@ultraviolet/ui 1.51.0 → 1.51.2
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/dist/components/ActionBar/index.d.ts +20 -0
- package/dist/components/ActionBar/index.js +40 -0
- package/dist/components/Alert/index.d.ts +27 -0
- package/dist/components/Alert/index.js +126 -0
- package/dist/components/Avatar/index.d.ts +43 -0
- package/dist/components/Avatar/index.js +54 -0
- package/dist/components/Badge/index.d.ts +31 -0
- package/dist/components/Badge/index.js +115 -0
- package/dist/components/Banner/assets/default-image-small.svg.js +4 -0
- package/dist/components/Banner/assets/default-image.svg.js +4 -0
- package/dist/components/Banner/index.d.ts +24 -0
- package/dist/components/Banner/index.js +191 -0
- package/dist/components/BarChart/Tooltip.d.ts +9 -0
- package/dist/components/BarChart/Tooltip.js +36 -0
- package/dist/components/BarChart/index.d.ts +27 -0
- package/dist/components/BarChart/index.js +82 -0
- package/dist/components/BarStack/index.d.ts +36 -0
- package/dist/components/BarStack/index.js +188 -0
- package/dist/components/Breadcrumbs/index.d.ts +30 -0
- package/dist/components/Breadcrumbs/index.js +76 -0
- package/dist/components/Bullet/index.d.ts +39 -0
- package/dist/components/Bullet/index.js +88 -0
- package/dist/components/Button/index.d.ts +120 -0
- package/dist/components/Button/index.js +291 -0
- package/dist/components/Card/index.d.ts +20 -0
- package/dist/components/Card/index.js +59 -0
- package/dist/components/Carousel/index.d.ts +19 -0
- package/dist/components/Carousel/index.js +147 -0
- package/dist/components/Checkbox/index.d.ts +36 -0
- package/dist/components/Checkbox/index.js +359 -0
- package/dist/components/CheckboxGroup/index.d.ts +24 -0
- package/dist/components/CheckboxGroup/index.js +112 -0
- package/dist/components/CopyButton/index.d.ts +19 -0
- package/dist/components/CopyButton/index.js +37 -0
- package/dist/components/DateInput/datepicker.css.js +4 -0
- package/dist/components/DateInput/index.d.ts +38 -0
- package/dist/components/DateInput/index.js +301 -0
- package/dist/components/Dialog/Context.d.ts +7 -0
- package/dist/components/Dialog/Context.js +15 -0
- package/dist/components/Dialog/constants.d.ts +2 -0
- package/dist/components/Dialog/index.d.ts +87 -0
- package/dist/components/Dialog/index.js +87 -0
- package/dist/components/Dialog/subComponents/Button.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Button.js +24 -0
- package/dist/components/Dialog/subComponents/Buttons.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Buttons.js +12 -0
- package/dist/components/Dialog/subComponents/CancelButton.d.ts +8 -0
- package/dist/components/Dialog/subComponents/CancelButton.js +9 -0
- package/dist/components/Dialog/subComponents/Stack.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Stack.js +6 -0
- package/dist/components/Dialog/subComponents/Text.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Text.js +6 -0
- package/dist/components/EmptyState/index.d.ts +38 -0
- package/dist/components/EmptyState/index.js +82 -0
- package/dist/components/Expandable/index.d.ts +33 -0
- package/dist/components/Expandable/index.js +79 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.d.ts +3 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.js +39 -0
- package/dist/components/GlobalAlert/index.d.ts +40 -0
- package/dist/components/GlobalAlert/index.js +112 -0
- package/dist/components/LineChart/CustomLegend.d.ts +13 -0
- package/dist/components/LineChart/CustomLegend.js +109 -0
- package/dist/components/LineChart/Tooltip.d.ts +6 -0
- package/dist/components/LineChart/Tooltip.js +46 -0
- package/dist/components/LineChart/helpers.d.ts +8 -0
- package/dist/components/LineChart/helpers.js +50 -0
- package/dist/components/LineChart/index.d.ts +25 -0
- package/dist/components/LineChart/index.js +118 -0
- package/dist/components/Link/index.d.ts +33 -0
- package/dist/components/Link/index.js +167 -0
- package/dist/components/List/Body.d.ts +6 -0
- package/dist/components/List/Body.js +11 -0
- package/dist/components/List/Cell.d.ts +12 -0
- package/dist/components/List/Cell.js +38 -0
- package/dist/components/List/HeaderCell.d.ts +11 -0
- package/dist/components/List/HeaderCell.js +96 -0
- package/dist/components/List/HeaderRow.d.ts +7 -0
- package/dist/components/List/HeaderRow.js +38 -0
- package/dist/components/List/ListContext.d.ts +34 -0
- package/dist/components/List/ListContext.js +155 -0
- package/dist/components/List/Row.d.ts +23 -0
- package/dist/components/List/Row.js +194 -0
- package/dist/components/List/SelectBar.d.ts +15 -0
- package/dist/components/List/SelectBar.js +35 -0
- package/dist/components/List/SkeletonRows.d.ts +7 -0
- package/dist/components/List/SkeletonRows.js +36 -0
- package/dist/components/List/constants.d.ts +2 -0
- package/dist/{src/components → components}/List/constants.js +4 -2
- package/dist/components/List/index.d.ts +68 -0
- package/dist/components/List/index.js +80 -0
- package/dist/components/Loader/index.d.ts +22 -0
- package/dist/components/Loader/index.js +98 -0
- package/dist/components/Menu/Item.d.ts +15 -0
- package/dist/components/Menu/Item.js +101 -0
- package/dist/components/Menu/index.d.ts +49 -0
- package/dist/components/Menu/index.js +182 -0
- package/dist/components/MenuV2/Group.d.ts +7 -0
- package/dist/components/MenuV2/Group.js +23 -0
- package/dist/components/MenuV2/Item.d.ts +16 -0
- package/dist/components/MenuV2/Item.js +120 -0
- package/dist/components/MenuV2/index.d.ts +90 -0
- package/dist/components/MenuV2/index.js +124 -0
- package/dist/components/Meter/index.d.ts +26 -0
- package/dist/components/Meter/index.js +76 -0
- package/dist/components/Modal/Dialog.d.ts +3 -0
- package/dist/components/Modal/Dialog.js +197 -0
- package/dist/components/Modal/Disclosure.d.ts +3 -0
- package/dist/{src/components → components}/Modal/Disclosure.js +12 -12
- package/dist/components/Modal/constants.d.ts +3 -0
- package/dist/{src/components → components}/Modal/constants.js +8 -6
- package/dist/components/Modal/index.d.ts +42 -0
- package/dist/components/Modal/index.js +114 -0
- package/dist/components/Modal/types.d.ts +48 -0
- package/dist/components/Notice/index.d.ts +11 -0
- package/dist/components/Notice/index.js +39 -0
- package/dist/components/Notification/index.d.ts +36 -0
- package/dist/components/Notification/index.js +88 -0
- package/dist/components/Notification/react-toastify.css.js +4 -0
- package/dist/components/NumberInput/helpers.d.ts +4 -0
- package/dist/{src/components → components}/NumberInput/helpers.js +6 -2
- package/dist/components/NumberInput/index.d.ts +41 -0
- package/dist/components/NumberInput/index.js +349 -0
- package/dist/components/NumberInputV2/index.d.ts +27 -0
- package/dist/components/NumberInputV2/index.js +370 -0
- package/dist/components/Pagination/getPageNumbers.d.ts +8 -0
- package/dist/{src/components → components}/Pagination/getPageNumbers.js +4 -12
- package/dist/components/Pagination/index.d.ts +30 -0
- package/dist/components/Pagination/index.js +124 -0
- package/dist/components/PasswordCheck/index.d.ts +20 -0
- package/dist/components/PasswordCheck/index.js +29 -0
- package/dist/components/PasswordStrengthMeter/index.d.ts +39 -0
- package/dist/components/PasswordStrengthMeter/index.js +98 -0
- package/dist/components/PieChart/Legends.d.ts +9 -0
- package/dist/components/PieChart/Legends.js +120 -0
- package/dist/components/PieChart/Tooltip.d.ts +12 -0
- package/dist/components/PieChart/Tooltip.js +29 -0
- package/dist/components/PieChart/index.d.ts +20 -0
- package/dist/components/PieChart/index.js +120 -0
- package/dist/components/PieChart/types.d.ts +7 -0
- package/dist/components/Popover/index.d.ts +55 -0
- package/dist/components/Popover/index.js +149 -0
- package/dist/components/Popup/animations.d.ts +11 -0
- package/dist/{src/components → components}/Popup/animations.js +7 -6
- package/dist/components/Popup/helpers.d.ts +31 -0
- package/dist/components/Popup/helpers.js +204 -0
- package/dist/components/Popup/index.d.ts +72 -0
- package/dist/components/Popup/index.js +385 -0
- package/dist/components/ProgressBar/index.d.ts +14 -0
- package/dist/components/ProgressBar/index.js +71 -0
- package/dist/components/Radio/index.d.ts +21 -0
- package/dist/components/Radio/index.js +202 -0
- package/dist/components/RadioGroup/index.d.ts +25 -0
- package/dist/components/RadioGroup/index.js +104 -0
- package/dist/components/Row/index.d.ts +22 -0
- package/dist/components/Row/index.js +43 -0
- package/dist/components/SelectInput/index.d.ts +75 -0
- package/dist/components/SelectInput/index.js +563 -0
- package/dist/components/SelectInputV2/Dropdown.d.ts +23 -0
- package/dist/components/SelectInputV2/Dropdown.js +669 -0
- package/dist/components/SelectInputV2/DropdownOption.d.ts +8 -0
- package/dist/components/SelectInputV2/DropdownOption.js +133 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.d.ts +9 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.js +123 -0
- package/dist/components/SelectInputV2/SelectBar.d.ts +14 -0
- package/dist/components/SelectInputV2/SelectBar.js +327 -0
- package/dist/components/SelectInputV2/SelectInputProvider.d.ts +41 -0
- package/dist/components/SelectInputV2/SelectInputProvider.js +203 -0
- package/dist/components/SelectInputV2/findOptionInOptions.d.ts +2 -0
- package/dist/components/SelectInputV2/findOptionInOptions.js +12 -0
- package/dist/components/SelectInputV2/index.d.ts +115 -0
- package/dist/components/SelectInputV2/index.js +146 -0
- package/dist/components/SelectInputV2/types.d.ts +38 -0
- package/dist/{src/components → components}/SelectInputV2/types.js +4 -2
- package/dist/components/SelectableCard/index.d.ts +25 -0
- package/dist/components/SelectableCard/index.js +193 -0
- package/dist/components/SelectableCardGroup/index.d.ts +23 -0
- package/dist/components/SelectableCardGroup/index.js +112 -0
- package/dist/components/Separator/index.d.ts +17 -0
- package/dist/components/Separator/index.js +76 -0
- package/dist/components/Skeleton/Block.d.ts +3 -0
- package/dist/components/Skeleton/Block.js +30 -0
- package/dist/components/Skeleton/Blocks.d.ts +4 -0
- package/dist/components/Skeleton/Blocks.js +28 -0
- package/dist/components/Skeleton/BoxWithIcon.d.ts +4 -0
- package/dist/components/Skeleton/BoxWithIcon.js +29 -0
- package/dist/components/Skeleton/Donut.d.ts +1 -0
- package/dist/components/Skeleton/Donut.js +36 -0
- package/dist/components/Skeleton/IconSkeleton.d.ts +5 -0
- package/dist/components/Skeleton/IconSkeleton.js +12 -0
- package/dist/components/Skeleton/Line.d.ts +5 -0
- package/dist/components/Skeleton/Line.js +13 -0
- package/dist/components/Skeleton/List.d.ts +4 -0
- package/dist/components/Skeleton/List.js +29 -0
- package/dist/components/Skeleton/Slider.d.ts +3 -0
- package/dist/components/Skeleton/Slider.js +26 -0
- package/dist/components/Skeleton/Square.d.ts +5 -0
- package/dist/components/Skeleton/Square.js +10 -0
- package/dist/components/Skeleton/index.d.ts +47 -0
- package/dist/components/Skeleton/index.js +86 -0
- package/dist/components/Snippet/index.d.ts +23 -0
- package/dist/components/Snippet/index.js +171 -0
- package/dist/components/Stack/index.d.ts +23 -0
- package/dist/components/Stack/index.js +36 -0
- package/dist/components/Status/index.d.ts +32 -0
- package/dist/components/Status/index.js +57 -0
- package/dist/components/StepList/index.d.ts +33 -0
- package/dist/components/StepList/index.js +69 -0
- package/dist/components/Stepper/index.d.ts +15 -0
- package/dist/components/Stepper/index.js +153 -0
- package/dist/components/SwitchButton/FocusOverlay.d.ts +8 -0
- package/dist/components/SwitchButton/FocusOverlay.js +47 -0
- package/dist/components/SwitchButton/index.d.ts +26 -0
- package/dist/components/SwitchButton/index.js +140 -0
- package/dist/components/Table/Body.d.ts +6 -0
- package/dist/components/Table/Body.js +5 -0
- package/dist/components/Table/Cell.d.ts +9 -0
- package/dist/components/Table/Cell.js +10 -0
- package/dist/components/Table/Header.d.ts +6 -0
- package/dist/components/Table/Header.js +9 -0
- package/dist/components/Table/HeaderCell.d.ts +14 -0
- package/dist/components/Table/HeaderCell.js +123 -0
- package/dist/components/Table/HeaderRow.d.ts +7 -0
- package/dist/components/Table/HeaderRow.js +25 -0
- package/dist/components/Table/Row.d.ts +14 -0
- package/dist/components/Table/Row.js +85 -0
- package/dist/components/Table/SelectBar.d.ts +15 -0
- package/dist/components/Table/SelectBar.js +35 -0
- package/dist/components/Table/SkeletonRows.d.ts +7 -0
- package/dist/components/Table/SkeletonRows.js +22 -0
- package/dist/components/Table/TableContext.d.ts +27 -0
- package/dist/components/Table/TableContext.js +103 -0
- package/dist/components/Table/index.d.ts +60 -0
- package/dist/components/Table/index.js +81 -0
- package/dist/components/Tabs/Tab.d.ts +20 -0
- package/dist/components/Tabs/Tab.js +170 -0
- package/dist/components/Tabs/TabMenu.d.ts +8 -0
- package/dist/components/Tabs/TabMenu.js +63 -0
- package/dist/components/Tabs/TabMenuItem.d.ts +20 -0
- package/dist/components/Tabs/TabMenuItem.js +39 -0
- package/dist/components/Tabs/TabsContext.d.ts +8 -0
- package/dist/components/Tabs/TabsContext.js +9 -0
- package/dist/components/Tabs/index.d.ts +50 -0
- package/dist/components/Tabs/index.js +137 -0
- package/dist/components/Tag/index.d.ts +26 -0
- package/dist/components/Tag/index.js +153 -0
- package/dist/components/TagInput/index.d.ts +55 -0
- package/dist/components/TagInput/index.js +316 -0
- package/dist/components/TagList/index.d.ts +37 -0
- package/dist/components/TagList/index.js +103 -0
- package/dist/components/Text/index.d.ts +40 -0
- package/dist/components/Text/index.js +107 -0
- package/dist/components/TextArea/index.d.ts +50 -0
- package/dist/components/TextArea/index.js +226 -0
- package/dist/components/TextInput/index.d.ts +75 -0
- package/dist/components/TextInput/index.js +472 -0
- package/dist/components/TextInputV2/index.d.ts +30 -0
- package/dist/components/TextInputV2/index.js +314 -0
- package/dist/components/TimeInput/index.d.ts +25 -0
- package/dist/components/TimeInput/index.js +199 -0
- package/dist/components/Toaster/index.d.ts +46 -0
- package/dist/components/Toaster/index.js +131 -0
- package/dist/components/Toaster/react-toastify.css.js +4 -0
- package/dist/components/Toggle/index.d.ts +34 -0
- package/dist/components/Toggle/index.js +196 -0
- package/dist/components/ToggleGroup/index.d.ts +24 -0
- package/dist/components/ToggleGroup/index.js +87 -0
- package/dist/components/Tooltip/index.d.ts +9 -0
- package/dist/components/Tooltip/index.js +47 -0
- package/dist/components/VerificationCode/index.d.ts +36 -0
- package/dist/components/VerificationCode/index.js +222 -0
- package/dist/components/index.d.ts +75 -0
- package/dist/helpers/isJSON.d.ts +2 -0
- package/dist/{src/helpers → helpers}/isJSON.js +4 -3
- package/dist/helpers/jestMockMatchMedia.d.ts +6 -0
- package/dist/helpers/keycode.d.ts +3 -0
- package/dist/helpers/legend.d.ts +2 -0
- package/dist/helpers/legend.js +14 -0
- package/dist/helpers/numbers.d.ts +2 -0
- package/dist/helpers/recursivelyGetChildrenString.d.ts +3 -0
- package/dist/helpers/recursivelyGetChildrenString.js +15 -0
- package/dist/hooks/useIsOverflowing.d.ts +5 -0
- package/dist/hooks/useIsOverflowing.js +23 -0
- package/dist/index.d.ts +4 -3693
- package/dist/index.js +187 -0
- package/dist/mocks/list.d.ts +12 -0
- package/dist/theme/index.d.ts +1573 -0
- package/dist/theme/index.js +30 -0
- package/dist/types.d.ts +6 -0
- package/dist/utils/animations.d.ts +27 -0
- package/dist/{src/utils → utils}/animations.js +30 -4
- package/dist/utils/capitalize.d.ts +2 -0
- package/dist/utils/capitalize.js +4 -0
- package/dist/utils/ids.d.ts +1 -0
- package/dist/utils/ids.js +6 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/normalize.d.ts +2 -0
- package/dist/{src/utils → utils}/normalize.js +4 -3
- package/dist/utils/orderBy.d.ts +2 -0
- package/dist/utils/responsive/Breakpoint.d.ts +9 -0
- package/dist/utils/responsive/Breakpoint.js +13 -0
- package/dist/utils/responsive/index.d.ts +2 -0
- package/dist/utils/responsive/utilities.d.ts +3 -0
- package/dist/{src/utils → utils}/responsive/utilities.js +9 -6
- package/package.json +23 -13
- package/dist/react-datepicker/dist/react-datepicker.min.css.js +0 -3
- package/dist/react-toastify/dist/ReactToastify.min.css.js +0 -3
- package/dist/src/components/ActionBar/index.js +0 -40
- package/dist/src/components/Alert/index.js +0 -133
- package/dist/src/components/Avatar/index.js +0 -74
- package/dist/src/components/Badge/index.js +0 -116
- package/dist/src/components/Banner/assets/default-image-small.svg.js +0 -5
- package/dist/src/components/Banner/assets/default-image.svg.js +0 -5
- package/dist/src/components/Banner/index.js +0 -159
- package/dist/src/components/BarChart/Tooltip.js +0 -48
- package/dist/src/components/BarChart/index.js +0 -95
- package/dist/src/components/BarStack/index.js +0 -136
- package/dist/src/components/Breadcrumbs/index.js +0 -82
- package/dist/src/components/Bullet/index.js +0 -98
- package/dist/src/components/Button/index.js +0 -311
- package/dist/src/components/Card/index.js +0 -67
- package/dist/src/components/Carousel/index.js +0 -128
- package/dist/src/components/Checkbox/index.js +0 -316
- package/dist/src/components/CheckboxGroup/index.js +0 -143
- package/dist/src/components/CopyButton/index.js +0 -37
- package/dist/src/components/DateInput/index.js +0 -242
- package/dist/src/components/Dialog/Context.js +0 -12
- package/dist/src/components/Dialog/index.js +0 -88
- package/dist/src/components/Dialog/subComponents/Button.js +0 -21
- package/dist/src/components/Dialog/subComponents/Buttons.js +0 -14
- package/dist/src/components/Dialog/subComponents/CancelButton.js +0 -14
- package/dist/src/components/Dialog/subComponents/Stack.js +0 -11
- package/dist/src/components/Dialog/subComponents/Text.js +0 -12
- package/dist/src/components/EmptyState/index.js +0 -112
- package/dist/src/components/Expandable/index.js +0 -96
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +0 -38
- package/dist/src/components/GlobalAlert/index.js +0 -82
- package/dist/src/components/LineChart/CustomLegend.js +0 -138
- package/dist/src/components/LineChart/Tooltip.js +0 -43
- package/dist/src/components/LineChart/helpers.js +0 -40
- package/dist/src/components/LineChart/index.js +0 -131
- package/dist/src/components/Link/index.js +0 -147
- package/dist/src/components/List/Body.js +0 -16
- package/dist/src/components/List/Cell.js +0 -43
- package/dist/src/components/List/HeaderCell.js +0 -90
- package/dist/src/components/List/HeaderRow.js +0 -43
- package/dist/src/components/List/ListContext.js +0 -138
- package/dist/src/components/List/Row.js +0 -185
- package/dist/src/components/List/SelectBar.js +0 -48
- package/dist/src/components/List/SkeletonRows.js +0 -53
- package/dist/src/components/List/index.js +0 -75
- package/dist/src/components/Loader/index.js +0 -100
- package/dist/src/components/Menu/Item.js +0 -112
- package/dist/src/components/Menu/index.js +0 -129
- package/dist/src/components/MenuV2/Group.js +0 -25
- package/dist/src/components/MenuV2/Item.js +0 -139
- package/dist/src/components/MenuV2/index.js +0 -116
- package/dist/src/components/Meter/index.js +0 -76
- package/dist/src/components/Modal/Dialog.js +0 -182
- package/dist/src/components/Modal/index.js +0 -113
- package/dist/src/components/Notice/index.js +0 -34
- package/dist/src/components/Notification/index.js +0 -77
- package/dist/src/components/NumberInput/index.js +0 -299
- package/dist/src/components/NumberInputV2/index.js +0 -284
- package/dist/src/components/Pagination/index.js +0 -117
- package/dist/src/components/PasswordCheck/index.js +0 -41
- package/dist/src/components/PasswordStrengthMeter/index.js +0 -102
- package/dist/src/components/PieChart/Legends.js +0 -138
- package/dist/src/components/PieChart/Tooltip.js +0 -61
- package/dist/src/components/PieChart/index.js +0 -125
- package/dist/src/components/Popover/index.js +0 -144
- package/dist/src/components/Popup/helpers.js +0 -252
- package/dist/src/components/Popup/index.js +0 -363
- package/dist/src/components/ProgressBar/index.js +0 -57
- package/dist/src/components/Radio/index.js +0 -157
- package/dist/src/components/RadioGroup/index.js +0 -131
- package/dist/src/components/Row/index.js +0 -41
- package/dist/src/components/SelectInput/index.js +0 -610
- package/dist/src/components/SelectInputV2/Dropdown.js +0 -594
- package/dist/src/components/SelectInputV2/DropdownOption.js +0 -130
- package/dist/src/components/SelectInputV2/SearchBarDropdown.js +0 -128
- package/dist/src/components/SelectInputV2/SelectBar.js +0 -282
- package/dist/src/components/SelectInputV2/SelectInputProvider.js +0 -169
- package/dist/src/components/SelectInputV2/findOptionInOptions.js +0 -11
- package/dist/src/components/SelectInputV2/index.js +0 -137
- package/dist/src/components/SelectableCard/index.js +0 -175
- package/dist/src/components/SelectableCardGroup/index.js +0 -141
- package/dist/src/components/Separator/index.js +0 -73
- package/dist/src/components/Skeleton/Block.js +0 -35
- package/dist/src/components/Skeleton/Blocks.js +0 -34
- package/dist/src/components/Skeleton/BoxWithIcon.js +0 -32
- package/dist/src/components/Skeleton/Donut.js +0 -55
- package/dist/src/components/Skeleton/IconSkeleton.js +0 -19
- package/dist/src/components/Skeleton/Line.js +0 -13
- package/dist/src/components/Skeleton/List.js +0 -51
- package/dist/src/components/Skeleton/Slider.js +0 -36
- package/dist/src/components/Skeleton/Square.js +0 -9
- package/dist/src/components/Skeleton/index.js +0 -82
- package/dist/src/components/Snippet/index.js +0 -200
- package/dist/src/components/Stack/index.js +0 -29
- package/dist/src/components/Status/index.js +0 -74
- package/dist/src/components/StepList/index.js +0 -69
- package/dist/src/components/Stepper/index.js +0 -150
- package/dist/src/components/SwitchButton/FocusOverlay.js +0 -37
- package/dist/src/components/SwitchButton/index.js +0 -108
- package/dist/src/components/Table/Body.js +0 -9
- package/dist/src/components/Table/Cell.js +0 -21
- package/dist/src/components/Table/Header.js +0 -15
- package/dist/src/components/Table/HeaderCell.js +0 -103
- package/dist/src/components/Table/HeaderRow.js +0 -32
- package/dist/src/components/Table/Row.js +0 -89
- package/dist/src/components/Table/SelectBar.js +0 -48
- package/dist/src/components/Table/SkeletonRows.js +0 -51
- package/dist/src/components/Table/TableContext.js +0 -90
- package/dist/src/components/Table/index.js +0 -82
- package/dist/src/components/Tabs/Tab.js +0 -138
- package/dist/src/components/Tabs/TabMenu.js +0 -59
- package/dist/src/components/Tabs/TabMenuItem.js +0 -36
- package/dist/src/components/Tabs/TabsContext.js +0 -6
- package/dist/src/components/Tabs/index.js +0 -117
- package/dist/src/components/Tag/index.js +0 -169
- package/dist/src/components/TagInput/index.js +0 -309
- package/dist/src/components/TagList/index.js +0 -106
- package/dist/src/components/Text/index.js +0 -107
- package/dist/src/components/TextArea/index.js +0 -210
- package/dist/src/components/TextInput/index.js +0 -451
- package/dist/src/components/TextInputV2/index.js +0 -289
- package/dist/src/components/TimeInput/index.js +0 -37
- package/dist/src/components/Toaster/index.js +0 -131
- package/dist/src/components/Toggle/index.js +0 -160
- package/dist/src/components/ToggleGroup/index.js +0 -122
- package/dist/src/components/Tooltip/index.js +0 -55
- package/dist/src/components/VerificationCode/index.js +0 -222
- package/dist/src/helpers/legend.js +0 -13
- package/dist/src/helpers/recursivelyGetChildrenString.js +0 -11
- package/dist/src/hooks/useIsOverflowing.js +0 -34
- package/dist/src/index.js +0 -77
- package/dist/src/theme/index.js +0 -29
- package/dist/src/utils/capitalize.js +0 -3
- package/dist/src/utils/ids.js +0 -7
- package/dist/src/utils/responsive/Breakpoint.js +0 -12
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext, useMemo, useState, useReducer, useContext } from "react";
|
|
3
|
+
const SelectInputContext = createContext({
|
|
4
|
+
options: [],
|
|
5
|
+
multiselect: false,
|
|
6
|
+
onSearch: () => {
|
|
7
|
+
},
|
|
8
|
+
isDropdownVisible: false,
|
|
9
|
+
setIsDropdownVisible: () => {
|
|
10
|
+
},
|
|
11
|
+
searchInput: "",
|
|
12
|
+
setSearchInput: () => {
|
|
13
|
+
},
|
|
14
|
+
selectAll: { label: "" },
|
|
15
|
+
selectAllGroup: false,
|
|
16
|
+
numberOfOptions: 0,
|
|
17
|
+
displayedOptions: [],
|
|
18
|
+
selectedData: { allSelected: false, selectedGroups: [], selectedValues: [] },
|
|
19
|
+
setSelectedData: () => {
|
|
20
|
+
},
|
|
21
|
+
onChange: () => {
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const useSelectInput = () => useContext(SelectInputContext);
|
|
25
|
+
const SelectInputProvider = ({
|
|
26
|
+
options,
|
|
27
|
+
multiselect,
|
|
28
|
+
selectAll,
|
|
29
|
+
value,
|
|
30
|
+
selectAllGroup,
|
|
31
|
+
numberOfOptions,
|
|
32
|
+
children,
|
|
33
|
+
onChange
|
|
34
|
+
}) => {
|
|
35
|
+
const currentValue = useMemo(() => {
|
|
36
|
+
if (value) {
|
|
37
|
+
if (Array.isArray(value)) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
return [value];
|
|
41
|
+
}
|
|
42
|
+
return [];
|
|
43
|
+
}, [value]);
|
|
44
|
+
const selectedGroups = useMemo(() => {
|
|
45
|
+
if (Array.isArray(options)) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
return Object.keys(options).filter(
|
|
49
|
+
(group) => options[group].every(
|
|
50
|
+
(groupOption) => currentValue.includes(groupOption.value)
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
}, [currentValue, options]);
|
|
54
|
+
const [displayedOptions, setDisplayedOptions] = useState(options);
|
|
55
|
+
const [isDropdownVisible, setIsDropdownVisible] = useState(false);
|
|
56
|
+
const [searchInput, setSearchInput] = useState("");
|
|
57
|
+
const allValues = useMemo(() => {
|
|
58
|
+
if (!Array.isArray(options)) {
|
|
59
|
+
return Object.keys(options).map(
|
|
60
|
+
(group) => options[group].filter((option) => !option.disabled)
|
|
61
|
+
).flat();
|
|
62
|
+
}
|
|
63
|
+
return options;
|
|
64
|
+
}, [options]);
|
|
65
|
+
const allGroups = useMemo(() => {
|
|
66
|
+
if (!Array.isArray(options)) {
|
|
67
|
+
return Object.keys(options);
|
|
68
|
+
}
|
|
69
|
+
return [];
|
|
70
|
+
}, [options]);
|
|
71
|
+
const reducer = (state, action) => {
|
|
72
|
+
switch (action.type) {
|
|
73
|
+
case "selectAll":
|
|
74
|
+
if (state.allSelected) {
|
|
75
|
+
return { selectedValues: [], allSelected: false, selectedGroups: [] };
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
selectedValues: allValues.map((option) => option.value),
|
|
79
|
+
allSelected: true,
|
|
80
|
+
selectedGroups: allGroups
|
|
81
|
+
};
|
|
82
|
+
case "selectGroup":
|
|
83
|
+
if (!Array.isArray(options)) {
|
|
84
|
+
if (state.selectedGroups.includes(action.selectedGroup)) {
|
|
85
|
+
return {
|
|
86
|
+
selectedValues: [...state.selectedValues].filter(
|
|
87
|
+
(selectedValue) => !options[action.selectedGroup].find(
|
|
88
|
+
(option) => option.value === selectedValue
|
|
89
|
+
)
|
|
90
|
+
),
|
|
91
|
+
allSelected: false,
|
|
92
|
+
selectedGroups: state.selectedGroups.filter(
|
|
93
|
+
(selectedGroup) => selectedGroup !== action.selectedGroup
|
|
94
|
+
)
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const newSelectedValues = [...state.selectedValues];
|
|
98
|
+
options[action.selectedGroup].map(
|
|
99
|
+
(option) => newSelectedValues.find((aValue) => aValue === option.value) || option.disabled ? null : newSelectedValues.push(option.value)
|
|
100
|
+
);
|
|
101
|
+
return {
|
|
102
|
+
selectedValues: newSelectedValues,
|
|
103
|
+
allSelected: newSelectedValues.length === numberOfOptions,
|
|
104
|
+
selectedGroups: [...state.selectedGroups, action.selectedGroup]
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return state;
|
|
108
|
+
case "selectOption":
|
|
109
|
+
if (multiselect) {
|
|
110
|
+
if (state.selectedValues.includes(action.clickedOption.value)) {
|
|
111
|
+
return {
|
|
112
|
+
selectedValues: state.selectedValues.filter(
|
|
113
|
+
(val) => val !== action.clickedOption.value
|
|
114
|
+
),
|
|
115
|
+
allSelected: false,
|
|
116
|
+
selectedGroups: action.group && state.selectedGroups.includes(action.group) ? state.selectedGroups.filter(
|
|
117
|
+
(selectedGroup) => selectedGroup !== action.group
|
|
118
|
+
) : []
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
selectedValues: [
|
|
123
|
+
...state.selectedValues,
|
|
124
|
+
action.clickedOption.value
|
|
125
|
+
],
|
|
126
|
+
allSelected: state.selectedValues.length + 1 === numberOfOptions,
|
|
127
|
+
selectedGroups: !Array.isArray(options) && action.group && options[action.group].every(
|
|
128
|
+
(option) => [
|
|
129
|
+
...state.selectedValues,
|
|
130
|
+
action.clickedOption.value
|
|
131
|
+
].includes(option.value) || option.disabled
|
|
132
|
+
) ? [...state.selectedGroups, action.group] : state.selectedGroups
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
selectedValues: [action.clickedOption.value],
|
|
137
|
+
allSelected: false,
|
|
138
|
+
selectedGroups: state.selectedGroups
|
|
139
|
+
};
|
|
140
|
+
case "clearAll":
|
|
141
|
+
return { selectedGroups: [], selectedValues: [], allSelected: false };
|
|
142
|
+
case "update":
|
|
143
|
+
return {
|
|
144
|
+
selectedGroups: state.selectedGroups,
|
|
145
|
+
allSelected: state.allSelected,
|
|
146
|
+
selectedValues: state.selectedValues.filter((selectedValue) => {
|
|
147
|
+
if (!Array.isArray(options)) {
|
|
148
|
+
return Object.keys(options).some(
|
|
149
|
+
(group) => options[group].some(
|
|
150
|
+
(option) => option.value === selectedValue && !option.disabled
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return options.some(
|
|
155
|
+
(option) => option.value === selectedValue && !option.disabled
|
|
156
|
+
);
|
|
157
|
+
})
|
|
158
|
+
};
|
|
159
|
+
default:
|
|
160
|
+
return state;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const [selectedData, setSelectedData] = useReducer(reducer, {
|
|
164
|
+
selectedValues: currentValue,
|
|
165
|
+
allSelected: false,
|
|
166
|
+
selectedGroups
|
|
167
|
+
});
|
|
168
|
+
const providerValue = useMemo(
|
|
169
|
+
() => ({
|
|
170
|
+
onSearch: setDisplayedOptions,
|
|
171
|
+
isDropdownVisible,
|
|
172
|
+
setIsDropdownVisible,
|
|
173
|
+
searchInput,
|
|
174
|
+
setSearchInput,
|
|
175
|
+
options,
|
|
176
|
+
multiselect,
|
|
177
|
+
selectAll,
|
|
178
|
+
selectAllGroup,
|
|
179
|
+
numberOfOptions,
|
|
180
|
+
displayedOptions,
|
|
181
|
+
selectedData,
|
|
182
|
+
setSelectedData,
|
|
183
|
+
onChange
|
|
184
|
+
}),
|
|
185
|
+
[
|
|
186
|
+
displayedOptions,
|
|
187
|
+
isDropdownVisible,
|
|
188
|
+
multiselect,
|
|
189
|
+
numberOfOptions,
|
|
190
|
+
options,
|
|
191
|
+
searchInput,
|
|
192
|
+
selectAll,
|
|
193
|
+
selectAllGroup,
|
|
194
|
+
selectedData,
|
|
195
|
+
onChange
|
|
196
|
+
]
|
|
197
|
+
);
|
|
198
|
+
return /* @__PURE__ */ jsx(SelectInputContext.Provider, { value: providerValue, children });
|
|
199
|
+
};
|
|
200
|
+
export {
|
|
201
|
+
SelectInputProvider,
|
|
202
|
+
useSelectInput
|
|
203
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const findOptionInOptions = (options, optionValue) => {
|
|
2
|
+
let flatOptions = [];
|
|
3
|
+
if (!Array.isArray(options)) {
|
|
4
|
+
flatOptions = Object.keys(options).map((group) => options[group]).flat();
|
|
5
|
+
} else {
|
|
6
|
+
flatOptions = options;
|
|
7
|
+
}
|
|
8
|
+
return flatOptions.find((option) => option.value === optionValue);
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
findOptionInOptions
|
|
12
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { DataType } from './types';
|
|
3
|
+
type SelectInputV2Props<IsMulti extends undefined | boolean = false> = {
|
|
4
|
+
/**
|
|
5
|
+
* Input name
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Place holder when no value defined
|
|
10
|
+
*/
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/**
|
|
13
|
+
* When searchable, placeholder when no value is searched
|
|
14
|
+
*/
|
|
15
|
+
placeholderSearch?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Label of the component
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Helper text to give more information to the user
|
|
22
|
+
*/
|
|
23
|
+
helper?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Selectable options
|
|
26
|
+
*/
|
|
27
|
+
options: DataType;
|
|
28
|
+
/**
|
|
29
|
+
* Message to show when no option available
|
|
30
|
+
*/
|
|
31
|
+
emptyState?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Whether it is possible to search through the input
|
|
34
|
+
*/
|
|
35
|
+
searchable?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the component in disabled
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the component in readOnly
|
|
42
|
+
*/
|
|
43
|
+
readOnly?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether it is possible to clear the search input
|
|
46
|
+
*/
|
|
47
|
+
clearable?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Size of the input
|
|
50
|
+
*/
|
|
51
|
+
size?: 'small' | 'medium' | 'large';
|
|
52
|
+
/**
|
|
53
|
+
* Whether field is required
|
|
54
|
+
*/
|
|
55
|
+
required?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* More information regarding/description ofs the selectInput
|
|
58
|
+
*/
|
|
59
|
+
labelDescription?: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Whether option description is on the right of the option or under it
|
|
62
|
+
*/
|
|
63
|
+
descriptionDirection?: 'row' | 'column';
|
|
64
|
+
/**
|
|
65
|
+
* Where to place the additional info prop
|
|
66
|
+
*/
|
|
67
|
+
optionalInfoPlacement?: 'left' | 'right';
|
|
68
|
+
/**
|
|
69
|
+
* To add custom fixed elements at the bottom of the dropdown
|
|
70
|
+
*/
|
|
71
|
+
footer?: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Display an error message under the select bar
|
|
74
|
+
*/
|
|
75
|
+
error?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Display a success message under the select bar
|
|
78
|
+
*/
|
|
79
|
+
success?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Load more button to implement lazy loading
|
|
82
|
+
*/
|
|
83
|
+
loadMore?: ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* When the options are loading, display a skeleton
|
|
86
|
+
*/
|
|
87
|
+
isLoading?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Adds an option to select every selectable options
|
|
90
|
+
*/
|
|
91
|
+
selectAll?: {
|
|
92
|
+
label: ReactNode;
|
|
93
|
+
description?: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* When options are group, define a option to select every selectable options of a group
|
|
97
|
+
*/
|
|
98
|
+
selectAllGroup?: boolean;
|
|
99
|
+
autofocus?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Whether it is possible to select multiple options
|
|
102
|
+
*/
|
|
103
|
+
multiselect?: IsMulti;
|
|
104
|
+
/**
|
|
105
|
+
* Default value, must be one of the options
|
|
106
|
+
*/
|
|
107
|
+
value?: IsMulti extends true ? string[] : string;
|
|
108
|
+
onChange?: IsMulti extends true ? (value: string[]) => void : (value: string) => void;
|
|
109
|
+
'data-testid'?: string;
|
|
110
|
+
} & Pick<HTMLAttributes<HTMLDivElement>, 'id' | 'onBlur' | 'onFocus' | 'aria-label' | 'className'>;
|
|
111
|
+
/**
|
|
112
|
+
* SelectInputV2 component is used to select one or many elements from a selection.
|
|
113
|
+
*/
|
|
114
|
+
export declare const SelectInputV2: <IsMulti extends boolean | undefined>({ name, id, onBlur, onFocus, onChange, "aria-label": ariaLabel, value, label, helper, options, size, emptyState, descriptionDirection, success, error, "data-testid": dataTestId, className, footer, placeholderSearch, placeholder, searchable, disabled, readOnly, clearable, multiselect, required, labelDescription, autofocus, loadMore, optionalInfoPlacement, isLoading, selectAll, selectAllGroup, }: SelectInputV2Props<IsMulti>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
115
|
+
export {};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Icon } from "@ultraviolet/icons";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { Stack } from "../Stack/index.js";
|
|
6
|
+
import { Text } from "../Text/index.js";
|
|
7
|
+
import { Dropdown } from "./Dropdown.js";
|
|
8
|
+
import { SelectBar } from "./SelectBar.js";
|
|
9
|
+
import { SelectInputProvider } from "./SelectInputProvider.js";
|
|
10
|
+
const SelectInputContainer = styled.div`
|
|
11
|
+
width: 100%;
|
|
12
|
+
`;
|
|
13
|
+
const HelperText = styled(Text)`
|
|
14
|
+
padding-top: ${({ theme }) => theme.space["0.5"]};
|
|
15
|
+
`;
|
|
16
|
+
const SelectInputV2 = ({
|
|
17
|
+
name,
|
|
18
|
+
id,
|
|
19
|
+
onBlur,
|
|
20
|
+
onFocus,
|
|
21
|
+
onChange,
|
|
22
|
+
"aria-label": ariaLabel,
|
|
23
|
+
value,
|
|
24
|
+
label,
|
|
25
|
+
helper,
|
|
26
|
+
options,
|
|
27
|
+
size = "large",
|
|
28
|
+
emptyState,
|
|
29
|
+
descriptionDirection = "column",
|
|
30
|
+
success,
|
|
31
|
+
error,
|
|
32
|
+
"data-testid": dataTestId,
|
|
33
|
+
className,
|
|
34
|
+
footer,
|
|
35
|
+
placeholderSearch = "Search in list",
|
|
36
|
+
placeholder = "Select item",
|
|
37
|
+
searchable = true,
|
|
38
|
+
disabled = false,
|
|
39
|
+
readOnly = false,
|
|
40
|
+
clearable = true,
|
|
41
|
+
multiselect = false,
|
|
42
|
+
required = false,
|
|
43
|
+
labelDescription,
|
|
44
|
+
autofocus,
|
|
45
|
+
loadMore,
|
|
46
|
+
optionalInfoPlacement = "right",
|
|
47
|
+
isLoading,
|
|
48
|
+
selectAll,
|
|
49
|
+
selectAllGroup = false
|
|
50
|
+
}) => {
|
|
51
|
+
const ref = useRef(null);
|
|
52
|
+
const numberOfOptions = Array.isArray(options) ? options.length : Object.values(options).reduce(
|
|
53
|
+
(acc, current) => acc + current.filter((option) => !option.disabled).length,
|
|
54
|
+
0
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
SelectInputProvider,
|
|
58
|
+
{
|
|
59
|
+
options,
|
|
60
|
+
multiselect,
|
|
61
|
+
selectAll,
|
|
62
|
+
value,
|
|
63
|
+
selectAllGroup,
|
|
64
|
+
numberOfOptions,
|
|
65
|
+
onChange,
|
|
66
|
+
children: /* @__PURE__ */ jsxs(
|
|
67
|
+
SelectInputContainer,
|
|
68
|
+
{
|
|
69
|
+
id,
|
|
70
|
+
onBlur,
|
|
71
|
+
onFocus,
|
|
72
|
+
"data-testid": dataTestId,
|
|
73
|
+
className,
|
|
74
|
+
"aria-label": name,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
Dropdown,
|
|
78
|
+
{
|
|
79
|
+
emptyState,
|
|
80
|
+
descriptionDirection,
|
|
81
|
+
searchable,
|
|
82
|
+
placeholder: placeholderSearch,
|
|
83
|
+
footer,
|
|
84
|
+
refSelect: ref,
|
|
85
|
+
loadMore,
|
|
86
|
+
optionalInfoPlacement,
|
|
87
|
+
isLoading,
|
|
88
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: 0.5, "aria-label": ariaLabel, children: [
|
|
89
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", gap: 0.5, children: [
|
|
90
|
+
label ? /* @__PURE__ */ jsx(
|
|
91
|
+
Text,
|
|
92
|
+
{
|
|
93
|
+
as: "label",
|
|
94
|
+
variant: size === "large" ? "bodyStrong" : "bodySmallStrong",
|
|
95
|
+
children: label
|
|
96
|
+
}
|
|
97
|
+
) : null,
|
|
98
|
+
required && label ? /* @__PURE__ */ jsx(Icon, { name: "asterisk", sentiment: "danger", size: 8 }) : null,
|
|
99
|
+
labelDescription ?? null
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
SelectBar,
|
|
103
|
+
{
|
|
104
|
+
size,
|
|
105
|
+
clearable,
|
|
106
|
+
readOnly,
|
|
107
|
+
disabled,
|
|
108
|
+
placeholder,
|
|
109
|
+
success,
|
|
110
|
+
error,
|
|
111
|
+
autoFocus: autofocus,
|
|
112
|
+
innerRef: ref
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] })
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
!error && !success ? /* @__PURE__ */ jsx(
|
|
119
|
+
HelperText,
|
|
120
|
+
{
|
|
121
|
+
variant: "caption",
|
|
122
|
+
as: "p",
|
|
123
|
+
sentiment: "neutral",
|
|
124
|
+
prominence: "default",
|
|
125
|
+
children: helper
|
|
126
|
+
}
|
|
127
|
+
) : null,
|
|
128
|
+
error || success ? /* @__PURE__ */ jsx(
|
|
129
|
+
HelperText,
|
|
130
|
+
{
|
|
131
|
+
variant: "caption",
|
|
132
|
+
as: "p",
|
|
133
|
+
sentiment: error ? "danger" : "success",
|
|
134
|
+
prominence: "default",
|
|
135
|
+
children: error || success
|
|
136
|
+
}
|
|
137
|
+
) : null
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
SelectInputV2
|
|
146
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type OptionType = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
description?: string;
|
|
7
|
+
optionalInfo?: ReactNode;
|
|
8
|
+
searchText?: string;
|
|
9
|
+
};
|
|
10
|
+
export type DataType = Record<string, OptionType[]> | OptionType[];
|
|
11
|
+
export type ReducerState = {
|
|
12
|
+
selectedValues: string[];
|
|
13
|
+
allSelected: boolean;
|
|
14
|
+
selectedGroups: string[];
|
|
15
|
+
};
|
|
16
|
+
export type ReducerAction = {
|
|
17
|
+
type: 'selectAll';
|
|
18
|
+
} | {
|
|
19
|
+
type: 'selectGroup';
|
|
20
|
+
selectedGroup: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'selectOption';
|
|
23
|
+
clickedOption: OptionType;
|
|
24
|
+
group?: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'clearAll';
|
|
27
|
+
} | {
|
|
28
|
+
type: 'update';
|
|
29
|
+
};
|
|
30
|
+
export declare const INPUT_SIZE_HEIGHT: {
|
|
31
|
+
readonly large: 48;
|
|
32
|
+
readonly medium: 40;
|
|
33
|
+
readonly small: 32;
|
|
34
|
+
};
|
|
35
|
+
export declare const SIZES_TAG: {
|
|
36
|
+
readonly letterWidth: 5;
|
|
37
|
+
readonly tagWidth: 72;
|
|
38
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ChangeEventHandler, FocusEventHandler, ReactNode } from 'react';
|
|
2
|
+
type SelectableCardProps = {
|
|
3
|
+
name?: string;
|
|
4
|
+
children?: (({ disabled, checked, }: Pick<SelectableCardProps, 'checked' | 'disabled'>) => ReactNode) | ReactNode;
|
|
5
|
+
value: string | number;
|
|
6
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
7
|
+
showTick?: boolean;
|
|
8
|
+
type?: 'radio' | 'checkbox';
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
isError?: boolean;
|
|
13
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
14
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
15
|
+
id?: string;
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* SelectableCard is a component that can be used to create a radio or checkbox card.
|
|
22
|
+
* It can be used to create a list of selectable items or a single selectable item.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SelectableCard: import("react").ForwardRefExoticComponent<SelectableCardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export {};
|