@dxc-technology/halstack-react 0.0.0-0b14645 → 0.0.0-0b2a880
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 -0
- package/BackgroundColorContext.js +6 -26
- package/HalstackContext.d.ts +1248 -0
- package/HalstackContext.js +310 -0
- package/README.md +47 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +106 -224
- package/accordion/Accordion.stories.tsx +251 -0
- package/accordion/Accordion.test.js +56 -0
- package/accordion/types.d.ts +57 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.accessibility.test.js +88 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +52 -135
- package/accordion-group/AccordionGroup.stories.tsx +252 -0
- package/accordion-group/AccordionGroup.test.js +98 -0
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +67 -0
- package/accordion-group/types.js +5 -0
- 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.d.ts +4 -0
- package/alert/Alert.js +36 -145
- package/alert/Alert.stories.tsx +198 -0
- package/alert/Alert.test.js +75 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +142 -40
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +54 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +43 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -0
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +32 -109
- package/box/Box.stories.tsx +119 -0
- package/box/Box.test.js +13 -0
- package/box/types.d.ts +32 -0
- package/box/types.js +5 -0
- package/bulleted-list/BulletedList.accessibility.test.js +107 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +92 -0
- package/bulleted-list/BulletedList.stories.tsx +115 -0
- package/bulleted-list/types.d.ts +38 -0
- package/bulleted-list/types.js +5 -0
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +65 -126
- package/button/Button.stories.tsx +313 -294
- package/button/Button.test.js +38 -0
- package/button/types.d.ts +18 -18
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +59 -139
- package/card/Card.stories.tsx +171 -0
- package/card/Card.test.js +39 -0
- package/card/types.d.ts +62 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +145 -183
- package/checkbox/Checkbox.stories.tsx +222 -0
- package/checkbox/Checkbox.test.js +199 -0
- package/checkbox/types.d.ts +20 -9
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +49 -146
- package/chip/Chip.stories.tsx +195 -0
- package/chip/Chip.test.js +41 -0
- package/chip/types.d.ts +45 -0
- package/chip/types.js +5 -0
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +6 -12
- package/common/variables.d.ts +1394 -0
- package/common/variables.js +1035 -1338
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +86 -0
- package/contextual-menu/ContextualMenu.d.ts +5 -0
- package/contextual-menu/ContextualMenu.js +88 -0
- package/contextual-menu/ContextualMenu.stories.tsx +219 -0
- package/contextual-menu/ContextualMenu.test.js +205 -0
- package/contextual-menu/GroupItem.d.ts +4 -0
- package/contextual-menu/GroupItem.js +67 -0
- package/contextual-menu/ItemAction.d.ts +4 -0
- package/contextual-menu/ItemAction.js +52 -0
- package/contextual-menu/MenuItem.d.ts +4 -0
- package/contextual-menu/MenuItem.js +29 -0
- package/contextual-menu/SingleItem.d.ts +4 -0
- package/contextual-menu/SingleItem.js +38 -0
- package/contextual-menu/types.d.ts +58 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +214 -0
- package/date-input/DateInput.accessibility.test.js +216 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +174 -348
- package/date-input/DateInput.stories.tsx +285 -0
- package/date-input/DateInput.test.js +808 -0
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +121 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +100 -0
- package/date-input/types.d.ts +164 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +57 -149
- package/dialog/Dialog.stories.tsx +365 -0
- package/dialog/Dialog.test.js +307 -0
- package/dialog/types.d.ts +36 -0
- package/dialog/types.js +5 -0
- 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.d.ts +4 -0
- package/dropdown/Dropdown.js +233 -364
- package/dropdown/Dropdown.stories.tsx +427 -0
- package/dropdown/Dropdown.test.js +599 -0
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +63 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +70 -0
- package/dropdown/types.d.ts +96 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.accessibility.test.js +160 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +274 -363
- package/file-input/FileInput.stories.tsx +618 -0
- package/file-input/FileInput.test.js +382 -0
- package/file-input/FileItem.d.ts +4 -0
- package/file-input/FileItem.js +61 -133
- package/file-input/types.d.ts +129 -0
- package/file-input/types.js +5 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +57 -0
- package/flex/Flex.stories.tsx +112 -0
- package/flex/types.d.ts +97 -0
- package/flex/types.js +5 -0
- package/footer/Footer.accessibility.test.js +117 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +75 -232
- package/footer/Footer.stories.tsx +196 -0
- package/footer/Footer.test.js +85 -0
- package/footer/Icons.d.ts +3 -0
- package/footer/Icons.js +67 -8
- package/footer/types.d.ts +64 -0
- package/footer/types.js +5 -0
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +76 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.accessibility.test.js +84 -0
- package/header/Header.d.ts +8 -0
- package/header/Header.js +104 -221
- package/header/Header.stories.tsx +251 -0
- package/header/Header.test.js +66 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +5 -35
- package/header/types.d.ts +33 -0
- package/header/types.js +5 -0
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +16 -55
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +169 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -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.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +129 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +43 -0
- package/inset/Inset.stories.tsx +230 -0
- package/inset/types.d.ts +37 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +20 -0
- package/layout/ApplicationLayout.js +86 -184
- package/layout/ApplicationLayout.stories.tsx +162 -0
- package/layout/Icons.d.ts +7 -0
- package/layout/Icons.js +41 -48
- package/layout/types.d.ts +41 -0
- package/layout/types.js +5 -0
- package/link/Link.accessibility.test.js +112 -0
- package/link/Link.d.ts +4 -0
- package/link/Link.js +65 -131
- package/link/Link.stories.tsx +253 -0
- package/link/Link.test.js +63 -0
- package/link/types.d.ts +54 -0
- package/link/types.js +5 -0
- package/main.d.ts +19 -14
- package/main.js +92 -98
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +7 -0
- package/nav-tabs/NavTabs.js +93 -0
- package/nav-tabs/NavTabs.stories.tsx +279 -0
- package/nav-tabs/NavTabs.test.js +75 -0
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.d.ts +4 -0
- package/nav-tabs/Tab.js +117 -0
- package/nav-tabs/types.d.ts +52 -0
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.accessibility.test.js +228 -0
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +48 -90
- package/number-input/NumberInput.stories.tsx +131 -0
- package/number-input/NumberInput.test.js +989 -0
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +3 -11
- package/number-input/types.d.ts +136 -0
- package/number-input/types.js +5 -0
- package/package.json +52 -51
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +39 -103
- package/paginator/Paginator.stories.tsx +87 -0
- package/paginator/Paginator.test.js +335 -0
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.d.ts +5 -0
- package/paragraph/Paragraph.js +22 -0
- package/paragraph/Paragraph.stories.tsx +27 -0
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +59 -162
- package/password-input/PasswordInput.stories.tsx +99 -0
- package/password-input/PasswordInput.test.js +198 -0
- package/password-input/types.d.ts +111 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +67 -111
- package/progress-bar/ProgressBar.stories.tsx +93 -0
- package/progress-bar/ProgressBar.test.js +93 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +94 -0
- package/quick-nav/QuickNav.stories.tsx +356 -0
- package/quick-nav/types.d.ts +21 -0
- package/quick-nav/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +124 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +235 -0
- package/radio-group/RadioGroup.stories.tsx +214 -0
- package/radio-group/RadioGroup.test.js +756 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultset-table/Icons.d.ts +7 -0
- package/resultset-table/Icons.js +47 -0
- package/resultset-table/ResultsetTable.accessibility.test.js +274 -0
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/resultset-table/ResultsetTable.js +170 -0
- package/resultset-table/ResultsetTable.stories.tsx +401 -0
- package/resultset-table/ResultsetTable.test.js +381 -0
- package/resultset-table/types.d.ts +100 -0
- package/resultset-table/types.js +5 -0
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +145 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +88 -0
- package/select/Select.accessibility.test.js +217 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +248 -515
- package/select/Select.stories.tsx +907 -0
- package/select/Select.test.js +2276 -0
- package/select/types.d.ts +209 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.d.ts +10 -0
- package/sidenav/Sidenav.js +137 -81
- package/sidenav/Sidenav.stories.tsx +277 -0
- package/sidenav/Sidenav.test.js +37 -0
- package/sidenav/SidenavContext.d.ts +5 -0
- package/sidenav/SidenavContext.js +13 -0
- package/sidenav/types.d.ts +76 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.accessibility.test.js +104 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +165 -220
- package/slider/Slider.test.js +254 -0
- package/slider/types.d.ts +86 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +38 -99
- package/spinner/Spinner.stories.tsx +129 -0
- package/spinner/Spinner.test.js +55 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- 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.d.ts +4 -0
- package/switch/Switch.js +150 -144
- package/switch/Switch.stories.tsx +137 -0
- package/switch/Switch.test.js +180 -0
- package/switch/types.d.ts +66 -0
- package/switch/types.js +5 -0
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.js +82 -0
- package/table/Table.d.ts +8 -0
- package/table/Table.js +80 -37
- package/table/Table.stories.tsx +651 -0
- package/table/Table.test.js +113 -0
- package/table/types.d.ts +49 -0
- package/table/types.js +5 -0
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +117 -0
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +308 -194
- package/tabs/Tabs.stories.tsx +224 -0
- package/tabs/Tabs.test.js +276 -0
- package/tabs/types.d.ts +92 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +55 -112
- package/tag/Tag.stories.tsx +152 -0
- package/tag/Tag.test.js +41 -0
- package/tag/types.d.ts +69 -0
- package/tag/types.js +5 -0
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +67 -0
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +86 -0
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +335 -593
- package/text-input/TextInput.stories.tsx +465 -0
- package/text-input/TextInput.test.js +1756 -0
- package/text-input/types.d.ts +205 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.d.ts +4 -0
- package/textarea/Textarea.js +98 -181
- package/textarea/Textarea.stories.tsx +174 -0
- package/textarea/Textarea.test.js +406 -0
- package/textarea/types.d.ts +141 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +101 -142
- package/toggle-group/ToggleGroup.stories.tsx +218 -0
- package/toggle-group/ToggleGroup.test.js +137 -0
- package/toggle-group/types.d.ts +114 -0
- package/toggle-group/types.js +5 -0
- package/typography/Typography.accessibility.test.js +339 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +23 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/useTheme.d.ts +1147 -0
- package/useTheme.js +4 -11
- package/useTranslatedLabels.d.ts +85 -0
- package/useTranslatedLabels.js +14 -0
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +94 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +124 -0
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +130 -154
- package/wizard/Wizard.stories.tsx +272 -0
- package/wizard/Wizard.test.js +114 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/ThemeContext.js +0 -246
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/accordion/index.d.ts +0 -28
- package/accordion-group/index.d.ts +0 -16
- package/alert/index.d.ts +0 -51
- package/box/index.d.ts +0 -25
- package/card/index.d.ts +0 -22
- package/chip/index.d.ts +0 -22
- package/common/OpenSans.css +0 -81
- package/common/RequiredComponent.js +0 -32
- 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/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/date-input/index.d.ts +0 -95
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/file-input/index.d.ts +0 -81
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/heading/index.d.ts +0 -17
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/paginator/Icons.js +0 -66
- package/password-input/index.d.ts +0 -94
- package/progress-bar/index.d.ts +0 -18
- package/radio/Radio.js +0 -195
- package/radio/index.d.ts +0 -23
- package/resultsetTable/ResultsetTable.js +0 -274
- package/resultsetTable/index.d.ts +0 -19
- package/select/index.d.ts +0 -131
- package/sidenav/index.d.ts +0 -13
- package/slider/index.d.ts +0 -29
- package/spinner/index.d.ts +0 -17
- package/switch/index.d.ts +0 -24
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
- package/tag/index.d.ts +0 -24
- package/text-input/index.d.ts +0 -135
- package/textarea/index.d.ts +0 -117
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/toggle-group/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
- package/wizard/Icons.js +0 -65
- package/wizard/index.d.ts +0 -18
package/spinner/Spinner.js
CHANGED
|
@@ -1,60 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
20
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var _variables = require("../common/variables.js");
|
|
25
|
-
|
|
26
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
27
|
-
|
|
28
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
29
|
-
|
|
13
|
+
var _variables = require("../common/variables");
|
|
14
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
30
15
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
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; }
|
|
35
|
-
|
|
16
|
+
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); }
|
|
17
|
+
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 && {}.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; }
|
|
36
18
|
var DxcSpinner = function DxcSpinner(_ref) {
|
|
37
19
|
var _ref$label = _ref.label,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
21
|
+
value = _ref.value,
|
|
22
|
+
_ref$showValue = _ref.showValue,
|
|
23
|
+
showValue = _ref$showValue === void 0 ? false : _ref$showValue,
|
|
24
|
+
_ref$mode = _ref.mode,
|
|
25
|
+
mode = _ref$mode === void 0 ? "large" : _ref$mode,
|
|
26
|
+
margin = _ref.margin;
|
|
45
27
|
var colorsTheme = (0, _useTheme["default"])();
|
|
46
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
47
28
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
48
29
|
theme: colorsTheme.spinner
|
|
49
30
|
}, /*#__PURE__*/_react["default"].createElement(DXCSpinner, {
|
|
50
31
|
margin: margin,
|
|
51
32
|
mode: mode
|
|
52
33
|
}, /*#__PURE__*/_react["default"].createElement(SpinnerContainer, {
|
|
53
|
-
backgroundType: backgroundType,
|
|
54
|
-
mode: mode
|
|
55
|
-
}, mode === "overlay" && /*#__PURE__*/_react["default"].createElement(BackOverlay, null), /*#__PURE__*/_react["default"].createElement(BackgroundSpinner, {
|
|
56
34
|
mode: mode
|
|
57
|
-
}, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGBackground, {
|
|
35
|
+
}, mode === "overlay" && /*#__PURE__*/_react["default"].createElement(BackOverlay, null), /*#__PURE__*/_react["default"].createElement(BackgroundSpinner, null, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGBackground, {
|
|
58
36
|
viewBox: "0 0 140 140"
|
|
59
37
|
}, /*#__PURE__*/_react["default"].createElement(CircleBackground, {
|
|
60
38
|
cx: "70",
|
|
@@ -69,8 +47,7 @@ var DxcSpinner = function DxcSpinner(_ref) {
|
|
|
69
47
|
r: "6",
|
|
70
48
|
mode: mode
|
|
71
49
|
}))), value >= 0 && value <= 100 ? /*#__PURE__*/_react["default"].createElement(Spinner, {
|
|
72
|
-
role: "progressbar"
|
|
73
|
-
mode: mode
|
|
50
|
+
role: "progressbar"
|
|
74
51
|
}, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
75
52
|
viewBox: "0 0 140 140",
|
|
76
53
|
isDeterminated: true
|
|
@@ -78,7 +55,6 @@ var DxcSpinner = function DxcSpinner(_ref) {
|
|
|
78
55
|
cx: "70",
|
|
79
56
|
cy: "70",
|
|
80
57
|
r: "65",
|
|
81
|
-
backgroundType: backgroundType,
|
|
82
58
|
mode: mode,
|
|
83
59
|
isDeterminated: true,
|
|
84
60
|
value: value
|
|
@@ -89,13 +65,11 @@ var DxcSpinner = function DxcSpinner(_ref) {
|
|
|
89
65
|
cx: "8",
|
|
90
66
|
cy: "8",
|
|
91
67
|
r: "6",
|
|
92
|
-
backgroundType: backgroundType,
|
|
93
68
|
mode: mode,
|
|
94
69
|
isDeterminated: true,
|
|
95
70
|
value: value
|
|
96
71
|
}))) : /*#__PURE__*/_react["default"].createElement(Spinner, {
|
|
97
|
-
role: "progressbar"
|
|
98
|
-
mode: mode
|
|
72
|
+
role: "progressbar"
|
|
99
73
|
}, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
100
74
|
viewBox: "0 0 140 140",
|
|
101
75
|
isDeterminated: false
|
|
@@ -103,9 +77,9 @@ var DxcSpinner = function DxcSpinner(_ref) {
|
|
|
103
77
|
cx: "70",
|
|
104
78
|
cy: "70",
|
|
105
79
|
r: "65",
|
|
106
|
-
backgroundType: backgroundType,
|
|
107
80
|
mode: mode,
|
|
108
|
-
isDeterminated: false
|
|
81
|
+
isDeterminated: false,
|
|
82
|
+
value: value
|
|
109
83
|
})), mode === "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
110
84
|
viewBox: "0 0 16 16",
|
|
111
85
|
isDeterminated: false
|
|
@@ -113,46 +87,24 @@ var DxcSpinner = function DxcSpinner(_ref) {
|
|
|
113
87
|
cx: "8",
|
|
114
88
|
cy: "8",
|
|
115
89
|
r: "6",
|
|
116
|
-
backgroundType: backgroundType,
|
|
117
90
|
mode: mode,
|
|
118
|
-
isDeterminated: false
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
value: value,
|
|
122
|
-
showValue: showValue
|
|
123
|
-
}, /*#__PURE__*/_react["default"].createElement(SpinnerLabel, {
|
|
124
|
-
backgroundType: backgroundType,
|
|
91
|
+
isDeterminated: false,
|
|
92
|
+
value: value
|
|
93
|
+
}))), mode !== "small" && /*#__PURE__*/_react["default"].createElement(LabelsContainer, null, /*#__PURE__*/_react["default"].createElement(SpinnerLabel, {
|
|
125
94
|
mode: mode
|
|
126
95
|
}, label), (value || value === 0) && showValue && /*#__PURE__*/_react["default"].createElement(SpinnerProgress, {
|
|
127
|
-
|
|
96
|
+
value: value,
|
|
128
97
|
mode: mode,
|
|
129
98
|
showValue: showValue
|
|
130
99
|
}, value, "%")))));
|
|
131
100
|
};
|
|
132
|
-
|
|
133
|
-
var determinatedValue = function determinatedValue(props, strokeDashArray) {
|
|
101
|
+
var determinateValue = function determinateValue(value, strokeDashArray) {
|
|
134
102
|
var val = 0;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
val = strokeDashArray * (1 - props.value / 100);
|
|
103
|
+
if (value >= 0 && value <= 100) {
|
|
104
|
+
val = strokeDashArray * (1 - value / 100);
|
|
138
105
|
}
|
|
139
|
-
|
|
140
106
|
return val;
|
|
141
107
|
};
|
|
142
|
-
|
|
143
|
-
DxcSpinner.propTypes = {
|
|
144
|
-
label: _propTypes["default"].string,
|
|
145
|
-
value: _propTypes["default"].number,
|
|
146
|
-
showValue: _propTypes["default"].bool,
|
|
147
|
-
mode: _propTypes["default"].oneOf(["large", "small", "overlay"]),
|
|
148
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
149
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
150
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
151
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
152
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
153
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
154
|
-
};
|
|
155
|
-
|
|
156
108
|
var DXCSpinner = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n display: ", ";\n position: ", ";\n top: ", ";\n left: ", ";\n justify-content: ", ";\n align-items: ", ";\n z-index: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
157
109
|
return props.mode === "overlay" ? "100vh" : "";
|
|
158
110
|
}, function (props) {
|
|
@@ -172,33 +124,28 @@ var DXCSpinner = _styledComponents["default"].div(_templateObject || (_templateO
|
|
|
172
124
|
}, function (props) {
|
|
173
125
|
return props.mode === "overlay" ? 1300 : "";
|
|
174
126
|
}, function (props) {
|
|
175
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
127
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px" : "";
|
|
176
128
|
}, function (props) {
|
|
177
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
129
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "" : "";
|
|
178
130
|
}, function (props) {
|
|
179
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
131
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "" : "";
|
|
180
132
|
}, function (props) {
|
|
181
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
133
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "" : "";
|
|
182
134
|
}, function (props) {
|
|
183
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
135
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "" : "";
|
|
184
136
|
});
|
|
185
|
-
|
|
186
137
|
var SpinnerContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n align-items: center;\n display: flex;\n height: ", ";\n width: ", ";\n justify-content: center;\n position: relative;\n background-color: transparent;\n\n @keyframes spinner-svg {\n 0% {\n transform: rotateZ(0deg);\n }\n 100% {\n transform: rotateZ(360deg);\n }\n }\n @keyframes svg-circle-large {\n 0% {\n stroke-dashoffset: 400;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 75;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 400;\n transform: rotate(360deg);\n }\n }\n @keyframes svg-circle-small {\n 0% {\n stroke-dashoffset: 35;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 8;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 35;\n transform: rotate(360deg);\n }\n }\n"])), function (props) {
|
|
187
138
|
return props.mode === "small" ? "16px" : "140px";
|
|
188
139
|
}, function (props) {
|
|
189
140
|
return props.mode === "small" ? "16px" : "140px";
|
|
190
141
|
});
|
|
191
|
-
|
|
192
142
|
var BackOverlay = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100vw;\n height: 100vh;\n opacity: 1;\n transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n position: fixed;\n top: 0;\n left: 0;\n background-color: ", ";\n opacity: ", ";\n"])), function (props) {
|
|
193
143
|
return "".concat(props.theme.overlayBackgroundColor);
|
|
194
144
|
}, function (props) {
|
|
195
145
|
return "".concat(props.theme.overlayOpacity);
|
|
196
146
|
});
|
|
197
|
-
|
|
198
|
-
var BackgroundSpinner = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: absolute;\n z-index: 1;\n"])));
|
|
199
|
-
|
|
147
|
+
var BackgroundSpinner = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: absolute;\n"])));
|
|
200
148
|
var SVGBackground = _styledComponents["default"].svg(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n"])));
|
|
201
|
-
|
|
202
149
|
var CircleBackground = _styledComponents["default"].circle(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n animation: none;\n fill: transparent;\n stroke: ", ";\n stroke-dasharray: ", ";\n stroke-linecap: initial;\n stroke-width: ", ";\n transform-origin: 50% 50%;\n vector-effect: non-scaling-stroke;\n"])), function (props) {
|
|
203
150
|
return "".concat(props.theme.totalCircleColor);
|
|
204
151
|
}, function (props) {
|
|
@@ -206,17 +153,14 @@ var CircleBackground = _styledComponents["default"].circle(_templateObject6 || (
|
|
|
206
153
|
}, function (props) {
|
|
207
154
|
return props.mode !== "small" ? "8.5px" : "2px";
|
|
208
155
|
});
|
|
209
|
-
|
|
210
|
-
var Spinner = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: relative;\n z-index: 2;\n"])));
|
|
211
|
-
|
|
156
|
+
var Spinner = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: relative;\n"])));
|
|
212
157
|
var SVGSpinner = _styledComponents["default"].svg(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n transform: rotate(-90deg);\n top: 0;\n left: 0;\n transform-origin: center;\n overflow: visible;\n animation: ", ";\n"])), function (props) {
|
|
213
158
|
return !props.isDeterminated ? "1.4s linear infinite both spinner-svg" : "";
|
|
214
159
|
});
|
|
215
|
-
|
|
216
160
|
var CircleSpinner = _styledComponents["default"].circle(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n fill: transparent;\n stroke-linecap: initial;\n vector-effect: non-scaling-stroke;\n animation: ", ";\n stroke: ", ";\n transform-origin: ", ";\n stroke-dasharray: ", ";\n stroke-width: ", ";\n stroke-dashoffset: ", ";\n"])), function (props) {
|
|
217
161
|
return props.isDeterminated ? "none" : props.mode !== "small" ? "1.4s ease-in-out infinite both svg-circle-large" : "1.4s ease-in-out infinite both svg-circle-small";
|
|
218
162
|
}, function (props) {
|
|
219
|
-
return props.
|
|
163
|
+
return props.mode === "overlay" ? props.theme.trackCircleColorOverlay : props.theme.trackCircleColor;
|
|
220
164
|
}, function (props) {
|
|
221
165
|
return !props.isDeterminated ? "50% 50%" : "";
|
|
222
166
|
}, function (props) {
|
|
@@ -224,11 +168,9 @@ var CircleSpinner = _styledComponents["default"].circle(_templateObject9 || (_te
|
|
|
224
168
|
}, function (props) {
|
|
225
169
|
return props.mode !== "small" ? "8.5px" : "2px";
|
|
226
170
|
}, function (props) {
|
|
227
|
-
return props.isDeterminated ? props.mode !== "small" ?
|
|
171
|
+
return props.isDeterminated ? props.mode !== "small" ? determinateValue(props.value, 409) : determinateValue(props.value, 38) : "";
|
|
228
172
|
});
|
|
229
|
-
|
|
230
173
|
var LabelsContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: block;\n margin: 0 auto;\n position: absolute;\n text-align: center;\n width: 110px;\n"])));
|
|
231
|
-
|
|
232
174
|
var SpinnerLabel = _styledComponents["default"].p(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"])), function (props) {
|
|
233
175
|
return props.mode === "overlay" ? props.theme.overlayLabelFontFamily : props.theme.labelFontFamily;
|
|
234
176
|
}, function (props) {
|
|
@@ -238,15 +180,14 @@ var SpinnerLabel = _styledComponents["default"].p(_templateObject11 || (_templat
|
|
|
238
180
|
}, function (props) {
|
|
239
181
|
return props.mode === "overlay" ? props.theme.overlayLabelFontStyle : props.theme.labelFontStyle;
|
|
240
182
|
}, function (props) {
|
|
241
|
-
return props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.
|
|
183
|
+
return props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.theme.labelFontColor;
|
|
242
184
|
}, function (props) {
|
|
243
185
|
return props.mode === "overlay" ? props.theme.overlayLabelTextAlign : props.theme.labelTextAlign;
|
|
244
186
|
}, function (props) {
|
|
245
187
|
return props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing;
|
|
246
188
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return props.value !== "" && props.showValue === true && "block" || "none";
|
|
189
|
+
var SpinnerProgress = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"])), function (props) {
|
|
190
|
+
return props.value && props.showValue === true && "block" || "none";
|
|
250
191
|
}, function (props) {
|
|
251
192
|
return props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily;
|
|
252
193
|
}, function (props) {
|
|
@@ -256,12 +197,10 @@ var SpinnerProgress = _styledComponents["default"].p(_templateObject12 || (_temp
|
|
|
256
197
|
}, function (props) {
|
|
257
198
|
return props.mode === "overlay" ? props.theme.overlayProgressValueFontStyle : props.theme.progressValueFontStyle;
|
|
258
199
|
}, function (props) {
|
|
259
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.
|
|
200
|
+
return props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.theme.progressValueFontColor;
|
|
260
201
|
}, function (props) {
|
|
261
202
|
return props.mode === "overlay" ? props.theme.overlayProgressValueTextAlign : props.theme.progressValueTextAlign;
|
|
262
203
|
}, function (props) {
|
|
263
204
|
return props.mode === "overlay" ? props.theme.overlayProgressValueLetterSpacing : props.theme.progressValueLetterSpacing;
|
|
264
205
|
});
|
|
265
|
-
|
|
266
|
-
var _default = DxcSpinner;
|
|
267
|
-
exports["default"] = _default;
|
|
206
|
+
var _default = exports["default"] = DxcSpinner;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcSpinner from "./Spinner";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "Spinner",
|
|
9
|
+
component: DxcSpinner,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const opinionatedTheme = {
|
|
13
|
+
spinner: {
|
|
14
|
+
accentColor: "#5f249f",
|
|
15
|
+
baseColor: "#ffffff",
|
|
16
|
+
fontColor: "#000000",
|
|
17
|
+
overlayColor: "#a46ede",
|
|
18
|
+
overlayFontColor: "#ffffff",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Chromatic = () => (
|
|
23
|
+
<>
|
|
24
|
+
<ExampleContainer>
|
|
25
|
+
<Title title="With label" theme="light" level={4} />
|
|
26
|
+
<DxcSpinner label="Label" value={50}></DxcSpinner>
|
|
27
|
+
<Title title="With value label" theme="light" level={4} />
|
|
28
|
+
<DxcSpinner value={50} showValue></DxcSpinner>
|
|
29
|
+
<Title title="With label and value label" theme="light" level={4} />
|
|
30
|
+
<DxcSpinner label="Label" value={50} showValue></DxcSpinner>
|
|
31
|
+
<Title title="With 100%" theme="light" level={4} />
|
|
32
|
+
<DxcSpinner label="Label" value={100} showValue></DxcSpinner>
|
|
33
|
+
</ExampleContainer>
|
|
34
|
+
<Title title="Modes" theme="light" level={2} />
|
|
35
|
+
<ExampleContainer>
|
|
36
|
+
<Title title="Mode large" theme="light" level={4} />
|
|
37
|
+
<DxcSpinner mode="large" value={50}></DxcSpinner>
|
|
38
|
+
<Title title="Mode small" theme="light" level={4} />
|
|
39
|
+
<DxcSpinner mode="small" value={50}></DxcSpinner>
|
|
40
|
+
<Title title="Mode small with 100%" theme="light" level={4} />
|
|
41
|
+
<DxcSpinner mode="small" value={100} showValue></DxcSpinner>
|
|
42
|
+
</ExampleContainer>
|
|
43
|
+
<Title title="Margins with large mode" theme="light" level={2} />
|
|
44
|
+
<ExampleContainer>
|
|
45
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
46
|
+
<DxcSpinner margin="xxsmall" value={75}></DxcSpinner>
|
|
47
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
48
|
+
<DxcSpinner margin="xsmall" value={75}></DxcSpinner>
|
|
49
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
50
|
+
<DxcSpinner margin="small" value={75}></DxcSpinner>
|
|
51
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
52
|
+
<DxcSpinner margin="medium" value={75}></DxcSpinner>
|
|
53
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
54
|
+
<DxcSpinner margin="large" value={75}></DxcSpinner>
|
|
55
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
56
|
+
<DxcSpinner margin="xlarge" value={75}></DxcSpinner>
|
|
57
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
58
|
+
<DxcSpinner margin="xxlarge" value={75}></DxcSpinner>
|
|
59
|
+
</ExampleContainer>
|
|
60
|
+
<Title title="Margins with small mode" theme="light" level={2} />
|
|
61
|
+
<ExampleContainer>
|
|
62
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
63
|
+
<DxcSpinner margin="xxsmall" mode="small" value={75}></DxcSpinner>
|
|
64
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
65
|
+
<DxcSpinner margin="xsmall" mode="small" value={75}></DxcSpinner>
|
|
66
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
67
|
+
<DxcSpinner margin="small" mode="small" value={75}></DxcSpinner>
|
|
68
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
69
|
+
<DxcSpinner margin="medium" mode="small" value={75}></DxcSpinner>
|
|
70
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
71
|
+
<DxcSpinner margin="large" mode="small" value={75}></DxcSpinner>
|
|
72
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
73
|
+
<DxcSpinner margin="xlarge" mode="small" value={75}></DxcSpinner>
|
|
74
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
75
|
+
<DxcSpinner margin="xxlarge" mode="small" value={75}></DxcSpinner>
|
|
76
|
+
</ExampleContainer>
|
|
77
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
78
|
+
<ExampleContainer>
|
|
79
|
+
<Title title="With label and value label" theme="light" level={4} />
|
|
80
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
81
|
+
<DxcSpinner label="Label" value={50} showValue></DxcSpinner>
|
|
82
|
+
</HalstackProvider>
|
|
83
|
+
</ExampleContainer>
|
|
84
|
+
</>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export const SpinnerOverlay = () => (
|
|
88
|
+
<ExampleContainer>
|
|
89
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
90
|
+
<DxcSpinner mode="overlay" value={25}></DxcSpinner>
|
|
91
|
+
</ExampleContainer>
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export const SpinnerOverlayWith100 = () => (
|
|
95
|
+
<ExampleContainer>
|
|
96
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
97
|
+
<DxcSpinner mode="overlay" value={100}></DxcSpinner>
|
|
98
|
+
</ExampleContainer>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
export const SpinnerOverlayWithLabel = () => (
|
|
102
|
+
<ExampleContainer>
|
|
103
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
104
|
+
<DxcSpinner mode="overlay" value={50} label="Label"></DxcSpinner>
|
|
105
|
+
</ExampleContainer>
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
export const SpinnerOverlayWithValue = () => (
|
|
109
|
+
<ExampleContainer>
|
|
110
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
111
|
+
<DxcSpinner mode="overlay" value={50} showValue></DxcSpinner>
|
|
112
|
+
</ExampleContainer>
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
export const SpinnerOverlayWithValueAndLabel = () => (
|
|
116
|
+
<ExampleContainer>
|
|
117
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
118
|
+
<DxcSpinner mode="overlay" label="Label" value={50} showValue></DxcSpinner>
|
|
119
|
+
</ExampleContainer>
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export const SpinnerOverlayWithValueAndLabelOpinionated = () => (
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
125
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
126
|
+
<DxcSpinner mode="overlay" label="Label" value={50} showValue></DxcSpinner>
|
|
127
|
+
</HalstackProvider>
|
|
128
|
+
</ExampleContainer>
|
|
129
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
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 _Spinner = _interopRequireDefault(require("./Spinner.tsx"));
|
|
7
|
+
describe("Spinner component tests", function () {
|
|
8
|
+
test("Spinner renders with correct label", function () {
|
|
9
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
10
|
+
label: "test-loading"
|
|
11
|
+
})),
|
|
12
|
+
getByText = _render.getByText;
|
|
13
|
+
expect(getByText("test-loading")).toBeTruthy();
|
|
14
|
+
});
|
|
15
|
+
test("Spinner shows value correctly", function () {
|
|
16
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
17
|
+
label: "test-loading",
|
|
18
|
+
value: 75,
|
|
19
|
+
showValue: true
|
|
20
|
+
})),
|
|
21
|
+
getByText = _render2.getByText;
|
|
22
|
+
expect(getByText("75%")).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
test("Small spinner hides value and label correctly", function () {
|
|
25
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
26
|
+
mode: "small",
|
|
27
|
+
label: "test-loading",
|
|
28
|
+
value: 75,
|
|
29
|
+
showValue: true
|
|
30
|
+
})),
|
|
31
|
+
queryByText = _render3.queryByText;
|
|
32
|
+
expect(queryByText("test-loading")).toBeFalsy();
|
|
33
|
+
expect(queryByText("75%")).toBeFalsy();
|
|
34
|
+
});
|
|
35
|
+
test("Overlay spinner shows value and label correctly", function () {
|
|
36
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
37
|
+
mode: "overlay",
|
|
38
|
+
label: "test-loading",
|
|
39
|
+
value: 75,
|
|
40
|
+
showValue: true
|
|
41
|
+
})),
|
|
42
|
+
getByText = _render4.getByText;
|
|
43
|
+
expect(getByText("test-loading")).toBeTruthy();
|
|
44
|
+
expect(getByText("75%")).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
test("Get spinner by role", function () {
|
|
47
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
48
|
+
label: "test-loading",
|
|
49
|
+
value: 75,
|
|
50
|
+
showValue: true
|
|
51
|
+
})),
|
|
52
|
+
getByRole = _render5.getByRole;
|
|
53
|
+
expect(getByRole("progressbar")).toBeTruthy();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
type Props = {
|
|
9
|
+
/**
|
|
10
|
+
* Text to be placed inside the spinner.
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The value of the progress indicator. If it's received the
|
|
15
|
+
* component is determinate, otherwise is indeterminate.
|
|
16
|
+
*/
|
|
17
|
+
value?: number;
|
|
18
|
+
/**
|
|
19
|
+
* If true, the value is displayed inside the spinner..
|
|
20
|
+
*/
|
|
21
|
+
showValue?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Available modes of the spinner.
|
|
24
|
+
*/
|
|
25
|
+
mode?: "large" | "small" | "overlay";
|
|
26
|
+
/**
|
|
27
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
28
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
29
|
+
*/
|
|
30
|
+
margin?: Space | Margin;
|
|
31
|
+
};
|
|
32
|
+
export default Props;
|