@dxc-technology/halstack-react 12.2.0 → 13.1.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 -2
- package/dist/index.d.mts +6439 -0
- package/dist/index.d.ts +6439 -0
- package/dist/index.js +12568 -0
- package/dist/index.mjs +12480 -0
- package/package.json +63 -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/file-input/FileInput.js
DELETED
|
@@ -1,438 +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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
18
|
-
var _variables = require("../common/variables");
|
|
19
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
20
|
-
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
21
|
-
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
22
|
-
var _FileItem = _interopRequireDefault(require("./FileItem"));
|
|
23
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
24
|
-
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); }
|
|
25
|
-
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; }
|
|
26
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
|
-
var getFilePreview = /*#__PURE__*/function () {
|
|
29
|
-
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
|
|
30
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
31
|
-
while (1) switch (_context.prev = _context.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
if (!file.type.includes("video")) {
|
|
34
|
-
_context.next = 4;
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
return _context.abrupt("return", "filled_movie");
|
|
38
|
-
case 4:
|
|
39
|
-
if (!file.type.includes("audio")) {
|
|
40
|
-
_context.next = 8;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
return _context.abrupt("return", "music_video");
|
|
44
|
-
case 8:
|
|
45
|
-
if (!file.type.includes("image")) {
|
|
46
|
-
_context.next = 12;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
return _context.abrupt("return", new Promise(function (resolve) {
|
|
50
|
-
var reader = new FileReader();
|
|
51
|
-
reader.readAsDataURL(file);
|
|
52
|
-
reader.onload = function (e) {
|
|
53
|
-
resolve(e.target.result);
|
|
54
|
-
};
|
|
55
|
-
}));
|
|
56
|
-
case 12:
|
|
57
|
-
return _context.abrupt("return", "draft");
|
|
58
|
-
case 13:
|
|
59
|
-
case "end":
|
|
60
|
-
return _context.stop();
|
|
61
|
-
}
|
|
62
|
-
}, _callee);
|
|
63
|
-
}));
|
|
64
|
-
return function getFilePreview(_x) {
|
|
65
|
-
return _ref.apply(this, arguments);
|
|
66
|
-
};
|
|
67
|
-
}();
|
|
68
|
-
var isFileIncluded = function isFileIncluded(file, fileList) {
|
|
69
|
-
var fileListInfo = fileList.map(function (existingFile) {
|
|
70
|
-
return existingFile.file;
|
|
71
|
-
});
|
|
72
|
-
return fileListInfo.some(function (_ref2) {
|
|
73
|
-
var name = _ref2.name,
|
|
74
|
-
size = _ref2.size,
|
|
75
|
-
type = _ref2.type,
|
|
76
|
-
lastModified = _ref2.lastModified,
|
|
77
|
-
webkitRelativePath = _ref2.webkitRelativePath;
|
|
78
|
-
return name === file.file.name && size === file.file.size && type === file.file.type && lastModified === file.file.lastModified && webkitRelativePath === file.file.webkitRelativePath;
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
82
|
-
var _ref3$mode = _ref3.mode,
|
|
83
|
-
mode = _ref3$mode === void 0 ? "file" : _ref3$mode,
|
|
84
|
-
_ref3$label = _ref3.label,
|
|
85
|
-
label = _ref3$label === void 0 ? "" : _ref3$label,
|
|
86
|
-
buttonLabel = _ref3.buttonLabel,
|
|
87
|
-
dropAreaLabel = _ref3.dropAreaLabel,
|
|
88
|
-
_ref3$helperText = _ref3.helperText,
|
|
89
|
-
helperText = _ref3$helperText === void 0 ? "" : _ref3$helperText,
|
|
90
|
-
accept = _ref3.accept,
|
|
91
|
-
minSize = _ref3.minSize,
|
|
92
|
-
maxSize = _ref3.maxSize,
|
|
93
|
-
_ref3$showPreview = _ref3.showPreview,
|
|
94
|
-
showPreview = _ref3$showPreview === void 0 ? false : _ref3$showPreview,
|
|
95
|
-
_ref3$multiple = _ref3.multiple,
|
|
96
|
-
multiple = _ref3$multiple === void 0 ? true : _ref3$multiple,
|
|
97
|
-
_ref3$disabled = _ref3.disabled,
|
|
98
|
-
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
|
|
99
|
-
callbackFile = _ref3.callbackFile,
|
|
100
|
-
value = _ref3.value,
|
|
101
|
-
margin = _ref3.margin,
|
|
102
|
-
_ref3$tabIndex = _ref3.tabIndex,
|
|
103
|
-
tabIndex = _ref3$tabIndex === void 0 ? 0 : _ref3$tabIndex;
|
|
104
|
-
var _useState = (0, _react.useState)(false),
|
|
105
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
106
|
-
isDragging = _useState2[0],
|
|
107
|
-
setIsDragging = _useState2[1];
|
|
108
|
-
var _useState3 = (0, _react.useState)([]),
|
|
109
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
110
|
-
files = _useState4[0],
|
|
111
|
-
setFiles = _useState4[1];
|
|
112
|
-
var fileInputId = "file-input-".concat((0, _react.useId)());
|
|
113
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
114
|
-
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
115
|
-
var checkFileSize = function checkFileSize(file) {
|
|
116
|
-
if (file.size < minSize) return translatedLabels.fileInput.fileSizeGreaterThanErrorMessage;else if (file.size > maxSize) return translatedLabels.fileInput.fileSizeLessThanErrorMessage;
|
|
117
|
-
};
|
|
118
|
-
var getFilesToAdd = /*#__PURE__*/function () {
|
|
119
|
-
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(selectedFiles) {
|
|
120
|
-
var filesToAdd;
|
|
121
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
122
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
123
|
-
case 0:
|
|
124
|
-
_context2.next = 2;
|
|
125
|
-
return Promise.all(selectedFiles.map(function (selectedFile) {
|
|
126
|
-
return getFilePreview(selectedFile);
|
|
127
|
-
})).then(function (previews) {
|
|
128
|
-
return selectedFiles.map(function (file, index) {
|
|
129
|
-
var fileInfo = {
|
|
130
|
-
file: file,
|
|
131
|
-
error: checkFileSize(file),
|
|
132
|
-
preview: previews[index]
|
|
133
|
-
};
|
|
134
|
-
return fileInfo;
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
case 2:
|
|
138
|
-
filesToAdd = _context2.sent;
|
|
139
|
-
return _context2.abrupt("return", filesToAdd.filter(function (file) {
|
|
140
|
-
return !isFileIncluded(file, files);
|
|
141
|
-
}));
|
|
142
|
-
case 4:
|
|
143
|
-
case "end":
|
|
144
|
-
return _context2.stop();
|
|
145
|
-
}
|
|
146
|
-
}, _callee2);
|
|
147
|
-
}));
|
|
148
|
-
return function getFilesToAdd(_x2) {
|
|
149
|
-
return _ref4.apply(this, arguments);
|
|
150
|
-
};
|
|
151
|
-
}();
|
|
152
|
-
var addFile = /*#__PURE__*/function () {
|
|
153
|
-
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(selectedFiles) {
|
|
154
|
-
var filesToAdd, finalFiles;
|
|
155
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
156
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
157
|
-
case 0:
|
|
158
|
-
_context3.next = 2;
|
|
159
|
-
return getFilesToAdd(multiple ? selectedFiles : selectedFiles.length === 1 ? selectedFiles : [selectedFiles[0]]);
|
|
160
|
-
case 2:
|
|
161
|
-
filesToAdd = _context3.sent;
|
|
162
|
-
finalFiles = multiple ? [].concat((0, _toConsumableArray2["default"])(files), (0, _toConsumableArray2["default"])(filesToAdd)) : filesToAdd;
|
|
163
|
-
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(finalFiles);
|
|
164
|
-
case 5:
|
|
165
|
-
case "end":
|
|
166
|
-
return _context3.stop();
|
|
167
|
-
}
|
|
168
|
-
}, _callee3);
|
|
169
|
-
}));
|
|
170
|
-
return function addFile(_x3) {
|
|
171
|
-
return _ref5.apply(this, arguments);
|
|
172
|
-
};
|
|
173
|
-
}();
|
|
174
|
-
var selectFiles = function selectFiles(e) {
|
|
175
|
-
var selectedFiles = e.target.files;
|
|
176
|
-
var filesArray = Object.keys(selectedFiles).map(function (key) {
|
|
177
|
-
return selectedFiles[key];
|
|
178
|
-
});
|
|
179
|
-
addFile(filesArray);
|
|
180
|
-
e.target.value = null;
|
|
181
|
-
};
|
|
182
|
-
var onDelete = (0, _react.useCallback)(function (fileName) {
|
|
183
|
-
var filesCopy = (0, _toConsumableArray2["default"])(files);
|
|
184
|
-
var fileToRemove = filesCopy.find(function (file) {
|
|
185
|
-
return file.file.name === fileName;
|
|
186
|
-
});
|
|
187
|
-
var fileIndex = filesCopy.indexOf(fileToRemove);
|
|
188
|
-
filesCopy.splice(fileIndex, 1);
|
|
189
|
-
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(filesCopy);
|
|
190
|
-
}, [files, callbackFile]);
|
|
191
|
-
var handleClick = function handleClick() {
|
|
192
|
-
document.getElementById(fileInputId).click();
|
|
193
|
-
};
|
|
194
|
-
var handleDrag = function handleDrag(e) {
|
|
195
|
-
e.preventDefault();
|
|
196
|
-
e.stopPropagation();
|
|
197
|
-
};
|
|
198
|
-
var handleDragIn = function handleDragIn(e) {
|
|
199
|
-
var _e$dataTransfer$items;
|
|
200
|
-
if (((_e$dataTransfer$items = e.dataTransfer.items) === null || _e$dataTransfer$items === void 0 ? void 0 : _e$dataTransfer$items.length) > 0) setIsDragging(true);
|
|
201
|
-
};
|
|
202
|
-
var handleDragOut = function handleDragOut(e) {
|
|
203
|
-
// only if dragged items leave container (outside, not to childs)
|
|
204
|
-
if (!e.currentTarget.contains(e.relatedTarget)) setIsDragging(false);
|
|
205
|
-
};
|
|
206
|
-
var handleDrop = function handleDrop(e) {
|
|
207
|
-
e.preventDefault();
|
|
208
|
-
e.stopPropagation();
|
|
209
|
-
setIsDragging(false);
|
|
210
|
-
var filesObject = e.dataTransfer.files;
|
|
211
|
-
if ((filesObject === null || filesObject === void 0 ? void 0 : filesObject.length) > 0) {
|
|
212
|
-
var filesArray = Object.keys(filesObject).map(function (key) {
|
|
213
|
-
return filesObject[key];
|
|
214
|
-
});
|
|
215
|
-
addFile(filesArray);
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
(0, _react.useEffect)(function () {
|
|
219
|
-
var getFiles = /*#__PURE__*/function () {
|
|
220
|
-
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
221
|
-
var valueFiles;
|
|
222
|
-
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
223
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
224
|
-
case 0:
|
|
225
|
-
if (!value) {
|
|
226
|
-
_context5.next = 5;
|
|
227
|
-
break;
|
|
228
|
-
}
|
|
229
|
-
_context5.next = 3;
|
|
230
|
-
return Promise.all(value.map( /*#__PURE__*/function () {
|
|
231
|
-
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(file) {
|
|
232
|
-
var preview;
|
|
233
|
-
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
234
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
235
|
-
case 0:
|
|
236
|
-
if (!file.preview) {
|
|
237
|
-
_context4.next = 4;
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
return _context4.abrupt("return", file);
|
|
241
|
-
case 4:
|
|
242
|
-
_context4.next = 6;
|
|
243
|
-
return getFilePreview(file.file);
|
|
244
|
-
case 6:
|
|
245
|
-
preview = _context4.sent;
|
|
246
|
-
return _context4.abrupt("return", _objectSpread(_objectSpread({}, file), {}, {
|
|
247
|
-
preview: preview
|
|
248
|
-
}));
|
|
249
|
-
case 8:
|
|
250
|
-
case "end":
|
|
251
|
-
return _context4.stop();
|
|
252
|
-
}
|
|
253
|
-
}, _callee4);
|
|
254
|
-
}));
|
|
255
|
-
return function (_x4) {
|
|
256
|
-
return _ref7.apply(this, arguments);
|
|
257
|
-
};
|
|
258
|
-
}()));
|
|
259
|
-
case 3:
|
|
260
|
-
valueFiles = _context5.sent;
|
|
261
|
-
setFiles(valueFiles);
|
|
262
|
-
case 5:
|
|
263
|
-
case "end":
|
|
264
|
-
return _context5.stop();
|
|
265
|
-
}
|
|
266
|
-
}, _callee5);
|
|
267
|
-
}));
|
|
268
|
-
return function getFiles() {
|
|
269
|
-
return _ref6.apply(this, arguments);
|
|
270
|
-
};
|
|
271
|
-
}();
|
|
272
|
-
getFiles();
|
|
273
|
-
}, [value]);
|
|
274
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
275
|
-
theme: colorsTheme.fileInput
|
|
276
|
-
}, /*#__PURE__*/_react["default"].createElement(FileInputContainer, {
|
|
277
|
-
margin: margin,
|
|
278
|
-
ref: ref
|
|
279
|
-
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
280
|
-
htmlFor: fileInputId,
|
|
281
|
-
disabled: disabled
|
|
282
|
-
}, label), /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
283
|
-
disabled: disabled
|
|
284
|
-
}, helperText), mode === "file" ? /*#__PURE__*/_react["default"].createElement(FileContainer, {
|
|
285
|
-
singleFileMode: !multiple && files.length === 1
|
|
286
|
-
}, /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
287
|
-
id: fileInputId,
|
|
288
|
-
type: "file",
|
|
289
|
-
accept: accept,
|
|
290
|
-
multiple: multiple,
|
|
291
|
-
onChange: selectFiles,
|
|
292
|
-
disabled: disabled,
|
|
293
|
-
readOnly: true
|
|
294
|
-
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
295
|
-
mode: "secondary",
|
|
296
|
-
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : multiple ? translatedLabels.fileInput.multipleButtonLabelDefault : translatedLabels.fileInput.singleButtonLabelDefault,
|
|
297
|
-
onClick: handleClick,
|
|
298
|
-
disabled: disabled,
|
|
299
|
-
size: "fitContent",
|
|
300
|
-
tabIndex: tabIndex
|
|
301
|
-
}), files.length > 0 && /*#__PURE__*/_react["default"].createElement(FileItemListContainer, null, files.map(function (file, index) {
|
|
302
|
-
return /*#__PURE__*/_react["default"].createElement(_FileItem["default"], {
|
|
303
|
-
fileName: file.file.name,
|
|
304
|
-
error: file.error,
|
|
305
|
-
singleFileMode: !multiple && files.length === 1,
|
|
306
|
-
showPreview: mode === "file" && !multiple ? false : showPreview,
|
|
307
|
-
preview: file.preview,
|
|
308
|
-
type: file.file.type,
|
|
309
|
-
onDelete: onDelete,
|
|
310
|
-
tabIndex: tabIndex,
|
|
311
|
-
key: "file-".concat(index)
|
|
312
|
-
});
|
|
313
|
-
}))) : /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
314
|
-
id: fileInputId,
|
|
315
|
-
type: "file",
|
|
316
|
-
accept: accept,
|
|
317
|
-
multiple: multiple,
|
|
318
|
-
onChange: selectFiles,
|
|
319
|
-
disabled: disabled,
|
|
320
|
-
readOnly: true
|
|
321
|
-
}), /*#__PURE__*/_react["default"].createElement(DragDropArea, {
|
|
322
|
-
isDragging: isDragging,
|
|
323
|
-
disabled: disabled,
|
|
324
|
-
mode: mode,
|
|
325
|
-
onDrop: handleDrop,
|
|
326
|
-
onDragEnter: handleDragIn,
|
|
327
|
-
onDragOver: handleDrag,
|
|
328
|
-
onDragLeave: handleDragOut
|
|
329
|
-
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
330
|
-
mode: "secondary",
|
|
331
|
-
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : translatedLabels.fileInput.dropAreaButtonLabelDefault,
|
|
332
|
-
onClick: handleClick,
|
|
333
|
-
disabled: disabled,
|
|
334
|
-
size: "fitContent"
|
|
335
|
-
}), mode === "dropzone" ? /*#__PURE__*/_react["default"].createElement(DropzoneLabel, {
|
|
336
|
-
disabled: disabled
|
|
337
|
-
}, dropAreaLabel !== null && dropAreaLabel !== void 0 ? dropAreaLabel : multiple ? translatedLabels.fileInput.multipleDropAreaLabelDefault : translatedLabels.fileInput.singleDropAreaLabelDefault) : /*#__PURE__*/_react["default"].createElement(FiledropLabel, {
|
|
338
|
-
disabled: disabled
|
|
339
|
-
}, dropAreaLabel !== null && dropAreaLabel !== void 0 ? dropAreaLabel : multiple ? translatedLabels.fileInput.multipleDropAreaLabelDefault : translatedLabels.fileInput.singleDropAreaLabelDefault)), files.length > 0 && /*#__PURE__*/_react["default"].createElement(FileItemListContainer, null, files.map(function (file, index) {
|
|
340
|
-
return /*#__PURE__*/_react["default"].createElement(_FileItem["default"], {
|
|
341
|
-
fileName: file.file.name,
|
|
342
|
-
error: file.error,
|
|
343
|
-
singleFileMode: false,
|
|
344
|
-
showPreview: showPreview,
|
|
345
|
-
preview: file.preview,
|
|
346
|
-
type: file.file.type,
|
|
347
|
-
onDelete: onDelete,
|
|
348
|
-
tabIndex: tabIndex,
|
|
349
|
-
key: "file-".concat(index)
|
|
350
|
-
});
|
|
351
|
-
}))), mode === "file" && !multiple && files.length === 1 && files[0].error && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, files[0].error)));
|
|
352
|
-
});
|
|
353
|
-
var FileInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: fit-content;\n"])), function (props) {
|
|
354
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
355
|
-
}, function (props) {
|
|
356
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
357
|
-
}, function (props) {
|
|
358
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
359
|
-
}, function (props) {
|
|
360
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
361
|
-
}, function (props) {
|
|
362
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
363
|
-
});
|
|
364
|
-
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
365
|
-
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
366
|
-
}, function (props) {
|
|
367
|
-
return props.theme.labelFontFamily;
|
|
368
|
-
}, function (props) {
|
|
369
|
-
return props.theme.labelFontSize;
|
|
370
|
-
}, function (props) {
|
|
371
|
-
return props.theme.labelFontWeight;
|
|
372
|
-
}, function (props) {
|
|
373
|
-
return props.theme.labelLineHeight;
|
|
374
|
-
});
|
|
375
|
-
var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
376
|
-
return props.disabled ? props.theme.disabledHelperTextFontcolor : props.theme.helperTextFontColor;
|
|
377
|
-
}, function (props) {
|
|
378
|
-
return props.theme.helperTextFontFamily;
|
|
379
|
-
}, function (props) {
|
|
380
|
-
return props.theme.helperTextFontSize;
|
|
381
|
-
}, function (props) {
|
|
382
|
-
return props.theme.helperTextFontWeight;
|
|
383
|
-
}, function (props) {
|
|
384
|
-
return props.theme.helperTextLineHeight;
|
|
385
|
-
});
|
|
386
|
-
var FileContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n margin-top: 0.25rem;\n"])), function (props) {
|
|
387
|
-
return props.singleFileMode ? "flex-direction: row; column-gap: 0.25rem;" : "flex-direction: column; row-gap: 0.25rem;";
|
|
388
|
-
});
|
|
389
|
-
var ValueInput = _styledComponents["default"].input(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: none;\n"])));
|
|
390
|
-
var FileItemListContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n row-gap: 0.25rem;\n"])));
|
|
391
|
-
var Container = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n row-gap: 0.25rem;\n margin-top: 0.25rem;\n"])));
|
|
392
|
-
var DragDropArea = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n ", "\n align-items: center;\n width: 320px;\n padding: ", ";\n overflow: hidden;\n box-shadow: 0 0 0 2px transparent;\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n ", "\n cursor: ", ";\n"])), function (props) {
|
|
393
|
-
return props.mode === "filedrop" ? "flex-direction: row; column-gap: 0.75rem; height: 48px;" : "justify-content: center; flex-direction: column; row-gap: 0.5rem; height: 160px;";
|
|
394
|
-
}, function (props) {
|
|
395
|
-
return props.mode === "filedrop" ? "calc(4px - ".concat(props.theme.dropBorderThickness, ") 1rem calc(4px - ").concat(props.theme.dropBorderThickness, ") calc(4px - ").concat(props.theme.dropBorderThickness, ")") : "1rem";
|
|
396
|
-
}, function (props) {
|
|
397
|
-
return props.theme.dropBorderRadius;
|
|
398
|
-
}, function (props) {
|
|
399
|
-
return props.theme.dropBorderThickness;
|
|
400
|
-
}, function (props) {
|
|
401
|
-
return props.theme.dropBorderStyle;
|
|
402
|
-
}, function (props) {
|
|
403
|
-
return props.disabled ? props.theme.disabledDropBorderColor : props.theme.dropBorderColor;
|
|
404
|
-
}, function (props) {
|
|
405
|
-
return props.isDragging && "\n background-color: ".concat(props.theme.dragoverDropBackgroundColor, ";\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusDropBorderColor, ";\n ");
|
|
406
|
-
}, function (props) {
|
|
407
|
-
return props.disabled && "not-allowed";
|
|
408
|
-
});
|
|
409
|
-
var DropzoneLabel = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: 3;\n text-align: center;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
410
|
-
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
411
|
-
}, function (props) {
|
|
412
|
-
return props.theme.dropLabelFontFamily;
|
|
413
|
-
}, function (props) {
|
|
414
|
-
return props.theme.dropLabelFontSize;
|
|
415
|
-
}, function (props) {
|
|
416
|
-
return props.theme.dropLabelFontWeight;
|
|
417
|
-
});
|
|
418
|
-
var FiledropLabel = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
419
|
-
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
420
|
-
}, function (props) {
|
|
421
|
-
return props.theme.dropLabelFontFamily;
|
|
422
|
-
}, function (props) {
|
|
423
|
-
return props.theme.dropLabelFontSize;
|
|
424
|
-
}, function (props) {
|
|
425
|
-
return props.theme.dropLabelFontWeight;
|
|
426
|
-
});
|
|
427
|
-
var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: 0.25rem;\n"])), function (props) {
|
|
428
|
-
return props.theme.errorMessageFontColor;
|
|
429
|
-
}, function (props) {
|
|
430
|
-
return props.theme.errorMessageFontFamily;
|
|
431
|
-
}, function (props) {
|
|
432
|
-
return props.theme.errorMessageFontSize;
|
|
433
|
-
}, function (props) {
|
|
434
|
-
return props.theme.errorMessageFontWeight;
|
|
435
|
-
}, function (props) {
|
|
436
|
-
return props.theme.errorMessageLineHeight;
|
|
437
|
-
});
|
|
438
|
-
var _default = exports["default"] = DxcFileInput;
|