@ultraviolet/ui 1.51.1 → 1.51.3
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 +30 -0
- package/dist/components/Alert/index.d.ts +27 -0
- package/dist/components/Alert/index.js +115 -0
- package/dist/components/Avatar/index.d.ts +43 -0
- package/dist/components/Avatar/index.js +57 -0
- package/dist/components/Badge/index.d.ts +31 -0
- package/dist/components/Badge/index.js +99 -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 +116 -0
- package/dist/components/BarChart/Tooltip.d.ts +9 -0
- package/dist/components/BarChart/Tooltip.js +41 -0
- package/dist/components/BarChart/index.d.ts +27 -0
- package/dist/components/BarChart/index.js +69 -0
- package/dist/components/BarStack/index.d.ts +36 -0
- package/dist/components/BarStack/index.js +114 -0
- package/dist/components/Breadcrumbs/index.d.ts +30 -0
- package/dist/components/Breadcrumbs/index.js +73 -0
- package/dist/components/Bullet/index.d.ts +39 -0
- package/dist/components/Bullet/index.js +84 -0
- package/dist/components/Button/index.d.ts +120 -0
- package/dist/components/Button/index.js +249 -0
- package/dist/components/Card/index.d.ts +20 -0
- package/dist/components/Card/index.js +52 -0
- package/dist/components/Carousel/index.d.ts +19 -0
- package/dist/components/Carousel/index.js +123 -0
- package/dist/components/Checkbox/index.d.ts +36 -0
- package/dist/components/Checkbox/index.js +262 -0
- package/dist/components/CheckboxGroup/index.d.ts +24 -0
- package/dist/components/CheckboxGroup/index.js +116 -0
- package/dist/components/CopyButton/index.d.ts +19 -0
- package/dist/components/CopyButton/index.js +23 -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 +182 -0
- package/dist/components/Dialog/Context.d.ts +7 -0
- package/dist/components/Dialog/Context.js +13 -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 +66 -0
- package/dist/components/Dialog/subComponents/Button.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Button.js +15 -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 +8 -0
- package/dist/components/Dialog/subComponents/Text.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Text.js +8 -0
- package/dist/components/EmptyState/index.d.ts +38 -0
- package/dist/components/EmptyState/index.js +90 -0
- package/dist/components/Expandable/index.d.ts +33 -0
- package/dist/components/Expandable/index.js +75 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.d.ts +3 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.js +23 -0
- package/dist/components/GlobalAlert/index.d.ts +40 -0
- package/dist/components/GlobalAlert/index.js +59 -0
- package/dist/components/LineChart/CustomLegend.d.ts +13 -0
- package/dist/components/LineChart/CustomLegend.js +113 -0
- package/dist/components/LineChart/Tooltip.d.ts +6 -0
- package/dist/components/LineChart/Tooltip.js +35 -0
- package/dist/components/LineChart/helpers.d.ts +8 -0
- package/dist/{src/components → components}/LineChart/helpers.js +22 -10
- package/dist/components/LineChart/index.d.ts +25 -0
- package/dist/components/LineChart/index.js +101 -0
- package/dist/components/Link/index.d.ts +33 -0
- package/dist/components/Link/index.js +128 -0
- package/dist/components/List/Body.d.ts +6 -0
- package/dist/components/List/Body.js +16 -0
- package/dist/components/List/Cell.d.ts +12 -0
- package/dist/components/List/Cell.js +41 -0
- package/dist/components/List/HeaderCell.d.ts +11 -0
- package/dist/components/List/HeaderCell.js +82 -0
- package/dist/components/List/HeaderRow.d.ts +7 -0
- package/dist/components/List/HeaderRow.js +36 -0
- package/dist/components/List/ListContext.d.ts +34 -0
- package/dist/{src/components → components}/List/ListContext.js +27 -29
- package/dist/components/List/Row.d.ts +23 -0
- package/dist/components/List/Row.js +161 -0
- package/dist/components/List/SelectBar.d.ts +15 -0
- package/dist/components/List/SelectBar.js +52 -0
- package/dist/components/List/SkeletonRows.d.ts +7 -0
- package/dist/components/List/SkeletonRows.js +55 -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 +60 -0
- package/dist/components/Loader/index.d.ts +22 -0
- package/dist/components/Loader/index.js +77 -0
- package/dist/components/Menu/Item.d.ts +15 -0
- package/dist/components/Menu/Item.js +91 -0
- package/dist/components/Menu/index.d.ts +49 -0
- package/dist/components/Menu/index.js +116 -0
- package/dist/components/MenuV2/Group.d.ts +7 -0
- package/dist/components/MenuV2/Group.js +21 -0
- package/dist/components/MenuV2/Item.d.ts +16 -0
- package/dist/components/MenuV2/Item.js +113 -0
- package/dist/components/MenuV2/index.d.ts +90 -0
- package/dist/components/MenuV2/index.js +90 -0
- package/dist/components/Meter/index.d.ts +26 -0
- package/dist/components/Meter/index.js +63 -0
- package/dist/components/Modal/Dialog.d.ts +3 -0
- package/dist/components/Modal/Dialog.js +141 -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 +79 -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 +23 -0
- package/dist/components/Notification/index.d.ts +36 -0
- package/dist/components/Notification/index.js +49 -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 +262 -0
- package/dist/components/NumberInputV2/index.d.ts +27 -0
- package/dist/components/NumberInputV2/index.js +221 -0
- package/dist/components/Pagination/getPageNumbers.d.ts +8 -0
- package/dist/{src/components → components}/Pagination/getPageNumbers.js +3 -9
- package/dist/components/Pagination/index.d.ts +30 -0
- package/dist/components/Pagination/index.js +88 -0
- package/dist/components/PasswordCheck/index.d.ts +20 -0
- package/dist/components/PasswordCheck/index.js +24 -0
- package/dist/components/PasswordStrengthMeter/index.d.ts +39 -0
- package/dist/components/PasswordStrengthMeter/index.js +96 -0
- package/dist/components/PieChart/Legends.d.ts +9 -0
- package/dist/components/PieChart/Legends.js +142 -0
- package/dist/components/PieChart/Tooltip.d.ts +12 -0
- package/dist/components/PieChart/Tooltip.js +49 -0
- package/dist/components/PieChart/index.d.ts +20 -0
- package/dist/components/PieChart/index.js +101 -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 +100 -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 +216 -0
- package/dist/components/Popup/index.d.ts +72 -0
- package/dist/components/Popup/index.js +297 -0
- package/dist/components/ProgressBar/index.d.ts +14 -0
- package/dist/components/ProgressBar/index.js +53 -0
- package/dist/components/Radio/index.d.ts +21 -0
- package/dist/components/Radio/index.js +133 -0
- package/dist/components/RadioGroup/index.d.ts +25 -0
- package/dist/components/RadioGroup/index.js +99 -0
- package/dist/components/Row/index.d.ts +22 -0
- package/dist/components/Row/index.js +34 -0
- package/dist/components/SelectInput/index.d.ts +75 -0
- package/dist/components/SelectInput/index.js +516 -0
- package/dist/components/SelectInputV2/Dropdown.d.ts +23 -0
- package/dist/components/SelectInputV2/Dropdown.js +429 -0
- package/dist/components/SelectInputV2/DropdownOption.d.ts +8 -0
- package/dist/components/SelectInputV2/DropdownOption.js +62 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.d.ts +9 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.js +107 -0
- package/dist/components/SelectInputV2/SelectBar.d.ts +14 -0
- package/dist/components/SelectInputV2/SelectBar.js +224 -0
- package/dist/components/SelectInputV2/SelectInputProvider.d.ts +41 -0
- package/dist/{src/components → components}/SelectInputV2/SelectInputProvider.js +38 -36
- 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 +87 -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 +137 -0
- package/dist/components/SelectableCardGroup/index.d.ts +23 -0
- package/dist/components/SelectableCardGroup/index.js +107 -0
- package/dist/components/Separator/index.d.ts +17 -0
- package/dist/components/Separator/index.js +56 -0
- package/dist/components/Skeleton/Block.d.ts +3 -0
- package/dist/components/Skeleton/Block.js +38 -0
- package/dist/components/Skeleton/Blocks.d.ts +4 -0
- package/dist/components/Skeleton/Blocks.js +38 -0
- package/dist/components/Skeleton/BoxWithIcon.d.ts +4 -0
- package/dist/components/Skeleton/BoxWithIcon.js +36 -0
- package/dist/components/Skeleton/Donut.d.ts +1 -0
- package/dist/components/Skeleton/Donut.js +61 -0
- package/dist/components/Skeleton/IconSkeleton.d.ts +5 -0
- package/dist/components/Skeleton/IconSkeleton.js +22 -0
- package/dist/components/Skeleton/Line.d.ts +5 -0
- package/dist/components/Skeleton/Line.js +16 -0
- package/dist/components/Skeleton/List.d.ts +4 -0
- package/dist/components/Skeleton/List.js +56 -0
- package/dist/components/Skeleton/Slider.d.ts +3 -0
- package/dist/components/Skeleton/Slider.js +40 -0
- package/dist/components/Skeleton/Square.d.ts +5 -0
- package/dist/components/Skeleton/Square.js +12 -0
- package/dist/components/Skeleton/index.d.ts +47 -0
- package/dist/components/Skeleton/index.js +79 -0
- package/dist/components/Snippet/index.d.ts +23 -0
- package/dist/components/Snippet/index.js +182 -0
- package/dist/components/Stack/index.d.ts +23 -0
- package/dist/components/Stack/index.js +29 -0
- package/dist/components/Status/index.d.ts +32 -0
- package/dist/components/Status/index.js +72 -0
- package/dist/components/StepList/index.d.ts +33 -0
- package/dist/components/StepList/index.js +58 -0
- package/dist/components/Stepper/index.d.ts +15 -0
- package/dist/components/Stepper/index.js +145 -0
- package/dist/components/SwitchButton/FocusOverlay.d.ts +8 -0
- package/dist/components/SwitchButton/FocusOverlay.js +38 -0
- package/dist/components/SwitchButton/index.d.ts +26 -0
- package/dist/components/SwitchButton/index.js +76 -0
- package/dist/components/Table/Body.d.ts +6 -0
- package/dist/components/Table/Body.js +7 -0
- package/dist/components/Table/Cell.d.ts +9 -0
- package/dist/components/Table/Cell.js +19 -0
- package/dist/components/Table/Header.d.ts +6 -0
- package/dist/components/Table/Header.js +16 -0
- package/dist/components/Table/HeaderCell.d.ts +14 -0
- package/dist/components/Table/HeaderCell.js +80 -0
- package/dist/components/Table/HeaderRow.d.ts +7 -0
- package/dist/components/Table/HeaderRow.js +23 -0
- package/dist/components/Table/Row.d.ts +14 -0
- package/dist/components/Table/Row.js +80 -0
- package/dist/components/Table/SelectBar.d.ts +15 -0
- package/dist/components/Table/SelectBar.js +52 -0
- package/dist/components/Table/SkeletonRows.d.ts +7 -0
- package/dist/components/Table/SkeletonRows.js +54 -0
- package/dist/components/Table/TableContext.d.ts +27 -0
- package/dist/{src/components → components}/Table/TableContext.js +19 -21
- package/dist/components/Table/index.d.ts +60 -0
- package/dist/components/Table/index.js +67 -0
- package/dist/components/Tabs/Tab.d.ts +20 -0
- package/dist/components/Tabs/Tab.js +120 -0
- package/dist/components/Tabs/TabMenu.d.ts +8 -0
- package/dist/components/Tabs/TabMenu.js +62 -0
- package/dist/components/Tabs/TabMenuItem.d.ts +20 -0
- package/dist/components/Tabs/TabMenuItem.js +34 -0
- package/dist/components/Tabs/TabsContext.d.ts +8 -0
- package/dist/components/Tabs/TabsContext.js +7 -0
- package/dist/components/Tabs/index.d.ts +50 -0
- package/dist/components/Tabs/index.js +102 -0
- package/dist/components/Tag/index.d.ts +26 -0
- package/dist/components/Tag/index.js +144 -0
- package/dist/components/TagInput/index.d.ts +55 -0
- package/dist/components/TagInput/index.js +253 -0
- package/dist/components/TagList/index.d.ts +37 -0
- package/dist/components/TagList/index.js +98 -0
- package/dist/components/Text/index.d.ts +40 -0
- package/dist/components/Text/index.js +82 -0
- package/dist/components/TextArea/index.d.ts +50 -0
- package/dist/components/TextArea/index.js +158 -0
- package/dist/components/TextInput/index.d.ts +75 -0
- package/dist/components/TextInput/index.js +387 -0
- package/dist/components/TextInputV2/index.d.ts +30 -0
- package/dist/components/TextInputV2/index.js +190 -0
- package/dist/components/TimeInput/index.d.ts +25 -0
- package/dist/components/TimeInput/index.js +28 -0
- package/dist/components/Toaster/index.d.ts +46 -0
- package/dist/components/Toaster/index.js +83 -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 +136 -0
- package/dist/components/ToggleGroup/index.d.ts +24 -0
- package/dist/components/ToggleGroup/index.js +96 -0
- package/dist/components/Tooltip/index.d.ts +9 -0
- package/dist/components/Tooltip/index.js +40 -0
- package/dist/components/VerificationCode/index.d.ts +36 -0
- package/dist/components/VerificationCode/index.js +217 -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 -3723
- 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 +27 -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/{src/utils → utils}/ids.js +5 -4
- 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 +15 -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 +18 -8
- 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/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/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 -118
- 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 -146
- package/dist/src/components/Popup/helpers.js +0 -252
- package/dist/src/components/Popup/index.js +0 -383
- 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 -122
- package/dist/src/components/SelectInputV2/SelectBar.js +0 -282
- 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/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/responsive/Breakpoint.js +0 -12
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import _styled from "@emotion/styled/base";
|
|
3
|
+
import { useId, useState, createRef } from "react";
|
|
4
|
+
const SIZE_HEIGHT = {
|
|
5
|
+
xlarge: 64,
|
|
6
|
+
large: 48,
|
|
7
|
+
medium: 40,
|
|
8
|
+
small: 32
|
|
9
|
+
};
|
|
10
|
+
const SIZE_WIDTH = {
|
|
11
|
+
xlarge: 56,
|
|
12
|
+
large: 40,
|
|
13
|
+
medium: 32,
|
|
14
|
+
small: 24
|
|
15
|
+
};
|
|
16
|
+
const StyledInput = /* @__PURE__ */ _styled("input", process.env.NODE_ENV === "production" ? {
|
|
17
|
+
shouldForwardProp: (prop) => !["inputSize"].includes(prop),
|
|
18
|
+
target: "e1a2bx9q0"
|
|
19
|
+
} : {
|
|
20
|
+
shouldForwardProp: (prop) => !["inputSize"].includes(prop),
|
|
21
|
+
target: "e1a2bx9q0",
|
|
22
|
+
label: "StyledInput"
|
|
23
|
+
})("background:", ({
|
|
24
|
+
theme
|
|
25
|
+
}) => theme.colors.neutral.background, ";border:solid 1px ", ({
|
|
26
|
+
"aria-invalid": error,
|
|
27
|
+
theme
|
|
28
|
+
}) => error ? theme.colors.danger.border : theme.colors.neutral.border, ";color:", ({
|
|
29
|
+
"aria-invalid": error,
|
|
30
|
+
theme
|
|
31
|
+
}) => error ? theme.colors.danger.text : theme.colors.neutral.text, ";", ({
|
|
32
|
+
inputSize,
|
|
33
|
+
theme
|
|
34
|
+
}) => {
|
|
35
|
+
if (inputSize === "small") {
|
|
36
|
+
return `
|
|
37
|
+
font-size: ${theme.typography.caption.fontSize};
|
|
38
|
+
font-weight: ${theme.typography.caption.weight};
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
return `
|
|
42
|
+
font-size: ${theme.typography.body.fontSize};
|
|
43
|
+
font-weight: ${theme.typography.body.weight};
|
|
44
|
+
`;
|
|
45
|
+
}, " text-align:center;border-radius:", ({
|
|
46
|
+
theme
|
|
47
|
+
}) => theme.radii.default, ";margin-right:", ({
|
|
48
|
+
theme
|
|
49
|
+
}) => theme.space["1"], ";width:", ({
|
|
50
|
+
inputSize
|
|
51
|
+
}) => SIZE_WIDTH[inputSize], "px;height:", ({
|
|
52
|
+
inputSize
|
|
53
|
+
}) => SIZE_HEIGHT[inputSize], "px;outline-style:none;transition:border-color 0.2s ease,box-shadow 0.2s ease;&:hover,&:focus{border-color:", ({
|
|
54
|
+
"aria-invalid": error,
|
|
55
|
+
theme
|
|
56
|
+
}) => error ? theme.colors.danger.borderHover : theme.colors.primary.borderHover, ";}&:focus{box-shadow:", ({
|
|
57
|
+
"aria-invalid": error,
|
|
58
|
+
theme: {
|
|
59
|
+
shadows
|
|
60
|
+
}
|
|
61
|
+
}) => error ? shadows.focusDanger : shadows.focusPrimary, ";}&:last-child{margin-right:0;}&::placeholder{color:", ({
|
|
62
|
+
disabled,
|
|
63
|
+
theme
|
|
64
|
+
}) => disabled ? theme.colors.neutral.textWeakDisabled : theme.colors.neutral.textWeak, ";}", ({
|
|
65
|
+
disabled,
|
|
66
|
+
theme: {
|
|
67
|
+
colors
|
|
68
|
+
}
|
|
69
|
+
}) => disabled && `cursor: default;
|
|
70
|
+
background-color: ${colors.neutral.backgroundDisabled};
|
|
71
|
+
border-color: ${colors.neutral.borderDisabled};
|
|
72
|
+
color: ${colors.neutral.textDisabled};
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
border: ${colors.neutral.borderDisabled}
|
|
76
|
+
}
|
|
77
|
+
`, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3VpL3NyYy9jb21wb25lbnRzL1ZlcmlmaWNhdGlvbkNvZGUvaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCRSIsImZpbGUiOiIv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gY2FzZSAnQmFja3NwYWNlJzpcbiAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpXG4gICAgICAgICAgaWYgKHZhbHVlc1tpbmRleF0pIHtcbiAgICAgICAgICAgIHZhbHNbaW5kZXhdID0gJydcbiAgICAgICAgICAgIHNldFZhbHVlcyh2YWxzKVxuICAgICAgICAgICAgdHJpZ2dlckNoYW5nZSh2YWxzKVxuICAgICAgICAgIH0gZWxzZSBpZiAocHJldikge1xuICAgICAgICAgICAgdmFsc1twcmV2SW5kZXhdID0gJydcbiAgICAgICAgICAgIHByZXY/LmN1cnJlbnQ/LmZvY3VzKClcbiAgICAgICAgICAgIHNldFZhbHVlcyh2YWxzKVxuICAgICAgICAgICAgdHJpZ2dlckNoYW5nZSh2YWxzKVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdBcnJvd0xlZnQnOlxuICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICBwcmV2Py5jdXJyZW50Py5mb2N1cygpXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnQXJyb3dSaWdodCc6XG4gICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKVxuICAgICAgICAgIG5leHQ/LmN1cnJlbnQ/LmZvY3VzKClcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdBcnJvd1VwJzpcbiAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpXG4gICAgICAgICAgZmlyc3Q/LmN1cnJlbnQ/LmZvY3VzKClcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdBcnJvd0Rvd24nOlxuICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICBsYXN0Py5jdXJyZW50Py5mb2N1cygpXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICBicmVha1xuICAgICAgfVxuICAgIH1cblxuIC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VhY3Qvbm8tYXJyYXktaW5kZXgta2V5XG4gICAgICAgICAga2V5PXtpbmRleH1cbiAgICAgICAgICBkYXRhLXRlc3RpZD17aW5kZXh9XG4gICAgICAgICAgdmFsdWU9e3ZhbHVlfVxuICAgICAgICAgIGlkPXtgJHtpbnB1dElkIHx8IHVuaXF1ZUlkfS0ke2luZGV4fWB9XG4gICAgICAgICAgcmVmPXtpbnB1dFJlZnNbaW5kZXhdfVxuICAgICAgICAgIG9uQ2hhbmdlPXtpbnB1dE9uQ2hhbmdlKGluZGV4KX1cbiAgICAgICAgICBvbktleURvd249e2lucHV0T25LZXlEb3duKGluZGV4KX1cbiAgICAgICAgICBvblBhc3RlPXtpbnB1dE9uUGFzdGUoaW5kZXgpfVxuICAgICAgICAgIG9uRm9jdXM9e2lucHV0T25Gb2N1c31cbiAgICAgICAgICBkaXNhYmxlZD17ZGlzYWJsZWR9XG4gICAgICAgICAgcmVxdWlyZWQ9e3JlcXVpcmVkfVxuICAgICAgICAgIHBsYWNlaG9sZGVyPXtwbGFjZWhvbGRlcj8uW2luZGV4XSA/PyAnJ31cbiAgICAgICAgICBhcmlhLWxhYmVsPXtgJHthcmlhTGFiZWx9ICR7aW5kZXh9YH1cbiAgICAgICAgLz5cbiAgICAgICkpfVxuICAgIDwvZGl2PlxuICApXG59XG4iXX0= */"));
|
|
78
|
+
const DEFAULT_ON_FUNCTION = () => {
|
|
79
|
+
};
|
|
80
|
+
const VerificationCode = ({
|
|
81
|
+
disabled = false,
|
|
82
|
+
className,
|
|
83
|
+
error = false,
|
|
84
|
+
fields = 4,
|
|
85
|
+
initialValue = "",
|
|
86
|
+
inputId,
|
|
87
|
+
inputStyle = "",
|
|
88
|
+
size = "large",
|
|
89
|
+
onChange = DEFAULT_ON_FUNCTION,
|
|
90
|
+
onComplete = DEFAULT_ON_FUNCTION,
|
|
91
|
+
placeholder = "",
|
|
92
|
+
required = false,
|
|
93
|
+
type = "number",
|
|
94
|
+
"data-testid": dataTestId,
|
|
95
|
+
"aria-label": ariaLabel = "Verification code"
|
|
96
|
+
}) => {
|
|
97
|
+
const uniqueId = useId();
|
|
98
|
+
const valuesArray = Object.assign(new Array(fields).fill(""), initialValue.substring(0, fields).split(""));
|
|
99
|
+
const [values, setValues] = useState(valuesArray);
|
|
100
|
+
const inputRefs = Array.from({
|
|
101
|
+
length: fields
|
|
102
|
+
}, () => createRef());
|
|
103
|
+
const triggerChange = (inputValues) => {
|
|
104
|
+
const stringValue = inputValues.join("");
|
|
105
|
+
if (onChange) {
|
|
106
|
+
onChange(stringValue);
|
|
107
|
+
}
|
|
108
|
+
if (onComplete && stringValue.length >= fields) {
|
|
109
|
+
onComplete(stringValue);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const inputOnChange = (index) => (event) => {
|
|
113
|
+
let {
|
|
114
|
+
value
|
|
115
|
+
} = event.target;
|
|
116
|
+
if (type === "number") {
|
|
117
|
+
value = event.target.value.replace(/[^\d]/gi, "");
|
|
118
|
+
}
|
|
119
|
+
const newValues = [...values];
|
|
120
|
+
if (value === "" || type === "number" && !new RegExp(event.target.pattern).test(value)) {
|
|
121
|
+
newValues[index] = "";
|
|
122
|
+
setValues(newValues);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const sanitizedValue = value[0];
|
|
126
|
+
newValues[index] = sanitizedValue;
|
|
127
|
+
setValues(newValues);
|
|
128
|
+
const nextIndex = Math.min(index + 1, fields - 1);
|
|
129
|
+
const next = inputRefs[nextIndex];
|
|
130
|
+
next?.current?.focus();
|
|
131
|
+
triggerChange(newValues);
|
|
132
|
+
};
|
|
133
|
+
const inputOnKeyDown = (index) => (event) => {
|
|
134
|
+
const prevIndex = index - 1;
|
|
135
|
+
const nextIndex = index + 1;
|
|
136
|
+
const first = inputRefs[0];
|
|
137
|
+
const last = inputRefs[inputRefs.length - 1];
|
|
138
|
+
const prev = inputRefs[prevIndex];
|
|
139
|
+
const next = inputRefs[nextIndex];
|
|
140
|
+
const vals = [...values];
|
|
141
|
+
switch (event.key) {
|
|
142
|
+
case "Backspace":
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
if (values[index]) {
|
|
145
|
+
vals[index] = "";
|
|
146
|
+
setValues(vals);
|
|
147
|
+
triggerChange(vals);
|
|
148
|
+
} else if (prev) {
|
|
149
|
+
vals[prevIndex] = "";
|
|
150
|
+
prev?.current?.focus();
|
|
151
|
+
setValues(vals);
|
|
152
|
+
triggerChange(vals);
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
case "ArrowLeft":
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
prev?.current?.focus();
|
|
158
|
+
break;
|
|
159
|
+
case "ArrowRight":
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
next?.current?.focus();
|
|
162
|
+
break;
|
|
163
|
+
case "ArrowUp":
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
first?.current?.focus();
|
|
166
|
+
break;
|
|
167
|
+
case "ArrowDown":
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
last?.current?.focus();
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
const inputOnFocus = (event) => event.target.select();
|
|
174
|
+
const inputOnPaste = (currentIndex) => (event) => {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
const pastedValue = [...event.clipboardData.getData("Text").split("")].map((copiedValue) => (
|
|
177
|
+
// Replace non number char with empty char when type is number
|
|
178
|
+
type === "number" ? copiedValue.replace(/[^\d]/gi, "") : copiedValue
|
|
179
|
+
));
|
|
180
|
+
pastedValue.splice(fields - currentIndex < pastedValue.length ? fields - currentIndex : pastedValue.length);
|
|
181
|
+
setValues((vals) => {
|
|
182
|
+
const newArray = vals.slice();
|
|
183
|
+
newArray.splice(currentIndex, pastedValue.length, ...pastedValue);
|
|
184
|
+
return newArray;
|
|
185
|
+
});
|
|
186
|
+
const nextIndex = Math.min(currentIndex + pastedValue.filter((item) => item !== "").length, inputRefs.length - 1);
|
|
187
|
+
const next = inputRefs[nextIndex];
|
|
188
|
+
next?.current?.focus();
|
|
189
|
+
triggerChange(pastedValue);
|
|
190
|
+
};
|
|
191
|
+
return /* @__PURE__ */ jsx("div", { className, "data-testid": dataTestId, children: values.map((value, index) => /* @__PURE__ */ jsx(
|
|
192
|
+
StyledInput,
|
|
193
|
+
{
|
|
194
|
+
css: [inputStyle, process.env.NODE_ENV === "production" ? "" : ";label:VerificationCode;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3VpL3NyYy9jb21wb25lbnRzL1ZlcmlmaWNhdGlvbkNvZGUvaW5kZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdTVSIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay91bHRyYXZpb2xldC91bHRyYXZpb2xldC9wYWNrYWdlcy91aS9zcmMvY29tcG9uZW50cy9WZXJpZmljYXRpb25Db2RlL2luZGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHR5cGUge1xuICBDaGFuZ2VFdmVudCxcbiAgQ2xpcGJvYXJkRXZlbnRIYW5kbGVyLFxuICBGb2N1c0V2ZW50SGFuZGxlcixcbiAgS2V5Ym9hcmRFdmVudEhhbmRsZXIsXG59IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgY3JlYXRlUmVmLCB1c2VJZCwgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCdcblxudHlwZSBTaXplID0gJ3NtYWxsJyB8ICdtZWRpdW0nIHwgJ2xhcmdlJyB8ICd4bGFyZ2UnXG5cbmNvbnN0IFNJWkVfSEVJR0hUID0ge1xuICB4bGFyZ2U6IDY0LFxuICBsYXJnZTogN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A9XG4gICAgKGluZGV4OiBudW1iZXIpOiBLZXlib2FyZEV2ZW50SGFuZGxlcjxIVE1MSW5wdXRFbGVtZW50PiA9PlxuICAgIGV2ZW50ID0+IHtcbiAgICAgIGNvbnN0IHByZXZJbmRleCA9IGluZGV4IC0gMVxuICAgICAgY29uc3QgbmV4dEluZGV4ID0gaW5kZXggKyAxXG4gICAgICBjb25zdCBmaXJzdCA9IGlucHV0UmVmc1swXVxuICAgICAgY29uc3QgbGFzdCA9IGlucHV0UmVmc1tpbnB1dFJlZnMubGVuZ3RoIC0gMV1cbiAgICAgIGNvbnN0IHByZXYgPSBpbnB1dFJlZnNbcHJldkluZGV4XVxuICAgICAgY29uc3QgbmV4dCA9IGlucHV0UmVmc1tuZXh0SW5kZXhdXG4gICAgICBjb25zdCB2YWxzID0gWy4uLnZhbHVlc11cblxuICAgICAgc3dpdGNoIChldmVudC5rZXkpIHtcbiAgICAgICAgY2FzZSAnQmFja3NwYWNlJzpcbiAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpXG4gICAgICAgICAgaWYgKHZhbHVlc1tpbmRleF0pIHtcbiAgICAgICAgICAgIHZhbHNbaW5kZXhdID0gJydcbiAgICAgICAgICAgIHNldFZhbHVlcyh2YWxzKVxuICAgICAgICAgICAgdHJpZ2dlckNoYW5nZSh2YWxzKVxuICAgICAgICAgIH0gZWxzZSBpZiAocHJldikge1xuICAgICAgICAgICAgdmFsc1twcmV2SW5kZXhdID0gJydcbiAgICAgICAgICAgIHByZXY/LmN1cnJlbnQ/LmZvY3VzKClcbiAgICAgICAgICAgIHNldFZhbHVlcyh2YWxzKVxuICAgICAgICAgICAgdHJpZ2dlckNoYW5nZSh2YWxzKVxuICAgICAgICAgIH1cbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdBcnJvd0xlZnQnOlxuICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICBwcmV2Py5jdXJyZW50Py5mb2N1cygpXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnQXJyb3dSaWdodCc6XG4gICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKVxuICAgICAgICAgIG5leHQ/LmN1cnJlbnQ/LmZvY3VzKClcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdBcnJvd1VwJzpcbiAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpXG4gICAgICAgICAgZmlyc3Q/LmN1cnJlbnQ/LmZvY3VzKClcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdBcnJvd0Rvd24nOlxuICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICBsYXN0Py5jdXJyZW50Py5mb2N1cygpXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICBicmVha1xuICAgICAgfVxuICAgIH1cblxuICBjb25zdCBpbnB1dE9uRm9jdXM6IEZvY3VzRXZlbnRIYW5kbGVyPEhUTUxJbnB1dEVsZW1lbnQ+ID0gZXZlbnQgPT5cbiAgICBldmVudC50YXJnZXQuc2VsZWN0KClcblxuICBjb25zdCBpbnB1dE9uUGFzdGUgPVxuICAgIChjdXJyZW50SW5kZXg6IG51bWJlcik6IENsaXBib2FyZEV2ZW50SGFuZGxlcjxIVE1MSW5wdXRFbGVtZW50PiA9PlxuICAgIGV2ZW50ID0+IHtcbiAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcbiAgICAgIGNvbnN0IHBhc3RlZFZhbHVlID0gW1xuICAgICAgICAuLi5ldmVudC5jbGlwYm9hcmREYXRhLmdldERhdGEoJ1RleHQnKS5zcGxpdCgnJyksXG4gICAgICBdLm1hcCgoY29waWVkVmFsdWU6IHN0cmluZykgPT5cbiAgICAgICAgLy8gUmVwbGFjZSBub24gbnVtYmVyIGNoYXIgd2l0aCBlbXB0eSBjaGFyIHdoZW4gdHlwZSBpcyBudW1iZXJcbiAgICAgIC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W2luZGV4XSA/PyAnJ31cbiAgICAgICAgICBhcmlhLWxhYmVsPXtgJHthcmlhTGFiZWx9ICR7aW5kZXh9YH1cbiAgICAgICAgLz5cbiAgICAgICkpfVxuICAgIDwvZGl2PlxuICApXG59XG4iXX0= */"],
|
|
195
|
+
"aria-invalid": error,
|
|
196
|
+
inputSize: size,
|
|
197
|
+
type: type === "number" ? "tel" : type,
|
|
198
|
+
pattern: type === "number" ? "[0-9]*" : void 0,
|
|
199
|
+
"data-testid": index,
|
|
200
|
+
value,
|
|
201
|
+
id: `${inputId || uniqueId}-${index}`,
|
|
202
|
+
ref: inputRefs[index],
|
|
203
|
+
onChange: inputOnChange(index),
|
|
204
|
+
onKeyDown: inputOnKeyDown(index),
|
|
205
|
+
onPaste: inputOnPaste(index),
|
|
206
|
+
onFocus: inputOnFocus,
|
|
207
|
+
disabled,
|
|
208
|
+
required,
|
|
209
|
+
placeholder: placeholder?.[index] ?? "",
|
|
210
|
+
"aria-label": `${ariaLabel} ${index}`
|
|
211
|
+
},
|
|
212
|
+
index
|
|
213
|
+
)) });
|
|
214
|
+
};
|
|
215
|
+
export {
|
|
216
|
+
VerificationCode
|
|
217
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export { ActionBar } from './ActionBar';
|
|
2
|
+
export { Alert } from './Alert';
|
|
3
|
+
export { Avatar } from './Avatar';
|
|
4
|
+
export { Badge } from './Badge';
|
|
5
|
+
export { Banner } from './Banner';
|
|
6
|
+
export { BarChart } from './BarChart';
|
|
7
|
+
export { BarStack } from './BarStack';
|
|
8
|
+
export { Breadcrumbs } from './Breadcrumbs';
|
|
9
|
+
export { Bullet } from './Bullet';
|
|
10
|
+
export { Button } from './Button';
|
|
11
|
+
export { Card } from './Card';
|
|
12
|
+
export { Carousel } from './Carousel';
|
|
13
|
+
export { Checkbox } from './Checkbox';
|
|
14
|
+
export { CopyButton } from './CopyButton';
|
|
15
|
+
export { DateInput } from './DateInput';
|
|
16
|
+
export { Dialog } from './Dialog';
|
|
17
|
+
export { EmptyState } from './EmptyState';
|
|
18
|
+
export { Expandable } from './Expandable';
|
|
19
|
+
export { LineChart } from './LineChart';
|
|
20
|
+
export { Link } from './Link';
|
|
21
|
+
export { List } from './List';
|
|
22
|
+
export { Loader } from './Loader';
|
|
23
|
+
export { Menu } from './Menu';
|
|
24
|
+
export { Meter } from './Meter';
|
|
25
|
+
export { Modal } from './Modal';
|
|
26
|
+
export { Notice } from './Notice';
|
|
27
|
+
export { CheckboxGroup, CheckboxGroupCheckbox } from './CheckboxGroup';
|
|
28
|
+
export { NumberInput } from './NumberInput';
|
|
29
|
+
export { NumberInputV2 } from './NumberInputV2';
|
|
30
|
+
export { Pagination } from './Pagination';
|
|
31
|
+
export { PasswordCheck } from './PasswordCheck';
|
|
32
|
+
export { PasswordStrengthMeter } from './PasswordStrengthMeter';
|
|
33
|
+
export { PieChart } from './PieChart';
|
|
34
|
+
export { Popover } from './Popover';
|
|
35
|
+
export { Popup } from './Popup';
|
|
36
|
+
export { ProgressBar } from './ProgressBar';
|
|
37
|
+
export { Radio } from './Radio';
|
|
38
|
+
export { Row } from './Row';
|
|
39
|
+
export { SelectableCard } from './SelectableCard';
|
|
40
|
+
export { SelectInput, type SelectOption } from './SelectInput';
|
|
41
|
+
export { Separator } from './Separator';
|
|
42
|
+
export { Skeleton } from './Skeleton';
|
|
43
|
+
export { Snippet } from './Snippet';
|
|
44
|
+
export { Stack } from './Stack';
|
|
45
|
+
export { Status } from './Status';
|
|
46
|
+
export { StepList } from './StepList';
|
|
47
|
+
export { Stepper } from './Stepper';
|
|
48
|
+
export { SwitchButton } from './SwitchButton';
|
|
49
|
+
export { Table } from './Table';
|
|
50
|
+
export { Tabs } from './Tabs';
|
|
51
|
+
export { Tag } from './Tag';
|
|
52
|
+
export { TagInput } from './TagInput';
|
|
53
|
+
export { TagList } from './TagList';
|
|
54
|
+
export { Text } from './Text';
|
|
55
|
+
export { TextArea } from './TextArea';
|
|
56
|
+
export { TextInput } from './TextInput';
|
|
57
|
+
export { TextInputV2 } from './TextInputV2';
|
|
58
|
+
export { TimeInput } from './TimeInput';
|
|
59
|
+
export { ToastContainer, toast } from './Toaster';
|
|
60
|
+
export { Toggle } from './Toggle';
|
|
61
|
+
export { ToggleGroup } from './ToggleGroup';
|
|
62
|
+
export { Tooltip } from './Tooltip';
|
|
63
|
+
export { VerificationCode } from './VerificationCode';
|
|
64
|
+
export { RadioGroup } from './RadioGroup';
|
|
65
|
+
export {
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated This component is deprecated. Please use `Icon` from `@ultraviolet/icons` instead.
|
|
68
|
+
* The component is the same but has been moved to another package.
|
|
69
|
+
*/
|
|
70
|
+
Icon, } from '@ultraviolet/icons';
|
|
71
|
+
export { MenuV2 } from './MenuV2';
|
|
72
|
+
export { GlobalAlert } from './GlobalAlert';
|
|
73
|
+
export { NotificationContainer, notification } from './Notification';
|
|
74
|
+
export { SelectableCardGroup } from './SelectableCardGroup';
|
|
75
|
+
export { SelectInputV2 } from './SelectInputV2';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const isJSONString = str => {
|
|
1
|
+
const isJSONString = (str) => {
|
|
2
2
|
try {
|
|
3
3
|
JSON.parse(str);
|
|
4
4
|
} catch (e) {
|
|
@@ -6,5 +6,6 @@ const isJSONString = str => {
|
|
|
6
6
|
}
|
|
7
7
|
return true;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export {
|
|
10
|
+
isJSONString as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const getLegendColor = (theme) => {
|
|
2
|
+
const {
|
|
3
|
+
colors
|
|
4
|
+
} = theme;
|
|
5
|
+
return Object.keys(colors.other.data.charts).filter((key) => !["success", "danger"].includes(key)).sort((a, b) => {
|
|
6
|
+
if (Number(a.replace("data", "")) < Number(b.replace("data", ""))) {
|
|
7
|
+
return -1;
|
|
8
|
+
}
|
|
9
|
+
return 1;
|
|
10
|
+
}).map((key) => colors.other.data.charts[key]);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
getLegendColor
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const recursivelyGetChildrenString = (children) => {
|
|
2
|
+
if (typeof children === "string")
|
|
3
|
+
return children;
|
|
4
|
+
if (Array.isArray(children))
|
|
5
|
+
return "";
|
|
6
|
+
if (typeof children === "object") {
|
|
7
|
+
const childProps = children?.["props"]?.["children"];
|
|
8
|
+
if (childProps)
|
|
9
|
+
return recursivelyGetChildrenString(childProps);
|
|
10
|
+
}
|
|
11
|
+
return "";
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
recursivelyGetChildrenString as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* This hook checks if the element has overflow based on the offsetWidth and scrollWidth of the element.
|
|
4
|
+
*/
|
|
5
|
+
export declare const useIsOverflowing: (ref: MutableRefObject<HTMLElement | HTMLDivElement | undefined | null>, callback?: (hasOverflow: boolean) => void) => boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
const useIsOverflowing = (ref, callback) => {
|
|
3
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const handleResize = () => {
|
|
6
|
+
if (!ref.current) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const element = ref.current;
|
|
10
|
+
const hasOverflow = element.clientWidth < element.scrollWidth;
|
|
11
|
+
setIsOverflowing(hasOverflow);
|
|
12
|
+
};
|
|
13
|
+
setTimeout(() => handleResize(), 0);
|
|
14
|
+
window.addEventListener("resize", handleResize);
|
|
15
|
+
return () => {
|
|
16
|
+
window.removeEventListener("resize", handleResize);
|
|
17
|
+
};
|
|
18
|
+
}, [ref, callback]);
|
|
19
|
+
return isOverflowing;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
useIsOverflowing
|
|
23
|
+
};
|