@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,563 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { css, useTheme } from "@emotion/react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { Icon } from "@ultraviolet/icons";
|
|
5
|
+
import React, { forwardRef, useState, useId, useMemo, Children, useEffect } from "react";
|
|
6
|
+
import Select, { components } from "react-select";
|
|
7
|
+
import isJSONString from "../../helpers/isJSON.js";
|
|
8
|
+
import * as animations from "../../utils/animations.js";
|
|
9
|
+
import { Expandable } from "../Expandable/index.js";
|
|
10
|
+
import { Separator } from "../Separator/index.js";
|
|
11
|
+
import { Stack } from "../Stack/index.js";
|
|
12
|
+
import { Text } from "../Text/index.js";
|
|
13
|
+
const StyledSeparator = styled(Separator)`
|
|
14
|
+
background-color: ${({ theme }) => theme.colors.neutral.border};
|
|
15
|
+
height: 100%;
|
|
16
|
+
`;
|
|
17
|
+
const getControlColor = ({ state, error, theme }) => {
|
|
18
|
+
if (state.isDisabled)
|
|
19
|
+
return theme.colors.neutral.textDisabled;
|
|
20
|
+
if (error)
|
|
21
|
+
return theme.colors.danger.text;
|
|
22
|
+
return theme.colors.neutral.text;
|
|
23
|
+
};
|
|
24
|
+
const getPlaceholderColor = ({
|
|
25
|
+
state,
|
|
26
|
+
error,
|
|
27
|
+
theme
|
|
28
|
+
}) => {
|
|
29
|
+
if (state.isDisabled)
|
|
30
|
+
return theme.colors.neutral.textDisabled;
|
|
31
|
+
if (error)
|
|
32
|
+
return theme.colors.danger.text;
|
|
33
|
+
return theme.colors.neutral.textWeak;
|
|
34
|
+
};
|
|
35
|
+
const getOptionColor = ({ state, theme }) => {
|
|
36
|
+
let color = theme.colors.neutral.text;
|
|
37
|
+
let backgroundColor = theme.colors.neutral.backgroundWeakElevated;
|
|
38
|
+
if (state.isDisabled) {
|
|
39
|
+
backgroundColor = theme.colors.neutral.backgroundDisabled;
|
|
40
|
+
color = theme.colors.neutral.textDisabled;
|
|
41
|
+
} else if (state.isSelected) {
|
|
42
|
+
backgroundColor = theme.colors.primary.backgroundStrong;
|
|
43
|
+
color = theme.colors.primary.textStrong;
|
|
44
|
+
} else if (state.isFocused) {
|
|
45
|
+
backgroundColor = theme.colors.primary.background;
|
|
46
|
+
}
|
|
47
|
+
return { backgroundColor, color };
|
|
48
|
+
};
|
|
49
|
+
const getSelectStyles = ({
|
|
50
|
+
error,
|
|
51
|
+
customStyle,
|
|
52
|
+
animation,
|
|
53
|
+
animationDuration,
|
|
54
|
+
noTopLabel,
|
|
55
|
+
theme
|
|
56
|
+
}) => ({
|
|
57
|
+
control: (provided, state) => ({
|
|
58
|
+
...provided,
|
|
59
|
+
backgroundColor: state.isDisabled ? theme.colors.neutral.backgroundDisabled : theme.colors.neutral.background,
|
|
60
|
+
borderColor: error ? theme.colors.danger.border : theme.colors.neutral.border,
|
|
61
|
+
borderRadius: "4px",
|
|
62
|
+
borderStyle: "solid",
|
|
63
|
+
borderWidth: "1px",
|
|
64
|
+
boxShadow: "none",
|
|
65
|
+
color: getControlColor({ error, state, theme }),
|
|
66
|
+
fontSize: "16px",
|
|
67
|
+
fontWeight: 500,
|
|
68
|
+
lineHeight: "24px",
|
|
69
|
+
minHeight: "48px",
|
|
70
|
+
transition: "border-color 200ms ease, box-shadow 200ms ease",
|
|
71
|
+
cursor: state.isDisabled ? "not-allowed" : "pointer",
|
|
72
|
+
...!state.isDisabled && {
|
|
73
|
+
":focus-within": {
|
|
74
|
+
borderColor: error ? theme.colors.danger.border : theme.colors.primary.border,
|
|
75
|
+
boxShadow: error ? theme.shadows.focusDanger : theme.shadows.focusPrimary
|
|
76
|
+
},
|
|
77
|
+
":hover": {
|
|
78
|
+
borderColor: error ? theme.colors.danger.borderHover : theme.colors.primary.borderHover
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
...customStyle(state)?.["control"] || {},
|
|
82
|
+
animation: animation ? `${animationDuration}ms ${animations[animation]}` : "none"
|
|
83
|
+
}),
|
|
84
|
+
indicatorsContainer: (provided) => ({
|
|
85
|
+
...provided,
|
|
86
|
+
maxHeight: "48px"
|
|
87
|
+
}),
|
|
88
|
+
indicatorSeparator: (provided, state) => ({
|
|
89
|
+
...provided,
|
|
90
|
+
backgroundColor: theme.colors.neutral.border,
|
|
91
|
+
display: "none",
|
|
92
|
+
...customStyle(state)?.["indicatorSeparator"] || {}
|
|
93
|
+
}),
|
|
94
|
+
input: (provided) => ({
|
|
95
|
+
...provided,
|
|
96
|
+
flexGrow: 1,
|
|
97
|
+
marginLeft: 0,
|
|
98
|
+
paddingTop: noTopLabel ? 0 : 11
|
|
99
|
+
}),
|
|
100
|
+
menu: (provided, state) => ({
|
|
101
|
+
...provided,
|
|
102
|
+
...customStyle(state)?.["menu"] || {},
|
|
103
|
+
boxShadow: theme.shadows.menu
|
|
104
|
+
}),
|
|
105
|
+
menuList: (provided, state) => ({
|
|
106
|
+
...provided,
|
|
107
|
+
backgroundColor: theme.colors.neutral.backgroundWeak,
|
|
108
|
+
maxHeight: "225px",
|
|
109
|
+
...customStyle(state)?.["menuList"] || {}
|
|
110
|
+
}),
|
|
111
|
+
menuPortal: (provided, state) => ({
|
|
112
|
+
...provided,
|
|
113
|
+
zIndex: 1e4,
|
|
114
|
+
...customStyle(state)?.["menuPortal"] || {}
|
|
115
|
+
}),
|
|
116
|
+
multiValue: (provided, state) => ({
|
|
117
|
+
...provided,
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
backgroundColor: theme.colors.neutral.backgroundDisabled,
|
|
120
|
+
borderRadius: "4px",
|
|
121
|
+
color: theme.colors.neutral.text,
|
|
122
|
+
fontSize: "14px",
|
|
123
|
+
fontWeight: 500,
|
|
124
|
+
height: "24px",
|
|
125
|
+
justifyContent: "center",
|
|
126
|
+
marginTop: theme.space[noTopLabel ? "0.5" : "2"],
|
|
127
|
+
textOverflow: "ellipsis",
|
|
128
|
+
...customStyle(state)?.["multiValue"] || {}
|
|
129
|
+
}),
|
|
130
|
+
multiValueLabel: (provided, state) => ({
|
|
131
|
+
...provided,
|
|
132
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text,
|
|
133
|
+
fontSize: "14px",
|
|
134
|
+
fontWeight: "normal",
|
|
135
|
+
lineHeight: "20px",
|
|
136
|
+
...customStyle(state)?.["multiValueLabel"] || {}
|
|
137
|
+
}),
|
|
138
|
+
multiValueRemove: (provided, state) => ({
|
|
139
|
+
...provided,
|
|
140
|
+
...state.isDisabled ? {
|
|
141
|
+
color: theme.colors.neutral.textDisabled,
|
|
142
|
+
cursor: "none",
|
|
143
|
+
pointerEvents: "none"
|
|
144
|
+
} : {
|
|
145
|
+
color: theme.colors.primary.text
|
|
146
|
+
},
|
|
147
|
+
":hover": {
|
|
148
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.primary.text,
|
|
149
|
+
cursor: state.isDisabled ? "none" : "pointer",
|
|
150
|
+
pointerEvents: state.isDisabled ? "none" : "fill"
|
|
151
|
+
},
|
|
152
|
+
...customStyle(state)?.["multiValueRemove"] || {}
|
|
153
|
+
}),
|
|
154
|
+
option: (provided, state) => ({
|
|
155
|
+
...provided,
|
|
156
|
+
...getOptionColor({ state, theme }),
|
|
157
|
+
cursor: state.isDisabled ? "not-allowed" : "pointer",
|
|
158
|
+
":active": {
|
|
159
|
+
backgroundColor: state.isDisabled ? theme.colors.neutral.backgroundDisabled : theme.colors.primary.background,
|
|
160
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.primary.text
|
|
161
|
+
},
|
|
162
|
+
":hover": {
|
|
163
|
+
backgroundColor: state.isDisabled ? theme.colors.neutral.backgroundDisabled : theme.colors.primary.background,
|
|
164
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text
|
|
165
|
+
},
|
|
166
|
+
...customStyle(state)?.["option"] || {}
|
|
167
|
+
}),
|
|
168
|
+
placeholder: (provided, state) => ({
|
|
169
|
+
...provided,
|
|
170
|
+
color: getPlaceholderColor({ error, state, theme }),
|
|
171
|
+
...customStyle(state)?.["placeholder"] || {}
|
|
172
|
+
}),
|
|
173
|
+
singleValue: (provided, state) => ({
|
|
174
|
+
...provided,
|
|
175
|
+
color: state.isDisabled ? theme.colors.neutral.textDisabled : theme.colors.neutral.text,
|
|
176
|
+
marginLeft: state.hasValue ? 0 : void 0,
|
|
177
|
+
marginRight: state.hasValue ? 0 : void 0,
|
|
178
|
+
marginTop: !state.hasValue || noTopLabel ? 0 : "5px",
|
|
179
|
+
paddingLeft: state.hasValue ? 0 : void 0,
|
|
180
|
+
...customStyle(state)?.["singleValue"] || {}
|
|
181
|
+
}),
|
|
182
|
+
valueContainer: (provided, state) => ({
|
|
183
|
+
...provided,
|
|
184
|
+
...customStyle(state)?.["valueContainer"] || {},
|
|
185
|
+
cursor: state.isDisabled ? "not-allowed" : void 0,
|
|
186
|
+
height: "100%",
|
|
187
|
+
label: {
|
|
188
|
+
display: noTopLabel ? "none" : "initial"
|
|
189
|
+
},
|
|
190
|
+
paddingTop: 0
|
|
191
|
+
})
|
|
192
|
+
});
|
|
193
|
+
const StyledContainer = styled("div", {
|
|
194
|
+
shouldForwardProp: (prop) => !["isDisabled", "additionalStyles"].includes(prop)
|
|
195
|
+
})`
|
|
196
|
+
width: 100%;
|
|
197
|
+
${({ isDisabled }) => isDisabled && `pointer-events: initial;`};
|
|
198
|
+
${({ additionalStyles }) => css(additionalStyles)}
|
|
199
|
+
`;
|
|
200
|
+
const StyledError = styled.div`
|
|
201
|
+
font-size: 12px;
|
|
202
|
+
color: ${({ theme }) => theme.colors.danger.text};
|
|
203
|
+
padding-top: ${({ theme }) => theme.space["0.25"]};
|
|
204
|
+
`;
|
|
205
|
+
const SelectContainer = (props) => {
|
|
206
|
+
const {
|
|
207
|
+
children,
|
|
208
|
+
getStyles,
|
|
209
|
+
innerProps: { onKeyDown } = {},
|
|
210
|
+
isDisabled = false,
|
|
211
|
+
className,
|
|
212
|
+
selectProps: { name = "", error, className: selectPropsClassName } = {}
|
|
213
|
+
} = props;
|
|
214
|
+
return /* @__PURE__ */ jsxs(
|
|
215
|
+
StyledContainer,
|
|
216
|
+
{
|
|
217
|
+
"data-testid": `select-input-${name}`,
|
|
218
|
+
additionalStyles: getStyles?.("container", props),
|
|
219
|
+
isDisabled,
|
|
220
|
+
className: [className, selectPropsClassName].filter(Boolean).join(" "),
|
|
221
|
+
onKeyDown,
|
|
222
|
+
children: [
|
|
223
|
+
children,
|
|
224
|
+
/* @__PURE__ */ jsx(Expandable, { opened: !!error, children: /* @__PURE__ */ jsx(StyledError, { children: error }) })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
};
|
|
229
|
+
const StyledPlaceholder = styled("label", {
|
|
230
|
+
shouldForwardProp: (prop) => !["error", "hasValue", "isDisabled", "isMulti"].includes(prop)
|
|
231
|
+
})`
|
|
232
|
+
position: absolute;
|
|
233
|
+
left: 0;
|
|
234
|
+
font-weight: 400;
|
|
235
|
+
pointer-events: none;
|
|
236
|
+
color: ${({ theme, error }) => error ? theme.colors.danger.text : theme.colors.neutral.text};
|
|
237
|
+
white-space: nowrap;
|
|
238
|
+
width: 100%;
|
|
239
|
+
height: 100%;
|
|
240
|
+
font-size: 16px;
|
|
241
|
+
transition: transform 250ms ease;
|
|
242
|
+
opacity: 0;
|
|
243
|
+
${({ hasValue }) => hasValue && `
|
|
244
|
+
transform: translate(0, -8px) scale(0.8);
|
|
245
|
+
transform-origin: left;
|
|
246
|
+
padding-left: 8px;
|
|
247
|
+
left: 0;
|
|
248
|
+
top: 2px;
|
|
249
|
+
opacity: 1;
|
|
250
|
+
`}
|
|
251
|
+
${({ isDisabled, hasValue }) => hasValue && isDisabled && "opacity: 0.5"}
|
|
252
|
+
`;
|
|
253
|
+
const StyledText = styled(Text)`
|
|
254
|
+
margin-left: ${({ theme }) => theme.space["1"]};
|
|
255
|
+
color: ${({ isSelectedAndNotFocused, theme }) => isSelectedAndNotFocused ? theme.colors.primary.textStrong : void 0};
|
|
256
|
+
`;
|
|
257
|
+
const MaxLineStyledText = styled(StyledText)`
|
|
258
|
+
-webkit-line-clamp: 3;
|
|
259
|
+
margin-top: ${({ theme }) => theme.space["2"]};
|
|
260
|
+
`;
|
|
261
|
+
const ValueContainer = ({
|
|
262
|
+
isDisabled,
|
|
263
|
+
children,
|
|
264
|
+
selectProps: { error, labelId, inputId, ...selectProps },
|
|
265
|
+
isMulti,
|
|
266
|
+
hasValue,
|
|
267
|
+
clearValue,
|
|
268
|
+
getStyles,
|
|
269
|
+
getValue,
|
|
270
|
+
getClassNames,
|
|
271
|
+
isRtl,
|
|
272
|
+
cx,
|
|
273
|
+
options,
|
|
274
|
+
selectOption,
|
|
275
|
+
setValue,
|
|
276
|
+
theme,
|
|
277
|
+
className,
|
|
278
|
+
innerProps
|
|
279
|
+
}) => /* @__PURE__ */ jsx(
|
|
280
|
+
components.ValueContainer,
|
|
281
|
+
{
|
|
282
|
+
clearValue,
|
|
283
|
+
getStyles,
|
|
284
|
+
getValue,
|
|
285
|
+
isRtl,
|
|
286
|
+
cx,
|
|
287
|
+
options,
|
|
288
|
+
selectOption,
|
|
289
|
+
setValue,
|
|
290
|
+
theme,
|
|
291
|
+
className,
|
|
292
|
+
innerProps,
|
|
293
|
+
selectProps,
|
|
294
|
+
isMulti,
|
|
295
|
+
hasValue,
|
|
296
|
+
isDisabled,
|
|
297
|
+
getClassNames,
|
|
298
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
299
|
+
selectProps.placeholder ? /* @__PURE__ */ jsx(
|
|
300
|
+
StyledPlaceholder,
|
|
301
|
+
{
|
|
302
|
+
as: "label",
|
|
303
|
+
id: labelId,
|
|
304
|
+
htmlFor: inputId,
|
|
305
|
+
"aria-live": "assertive",
|
|
306
|
+
error,
|
|
307
|
+
isMulti,
|
|
308
|
+
isDisabled,
|
|
309
|
+
hasValue,
|
|
310
|
+
children: selectProps.placeholder
|
|
311
|
+
}
|
|
312
|
+
) : null,
|
|
313
|
+
children
|
|
314
|
+
] })
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
const inputStyles = ({ isMulti }) => css`
|
|
318
|
+
margin-left: 0px;
|
|
319
|
+
${!isMulti && "caret-color: transparent"};
|
|
320
|
+
`;
|
|
321
|
+
const Input = ({
|
|
322
|
+
isMulti,
|
|
323
|
+
hasValue,
|
|
324
|
+
selectProps: { inputId, labelId, placeholder, ...selectProps },
|
|
325
|
+
clearValue,
|
|
326
|
+
getStyles,
|
|
327
|
+
getValue,
|
|
328
|
+
isRtl,
|
|
329
|
+
cx,
|
|
330
|
+
options,
|
|
331
|
+
selectOption,
|
|
332
|
+
setValue,
|
|
333
|
+
theme,
|
|
334
|
+
className,
|
|
335
|
+
isHidden,
|
|
336
|
+
...props
|
|
337
|
+
}) => /* @__PURE__ */ jsx(
|
|
338
|
+
components.Input,
|
|
339
|
+
{
|
|
340
|
+
...props,
|
|
341
|
+
css: inputStyles({ isMulti }),
|
|
342
|
+
id: inputId,
|
|
343
|
+
"aria-controls": labelId,
|
|
344
|
+
hasValue,
|
|
345
|
+
isMulti,
|
|
346
|
+
clearValue,
|
|
347
|
+
getStyles,
|
|
348
|
+
getValue,
|
|
349
|
+
isRtl,
|
|
350
|
+
cx,
|
|
351
|
+
options,
|
|
352
|
+
selectOption,
|
|
353
|
+
setValue,
|
|
354
|
+
theme,
|
|
355
|
+
className,
|
|
356
|
+
isHidden,
|
|
357
|
+
selectProps: { ...selectProps, placeholder }
|
|
358
|
+
}
|
|
359
|
+
);
|
|
360
|
+
const Option = ({
|
|
361
|
+
selectProps,
|
|
362
|
+
value,
|
|
363
|
+
label,
|
|
364
|
+
children,
|
|
365
|
+
data: { inlineDescription, description },
|
|
366
|
+
isSelected,
|
|
367
|
+
data,
|
|
368
|
+
...props
|
|
369
|
+
}) => {
|
|
370
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
371
|
+
return /* @__PURE__ */ jsx(
|
|
372
|
+
"div",
|
|
373
|
+
{
|
|
374
|
+
"data-testid": `option-${selectProps.name || ""}-${isJSONString(value) ? label : value}`,
|
|
375
|
+
onMouseOver: () => setIsFocused(true),
|
|
376
|
+
onFocus: () => setIsFocused(true),
|
|
377
|
+
onMouseOut: () => setIsFocused(false),
|
|
378
|
+
onBlur: () => setIsFocused(false),
|
|
379
|
+
children: /* @__PURE__ */ jsxs(
|
|
380
|
+
components.Option,
|
|
381
|
+
{
|
|
382
|
+
...props,
|
|
383
|
+
selectProps,
|
|
384
|
+
label,
|
|
385
|
+
data,
|
|
386
|
+
isSelected,
|
|
387
|
+
children: [
|
|
388
|
+
children,
|
|
389
|
+
inlineDescription ? /* @__PURE__ */ jsx(
|
|
390
|
+
StyledText,
|
|
391
|
+
{
|
|
392
|
+
as: "span",
|
|
393
|
+
variant: "bodySmall",
|
|
394
|
+
isSelectedAndNotFocused: isSelected && !isFocused,
|
|
395
|
+
children: inlineDescription
|
|
396
|
+
}
|
|
397
|
+
) : null,
|
|
398
|
+
description ? /* @__PURE__ */ jsx(
|
|
399
|
+
MaxLineStyledText,
|
|
400
|
+
{
|
|
401
|
+
as: "p",
|
|
402
|
+
variant: "bodySmall",
|
|
403
|
+
isSelectedAndNotFocused: isSelected && !isFocused,
|
|
404
|
+
children: description
|
|
405
|
+
}
|
|
406
|
+
) : null
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
);
|
|
412
|
+
};
|
|
413
|
+
const DropdownIndicator = (props) => {
|
|
414
|
+
const {
|
|
415
|
+
selectProps: { isDisabled, time, required }
|
|
416
|
+
} = props;
|
|
417
|
+
return /* @__PURE__ */ jsx(components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxs(Stack, { gap: 1, direction: "row", alignItems: "center", children: [
|
|
418
|
+
required ? /* @__PURE__ */ jsx(Icon, { name: "asterisk", size: 10, color: "danger" }) : null,
|
|
419
|
+
time ? /* @__PURE__ */ jsx(StyledSeparator, { direction: "vertical" }) : null,
|
|
420
|
+
/* @__PURE__ */ jsx(
|
|
421
|
+
Icon,
|
|
422
|
+
{
|
|
423
|
+
name: time ? "clock-outline" : "arrow-down",
|
|
424
|
+
size: time ? 24 : 16,
|
|
425
|
+
disabled: isDisabled
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
] }) });
|
|
429
|
+
};
|
|
430
|
+
const ClearIndicator = (props) => {
|
|
431
|
+
const {
|
|
432
|
+
selectProps: { checked, error },
|
|
433
|
+
innerProps: { ref, ...restInnerProps }
|
|
434
|
+
} = props;
|
|
435
|
+
return /* @__PURE__ */ jsx(components.ClearIndicator, { ...props, children: /* @__PURE__ */ jsx(
|
|
436
|
+
Icon,
|
|
437
|
+
{
|
|
438
|
+
...restInnerProps,
|
|
439
|
+
name: "close",
|
|
440
|
+
cursor: "pointer",
|
|
441
|
+
color: checked && "primary" || error && "danger" || "neutral"
|
|
442
|
+
}
|
|
443
|
+
) });
|
|
444
|
+
};
|
|
445
|
+
const MultiValueContainer = (props) => /* @__PURE__ */ jsx(components.MultiValueContainer, { ...props });
|
|
446
|
+
const MultiValueLabel = (props) => /* @__PURE__ */ jsx(components.MultiValueLabel, { ...props });
|
|
447
|
+
const MultiValueRemove = (props) => /* @__PURE__ */ jsx(components.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsx(Icon, { name: "close", size: 16 }) });
|
|
448
|
+
const defaultCustomStyle = () => ({});
|
|
449
|
+
const FwdSelectInput = ({
|
|
450
|
+
animation = "pulse",
|
|
451
|
+
animationDuration = 1e3,
|
|
452
|
+
animationOnChange = false,
|
|
453
|
+
children,
|
|
454
|
+
className,
|
|
455
|
+
customComponents,
|
|
456
|
+
customStyle = defaultCustomStyle,
|
|
457
|
+
disabled = false,
|
|
458
|
+
error,
|
|
459
|
+
innerRef,
|
|
460
|
+
inputId: inputIdProp,
|
|
461
|
+
isClearable = false,
|
|
462
|
+
isMulti = false,
|
|
463
|
+
isSearchable = true,
|
|
464
|
+
menuPortalTarget,
|
|
465
|
+
noTopLabel = false,
|
|
466
|
+
onBlur,
|
|
467
|
+
onChange,
|
|
468
|
+
onFocus,
|
|
469
|
+
options,
|
|
470
|
+
placeholder,
|
|
471
|
+
readOnly = false,
|
|
472
|
+
value,
|
|
473
|
+
name,
|
|
474
|
+
id: idProp,
|
|
475
|
+
time,
|
|
476
|
+
isLoading,
|
|
477
|
+
required,
|
|
478
|
+
emptyState,
|
|
479
|
+
"data-testid": dataTestId
|
|
480
|
+
}) => {
|
|
481
|
+
const id = useId();
|
|
482
|
+
const inputId = inputIdProp ?? id;
|
|
483
|
+
const theme = useTheme();
|
|
484
|
+
const [isAnimated, setIsAnimated] = useState(false);
|
|
485
|
+
const currentValue = value?.value;
|
|
486
|
+
const selectOptions = useMemo(
|
|
487
|
+
() => options || Children.toArray(children).reduce((acc, child) => {
|
|
488
|
+
if (React.isValidElement(child)) {
|
|
489
|
+
return [
|
|
490
|
+
...acc,
|
|
491
|
+
{
|
|
492
|
+
...child.props,
|
|
493
|
+
label: child.props.children
|
|
494
|
+
}
|
|
495
|
+
];
|
|
496
|
+
}
|
|
497
|
+
return acc;
|
|
498
|
+
}, []),
|
|
499
|
+
[options, children]
|
|
500
|
+
);
|
|
501
|
+
useEffect(() => {
|
|
502
|
+
if (animationOnChange) {
|
|
503
|
+
setIsAnimated(true);
|
|
504
|
+
setTimeout(() => setIsAnimated(false), animationDuration);
|
|
505
|
+
}
|
|
506
|
+
}, [setIsAnimated, animationOnChange, animationDuration, currentValue]);
|
|
507
|
+
return /* @__PURE__ */ jsx(
|
|
508
|
+
Select,
|
|
509
|
+
{
|
|
510
|
+
components: {
|
|
511
|
+
ClearIndicator,
|
|
512
|
+
DropdownIndicator,
|
|
513
|
+
Input,
|
|
514
|
+
MultiValueContainer,
|
|
515
|
+
MultiValueLabel,
|
|
516
|
+
MultiValueRemove,
|
|
517
|
+
Option,
|
|
518
|
+
SelectContainer,
|
|
519
|
+
ValueContainer,
|
|
520
|
+
...customComponents
|
|
521
|
+
},
|
|
522
|
+
placeholder,
|
|
523
|
+
className,
|
|
524
|
+
isDisabled: disabled || readOnly,
|
|
525
|
+
isOptionDisabled: (option) => !!option.disabled,
|
|
526
|
+
styles: getSelectStyles({
|
|
527
|
+
animation: isAnimated ? animation : void 0,
|
|
528
|
+
animationDuration,
|
|
529
|
+
customStyle,
|
|
530
|
+
error,
|
|
531
|
+
noTopLabel,
|
|
532
|
+
theme
|
|
533
|
+
}),
|
|
534
|
+
options: selectOptions,
|
|
535
|
+
menuPortalTarget: menuPortalTarget || void 0,
|
|
536
|
+
isSearchable,
|
|
537
|
+
isClearable,
|
|
538
|
+
isMulti,
|
|
539
|
+
onBlur,
|
|
540
|
+
onChange,
|
|
541
|
+
onFocus,
|
|
542
|
+
value,
|
|
543
|
+
maxMenuHeight: 250,
|
|
544
|
+
inputId,
|
|
545
|
+
ref: innerRef,
|
|
546
|
+
name,
|
|
547
|
+
id: idProp,
|
|
548
|
+
time,
|
|
549
|
+
isLoading,
|
|
550
|
+
required,
|
|
551
|
+
noOptionsMessage: emptyState,
|
|
552
|
+
"data-testid": dataTestId
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
};
|
|
556
|
+
const SelectInput = forwardRef(
|
|
557
|
+
(props, ref) => /* @__PURE__ */ jsx(FwdSelectInput, { innerRef: ref, ...props })
|
|
558
|
+
);
|
|
559
|
+
SelectInput.displayName = "SelectInput";
|
|
560
|
+
SelectInput.Option = Option;
|
|
561
|
+
export {
|
|
562
|
+
SelectInput
|
|
563
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
export type DropdownProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
emptyState: ReactNode;
|
|
5
|
+
descriptionDirection: 'row' | 'column';
|
|
6
|
+
searchable: boolean;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
refSelect: RefObject<HTMLDivElement>;
|
|
10
|
+
loadMore?: ReactNode;
|
|
11
|
+
optionalInfoPlacement: 'left' | 'right';
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type CreateDropdownProps = {
|
|
15
|
+
isEmpty: boolean;
|
|
16
|
+
emptyState: ReactNode;
|
|
17
|
+
descriptionDirection: 'row' | 'column';
|
|
18
|
+
loadMore?: ReactNode;
|
|
19
|
+
optionalInfoPlacement: 'left' | 'right';
|
|
20
|
+
defaultSearchValue: string | null;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const Dropdown: ({ children, emptyState, descriptionDirection, searchable, placeholder, footer, refSelect, loadMore, optionalInfoPlacement, isLoading, }: DropdownProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|