@madie/madie-design-system 1.2.62 → 2.0.0
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/.eslintrc.js +1 -1
- package/.storybook/.babelrc +2 -1
- package/.storybook/main.js +3 -11
- package/components/AutoComplete/AutoComplete.jsx +1 -1
- package/components/Button/Button.stories.js +0 -2
- package/components/DateField/DateField.jsx +1 -1
- package/components/DateField/DateField.stories.jsx +23 -10
- package/components/DateTimeField/DateTimeField.jsx +6 -2
- package/components/DateTimeField/DateTimeField.stories.jsx +29 -19
- package/components/Instant/Instant.stories.js +14 -6
- package/components/MadieAlert/MadieAlert.stories.js +35 -29
- package/components/MadieAlert/index.jsx +5 -5
- package/components/MadieConfirmDialog/MadieConfirmDialog.stories.js +17 -27
- package/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +9 -18
- package/components/MadieDialog/MadieDialog.stories.js +45 -116
- package/components/MadieDialog/index.jsx +4 -2
- package/components/MadieDiscardDialog/MadieDiscardDialog.stories.js +5 -7
- package/components/MadieSpinner/MadieSpinner.stories.js +1 -3
- package/components/MadieTooltip/MadieTooltip.stories.js +7 -2
- package/components/Modal/Modal.stories.js +18 -89
- package/components/NotificationBanner/NotificationBanner.stories.js +17 -11
- package/components/NotificationBanner/index.js +3 -3
- package/components/NumberInput/NumberInput.stories.js +51 -63
- package/components/Popover/Popover.stories.js +6 -14
- package/components/Popover/index.js +2 -2
- package/components/RadioButton/RadioButton.jsx +4 -2
- package/components/RadioButton/RadioButton.stories.jsx +6 -2
- package/components/ReadOnlyTextField/ReadOnlyTextField.stories.js +4 -3
- package/components/ReadOnlyTextField/index.jsx +1 -1
- package/components/RichTextEditor/RichTextEditor.stories.js +10 -8
- package/components/RichTextEditor/index.jsx +14 -15
- package/components/Search/Search.stories.js +2 -4
- package/components/Select/Select.stories.js +59 -160
- package/components/Select/index.jsx +1 -1
- package/components/Tabs/Tabs.stories.js +78 -210
- package/components/TextArea/TextArea.stories.js +88 -108
- package/components/TextArea/index.jsx +1 -1
- package/components/TextField/TextField.stories.js +101 -124
- package/components/TextField/index.jsx +1 -1
- package/components/TimeField/TimeField.stories.js +18 -8
- package/components/Toast/Toast.stories.js +42 -102
- package/components/TruncateText/TruncateText.stories.js +22 -17
- package/components/hooks/useGetConfig.js +2 -2
- package/components/index.js +0 -24
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +182 -51
- package/dist/react/index.js.LICENSE.txt +27 -24
- package/dist/react/index.js.map +1 -1
- package/eslint.config.js +56 -0
- package/index.js +7 -9
- package/package.json +43 -75
- package/test/components/Accordion.test.js +1 -1
- package/test/components/AutoComplete.test.js +11 -6
- package/test/components/Button.test.js +7 -3
- package/test/components/DateField.test.js +25 -29
- package/test/components/DateTimeField.test.js +21 -25
- package/test/components/Instant.test.js +1 -1
- package/test/components/MadieAlert.test.js +22 -22
- package/test/components/MadieConfirmDialog.test.js +42 -64
- package/test/components/MadieDeleteDialog.test.js +51 -69
- package/test/components/MadieDialog.test.js +13 -13
- package/test/components/MadieDiscardDialog.test.js +28 -45
- package/test/components/MadieSpinner.test.js +12 -17
- package/test/components/Modal.test.js +115 -0
- package/test/components/Pagination.test.js +2 -2
- package/test/components/RadioButton.test.js +7 -7
- package/test/components/ReadOnlyTextField.test.js +4 -2
- package/test/components/RichTextEditor.test.js +90 -6
- package/test/components/Search.test.js +75 -0
- package/test/components/Select.test.js +97 -107
- package/test/components/Tabs.test.js +22 -24
- package/test/components/TextArea.test.js +78 -92
- package/test/components/TextField.test.js +128 -147
- package/test/components/Toast.test.js +67 -78
- package/test/components/TruncateText.test.js +75 -0
- package/test/components/index.test.js +23 -0
- package/webpack.config.js +0 -1
- package/.eslintignore +0 -5
- package/components/Alert/Alert.stories.js +0 -70
- package/components/Alert/index.js +0 -55
- package/components/Breadcrumb/Breadcrumb.md +0 -28
- package/components/Breadcrumb/Breadcrumb.stories.js +0 -76
- package/components/Breadcrumb/index.js +0 -92
- package/components/CalloutBox/CalloutBox.stories.js +0 -94
- package/components/CalloutBox/index.js +0 -109
- package/components/Card/Card.stories.js +0 -163
- package/components/Card/index.js +0 -144
- package/components/Dropdown/Dropdown.stories.js +0 -94
- package/components/Dropdown/index.js +0 -85
- package/components/Error/Collapsible.jsx +0 -93
- package/components/Error/ErrorUI.jsx +0 -31
- package/components/Error/error.js +0 -26
- package/components/FlashNotification/FlashNotificationUI.jsx +0 -91
- package/components/FlashNotification/index.js +0 -30
- package/components/Footer/Footer.stories.js +0 -20
- package/components/Footer/FooterUI.jsx +0 -137
- package/components/Footer/LegacyFooterUI.jsx +0 -204
- package/components/Footer/SocialLinks.jsx +0 -63
- package/components/Footer/Subscribe.jsx +0 -34
- package/components/Footer/footer.js +0 -30
- package/components/Infotip/Infotip.jsx +0 -75
- package/components/Infotip/Infotip.stories.js +0 -52
- package/components/Infotip/InfotipIcon.jsx +0 -41
- package/components/Infotip/index.js +0 -3
- package/components/Link/Link.stories.js +0 -82
- package/components/Link/index.js +0 -61
- package/components/Spinner/index.js +0 -9
- package/components/TextInput/TextInput.stories.js +0 -118
- package/components/TextInput/index.js +0 -137
- package/components/Tooltip/Tooltip.jsx +0 -88
- package/components/Tooltip/Tooltip.stories.js +0 -80
- package/components/Tooltip/index.js +0 -3
- package/components/Tooltip/position.js +0 -76
- package/test/components/ErrorUI.test.js +0 -32
- package/test/components/FooterUI.test.js +0 -122
- package/test/components/Infotip.test.js +0 -76
- package/test/components/Tooltip.test.js +0 -147
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import { withKnobs } from "@storybook/addon-knobs";
|
|
4
3
|
import Select from "./index";
|
|
5
4
|
import { MenuItem, Box } from "@mui/material";
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
7
|
title: "Select",
|
|
9
8
|
component: Select,
|
|
10
|
-
|
|
9
|
+
argTypes: {
|
|
10
|
+
defaultValue: { control: "text" },
|
|
11
|
+
placeHolder: { control: "object" },
|
|
12
|
+
label: { control: "text" },
|
|
13
|
+
id: { control: "text" },
|
|
14
|
+
size: {
|
|
15
|
+
control: { type: "select", options: ["small", "medium", "large"] },
|
|
16
|
+
},
|
|
17
|
+
disabled: { control: "boolean" },
|
|
18
|
+
required: { control: "boolean" },
|
|
19
|
+
error: { control: "boolean" },
|
|
20
|
+
helperText: { control: "text" },
|
|
21
|
+
},
|
|
11
22
|
};
|
|
12
23
|
|
|
13
24
|
const Wrapper = ({ children }) => (
|
|
@@ -19,7 +30,6 @@ const Wrapper = ({ children }) => (
|
|
|
19
30
|
</div>
|
|
20
31
|
);
|
|
21
32
|
Wrapper.propTypes = {
|
|
22
|
-
className: PropTypes.string,
|
|
23
33
|
children: PropTypes.node,
|
|
24
34
|
};
|
|
25
35
|
|
|
@@ -28,135 +38,56 @@ const options = [
|
|
|
28
38
|
{ key: "key2", value: "value2", testId: "testid2", name: "name2" },
|
|
29
39
|
{ key: "key3", value: "value2", testId: "testid3", name: "name3" },
|
|
30
40
|
];
|
|
31
|
-
export const SelectWithLabel = () => (
|
|
32
|
-
<Wrapper>
|
|
33
|
-
<Select
|
|
34
|
-
defaultValue=""
|
|
35
|
-
placeHolder={{ name: "placeholder", value: "" }}
|
|
36
|
-
label="Text Label"
|
|
37
|
-
id="measureName"
|
|
38
|
-
inputProps={{ "data-testid": "measure-name-input" }}
|
|
39
|
-
data-testid="measure-name-text-field"
|
|
40
|
-
size="small"
|
|
41
|
-
options={options.map(({ key, value, testId, name }) => {
|
|
42
|
-
return (
|
|
43
|
-
<MenuItem
|
|
44
|
-
key={key}
|
|
45
|
-
value={value}
|
|
46
|
-
data-testid={`option-${testId}`}
|
|
47
|
-
>
|
|
48
|
-
{name}
|
|
49
|
-
</MenuItem>
|
|
50
|
-
);
|
|
51
|
-
})}
|
|
52
|
-
/>
|
|
53
|
-
</Wrapper>
|
|
54
|
-
);
|
|
55
41
|
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
label="Text Label"
|
|
62
|
-
id="measureName"
|
|
63
|
-
inputProps={{ "data-testid": "measure-name-input" }}
|
|
64
|
-
data-testid="measure-name-text-field"
|
|
65
|
-
size="small"
|
|
66
|
-
helperText="A descriptive message"
|
|
67
|
-
options={options.map(({ key, value, testId, name }) => {
|
|
68
|
-
return (
|
|
69
|
-
<MenuItem
|
|
70
|
-
key={key}
|
|
71
|
-
value={value}
|
|
72
|
-
data-testid={`option-${testId}`}
|
|
73
|
-
>
|
|
74
|
-
{name}
|
|
75
|
-
</MenuItem>
|
|
76
|
-
);
|
|
77
|
-
})}
|
|
78
|
-
/>
|
|
79
|
-
</Wrapper>
|
|
80
|
-
);
|
|
42
|
+
const renderedOptions = options.map(({ key, value, testId, name }) => (
|
|
43
|
+
<MenuItem key={key} value={value} data-testid={`option-${testId}`}>
|
|
44
|
+
{name}
|
|
45
|
+
</MenuItem>
|
|
46
|
+
));
|
|
81
47
|
|
|
82
|
-
|
|
48
|
+
const Template = (args) => (
|
|
83
49
|
<Wrapper>
|
|
84
|
-
<Select
|
|
85
|
-
placeHolder={{ name: "placeholder", value: "" }}
|
|
86
|
-
defaultValue=""
|
|
87
|
-
label="Text Label"
|
|
88
|
-
id="measureName"
|
|
89
|
-
inputProps={{ "data-testid": "measure-name-input" }}
|
|
90
|
-
data-testid="measure-name-text-field"
|
|
91
|
-
size="small"
|
|
92
|
-
disabled
|
|
93
|
-
options={options.map(({ key, value, testId, name }) => {
|
|
94
|
-
return (
|
|
95
|
-
<MenuItem
|
|
96
|
-
key={key}
|
|
97
|
-
value={value}
|
|
98
|
-
data-testid={`option-${testId}`}
|
|
99
|
-
>
|
|
100
|
-
{name}
|
|
101
|
-
</MenuItem>
|
|
102
|
-
);
|
|
103
|
-
})}
|
|
104
|
-
/>
|
|
50
|
+
<Select {...args} options={renderedOptions} />
|
|
105
51
|
</Wrapper>
|
|
106
52
|
);
|
|
107
53
|
|
|
108
|
-
export const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<MenuItem
|
|
122
|
-
key={key}
|
|
123
|
-
value={value}
|
|
124
|
-
data-testid={`option-${testId}`}
|
|
125
|
-
>
|
|
126
|
-
{name}
|
|
127
|
-
</MenuItem>
|
|
128
|
-
);
|
|
129
|
-
})}
|
|
130
|
-
/>
|
|
131
|
-
</Wrapper>
|
|
132
|
-
);
|
|
54
|
+
export const SelectWithLabel = Template.bind({});
|
|
55
|
+
SelectWithLabel.args = {
|
|
56
|
+
defaultValue: "",
|
|
57
|
+
placeHolder: { name: "placeholder", value: "" },
|
|
58
|
+
label: "Text Label",
|
|
59
|
+
id: "measureName",
|
|
60
|
+
size: "small",
|
|
61
|
+
disabled: false,
|
|
62
|
+
required: false,
|
|
63
|
+
error: false,
|
|
64
|
+
helperText: "",
|
|
65
|
+
};
|
|
133
66
|
|
|
134
|
-
export const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
</Wrapper>
|
|
159
|
-
);
|
|
67
|
+
export const WithHelperText = Template.bind({});
|
|
68
|
+
WithHelperText.args = {
|
|
69
|
+
...SelectWithLabel.args,
|
|
70
|
+
helperText: "A descriptive message",
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Disabled = Template.bind({});
|
|
74
|
+
Disabled.args = {
|
|
75
|
+
...SelectWithLabel.args,
|
|
76
|
+
disabled: true,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const Required = Template.bind({});
|
|
80
|
+
Required.args = {
|
|
81
|
+
...SelectWithLabel.args,
|
|
82
|
+
required: true,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Error = Template.bind({});
|
|
86
|
+
Error.args = {
|
|
87
|
+
...SelectWithLabel.args,
|
|
88
|
+
error: true,
|
|
89
|
+
helperText: "An error message An error message An error message",
|
|
90
|
+
};
|
|
160
91
|
|
|
161
92
|
export const VariedHeights = () => (
|
|
162
93
|
<div
|
|
@@ -174,20 +105,9 @@ export const VariedHeights = () => (
|
|
|
174
105
|
data-testid="measure-name-text-field"
|
|
175
106
|
size="small"
|
|
176
107
|
helperText="An error message"
|
|
177
|
-
options={
|
|
178
|
-
return (
|
|
179
|
-
<MenuItem
|
|
180
|
-
key={key}
|
|
181
|
-
value={value}
|
|
182
|
-
data-testid={`option-${testId}`}
|
|
183
|
-
>
|
|
184
|
-
{name}
|
|
185
|
-
</MenuItem>
|
|
186
|
-
);
|
|
187
|
-
})}
|
|
108
|
+
options={renderedOptions}
|
|
188
109
|
/>
|
|
189
110
|
<Select
|
|
190
|
-
// error
|
|
191
111
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
192
112
|
defaultValue=""
|
|
193
113
|
label="Text Label"
|
|
@@ -196,20 +116,9 @@ export const VariedHeights = () => (
|
|
|
196
116
|
data-testid="measure-name-text-field"
|
|
197
117
|
size="small"
|
|
198
118
|
helperText=""
|
|
199
|
-
options={
|
|
200
|
-
return (
|
|
201
|
-
<MenuItem
|
|
202
|
-
key={key}
|
|
203
|
-
value={value}
|
|
204
|
-
data-testid={`option-${testId}`}
|
|
205
|
-
>
|
|
206
|
-
{name}
|
|
207
|
-
</MenuItem>
|
|
208
|
-
);
|
|
209
|
-
})}
|
|
119
|
+
options={renderedOptions}
|
|
210
120
|
/>
|
|
211
121
|
<Select
|
|
212
|
-
// error
|
|
213
122
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
214
123
|
defaultValue=""
|
|
215
124
|
label="Text Label"
|
|
@@ -218,17 +127,7 @@ export const VariedHeights = () => (
|
|
|
218
127
|
data-testid="measure-name-text-field"
|
|
219
128
|
size="small"
|
|
220
129
|
helperText="An error message designed to take up a lot of space to see how we space multiple input elements within the same row in a responsive manner "
|
|
221
|
-
options={
|
|
222
|
-
return (
|
|
223
|
-
<MenuItem
|
|
224
|
-
key={key}
|
|
225
|
-
value={value}
|
|
226
|
-
data-testid={`option-${testId}`}
|
|
227
|
-
>
|
|
228
|
-
{name}
|
|
229
|
-
</MenuItem>
|
|
230
|
-
);
|
|
231
|
-
})}
|
|
130
|
+
options={renderedOptions}
|
|
232
131
|
/>
|
|
233
132
|
</Box>
|
|
234
133
|
</div>
|
|
@@ -1,228 +1,96 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { withKnobs } from "@storybook/addon-knobs";
|
|
3
2
|
import "./tabs.scss";
|
|
4
3
|
import Tabs from "./index";
|
|
5
4
|
import Tab from "./Tab";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Tabs",
|
|
9
9
|
component: Tabs,
|
|
10
|
-
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: {
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
options: ["A", "B", "C", "D"],
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
control: { type: "select" },
|
|
17
|
+
options: ["standard", "large"],
|
|
18
|
+
},
|
|
19
|
+
orientation: {
|
|
20
|
+
control: { type: "radio" },
|
|
21
|
+
options: ["horizontal", "vertical"],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
11
24
|
};
|
|
12
25
|
|
|
13
|
-
|
|
14
|
-
// state, setState
|
|
26
|
+
const Template = ({ type, size, orientation }) => {
|
|
15
27
|
const [selected, setSelected] = useState(1);
|
|
16
28
|
|
|
17
|
-
const handleChange = (
|
|
18
|
-
|
|
19
|
-
setSelected(v);
|
|
29
|
+
const handleChange = (event, value) => {
|
|
30
|
+
setSelected(value);
|
|
20
31
|
};
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type="A"
|
|
28
|
-
size="standard"
|
|
29
|
-
value={selected}
|
|
30
|
-
onChange={handleChange}
|
|
31
|
-
>
|
|
32
|
-
<Tab type="A" size="standard" label="Item One" value={1} />
|
|
33
|
-
<Tab type="A" size="standard" label="Item Two" value={2} />
|
|
34
|
-
<Tab
|
|
35
|
-
type="A"
|
|
36
|
-
size="standard"
|
|
37
|
-
label="Item Three"
|
|
38
|
-
value={3}
|
|
39
|
-
/>
|
|
40
|
-
<Tab
|
|
41
|
-
type="A"
|
|
42
|
-
size="standard"
|
|
43
|
-
label="disabled"
|
|
44
|
-
value={4}
|
|
45
|
-
disabled
|
|
46
|
-
/>
|
|
47
|
-
</Tabs>
|
|
48
|
-
</div>
|
|
49
|
-
<div style={{ width: "fit-content" }}>
|
|
50
|
-
Large: A
|
|
51
|
-
<Tabs
|
|
52
|
-
type="A"
|
|
53
|
-
size="large"
|
|
54
|
-
value={selected}
|
|
55
|
-
onChange={handleChange}
|
|
56
|
-
>
|
|
57
|
-
<Tab type="A" size="large" label="Item One" value={1} />
|
|
58
|
-
<Tab type="A" size="large" label="Item Two" value={2} />
|
|
59
|
-
<Tab type="A" size="large" label="Item Three" value={3} />
|
|
60
|
-
<Tab
|
|
61
|
-
type="A"
|
|
62
|
-
size="large"
|
|
63
|
-
label="disabled"
|
|
64
|
-
value={4}
|
|
65
|
-
disabled
|
|
66
|
-
/>
|
|
67
|
-
</Tabs>
|
|
68
|
-
</div>
|
|
69
|
-
<div style={{ width: "fit-content" }}>
|
|
70
|
-
Standard: B
|
|
71
|
-
<Tabs
|
|
72
|
-
type="B"
|
|
73
|
-
size="standard"
|
|
74
|
-
value={selected}
|
|
75
|
-
onChange={handleChange}
|
|
76
|
-
>
|
|
77
|
-
<Tab type="B" size="standard" label="Item One" value={1} />
|
|
78
|
-
<Tab type="B" size="standard" label="Item Two" value={2} />
|
|
79
|
-
<Tab
|
|
80
|
-
type="B"
|
|
81
|
-
size="standard"
|
|
82
|
-
label="Item Three"
|
|
83
|
-
value={3}
|
|
84
|
-
/>
|
|
85
|
-
<Tab
|
|
86
|
-
type="B"
|
|
87
|
-
size="standard"
|
|
88
|
-
label="disabled"
|
|
89
|
-
value={4}
|
|
90
|
-
disabled
|
|
91
|
-
/>
|
|
92
|
-
</Tabs>
|
|
93
|
-
</div>
|
|
33
|
+
const tabProps = {
|
|
34
|
+
type,
|
|
35
|
+
size,
|
|
36
|
+
orientation,
|
|
37
|
+
};
|
|
94
38
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<Tab type="C" size="large" label="Item One" value={1} />
|
|
139
|
-
<Tab type="C" size="large" label="Item Two" value={2} />
|
|
140
|
-
<Tab type="C" size="large" label="Item Three" value={3} />
|
|
141
|
-
<Tab
|
|
142
|
-
type="C"
|
|
143
|
-
size="large"
|
|
144
|
-
label="disabled"
|
|
145
|
-
value={4}
|
|
146
|
-
disabled
|
|
147
|
-
/>
|
|
148
|
-
</Tabs>
|
|
149
|
-
</div>
|
|
150
|
-
<div className={"vertical-standard-type-c-wrapper"}>
|
|
151
|
-
<div className={"vertical-standard-type-c"}>
|
|
152
|
-
<h4>Vertical Standard: C</h4>
|
|
153
|
-
<Tabs
|
|
154
|
-
type="C"
|
|
155
|
-
value={selected}
|
|
156
|
-
onChange={handleChange}
|
|
157
|
-
orientation="vertical"
|
|
158
|
-
>
|
|
159
|
-
<Tab
|
|
160
|
-
type="C"
|
|
161
|
-
size="standard"
|
|
162
|
-
label="Item One"
|
|
163
|
-
value={1}
|
|
164
|
-
orientation="vertical"
|
|
165
|
-
/>
|
|
166
|
-
<Tab
|
|
167
|
-
type="C"
|
|
168
|
-
size="standard"
|
|
169
|
-
label="Item Two"
|
|
170
|
-
value={2}
|
|
171
|
-
orientation="vertical"
|
|
172
|
-
/>
|
|
173
|
-
<Tab
|
|
174
|
-
type="C"
|
|
175
|
-
size="standard"
|
|
176
|
-
label="Item Three"
|
|
177
|
-
value={3}
|
|
178
|
-
orientation="vertical"
|
|
179
|
-
/>
|
|
180
|
-
<Tab
|
|
181
|
-
type="C"
|
|
182
|
-
size="standard"
|
|
183
|
-
label="disabled"
|
|
184
|
-
value={4}
|
|
185
|
-
disabled
|
|
186
|
-
orientation="vertical"
|
|
187
|
-
/>
|
|
188
|
-
</Tabs>
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
<div style={{ width: "fit-content" }}>
|
|
192
|
-
Standard: D
|
|
193
|
-
<Tabs type="D" value={selected} onChange={handleChange}>
|
|
194
|
-
<Tab type="D" size="standard" label="Item One" value={1} />
|
|
195
|
-
<Tab type="D" size="standard" label="Item Two" value={2} />
|
|
196
|
-
<Tab
|
|
197
|
-
type="D"
|
|
198
|
-
size="standard"
|
|
199
|
-
label="Item Three"
|
|
200
|
-
value={3}
|
|
201
|
-
/>
|
|
202
|
-
<Tab
|
|
203
|
-
type="D"
|
|
204
|
-
size="standard"
|
|
205
|
-
label="disabled"
|
|
206
|
-
value={4}
|
|
207
|
-
disabled
|
|
208
|
-
/>
|
|
209
|
-
</Tabs>
|
|
210
|
-
</div>
|
|
211
|
-
<div style={{ width: "fit-content" }}>
|
|
212
|
-
Large: D
|
|
213
|
-
<Tabs type="D" value={selected} onChange={handleChange}>
|
|
214
|
-
<Tab type="D" size="large" label="Item One" value={1} />
|
|
215
|
-
<Tab type="D" size="large" label="Item Two" value={2} />
|
|
216
|
-
<Tab type="D" size="large" label="Item Three" value={3} />
|
|
217
|
-
<Tab
|
|
218
|
-
type="D"
|
|
219
|
-
size="large"
|
|
220
|
-
label="disabled"
|
|
221
|
-
value={4}
|
|
222
|
-
disabled
|
|
223
|
-
/>
|
|
224
|
-
</Tabs>
|
|
225
|
-
</div>
|
|
39
|
+
const tabsOrientation =
|
|
40
|
+
orientation === "vertical" ? "vertical" : "horizontal";
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
margin: "25px",
|
|
46
|
+
width: orientation === "vertical" ? 200 : "fit-content",
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<Tabs
|
|
50
|
+
type={type}
|
|
51
|
+
size={size}
|
|
52
|
+
orientation={tabsOrientation}
|
|
53
|
+
value={selected}
|
|
54
|
+
onChange={handleChange}
|
|
55
|
+
>
|
|
56
|
+
<Tab
|
|
57
|
+
{...tabProps}
|
|
58
|
+
label="Item One"
|
|
59
|
+
value={1}
|
|
60
|
+
orientation={tabsOrientation}
|
|
61
|
+
/>
|
|
62
|
+
<Tab
|
|
63
|
+
{...tabProps}
|
|
64
|
+
label="Item Two"
|
|
65
|
+
value={2}
|
|
66
|
+
orientation={tabsOrientation}
|
|
67
|
+
/>
|
|
68
|
+
<Tab
|
|
69
|
+
{...tabProps}
|
|
70
|
+
label="Item Three"
|
|
71
|
+
value={3}
|
|
72
|
+
orientation={tabsOrientation}
|
|
73
|
+
/>
|
|
74
|
+
<Tab
|
|
75
|
+
{...tabProps}
|
|
76
|
+
label="disabled"
|
|
77
|
+
value={4}
|
|
78
|
+
disabled
|
|
79
|
+
orientation={tabsOrientation}
|
|
80
|
+
/>
|
|
81
|
+
</Tabs>
|
|
226
82
|
</div>
|
|
227
83
|
);
|
|
228
84
|
};
|
|
85
|
+
|
|
86
|
+
Template.propTypes = {
|
|
87
|
+
type: PropTypes.string.isRequired,
|
|
88
|
+
size: PropTypes.string.isRequired,
|
|
89
|
+
orientation: PropTypes.oneOf(["horizontal", "vertical"]).isRequired,
|
|
90
|
+
};
|
|
91
|
+
export const InteractiveTabs = Template.bind({});
|
|
92
|
+
InteractiveTabs.args = {
|
|
93
|
+
type: "A",
|
|
94
|
+
size: "standard",
|
|
95
|
+
orientation: "horizontal",
|
|
96
|
+
};
|