@dxc-technology/halstack-react 0.0.0-ff6c8bf → 0.0.0-ff78514
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 -2
- package/dist/index.d.mts +6589 -0
- package/dist/index.d.ts +6589 -0
- package/dist/index.js +13660 -0
- package/dist/index.mjs +13602 -0
- package/package.json +64 -66
- package/BackgroundColorContext.d.ts +0 -1
- package/BackgroundColorContext.js +0 -30
- package/HalstackContext.d.ts +0 -1246
- package/HalstackContext.js +0 -310
- package/accordion/Accordion.accessibility.test.js +0 -71
- package/accordion/Accordion.d.ts +0 -4
- package/accordion/Accordion.js +0 -171
- package/accordion/Accordion.stories.tsx +0 -241
- 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.js +0 -88
- 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.js +0 -98
- 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.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.js +0 -64
- package/action-icon/types.d.ts +0 -26
- package/action-icon/types.js +0 -5
- 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.js +0 -75
- package/alert/types.d.ts +0 -49
- package/alert/types.js +0 -5
- 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.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.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.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 -169
- 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 -16
- package/breadcrumbs/types.js +0 -5
- 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.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.js +0 -38
- package/button/types.d.ts +0 -57
- package/button/types.js +0 -5
- 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.js +0 -39
- package/card/types.d.ts +0 -62
- package/card/types.js +0 -5
- package/checkbox/Checkbox.accessibility.test.js +0 -87
- package/checkbox/Checkbox.d.ts +0 -4
- package/checkbox/Checkbox.js +0 -215
- package/checkbox/Checkbox.stories.tsx +0 -222
- 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.js +0 -67
- package/chip/Chip.d.ts +0 -4
- package/chip/Chip.js +0 -126
- package/chip/Chip.stories.tsx +0 -199
- 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 -237
- package/common/coreTokens.js +0 -184
- package/common/utils.d.ts +0 -1
- package/common/utils.js +0 -16
- package/common/variables.d.ts +0 -1392
- package/common/variables.js +0 -1264
- 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 -74
- package/container/types.js +0 -5
- package/contextual-menu/ContextualMenu.accessibility.test.js +0 -97
- package/contextual-menu/ContextualMenu.d.ts +0 -5
- package/contextual-menu/ContextualMenu.js +0 -88
- package/contextual-menu/ContextualMenu.stories.tsx +0 -232
- package/contextual-menu/ContextualMenu.test.js +0 -205
- 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 -51
- 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 -58
- package/contextual-menu/types.js +0 -5
- package/date-input/Calendar.d.ts +0 -4
- package/date-input/Calendar.js +0 -214
- package/date-input/DateInput.accessibility.test.js +0 -228
- package/date-input/DateInput.d.ts +0 -4
- package/date-input/DateInput.js +0 -222
- package/date-input/DateInput.stories.tsx +0 -292
- 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 -100
- package/date-input/types.d.ts +0 -164
- package/date-input/types.js +0 -5
- 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 -371
- package/dialog/Dialog.test.js +0 -307
- package/dialog/types.d.ts +0 -36
- package/dialog/types.js +0 -5
- 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 -223
- 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.js +0 -180
- package/dropdown/Dropdown.d.ts +0 -4
- package/dropdown/Dropdown.js +0 -321
- package/dropdown/Dropdown.stories.tsx +0 -427
- package/dropdown/Dropdown.test.js +0 -599
- 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.js +0 -160
- package/file-input/FileInput.d.ts +0 -4
- package/file-input/FileInput.js +0 -443
- package/file-input/FileInput.stories.tsx +0 -618
- package/file-input/FileInput.test.js +0 -396
- package/file-input/FileItem.d.ts +0 -4
- package/file-input/FileItem.js +0 -125
- package/file-input/types.d.ts +0 -129
- package/file-input/types.js +0 -5
- package/flex/Flex.d.ts +0 -4
- package/flex/Flex.js +0 -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.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.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 -219
- package/grid/types.d.ts +0 -115
- package/grid/types.js +0 -5
- package/header/Header.accessibility.test.js +0 -93
- package/header/Header.d.ts +0 -8
- package/header/Header.js +0 -210
- package/header/Header.stories.tsx +0 -267
- 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.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.js +0 -169
- package/heading/types.d.ts +0 -33
- package/heading/types.js +0 -5
- 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.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.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.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.js +0 -44
- package/nav-tabs/NavTabs.d.ts +0 -7
- package/nav-tabs/NavTabs.js +0 -93
- package/nav-tabs/NavTabs.stories.tsx +0 -279
- 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.js +0 -228
- package/number-input/NumberInput.d.ts +0 -4
- package/number-input/NumberInput.js +0 -86
- package/number-input/NumberInput.stories.tsx +0 -131
- package/number-input/NumberInput.test.js +0 -989
- 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.js +0 -79
- package/paginator/Paginator.d.ts +0 -4
- package/paginator/Paginator.js +0 -138
- package/paginator/Paginator.stories.tsx +0 -87
- package/paginator/Paginator.test.js +0 -335
- package/paginator/types.d.ts +0 -38
- package/paginator/types.js +0 -5
- 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.js +0 -153
- package/password-input/PasswordInput.d.ts +0 -4
- package/password-input/PasswordInput.js +0 -97
- package/password-input/PasswordInput.stories.tsx +0 -99
- package/password-input/PasswordInput.test.js +0 -198
- package/password-input/types.d.ts +0 -111
- package/password-input/types.js +0 -5
- 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.js +0 -93
- package/progress-bar/types.d.ts +0 -37
- package/progress-bar/types.js +0 -5
- 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 -124
- package/radio-group/RadioGroup.accessibility.test.js +0 -97
- package/radio-group/RadioGroup.d.ts +0 -4
- package/radio-group/RadioGroup.js +0 -236
- package/radio-group/RadioGroup.stories.tsx +0 -214
- package/radio-group/RadioGroup.test.js +0 -756
- 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.js +0 -285
- package/resultset-table/ResultsetTable.d.ts +0 -7
- package/resultset-table/ResultsetTable.js +0 -171
- package/resultset-table/ResultsetTable.stories.tsx +0 -413
- package/resultset-table/ResultsetTable.test.js +0 -381
- package/resultset-table/types.d.ts +0 -100
- package/resultset-table/types.js +0 -5
- package/select/Listbox.d.ts +0 -4
- package/select/Listbox.js +0 -155
- package/select/Option.d.ts +0 -4
- package/select/Option.js +0 -89
- package/select/Select.accessibility.test.js +0 -228
- package/select/Select.d.ts +0 -4
- package/select/Select.js +0 -602
- package/select/Select.stories.tsx +0 -919
- package/select/Select.test.js +0 -2265
- package/select/types.d.ts +0 -209
- package/select/types.js +0 -5
- 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.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.js +0 -104
- package/slider/Slider.d.ts +0 -4
- package/slider/Slider.js +0 -286
- package/slider/Slider.stories.tsx +0 -180
- package/slider/Slider.test.js +0 -254
- package/slider/types.d.ts +0 -86
- package/slider/types.js +0 -5
- 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.js +0 -55
- package/spinner/types.d.ts +0 -32
- package/spinner/types.js +0 -5
- 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.js +0 -25
- package/status-light/types.d.ts +0 -17
- package/status-light/types.js +0 -5
- package/switch/Switch.accessibility.test.js +0 -98
- package/switch/Switch.d.ts +0 -4
- package/switch/Switch.js +0 -214
- package/switch/Switch.stories.tsx +0 -149
- 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.js +0 -93
- package/table/Table.d.ts +0 -8
- package/table/Table.js +0 -161
- package/table/Table.stories.tsx +0 -663
- package/table/Table.test.js +0 -113
- 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.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.js +0 -276
- package/tabs/types.d.ts +0 -92
- package/tabs/types.js +0 -5
- 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.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.js +0 -321
- package/text-input/TextInput.d.ts +0 -4
- package/text-input/TextInput.js +0 -571
- package/text-input/TextInput.stories.tsx +0 -474
- package/text-input/TextInput.test.js +0 -1756
- package/text-input/types.d.ts +0 -205
- package/text-input/types.js +0 -5
- 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.js +0 -406
- package/textarea/types.d.ts +0 -141
- package/textarea/types.js +0 -5
- package/toggle-group/ToggleGroup.accessibility.test.js +0 -107
- package/toggle-group/ToggleGroup.d.ts +0 -4
- package/toggle-group/ToggleGroup.js +0 -202
- package/toggle-group/ToggleGroup.stories.tsx +0 -218
- package/toggle-group/ToggleGroup.test.js +0 -137
- package/toggle-group/types.d.ts +0 -114
- package/toggle-group/types.js +0 -5
- 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 -198
- package/typography/types.d.ts +0 -18
- package/typography/types.js +0 -5
- package/useTheme.d.ts +0 -1145
- 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 -94
- package/utils/FocusLock.d.ts +0 -13
- package/utils/FocusLock.js +0 -124
- 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.js +0 -114
- package/wizard/types.d.ts +0 -64
- package/wizard/types.js +0 -5
|
@@ -1,146 +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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
14
|
-
var _variables = require("../common/variables");
|
|
15
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
16
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
19
|
-
var DxcProgressBar = function DxcProgressBar(_ref) {
|
|
20
|
-
var _ref$label = _ref.label,
|
|
21
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
22
|
-
_ref$helperText = _ref.helperText,
|
|
23
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
24
|
-
_ref$overlay = _ref.overlay,
|
|
25
|
-
overlay = _ref$overlay === void 0 ? false : _ref$overlay,
|
|
26
|
-
value = _ref.value,
|
|
27
|
-
_ref$showValue = _ref.showValue,
|
|
28
|
-
showValue = _ref$showValue === void 0 ? false : _ref$showValue,
|
|
29
|
-
margin = _ref.margin;
|
|
30
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
31
|
-
var _useState = (0, _react.useState)(0),
|
|
32
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
33
|
-
valueProgressBar = _useState2[0],
|
|
34
|
-
setValueProgressBar = _useState2[1];
|
|
35
|
-
(0, _react.useEffect)(function () {
|
|
36
|
-
setValueProgressBar(value === null || value === undefined || value < 0 ? 0 : value >= 0 && value <= 100 ? value : 100);
|
|
37
|
-
}, [value]);
|
|
38
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
39
|
-
theme: colorsTheme.progressBar
|
|
40
|
-
}, /*#__PURE__*/_react["default"].createElement(BackgroundProgressBar, {
|
|
41
|
-
overlay: overlay
|
|
42
|
-
}, /*#__PURE__*/_react["default"].createElement(ProgressBarContainer, {
|
|
43
|
-
overlay: overlay,
|
|
44
|
-
margin: margin
|
|
45
|
-
}, /*#__PURE__*/_react["default"].createElement(InfoProgressBar, null, /*#__PURE__*/_react["default"].createElement(ProgressBarLabel, {
|
|
46
|
-
overlay: overlay
|
|
47
|
-
}, label), /*#__PURE__*/_react["default"].createElement(ProgressBarProgress, {
|
|
48
|
-
overlay: overlay,
|
|
49
|
-
showValue: showValue,
|
|
50
|
-
value: valueProgressBar
|
|
51
|
-
}, valueProgressBar, " %")), /*#__PURE__*/_react["default"].createElement(LinearProgress, {
|
|
52
|
-
role: "progressbar",
|
|
53
|
-
helperText: helperText,
|
|
54
|
-
"aria-valuenow": showValue ? valueProgressBar : undefined,
|
|
55
|
-
"aria-valuemin": 0,
|
|
56
|
-
"aria-valuemax": 100,
|
|
57
|
-
"aria-label": label || "Progress Bar"
|
|
58
|
-
}, /*#__PURE__*/_react["default"].createElement(LinearProgressBar, {
|
|
59
|
-
variant: value === null || value === undefined ? "indeterminate" : "determinate",
|
|
60
|
-
container: "first",
|
|
61
|
-
value: valueProgressBar
|
|
62
|
-
})), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
63
|
-
overlay: overlay
|
|
64
|
-
}, helperText))));
|
|
65
|
-
};
|
|
66
|
-
var BackgroundProgressBar = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n display: flex;\n flex-wrap: wrap;\n min-width: 100px;\n width: 100%;\n"])), function (_ref2) {
|
|
67
|
-
var overlay = _ref2.overlay,
|
|
68
|
-
theme = _ref2.theme;
|
|
69
|
-
return overlay ? "background-color: ".concat(theme.overlayColor, ";\n width: 100%;\n justify-content: center;\n height: 100vh;\n align-items: center;\n max-width: 100%;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1300;") : "background-color: \"transparent\";";
|
|
70
|
-
});
|
|
71
|
-
var ProgressBarContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n z-index: ", ";\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
72
|
-
return props.overlay === true && "100" || "0";
|
|
73
|
-
}, function (props) {
|
|
74
|
-
return props.overlay === true ? "80%" : "100%";
|
|
75
|
-
}, function (props) {
|
|
76
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
77
|
-
}, function (props) {
|
|
78
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
79
|
-
}, function (props) {
|
|
80
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
81
|
-
}, function (props) {
|
|
82
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
83
|
-
}, function (props) {
|
|
84
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
85
|
-
});
|
|
86
|
-
var InfoProgressBar = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n width: 685px;\n flex-wrap: wrap;\n width: 100%;\n margin-bottom: 8px;\n align-items: baseline;\n justify-content: space-between;\n"])));
|
|
87
|
-
var ProgressBarLabel = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-overflow: ellipsis;\n"])), function (props) {
|
|
88
|
-
return props.theme.labelFontFamily;
|
|
89
|
-
}, function (props) {
|
|
90
|
-
return props.theme.labelFontStyle;
|
|
91
|
-
}, function (props) {
|
|
92
|
-
return props.theme.labelFontSize;
|
|
93
|
-
}, function (props) {
|
|
94
|
-
return props.theme.labelFontWeight;
|
|
95
|
-
}, function (props) {
|
|
96
|
-
return props.theme.labelFontTextTransform;
|
|
97
|
-
}, function (props) {
|
|
98
|
-
return props.overlay === true ? props.theme.overlayFontColor : props.theme.labelFontColor;
|
|
99
|
-
});
|
|
100
|
-
var ProgressBarProgress = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n display: ", ";\n flex-shrink: 0;\n"])), function (props) {
|
|
101
|
-
return props.theme.valueFontFamily;
|
|
102
|
-
}, function (props) {
|
|
103
|
-
return props.theme.valueFontStyle;
|
|
104
|
-
}, function (props) {
|
|
105
|
-
return props.theme.valueFontSize;
|
|
106
|
-
}, function (props) {
|
|
107
|
-
return props.theme.valueFontWeight;
|
|
108
|
-
}, function (props) {
|
|
109
|
-
return props.theme.valueFontTextTransform;
|
|
110
|
-
}, function (props) {
|
|
111
|
-
return props.overlay === true ? props.theme.overlayFontColor : props.theme.valueFontColor;
|
|
112
|
-
}, function (props) {
|
|
113
|
-
return props.value !== undefined && props.value !== null && props.showValue === true && "block" || "none";
|
|
114
|
-
});
|
|
115
|
-
var HelperText = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"])), function (props) {
|
|
116
|
-
return props.overlay === true ? props.theme.overlayFontColor : props.theme.helperTextFontColor;
|
|
117
|
-
}, function (props) {
|
|
118
|
-
return props.theme.helperTextFontFamily;
|
|
119
|
-
}, function (props) {
|
|
120
|
-
return props.theme.helperTextFontSize;
|
|
121
|
-
}, function (props) {
|
|
122
|
-
return props.theme.helperTextFontStyle;
|
|
123
|
-
}, function (props) {
|
|
124
|
-
return props.theme.helperTextFontWeight;
|
|
125
|
-
});
|
|
126
|
-
var LinearProgress = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n background-color: ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n position: relative;\n"])), function (props) {
|
|
127
|
-
return props.theme.thickness;
|
|
128
|
-
}, function (props) {
|
|
129
|
-
return props.theme.totalLineColor;
|
|
130
|
-
}, function (props) {
|
|
131
|
-
return props.theme.borderRadius;
|
|
132
|
-
}, function (props) {
|
|
133
|
-
return props.helperText !== "" && "8px";
|
|
134
|
-
});
|
|
135
|
-
var LinearProgressBar = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n transform: ", ";\n top: 0;\n left: 0;\n width: 100%;\n bottom: 0;\n position: absolute;\n transition: ", ";\n transform-origin: left;\n ", ";\n ", ";\n\n @keyframes keyframes-indeterminate-first {\n 0% {\n left: -35%;\n right: 100%;\n }\n 60% {\n left: 100%;\n right: -90%;\n }\n 100% {\n left: 100%;\n right: -90%;\n }\n }\n\n @keyframes keyframes-indeterminate-second {\n 0% {\n left: -200%;\n right: 100%;\n }\n 60% {\n left: 107%;\n right: -8%;\n }\n 100% {\n left: 107%;\n right: -8%;\n }\n }\n"])), function (props) {
|
|
136
|
-
return props.theme.trackLineColor;
|
|
137
|
-
}, function (props) {
|
|
138
|
-
return "translateX(-".concat(props.variant === "determinate" ? 100 - props.value : 0, "%)");
|
|
139
|
-
}, function (props) {
|
|
140
|
-
return props.variant === "determinate" ? "transform .4s linear" : "transform 0.2s linear";
|
|
141
|
-
}, function (props) {
|
|
142
|
-
return props.variant === "indeterminate" && "width: auto;";
|
|
143
|
-
}, function (props) {
|
|
144
|
-
return props.variant === "indeterminate" ? props.container === "first" ? "animation: keyframes-indeterminate-first 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;" : "animation: keyframes-indeterminate-second 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;" : "";
|
|
145
|
-
});
|
|
146
|
-
var _default = exports["default"] = DxcProgressBar;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import DxcProgressBar from "./ProgressBar";
|
|
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: "Progress Bar",
|
|
9
|
-
component: DxcProgressBar,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const opinionatedTheme = {
|
|
13
|
-
progressBar: {
|
|
14
|
-
accentColor: "#5f249f",
|
|
15
|
-
baseColor: "#e6e6e6",
|
|
16
|
-
fontColor: "#000000",
|
|
17
|
-
overlayColor: "#000000b3",
|
|
18
|
-
overlayFontColor: "#ffffff",
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Chromatic = () => (
|
|
23
|
-
<>
|
|
24
|
-
<ExampleContainer>
|
|
25
|
-
<Title title="Without labels" theme="light" level={4} />
|
|
26
|
-
<DxcProgressBar value={50} showValue />
|
|
27
|
-
<Title title="With helperText" theme="light" level={4} />
|
|
28
|
-
<DxcProgressBar helperText="Helper text" value={24} showValue />
|
|
29
|
-
<Title title="Without default value" theme="light" level={4} />
|
|
30
|
-
<DxcProgressBar label="Loading..." showValue />
|
|
31
|
-
<Title title="With full value" theme="light" level={4} />
|
|
32
|
-
<DxcProgressBar label="Loading..." value={100} showValue />
|
|
33
|
-
</ExampleContainer>
|
|
34
|
-
<Title title="Margins" theme="light" level={2} />
|
|
35
|
-
<ExampleContainer>
|
|
36
|
-
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
37
|
-
<DxcProgressBar label="Margin xxsmall" margin="xxsmall" value={50} showValue />
|
|
38
|
-
</ExampleContainer>
|
|
39
|
-
<ExampleContainer>
|
|
40
|
-
<Title title="Xsmall margin" theme="light" level={4} />
|
|
41
|
-
<DxcProgressBar label="Margin xsmall" margin="xsmall" value={50} showValue />
|
|
42
|
-
</ExampleContainer>
|
|
43
|
-
<ExampleContainer>
|
|
44
|
-
<Title title="Small margin" theme="light" level={4} />
|
|
45
|
-
<DxcProgressBar label="Margin small" margin="small" value={50} showValue />
|
|
46
|
-
</ExampleContainer>
|
|
47
|
-
<ExampleContainer>
|
|
48
|
-
<Title title="Medium margin" theme="light" level={4} />
|
|
49
|
-
<DxcProgressBar label="Margin medium" margin="medium" value={50} showValue />
|
|
50
|
-
</ExampleContainer>
|
|
51
|
-
<ExampleContainer>
|
|
52
|
-
<Title title="Large margin" theme="light" level={4} />
|
|
53
|
-
<DxcProgressBar label="Margin large" margin="large" value={50} showValue />
|
|
54
|
-
</ExampleContainer>
|
|
55
|
-
<ExampleContainer>
|
|
56
|
-
<Title title="Xlarge margin" theme="light" level={4} />
|
|
57
|
-
<DxcProgressBar label="Margin xlarge" margin="xlarge" value={50} showValue />
|
|
58
|
-
</ExampleContainer>
|
|
59
|
-
<ExampleContainer>
|
|
60
|
-
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
61
|
-
<DxcProgressBar label="Margin xxlarge" margin="xxlarge" value={50} showValue />
|
|
62
|
-
</ExampleContainer>
|
|
63
|
-
<Title title="Opinionated theme" theme="light" level={2} />
|
|
64
|
-
<ExampleContainer>
|
|
65
|
-
<Title title="Label and helper text" theme="light" level={4} />
|
|
66
|
-
<HalstackProvider theme={opinionatedTheme}>
|
|
67
|
-
<DxcProgressBar label="Loading..." helperText="Helper text" value={24} showValue />
|
|
68
|
-
</HalstackProvider>
|
|
69
|
-
</ExampleContainer>
|
|
70
|
-
<ExampleContainer>
|
|
71
|
-
<Title title="Without default value" theme="light" level={4} />
|
|
72
|
-
<HalstackProvider theme={opinionatedTheme}>
|
|
73
|
-
<DxcProgressBar label="Loading..." helperText="Helper text" showValue />
|
|
74
|
-
</HalstackProvider>
|
|
75
|
-
</ExampleContainer>
|
|
76
|
-
</>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
export const ProgressBarOverlay = () => (
|
|
80
|
-
<ExampleContainer>
|
|
81
|
-
<Title title="Overlay" theme="dark" level={4} />
|
|
82
|
-
<DxcProgressBar label="Overlay" helperText="Helper text" overlay showValue value={50} />
|
|
83
|
-
</ExampleContainer>
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
export const ProgressBarOverlayOpinionated = () => (
|
|
87
|
-
<ExampleContainer>
|
|
88
|
-
<Title title="Overlay" theme="dark" level={4} />
|
|
89
|
-
<HalstackProvider theme={opinionatedTheme}>
|
|
90
|
-
<DxcProgressBar label="Overlay" helperText="Helper text" overlay showValue value={50} />
|
|
91
|
-
</HalstackProvider>
|
|
92
|
-
</ExampleContainer>
|
|
93
|
-
);
|
|
@@ -1,93 +0,0 @@
|
|
|
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 _ProgressBar = _interopRequireDefault(require("./ProgressBar.tsx"));
|
|
7
|
-
describe("ProgressBar component tests", function () {
|
|
8
|
-
test("ProgressBar renders with label and helperText", function () {
|
|
9
|
-
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
10
|
-
label: "test-label",
|
|
11
|
-
helperText: "helper-text"
|
|
12
|
-
})),
|
|
13
|
-
getByText = _render.getByText;
|
|
14
|
-
expect(getByText("test-label")).toBeTruthy();
|
|
15
|
-
expect(getByText("helper-text")).toBeTruthy();
|
|
16
|
-
});
|
|
17
|
-
test("ProgressBar renders with default value", function () {
|
|
18
|
-
var value = 0;
|
|
19
|
-
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
20
|
-
showValue: true
|
|
21
|
-
})),
|
|
22
|
-
getByText = _render2.getByText,
|
|
23
|
-
getByRole = _render2.getByRole;
|
|
24
|
-
var progressBar = getByRole("progressbar");
|
|
25
|
-
expect(getByText("0 %")).toBeTruthy();
|
|
26
|
-
expect(progressBar.getAttribute("aria-valuenow")).toEqual(value.toString());
|
|
27
|
-
});
|
|
28
|
-
test("ProgressBar renders with value", function () {
|
|
29
|
-
var value = 25;
|
|
30
|
-
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
31
|
-
showValue: true,
|
|
32
|
-
value: value
|
|
33
|
-
})),
|
|
34
|
-
getByText = _render3.getByText,
|
|
35
|
-
getByRole = _render3.getByRole;
|
|
36
|
-
var progressBar = getByRole("progressbar");
|
|
37
|
-
expect(getByText("25 %")).toBeTruthy();
|
|
38
|
-
expect(progressBar.getAttribute("aria-valuenow")).toEqual(value.toString());
|
|
39
|
-
});
|
|
40
|
-
test("ProgressBar renders with negative value", function () {
|
|
41
|
-
var value = 0;
|
|
42
|
-
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
43
|
-
showValue: true,
|
|
44
|
-
value: -20
|
|
45
|
-
})),
|
|
46
|
-
getByText = _render4.getByText,
|
|
47
|
-
getByRole = _render4.getByRole;
|
|
48
|
-
var progressBar = getByRole("progressbar");
|
|
49
|
-
expect(getByText("0 %")).toBeTruthy();
|
|
50
|
-
expect(progressBar.getAttribute("aria-valuenow")).toEqual(value.toString());
|
|
51
|
-
});
|
|
52
|
-
test("ProgressBar renders as indeterminate", function () {
|
|
53
|
-
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], null)),
|
|
54
|
-
getByRole = _render5.getByRole;
|
|
55
|
-
var progressBar = getByRole("progressbar");
|
|
56
|
-
expect(progressBar.getAttribute("aria-valuenow")).toBe(null);
|
|
57
|
-
});
|
|
58
|
-
test("Overlay progressBar renders with label and helperText", function () {
|
|
59
|
-
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
60
|
-
label: "test-label",
|
|
61
|
-
helperText: "helper-text",
|
|
62
|
-
overlay: true
|
|
63
|
-
})),
|
|
64
|
-
getByText = _render6.getByText;
|
|
65
|
-
expect(getByText("test-label")).toBeTruthy();
|
|
66
|
-
expect(getByText("helper-text")).toBeTruthy();
|
|
67
|
-
});
|
|
68
|
-
test("Overlay progressBar renders with default value", function () {
|
|
69
|
-
var value = 0;
|
|
70
|
-
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
71
|
-
showValue: true,
|
|
72
|
-
overlay: true
|
|
73
|
-
})),
|
|
74
|
-
getByText = _render7.getByText,
|
|
75
|
-
getByRole = _render7.getByRole;
|
|
76
|
-
var progressBar = getByRole("progressbar");
|
|
77
|
-
expect(getByText("0 %")).toBeTruthy();
|
|
78
|
-
expect(progressBar.getAttribute("aria-valuenow")).toEqual(value.toString());
|
|
79
|
-
});
|
|
80
|
-
test("Overlay progressBar renders with value", function () {
|
|
81
|
-
var value = 25;
|
|
82
|
-
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ProgressBar["default"], {
|
|
83
|
-
showValue: true,
|
|
84
|
-
value: value,
|
|
85
|
-
overlay: true
|
|
86
|
-
})),
|
|
87
|
-
getByText = _render8.getByText,
|
|
88
|
-
getByRole = _render8.getByRole;
|
|
89
|
-
var progressBar = getByRole("progressbar");
|
|
90
|
-
expect(getByText("25 %")).toBeTruthy();
|
|
91
|
-
expect(progressBar.getAttribute("aria-valuenow")).toEqual(value.toString());
|
|
92
|
-
});
|
|
93
|
-
});
|
package/progress-bar/types.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Size = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
type Props = {
|
|
9
|
-
/**
|
|
10
|
-
* Text to be placed above the progress bar.
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Helper text to be placed under the progress bar.
|
|
15
|
-
*/
|
|
16
|
-
helperText?: string;
|
|
17
|
-
/**
|
|
18
|
-
* If true, the progress bar will be displayed as a modal.
|
|
19
|
-
*/
|
|
20
|
-
overlay?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The value of the progress indicator. If it's received the component is
|
|
23
|
-
* determinate otherwise is indeterminate.
|
|
24
|
-
*/
|
|
25
|
-
value?: number;
|
|
26
|
-
/**
|
|
27
|
-
* If true, the value is displayed above the progress bar.
|
|
28
|
-
*/
|
|
29
|
-
showValue?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Size of the margin to be applied to the component. You can pass
|
|
32
|
-
* an object with 'top', 'bottom', 'left' and 'right' properties
|
|
33
|
-
* in order to specify different margin sizes.
|
|
34
|
-
*/
|
|
35
|
-
margin?: Space | Size;
|
|
36
|
-
};
|
|
37
|
-
export default Props;
|
package/progress-bar/types.js
DELETED
|
@@ -1,57 +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 _QuickNav = _interopRequireDefault(require("./QuickNav"));
|
|
10
|
-
var links = [{
|
|
11
|
-
label: "Overview",
|
|
12
|
-
links: [{
|
|
13
|
-
label: "Introduction"
|
|
14
|
-
}]
|
|
15
|
-
}, {
|
|
16
|
-
label: "Components",
|
|
17
|
-
links: [{
|
|
18
|
-
label: "Introduction"
|
|
19
|
-
}, {
|
|
20
|
-
label: "Accordion"
|
|
21
|
-
}]
|
|
22
|
-
}, {
|
|
23
|
-
label: "Principles very very very very very very very very long",
|
|
24
|
-
links: [{
|
|
25
|
-
label: "Color very very very very very very very very long"
|
|
26
|
-
}, {
|
|
27
|
-
label: "Spacingveryveryveryveryveryveryveryverylong"
|
|
28
|
-
}, {
|
|
29
|
-
label: "Typography"
|
|
30
|
-
}]
|
|
31
|
-
}, {
|
|
32
|
-
label: "Componentsveryveryveryveryveryveryveryverylong",
|
|
33
|
-
links: [{
|
|
34
|
-
label: "Accordion"
|
|
35
|
-
}]
|
|
36
|
-
}];
|
|
37
|
-
describe("Quick Nav component accessibility tests", function () {
|
|
38
|
-
it("Should not have basic accessibility issues for icon mode", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
39
|
-
var _render, container, results;
|
|
40
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
41
|
-
while (1) switch (_context.prev = _context.next) {
|
|
42
|
-
case 0:
|
|
43
|
-
_render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_QuickNav["default"], {
|
|
44
|
-
links: links
|
|
45
|
-
})), container = _render.container;
|
|
46
|
-
_context.next = 3;
|
|
47
|
-
return (0, _axeHelper.axe)(container);
|
|
48
|
-
case 3:
|
|
49
|
-
results = _context.sent;
|
|
50
|
-
expect(results).toHaveNoViolations();
|
|
51
|
-
case 5:
|
|
52
|
-
case "end":
|
|
53
|
-
return _context.stop();
|
|
54
|
-
}
|
|
55
|
-
}, _callee);
|
|
56
|
-
})));
|
|
57
|
-
});
|
package/quick-nav/QuickNav.d.ts
DELETED
package/quick-nav/QuickNav.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
12
|
-
var _slugify = _interopRequireDefault(require("slugify"));
|
|
13
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
14
|
-
var _Heading = _interopRequireDefault(require("../heading/Heading"));
|
|
15
|
-
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
16
|
-
var _Inset = _interopRequireDefault(require("../inset/Inset"));
|
|
17
|
-
var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
18
|
-
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
19
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
20
|
-
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); }
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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; }
|
|
22
|
-
var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
23
|
-
var title = _ref.title,
|
|
24
|
-
links = _ref.links;
|
|
25
|
-
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
26
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
28
|
-
theme: colorsTheme.quickNav
|
|
29
|
-
}, /*#__PURE__*/_react["default"].createElement(QuickNavContainer, null, /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
|
|
30
|
-
direction: "column",
|
|
31
|
-
gap: "0.5rem"
|
|
32
|
-
}, /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
|
|
33
|
-
level: 4,
|
|
34
|
-
text: title || translatedLabels.quickNav.contentTitle
|
|
35
|
-
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null, links.map(function (link) {
|
|
36
|
-
var _link$links;
|
|
37
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
38
|
-
key: link.label
|
|
39
|
-
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
40
|
-
space: "0.25rem"
|
|
41
|
-
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, /*#__PURE__*/_react["default"].createElement(Link, {
|
|
42
|
-
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
43
|
-
lower: true
|
|
44
|
-
}))
|
|
45
|
-
}, link === null || link === void 0 ? void 0 : link.label), /*#__PURE__*/_react["default"].createElement(ListSecondColumn, null, (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
46
|
-
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
47
|
-
key: sublink.label
|
|
48
|
-
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
49
|
-
horizontal: "0.5rem"
|
|
50
|
-
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, /*#__PURE__*/_react["default"].createElement(Link, {
|
|
51
|
-
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
52
|
-
lower: true
|
|
53
|
-
}), "-").concat((0, _slugify["default"])(sublink === null || sublink === void 0 ? void 0 : sublink.label, {
|
|
54
|
-
lower: true
|
|
55
|
-
}))
|
|
56
|
-
}, sublink === null || sublink === void 0 ? void 0 : sublink.label))));
|
|
57
|
-
})))));
|
|
58
|
-
})))));
|
|
59
|
-
};
|
|
60
|
-
var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n border-left: 2px solid ", ";\n"])), function (props) {
|
|
61
|
-
return props.theme.paddingTop;
|
|
62
|
-
}, function (props) {
|
|
63
|
-
return props.theme.paddingBottom;
|
|
64
|
-
}, function (props) {
|
|
65
|
-
return props.theme.paddingLeft;
|
|
66
|
-
}, function (props) {
|
|
67
|
-
return props.theme.paddingRight;
|
|
68
|
-
}, function (props) {
|
|
69
|
-
return props.theme.dividerBorderColor;
|
|
70
|
-
});
|
|
71
|
-
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
72
|
-
var ListSecondColumn = _styledComponents["default"].ul(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
73
|
-
var Link = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n display: block;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n\n &:hover {\n color: ", ";\n }\n &:focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n border-radius: ", ";\n }\n"])), function (props) {
|
|
74
|
-
return props.theme.fontSize;
|
|
75
|
-
}, function (props) {
|
|
76
|
-
return props.theme.fontFamily;
|
|
77
|
-
}, function (props) {
|
|
78
|
-
return props.theme.fontStyle;
|
|
79
|
-
}, function (props) {
|
|
80
|
-
return props.theme.fontWeight;
|
|
81
|
-
}, function (props) {
|
|
82
|
-
return props.theme.fontColor;
|
|
83
|
-
}, function (props) {
|
|
84
|
-
return props.theme.hoverFontColor;
|
|
85
|
-
}, function (props) {
|
|
86
|
-
return props.theme.focusBorderColor;
|
|
87
|
-
}, function (props) {
|
|
88
|
-
return props.theme.focusBorderStyle;
|
|
89
|
-
}, function (props) {
|
|
90
|
-
return props.theme.focusBorderThickness;
|
|
91
|
-
}, function (props) {
|
|
92
|
-
return props.theme.focusBorderRadius;
|
|
93
|
-
});
|
|
94
|
-
var _default = exports["default"] = DxcQuickNav;
|