@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,370 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Icon } from "@ultraviolet/icons";
|
|
4
|
+
import { forwardRef, useRef, useImperativeHandle, useId, useCallback, useMemo } from "react";
|
|
5
|
+
import { Button } from "../Button/index.js";
|
|
6
|
+
import { Row } from "../Row/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 SIZES = {
|
|
11
|
+
small: "30px",
|
|
12
|
+
medium: "38px",
|
|
13
|
+
large: "46px"
|
|
14
|
+
};
|
|
15
|
+
const SideContainer = styled(Stack)`
|
|
16
|
+
padding: ${({ theme }) => `${theme.space["0.25"]} ${theme.space["1"]}`};
|
|
17
|
+
|
|
18
|
+
&[data-size='small'] {
|
|
19
|
+
height: ${SIZES.small};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[data-size='medium'] {
|
|
23
|
+
height: ${SIZES.medium};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&[data-size='large'] {
|
|
27
|
+
height: ${SIZES.large};
|
|
28
|
+
padding: ${({ theme }) => `${theme.space["0.5"]} ${theme.space["1"]}`};
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
const InputContainer = styled(Row)`
|
|
32
|
+
border-width: 0 1px 0 1px;
|
|
33
|
+
border-style: solid;
|
|
34
|
+
border-color: inherit;
|
|
35
|
+
background: inherit;
|
|
36
|
+
width: 100%;
|
|
37
|
+
`;
|
|
38
|
+
const Unit = styled(Text, {
|
|
39
|
+
shouldForwardProp: (prop) => !["size"].includes(prop)
|
|
40
|
+
})`
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
padding: ${({ theme }) => theme.space["1"]};
|
|
44
|
+
height: ${({ size }) => SIZES[size]};
|
|
45
|
+
`;
|
|
46
|
+
const Input = styled.input`
|
|
47
|
+
outline: none;
|
|
48
|
+
border: none;
|
|
49
|
+
padding: 0;
|
|
50
|
+
width: 100%;
|
|
51
|
+
color: ${({ theme }) => theme.colors.neutral.text};
|
|
52
|
+
font-size: ${({ theme }) => theme.typography.body.fontSize};
|
|
53
|
+
font-family: ${({ theme }) => theme.typography.body.fontFamily};
|
|
54
|
+
font-weight: ${({ theme }) => theme.typography.body.fontWeight};
|
|
55
|
+
line-height: ${({ theme }) => theme.typography.body.lineHeight};
|
|
56
|
+
text-align: center;
|
|
57
|
+
padding: ${({ theme }) => theme.space["1"]};
|
|
58
|
+
background: none;
|
|
59
|
+
|
|
60
|
+
&[data-has-unit='true'] {
|
|
61
|
+
text-align: left;
|
|
62
|
+
padding: ${({ theme }) => `${theme.space["1"]} 0 ${theme.space["1"]} ${theme.space["1"]}`};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Remove native arrows from input[type=number]
|
|
66
|
+
|
|
67
|
+
&::-webkit-outer-spin-button,
|
|
68
|
+
&::-webkit-inner-spin-button {
|
|
69
|
+
-webkit-appearance: none;
|
|
70
|
+
margin: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
& {
|
|
74
|
+
-moz-appearance: textfield;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[data-size='small'] {
|
|
78
|
+
height: ${SIZES.small};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&[data-size='medium'] {
|
|
82
|
+
height: ${SIZES.medium};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&[data-size='large'] {
|
|
86
|
+
height: ${SIZES.large};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:read-only {
|
|
90
|
+
color: ${({ theme }) => theme.colors.neutral.text};
|
|
91
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundWeak};
|
|
92
|
+
|
|
93
|
+
& ~ ${Unit} {
|
|
94
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundWeak};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:disabled {
|
|
99
|
+
color: ${({ theme }) => theme.colors.neutral.textDisabled};
|
|
100
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundDisabled};
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
|
|
103
|
+
& ~ ${Unit} {
|
|
104
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundDisabled};
|
|
105
|
+
cursor: not-allowed;
|
|
106
|
+
user-select: none;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:placeholder-shown ~ ${Unit} {
|
|
111
|
+
color: ${({ theme }) => theme.colors.neutral.textWeak};
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
const Container = styled.div`
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
flex-direction: row;
|
|
119
|
+
border: 1px solid ${({ theme }) => theme.colors.neutral.border};
|
|
120
|
+
border-radius: ${({ theme }) => theme.radii.default};
|
|
121
|
+
|
|
122
|
+
&:focus-within {
|
|
123
|
+
border-color: ${({ theme }) => theme.colors.primary.borderHover};
|
|
124
|
+
box-shadow: ${({ theme }) => theme.shadows.focusPrimary};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&[data-success='true'] {
|
|
128
|
+
border-color: ${({ theme }) => theme.colors.success.border};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&[data-error='true'] {
|
|
132
|
+
border-color: ${({ theme }) => theme.colors.danger.border};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:hover {
|
|
136
|
+
border-color: ${({ theme }) => theme.colors.primary.borderHover};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&[data-readonly='true'] {
|
|
140
|
+
border-color: ${({ theme }) => theme.colors.neutral.border};
|
|
141
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundWeak};
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&[data-disabled='true'] {
|
|
146
|
+
border-color: ${({ theme }) => theme.colors.neutral.borderDisabled};
|
|
147
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundDisabled};
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
const NumberInputV2 = forwardRef(
|
|
152
|
+
({
|
|
153
|
+
disabled = false,
|
|
154
|
+
max = Number.MAX_SAFE_INTEGER,
|
|
155
|
+
min = 0,
|
|
156
|
+
name,
|
|
157
|
+
onChange,
|
|
158
|
+
onFocus,
|
|
159
|
+
onBlur,
|
|
160
|
+
size = "large",
|
|
161
|
+
step,
|
|
162
|
+
unit,
|
|
163
|
+
value,
|
|
164
|
+
tooltip,
|
|
165
|
+
className,
|
|
166
|
+
label,
|
|
167
|
+
labelDescription,
|
|
168
|
+
id,
|
|
169
|
+
placeholder = "",
|
|
170
|
+
error,
|
|
171
|
+
success,
|
|
172
|
+
helper,
|
|
173
|
+
"aria-label": ariaLabel,
|
|
174
|
+
"data-testid": dataTestId,
|
|
175
|
+
required,
|
|
176
|
+
autoFocus,
|
|
177
|
+
readOnly
|
|
178
|
+
}, ref) => {
|
|
179
|
+
const localRef = useRef(null);
|
|
180
|
+
useImperativeHandle(ref, () => localRef.current);
|
|
181
|
+
const uniqueId = useId();
|
|
182
|
+
const localId = id ?? uniqueId;
|
|
183
|
+
const onClickSideButton = useCallback(
|
|
184
|
+
(direction) => () => {
|
|
185
|
+
if (direction === "up") {
|
|
186
|
+
localRef.current?.stepUp();
|
|
187
|
+
} else if (direction === "down") {
|
|
188
|
+
localRef.current?.stepDown();
|
|
189
|
+
}
|
|
190
|
+
onChange?.(parseInt(localRef.current?.value ?? "", 10) ?? min);
|
|
191
|
+
},
|
|
192
|
+
[localRef, min, onChange]
|
|
193
|
+
);
|
|
194
|
+
const isMinusDisabled = useMemo(
|
|
195
|
+
() => {
|
|
196
|
+
if (!localRef?.current?.value || localRef?.current?.value === "") {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
const numericValue = Number(localRef?.current?.value);
|
|
200
|
+
if (Number.isNaN(numericValue))
|
|
201
|
+
return false;
|
|
202
|
+
const minValue = typeof min === "number" ? min : Number(min);
|
|
203
|
+
return Number.isNaN(numericValue) || numericValue <= minValue;
|
|
204
|
+
},
|
|
205
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
206
|
+
[localRef?.current?.value, min]
|
|
207
|
+
);
|
|
208
|
+
const isPlusDisabled = useMemo(
|
|
209
|
+
() => {
|
|
210
|
+
if (!localRef?.current?.value || localRef?.current?.value === "") {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
const numericValue = Number(localRef?.current?.value);
|
|
214
|
+
if (Number.isNaN(numericValue))
|
|
215
|
+
return false;
|
|
216
|
+
const maxValue = typeof max === "number" ? max : Number(max);
|
|
217
|
+
return numericValue >= maxValue;
|
|
218
|
+
},
|
|
219
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
220
|
+
[localRef?.current?.value, max]
|
|
221
|
+
);
|
|
222
|
+
const helperSentiment = useMemo(() => {
|
|
223
|
+
if (error) {
|
|
224
|
+
return "danger";
|
|
225
|
+
}
|
|
226
|
+
if (success) {
|
|
227
|
+
return "success";
|
|
228
|
+
}
|
|
229
|
+
return "neutral";
|
|
230
|
+
}, [error, success]);
|
|
231
|
+
let inputValue;
|
|
232
|
+
if (value !== void 0) {
|
|
233
|
+
inputValue = value !== null && Number.isInteger(value) ? value.toString() : "";
|
|
234
|
+
}
|
|
235
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "0.5", className, children: [
|
|
236
|
+
label || labelDescription ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: "1", alignItems: "center", children: [
|
|
237
|
+
label ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: "0.5", alignItems: "start", children: [
|
|
238
|
+
/* @__PURE__ */ jsx(
|
|
239
|
+
Text,
|
|
240
|
+
{
|
|
241
|
+
as: "label",
|
|
242
|
+
variant: "bodyStrong",
|
|
243
|
+
sentiment: "neutral",
|
|
244
|
+
htmlFor: id ?? localId,
|
|
245
|
+
children: label
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
required ? /* @__PURE__ */ jsx(Icon, { name: "asterisk", color: "danger", size: 8 }) : null
|
|
249
|
+
] }) : null,
|
|
250
|
+
labelDescription ?? null
|
|
251
|
+
] }) : null,
|
|
252
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxs(
|
|
253
|
+
Container,
|
|
254
|
+
{
|
|
255
|
+
"data-disabled": disabled,
|
|
256
|
+
"data-readonly": readOnly,
|
|
257
|
+
"data-error": !!error,
|
|
258
|
+
"data-success": !!success,
|
|
259
|
+
"data-unit": !!unit,
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ jsx(
|
|
262
|
+
SideContainer,
|
|
263
|
+
{
|
|
264
|
+
justifyContent: "center",
|
|
265
|
+
alignItems: "center",
|
|
266
|
+
"data-size": size,
|
|
267
|
+
children: /* @__PURE__ */ jsx(
|
|
268
|
+
Button,
|
|
269
|
+
{
|
|
270
|
+
sentiment: "neutral",
|
|
271
|
+
variant: "ghost",
|
|
272
|
+
icon: "minus",
|
|
273
|
+
size: size === "small" ? "xsmall" : "small",
|
|
274
|
+
disabled: disabled || readOnly || isMinusDisabled,
|
|
275
|
+
onClick: onClickSideButton("down"),
|
|
276
|
+
"aria-label": "minus"
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ jsxs(
|
|
282
|
+
InputContainer,
|
|
283
|
+
{
|
|
284
|
+
justifyContent: "space-between",
|
|
285
|
+
alignItems: "center",
|
|
286
|
+
templateColumns: "1fr auto",
|
|
287
|
+
children: [
|
|
288
|
+
/* @__PURE__ */ jsx(
|
|
289
|
+
Input,
|
|
290
|
+
{
|
|
291
|
+
ref: localRef,
|
|
292
|
+
type: "number",
|
|
293
|
+
name,
|
|
294
|
+
id: localId,
|
|
295
|
+
placeholder,
|
|
296
|
+
onChange: onChange ? (event) => {
|
|
297
|
+
const newNumber = parseInt(event.target.value, 10);
|
|
298
|
+
onChange(Number.isNaN(newNumber) ? null : newNumber);
|
|
299
|
+
} : void 0,
|
|
300
|
+
value: inputValue,
|
|
301
|
+
onFocus,
|
|
302
|
+
onBlur,
|
|
303
|
+
"data-size": size,
|
|
304
|
+
step,
|
|
305
|
+
disabled,
|
|
306
|
+
"aria-label": ariaLabel,
|
|
307
|
+
"data-testid": dataTestId,
|
|
308
|
+
min,
|
|
309
|
+
max,
|
|
310
|
+
required,
|
|
311
|
+
autoFocus,
|
|
312
|
+
readOnly,
|
|
313
|
+
"data-has-unit": !!unit
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
unit ? /* @__PURE__ */ jsx(
|
|
317
|
+
Unit,
|
|
318
|
+
{
|
|
319
|
+
variant: "body",
|
|
320
|
+
sentiment: "neutral",
|
|
321
|
+
as: "span",
|
|
322
|
+
disabled,
|
|
323
|
+
size,
|
|
324
|
+
children: unit
|
|
325
|
+
}
|
|
326
|
+
) : null
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
/* @__PURE__ */ jsx(
|
|
331
|
+
SideContainer,
|
|
332
|
+
{
|
|
333
|
+
justifyContent: "center",
|
|
334
|
+
alignItems: "center",
|
|
335
|
+
"data-size": size,
|
|
336
|
+
children: /* @__PURE__ */ jsx(
|
|
337
|
+
Button,
|
|
338
|
+
{
|
|
339
|
+
sentiment: "neutral",
|
|
340
|
+
variant: "ghost",
|
|
341
|
+
icon: "plus",
|
|
342
|
+
size: size === "small" ? "xsmall" : "small",
|
|
343
|
+
disabled: disabled || readOnly || isPlusDisabled,
|
|
344
|
+
onClick: onClickSideButton("up"),
|
|
345
|
+
"aria-label": "plus"
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
)
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
) }) }),
|
|
353
|
+
error || typeof success === "string" || typeof helper === "string" ? /* @__PURE__ */ jsx(
|
|
354
|
+
Text,
|
|
355
|
+
{
|
|
356
|
+
variant: "caption",
|
|
357
|
+
as: "span",
|
|
358
|
+
prominence: !error && !success ? "weak" : void 0,
|
|
359
|
+
sentiment: helperSentiment,
|
|
360
|
+
disabled: disabled || readOnly,
|
|
361
|
+
children: error || success || helper
|
|
362
|
+
}
|
|
363
|
+
) : null,
|
|
364
|
+
!error && !success && typeof helper !== "string" && helper ? helper : null
|
|
365
|
+
] });
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
export {
|
|
369
|
+
NumberInputV2
|
|
370
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a list of page numbers around the currentPage
|
|
3
|
+
* @param currentPage The current page
|
|
4
|
+
* @param pageCount The last page number
|
|
5
|
+
* @param range The number of pages wanted
|
|
6
|
+
* @returns List of page numbers around currentPage
|
|
7
|
+
*/
|
|
8
|
+
export declare const getPageNumbers: (currentPage: number, pageCount: number, range?: number) => number[];
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return a list of page numbers around the currentPage
|
|
3
|
-
* @param currentPage The current page
|
|
4
|
-
* @param pageCount The last page number
|
|
5
|
-
* @param range The number of pages wanted
|
|
6
|
-
* @returns List of page numbers around currentPage
|
|
7
|
-
*/
|
|
8
1
|
const getPageNumbers = (currentPage, pageCount, range = 5) => {
|
|
9
2
|
const gap = Math.floor(range / 2);
|
|
10
3
|
let end = currentPage + gap;
|
|
@@ -21,9 +14,8 @@ const getPageNumbers = (currentPage, pageCount, range = 5) => {
|
|
|
21
14
|
if (end < pageCount) {
|
|
22
15
|
end = Math.min(end + remaining, pageCount);
|
|
23
16
|
}
|
|
24
|
-
return Array.from({
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
return Array.from({ length: end - start + 1 }, (_, index) => start + index);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
getPageNumbers
|
|
27
21
|
};
|
|
28
|
-
|
|
29
|
-
export { getPageNumbers };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type PaginationProps = {
|
|
2
|
+
/**
|
|
3
|
+
Event function called when changing the page
|
|
4
|
+
*/
|
|
5
|
+
onChange: (newPage: number) => void;
|
|
6
|
+
/**
|
|
7
|
+
The current page (must be between 1 and pageCount included, otherwhile onChange will be called with a correct value)
|
|
8
|
+
*/
|
|
9
|
+
page: number;
|
|
10
|
+
/**
|
|
11
|
+
Number of page you have
|
|
12
|
+
*/
|
|
13
|
+
pageCount: number;
|
|
14
|
+
/**
|
|
15
|
+
How many page button you want to have
|
|
16
|
+
*/
|
|
17
|
+
pageTabCount?: number;
|
|
18
|
+
/**
|
|
19
|
+
Disable all buttons
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
'data-testid'?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Pagination is a component to navigate between pages, it is composed of 2 buttons to go to the previous and next page,
|
|
27
|
+
* and a list of buttons to go to a specific page.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Pagination: ({ disabled, page, pageCount, onChange, pageTabCount, className, "data-testid": dataTestId, }: PaginationProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { useCallback, useMemo, useEffect } from "react";
|
|
4
|
+
import { Button } from "../Button/index.js";
|
|
5
|
+
import { getPageNumbers } from "./getPageNumbers.js";
|
|
6
|
+
const PageNumbersContainer = styled.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: ${({ theme }) => theme.space["2"]};
|
|
9
|
+
margin: 0 ${({ theme }) => theme.space["2"]};
|
|
10
|
+
`;
|
|
11
|
+
const PageSwitchContainer = styled.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
gap: ${({ theme }) => theme.space["1"]};
|
|
14
|
+
`;
|
|
15
|
+
const StyledContainer = styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
`;
|
|
18
|
+
const Pagination = ({
|
|
19
|
+
disabled = false,
|
|
20
|
+
page,
|
|
21
|
+
pageCount,
|
|
22
|
+
onChange,
|
|
23
|
+
pageTabCount = 5,
|
|
24
|
+
className,
|
|
25
|
+
"data-testid": dataTestId
|
|
26
|
+
}) => {
|
|
27
|
+
const goToFirstPage = useCallback(() => {
|
|
28
|
+
onChange(1);
|
|
29
|
+
}, [onChange]);
|
|
30
|
+
const goToLastPage = useCallback(() => {
|
|
31
|
+
onChange(pageCount);
|
|
32
|
+
}, [onChange, pageCount]);
|
|
33
|
+
const goToNextPage = useCallback(() => {
|
|
34
|
+
onChange(page + 1);
|
|
35
|
+
}, [onChange, page]);
|
|
36
|
+
const goToPreviousPage = useCallback(() => {
|
|
37
|
+
onChange(page - 1);
|
|
38
|
+
}, [onChange, page]);
|
|
39
|
+
const pageNumbersToDisplay = useMemo(
|
|
40
|
+
() => pageCount > 1 ? getPageNumbers(page, pageCount, pageTabCount) : [1],
|
|
41
|
+
[page, pageCount, pageTabCount]
|
|
42
|
+
);
|
|
43
|
+
const handlePageClick = useCallback(
|
|
44
|
+
(pageNumber) => () => {
|
|
45
|
+
onChange(pageNumber);
|
|
46
|
+
},
|
|
47
|
+
[onChange]
|
|
48
|
+
);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (page < 1) {
|
|
51
|
+
onChange(1);
|
|
52
|
+
}
|
|
53
|
+
if (page > pageCount) {
|
|
54
|
+
onChange(pageCount);
|
|
55
|
+
}
|
|
56
|
+
}, [page, pageCount, onChange]);
|
|
57
|
+
return /* @__PURE__ */ jsxs(StyledContainer, { className, "data-testid": dataTestId, children: [
|
|
58
|
+
/* @__PURE__ */ jsxs(PageSwitchContainer, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
Button,
|
|
61
|
+
{
|
|
62
|
+
"aria-label": "First",
|
|
63
|
+
disabled: page <= 1 || disabled,
|
|
64
|
+
variant: "outlined",
|
|
65
|
+
sentiment: "primary",
|
|
66
|
+
onClick: goToFirstPage,
|
|
67
|
+
icon: "arrow-left-double"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
Button,
|
|
72
|
+
{
|
|
73
|
+
"aria-label": "Back",
|
|
74
|
+
disabled: page <= 1 || disabled,
|
|
75
|
+
variant: "outlined",
|
|
76
|
+
sentiment: "primary",
|
|
77
|
+
onClick: goToPreviousPage,
|
|
78
|
+
icon: "arrow-left"
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx(PageNumbersContainer, { children: pageNumbersToDisplay.map((pageNumber) => /* @__PURE__ */ jsx(
|
|
83
|
+
Button,
|
|
84
|
+
{
|
|
85
|
+
"aria-label": `Page ${pageNumber}`,
|
|
86
|
+
"aria-current": pageNumber === page,
|
|
87
|
+
disabled,
|
|
88
|
+
variant: "outlined",
|
|
89
|
+
sentiment: pageNumber === page ? "primary" : "neutral",
|
|
90
|
+
onClick: handlePageClick(pageNumber),
|
|
91
|
+
type: "button",
|
|
92
|
+
children: pageNumber
|
|
93
|
+
},
|
|
94
|
+
`pagination-page-${pageNumber}`
|
|
95
|
+
)) }),
|
|
96
|
+
/* @__PURE__ */ jsxs(PageSwitchContainer, { children: [
|
|
97
|
+
/* @__PURE__ */ jsx(
|
|
98
|
+
Button,
|
|
99
|
+
{
|
|
100
|
+
"aria-label": "Next",
|
|
101
|
+
disabled: page >= pageCount || disabled,
|
|
102
|
+
variant: "outlined",
|
|
103
|
+
sentiment: "primary",
|
|
104
|
+
onClick: goToNextPage,
|
|
105
|
+
icon: "arrow-right"
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
Button,
|
|
110
|
+
{
|
|
111
|
+
"aria-label": "Last",
|
|
112
|
+
disabled: page >= pageCount || disabled,
|
|
113
|
+
variant: "outlined",
|
|
114
|
+
sentiment: "primary",
|
|
115
|
+
onClick: goToLastPage,
|
|
116
|
+
icon: "arrow-right-double"
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] })
|
|
120
|
+
] });
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
Pagination
|
|
124
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type Rule = {
|
|
2
|
+
name: string;
|
|
3
|
+
text: string;
|
|
4
|
+
valid: boolean;
|
|
5
|
+
};
|
|
6
|
+
type PasswordCheckProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Is an array of object that contains password rules. `name` is the name of the rule, `text` the text associated
|
|
9
|
+
* with the rule and `valid` is a boolean that determine if the rule is respected or not.
|
|
10
|
+
*/
|
|
11
|
+
rules: Rule[];
|
|
12
|
+
className?: string;
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* PasswordCheck is a component that display a list of password rules with a check or a cross depending on the validity
|
|
17
|
+
* of the rule.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PasswordCheck: ({ rules, className, "data-testid": dataTestId, }: PasswordCheckProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Icon } from "@ultraviolet/icons";
|
|
4
|
+
import { Stack } from "../Stack/index.js";
|
|
5
|
+
import { Text } from "../Text/index.js";
|
|
6
|
+
const PasswordCheckContainer = styled.div`
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: repeat(2, 1fr);
|
|
9
|
+
gap: ${({ theme }) => theme.space["1"]};
|
|
10
|
+
`;
|
|
11
|
+
const PasswordCheck = ({
|
|
12
|
+
rules,
|
|
13
|
+
className,
|
|
14
|
+
"data-testid": dataTestId
|
|
15
|
+
}) => /* @__PURE__ */ jsx(PasswordCheckContainer, { className, "data-testid": dataTestId, children: rules.map((rule) => /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: 1, alignItems: "center", children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
Icon,
|
|
18
|
+
{
|
|
19
|
+
name: rule.valid ? "checkbox-circle-outline" : "close-circle-outline",
|
|
20
|
+
color: rule.valid ? "success" : "neutral",
|
|
21
|
+
prominence: "weak",
|
|
22
|
+
size: 20
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx(Text, { as: "p", variant: "bodySmall", children: rule.text })
|
|
26
|
+
] }, rule.name)) });
|
|
27
|
+
export {
|
|
28
|
+
PasswordCheck
|
|
29
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type Strength = {
|
|
2
|
+
/**
|
|
3
|
+
* Color to display
|
|
4
|
+
*/
|
|
5
|
+
color: string;
|
|
6
|
+
/**
|
|
7
|
+
* Text to display
|
|
8
|
+
*/
|
|
9
|
+
t: string;
|
|
10
|
+
};
|
|
11
|
+
type Score = 0 | 1 | 2 | 3 | 4;
|
|
12
|
+
type ResponseEstimate = {
|
|
13
|
+
score: Score;
|
|
14
|
+
};
|
|
15
|
+
type PasswordStrengthMeterProps = {
|
|
16
|
+
/**
|
|
17
|
+
* A function that should return a score based on password (index of strength array). The higher score is the stronger password is.
|
|
18
|
+
*/
|
|
19
|
+
estimate?: ((passwordToTest: string, userInputs: string[]) => Promise<ResponseEstimate>) | ((passwordToTest: string, userInputs: string[]) => ResponseEstimate);
|
|
20
|
+
onChange?: (score: number) => unknown;
|
|
21
|
+
password?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Strength is used for defining different color and text associated with it.
|
|
24
|
+
*/
|
|
25
|
+
strength: Strength[];
|
|
26
|
+
title: string;
|
|
27
|
+
/**
|
|
28
|
+
* An array of string that defines what word shouldn't be used in the password.
|
|
29
|
+
*/
|
|
30
|
+
forbiddenInputs?: string[];
|
|
31
|
+
className?: string;
|
|
32
|
+
'data-testid'?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* PasswordStrengthMeter is a component that displays a password strength meter.
|
|
36
|
+
* @deprecated use Meter component instead
|
|
37
|
+
*/
|
|
38
|
+
export declare const PasswordStrengthMeter: ({ password, onChange, strength, title, estimate, forbiddenInputs, className, "data-testid": dataTestId, }: PasswordStrengthMeterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|