@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
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { useMemo, useState, useReducer, createContext, useContext } from 'react';
|
|
2
|
-
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
const SelectInputContext = /*#__PURE__*/createContext({
|
|
5
|
-
options: [],
|
|
6
|
-
multiselect: false,
|
|
7
|
-
onSearch: () => {},
|
|
8
|
-
isDropdownVisible: false,
|
|
9
|
-
setIsDropdownVisible: () => {},
|
|
10
|
-
searchInput: '',
|
|
11
|
-
setSearchInput: () => {},
|
|
12
|
-
selectAll: {
|
|
13
|
-
label: ''
|
|
14
|
-
},
|
|
15
|
-
selectAllGroup: false,
|
|
16
|
-
numberOfOptions: 0,
|
|
17
|
-
displayedOptions: [],
|
|
18
|
-
selectedData: {
|
|
19
|
-
allSelected: false,
|
|
20
|
-
selectedGroups: [],
|
|
21
|
-
selectedValues: []
|
|
22
|
-
},
|
|
23
|
-
setSelectedData: () => {},
|
|
24
|
-
onChange: () => {}
|
|
25
|
-
});
|
|
26
|
-
const useSelectInput = () => useContext(SelectInputContext);
|
|
27
|
-
const SelectInputProvider = ({
|
|
28
|
-
options,
|
|
29
|
-
multiselect,
|
|
30
|
-
selectAll,
|
|
31
|
-
value,
|
|
32
|
-
selectAllGroup,
|
|
33
|
-
numberOfOptions,
|
|
34
|
-
children,
|
|
35
|
-
onChange
|
|
36
|
-
}) => {
|
|
37
|
-
const currentValue = useMemo(() => {
|
|
38
|
-
if (value) {
|
|
39
|
-
if (Array.isArray(value)) {
|
|
40
|
-
return value;
|
|
41
|
-
}
|
|
42
|
-
return [value];
|
|
43
|
-
}
|
|
44
|
-
return [];
|
|
45
|
-
}, [value]);
|
|
46
|
-
const selectedGroups = useMemo(() => {
|
|
47
|
-
if (Array.isArray(options)) {
|
|
48
|
-
return [];
|
|
49
|
-
}
|
|
50
|
-
return Object.keys(options).filter(group => options[group].every(groupOption => currentValue.includes(groupOption.value)));
|
|
51
|
-
}, [currentValue, options]);
|
|
52
|
-
const [displayedOptions, setDisplayedOptions] = useState(options);
|
|
53
|
-
const [isDropdownVisible, setIsDropdownVisible] = useState(false);
|
|
54
|
-
const [searchInput, setSearchInput] = useState('');
|
|
55
|
-
const allValues = useMemo(() => {
|
|
56
|
-
if (!Array.isArray(options)) {
|
|
57
|
-
return Object.keys(options).map(group => options[group].filter(option => !option.disabled)).flat();
|
|
58
|
-
}
|
|
59
|
-
return options;
|
|
60
|
-
}, [options]);
|
|
61
|
-
const allGroups = useMemo(() => {
|
|
62
|
-
if (!Array.isArray(options)) {
|
|
63
|
-
return Object.keys(options);
|
|
64
|
-
}
|
|
65
|
-
return [];
|
|
66
|
-
}, [options]);
|
|
67
|
-
const reducer = (state, action) => {
|
|
68
|
-
switch (action.type) {
|
|
69
|
-
case 'selectAll':
|
|
70
|
-
if (state.allSelected) {
|
|
71
|
-
return {
|
|
72
|
-
selectedValues: [],
|
|
73
|
-
allSelected: false,
|
|
74
|
-
selectedGroups: []
|
|
75
|
-
};
|
|
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(selectedValue => !options[action.selectedGroup].find(option => option.value === selectedValue)),
|
|
87
|
-
allSelected: false,
|
|
88
|
-
selectedGroups: state.selectedGroups.filter(selectedGroup => selectedGroup !== action.selectedGroup)
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const newSelectedValues = [...state.selectedValues];
|
|
92
|
-
options[action.selectedGroup].map(option => newSelectedValues.find(aValue => aValue === option.value) || option.disabled ? null : newSelectedValues.push(option.value));
|
|
93
|
-
return {
|
|
94
|
-
selectedValues: newSelectedValues,
|
|
95
|
-
allSelected: newSelectedValues.length === numberOfOptions,
|
|
96
|
-
selectedGroups: [...state.selectedGroups, action.selectedGroup]
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
return state;
|
|
100
|
-
case 'selectOption':
|
|
101
|
-
if (multiselect) {
|
|
102
|
-
if (state.selectedValues.includes(action.clickedOption.value)) {
|
|
103
|
-
return {
|
|
104
|
-
selectedValues: state.selectedValues.filter(val => val !== action.clickedOption.value),
|
|
105
|
-
allSelected: false,
|
|
106
|
-
selectedGroups: action.group && state.selectedGroups.includes(action.group) ? state.selectedGroups.filter(selectedGroup => selectedGroup !== action.group) : []
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
selectedValues: [...state.selectedValues, action.clickedOption.value],
|
|
111
|
-
allSelected: state.selectedValues.length + 1 === numberOfOptions,
|
|
112
|
-
selectedGroups: !Array.isArray(options) && action.group && options[action.group].every(option => [...state.selectedValues, action.clickedOption.value].includes(option.value) || option.disabled) ? [...state.selectedGroups, action.group] : state.selectedGroups
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
selectedValues: [action.clickedOption.value],
|
|
117
|
-
allSelected: false,
|
|
118
|
-
selectedGroups: state.selectedGroups
|
|
119
|
-
};
|
|
120
|
-
case 'clearAll':
|
|
121
|
-
return {
|
|
122
|
-
selectedGroups: [],
|
|
123
|
-
selectedValues: [],
|
|
124
|
-
allSelected: false
|
|
125
|
-
};
|
|
126
|
-
case 'update':
|
|
127
|
-
// update the selected values to only keep non-disabled one
|
|
128
|
-
return {
|
|
129
|
-
selectedGroups: state.selectedGroups,
|
|
130
|
-
allSelected: state.allSelected,
|
|
131
|
-
selectedValues: state.selectedValues.filter(selectedValue => {
|
|
132
|
-
if (!Array.isArray(options)) {
|
|
133
|
-
return Object.keys(options).some(group => options[group].some(option => option.value === selectedValue && !option.disabled));
|
|
134
|
-
}
|
|
135
|
-
return options.some(option => option.value === selectedValue && !option.disabled);
|
|
136
|
-
})
|
|
137
|
-
};
|
|
138
|
-
default:
|
|
139
|
-
return state;
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
const [selectedData, setSelectedData] = useReducer(reducer, {
|
|
143
|
-
selectedValues: currentValue,
|
|
144
|
-
allSelected: false,
|
|
145
|
-
selectedGroups
|
|
146
|
-
});
|
|
147
|
-
const providerValue = useMemo(() => ({
|
|
148
|
-
onSearch: setDisplayedOptions,
|
|
149
|
-
isDropdownVisible,
|
|
150
|
-
setIsDropdownVisible,
|
|
151
|
-
searchInput,
|
|
152
|
-
setSearchInput,
|
|
153
|
-
options,
|
|
154
|
-
multiselect,
|
|
155
|
-
selectAll,
|
|
156
|
-
selectAllGroup,
|
|
157
|
-
numberOfOptions,
|
|
158
|
-
displayedOptions,
|
|
159
|
-
selectedData,
|
|
160
|
-
setSelectedData,
|
|
161
|
-
onChange
|
|
162
|
-
}), [displayedOptions, isDropdownVisible, multiselect, numberOfOptions, options, searchInput, selectAll, selectAllGroup, selectedData, onChange]);
|
|
163
|
-
return jsx(SelectInputContext.Provider, {
|
|
164
|
-
value: providerValue,
|
|
165
|
-
children: children
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export { SelectInputProvider, useSelectInput };
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
|
|
11
|
-
export { findOptionInOptions };
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { Icon } from '@ultraviolet/icons';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { Stack } from '../Stack/index.js';
|
|
5
|
-
import { Text } from '../Text/index.js';
|
|
6
|
-
import { Dropdown } from './Dropdown.js';
|
|
7
|
-
import { SelectBar } from './SelectBar.js';
|
|
8
|
-
import { SelectInputProvider } from './SelectInputProvider.js';
|
|
9
|
-
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
12
|
-
const SelectInputContainer = /*#__PURE__*/_styled("div", {
|
|
13
|
-
target: "ebdnz3x1"
|
|
14
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
15
|
-
name: "1d3w5wq",
|
|
16
|
-
styles: "width:100%"
|
|
17
|
-
} : {
|
|
18
|
-
name: "1d3w5wq",
|
|
19
|
-
styles: "width:100%",
|
|
20
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
-
});
|
|
22
|
-
const HelperText = /*#__PURE__*/_styled(Text, {
|
|
23
|
-
target: "ebdnz3x0"
|
|
24
|
-
})("padding-top:", ({
|
|
25
|
-
theme
|
|
26
|
-
}) => theme.space['0.5'], ";");
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* SelectInputV2 component is used to select one or many elements from a selection.
|
|
30
|
-
*/
|
|
31
|
-
const SelectInputV2 = ({
|
|
32
|
-
name,
|
|
33
|
-
id,
|
|
34
|
-
onBlur,
|
|
35
|
-
onFocus,
|
|
36
|
-
onChange,
|
|
37
|
-
'aria-label': ariaLabel,
|
|
38
|
-
value,
|
|
39
|
-
label,
|
|
40
|
-
helper,
|
|
41
|
-
options,
|
|
42
|
-
size = 'large',
|
|
43
|
-
emptyState,
|
|
44
|
-
descriptionDirection = 'column',
|
|
45
|
-
success,
|
|
46
|
-
error,
|
|
47
|
-
'data-testid': dataTestId,
|
|
48
|
-
className,
|
|
49
|
-
footer,
|
|
50
|
-
placeholderSearch = 'Search in list',
|
|
51
|
-
placeholder = 'Select item',
|
|
52
|
-
searchable = true,
|
|
53
|
-
disabled = false,
|
|
54
|
-
readOnly = false,
|
|
55
|
-
clearable = true,
|
|
56
|
-
multiselect = false,
|
|
57
|
-
required = false,
|
|
58
|
-
labelDescription,
|
|
59
|
-
autofocus,
|
|
60
|
-
loadMore,
|
|
61
|
-
optionalInfoPlacement = 'right',
|
|
62
|
-
isLoading,
|
|
63
|
-
selectAll,
|
|
64
|
-
selectAllGroup = false
|
|
65
|
-
}) => {
|
|
66
|
-
const ref = useRef(null);
|
|
67
|
-
const numberOfOptions = Array.isArray(options) ? options.length : Object.values(options).reduce((acc, current) => acc + current.filter(option => !option.disabled).length, 0);
|
|
68
|
-
return jsx(SelectInputProvider, {
|
|
69
|
-
options: options,
|
|
70
|
-
multiselect: multiselect,
|
|
71
|
-
selectAll: selectAll,
|
|
72
|
-
value: value,
|
|
73
|
-
selectAllGroup: selectAllGroup,
|
|
74
|
-
numberOfOptions: numberOfOptions,
|
|
75
|
-
onChange: onChange,
|
|
76
|
-
children: jsxs(SelectInputContainer, {
|
|
77
|
-
id: id,
|
|
78
|
-
onBlur: onBlur,
|
|
79
|
-
onFocus: onFocus,
|
|
80
|
-
"data-testid": dataTestId,
|
|
81
|
-
className: className,
|
|
82
|
-
"aria-label": name,
|
|
83
|
-
children: [jsx(Dropdown, {
|
|
84
|
-
emptyState: emptyState,
|
|
85
|
-
descriptionDirection: descriptionDirection,
|
|
86
|
-
searchable: searchable,
|
|
87
|
-
placeholder: placeholderSearch,
|
|
88
|
-
footer: footer,
|
|
89
|
-
refSelect: ref,
|
|
90
|
-
loadMore: loadMore,
|
|
91
|
-
optionalInfoPlacement: optionalInfoPlacement,
|
|
92
|
-
isLoading: isLoading,
|
|
93
|
-
children: jsxs(Stack, {
|
|
94
|
-
gap: 0.5,
|
|
95
|
-
"aria-label": ariaLabel,
|
|
96
|
-
children: [jsxs(Stack, {
|
|
97
|
-
direction: "row",
|
|
98
|
-
gap: 0.5,
|
|
99
|
-
children: [label ? jsx(Text, {
|
|
100
|
-
as: "label",
|
|
101
|
-
variant: size === 'large' ? 'bodyStrong' : 'bodySmallStrong',
|
|
102
|
-
children: label
|
|
103
|
-
}) : null, required && label ? jsx(Icon, {
|
|
104
|
-
name: "asterisk",
|
|
105
|
-
sentiment: "danger",
|
|
106
|
-
size: 8
|
|
107
|
-
}) : null, labelDescription ?? null]
|
|
108
|
-
}), jsx(SelectBar, {
|
|
109
|
-
size: size,
|
|
110
|
-
clearable: clearable,
|
|
111
|
-
readOnly: readOnly,
|
|
112
|
-
disabled: disabled,
|
|
113
|
-
placeholder: placeholder,
|
|
114
|
-
success: success,
|
|
115
|
-
error: error,
|
|
116
|
-
autoFocus: autofocus,
|
|
117
|
-
innerRef: ref
|
|
118
|
-
})]
|
|
119
|
-
})
|
|
120
|
-
}), !error && !success ? jsx(HelperText, {
|
|
121
|
-
variant: "caption",
|
|
122
|
-
as: "p",
|
|
123
|
-
sentiment: "neutral",
|
|
124
|
-
prominence: "default",
|
|
125
|
-
children: helper
|
|
126
|
-
}) : null, error || success ? jsx(HelperText, {
|
|
127
|
-
variant: "caption",
|
|
128
|
-
as: "p",
|
|
129
|
-
sentiment: error ? 'danger' : 'success',
|
|
130
|
-
prominence: "default",
|
|
131
|
-
children: error || success
|
|
132
|
-
}) : null]
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
export { SelectInputV2 };
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { forwardRef, useRef, useCallback } from 'react';
|
|
3
|
-
import { Checkbox } from '../Checkbox/index.js';
|
|
4
|
-
import { Radio } from '../Radio/index.js';
|
|
5
|
-
import { Stack } from '../Stack/index.js';
|
|
6
|
-
import { Tooltip } from '../Tooltip/index.js';
|
|
7
|
-
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
10
|
-
const Container = /*#__PURE__*/_styled(Stack, {
|
|
11
|
-
target: "e1s5n3hj3"
|
|
12
|
-
})("&[data-has-label='false']>:first-child{margin-bottom:-", ({
|
|
13
|
-
theme
|
|
14
|
-
}) => theme.space['0.5'], ";}padding:", ({
|
|
15
|
-
theme
|
|
16
|
-
}) => theme.space['2'], ";border-radius:", ({
|
|
17
|
-
theme
|
|
18
|
-
}) => theme.radii.default, ";transition:border-color 200ms ease,box-shadow 200ms ease;cursor:pointer;background:", ({
|
|
19
|
-
theme
|
|
20
|
-
}) => theme.colors.neutral.background, ";border:1px solid ", ({
|
|
21
|
-
theme
|
|
22
|
-
}) => theme.colors.neutral.border, ";color:", ({
|
|
23
|
-
theme
|
|
24
|
-
}) => theme.colors.neutral.text, ";&[data-checked='true']{border:1px solid ", ({
|
|
25
|
-
theme
|
|
26
|
-
}) => theme.colors.primary.border, ";}&[data-error='true']{border:1px solid ", ({
|
|
27
|
-
theme
|
|
28
|
-
}) => theme.colors.danger.border, ";}&[data-disabled='true']{border:1px solid ", ({
|
|
29
|
-
theme
|
|
30
|
-
}) => theme.colors.neutral.borderDisabled, ";color:", ({
|
|
31
|
-
theme
|
|
32
|
-
}) => theme.colors.neutral.textDisabled, ";background:", ({
|
|
33
|
-
theme
|
|
34
|
-
}) => theme.colors.neutral.backgroundDisabled, ";cursor:not-allowed;}&:hover,&:focus-within,&:active{&:not([data-error='true']):not([data-disabled='true']){border:1px solid ", ({
|
|
35
|
-
theme
|
|
36
|
-
}) => theme.colors.primary.border, ";&[data-cheked='false']{box-shadow:", ({
|
|
37
|
-
theme
|
|
38
|
-
}) => theme.shadows.hoverPrimary, ";}}}");
|
|
39
|
-
const StyledStack = /*#__PURE__*/_styled(Stack, {
|
|
40
|
-
target: "e1s5n3hj2"
|
|
41
|
-
})("&[data-has-label='true']{padding-left:", ({
|
|
42
|
-
theme
|
|
43
|
-
}) => theme.space['4'], ";}&[data-has-label='false']{display:contents;}");
|
|
44
|
-
const StyledElement = /*#__PURE__*/_styled('div', {
|
|
45
|
-
shouldForwardProp: prop => !['showTick', 'hasLabel'].includes(prop),
|
|
46
|
-
target: "e1s5n3hj1"
|
|
47
|
-
})("display:inline-flex;align-items:start;&[data-checked='true']{color:", ({
|
|
48
|
-
theme
|
|
49
|
-
}) => theme.colors.primary.text, ";}&[data-error='true']{color:", ({
|
|
50
|
-
theme
|
|
51
|
-
}) => theme.colors.danger.text, ";}&[aria-disabled='true']{color:", ({
|
|
52
|
-
theme
|
|
53
|
-
}) => theme.colors.neutral.textDisabled, ";}input+svg{", ({
|
|
54
|
-
showTick
|
|
55
|
-
}) => !showTick ? `display: none;` : null, ";}label{", ({
|
|
56
|
-
showTick,
|
|
57
|
-
hasLabel
|
|
58
|
-
}) => !showTick && !hasLabel ? `display: none;` : null, ";}");
|
|
59
|
-
const StyledRadio = /*#__PURE__*/StyledElement.withComponent(Radio, {
|
|
60
|
-
target: "e1s5n3hj4"
|
|
61
|
-
});
|
|
62
|
-
const OverloadedCheckbox = /*#__PURE__*/StyledElement.withComponent(Checkbox, {
|
|
63
|
-
target: "e1s5n3hj5"
|
|
64
|
-
});
|
|
65
|
-
const StyledCheckbox = /*#__PURE__*/_styled(OverloadedCheckbox, {
|
|
66
|
-
target: "e1s5n3hj0"
|
|
67
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
68
|
-
name: "1wopizl",
|
|
69
|
-
styles: "label{width:100%;}pointer-events:none"
|
|
70
|
-
} : {
|
|
71
|
-
name: "1wopizl",
|
|
72
|
-
styles: "label{width:100%;}pointer-events:none",
|
|
73
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
74
|
-
});
|
|
75
|
-
/**
|
|
76
|
-
* SelectableCard is a component that can be used to create a radio or checkbox card.
|
|
77
|
-
* It can be used to create a list of selectable items or a single selectable item.
|
|
78
|
-
*/
|
|
79
|
-
const SelectableCard = /*#__PURE__*/forwardRef(({
|
|
80
|
-
name,
|
|
81
|
-
value,
|
|
82
|
-
onChange,
|
|
83
|
-
showTick = false,
|
|
84
|
-
type = 'radio',
|
|
85
|
-
checked = false,
|
|
86
|
-
disabled = false,
|
|
87
|
-
children,
|
|
88
|
-
className,
|
|
89
|
-
isError,
|
|
90
|
-
onFocus,
|
|
91
|
-
onBlur,
|
|
92
|
-
tooltip,
|
|
93
|
-
id,
|
|
94
|
-
label,
|
|
95
|
-
'data-testid': dataTestId
|
|
96
|
-
}, ref) => {
|
|
97
|
-
const innerRef = useRef(null);
|
|
98
|
-
const ParentContainer = useCallback(({
|
|
99
|
-
children: subChildren
|
|
100
|
-
}) => {
|
|
101
|
-
if (tooltip) {
|
|
102
|
-
return jsx(Stack, {
|
|
103
|
-
flex: 1,
|
|
104
|
-
children: jsx(Tooltip, {
|
|
105
|
-
text: tooltip,
|
|
106
|
-
children: subChildren
|
|
107
|
-
})
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return jsx(Tooltip, {
|
|
111
|
-
children: subChildren
|
|
112
|
-
});
|
|
113
|
-
}, [tooltip]);
|
|
114
|
-
return jsx(ParentContainer, {
|
|
115
|
-
children: jsxs(Container, {
|
|
116
|
-
onClick: () => {
|
|
117
|
-
if (innerRef?.current) {
|
|
118
|
-
innerRef.current.click();
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
className: className,
|
|
122
|
-
"data-checked": checked,
|
|
123
|
-
"data-disabled": disabled,
|
|
124
|
-
"data-error": isError,
|
|
125
|
-
"data-testid": dataTestId,
|
|
126
|
-
"data-type": type,
|
|
127
|
-
"data-has-label": !!label,
|
|
128
|
-
ref: ref,
|
|
129
|
-
alignItems: "start",
|
|
130
|
-
direction: "column",
|
|
131
|
-
gap: 0.5,
|
|
132
|
-
flex: 1,
|
|
133
|
-
children: [type === 'radio' ? jsx(StyledRadio, {
|
|
134
|
-
name: name,
|
|
135
|
-
value: value,
|
|
136
|
-
onChange: onChange,
|
|
137
|
-
showTick: showTick,
|
|
138
|
-
checked: checked,
|
|
139
|
-
disabled: disabled,
|
|
140
|
-
error: isError,
|
|
141
|
-
onFocus: onFocus,
|
|
142
|
-
onBlur: onBlur,
|
|
143
|
-
hasLabel: !!label,
|
|
144
|
-
id: id,
|
|
145
|
-
ref: innerRef,
|
|
146
|
-
"data-error": isError,
|
|
147
|
-
label: label
|
|
148
|
-
}) : jsx(StyledCheckbox, {
|
|
149
|
-
name: name,
|
|
150
|
-
value: value,
|
|
151
|
-
onChange: onChange,
|
|
152
|
-
showTick: showTick,
|
|
153
|
-
checked: checked,
|
|
154
|
-
disabled: disabled,
|
|
155
|
-
error: isError,
|
|
156
|
-
onFocus: onFocus,
|
|
157
|
-
onBlur: onBlur,
|
|
158
|
-
hasLabel: !!label,
|
|
159
|
-
id: id,
|
|
160
|
-
ref: innerRef,
|
|
161
|
-
"data-error": isError,
|
|
162
|
-
children: label
|
|
163
|
-
}), children ? jsx(StyledStack, {
|
|
164
|
-
"data-has-label": !!label && showTick,
|
|
165
|
-
width: "100%",
|
|
166
|
-
children: typeof children === 'function' ? children({
|
|
167
|
-
checked,
|
|
168
|
-
disabled
|
|
169
|
-
}) : children
|
|
170
|
-
}) : null]
|
|
171
|
-
})
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
export { SelectableCard };
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { Icon } from '@ultraviolet/icons';
|
|
3
|
-
import { useMemo, createContext, useContext } from 'react';
|
|
4
|
-
import { Row } from '../Row/index.js';
|
|
5
|
-
import { SelectableCard } from '../SelectableCard/index.js';
|
|
6
|
-
import { Stack } from '../Stack/index.js';
|
|
7
|
-
import { Text } from '../Text/index.js';
|
|
8
|
-
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11
|
-
const SelectableCardGroupContext = /*#__PURE__*/createContext(undefined);
|
|
12
|
-
const CardSelectableCard = ({
|
|
13
|
-
value,
|
|
14
|
-
disabled,
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
isError,
|
|
18
|
-
onFocus,
|
|
19
|
-
onBlur,
|
|
20
|
-
tooltip,
|
|
21
|
-
id,
|
|
22
|
-
label,
|
|
23
|
-
'data-testid': dataTestId
|
|
24
|
-
}) => {
|
|
25
|
-
const context = useContext(SelectableCardGroupContext);
|
|
26
|
-
if (!context) {
|
|
27
|
-
throw new Error('SelectableCardGroup.Card can only be used inside a SelectableCardGroup');
|
|
28
|
-
}
|
|
29
|
-
const {
|
|
30
|
-
groupName,
|
|
31
|
-
onChange,
|
|
32
|
-
groupValue,
|
|
33
|
-
type,
|
|
34
|
-
showTick
|
|
35
|
-
} = context;
|
|
36
|
-
return jsx(SelectableCard, {
|
|
37
|
-
name: groupName,
|
|
38
|
-
value: value,
|
|
39
|
-
showTick: showTick,
|
|
40
|
-
type: type,
|
|
41
|
-
disabled: disabled,
|
|
42
|
-
className: className,
|
|
43
|
-
isError: isError,
|
|
44
|
-
onFocus: onFocus,
|
|
45
|
-
onBlur: onBlur,
|
|
46
|
-
tooltip: tooltip,
|
|
47
|
-
id: id,
|
|
48
|
-
label: label,
|
|
49
|
-
onChange: onChange,
|
|
50
|
-
checked: typeof groupValue === 'object' ? groupValue.includes(value) : groupValue === value,
|
|
51
|
-
"data-testid": dataTestId,
|
|
52
|
-
children: children
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
const FieldSet = /*#__PURE__*/_styled("fieldset", {
|
|
56
|
-
target: "e1cxe6lb1"
|
|
57
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
58
|
-
name: "7o2an9",
|
|
59
|
-
styles: "border:none;padding:0;margin:0"
|
|
60
|
-
} : {
|
|
61
|
-
name: "7o2an9",
|
|
62
|
-
styles: "border:none;padding:0;margin:0",
|
|
63
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
64
|
-
});
|
|
65
|
-
const StyledRequiredIcon = /*#__PURE__*/_styled(Icon, {
|
|
66
|
-
target: "e1cxe6lb0"
|
|
67
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
68
|
-
name: "1nglpc5",
|
|
69
|
-
styles: "vertical-align:super"
|
|
70
|
-
} : {
|
|
71
|
-
name: "1nglpc5",
|
|
72
|
-
styles: "vertical-align:super",
|
|
73
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
74
|
-
});
|
|
75
|
-
/**
|
|
76
|
-
* SelectableCardGroup is a component that allows users to select cards from a list of cards using SelectableCard.
|
|
77
|
-
*/
|
|
78
|
-
const SelectableCardGroup = ({
|
|
79
|
-
legend,
|
|
80
|
-
value,
|
|
81
|
-
className,
|
|
82
|
-
helper,
|
|
83
|
-
error,
|
|
84
|
-
columns = 1,
|
|
85
|
-
children,
|
|
86
|
-
onChange,
|
|
87
|
-
name,
|
|
88
|
-
required = false,
|
|
89
|
-
type,
|
|
90
|
-
showTick = false
|
|
91
|
-
}) => {
|
|
92
|
-
const contextValue = useMemo(() => ({
|
|
93
|
-
groupName: name,
|
|
94
|
-
groupValue: value,
|
|
95
|
-
onChange,
|
|
96
|
-
required,
|
|
97
|
-
type,
|
|
98
|
-
showTick
|
|
99
|
-
}), [name, value, onChange, required, type, showTick]);
|
|
100
|
-
return jsx(SelectableCardGroupContext.Provider, {
|
|
101
|
-
value: contextValue,
|
|
102
|
-
children: jsxs(Stack, {
|
|
103
|
-
gap: 1,
|
|
104
|
-
children: [jsx(FieldSet, {
|
|
105
|
-
className: className,
|
|
106
|
-
children: jsxs(Stack, {
|
|
107
|
-
gap: 1.5,
|
|
108
|
-
children: [legend ? jsxs(Text, {
|
|
109
|
-
as: "legend",
|
|
110
|
-
variant: "bodyStrong",
|
|
111
|
-
children: [legend && jsxs(Fragment, {
|
|
112
|
-
children: [legend, " \xA0"]
|
|
113
|
-
}), required ? jsx(StyledRequiredIcon, {
|
|
114
|
-
name: "asterisk",
|
|
115
|
-
color: "danger",
|
|
116
|
-
size: 8
|
|
117
|
-
}) : null]
|
|
118
|
-
}) : null, jsx(Row, {
|
|
119
|
-
gap: 2,
|
|
120
|
-
templateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
121
|
-
children: children
|
|
122
|
-
})]
|
|
123
|
-
})
|
|
124
|
-
}), helper ? jsx(Text, {
|
|
125
|
-
as: "span",
|
|
126
|
-
variant: "caption",
|
|
127
|
-
prominence: "weak",
|
|
128
|
-
sentiment: "neutral",
|
|
129
|
-
children: helper
|
|
130
|
-
}) : null, error ? jsx(Text, {
|
|
131
|
-
as: "span",
|
|
132
|
-
variant: "caption",
|
|
133
|
-
sentiment: "danger",
|
|
134
|
-
children: error
|
|
135
|
-
}) : null]
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
SelectableCardGroup.Card = CardSelectableCard;
|
|
140
|
-
|
|
141
|
-
export { SelectableCardGroup };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import _styled from '@emotion/styled/base';
|
|
2
|
-
import { Icon } from '@ultraviolet/icons';
|
|
3
|
-
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
const StyledIconWrapper = /*#__PURE__*/_styled('div', {
|
|
6
|
-
shouldForwardProp: prop => !['direction'].includes(prop),
|
|
7
|
-
target: "e1d1zom92"
|
|
8
|
-
})("display:flex;flex-direction:", ({
|
|
9
|
-
direction
|
|
10
|
-
}) => direction === 'vertical' ? 'column' : 'row', ";align-items:center;");
|
|
11
|
-
const StyledIcon = /*#__PURE__*/_styled(Icon, {
|
|
12
|
-
target: "e1d1zom91"
|
|
13
|
-
})("fill:", ({
|
|
14
|
-
color,
|
|
15
|
-
theme
|
|
16
|
-
}) => theme.colors[color].borderWeak, ";");
|
|
17
|
-
const StyledHr = /*#__PURE__*/_styled('hr', {
|
|
18
|
-
shouldForwardProp: prop => !['direction', 'thickness', 'color', 'hasIcon'].includes(prop),
|
|
19
|
-
target: "e1d1zom90"
|
|
20
|
-
})("margin:0;border:0;width:", ({
|
|
21
|
-
direction,
|
|
22
|
-
thickness = 1
|
|
23
|
-
}) => direction === 'vertical' ? `${thickness}px` : 'auto', ";height:", ({
|
|
24
|
-
direction,
|
|
25
|
-
thickness = 1
|
|
26
|
-
}) => direction === 'horizontal' ? `${thickness}px` : 'auto', ";flex-shrink:0;background-color:", ({
|
|
27
|
-
theme,
|
|
28
|
-
color
|
|
29
|
-
}) => theme.colors[color].borderWeak, ";", ({
|
|
30
|
-
hasIcon
|
|
31
|
-
}) => hasIcon && `flex: 1;`, ";");
|
|
32
|
-
/**
|
|
33
|
-
* Separator component used to separate content with a horizontal or vertical line.
|
|
34
|
-
*/
|
|
35
|
-
const Separator = ({
|
|
36
|
-
direction = 'horizontal',
|
|
37
|
-
thickness = 1,
|
|
38
|
-
color = 'neutral',
|
|
39
|
-
icon,
|
|
40
|
-
className,
|
|
41
|
-
'data-testid': dataTestId
|
|
42
|
-
}) => icon ? jsxs(StyledIconWrapper, {
|
|
43
|
-
role: "separator",
|
|
44
|
-
"aria-orientation": direction,
|
|
45
|
-
direction: direction,
|
|
46
|
-
className: className,
|
|
47
|
-
"data-testid": dataTestId,
|
|
48
|
-
children: [jsx(StyledHr, {
|
|
49
|
-
direction: direction,
|
|
50
|
-
thickness: thickness,
|
|
51
|
-
color: color,
|
|
52
|
-
hasIcon: true
|
|
53
|
-
}), jsx(StyledIcon, {
|
|
54
|
-
name: icon,
|
|
55
|
-
size: 24,
|
|
56
|
-
color: color
|
|
57
|
-
}), jsx(StyledHr, {
|
|
58
|
-
direction: direction,
|
|
59
|
-
thickness: thickness,
|
|
60
|
-
color: color,
|
|
61
|
-
hasIcon: true
|
|
62
|
-
})]
|
|
63
|
-
}) : jsx(StyledHr, {
|
|
64
|
-
role: "separator",
|
|
65
|
-
"aria-orientation": direction,
|
|
66
|
-
direction: direction,
|
|
67
|
-
thickness: thickness,
|
|
68
|
-
color: color,
|
|
69
|
-
className: className,
|
|
70
|
-
"data-testid": dataTestId
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export { Separator };
|