diff --git a/.yarnrc b/.yarnrc index 5acad03ee6..43d76296bc 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,2 +1,2 @@ version-git-tag false -version-commit-hooks false +version-commit-hooks false \ No newline at end of file diff --git a/package.json b/package.json index 7292404b59..d6b1ef251b 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "watch": "gio-rewire lib compile --watch" }, "peerDependencies": { + "@gio-design/tokens": ">=21.4.2", "@gio-design/icons": ">=21.4.0", - "@gio-design/tokens": ">=21.4.1", "react": ">=16.8.0", "react-dom": ">=16.8.0" }, @@ -74,8 +74,8 @@ "@babel/preset-typescript": "^7.12.7", "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^12.0.1", + "@gio-design/tokens": "^21.4.2", "@gio-design/icons": "^21.4.0", - "@gio-design/tokens": "^21.4.1", "@storybook/addon-actions": "^6.2.3", "@storybook/addon-controls": "^6.2.3", "@storybook/addon-docs": "^6.2.3", diff --git a/src/components/button/Button.mdx b/src/components/button/Button.mdx index 733eec9836..85c0634f91 100644 --- a/src/components/button/Button.mdx +++ b/src/components/button/Button.mdx @@ -15,9 +15,9 @@ import Button from '.'; > 用于与主按钮配对,以明确有两个选项;或者用于多个无主次之分的操作时。 -辅助按钮 assist +链接按钮 link -> 当页面有许多高频率使用的操作时,将其用作默认按钮。如:看板页面。 +> 适用于列表内添加多个内容时,如「事件分析」中「添加事件」、「fliter」中「添加过滤条件」等。 文本按钮 text diff --git a/src/components/button/Button.stories.tsx b/src/components/button/Button.stories.tsx index 299abc21f0..321adb3c73 100644 --- a/src/components/button/Button.stories.tsx +++ b/src/components/button/Button.stories.tsx @@ -63,6 +63,8 @@ export const Default = Template.bind({}); export const IconButton = IconTemplate.bind({}); export const TextButton = Template.bind({}); export const BlockButton = Template.bind({}); + + Default.args = { style: { margin: '0 20px 0 0', diff --git a/src/components/button/__tests__/__snapshots__/button.test.js.snap b/src/components/button/__tests__/__snapshots__/button.test.js.snap index 3b6613c4da..197d829993 100644 --- a/src/components/button/__tests__/__snapshots__/button.test.js.snap +++ b/src/components/button/__tests__/__snapshots__/button.test.js.snap @@ -4761,7 +4761,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -4769,7 +4769,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, @@ -4790,7 +4790,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -4798,7 +4798,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -5002,7 +5002,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -5010,7 +5010,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, @@ -5031,7 +5031,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -5039,7 +5039,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -5242,7 +5242,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -5250,7 +5250,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, @@ -5271,7 +5271,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -5279,7 +5279,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -5504,7 +5504,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -5512,7 +5512,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, @@ -5533,7 +5533,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -5541,7 +5541,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -5745,7 +5745,7 @@ initialize { }, Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -5753,7 +5753,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, @@ -5774,7 +5774,7 @@ initialize { "namespace": "http://www.w3.org/1999/xhtml", "next": Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -5782,7 +5782,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -6015,7 +6015,7 @@ initialize { }, Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -6023,7 +6023,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -6087,7 +6087,7 @@ initialize { "parent": [Circular], "prev": Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -6095,7 +6095,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, @@ -6316,7 +6316,7 @@ initialize { "parent": [Circular], "prev": Object { "attribs": Object { - "class": "gio-btn gio-btn-text gio-btn-small gio-btn-background-ghost", + "class": "gio-btn gio-btn-link gio-btn-small gio-btn-background-ghost", "type": "button", }, "children": Array [ @@ -6324,7 +6324,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "深色背景", + "data": "链接按钮", "next": null, "parent": [Circular], "prev": null, @@ -6347,7 +6347,7 @@ initialize { "parent": [Circular], "prev": Object { "attribs": Object { - "class": "gio-btn gio-btn-assist gio-btn-middle", + "class": "gio-btn gio-btn-text gio-btn-middle", "type": "button", }, "children": Array [ @@ -6355,7 +6355,7 @@ initialize { "attribs": Object {}, "children": Array [ Object { - "data": "辅助按钮", + "data": "文本按钮", "next": null, "parent": [Circular], "prev": null, diff --git a/src/components/button/__tests__/button.test.js b/src/components/button/__tests__/button.test.js index e3702b1f95..814b2a08a1 100644 --- a/src/components/button/__tests__/button.test.js +++ b/src/components/button/__tests__/button.test.js @@ -54,11 +54,11 @@ describe('Testing button', () => { - -
-
-
-
-
- +
-
-
-
-
-
-
-
-
-
diff --git a/website/src/components/basic/button/demos/icon.tsx b/website/src/components/basic/button/demos/icon.tsx index ed6b9bbe4b..3467a60045 100644 --- a/website/src/components/basic/button/demos/icon.tsx +++ b/website/src/components/basic/button/demos/icon.tsx @@ -24,20 +24,20 @@ export default () => {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/website/src/components/basic/button/index.zh-CN.md b/website/src/components/basic/button/index.zh-CN.md index bdb7b3c3bc..3e6bbcdc67 100644 --- a/website/src/components/basic/button/index.zh-CN.md +++ b/website/src/components/basic/button/index.zh-CN.md @@ -19,9 +19,9 @@ group: - + - + @@ -31,7 +31,7 @@ group: | 参数 | 说明 | 类型 | 默认值 | | ------- | --------------------------------------------------------------------- | ------------------------------ | ------ | -| type | 设置按钮类型,可选值为 `primary` `secondary` `assist` `text` 或者不设 | string | - | +| type | 设置按钮类型,可选值为 `primary` `secondary` `link` `text` 或者不设 | string | - | | icon | 设置按钮的图标组件 | ReactNode | - | | size | 设置按钮大小 | `large` \| `middle` \| `small` | - | | loading | 设置按钮载入状态 | boolean | false | diff --git a/website/src/components/functional/dropdown/demo/filter.tsx b/website/src/components/functional/dropdown/demo/filter.tsx index b5a15304b3..d9f05c1892 100644 --- a/website/src/components/functional/dropdown/demo/filter.tsx +++ b/website/src/components/functional/dropdown/demo/filter.tsx @@ -62,7 +62,7 @@ export default () => {
} > - ) : ( diff --git a/website/src/components/functional/table/demo/interaction/hover.tsx b/website/src/components/functional/table/demo/interaction/hover.tsx index ce071d2b67..e26a06004a 100644 --- a/website/src/components/functional/table/demo/interaction/hover.tsx +++ b/website/src/components/functional/table/demo/interaction/hover.tsx @@ -42,7 +42,7 @@ export default () => { title: '操作', key: 'operate', align: 'center', - render: () =>