@dxc-technology/halstack-react 0.0.0-c9c1158 → 0.0.0-c9efd3e
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/BackgroundColorContext.d.ts +1 -10
- package/BackgroundColorContext.js +2 -7
- package/HalstackContext.d.ts +29 -133
- package/HalstackContext.js +1 -1
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +10 -26
- package/accordion/Accordion.stories.tsx +4 -36
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +3 -3
- package/accordion-group/AccordionGroupAccordion.js +2 -2
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +1 -1
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +48 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/action-icon/types.js +5 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +15 -72
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -28
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +1 -4
- package/bulleted-list/BulletedList.accessibility.test.js +107 -0
- package/bulleted-list/BulletedList.js +15 -22
- package/bulleted-list/BulletedList.stories.tsx +1 -2
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +15 -15
- package/button/Button.stories.tsx +32 -51
- package/button/Button.test.js +3 -1
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.js +36 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +26 -31
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +8 -5
- package/chip/Chip.stories.tsx +5 -24
- package/chip/Chip.test.js +4 -4
- package/common/coreTokens.d.ts +1 -1
- package/common/coreTokens.js +3 -3
- package/common/variables.d.ts +29 -133
- package/common/variables.js +38 -142
- package/container/Container.js +3 -7
- package/container/Container.stories.tsx +10 -25
- package/contextual-menu/ContextualMenu.accessibility.test.js +86 -0
- package/contextual-menu/ContextualMenu.d.ts +7 -0
- package/contextual-menu/ContextualMenu.js +71 -0
- package/contextual-menu/ContextualMenu.stories.tsx +182 -0
- package/contextual-menu/ContextualMenu.test.js +71 -0
- package/contextual-menu/MenuItemAction.d.ts +4 -0
- package/contextual-menu/MenuItemAction.js +46 -0
- package/contextual-menu/types.d.ts +22 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/DateInput.accessibility.test.js +216 -0
- package/date-input/types.d.ts +2 -2
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +2 -5
- package/dialog/Dialog.stories.tsx +170 -0
- package/dialog/Dialog.test.js +1 -1
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.js +180 -0
- package/dropdown/Dropdown.js +21 -36
- package/dropdown/Dropdown.stories.tsx +5 -16
- package/dropdown/DropdownMenuItem.js +6 -3
- package/dropdown/types.d.ts +3 -5
- package/file-input/FileInput.accessibility.test.js +160 -0
- package/file-input/FileInput.js +3 -39
- package/file-input/FileInput.test.js +7 -84
- package/file-input/FileItem.js +13 -27
- package/footer/Footer.accessibility.test.js +117 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +36 -31
- package/footer/Footer.stories.tsx +46 -2
- package/footer/Icons.d.ts +1 -0
- package/footer/Icons.js +65 -1
- package/footer/types.d.ts +8 -8
- package/header/Header.accessibility.test.js +84 -0
- package/header/Header.js +18 -40
- package/header/types.d.ts +4 -3
- package/heading/Heading.accessibility.test.js +33 -0
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.stories.tsx +3 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +1 -1
- package/layout/Icons.js +0 -2
- package/link/Link.accessibility.test.js +112 -0
- package/link/Link.js +7 -5
- package/link/Link.stories.tsx +2 -2
- package/link/types.d.ts +1 -1
- package/main.d.ts +5 -3
- package/main.js +22 -8
- package/nav-tabs/NavTabs.accessibility.test.js +52 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +9 -6
- package/nav-tabs/NavTabs.stories.tsx +6 -4
- package/nav-tabs/NavTabs.test.js +3 -2
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +8 -7
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +24 -5
- package/number-input/NumberInput.test.js +165 -6
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +6 -0
- package/package.json +12 -12
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +1 -4
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +2 -7
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.stories.tsx +0 -1
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +5 -11
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +1 -1
- package/resultset-table/ResultsetTable.accessibility.test.js +274 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +23 -12
- package/resultset-table/ResultsetTable.stories.tsx +106 -5
- package/resultset-table/ResultsetTable.test.js +76 -0
- package/resultset-table/types.d.ts +40 -7
- package/select/Option.js +8 -1
- package/select/Select.accessibility.test.js +217 -0
- package/select/Select.js +35 -27
- package/select/Select.stories.tsx +0 -1
- package/select/Select.test.js +498 -462
- package/select/types.d.ts +2 -2
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +20 -18
- package/sidenav/Sidenav.stories.tsx +4 -9
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.js +37 -46
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +6 -14
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.js +89 -0
- package/switch/Switch.js +23 -28
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.js +82 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +73 -11
- package/table/Table.stories.tsx +297 -2
- package/table/Table.test.js +92 -0
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +7 -4
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +4 -5
- package/tabs/Tabs.stories.tsx +1 -1
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +6 -6
- package/tag/Tag.stories.tsx +4 -7
- package/tag/Tag.test.js +4 -12
- package/tag/types.d.ts +2 -2
- package/text-input/Suggestions.js +7 -10
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +77 -102
- package/text-input/TextInput.stories.tsx +1 -1
- package/text-input/TextInput.test.js +96 -79
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +10 -16
- package/textarea/Textarea.stories.tsx +0 -1
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +1 -4
- package/typography/Typography.accessibility.test.js +339 -0
- package/useTheme.d.ts +29 -133
- package/utils/FocusLock.js +15 -5
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/types.d.ts +1 -1
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -47
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -56
- /package/{layout → sidenav}/SidenavContext.d.ts +0 -0
- /package/{layout → sidenav}/SidenavContext.js +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import DxcDivider from "./Divider";
|
|
4
|
+
import { DxcFlex, DxcParagraph } from "../main";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Divider",
|
|
9
|
+
component: DxcDivider,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Chromatic = () => (
|
|
13
|
+
<>
|
|
14
|
+
<Title title="Default" level={4} />
|
|
15
|
+
<ExampleContainer>
|
|
16
|
+
<DxcFlex gap="1rem" direction="column">
|
|
17
|
+
<DxcParagraph>
|
|
18
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
19
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
20
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
21
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
22
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
23
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
24
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
25
|
+
Commodo sagittis volutpat id lorem.
|
|
26
|
+
</DxcParagraph>
|
|
27
|
+
<DxcDivider />
|
|
28
|
+
<DxcParagraph>
|
|
29
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
30
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
31
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
32
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
33
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
34
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
35
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
36
|
+
Commodo sagittis volutpat id lorem.
|
|
37
|
+
</DxcParagraph>
|
|
38
|
+
</DxcFlex>
|
|
39
|
+
</ExampleContainer>
|
|
40
|
+
<Title title="Default strong" level={4} />
|
|
41
|
+
<ExampleContainer>
|
|
42
|
+
<DxcFlex gap="1rem" direction="column">
|
|
43
|
+
<DxcParagraph>
|
|
44
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
45
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
46
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
47
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
48
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
49
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
50
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
51
|
+
Commodo sagittis volutpat id lorem.
|
|
52
|
+
</DxcParagraph>
|
|
53
|
+
<DxcDivider weight="strong" />
|
|
54
|
+
<DxcParagraph>
|
|
55
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
56
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
57
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
58
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
59
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
60
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
61
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
62
|
+
Commodo sagittis volutpat id lorem.
|
|
63
|
+
</DxcParagraph>
|
|
64
|
+
</DxcFlex>
|
|
65
|
+
</ExampleContainer>
|
|
66
|
+
<Title title="Default light grey" level={4} />
|
|
67
|
+
<ExampleContainer>
|
|
68
|
+
<DxcFlex gap="1rem" direction="column">
|
|
69
|
+
<DxcParagraph>
|
|
70
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
71
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
72
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
73
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
74
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
75
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
76
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
77
|
+
Commodo sagittis volutpat id lorem.
|
|
78
|
+
</DxcParagraph>
|
|
79
|
+
<DxcDivider color="lightGrey" />
|
|
80
|
+
<DxcParagraph>
|
|
81
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
82
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
83
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
84
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
85
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
86
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
87
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
88
|
+
Commodo sagittis volutpat id lorem.
|
|
89
|
+
</DxcParagraph>
|
|
90
|
+
</DxcFlex>
|
|
91
|
+
</ExampleContainer>
|
|
92
|
+
<Title title="Default dark grey" level={4} />
|
|
93
|
+
<ExampleContainer>
|
|
94
|
+
<DxcFlex gap="1rem" direction="column">
|
|
95
|
+
<DxcParagraph>
|
|
96
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
97
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
98
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
99
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
100
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
101
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
102
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
103
|
+
Commodo sagittis volutpat id lorem.
|
|
104
|
+
</DxcParagraph>
|
|
105
|
+
<DxcDivider color="darkGrey" />
|
|
106
|
+
<DxcParagraph>
|
|
107
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
108
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
109
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
110
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
111
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
112
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
113
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
114
|
+
Commodo sagittis volutpat id lorem.
|
|
115
|
+
</DxcParagraph>
|
|
116
|
+
</DxcFlex>
|
|
117
|
+
</ExampleContainer>
|
|
118
|
+
<Title title="Vertical" level={4} />
|
|
119
|
+
<ExampleContainer>
|
|
120
|
+
<DxcFlex gap="1rem" direction="row">
|
|
121
|
+
<DxcParagraph>
|
|
122
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
123
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
124
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
125
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
126
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
127
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
128
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
129
|
+
Commodo sagittis volutpat id lorem.
|
|
130
|
+
</DxcParagraph>
|
|
131
|
+
<DxcDivider orientation="vertical" />
|
|
132
|
+
<DxcParagraph>
|
|
133
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
134
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
135
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
136
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
137
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
138
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
139
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
140
|
+
Commodo sagittis volutpat id lorem.
|
|
141
|
+
</DxcParagraph>
|
|
142
|
+
</DxcFlex>
|
|
143
|
+
</ExampleContainer>
|
|
144
|
+
<Title title="Vertical strong" level={4} />
|
|
145
|
+
<ExampleContainer>
|
|
146
|
+
<DxcFlex gap="1rem" direction="row">
|
|
147
|
+
<DxcParagraph>
|
|
148
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
149
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
150
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
151
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
152
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
153
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
154
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
155
|
+
Commodo sagittis volutpat id lorem.
|
|
156
|
+
</DxcParagraph>
|
|
157
|
+
<DxcDivider orientation="vertical" weight="strong" />
|
|
158
|
+
<DxcParagraph>
|
|
159
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
160
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
161
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
162
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
163
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
164
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
165
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
166
|
+
Commodo sagittis volutpat id lorem.
|
|
167
|
+
</DxcParagraph>
|
|
168
|
+
</DxcFlex>
|
|
169
|
+
</ExampleContainer>
|
|
170
|
+
<Title title="Vertical light grey" level={4} />
|
|
171
|
+
<ExampleContainer>
|
|
172
|
+
<DxcFlex gap="1rem" direction="row">
|
|
173
|
+
<DxcParagraph>
|
|
174
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
175
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
176
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
177
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
178
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
179
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
180
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
181
|
+
Commodo sagittis volutpat id lorem.
|
|
182
|
+
</DxcParagraph>
|
|
183
|
+
<DxcDivider orientation="vertical" color="lightGrey" />
|
|
184
|
+
<DxcParagraph>
|
|
185
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
186
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
187
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
188
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
189
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
190
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
191
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
192
|
+
Commodo sagittis volutpat id lorem.
|
|
193
|
+
</DxcParagraph>
|
|
194
|
+
</DxcFlex>
|
|
195
|
+
</ExampleContainer>
|
|
196
|
+
<Title title="Vertical dark grey" level={4} />
|
|
197
|
+
<ExampleContainer>
|
|
198
|
+
<DxcFlex gap="1rem" direction="row">
|
|
199
|
+
<DxcParagraph>
|
|
200
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
201
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
202
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
203
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
204
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
205
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
206
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
207
|
+
Commodo sagittis volutpat id lorem.
|
|
208
|
+
</DxcParagraph>
|
|
209
|
+
<DxcDivider orientation="vertical" color="darkGrey" />
|
|
210
|
+
<DxcParagraph>
|
|
211
|
+
Lorem ipsum dolor sit amet consectetur. Tincidunt sed pharetra mollis duis volutpat urna. Hendrerit aliquet et
|
|
212
|
+
arcu purus. Sodales elementum sollicitudin consequat elementum tortor. Lectus eget cursus ut ac pharetra
|
|
213
|
+
lobortis integer eu. Potenti amet ac id risus ac nunc orci nibh. Tempus vitae vitae aenean arcu. Nibh
|
|
214
|
+
tristique porta dui enim eget tristique rutrum. Quisque faucibus suscipit nibh est sed. Netus venenatis congue
|
|
215
|
+
diam in dui morbi dignissim lorem. Urna aliquet sem in tincidunt. Nunc arcu nec fringilla enim purus ut justo
|
|
216
|
+
nisi. Vel mus ut ornare faucibus blandit diam sit vestibulum massa. Semper nullam sit sagittis hendrerit
|
|
217
|
+
augue. In fermentum metus proin arcu faucibus proin nibh sit. Vel integer sed enim in sed vel nec ut vitae.
|
|
218
|
+
Commodo sagittis volutpat id lorem.
|
|
219
|
+
</DxcParagraph>
|
|
220
|
+
</DxcFlex>
|
|
221
|
+
</ExampleContainer>
|
|
222
|
+
</>
|
|
223
|
+
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
var _Divider = _interopRequireDefault(require("./Divider"));
|
|
7
|
+
describe("Divider Component", function () {
|
|
8
|
+
test("Default renders horizontal divider correctly", function () {
|
|
9
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Divider["default"], null)),
|
|
10
|
+
container = _render.container;
|
|
11
|
+
var divider = container.querySelector("hr");
|
|
12
|
+
expect(divider.getAttribute("aria-orientation")).toBe("horizontal");
|
|
13
|
+
});
|
|
14
|
+
test("Renders vertical divider correctly", function () {
|
|
15
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Divider["default"], {
|
|
16
|
+
orientation: "vertical"
|
|
17
|
+
})),
|
|
18
|
+
container = _render2.container;
|
|
19
|
+
var divider = container.querySelector("hr");
|
|
20
|
+
expect(divider.getAttribute("aria-orientation")).toBe("vertical");
|
|
21
|
+
});
|
|
22
|
+
test("Renders divider as a decorative resource by default", function () {
|
|
23
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Divider["default"], null)),
|
|
24
|
+
container = _render3.container;
|
|
25
|
+
var divider = container.querySelector("hr");
|
|
26
|
+
expect(divider).toBeTruthy();
|
|
27
|
+
expect(divider.getAttribute("aria-hidden")).toBe("true");
|
|
28
|
+
});
|
|
29
|
+
test("Renders divider as a separator if it is not decorative", function () {
|
|
30
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Divider["default"], {
|
|
31
|
+
decorative: false
|
|
32
|
+
})),
|
|
33
|
+
getByRole = _render4.getByRole;
|
|
34
|
+
var divider = getByRole("separator");
|
|
35
|
+
expect(divider).toBeTruthy();
|
|
36
|
+
expect(divider.getAttribute("aria-hidden")).toBe("false");
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* The divider can be shown in horizontal or vertical.
|
|
4
|
+
*/
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
/**
|
|
7
|
+
* Modifies the thickness of the divider.
|
|
8
|
+
*/
|
|
9
|
+
weight?: "regular" | "strong";
|
|
10
|
+
/**
|
|
11
|
+
* Modifies the color of the divider.
|
|
12
|
+
*/
|
|
13
|
+
color?: "lightGrey" | "mediumGrey" | "darkGrey";
|
|
14
|
+
/**
|
|
15
|
+
* Specifies whether the divider serves a purely decorative purpose
|
|
16
|
+
* or functions as a semantic separator for content. Additionally, it
|
|
17
|
+
* determines whether the divider is accessible to screen readers.
|
|
18
|
+
*/
|
|
19
|
+
decorative?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export default Props;
|
package/divider/types.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
7
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _react2 = require("@testing-library/react");
|
|
10
|
+
var _jestAxe = require("jest-axe");
|
|
11
|
+
var _Dropdown = _interopRequireDefault(require("./Dropdown.tsx"));
|
|
12
|
+
var iconSVG = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
13
|
+
viewBox: "0 0 24 24",
|
|
14
|
+
height: "24",
|
|
15
|
+
width: "24",
|
|
16
|
+
fill: "currentColor"
|
|
17
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
18
|
+
d: "M0 0h24v24H0z",
|
|
19
|
+
fill: "none"
|
|
20
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
21
|
+
d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"
|
|
22
|
+
}));
|
|
23
|
+
var iconUrl = "https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png";
|
|
24
|
+
|
|
25
|
+
// Mocking DOMRect for Radix Primitive Popover
|
|
26
|
+
global.globalThis = global;
|
|
27
|
+
global.DOMRect = {
|
|
28
|
+
fromRect: function fromRect() {
|
|
29
|
+
return {
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
bottom: 0,
|
|
33
|
+
right: 0,
|
|
34
|
+
width: 0,
|
|
35
|
+
height: 0
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
global.ResizeObserver = /*#__PURE__*/function () {
|
|
40
|
+
function ResizeObserver() {
|
|
41
|
+
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
42
|
+
}
|
|
43
|
+
(0, _createClass2["default"])(ResizeObserver, [{
|
|
44
|
+
key: "observe",
|
|
45
|
+
value: function observe() {}
|
|
46
|
+
}, {
|
|
47
|
+
key: "unobserve",
|
|
48
|
+
value: function unobserve() {}
|
|
49
|
+
}, {
|
|
50
|
+
key: "disconnect",
|
|
51
|
+
value: function disconnect() {}
|
|
52
|
+
}]);
|
|
53
|
+
return ResizeObserver;
|
|
54
|
+
}();
|
|
55
|
+
var options = [{
|
|
56
|
+
value: "1",
|
|
57
|
+
label: "Amazon",
|
|
58
|
+
icon: iconUrl
|
|
59
|
+
}, {
|
|
60
|
+
value: "2",
|
|
61
|
+
label: "Ebay",
|
|
62
|
+
icon: iconUrl
|
|
63
|
+
}, {
|
|
64
|
+
value: "3",
|
|
65
|
+
label: "Wallapop",
|
|
66
|
+
icon: iconSVG
|
|
67
|
+
}, {
|
|
68
|
+
value: "4",
|
|
69
|
+
label: "Aliexpress",
|
|
70
|
+
icon: iconSVG
|
|
71
|
+
}];
|
|
72
|
+
describe("Dropdown component accessibility tests", function () {
|
|
73
|
+
it("Should not have basic accessibility issues", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
74
|
+
var _render, baseElement, results;
|
|
75
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
76
|
+
while (1) switch (_context.prev = _context.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
// baseElement is needed when using React Portals
|
|
79
|
+
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
80
|
+
options: options,
|
|
81
|
+
label: "dropdown-test",
|
|
82
|
+
icon: iconSVG,
|
|
83
|
+
iconPosition: "before",
|
|
84
|
+
margin: "medium",
|
|
85
|
+
size: "medium",
|
|
86
|
+
optionsIconPosition: "before"
|
|
87
|
+
})), baseElement = _render.baseElement;
|
|
88
|
+
_context.next = 3;
|
|
89
|
+
return (0, _jestAxe.axe)(baseElement);
|
|
90
|
+
case 3:
|
|
91
|
+
results = _context.sent;
|
|
92
|
+
expect(results).toHaveNoViolations();
|
|
93
|
+
case 5:
|
|
94
|
+
case "end":
|
|
95
|
+
return _context.stop();
|
|
96
|
+
}
|
|
97
|
+
}, _callee);
|
|
98
|
+
})));
|
|
99
|
+
it("Should not have basic accessibility issues for disabled mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
100
|
+
var _render2, baseElement, results;
|
|
101
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
// baseElement is needed when using React Portals
|
|
105
|
+
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
106
|
+
options: options,
|
|
107
|
+
label: "dropdown-test",
|
|
108
|
+
icon: iconSVG,
|
|
109
|
+
iconPosition: "before",
|
|
110
|
+
margin: "medium",
|
|
111
|
+
size: "medium",
|
|
112
|
+
optionsIconPosition: "before",
|
|
113
|
+
disabled: true
|
|
114
|
+
})), baseElement = _render2.baseElement;
|
|
115
|
+
_context2.next = 3;
|
|
116
|
+
return (0, _jestAxe.axe)(baseElement);
|
|
117
|
+
case 3:
|
|
118
|
+
results = _context2.sent;
|
|
119
|
+
expect(results).toHaveNoViolations();
|
|
120
|
+
case 5:
|
|
121
|
+
case "end":
|
|
122
|
+
return _context2.stop();
|
|
123
|
+
}
|
|
124
|
+
}, _callee2);
|
|
125
|
+
})));
|
|
126
|
+
it("Should not have basic accessibility issues for caret-hidden mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
127
|
+
var _render3, baseElement, results;
|
|
128
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
129
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
// baseElement is needed when using React Portals
|
|
132
|
+
_render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
133
|
+
options: options,
|
|
134
|
+
label: "dropdown-test",
|
|
135
|
+
icon: iconSVG,
|
|
136
|
+
iconPosition: "after",
|
|
137
|
+
margin: "medium",
|
|
138
|
+
size: "medium",
|
|
139
|
+
optionsIconPosition: "after",
|
|
140
|
+
caretHidden: true
|
|
141
|
+
})), baseElement = _render3.baseElement;
|
|
142
|
+
_context3.next = 3;
|
|
143
|
+
return (0, _jestAxe.axe)(baseElement);
|
|
144
|
+
case 3:
|
|
145
|
+
results = _context3.sent;
|
|
146
|
+
expect(results).toHaveNoViolations();
|
|
147
|
+
case 5:
|
|
148
|
+
case "end":
|
|
149
|
+
return _context3.stop();
|
|
150
|
+
}
|
|
151
|
+
}, _callee3);
|
|
152
|
+
})));
|
|
153
|
+
it("Should not have basic accessibility issues for expand-on-hover mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
154
|
+
var _render4, baseElement, results;
|
|
155
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
156
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
157
|
+
case 0:
|
|
158
|
+
// baseElement is needed when using React Portals
|
|
159
|
+
_render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
160
|
+
options: options,
|
|
161
|
+
label: "dropdown-test",
|
|
162
|
+
icon: iconSVG,
|
|
163
|
+
iconPosition: "after",
|
|
164
|
+
margin: "medium",
|
|
165
|
+
size: "medium",
|
|
166
|
+
optionsIconPosition: "after",
|
|
167
|
+
expandOnHover: true
|
|
168
|
+
})), baseElement = _render4.baseElement;
|
|
169
|
+
_context4.next = 3;
|
|
170
|
+
return (0, _jestAxe.axe)(baseElement);
|
|
171
|
+
case 3:
|
|
172
|
+
results = _context4.sent;
|
|
173
|
+
expect(results).toHaveNoViolations();
|
|
174
|
+
case 5:
|
|
175
|
+
case "end":
|
|
176
|
+
return _context4.stop();
|
|
177
|
+
}
|
|
178
|
+
}, _callee4);
|
|
179
|
+
})));
|
|
180
|
+
});
|
package/dropdown/Dropdown.js
CHANGED
|
@@ -17,33 +17,10 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
17
17
|
var _uuid = require("uuid");
|
|
18
18
|
var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
|
|
19
19
|
var _DropdownMenu = _interopRequireDefault(require("./DropdownMenu"));
|
|
20
|
+
var _Icon = _interopRequireDefault(require("../icon/Icon"));
|
|
20
21
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
21
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
23
|
-
var upArrowIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
24
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
-
width: "24",
|
|
26
|
-
height: "24",
|
|
27
|
-
viewBox: "0 0 24 24",
|
|
28
|
-
fill: "currentColor"
|
|
29
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
30
|
-
d: "M7 14l5-5 5 5z"
|
|
31
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
32
|
-
d: "M0 0h24v24H0z",
|
|
33
|
-
fill: "none"
|
|
34
|
-
}));
|
|
35
|
-
var downArrowIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
36
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
-
width: "24",
|
|
38
|
-
height: "24",
|
|
39
|
-
viewBox: "0 0 24 24",
|
|
40
|
-
fill: "currentColor"
|
|
41
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
42
|
-
d: "M7 10l5 5 5-5z"
|
|
43
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
44
|
-
d: "M0 0h24v24H0z",
|
|
45
|
-
fill: "none"
|
|
46
|
-
}));
|
|
47
24
|
var useWidth = function useWidth(target) {
|
|
48
25
|
var _useState = (0, _react.useState)(0),
|
|
49
26
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -231,11 +208,13 @@ var DxcDropdown = function DxcDropdown(_ref) {
|
|
|
231
208
|
}, /*#__PURE__*/_react["default"].createElement(DropdownTriggerContent, null, label && iconPosition === "after" && /*#__PURE__*/_react["default"].createElement(DropdownTriggerLabel, null, label), icon && /*#__PURE__*/_react["default"].createElement(DropdownTriggerIcon, {
|
|
232
209
|
disabled: disabled,
|
|
233
210
|
role: typeof icon === "string" ? undefined : "img"
|
|
234
|
-
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("
|
|
235
|
-
|
|
211
|
+
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
212
|
+
icon: icon
|
|
236
213
|
}) : icon), label && iconPosition === "before" && /*#__PURE__*/_react["default"].createElement(DropdownTriggerLabel, null, label)), !caretHidden && /*#__PURE__*/_react["default"].createElement(CaretIcon, {
|
|
237
214
|
disabled: disabled
|
|
238
|
-
},
|
|
215
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
|
216
|
+
icon: isOpen ? "arrow_drop_up" : "arrow_drop_down"
|
|
217
|
+
}), " "))), /*#__PURE__*/_react["default"].createElement(Popover.Portal, null, /*#__PURE__*/_react["default"].createElement(Popover.Content, {
|
|
239
218
|
asChild: true,
|
|
240
219
|
sideOffset: 1
|
|
241
220
|
}, /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
|
@@ -263,7 +242,7 @@ var sizes = {
|
|
|
263
242
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
264
243
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
265
244
|
};
|
|
266
|
-
var DropdownContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
245
|
+
var DropdownContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
267
246
|
return calculateWidth(props.margin, props.size);
|
|
268
247
|
}, function (props) {
|
|
269
248
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -276,18 +255,20 @@ var DropdownContainer = _styledComponents["default"].div(_templateObject || (_te
|
|
|
276
255
|
}, function (props) {
|
|
277
256
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
278
257
|
});
|
|
279
|
-
var DropdownTrigger = _styledComponents["default"].button(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: ", ";\n width: 100%;\n
|
|
258
|
+
var DropdownTrigger = _styledComponents["default"].button(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: ", ";\n width: 100%;\n height: ", ";\n min-width: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n background-color: ", ";\n color: ", ";\n cursor: ", ";\n\n ", ";\n"])), function (props) {
|
|
280
259
|
return props.theme.caretIconSpacing;
|
|
260
|
+
}, function (props) {
|
|
261
|
+
return props.theme.buttonHeight;
|
|
281
262
|
}, function (props) {
|
|
282
263
|
return props.label === "" ? "0px" : calculateWidth(props.margin, props.size);
|
|
283
264
|
}, function (props) {
|
|
284
|
-
return props.theme.
|
|
265
|
+
return props.theme.buttonBorderRadius;
|
|
285
266
|
}, function (props) {
|
|
286
|
-
return props.theme.
|
|
267
|
+
return props.theme.buttonBorderThickness;
|
|
287
268
|
}, function (props) {
|
|
288
|
-
return props.theme.
|
|
269
|
+
return props.theme.buttonBorderStyle;
|
|
289
270
|
}, function (props) {
|
|
290
|
-
return props.disabled ? props.theme.
|
|
271
|
+
return props.disabled ? props.theme.disabledButtonBorderColor : props.theme.buttonBorderColor;
|
|
291
272
|
}, function (props) {
|
|
292
273
|
return props.theme.buttonPaddingTop;
|
|
293
274
|
}, function (props) {
|
|
@@ -303,7 +284,7 @@ var DropdownTrigger = _styledComponents["default"].button(_templateObject2 || (_
|
|
|
303
284
|
}, function (props) {
|
|
304
285
|
return props.disabled ? "not-allowed" : "pointer";
|
|
305
286
|
}, function (props) {
|
|
306
|
-
return !props.disabled && "\n &:focus {\n outline: ".concat(props.theme.focusColor, "
|
|
287
|
+
return !props.disabled && "\n &:focus {\n outline: 2px solid ".concat(props.theme.focusColor, ";\n }\n &:hover {\n background-color: ").concat(props.theme.hoverButtonBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(props.theme.activeButtonBackgroundColor, ";\n }\n ");
|
|
307
288
|
});
|
|
308
289
|
var DropdownTriggerContent = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n gap: ", ";\n margin-left: 0px;\n margin-right: 0px;\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n"])), function (props) {
|
|
309
290
|
return props.theme.buttonIconSpacing;
|
|
@@ -317,18 +298,22 @@ var DropdownTriggerLabel = _styledComponents["default"].span(_templateObject4 ||
|
|
|
317
298
|
}, function (props) {
|
|
318
299
|
return props.theme.buttonFontWeight;
|
|
319
300
|
});
|
|
320
|
-
var DropdownTriggerIcon = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n color: ", ";\n\n
|
|
301
|
+
var DropdownTriggerIcon = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n color: ", ";\n font-size: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
|
|
321
302
|
return props.disabled ? props.theme.disabledColor : props.theme.buttonIconColor;
|
|
322
303
|
}, function (props) {
|
|
323
304
|
return props.theme.buttonIconSize;
|
|
324
305
|
}, function (props) {
|
|
325
306
|
return props.theme.buttonIconSize;
|
|
307
|
+
}, function (props) {
|
|
308
|
+
return props.theme.buttonIconSize;
|
|
326
309
|
});
|
|
327
|
-
var CaretIcon = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
|
|
310
|
+
var CaretIcon = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n color: ", ";\n font-size: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
|
|
328
311
|
return props.disabled ? props.theme.disabledColor : props.theme.caretIconColor;
|
|
329
312
|
}, function (props) {
|
|
330
313
|
return props.theme.caretIconSize;
|
|
331
314
|
}, function (props) {
|
|
332
315
|
return props.theme.caretIconSize;
|
|
316
|
+
}, function (props) {
|
|
317
|
+
return props.theme.caretIconSize;
|
|
333
318
|
});
|
|
334
319
|
var _default = exports["default"] = DxcDropdown;
|