@dxc-technology/halstack-react 12.2.0 → 13.0.0
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 +1 -1
- package/dist/index.d.mts +6439 -0
- package/dist/index.d.ts +6439 -0
- package/dist/index.js +12617 -0
- package/dist/index.mjs +12529 -0
- package/package.json +59 -64
- package/BackgroundColorContext.d.ts +0 -1
- package/BackgroundColorContext.js +0 -30
- package/HalstackContext.d.ts +0 -1269
- package/HalstackContext.js +0 -320
- package/accordion/Accordion.accessibility.test.d.ts +0 -1
- package/accordion/Accordion.accessibility.test.js +0 -71
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -168
- package/accordion/Accordion.stories.tsx +0 -241
- package/accordion/Accordion.test.d.ts +0 -1
- package/accordion/Accordion.test.js +0 -56
- package/accordion/types.d.ts +0 -57
- package/accordion/types.js +0 -5
- package/accordion-group/AccordionGroup.accessibility.test.d.ts +0 -1
- package/accordion-group/AccordionGroup.accessibility.test.js +0 -82
- package/accordion-group/AccordionGroup.d.ts +0 -7
- package/accordion-group/AccordionGroup.js +0 -101
- package/accordion-group/AccordionGroup.stories.tsx +0 -252
- package/accordion-group/AccordionGroup.test.d.ts +0 -1
- package/accordion-group/AccordionGroup.test.js +0 -94
- package/accordion-group/AccordionGroupAccordion.d.ts +0 -4
- package/accordion-group/AccordionGroupAccordion.js +0 -31
- package/accordion-group/AccordionGroupContext.d.ts +0 -3
- package/accordion-group/AccordionGroupContext.js +0 -8
- package/accordion-group/types.d.ts +0 -67
- package/accordion-group/types.js +0 -5
- package/action-icon/ActionIcon.accessibility.test.d.ts +0 -1
- package/action-icon/ActionIcon.accessibility.test.js +0 -63
- package/action-icon/ActionIcon.d.ts +0 -4
- package/action-icon/ActionIcon.js +0 -48
- package/action-icon/ActionIcon.stories.tsx +0 -41
- package/action-icon/ActionIcon.test.d.ts +0 -1
- package/action-icon/ActionIcon.test.js +0 -64
- package/action-icon/types.d.ts +0 -26
- package/action-icon/types.js +0 -5
- package/alert/Alert.accessibility.test.d.ts +0 -1
- package/alert/Alert.accessibility.test.js +0 -95
- package/alert/Alert.d.ts +0 -4
- package/alert/Alert.js +0 -203
- package/alert/Alert.stories.tsx +0 -198
- package/alert/Alert.test.d.ts +0 -1
- package/alert/Alert.test.js +0 -75
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- package/badge/Badge.accessibility.test.d.ts +0 -1
- package/badge/Badge.accessibility.test.js +0 -129
- package/badge/Badge.d.ts +0 -4
- package/badge/Badge.js +0 -161
- package/badge/Badge.stories.tsx +0 -210
- package/badge/Badge.test.d.ts +0 -1
- package/badge/Badge.test.js +0 -30
- package/badge/types.d.ts +0 -54
- package/badge/types.js +0 -5
- package/bleed/Bleed.d.ts +0 -3
- package/bleed/Bleed.js +0 -43
- package/bleed/Bleed.stories.tsx +0 -342
- package/bleed/types.d.ts +0 -37
- package/bleed/types.js +0 -5
- package/box/Box.accessibility.test.d.ts +0 -1
- package/box/Box.accessibility.test.js +0 -33
- package/box/Box.d.ts +0 -4
- package/box/Box.js +0 -75
- package/box/Box.stories.tsx +0 -119
- package/box/Box.test.d.ts +0 -1
- package/box/Box.test.js +0 -13
- package/box/types.d.ts +0 -32
- package/box/types.js +0 -5
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +0 -1
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +0 -96
- package/breadcrumbs/Breadcrumbs.d.ts +0 -4
- package/breadcrumbs/Breadcrumbs.js +0 -79
- package/breadcrumbs/Breadcrumbs.stories.tsx +0 -194
- package/breadcrumbs/Breadcrumbs.test.d.ts +0 -1
- package/breadcrumbs/Breadcrumbs.test.js +0 -168
- package/breadcrumbs/Item.d.ts +0 -4
- package/breadcrumbs/Item.js +0 -52
- package/breadcrumbs/dropdownTheme.d.ts +0 -53
- package/breadcrumbs/dropdownTheme.js +0 -62
- package/breadcrumbs/types.d.ts +0 -40
- package/breadcrumbs/types.js +0 -5
- package/bulleted-list/BulletedList.accessibility.test.d.ts +0 -1
- package/bulleted-list/BulletedList.accessibility.test.js +0 -119
- package/bulleted-list/BulletedList.d.ts +0 -7
- package/bulleted-list/BulletedList.js +0 -92
- package/bulleted-list/BulletedList.stories.tsx +0 -115
- package/bulleted-list/types.d.ts +0 -38
- package/bulleted-list/types.js +0 -5
- package/button/Button.accessibility.test.d.ts +0 -1
- package/button/Button.accessibility.test.js +0 -127
- package/button/Button.d.ts +0 -4
- package/button/Button.js +0 -121
- package/button/Button.stories.tsx +0 -325
- package/button/Button.test.d.ts +0 -1
- package/button/Button.test.js +0 -38
- package/button/types.d.ts +0 -57
- package/button/types.js +0 -5
- package/card/Card.accessibility.test.d.ts +0 -1
- package/card/Card.accessibility.test.js +0 -36
- package/card/Card.d.ts +0 -4
- package/card/Card.js +0 -121
- package/card/Card.stories.tsx +0 -171
- package/card/Card.test.d.ts +0 -1
- package/card/Card.test.js +0 -39
- package/card/types.d.ts +0 -62
- package/card/types.js +0 -5
- package/checkbox/Checkbox.accessibility.test.d.ts +0 -1
- package/checkbox/Checkbox.accessibility.test.js +0 -87
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -212
- package/checkbox/Checkbox.stories.tsx +0 -222
- package/checkbox/Checkbox.test.d.ts +0 -1
- package/checkbox/Checkbox.test.js +0 -199
- package/checkbox/types.d.ts +0 -72
- package/checkbox/types.js +0 -5
- package/chip/Chip.accessibility.test.d.ts +0 -1
- package/chip/Chip.accessibility.test.js +0 -67
- package/chip/Chip.d.ts +0 -4
- package/chip/Chip.js +0 -126
- package/chip/Chip.stories.tsx +0 -195
- package/chip/Chip.test.d.ts +0 -1
- package/chip/Chip.test.js +0 -41
- package/chip/types.d.ts +0 -45
- package/chip/types.js +0 -5
- package/common/coreTokens.d.ts +0 -236
- package/common/coreTokens.js +0 -183
- package/common/utils.d.ts +0 -1
- package/common/utils.js +0 -16
- package/common/variables.d.ts +0 -1421
- package/common/variables.js +0 -1287
- package/container/Container.d.ts +0 -4
- package/container/Container.js +0 -194
- package/container/Container.stories.tsx +0 -214
- package/container/types.d.ts +0 -176
- package/container/types.js +0 -5
- package/contextual-menu/ContextualMenu.accessibility.test.d.ts +0 -1
- package/contextual-menu/ContextualMenu.accessibility.test.js +0 -98
- package/contextual-menu/ContextualMenu.d.ts +0 -5
- package/contextual-menu/ContextualMenu.js +0 -136
- package/contextual-menu/ContextualMenu.stories.tsx +0 -231
- package/contextual-menu/ContextualMenu.test.d.ts +0 -1
- package/contextual-menu/ContextualMenu.test.js +0 -247
- package/contextual-menu/GroupItem.d.ts +0 -4
- package/contextual-menu/GroupItem.js +0 -67
- package/contextual-menu/ItemAction.d.ts +0 -4
- package/contextual-menu/ItemAction.js +0 -88
- package/contextual-menu/MenuItem.d.ts +0 -4
- package/contextual-menu/MenuItem.js +0 -29
- package/contextual-menu/SingleItem.d.ts +0 -4
- package/contextual-menu/SingleItem.js +0 -38
- package/contextual-menu/types.d.ts +0 -65
- package/contextual-menu/types.js +0 -5
- package/date-input/Calendar.d.ts +0 -4
- package/date-input/Calendar.js +0 -230
- package/date-input/DateInput.accessibility.test.d.ts +0 -1
- package/date-input/DateInput.accessibility.test.js +0 -229
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -228
- package/date-input/DateInput.stories.tsx +0 -291
- package/date-input/DateInput.test.d.ts +0 -1
- package/date-input/DateInput.test.js +0 -808
- package/date-input/DatePicker.d.ts +0 -4
- package/date-input/DatePicker.js +0 -121
- package/date-input/YearPicker.d.ts +0 -4
- package/date-input/YearPicker.js +0 -105
- package/date-input/types.d.ts +0 -164
- package/date-input/types.js +0 -5
- package/dialog/Dialog.accessibility.test.d.ts +0 -1
- package/dialog/Dialog.accessibility.test.js +0 -69
- package/dialog/Dialog.d.ts +0 -4
- package/dialog/Dialog.js +0 -93
- package/dialog/Dialog.stories.tsx +0 -369
- package/dialog/Dialog.test.d.ts +0 -1
- package/dialog/Dialog.test.js +0 -370
- package/dialog/types.d.ts +0 -36
- package/dialog/types.js +0 -5
- package/divider/Divider.accessibility.test.d.ts +0 -1
- package/divider/Divider.accessibility.test.js +0 -33
- package/divider/Divider.d.ts +0 -4
- package/divider/Divider.js +0 -36
- package/divider/Divider.stories.tsx +0 -224
- package/divider/Divider.test.d.ts +0 -1
- package/divider/Divider.test.js +0 -38
- package/divider/types.d.ts +0 -21
- package/divider/types.js +0 -5
- package/dropdown/Dropdown.accessibility.test.d.ts +0 -1
- package/dropdown/Dropdown.accessibility.test.js +0 -183
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -320
- package/dropdown/Dropdown.stories.tsx +0 -427
- package/dropdown/Dropdown.test.d.ts +0 -1
- package/dropdown/Dropdown.test.js +0 -628
- package/dropdown/DropdownMenu.d.ts +0 -4
- package/dropdown/DropdownMenu.js +0 -63
- package/dropdown/DropdownMenuItem.d.ts +0 -4
- package/dropdown/DropdownMenuItem.js +0 -71
- package/dropdown/types.d.ts +0 -96
- package/dropdown/types.js +0 -5
- package/file-input/FileInput.accessibility.test.d.ts +0 -1
- package/file-input/FileInput.accessibility.test.js +0 -167
- package/file-input/FileInput.d.ts +0 -4
- package/file-input/FileInput.js +0 -438
- package/file-input/FileInput.stories.tsx +0 -618
- package/file-input/FileInput.test.d.ts +0 -1
- package/file-input/FileInput.test.js +0 -404
- package/file-input/FileItem.d.ts +0 -4
- package/file-input/FileItem.js +0 -125
- package/file-input/types.d.ts +0 -125
- package/file-input/types.js +0 -5
- package/flex/Flex.d.ts +0 -4
- package/flex/Flex.js +0 -57
- package/flex/Flex.stories.tsx +0 -112
- package/flex/types.d.ts +0 -97
- package/flex/types.js +0 -5
- package/footer/Footer.accessibility.test.d.ts +0 -1
- package/footer/Footer.accessibility.test.js +0 -125
- package/footer/Footer.d.ts +0 -4
- package/footer/Footer.js +0 -140
- package/footer/Footer.stories.tsx +0 -208
- package/footer/Footer.test.d.ts +0 -1
- package/footer/Footer.test.js +0 -85
- package/footer/Icons.d.ts +0 -3
- package/footer/Icons.js +0 -108
- package/footer/types.d.ts +0 -64
- package/footer/types.js +0 -5
- package/grid/Grid.d.ts +0 -7
- package/grid/Grid.js +0 -76
- package/grid/Grid.stories.tsx +0 -221
- package/grid/types.d.ts +0 -115
- package/grid/types.js +0 -5
- package/header/Header.accessibility.test.d.ts +0 -1
- package/header/Header.accessibility.test.js +0 -94
- package/header/Header.d.ts +0 -8
- package/header/Header.js +0 -210
- package/header/Header.stories.tsx +0 -267
- package/header/Header.test.d.ts +0 -1
- package/header/Header.test.js +0 -66
- package/header/Icons.d.ts +0 -2
- package/header/Icons.js +0 -24
- package/header/types.d.ts +0 -33
- package/header/types.js +0 -5
- package/heading/Heading.accessibility.test.d.ts +0 -1
- package/heading/Heading.accessibility.test.js +0 -33
- package/heading/Heading.d.ts +0 -4
- package/heading/Heading.js +0 -137
- package/heading/Heading.stories.tsx +0 -54
- package/heading/Heading.test.d.ts +0 -1
- package/heading/Heading.test.js +0 -156
- package/heading/types.d.ts +0 -33
- package/heading/types.js +0 -5
- package/icon/Icon.accessibility.test.d.ts +0 -1
- package/icon/Icon.accessibility.test.js +0 -30
- package/icon/Icon.d.ts +0 -4
- package/icon/Icon.js +0 -33
- package/icon/Icon.stories.tsx +0 -28
- package/icon/types.d.ts +0 -4
- package/icon/types.js +0 -5
- package/image/Image.accessibility.test.d.ts +0 -1
- package/image/Image.accessibility.test.js +0 -56
- package/image/Image.d.ts +0 -4
- package/image/Image.js +0 -70
- package/image/Image.stories.tsx +0 -129
- package/image/types.d.ts +0 -72
- package/image/types.js +0 -5
- package/inset/Inset.d.ts +0 -3
- package/inset/Inset.js +0 -43
- package/inset/Inset.stories.tsx +0 -230
- 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 -137
- package/layout/ApplicationLayout.stories.tsx +0 -162
- package/layout/Icons.d.ts +0 -7
- package/layout/Icons.js +0 -48
- package/layout/types.d.ts +0 -41
- package/layout/types.js +0 -5
- package/link/Link.accessibility.test.d.ts +0 -1
- package/link/Link.accessibility.test.js +0 -108
- package/link/Link.d.ts +0 -4
- package/link/Link.js +0 -117
- package/link/Link.stories.tsx +0 -253
- package/link/Link.test.d.ts +0 -1
- package/link/Link.test.js +0 -63
- package/link/types.d.ts +0 -54
- package/link/types.js +0 -5
- package/main.d.ts +0 -50
- package/main.js +0 -364
- package/nav-tabs/NavTabs.accessibility.test.d.ts +0 -1
- package/nav-tabs/NavTabs.accessibility.test.js +0 -44
- package/nav-tabs/NavTabs.d.ts +0 -7
- package/nav-tabs/NavTabs.js +0 -108
- package/nav-tabs/NavTabs.stories.tsx +0 -294
- package/nav-tabs/NavTabs.test.d.ts +0 -1
- package/nav-tabs/NavTabs.test.js +0 -77
- package/nav-tabs/NavTabsContext.d.ts +0 -3
- package/nav-tabs/NavTabsContext.js +0 -8
- package/nav-tabs/Tab.d.ts +0 -4
- package/nav-tabs/Tab.js +0 -117
- package/nav-tabs/types.d.ts +0 -52
- package/nav-tabs/types.js +0 -5
- package/number-input/NumberInput.accessibility.test.d.ts +0 -1
- package/number-input/NumberInput.accessibility.test.js +0 -227
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -89
- package/number-input/NumberInput.stories.tsx +0 -126
- package/number-input/NumberInput.test.d.ts +0 -1
- package/number-input/NumberInput.test.js +0 -988
- package/number-input/NumberInputContext.d.ts +0 -3
- package/number-input/NumberInputContext.js +0 -8
- package/number-input/types.d.ts +0 -136
- package/number-input/types.js +0 -5
- package/paginator/Paginator.accessibility.test.d.ts +0 -1
- package/paginator/Paginator.accessibility.test.js +0 -78
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -138
- package/paginator/Paginator.stories.tsx +0 -87
- package/paginator/Paginator.test.d.ts +0 -1
- package/paginator/Paginator.test.js +0 -334
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- package/paragraph/Paragraph.accessibility.test.d.ts +0 -1
- package/paragraph/Paragraph.accessibility.test.js +0 -28
- package/paragraph/Paragraph.d.ts +0 -5
- package/paragraph/Paragraph.js +0 -22
- package/paragraph/Paragraph.stories.tsx +0 -27
- package/password-input/PasswordInput.accessibility.test.d.ts +0 -1
- package/password-input/PasswordInput.accessibility.test.js +0 -152
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -100
- package/password-input/PasswordInput.stories.tsx +0 -108
- package/password-input/PasswordInput.test.d.ts +0 -1
- package/password-input/PasswordInput.test.js +0 -197
- package/password-input/types.d.ts +0 -111
- package/password-input/types.js +0 -5
- package/progress-bar/ProgressBar.accessibility.test.d.ts +0 -1
- package/progress-bar/ProgressBar.accessibility.test.js +0 -35
- package/progress-bar/ProgressBar.d.ts +0 -4
- package/progress-bar/ProgressBar.js +0 -146
- package/progress-bar/ProgressBar.stories.tsx +0 -93
- package/progress-bar/ProgressBar.test.d.ts +0 -1
- package/progress-bar/ProgressBar.test.js +0 -93
- package/progress-bar/types.d.ts +0 -37
- package/progress-bar/types.js +0 -5
- package/quick-nav/QuickNav.accessibility.test.d.ts +0 -1
- package/quick-nav/QuickNav.accessibility.test.js +0 -57
- package/quick-nav/QuickNav.d.ts +0 -4
- package/quick-nav/QuickNav.js +0 -94
- package/quick-nav/QuickNav.stories.tsx +0 -356
- 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 -121
- package/radio-group/RadioGroup.accessibility.test.d.ts +0 -1
- package/radio-group/RadioGroup.accessibility.test.js +0 -97
- package/radio-group/RadioGroup.d.ts +0 -4
- package/radio-group/RadioGroup.js +0 -233
- package/radio-group/RadioGroup.stories.tsx +0 -214
- package/radio-group/RadioGroup.test.d.ts +0 -1
- package/radio-group/RadioGroup.test.js +0 -754
- package/radio-group/types.d.ts +0 -114
- package/radio-group/types.js +0 -5
- package/resultset-table/Icons.d.ts +0 -7
- package/resultset-table/Icons.js +0 -47
- package/resultset-table/ResultsetTable.accessibility.test.d.ts +0 -1
- package/resultset-table/ResultsetTable.accessibility.test.js +0 -284
- package/resultset-table/ResultsetTable.d.ts +0 -7
- package/resultset-table/ResultsetTable.js +0 -195
- package/resultset-table/ResultsetTable.stories.tsx +0 -413
- package/resultset-table/ResultsetTable.test.d.ts +0 -1
- package/resultset-table/ResultsetTable.test.js +0 -450
- package/resultset-table/types.d.ts +0 -101
- package/resultset-table/types.js +0 -5
- package/select/Listbox.d.ts +0 -4
- package/select/Listbox.js +0 -151
- package/select/Option.d.ts +0 -4
- package/select/Option.js +0 -89
- package/select/Select.accessibility.test.d.ts +0 -1
- package/select/Select.accessibility.test.js +0 -227
- package/select/Select.d.ts +0 -4
- package/select/Select.js +0 -602
- package/select/Select.stories.tsx +0 -928
- package/select/Select.test.d.ts +0 -1
- package/select/Select.test.js +0 -2267
- package/select/types.d.ts +0 -209
- package/select/types.js +0 -5
- package/sidenav/Sidenav.accessibility.test.d.ts +0 -1
- package/sidenav/Sidenav.accessibility.test.js +0 -59
- package/sidenav/Sidenav.d.ts +0 -10
- package/sidenav/Sidenav.js +0 -201
- package/sidenav/Sidenav.stories.tsx +0 -277
- package/sidenav/Sidenav.test.d.ts +0 -1
- package/sidenav/Sidenav.test.js +0 -37
- package/sidenav/SidenavContext.d.ts +0 -5
- package/sidenav/SidenavContext.js +0 -13
- package/sidenav/types.d.ts +0 -76
- package/sidenav/types.js +0 -5
- package/slider/Slider.accessibility.test.d.ts +0 -1
- package/slider/Slider.accessibility.test.js +0 -103
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -283
- package/slider/Slider.stories.tsx +0 -180
- package/slider/Slider.test.d.ts +0 -1
- package/slider/Slider.test.js +0 -256
- package/slider/types.d.ts +0 -86
- package/slider/types.js +0 -5
- package/spinner/Spinner.accessibility.test.d.ts +0 -1
- package/spinner/Spinner.accessibility.test.js +0 -96
- package/spinner/Spinner.d.ts +0 -4
- package/spinner/Spinner.js +0 -210
- package/spinner/Spinner.stories.tsx +0 -129
- package/spinner/Spinner.test.d.ts +0 -1
- package/spinner/Spinner.test.js +0 -55
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- package/status-light/StatusLight.accessibility.test.d.ts +0 -1
- package/status-light/StatusLight.accessibility.test.js +0 -157
- package/status-light/StatusLight.d.ts +0 -4
- package/status-light/StatusLight.js +0 -51
- package/status-light/StatusLight.stories.tsx +0 -74
- package/status-light/StatusLight.test.d.ts +0 -1
- package/status-light/StatusLight.test.js +0 -25
- package/status-light/types.d.ts +0 -17
- package/status-light/types.js +0 -5
- package/switch/Switch.accessibility.test.d.ts +0 -1
- package/switch/Switch.accessibility.test.js +0 -98
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -211
- package/switch/Switch.stories.tsx +0 -149
- package/switch/Switch.test.d.ts +0 -1
- package/switch/Switch.test.js +0 -180
- package/switch/types.d.ts +0 -66
- package/switch/types.js +0 -5
- package/table/DropdownTheme.js +0 -62
- package/table/Table.accessibility.test.d.ts +0 -1
- package/table/Table.accessibility.test.js +0 -92
- package/table/Table.d.ts +0 -8
- package/table/Table.js +0 -161
- package/table/Table.stories.tsx +0 -663
- package/table/Table.test.d.ts +0 -1
- package/table/Table.test.js +0 -111
- package/table/types.d.ts +0 -49
- package/table/types.js +0 -5
- package/tabs/Tab.d.ts +0 -4
- package/tabs/Tab.js +0 -117
- package/tabs/Tabs.accessibility.test.d.ts +0 -1
- package/tabs/Tabs.accessibility.test.js +0 -56
- package/tabs/Tabs.d.ts +0 -4
- package/tabs/Tabs.js +0 -373
- package/tabs/Tabs.stories.tsx +0 -230
- package/tabs/Tabs.test.d.ts +0 -1
- package/tabs/Tabs.test.js +0 -276
- package/tabs/types.d.ts +0 -92
- package/tabs/types.js +0 -5
- package/tag/Tag.accessibility.test.d.ts +0 -1
- package/tag/Tag.accessibility.test.js +0 -69
- package/tag/Tag.d.ts +0 -4
- package/tag/Tag.js +0 -151
- package/tag/Tag.stories.tsx +0 -152
- package/tag/Tag.test.d.ts +0 -1
- package/tag/Tag.test.js +0 -41
- package/tag/types.d.ts +0 -69
- package/tag/types.js +0 -5
- package/text-input/Suggestion.d.ts +0 -4
- package/text-input/Suggestion.js +0 -67
- package/text-input/Suggestions.d.ts +0 -4
- package/text-input/Suggestions.js +0 -94
- package/text-input/TextInput.accessibility.test.d.ts +0 -1
- package/text-input/TextInput.accessibility.test.js +0 -320
- package/text-input/TextInput.d.ts +0 -4
- package/text-input/TextInput.js +0 -571
- package/text-input/TextInput.stories.tsx +0 -477
- package/text-input/TextInput.test.d.ts +0 -1
- package/text-input/TextInput.test.js +0 -1755
- package/text-input/types.d.ts +0 -205
- package/text-input/types.js +0 -5
- package/textarea/Textarea.accessibility.test.d.ts +0 -1
- package/textarea/Textarea.accessibility.test.js +0 -155
- package/textarea/Textarea.d.ts +0 -4
- package/textarea/Textarea.js +0 -235
- package/textarea/Textarea.stories.tsx +0 -174
- package/textarea/Textarea.test.d.ts +0 -1
- package/textarea/Textarea.test.js +0 -406
- package/textarea/types.d.ts +0 -141
- package/textarea/types.js +0 -5
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +0 -1
- package/toggle-group/ToggleGroup.accessibility.test.js +0 -107
- package/toggle-group/ToggleGroup.d.ts +0 -4
- package/toggle-group/ToggleGroup.js +0 -199
- package/toggle-group/ToggleGroup.stories.tsx +0 -218
- package/toggle-group/ToggleGroup.test.d.ts +0 -1
- package/toggle-group/ToggleGroup.test.js +0 -137
- package/toggle-group/types.d.ts +0 -114
- package/toggle-group/types.js +0 -5
- package/tooltip/Tooltip.accessibility.test.d.ts +0 -1
- package/tooltip/Tooltip.accessibility.test.js +0 -144
- package/tooltip/Tooltip.d.ts +0 -4
- package/tooltip/Tooltip.js +0 -50
- package/tooltip/Tooltip.stories.tsx +0 -111
- package/tooltip/Tooltip.test.d.ts +0 -1
- package/tooltip/Tooltip.test.js +0 -112
- package/tooltip/types.d.ts +0 -16
- package/tooltip/types.js +0 -5
- package/typography/Typography.accessibility.test.d.ts +0 -1
- package/typography/Typography.accessibility.test.js +0 -339
- package/typography/Typography.d.ts +0 -4
- package/typography/Typography.js +0 -23
- package/typography/Typography.stories.tsx +0 -196
- package/typography/Typography.test.js +0 -23
- package/typography/types.d.ts +0 -18
- package/typography/types.js +0 -5
- package/useTheme.d.ts +0 -1168
- package/useTheme.js +0 -15
- package/useTranslatedLabels.d.ts +0 -85
- package/useTranslatedLabels.js +0 -14
- package/utils/BaseTypography.d.ts +0 -21
- package/utils/BaseTypography.js +0 -98
- package/utils/FocusLock.d.ts +0 -13
- package/utils/FocusLock.js +0 -125
- package/wizard/Wizard.accessibility.test.d.ts +0 -1
- package/wizard/Wizard.accessibility.test.js +0 -55
- package/wizard/Wizard.d.ts +0 -4
- package/wizard/Wizard.js +0 -239
- package/wizard/Wizard.stories.tsx +0 -272
- package/wizard/Wizard.test.d.ts +0 -1
- package/wizard/Wizard.test.js +0 -114
- package/wizard/types.d.ts +0 -64
- package/wizard/types.js +0 -5
package/slider/Slider.test.js
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
5
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
9
|
-
var _Slider = _interopRequireDefault(require("./Slider"));
|
|
10
|
-
// Mocking DOMRect for Radix Primitive Popover
|
|
11
|
-
global.globalThis = global;
|
|
12
|
-
global.DOMRect = {
|
|
13
|
-
fromRect: function fromRect() {
|
|
14
|
-
return {
|
|
15
|
-
top: 0,
|
|
16
|
-
left: 0,
|
|
17
|
-
bottom: 0,
|
|
18
|
-
right: 0,
|
|
19
|
-
width: 0,
|
|
20
|
-
height: 0
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
global.ResizeObserver = /*#__PURE__*/function () {
|
|
25
|
-
function ResizeObserver() {
|
|
26
|
-
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
27
|
-
}
|
|
28
|
-
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
29
|
-
key: "observe",
|
|
30
|
-
value: function observe() {}
|
|
31
|
-
}, {
|
|
32
|
-
key: "unobserve",
|
|
33
|
-
value: function unobserve() {}
|
|
34
|
-
}, {
|
|
35
|
-
key: "disconnect",
|
|
36
|
-
value: function disconnect() {}
|
|
37
|
-
}]);
|
|
38
|
-
}();
|
|
39
|
-
describe("Slider component tests", function () {
|
|
40
|
-
test("Slider renders with correct text and label id", function () {
|
|
41
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
42
|
-
label: "label",
|
|
43
|
-
minValue: 0,
|
|
44
|
-
maxValue: 100,
|
|
45
|
-
showLimitsValues: true
|
|
46
|
-
})),
|
|
47
|
-
getByText = _render.getByText,
|
|
48
|
-
getByRole = _render.getByRole;
|
|
49
|
-
expect(getByText("0")).toBeTruthy();
|
|
50
|
-
expect(getByText("100")).toBeTruthy();
|
|
51
|
-
var sliderId = getByText("label").getAttribute("id");
|
|
52
|
-
expect(getByRole("slider").getAttribute("aria-labelledby")).toBe(sliderId);
|
|
53
|
-
expect(getByRole("slider").getAttribute("aria-orientation")).toBe("horizontal");
|
|
54
|
-
});
|
|
55
|
-
test("Slider renders with correct initial value when it is uncontrolled", function () {
|
|
56
|
-
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
57
|
-
defaultValue: 30,
|
|
58
|
-
minValue: 0,
|
|
59
|
-
maxValue: 100,
|
|
60
|
-
showLimitsValues: true,
|
|
61
|
-
showInput: true
|
|
62
|
-
})),
|
|
63
|
-
getByRole = _render2.getByRole;
|
|
64
|
-
var slider = getByRole("slider");
|
|
65
|
-
var input = getByRole("textbox");
|
|
66
|
-
expect(slider.getAttribute("aria-valuenow")).toBe("30");
|
|
67
|
-
expect(input.value).toBe("30");
|
|
68
|
-
});
|
|
69
|
-
test("Slider correct limit values", function () {
|
|
70
|
-
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
71
|
-
defaultValue: 125,
|
|
72
|
-
minValue: 30,
|
|
73
|
-
maxValue: 125,
|
|
74
|
-
showLimitsValues: true
|
|
75
|
-
})),
|
|
76
|
-
getByRole = _render3.getByRole,
|
|
77
|
-
getByText = _render3.getByText;
|
|
78
|
-
var slider = getByRole("slider");
|
|
79
|
-
expect(slider.getAttribute("aria-valuemin")).toBe("30");
|
|
80
|
-
expect(slider.getAttribute("aria-valuemax")).toBe("125");
|
|
81
|
-
_userEvent["default"].tab();
|
|
82
|
-
_react2.fireEvent.keyDown(slider, {
|
|
83
|
-
key: "ArrowRight",
|
|
84
|
-
code: "ArrowRight",
|
|
85
|
-
keyCode: 39,
|
|
86
|
-
charCode: 39
|
|
87
|
-
});
|
|
88
|
-
expect(slider.getAttribute("aria-valuenow")).toBe("125");
|
|
89
|
-
expect(getByText("30")).toBeTruthy();
|
|
90
|
-
expect(getByText("125")).toBeTruthy();
|
|
91
|
-
});
|
|
92
|
-
test("Calls correct function onChange in controlled slider", function () {
|
|
93
|
-
var onChange = jest.fn();
|
|
94
|
-
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
95
|
-
minValue: 0,
|
|
96
|
-
maxValue: 100,
|
|
97
|
-
onChange: onChange,
|
|
98
|
-
showLimitsValues: true,
|
|
99
|
-
value: 13,
|
|
100
|
-
showInput: true
|
|
101
|
-
})),
|
|
102
|
-
getByRole = _render4.getByRole;
|
|
103
|
-
var input = getByRole("textbox");
|
|
104
|
-
expect(getByRole("slider").getAttribute("aria-valuenow")).toBe("13");
|
|
105
|
-
expect(input.value).toBe("13");
|
|
106
|
-
(0, _react2.act)(function () {
|
|
107
|
-
_react2.fireEvent.change(input, {
|
|
108
|
-
target: {
|
|
109
|
-
value: 25
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
expect(onChange).toHaveBeenCalledWith(25);
|
|
114
|
-
expect(getByRole("slider").getAttribute("aria-valuenow")).toBe("13");
|
|
115
|
-
expect(input.value).toBe("13");
|
|
116
|
-
});
|
|
117
|
-
test("Calls correct function onChange in uncontrolled slider", function () {
|
|
118
|
-
var onChange = jest.fn();
|
|
119
|
-
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
120
|
-
minValue: 0,
|
|
121
|
-
maxValue: 100,
|
|
122
|
-
onChange: onChange,
|
|
123
|
-
showLimitsValues: true,
|
|
124
|
-
showInput: true
|
|
125
|
-
})),
|
|
126
|
-
getByRole = _render5.getByRole;
|
|
127
|
-
var input = getByRole("textbox");
|
|
128
|
-
(0, _react2.act)(function () {
|
|
129
|
-
_react2.fireEvent.change(input, {
|
|
130
|
-
target: {
|
|
131
|
-
value: 25
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
expect(onChange).toHaveBeenCalledWith(25);
|
|
136
|
-
expect(getByRole("slider").getAttribute("aria-valuenow")).toBe("25");
|
|
137
|
-
expect(input.value).toBe("25");
|
|
138
|
-
});
|
|
139
|
-
test("Disabled slider have disabled input and slider", function () {
|
|
140
|
-
var onChange = jest.fn();
|
|
141
|
-
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
142
|
-
minValue: 0,
|
|
143
|
-
maxValue: 100,
|
|
144
|
-
onChange: onChange,
|
|
145
|
-
showLimitsValues: true,
|
|
146
|
-
disabled: true,
|
|
147
|
-
showInput: true,
|
|
148
|
-
value: 13
|
|
149
|
-
})),
|
|
150
|
-
getByRole = _render6.getByRole;
|
|
151
|
-
var input = getByRole("textbox");
|
|
152
|
-
(0, _react2.act)(function () {
|
|
153
|
-
_react2.fireEvent.change(input, {
|
|
154
|
-
target: {
|
|
155
|
-
value: 25
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
expect(input.hasAttribute("disabled")).toBeTruthy();
|
|
160
|
-
expect(input.value).toBe("13");
|
|
161
|
-
expect(getByRole("slider").hasAttribute("disabled")).toBeTruthy();
|
|
162
|
-
});
|
|
163
|
-
test("Calls correct function onDragEnd when it is uncontrolled", function () {
|
|
164
|
-
var onDragEnd = jest.fn();
|
|
165
|
-
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
166
|
-
minValue: 0,
|
|
167
|
-
maxValue: 150,
|
|
168
|
-
onDragEnd: onDragEnd,
|
|
169
|
-
showInput: true
|
|
170
|
-
})),
|
|
171
|
-
getByRole = _render7.getByRole;
|
|
172
|
-
var slider = getByRole("slider");
|
|
173
|
-
(0, _react2.act)(function () {
|
|
174
|
-
_react2.fireEvent.mouseDown(slider);
|
|
175
|
-
});
|
|
176
|
-
(0, _react2.act)(function () {
|
|
177
|
-
_react2.fireEvent.mouseUp(slider, {
|
|
178
|
-
target: {
|
|
179
|
-
value: 120
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
expect(onDragEnd).toHaveBeenCalledWith("120");
|
|
184
|
-
});
|
|
185
|
-
test("Calls correct function onDragEnd when it is controlled", function () {
|
|
186
|
-
var onDragEnd = jest.fn();
|
|
187
|
-
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
188
|
-
minValue: 0,
|
|
189
|
-
maxValue: 150,
|
|
190
|
-
value: 50,
|
|
191
|
-
onDragEnd: onDragEnd,
|
|
192
|
-
showInput: true
|
|
193
|
-
})),
|
|
194
|
-
getByRole = _render8.getByRole;
|
|
195
|
-
var slider = getByRole("slider");
|
|
196
|
-
(0, _react2.act)(function () {
|
|
197
|
-
_react2.fireEvent.mouseDown(slider);
|
|
198
|
-
});
|
|
199
|
-
(0, _react2.act)(function () {
|
|
200
|
-
_react2.fireEvent.mouseUp(slider, {
|
|
201
|
-
target: {
|
|
202
|
-
value: 120
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
expect(onDragEnd).toHaveBeenCalledWith("120");
|
|
207
|
-
expect(slider.getAttribute("aria-valuenow")).toBe("50");
|
|
208
|
-
});
|
|
209
|
-
test("Calls correct function labelFormatCallback", function () {
|
|
210
|
-
var labelFormatCallback = jest.fn(function (x) {
|
|
211
|
-
return "".concat(x, "$");
|
|
212
|
-
});
|
|
213
|
-
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
214
|
-
minValue: 0,
|
|
215
|
-
maxValue: 100,
|
|
216
|
-
showLimitsValues: true,
|
|
217
|
-
showInput: true,
|
|
218
|
-
value: 25,
|
|
219
|
-
labelFormatCallback: labelFormatCallback
|
|
220
|
-
})),
|
|
221
|
-
getByText = _render9.getByText;
|
|
222
|
-
expect(getByText("0$")).toBeTruthy();
|
|
223
|
-
expect(getByText("100$")).toBeTruthy();
|
|
224
|
-
expect(labelFormatCallback).toHaveBeenCalledTimes(2);
|
|
225
|
-
});
|
|
226
|
-
test("Change value correctly to 0 from external function", function () {
|
|
227
|
-
var onChange = jest.fn();
|
|
228
|
-
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
229
|
-
minValue: 0,
|
|
230
|
-
maxValue: 100,
|
|
231
|
-
onChange: onChange,
|
|
232
|
-
showLimitsValues: true,
|
|
233
|
-
value: 13,
|
|
234
|
-
showInput: true
|
|
235
|
-
})),
|
|
236
|
-
rerender = _render10.rerender,
|
|
237
|
-
getByRole = _render10.getByRole;
|
|
238
|
-
var slider = getByRole("slider");
|
|
239
|
-
_userEvent["default"].tab();
|
|
240
|
-
_react2.fireEvent.keyDown(slider, {
|
|
241
|
-
key: "ArrowRight",
|
|
242
|
-
code: "ArrowRight",
|
|
243
|
-
keyCode: 39,
|
|
244
|
-
charCode: 39
|
|
245
|
-
});
|
|
246
|
-
rerender( /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
247
|
-
minValue: 0,
|
|
248
|
-
maxValue: 100,
|
|
249
|
-
onChange: onChange,
|
|
250
|
-
showLimitsValues: true,
|
|
251
|
-
value: 0,
|
|
252
|
-
showInput: true
|
|
253
|
-
}));
|
|
254
|
-
expect(slider.getAttribute("aria-valuenow")).toBe("0");
|
|
255
|
-
});
|
|
256
|
-
});
|
package/slider/types.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
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 above the slider.
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Name attribute of the input element.
|
|
15
|
-
*/
|
|
16
|
-
name?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Initial value of the slider, only when it is uncontrolled.
|
|
19
|
-
*/
|
|
20
|
-
defaultValue?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The selected value. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
23
|
-
*/
|
|
24
|
-
value?: number;
|
|
25
|
-
/**
|
|
26
|
-
* Helper text to be placed above the slider.
|
|
27
|
-
*/
|
|
28
|
-
helperText?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The minimum value available for selection.
|
|
31
|
-
*/
|
|
32
|
-
minValue?: number;
|
|
33
|
-
/**
|
|
34
|
-
* The maximum value available for selection.
|
|
35
|
-
*/
|
|
36
|
-
maxValue?: number;
|
|
37
|
-
/**
|
|
38
|
-
* The step interval between values available for selection.
|
|
39
|
-
*/
|
|
40
|
-
step?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Whether the min/max value labels should be displayed next to the slider
|
|
43
|
-
*/
|
|
44
|
-
showLimitsValues?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Whether the input element for displaying/controlling the slider value should be displayed next to the slider.
|
|
47
|
-
*/
|
|
48
|
-
showInput?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* If true, the component will be disabled.
|
|
51
|
-
*/
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Whether the marks between each step should be shown or not.
|
|
55
|
-
*/
|
|
56
|
-
marks?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* This function will be called when the slider changes its value, as it's being dragged.
|
|
59
|
-
* The new value will be passed as a parameter when this function is executed.
|
|
60
|
-
*/
|
|
61
|
-
onChange?: (value: number) => void;
|
|
62
|
-
/**
|
|
63
|
-
* This function will be called when the slider changes its value, but only when the thumb is released.
|
|
64
|
-
* The new value will be passed as a parameter when this function is executed.
|
|
65
|
-
*/
|
|
66
|
-
onDragEnd?: (value: number) => void;
|
|
67
|
-
/**
|
|
68
|
-
* This function will be used to format the labels displayed next to the slider.
|
|
69
|
-
* The value will be passed as parameter and the function must return the formatted value.
|
|
70
|
-
*/
|
|
71
|
-
labelFormatCallback?: (value: number) => string;
|
|
72
|
-
/**
|
|
73
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
74
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
75
|
-
*/
|
|
76
|
-
margin?: Space | Margin;
|
|
77
|
-
/**
|
|
78
|
-
* Size of the component.
|
|
79
|
-
*/
|
|
80
|
-
size?: "medium" | "large" | "fillParent";
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Reference to the component.
|
|
84
|
-
*/
|
|
85
|
-
export type RefType = HTMLDivElement;
|
|
86
|
-
export default Props;
|
package/slider/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
-
var _react = _interopRequireDefault(require("react"));
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
var _axeHelper = require("../../test/accessibility/axe-helper.js");
|
|
9
|
-
var _Spinner = _interopRequireDefault(require("./Spinner"));
|
|
10
|
-
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
11
|
-
describe("Spinner component accessibility tests", function () {
|
|
12
|
-
it("Should not have basic accessibility issues for overlay mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
13
|
-
var _render, container, results;
|
|
14
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
15
|
-
while (1) switch (_context.prev = _context.next) {
|
|
16
|
-
case 0:
|
|
17
|
-
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
18
|
-
label: "test-loading",
|
|
19
|
-
margin: "medium",
|
|
20
|
-
mode: "overlay",
|
|
21
|
-
value: 50,
|
|
22
|
-
showValue: true
|
|
23
|
-
}), /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
24
|
-
label: "test-loading",
|
|
25
|
-
margin: "medium",
|
|
26
|
-
mode: "overlay",
|
|
27
|
-
value: 50
|
|
28
|
-
}))), container = _render.container;
|
|
29
|
-
_context.next = 3;
|
|
30
|
-
return (0, _axeHelper.axe)(container);
|
|
31
|
-
case 3:
|
|
32
|
-
results = _context.sent;
|
|
33
|
-
expect(results).toHaveNoViolations();
|
|
34
|
-
case 5:
|
|
35
|
-
case "end":
|
|
36
|
-
return _context.stop();
|
|
37
|
-
}
|
|
38
|
-
}, _callee);
|
|
39
|
-
})));
|
|
40
|
-
it("Should not have basic accessibility issues for large mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
41
|
-
var _render2, container, results;
|
|
42
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
43
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
44
|
-
case 0:
|
|
45
|
-
_render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
46
|
-
label: "test-loading",
|
|
47
|
-
margin: "medium",
|
|
48
|
-
mode: "large",
|
|
49
|
-
value: 50,
|
|
50
|
-
showValue: true
|
|
51
|
-
}), /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
52
|
-
label: "test-loading",
|
|
53
|
-
margin: "medium",
|
|
54
|
-
mode: "large",
|
|
55
|
-
value: 50
|
|
56
|
-
}))), container = _render2.container;
|
|
57
|
-
_context2.next = 3;
|
|
58
|
-
return (0, _axeHelper.axe)(container);
|
|
59
|
-
case 3:
|
|
60
|
-
results = _context2.sent;
|
|
61
|
-
expect(results).toHaveNoViolations();
|
|
62
|
-
case 5:
|
|
63
|
-
case "end":
|
|
64
|
-
return _context2.stop();
|
|
65
|
-
}
|
|
66
|
-
}, _callee2);
|
|
67
|
-
})));
|
|
68
|
-
it("Should not have basic accessibility issues for small mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
69
|
-
var _render3, container, results;
|
|
70
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
71
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
72
|
-
case 0:
|
|
73
|
-
_render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
74
|
-
label: "test-loading",
|
|
75
|
-
margin: "medium",
|
|
76
|
-
mode: "small",
|
|
77
|
-
value: 50,
|
|
78
|
-
showValue: true
|
|
79
|
-
}), /*#__PURE__*/_react["default"].createElement(_Spinner["default"], {
|
|
80
|
-
label: "test-loading",
|
|
81
|
-
margin: "medium",
|
|
82
|
-
mode: "small",
|
|
83
|
-
value: 50
|
|
84
|
-
}))), container = _render3.container;
|
|
85
|
-
_context3.next = 3;
|
|
86
|
-
return (0, _axeHelper.axe)(container);
|
|
87
|
-
case 3:
|
|
88
|
-
results = _context3.sent;
|
|
89
|
-
expect(results).toHaveNoViolations();
|
|
90
|
-
case 5:
|
|
91
|
-
case "end":
|
|
92
|
-
return _context3.stop();
|
|
93
|
-
}
|
|
94
|
-
}, _callee3);
|
|
95
|
-
})));
|
|
96
|
-
});
|
package/spinner/Spinner.d.ts
DELETED
package/spinner/Spinner.js
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
var _variables = require("../common/variables");
|
|
14
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
15
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
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; }
|
|
18
|
-
var DxcSpinner = function DxcSpinner(_ref) {
|
|
19
|
-
var _ref$label = _ref.label,
|
|
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;
|
|
27
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
28
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
29
|
-
theme: colorsTheme.spinner
|
|
30
|
-
}, /*#__PURE__*/_react["default"].createElement(DXCSpinner, {
|
|
31
|
-
margin: margin,
|
|
32
|
-
mode: mode
|
|
33
|
-
}, /*#__PURE__*/_react["default"].createElement(SpinnerContainer, {
|
|
34
|
-
mode: mode
|
|
35
|
-
}, mode === "overlay" && /*#__PURE__*/_react["default"].createElement(BackOverlay, null), /*#__PURE__*/_react["default"].createElement(BackgroundSpinner, null, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGBackground, {
|
|
36
|
-
viewBox: "0 0 140 140"
|
|
37
|
-
}, /*#__PURE__*/_react["default"].createElement(CircleBackground, {
|
|
38
|
-
cx: "70",
|
|
39
|
-
cy: "70",
|
|
40
|
-
r: "65",
|
|
41
|
-
mode: mode
|
|
42
|
-
})), mode === "small" && /*#__PURE__*/_react["default"].createElement(SVGBackground, {
|
|
43
|
-
viewBox: "0 0 16 16"
|
|
44
|
-
}, /*#__PURE__*/_react["default"].createElement(CircleBackground, {
|
|
45
|
-
cx: "8",
|
|
46
|
-
cy: "8",
|
|
47
|
-
r: "6",
|
|
48
|
-
mode: mode
|
|
49
|
-
}))), value >= 0 && value <= 100 ? /*#__PURE__*/_react["default"].createElement(Spinner, {
|
|
50
|
-
role: "progressbar",
|
|
51
|
-
"aria-valuenow": showValue ? value : undefined,
|
|
52
|
-
"aria-valuemin": 0,
|
|
53
|
-
"aria-valuemax": 100,
|
|
54
|
-
"aria-label": label || "Spinner"
|
|
55
|
-
}, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
56
|
-
viewBox: "0 0 140 140",
|
|
57
|
-
isDeterminated: true
|
|
58
|
-
}, /*#__PURE__*/_react["default"].createElement(CircleSpinner, {
|
|
59
|
-
cx: "70",
|
|
60
|
-
cy: "70",
|
|
61
|
-
r: "65",
|
|
62
|
-
mode: mode,
|
|
63
|
-
isDeterminated: true,
|
|
64
|
-
value: value
|
|
65
|
-
})), mode === "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
66
|
-
viewBox: "0 0 16 16",
|
|
67
|
-
isDeterminated: true
|
|
68
|
-
}, /*#__PURE__*/_react["default"].createElement(CircleSpinner, {
|
|
69
|
-
cx: "8",
|
|
70
|
-
cy: "8",
|
|
71
|
-
r: "6",
|
|
72
|
-
mode: mode,
|
|
73
|
-
isDeterminated: true,
|
|
74
|
-
value: value
|
|
75
|
-
}))) : /*#__PURE__*/_react["default"].createElement(Spinner, {
|
|
76
|
-
role: "progressbar"
|
|
77
|
-
}, mode !== "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
78
|
-
viewBox: "0 0 140 140",
|
|
79
|
-
isDeterminated: false
|
|
80
|
-
}, /*#__PURE__*/_react["default"].createElement(CircleSpinner, {
|
|
81
|
-
cx: "70",
|
|
82
|
-
cy: "70",
|
|
83
|
-
r: "65",
|
|
84
|
-
mode: mode,
|
|
85
|
-
isDeterminated: false,
|
|
86
|
-
value: value
|
|
87
|
-
})), mode === "small" && /*#__PURE__*/_react["default"].createElement(SVGSpinner, {
|
|
88
|
-
viewBox: "0 0 16 16",
|
|
89
|
-
isDeterminated: false
|
|
90
|
-
}, /*#__PURE__*/_react["default"].createElement(CircleSpinner, {
|
|
91
|
-
cx: "8",
|
|
92
|
-
cy: "8",
|
|
93
|
-
r: "6",
|
|
94
|
-
mode: mode,
|
|
95
|
-
isDeterminated: false,
|
|
96
|
-
value: value
|
|
97
|
-
}))), mode !== "small" && /*#__PURE__*/_react["default"].createElement(LabelsContainer, null, /*#__PURE__*/_react["default"].createElement(SpinnerLabel, {
|
|
98
|
-
mode: mode
|
|
99
|
-
}, label), (value || value === 0) && showValue && /*#__PURE__*/_react["default"].createElement(SpinnerProgress, {
|
|
100
|
-
value: value,
|
|
101
|
-
mode: mode,
|
|
102
|
-
showValue: showValue
|
|
103
|
-
}, value, "%")))));
|
|
104
|
-
};
|
|
105
|
-
var determinateValue = function determinateValue(value, strokeDashArray) {
|
|
106
|
-
var val = 0;
|
|
107
|
-
if (value >= 0 && value <= 100) {
|
|
108
|
-
val = strokeDashArray * (1 - value / 100);
|
|
109
|
-
}
|
|
110
|
-
return val;
|
|
111
|
-
};
|
|
112
|
-
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) {
|
|
113
|
-
return props.mode === "overlay" ? "100vh" : "";
|
|
114
|
-
}, function (props) {
|
|
115
|
-
return props.mode === "overlay" ? "100vw" : "";
|
|
116
|
-
}, function (props) {
|
|
117
|
-
return props.mode === "overlay" ? "flex" : "";
|
|
118
|
-
}, function (props) {
|
|
119
|
-
return props.mode === "overlay" ? "fixed" : "";
|
|
120
|
-
}, function (props) {
|
|
121
|
-
return props.mode === "overlay" ? 0 : "";
|
|
122
|
-
}, function (props) {
|
|
123
|
-
return props.mode === "overlay" ? 0 : "";
|
|
124
|
-
}, function (props) {
|
|
125
|
-
return props.mode === "overlay" ? "center" : "";
|
|
126
|
-
}, function (props) {
|
|
127
|
-
return props.mode === "overlay" ? "center" : "";
|
|
128
|
-
}, function (props) {
|
|
129
|
-
return props.mode === "overlay" ? 1300 : "";
|
|
130
|
-
}, function (props) {
|
|
131
|
-
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px" : "";
|
|
132
|
-
}, function (props) {
|
|
133
|
-
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "" : "";
|
|
134
|
-
}, function (props) {
|
|
135
|
-
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "" : "";
|
|
136
|
-
}, function (props) {
|
|
137
|
-
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "" : "";
|
|
138
|
-
}, function (props) {
|
|
139
|
-
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "" : "";
|
|
140
|
-
});
|
|
141
|
-
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) {
|
|
142
|
-
return props.mode === "small" ? "16px" : "140px";
|
|
143
|
-
}, function (props) {
|
|
144
|
-
return props.mode === "small" ? "16px" : "140px";
|
|
145
|
-
});
|
|
146
|
-
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) {
|
|
147
|
-
return "".concat(props.theme.overlayBackgroundColor);
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return "".concat(props.theme.overlayOpacity);
|
|
150
|
-
});
|
|
151
|
-
var BackgroundSpinner = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: absolute;\n"])));
|
|
152
|
-
var SVGBackground = _styledComponents["default"].svg(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n"])));
|
|
153
|
-
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) {
|
|
154
|
-
return "".concat(props.theme.totalCircleColor);
|
|
155
|
-
}, function (props) {
|
|
156
|
-
return props.mode !== "small" ? "409" : "38";
|
|
157
|
-
}, function (props) {
|
|
158
|
-
return props.mode !== "small" ? "8.5px" : "2px";
|
|
159
|
-
});
|
|
160
|
-
var Spinner = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: inherit;\n width: inherit;\n position: relative;\n"])));
|
|
161
|
-
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) {
|
|
162
|
-
return !props.isDeterminated ? "1.4s linear infinite both spinner-svg" : "";
|
|
163
|
-
});
|
|
164
|
-
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) {
|
|
165
|
-
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";
|
|
166
|
-
}, function (props) {
|
|
167
|
-
return props.mode === "overlay" ? props.theme.trackCircleColorOverlay : props.theme.trackCircleColor;
|
|
168
|
-
}, function (props) {
|
|
169
|
-
return !props.isDeterminated ? "50% 50%" : "";
|
|
170
|
-
}, function (props) {
|
|
171
|
-
return props.mode !== "small" ? "409" : "38";
|
|
172
|
-
}, function (props) {
|
|
173
|
-
return props.mode !== "small" ? "8.5px" : "2px";
|
|
174
|
-
}, function (props) {
|
|
175
|
-
return props.isDeterminated ? props.mode !== "small" ? determinateValue(props.value, 409) : determinateValue(props.value, 38) : "";
|
|
176
|
-
});
|
|
177
|
-
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"])));
|
|
178
|
-
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) {
|
|
179
|
-
return props.mode === "overlay" ? props.theme.overlayLabelFontFamily : props.theme.labelFontFamily;
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return props.mode === "overlay" ? props.theme.overlayLabelFontWeight : props.theme.labelFontWeight;
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.mode === "overlay" ? props.theme.overlayLabelFontSize : props.theme.labelFontSize;
|
|
184
|
-
}, function (props) {
|
|
185
|
-
return props.mode === "overlay" ? props.theme.overlayLabelFontStyle : props.theme.labelFontStyle;
|
|
186
|
-
}, function (props) {
|
|
187
|
-
return props.mode === "overlay" ? props.theme.overlayLabelFontColor : props.theme.labelFontColor;
|
|
188
|
-
}, function (props) {
|
|
189
|
-
return props.mode === "overlay" ? props.theme.overlayLabelTextAlign : props.theme.labelTextAlign;
|
|
190
|
-
}, function (props) {
|
|
191
|
-
return props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing;
|
|
192
|
-
});
|
|
193
|
-
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) {
|
|
194
|
-
return props.value && props.showValue === true && "block" || "none";
|
|
195
|
-
}, function (props) {
|
|
196
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily;
|
|
197
|
-
}, function (props) {
|
|
198
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueFontWeight : props.theme.progressValueFontWeight;
|
|
199
|
-
}, function (props) {
|
|
200
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueFontSize : props.theme.progressValueFontSize;
|
|
201
|
-
}, function (props) {
|
|
202
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueFontStyle : props.theme.progressValueFontStyle;
|
|
203
|
-
}, function (props) {
|
|
204
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueFontColor : props.theme.progressValueFontColor;
|
|
205
|
-
}, function (props) {
|
|
206
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueTextAlign : props.theme.progressValueTextAlign;
|
|
207
|
-
}, function (props) {
|
|
208
|
-
return props.mode === "overlay" ? props.theme.overlayProgressValueLetterSpacing : props.theme.progressValueLetterSpacing;
|
|
209
|
-
});
|
|
210
|
-
var _default = exports["default"] = DxcSpinner;
|