@twreporter/react-components 8.21.0-rc.2 → 8.21.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/lib/badge/badge.stories.js +7 -13
- package/lib/bookmark-list/stories/bookmark.stories.js +10 -9
- package/lib/button/stories/iconButton.stories.js +19 -22
- package/lib/button/stories/iconWithTextButton.stories.js +21 -24
- package/lib/button/stories/link.stories.js +65 -67
- package/lib/button/stories/menuButton.stories.js +11 -16
- package/lib/button/stories/pillButton.stories.js +38 -41
- package/lib/button/stories/textButton.stories.js +48 -51
- package/lib/button/stories/toggleButton.stories.js +9 -15
- package/lib/card/stories/articleCard.stories.js +20 -18
- package/lib/card/stories/dialog.stories.js +15 -14
- package/lib/checkbox/checkbox.stories.js +10 -16
- package/lib/divider.stories.js +30 -28
- package/lib/empty-state/stories/empty-guide.stories.js +10 -15
- package/lib/icon/stories/arrow.stories.js +38 -42
- package/lib/icon/stories/article.stories.js +1 -9
- package/lib/icon/stories/bookmark.stories.js +30 -35
- package/lib/icon/stories/changeIconColor.stories.js +1 -5
- package/lib/icon/stories/clock.stories.js +1 -9
- package/lib/icon/stories/copy.stories.js +1 -9
- package/lib/icon/stories/cross.stories.js +1 -9
- package/lib/icon/stories/hamburger.stories.js +1 -9
- package/lib/icon/stories/home.stories.js +1 -9
- package/lib/icon/stories/letter.stories.js +1 -9
- package/lib/icon/stories/loading.stories.js +1 -9
- package/lib/icon/stories/member.stories.js +1 -9
- package/lib/icon/stories/printer.stories.js +1 -9
- package/lib/icon/stories/search.stories.js +1 -9
- package/lib/icon/stories/share.stories.js +1 -9
- package/lib/icon/stories/socialMedia.stories.js +1 -9
- package/lib/icon/stories/text.stories.js +1 -9
- package/lib/icon/stories/topic.stories.js +1 -9
- package/lib/input/stories/search-bar.stories.js +12 -17
- package/lib/input/stories/text-field.stories.js +15 -14
- package/lib/listing-page/stories/cardList.stories.js +52 -57
- package/lib/logo/stories/logoFooter.stories.js +1 -7
- package/lib/logo/stories/logoHeader.stories.js +5 -10
- package/lib/logo/stories/logoLoadingFallback.stories.js +1 -7
- package/lib/logo/stories/logoSymbol.stories.js +5 -10
- package/lib/mobile-member-role-card/index.js +95 -57
- package/lib/mobile-member-role-card/stories/member-role-card.stories.js +14 -13
- package/lib/simple-header/simpleHeader.stories.js +3 -9
- package/lib/snack-bar/stories/snackBar.stories.js +18 -20
- package/lib/text/stories/headline.stories.js +72 -74
- package/lib/text/stories/paragraph.stories.js +48 -50
- package/lib/title-bar/stories/bar.stories.js +15 -19
- package/lib/title-bar/stories/tab.stories.js +252 -256
- package/package.json +21 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.21.0-rc.4](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.21.0-rc.3...@twreporter/react-components@8.21.0-rc.4) (2023-11-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* upgrade storybook to v7 ([fa85736](https://github.com/twreporter/twreporter-npm-packages/commit/fa85736bd60eda26596bc89c5bccaf74892774f2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [8.21.0-rc.3](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.21.0-rc.2...@twreporter/react-components@8.21.0-rc.3) (2023-11-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* use Object.freeze and use en-US ([e4ff2a0](https://github.com/twreporter/twreporter-npm-packages/commit/e4ff2a0dda08003eb762d3009b6670b6c84cbcf1))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* new moblie member role card ([2e01669](https://github.com/twreporter/twreporter-npm-packages/commit/2e01669144c072d5bd89d88fe68b97d69e8b6e6f))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [8.21.0-rc.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@8.21.0-rc.1...@twreporter/react-components@8.21.0-rc.2) (2023-11-13)
|
|
7
34
|
|
|
8
35
|
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.badge = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _ = _interopRequireDefault(require("."));
|
|
11
9
|
|
|
12
10
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
@@ -18,15 +16,11 @@ var _default = {
|
|
|
18
16
|
component: _["default"]
|
|
19
17
|
};
|
|
20
18
|
exports["default"] = _default;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
var badge = {
|
|
20
|
+
args: {
|
|
21
|
+
text: '不定期',
|
|
22
|
+
textColor: _color.colorBrand.heavy,
|
|
23
|
+
backgroundColor: 'white'
|
|
24
|
+
}
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
-
var badge = Template.bind({});
|
|
27
|
-
exports.badge = badge;
|
|
28
|
-
badge.args = {
|
|
29
|
-
text: '不定期',
|
|
30
|
-
textColor: _color.colorBrand.heavy,
|
|
31
|
-
backgroundColor: 'white'
|
|
32
|
-
};
|
|
26
|
+
exports.badge = badge;
|
|
@@ -11,18 +11,19 @@ var _bookmarks = _interopRequireDefault(require("../bookmarks"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
14
|
+
/* eslint react/display-name:0 */
|
|
14
15
|
var _default = {
|
|
15
16
|
title: 'Bookmark/Empty List',
|
|
16
17
|
component: _bookmarks["default"]
|
|
17
18
|
};
|
|
18
19
|
exports["default"] = _default;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
var emptyList = {
|
|
21
|
+
render: function render() {
|
|
22
|
+
return /*#__PURE__*/_react["default"].createElement(_bookmarks["default"], null);
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
bookmarks: [],
|
|
26
|
+
total: 0
|
|
27
|
+
}
|
|
22
28
|
};
|
|
23
|
-
|
|
24
|
-
exports.emptyList = emptyList;
|
|
25
|
-
emptyList.args = {
|
|
26
|
-
bookmarks: [],
|
|
27
|
-
total: 0
|
|
28
|
-
};
|
|
29
|
+
exports.emptyList = emptyList;
|
|
@@ -28,28 +28,25 @@ var _default = {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
exports["default"] = _default;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
var iconButton = {
|
|
32
|
+
args: {
|
|
33
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
34
|
+
direction: "down"
|
|
35
|
+
}),
|
|
36
|
+
theme: _iconButton["default"].THEME.normal,
|
|
37
|
+
type: _iconButton["default"].Type.PRIMARY,
|
|
38
|
+
disabled: false,
|
|
39
|
+
active: false
|
|
40
|
+
}
|
|
34
41
|
};
|
|
35
|
-
|
|
36
|
-
var iconButton = Template.bind({});
|
|
37
42
|
exports.iconButton = iconButton;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
var shareButton = {
|
|
44
|
+
args: {
|
|
45
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
46
|
+
theme: _iconButton["default"].THEME.normal,
|
|
47
|
+
type: _iconButton["default"].Type.PRIMARY,
|
|
48
|
+
disabled: false,
|
|
49
|
+
active: false
|
|
50
|
+
}
|
|
46
51
|
};
|
|
47
|
-
|
|
48
|
-
exports.shareButton = shareButton;
|
|
49
|
-
shareButton.args = {
|
|
50
|
-
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
51
|
-
theme: _iconButton["default"].THEME.normal,
|
|
52
|
-
type: _iconButton["default"].Type.PRIMARY,
|
|
53
|
-
disabled: false,
|
|
54
|
-
active: false
|
|
55
|
-
};
|
|
52
|
+
exports.shareButton = shareButton;
|
|
@@ -23,30 +23,27 @@ var _default = {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
exports["default"] = _default;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
var iconWithTextButton = {
|
|
27
|
+
args: {
|
|
28
|
+
text: '文字',
|
|
29
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
30
|
+
direction: "down"
|
|
31
|
+
}),
|
|
32
|
+
theme: _iconWithTextButton["default"].THEME.normal,
|
|
33
|
+
disabled: false,
|
|
34
|
+
active: false,
|
|
35
|
+
hideText: false
|
|
36
|
+
}
|
|
29
37
|
};
|
|
30
|
-
|
|
31
|
-
var iconWithTextButton = Template.bind({});
|
|
32
38
|
exports.iconWithTextButton = iconWithTextButton;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
var shareButton = {
|
|
40
|
+
args: {
|
|
41
|
+
text: '分享',
|
|
42
|
+
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
43
|
+
theme: _iconWithTextButton["default"].THEME.normal,
|
|
44
|
+
disabled: false,
|
|
45
|
+
active: false,
|
|
46
|
+
hideText: false
|
|
47
|
+
}
|
|
42
48
|
};
|
|
43
|
-
|
|
44
|
-
exports.shareButton = shareButton;
|
|
45
|
-
shareButton.args = {
|
|
46
|
-
text: '分享',
|
|
47
|
-
iconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Share, null),
|
|
48
|
-
theme: _iconWithTextButton["default"].THEME.normal,
|
|
49
|
-
disabled: false,
|
|
50
|
-
active: false,
|
|
51
|
-
hideText: false
|
|
52
|
-
};
|
|
49
|
+
exports.shareButton = shareButton;
|
|
@@ -25,6 +25,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
27
|
|
|
28
|
+
/* eslint react/display-name:0 */
|
|
28
29
|
var _default = {
|
|
29
30
|
title: 'Button/Link',
|
|
30
31
|
component: _link["default"],
|
|
@@ -55,86 +56,83 @@ var _default = {
|
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
exports["default"] = _default;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
link.parameters = {
|
|
73
|
-
controls: {
|
|
74
|
-
exclude: ['textComponent', 'leftWord', 'rightWord']
|
|
59
|
+
var link = {
|
|
60
|
+
args: {
|
|
61
|
+
text: '文字',
|
|
62
|
+
type: _link["default"].Type.DEFAULT,
|
|
63
|
+
link: {
|
|
64
|
+
to: 'https://www.twreporter.org'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
parameters: {
|
|
68
|
+
controls: {
|
|
69
|
+
exclude: ['textComponent', 'leftWord', 'rightWord']
|
|
70
|
+
}
|
|
75
71
|
}
|
|
76
72
|
};
|
|
73
|
+
exports.link = link;
|
|
74
|
+
var changeTextComponent = {
|
|
75
|
+
render: function render(args) {
|
|
76
|
+
if (args.textComponent === 'P2') {
|
|
77
|
+
args.TextComponent = _paragraph.P2;
|
|
78
|
+
}
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
80
|
+
if (args.textComponent === 'H4') {
|
|
81
|
+
args.TextComponent = _headline.H4;
|
|
82
|
+
}
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
return /*#__PURE__*/_react["default"].createElement(_link["default"], args);
|
|
85
|
+
},
|
|
86
|
+
args: {
|
|
87
|
+
text: '文字',
|
|
88
|
+
type: _link["default"].Type.DEFAULT,
|
|
89
|
+
textComponent: 'P2',
|
|
90
|
+
link: {
|
|
91
|
+
to: 'https://www.twreporter.org'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
parameters: {
|
|
95
|
+
controls: {
|
|
96
|
+
exclude: ['TextComponent', 'leftWord', 'rightWord']
|
|
97
|
+
}
|
|
85
98
|
}
|
|
86
|
-
|
|
87
|
-
return /*#__PURE__*/_react["default"].createElement(_link["default"], args);
|
|
88
99
|
};
|
|
89
|
-
|
|
90
100
|
exports.changeTextComponent = changeTextComponent;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
changeTextComponent.parameters = {
|
|
100
|
-
controls: {
|
|
101
|
-
exclude: ['TextComponent', 'leftWord', 'rightWord']
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
var disabledLink = Template.bind({});
|
|
105
|
-
exports.disabledLink = disabledLink;
|
|
106
|
-
disabledLink.args = {
|
|
107
|
-
text: '文字',
|
|
108
|
-
type: _link["default"].Type.DEFAULT,
|
|
109
|
-
link: {
|
|
110
|
-
to: 'https://www.twreporter.org'
|
|
101
|
+
var disabledLink = {
|
|
102
|
+
args: {
|
|
103
|
+
text: '文字',
|
|
104
|
+
type: _link["default"].Type.DEFAULT,
|
|
105
|
+
link: {
|
|
106
|
+
to: 'https://www.twreporter.org'
|
|
107
|
+
},
|
|
108
|
+
disabled: true
|
|
111
109
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
exclude: ['textComponent', 'disabled', 'leftWord', 'rightWord']
|
|
110
|
+
parameters: {
|
|
111
|
+
controls: {
|
|
112
|
+
exclude: ['textComponent', 'disabled', 'leftWord', 'rightWord']
|
|
113
|
+
}
|
|
117
114
|
}
|
|
118
115
|
};
|
|
116
|
+
exports.disabledLink = disabledLink;
|
|
119
117
|
var StyledP1 = /*#__PURE__*/(0, _styledComponents["default"])(_paragraph.P1).withConfig({
|
|
120
118
|
displayName: "linkstories__StyledP1",
|
|
121
119
|
componentId: "sc-1i9kyc3-0"
|
|
122
120
|
})(["display:unset;"]);
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
var linkInParagraph = {
|
|
122
|
+
render: function render(args) {
|
|
123
|
+
return /*#__PURE__*/_react["default"].createElement(StyledP1, null, args.leftWord, /*#__PURE__*/_react["default"].createElement(_link.InheritLinkButton, args), args.rightWord);
|
|
124
|
+
},
|
|
125
|
+
args: {
|
|
126
|
+
text: '文字',
|
|
127
|
+
type: _link["default"].Type.DEFAULT,
|
|
128
|
+
link: {
|
|
129
|
+
to: 'https://www.twreporter.org'
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
parameters: {
|
|
133
|
+
controls: {
|
|
134
|
+
exclude: ['textComponent', 'disabled', 'weight', 'TextComponent']
|
|
135
|
+
}
|
|
134
136
|
}
|
|
135
137
|
};
|
|
136
|
-
linkInParagraph
|
|
137
|
-
controls: {
|
|
138
|
-
exclude: ['textComponent', 'disabled', 'weight', 'TextComponent']
|
|
139
|
-
}
|
|
140
|
-
};
|
|
138
|
+
exports.linkInParagraph = linkInParagraph;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.menuButton = exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _menuButton = _interopRequireDefault(require("../components/menuButton"));
|
|
11
9
|
|
|
12
10
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
@@ -23,18 +21,15 @@ var _default = {
|
|
|
23
21
|
}
|
|
24
22
|
};
|
|
25
23
|
exports["default"] = _default;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
var menuButton = {
|
|
25
|
+
args: {
|
|
26
|
+
text: '文字',
|
|
27
|
+
link: {},
|
|
28
|
+
color: _color.colorGrayscale.gray800,
|
|
29
|
+
hoverBgColor: _color.colorGrayscale.gray100,
|
|
30
|
+
activeBgColor: _color.colorGrayscale.gray200,
|
|
31
|
+
paddingLeft: 32,
|
|
32
|
+
paddingRight: 32
|
|
33
|
+
}
|
|
29
34
|
};
|
|
30
|
-
|
|
31
|
-
exports.menuButton = menuButton;
|
|
32
|
-
menuButton.args = {
|
|
33
|
-
text: '文字',
|
|
34
|
-
link: {},
|
|
35
|
-
color: _color.colorGrayscale.gray800,
|
|
36
|
-
hoverBgColor: _color.colorGrayscale.gray100,
|
|
37
|
-
activeBgColor: _color.colorGrayscale.gray200,
|
|
38
|
-
paddingLeft: 32,
|
|
39
|
-
paddingRight: 32
|
|
40
|
-
};
|
|
35
|
+
exports.menuButton = menuButton;
|
|
@@ -19,6 +19,7 @@ var _constants = require("../../storybook/constants");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
|
+
/* eslint react/display-name:0 */
|
|
22
23
|
var _default = {
|
|
23
24
|
title: 'Button/Pill Button',
|
|
24
25
|
component: _pillButton["default"],
|
|
@@ -43,48 +44,44 @@ var _default = {
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
exports["default"] = _default;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var pillButton = {
|
|
48
|
+
args: {
|
|
49
|
+
text: '文字',
|
|
50
|
+
size: _pillButton["default"].Size.S,
|
|
51
|
+
theme: _pillButton["default"].THEME.normal,
|
|
52
|
+
style: _pillButton["default"].Style.BRAND,
|
|
53
|
+
type: _pillButton["default"].Type.PRIMARY,
|
|
54
|
+
disabled: false,
|
|
55
|
+
loading: false
|
|
56
|
+
},
|
|
57
|
+
parameters: {
|
|
58
|
+
controls: {
|
|
59
|
+
exclude: ['showLeft', 'showRight']
|
|
60
|
+
}
|
|
61
|
+
}
|
|
49
62
|
};
|
|
50
|
-
|
|
51
|
-
var pillButton = Template.bind({});
|
|
52
63
|
exports.pillButton = pillButton;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
var toggleIconDisplay = {
|
|
65
|
+
render: function render(args) {
|
|
66
|
+
args.leftIconComponent = args.showLeft ? /*#__PURE__*/_react["default"].createElement(_icon.Cross, null) : null;
|
|
67
|
+
args.rightIconComponent = args.showRight ? /*#__PURE__*/_react["default"].createElement(_icon.Cross, null) : null;
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(_pillButton["default"], args);
|
|
69
|
+
},
|
|
70
|
+
args: {
|
|
71
|
+
showLeft: true,
|
|
72
|
+
showRight: true,
|
|
73
|
+
text: '文字',
|
|
74
|
+
size: _pillButton["default"].Size.S,
|
|
75
|
+
theme: _pillButton["default"].THEME.normal,
|
|
76
|
+
style: _pillButton["default"].Style.BRAND,
|
|
77
|
+
type: _pillButton["default"].Type.PRIMARY,
|
|
78
|
+
disabled: false,
|
|
79
|
+
loading: false
|
|
80
|
+
},
|
|
81
|
+
parameters: {
|
|
82
|
+
controls: {
|
|
83
|
+
exclude: ['leftIconComponent', 'rightIconComponent']
|
|
84
|
+
}
|
|
65
85
|
}
|
|
66
86
|
};
|
|
67
|
-
|
|
68
|
-
var toggleIconDisplay = function toggleIconDisplay(args) {
|
|
69
|
-
args.leftIconComponent = args.showLeft ? /*#__PURE__*/_react["default"].createElement(_icon.Cross, null) : null;
|
|
70
|
-
args.rightIconComponent = args.showRight ? /*#__PURE__*/_react["default"].createElement(_icon.Cross, null) : null;
|
|
71
|
-
return /*#__PURE__*/_react["default"].createElement(_pillButton["default"], args);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
exports.toggleIconDisplay = toggleIconDisplay;
|
|
75
|
-
toggleIconDisplay.args = {
|
|
76
|
-
showLeft: true,
|
|
77
|
-
showRight: true,
|
|
78
|
-
text: '文字',
|
|
79
|
-
size: _pillButton["default"].Size.S,
|
|
80
|
-
theme: _pillButton["default"].THEME.normal,
|
|
81
|
-
style: _pillButton["default"].Style.BRAND,
|
|
82
|
-
type: _pillButton["default"].Type.PRIMARY,
|
|
83
|
-
disabled: false,
|
|
84
|
-
loading: false
|
|
85
|
-
};
|
|
86
|
-
toggleIconDisplay.parameters = {
|
|
87
|
-
controls: {
|
|
88
|
-
exclude: ['leftIconComponent', 'rightIconComponent']
|
|
89
|
-
}
|
|
90
|
-
};
|
|
87
|
+
exports.toggleIconDisplay = toggleIconDisplay;
|
|
@@ -19,6 +19,7 @@ var _constants = require("../../storybook/constants");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
|
+
/* eslint react/display-name:0 */
|
|
22
23
|
var _default = {
|
|
23
24
|
title: 'Button/Text Button',
|
|
24
25
|
component: _textButton["default"],
|
|
@@ -43,58 +44,54 @@ var _default = {
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
exports["default"] = _default;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var textButton = {
|
|
48
|
+
args: {
|
|
49
|
+
text: '文字',
|
|
50
|
+
size: _textButton["default"].Size.S,
|
|
51
|
+
theme: _textButton["default"].THEME.normal,
|
|
52
|
+
type: _textButton["default"].Type.PRIMARY,
|
|
53
|
+
style: _textButton["default"].Style.DARK,
|
|
54
|
+
active: false,
|
|
55
|
+
disabled: false,
|
|
56
|
+
leftIconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
57
|
+
direction: "left"
|
|
58
|
+
}),
|
|
59
|
+
rightIconComponent: /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
60
|
+
direction: "right"
|
|
61
|
+
})
|
|
62
|
+
},
|
|
63
|
+
parameters: {
|
|
64
|
+
controls: {
|
|
65
|
+
exclude: ['showLeft', 'showRight']
|
|
66
|
+
}
|
|
67
|
+
}
|
|
49
68
|
};
|
|
50
|
-
|
|
51
|
-
var textButton = Template.bind({});
|
|
52
69
|
exports.textButton = textButton;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
var toggleIconDisplay = {
|
|
71
|
+
render: function render(args) {
|
|
72
|
+
args.leftIconComponent = args.showLeft ? /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
73
|
+
direction: "left"
|
|
74
|
+
}) : null;
|
|
75
|
+
args.rightIconComponent = args.showRight ? /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
76
|
+
direction: "right"
|
|
77
|
+
}) : null;
|
|
78
|
+
return /*#__PURE__*/_react["default"].createElement(_textButton["default"], args);
|
|
79
|
+
},
|
|
80
|
+
args: {
|
|
81
|
+
showLeft: true,
|
|
82
|
+
showRight: true,
|
|
83
|
+
text: '文字',
|
|
84
|
+
size: _textButton["default"].Size.S,
|
|
85
|
+
theme: _textButton["default"].THEME.normal,
|
|
86
|
+
type: _textButton["default"].Type.PRIMARY,
|
|
87
|
+
style: _textButton["default"].Style.DARK,
|
|
88
|
+
active: false,
|
|
89
|
+
disabled: false
|
|
90
|
+
},
|
|
91
|
+
parameters: {
|
|
92
|
+
controls: {
|
|
93
|
+
exclude: ['leftIconComponent', 'rightIconComponent']
|
|
94
|
+
}
|
|
71
95
|
}
|
|
72
96
|
};
|
|
73
|
-
|
|
74
|
-
var toggleIconDisplay = function toggleIconDisplay(args) {
|
|
75
|
-
args.leftIconComponent = args.showLeft ? /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
76
|
-
direction: "left"
|
|
77
|
-
}) : null;
|
|
78
|
-
args.rightIconComponent = args.showRight ? /*#__PURE__*/_react["default"].createElement(_icon.Arrow, {
|
|
79
|
-
direction: "right"
|
|
80
|
-
}) : null;
|
|
81
|
-
return /*#__PURE__*/_react["default"].createElement(_textButton["default"], args);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
exports.toggleIconDisplay = toggleIconDisplay;
|
|
85
|
-
toggleIconDisplay.args = {
|
|
86
|
-
showLeft: true,
|
|
87
|
-
showRight: true,
|
|
88
|
-
text: '文字',
|
|
89
|
-
size: _textButton["default"].Size.S,
|
|
90
|
-
theme: _textButton["default"].THEME.normal,
|
|
91
|
-
type: _textButton["default"].Type.PRIMARY,
|
|
92
|
-
style: _textButton["default"].Style.DARK,
|
|
93
|
-
active: false,
|
|
94
|
-
disabled: false
|
|
95
|
-
};
|
|
96
|
-
toggleIconDisplay.parameters = {
|
|
97
|
-
controls: {
|
|
98
|
-
exclude: ['leftIconComponent', 'rightIconComponent']
|
|
99
|
-
}
|
|
100
|
-
};
|
|
97
|
+
exports.toggleIconDisplay = toggleIconDisplay;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.toggleButton = exports["default"] = void 0;
|
|
7
7
|
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _toggleButton = _interopRequireDefault(require("../components/toggleButton"));
|
|
11
9
|
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -22,17 +20,13 @@ var _default = {
|
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
22
|
exports["default"] = _default;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
var toggleButton = {
|
|
24
|
+
args: {
|
|
25
|
+
value: false,
|
|
26
|
+
labelOn: '已訂閱',
|
|
27
|
+
labelOff: '未訂閱',
|
|
28
|
+
disabled: false,
|
|
29
|
+
onChange: function onChange() {}
|
|
30
|
+
}
|
|
28
31
|
};
|
|
29
|
-
|
|
30
|
-
var toggleButton = Template.bind({});
|
|
31
|
-
exports.toggleButton = toggleButton;
|
|
32
|
-
toggleButton.args = {
|
|
33
|
-
value: false,
|
|
34
|
-
labelOn: '已訂閱',
|
|
35
|
-
labelOff: '未訂閱',
|
|
36
|
-
disabled: false,
|
|
37
|
-
onChange: function onChange() {}
|
|
38
|
-
};
|
|
32
|
+
exports.toggleButton = toggleButton;
|