@dxc-technology/halstack-react 0.0.0-ecc45e2 → 0.0.0-ede733c
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 +2 -2
- package/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +1329 -5
- package/HalstackContext.js +117 -77
- package/accordion/Accordion.js +118 -110
- package/accordion/Accordion.stories.tsx +103 -15
- package/accordion/Accordion.test.js +10 -11
- package/accordion/types.d.ts +1 -0
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +24 -65
- package/accordion-group/AccordionGroup.stories.tsx +27 -1
- package/accordion-group/AccordionGroup.test.js +21 -46
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +7 -0
- package/alert/Alert.js +5 -9
- package/alert/Alert.stories.tsx +28 -0
- package/alert/Alert.test.js +1 -1
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.js +4 -6
- package/box/Box.stories.tsx +15 -0
- package/box/Box.test.js +1 -1
- package/box/types.d.ts +1 -0
- package/bulleted-list/BulletedList.js +4 -2
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +31 -4
- package/button/Button.js +13 -16
- package/button/Button.stories.tsx +151 -9
- package/button/Button.test.js +1 -1
- package/button/types.d.ts +3 -3
- package/card/Card.js +12 -13
- package/card/Card.stories.tsx +12 -13
- package/card/Card.test.js +1 -1
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +94 -101
- package/checkbox/Checkbox.stories.tsx +131 -59
- package/checkbox/Checkbox.test.js +94 -17
- package/checkbox/types.d.ts +4 -0
- package/chip/Chip.js +28 -49
- package/chip/Chip.stories.tsx +121 -26
- package/chip/Chip.test.js +3 -5
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +146 -0
- package/common/coreTokens.js +167 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1482 -0
- package/common/variables.js +994 -1137
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +134 -237
- package/date-input/DateInput.stories.tsx +199 -33
- package/date-input/DateInput.test.js +494 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -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 +126 -0
- package/date-input/types.d.ts +51 -0
- package/dialog/Dialog.js +60 -73
- package/dialog/Dialog.stories.tsx +229 -121
- package/dialog/Dialog.test.js +302 -3
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.js +43 -42
- package/dropdown/Dropdown.stories.tsx +210 -84
- package/dropdown/Dropdown.test.js +22 -27
- package/dropdown/DropdownMenu.js +12 -18
- package/dropdown/DropdownMenuItem.js +5 -18
- package/dropdown/types.d.ts +3 -3
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +174 -220
- package/file-input/FileInput.stories.tsx +122 -11
- package/file-input/FileInput.test.js +14 -14
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +39 -63
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +1 -1
- package/flex/Flex.js +33 -19
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +83 -7
- package/footer/Footer.js +6 -8
- package/footer/Footer.stories.tsx +99 -1
- package/footer/Footer.test.js +14 -26
- package/footer/types.d.ts +1 -0
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +91 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/header/Header.d.ts +3 -2
- package/header/Header.js +21 -23
- package/header/Header.stories.tsx +152 -9
- package/header/Header.test.js +2 -2
- package/header/types.d.ts +3 -2
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.js +1 -1
- package/inset/Inset.stories.tsx +2 -1
- package/layout/ApplicationLayout.d.ts +3 -3
- package/layout/ApplicationLayout.js +1 -1
- package/layout/ApplicationLayout.stories.tsx +1 -0
- package/layout/types.d.ts +2 -3
- package/link/Link.js +4 -4
- package/link/Link.stories.tsx +60 -0
- package/link/Link.test.js +2 -4
- package/link/types.d.ts +2 -2
- package/main.d.ts +3 -2
- package/main.js +9 -1
- package/{tabs-nav → nav-tabs}/NavTabs.js +1 -1
- package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +96 -6
- package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
- package/{tabs-nav → nav-tabs}/Tab.js +38 -18
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.test.js +44 -8
- package/package.json +15 -20
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +7 -15
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +45 -48
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +5 -5
- package/password-input/PasswordInput.test.js +14 -13
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +5 -5
- package/progress-bar/ProgressBar.stories.jsx +35 -2
- package/progress-bar/ProgressBar.test.js +1 -1
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.js +11 -12
- package/quick-nav/QuickNav.stories.tsx +111 -19
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +15 -13
- package/radio-group/RadioGroup.stories.tsx +132 -18
- package/radio-group/RadioGroup.test.js +124 -97
- 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 +49 -108
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +41 -64
- package/resultsetTable/types.d.ts +1 -1
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +5 -35
- package/select/Option.js +11 -24
- package/select/Select.js +59 -36
- package/select/Select.stories.tsx +494 -150
- package/select/Select.test.js +341 -288
- package/select/types.d.ts +2 -2
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +66 -96
- package/sidenav/Sidenav.stories.tsx +165 -63
- package/sidenav/types.d.ts +21 -18
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +119 -95
- package/slider/Slider.stories.tsx +64 -1
- package/slider/Slider.test.js +88 -25
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.js +17 -23
- package/spinner/Spinner.stories.jsx +53 -27
- package/spinner/Spinner.test.js +1 -1
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +96 -85
- package/switch/Switch.stories.tsx +33 -0
- package/switch/Switch.test.js +27 -14
- package/switch/types.d.ts +8 -3
- package/table/Table.js +3 -3
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +2 -2
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +132 -0
- package/tabs/Tabs.js +358 -108
- package/tabs/Tabs.stories.tsx +119 -5
- package/tabs/Tabs.test.js +220 -10
- package/tabs/types.d.ts +12 -2
- package/tag/Tag.js +8 -10
- package/tag/Tag.stories.tsx +14 -1
- package/tag/Tag.test.js +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +40 -11
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +189 -277
- package/text-input/TextInput.stories.tsx +280 -184
- package/text-input/TextInput.test.js +736 -725
- package/text-input/types.d.ts +21 -2
- package/textarea/Textarea.js +3 -4
- package/textarea/Textarea.stories.jsx +60 -1
- package/textarea/Textarea.test.js +2 -4
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +7 -4
- package/toggle-group/ToggleGroup.stories.tsx +42 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +14 -113
- package/typography/Typography.stories.tsx +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +1 -1
- package/useTranslatedLabels.d.ts +84 -1
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +138 -0
- package/wizard/Wizard.js +2 -2
- package/wizard/Wizard.stories.tsx +20 -0
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +5 -6
- package/common/RequiredComponent.js +0 -32
- /package/{tabs-nav → grid}/types.js +0 -0
- /package/{tabs-nav → nav-tabs}/NavTabs.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/types.d.ts +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DxcSidenav from "./Sidenav";
|
|
3
|
+
import DxcSelect from "../select/Select";
|
|
4
|
+
import DxcInset from "../inset/Inset";
|
|
3
5
|
import Title from "../../.storybook/components/Title";
|
|
4
6
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
7
|
import { userEvent, within } from "@storybook/testing-library";
|
|
8
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
6
9
|
|
|
7
10
|
export default {
|
|
8
11
|
title: "Sidenav",
|
|
@@ -10,9 +13,26 @@ export default {
|
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
const iconSVG = (
|
|
13
|
-
<svg
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
<svg
|
|
17
|
+
version="1.1"
|
|
18
|
+
id="Capa_1"
|
|
19
|
+
x="0px"
|
|
20
|
+
y="0px"
|
|
21
|
+
width="438.536px"
|
|
22
|
+
height="438.536px"
|
|
23
|
+
viewBox="0 0 438.536 438.536"
|
|
24
|
+
fill="currentColor"
|
|
25
|
+
>
|
|
26
|
+
<g>
|
|
27
|
+
<path
|
|
28
|
+
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
|
|
29
|
+
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
|
|
30
|
+
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
31
|
+
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
|
|
32
|
+
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
|
|
33
|
+
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"
|
|
34
|
+
/>
|
|
35
|
+
</g>
|
|
16
36
|
</svg>
|
|
17
37
|
);
|
|
18
38
|
|
|
@@ -20,11 +40,17 @@ const TitleComponent = () => {
|
|
|
20
40
|
return <DxcSidenav.Title>Dxc technology</DxcSidenav.Title>;
|
|
21
41
|
};
|
|
22
42
|
|
|
43
|
+
const opinionatedTheme = {
|
|
44
|
+
sidenav: {
|
|
45
|
+
baseColor: "#f2f2f2",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
23
49
|
export const Chromatic = () => (
|
|
24
50
|
<>
|
|
25
51
|
<ExampleContainer>
|
|
26
52
|
<Title title="Default sidenav" theme="light" level={4} />
|
|
27
|
-
<DxcSidenav title={<
|
|
53
|
+
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
28
54
|
<DxcSidenav.Section>
|
|
29
55
|
<p>
|
|
30
56
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
|
|
@@ -41,12 +67,18 @@ export const Chromatic = () => (
|
|
|
41
67
|
</DxcSidenav.Group>
|
|
42
68
|
</DxcSidenav.Section>
|
|
43
69
|
<DxcSidenav.Section>
|
|
44
|
-
<DxcSidenav.Group
|
|
70
|
+
<DxcSidenav.Group
|
|
71
|
+
collapsable={true}
|
|
72
|
+
title="Section Group"
|
|
73
|
+
icon="https://cdn-icons-png.flaticon.com/512/5039/5039041.png"
|
|
74
|
+
>
|
|
45
75
|
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
46
76
|
<DxcSidenav.Link icon={iconSVG}>Group Link</DxcSidenav.Link>
|
|
47
77
|
</DxcSidenav.Group>
|
|
48
|
-
<DxcSidenav.Link icon=
|
|
49
|
-
|
|
78
|
+
<DxcSidenav.Link icon="https://upload.wikimedia.org/wikipedia/commons/7/73/Flat_tick_icon.svg" newWindow>
|
|
79
|
+
Single Link
|
|
80
|
+
</DxcSidenav.Link>
|
|
81
|
+
<DxcSidenav.Link newWindow>Single Link</DxcSidenav.Link>
|
|
50
82
|
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
51
83
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
52
84
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
@@ -55,53 +87,78 @@ export const Chromatic = () => (
|
|
|
55
87
|
</DxcSidenav.Section>
|
|
56
88
|
</DxcSidenav>
|
|
57
89
|
</ExampleContainer>
|
|
90
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
91
|
+
<Title title="Focused options sidenav" theme="light" level={4} />
|
|
92
|
+
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
93
|
+
<DxcSidenav.Section>
|
|
94
|
+
<p>
|
|
95
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
|
|
96
|
+
vitae lacinia libero.
|
|
97
|
+
</p>
|
|
98
|
+
</DxcSidenav.Section>
|
|
99
|
+
<DxcSidenav.Section>
|
|
100
|
+
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
101
|
+
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
102
|
+
<DxcSidenav.Link icon="https://cdn-icons-png.flaticon.com/512/5039/5039041.png">Group Link</DxcSidenav.Link>
|
|
103
|
+
</DxcSidenav.Group>
|
|
104
|
+
</DxcSidenav.Section>
|
|
105
|
+
<DxcSidenav.Section>
|
|
106
|
+
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
107
|
+
<DxcSidenav.Link selected icon={iconSVG}>
|
|
108
|
+
Group Link
|
|
109
|
+
</DxcSidenav.Link>
|
|
110
|
+
</DxcSidenav.Group>
|
|
111
|
+
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
112
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
113
|
+
</DxcSidenav.Group>
|
|
114
|
+
</DxcSidenav.Section>
|
|
115
|
+
</DxcSidenav>
|
|
116
|
+
</ExampleContainer>
|
|
117
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
118
|
+
<ExampleContainer>
|
|
119
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
120
|
+
<DxcSidenav title={<TitleComponent />}>
|
|
121
|
+
<DxcSidenav.Section>
|
|
122
|
+
<p>
|
|
123
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
|
|
124
|
+
vitae lacinia libero.
|
|
125
|
+
</p>
|
|
126
|
+
</DxcSidenav.Section>
|
|
127
|
+
<DxcSidenav.Section>
|
|
128
|
+
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
129
|
+
<DxcSidenav.Group collapsable={false} title="Single Group" icon={iconSVG}>
|
|
130
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
131
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
132
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
133
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
134
|
+
</DxcSidenav.Group>
|
|
135
|
+
</DxcSidenav.Section>
|
|
136
|
+
<DxcSidenav.Section>
|
|
137
|
+
<DxcSidenav.Group collapsable={true} title="Section Group" icon={iconSVG}>
|
|
138
|
+
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
139
|
+
<DxcSidenav.Link icon={iconSVG}>Group Link</DxcSidenav.Link>
|
|
140
|
+
</DxcSidenav.Group>
|
|
141
|
+
<DxcSidenav.Link icon={iconSVG}>Single Link</DxcSidenav.Link>
|
|
142
|
+
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
143
|
+
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
144
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
145
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
146
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
147
|
+
</DxcSidenav.Group>
|
|
148
|
+
</DxcSidenav.Section>
|
|
149
|
+
</DxcSidenav>
|
|
150
|
+
</HalstackProvider>
|
|
151
|
+
</ExampleContainer>
|
|
58
152
|
</>
|
|
59
153
|
);
|
|
60
154
|
|
|
61
|
-
|
|
62
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
63
|
-
<Title title="Default sidenav" theme="light" level={4} />
|
|
64
|
-
<DxcSidenav title={<TitleComponent />}>
|
|
65
|
-
<DxcSidenav.Section>
|
|
66
|
-
<p>
|
|
67
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse vitae
|
|
68
|
-
lacinia libero.
|
|
69
|
-
</p>
|
|
70
|
-
</DxcSidenav.Section>
|
|
71
|
-
<DxcSidenav.Section>
|
|
72
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
73
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
74
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
75
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
76
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
77
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
78
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
79
|
-
</DxcSidenav.Group>
|
|
80
|
-
</DxcSidenav.Section>
|
|
81
|
-
<DxcSidenav.Section>
|
|
82
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
83
|
-
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
84
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
85
|
-
</DxcSidenav.Group>
|
|
86
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
87
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
88
|
-
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
89
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
90
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
91
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
92
|
-
</DxcSidenav.Group>
|
|
93
|
-
</DxcSidenav.Section>
|
|
94
|
-
</DxcSidenav>
|
|
95
|
-
</ExampleContainer>
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
const CollapsedGroup = () => (
|
|
155
|
+
const CollapsedGroupSidenav = () => (
|
|
99
156
|
<>
|
|
100
157
|
<ExampleContainer>
|
|
101
|
-
<Title title="
|
|
102
|
-
<DxcSidenav title={<
|
|
158
|
+
<Title title="Collapsed group with a selected link" theme="light" level={4} />
|
|
159
|
+
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
103
160
|
<DxcSidenav.Section>
|
|
104
|
-
<DxcSidenav.Group collapsable={true} title="
|
|
161
|
+
<DxcSidenav.Group collapsable={true} title="Collapsed Group" icon={iconSVG}>
|
|
105
162
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
106
163
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
107
164
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
@@ -109,11 +166,11 @@ const CollapsedGroup = () => (
|
|
|
109
166
|
</DxcSidenav.Group>
|
|
110
167
|
</DxcSidenav.Section>
|
|
111
168
|
<DxcSidenav.Section>
|
|
112
|
-
<DxcSidenav.Group collapsable={true} title="
|
|
113
|
-
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
169
|
+
<DxcSidenav.Group collapsable={true} title="Collapsed Group">
|
|
114
170
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
171
|
+
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
115
172
|
</DxcSidenav.Group>
|
|
116
|
-
<DxcSidenav.Group collapsable={
|
|
173
|
+
<DxcSidenav.Group collapsable={true} title="Section Group">
|
|
117
174
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
118
175
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
119
176
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
@@ -124,14 +181,14 @@ const CollapsedGroup = () => (
|
|
|
124
181
|
</>
|
|
125
182
|
);
|
|
126
183
|
|
|
127
|
-
const
|
|
184
|
+
const HoveredGroupSidenav = () => (
|
|
128
185
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
129
|
-
<Title title="
|
|
130
|
-
<DxcSidenav title={<
|
|
186
|
+
<Title title="Hover state for groups (selected and not)" theme="light" level={4} />
|
|
187
|
+
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
131
188
|
<DxcSidenav.Section>
|
|
132
189
|
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
133
190
|
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
134
|
-
<DxcSidenav.Group collapsable={true} title="
|
|
191
|
+
<DxcSidenav.Group collapsable={true} title="Collapsed Group">
|
|
135
192
|
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
136
193
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
137
194
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
@@ -145,36 +202,81 @@ const HoverSidenav = () => (
|
|
|
145
202
|
</DxcSidenav.Group>
|
|
146
203
|
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
147
204
|
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
148
|
-
<DxcSidenav.Group collapsable={true} title="
|
|
205
|
+
<DxcSidenav.Group collapsable={true} title="Collapsed Group">
|
|
149
206
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
150
207
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
151
208
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
152
209
|
</DxcSidenav.Group>
|
|
210
|
+
<DxcSidenav.Group collapsable={true} title="Collapsed Group">
|
|
211
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
212
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
213
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
214
|
+
</DxcSidenav.Group>
|
|
215
|
+
</DxcSidenav.Section>
|
|
216
|
+
</DxcSidenav>
|
|
217
|
+
</ExampleContainer>
|
|
218
|
+
);
|
|
153
219
|
|
|
154
|
-
|
|
220
|
+
const ActiveGroupSidenav = () => (
|
|
221
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
222
|
+
<Title title="Active state for groups (selected and not)" theme="light" level={4} />
|
|
223
|
+
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
224
|
+
<DxcSidenav.Section>
|
|
225
|
+
<DxcInset space="1rem">
|
|
226
|
+
<DxcSelect
|
|
227
|
+
defaultValue="1"
|
|
228
|
+
options={[
|
|
229
|
+
{ label: "v1.0.0", value: "1" },
|
|
230
|
+
{ label: "v2.0.0", value: "2" },
|
|
231
|
+
{ label: "v3.0.0", value: "3" },
|
|
232
|
+
{ label: "v4.0.0", value: "4" },
|
|
233
|
+
]}
|
|
234
|
+
size="fillParent"
|
|
235
|
+
/>
|
|
236
|
+
</DxcInset>
|
|
237
|
+
</DxcSidenav.Section>
|
|
238
|
+
<DxcSidenav.Section>
|
|
239
|
+
<DxcSidenav.Group collapsable={true} title="Collapsed Group">
|
|
240
|
+
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
155
241
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
156
242
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
157
243
|
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
158
244
|
</DxcSidenav.Group>
|
|
159
245
|
</DxcSidenav.Section>
|
|
246
|
+
<DxcSidenav.Section>
|
|
247
|
+
<DxcSidenav.Group collapsable={true} title="Not Collapsed Group">
|
|
248
|
+
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
249
|
+
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
250
|
+
</DxcSidenav.Group>
|
|
251
|
+
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
252
|
+
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
253
|
+
</DxcSidenav.Section>
|
|
160
254
|
</DxcSidenav>
|
|
161
255
|
</ExampleContainer>
|
|
162
256
|
);
|
|
163
257
|
|
|
164
|
-
export const
|
|
165
|
-
|
|
258
|
+
export const CollapsableGroup = CollapsedGroupSidenav.bind({});
|
|
259
|
+
CollapsableGroup.play = async ({ canvasElement }) => {
|
|
166
260
|
const canvas = within(canvasElement);
|
|
167
|
-
const collapsableGroups = canvas.getAllByText("
|
|
261
|
+
const collapsableGroups = canvas.getAllByText("Collapsed Group");
|
|
168
262
|
collapsableGroups.forEach((group) => {
|
|
169
263
|
userEvent.click(group);
|
|
170
264
|
});
|
|
171
265
|
};
|
|
172
266
|
|
|
173
|
-
export const
|
|
174
|
-
|
|
267
|
+
export const CollapsedHoverGroup = HoveredGroupSidenav.bind({});
|
|
268
|
+
CollapsedHoverGroup.play = async ({ canvasElement }) => {
|
|
175
269
|
const canvas = within(canvasElement);
|
|
176
|
-
const collapsableGroups = canvas.getAllByText("
|
|
270
|
+
const collapsableGroups = canvas.getAllByText("Collapsed Group");
|
|
177
271
|
collapsableGroups.forEach((group) => {
|
|
178
272
|
userEvent.click(group);
|
|
179
273
|
});
|
|
274
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
180
275
|
};
|
|
276
|
+
|
|
277
|
+
export const CollapsedActiveGroup = ActiveGroupSidenav.bind({});
|
|
278
|
+
CollapsedActiveGroup.play = async ({ canvasElement }) => {
|
|
279
|
+
const canvas = within(canvasElement);
|
|
280
|
+
const collapsableGroups = canvas.getAllByText("Collapsed Group");
|
|
281
|
+
userEvent.click(collapsableGroups[0]);
|
|
282
|
+
};
|
package/sidenav/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
3
3
|
declare type SidenavPropsType = {
|
|
4
|
-
/**
|
|
5
|
-
* The area inside the sidenav. This area can be used to render the content inside the sidenav.
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactNode;
|
|
8
4
|
/**
|
|
9
5
|
* The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
|
|
10
6
|
*/
|
|
11
7
|
title?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The area inside the sidenav. This area can be used to render the content inside the sidenav.
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
12
|
};
|
|
13
13
|
export declare type SidenavTitlePropsType = {
|
|
14
14
|
/**
|
|
@@ -23,28 +23,25 @@ export declare type SidenavSectionPropsType = {
|
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
};
|
|
25
25
|
export declare type SidenavGroupPropsType = {
|
|
26
|
-
/**
|
|
27
|
-
* The area inside the sidenav group. This area can be used to render sidenav links.
|
|
28
|
-
*/
|
|
29
|
-
children: React.ReactNode;
|
|
30
26
|
/**
|
|
31
27
|
* The title of the sidenav group.
|
|
32
28
|
*/
|
|
33
29
|
title?: string;
|
|
34
30
|
/**
|
|
35
|
-
* If true the sidenav group
|
|
31
|
+
* If true, the sidenav group will be a button that will allow you to collapse the links contained within it.
|
|
32
|
+
* In addition, if it's collapsed and contains the currently selected link, the group title will also be marked as selected.
|
|
36
33
|
*/
|
|
37
34
|
collapsable?: boolean;
|
|
38
35
|
/**
|
|
39
36
|
* The icon to be displayed next to the title of the group.
|
|
40
37
|
*/
|
|
41
38
|
icon?: string | SVG;
|
|
42
|
-
};
|
|
43
|
-
export declare type SidenavLinkPropsType = {
|
|
44
39
|
/**
|
|
45
|
-
*
|
|
40
|
+
* The area inside the sidenav group. This area can be used to render sidenav links.
|
|
46
41
|
*/
|
|
47
|
-
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
};
|
|
44
|
+
export declare type SidenavLinkPropsType = {
|
|
48
45
|
/**
|
|
49
46
|
* Page to be opened when the user clicks on the link.
|
|
50
47
|
*/
|
|
@@ -58,16 +55,22 @@ export declare type SidenavLinkPropsType = {
|
|
|
58
55
|
*/
|
|
59
56
|
icon?: string | SVG;
|
|
60
57
|
/**
|
|
61
|
-
* If true, the link will be marked as selected.
|
|
58
|
+
* If true, the link will be marked as selected. Moreover, in that same case,
|
|
59
|
+
* if it is contained within a collapsed group, and consequently, the currently selected link is not visible,
|
|
60
|
+
* the group title will appear as selected too.
|
|
62
61
|
*/
|
|
63
62
|
selected?: boolean;
|
|
64
63
|
/**
|
|
65
|
-
*
|
|
64
|
+
* This function will be called when the user clicks the link and the event will be passed to this function.
|
|
66
65
|
*/
|
|
67
|
-
|
|
66
|
+
onClick?: ($event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
68
67
|
/**
|
|
69
|
-
*
|
|
68
|
+
* Value of the tabindex.
|
|
69
|
+
*/
|
|
70
|
+
tabIndex?: number;
|
|
71
|
+
/**
|
|
72
|
+
* The area inside the sidenav link.
|
|
70
73
|
*/
|
|
71
|
-
|
|
74
|
+
children: React.ReactNode;
|
|
72
75
|
};
|
|
73
76
|
export default SidenavPropsType;
|
package/slider/Slider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import SliderPropsType from "./types";
|
|
3
|
-
declare const DxcSlider:
|
|
3
|
+
declare const DxcSlider: React.ForwardRefExoticComponent<SliderPropsType & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default DxcSlider;
|