@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,177 +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 index = require("../Popup/index.cjs");
|
|
8
|
-
const index$2 = require("../SearchInput/index.cjs");
|
|
9
|
-
const index$1 = require("../Stack/index.cjs");
|
|
10
|
-
const helpers = require("./helpers.cjs");
|
|
11
|
-
const MenuProvider = require("./MenuProvider.cjs");
|
|
12
|
-
const styles_css = require("./styles.css.cjs");
|
|
13
|
-
const SPACE_DISCLOSURE_POPUP = 24;
|
|
14
|
-
const Menu = react.forwardRef(({
|
|
15
|
-
id,
|
|
16
|
-
ariaLabel = "Menu",
|
|
17
|
-
children,
|
|
18
|
-
disclosure,
|
|
19
|
-
hasArrow = false,
|
|
20
|
-
placement = "bottom",
|
|
21
|
-
className,
|
|
22
|
-
"data-testid": dataTestId,
|
|
23
|
-
maxHeight,
|
|
24
|
-
portalTarget = document.body,
|
|
25
|
-
triggerMethod = "click",
|
|
26
|
-
dynamicDomRendering,
|
|
27
|
-
align,
|
|
28
|
-
searchable = false,
|
|
29
|
-
footer,
|
|
30
|
-
noShrink = false,
|
|
31
|
-
style
|
|
32
|
-
}, ref) => {
|
|
33
|
-
const {
|
|
34
|
-
isVisible,
|
|
35
|
-
setIsVisible,
|
|
36
|
-
isNested,
|
|
37
|
-
disclosureRef,
|
|
38
|
-
menuRef,
|
|
39
|
-
setShouldBeVisible,
|
|
40
|
-
shouldBeVisible
|
|
41
|
-
} = MenuProvider.useMenu();
|
|
42
|
-
const searchInputRef = react.useRef(null);
|
|
43
|
-
const [localChild, setLocalChild] = react.useState(null);
|
|
44
|
-
const [popupMaxHeight, setPopupMaxHeight] = react.useState(maxHeight ?? "30rem");
|
|
45
|
-
const contentRef = react.useRef(null);
|
|
46
|
-
const tempId = react.useId();
|
|
47
|
-
const finalId = `menu-${id ?? tempId}`;
|
|
48
|
-
const target = react.isValidElement(disclosure) ? disclosure : disclosure({
|
|
49
|
-
visible: isVisible
|
|
50
|
-
});
|
|
51
|
-
const innerRef = react.useRef(target);
|
|
52
|
-
react.useImperativeHandle(ref, () => innerRef.current);
|
|
53
|
-
const finalDisclosure = react.cloneElement(target, {
|
|
54
|
-
"aria-expanded": isVisible,
|
|
55
|
-
"aria-haspopup": "dialog",
|
|
56
|
-
onClick: (event) => {
|
|
57
|
-
target.props.onClick?.(event);
|
|
58
|
-
setIsVisible(!isVisible);
|
|
59
|
-
},
|
|
60
|
-
// @ts-expect-error not sure how to fix this
|
|
61
|
-
ref: disclosureRef
|
|
62
|
-
});
|
|
63
|
-
const onSearch = react.useCallback((value) => {
|
|
64
|
-
if (typeof children === "object") {
|
|
65
|
-
setLocalChild(helpers.searchChildren(children, value));
|
|
66
|
-
}
|
|
67
|
-
}, [children]);
|
|
68
|
-
react.useEffect(() => {
|
|
69
|
-
if (isVisible && searchable) {
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
searchInputRef.current?.focus();
|
|
72
|
-
}, 50);
|
|
73
|
-
}
|
|
74
|
-
}, [isVisible, searchable]);
|
|
75
|
-
react.useEffect(() => {
|
|
76
|
-
if (disclosureRef.current && triggerMethod === "hover") {
|
|
77
|
-
const handler = (value) => {
|
|
78
|
-
setShouldBeVisible(value);
|
|
79
|
-
};
|
|
80
|
-
disclosureRef.current.addEventListener("focus", () => handler(true));
|
|
81
|
-
disclosureRef.current.addEventListener("mouseenter", () => handler(true));
|
|
82
|
-
disclosureRef.current.addEventListener("mouseleave", () => handler(false));
|
|
83
|
-
disclosureRef.current.addEventListener("keydown", (event) => {
|
|
84
|
-
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
85
|
-
handler(false);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
return () => {
|
|
89
|
-
window.removeEventListener("focus", () => handler(void 0));
|
|
90
|
-
window.removeEventListener("mouseenter", () => handler(void 0));
|
|
91
|
-
window.removeEventListener("mouseleave", () => handler(void 0));
|
|
92
|
-
window.removeEventListener("keydown", () => handler(void 0));
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
return void 0;
|
|
96
|
-
}, [setShouldBeVisible, disclosureRef, triggerMethod]);
|
|
97
|
-
const finalChild = react.useMemo(() => {
|
|
98
|
-
if (typeof children === "function") {
|
|
99
|
-
return children({
|
|
100
|
-
toggle: () => setIsVisible(!isVisible)
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
if (searchable && localChild) {
|
|
104
|
-
return localChild;
|
|
105
|
-
}
|
|
106
|
-
return children;
|
|
107
|
-
}, [children, isVisible, localChild, searchable, setIsVisible]);
|
|
108
|
-
const handleTabOpen = (event) => {
|
|
109
|
-
if (contentRef.current) {
|
|
110
|
-
const listItem = helpers.getListItem([...contentRef.current.children]);
|
|
111
|
-
if (listItem && isVisible && ["Tab", "ArrowDown"].includes(event.key)) {
|
|
112
|
-
event?.preventDefault();
|
|
113
|
-
listItem[0]?.focus();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const handleKeyDown = (event) => {
|
|
118
|
-
if (contentRef.current) {
|
|
119
|
-
const listItem = helpers.getListItem([...contentRef.current.children]);
|
|
120
|
-
if (listItem) {
|
|
121
|
-
const currentElement = listItem.find((item) => item === document.activeElement);
|
|
122
|
-
if (currentElement) {
|
|
123
|
-
if (event.key === "ArrowDown") {
|
|
124
|
-
event.preventDefault();
|
|
125
|
-
const indexOfCurrent = listItem.indexOf(currentElement);
|
|
126
|
-
if (indexOfCurrent < listItem.length - 1) {
|
|
127
|
-
listItem[indexOfCurrent + 1].focus();
|
|
128
|
-
} else {
|
|
129
|
-
listItem[0].focus();
|
|
130
|
-
}
|
|
131
|
-
} else if (event.key === "ArrowUp") {
|
|
132
|
-
event.preventDefault();
|
|
133
|
-
const indexOfCurrent = listItem.indexOf(currentElement);
|
|
134
|
-
if (indexOfCurrent > 0) {
|
|
135
|
-
listItem[indexOfCurrent - 1].focus();
|
|
136
|
-
} else {
|
|
137
|
-
listItem[listItem.length - 1].focus();
|
|
138
|
-
}
|
|
139
|
-
} else if (event.key === "ArrowLeft" && triggerMethod === "hover") {
|
|
140
|
-
disclosureRef.current?.focus();
|
|
141
|
-
setShouldBeVisible(void 0);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
react.useEffect(() => {
|
|
148
|
-
if (disclosureRef.current && placement === "bottom" && !noShrink) {
|
|
149
|
-
const disclosureRect = disclosureRef.current.getBoundingClientRect();
|
|
150
|
-
const disclosureBottom = disclosureRect.bottom;
|
|
151
|
-
const targetSize = portalTarget.getBoundingClientRect().bottom;
|
|
152
|
-
const availableSpace = targetSize - disclosureBottom - SPACE_DISCLOSURE_POPUP;
|
|
153
|
-
setPopupMaxHeight(`${availableSpace}px`);
|
|
154
|
-
}
|
|
155
|
-
}, [isVisible, portalTarget, disclosureRef, placement, noShrink]);
|
|
156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Popup, { align, "aria-label": ariaLabel, className: `${className ? `${className} ` : ""}${styles_css.menu({
|
|
157
|
-
arrow: hasArrow,
|
|
158
|
-
searchable
|
|
159
|
-
})}`, debounceDelay: triggerMethod === "hover" ? 250 : 0, dynamicDomRendering, hasArrow, hideOnClickOutside: true, id: finalId, maxHeight: maxHeight ?? "fit-content", onClose: () => {
|
|
160
|
-
setIsVisible(false);
|
|
161
|
-
setLocalChild(null);
|
|
162
|
-
if (triggerMethod === "click") {
|
|
163
|
-
disclosureRef.current?.focus();
|
|
164
|
-
}
|
|
165
|
-
setShouldBeVisible(void 0);
|
|
166
|
-
}, onKeyDown: handleTabOpen, placement: isNested ? "nested-menu" : placement, portalTarget, ref: menuRef, role: "dialog", style, tabIndex: -1, text: /* @__PURE__ */ jsxRuntime.jsxs(index$1.Stack, { className: `${className ? `${className} ` : ""}${styles_css.menuList}`, "data-testid": dataTestId, onKeyDown: handleKeyDown, onMouseEnter: () => setShouldBeVisible(true), onMouseLeave: () => setShouldBeVisible(false), role: "menu", style: dynamic.assignInlineVars({
|
|
167
|
-
[styles_css.heightMenu]: maxHeight ?? "30rem",
|
|
168
|
-
[styles_css.heightAvailableSpace]: popupMaxHeight
|
|
169
|
-
}), children: [
|
|
170
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index$1.Stack, { className: styles_css.menuContent, ref: contentRef, children: [
|
|
171
|
-
searchable && typeof children !== "function" ? /* @__PURE__ */ jsxRuntime.jsx(index$2.SearchInput, { className: styles_css.menuSearchInput, onSearch, ref: searchInputRef, size: "small" }) : null,
|
|
172
|
-
finalChild
|
|
173
|
-
] }),
|
|
174
|
-
footer ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Stack, { className: styles_css.menuFooter, children: footer }) : null
|
|
175
|
-
] }), visible: triggerMethod === "click" ? isVisible : shouldBeVisible, children: /* @__PURE__ */ jsxRuntime.jsx(MenuProvider.DisclosureContext.Provider, { value: true, children: finalDisclosure }) });
|
|
176
|
-
});
|
|
177
|
-
exports.Menu = Menu;
|
|
@@ -1,44 +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 MenuContext = react.createContext(void 0);
|
|
7
|
-
const useMenu = () => {
|
|
8
|
-
const context = react.useContext(MenuContext);
|
|
9
|
-
if (!context) {
|
|
10
|
-
throw new Error("useMenu must be used in MenuProvider");
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
};
|
|
14
|
-
const MenuProvider = ({
|
|
15
|
-
hideOnClickItem = false,
|
|
16
|
-
children,
|
|
17
|
-
visible = false,
|
|
18
|
-
parentDisclosureRef
|
|
19
|
-
}) => {
|
|
20
|
-
const [isVisible, setIsVisible] = react.useState(visible);
|
|
21
|
-
const [shouldBeVisible, setShouldBeVisible] = react.useState(void 0);
|
|
22
|
-
const disclosureRef = react.useRef(null);
|
|
23
|
-
const menuRef = react.useRef(null);
|
|
24
|
-
const parentMenu = react.useContext(MenuContext);
|
|
25
|
-
const isNested = !!parentMenu;
|
|
26
|
-
const values = react.useMemo(() => ({
|
|
27
|
-
disclosureRef,
|
|
28
|
-
hideOnClickItem,
|
|
29
|
-
isNested,
|
|
30
|
-
isVisible,
|
|
31
|
-
menuRef,
|
|
32
|
-
parentDisclosureRef: parentDisclosureRef ?? parentMenu?.disclosureRef,
|
|
33
|
-
setIsVisible,
|
|
34
|
-
setShouldBeVisible,
|
|
35
|
-
shouldBeVisible
|
|
36
|
-
}), [hideOnClickItem, isVisible, isNested, parentDisclosureRef, parentMenu?.disclosureRef, shouldBeVisible, setShouldBeVisible]);
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: values, children });
|
|
38
|
-
};
|
|
39
|
-
const DisclosureContext = react.createContext(false);
|
|
40
|
-
const useDisclosureContext = () => react.useContext(DisclosureContext);
|
|
41
|
-
exports.DisclosureContext = DisclosureContext;
|
|
42
|
-
exports.MenuProvider = MenuProvider;
|
|
43
|
-
exports.useDisclosureContext = useDisclosureContext;
|
|
44
|
-
exports.useMenu = useMenu;
|
|
@@ -1,25 +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 index = require("../../Stack/index.cjs");
|
|
7
|
-
const index$1 = require("../../Text/index.cjs");
|
|
8
|
-
const styles_css = require("../styles.css.cjs");
|
|
9
|
-
const Group = ({
|
|
10
|
-
label,
|
|
11
|
-
children,
|
|
12
|
-
labelDescription,
|
|
13
|
-
emptyState,
|
|
14
|
-
style
|
|
15
|
-
}) => {
|
|
16
|
-
const isChildrenEmpty = react.Children.count(children) === 0;
|
|
17
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles_css.menuGroup, style, children: /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "center", direction: "row", gap: 1, children: [
|
|
19
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", prominence: "weak", sentiment: "neutral", variant: "captionStrong", children: label }),
|
|
20
|
-
labelDescription || null
|
|
21
|
-
] }) }),
|
|
22
|
-
isChildrenEmpty && emptyState ? emptyState : children
|
|
23
|
-
] });
|
|
24
|
-
};
|
|
25
|
-
exports.Group = Group;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
-
const Icon = require("@ultraviolet/icons");
|
|
5
|
-
const react = require("react");
|
|
6
|
-
const index$1 = require("../../Stack/index.cjs");
|
|
7
|
-
const index = require("../../Tooltip/index.cjs");
|
|
8
|
-
const helpers = require("../helpers.cjs");
|
|
9
|
-
const MenuProvider = require("../MenuProvider.cjs");
|
|
10
|
-
const styles_css = require("../styles.css.cjs");
|
|
11
|
-
const Item = react.forwardRef(({
|
|
12
|
-
borderless = false,
|
|
13
|
-
disabled = false,
|
|
14
|
-
onClick,
|
|
15
|
-
sentiment = "neutral",
|
|
16
|
-
href,
|
|
17
|
-
target,
|
|
18
|
-
rel,
|
|
19
|
-
children,
|
|
20
|
-
tooltip,
|
|
21
|
-
active,
|
|
22
|
-
className,
|
|
23
|
-
searchText,
|
|
24
|
-
"data-testid": dataTestId,
|
|
25
|
-
style
|
|
26
|
-
}, ref) => {
|
|
27
|
-
const {
|
|
28
|
-
hideOnClickItem,
|
|
29
|
-
setIsVisible,
|
|
30
|
-
isVisible,
|
|
31
|
-
menuRef,
|
|
32
|
-
isNested,
|
|
33
|
-
parentDisclosureRef,
|
|
34
|
-
disclosureRef
|
|
35
|
-
} = MenuProvider.useMenu();
|
|
36
|
-
const isDisclosure = MenuProvider.useDisclosureContext();
|
|
37
|
-
const onClickHandle = react.useCallback((event) => {
|
|
38
|
-
if (disabled) {
|
|
39
|
-
return void 0;
|
|
40
|
-
}
|
|
41
|
-
onClick?.(event);
|
|
42
|
-
if (hideOnClickItem) {
|
|
43
|
-
setIsVisible(false);
|
|
44
|
-
}
|
|
45
|
-
return void 0;
|
|
46
|
-
}, [disabled, hideOnClickItem, onClick, setIsVisible]);
|
|
47
|
-
const handleKeyDown = (event) => {
|
|
48
|
-
if (isDisclosure && ["Enter", " ", "ArrowRight"].includes(event.key)) {
|
|
49
|
-
disclosureRef?.current?.click();
|
|
50
|
-
setTimeout(() => {
|
|
51
|
-
if (menuRef.current?.children) {
|
|
52
|
-
const listItem = helpers.getListItem([...menuRef.current.children[0].children[0].children]);
|
|
53
|
-
if (listItem) {
|
|
54
|
-
const firstElementInNestedMenu = listItem[0];
|
|
55
|
-
if (firstElementInNestedMenu && ["BUTTON", "A"].includes(firstElementInNestedMenu.tagName)) {
|
|
56
|
-
firstElementInNestedMenu.focus();
|
|
57
|
-
} else if (firstElementInNestedMenu && firstElementInNestedMenu.firstChild instanceof HTMLElement) {
|
|
58
|
-
firstElementInNestedMenu.firstChild.focus();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, 50);
|
|
63
|
-
} else if (event.key === "ArrowLeft" && isNested && (isDisclosure && parentDisclosureRef?.current?.dataset["isMenuItem"] || !isDisclosure) && parentDisclosureRef?.current) {
|
|
64
|
-
(isDisclosure ? parentDisclosureRef : disclosureRef).current?.click();
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
if (href && !disabled) {
|
|
68
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.menuItemContainer({
|
|
69
|
-
borderless
|
|
70
|
-
}), "data-search-text": searchText, style, children: /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsx("a", { className: `${className ? `${className} ` : ""}${styles_css.menuItem({
|
|
71
|
-
borderless: true,
|
|
72
|
-
disabled,
|
|
73
|
-
sentiment
|
|
74
|
-
})}`, "data-active": active, "data-is-disclosure": isDisclosure, "data-is-menu-item": true, "data-testid": dataTestId, href, onClick: onClickHandle, onKeyDown: handleKeyDown, ref, rel, role: "menuitem", target, children: isDisclosure ? /* @__PURE__ */ jsxRuntime.jsxs(index$1.Stack, { alignItems: "center", direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
75
|
-
children,
|
|
76
|
-
" ",
|
|
77
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon.ArrowRightIcon, {})
|
|
78
|
-
] }) : children }) }) });
|
|
79
|
-
}
|
|
80
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.menuItemContainer({
|
|
81
|
-
borderless
|
|
82
|
-
}), "data-search-text": searchText, style, children: /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: `${className ? `${className} ` : ""}${styles_css.menuItem({
|
|
83
|
-
borderless,
|
|
84
|
-
disabled,
|
|
85
|
-
sentiment
|
|
86
|
-
})}`, "data-active": active || isVisible && isDisclosure, "data-is-disclosure": isDisclosure, "data-is-menu-item": true, "data-testid": dataTestId, disabled, onClick: (event) => {
|
|
87
|
-
onClick?.(event);
|
|
88
|
-
if (hideOnClickItem) {
|
|
89
|
-
setIsVisible(false);
|
|
90
|
-
}
|
|
91
|
-
}, onKeyDown: handleKeyDown, ref, role: "menuitem", type: "button", children: isDisclosure ? /* @__PURE__ */ jsxRuntime.jsxs(index$1.Stack, { alignItems: "center", direction: "row", justifyContent: "space-between", width: "100%", children: [
|
|
92
|
-
children,
|
|
93
|
-
" ",
|
|
94
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon.ArrowRightIcon, {})
|
|
95
|
-
] }) : children }) }) });
|
|
96
|
-
});
|
|
97
|
-
module.exports = Item;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const react = require("react");
|
|
4
|
-
const searchChildren = (children, searchString) => {
|
|
5
|
-
const searchRegex = new RegExp(searchString, "i");
|
|
6
|
-
const matches = react.Children.map(children, (child) => {
|
|
7
|
-
if (typeof child === "string" && child.match(searchRegex)) {
|
|
8
|
-
return child;
|
|
9
|
-
}
|
|
10
|
-
if (react.isValidElement(child)) {
|
|
11
|
-
const childProps = child.props;
|
|
12
|
-
if (childProps?.searchText?.match(searchRegex)) {
|
|
13
|
-
return react.cloneElement(child, {
|
|
14
|
-
children: childProps.children
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
if (childProps?.label) {
|
|
18
|
-
return react.cloneElement(child, {
|
|
19
|
-
children: searchChildren(childProps.children, searchString)
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
if (childProps.disclosure && typeof childProps.disclosure.props.children === "string" && childProps.disclosure.props.children.match(searchRegex)) {
|
|
23
|
-
return child;
|
|
24
|
-
}
|
|
25
|
-
const childMatches = searchChildren(childProps.children, searchString);
|
|
26
|
-
if (childMatches.length > 0) {
|
|
27
|
-
return child;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return null;
|
|
31
|
-
});
|
|
32
|
-
return matches ? matches.filter(Boolean) : [];
|
|
33
|
-
};
|
|
34
|
-
const getButtonOrLink = (element) => {
|
|
35
|
-
const tag = element?.firstElementChild?.tagName.toLowerCase();
|
|
36
|
-
if (element) {
|
|
37
|
-
if (tag === "button" && !element.firstElementChild.disabled) {
|
|
38
|
-
return element.firstElementChild;
|
|
39
|
-
}
|
|
40
|
-
if (tag === "a") {
|
|
41
|
-
return element.firstElementChild;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
};
|
|
46
|
-
const getListItem = (listItems) => listItems.map((child) => getButtonOrLink(child) ? getButtonOrLink(child) : getButtonOrLink(child.firstElementChild)).filter((element) => typeof element !== "boolean");
|
|
47
|
-
exports.getListItem = getListItem;
|
|
48
|
-
exports.searchChildren = searchChildren;
|
|
@@ -1,20 +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 Group = require("./components/Group.cjs");
|
|
7
|
-
const Item = require("./components/Item.cjs");
|
|
8
|
-
const MenuContent = require("./MenuContent.cjs");
|
|
9
|
-
const MenuProvider = require("./MenuProvider.cjs");
|
|
10
|
-
const Component = react.forwardRef(({
|
|
11
|
-
children,
|
|
12
|
-
visible,
|
|
13
|
-
hideOnClickItem,
|
|
14
|
-
...props
|
|
15
|
-
}, ref) => /* @__PURE__ */ jsxRuntime.jsx(MenuProvider.MenuProvider, { hideOnClickItem, visible, children: /* @__PURE__ */ jsxRuntime.jsx(MenuContent.Menu, { ...props, ref, children }) }));
|
|
16
|
-
const Menu = Object.assign(Component, {
|
|
17
|
-
Group: Group.Group,
|
|
18
|
-
Item
|
|
19
|
-
});
|
|
20
|
-
exports.Menu = Menu;
|
|
@@ -1,24 +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 heightMenu = "var(--uv_gky3yh0)";
|
|
6
|
-
var heightAvailableSpace = "var(--uv_gky3yh1)";
|
|
7
|
-
var menu = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_gky3yh2", variantClassNames: { arrow: { true: "uv_gky3yh3" }, searchable: { true: "uv_gky3yh4" } }, defaultVariants: { arrow: false, searchable: false }, compoundVariants: [] });
|
|
8
|
-
var menuContent = "uv_gky3yh5";
|
|
9
|
-
var menuFooter = "uv_gky3yh6";
|
|
10
|
-
var menuList = "uv_gky3yh7";
|
|
11
|
-
var menuSearchInput = "uv_gky3yh8";
|
|
12
|
-
var menuGroup = "uv_gky3yh9";
|
|
13
|
-
var menuItemContainer = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_gky3yha", variantClassNames: { borderless: { false: "uv_gky3yhb", true: "uv_gky3yhc" } }, defaultVariants: { borderless: false }, compoundVariants: [] });
|
|
14
|
-
var menuItem = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_gky3yhd", variantClassNames: { borderless: { true: "uv_gky3yhe" }, disabled: { true: "uv_gky3yhf" }, sentiment: { neutral: "uv_gky3yhg", danger: "uv_gky3yhh", primary: "uv_gky3yhi" } }, defaultVariants: { borderless: false, disabled: false, sentiment: "neutral" }, compoundVariants: [[{ sentiment: "neutral", disabled: false }, "uv_gky3yhj"], [{ sentiment: "danger", disabled: false }, "uv_gky3yhk"], [{ sentiment: "primary", disabled: false }, "uv_gky3yhl"], [{ sentiment: "neutral", disabled: true }, "uv_gky3yhm"], [{ sentiment: "danger", disabled: true }, "uv_gky3yhn"], [{ sentiment: "primary", disabled: true }, "uv_gky3yho"]] });
|
|
15
|
-
exports.heightAvailableSpace = heightAvailableSpace;
|
|
16
|
-
exports.heightMenu = heightMenu;
|
|
17
|
-
exports.menu = menu;
|
|
18
|
-
exports.menuContent = menuContent;
|
|
19
|
-
exports.menuFooter = menuFooter;
|
|
20
|
-
exports.menuGroup = menuGroup;
|
|
21
|
-
exports.menuItem = menuItem;
|
|
22
|
-
exports.menuItemContainer = menuItemContainer;
|
|
23
|
-
exports.menuList = menuList;
|
|
24
|
-
exports.menuSearchInput = menuSearchInput;
|
|
@@ -1,34 +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 index = require("../Text/index.cjs");
|
|
7
|
-
const styles_css = require("./styles.css.cjs");
|
|
8
|
-
const Meter = ({
|
|
9
|
-
strength,
|
|
10
|
-
title,
|
|
11
|
-
value,
|
|
12
|
-
className,
|
|
13
|
-
"data-testid": dataTestId,
|
|
14
|
-
style,
|
|
15
|
-
id
|
|
16
|
-
}) => {
|
|
17
|
-
const toValue = (value + 1) / strength.length * 100;
|
|
18
|
-
const width = `${toValue}%`;
|
|
19
|
-
const backgroundColor = strength[value]?.color ?? strength[0].color;
|
|
20
|
-
const text = strength[value]?.text ?? strength[0].text;
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-labelledby": "meter-label", "aria-live": "polite", "aria-valuemax": strength.length ?? 0, "aria-valuemin": 0, "aria-valuenow": value, className, "data-testid": dataTestId, id, role: "meter", style, title, children: [
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index.Text, { as: "p", id: "meter-label", variant: "bodySmallStrong", children: [
|
|
23
|
-
title,
|
|
24
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Text, { as: "span", className: styles_css.strengthMeter, style: dynamic.assignInlineVars({
|
|
25
|
-
[styles_css.colorMeter]: strength[value].color
|
|
26
|
-
}), variant: "bodySmallStrong", children: text })
|
|
27
|
-
] }),
|
|
28
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.wrapperMeter, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.meter, style: {
|
|
29
|
-
backgroundColor,
|
|
30
|
-
width
|
|
31
|
-
} }) })
|
|
32
|
-
] });
|
|
33
|
-
};
|
|
34
|
-
exports.Meter = Meter;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
var colorMeter = "var(--uv_1enq5vc0)";
|
|
5
|
-
var strengthMeter = "uv_1enq5vc1";
|
|
6
|
-
var wrapperMeter = "uv_1enq5vc2";
|
|
7
|
-
var meter = "uv_1enq5vc3";
|
|
8
|
-
exports.colorMeter = colorMeter;
|
|
9
|
-
exports.meter = meter;
|
|
10
|
-
exports.strengthMeter = strengthMeter;
|
|
11
|
-
exports.wrapperMeter = wrapperMeter;
|
|
@@ -1,39 +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("../Button/index.cjs");
|
|
7
|
-
const Dialog = require("./components/Dialog.cjs");
|
|
8
|
-
const styles_css = require("./styles.css.cjs");
|
|
9
|
-
const ModalContent = ({
|
|
10
|
-
visible,
|
|
11
|
-
open,
|
|
12
|
-
placement,
|
|
13
|
-
finalSize,
|
|
14
|
-
ariaLabel,
|
|
15
|
-
hideOnClickOutside,
|
|
16
|
-
hideOnEsc,
|
|
17
|
-
preventBodyScroll,
|
|
18
|
-
handleClose,
|
|
19
|
-
className,
|
|
20
|
-
backdropClassName,
|
|
21
|
-
dataTestId,
|
|
22
|
-
isClosable,
|
|
23
|
-
children,
|
|
24
|
-
handleOpen,
|
|
25
|
-
handleToggle,
|
|
26
|
-
finalId,
|
|
27
|
-
image,
|
|
28
|
-
style
|
|
29
|
-
}) => visible || open ? /* @__PURE__ */ jsxRuntime.jsx(Dialog.Dialog, { ariaLabel, backdropClassName, className, "data-testid": dataTestId, hideOnClickOutside, hideOnEsc, id: finalId, image, onClose: handleClose, open: visible || open, placement, preventBodyScroll, size: finalSize, style, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
30
|
-
typeof children === "function" ? children({
|
|
31
|
-
close: handleClose,
|
|
32
|
-
modalId: finalId,
|
|
33
|
-
show: handleOpen,
|
|
34
|
-
toggle: handleToggle,
|
|
35
|
-
visible
|
|
36
|
-
}) : children,
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.modalContainer, children: isClosable ? /* @__PURE__ */ jsxRuntime.jsx(index.Button, { "aria-label": "close", "data-testid": dataTestId ? `${dataTestId}-close-button` : void 0, onClick: handleClose, sentiment: "neutral", size: "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) }) : null })
|
|
38
|
-
] }) }) : null;
|
|
39
|
-
exports.ModalContent = ModalContent;
|
|
@@ -1,41 +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 ModalContext = react.createContext(void 0);
|
|
7
|
-
const useModal = () => {
|
|
8
|
-
const context = react.useContext(ModalContext);
|
|
9
|
-
if (!context) {
|
|
10
|
-
throw new Error("useModal must be used within a ModalProvider");
|
|
11
|
-
}
|
|
12
|
-
return context;
|
|
13
|
-
};
|
|
14
|
-
const ModalProvider = ({
|
|
15
|
-
children
|
|
16
|
-
}) => {
|
|
17
|
-
const [openedModals, setOpenedModals] = react.useState([]);
|
|
18
|
-
const [previsousOpenedModales, setPreviousOpenedModales] = react.useState([]);
|
|
19
|
-
const registerModal = react.useCallback((object) => {
|
|
20
|
-
setOpenedModals((prev) => {
|
|
21
|
-
setPreviousOpenedModales(prev);
|
|
22
|
-
return [...prev, object];
|
|
23
|
-
});
|
|
24
|
-
}, []);
|
|
25
|
-
const unregisterModal = react.useCallback((id) => {
|
|
26
|
-
setOpenedModals((prev) => {
|
|
27
|
-
setPreviousOpenedModales(prev);
|
|
28
|
-
return prev.filter((modalId) => modalId.id !== id);
|
|
29
|
-
});
|
|
30
|
-
}, []);
|
|
31
|
-
const value = react.useMemo(() => ({
|
|
32
|
-
openedModals,
|
|
33
|
-
previsousOpenedModales,
|
|
34
|
-
registerModal,
|
|
35
|
-
unregisterModal
|
|
36
|
-
}), [openedModals, registerModal, unregisterModal, previsousOpenedModales]);
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ModalContext.Provider, { value, children });
|
|
38
|
-
};
|
|
39
|
-
exports.ModalContext = ModalContext;
|
|
40
|
-
exports.ModalProvider = ModalProvider;
|
|
41
|
-
exports.useModal = useModal;
|