@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,191 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useTheme, css } from "@emotion/react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Button } from "../Button/index.js";
|
|
6
|
+
import { Link } from "../Link/index.js";
|
|
7
|
+
import { Stack } from "../Stack/index.js";
|
|
8
|
+
import { Text } from "../Text/index.js";
|
|
9
|
+
import defaultIllustrationSmall from "./assets/default-image-small.svg.js";
|
|
10
|
+
import defaultIllustration from "./assets/default-image.svg.js";
|
|
11
|
+
const styles = ({
|
|
12
|
+
theme,
|
|
13
|
+
variant,
|
|
14
|
+
size
|
|
15
|
+
}) => {
|
|
16
|
+
if (size === "small") {
|
|
17
|
+
if (variant === "intro") {
|
|
18
|
+
return css`
|
|
19
|
+
background: ${theme.colors.primary.background};
|
|
20
|
+
background-position: left, right;
|
|
21
|
+
background-repeat: no-repeat, no-repeat;
|
|
22
|
+
background-size: contain, contain;
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
if (variant === "promotional") {
|
|
26
|
+
return css`
|
|
27
|
+
background-position: left, right;
|
|
28
|
+
background-image: ${theme.colors.other.gradients.background.linear.aqua};
|
|
29
|
+
background-repeat: no-repeat, no-repeat;
|
|
30
|
+
background-size: contain, contain;
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (size === "medium") {
|
|
35
|
+
if (variant === "intro") {
|
|
36
|
+
return css`
|
|
37
|
+
background: ${theme.colors.primary.background};
|
|
38
|
+
background-position: right;
|
|
39
|
+
background-repeat: no-repeat;
|
|
40
|
+
background-size: contain;
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
if (variant === "promotional") {
|
|
44
|
+
return css`
|
|
45
|
+
background-image: ${theme.colors.other.gradients.background.linear.aqua};
|
|
46
|
+
background-position: right;
|
|
47
|
+
background-repeat: no-repeat;
|
|
48
|
+
background-size: contain;
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
};
|
|
54
|
+
const Container = styled("div", {
|
|
55
|
+
shouldForwardProp: (prop) => !["variant", "size", "padding"].includes(prop)
|
|
56
|
+
})`
|
|
57
|
+
padding: ${({ theme, size }) => theme.space[size === "small" ? "2" : "3"]};
|
|
58
|
+
border-radius: ${({ theme }) => theme.radii.large};
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
gap: ${({ theme }) => theme.space["2"]};
|
|
63
|
+
${({ theme, variant, size }) => styles({ theme, variant, size })};
|
|
64
|
+
|
|
65
|
+
> svg:first-child,
|
|
66
|
+
> img {
|
|
67
|
+
height: ${({ size }) => size === "medium" ? "140px" : "100px"};
|
|
68
|
+
align-self: center;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
button[name='close'] {
|
|
72
|
+
background: none;
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
background: none;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
const ImageStack = styled(Stack, {
|
|
80
|
+
shouldForwardProp: (prop) => !["size"].includes(prop)
|
|
81
|
+
})`
|
|
82
|
+
width: ${({ size }) => size === "medium" ? "140px" : "74px"};
|
|
83
|
+
`;
|
|
84
|
+
const Banner = ({
|
|
85
|
+
variant = "intro",
|
|
86
|
+
size = "medium",
|
|
87
|
+
title,
|
|
88
|
+
children,
|
|
89
|
+
direction = "column",
|
|
90
|
+
onClose,
|
|
91
|
+
buttonText,
|
|
92
|
+
onClickButton,
|
|
93
|
+
linkText,
|
|
94
|
+
linkHref,
|
|
95
|
+
image,
|
|
96
|
+
className,
|
|
97
|
+
closable = true,
|
|
98
|
+
"data-testid": dataTestId
|
|
99
|
+
}) => {
|
|
100
|
+
const { theme } = useTheme();
|
|
101
|
+
const defaultImage = size === "small" ? defaultIllustrationSmall : defaultIllustration;
|
|
102
|
+
const [opened, setOpened] = useState(true);
|
|
103
|
+
if (!opened)
|
|
104
|
+
return null;
|
|
105
|
+
return /* @__PURE__ */ jsxs(
|
|
106
|
+
Container,
|
|
107
|
+
{
|
|
108
|
+
variant,
|
|
109
|
+
size,
|
|
110
|
+
className,
|
|
111
|
+
"data-testid": dataTestId,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(ImageStack, { size, justifyContent: "center", children: image ?? /* @__PURE__ */ jsx("img", { src: defaultImage, alt: "" }) }),
|
|
114
|
+
/* @__PURE__ */ jsxs(
|
|
115
|
+
Stack,
|
|
116
|
+
{
|
|
117
|
+
direction,
|
|
118
|
+
gap: 2,
|
|
119
|
+
justifyContent: "space-between",
|
|
120
|
+
alignItems: direction === "column" ? "start" : "center",
|
|
121
|
+
style: { flex: 1 },
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ jsxs(Stack, { gap: 0.5, style: { flex: 1 }, justifyContent: "center", children: [
|
|
124
|
+
/* @__PURE__ */ jsx(
|
|
125
|
+
Text,
|
|
126
|
+
{
|
|
127
|
+
as: "p",
|
|
128
|
+
variant: size === "medium" ? "headingSmall" : "bodyStronger",
|
|
129
|
+
sentiment: variant === "promotional" && theme !== "light" ? "neutral" : "primary",
|
|
130
|
+
prominence: variant === "intro" ? "default" : "strong",
|
|
131
|
+
children: title
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
Text,
|
|
136
|
+
{
|
|
137
|
+
as: "p",
|
|
138
|
+
variant: "body",
|
|
139
|
+
sentiment: "neutral",
|
|
140
|
+
prominence: variant === "intro" || variant === "promotional" && theme !== "light" ? "default" : "stronger",
|
|
141
|
+
children
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] }),
|
|
145
|
+
buttonText || linkText ? /* @__PURE__ */ jsxs(Stack, { direction: "row", gap: 2, alignItems: "center", children: [
|
|
146
|
+
buttonText ? /* @__PURE__ */ jsx(
|
|
147
|
+
Button,
|
|
148
|
+
{
|
|
149
|
+
size: "medium",
|
|
150
|
+
sentiment: variant === "intro" ? "primary" : "neutral",
|
|
151
|
+
variant: "filled",
|
|
152
|
+
onClick: onClickButton,
|
|
153
|
+
children: buttonText
|
|
154
|
+
}
|
|
155
|
+
) : null,
|
|
156
|
+
linkText ? /* @__PURE__ */ jsx(
|
|
157
|
+
Link,
|
|
158
|
+
{
|
|
159
|
+
sentiment: theme !== "light" ? "neutral" : "primary",
|
|
160
|
+
size: "small",
|
|
161
|
+
target: "_blank",
|
|
162
|
+
href: linkHref ?? "",
|
|
163
|
+
prominence: variant === "intro" || theme !== "light" ? "default" : "strong",
|
|
164
|
+
children: linkText
|
|
165
|
+
}
|
|
166
|
+
) : null
|
|
167
|
+
] }) : null
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
closable ? /* @__PURE__ */ jsx(
|
|
172
|
+
Button,
|
|
173
|
+
{
|
|
174
|
+
icon: "close",
|
|
175
|
+
size: "small",
|
|
176
|
+
name: "close",
|
|
177
|
+
variant: variant === "intro" ? "ghost" : "filled",
|
|
178
|
+
sentiment: variant === "intro" || variant === "promotional" && theme !== "light" ? "neutral" : "primary",
|
|
179
|
+
onClick: () => {
|
|
180
|
+
setOpened(false);
|
|
181
|
+
onClose?.();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
) : null
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
export {
|
|
190
|
+
Banner
|
|
191
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type BarChartToolTipProps = {
|
|
2
|
+
color: string;
|
|
3
|
+
indexValue: string;
|
|
4
|
+
formattedValue: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
'data-testid'?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const BarChartToolTip: ({ formattedValue, indexValue, color, className, "data-testid": dataTestId, }: BarChartToolTipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default BarChartToolTip;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Text } from "../Text/index.js";
|
|
4
|
+
const BarToolTipContainer = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
background: ${({ theme }) => theme.colors.neutral.backgroundWeakElevated};
|
|
7
|
+
border-radius: ${({ theme }) => theme.radii.small};
|
|
8
|
+
box-shadow: ${({ theme }) => theme.shadows.tooltip};
|
|
9
|
+
padding: 5px 9px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
`;
|
|
12
|
+
const BarColorSquare = styled("span", {
|
|
13
|
+
shouldForwardProp: (prop) => !["color"].includes(prop)
|
|
14
|
+
})`
|
|
15
|
+
display: block;
|
|
16
|
+
width: 12px;
|
|
17
|
+
height: 12px;
|
|
18
|
+
background: ${({ color }) => color};
|
|
19
|
+
margin-right: 12px;
|
|
20
|
+
`;
|
|
21
|
+
const BarChartToolTip = ({
|
|
22
|
+
formattedValue,
|
|
23
|
+
indexValue,
|
|
24
|
+
color,
|
|
25
|
+
className,
|
|
26
|
+
"data-testid": dataTestId
|
|
27
|
+
}) => /* @__PURE__ */ jsxs(BarToolTipContainer, { className, "data-testid": dataTestId, children: [
|
|
28
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(BarColorSquare, { color }) }),
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
30
|
+
/* @__PURE__ */ jsx(Text, { variant: "bodyStronger", as: "p", sentiment: "primary", children: formattedValue }),
|
|
31
|
+
/* @__PURE__ */ jsx(Text, { variant: "bodySmall", as: "p", children: indexValue })
|
|
32
|
+
] })
|
|
33
|
+
] });
|
|
34
|
+
export {
|
|
35
|
+
BarChartToolTip as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BarDatum, BarSvgProps, BarTooltipProps } from '@nivo/bar';
|
|
2
|
+
import { ResponsiveBar } from '@nivo/bar';
|
|
3
|
+
import type { Box, DatumValue, ValueFormat } from '@nivo/core';
|
|
4
|
+
import type { ComponentProps } from 'react';
|
|
5
|
+
import BarChartTooltip from './Tooltip';
|
|
6
|
+
type Formatter = ValueFormat<DatumValue>;
|
|
7
|
+
type TickSpec = NonNullable<ComponentProps<typeof ResponsiveBar>['axisBottom']>['tickValues'];
|
|
8
|
+
type BarChartProps = {
|
|
9
|
+
height?: string | number;
|
|
10
|
+
margin?: Box;
|
|
11
|
+
data?: BarDatum[];
|
|
12
|
+
axisFormatters?: Partial<Record<'bottom' | 'left' | 'right' | 'top', Formatter>>;
|
|
13
|
+
pointFormatters?: Partial<Record<'x' | 'y', Formatter>>;
|
|
14
|
+
tickValues?: Partial<Record<'bottom' | 'left' | 'right' | 'top', TickSpec>>;
|
|
15
|
+
keys?: string[];
|
|
16
|
+
className?: string;
|
|
17
|
+
tooltipFunction?: (props: BarTooltipProps<BarDatum>) => ComponentProps<typeof BarChartTooltip>;
|
|
18
|
+
chartProps?: Partial<BarSvgProps<BarDatum>>;
|
|
19
|
+
'data-testid'?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* BarChart component is used to display data in a bar chart format. It uses the Nivo library under the hood.
|
|
23
|
+
* See https://nivo.rocks/bar/ for more information.
|
|
24
|
+
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
25
|
+
*/
|
|
26
|
+
export declare const BarChart: ({ height, margin, data, axisFormatters, tickValues, keys, tooltipFunction, chartProps, className, "data-testid": dataTestId, }: BarChartProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useTheme } from "@emotion/react";
|
|
3
|
+
import { ResponsiveBar } from "@nivo/bar";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { getLegendColor } from "../../helpers/legend.js";
|
|
6
|
+
import BarChartToolTip from "./Tooltip.js";
|
|
7
|
+
const DEFAULT_MARGIN = { bottom: 50, left: 60, right: 25, top: 50 };
|
|
8
|
+
const DEFAULT_DATA = [];
|
|
9
|
+
const DEFAULT_AXISFORMATTER = {};
|
|
10
|
+
const DEFAULT_KEYS = ["value"];
|
|
11
|
+
const BarChart = ({
|
|
12
|
+
height = "537px",
|
|
13
|
+
// to maintain aspect ratio based on our standard 1074px width,
|
|
14
|
+
margin = DEFAULT_MARGIN,
|
|
15
|
+
data = DEFAULT_DATA,
|
|
16
|
+
axisFormatters = DEFAULT_AXISFORMATTER,
|
|
17
|
+
tickValues,
|
|
18
|
+
keys = DEFAULT_KEYS,
|
|
19
|
+
tooltipFunction,
|
|
20
|
+
chartProps,
|
|
21
|
+
className,
|
|
22
|
+
"data-testid": dataTestId
|
|
23
|
+
}) => {
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
const chartTheme = {
|
|
26
|
+
axis: {
|
|
27
|
+
ticks: {
|
|
28
|
+
line: {
|
|
29
|
+
stroke: theme.colors.neutral.backgroundStrong,
|
|
30
|
+
strokeWidth: 1
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
fontFamily: theme.typography.body.fontFamily,
|
|
35
|
+
fontSize: 12,
|
|
36
|
+
textColor: theme.colors.neutral.textWeak
|
|
37
|
+
};
|
|
38
|
+
const tooltip = useCallback(
|
|
39
|
+
(props) => {
|
|
40
|
+
const { indexValue, formattedValue, color } = tooltipFunction ? tooltipFunction(props) : props;
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
BarChartToolTip,
|
|
43
|
+
{
|
|
44
|
+
formattedValue,
|
|
45
|
+
indexValue: indexValue.toString(),
|
|
46
|
+
color
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
[tooltipFunction]
|
|
51
|
+
);
|
|
52
|
+
return /* @__PURE__ */ jsx("div", { style: { height }, className, "data-testid": dataTestId, children: /* @__PURE__ */ jsx(
|
|
53
|
+
ResponsiveBar,
|
|
54
|
+
{
|
|
55
|
+
colors: getLegendColor(theme),
|
|
56
|
+
data,
|
|
57
|
+
margin,
|
|
58
|
+
axisBottom: {
|
|
59
|
+
format: axisFormatters?.bottom,
|
|
60
|
+
tickPadding: 5,
|
|
61
|
+
tickRotation: 0,
|
|
62
|
+
tickSize: 5,
|
|
63
|
+
tickValues: tickValues?.bottom
|
|
64
|
+
},
|
|
65
|
+
axisLeft: {
|
|
66
|
+
format: axisFormatters?.left,
|
|
67
|
+
tickPadding: 5,
|
|
68
|
+
tickRotation: 0,
|
|
69
|
+
tickSize: 5,
|
|
70
|
+
tickValues: tickValues?.left
|
|
71
|
+
},
|
|
72
|
+
theme: chartTheme,
|
|
73
|
+
tooltip,
|
|
74
|
+
keys,
|
|
75
|
+
enableLabel: false,
|
|
76
|
+
...chartProps
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
BarChart
|
|
82
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
type BarProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Unique id of the bar
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* The value of the bar
|
|
9
|
+
*/
|
|
10
|
+
value: number;
|
|
11
|
+
/**
|
|
12
|
+
* Text to display inside the bar
|
|
13
|
+
*/
|
|
14
|
+
text?: string;
|
|
15
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
16
|
+
onDoubleClick?: MouseEventHandler<HTMLDivElement>;
|
|
17
|
+
onMouseDown?: MouseEventHandler<HTMLDivElement>;
|
|
18
|
+
onMouseUp?: MouseEventHandler<HTMLDivElement>;
|
|
19
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
20
|
+
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
21
|
+
/**
|
|
22
|
+
* A tooltip to display when hovering the bar
|
|
23
|
+
*/
|
|
24
|
+
tooltip?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
type BarStackProps = {
|
|
27
|
+
data: BarProps[];
|
|
28
|
+
total?: number;
|
|
29
|
+
className?: string;
|
|
30
|
+
'data-testid'?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* BarStack is a graphic component that is used to show data in one dimension.
|
|
34
|
+
*/
|
|
35
|
+
export declare const BarStack: ({ data, total, className, "data-testid": dataTestId, }: BarStackProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { Tooltip } from "../Tooltip/index.js";
|
|
5
|
+
const StyledBarWrapper = styled.div`
|
|
6
|
+
width: 0px;
|
|
7
|
+
transition: width 500ms;
|
|
8
|
+
background-color: ${({ theme }) => theme.colors.neutral.backgroundWeak};
|
|
9
|
+
`;
|
|
10
|
+
const StyledBar = styled.div`
|
|
11
|
+
height: 50px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
color: ${({ theme }) => theme.colors.neutral.backgroundWeak};
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
padding: ${({ theme }) => theme.space[1]};
|
|
18
|
+
width: 100%;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-shadow:
|
|
22
|
+
-1px 0 ${({ theme }) => theme.colors.neutral.backgroundStronger}B3,
|
|
23
|
+
0 1px ${({ theme }) => theme.colors.neutral.backgroundStronger}B3,
|
|
24
|
+
1px 0 ${({ theme }) => theme.colors.neutral.backgroundStronger}B3,
|
|
25
|
+
0 -1px ${({ theme }) => theme.colors.neutral.backgroundStronger}B3;
|
|
26
|
+
`;
|
|
27
|
+
const StyledContainer = styled.div`
|
|
28
|
+
width: 100%;
|
|
29
|
+
display: flex;
|
|
30
|
+
background-color: ${({ theme }) => theme.colors.neutral.backgroundWeak};
|
|
31
|
+
border-radius: ${({ theme }) => theme.radii.default};
|
|
32
|
+
box-shadow: ${({ theme }) => theme.shadows.defaultShadow};
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
|
|
35
|
+
${StyledBarWrapper}:nth-child(5n+1) {
|
|
36
|
+
${({
|
|
37
|
+
theme
|
|
38
|
+
}) => `background: linear-gradient(-45deg, ${theme.colors.neutral.backgroundWeak}1A 25%,
|
|
39
|
+
${theme.colors.primary.backgroundStrong} 25%, ${theme.colors.primary.backgroundStrong} 50%,
|
|
40
|
+
${theme.colors.neutral.backgroundWeak}1A 50%, ${theme.colors.neutral.backgroundWeak}1A 75%, ${theme.colors.primary.backgroundStrong}
|
|
41
|
+
75%);`}
|
|
42
|
+
background-size: 30px 30px;
|
|
43
|
+
background-color: ${({ theme }) => theme.colors.primary.backgroundStrong};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
${StyledBarWrapper}:nth-child(5n+2) {
|
|
47
|
+
background-color: ${({ theme }) => theme.colors.primary.backgroundStrong}D9;
|
|
48
|
+
|
|
49
|
+
background-image: linear-gradient(
|
|
50
|
+
135deg,
|
|
51
|
+
${({ theme }) => theme.colors.neutral.backgroundStrong}33 25%,
|
|
52
|
+
transparent 25%
|
|
53
|
+
),
|
|
54
|
+
linear-gradient(
|
|
55
|
+
225deg,
|
|
56
|
+
${({ theme }) => theme.colors.neutral.backgroundStrong}33 25%,
|
|
57
|
+
transparent 25%
|
|
58
|
+
),
|
|
59
|
+
linear-gradient(
|
|
60
|
+
45deg,
|
|
61
|
+
${({ theme }) => theme.colors.neutral.backgroundStrong}33 25%,
|
|
62
|
+
transparent 25%
|
|
63
|
+
),
|
|
64
|
+
linear-gradient(
|
|
65
|
+
315deg,
|
|
66
|
+
${({ theme }) => theme.colors.neutral.backgroundStrong}33 25%,
|
|
67
|
+
${({ theme }) => theme.colors.primary.backgroundStrong}12 25%
|
|
68
|
+
);
|
|
69
|
+
background-position:
|
|
70
|
+
10px 0,
|
|
71
|
+
10px 0,
|
|
72
|
+
0 0,
|
|
73
|
+
0 0;
|
|
74
|
+
background-size: 10px 10px;
|
|
75
|
+
background-repeat: repeat;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
${StyledBarWrapper}:nth-child(5n+3) {
|
|
79
|
+
${({
|
|
80
|
+
theme
|
|
81
|
+
}) => `background: linear-gradient(-45deg, ${theme.colors.neutral.backgroundWeak}1A 25%,
|
|
82
|
+
${theme.colors.primary.backgroundStrong}4D 25%, ${theme.colors.primary.backgroundStrong}4D 50%,
|
|
83
|
+
${theme.colors.neutral.backgroundWeak}1A 50%, ${theme.colors.neutral.backgroundWeak}1A 75%, ${theme.colors.primary.backgroundStrong}4D
|
|
84
|
+
75%);`}
|
|
85
|
+
background-size: 30px 30px;
|
|
86
|
+
background-color: ${({ theme }) => theme.colors.secondary.backgroundStrong};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
${StyledBarWrapper}:nth-child(5n+4) {
|
|
90
|
+
background-color: ${({ theme }) => theme.colors.secondary.backgroundStrong};
|
|
91
|
+
|
|
92
|
+
background-image: linear-gradient(
|
|
93
|
+
135deg,
|
|
94
|
+
${({ theme }) => theme.colors.neutral.backgroundWeak}33 25%,
|
|
95
|
+
transparent 25%
|
|
96
|
+
),
|
|
97
|
+
linear-gradient(
|
|
98
|
+
225deg,
|
|
99
|
+
${({ theme }) => theme.colors.neutral.backgroundWeak}33 25%,
|
|
100
|
+
transparent 25%
|
|
101
|
+
),
|
|
102
|
+
linear-gradient(
|
|
103
|
+
45deg,
|
|
104
|
+
${({ theme }) => theme.colors.neutral.backgroundWeak}33 25%,
|
|
105
|
+
transparent 25%
|
|
106
|
+
),
|
|
107
|
+
linear-gradient(
|
|
108
|
+
315deg,
|
|
109
|
+
${({ theme }) => theme.colors.neutral.backgroundWeak}33 25%,
|
|
110
|
+
${({ theme }) => theme.colors.secondary.backgroundStrong} 25%
|
|
111
|
+
);
|
|
112
|
+
background-position:
|
|
113
|
+
10px 0,
|
|
114
|
+
10px 0,
|
|
115
|
+
0 0,
|
|
116
|
+
0 0;
|
|
117
|
+
background-size: 10px 10px;
|
|
118
|
+
background-repeat: repeat;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
${StyledBarWrapper}:nth-child(5n+5) {
|
|
122
|
+
${({
|
|
123
|
+
theme
|
|
124
|
+
}) => `background: linear-gradient(-45deg, ${theme.colors.neutral.backgroundWeak}40 25%,
|
|
125
|
+
${theme.colors.secondary.backgroundStrong}40 25%, ${theme.colors.secondary.backgroundStrong}40 50%,
|
|
126
|
+
${theme.colors.neutral.backgroundWeak}40 50%, ${theme.colors.neutral.backgroundWeak}40 75%, ${theme.colors.secondary.backgroundStrong}40
|
|
127
|
+
75%);`}
|
|
128
|
+
background-size: 30px 30px;
|
|
129
|
+
background-color: ${({ theme }) => theme.colors.secondary.backgroundStrong}BF;
|
|
130
|
+
}
|
|
131
|
+
`;
|
|
132
|
+
const BarStack = ({
|
|
133
|
+
data,
|
|
134
|
+
total,
|
|
135
|
+
className,
|
|
136
|
+
"data-testid": dataTestId
|
|
137
|
+
}) => {
|
|
138
|
+
const computedTotal = useMemo(
|
|
139
|
+
() => total ?? data.reduce((acc, { value }) => acc + value, 0),
|
|
140
|
+
[total, data]
|
|
141
|
+
);
|
|
142
|
+
return /* @__PURE__ */ jsx(StyledContainer, { "data-testid": dataTestId, className, children: data.map(
|
|
143
|
+
({
|
|
144
|
+
id,
|
|
145
|
+
value,
|
|
146
|
+
text,
|
|
147
|
+
onClick,
|
|
148
|
+
onDoubleClick,
|
|
149
|
+
onMouseEnter,
|
|
150
|
+
onMouseLeave,
|
|
151
|
+
onMouseDown,
|
|
152
|
+
onMouseUp,
|
|
153
|
+
tooltip
|
|
154
|
+
}) => /* @__PURE__ */ jsx(
|
|
155
|
+
StyledBarWrapper,
|
|
156
|
+
{
|
|
157
|
+
style: { width: `${value / computedTotal * 100}%` },
|
|
158
|
+
children: tooltip ? /* @__PURE__ */ jsx(Tooltip, { id: `tooltip-${id}`, text: tooltip, children: /* @__PURE__ */ jsx(
|
|
159
|
+
StyledBar,
|
|
160
|
+
{
|
|
161
|
+
onMouseDown,
|
|
162
|
+
onMouseUp,
|
|
163
|
+
onClick,
|
|
164
|
+
onDoubleClick,
|
|
165
|
+
onMouseEnter,
|
|
166
|
+
onMouseLeave,
|
|
167
|
+
children: text
|
|
168
|
+
}
|
|
169
|
+
) }) : /* @__PURE__ */ jsx(
|
|
170
|
+
StyledBar,
|
|
171
|
+
{
|
|
172
|
+
onMouseDown,
|
|
173
|
+
onMouseUp,
|
|
174
|
+
onClick,
|
|
175
|
+
onDoubleClick,
|
|
176
|
+
onMouseEnter,
|
|
177
|
+
onMouseLeave,
|
|
178
|
+
children: text
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
},
|
|
182
|
+
id
|
|
183
|
+
)
|
|
184
|
+
) });
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
BarStack
|
|
188
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { JSX, MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
|
+
type ItemProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time';
|
|
5
|
+
/**
|
|
6
|
+
* Make the component act a `Link` tag
|
|
7
|
+
*/
|
|
8
|
+
to?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* ID of the step, automatically injected by Breadcrumbs parent tag
|
|
12
|
+
*/
|
|
13
|
+
step?: number;
|
|
14
|
+
onClick?: (event: ReactMouseEvent<HTMLLIElement>, step: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const Item: ({ to, children, disabled, "aria-current": ariaCurrent, onClick, step, }: ItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
+
type BreadcrumbsProps = {
|
|
18
|
+
selected?: number;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
};
|
|
23
|
+
type BreadcrumbsType = ((props: BreadcrumbsProps) => JSX.Element) & {
|
|
24
|
+
Item: typeof Item;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Breadcrumbs component is used to display a navigation path with links to the parent pages.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Breadcrumbs: BreadcrumbsType;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { Children, isValidElement, cloneElement } from "react";
|
|
4
|
+
import { Link } from "../Link/index.js";
|
|
5
|
+
const contractString = (str) => {
|
|
6
|
+
if (typeof str === "string" && str.length > 30) {
|
|
7
|
+
return `${str.slice(0, 15)}...${str.slice(-15)}`;
|
|
8
|
+
}
|
|
9
|
+
return str;
|
|
10
|
+
};
|
|
11
|
+
const StyledOl = styled.ol`
|
|
12
|
+
list-style: none;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
align-items: center;
|
|
18
|
+
`;
|
|
19
|
+
const ItemContainer = styled.li`
|
|
20
|
+
display: inline;
|
|
21
|
+
|
|
22
|
+
&[aria-current='page'] {
|
|
23
|
+
color: ${({ theme }) => theme.colors.neutral.textWeak};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:not(:last-child)::after {
|
|
27
|
+
content: '›';
|
|
28
|
+
margin: 0 8px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${({ onClick }) => onClick ? `
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
&[aria-disabled="true"] {
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
}
|
|
36
|
+
` : ``}
|
|
37
|
+
`;
|
|
38
|
+
const Item = ({
|
|
39
|
+
to,
|
|
40
|
+
children,
|
|
41
|
+
disabled = false,
|
|
42
|
+
"aria-current": ariaCurrent,
|
|
43
|
+
onClick,
|
|
44
|
+
step
|
|
45
|
+
}) => /* @__PURE__ */ jsx(
|
|
46
|
+
ItemContainer,
|
|
47
|
+
{
|
|
48
|
+
"aria-disabled": disabled,
|
|
49
|
+
onClick: onClick ? (event) => onClick(event, step ?? -1) : void 0,
|
|
50
|
+
"aria-current": ariaCurrent,
|
|
51
|
+
children: to ? /* @__PURE__ */ jsx(Link, { sentiment: "primary", href: to, children: contractString(children) }) : contractString(children)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
const Breadcrumbs = ({
|
|
55
|
+
children,
|
|
56
|
+
selected: selectedProp,
|
|
57
|
+
className,
|
|
58
|
+
"data-testid": dataTestId
|
|
59
|
+
}) => {
|
|
60
|
+
const selected = selectedProp !== void 0 ? selectedProp : Children.count(children) - 1;
|
|
61
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", className, "data-testid": dataTestId, children: /* @__PURE__ */ jsx(StyledOl, { children: Children.map(children, (child, index) => {
|
|
62
|
+
if (!isValidElement(child)) {
|
|
63
|
+
return child;
|
|
64
|
+
}
|
|
65
|
+
const active = selected === index;
|
|
66
|
+
return cloneElement(child, {
|
|
67
|
+
"aria-current": active ? "page" : void 0,
|
|
68
|
+
step: index
|
|
69
|
+
});
|
|
70
|
+
}) }) });
|
|
71
|
+
};
|
|
72
|
+
Breadcrumbs.Item = Item;
|
|
73
|
+
export {
|
|
74
|
+
Breadcrumbs,
|
|
75
|
+
Item
|
|
76
|
+
};
|