@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
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const dynamic = require("@vanilla-extract/dynamic");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const reactDom = require("react-dom");
|
|
8
|
-
const index = require("../../Stack/index.cjs");
|
|
9
|
-
const ModalProvider = require("../ModalProvider.cjs");
|
|
10
|
-
const styles_css = require("../styles.css.cjs");
|
|
11
|
-
const stopCancel = (event) => {
|
|
12
|
-
event.preventDefault();
|
|
13
|
-
event.stopPropagation();
|
|
14
|
-
};
|
|
15
|
-
const Dialog = ({
|
|
16
|
-
children,
|
|
17
|
-
placement,
|
|
18
|
-
onClose,
|
|
19
|
-
hideOnClickOutside,
|
|
20
|
-
size,
|
|
21
|
-
id,
|
|
22
|
-
ariaLabel,
|
|
23
|
-
className,
|
|
24
|
-
"data-testid": dataTestId,
|
|
25
|
-
preventBodyScroll,
|
|
26
|
-
hideOnEsc,
|
|
27
|
-
backdropClassName,
|
|
28
|
-
image,
|
|
29
|
-
style
|
|
30
|
-
}) => {
|
|
31
|
-
const [isVisible, setIsVisible] = react.useState(false);
|
|
32
|
-
const containerRef = react.useRef(document.createElement("div"));
|
|
33
|
-
const dialogRef = react.useRef(null);
|
|
34
|
-
const onCloseRef = react.useRef(onClose);
|
|
35
|
-
const {
|
|
36
|
-
registerModal,
|
|
37
|
-
unregisterModal,
|
|
38
|
-
openedModals,
|
|
39
|
-
previsousOpenedModales
|
|
40
|
-
} = ModalProvider.useModal();
|
|
41
|
-
react.useEffect(() => {
|
|
42
|
-
setIsVisible(true);
|
|
43
|
-
}, []);
|
|
44
|
-
react.useEffect(() => {
|
|
45
|
-
registerModal({
|
|
46
|
-
id,
|
|
47
|
-
ref: dialogRef
|
|
48
|
-
});
|
|
49
|
-
return () => {
|
|
50
|
-
unregisterModal(id);
|
|
51
|
-
};
|
|
52
|
-
}, [id, registerModal, unregisterModal]);
|
|
53
|
-
react.useEffect(() => {
|
|
54
|
-
const element = containerRef.current;
|
|
55
|
-
document.body.appendChild(element);
|
|
56
|
-
return () => {
|
|
57
|
-
if (document.body.contains(element)) {
|
|
58
|
-
document.body.removeChild(element);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}, []);
|
|
62
|
-
react.useEffect(() => {
|
|
63
|
-
onCloseRef.current = onClose;
|
|
64
|
-
}, [onClose]);
|
|
65
|
-
react.useEffect(() => {
|
|
66
|
-
dialogRef.current?.focus();
|
|
67
|
-
}, []);
|
|
68
|
-
react.useEffect(() => {
|
|
69
|
-
const previousOverflow = document.body.style.overflow;
|
|
70
|
-
if (preventBodyScroll) {
|
|
71
|
-
document.body.style.overflow = "hidden";
|
|
72
|
-
}
|
|
73
|
-
return () => {
|
|
74
|
-
document.body.style.overflow = previousOverflow;
|
|
75
|
-
};
|
|
76
|
-
}, [preventBodyScroll]);
|
|
77
|
-
const stopFocus = react.useCallback((event) => {
|
|
78
|
-
event.stopPropagation();
|
|
79
|
-
}, []);
|
|
80
|
-
const realPosition = [...openedModals].findIndex((object) => object.id === id);
|
|
81
|
-
const position = [...openedModals].reverse().findIndex((object) => object.id === id);
|
|
82
|
-
const modalAbove = openedModals[realPosition + 1];
|
|
83
|
-
const currentModalHeight = dialogRef.current?.offsetHeight;
|
|
84
|
-
let top = 0;
|
|
85
|
-
const handleKeyUp = react.useCallback((event) => {
|
|
86
|
-
event.stopPropagation();
|
|
87
|
-
if (event.key === "Escape" && hideOnEsc) {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
onCloseRef.current();
|
|
90
|
-
}
|
|
91
|
-
}, [hideOnEsc]);
|
|
92
|
-
const handleClose = react.useCallback((event) => {
|
|
93
|
-
if (hideOnClickOutside && dialogRef.current && !dialogRef.current.contains(event.target) && position === 0) {
|
|
94
|
-
onCloseRef.current();
|
|
95
|
-
}
|
|
96
|
-
}, [hideOnClickOutside, position]);
|
|
97
|
-
const handleFocusTrap = react.useCallback((event) => {
|
|
98
|
-
event.stopPropagation();
|
|
99
|
-
if (event.key === "Escape") {
|
|
100
|
-
event.preventDefault();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const isTabPressed = event.key === "Tab";
|
|
104
|
-
if (!isTabPressed) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const focusableEls = dialogRef.current?.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])") ?? [];
|
|
108
|
-
if (focusableEls.length === 0) {
|
|
109
|
-
event.preventDefault();
|
|
110
|
-
}
|
|
111
|
-
const firstFocusableEl = focusableEls[0];
|
|
112
|
-
const lastFocusableEl = focusableEls[focusableEls.length - 1];
|
|
113
|
-
if (event.shiftKey) {
|
|
114
|
-
if (document.activeElement === firstFocusableEl || document.activeElement === dialogRef.current) {
|
|
115
|
-
lastFocusableEl.focus();
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
}
|
|
118
|
-
} else if (document.activeElement === lastFocusableEl || document.activeElement === dialogRef.current) {
|
|
119
|
-
firstFocusableEl.focus();
|
|
120
|
-
event.preventDefault();
|
|
121
|
-
}
|
|
122
|
-
}, []);
|
|
123
|
-
if (modalAbove?.ref && typeof modalAbove.ref === "object" && "current" in modalAbove.ref && currentModalHeight) {
|
|
124
|
-
top = (modalAbove?.ref?.current?.offsetHeight ?? 0) / 2 - currentModalHeight / 2 + 20;
|
|
125
|
-
}
|
|
126
|
-
const animation = openedModals.length > 1 && position === 0 && previsousOpenedModales.length < openedModals.length;
|
|
127
|
-
return reactDom.createPortal(/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${backdropClassName} ${styles_css.modalBackdrop({
|
|
128
|
-
open: true,
|
|
129
|
-
visible: isVisible
|
|
130
|
-
})}`, "data-testid": dataTestId ? `${dataTestId}-backdrop` : void 0, "data-visible": isVisible, onClick: handleClose, onFocus: stopFocus, onKeyDown: () => {
|
|
131
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx("dialog", { "aria-label": ariaLabel, "aria-modal": true, className: `${className ? `${className} ` : ""}${styles_css.modal({
|
|
132
|
-
animation,
|
|
133
|
-
image: !!image,
|
|
134
|
-
placement,
|
|
135
|
-
positivePosition: position > 0,
|
|
136
|
-
size
|
|
137
|
-
})}`, "data-size": size, "data-testid": dataTestId, id, onCancel: stopCancel, onClose: stopCancel, onKeyDown: handleFocusTrap, onKeyUp: handleKeyUp, open: true, ref: dialogRef, style: {
|
|
138
|
-
...dynamic.assignInlineVars({
|
|
139
|
-
[styles_css.topModal]: `-${top}px`,
|
|
140
|
-
[styles_css.positionModal]: `${position * 50}px`
|
|
141
|
-
}),
|
|
142
|
-
...style
|
|
143
|
-
}, tabIndex: 0, children: image ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "end", className: styles_css.modalImageContainer, justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx("img", { alt: "illustration", className: styles_css.modalImage, src: image }) }),
|
|
145
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { className: styles_css.modalContent, gap: 5, children })
|
|
146
|
-
] }) : children }) }), containerRef.current);
|
|
147
|
-
};
|
|
148
|
-
exports.Dialog = Dialog;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const react = require("react");
|
|
5
|
-
const Disclosure = ({
|
|
6
|
-
disclosure,
|
|
7
|
-
handleOpen,
|
|
8
|
-
visible,
|
|
9
|
-
handleClose,
|
|
10
|
-
toggle,
|
|
11
|
-
id,
|
|
12
|
-
ref
|
|
13
|
-
}) => {
|
|
14
|
-
react.useEffect(() => {
|
|
15
|
-
const element = ref.current;
|
|
16
|
-
element?.addEventListener("click", handleOpen);
|
|
17
|
-
return () => {
|
|
18
|
-
element?.removeEventListener("click", handleOpen);
|
|
19
|
-
};
|
|
20
|
-
}, [handleOpen, ref, disclosure]);
|
|
21
|
-
const finalDisclosure = react.useMemo(() => {
|
|
22
|
-
if (typeof disclosure === "function") {
|
|
23
|
-
return disclosure({
|
|
24
|
-
close: handleClose,
|
|
25
|
-
modalId: id,
|
|
26
|
-
show: handleOpen,
|
|
27
|
-
toggle,
|
|
28
|
-
visible
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return disclosure;
|
|
32
|
-
}, [disclosure, handleOpen, handleClose, id, toggle, visible]);
|
|
33
|
-
if (!react.isValidElement(finalDisclosure)) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
return react.cloneElement(finalDisclosure, {
|
|
37
|
-
"aria-controls": id,
|
|
38
|
-
"aria-haspopup": "dialog",
|
|
39
|
-
ref
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
exports.Disclosure = Disclosure;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const react = require("react");
|
|
6
|
-
const Disclosure = require("./components/Disclosure.cjs");
|
|
7
|
-
const ModalContent = require("./ModalContent.cjs");
|
|
8
|
-
const ModalProvider = require("./ModalProvider.cjs");
|
|
9
|
-
const Modal = ({
|
|
10
|
-
ariaLabel = "modal",
|
|
11
|
-
id,
|
|
12
|
-
children,
|
|
13
|
-
disclosure,
|
|
14
|
-
hideOnClickOutside = true,
|
|
15
|
-
hideOnEsc = true,
|
|
16
|
-
isClosable = true,
|
|
17
|
-
onClose,
|
|
18
|
-
onBeforeClose,
|
|
19
|
-
open = false,
|
|
20
|
-
placement = "center",
|
|
21
|
-
preventBodyScroll = true,
|
|
22
|
-
size = "small",
|
|
23
|
-
className,
|
|
24
|
-
"data-testid": dataTestId,
|
|
25
|
-
backdropClassName,
|
|
26
|
-
image,
|
|
27
|
-
style
|
|
28
|
-
}) => {
|
|
29
|
-
const [visible, setVisible] = react.useState(false);
|
|
30
|
-
const controlId = react.useId();
|
|
31
|
-
const disclosureRef = react.useRef(null);
|
|
32
|
-
const handleOpen = react.useCallback(() => {
|
|
33
|
-
setVisible(true);
|
|
34
|
-
}, []);
|
|
35
|
-
const handleClose = react.useCallback(() => {
|
|
36
|
-
disclosureRef.current?.focus();
|
|
37
|
-
if (onClose) {
|
|
38
|
-
onClose();
|
|
39
|
-
} else {
|
|
40
|
-
const promise = onBeforeClose?.();
|
|
41
|
-
if (promise && "catch" in promise) {
|
|
42
|
-
promise.catch(() => null);
|
|
43
|
-
}
|
|
44
|
-
setVisible(false);
|
|
45
|
-
}
|
|
46
|
-
}, [onBeforeClose, onClose]);
|
|
47
|
-
const handleToggle = react.useCallback(() => {
|
|
48
|
-
disclosureRef.current?.focus();
|
|
49
|
-
setVisible((current) => !current);
|
|
50
|
-
}, []);
|
|
51
|
-
const finalId = id ?? controlId;
|
|
52
|
-
const context = react.useContext(ModalProvider.ModalContext);
|
|
53
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
54
|
-
disclosure ? /* @__PURE__ */ jsxRuntime.jsx(Disclosure.Disclosure, { disclosure, handleClose, handleOpen, id: finalId, ref: disclosureRef, toggle: handleToggle, visible }) : null,
|
|
55
|
-
!context ? /* @__PURE__ */ jsxRuntime.jsx(ModalProvider.ModalProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(ModalContent.ModalContent, { ariaLabel, backdropClassName, className, dataTestId, finalId, finalSize: size, handleClose, handleOpen, handleToggle, hideOnClickOutside, hideOnEsc, image, isClosable, open, placement, preventBodyScroll, style, visible, children }) }) : /* @__PURE__ */ jsxRuntime.jsx(ModalContent.ModalContent, { ariaLabel, backdropClassName, className, dataTestId, finalId, finalSize: size, handleClose, handleOpen, handleToggle, hideOnClickOutside, hideOnEsc, image, isClosable, open, placement, preventBodyScroll, style, visible, children })
|
|
56
|
-
] });
|
|
57
|
-
};
|
|
58
|
-
exports.Modal = Modal;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
;/* empty css */
|
|
5
|
-
const createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
6
|
-
var topModal = "var(--uv_lrojhc0)";
|
|
7
|
-
var positionModal = "var(--uv_lrojhc1)";
|
|
8
|
-
var modalContainer = "uv_lrojhc2";
|
|
9
|
-
var modalImageContainer = "uv_lrojhc3";
|
|
10
|
-
var modalImage = "uv_lrojhc4";
|
|
11
|
-
var modalContent = "uv_lrojhc5";
|
|
12
|
-
var modalBackdrop = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_lrojhc7 uv_lrojhc6", variantClassNames: { open: { true: "uv_lrojhc8" }, visible: { true: "uv_lrojhc9" } }, defaultVariants: {}, compoundVariants: [] });
|
|
13
|
-
var modal = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_lrojhca", variantClassNames: { size: { large: "uv_lrojhcb", medium: "uv_lrojhcc", small: "uv_lrojhcd", xsmall: "uv_lrojhce", xxsmall: "uv_lrojhcf" }, placement: { bottom: "uv_lrojhcg", "bottom-left": "uv_lrojhch", "bottom-right": "uv_lrojhci", center: "uv_lrojhcj", left: "uv_lrojhck", right: "uv_lrojhcl", top: "uv_lrojhcm", "top-left": "uv_lrojhcn", "top-right": "uv_lrojhco" }, image: { true: "uv_lrojhcp" }, animation: { true: "uv_lrojhcq" }, positivePosition: { true: "uv_lrojhcr" } }, defaultVariants: { size: "medium", placement: "center", image: false, animation: false, positivePosition: false }, compoundVariants: [[{ size: "large", positivePosition: true }, "uv_lrojhcs"], [{ size: "medium", positivePosition: true }, "uv_lrojhct"], [{ size: "small", positivePosition: true }, "uv_lrojhcu"], [{ size: "xsmall", positivePosition: true }, "uv_lrojhcv"], [{ size: "xxsmall", positivePosition: true }, "uv_lrojhcw"]] });
|
|
14
|
-
exports.modal = modal;
|
|
15
|
-
exports.modalBackdrop = modalBackdrop;
|
|
16
|
-
exports.modalContainer = modalContainer;
|
|
17
|
-
exports.modalContent = modalContent;
|
|
18
|
-
exports.modalImage = modalImage;
|
|
19
|
-
exports.modalImageContainer = modalImageContainer;
|
|
20
|
-
exports.positionModal = positionModal;
|
|
21
|
-
exports.topModal = topModal;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const index = require("../Text/index.cjs");
|
|
7
|
-
const styles_css = require("./styles.css.cjs");
|
|
8
|
-
const Notice = ({
|
|
9
|
-
children,
|
|
10
|
-
className,
|
|
11
|
-
"data-testid": dataTestId,
|
|
12
|
-
style
|
|
13
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxs(index.Text, { as: "span", className: `${className ? `${className} ` : ""}${styles_css.notice}`, "data-testid": dataTestId, prominence: "weak", sentiment: "neutral", style, variant: "caption", children: [
|
|
14
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon.InformationOutlineIcon, { prominence: "weak", sentiment: "neutral", size: "small" }),
|
|
15
|
-
children
|
|
16
|
-
] });
|
|
17
|
-
exports.Notice = Notice;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const reactToastify = require("react-toastify");
|
|
7
|
-
const index$2 = require("../Button/index.cjs");
|
|
8
|
-
const index = require("../Stack/index.cjs");
|
|
9
|
-
const index$1 = require("../Text/index.cjs");
|
|
10
|
-
const styles_css = require("./styles.css.cjs");
|
|
11
|
-
const closeButton = (props) => /* @__PURE__ */ jsxRuntime.jsx(index$2.Button, { "aria-label": "close", onClick: props.closeToast, sentiment: "neutral", size: "xsmall", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) });
|
|
12
|
-
const notification = (children, title, icon, isClosable, containerId, options) => reactToastify.toast("", {
|
|
13
|
-
...options,
|
|
14
|
-
closeButton: (props) => /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", gap: 2, children: [
|
|
15
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: icon }),
|
|
16
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "column", children: [
|
|
17
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "h3", variant: "bodySmallStronger", children: title }),
|
|
18
|
-
typeof children === "function" ? children(props) : children
|
|
19
|
-
] }),
|
|
20
|
-
isClosable ? closeButton(props) : null
|
|
21
|
-
] }),
|
|
22
|
-
containerId: containerId ?? "notification"
|
|
23
|
-
});
|
|
24
|
-
const NotificationContainer = ({
|
|
25
|
-
newestOnTop,
|
|
26
|
-
limit,
|
|
27
|
-
autoClose = false,
|
|
28
|
-
position = "top-right",
|
|
29
|
-
"data-testid": dataTestId,
|
|
30
|
-
className,
|
|
31
|
-
style,
|
|
32
|
-
containerId = "notification"
|
|
33
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(reactToastify.ToastContainer, { autoClose, className: `${className ? `${className} ` : ""}${styles_css.notification}`, containerId, "data-testid": dataTestId, draggable: false, hideProgressBar: true, icon: false, limit, newestOnTop, position, style, transition: reactToastify.Slide });
|
|
34
|
-
exports.NotificationContainer = NotificationContainer;
|
|
35
|
-
exports.notification = notification;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const index$3 = require("../Button/index.cjs");
|
|
8
|
-
const index$1 = require("../Label/index.cjs");
|
|
9
|
-
const index$4 = require("../Row/index.cjs");
|
|
10
|
-
const index = require("../Stack/index.cjs");
|
|
11
|
-
const index$5 = require("../Text/index.cjs");
|
|
12
|
-
const index$2 = require("../Tooltip/index.cjs");
|
|
13
|
-
const styles_css = require("./styles.css.cjs");
|
|
14
|
-
const NumberInput = react.forwardRef(({
|
|
15
|
-
disabled = false,
|
|
16
|
-
max = Number.MAX_SAFE_INTEGER,
|
|
17
|
-
min = 0,
|
|
18
|
-
name,
|
|
19
|
-
onChange,
|
|
20
|
-
onFocus,
|
|
21
|
-
onBlur,
|
|
22
|
-
size = "large",
|
|
23
|
-
step,
|
|
24
|
-
unit,
|
|
25
|
-
value,
|
|
26
|
-
tooltip,
|
|
27
|
-
className,
|
|
28
|
-
label,
|
|
29
|
-
labelDescription,
|
|
30
|
-
id,
|
|
31
|
-
controls = true,
|
|
32
|
-
placeholder = "",
|
|
33
|
-
error,
|
|
34
|
-
success,
|
|
35
|
-
helper,
|
|
36
|
-
"aria-label": ariaLabel,
|
|
37
|
-
"data-testid": dataTestId,
|
|
38
|
-
required,
|
|
39
|
-
autoFocus,
|
|
40
|
-
readOnly,
|
|
41
|
-
style
|
|
42
|
-
}, ref) => {
|
|
43
|
-
const localRef = react.useRef(null);
|
|
44
|
-
react.useImperativeHandle(ref, () => localRef.current);
|
|
45
|
-
const uniqueId = react.useId();
|
|
46
|
-
const localId = id ?? uniqueId;
|
|
47
|
-
const computedState = react.useMemo(() => {
|
|
48
|
-
if (disabled) {
|
|
49
|
-
return "disabled";
|
|
50
|
-
}
|
|
51
|
-
if (readOnly) {
|
|
52
|
-
return "readOnly";
|
|
53
|
-
}
|
|
54
|
-
if (error) {
|
|
55
|
-
return "error";
|
|
56
|
-
}
|
|
57
|
-
if (success) {
|
|
58
|
-
return "success";
|
|
59
|
-
}
|
|
60
|
-
return "default";
|
|
61
|
-
}, [error, success, disabled, readOnly]);
|
|
62
|
-
const onClickSideButton = react.useCallback((direction) => () => {
|
|
63
|
-
if (direction === "up") {
|
|
64
|
-
localRef.current?.stepUp();
|
|
65
|
-
} else if (direction === "down") {
|
|
66
|
-
localRef.current?.stepDown();
|
|
67
|
-
}
|
|
68
|
-
onChange?.(Number.parseFloat(localRef.current?.value ?? "") ?? min);
|
|
69
|
-
}, [localRef, min, onChange]);
|
|
70
|
-
const isMinusDisabled = react.useCallback(() => {
|
|
71
|
-
if (!localRef?.current?.value || localRef?.current?.value === "") {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
const numericValue = Number(localRef?.current?.value);
|
|
75
|
-
if (Number.isNaN(numericValue)) {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
const minValue = typeof min === "number" ? min : Number(min);
|
|
79
|
-
return Number.isNaN(numericValue) || numericValue <= minValue;
|
|
80
|
-
}, [localRef?.current?.value, min]);
|
|
81
|
-
const isPlusDisabled = react.useCallback(() => {
|
|
82
|
-
if (!localRef?.current?.value || localRef?.current?.value === "") {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
const numericValue = Number(localRef?.current?.value);
|
|
86
|
-
if (Number.isNaN(numericValue)) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
const maxValue = typeof max === "number" ? max : Number(max);
|
|
90
|
-
return numericValue >= maxValue;
|
|
91
|
-
}, [localRef?.current?.value, max]);
|
|
92
|
-
const helperSentiment = react.useMemo(() => {
|
|
93
|
-
if (error) {
|
|
94
|
-
return "danger";
|
|
95
|
-
}
|
|
96
|
-
if (success) {
|
|
97
|
-
return "success";
|
|
98
|
-
}
|
|
99
|
-
return "neutral";
|
|
100
|
-
}, [error, success]);
|
|
101
|
-
let inputValue;
|
|
102
|
-
if (value !== void 0) {
|
|
103
|
-
inputValue = value !== null && typeof value === "number" ? value.toString() : "";
|
|
104
|
-
if (localRef.current) {
|
|
105
|
-
localRef.current.value = inputValue;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { className, gap: "0.5", children: [
|
|
109
|
-
label || labelDescription ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { htmlFor: id ?? localId, labelDescription, required, size, children: label }) : null,
|
|
110
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(index$2.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_css.numberinputContainer({
|
|
111
|
-
size,
|
|
112
|
-
state: computedState
|
|
113
|
-
}), "data-controls": controls, "data-disabled": disabled, "data-error": !!error, "data-readonly": readOnly, "data-size": size, "data-success": !!success, "data-unit": !!unit, children: [
|
|
114
|
-
controls ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "center", className: styles_css.numberinputSideContainer[size], "data-size": size, justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(index$3.Button, { "aria-label": "minus", disabled: disabled || readOnly || isMinusDisabled(), onClick: onClickSideButton("down"), sentiment: "neutral", size: size === "small" ? "xsmall" : "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.MinusIcon, { size: size === "large" ? "small" : "small" }) }) }) : null,
|
|
115
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index$4.Row, { alignItems: "center", className: styles_css.inputContainer({
|
|
116
|
-
controls
|
|
117
|
-
}), justifyContent: "space-between", templateColumns: "1fr auto", children: [
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { "aria-label": ariaLabel, autoFocus, className: styles_css.numberinput({
|
|
119
|
-
controls,
|
|
120
|
-
hasUnit: !!unit,
|
|
121
|
-
size
|
|
122
|
-
}), "data-testid": dataTestId, disabled, id: localId, max, min, name, onBlur: (event) => {
|
|
123
|
-
if (value && value > max) {
|
|
124
|
-
onChange?.(max);
|
|
125
|
-
} else if (value && value < min) {
|
|
126
|
-
onChange?.(min);
|
|
127
|
-
}
|
|
128
|
-
onBlur?.(event);
|
|
129
|
-
}, onChange: onChange ? (event) => {
|
|
130
|
-
const newNumber = Number.parseFloat(event.target.value);
|
|
131
|
-
onChange(Number.isNaN(newNumber) ? null : newNumber);
|
|
132
|
-
} : void 0, onFocus, placeholder, readOnly, ref: localRef, required, step, style, type: "number", value: inputValue }),
|
|
133
|
-
unit ? /* @__PURE__ */ jsxRuntime.jsx(index$5.Text, { as: "span", className: styles_css.unit({
|
|
134
|
-
disabled,
|
|
135
|
-
readOnly,
|
|
136
|
-
size
|
|
137
|
-
}), disabled, sentiment: "neutral", variant: "body", children: unit }) : null
|
|
138
|
-
] }),
|
|
139
|
-
controls ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "center", className: styles_css.numberinputSideContainer[size], "data-size": size, justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(index$3.Button, { "aria-label": "plus", disabled: disabled || readOnly || isPlusDisabled(), onClick: onClickSideButton("up"), sentiment: "neutral", size: size === "small" ? "xsmall" : "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.PlusIcon, { size: size === "large" ? "small" : "small" }) }) }) : null
|
|
140
|
-
] }) }) }),
|
|
141
|
-
error || typeof success === "string" || typeof helper === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$5.Text, { as: "span", disabled: disabled || readOnly, prominence: !error && !success ? "weak" : "default", sentiment: helperSentiment, variant: "caption", children: error || success || helper }) : null,
|
|
142
|
-
!error && !success && typeof helper !== "string" && helper ? helper : null
|
|
143
|
-
] });
|
|
144
|
-
});
|
|
145
|
-
exports.NumberInput = NumberInput;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
const createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
5
|
-
var numberinputSideContainer = { small: "uv_1ce7gb60", medium: "uv_1ce7gb61", large: "uv_1ce7gb62" };
|
|
6
|
-
var inputContainer = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_1ce7gb63", variantClassNames: { controls: { false: "uv_1ce7gb64" } }, defaultVariants: { controls: true }, compoundVariants: [] });
|
|
7
|
-
var unit = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_1ce7gb65", variantClassNames: { size: { small: "uv_1ce7gb66", medium: "uv_1ce7gb67", large: "uv_1ce7gb68" }, disabled: { true: "uv_1ce7gb69" }, readOnly: { true: "uv_1ce7gb6a" } }, defaultVariants: { size: "large", disabled: false, readOnly: false }, compoundVariants: [] });
|
|
8
|
-
var numberinput = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_1ce7gb6b", variantClassNames: { hasUnit: { true: "uv_1ce7gb6c" }, size: { small: "uv_1ce7gb6d", medium: "uv_1ce7gb6e", large: "uv_1ce7gb6f" }, controls: { false: "uv_1ce7gb6g" } }, defaultVariants: { hasUnit: false, size: "large", controls: true }, compoundVariants: [] });
|
|
9
|
-
var numberinputContainer = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_1ce7gb6h", variantClassNames: { state: { "default": "uv_1ce7gb6i", success: "uv_1ce7gb6j", error: "uv_1ce7gb6k", readOnly: "uv_1ce7gb6l", disabled: "uv_1ce7gb6m" }, size: { small: "uv_1ce7gb6n", medium: "uv_1ce7gb6o", large: "uv_1ce7gb6p" } }, defaultVariants: { size: "large", state: "default" }, compoundVariants: [] });
|
|
10
|
-
exports.inputContainer = inputContainer;
|
|
11
|
-
exports.numberinput = numberinput;
|
|
12
|
-
exports.numberinputContainer = numberinputContainer;
|
|
13
|
-
exports.numberinputSideContainer = numberinputSideContainer;
|
|
14
|
-
exports.unit = unit;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const index$1 = require("../Button/index.cjs");
|
|
8
|
-
const index = require("../Stack/index.cjs");
|
|
9
|
-
const index$2 = require("../Text/index.cjs");
|
|
10
|
-
const getPageNumbers = require("./getPageNumbers.cjs");
|
|
11
|
-
const styles_css = require("./styles.css.cjs");
|
|
12
|
-
const MakeButton = ({
|
|
13
|
-
hasEllipsisBefore,
|
|
14
|
-
pageNumber,
|
|
15
|
-
disabled,
|
|
16
|
-
page,
|
|
17
|
-
handlePageClick,
|
|
18
|
-
perPage
|
|
19
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20
|
-
hasEllipsisBefore ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Text, { "aria-label": "ellipsis", as: "span", className: styles_css.ellipsisClass[perPage ? "small" : "medium"], disabled, placement: "center", prominence: "default", sentiment: "neutral", variant: "body", children: "..." }) : null,
|
|
21
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$1.Button, { "aria-current": pageNumber === page, className: styles_css.pageButton[perPage ? "small" : "medium"], disabled, onClick: handlePageClick(pageNumber), sentiment: pageNumber === page ? "primary" : "neutral", size: perPage ? "small" : "medium", type: "button", variant: pageNumber === page ? "filled" : "outlined", children: pageNumber })
|
|
22
|
-
] });
|
|
23
|
-
const PaginationButtons = ({
|
|
24
|
-
page,
|
|
25
|
-
disabled,
|
|
26
|
-
onChange,
|
|
27
|
-
pageCount,
|
|
28
|
-
pageTabCount,
|
|
29
|
-
"data-testid": dataTestId,
|
|
30
|
-
className,
|
|
31
|
-
perPage
|
|
32
|
-
}) => {
|
|
33
|
-
const goToNextPage = react.useCallback(() => {
|
|
34
|
-
onChange(page + 1);
|
|
35
|
-
}, [onChange, page]);
|
|
36
|
-
const goToPreviousPage = react.useCallback(() => {
|
|
37
|
-
onChange(page - 1);
|
|
38
|
-
}, [onChange, page]);
|
|
39
|
-
const pageNumbersToDisplay = react.useMemo(() => pageCount > 1 ? getPageNumbers.getPageNumbers(page, pageCount, pageTabCount) : [1], [page, pageCount, pageTabCount]);
|
|
40
|
-
const handlePageClick = react.useCallback((pageNumber) => () => {
|
|
41
|
-
onChange(pageNumber);
|
|
42
|
-
}, [onChange]);
|
|
43
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { className, "data-testid": dataTestId, direction: "row", children: [
|
|
44
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { gap: 1, children: /* @__PURE__ */ jsxRuntime.jsx(index$1.Button, { "aria-label": "Back", disabled: page <= 1 || disabled, onClick: goToPreviousPage, sentiment: "primary", size: perPage ? "small" : "medium", variant: "outlined", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.ArrowLeftIcon, {}) }) }),
|
|
45
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { className: styles_css.pageNumbersContainer, direction: "row", gap: 1, children: pageNumbersToDisplay.map((pageNumber, index2) => /* @__PURE__ */ jsxRuntime.jsx(MakeButton, { disabled, handlePageClick, hasEllipsisBefore: !(index2 === 0 || pageNumbersToDisplay[index2 - 1] === pageNumber - 1), page, pageNumber, perPage }, pageNumber)) }),
|
|
46
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { gap: 1, children: /* @__PURE__ */ jsxRuntime.jsx(index$1.Button, { "aria-label": "Next", disabled: page >= pageCount || disabled, onClick: goToNextPage, sentiment: "primary", size: perPage ? "small" : "medium", variant: "outlined", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.ArrowRightIcon, {}) }) })
|
|
47
|
-
] });
|
|
48
|
-
};
|
|
49
|
-
exports.PaginationButtons = PaginationButtons;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const index$2 = require("../SelectInput/index.cjs");
|
|
6
|
-
const index = require("../Stack/index.cjs");
|
|
7
|
-
const index$1 = require("../Text/index.cjs");
|
|
8
|
-
const optionsItemsPerPage = [{
|
|
9
|
-
label: "10",
|
|
10
|
-
value: "10"
|
|
11
|
-
}, {
|
|
12
|
-
label: "25",
|
|
13
|
-
value: "25"
|
|
14
|
-
}, {
|
|
15
|
-
label: "50",
|
|
16
|
-
value: "50"
|
|
17
|
-
}, {
|
|
18
|
-
label: "100",
|
|
19
|
-
value: "100"
|
|
20
|
-
}];
|
|
21
|
-
const PerPage = ({
|
|
22
|
-
perPage,
|
|
23
|
-
onChangePerPage,
|
|
24
|
-
perPageText,
|
|
25
|
-
setPerPage,
|
|
26
|
-
numberOfItemsText,
|
|
27
|
-
page,
|
|
28
|
-
numberOfItems
|
|
29
|
-
}) => {
|
|
30
|
-
const handleChange = (value) => {
|
|
31
|
-
const intValue = Number.parseInt(value, 10);
|
|
32
|
-
onChangePerPage?.(intValue);
|
|
33
|
-
setPerPage(intValue);
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "center", direction: "row", gap: "2", children: [
|
|
36
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", prominence: "weak", sentiment: "neutral", variant: "body", children: perPageText ?? "Items per page" }),
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$2.SelectInput, { name: "select-items-per-page", onChange: handleChange, options: optionsItemsPerPage, size: "small", style: {
|
|
38
|
-
width: "fit-content"
|
|
39
|
-
}, value: perPage.toString() }),
|
|
40
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index$1.Text, { as: "span", prominence: "weak", sentiment: "neutral", variant: "body", children: [
|
|
41
|
-
(page - 1) * perPage + 1,
|
|
42
|
-
"-",
|
|
43
|
-
Math.min(page * perPage, numberOfItems),
|
|
44
|
-
" ",
|
|
45
|
-
numberOfItemsText ?? `of ${numberOfItems} items"`
|
|
46
|
-
] })
|
|
47
|
-
] });
|
|
48
|
-
};
|
|
49
|
-
exports.PerPage = PerPage;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const NUMBER_OF_BUTTONS_IN_BETWEEN = 3;
|
|
4
|
-
const getPageNumbers = (currentPage, pageCount, range = 5) => {
|
|
5
|
-
const truncationBefore = currentPage >= range;
|
|
6
|
-
const truncationAfter = currentPage <= pageCount - range + 1 || currentPage < range;
|
|
7
|
-
if (pageCount <= range) {
|
|
8
|
-
return Array.from({
|
|
9
|
-
length: pageCount
|
|
10
|
-
}, (_, index) => index + 1);
|
|
11
|
-
}
|
|
12
|
-
const pagesToShowBeforeTruncation = truncationBefore ? [1] : Array.from({
|
|
13
|
-
length: range
|
|
14
|
-
}, (_, index) => index + 1);
|
|
15
|
-
const pagesToShowAfterTruncation = truncationAfter ? [pageCount] : Array.from({
|
|
16
|
-
length: range
|
|
17
|
-
}, (_, index) => index + pageCount - range + 1);
|
|
18
|
-
const pagesToShowBetweenTruncation = truncationBefore && truncationAfter ? Array.from({
|
|
19
|
-
length: NUMBER_OF_BUTTONS_IN_BETWEEN
|
|
20
|
-
}, (_, index) => currentPage + index - 1) : [];
|
|
21
|
-
return [...pagesToShowBeforeTruncation, ...pagesToShowBetweenTruncation, ...pagesToShowAfterTruncation];
|
|
22
|
-
};
|
|
23
|
-
exports.getPageNumbers = getPageNumbers;
|