@dxc-technology/halstack-react 0.0.0-4448bdb → 0.0.0-453c87a
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/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +294 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +117 -136
- package/accordion/Accordion.stories.tsx +65 -26
- package/accordion/Accordion.test.js +71 -0
- package/accordion/types.d.ts +11 -10
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +15 -36
- package/accordion-group/AccordionGroup.stories.tsx +28 -2
- package/accordion-group/AccordionGroup.test.js +126 -0
- package/accordion-group/types.d.ts +16 -9
- package/alert/Alert.js +5 -2
- package/alert/Alert.test.js +92 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +5 -0
- package/{radio → badge}/types.js +0 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +51 -0
- package/bleed/Bleed.stories.tsx +341 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.js +23 -33
- package/box/Box.test.js +18 -0
- package/box/types.d.ts +1 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +54 -79
- package/button/Button.stories.tsx +66 -8
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +8 -12
- package/card/Card.js +24 -27
- package/card/Card.test.js +50 -0
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +106 -109
- package/checkbox/Checkbox.stories.tsx +146 -130
- package/checkbox/Checkbox.test.js +155 -0
- package/checkbox/types.d.ts +13 -5
- package/chip/Chip.d.ts +1 -1
- package/chip/Chip.js +17 -67
- package/chip/Chip.stories.tsx +44 -14
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +5 -13
- package/common/variables.js +346 -446
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +246 -0
- package/date-input/DateInput.js +171 -260
- package/date-input/DateInput.stories.tsx +137 -38
- package/date-input/DateInput.test.js +835 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +132 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +116 -0
- package/date-input/types.d.ts +67 -9
- package/dialog/Dialog.js +46 -50
- package/dialog/Dialog.stories.tsx +57 -2
- package/dialog/Dialog.test.js +70 -0
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +249 -277
- package/dropdown/Dropdown.stories.tsx +153 -80
- package/dropdown/Dropdown.test.js +585 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +80 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +92 -0
- package/dropdown/types.d.ts +29 -18
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +183 -222
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +498 -0
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +43 -66
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/flex/types.js +5 -0
- package/footer/Footer.js +24 -99
- package/footer/Footer.stories.tsx +8 -1
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +95 -114
- package/header/Header.stories.tsx +46 -36
- package/header/Header.test.js +79 -0
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/heading/Heading.test.js +186 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +51 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +16 -6
- package/layout/ApplicationLayout.js +71 -125
- package/layout/ApplicationLayout.stories.tsx +84 -93
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +18 -33
- package/link/Link.d.ts +3 -2
- package/link/Link.js +61 -86
- package/link/Link.stories.tsx +99 -52
- package/link/Link.test.js +83 -0
- package/link/types.d.ts +9 -29
- package/main.d.ts +11 -15
- package/main.js +53 -79
- package/number-input/NumberInput.js +11 -18
- package/number-input/NumberInput.stories.tsx +5 -5
- package/number-input/NumberInput.test.js +542 -0
- package/number-input/types.d.ts +17 -10
- package/package.json +19 -22
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +19 -46
- package/paginator/Paginator.test.js +308 -0
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.js +7 -4
- package/password-input/PasswordInput.test.js +181 -0
- package/password-input/types.d.ts +14 -11
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +57 -51
- package/progress-bar/ProgressBar.stories.jsx +13 -11
- package/progress-bar/ProgressBar.test.js +110 -0
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +117 -0
- package/quick-nav/QuickNav.stories.tsx +342 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +57 -31
- package/radio-group/RadioGroup.js +75 -60
- package/radio-group/RadioGroup.stories.tsx +61 -39
- package/radio-group/RadioGroup.test.js +722 -0
- package/radio-group/types.d.ts +81 -3
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +49 -105
- package/resultsetTable/ResultsetTable.stories.tsx +56 -33
- package/resultsetTable/ResultsetTable.test.js +330 -0
- package/resultsetTable/types.d.ts +2 -2
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +198 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +108 -0
- package/select/Select.js +147 -365
- package/select/Select.stories.tsx +324 -213
- package/select/Select.test.js +2233 -0
- package/select/types.d.ts +52 -12
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +182 -52
- package/sidenav/Sidenav.stories.tsx +163 -156
- package/sidenav/Sidenav.test.js +44 -0
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +122 -96
- package/slider/Slider.stories.tsx +15 -9
- package/slider/Slider.test.js +250 -0
- package/slider/types.d.ts +10 -2
- package/spinner/Spinner.js +3 -3
- package/spinner/Spinner.test.js +64 -0
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +150 -67
- package/switch/Switch.stories.tsx +20 -42
- package/switch/Switch.test.js +225 -0
- package/switch/types.d.ts +12 -4
- package/table/Table.js +1 -1
- package/table/Table.test.js +26 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.d.ts +1 -1
- package/tabs/Tabs.js +364 -110
- package/tabs/Tabs.stories.tsx +84 -18
- package/tabs/Tabs.test.js +351 -0
- package/tabs/types.d.ts +39 -17
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +172 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +128 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/tag/Tag.d.ts +1 -1
- package/tag/Tag.js +18 -28
- package/tag/Tag.stories.tsx +25 -28
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +23 -14
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +84 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +219 -332
- package/text-input/TextInput.stories.tsx +242 -197
- package/text-input/TextInput.test.js +1724 -0
- package/text-input/types.d.ts +51 -13
- package/textarea/Textarea.js +20 -27
- package/textarea/Textarea.stories.jsx +33 -12
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +18 -11
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toggle-group/ToggleGroup.js +5 -4
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.js +156 -0
- package/toggle-group/types.d.ts +9 -1
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.js +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.d.ts +1 -1
- package/wizard/Wizard.js +58 -54
- package/wizard/Wizard.stories.tsx +33 -24
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +10 -5
- package/ThemeContext.d.ts +0 -15
- package/ThemeContext.js +0 -243
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/common/RequiredComponent.js +0 -32
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/list/List.d.ts +0 -8
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -95
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -174
- package/radio/Radio.stories.tsx +0 -192
- package/radio/types.d.ts +0 -54
- package/row/Row.d.ts +0 -11
- package/row/Row.js +0 -127
- package/row/Row.stories.tsx +0 -239
- package/stack/Stack.d.ts +0 -10
- package/stack/Stack.js +0 -97
- package/stack/Stack.stories.tsx +0 -166
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { userEvent, within, waitFor } from "@storybook/testing-library";
|
|
4
|
-
import { fireEvent } from "@testing-library/react";
|
|
5
|
-
|
|
2
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
6
3
|
import Title from "../../.storybook/components/Title";
|
|
7
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
8
|
-
|
|
9
5
|
import DxcSelect from "./Select";
|
|
6
|
+
import Listbox from "./Listbox";
|
|
7
|
+
import DxcButton from "../button/Button";
|
|
8
|
+
import DxcCheckbox from "../checkbox/Checkbox";
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
11
|
title: "Select",
|
|
13
12
|
component: DxcSelect,
|
|
14
13
|
};
|
|
15
|
-
const one_option = [{ label: "Option 01", value: "1" }];
|
|
16
14
|
|
|
15
|
+
const one_option = [{ label: "Option 01", value: "1" }];
|
|
17
16
|
const single_options = [
|
|
18
17
|
{ label: "Option 01", value: "1" },
|
|
19
18
|
{ label: "Option 02", value: "2" },
|
|
@@ -190,7 +189,29 @@ const url_options = [
|
|
|
190
189
|
{
|
|
191
190
|
label: "Facebook",
|
|
192
191
|
value: "facebook",
|
|
193
|
-
icon:
|
|
192
|
+
icon: (
|
|
193
|
+
<svg
|
|
194
|
+
version="1.1"
|
|
195
|
+
id="Capa_1"
|
|
196
|
+
x="0px"
|
|
197
|
+
y="0px"
|
|
198
|
+
width="438.536px"
|
|
199
|
+
height="438.536px"
|
|
200
|
+
viewBox="0 0 438.536 438.536"
|
|
201
|
+
fill="#4267B2"
|
|
202
|
+
>
|
|
203
|
+
<g>
|
|
204
|
+
<path
|
|
205
|
+
d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
|
|
206
|
+
C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
|
|
207
|
+
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
208
|
+
C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
|
|
209
|
+
c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
|
|
210
|
+
c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
|
|
211
|
+
/>
|
|
212
|
+
</g>
|
|
213
|
+
</svg>
|
|
214
|
+
),
|
|
194
215
|
},
|
|
195
216
|
{
|
|
196
217
|
label: "Pinterest",
|
|
@@ -224,10 +245,12 @@ const optionsWithEllipsisMedium = [
|
|
|
224
245
|
{ label: "Optiond1234567890123456789012345678901234", value: "1" },
|
|
225
246
|
{ label: "Optiond12345678901234567890123456789012345", value: "2" },
|
|
226
247
|
{ label: "Option 031111111111111111111111111111222", value: "3" },
|
|
227
|
-
{ label: "Option
|
|
248
|
+
{ label: "Option 03111111111111111111111111111222", value: "4" },
|
|
228
249
|
];
|
|
250
|
+
|
|
229
251
|
const Select = () => (
|
|
230
252
|
<>
|
|
253
|
+
<Title title="States" theme="light" level={2} />
|
|
231
254
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
232
255
|
<Title title="Hovered" theme="light" level={4} />
|
|
233
256
|
<DxcSelect label="Hovered" options={single_options} />
|
|
@@ -242,115 +265,288 @@ const Select = () => (
|
|
|
242
265
|
</ExampleContainer>
|
|
243
266
|
<ExampleContainer>
|
|
244
267
|
<Title title="Disabled with value" theme="light" level={4} />
|
|
245
|
-
<DxcSelect label="Disabled with value" disabled options={single_options}
|
|
268
|
+
<DxcSelect label="Disabled with value" disabled options={single_options} defaultValue="1" />
|
|
246
269
|
</ExampleContainer>
|
|
247
270
|
<ExampleContainer>
|
|
248
|
-
<Title title="With label" theme="light" level={4} />
|
|
249
|
-
<DxcSelect label="Label" options={single_options} />
|
|
250
|
-
<Title title="Label and placeholder" theme="light" level={4} />
|
|
251
|
-
<DxcSelect label="Label" options={single_options} placeholder="Placeholder" />
|
|
252
|
-
<Title title="Label, placeholder and helper text" theme="light" level={4} />
|
|
253
|
-
<DxcSelect label="Label" options={single_options} helperText="Helper text" placeholder="Placeholder" />
|
|
254
271
|
<Title title="Error" theme="light" level={4} />
|
|
255
272
|
<DxcSelect
|
|
256
273
|
label="Label"
|
|
257
274
|
options={single_options}
|
|
258
|
-
error="Error message"
|
|
275
|
+
error="Error message."
|
|
259
276
|
helperText="Helper text"
|
|
260
277
|
placeholder="Placeholder"
|
|
261
278
|
/>
|
|
279
|
+
</ExampleContainer>
|
|
280
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
281
|
+
<Title title="Hovered error" theme="light" level={4} />
|
|
282
|
+
<DxcSelect
|
|
283
|
+
label="Label"
|
|
284
|
+
options={single_options}
|
|
285
|
+
error="Error message."
|
|
286
|
+
helperText="Helper text"
|
|
287
|
+
placeholder="Placeholder"
|
|
288
|
+
/>
|
|
289
|
+
</ExampleContainer>
|
|
290
|
+
<Title title="Anatomy" theme="light" level={2} />
|
|
291
|
+
<ExampleContainer>
|
|
292
|
+
<Title title="Label, placeholder and helper text" theme="light" level={4} />
|
|
293
|
+
<DxcSelect label="Label" options={single_options} helperText="Helper text" placeholder="Placeholder" />
|
|
294
|
+
</ExampleContainer>
|
|
295
|
+
<Title title="Variants" theme="light" level={2} />
|
|
296
|
+
<ExampleContainer>
|
|
262
297
|
<Title title="Simple selection" theme="light" level={4} />
|
|
263
|
-
<DxcSelect label="Simple selection" searchable options={single_options}
|
|
298
|
+
<DxcSelect label="Simple selection" searchable options={single_options} defaultValue="2" />
|
|
299
|
+
</ExampleContainer>
|
|
300
|
+
<ExampleContainer>
|
|
264
301
|
<Title title="Multiple selection" theme="light" level={4} />
|
|
265
|
-
<DxcSelect label="Multiple select" searchable options={single_options} multiple
|
|
302
|
+
<DxcSelect label="Multiple select" searchable options={single_options} multiple defaultValue={["1", "2"]} />
|
|
266
303
|
</ExampleContainer>
|
|
267
|
-
|
|
268
304
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
269
305
|
<Title title="Multiple clear hovered" theme="light" level={4} />
|
|
270
|
-
<DxcSelect label="Multiple select" options={single_options} multiple
|
|
306
|
+
<DxcSelect label="Multiple select" options={single_options} multiple defaultValue={["1", "2"]} />
|
|
271
307
|
</ExampleContainer>
|
|
272
|
-
|
|
273
308
|
<ExampleContainer pseudoState="pseudo-active">
|
|
274
309
|
<Title title="Multiple clear actived" theme="light" level={4} />
|
|
275
|
-
<DxcSelect label="Multiple select" options={single_options} multiple
|
|
276
|
-
</ExampleContainer>
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
<
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
<
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
<
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
<
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
<Title title="xxlarge margin" theme="light" level={4} />
|
|
324
|
-
<DxcSelect label="xxLarge" options={single_options} margin="xxlarge" />
|
|
325
|
-
</ExampleContainer>
|
|
326
|
-
</>
|
|
310
|
+
<DxcSelect label="Multiple select" options={single_options} multiple defaultValue={["1", "2"]} />
|
|
311
|
+
</ExampleContainer>
|
|
312
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
313
|
+
<ExampleContainer>
|
|
314
|
+
<Title title="Small size" theme="light" level={4} />
|
|
315
|
+
<DxcSelect label="Small" options={single_options} size="small" />
|
|
316
|
+
</ExampleContainer>
|
|
317
|
+
<ExampleContainer>
|
|
318
|
+
<Title title="Medium size" theme="light" level={4} />
|
|
319
|
+
<DxcSelect label="Medium" options={single_options} size="medium" />
|
|
320
|
+
</ExampleContainer>
|
|
321
|
+
<ExampleContainer>
|
|
322
|
+
<Title title="Large size" theme="light" level={4} />
|
|
323
|
+
<DxcSelect label="Large" options={single_options} size="large" />
|
|
324
|
+
</ExampleContainer>
|
|
325
|
+
<ExampleContainer>
|
|
326
|
+
<Title title="Fillparent size" theme="light" level={4} />
|
|
327
|
+
<DxcSelect label="Fillparent" options={single_options} size="fillParent" />
|
|
328
|
+
</ExampleContainer>
|
|
329
|
+
<Title title="Margins" theme="light" level={2} />
|
|
330
|
+
<ExampleContainer>
|
|
331
|
+
<Title title="xxsmall margin" theme="light" level={4} />
|
|
332
|
+
<DxcSelect label="xxSmall" options={single_options} margin="xxsmall" />
|
|
333
|
+
</ExampleContainer>
|
|
334
|
+
<ExampleContainer>
|
|
335
|
+
<Title title="xsmall margin" theme="light" level={4} />
|
|
336
|
+
<DxcSelect label="xSmall" options={single_options} margin="xsmall" />
|
|
337
|
+
</ExampleContainer>
|
|
338
|
+
<ExampleContainer>
|
|
339
|
+
<Title title="small margin" theme="light" level={4} />
|
|
340
|
+
<DxcSelect label="Small" options={single_options} margin="small" />
|
|
341
|
+
</ExampleContainer>
|
|
342
|
+
<ExampleContainer>
|
|
343
|
+
<Title title="medium margin" theme="light" level={4} />
|
|
344
|
+
<DxcSelect label="Medium" options={single_options} margin="medium" />
|
|
345
|
+
</ExampleContainer>
|
|
346
|
+
<ExampleContainer>
|
|
347
|
+
<Title title="large margin" theme="light" level={4} />
|
|
348
|
+
<DxcSelect label="Large" options={single_options} margin="large" />
|
|
349
|
+
</ExampleContainer>
|
|
350
|
+
<ExampleContainer>
|
|
351
|
+
<Title title="xlarge margin" theme="light" level={4} />
|
|
352
|
+
<DxcSelect label="xLarge" options={single_options} margin="xlarge" />
|
|
353
|
+
</ExampleContainer>
|
|
354
|
+
<ExampleContainer>
|
|
355
|
+
<Title title="xxlarge margin" theme="light" level={4} />
|
|
356
|
+
<DxcSelect label="xxLarge" options={single_options} margin="xxlarge" />
|
|
357
|
+
</ExampleContainer>
|
|
327
358
|
<ExampleContainer expanded>
|
|
328
359
|
<Title title="Ellipsis" theme="light" level={2} />
|
|
329
360
|
<Title title="Multiple selection with ellipsis" theme="light" level={4} />
|
|
330
|
-
<DxcSelect label="Label" options={single_options} multiple
|
|
361
|
+
<DxcSelect label="Label" options={single_options} multiple defaultValue={["1", "2", "3", "4"]} />
|
|
331
362
|
<Title title="Value with ellipsis" theme="light" level={4} />
|
|
332
|
-
<DxcSelect label="Label" options={optionsWithEllipsisMedium}
|
|
333
|
-
<Title title="
|
|
363
|
+
<DxcSelect label="Label" options={optionsWithEllipsisMedium} defaultValue="1" size="medium" />
|
|
364
|
+
<Title title="Options with ellipsis" theme="light" level={4} />
|
|
334
365
|
<DxcSelect
|
|
335
366
|
label="Label"
|
|
336
367
|
placeholder="Choose an option"
|
|
337
|
-
|
|
368
|
+
defaultValue="1"
|
|
338
369
|
options={optionsWithEllipsisMedium}
|
|
339
370
|
size="medium"
|
|
340
371
|
/>
|
|
341
372
|
</ExampleContainer>
|
|
342
373
|
</>
|
|
343
374
|
);
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
375
|
+
const SelectListbox = () => (
|
|
376
|
+
<>
|
|
377
|
+
<Title title="Listbox" theme="light" level={2} />
|
|
378
|
+
<ExampleContainer>
|
|
379
|
+
<Title
|
|
380
|
+
title="List dialog uses a Radix Popover to appear over elements with a certain z-index"
|
|
381
|
+
theme="light"
|
|
382
|
+
level={3}
|
|
383
|
+
/>
|
|
384
|
+
<div
|
|
385
|
+
style={{
|
|
386
|
+
display: "flex",
|
|
387
|
+
flexDirection: "column",
|
|
388
|
+
gap: "20px",
|
|
389
|
+
height: "150px",
|
|
390
|
+
width: "min-content",
|
|
391
|
+
marginBottom: "100px",
|
|
392
|
+
padding: "20px",
|
|
393
|
+
border: "1px solid black",
|
|
394
|
+
borderRadius: "4px",
|
|
395
|
+
overflow: "auto",
|
|
396
|
+
zIndex: "1300",
|
|
397
|
+
}}
|
|
398
|
+
>
|
|
399
|
+
<DxcSelect label="Label" options={single_options} optional placeholder="Choose an option" />
|
|
400
|
+
<button style={{ zIndex: "1", width: "100px" }}>Submit</button>
|
|
401
|
+
</div>
|
|
402
|
+
</ExampleContainer>
|
|
403
|
+
<Title title="Listbox option states" theme="light" level={3} />
|
|
404
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
405
|
+
<Title title="Hovered option" theme="light" level={4} />
|
|
406
|
+
<Listbox
|
|
407
|
+
id="x"
|
|
408
|
+
currentValue=""
|
|
409
|
+
options={one_option}
|
|
410
|
+
visualFocusIndex={-1}
|
|
411
|
+
lastOptionIndex={0}
|
|
412
|
+
multiple={false}
|
|
413
|
+
optional={false}
|
|
414
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
415
|
+
searchable={false}
|
|
416
|
+
handleOptionOnClick={() => {}}
|
|
417
|
+
getSelectWidth={() => 360}
|
|
418
|
+
/>
|
|
419
|
+
</ExampleContainer>
|
|
420
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
421
|
+
<Title title="Active option" theme="light" level={4} />
|
|
422
|
+
<Listbox
|
|
423
|
+
id="x"
|
|
424
|
+
currentValue=""
|
|
425
|
+
options={one_option}
|
|
426
|
+
visualFocusIndex={-1}
|
|
427
|
+
lastOptionIndex={0}
|
|
428
|
+
multiple={false}
|
|
429
|
+
optional={false}
|
|
430
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
431
|
+
searchable={false}
|
|
432
|
+
handleOptionOnClick={() => {}}
|
|
433
|
+
getSelectWidth={() => 360}
|
|
434
|
+
/>
|
|
435
|
+
</ExampleContainer>
|
|
436
|
+
<ExampleContainer>
|
|
437
|
+
<Title title="Focused option" theme="light" level={4} />
|
|
438
|
+
<Listbox
|
|
439
|
+
id="x"
|
|
440
|
+
currentValue=""
|
|
441
|
+
options={one_option}
|
|
442
|
+
visualFocusIndex={0}
|
|
443
|
+
lastOptionIndex={0}
|
|
444
|
+
multiple={false}
|
|
445
|
+
optional={false}
|
|
446
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
447
|
+
searchable={false}
|
|
448
|
+
handleOptionOnClick={() => {}}
|
|
449
|
+
getSelectWidth={() => 360}
|
|
450
|
+
/>
|
|
451
|
+
</ExampleContainer>
|
|
452
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
453
|
+
<Title title="Hovered selected option" theme="light" level={4} />
|
|
454
|
+
<Listbox
|
|
455
|
+
id="x"
|
|
456
|
+
currentValue="1"
|
|
457
|
+
options={single_options}
|
|
458
|
+
visualFocusIndex={-1}
|
|
459
|
+
lastOptionIndex={3}
|
|
460
|
+
multiple={false}
|
|
461
|
+
optional={false}
|
|
462
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
463
|
+
searchable={false}
|
|
464
|
+
handleOptionOnClick={() => {}}
|
|
465
|
+
getSelectWidth={() => 360}
|
|
466
|
+
/>
|
|
467
|
+
</ExampleContainer>
|
|
468
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
469
|
+
<Title title="Active selected option" theme="light" level={4} />
|
|
470
|
+
<Listbox
|
|
471
|
+
id="x"
|
|
472
|
+
currentValue="2"
|
|
473
|
+
options={single_options}
|
|
474
|
+
visualFocusIndex={0}
|
|
475
|
+
lastOptionIndex={3}
|
|
476
|
+
multiple={false}
|
|
477
|
+
optional={false}
|
|
478
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
479
|
+
searchable={false}
|
|
480
|
+
handleOptionOnClick={() => {}}
|
|
481
|
+
getSelectWidth={() => 360}
|
|
482
|
+
/>
|
|
483
|
+
</ExampleContainer>
|
|
484
|
+
<Title title="Listbox with icons" theme="light" level={3} />
|
|
485
|
+
<ExampleContainer>
|
|
486
|
+
<Title title="Icons (SVGs)" theme="light" level={4} />
|
|
487
|
+
<Listbox
|
|
488
|
+
id="x"
|
|
489
|
+
currentValue="3"
|
|
490
|
+
options={icon_options}
|
|
491
|
+
visualFocusIndex={-1}
|
|
492
|
+
lastOptionIndex={3}
|
|
493
|
+
multiple={false}
|
|
494
|
+
optional={false}
|
|
495
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
496
|
+
searchable={false}
|
|
497
|
+
handleOptionOnClick={() => {}}
|
|
498
|
+
getSelectWidth={() => 360}
|
|
499
|
+
/>
|
|
500
|
+
</ExampleContainer>
|
|
501
|
+
<ExampleContainer>
|
|
502
|
+
<Title title="Icons (Images)" theme="light" level={4} />
|
|
503
|
+
<Listbox
|
|
504
|
+
id="x"
|
|
505
|
+
currentValue="facebook"
|
|
506
|
+
options={url_options}
|
|
507
|
+
visualFocusIndex={-1}
|
|
508
|
+
lastOptionIndex={6}
|
|
509
|
+
multiple={false}
|
|
510
|
+
optional={false}
|
|
511
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
512
|
+
searchable={false}
|
|
513
|
+
handleOptionOnClick={() => {}}
|
|
514
|
+
getSelectWidth={() => 360}
|
|
515
|
+
/>
|
|
516
|
+
</ExampleContainer>
|
|
517
|
+
<ExampleContainer>
|
|
518
|
+
<Title title="Grouped icons (SVGs)" theme="light" level={4} />
|
|
519
|
+
<Listbox
|
|
520
|
+
id="x"
|
|
521
|
+
currentValue={["0", "3"]}
|
|
522
|
+
options={icon_options_grouped}
|
|
523
|
+
visualFocusIndex={-1}
|
|
524
|
+
lastOptionIndex={3}
|
|
525
|
+
multiple={false}
|
|
526
|
+
optional={false}
|
|
527
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
528
|
+
searchable={false}
|
|
529
|
+
handleOptionOnClick={() => {}}
|
|
530
|
+
getSelectWidth={() => 360}
|
|
531
|
+
/>
|
|
532
|
+
</ExampleContainer>
|
|
533
|
+
<ExampleContainer>
|
|
534
|
+
<Title title="Grouped icons (Images)" theme="light" level={4} />
|
|
535
|
+
<Listbox
|
|
536
|
+
id="x"
|
|
537
|
+
currentValue={["facebook", "figma"]}
|
|
538
|
+
options={url_options}
|
|
539
|
+
visualFocusIndex={-1}
|
|
540
|
+
lastOptionIndex={6}
|
|
541
|
+
multiple={true}
|
|
542
|
+
optional={false}
|
|
543
|
+
optionalItem={{ label: "Empty", value: "" }}
|
|
544
|
+
searchable={false}
|
|
545
|
+
handleOptionOnClick={() => {}}
|
|
546
|
+
getSelectWidth={() => 360}
|
|
547
|
+
/>
|
|
548
|
+
</ExampleContainer>
|
|
549
|
+
</>
|
|
354
550
|
);
|
|
355
551
|
const SearchableSelect = () => (
|
|
356
552
|
<ExampleContainer expanded>
|
|
@@ -358,13 +554,18 @@ const SearchableSelect = () => (
|
|
|
358
554
|
<DxcSelect label="Select Label" searchable options={single_options} placeholder="Choose an option" />
|
|
359
555
|
</ExampleContainer>
|
|
360
556
|
);
|
|
361
|
-
const
|
|
557
|
+
const SearchValue = () => (
|
|
362
558
|
<ExampleContainer expanded>
|
|
363
559
|
<Title title="Searchable select with value" theme="light" level={4} />
|
|
364
|
-
<DxcSelect
|
|
560
|
+
<DxcSelect
|
|
561
|
+
label="Select Label"
|
|
562
|
+
searchable
|
|
563
|
+
defaultValue="1"
|
|
564
|
+
options={single_options}
|
|
565
|
+
placeholder="Choose an option"
|
|
566
|
+
/>
|
|
365
567
|
</ExampleContainer>
|
|
366
568
|
);
|
|
367
|
-
|
|
368
569
|
const MultipleSelect = () => (
|
|
369
570
|
<>
|
|
370
571
|
<ExampleContainer expanded>
|
|
@@ -372,7 +573,7 @@ const MultipleSelect = () => (
|
|
|
372
573
|
<DxcSelect
|
|
373
574
|
label="Select label"
|
|
374
575
|
options={single_options}
|
|
375
|
-
|
|
576
|
+
defaultValue={["1", "4"]}
|
|
376
577
|
multiple
|
|
377
578
|
placeholder="Choose an option"
|
|
378
579
|
/>
|
|
@@ -382,31 +583,25 @@ const MultipleSelect = () => (
|
|
|
382
583
|
const DefaultGroupedOptionsSelect = () => (
|
|
383
584
|
<ExampleContainer expanded>
|
|
384
585
|
<Title title="Grouped options simple select" theme="light" level={4} />
|
|
385
|
-
<DxcSelect label="Label" options={group_options}
|
|
586
|
+
<DxcSelect label="Label" options={group_options} defaultValue="9" placeholder="Choose an option" />
|
|
386
587
|
</ExampleContainer>
|
|
387
588
|
);
|
|
388
589
|
const MultipleGroupedOptionsSelect = () => (
|
|
389
590
|
<ExampleContainer expanded>
|
|
390
591
|
<Title title="Grouped options multiple select" theme="light" level={4} />
|
|
391
|
-
<DxcSelect
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
</ExampleContainer>
|
|
399
|
-
);
|
|
400
|
-
const SelectWithIcons = () => (
|
|
401
|
-
<ExampleContainer expanded>
|
|
402
|
-
<Title title="Normal icons displayed" theme="light" level={4} />
|
|
403
|
-
<DxcSelect label="Label" options={icon_options} value="3" placeholder="Choose an option" />
|
|
592
|
+
<DxcSelect
|
|
593
|
+
label="Label"
|
|
594
|
+
options={group_options}
|
|
595
|
+
defaultValue={["0", "2"]}
|
|
596
|
+
multiple
|
|
597
|
+
placeholder="Choose an option"
|
|
598
|
+
/>
|
|
404
599
|
</ExampleContainer>
|
|
405
600
|
);
|
|
406
601
|
const SelectMultipleWithIcons = () => (
|
|
407
602
|
<ExampleContainer expanded>
|
|
408
603
|
<Title title="Multiple select with icons" theme="light" level={4} />
|
|
409
|
-
<DxcSelect label="Label" options={icon_options} multiple
|
|
604
|
+
<DxcSelect label="Label" options={icon_options} multiple defaultValue={["1", "3"]} placeholder="Choose an option" />
|
|
410
605
|
</ExampleContainer>
|
|
411
606
|
);
|
|
412
607
|
const MultipleGroupedOptionsSelectWithIcons = () => (
|
|
@@ -416,41 +611,12 @@ const MultipleGroupedOptionsSelectWithIcons = () => (
|
|
|
416
611
|
label="Label"
|
|
417
612
|
options={icon_options_grouped}
|
|
418
613
|
multiple
|
|
419
|
-
|
|
614
|
+
defaultValue={["3", "2"]}
|
|
420
615
|
placeholder="Choose an option"
|
|
421
616
|
/>
|
|
422
617
|
</ExampleContainer>
|
|
423
618
|
);
|
|
424
|
-
|
|
425
|
-
<ExampleContainer pseudoState="pseudo-hover" expanded>
|
|
426
|
-
<Title title="Hovered Option" theme="light" level={4} />
|
|
427
|
-
<DxcSelect label="Hovered" options={one_option} placeholder="Choose an option" />
|
|
428
|
-
</ExampleContainer>
|
|
429
|
-
);
|
|
430
|
-
const OnlyOneOptionFocused = () => (
|
|
431
|
-
<ExampleContainer pseudoState="pseudo-focus" expanded>
|
|
432
|
-
<Title title="Focused Option" theme="light" level={4} />
|
|
433
|
-
<DxcSelect label="Focused" options={one_option} placeholder="Choose an option" />
|
|
434
|
-
</ExampleContainer>
|
|
435
|
-
);
|
|
436
|
-
const OnlyOneOptionActived = () => (
|
|
437
|
-
<ExampleContainer pseudoState="pseudo-active" expanded>
|
|
438
|
-
<Title title="Actived Option" theme="light" level={4} />
|
|
439
|
-
<DxcSelect label="Actived" options={one_option} placeholder="Choose an option" />
|
|
440
|
-
</ExampleContainer>
|
|
441
|
-
);
|
|
442
|
-
const SelectedOptionHovered = () => (
|
|
443
|
-
<ExampleContainer pseudoState="pseudo-hover" expanded>
|
|
444
|
-
<Title title="Hovered Selected Option" theme="light" level={4} />
|
|
445
|
-
<DxcSelect label="Hovered" value="1" options={one_option} placeholder="Choose an option" />
|
|
446
|
-
</ExampleContainer>
|
|
447
|
-
);
|
|
448
|
-
const SelectedOptionActived = () => (
|
|
449
|
-
<ExampleContainer pseudoState="pseudo-active" expanded>
|
|
450
|
-
<Title title="Actived Selected Option" theme="light" level={4} />
|
|
451
|
-
<DxcSelect label="Actived" value="1" options={one_option} placeholder="Choose an option" />
|
|
452
|
-
</ExampleContainer>
|
|
453
|
-
);
|
|
619
|
+
|
|
454
620
|
const MultipleSearchable = () => (
|
|
455
621
|
<ExampleContainer expanded>
|
|
456
622
|
<Title title="Searchable multiple select with value" theme="light" level={4} />
|
|
@@ -458,34 +624,40 @@ const MultipleSearchable = () => (
|
|
|
458
624
|
label="Select Label"
|
|
459
625
|
searchable
|
|
460
626
|
multiple
|
|
461
|
-
|
|
627
|
+
defaultValue={["1", "4"]}
|
|
462
628
|
options={single_options}
|
|
463
629
|
placeholder="Choose an option"
|
|
464
630
|
/>
|
|
465
631
|
</ExampleContainer>
|
|
466
632
|
);
|
|
467
|
-
|
|
468
|
-
|
|
633
|
+
|
|
634
|
+
export const Chromatic = Select.bind({});
|
|
635
|
+
Chromatic.play = async ({ canvasElement }) => {
|
|
636
|
+
const canvas = within(canvasElement);
|
|
637
|
+
await userEvent.click(canvas.getAllByRole("combobox")[24]);
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
export const ListboxStates = SelectListbox.bind({});
|
|
641
|
+
ListboxStates.play = async ({ canvasElement }) => {
|
|
469
642
|
const canvas = within(canvasElement);
|
|
470
643
|
const select = canvas.getByRole("combobox");
|
|
471
644
|
await userEvent.click(select);
|
|
472
645
|
};
|
|
646
|
+
|
|
473
647
|
export const Searchable = SearchableSelect.bind({});
|
|
474
648
|
Searchable.play = async ({ canvasElement }) => {
|
|
475
649
|
const canvas = within(canvasElement);
|
|
476
|
-
await userEvent.
|
|
477
|
-
await waitFor(async () => {
|
|
478
|
-
userEvent.type(canvas.getByRole("combobox"), "r");
|
|
479
|
-
});
|
|
650
|
+
await userEvent.type(canvas.getByRole("combobox"), "r");
|
|
480
651
|
};
|
|
481
|
-
|
|
482
|
-
|
|
652
|
+
|
|
653
|
+
export const SearchableWithValue = SearchValue.bind({});
|
|
654
|
+
SearchableWithValue.play = async ({ canvasElement }) => {
|
|
483
655
|
const canvas = within(canvasElement);
|
|
484
656
|
await userEvent.click(canvas.getByRole("combobox"));
|
|
485
657
|
};
|
|
486
658
|
|
|
487
|
-
export const
|
|
488
|
-
|
|
659
|
+
export const MultipleSearchableWithValue = MultipleSearchable.bind({});
|
|
660
|
+
MultipleSearchableWithValue.play = async ({ canvasElement }) => {
|
|
489
661
|
const canvas = within(canvasElement);
|
|
490
662
|
await userEvent.click(canvas.getAllByRole("combobox")[0]);
|
|
491
663
|
};
|
|
@@ -497,75 +669,14 @@ GroupOptionsDisplayed.play = async ({ canvasElement }) => {
|
|
|
497
669
|
await userEvent.click(select);
|
|
498
670
|
};
|
|
499
671
|
|
|
500
|
-
export const
|
|
501
|
-
|
|
672
|
+
export const MultipleOptionsDisplayed = MultipleSelect.bind({});
|
|
673
|
+
MultipleOptionsDisplayed.play = async ({ canvasElement }) => {
|
|
502
674
|
const canvas = within(canvasElement);
|
|
503
675
|
await userEvent.click(canvas.getAllByRole("combobox")[0]);
|
|
504
676
|
};
|
|
505
677
|
|
|
506
|
-
export const
|
|
507
|
-
|
|
508
|
-
const canvas = within(canvasElement);
|
|
509
|
-
const select = canvas.getByRole("combobox");
|
|
510
|
-
await userEvent.click(select);
|
|
511
|
-
};
|
|
512
|
-
export const SelectWithIconsDisplayed = SelectWithIcons.bind({});
|
|
513
|
-
SelectWithIconsDisplayed.play = async ({ canvasElement }) => {
|
|
514
|
-
const canvas = within(canvasElement);
|
|
515
|
-
const select = canvas.getByRole("combobox");
|
|
516
|
-
await userEvent.click(select);
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
export const SelectWithRescaledIconsDisplayed = RescaledIcons.bind({});
|
|
520
|
-
SelectWithRescaledIconsDisplayed.play = async ({ canvasElement }) => {
|
|
521
|
-
const canvas = within(canvasElement);
|
|
522
|
-
const select = canvas.getByRole("combobox");
|
|
523
|
-
await userEvent.click(select);
|
|
524
|
-
};
|
|
525
|
-
export const SelectMultipleWithIconsDisplayed = SelectMultipleWithIcons.bind({});
|
|
526
|
-
SelectMultipleWithIconsDisplayed.play = async ({ canvasElement }) => {
|
|
527
|
-
const canvas = within(canvasElement);
|
|
528
|
-
const select = canvas.getByRole("combobox");
|
|
529
|
-
await userEvent.click(select);
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
export const SelectMultipleGroupedWithIconsDisplayed = MultipleGroupedOptionsSelectWithIcons.bind({});
|
|
533
|
-
SelectMultipleGroupedWithIconsDisplayed.play = async ({ canvasElement }) => {
|
|
534
|
-
const canvas = within(canvasElement);
|
|
535
|
-
const select = canvas.getByRole("combobox");
|
|
536
|
-
await userEvent.click(select);
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
export const OptionHovered = OnlyOneOptionHovered.bind({});
|
|
540
|
-
OptionHovered.play = async ({ canvasElement }) => {
|
|
541
|
-
const canvas = within(canvasElement);
|
|
542
|
-
const select = canvas.getByRole("combobox");
|
|
543
|
-
await userEvent.click(select);
|
|
544
|
-
};
|
|
545
|
-
|
|
546
|
-
export const OptionFocused = OnlyOneOptionFocused.bind({});
|
|
547
|
-
OptionFocused.play = async ({ canvasElement }) => {
|
|
548
|
-
const canvas = within(canvasElement);
|
|
549
|
-
const select = canvas.getByRole("combobox");
|
|
550
|
-
await userEvent.click(select);
|
|
551
|
-
await waitFor(async () => {
|
|
552
|
-
fireEvent.keyDown(select, { key: "ArrowDown", code: "ArrowDown", keyCode: 40, charCode: 40 });
|
|
553
|
-
});
|
|
554
|
-
};
|
|
555
|
-
export const OptionActived = OnlyOneOptionActived.bind({});
|
|
556
|
-
OptionActived.play = async ({ canvasElement }) => {
|
|
557
|
-
const canvas = within(canvasElement);
|
|
558
|
-
const select = canvas.getByRole("combobox");
|
|
559
|
-
await userEvent.click(select);
|
|
560
|
-
};
|
|
561
|
-
export const OptionSelectedHovered = SelectedOptionHovered.bind({});
|
|
562
|
-
OptionSelectedHovered.play = async ({ canvasElement }) => {
|
|
563
|
-
const canvas = within(canvasElement);
|
|
564
|
-
const select = canvas.getByRole("combobox");
|
|
565
|
-
await userEvent.click(select);
|
|
566
|
-
};
|
|
567
|
-
export const OptionSelectedActived = SelectedOptionActived.bind({});
|
|
568
|
-
OptionSelectedActived.play = async ({ canvasElement }) => {
|
|
678
|
+
export const MultipleGroupedOptionsDisplayed = MultipleGroupedOptionsSelect.bind({});
|
|
679
|
+
MultipleGroupedOptionsDisplayed.play = async ({ canvasElement }) => {
|
|
569
680
|
const canvas = within(canvasElement);
|
|
570
681
|
const select = canvas.getByRole("combobox");
|
|
571
682
|
await userEvent.click(select);
|