@ultraviolet/ui 1.51.0 → 1.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionBar/index.d.ts +20 -0
- package/dist/components/ActionBar/index.js +40 -0
- package/dist/components/Alert/index.d.ts +27 -0
- package/dist/components/Alert/index.js +126 -0
- package/dist/components/Avatar/index.d.ts +43 -0
- package/dist/components/Avatar/index.js +54 -0
- package/dist/components/Badge/index.d.ts +31 -0
- package/dist/components/Badge/index.js +115 -0
- package/dist/components/Banner/assets/default-image-small.svg.js +4 -0
- package/dist/components/Banner/assets/default-image.svg.js +4 -0
- package/dist/components/Banner/index.d.ts +24 -0
- package/dist/components/Banner/index.js +191 -0
- package/dist/components/BarChart/Tooltip.d.ts +9 -0
- package/dist/components/BarChart/Tooltip.js +36 -0
- package/dist/components/BarChart/index.d.ts +27 -0
- package/dist/components/BarChart/index.js +82 -0
- package/dist/components/BarStack/index.d.ts +36 -0
- package/dist/components/BarStack/index.js +188 -0
- package/dist/components/Breadcrumbs/index.d.ts +30 -0
- package/dist/components/Breadcrumbs/index.js +76 -0
- package/dist/components/Bullet/index.d.ts +39 -0
- package/dist/components/Bullet/index.js +88 -0
- package/dist/components/Button/index.d.ts +120 -0
- package/dist/components/Button/index.js +291 -0
- package/dist/components/Card/index.d.ts +20 -0
- package/dist/components/Card/index.js +59 -0
- package/dist/components/Carousel/index.d.ts +19 -0
- package/dist/components/Carousel/index.js +147 -0
- package/dist/components/Checkbox/index.d.ts +36 -0
- package/dist/components/Checkbox/index.js +359 -0
- package/dist/components/CheckboxGroup/index.d.ts +24 -0
- package/dist/components/CheckboxGroup/index.js +112 -0
- package/dist/components/CopyButton/index.d.ts +19 -0
- package/dist/components/CopyButton/index.js +37 -0
- package/dist/components/DateInput/datepicker.css.js +4 -0
- package/dist/components/DateInput/index.d.ts +38 -0
- package/dist/components/DateInput/index.js +301 -0
- package/dist/components/Dialog/Context.d.ts +7 -0
- package/dist/components/Dialog/Context.js +15 -0
- package/dist/components/Dialog/constants.d.ts +2 -0
- package/dist/components/Dialog/index.d.ts +87 -0
- package/dist/components/Dialog/index.js +87 -0
- package/dist/components/Dialog/subComponents/Button.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Button.js +24 -0
- package/dist/components/Dialog/subComponents/Buttons.d.ts +7 -0
- package/dist/components/Dialog/subComponents/Buttons.js +12 -0
- package/dist/components/Dialog/subComponents/CancelButton.d.ts +8 -0
- package/dist/components/Dialog/subComponents/CancelButton.js +9 -0
- package/dist/components/Dialog/subComponents/Stack.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Stack.js +6 -0
- package/dist/components/Dialog/subComponents/Text.d.ts +6 -0
- package/dist/components/Dialog/subComponents/Text.js +6 -0
- package/dist/components/EmptyState/index.d.ts +38 -0
- package/dist/components/EmptyState/index.js +82 -0
- package/dist/components/Expandable/index.d.ts +33 -0
- package/dist/components/Expandable/index.js +79 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.d.ts +3 -0
- package/dist/components/GlobalAlert/GlobalAlertLink.js +39 -0
- package/dist/components/GlobalAlert/index.d.ts +40 -0
- package/dist/components/GlobalAlert/index.js +112 -0
- package/dist/components/LineChart/CustomLegend.d.ts +13 -0
- package/dist/components/LineChart/CustomLegend.js +109 -0
- package/dist/components/LineChart/Tooltip.d.ts +6 -0
- package/dist/components/LineChart/Tooltip.js +46 -0
- package/dist/components/LineChart/helpers.d.ts +8 -0
- package/dist/components/LineChart/helpers.js +50 -0
- package/dist/components/LineChart/index.d.ts +25 -0
- package/dist/components/LineChart/index.js +118 -0
- package/dist/components/Link/index.d.ts +33 -0
- package/dist/components/Link/index.js +167 -0
- package/dist/components/List/Body.d.ts +6 -0
- package/dist/components/List/Body.js +11 -0
- package/dist/components/List/Cell.d.ts +12 -0
- package/dist/components/List/Cell.js +38 -0
- package/dist/components/List/HeaderCell.d.ts +11 -0
- package/dist/components/List/HeaderCell.js +96 -0
- package/dist/components/List/HeaderRow.d.ts +7 -0
- package/dist/components/List/HeaderRow.js +38 -0
- package/dist/components/List/ListContext.d.ts +34 -0
- package/dist/components/List/ListContext.js +155 -0
- package/dist/components/List/Row.d.ts +23 -0
- package/dist/components/List/Row.js +194 -0
- package/dist/components/List/SelectBar.d.ts +15 -0
- package/dist/components/List/SelectBar.js +35 -0
- package/dist/components/List/SkeletonRows.d.ts +7 -0
- package/dist/components/List/SkeletonRows.js +36 -0
- package/dist/components/List/constants.d.ts +2 -0
- package/dist/{src/components → components}/List/constants.js +4 -2
- package/dist/components/List/index.d.ts +68 -0
- package/dist/components/List/index.js +80 -0
- package/dist/components/Loader/index.d.ts +22 -0
- package/dist/components/Loader/index.js +98 -0
- package/dist/components/Menu/Item.d.ts +15 -0
- package/dist/components/Menu/Item.js +101 -0
- package/dist/components/Menu/index.d.ts +49 -0
- package/dist/components/Menu/index.js +182 -0
- package/dist/components/MenuV2/Group.d.ts +7 -0
- package/dist/components/MenuV2/Group.js +23 -0
- package/dist/components/MenuV2/Item.d.ts +16 -0
- package/dist/components/MenuV2/Item.js +120 -0
- package/dist/components/MenuV2/index.d.ts +90 -0
- package/dist/components/MenuV2/index.js +124 -0
- package/dist/components/Meter/index.d.ts +26 -0
- package/dist/components/Meter/index.js +76 -0
- package/dist/components/Modal/Dialog.d.ts +3 -0
- package/dist/components/Modal/Dialog.js +197 -0
- package/dist/components/Modal/Disclosure.d.ts +3 -0
- package/dist/{src/components → components}/Modal/Disclosure.js +12 -12
- package/dist/components/Modal/constants.d.ts +3 -0
- package/dist/{src/components → components}/Modal/constants.js +8 -6
- package/dist/components/Modal/index.d.ts +42 -0
- package/dist/components/Modal/index.js +114 -0
- package/dist/components/Modal/types.d.ts +48 -0
- package/dist/components/Notice/index.d.ts +11 -0
- package/dist/components/Notice/index.js +39 -0
- package/dist/components/Notification/index.d.ts +36 -0
- package/dist/components/Notification/index.js +88 -0
- package/dist/components/Notification/react-toastify.css.js +4 -0
- package/dist/components/NumberInput/helpers.d.ts +4 -0
- package/dist/{src/components → components}/NumberInput/helpers.js +6 -2
- package/dist/components/NumberInput/index.d.ts +41 -0
- package/dist/components/NumberInput/index.js +349 -0
- package/dist/components/NumberInputV2/index.d.ts +27 -0
- package/dist/components/NumberInputV2/index.js +370 -0
- package/dist/components/Pagination/getPageNumbers.d.ts +8 -0
- package/dist/{src/components → components}/Pagination/getPageNumbers.js +4 -12
- package/dist/components/Pagination/index.d.ts +30 -0
- package/dist/components/Pagination/index.js +124 -0
- package/dist/components/PasswordCheck/index.d.ts +20 -0
- package/dist/components/PasswordCheck/index.js +29 -0
- package/dist/components/PasswordStrengthMeter/index.d.ts +39 -0
- package/dist/components/PasswordStrengthMeter/index.js +98 -0
- package/dist/components/PieChart/Legends.d.ts +9 -0
- package/dist/components/PieChart/Legends.js +120 -0
- package/dist/components/PieChart/Tooltip.d.ts +12 -0
- package/dist/components/PieChart/Tooltip.js +29 -0
- package/dist/components/PieChart/index.d.ts +20 -0
- package/dist/components/PieChart/index.js +120 -0
- package/dist/components/PieChart/types.d.ts +7 -0
- package/dist/components/Popover/index.d.ts +55 -0
- package/dist/components/Popover/index.js +149 -0
- package/dist/components/Popup/animations.d.ts +11 -0
- package/dist/{src/components → components}/Popup/animations.js +7 -6
- package/dist/components/Popup/helpers.d.ts +31 -0
- package/dist/components/Popup/helpers.js +204 -0
- package/dist/components/Popup/index.d.ts +72 -0
- package/dist/components/Popup/index.js +385 -0
- package/dist/components/ProgressBar/index.d.ts +14 -0
- package/dist/components/ProgressBar/index.js +71 -0
- package/dist/components/Radio/index.d.ts +21 -0
- package/dist/components/Radio/index.js +202 -0
- package/dist/components/RadioGroup/index.d.ts +25 -0
- package/dist/components/RadioGroup/index.js +104 -0
- package/dist/components/Row/index.d.ts +22 -0
- package/dist/components/Row/index.js +43 -0
- package/dist/components/SelectInput/index.d.ts +75 -0
- package/dist/components/SelectInput/index.js +563 -0
- package/dist/components/SelectInputV2/Dropdown.d.ts +23 -0
- package/dist/components/SelectInputV2/Dropdown.js +669 -0
- package/dist/components/SelectInputV2/DropdownOption.d.ts +8 -0
- package/dist/components/SelectInputV2/DropdownOption.js +133 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.d.ts +9 -0
- package/dist/components/SelectInputV2/SearchBarDropdown.js +123 -0
- package/dist/components/SelectInputV2/SelectBar.d.ts +14 -0
- package/dist/components/SelectInputV2/SelectBar.js +327 -0
- package/dist/components/SelectInputV2/SelectInputProvider.d.ts +41 -0
- package/dist/components/SelectInputV2/SelectInputProvider.js +203 -0
- package/dist/components/SelectInputV2/findOptionInOptions.d.ts +2 -0
- package/dist/components/SelectInputV2/findOptionInOptions.js +12 -0
- package/dist/components/SelectInputV2/index.d.ts +115 -0
- package/dist/components/SelectInputV2/index.js +146 -0
- package/dist/components/SelectInputV2/types.d.ts +38 -0
- package/dist/{src/components → components}/SelectInputV2/types.js +4 -2
- package/dist/components/SelectableCard/index.d.ts +25 -0
- package/dist/components/SelectableCard/index.js +193 -0
- package/dist/components/SelectableCardGroup/index.d.ts +23 -0
- package/dist/components/SelectableCardGroup/index.js +112 -0
- package/dist/components/Separator/index.d.ts +17 -0
- package/dist/components/Separator/index.js +76 -0
- package/dist/components/Skeleton/Block.d.ts +3 -0
- package/dist/components/Skeleton/Block.js +30 -0
- package/dist/components/Skeleton/Blocks.d.ts +4 -0
- package/dist/components/Skeleton/Blocks.js +28 -0
- package/dist/components/Skeleton/BoxWithIcon.d.ts +4 -0
- package/dist/components/Skeleton/BoxWithIcon.js +29 -0
- package/dist/components/Skeleton/Donut.d.ts +1 -0
- package/dist/components/Skeleton/Donut.js +36 -0
- package/dist/components/Skeleton/IconSkeleton.d.ts +5 -0
- package/dist/components/Skeleton/IconSkeleton.js +12 -0
- package/dist/components/Skeleton/Line.d.ts +5 -0
- package/dist/components/Skeleton/Line.js +13 -0
- package/dist/components/Skeleton/List.d.ts +4 -0
- package/dist/components/Skeleton/List.js +29 -0
- package/dist/components/Skeleton/Slider.d.ts +3 -0
- package/dist/components/Skeleton/Slider.js +26 -0
- package/dist/components/Skeleton/Square.d.ts +5 -0
- package/dist/components/Skeleton/Square.js +10 -0
- package/dist/components/Skeleton/index.d.ts +47 -0
- package/dist/components/Skeleton/index.js +86 -0
- package/dist/components/Snippet/index.d.ts +23 -0
- package/dist/components/Snippet/index.js +171 -0
- package/dist/components/Stack/index.d.ts +23 -0
- package/dist/components/Stack/index.js +36 -0
- package/dist/components/Status/index.d.ts +32 -0
- package/dist/components/Status/index.js +57 -0
- package/dist/components/StepList/index.d.ts +33 -0
- package/dist/components/StepList/index.js +69 -0
- package/dist/components/Stepper/index.d.ts +15 -0
- package/dist/components/Stepper/index.js +153 -0
- package/dist/components/SwitchButton/FocusOverlay.d.ts +8 -0
- package/dist/components/SwitchButton/FocusOverlay.js +47 -0
- package/dist/components/SwitchButton/index.d.ts +26 -0
- package/dist/components/SwitchButton/index.js +140 -0
- package/dist/components/Table/Body.d.ts +6 -0
- package/dist/components/Table/Body.js +5 -0
- package/dist/components/Table/Cell.d.ts +9 -0
- package/dist/components/Table/Cell.js +10 -0
- package/dist/components/Table/Header.d.ts +6 -0
- package/dist/components/Table/Header.js +9 -0
- package/dist/components/Table/HeaderCell.d.ts +14 -0
- package/dist/components/Table/HeaderCell.js +123 -0
- package/dist/components/Table/HeaderRow.d.ts +7 -0
- package/dist/components/Table/HeaderRow.js +25 -0
- package/dist/components/Table/Row.d.ts +14 -0
- package/dist/components/Table/Row.js +85 -0
- package/dist/components/Table/SelectBar.d.ts +15 -0
- package/dist/components/Table/SelectBar.js +35 -0
- package/dist/components/Table/SkeletonRows.d.ts +7 -0
- package/dist/components/Table/SkeletonRows.js +22 -0
- package/dist/components/Table/TableContext.d.ts +27 -0
- package/dist/components/Table/TableContext.js +103 -0
- package/dist/components/Table/index.d.ts +60 -0
- package/dist/components/Table/index.js +81 -0
- package/dist/components/Tabs/Tab.d.ts +20 -0
- package/dist/components/Tabs/Tab.js +170 -0
- package/dist/components/Tabs/TabMenu.d.ts +8 -0
- package/dist/components/Tabs/TabMenu.js +63 -0
- package/dist/components/Tabs/TabMenuItem.d.ts +20 -0
- package/dist/components/Tabs/TabMenuItem.js +39 -0
- package/dist/components/Tabs/TabsContext.d.ts +8 -0
- package/dist/components/Tabs/TabsContext.js +9 -0
- package/dist/components/Tabs/index.d.ts +50 -0
- package/dist/components/Tabs/index.js +137 -0
- package/dist/components/Tag/index.d.ts +26 -0
- package/dist/components/Tag/index.js +153 -0
- package/dist/components/TagInput/index.d.ts +55 -0
- package/dist/components/TagInput/index.js +316 -0
- package/dist/components/TagList/index.d.ts +37 -0
- package/dist/components/TagList/index.js +103 -0
- package/dist/components/Text/index.d.ts +40 -0
- package/dist/components/Text/index.js +107 -0
- package/dist/components/TextArea/index.d.ts +50 -0
- package/dist/components/TextArea/index.js +226 -0
- package/dist/components/TextInput/index.d.ts +75 -0
- package/dist/components/TextInput/index.js +472 -0
- package/dist/components/TextInputV2/index.d.ts +30 -0
- package/dist/components/TextInputV2/index.js +314 -0
- package/dist/components/TimeInput/index.d.ts +25 -0
- package/dist/components/TimeInput/index.js +199 -0
- package/dist/components/Toaster/index.d.ts +46 -0
- package/dist/components/Toaster/index.js +131 -0
- package/dist/components/Toaster/react-toastify.css.js +4 -0
- package/dist/components/Toggle/index.d.ts +34 -0
- package/dist/components/Toggle/index.js +196 -0
- package/dist/components/ToggleGroup/index.d.ts +24 -0
- package/dist/components/ToggleGroup/index.js +87 -0
- package/dist/components/Tooltip/index.d.ts +9 -0
- package/dist/components/Tooltip/index.js +47 -0
- package/dist/components/VerificationCode/index.d.ts +36 -0
- package/dist/components/VerificationCode/index.js +222 -0
- package/dist/components/index.d.ts +75 -0
- package/dist/helpers/isJSON.d.ts +2 -0
- package/dist/{src/helpers → helpers}/isJSON.js +4 -3
- package/dist/helpers/jestMockMatchMedia.d.ts +6 -0
- package/dist/helpers/keycode.d.ts +3 -0
- package/dist/helpers/legend.d.ts +2 -0
- package/dist/helpers/legend.js +14 -0
- package/dist/helpers/numbers.d.ts +2 -0
- package/dist/helpers/recursivelyGetChildrenString.d.ts +3 -0
- package/dist/helpers/recursivelyGetChildrenString.js +15 -0
- package/dist/hooks/useIsOverflowing.d.ts +5 -0
- package/dist/hooks/useIsOverflowing.js +23 -0
- package/dist/index.d.ts +4 -3693
- package/dist/index.js +187 -0
- package/dist/mocks/list.d.ts +12 -0
- package/dist/theme/index.d.ts +1573 -0
- package/dist/theme/index.js +30 -0
- package/dist/types.d.ts +6 -0
- package/dist/utils/animations.d.ts +27 -0
- package/dist/{src/utils → utils}/animations.js +30 -4
- package/dist/utils/capitalize.d.ts +2 -0
- package/dist/utils/capitalize.js +4 -0
- package/dist/utils/ids.d.ts +1 -0
- package/dist/utils/ids.js +6 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/normalize.d.ts +2 -0
- package/dist/{src/utils → utils}/normalize.js +4 -3
- package/dist/utils/orderBy.d.ts +2 -0
- package/dist/utils/responsive/Breakpoint.d.ts +9 -0
- package/dist/utils/responsive/Breakpoint.js +13 -0
- package/dist/utils/responsive/index.d.ts +2 -0
- package/dist/utils/responsive/utilities.d.ts +3 -0
- package/dist/{src/utils → utils}/responsive/utilities.js +9 -6
- package/package.json +23 -13
- package/dist/react-datepicker/dist/react-datepicker.min.css.js +0 -3
- package/dist/react-toastify/dist/ReactToastify.min.css.js +0 -3
- package/dist/src/components/ActionBar/index.js +0 -40
- package/dist/src/components/Alert/index.js +0 -133
- package/dist/src/components/Avatar/index.js +0 -74
- package/dist/src/components/Badge/index.js +0 -116
- package/dist/src/components/Banner/assets/default-image-small.svg.js +0 -5
- package/dist/src/components/Banner/assets/default-image.svg.js +0 -5
- package/dist/src/components/Banner/index.js +0 -159
- package/dist/src/components/BarChart/Tooltip.js +0 -48
- package/dist/src/components/BarChart/index.js +0 -95
- package/dist/src/components/BarStack/index.js +0 -136
- package/dist/src/components/Breadcrumbs/index.js +0 -82
- package/dist/src/components/Bullet/index.js +0 -98
- package/dist/src/components/Button/index.js +0 -311
- package/dist/src/components/Card/index.js +0 -67
- package/dist/src/components/Carousel/index.js +0 -128
- package/dist/src/components/Checkbox/index.js +0 -316
- package/dist/src/components/CheckboxGroup/index.js +0 -143
- package/dist/src/components/CopyButton/index.js +0 -37
- package/dist/src/components/DateInput/index.js +0 -242
- package/dist/src/components/Dialog/Context.js +0 -12
- package/dist/src/components/Dialog/index.js +0 -88
- package/dist/src/components/Dialog/subComponents/Button.js +0 -21
- package/dist/src/components/Dialog/subComponents/Buttons.js +0 -14
- package/dist/src/components/Dialog/subComponents/CancelButton.js +0 -14
- package/dist/src/components/Dialog/subComponents/Stack.js +0 -11
- package/dist/src/components/Dialog/subComponents/Text.js +0 -12
- package/dist/src/components/EmptyState/index.js +0 -112
- package/dist/src/components/Expandable/index.js +0 -96
- package/dist/src/components/GlobalAlert/GlobalAlertLink.js +0 -38
- package/dist/src/components/GlobalAlert/index.js +0 -82
- package/dist/src/components/LineChart/CustomLegend.js +0 -138
- package/dist/src/components/LineChart/Tooltip.js +0 -43
- package/dist/src/components/LineChart/helpers.js +0 -40
- package/dist/src/components/LineChart/index.js +0 -131
- package/dist/src/components/Link/index.js +0 -147
- package/dist/src/components/List/Body.js +0 -16
- package/dist/src/components/List/Cell.js +0 -43
- package/dist/src/components/List/HeaderCell.js +0 -90
- package/dist/src/components/List/HeaderRow.js +0 -43
- package/dist/src/components/List/ListContext.js +0 -138
- package/dist/src/components/List/Row.js +0 -185
- package/dist/src/components/List/SelectBar.js +0 -48
- package/dist/src/components/List/SkeletonRows.js +0 -53
- package/dist/src/components/List/index.js +0 -75
- package/dist/src/components/Loader/index.js +0 -100
- package/dist/src/components/Menu/Item.js +0 -112
- package/dist/src/components/Menu/index.js +0 -129
- package/dist/src/components/MenuV2/Group.js +0 -25
- package/dist/src/components/MenuV2/Item.js +0 -139
- package/dist/src/components/MenuV2/index.js +0 -116
- package/dist/src/components/Meter/index.js +0 -76
- package/dist/src/components/Modal/Dialog.js +0 -182
- package/dist/src/components/Modal/index.js +0 -113
- package/dist/src/components/Notice/index.js +0 -34
- package/dist/src/components/Notification/index.js +0 -77
- package/dist/src/components/NumberInput/index.js +0 -299
- package/dist/src/components/NumberInputV2/index.js +0 -284
- package/dist/src/components/Pagination/index.js +0 -117
- package/dist/src/components/PasswordCheck/index.js +0 -41
- package/dist/src/components/PasswordStrengthMeter/index.js +0 -102
- package/dist/src/components/PieChart/Legends.js +0 -138
- package/dist/src/components/PieChart/Tooltip.js +0 -61
- package/dist/src/components/PieChart/index.js +0 -125
- package/dist/src/components/Popover/index.js +0 -144
- package/dist/src/components/Popup/helpers.js +0 -252
- package/dist/src/components/Popup/index.js +0 -363
- package/dist/src/components/ProgressBar/index.js +0 -57
- package/dist/src/components/Radio/index.js +0 -157
- package/dist/src/components/RadioGroup/index.js +0 -131
- package/dist/src/components/Row/index.js +0 -41
- package/dist/src/components/SelectInput/index.js +0 -610
- package/dist/src/components/SelectInputV2/Dropdown.js +0 -594
- package/dist/src/components/SelectInputV2/DropdownOption.js +0 -130
- package/dist/src/components/SelectInputV2/SearchBarDropdown.js +0 -128
- package/dist/src/components/SelectInputV2/SelectBar.js +0 -282
- package/dist/src/components/SelectInputV2/SelectInputProvider.js +0 -169
- package/dist/src/components/SelectInputV2/findOptionInOptions.js +0 -11
- package/dist/src/components/SelectInputV2/index.js +0 -137
- package/dist/src/components/SelectableCard/index.js +0 -175
- package/dist/src/components/SelectableCardGroup/index.js +0 -141
- package/dist/src/components/Separator/index.js +0 -73
- package/dist/src/components/Skeleton/Block.js +0 -35
- package/dist/src/components/Skeleton/Blocks.js +0 -34
- package/dist/src/components/Skeleton/BoxWithIcon.js +0 -32
- package/dist/src/components/Skeleton/Donut.js +0 -55
- package/dist/src/components/Skeleton/IconSkeleton.js +0 -19
- package/dist/src/components/Skeleton/Line.js +0 -13
- package/dist/src/components/Skeleton/List.js +0 -51
- package/dist/src/components/Skeleton/Slider.js +0 -36
- package/dist/src/components/Skeleton/Square.js +0 -9
- package/dist/src/components/Skeleton/index.js +0 -82
- package/dist/src/components/Snippet/index.js +0 -200
- package/dist/src/components/Stack/index.js +0 -29
- package/dist/src/components/Status/index.js +0 -74
- package/dist/src/components/StepList/index.js +0 -69
- package/dist/src/components/Stepper/index.js +0 -150
- package/dist/src/components/SwitchButton/FocusOverlay.js +0 -37
- package/dist/src/components/SwitchButton/index.js +0 -108
- package/dist/src/components/Table/Body.js +0 -9
- package/dist/src/components/Table/Cell.js +0 -21
- package/dist/src/components/Table/Header.js +0 -15
- package/dist/src/components/Table/HeaderCell.js +0 -103
- package/dist/src/components/Table/HeaderRow.js +0 -32
- package/dist/src/components/Table/Row.js +0 -89
- package/dist/src/components/Table/SelectBar.js +0 -48
- package/dist/src/components/Table/SkeletonRows.js +0 -51
- package/dist/src/components/Table/TableContext.js +0 -90
- package/dist/src/components/Table/index.js +0 -82
- package/dist/src/components/Tabs/Tab.js +0 -138
- package/dist/src/components/Tabs/TabMenu.js +0 -59
- package/dist/src/components/Tabs/TabMenuItem.js +0 -36
- package/dist/src/components/Tabs/TabsContext.js +0 -6
- package/dist/src/components/Tabs/index.js +0 -117
- package/dist/src/components/Tag/index.js +0 -169
- package/dist/src/components/TagInput/index.js +0 -309
- package/dist/src/components/TagList/index.js +0 -106
- package/dist/src/components/Text/index.js +0 -107
- package/dist/src/components/TextArea/index.js +0 -210
- package/dist/src/components/TextInput/index.js +0 -451
- package/dist/src/components/TextInputV2/index.js +0 -289
- package/dist/src/components/TimeInput/index.js +0 -37
- package/dist/src/components/Toaster/index.js +0 -131
- package/dist/src/components/Toggle/index.js +0 -160
- package/dist/src/components/ToggleGroup/index.js +0 -122
- package/dist/src/components/Tooltip/index.js +0 -55
- package/dist/src/components/VerificationCode/index.js +0 -222
- package/dist/src/helpers/legend.js +0 -13
- package/dist/src/helpers/recursivelyGetChildrenString.js +0 -11
- package/dist/src/hooks/useIsOverflowing.js +0 -34
- package/dist/src/index.js +0 -77
- package/dist/src/theme/index.js +0 -29
- package/dist/src/utils/capitalize.js +0 -3
- package/dist/src/utils/ids.js +0 -7
- package/dist/src/utils/responsive/Breakpoint.js +0 -12
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { useRef, useEffect, useState } from "react";
|
|
4
|
+
const StyledWrapper = styled.div`
|
|
5
|
+
position: relative;
|
|
6
|
+
margin-left: -100px;
|
|
7
|
+
margin-right: -100px;
|
|
8
|
+
`;
|
|
9
|
+
const StyledBeforeScroll = styled.span`
|
|
10
|
+
position: absolute;
|
|
11
|
+
width: 100px;
|
|
12
|
+
height: 100%;
|
|
13
|
+
content: '';
|
|
14
|
+
background: linear-gradient(
|
|
15
|
+
-90deg,
|
|
16
|
+
${({ theme }) => theme.colors.neutral.background}ff,
|
|
17
|
+
${({ theme }) => theme.colors.neutral.background}
|
|
18
|
+
);
|
|
19
|
+
cursor: w-resize;
|
|
20
|
+
z-index: auto;
|
|
21
|
+
`;
|
|
22
|
+
const StyledScrollableWrapper = styled.div`
|
|
23
|
+
overflow-x: scroll;
|
|
24
|
+
overflow-y: hidden;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
display: flex;
|
|
27
|
+
padding: 0 100px;
|
|
28
|
+
gap: ${({ theme }) => theme.space["2"]};
|
|
29
|
+
`;
|
|
30
|
+
const StyledAfterScroll = styled.span`
|
|
31
|
+
position: absolute;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
width: 100px;
|
|
35
|
+
height: 100%;
|
|
36
|
+
content: '';
|
|
37
|
+
cursor: e-resize;
|
|
38
|
+
z-index: auto;
|
|
39
|
+
background: linear-gradient(
|
|
40
|
+
-90deg,
|
|
41
|
+
${({ theme }) => theme.colors.neutral.background},
|
|
42
|
+
${({ theme }) => theme.colors.neutral.background}ff
|
|
43
|
+
);
|
|
44
|
+
`;
|
|
45
|
+
const StyledBorderWrapper = styled("div", {
|
|
46
|
+
shouldForwardProp: (prop) => !["width"].includes(prop)
|
|
47
|
+
})`
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: stretch;
|
|
50
|
+
width: ${({ width }) => width};
|
|
51
|
+
max-width: ${({ width }) => width};
|
|
52
|
+
overflow-wrap: break-word;
|
|
53
|
+
white-space: normal;
|
|
54
|
+
height: auto;
|
|
55
|
+
cursor: grab;
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
`;
|
|
58
|
+
const CarouselItem = ({
|
|
59
|
+
children,
|
|
60
|
+
width = "240px"
|
|
61
|
+
}) => /* @__PURE__ */ jsx(StyledBorderWrapper, { width, draggable: "true", children });
|
|
62
|
+
const Carousel = ({
|
|
63
|
+
children,
|
|
64
|
+
className,
|
|
65
|
+
"data-testid": dataTestId = "scrollbar"
|
|
66
|
+
}) => {
|
|
67
|
+
const scrollRef = useRef(null);
|
|
68
|
+
let intervalLeft;
|
|
69
|
+
let intervalRight;
|
|
70
|
+
const handleScrollRight = () => {
|
|
71
|
+
intervalRight = setInterval(() => {
|
|
72
|
+
if (scrollRef.current?.scrollTo && scrollRef.current?.scrollLeft) {
|
|
73
|
+
scrollRef.current.scrollTo?.(scrollRef.current.scrollLeft - 25, 0);
|
|
74
|
+
}
|
|
75
|
+
}, 30);
|
|
76
|
+
};
|
|
77
|
+
const handleScrollLeft = () => {
|
|
78
|
+
intervalLeft = setInterval(() => {
|
|
79
|
+
if (scrollRef.current?.scrollTo && scrollRef.current?.scrollLeft) {
|
|
80
|
+
scrollRef.current.scrollTo(scrollRef.current.scrollLeft + 25, 0);
|
|
81
|
+
}
|
|
82
|
+
}, 30);
|
|
83
|
+
};
|
|
84
|
+
const handleScrollX = (scrollX = 25) => {
|
|
85
|
+
if (scrollRef.current?.scrollTo && scrollRef.current?.scrollLeft) {
|
|
86
|
+
scrollRef.current.scrollTo?.(scrollRef.current.scrollLeft + scrollX, 0);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const cleanUp = () => {
|
|
90
|
+
clearInterval(intervalLeft);
|
|
91
|
+
clearInterval(intervalRight);
|
|
92
|
+
};
|
|
93
|
+
useEffect(() => cleanUp);
|
|
94
|
+
const [dragStartX, setDragStartX] = useState(0);
|
|
95
|
+
const [deltaX, setDeltaX] = useState(0);
|
|
96
|
+
return /* @__PURE__ */ jsxs(StyledWrapper, { className, "data-testid": dataTestId, children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
StyledBeforeScroll,
|
|
99
|
+
{
|
|
100
|
+
"data-testid": `${dataTestId}-before`,
|
|
101
|
+
onMouseOver: handleScrollRight,
|
|
102
|
+
onMouseLeave: () => clearInterval(intervalRight)
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
StyledScrollableWrapper,
|
|
107
|
+
{
|
|
108
|
+
ref: scrollRef,
|
|
109
|
+
onDragOver: (e) => {
|
|
110
|
+
setDeltaX(dragStartX - e.pageX);
|
|
111
|
+
setDragStartX(e.pageX);
|
|
112
|
+
},
|
|
113
|
+
onDragStart: (e) => {
|
|
114
|
+
const blankImg = new Image();
|
|
115
|
+
blankImg.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
|
|
116
|
+
e.dataTransfer.setDragImage(blankImg, 0, 0);
|
|
117
|
+
setDragStartX(e.clientX);
|
|
118
|
+
},
|
|
119
|
+
onDrag: () => handleScrollX(deltaX),
|
|
120
|
+
onDragEnd: () => {
|
|
121
|
+
setDeltaX(0);
|
|
122
|
+
setDragStartX(0);
|
|
123
|
+
},
|
|
124
|
+
onMouseUp: (e) => {
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
e.stopPropagation();
|
|
127
|
+
},
|
|
128
|
+
className,
|
|
129
|
+
"data-testid": `${dataTestId}-wrapper`,
|
|
130
|
+
children
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
StyledAfterScroll,
|
|
135
|
+
{
|
|
136
|
+
"data-testid": `${dataTestId}-after`,
|
|
137
|
+
onMouseOver: handleScrollLeft,
|
|
138
|
+
onMouseLeave: () => clearInterval(intervalLeft)
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] });
|
|
142
|
+
};
|
|
143
|
+
Carousel.Item = CarouselItem;
|
|
144
|
+
export {
|
|
145
|
+
Carousel,
|
|
146
|
+
CarouselItem
|
|
147
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { XOR } from '../../types';
|
|
3
|
+
type CheckboxProps = {
|
|
4
|
+
error?: string | ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Size prop is deprecated and will be removed in next major update.
|
|
7
|
+
*/
|
|
8
|
+
size?: number;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Progress prop is deprecated and will be removed in next major update.
|
|
11
|
+
*/
|
|
12
|
+
progress?: boolean;
|
|
13
|
+
helper?: ReactNode;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
checked?: boolean | 'indeterminate';
|
|
16
|
+
className?: string;
|
|
17
|
+
['data-visibility']?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
'data-testid'?: string;
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
} & Pick<InputHTMLAttributes<HTMLInputElement>, 'onFocus' | 'onBlur' | 'name' | 'value' | 'autoFocus' | 'id' | 'onChange' | 'tabIndex'> & XOR<[
|
|
22
|
+
{
|
|
23
|
+
/**
|
|
24
|
+
* **`children` or `aria-label` property is required**
|
|
25
|
+
*/
|
|
26
|
+
'aria-label': string;
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
]>;
|
|
32
|
+
/**
|
|
33
|
+
* Checkbox is an input component used to select or deselect an option.
|
|
34
|
+
*/
|
|
35
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@emotion/react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { Icon } from "@ultraviolet/icons";
|
|
5
|
+
import { forwardRef, useState, useId, useEffect, useCallback } from "react";
|
|
6
|
+
import { Loader } from "../Loader/index.js";
|
|
7
|
+
import { Stack } from "../Stack/index.js";
|
|
8
|
+
import { Text } from "../Text/index.js";
|
|
9
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
10
|
+
const ErrorText = styled(Text)`
|
|
11
|
+
padding-top: ${({ theme }) => `${theme.space["0.5"]}`};
|
|
12
|
+
`;
|
|
13
|
+
const InnerCheckbox = styled.rect`
|
|
14
|
+
fill: ${({ theme }) => theme.colors.neutral.background};
|
|
15
|
+
stroke: ${({ theme }) => theme.colors.neutral.border};
|
|
16
|
+
`;
|
|
17
|
+
const CheckMixedMark = styled.rect``;
|
|
18
|
+
const CheckboxIconContainer = ({ children }) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
InnerCheckbox,
|
|
23
|
+
{
|
|
24
|
+
x: "4",
|
|
25
|
+
y: "4",
|
|
26
|
+
width: "16",
|
|
27
|
+
height: "16",
|
|
28
|
+
rx: theme.radii.small,
|
|
29
|
+
strokeWidth: "2"
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
children
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
35
|
+
const StyledIcon = styled("svg")`
|
|
36
|
+
border-radius: ${({ theme }) => theme.radii.default};
|
|
37
|
+
height: ${({ size }) => size}px;
|
|
38
|
+
width: ${({ size }) => size}px;
|
|
39
|
+
min-width: ${({ size }) => size}px;
|
|
40
|
+
min-height: ${({ size }) => size}px;
|
|
41
|
+
|
|
42
|
+
& path {
|
|
43
|
+
fill: ${({ theme }) => theme.colors.neutral.background};
|
|
44
|
+
transform: translate(2px, 2px);
|
|
45
|
+
transform: scale(0);
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
const StyledLabel = styled("label")`
|
|
49
|
+
width: 100%;
|
|
50
|
+
`;
|
|
51
|
+
const CheckboxInput = styled("input", {
|
|
52
|
+
shouldForwardProp: (prop) => !["size"].includes(prop)
|
|
53
|
+
})`
|
|
54
|
+
position: absolute;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
height: ${({ size }) => size}px;
|
|
57
|
+
width: ${({ size }) => size}px;
|
|
58
|
+
opacity: 0;
|
|
59
|
+
border-width: 0;
|
|
60
|
+
|
|
61
|
+
&:not(:disabled) {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:disabled {
|
|
66
|
+
cursor: not-allowed;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:not(:disabled) {
|
|
70
|
+
&:checked + ${StyledIcon}, &[aria-checked='mixed'] + ${StyledIcon} {
|
|
71
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrong};
|
|
72
|
+
|
|
73
|
+
${InnerCheckbox} {
|
|
74
|
+
stroke: ${({ theme }) => theme.colors.primary.borderStrong};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[aria-invalid='true']
|
|
79
|
+
+ ${StyledIcon},
|
|
80
|
+
&[aria-invalid='mixed']
|
|
81
|
+
+ ${StyledIcon} {
|
|
82
|
+
fill: ${({ theme }) => theme.colors.danger.background};
|
|
83
|
+
|
|
84
|
+
${InnerCheckbox} {
|
|
85
|
+
stroke: ${({ theme }) => theme.colors.danger.border};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:focus + ${StyledIcon} {
|
|
91
|
+
background-color: ${({ theme }) => theme.colors.primary.background};
|
|
92
|
+
fill: ${({ theme }) => theme.colors.danger.background};
|
|
93
|
+
outline: 1px solid ${({ theme }) => theme.shadows.focusPrimary};
|
|
94
|
+
|
|
95
|
+
${InnerCheckbox} {
|
|
96
|
+
stroke: ${({ theme }) => theme.colors.primary.borderHover};
|
|
97
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundHover};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&[aria-invalid='true']:focus + ${StyledIcon} {
|
|
102
|
+
background-color: ${({ theme }) => theme.colors.danger.background};
|
|
103
|
+
fill: ${({ theme }) => theme.colors.danger.background};
|
|
104
|
+
outline: 1px solid ${({ theme }) => theme.shadows.focusDanger};
|
|
105
|
+
|
|
106
|
+
${InnerCheckbox} {
|
|
107
|
+
stroke: ${({ theme }) => theme.colors.danger.borderHover};
|
|
108
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundHover};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
const CheckboxContainer = styled.div`
|
|
113
|
+
position: relative;
|
|
114
|
+
display: inline-flex;
|
|
115
|
+
align-items: start;
|
|
116
|
+
gap: ${({ theme }) => theme.space["1"]};
|
|
117
|
+
|
|
118
|
+
${StyledLabel} {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&[aria-disabled='true'] {
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
|
|
125
|
+
${StyledLabel} {
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
color: ${({ theme }) => theme.colors.neutral.textDisabled};
|
|
130
|
+
|
|
131
|
+
${StyledIcon} {
|
|
132
|
+
fill: ${({ theme }) => theme.colors.neutral.borderDisabled};
|
|
133
|
+
|
|
134
|
+
${InnerCheckbox} {
|
|
135
|
+
stroke: ${({ theme }) => theme.colors.neutral.borderStrongDisabled};
|
|
136
|
+
fill: ${({ theme }) => theme.colors.neutral.backgroundDisabled};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
${CheckboxInput}[aria-invalid="true"]:checked + ${StyledIcon} {
|
|
141
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundStrongDisabled};
|
|
142
|
+
|
|
143
|
+
${InnerCheckbox} {
|
|
144
|
+
stroke: ${({ theme }) => theme.colors.danger.borderStrongDisabled};
|
|
145
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundStrongDisabled};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
${CheckboxInput}[aria-invalid="true"] + ${StyledIcon} {
|
|
150
|
+
fill: ${({ theme }) => theme.colors.danger.background};
|
|
151
|
+
|
|
152
|
+
${InnerCheckbox} {
|
|
153
|
+
stroke: ${({ theme }) => theme.colors.danger.borderDisabled};
|
|
154
|
+
fill: ${({ theme }) => theme.colors.danger.background};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
${CheckboxInput}:checked + ${StyledIcon} {
|
|
159
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrongDisabled};
|
|
160
|
+
|
|
161
|
+
${InnerCheckbox} {
|
|
162
|
+
stroke: ${({ theme }) => theme.colors.primary.borderDisabled};
|
|
163
|
+
fill: ${({ theme }) => theme.colors.primary.borderDisabled};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
${CheckboxInput}[aria-checked="mixed"] + ${StyledIcon} {
|
|
168
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrongDisabled};
|
|
169
|
+
|
|
170
|
+
${InnerCheckbox} {
|
|
171
|
+
stroke: ${({ theme }) => theme.colors.primary.borderStrongDisabled};
|
|
172
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrongDisabled};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
${CheckboxInput}:checked + ${StyledIcon} path {
|
|
178
|
+
transform-origin: center;
|
|
179
|
+
transition: 200ms transform ease-in-out;
|
|
180
|
+
transform: scale(1);
|
|
181
|
+
transform: translate(2px, 2px);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
${CheckboxInput}:checked + ${StyledIcon} ${InnerCheckbox} {
|
|
185
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrong};
|
|
186
|
+
stroke: ${({ theme }) => theme.colors.primary.borderStrong};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
${CheckboxInput}[aria-invalid="true"]:checked + ${StyledIcon} ${InnerCheckbox} {
|
|
190
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundStrong};
|
|
191
|
+
stroke: ${({ theme }) => theme.colors.danger.borderStrong};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
${CheckboxInput}[aria-checked="mixed"] + ${StyledIcon} {
|
|
195
|
+
${CheckMixedMark} {
|
|
196
|
+
fill: ${({ theme }) => theme.colors.neutral.iconStronger};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
${InnerCheckbox} {
|
|
200
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrong};
|
|
201
|
+
stroke: ${({ theme }) => theme.colors.primary.borderStrong};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&:hover[aria-disabled='false'] {
|
|
206
|
+
${CheckboxInput}[aria-invalid='false'] {
|
|
207
|
+
&[aria-checked='false'] + ${StyledIcon} ${InnerCheckbox} {
|
|
208
|
+
stroke: ${({ theme }) => theme.colors.primary.borderHover};
|
|
209
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundHover};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&[aria-checked='true'] + ${StyledIcon} ${InnerCheckbox} {
|
|
213
|
+
stroke: ${({ theme }) => theme.colors.primary.borderStrongHover};
|
|
214
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrongHover};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&[aria-checked='mixed'] + ${StyledIcon} ${InnerCheckbox} {
|
|
218
|
+
stroke: ${({ theme }) => theme.colors.primary.borderStrongHover};
|
|
219
|
+
fill: ${({ theme }) => theme.colors.primary.backgroundStrongHover};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
${CheckboxInput}[aria-invalid='true'] {
|
|
224
|
+
&[aria-checked='false'] + ${StyledIcon} ${InnerCheckbox} {
|
|
225
|
+
stroke: ${({ theme }) => theme.colors.danger.borderHover};
|
|
226
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundHover};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&[aria-checked='true'] + ${StyledIcon} ${InnerCheckbox} {
|
|
230
|
+
stroke: ${({ theme }) => theme.colors.danger.borderStrongHover};
|
|
231
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundStrongHover};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
${CheckboxInput}[aria-invalid="true"] + ${StyledIcon} {
|
|
237
|
+
fill: ${({ theme }) => theme.colors.danger.backgroundStrong};
|
|
238
|
+
|
|
239
|
+
${InnerCheckbox} {
|
|
240
|
+
stroke: ${({ theme }) => theme.colors.danger.backgroundStrong};
|
|
241
|
+
fill: ${({ theme }) => theme.colors.danger.background};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
`;
|
|
245
|
+
const StyledActivityContainer = styled.div`
|
|
246
|
+
display: flex;
|
|
247
|
+
`;
|
|
248
|
+
const Checkbox = forwardRef(
|
|
249
|
+
({
|
|
250
|
+
id,
|
|
251
|
+
checked = false,
|
|
252
|
+
onChange,
|
|
253
|
+
onFocus,
|
|
254
|
+
onBlur,
|
|
255
|
+
error,
|
|
256
|
+
name,
|
|
257
|
+
helper,
|
|
258
|
+
value,
|
|
259
|
+
size = 24,
|
|
260
|
+
children,
|
|
261
|
+
progress = false,
|
|
262
|
+
disabled = false,
|
|
263
|
+
autoFocus = false,
|
|
264
|
+
className,
|
|
265
|
+
"data-visibility": dataVisibility,
|
|
266
|
+
"aria-label": ariaLabel,
|
|
267
|
+
required,
|
|
268
|
+
"data-testid": dataTestId,
|
|
269
|
+
tooltip,
|
|
270
|
+
tabIndex
|
|
271
|
+
}, ref) => {
|
|
272
|
+
const [state, setState] = useState(checked);
|
|
273
|
+
const uniqId = useId();
|
|
274
|
+
const localId = id ?? uniqId;
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
setState(checked);
|
|
277
|
+
}, [checked]);
|
|
278
|
+
const onLocalChange = useCallback(
|
|
279
|
+
(event) => {
|
|
280
|
+
if (!progress)
|
|
281
|
+
onChange?.(event);
|
|
282
|
+
setState(
|
|
283
|
+
(current) => current === "indeterminate" ? false : event.target.checked
|
|
284
|
+
);
|
|
285
|
+
},
|
|
286
|
+
[onChange, progress, setState]
|
|
287
|
+
);
|
|
288
|
+
return /* @__PURE__ */ jsx(Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxs(
|
|
289
|
+
CheckboxContainer,
|
|
290
|
+
{
|
|
291
|
+
className,
|
|
292
|
+
"aria-disabled": disabled,
|
|
293
|
+
"data-visibility": dataVisibility,
|
|
294
|
+
"data-checked": state,
|
|
295
|
+
"data-error": !!error,
|
|
296
|
+
"data-testid": dataTestId,
|
|
297
|
+
children: [
|
|
298
|
+
progress ? /* @__PURE__ */ jsx(StyledActivityContainer, { children: /* @__PURE__ */ jsx(Loader, { active: true, size }) }) : null,
|
|
299
|
+
/* @__PURE__ */ jsx(
|
|
300
|
+
CheckboxInput,
|
|
301
|
+
{
|
|
302
|
+
id: localId,
|
|
303
|
+
type: "checkbox",
|
|
304
|
+
"aria-invalid": !!error,
|
|
305
|
+
"aria-describedby": error ? `${localId}-hint` : void 0,
|
|
306
|
+
"aria-checked": state === "indeterminate" ? "mixed" : state,
|
|
307
|
+
"aria-label": ariaLabel,
|
|
308
|
+
checked: state === "indeterminate" ? false : state,
|
|
309
|
+
size,
|
|
310
|
+
onChange: onLocalChange,
|
|
311
|
+
onFocus,
|
|
312
|
+
onBlur,
|
|
313
|
+
disabled,
|
|
314
|
+
value,
|
|
315
|
+
name,
|
|
316
|
+
autoFocus,
|
|
317
|
+
ref,
|
|
318
|
+
required,
|
|
319
|
+
tabIndex
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
!progress ? /* @__PURE__ */ jsx(StyledIcon, { size, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(CheckboxIconContainer, { children: state !== "indeterminate" ? /* @__PURE__ */ jsx(
|
|
323
|
+
"path",
|
|
324
|
+
{
|
|
325
|
+
fillRule: "evenodd",
|
|
326
|
+
clipRule: "evenodd",
|
|
327
|
+
width: 12,
|
|
328
|
+
height: 9,
|
|
329
|
+
x: "5",
|
|
330
|
+
y: "4",
|
|
331
|
+
d: "M15.6678 5.26709C16.0849 5.6463 16.113 6.28907 15.7307 6.70276L9.29172 13.6705C9.10291 13.8748 8.83818 13.9937 8.55884 13.9998C8.2795 14.0058 8.0098 13.8984 7.81223 13.7024L4.30004 10.2185C3.89999 9.82169 3.89999 9.17831 4.30004 8.78149C4.70009 8.38467 5.34869 8.38467 5.74874 8.78149L8.50441 11.5149L14.2205 5.32951C14.6028 4.91583 15.2508 4.88788 15.6678 5.26709Z",
|
|
332
|
+
fill: "white"
|
|
333
|
+
}
|
|
334
|
+
) : /* @__PURE__ */ jsx(CheckMixedMark, { x: "6", y: "11", rx: "1", width: "12", height: "2" }) }) }) : null,
|
|
335
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 0.25, flex: 1, children: [
|
|
336
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 0.5, direction: "row", alignItems: "center", flex: 1, children: [
|
|
337
|
+
children ? /* @__PURE__ */ jsx(StyledLabel, { htmlFor: localId, children }) : null,
|
|
338
|
+
required ? /* @__PURE__ */ jsx("sup", { children: /* @__PURE__ */ jsx(Icon, { name: "asterisk", size: 10, color: "danger" }) }) : null
|
|
339
|
+
] }),
|
|
340
|
+
helper ? /* @__PURE__ */ jsx(
|
|
341
|
+
Text,
|
|
342
|
+
{
|
|
343
|
+
variant: "caption",
|
|
344
|
+
as: "span",
|
|
345
|
+
prominence: "weak",
|
|
346
|
+
sentiment: "neutral",
|
|
347
|
+
children: helper
|
|
348
|
+
}
|
|
349
|
+
) : null,
|
|
350
|
+
error ? /* @__PURE__ */ jsx(ErrorText, { variant: "caption", as: "span", sentiment: "danger", children: error }) : null
|
|
351
|
+
] })
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
) });
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
export {
|
|
358
|
+
Checkbox
|
|
359
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ComponentProps, type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { Checkbox } from '../Checkbox';
|
|
3
|
+
type CheckboxGroupCheckboxProps = Omit<ComponentProps<typeof Checkbox>, 'onChange' | 'checked'> & {
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const CheckboxGroupCheckbox: ({ onFocus, onBlur, disabled, error, name, value, children, helper, className, autoFocus, "data-testid": dataTestId, required, }: CheckboxGroupCheckboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
|
+
type CheckboxGroupProps = {
|
|
8
|
+
legend: string;
|
|
9
|
+
value?: string[];
|
|
10
|
+
className?: string;
|
|
11
|
+
helper?: ReactNode;
|
|
12
|
+
error?: ReactNode;
|
|
13
|
+
direction?: 'row' | 'column';
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
} & Required<Pick<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'name'>> & Pick<InputHTMLAttributes<HTMLInputElement>, 'required'>;
|
|
17
|
+
/**
|
|
18
|
+
* CheckboxGroup is a component that groups a set of checkboxes together with a legend and helper/error text.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CheckboxGroup: {
|
|
21
|
+
({ legend, value, className, helper, error, direction, children, onChange, name, required, }: CheckboxGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
|
+
Checkbox: ({ onFocus, onBlur, disabled, error, name, value, children, helper, className, autoFocus, "data-testid": dataTestId, required, }: CheckboxGroupCheckboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Icon } from "@ultraviolet/icons";
|
|
4
|
+
import { createContext, useContext, useMemo } from "react";
|
|
5
|
+
import { Checkbox } from "../Checkbox/index.js";
|
|
6
|
+
import { Stack } from "../Stack/index.js";
|
|
7
|
+
import { Text } from "../Text/index.js";
|
|
8
|
+
const CheckboxGroupContext = createContext(void 0);
|
|
9
|
+
const StyledCheckbox = styled(Checkbox)`
|
|
10
|
+
label {
|
|
11
|
+
width: fit-content;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const CheckboxGroupCheckbox = ({
|
|
15
|
+
onFocus,
|
|
16
|
+
onBlur,
|
|
17
|
+
disabled,
|
|
18
|
+
error,
|
|
19
|
+
name,
|
|
20
|
+
value,
|
|
21
|
+
children,
|
|
22
|
+
helper,
|
|
23
|
+
className,
|
|
24
|
+
autoFocus,
|
|
25
|
+
"data-testid": dataTestId,
|
|
26
|
+
required
|
|
27
|
+
}) => {
|
|
28
|
+
const context = useContext(CheckboxGroupContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
"CheckboxGroup.Checkbox can only be used inside a CheckboxGroup"
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const { groupName, onChange, groupValues } = context;
|
|
35
|
+
const checkboxName = `${groupName}.${name ?? ""}`;
|
|
36
|
+
const checkboxValue = `${value}`;
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
StyledCheckbox,
|
|
39
|
+
{
|
|
40
|
+
onChange,
|
|
41
|
+
checked: groupValues?.includes(checkboxValue),
|
|
42
|
+
onFocus,
|
|
43
|
+
onBlur,
|
|
44
|
+
disabled,
|
|
45
|
+
error,
|
|
46
|
+
name: checkboxName,
|
|
47
|
+
value: checkboxValue,
|
|
48
|
+
helper,
|
|
49
|
+
className,
|
|
50
|
+
autoFocus,
|
|
51
|
+
"data-testid": dataTestId,
|
|
52
|
+
required,
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
const FieldSet = styled.fieldset`
|
|
58
|
+
border: none;
|
|
59
|
+
padding: 0;
|
|
60
|
+
margin: 0;
|
|
61
|
+
`;
|
|
62
|
+
const StyledRequiredIcon = styled(Icon)`
|
|
63
|
+
vertical-align: super;
|
|
64
|
+
`;
|
|
65
|
+
const CheckboxGroup = ({
|
|
66
|
+
legend,
|
|
67
|
+
value,
|
|
68
|
+
className,
|
|
69
|
+
helper,
|
|
70
|
+
error,
|
|
71
|
+
direction = "column",
|
|
72
|
+
children,
|
|
73
|
+
onChange,
|
|
74
|
+
name,
|
|
75
|
+
required = false
|
|
76
|
+
}) => {
|
|
77
|
+
const contextValue = useMemo(
|
|
78
|
+
() => ({
|
|
79
|
+
groupName: name,
|
|
80
|
+
groupValues: value ?? [],
|
|
81
|
+
onChange,
|
|
82
|
+
required
|
|
83
|
+
}),
|
|
84
|
+
[name, value, onChange, required]
|
|
85
|
+
);
|
|
86
|
+
return /* @__PURE__ */ jsx(CheckboxGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(Stack, { gap: 1, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(FieldSet, { className, children: /* @__PURE__ */ jsxs(Stack, { gap: 1.5, children: [
|
|
88
|
+
/* @__PURE__ */ jsxs(Text, { as: "legend", variant: "bodyStrong", children: [
|
|
89
|
+
legend,
|
|
90
|
+
" ",
|
|
91
|
+
required ? /* @__PURE__ */ jsx(StyledRequiredIcon, { name: "asterisk", color: "danger", size: 8 }) : null
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsx(Stack, { gap: direction === "column" ? 1 : 2, direction, children })
|
|
94
|
+
] }) }),
|
|
95
|
+
helper ? /* @__PURE__ */ jsx(
|
|
96
|
+
Text,
|
|
97
|
+
{
|
|
98
|
+
as: "span",
|
|
99
|
+
variant: "caption",
|
|
100
|
+
prominence: "weak",
|
|
101
|
+
sentiment: "neutral",
|
|
102
|
+
children: helper
|
|
103
|
+
}
|
|
104
|
+
) : null,
|
|
105
|
+
error ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "caption", sentiment: "danger", children: error }) : null
|
|
106
|
+
] }) });
|
|
107
|
+
};
|
|
108
|
+
CheckboxGroup.Checkbox = CheckboxGroupCheckbox;
|
|
109
|
+
export {
|
|
110
|
+
CheckboxGroup,
|
|
111
|
+
CheckboxGroupCheckbox
|
|
112
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type CopyButtonProps = {
|
|
2
|
+
size?: 'xsmall' | 'small' | 'medium' | 'large';
|
|
3
|
+
value: string;
|
|
4
|
+
copyText?: string;
|
|
5
|
+
copiedText?: string;
|
|
6
|
+
sentiment?: 'primary' | 'neutral';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `bordered` instead
|
|
9
|
+
*/
|
|
10
|
+
noBorder?: boolean;
|
|
11
|
+
bordered?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* CopyButton is a button that copies a given value to the clipboard.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CopyButton: ({ size, value, copyText, copiedText, sentiment, noBorder, bordered, className, "data-testid": dataTestId, }: CopyButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|