@dxc-technology/halstack-react 0.0.0-59568e7 → 0.0.0-5aa300b
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.js +7 -11
- package/accordion/Accordion.js +117 -104
- package/accordion/Accordion.stories.tsx +54 -15
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +5 -4
- package/accordion-group/AccordionGroup.js +2 -21
- package/accordion-group/AccordionGroup.stories.tsx +27 -1
- package/accordion-group/AccordionGroup.test.js +20 -45
- package/accordion-group/types.d.ts +10 -3
- package/alert/Alert.js +1 -1
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +1 -0
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +94 -95
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +23 -33
- 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/{list → bulleted-list}/types.js +0 -0
- package/button/Button.js +50 -70
- package/button/Button.stories.tsx +61 -1
- package/button/types.d.ts +7 -7
- package/card/Card.js +34 -36
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +92 -99
- package/checkbox/Checkbox.stories.tsx +79 -59
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +6 -2
- package/chip/Chip.js +11 -23
- package/chip/Chip.stories.tsx +41 -9
- package/chip/types.d.ts +1 -1
- package/common/variables.js +186 -158
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +77 -222
- package/date-input/DateInput.stories.tsx +30 -17
- package/date-input/DateInput.test.js +411 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +160 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +115 -0
- package/date-input/types.d.ts +53 -0
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +57 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +247 -249
- package/dropdown/Dropdown.stories.tsx +135 -64
- package/dropdown/Dropdown.test.js +504 -108
- 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 +25 -5
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +177 -219
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +53 -12
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +38 -63
- 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/{radio → flex}/types.js +0 -0
- package/footer/Footer.stories.tsx +8 -1
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +74 -72
- package/header/Header.stories.tsx +4 -4
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +36 -36
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +16 -6
- package/layout/ApplicationLayout.js +70 -117
- 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 +2 -2
- package/link/Link.js +24 -50
- package/link/Link.stories.tsx +13 -6
- package/link/types.d.ts +3 -4
- package/main.d.ts +6 -9
- package/main.js +32 -56
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +16 -20
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +6 -12
- package/paginator/Paginator.test.js +43 -1
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.test.js +13 -12
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +56 -50
- package/progress-bar/ProgressBar.stories.jsx +3 -1
- package/progress-bar/ProgressBar.test.js +67 -22
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.js +25 -20
- package/quick-nav/QuickNav.stories.tsx +131 -26
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +23 -22
- package/radio-group/RadioGroup.stories.tsx +1 -0
- package/radio-group/RadioGroup.test.js +123 -96
- package/radio-group/types.d.ts +2 -2
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -107
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +65 -41
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +53 -7
- package/select/Option.js +8 -10
- package/select/Select.js +43 -43
- package/select/Select.stories.tsx +225 -136
- package/select/Select.test.js +363 -250
- package/select/types.d.ts +2 -5
- 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 +25 -37
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +120 -95
- package/slider/Slider.stories.tsx +7 -1
- package/slider/Slider.test.js +121 -21
- package/slider/types.d.ts +6 -2
- package/spinner/Spinner.js +2 -2
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +135 -68
- package/switch/Switch.stories.tsx +8 -30
- package/switch/Switch.test.js +144 -17
- package/switch/types.d.ts +6 -2
- package/table/Table.js +1 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +81 -5
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +15 -5
- 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/{row → tabs-nav}/types.js +0 -0
- package/tag/Tag.js +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +38 -9
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +195 -292
- package/text-input/TextInput.stories.tsx +211 -185
- package/text-input/TextInput.test.js +737 -725
- package/text-input/types.d.ts +22 -3
- package/toggle-group/types.d.ts +1 -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/{stack → typography}/types.js +0 -0
- package/wizard/Wizard.js +9 -16
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/types.d.ts +5 -4
- package/common/RequiredComponent.js +0 -32
- package/list/List.d.ts +0 -4
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -95
- package/list/types.d.ts +0 -7
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -173
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
- package/row/Row.d.ts +0 -3
- package/row/Row.js +0 -127
- package/row/Row.stories.tsx +0 -237
- package/row/types.d.ts +0 -28
- package/stack/Stack.d.ts +0 -3
- package/stack/Stack.js +0 -97
- package/stack/Stack.stories.tsx +0 -164
- package/stack/types.d.ts +0 -24
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
|
@@ -1,12 +1,11 @@
|
|
|
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",
|
|
@@ -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",
|
|
@@ -340,7 +361,7 @@ const Select = () => (
|
|
|
340
361
|
<DxcSelect label="Label" options={single_options} multiple defaultValue={["1", "2", "3", "4"]} />
|
|
341
362
|
<Title title="Value with ellipsis" theme="light" level={4} />
|
|
342
363
|
<DxcSelect label="Label" options={optionsWithEllipsisMedium} defaultValue="1" size="medium" />
|
|
343
|
-
<Title title="
|
|
364
|
+
<Title title="Options with ellipsis" theme="light" level={4} />
|
|
344
365
|
<DxcSelect
|
|
345
366
|
label="Label"
|
|
346
367
|
placeholder="Choose an option"
|
|
@@ -351,16 +372,181 @@ const Select = () => (
|
|
|
351
372
|
</ExampleContainer>
|
|
352
373
|
</>
|
|
353
374
|
);
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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
|
+
</>
|
|
364
550
|
);
|
|
365
551
|
const SearchableSelect = () => (
|
|
366
552
|
<ExampleContainer expanded>
|
|
@@ -368,7 +554,7 @@ const SearchableSelect = () => (
|
|
|
368
554
|
<DxcSelect label="Select Label" searchable options={single_options} placeholder="Choose an option" />
|
|
369
555
|
</ExampleContainer>
|
|
370
556
|
);
|
|
371
|
-
const
|
|
557
|
+
const SearchValue = () => (
|
|
372
558
|
<ExampleContainer expanded>
|
|
373
559
|
<Title title="Searchable select with value" theme="light" level={4} />
|
|
374
560
|
<DxcSelect
|
|
@@ -380,7 +566,6 @@ const SearchableWithValue = () => (
|
|
|
380
566
|
/>
|
|
381
567
|
</ExampleContainer>
|
|
382
568
|
);
|
|
383
|
-
|
|
384
569
|
const MultipleSelect = () => (
|
|
385
570
|
<>
|
|
386
571
|
<ExampleContainer expanded>
|
|
@@ -413,18 +598,6 @@ const MultipleGroupedOptionsSelect = () => (
|
|
|
413
598
|
/>
|
|
414
599
|
</ExampleContainer>
|
|
415
600
|
);
|
|
416
|
-
const RescaledIcons = () => (
|
|
417
|
-
<ExampleContainer expanded>
|
|
418
|
-
<Title title="Rescaled icons displayed" theme="light" level={4} />
|
|
419
|
-
<DxcSelect label="Label" options={url_options} defaultValue="facebook" placeholder="Choose an option" />
|
|
420
|
-
</ExampleContainer>
|
|
421
|
-
);
|
|
422
|
-
const SelectWithIcons = () => (
|
|
423
|
-
<ExampleContainer expanded>
|
|
424
|
-
<Title title="Normal icons displayed" theme="light" level={4} />
|
|
425
|
-
<DxcSelect label="Label" options={icon_options} defaultValue="3" placeholder="Choose an option" />
|
|
426
|
-
</ExampleContainer>
|
|
427
|
-
);
|
|
428
601
|
const SelectMultipleWithIcons = () => (
|
|
429
602
|
<ExampleContainer expanded>
|
|
430
603
|
<Title title="Multiple select with icons" theme="light" level={4} />
|
|
@@ -443,36 +616,7 @@ const MultipleGroupedOptionsSelectWithIcons = () => (
|
|
|
443
616
|
/>
|
|
444
617
|
</ExampleContainer>
|
|
445
618
|
);
|
|
446
|
-
|
|
447
|
-
<ExampleContainer pseudoState="pseudo-hover" expanded>
|
|
448
|
-
<Title title="Hovered Option" theme="light" level={4} />
|
|
449
|
-
<DxcSelect label="Hovered" options={one_option} placeholder="Choose an option" />
|
|
450
|
-
</ExampleContainer>
|
|
451
|
-
);
|
|
452
|
-
const OnlyOneOptionFocused = () => (
|
|
453
|
-
<ExampleContainer pseudoState="pseudo-focus" expanded>
|
|
454
|
-
<Title title="Focused Option" theme="light" level={4} />
|
|
455
|
-
<DxcSelect label="Focused" options={one_option} placeholder="Choose an option" />
|
|
456
|
-
</ExampleContainer>
|
|
457
|
-
);
|
|
458
|
-
const OnlyOneOptionActived = () => (
|
|
459
|
-
<ExampleContainer pseudoState="pseudo-active" expanded>
|
|
460
|
-
<Title title="Actived Option" theme="light" level={4} />
|
|
461
|
-
<DxcSelect label="Actived" options={one_option} placeholder="Choose an option" />
|
|
462
|
-
</ExampleContainer>
|
|
463
|
-
);
|
|
464
|
-
const SelectedOptionHovered = () => (
|
|
465
|
-
<ExampleContainer pseudoState="pseudo-hover" expanded>
|
|
466
|
-
<Title title="Hovered Selected Option" theme="light" level={4} />
|
|
467
|
-
<DxcSelect label="Hovered" defaultValue="1" options={one_option} placeholder="Choose an option" />
|
|
468
|
-
</ExampleContainer>
|
|
469
|
-
);
|
|
470
|
-
const SelectedOptionActived = () => (
|
|
471
|
-
<ExampleContainer pseudoState="pseudo-active" expanded>
|
|
472
|
-
<Title title="Actived Selected Option" theme="light" level={4} />
|
|
473
|
-
<DxcSelect label="Actived" defaultValue="1" options={one_option} placeholder="Choose an option" />
|
|
474
|
-
</ExampleContainer>
|
|
475
|
-
);
|
|
619
|
+
|
|
476
620
|
const MultipleSearchable = () => (
|
|
477
621
|
<ExampleContainer expanded>
|
|
478
622
|
<Title title="Searchable multiple select with value" theme="light" level={4} />
|
|
@@ -486,28 +630,34 @@ const MultipleSearchable = () => (
|
|
|
486
630
|
/>
|
|
487
631
|
</ExampleContainer>
|
|
488
632
|
);
|
|
489
|
-
|
|
490
|
-
|
|
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 }) => {
|
|
491
642
|
const canvas = within(canvasElement);
|
|
492
643
|
const select = canvas.getByRole("combobox");
|
|
493
644
|
await userEvent.click(select);
|
|
494
645
|
};
|
|
646
|
+
|
|
495
647
|
export const Searchable = SearchableSelect.bind({});
|
|
496
648
|
Searchable.play = async ({ canvasElement }) => {
|
|
497
649
|
const canvas = within(canvasElement);
|
|
498
|
-
await userEvent.
|
|
499
|
-
await waitFor(async () => {
|
|
500
|
-
userEvent.type(canvas.getByRole("combobox"), "r");
|
|
501
|
-
});
|
|
650
|
+
await userEvent.type(canvas.getByRole("combobox"), "r");
|
|
502
651
|
};
|
|
503
|
-
|
|
504
|
-
|
|
652
|
+
|
|
653
|
+
export const SearchableWithValue = SearchValue.bind({});
|
|
654
|
+
SearchableWithValue.play = async ({ canvasElement }) => {
|
|
505
655
|
const canvas = within(canvasElement);
|
|
506
656
|
await userEvent.click(canvas.getByRole("combobox"));
|
|
507
657
|
};
|
|
508
658
|
|
|
509
|
-
export const
|
|
510
|
-
|
|
659
|
+
export const MultipleSearchableWithValue = MultipleSearchable.bind({});
|
|
660
|
+
MultipleSearchableWithValue.play = async ({ canvasElement }) => {
|
|
511
661
|
const canvas = within(canvasElement);
|
|
512
662
|
await userEvent.click(canvas.getAllByRole("combobox")[0]);
|
|
513
663
|
};
|
|
@@ -519,75 +669,14 @@ GroupOptionsDisplayed.play = async ({ canvasElement }) => {
|
|
|
519
669
|
await userEvent.click(select);
|
|
520
670
|
};
|
|
521
671
|
|
|
522
|
-
export const
|
|
523
|
-
|
|
672
|
+
export const MultipleOptionsDisplayed = MultipleSelect.bind({});
|
|
673
|
+
MultipleOptionsDisplayed.play = async ({ canvasElement }) => {
|
|
524
674
|
const canvas = within(canvasElement);
|
|
525
675
|
await userEvent.click(canvas.getAllByRole("combobox")[0]);
|
|
526
676
|
};
|
|
527
677
|
|
|
528
|
-
export const
|
|
529
|
-
|
|
530
|
-
const canvas = within(canvasElement);
|
|
531
|
-
const select = canvas.getByRole("combobox");
|
|
532
|
-
await userEvent.click(select);
|
|
533
|
-
};
|
|
534
|
-
export const SelectWithIconsDisplayed = SelectWithIcons.bind({});
|
|
535
|
-
SelectWithIconsDisplayed.play = async ({ canvasElement }) => {
|
|
536
|
-
const canvas = within(canvasElement);
|
|
537
|
-
const select = canvas.getByRole("combobox");
|
|
538
|
-
await userEvent.click(select);
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
export const SelectWithRescaledIconsDisplayed = RescaledIcons.bind({});
|
|
542
|
-
SelectWithRescaledIconsDisplayed.play = async ({ canvasElement }) => {
|
|
543
|
-
const canvas = within(canvasElement);
|
|
544
|
-
const select = canvas.getByRole("combobox");
|
|
545
|
-
await userEvent.click(select);
|
|
546
|
-
};
|
|
547
|
-
export const SelectMultipleWithIconsDisplayed = SelectMultipleWithIcons.bind({});
|
|
548
|
-
SelectMultipleWithIconsDisplayed.play = async ({ canvasElement }) => {
|
|
549
|
-
const canvas = within(canvasElement);
|
|
550
|
-
const select = canvas.getByRole("combobox");
|
|
551
|
-
await userEvent.click(select);
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
export const SelectMultipleGroupedWithIconsDisplayed = MultipleGroupedOptionsSelectWithIcons.bind({});
|
|
555
|
-
SelectMultipleGroupedWithIconsDisplayed.play = async ({ canvasElement }) => {
|
|
556
|
-
const canvas = within(canvasElement);
|
|
557
|
-
const select = canvas.getByRole("combobox");
|
|
558
|
-
await userEvent.click(select);
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
export const OptionHovered = OnlyOneOptionHovered.bind({});
|
|
562
|
-
OptionHovered.play = async ({ canvasElement }) => {
|
|
563
|
-
const canvas = within(canvasElement);
|
|
564
|
-
const select = canvas.getByRole("combobox");
|
|
565
|
-
await userEvent.click(select);
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
export const OptionFocused = OnlyOneOptionFocused.bind({});
|
|
569
|
-
OptionFocused.play = async ({ canvasElement }) => {
|
|
570
|
-
const canvas = within(canvasElement);
|
|
571
|
-
const select = canvas.getByRole("combobox");
|
|
572
|
-
await userEvent.click(select);
|
|
573
|
-
await waitFor(async () => {
|
|
574
|
-
fireEvent.keyDown(select, { key: "ArrowDown", code: "ArrowDown", keyCode: 40, charCode: 40 });
|
|
575
|
-
});
|
|
576
|
-
};
|
|
577
|
-
export const OptionActived = OnlyOneOptionActived.bind({});
|
|
578
|
-
OptionActived.play = async ({ canvasElement }) => {
|
|
579
|
-
const canvas = within(canvasElement);
|
|
580
|
-
const select = canvas.getByRole("combobox");
|
|
581
|
-
await userEvent.click(select);
|
|
582
|
-
};
|
|
583
|
-
export const OptionSelectedHovered = SelectedOptionHovered.bind({});
|
|
584
|
-
OptionSelectedHovered.play = async ({ canvasElement }) => {
|
|
585
|
-
const canvas = within(canvasElement);
|
|
586
|
-
const select = canvas.getByRole("combobox");
|
|
587
|
-
await userEvent.click(select);
|
|
588
|
-
};
|
|
589
|
-
export const OptionSelectedActived = SelectedOptionActived.bind({});
|
|
590
|
-
OptionSelectedActived.play = async ({ canvasElement }) => {
|
|
678
|
+
export const MultipleGroupedOptionsDisplayed = MultipleGroupedOptionsSelect.bind({});
|
|
679
|
+
MultipleGroupedOptionsDisplayed.play = async ({ canvasElement }) => {
|
|
591
680
|
const canvas = within(canvasElement);
|
|
592
681
|
const select = canvas.getByRole("combobox");
|
|
593
682
|
await userEvent.click(select);
|