@dxc-technology/halstack-react 0.0.0-a062293 → 0.0.0-a0cade1
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/README.md +46 -0
- package/dist/index.d.mts +6516 -0
- package/dist/index.d.ts +6516 -0
- package/dist/index.js +12982 -0
- package/dist/index.mjs +12925 -0
- package/package.json +75 -67
- package/BackgroundColorContext.d.ts +0 -10
- package/BackgroundColorContext.js +0 -47
- package/HalstackContext.d.ts +0 -12
- package/HalstackContext.js +0 -294
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -239
- package/accordion/Accordion.stories.tsx +0 -346
- package/accordion/Accordion.test.js +0 -71
- package/accordion/types.d.ts +0 -69
- package/accordion/types.js +0 -5
- package/accordion-group/AccordionGroup.d.ts +0 -7
- package/accordion-group/AccordionGroup.js +0 -149
- package/accordion-group/AccordionGroup.stories.tsx +0 -251
- package/accordion-group/AccordionGroup.test.js +0 -126
- package/accordion-group/types.d.ts +0 -79
- package/accordion-group/types.js +0 -5
- package/alert/Alert.d.ts +0 -4
- package/alert/Alert.js +0 -293
- package/alert/Alert.stories.tsx +0 -170
- package/alert/Alert.test.js +0 -92
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- package/badge/Badge.d.ts +0 -4
- package/badge/Badge.js +0 -61
- package/badge/types.d.ts +0 -5
- package/badge/types.js +0 -5
- package/bleed/Bleed.d.ts +0 -3
- package/bleed/Bleed.js +0 -51
- package/bleed/Bleed.stories.tsx +0 -341
- package/bleed/types.d.ts +0 -37
- package/bleed/types.js +0 -5
- package/box/Box.d.ts +0 -4
- package/box/Box.js +0 -116
- package/box/Box.stories.tsx +0 -132
- package/box/Box.test.js +0 -18
- package/box/types.d.ts +0 -44
- package/box/types.js +0 -5
- package/bulleted-list/BulletedList.d.ts +0 -7
- package/bulleted-list/BulletedList.js +0 -123
- package/bulleted-list/BulletedList.stories.tsx +0 -200
- package/bulleted-list/types.d.ts +0 -11
- package/bulleted-list/types.js +0 -5
- package/button/Button.d.ts +0 -4
- package/button/Button.js +0 -154
- package/button/Button.stories.tsx +0 -334
- package/button/Button.test.js +0 -35
- package/button/types.d.ts +0 -53
- package/button/types.js +0 -5
- package/card/Card.d.ts +0 -4
- package/card/Card.js +0 -161
- package/card/Card.stories.tsx +0 -201
- package/card/Card.test.js +0 -50
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +0 -68
- package/card/types.js +0 -5
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -250
- package/checkbox/Checkbox.stories.tsx +0 -208
- package/checkbox/Checkbox.test.js +0 -155
- package/checkbox/types.d.ts +0 -68
- package/checkbox/types.js +0 -5
- package/chip/Chip.d.ts +0 -4
- package/chip/Chip.js +0 -149
- package/chip/Chip.stories.tsx +0 -151
- package/chip/Chip.test.js +0 -56
- package/chip/types.d.ts +0 -45
- package/chip/types.js +0 -5
- package/common/OpenSans.css +0 -81
- 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/common/utils.js +0 -22
- package/common/variables.js +0 -1512
- package/date-input/Calendar.d.ts +0 -4
- package/date-input/Calendar.js +0 -246
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -269
- package/date-input/DateInput.stories.tsx +0 -237
- package/date-input/DateInput.test.js +0 -835
- package/date-input/DatePicker.d.ts +0 -4
- package/date-input/DatePicker.js +0 -132
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -75
- package/date-input/YearPicker.d.ts +0 -4
- package/date-input/YearPicker.js +0 -116
- package/date-input/types.d.ts +0 -158
- package/date-input/types.js +0 -5
- package/dialog/Dialog.d.ts +0 -4
- package/dialog/Dialog.js +0 -162
- package/dialog/Dialog.stories.tsx +0 -267
- package/dialog/Dialog.test.js +0 -70
- package/dialog/types.d.ts +0 -44
- package/dialog/types.js +0 -5
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -389
- package/dropdown/Dropdown.stories.tsx +0 -320
- package/dropdown/Dropdown.test.js +0 -585
- package/dropdown/DropdownMenu.d.ts +0 -4
- package/dropdown/DropdownMenu.js +0 -80
- package/dropdown/DropdownMenuItem.d.ts +0 -4
- package/dropdown/DropdownMenuItem.js +0 -92
- package/dropdown/types.d.ts +0 -100
- package/dropdown/types.js +0 -5
- package/file-input/FileInput.d.ts +0 -4
- package/file-input/FileInput.js +0 -551
- package/file-input/FileInput.stories.tsx +0 -535
- package/file-input/FileInput.test.js +0 -498
- package/file-input/FileItem.d.ts +0 -4
- package/file-input/FileItem.js +0 -161
- package/file-input/types.d.ts +0 -129
- package/file-input/types.js +0 -5
- package/flex/Flex.d.ts +0 -4
- package/flex/Flex.js +0 -69
- package/flex/Flex.stories.tsx +0 -103
- package/flex/types.d.ts +0 -32
- package/flex/types.js +0 -5
- package/footer/Footer.d.ts +0 -4
- package/footer/Footer.js +0 -185
- package/footer/Footer.stories.tsx +0 -137
- package/footer/Footer.test.js +0 -109
- package/footer/Icons.d.ts +0 -2
- package/footer/Icons.js +0 -77
- package/footer/types.d.ts +0 -66
- package/footer/types.js +0 -5
- package/header/Header.d.ts +0 -7
- package/header/Header.js +0 -305
- package/header/Header.stories.tsx +0 -172
- package/header/Header.test.js +0 -79
- package/header/Icons.d.ts +0 -2
- package/header/Icons.js +0 -34
- package/header/types.d.ts +0 -48
- package/header/types.js +0 -5
- package/heading/Heading.d.ts +0 -4
- package/heading/Heading.js +0 -159
- package/heading/Heading.stories.tsx +0 -54
- package/heading/Heading.test.js +0 -186
- package/heading/types.d.ts +0 -33
- package/heading/types.js +0 -5
- package/inset/Inset.d.ts +0 -3
- package/inset/Inset.js +0 -51
- package/inset/Inset.stories.tsx +0 -229
- package/inset/types.d.ts +0 -37
- package/inset/types.js +0 -5
- package/layout/ApplicationLayout.d.ts +0 -20
- package/layout/ApplicationLayout.js +0 -171
- package/layout/ApplicationLayout.stories.tsx +0 -162
- package/layout/Icons.d.ts +0 -5
- package/layout/Icons.js +0 -66
- package/layout/SidenavContext.d.ts +0 -5
- package/layout/SidenavContext.js +0 -19
- package/layout/types.d.ts +0 -42
- package/layout/types.js +0 -5
- package/link/Link.d.ts +0 -4
- package/link/Link.js +0 -136
- package/link/Link.stories.tsx +0 -193
- package/link/Link.test.js +0 -83
- package/link/types.d.ts +0 -54
- package/link/types.js +0 -5
- package/main.d.ts +0 -44
- package/main.js +0 -369
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -76
- package/number-input/NumberInput.stories.tsx +0 -115
- package/number-input/NumberInput.test.js +0 -542
- package/number-input/NumberInputContext.d.ts +0 -4
- package/number-input/NumberInputContext.js +0 -19
- package/number-input/numberInputContextTypes.d.ts +0 -19
- package/number-input/numberInputContextTypes.js +0 -5
- package/number-input/types.d.ts +0 -124
- package/number-input/types.js +0 -5
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -54
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -165
- package/paginator/Paginator.stories.tsx +0 -63
- package/paginator/Paginator.test.js +0 -315
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- package/paragraph/Paragraph.d.ts +0 -6
- package/paragraph/Paragraph.js +0 -38
- package/paragraph/Paragraph.stories.tsx +0 -44
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -166
- package/password-input/PasswordInput.stories.tsx +0 -131
- package/password-input/PasswordInput.test.js +0 -181
- package/password-input/types.d.ts +0 -110
- package/password-input/types.js +0 -5
- package/progress-bar/ProgressBar.d.ts +0 -4
- package/progress-bar/ProgressBar.js +0 -176
- package/progress-bar/ProgressBar.stories.jsx +0 -60
- package/progress-bar/ProgressBar.test.js +0 -110
- package/progress-bar/types.d.ts +0 -36
- package/progress-bar/types.js +0 -5
- package/quick-nav/QuickNav.d.ts +0 -4
- package/quick-nav/QuickNav.js +0 -117
- package/quick-nav/QuickNav.stories.tsx +0 -342
- package/quick-nav/types.d.ts +0 -21
- package/quick-nav/types.js +0 -5
- package/radio-group/Radio.d.ts +0 -4
- package/radio-group/Radio.js +0 -156
- package/radio-group/RadioGroup.d.ts +0 -4
- package/radio-group/RadioGroup.js +0 -283
- package/radio-group/RadioGroup.stories.tsx +0 -101
- package/radio-group/RadioGroup.test.js +0 -722
- package/radio-group/types.d.ts +0 -114
- package/radio-group/types.js +0 -5
- package/resultsetTable/Icons.d.ts +0 -7
- package/resultsetTable/Icons.js +0 -51
- package/resultsetTable/ResultsetTable.d.ts +0 -4
- package/resultsetTable/ResultsetTable.js +0 -195
- package/resultsetTable/ResultsetTable.stories.tsx +0 -300
- package/resultsetTable/ResultsetTable.test.js +0 -325
- package/resultsetTable/types.d.ts +0 -67
- package/resultsetTable/types.js +0 -5
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -93
- package/select/Listbox.d.ts +0 -4
- package/select/Listbox.js +0 -169
- package/select/Option.d.ts +0 -4
- package/select/Option.js +0 -97
- package/select/Select.d.ts +0 -4
- package/select/Select.js +0 -664
- package/select/Select.stories.tsx +0 -670
- package/select/Select.test.js +0 -2228
- package/select/types.d.ts +0 -210
- package/select/types.js +0 -5
- package/sidenav/Sidenav.d.ts +0 -10
- package/sidenav/Sidenav.js +0 -266
- package/sidenav/Sidenav.stories.tsx +0 -189
- package/sidenav/Sidenav.test.js +0 -44
- package/sidenav/types.d.ts +0 -73
- package/sidenav/types.js +0 -5
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -343
- package/slider/Slider.stories.tsx +0 -183
- package/slider/Slider.test.js +0 -250
- package/slider/types.d.ts +0 -86
- package/slider/types.js +0 -5
- package/spinner/Spinner.d.ts +0 -4
- package/spinner/Spinner.js +0 -250
- package/spinner/Spinner.stories.jsx +0 -103
- package/spinner/Spinner.test.js +0 -64
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -262
- package/switch/Switch.stories.tsx +0 -138
- package/switch/Switch.test.js +0 -225
- package/switch/types.d.ts +0 -66
- package/switch/types.js +0 -5
- package/table/Table.d.ts +0 -4
- package/table/Table.js +0 -118
- package/table/Table.stories.jsx +0 -277
- package/table/Table.test.js +0 -26
- package/table/types.d.ts +0 -21
- package/table/types.js +0 -5
- package/tabs/Tab.d.ts +0 -4
- package/tabs/Tab.js +0 -133
- package/tabs/Tabs.d.ts +0 -4
- package/tabs/Tabs.js +0 -467
- package/tabs/Tabs.stories.tsx +0 -188
- package/tabs/Tabs.test.js +0 -351
- package/tabs/types.d.ts +0 -92
- package/tabs/types.js +0 -5
- package/tabs-nav/NavTabs.d.ts +0 -8
- package/tabs-nav/NavTabs.js +0 -125
- package/tabs-nav/NavTabs.stories.tsx +0 -172
- package/tabs-nav/NavTabs.test.js +0 -82
- package/tabs-nav/Tab.d.ts +0 -4
- package/tabs-nav/Tab.js +0 -128
- package/tabs-nav/types.d.ts +0 -53
- package/tabs-nav/types.js +0 -5
- package/tag/Tag.d.ts +0 -4
- package/tag/Tag.js +0 -183
- package/tag/Tag.stories.tsx +0 -142
- package/tag/Tag.test.js +0 -60
- package/tag/types.d.ts +0 -69
- package/tag/types.js +0 -5
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -60
- package/text-input/Suggestion.d.ts +0 -4
- package/text-input/Suggestion.js +0 -84
- package/text-input/Suggestions.d.ts +0 -4
- package/text-input/Suggestions.js +0 -134
- package/text-input/TextInput.d.ts +0 -4
- package/text-input/TextInput.js +0 -673
- package/text-input/TextInput.stories.tsx +0 -501
- package/text-input/TextInput.test.js +0 -1724
- package/text-input/types.d.ts +0 -197
- package/text-input/types.js +0 -5
- package/textarea/Textarea.d.ts +0 -4
- package/textarea/Textarea.js +0 -277
- package/textarea/Textarea.stories.jsx +0 -157
- package/textarea/Textarea.test.js +0 -437
- package/textarea/types.d.ts +0 -137
- package/textarea/types.js +0 -5
- package/toggle-group/ToggleGroup.d.ts +0 -4
- package/toggle-group/ToggleGroup.js +0 -215
- package/toggle-group/ToggleGroup.stories.tsx +0 -173
- package/toggle-group/ToggleGroup.test.js +0 -156
- package/toggle-group/types.d.ts +0 -105
- package/toggle-group/types.js +0 -5
- package/typography/Typography.d.ts +0 -4
- package/typography/Typography.js +0 -131
- package/typography/Typography.stories.tsx +0 -198
- package/typography/types.d.ts +0 -18
- package/typography/types.js +0 -5
- package/useTheme.d.ts +0 -2
- package/useTheme.js +0 -22
- package/useTranslatedLabels.d.ts +0 -2
- package/useTranslatedLabels.js +0 -20
- package/wizard/Wizard.d.ts +0 -4
- package/wizard/Wizard.js +0 -285
- package/wizard/Wizard.stories.tsx +0 -233
- package/wizard/Wizard.test.js +0 -141
- package/wizard/types.d.ts +0 -65
- package/wizard/types.js +0 -5
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import DxcSidenav from "./Sidenav";
|
|
3
|
-
import Title from "../../.storybook/components/Title";
|
|
4
|
-
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
-
import { userEvent, within } from "@storybook/testing-library";
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: "Sidenav",
|
|
9
|
-
component: DxcSidenav,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const iconSVG = (
|
|
13
|
-
<svg
|
|
14
|
-
version="1.1"
|
|
15
|
-
id="Capa_1"
|
|
16
|
-
x="0px"
|
|
17
|
-
y="0px"
|
|
18
|
-
width="438.536px"
|
|
19
|
-
height="438.536px"
|
|
20
|
-
viewBox="0 0 438.536 438.536"
|
|
21
|
-
fill="currentColor"
|
|
22
|
-
>
|
|
23
|
-
<g>
|
|
24
|
-
<path
|
|
25
|
-
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
|
|
26
|
-
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
|
|
27
|
-
h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
|
|
28
|
-
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
|
|
29
|
-
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
|
|
30
|
-
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"
|
|
31
|
-
/>
|
|
32
|
-
</g>
|
|
33
|
-
</svg>
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export const Chromatic = () => (
|
|
37
|
-
<>
|
|
38
|
-
<ExampleContainer>
|
|
39
|
-
<Title title="Default sidenav" theme="light" level={4} />
|
|
40
|
-
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
41
|
-
<DxcSidenav.Section>
|
|
42
|
-
<p>
|
|
43
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
|
|
44
|
-
vitae lacinia libero.
|
|
45
|
-
</p>
|
|
46
|
-
</DxcSidenav.Section>
|
|
47
|
-
<DxcSidenav.Section>
|
|
48
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
49
|
-
<DxcSidenav.Group collapsable={false} title="Single Group" icon={iconSVG}>
|
|
50
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
51
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
52
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
53
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
54
|
-
</DxcSidenav.Group>
|
|
55
|
-
</DxcSidenav.Section>
|
|
56
|
-
<DxcSidenav.Section>
|
|
57
|
-
<DxcSidenav.Group
|
|
58
|
-
collapsable={true}
|
|
59
|
-
title="Section Group"
|
|
60
|
-
icon="https://cdn-icons-png.flaticon.com/512/5039/5039041.png"
|
|
61
|
-
>
|
|
62
|
-
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
63
|
-
<DxcSidenav.Link icon={iconSVG}>Group Link</DxcSidenav.Link>
|
|
64
|
-
</DxcSidenav.Group>
|
|
65
|
-
<DxcSidenav.Link icon="https://upload.wikimedia.org/wikipedia/commons/7/73/Flat_tick_icon.svg" newWindow>
|
|
66
|
-
Single Link
|
|
67
|
-
</DxcSidenav.Link>
|
|
68
|
-
<DxcSidenav.Link newWindow>Single Link</DxcSidenav.Link>
|
|
69
|
-
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
70
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
71
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
72
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
73
|
-
</DxcSidenav.Group>
|
|
74
|
-
</DxcSidenav.Section>
|
|
75
|
-
</DxcSidenav>
|
|
76
|
-
</ExampleContainer>
|
|
77
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
78
|
-
<Title title="Focused options sidenav" theme="light" level={4} />
|
|
79
|
-
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
80
|
-
<DxcSidenav.Section>
|
|
81
|
-
<p>
|
|
82
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper consectetur mollis. Suspendisse
|
|
83
|
-
vitae lacinia libero.
|
|
84
|
-
</p>
|
|
85
|
-
</DxcSidenav.Section>
|
|
86
|
-
<DxcSidenav.Section>
|
|
87
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
88
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
89
|
-
<DxcSidenav.Link icon="https://cdn-icons-png.flaticon.com/512/5039/5039041.png">Group Link</DxcSidenav.Link>
|
|
90
|
-
</DxcSidenav.Group>
|
|
91
|
-
</DxcSidenav.Section>
|
|
92
|
-
<DxcSidenav.Section>
|
|
93
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
94
|
-
<DxcSidenav.Link selected icon={iconSVG}>
|
|
95
|
-
Group Link
|
|
96
|
-
</DxcSidenav.Link>
|
|
97
|
-
</DxcSidenav.Group>
|
|
98
|
-
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
99
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
100
|
-
</DxcSidenav.Group>
|
|
101
|
-
</DxcSidenav.Section>
|
|
102
|
-
</DxcSidenav>
|
|
103
|
-
</ExampleContainer>
|
|
104
|
-
</>
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
const CollapsedGroup = () => (
|
|
108
|
-
<>
|
|
109
|
-
<ExampleContainer>
|
|
110
|
-
<Title title="Default sidenav" theme="light" level={4} />
|
|
111
|
-
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
112
|
-
<DxcSidenav.Section>
|
|
113
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group" icon={iconSVG}>
|
|
114
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
115
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
116
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
117
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
118
|
-
</DxcSidenav.Group>
|
|
119
|
-
</DxcSidenav.Section>
|
|
120
|
-
<DxcSidenav.Section>
|
|
121
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
122
|
-
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
123
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
124
|
-
</DxcSidenav.Group>
|
|
125
|
-
<DxcSidenav.Group collapsable={false} title="Section Group">
|
|
126
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
127
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
128
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
129
|
-
</DxcSidenav.Group>
|
|
130
|
-
</DxcSidenav.Section>
|
|
131
|
-
</DxcSidenav>
|
|
132
|
-
</ExampleContainer>
|
|
133
|
-
</>
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
const HoverSidenav = () => (
|
|
137
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
138
|
-
<Title title="Default sidenav" theme="light" level={4} />
|
|
139
|
-
<DxcSidenav title={<DxcSidenav.Title>Dxc technology</DxcSidenav.Title>}>
|
|
140
|
-
<DxcSidenav.Section>
|
|
141
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
142
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
143
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
144
|
-
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
145
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
146
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
147
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
148
|
-
</DxcSidenav.Group>
|
|
149
|
-
</DxcSidenav.Section>
|
|
150
|
-
<DxcSidenav.Section>
|
|
151
|
-
<DxcSidenav.Group collapsable={true} title="Not Collapsed Group">
|
|
152
|
-
<DxcSidenav.Link selected>Group Link</DxcSidenav.Link>
|
|
153
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
154
|
-
</DxcSidenav.Group>
|
|
155
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
156
|
-
<DxcSidenav.Link>Single Link</DxcSidenav.Link>
|
|
157
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
158
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
159
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
160
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
161
|
-
</DxcSidenav.Group>
|
|
162
|
-
|
|
163
|
-
<DxcSidenav.Group collapsable={true} title="Collapsable Group">
|
|
164
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
165
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
166
|
-
<DxcSidenav.Link>Group Link</DxcSidenav.Link>
|
|
167
|
-
</DxcSidenav.Group>
|
|
168
|
-
</DxcSidenav.Section>
|
|
169
|
-
</DxcSidenav>
|
|
170
|
-
</ExampleContainer>
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
export const CollapseGroup = CollapsedGroup.bind({});
|
|
174
|
-
CollapseGroup.play = async ({ canvasElement }) => {
|
|
175
|
-
const canvas = within(canvasElement);
|
|
176
|
-
const collapsableGroups = canvas.getAllByText("Collapsable Group");
|
|
177
|
-
collapsableGroups.forEach((group) => {
|
|
178
|
-
userEvent.click(group);
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export const CollapseHoverGroup = HoverSidenav.bind({});
|
|
183
|
-
CollapseHoverGroup.play = async ({ canvasElement }) => {
|
|
184
|
-
const canvas = within(canvasElement);
|
|
185
|
-
const collapsableGroups = canvas.getAllByText("Collapsable Group");
|
|
186
|
-
collapsableGroups.forEach((group) => {
|
|
187
|
-
userEvent.click(group);
|
|
188
|
-
});
|
|
189
|
-
};
|
package/sidenav/Sidenav.test.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
|
-
var _Sidenav = _interopRequireDefault(require("./Sidenav.tsx"));
|
|
10
|
-
|
|
11
|
-
describe("Sidenav component tests", function () {
|
|
12
|
-
test("Sidenav renders anchors and Section correctly", function () {
|
|
13
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Section, null, /*#__PURE__*/_react["default"].createElement("p", null, "nav-content-test"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
14
|
-
href: "#"
|
|
15
|
-
}, "Link")))),
|
|
16
|
-
getByText = _render.getByText;
|
|
17
|
-
|
|
18
|
-
expect(getByText("nav-content-test")).toBeTruthy();
|
|
19
|
-
var link = getByText("Link");
|
|
20
|
-
expect(link.closest("a").getAttribute("href")).toBe("#");
|
|
21
|
-
});
|
|
22
|
-
test("Sidenav renders groups correctly", function () {
|
|
23
|
-
var sidenav = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Section, null, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Group, {
|
|
24
|
-
title: "Collapsable",
|
|
25
|
-
collapsable: true
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
27
|
-
href: "#"
|
|
28
|
-
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
29
|
-
href: "#"
|
|
30
|
-
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
31
|
-
href: "#"
|
|
32
|
-
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
33
|
-
href: "#"
|
|
34
|
-
}, "Lorem ipsum"), /*#__PURE__*/_react["default"].createElement(_Sidenav["default"].Link, {
|
|
35
|
-
href: "#"
|
|
36
|
-
}, "Lorem ipsum")))));
|
|
37
|
-
expect(sidenav.getByText("Collapsable")).toBeTruthy();
|
|
38
|
-
expect(sidenav.getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("true");
|
|
39
|
-
|
|
40
|
-
_react2.fireEvent.click(sidenav.getByText("Collapsable"));
|
|
41
|
-
|
|
42
|
-
expect(sidenav.getAllByRole("button")[0].getAttribute("aria-expanded")).toBe("false");
|
|
43
|
-
});
|
|
44
|
-
});
|
package/sidenav/types.d.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
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
|
-
/**
|
|
9
|
-
* The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
|
|
10
|
-
*/
|
|
11
|
-
title?: React.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
export declare type SidenavTitlePropsType = {
|
|
14
|
-
/**
|
|
15
|
-
* The area inside the sidenav title. This area can be used to render custom content.
|
|
16
|
-
*/
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
};
|
|
19
|
-
export declare type SidenavSectionPropsType = {
|
|
20
|
-
/**
|
|
21
|
-
* The area inside the sidenav section. This area can be used to render sidenav groups, links and custom content.
|
|
22
|
-
*/
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
};
|
|
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
|
-
/**
|
|
31
|
-
* The title of the sidenav group.
|
|
32
|
-
*/
|
|
33
|
-
title?: string;
|
|
34
|
-
/**
|
|
35
|
-
* If true the sidenav group title will be considered a button and the group will be collapsable.
|
|
36
|
-
*/
|
|
37
|
-
collapsable?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* The icon to be displayed next to the title of the group.
|
|
40
|
-
*/
|
|
41
|
-
icon?: string | SVG;
|
|
42
|
-
};
|
|
43
|
-
export declare type SidenavLinkPropsType = {
|
|
44
|
-
/**
|
|
45
|
-
* Value of the tabindex.
|
|
46
|
-
*/
|
|
47
|
-
tabIndex?: number;
|
|
48
|
-
/**
|
|
49
|
-
* Page to be opened when the user clicks on the link.
|
|
50
|
-
*/
|
|
51
|
-
href?: string;
|
|
52
|
-
/**
|
|
53
|
-
* If true, the page is opened in a new browser tab.
|
|
54
|
-
*/
|
|
55
|
-
newWindow?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Element or path used as the icon that will be placed to the left of the link text.
|
|
58
|
-
*/
|
|
59
|
-
icon?: string | SVG;
|
|
60
|
-
/**
|
|
61
|
-
* If true, the link will be marked as selected. This can also affect the group if it is closed to indicate that one of its links is selected.
|
|
62
|
-
*/
|
|
63
|
-
selected?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* The area inside the sidenav link.
|
|
66
|
-
*/
|
|
67
|
-
children: string;
|
|
68
|
-
/**
|
|
69
|
-
* This function will be called when the user clicks the link.
|
|
70
|
-
*/
|
|
71
|
-
onClick?: ($event: any) => void;
|
|
72
|
-
};
|
|
73
|
-
export default SidenavPropsType;
|
package/sidenav/types.js
DELETED
package/slider/Slider.d.ts
DELETED
package/slider/Slider.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
23
|
-
|
|
24
|
-
var _variables = require("../common/variables.js");
|
|
25
|
-
|
|
26
|
-
var _utils = require("../common/utils.js");
|
|
27
|
-
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
|
-
|
|
30
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
31
|
-
|
|
32
|
-
var _uuid = require("uuid");
|
|
33
|
-
|
|
34
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
-
|
|
38
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
-
|
|
40
|
-
var DxcSlider = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
41
|
-
var _ref$label = _ref.label,
|
|
42
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
43
|
-
_ref$name = _ref.name,
|
|
44
|
-
name = _ref$name === void 0 ? "" : _ref$name,
|
|
45
|
-
defaultValue = _ref.defaultValue,
|
|
46
|
-
value = _ref.value,
|
|
47
|
-
_ref$helperText = _ref.helperText,
|
|
48
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
49
|
-
_ref$minValue = _ref.minValue,
|
|
50
|
-
minValue = _ref$minValue === void 0 ? 0 : _ref$minValue,
|
|
51
|
-
_ref$maxValue = _ref.maxValue,
|
|
52
|
-
maxValue = _ref$maxValue === void 0 ? 100 : _ref$maxValue,
|
|
53
|
-
_ref$step = _ref.step,
|
|
54
|
-
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
55
|
-
_ref$showLimitsValues = _ref.showLimitsValues,
|
|
56
|
-
showLimitsValues = _ref$showLimitsValues === void 0 ? false : _ref$showLimitsValues,
|
|
57
|
-
_ref$showInput = _ref.showInput,
|
|
58
|
-
showInput = _ref$showInput === void 0 ? false : _ref$showInput,
|
|
59
|
-
_ref$disabled = _ref.disabled,
|
|
60
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
61
|
-
_ref$marks = _ref.marks,
|
|
62
|
-
marks = _ref$marks === void 0 ? false : _ref$marks,
|
|
63
|
-
onChange = _ref.onChange,
|
|
64
|
-
onDragEnd = _ref.onDragEnd,
|
|
65
|
-
labelFormatCallback = _ref.labelFormatCallback,
|
|
66
|
-
margin = _ref.margin,
|
|
67
|
-
_ref$size = _ref.size,
|
|
68
|
-
size = _ref$size === void 0 ? "fillParent" : _ref$size;
|
|
69
|
-
|
|
70
|
-
var _useState = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0),
|
|
71
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
72
|
-
innerValue = _useState2[0],
|
|
73
|
-
setInnerValue = _useState2[1];
|
|
74
|
-
|
|
75
|
-
var _useState3 = (0, _react.useState)(false),
|
|
76
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
77
|
-
dragging = _useState4[0],
|
|
78
|
-
setDragging = _useState4[1];
|
|
79
|
-
|
|
80
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
81
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
82
|
-
|
|
83
|
-
var _useState5 = (0, _react.useState)("label-".concat((0, _uuid.v4)())),
|
|
84
|
-
_useState6 = (0, _slicedToArray2["default"])(_useState5, 1),
|
|
85
|
-
labelId = _useState6[0];
|
|
86
|
-
|
|
87
|
-
var minLabel = (0, _react.useMemo)(function () {
|
|
88
|
-
return labelFormatCallback ? labelFormatCallback(minValue) : minValue;
|
|
89
|
-
}, [labelFormatCallback, minValue]);
|
|
90
|
-
var maxLabel = (0, _react.useMemo)(function () {
|
|
91
|
-
return labelFormatCallback ? labelFormatCallback(maxValue) : maxValue;
|
|
92
|
-
}, [labelFormatCallback, maxValue]);
|
|
93
|
-
var tickMarks = (0, _react.useMemo)(function () {
|
|
94
|
-
var ticks = [];
|
|
95
|
-
var numberOfMarks = Math.floor(maxValue / step - minValue / step);
|
|
96
|
-
var index = 0;
|
|
97
|
-
var range = maxValue - minValue;
|
|
98
|
-
|
|
99
|
-
if (marks) {
|
|
100
|
-
while (index <= numberOfMarks) {
|
|
101
|
-
ticks.push( /*#__PURE__*/_react["default"].createElement(TickMark, {
|
|
102
|
-
disabled: disabled,
|
|
103
|
-
stepPosition: step * index / range,
|
|
104
|
-
backgroundType: backgroundType,
|
|
105
|
-
stepValue: (value !== null && value !== void 0 ? value : innerValue) / maxValue
|
|
106
|
-
}));
|
|
107
|
-
index++;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return ticks;
|
|
111
|
-
} else {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
}, [minValue, maxValue, step, value, innerValue]);
|
|
115
|
-
|
|
116
|
-
var handleSliderChange = function handleSliderChange(event) {
|
|
117
|
-
var valueToCheck = event.target.value;
|
|
118
|
-
(valueToCheck !== value || valueToCheck !== innerValue) && setInnerValue(valueToCheck);
|
|
119
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(valueToCheck);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
var handleSliderDragging = function handleSliderDragging() {
|
|
123
|
-
setDragging(true);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
var handleSliderOnChangeCommited = function handleSliderOnChangeCommited(event) {
|
|
127
|
-
if (dragging) {
|
|
128
|
-
setDragging(false);
|
|
129
|
-
onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event.target.value);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
var handlerInputChange = function handlerInputChange(event) {
|
|
134
|
-
var intValue = parseInt(event.value, 10);
|
|
135
|
-
|
|
136
|
-
if (value == null) {
|
|
137
|
-
if (!Number.isNaN(intValue)) setInnerValue(intValue > maxValue ? maxValue : intValue);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (!Number.isNaN(intValue)) {
|
|
141
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(intValue > maxValue ? maxValue : intValue);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
var isFirefox = navigator.userAgent.indexOf("Firefox") !== -1;
|
|
146
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
147
|
-
theme: colorsTheme.slider
|
|
148
|
-
}, /*#__PURE__*/_react["default"].createElement(Container, {
|
|
149
|
-
margin: margin,
|
|
150
|
-
size: size,
|
|
151
|
-
ref: ref
|
|
152
|
-
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
153
|
-
id: labelId,
|
|
154
|
-
disabled: disabled,
|
|
155
|
-
backgroundType: backgroundType
|
|
156
|
-
}, label), /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
157
|
-
disabled: disabled,
|
|
158
|
-
backgroundType: backgroundType
|
|
159
|
-
}, helperText), /*#__PURE__*/_react["default"].createElement(SliderContainer, null, showLimitsValues && /*#__PURE__*/_react["default"].createElement(MinLabelContainer, {
|
|
160
|
-
backgroundType: backgroundType,
|
|
161
|
-
disabled: disabled
|
|
162
|
-
}, minLabel), /*#__PURE__*/_react["default"].createElement(SliderInputContainer, null, /*#__PURE__*/_react["default"].createElement(SliderInput, {
|
|
163
|
-
role: "slider",
|
|
164
|
-
type: "range",
|
|
165
|
-
value: value != null && value >= 0 ? value : innerValue,
|
|
166
|
-
min: minValue,
|
|
167
|
-
max: maxValue,
|
|
168
|
-
step: step,
|
|
169
|
-
marks: marks,
|
|
170
|
-
disabled: disabled,
|
|
171
|
-
"aria-labelledby": labelId,
|
|
172
|
-
"aria-orientation": "horizontal",
|
|
173
|
-
"aria-valuemax": maxValue,
|
|
174
|
-
"aria-valuemin": minValue,
|
|
175
|
-
"aria-valuenow": value != null && value >= 0 ? value : innerValue,
|
|
176
|
-
onChange: handleSliderChange,
|
|
177
|
-
onMouseUp: handleSliderOnChangeCommited,
|
|
178
|
-
onMouseDown: handleSliderDragging,
|
|
179
|
-
backgroundType: backgroundType
|
|
180
|
-
}), marks && /*#__PURE__*/_react["default"].createElement(MarksContainer, {
|
|
181
|
-
isFirefox: isFirefox
|
|
182
|
-
}, tickMarks)), showLimitsValues && /*#__PURE__*/_react["default"].createElement(MaxLabelContainer, {
|
|
183
|
-
backgroundType: backgroundType,
|
|
184
|
-
disabled: disabled,
|
|
185
|
-
step: step
|
|
186
|
-
}, maxLabel), showInput && /*#__PURE__*/_react["default"].createElement(StyledTextInput, null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
187
|
-
name: name,
|
|
188
|
-
value: value != null && value >= 0 ? value.toString() : innerValue.toString(),
|
|
189
|
-
disabled: disabled,
|
|
190
|
-
onChange: handlerInputChange,
|
|
191
|
-
size: "fillParent"
|
|
192
|
-
})))));
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
var sizes = {
|
|
196
|
-
medium: "360px",
|
|
197
|
-
large: "480px",
|
|
198
|
-
fillParent: "100%"
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
202
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
var getChromeStyles = function getChromeStyles() {
|
|
206
|
-
return "\n width: 100%;\n margin-right: 4px;";
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
var getFireFoxStyles = function getFireFoxStyles() {
|
|
210
|
-
return "\n width: calc(100% - 16px);\n margin-right: 3px;";
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n"])), function (props) {
|
|
214
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
215
|
-
}, function (props) {
|
|
216
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
217
|
-
}, function (props) {
|
|
218
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
219
|
-
}, function (props) {
|
|
220
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
221
|
-
}, function (props) {
|
|
222
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
223
|
-
}, function (props) {
|
|
224
|
-
return calculateWidth(props.margin, props.size);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
228
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
229
|
-
}, function (props) {
|
|
230
|
-
return props.theme.fontFamily;
|
|
231
|
-
}, function (props) {
|
|
232
|
-
return props.theme.labelFontSize;
|
|
233
|
-
}, function (props) {
|
|
234
|
-
return props.theme.labelFontStyle;
|
|
235
|
-
}, function (props) {
|
|
236
|
-
return props.theme.labelFontWeight;
|
|
237
|
-
}, function (props) {
|
|
238
|
-
return props.theme.labelLineHeight;
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
242
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
243
|
-
}, function (props) {
|
|
244
|
-
return props.theme.fontFamily;
|
|
245
|
-
}, function (props) {
|
|
246
|
-
return props.theme.helperTextFontSize;
|
|
247
|
-
}, function (props) {
|
|
248
|
-
return props.theme.helperTextFontStyle;
|
|
249
|
-
}, function (props) {
|
|
250
|
-
return props.theme.helperTextFontWeight;
|
|
251
|
-
}, function (props) {
|
|
252
|
-
return props.theme.helperTextLineHeight;
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
var SliderInput = _styledComponents["default"].input(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n min-width: 240px;\n height: ", ";\n display: inline-block;\n vertical-align: middle;\n -webkit-appearance: none;\n background-color: ", ";\n background-image: ", ";\n background-repeat: no-repeat;\n background-size: ", ";\n border-radius: 5px;\n cursor: ", ";\n &::-webkit-slider-runnable-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n margin: 0px -8px;\n }\n\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n border: none;\n height: ", ";\n width: ", ";\n border-radius: 25px;\n background: ", ";\n &:active {\n ", "\n }\n &:hover {\n ", "\n }\n }\n &::-moz-range-track {\n -webkit-appearance: none;\n box-shadow: none;\n border: none;\n background: transparent;\n }\n &::-moz-range-thumb {\n -webkit-appearance: none;\n border: none;\n height: ", ";\n width: ", ";\n border-radius: 25px;\n background: ", ";\n &:active {\n background: ", ";\n transform: scale(1.16667);\n }\n &:hover {\n ", "\n }\n }\n &:focus {\n outline: none;\n &::-webkit-slider-thumb {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n }\n &::-moz-range-thumb {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n }\n }\n"])), function (props) {
|
|
256
|
-
return props.theme.trackLineThickness;
|
|
257
|
-
}, function (props) {
|
|
258
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledTotalLineColorOnDark + "61" : props.theme.disabledTotalLineColor + "61" : props.backgroundType === "dark" ? props.theme.totalLineColorOnDark + "61" : props.theme.totalLineColor;
|
|
259
|
-
}, function (props) {
|
|
260
|
-
return props.disabled ? props.backgroundType === "dark" ? "linear-gradient(".concat(props.theme.disabledTrackLineColorOnDark, ", ").concat(props.theme.disabledTrackLineColorOnDark, ")") : "linear-gradient(".concat(props.theme.disabledTrackLineColor, ", ").concat(props.theme.disabledTrackLineColor, ")") : props.backgroundType === "dark" ? "linear-gradient(".concat(props.theme.trackLineColorOnDark, ", ").concat(props.theme.trackLineColorOnDark, ")") : "linear-gradient(".concat(props.theme.trackLineColor, ", ").concat(props.theme.trackLineColor, ")");
|
|
261
|
-
}, function (props) {
|
|
262
|
-
return (props.value - props.min) * 100 / (props.max - props.min) + "% 100%";
|
|
263
|
-
}, function (props) {
|
|
264
|
-
return props.disabled ? "not-allowed" : "pointer";
|
|
265
|
-
}, function (props) {
|
|
266
|
-
return props.theme.thumbHeight;
|
|
267
|
-
}, function (props) {
|
|
268
|
-
return props.theme.thumbWidth;
|
|
269
|
-
}, function (props) {
|
|
270
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor : props.backgroundType === "dark" ? props.theme.thumbBackgroundColorOnDark : props.theme.thumbBackgroundColor;
|
|
271
|
-
}, function (props) {
|
|
272
|
-
if (!props.disabled) {
|
|
273
|
-
return "\n background: ".concat(props.backgroundType === "dark" ? props.theme.activeThumbBackgroundColorOnDark : props.theme.activeThumbBackgroundColor, ";\n transform: scale(1.16667);");
|
|
274
|
-
}
|
|
275
|
-
}, function (props) {
|
|
276
|
-
if (!props.disabled) {
|
|
277
|
-
return "height: ".concat(props.theme.hoverThumbHeight, ";\n width: ").concat(props.theme.hoverThumbWidth, ";\n transform: scale(1.16667);\n transform-origin: center center;\n background: ").concat(props.backgroundType === "dark" ? props.theme.hoverThumbBackgroundColorOnDark : props.theme.hoverThumbBackgroundColor, ";");
|
|
278
|
-
}
|
|
279
|
-
}, function (props) {
|
|
280
|
-
return props.theme.thumbHeight;
|
|
281
|
-
}, function (props) {
|
|
282
|
-
return props.theme.thumbWidth;
|
|
283
|
-
}, function (props) {
|
|
284
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor : props.backgroundType === "dark" ? props.theme.thumbBackgroundColorOnDark : props.theme.thumbBackgroundColor;
|
|
285
|
-
}, function (props) {
|
|
286
|
-
return props.backgroundType === "dark" ? props.theme.activeThumbBackgroundColorOnDark : props.theme.activeThumbBackgroundColor;
|
|
287
|
-
}, function (props) {
|
|
288
|
-
if (!props.disabled) {
|
|
289
|
-
return "height: ".concat(props.theme.hoverThumbHeight, ";\n width: ").concat(props.theme.hoverThumbWidth, ";\n transform: scale(1.16667);\n transform-origin: center center;\n background: ").concat(props.backgroundType === "dark" ? props.theme.hoverThumbBackgroundColorOnDark : props.theme.hoverThumbBackgroundColor, ";");
|
|
290
|
-
}
|
|
291
|
-
}, function (props) {
|
|
292
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledFocusColorOnDark : props.theme.disabledFocusColor : props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
293
|
-
}, function (props) {
|
|
294
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledFocusColorOnDark : props.theme.disabledFocusColor : props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
var SliderContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 48px;\n align-items: center;\n"])));
|
|
298
|
-
|
|
299
|
-
var LimitLabelContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n white-space: nowrap;\n"])), function (props) {
|
|
300
|
-
return props.disabled ? props.theme.disabledLimitValuesFontColor : props.backgroundType === "dark" ? props.theme.limitValuesFontColorOnDark : props.theme.limitValuesFontColor;
|
|
301
|
-
}, function (props) {
|
|
302
|
-
return props.theme.fontFamily;
|
|
303
|
-
}, function (props) {
|
|
304
|
-
return props.theme.limitValuesFontSize;
|
|
305
|
-
}, function (props) {
|
|
306
|
-
return props.theme.limitValuesFontStyle;
|
|
307
|
-
}, function (props) {
|
|
308
|
-
return props.theme.limitValuesFontWeight;
|
|
309
|
-
}, function (props) {
|
|
310
|
-
return props.theme.limitValuesFontLetterSpacing;
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
var MinLabelContainer = (0, _styledComponents["default"])(LimitLabelContainer)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n"])), function (props) {
|
|
314
|
-
return props.theme.floorLabelMarginRight;
|
|
315
|
-
});
|
|
316
|
-
var MaxLabelContainer = (0, _styledComponents["default"])(LimitLabelContainer)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n"])), function (props) {
|
|
317
|
-
return props.step === 1 ? props.theme.ceilLabelMarginLeft : "1.25rem";
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
var SliderInputContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n width: 100%;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: -2px;\n padding-top: 1px;\n z-index: 0;\n"])));
|
|
321
|
-
|
|
322
|
-
var MarksContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n position: absolute;\n pointer-events: none;\n height: 100%;\n display: flex;\n align-items: center;\n"])), function (props) {
|
|
323
|
-
return props.isFirefox ? getFireFoxStyles() : getChromeStyles();
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
var TickMark = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n background: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n left: ", ";\n z-index: ", ";\n"])), function (props) {
|
|
327
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledTickBackgroundColorOnDark : props.theme.disabledTickBackgroundColor : props.backgroundType === "dark" ? props.theme.tickBackgroundColorOnDark : props.theme.tickBackgroundColor;
|
|
328
|
-
}, function (props) {
|
|
329
|
-
return props.theme.tickHeight;
|
|
330
|
-
}, function (props) {
|
|
331
|
-
return props.theme.tickWidth;
|
|
332
|
-
}, function (props) {
|
|
333
|
-
return "calc(".concat(props.stepPosition, " * 100%)");
|
|
334
|
-
}, function (props) {
|
|
335
|
-
return "".concat(props.stepPosition <= props.stepValue ? "-1" : "0");
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
var StyledTextInput = _styledComponents["default"].div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n max-width: 70px;\n"])), function (props) {
|
|
339
|
-
return props.theme.inputMarginLeft;
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
var _default = DxcSlider;
|
|
343
|
-
exports["default"] = _default;
|