@ultraviolet/ui 3.0.0-beta.25 → 3.0.0-beta.27
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/styles.css.js +1 -0
- package/dist/components/Avatar/constants.d.ts +5 -5
- package/dist/components/Avatar/constants.js +1 -1
- package/dist/components/Avatar/styles.css.d.ts +24 -24
- package/dist/components/Avatar/styles.css.js +0 -1
- package/dist/components/BarChart/Tooltip.d.ts +3 -3
- package/dist/components/BarChart/Tooltip.js +2 -2
- package/dist/components/BarChart/index.d.ts +1 -1
- package/dist/components/BarChart/index.js +2 -2
- package/dist/components/Button/constants.d.ts +1 -0
- package/dist/components/Button/index.d.ts +0 -4
- package/dist/components/ExpandableCard/constants.d.ts +1 -0
- package/dist/components/ExpandableCard/index.d.ts +1 -1
- package/dist/components/ExpandableCard/styles.css.d.ts +1 -1
- package/dist/components/ExpandableCard/styles.css.js +2 -2
- package/dist/components/Key/constants.d.ts +8 -0
- package/dist/components/Key/constants.js +11 -0
- package/dist/components/Key/index.d.ts +0 -8
- package/dist/components/Key/index.js +1 -9
- package/dist/components/LineChart/helpers.js +2 -2
- package/dist/components/List/Row.js +1 -1
- package/dist/components/Loader/constants.d.ts +8 -0
- package/dist/components/Loader/constants.js +11 -0
- package/dist/components/Loader/index.d.ts +1 -8
- package/dist/components/Loader/index.js +5 -24
- package/dist/components/Loader/styles.css.d.ts +1 -0
- package/dist/components/Loader/styles.css.js +3 -1
- package/dist/components/Menu/MenuContent.js +7 -1
- package/dist/components/Menu/components/Item.d.ts +2 -2
- package/dist/components/Menu/components/Item.js +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Notification/Notification.d.ts +10 -0
- package/dist/components/Notification/{index.js → Notification.js} +2 -14
- package/dist/components/Notification/NotificationContainer.d.ts +30 -0
- package/dist/components/Notification/NotificationContainer.js +17 -0
- package/dist/components/Notification/index.d.ts +2 -37
- package/dist/components/PieChart/Legends.d.ts +2 -2
- package/dist/components/PieChart/Legends.js +2 -2
- package/dist/components/PieChart/Tooltip.d.ts +2 -2
- package/dist/components/PieChart/Tooltip.js +1 -1
- package/dist/components/PieChart/index.js +1 -1
- package/dist/components/Popup/index.js +8 -0
- package/dist/components/ProgressBar/styles.css.js +0 -1
- package/dist/components/ProgressBar/variables.css.js +1 -0
- package/dist/components/SelectInput/components/SearchBarDropdown.d.ts +1 -3
- package/dist/components/SelectInput/components/SearchBarDropdown.js +7 -4
- package/dist/components/SelectableCard/styles.css.js +0 -1
- package/dist/components/SelectableCard/variables.css.js +1 -0
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/TagList/index.js +1 -1
- package/dist/components/Text/constants.d.ts +9 -0
- package/dist/components/Text/index.d.ts +1 -4
- package/dist/components/Text/style.css.js +1 -0
- package/dist/components/Text/variables.css.js +0 -1
- package/dist/components/Toaster/Toaster.d.ts +7 -0
- package/dist/components/Toaster/Toaster.js +25 -0
- package/dist/components/Toaster/ToasterContainer.d.ts +38 -0
- package/dist/components/Toaster/ToasterContainer.js +18 -0
- package/dist/components/Toaster/components/CloseButton.d.ts +8 -0
- package/dist/components/Toaster/components/CloseButton.js +12 -0
- package/dist/components/Toaster/components/Content.d.ts +6 -0
- package/dist/components/Toaster/components/Content.js +10 -0
- package/dist/components/Toaster/constants.d.ts +1 -0
- package/dist/components/Toaster/constants.js +4 -0
- package/dist/components/Toaster/index.d.ts +3 -45
- package/dist/components/TreeMapChart/Tooltip.d.ts +6 -0
- package/dist/components/TreeMapChart/Tooltip.js +15 -0
- package/dist/components/TreeMapChart/index.d.ts +18 -0
- package/dist/components/TreeMapChart/index.js +68 -0
- package/dist/components/TreeMapChart/styles.css.d.ts +2 -0
- package/dist/components/TreeMapChart/styles.css.js +7 -0
- package/dist/components/TreeMapChart/types.d.ts +7 -0
- package/dist/components/VerificationCode/constants.d.ts +1 -0
- package/dist/components/VerificationCode/index.d.ts +0 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/helpers/legend.d.ts +2 -2
- package/dist/helpers/legend.js +1 -1
- package/dist/helpers/nivoTheme.d.ts +1 -1
- package/dist/helpers/treeMap.d.ts +90 -0
- package/dist/helpers/treeMap.js +42 -0
- package/dist/hooks/useIsOverflowing.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +37 -9
- package/dist/ui.css +1 -1
- package/dist/utils/animations/animations.d.ts +27 -0
- package/dist/utils/animations/animations.js +271 -0
- package/dist/utils/animations/animationsVE.css.d.ts +27 -0
- package/dist/utils/animations/animationsVE.css.js +57 -0
- package/dist/utils/index.d.ts +2 -2
- package/package.json +6 -4
- package/dist/components/ActionBar/index.cjs +0 -22
- package/dist/components/ActionBar/styles.css.cjs +0 -10
- package/dist/components/Alert/index.cjs +0 -55
- package/dist/components/Alert/styles.css.cjs +0 -14
- package/dist/components/Avatar/constants.cjs +0 -19
- package/dist/components/Avatar/index.cjs +0 -66
- package/dist/components/Avatar/styles.css.cjs +0 -18
- package/dist/components/Avatar/variables.css.cjs +0 -8
- package/dist/components/Badge/constant.cjs +0 -8
- package/dist/components/Badge/index.cjs +0 -27
- package/dist/components/Badge/styles.css.cjs +0 -6
- package/dist/components/Banner/assets/default-image-small.svg.cjs +0 -3
- package/dist/components/Banner/assets/default-image.svg.cjs +0 -3
- package/dist/components/Banner/index.cjs +0 -74
- package/dist/components/Banner/styles.css.cjs +0 -10
- package/dist/components/BarChart/Tooltip.cjs +0 -22
- package/dist/components/BarChart/index.cjs +0 -60
- package/dist/components/BarChart/styles.css.cjs +0 -9
- package/dist/components/BarStack/index.cjs +0 -35
- package/dist/components/BarStack/styles.css.cjs +0 -11
- package/dist/components/Breadcrumbs/components/Item.cjs +0 -41
- package/dist/components/Breadcrumbs/components/styles.css.cjs +0 -18
- package/dist/components/Breadcrumbs/index.cjs +0 -14
- package/dist/components/Breadcrumbs/styles.css.cjs +0 -5
- package/dist/components/Bullet/index.cjs +0 -24
- package/dist/components/Bullet/styles.css.cjs +0 -6
- package/dist/components/Button/constants.cjs +0 -6
- package/dist/components/Button/index.cjs +0 -84
- package/dist/components/Button/styles.css.cjs +0 -6
- package/dist/components/Card/index.cjs +0 -28
- package/dist/components/Card/styles.css.cjs +0 -7
- package/dist/components/Carousel/index.cjs +0 -74
- package/dist/components/Carousel/styles.css.cjs +0 -15
- package/dist/components/Checkbox/index.cjs +0 -58
- package/dist/components/Checkbox/styles.css.cjs +0 -17
- package/dist/components/CheckboxGroup/index.cjs +0 -78
- package/dist/components/CheckboxGroup/styles.css.cjs +0 -7
- package/dist/components/Chip/ChipContext.cjs +0 -6
- package/dist/components/Chip/ChipIcon.cjs +0 -52
- package/dist/components/Chip/index.cjs +0 -60
- package/dist/components/Chip/styles.css.cjs +0 -7
- package/dist/components/CopyButton/index.cjs +0 -35
- package/dist/components/DateInput/Context.cjs +0 -23
- package/dist/components/DateInput/components/CalendarContent.cjs +0 -61
- package/dist/components/DateInput/components/CalendarDaily.cjs +0 -169
- package/dist/components/DateInput/components/CalendarMonthly.cjs +0 -105
- package/dist/components/DateInput/components/Popup.cjs +0 -28
- package/dist/components/DateInput/components/styles.css.cjs +0 -12
- package/dist/components/DateInput/constants.cjs +0 -6
- package/dist/components/DateInput/helpers.cjs +0 -69
- package/dist/components/DateInput/helpersLocale.cjs +0 -64
- package/dist/components/DateInput/index.cjs +0 -192
- package/dist/components/DateInput/styles.css.cjs +0 -8
- package/dist/components/Dialog/Context.cjs +0 -14
- package/dist/components/Dialog/components/Button.cjs +0 -17
- package/dist/components/Dialog/components/Buttons.cjs +0 -13
- package/dist/components/Dialog/components/CancelButton.cjs +0 -12
- package/dist/components/Dialog/components/Stack.cjs +0 -10
- package/dist/components/Dialog/components/Text.cjs +0 -10
- package/dist/components/Dialog/index.cjs +0 -60
- package/dist/components/Dialog/styles.css.cjs +0 -7
- package/dist/components/Drawer/index.cjs +0 -56
- package/dist/components/Drawer/styles.css.cjs +0 -17
- package/dist/components/EmptyState/index.cjs +0 -42
- package/dist/components/EmptyState/styles.css.cjs +0 -10
- package/dist/components/Expandable/index.cjs +0 -108
- package/dist/components/Expandable/styles.css.cjs +0 -7
- package/dist/components/ExpandableCard/components/Title.cjs +0 -13
- package/dist/components/ExpandableCard/index.cjs +0 -114
- package/dist/components/ExpandableCard/styles.css.cjs +0 -17
- package/dist/components/GlobalAlert/GlobalAlertLink.cjs +0 -25
- package/dist/components/GlobalAlert/index.cjs +0 -39
- package/dist/components/GlobalAlert/styles.css.cjs +0 -7
- package/dist/components/InfiniteScroll/index.cjs +0 -91
- package/dist/components/Key/index.cjs +0 -45
- package/dist/components/Key/styles.css.cjs +0 -6
- package/dist/components/Label/index.cjs +0 -52
- package/dist/components/Label/styles.css.cjs +0 -5
- package/dist/components/LineChart/CustomLegend.cjs +0 -64
- package/dist/components/LineChart/Tooltip.cjs +0 -19
- package/dist/components/LineChart/helpers.cjs +0 -57
- package/dist/components/LineChart/index.cjs +0 -92
- package/dist/components/LineChart/styles.css.cjs +0 -27
- package/dist/components/Link/index.cjs +0 -69
- package/dist/components/Link/styles.css.cjs +0 -14
- package/dist/components/List/Cell.cjs +0 -31
- package/dist/components/List/ColumnProvider.cjs +0 -28
- package/dist/components/List/HeaderCell.cjs +0 -49
- package/dist/components/List/HeaderRow.cjs +0 -26
- package/dist/components/List/ListContext.cjs +0 -210
- package/dist/components/List/Row.cjs +0 -107
- package/dist/components/List/SelectBar.cjs +0 -28
- package/dist/components/List/SkeletonRows.cjs +0 -31
- package/dist/components/List/index.cjs +0 -49
- package/dist/components/List/styles.css.cjs +0 -35
- package/dist/components/List/variables.css.cjs +0 -16
- package/dist/components/Loader/index.cjs +0 -66
- package/dist/components/Loader/styles.css.cjs +0 -7
- package/dist/components/Menu/MenuContent.cjs +0 -177
- package/dist/components/Menu/MenuProvider.cjs +0 -44
- package/dist/components/Menu/components/Group.cjs +0 -25
- package/dist/components/Menu/components/Item.cjs +0 -97
- package/dist/components/Menu/helpers.cjs +0 -48
- package/dist/components/Menu/index.cjs +0 -20
- package/dist/components/Menu/styles.css.cjs +0 -24
- package/dist/components/Meter/index.cjs +0 -34
- package/dist/components/Meter/styles.css.cjs +0 -11
- package/dist/components/Modal/ModalContent.cjs +0 -39
- package/dist/components/Modal/ModalProvider.cjs +0 -41
- package/dist/components/Modal/components/Dialog.cjs +0 -148
- package/dist/components/Modal/components/Disclosure.cjs +0 -42
- package/dist/components/Modal/index.cjs +0 -58
- package/dist/components/Modal/styles.css.cjs +0 -21
- package/dist/components/Notice/index.cjs +0 -17
- package/dist/components/Notice/styles.css.cjs +0 -5
- package/dist/components/Notification/index.cjs +0 -35
- package/dist/components/Notification/styles.css.cjs +0 -5
- package/dist/components/NumberInput/index.cjs +0 -145
- package/dist/components/NumberInput/styles.css.cjs +0 -14
- package/dist/components/Pagination/PaginationButtons.cjs +0 -49
- package/dist/components/Pagination/PerPage.cjs +0 -49
- package/dist/components/Pagination/getPageNumbers.cjs +0 -23
- package/dist/components/Pagination/index.cjs +0 -43
- package/dist/components/Pagination/styles.css.cjs +0 -9
- package/dist/components/PasswordCheck/index.cjs +0 -18
- package/dist/components/PasswordCheck/styles.css.cjs +0 -5
- package/dist/components/PieChart/Legends.cjs +0 -36
- package/dist/components/PieChart/Tooltip.cjs +0 -18
- package/dist/components/PieChart/index.cjs +0 -71
- package/dist/components/PieChart/styles.css.cjs +0 -36
- package/dist/components/Popover/index.cjs +0 -67
- package/dist/components/Popover/styles.css.cjs +0 -8
- package/dist/components/Popup/helpers.cjs +0 -264
- package/dist/components/Popup/index.cjs +0 -283
- package/dist/components/Popup/styles.css.cjs +0 -13
- package/dist/components/Popup/variables.css.cjs +0 -18
- package/dist/components/ProgressBar/index.cjs +0 -46
- package/dist/components/ProgressBar/styles.css.cjs +0 -12
- package/dist/components/ProgressBar/variables.css.cjs +0 -4
- package/dist/components/Radio/index.cjs +0 -69
- package/dist/components/Radio/styles.css.cjs +0 -21
- package/dist/components/RadioGroup/index.cjs +0 -73
- package/dist/components/RadioGroup/styles.css.cjs +0 -5
- package/dist/components/Row/index.cjs +0 -46
- package/dist/components/Row/styles.css.cjs +0 -17
- package/dist/components/Row/variables.css.cjs +0 -7
- package/dist/components/SearchInput/KeyGroup.cjs +0 -13
- package/dist/components/SearchInput/index.cjs +0 -186
- package/dist/components/SearchInput/styles.css.cjs +0 -10
- package/dist/components/SelectInput/SelectInputProvider.cjs +0 -203
- package/dist/components/SelectInput/components/Dropdown.cjs +0 -341
- package/dist/components/SelectInput/components/DropdownOption.cjs +0 -47
- package/dist/components/SelectInput/components/SearchBarDropdown.cjs +0 -117
- package/dist/components/SelectInput/components/SelectBar.cjs +0 -237
- package/dist/components/SelectInput/components/dropdown.css.cjs +0 -34
- package/dist/components/SelectInput/components/selectBar.css.cjs +0 -22
- package/dist/components/SelectInput/findOptionInOptions.cjs +0 -12
- package/dist/components/SelectInput/index.cjs +0 -68
- package/dist/components/SelectInput/styles.css.cjs +0 -7
- package/dist/components/SelectInput/types.cjs +0 -9
- package/dist/components/SelectableCard/index.cjs +0 -149
- package/dist/components/SelectableCard/styles.css.cjs +0 -21
- package/dist/components/SelectableCard/variables.css.cjs +0 -8
- package/dist/components/SelectableCardGroup/index.cjs +0 -75
- package/dist/components/SelectableCardGroup/styles.css.cjs +0 -5
- package/dist/components/SelectableCardOptionGroup/Provider.cjs +0 -24
- package/dist/components/SelectableCardOptionGroup/components/Image.cjs +0 -17
- package/dist/components/SelectableCardOptionGroup/components/Option.cjs +0 -60
- package/dist/components/SelectableCardOptionGroup/index.cjs +0 -51
- package/dist/components/SelectableCardOptionGroup/styles.css.cjs +0 -21
- package/dist/components/Separator/index.cjs +0 -40
- package/dist/components/Separator/styles.css.cjs +0 -10
- package/dist/components/Skeleton/Block.cjs +0 -17
- package/dist/components/Skeleton/Blocks.cjs +0 -20
- package/dist/components/Skeleton/BoxWithIcon.cjs +0 -20
- package/dist/components/Skeleton/Donut.cjs +0 -16
- package/dist/components/Skeleton/IconSkeleton.cjs +0 -7
- package/dist/components/Skeleton/Line.cjs +0 -12
- package/dist/components/Skeleton/List.cjs +0 -18
- package/dist/components/Skeleton/Slider.cjs +0 -14
- package/dist/components/Skeleton/Square.cjs +0 -7
- package/dist/components/Skeleton/index.cjs +0 -39
- package/dist/components/Skeleton/styles.css.cjs +0 -7
- package/dist/components/Skeleton/stylesVariants.css.cjs +0 -47
- package/dist/components/Slider/components/DoubleSlider.cjs +0 -236
- package/dist/components/Slider/components/Options.cjs +0 -35
- package/dist/components/Slider/components/SingleSlider.cjs +0 -153
- package/dist/components/Slider/constant.cjs +0 -4
- package/dist/components/Slider/index.cjs +0 -61
- package/dist/components/Slider/styles.css.cjs +0 -36
- package/dist/components/Snippet/index.cjs +0 -64
- package/dist/components/Snippet/styles.css.cjs +0 -26
- package/dist/components/Stack/index.cjs +0 -85
- package/dist/components/Stack/styles.css.cjs +0 -19
- package/dist/components/Stack/variables.css.cjs +0 -11
- package/dist/components/Status/index.cjs +0 -25
- package/dist/components/Status/styles.css.cjs +0 -11
- package/dist/components/StepList/index.cjs +0 -32
- package/dist/components/StepList/styles.css.cjs +0 -10
- package/dist/components/Stepper/Step.cjs +0 -72
- package/dist/components/Stepper/StepperProvider.cjs +0 -41
- package/dist/components/Stepper/index.cjs +0 -49
- package/dist/components/Stepper/styles.css.cjs +0 -20
- package/dist/components/SwitchButton/FocusOverlay.cjs +0 -16
- package/dist/components/SwitchButton/Option.cjs +0 -40
- package/dist/components/SwitchButton/SwitchButtonContext.cjs +0 -13
- package/dist/components/SwitchButton/constant.cjs +0 -4
- package/dist/components/SwitchButton/index.cjs +0 -110
- package/dist/components/SwitchButton/styles.css.cjs +0 -9
- package/dist/components/Table/Body.cjs +0 -8
- package/dist/components/Table/Cell.cjs +0 -35
- package/dist/components/Table/Header.cjs +0 -9
- package/dist/components/Table/HeaderCell.cjs +0 -55
- package/dist/components/Table/HeaderRow.cjs +0 -28
- package/dist/components/Table/Row.cjs +0 -88
- package/dist/components/Table/SelectBar.cjs +0 -28
- package/dist/components/Table/SkeletonRows.cjs +0 -24
- package/dist/components/Table/TableContext.cjs +0 -43
- package/dist/components/Table/constants.cjs +0 -4
- package/dist/components/Table/index.cjs +0 -56
- package/dist/components/Table/styles.css.cjs +0 -29
- package/dist/components/Table/variables.css.cjs +0 -14
- package/dist/components/Tabs/Tab.cjs +0 -52
- package/dist/components/Tabs/TabMenu.cjs +0 -32
- package/dist/components/Tabs/TabMenuItem.cjs +0 -27
- package/dist/components/Tabs/TabsContext.cjs +0 -7
- package/dist/components/Tabs/index.cjs +0 -74
- package/dist/components/Tabs/styles.css.cjs +0 -21
- package/dist/components/Tag/index.cjs +0 -63
- package/dist/components/Tag/styles.css.cjs +0 -10
- package/dist/components/TagInput/index.cjs +0 -163
- package/dist/components/TagInput/styles.css.cjs +0 -12
- package/dist/components/TagList/constant.cjs +0 -5
- package/dist/components/TagList/index.cjs +0 -163
- package/dist/components/TagList/styles.css.cjs +0 -14
- package/dist/components/Text/constant.d.ts +0 -6
- package/dist/components/Text/index.cjs +0 -53
- package/dist/components/Text/style.css.cjs +0 -6
- package/dist/components/Text/variables.css.cjs +0 -7
- package/dist/components/TextArea/index.cjs +0 -123
- package/dist/components/TextArea/styles.css.cjs +0 -12
- package/dist/components/TextInput/index.cjs +0 -119
- package/dist/components/TextInput/styles.css.cjs +0 -17
- package/dist/components/TimeInput/constants.cjs +0 -13
- package/dist/components/TimeInput/helpers.cjs +0 -66
- package/dist/components/TimeInput/index.cjs +0 -273
- package/dist/components/TimeInput/styles.css.cjs +0 -10
- package/dist/components/Toaster/index.cjs +0 -47
- package/dist/components/Toaster/index.js +0 -47
- package/dist/components/Toaster/styles.css.cjs +0 -7
- package/dist/components/Toggle/index.cjs +0 -50
- package/dist/components/Toggle/styles.css.cjs +0 -10
- package/dist/components/ToggleGroup/index.cjs +0 -72
- package/dist/components/ToggleGroup/styles.css.cjs +0 -5
- package/dist/components/Tooltip/index.cjs +0 -26
- package/dist/components/Tooltip/styles.css.cjs +0 -5
- package/dist/components/UnitInput/index.cjs +0 -111
- package/dist/components/UnitInput/styles.css.cjs +0 -18
- package/dist/components/VerificationCode/index.cjs +0 -148
- package/dist/components/VerificationCode/styles.css.cjs +0 -9
- package/dist/helpers/isClientSide.cjs +0 -4
- package/dist/helpers/legend.cjs +0 -14
- package/dist/helpers/nivoTheme.cjs +0 -22
- package/dist/helpers/recursivelyGetChildrenString.cjs +0 -17
- package/dist/hooks/useIsOverflowing.cjs +0 -23
- package/dist/index.cjs +0 -214
- package/dist/theme/ThemeProvider.cjs +0 -16
- package/dist/theme/index.cjs +0 -38
- package/dist/utils/animationVanillaExtract.css.cjs +0 -11
- package/dist/utils/animationVanillaExtract.css.d.ts +0 -4
- package/dist/utils/animationVanillaExtract.css.js +0 -11
- package/dist/utils/animations.cjs +0 -276
- package/dist/utils/animations.d.ts +0 -162
- package/dist/utils/animations.js +0 -276
- package/dist/utils/ids.cjs +0 -8
- package/dist/utils/normalize.cjs +0 -35
- package/dist/utils/responsive/Breakpoint.cjs +0 -15
- package/dist/utils/responsive/utilities.cjs +0 -17
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
|
3
3
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
4
4
|
import { Tooltip } from "../Tooltip/index.js";
|
|
5
5
|
import { listPie, listItemPie, toggleBoxPie, bulletPie, colorBullet, labelPie, textPie, linePie, progressiveLinePie, valuePie } from "./styles.css.js";
|
|
6
|
-
import Tooltip$1 from "./Tooltip.js";
|
|
6
|
+
import { Tooltip as Tooltip$1 } from "./Tooltip.js";
|
|
7
7
|
const Legends = ({
|
|
8
8
|
focused,
|
|
9
9
|
data,
|
|
@@ -33,5 +33,5 @@ const Legends = ({
|
|
|
33
33
|
] }) }, item.id);
|
|
34
34
|
}) });
|
|
35
35
|
export {
|
|
36
|
-
Legends
|
|
36
|
+
Legends
|
|
37
37
|
};
|
|
@@ -8,5 +8,5 @@ type TooltipProps = {
|
|
|
8
8
|
}[] | null;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
declare const Tooltip: ({ data }: TooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
-
export
|
|
11
|
+
export declare const Tooltip: ({ data }: TooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -7,7 +7,7 @@ import { useState, useCallback } from "react";
|
|
|
7
7
|
import { getLegendColor } from "../../helpers/legend.js";
|
|
8
8
|
import { getNivoTheme } from "../../helpers/nivoTheme.js";
|
|
9
9
|
import { Text } from "../Text/index.js";
|
|
10
|
-
import Legends from "./Legends.js";
|
|
10
|
+
import { Legends } from "./Legends.js";
|
|
11
11
|
import { emptyLegendPie, containerPie, contentPie, heightContainerPie } from "./styles.css.js";
|
|
12
12
|
const DEFAULT_CHARTPROPS = {};
|
|
13
13
|
const DEFAULT_MARGIN = {
|
|
@@ -222,6 +222,14 @@ const Popup = forwardRef(({
|
|
|
222
222
|
event.preventDefault();
|
|
223
223
|
}
|
|
224
224
|
}, []);
|
|
225
|
+
useEffect(() => () => {
|
|
226
|
+
if (timer.current) {
|
|
227
|
+
clearTimeout(timer.current);
|
|
228
|
+
}
|
|
229
|
+
if (debounceTimer.current) {
|
|
230
|
+
clearTimeout(debounceTimer.current);
|
|
231
|
+
}
|
|
232
|
+
}, []);
|
|
225
233
|
const renderChildren = useCallback(() => {
|
|
226
234
|
if (typeof children === "function") {
|
|
227
235
|
return children({
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import type { DataType
|
|
2
|
+
import type { DataType } from '../types';
|
|
3
3
|
type SearchBarProps = {
|
|
4
4
|
placeholder: string;
|
|
5
5
|
displayedOptions: DataType;
|
|
6
6
|
setSearchBarActive: Dispatch<SetStateAction<boolean>>;
|
|
7
7
|
};
|
|
8
|
-
export declare const getReferenceText: (option: OptionType) => string;
|
|
9
|
-
export declare const searchRegex: (data: OptionType[], query: string) => OptionType[];
|
|
10
8
|
export declare const SearchBarDropdown: ({ placeholder, displayedOptions, setSearchBarActive, }: SearchBarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
9
|
export {};
|
|
@@ -104,14 +104,17 @@ const SearchBarDropdown = ({
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
useEffect(() => {
|
|
107
|
-
setTimeout(() => {
|
|
107
|
+
const timeout = setTimeout(() => {
|
|
108
108
|
searchInputRef.current?.focus();
|
|
109
109
|
}, 50);
|
|
110
|
+
return () => {
|
|
111
|
+
if (timeout) {
|
|
112
|
+
clearTimeout(timeout);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
110
115
|
}, []);
|
|
111
116
|
return /* @__PURE__ */ jsx(TextInput, { "aria-label": "search-bar", className: searchBar, "data-testid": "search-bar", onBlur: () => setSearchBarActive(false), onChange: (event) => handleChange(event.target.value), onFocus: () => setSearchBarActive(true), onKeyDown: (event) => handleKeyDown(event.key, searchInput), placeholder, prefix: /* @__PURE__ */ jsx(SearchIcon, { sentiment: "neutral", size: "small" }), ref: searchInputRef, size: "medium", value: searchInput });
|
|
112
117
|
};
|
|
113
118
|
export {
|
|
114
|
-
SearchBarDropdown
|
|
115
|
-
getReferenceText,
|
|
116
|
-
searchRegex
|
|
119
|
+
SearchBarDropdown
|
|
117
120
|
};
|
|
@@ -16,7 +16,7 @@ const Stepper = ({
|
|
|
16
16
|
separator = true,
|
|
17
17
|
style
|
|
18
18
|
}) => {
|
|
19
|
-
const cleanChildren = Children.toArray(children).filter(isValidElement);
|
|
19
|
+
const cleanChildren = Children.toArray(children).filter((child) => isValidElement(child));
|
|
20
20
|
const lastStep = Children.count(cleanChildren) - 1;
|
|
21
21
|
return /* @__PURE__ */ jsx(StepperProvider, { animated, interactive, labelPosition, selected, separator, size, children: /* @__PURE__ */ jsx("div", { className: `${className ? `${className} ` : ""}${stepperContainer({
|
|
22
22
|
labelPosition,
|
|
@@ -96,7 +96,7 @@ const TagList = ({
|
|
|
96
96
|
const parentWidth = tagsContainer?.parentElement?.offsetWidth || 0;
|
|
97
97
|
if (visibleTags.length > 1 && hiddenTags.length > 0 && tagsContainerWidth + newPopoverTriggerWidth > parentWidth) {
|
|
98
98
|
const visibleTagsCopy = visibleTags.filter((_, index) => index < visibleTags.length - 1);
|
|
99
|
-
const tagToMove = visibleTags[visibleTags.length - 1];
|
|
99
|
+
const tagToMove = visibleTags[visibleTags.length - 1] ?? "";
|
|
100
100
|
setVisibleTags(visibleTagsCopy);
|
|
101
101
|
setHiddenTags([tagToMove, ...hiddenTags]);
|
|
102
102
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties, ElementType, ReactNode } from 'react';
|
|
2
2
|
import type { ExtendedColor } from '../../theme';
|
|
3
|
-
import {
|
|
4
|
-
import type { PROMINENCES } from './constant';
|
|
3
|
+
import type { PROMINENCES, TextVariant } from './constants';
|
|
5
4
|
type ProminenceProps = keyof typeof PROMINENCES;
|
|
6
5
|
type PlacementProps = CSSProperties['textAlign'];
|
|
7
6
|
type WhiteSpaceProps = CSSProperties['whiteSpace'];
|
|
8
|
-
type TextVariant = keyof typeof typography;
|
|
9
|
-
export declare const textVariants: TextVariant[];
|
|
10
7
|
type TextProps = {
|
|
11
8
|
className?: string;
|
|
12
9
|
children: ReactNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
/* empty css */
|
|
2
3
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
3
4
|
var text = createRuntimeFn({ defaultClassName: "uv_m4c9ow0", variantClassNames: { strikeThrough: { true: "uv_m4c9ow1", false: "uv_m4c9ow2" }, italic: { true: "uv_m4c9ow3", false: "uv_m4c9ow4" }, underline: { true: "uv_m4c9ow5", false: "uv_m4c9ow6" }, oneLine: { true: "uv_m4c9ow7", false: "uv_m4c9ow8" }, sentiment: { primary: "uv_m4c9ow9", secondary: "uv_m4c9owa", neutral: "uv_m4c9owb", success: "uv_m4c9owc", danger: "uv_m4c9owd", warning: "uv_m4c9owe", info: "uv_m4c9owf", black: "uv_m4c9owg", white: "uv_m4c9owh" }, prominence: { "default": "uv_m4c9owi", strong: "uv_m4c9owj", stronger: "uv_m4c9owk", weak: "uv_m4c9owl" }, variant: { body: "uv_m4c9owm", bodySmall: "uv_m4c9own", bodySmallStrong: "uv_m4c9owo", bodySmallStronger: "uv_m4c9owp", bodyStrong: "uv_m4c9owq", bodyStronger: "uv_m4c9owr", caption: "uv_m4c9ows", captionSmall: "uv_m4c9owt", captionSmallStrong: "uv_m4c9owu", captionSmallStronger: "uv_m4c9owv", captionStrong: "uv_m4c9oww", captionStronger: "uv_m4c9owx", code: "uv_m4c9owy", codeStrong: "uv_m4c9owz", codeStronger: "uv_m4c9ow10", heading: "uv_m4c9ow11", headingLarge: "uv_m4c9ow12", headingLargeStrong: "uv_m4c9ow13", headingLargeStronger: "uv_m4c9ow14", headingSmall: "uv_m4c9ow15", headingSmallStrong: "uv_m4c9ow16", headingSmallStronger: "uv_m4c9ow17", headingStrong: "uv_m4c9ow18", headingStronger: "uv_m4c9ow19" }, disabled: { true: "uv_m4c9ow1a", false: "uv_m4c9ow1b" } }, defaultVariants: { strikeThrough: false, italic: false, underline: false, oneLine: false, sentiment: void 0, prominence: "default", variant: "body", disabled: false }, compoundVariants: [[{ sentiment: "primary", prominence: "default", disabled: false }, "uv_m4c9ow1c"], [{ sentiment: "primary", prominence: "strong", disabled: false }, "uv_m4c9ow1d"], [{ sentiment: "primary", prominence: "stronger", disabled: false }, "uv_m4c9ow1e"], [{ sentiment: "primary", prominence: "weak", disabled: false }, "uv_m4c9ow1f"], [{ sentiment: "secondary", prominence: "default", disabled: false }, "uv_m4c9ow1g"], [{ sentiment: "secondary", prominence: "strong", disabled: false }, "uv_m4c9ow1h"], [{ sentiment: "secondary", prominence: "stronger", disabled: false }, "uv_m4c9ow1i"], [{ sentiment: "secondary", prominence: "weak", disabled: false }, "uv_m4c9ow1j"], [{ sentiment: "danger", prominence: "default", disabled: false }, "uv_m4c9ow1k"], [{ sentiment: "danger", prominence: "strong", disabled: false }, "uv_m4c9ow1l"], [{ sentiment: "danger", prominence: "stronger", disabled: false }, "uv_m4c9ow1m"], [{ sentiment: "danger", prominence: "weak", disabled: false }, "uv_m4c9ow1n"], [{ sentiment: "info", prominence: "default", disabled: false }, "uv_m4c9ow1o"], [{ sentiment: "info", prominence: "strong", disabled: false }, "uv_m4c9ow1p"], [{ sentiment: "info", prominence: "stronger", disabled: false }, "uv_m4c9ow1q"], [{ sentiment: "info", prominence: "weak", disabled: false }, "uv_m4c9ow1r"], [{ sentiment: "success", prominence: "default", disabled: false }, "uv_m4c9ow1s"], [{ sentiment: "success", prominence: "strong", disabled: false }, "uv_m4c9ow1t"], [{ sentiment: "success", prominence: "stronger", disabled: false }, "uv_m4c9ow1u"], [{ sentiment: "success", prominence: "weak", disabled: false }, "uv_m4c9ow1v"], [{ sentiment: "warning", prominence: "default", disabled: false }, "uv_m4c9ow1w"], [{ sentiment: "warning", prominence: "strong", disabled: false }, "uv_m4c9ow1x"], [{ sentiment: "warning", prominence: "stronger", disabled: false }, "uv_m4c9ow1y"], [{ sentiment: "warning", prominence: "weak", disabled: false }, "uv_m4c9ow1z"], [{ sentiment: "neutral", prominence: "default", disabled: false }, "uv_m4c9ow20"], [{ sentiment: "neutral", prominence: "strong", disabled: false }, "uv_m4c9ow21"], [{ sentiment: "neutral", prominence: "stronger", disabled: false }, "uv_m4c9ow22"], [{ sentiment: "neutral", prominence: "weak", disabled: false }, "uv_m4c9ow23"], [{ sentiment: "black", prominence: "default", disabled: false }, "uv_m4c9ow24"], [{ sentiment: "black", prominence: "strong", disabled: false }, "uv_m4c9ow25"], [{ sentiment: "black", prominence: "stronger", disabled: false }, "uv_m4c9ow26"], [{ sentiment: "black", prominence: "weak", disabled: false }, "uv_m4c9ow27"], [{ sentiment: "white", prominence: "default", disabled: false }, "uv_m4c9ow28"], [{ sentiment: "white", prominence: "strong", disabled: false }, "uv_m4c9ow29"], [{ sentiment: "white", prominence: "stronger", disabled: false }, "uv_m4c9ow2a"], [{ sentiment: "white", prominence: "weak", disabled: false }, "uv_m4c9ow2b"], [{ sentiment: "primary", prominence: "default", disabled: true }, "uv_m4c9ow2c"], [{ sentiment: "primary", prominence: "strong", disabled: true }, "uv_m4c9ow2d"], [{ sentiment: "primary", prominence: "stronger", disabled: true }, "uv_m4c9ow2e"], [{ sentiment: "primary", prominence: "weak", disabled: true }, "uv_m4c9ow2f"], [{ sentiment: "secondary", prominence: "default", disabled: true }, "uv_m4c9ow2g"], [{ sentiment: "secondary", prominence: "strong", disabled: true }, "uv_m4c9ow2h"], [{ sentiment: "secondary", prominence: "stronger", disabled: true }, "uv_m4c9ow2i"], [{ sentiment: "secondary", prominence: "weak", disabled: true }, "uv_m4c9ow2j"], [{ sentiment: "danger", prominence: "default", disabled: true }, "uv_m4c9ow2k"], [{ sentiment: "danger", prominence: "strong", disabled: true }, "uv_m4c9ow2l"], [{ sentiment: "danger", prominence: "stronger", disabled: true }, "uv_m4c9ow2m"], [{ sentiment: "danger", prominence: "weak", disabled: true }, "uv_m4c9ow2n"], [{ sentiment: "info", prominence: "default", disabled: true }, "uv_m4c9ow2o"], [{ sentiment: "info", prominence: "strong", disabled: true }, "uv_m4c9ow2p"], [{ sentiment: "info", prominence: "stronger", disabled: true }, "uv_m4c9ow2q"], [{ sentiment: "info", prominence: "weak", disabled: true }, "uv_m4c9ow2r"], [{ sentiment: "success", prominence: "default", disabled: true }, "uv_m4c9ow2s"], [{ sentiment: "success", prominence: "strong", disabled: true }, "uv_m4c9ow2t"], [{ sentiment: "success", prominence: "stronger", disabled: true }, "uv_m4c9ow2u"], [{ sentiment: "success", prominence: "weak", disabled: true }, "uv_m4c9ow2v"], [{ sentiment: "warning", prominence: "default", disabled: true }, "uv_m4c9ow2w"], [{ sentiment: "warning", prominence: "strong", disabled: true }, "uv_m4c9ow2x"], [{ sentiment: "warning", prominence: "stronger", disabled: true }, "uv_m4c9ow2y"], [{ sentiment: "warning", prominence: "weak", disabled: true }, "uv_m4c9ow2z"], [{ sentiment: "neutral", prominence: "default", disabled: true }, "uv_m4c9ow30"], [{ sentiment: "neutral", prominence: "strong", disabled: true }, "uv_m4c9ow31"], [{ sentiment: "neutral", prominence: "stronger", disabled: true }, "uv_m4c9ow32"], [{ sentiment: "neutral", prominence: "weak", disabled: true }, "uv_m4c9ow33"], [{ sentiment: "black", prominence: "default", disabled: true }, "uv_m4c9ow34"], [{ sentiment: "black", prominence: "strong", disabled: true }, "uv_m4c9ow35"], [{ sentiment: "black", prominence: "stronger", disabled: true }, "uv_m4c9ow36"], [{ sentiment: "black", prominence: "weak", disabled: true }, "uv_m4c9ow37"], [{ sentiment: "white", prominence: "default", disabled: true }, "uv_m4c9ow38"], [{ sentiment: "white", prominence: "strong", disabled: true }, "uv_m4c9ow39"], [{ sentiment: "white", prominence: "stronger", disabled: true }, "uv_m4c9ow3a"], [{ sentiment: "white", prominence: "weak", disabled: true }, "uv_m4c9ow3b"], [{ prominence: "default", disabled: false }, "uv_m4c9ow3c"], [{ prominence: "strong", disabled: false }, "uv_m4c9ow3d"], [{ prominence: "stronger", disabled: false }, "uv_m4c9ow3e"], [{ prominence: "weak", disabled: false }, "uv_m4c9ow3f"]] });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ToastOptions } from 'react-toastify';
|
|
3
|
+
export declare const toast: {
|
|
4
|
+
error: (children: ReactNode, options?: ToastOptions, containerId?: string) => number | string;
|
|
5
|
+
success: (children: ReactNode, options?: ToastOptions, containerId?: string) => number | string;
|
|
6
|
+
warning: (children: ReactNode, options?: ToastOptions, containerId?: string) => number | string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { toast as toast$1 } from "react-toastify";
|
|
4
|
+
import { CloseButton } from "./components/CloseButton.js";
|
|
5
|
+
import { Content } from "./components/Content.js";
|
|
6
|
+
const toast = {
|
|
7
|
+
error: (children, options, containerId) => toast$1.error(/* @__PURE__ */ jsx(Content, { children }), {
|
|
8
|
+
...options,
|
|
9
|
+
closeButton: /* @__PURE__ */ jsx(CloseButton, { sentiment: "danger" }),
|
|
10
|
+
containerId: containerId ?? "toaster"
|
|
11
|
+
}),
|
|
12
|
+
success: (children, options, containerId) => toast$1.success(/* @__PURE__ */ jsx(Content, { children }), {
|
|
13
|
+
...options,
|
|
14
|
+
closeButton: /* @__PURE__ */ jsx(CloseButton, { sentiment: "success" }),
|
|
15
|
+
containerId: containerId ?? "toaster"
|
|
16
|
+
}),
|
|
17
|
+
warning: (children, options, containerId) => toast$1.warn(/* @__PURE__ */ jsx(Content, { children }), {
|
|
18
|
+
...options,
|
|
19
|
+
closeButton: /* @__PURE__ */ jsx(CloseButton, { sentiment: "warning" }),
|
|
20
|
+
containerId: containerId ?? "toaster"
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
toast
|
|
25
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { ToastOptions } from 'react-toastify';
|
|
3
|
+
type ToastContainerProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to display the newest toast on top.
|
|
6
|
+
* `Default: false`
|
|
7
|
+
*/
|
|
8
|
+
newestOnTop?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Limit the number of toast displayed at the same time
|
|
11
|
+
*/
|
|
12
|
+
limit?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Position of the toast container
|
|
15
|
+
*/
|
|
16
|
+
position?: ToastOptions['position'];
|
|
17
|
+
'data-testid'?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Delay before the toast is automatically closed, if not set the default value is 6000ms
|
|
21
|
+
*/
|
|
22
|
+
autoClose?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Set a custom containerId to be able to define multiple ToastContainers
|
|
25
|
+
*/
|
|
26
|
+
containerId?: string;
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Display short information about an event that happen in the interface in a floating alert.
|
|
31
|
+
* Toaster is based on **react-tostify**, you can find a complete documentation
|
|
32
|
+
* [here](https://fkhadra.github.io/react-toastify/introduction/).
|
|
33
|
+
*
|
|
34
|
+
* Toaster is separated in two parts, first the `ToastContainer` which is where the div of the toast will be rendered,
|
|
35
|
+
* and second the `toast()` function which is used to display the toast.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ToastContainer: ({ newestOnTop, limit, position, "data-testid": dataTestId, className, autoClose, containerId, style, }: ToastContainerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { ToastContainer as ToastContainer$1, Slide } from "react-toastify";
|
|
4
|
+
import { AUTOCLOSE_DELAY } from "./constants.js";
|
|
5
|
+
import { toaster } from "./styles.css.js";
|
|
6
|
+
const ToastContainer = ({
|
|
7
|
+
newestOnTop,
|
|
8
|
+
limit,
|
|
9
|
+
position = "top-right",
|
|
10
|
+
"data-testid": dataTestId,
|
|
11
|
+
className,
|
|
12
|
+
autoClose,
|
|
13
|
+
containerId = "toaster",
|
|
14
|
+
style
|
|
15
|
+
}) => /* @__PURE__ */ jsx(ToastContainer$1, { autoClose: autoClose ?? AUTOCLOSE_DELAY, className: `${className ? `${className} ` : ""}${toaster}`, containerId, "data-testid": dataTestId, draggable: false, hideProgressBar: true, icon: false, limit, newestOnTop, pauseOnFocusLoss: false, pauseOnHover: false, position, stacked: true, style, transition: Slide });
|
|
16
|
+
export {
|
|
17
|
+
ToastContainer
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SENTIMENTS } from '../../../theme';
|
|
2
|
+
type SENTIMENT = (typeof SENTIMENTS)[number];
|
|
3
|
+
type CloseButtonProps = {
|
|
4
|
+
closeToast?: () => void;
|
|
5
|
+
sentiment: SENTIMENT;
|
|
6
|
+
};
|
|
7
|
+
export declare const CloseButton: ({ closeToast, sentiment, }: CloseButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { CloseIcon } from "@ultraviolet/icons";
|
|
4
|
+
import { Button } from "../../Button/index.js";
|
|
5
|
+
import { closeButtonToaster } from "../styles.css.js";
|
|
6
|
+
const CloseButton = ({
|
|
7
|
+
closeToast,
|
|
8
|
+
sentiment = "success"
|
|
9
|
+
}) => /* @__PURE__ */ jsx(Button, { "aria-label": "close", className: closeButtonToaster, onClick: closeToast, sentiment, size: "xsmall", children: /* @__PURE__ */ jsx(CloseIcon, {}) });
|
|
10
|
+
export {
|
|
11
|
+
CloseButton
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { Stack } from "../../Stack/index.js";
|
|
4
|
+
import { Text } from "../../Text/index.js";
|
|
5
|
+
const Content = ({
|
|
6
|
+
children
|
|
7
|
+
}) => /* @__PURE__ */ jsx(Stack, { direction: "row", gap: 2, width: "100%", children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "bodySmallStrong", children }) : children });
|
|
8
|
+
export {
|
|
9
|
+
Content
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AUTOCLOSE_DELAY = 6000;
|
|
@@ -1,48 +1,6 @@
|
|
|
1
|
-
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { ToastOptions } from 'react-toastify';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
export declare const toast: {
|
|
5
|
-
error: (children: ReactNode, options?: ToastOptions, containerId?: string) => number | string;
|
|
6
|
-
success: (children: ReactNode, options?: ToastOptions, containerId?: string) => number | string;
|
|
7
|
-
warning: (children: ReactNode, options?: ToastOptions, containerId?: string) => number | string;
|
|
8
|
-
};
|
|
9
|
-
type ToastContainerProps = {
|
|
10
|
-
/**
|
|
11
|
-
* Whether to display the newest toast on top.
|
|
12
|
-
* `Default: false`
|
|
13
|
-
*/
|
|
14
|
-
newestOnTop?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Limit the number of toast displayed at the same time
|
|
17
|
-
*/
|
|
18
|
-
limit?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Position of the toast container
|
|
21
|
-
*/
|
|
22
|
-
position?: ToastOptions['position'];
|
|
23
|
-
'data-testid'?: string;
|
|
24
|
-
className?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Delay before the toast is automatically closed, if not set the default value is 6000ms
|
|
27
|
-
*/
|
|
28
|
-
autoClose?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Set a custom containerId to be able to define multiple ToastContainers
|
|
31
|
-
*/
|
|
32
|
-
containerId?: string;
|
|
33
|
-
style?: CSSProperties;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Display short information about an event that happen in the interface in a floating alert.
|
|
37
|
-
* Toaster is based on **react-tostify**, you can find a complete documentation
|
|
38
|
-
* [here](https://fkhadra.github.io/react-toastify/introduction/).
|
|
39
|
-
*
|
|
40
|
-
* Toaster is separated in two parts, first the `ToastContainer` which is where the div of the toast will be rendered,
|
|
41
|
-
* and second the `toast()` function which is used to display the toast.
|
|
42
|
-
*/
|
|
43
|
-
export declare const ToastContainer: ({ newestOnTop, limit, position, "data-testid": dataTestId, className, autoClose, containerId, style, }: ToastContainerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
1
|
export declare const Toast: {
|
|
45
|
-
Button: ({ variant, className, ...props }: import("react").ComponentProps<typeof Button>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
2
|
+
Button: ({ variant, className, ...props }: import("react").ComponentProps<typeof import("..").Button>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
46
3
|
Link: ({ ...props }: import("react").ComponentProps<typeof import("..").Link>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
47
4
|
};
|
|
48
|
-
export {};
|
|
5
|
+
export { toast } from './Toaster';
|
|
6
|
+
export { ToastContainer } from './ToasterContainer';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DataType } from './types';
|
|
2
|
+
type TooltipProps = Pick<DataType, 'content' | 'value'> & {
|
|
3
|
+
'data-testid'?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const Tooltip: ({ value, content, "data-testid": dataTestId, }: TooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { Text } from "../Text/index.js";
|
|
4
|
+
import { treeMapTooltipContainer } from "./styles.css.js";
|
|
5
|
+
const Tooltip = ({
|
|
6
|
+
value,
|
|
7
|
+
content,
|
|
8
|
+
"data-testid": dataTestId
|
|
9
|
+
}) => /* @__PURE__ */ jsxs("div", { className: treeMapTooltipContainer, "data-testid": dataTestId, children: [
|
|
10
|
+
/* @__PURE__ */ jsx(Text, { as: "p", sentiment: "primary", variant: "bodyStronger", children: content }),
|
|
11
|
+
value ? /* @__PURE__ */ jsx(Text, { as: "p", sentiment: "primary", variant: "bodyStronger", children: value }) : null
|
|
12
|
+
] });
|
|
13
|
+
export {
|
|
14
|
+
Tooltip
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TooltipProps, TreeMapSvgProps } from '@nivo/treemap';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import { Tooltip } from './Tooltip';
|
|
4
|
+
import type { DataType } from './types';
|
|
5
|
+
type TreeMapChartProps = {
|
|
6
|
+
height?: string | number;
|
|
7
|
+
data: DataType;
|
|
8
|
+
className?: string;
|
|
9
|
+
tooltipFunction?: (props: TooltipProps<DataType>['node']['data']) => ComponentProps<typeof Tooltip>;
|
|
10
|
+
chartProps?: Partial<TreeMapSvgProps<DataType>>;
|
|
11
|
+
'data-testid'?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* TreeMapChart component is used to display data in a TreeMap chart format. It uses the Nivo library under the hood.
|
|
15
|
+
* See https://nivo.rocks/treemap/ for more information.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TreeMapChart: ({ height, data, tooltipFunction, chartProps, className, "data-testid": dataTestId, }: TreeMapChartProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { ResponsiveTreeMapHtml } from "@nivo/treemap";
|
|
4
|
+
import { useTheme } from "@ultraviolet/themes";
|
|
5
|
+
import { useMemo, useCallback } from "react";
|
|
6
|
+
import { getDataColors } from "../../helpers/treeMap.js";
|
|
7
|
+
import { Text } from "../Text/index.js";
|
|
8
|
+
import { treeMapContentWrapper } from "./styles.css.js";
|
|
9
|
+
import { Tooltip } from "./Tooltip.js";
|
|
10
|
+
const TreeMapChart = ({
|
|
11
|
+
height = "537px",
|
|
12
|
+
// maintains aspect ratio based on standard 1074px width
|
|
13
|
+
data,
|
|
14
|
+
tooltipFunction,
|
|
15
|
+
chartProps,
|
|
16
|
+
className,
|
|
17
|
+
"data-testid": dataTestId
|
|
18
|
+
}) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
const DEFAULT_COLOR = theme.colors.primary.text;
|
|
21
|
+
const colors = useMemo(() => getDataColors(data, theme), [data, theme]);
|
|
22
|
+
const tooltip = useCallback((props) => {
|
|
23
|
+
const {
|
|
24
|
+
value,
|
|
25
|
+
content
|
|
26
|
+
} = tooltipFunction ? tooltipFunction(props.node.data) : {
|
|
27
|
+
content: props.node.data.content,
|
|
28
|
+
value: props.node.data.value
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ jsx(Tooltip, { content, value });
|
|
31
|
+
}, [tooltipFunction]);
|
|
32
|
+
const nodeComponent = useCallback(({
|
|
33
|
+
node
|
|
34
|
+
}) => {
|
|
35
|
+
const backgroundColor = colors[node.data.id] || DEFAULT_COLOR;
|
|
36
|
+
const spacing = 4;
|
|
37
|
+
return /* @__PURE__ */ jsx("div", { className: treeMapContentWrapper, onMouseEnter: node.onMouseEnter, onMouseLeave: node.onMouseLeave, onMouseMove: node.onMouseMove, style: {
|
|
38
|
+
backgroundColor,
|
|
39
|
+
height: node.height - spacing,
|
|
40
|
+
left: node.x + spacing / 2,
|
|
41
|
+
top: node.y + spacing / 2,
|
|
42
|
+
width: node.width - spacing
|
|
43
|
+
}, children: /* @__PURE__ */ jsx(Text, { as: "div", oneLine: true, variant: "captionStrong", children: node.data.content }) });
|
|
44
|
+
}, [colors, DEFAULT_COLOR]);
|
|
45
|
+
return /* @__PURE__ */ jsx("div", { className, "data-testid": dataTestId, style: {
|
|
46
|
+
height
|
|
47
|
+
}, children: /* @__PURE__ */ jsx(
|
|
48
|
+
ResponsiveTreeMapHtml,
|
|
49
|
+
{
|
|
50
|
+
animate: false,
|
|
51
|
+
data,
|
|
52
|
+
enableParentLabel: false,
|
|
53
|
+
identity: "id",
|
|
54
|
+
labelSkipSize: 0,
|
|
55
|
+
leavesOnly: true,
|
|
56
|
+
motionConfig: "none",
|
|
57
|
+
nodeComponent,
|
|
58
|
+
orientLabel: false,
|
|
59
|
+
tile: "squarify",
|
|
60
|
+
tooltip,
|
|
61
|
+
value: "value",
|
|
62
|
+
...chartProps
|
|
63
|
+
}
|
|
64
|
+
) });
|
|
65
|
+
};
|
|
66
|
+
export {
|
|
67
|
+
TreeMapChart
|
|
68
|
+
};
|
|
@@ -70,5 +70,6 @@ export { ToastContainer, toast } from './Toaster';
|
|
|
70
70
|
export { Toggle } from './Toggle';
|
|
71
71
|
export { ToggleGroup } from './ToggleGroup';
|
|
72
72
|
export { Tooltip } from './Tooltip';
|
|
73
|
+
export { TreeMapChart } from './TreeMapChart';
|
|
73
74
|
export { UnitInput } from './UnitInput';
|
|
74
75
|
export { VerificationCode } from './VerificationCode';
|
package/dist/helpers/legend.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getLegendColor: (theme:
|
|
1
|
+
import type { theme as UVTheme } from '@ultraviolet/themes';
|
|
2
|
+
export declare const getLegendColor: (theme: typeof UVTheme) => string[];
|
package/dist/helpers/legend.js
CHANGED
|
@@ -2,7 +2,7 @@ const getLegendColor = (theme) => {
|
|
|
2
2
|
const {
|
|
3
3
|
colors
|
|
4
4
|
} = theme;
|
|
5
|
-
return Object.keys(colors.other.data.charts).filter((key) => !["success", "danger"].includes(key)).
|
|
5
|
+
return Object.keys(colors.other.data.charts).filter((key) => !["success", "danger"].includes(key)).toSorted((a, b) => {
|
|
6
6
|
if (Number(a.replace("data", "")) < Number(b.replace("data", ""))) {
|
|
7
7
|
return -1;
|
|
8
8
|
}
|