@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,237 +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 dynamic = require("@vanilla-extract/dynamic");
|
|
7
|
-
const react = require("react");
|
|
8
|
-
const index$3 = require("../../Button/index.cjs");
|
|
9
|
-
const index$2 = require("../../Stack/index.cjs");
|
|
10
|
-
const index$4 = require("../../Tag/index.cjs");
|
|
11
|
-
const index$1 = require("../../Text/index.cjs");
|
|
12
|
-
const index = require("../../Tooltip/index.cjs");
|
|
13
|
-
const findOptionInOptions = require("../findOptionInOptions.cjs");
|
|
14
|
-
const SelectInputProvider = require("../SelectInputProvider.cjs");
|
|
15
|
-
const selectBar_css = require("./selectBar.css.cjs");
|
|
16
|
-
const SIZES_TAG = {
|
|
17
|
-
gap: 8,
|
|
18
|
-
paddings: 16
|
|
19
|
-
};
|
|
20
|
-
const DisplayValues = ({
|
|
21
|
-
refTag,
|
|
22
|
-
nonOverflowedValues,
|
|
23
|
-
potentiallyNonOverflowedValues,
|
|
24
|
-
disabled,
|
|
25
|
-
readOnly,
|
|
26
|
-
overflowed,
|
|
27
|
-
overflowAmount,
|
|
28
|
-
size,
|
|
29
|
-
measureRef,
|
|
30
|
-
lastElementMaxWidth,
|
|
31
|
-
overflow,
|
|
32
|
-
refPlusTag,
|
|
33
|
-
displayShadowCopy
|
|
34
|
-
}) => {
|
|
35
|
-
const {
|
|
36
|
-
multiselect,
|
|
37
|
-
selectedData,
|
|
38
|
-
setSelectedData,
|
|
39
|
-
options,
|
|
40
|
-
onChange
|
|
41
|
-
} = SelectInputProvider.useSelectInput();
|
|
42
|
-
return multiselect ? /* @__PURE__ */ jsxRuntime.jsxs(index$2.Stack, { alignItems: "center", className: selectBar_css.multiselectStack, direction: "row", gap: "1", ref: refTag, wrap: "nowrap", children: [
|
|
43
|
-
displayShadowCopy ? /* @__PURE__ */ jsxRuntime.jsx("div", { ref: measureRef, style: {
|
|
44
|
-
position: "absolute"
|
|
45
|
-
}, children: potentiallyNonOverflowedValues.map((option) => /* @__PURE__ */ jsxRuntime.jsx(index$4.Tag, { className: `${option.value} ${selectBar_css.selectBarTags.hidden}`, onClose: () => {
|
|
46
|
-
}, children: option?.label }, option.value)) }) : null,
|
|
47
|
-
nonOverflowedValues.map((option, index2) => /* @__PURE__ */ jsxRuntime.jsx(index$4.Tag, { className: selectBar_css.selectBarTags.visible, "data-testid": "selected-options-tags", disabled, onClose: !readOnly ? (event) => {
|
|
48
|
-
event.stopPropagation();
|
|
49
|
-
setSelectedData({
|
|
50
|
-
clickedOption: option,
|
|
51
|
-
type: "selectOption"
|
|
52
|
-
});
|
|
53
|
-
const newSelectedValues = selectedData.selectedValues?.filter((val) => val !== option.value);
|
|
54
|
-
onChange?.(newSelectedValues);
|
|
55
|
-
} : void 0, sentiment: "neutral", style: index2 === nonOverflowedValues.length - 1 && overflow ? dynamic.assignInlineVars({
|
|
56
|
-
[selectBar_css.minWidthTag]: "auto",
|
|
57
|
-
[selectBar_css.maxWidthTag]: `${lastElementMaxWidth}px`
|
|
58
|
-
}) : void 0, children: option?.label }, option?.value)),
|
|
59
|
-
overflowed ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Stack, { justifyContent: "center", ref: refPlusTag, children: /* @__PURE__ */ jsxRuntime.jsxs(index$4.Tag, { "aria-label": "Plus tag", className: selectBar_css.plusTag, "data-testid": "plus-tag", disabled, sentiment: "neutral", children: [
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon.PlusIcon, { size: "xsmall" }),
|
|
61
|
-
overflowAmount
|
|
62
|
-
] }, "+") }) : null
|
|
63
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", className: selectBar_css.selectedValues, disabled, prominence: "default", sentiment: "neutral", variant: size === "large" ? "body" : "bodySmall", children: selectedData.selectedValues[0] ? findOptionInOptions.findOptionInOptions(options, selectedData.selectedValues[0])?.label : null });
|
|
64
|
-
};
|
|
65
|
-
const SelectBar = ({
|
|
66
|
-
size,
|
|
67
|
-
clearable,
|
|
68
|
-
disabled,
|
|
69
|
-
readOnly,
|
|
70
|
-
placeholder,
|
|
71
|
-
success,
|
|
72
|
-
error,
|
|
73
|
-
autoFocus,
|
|
74
|
-
tooltip,
|
|
75
|
-
innerRef,
|
|
76
|
-
id,
|
|
77
|
-
"data-testid": dataTestId,
|
|
78
|
-
label,
|
|
79
|
-
dropdownId
|
|
80
|
-
}) => {
|
|
81
|
-
const {
|
|
82
|
-
isDropdownVisible,
|
|
83
|
-
onChange,
|
|
84
|
-
setIsDropdownVisible,
|
|
85
|
-
options,
|
|
86
|
-
selectedData,
|
|
87
|
-
setSelectedData,
|
|
88
|
-
multiselect
|
|
89
|
-
} = SelectInputProvider.useSelectInput();
|
|
90
|
-
const openable = !(readOnly || disabled);
|
|
91
|
-
const [displayShadowCopy, setDisplayShadowCopy] = react.useState(false);
|
|
92
|
-
const refTag = react.useRef(null);
|
|
93
|
-
const measureRef = react.useRef(null);
|
|
94
|
-
const arrowRef = react.useRef(null);
|
|
95
|
-
const refPlusTag = react.useRef(null);
|
|
96
|
-
const [overflowAmount, setOverflowAmount] = react.useState(0);
|
|
97
|
-
const [overflow, setOverflow] = react.useState(false);
|
|
98
|
-
const [lastElementMaxWidth, setLastElementMaxWidth] = react.useState(0);
|
|
99
|
-
const [nonOverflowedValues, setNonOverFlowedValues] = react.useState(() => {
|
|
100
|
-
if (selectedData.selectedValues[0]) {
|
|
101
|
-
const firstSelectOption = findOptionInOptions.findOptionInOptions(options, selectedData.selectedValues[0]);
|
|
102
|
-
return firstSelectOption ? [firstSelectOption] : [];
|
|
103
|
-
}
|
|
104
|
-
return [];
|
|
105
|
-
});
|
|
106
|
-
const potentiallyNonOverflowedValues = react.useMemo(() => selectedData.selectedValues.map((selectedValue) => findOptionInOptions.findOptionInOptions(options, selectedValue)).filter((option) => !!option), [options, selectedData.selectedValues]);
|
|
107
|
-
const state = react.useMemo(() => {
|
|
108
|
-
if (error) {
|
|
109
|
-
return "danger";
|
|
110
|
-
}
|
|
111
|
-
if (success) {
|
|
112
|
-
return "success";
|
|
113
|
-
}
|
|
114
|
-
return "neutral";
|
|
115
|
-
}, [error, success]);
|
|
116
|
-
react.useEffect(() => {
|
|
117
|
-
setDisplayShadowCopy(true);
|
|
118
|
-
}, [selectedData.selectedValues.length]);
|
|
119
|
-
const getWidth = react.useCallback(() => {
|
|
120
|
-
if (refTag.current) {
|
|
121
|
-
return refTag.current.offsetWidth;
|
|
122
|
-
}
|
|
123
|
-
return innerRef.current?.offsetWidth ?? 0 - (arrowRef.current?.offsetWidth ?? 0) - SIZES_TAG.paddings;
|
|
124
|
-
}, [innerRef.current?.offsetWidth]);
|
|
125
|
-
react.useLayoutEffect(() => {
|
|
126
|
-
if (selectedData.selectedValues.length === 0) {
|
|
127
|
-
setOverflowAmount(0);
|
|
128
|
-
setNonOverFlowedValues([]);
|
|
129
|
-
}
|
|
130
|
-
if (measureRef.current && selectedData.selectedValues.length > 0) {
|
|
131
|
-
const toMeasureElements = measureRef.current.children;
|
|
132
|
-
const toMeasureElementsArray = [...toMeasureElements];
|
|
133
|
-
const innerWidth = getWidth();
|
|
134
|
-
const {
|
|
135
|
-
measuredVisibleTags,
|
|
136
|
-
measuredHiddenTags,
|
|
137
|
-
accumulatedWidth,
|
|
138
|
-
lastVisibleElementWidth,
|
|
139
|
-
lastVisibleLabel
|
|
140
|
-
} = toMeasureElementsArray.reduce((accumulator, currentValue, index2) => {
|
|
141
|
-
const elementWidth = currentValue.offsetWidth;
|
|
142
|
-
const newAccumulatedWidth = accumulator.accumulatedWidth + elementWidth + SIZES_TAG.gap;
|
|
143
|
-
const canBeVisible = newAccumulatedWidth <= innerWidth;
|
|
144
|
-
return {
|
|
145
|
-
accumulatedWidth: !canBeVisible ? accumulator.accumulatedWidth : newAccumulatedWidth,
|
|
146
|
-
lastVisibleElementWidth: canBeVisible ? elementWidth : accumulator.lastVisibleElementWidth,
|
|
147
|
-
lastVisibleLabel: canBeVisible ? potentiallyNonOverflowedValues[index2].label : accumulator.lastVisibleLabel,
|
|
148
|
-
measuredHiddenTags: accumulator.measuredHiddenTags + (!canBeVisible ? 1 : 0),
|
|
149
|
-
measuredVisibleTags: [...accumulator.measuredVisibleTags, canBeVisible && potentiallyNonOverflowedValues[index2]].filter(Boolean)
|
|
150
|
-
};
|
|
151
|
-
}, {
|
|
152
|
-
accumulatedWidth: 0,
|
|
153
|
-
lastVisibleElementWidth: 0,
|
|
154
|
-
lastVisibleLabel: "",
|
|
155
|
-
measuredHiddenTags: 0,
|
|
156
|
-
measuredVisibleTags: []
|
|
157
|
-
});
|
|
158
|
-
const additionnalElementsWidth = SIZES_TAG.paddings + (refPlusTag.current?.offsetWidth ?? 0);
|
|
159
|
-
const finalWidth = accumulatedWidth + (measuredHiddenTags ? additionnalElementsWidth : 0);
|
|
160
|
-
const overflowPx = finalWidth - innerWidth;
|
|
161
|
-
const hasOverflow = overflowPx > 0;
|
|
162
|
-
const hasHiddenTags = measuredHiddenTags > 0;
|
|
163
|
-
const lastVisibleElementMaxSize = lastVisibleElementWidth - overflowPx;
|
|
164
|
-
if (measuredHiddenTags === 1 && measuredVisibleTags.length === 0) {
|
|
165
|
-
setOverflowAmount(0);
|
|
166
|
-
setNonOverFlowedValues([potentiallyNonOverflowedValues[0]]);
|
|
167
|
-
const newOverflowPx = lastVisibleElementWidth + (measuredHiddenTags > 1 ? additionnalElementsWidth : 0) - innerWidth;
|
|
168
|
-
setLastElementMaxWidth(lastVisibleElementWidth - newOverflowPx);
|
|
169
|
-
setOverflow(true);
|
|
170
|
-
} else if (hasOverflow && hasHiddenTags && (lastVisibleElementMaxSize > 65 || measuredVisibleTags.length === 1 && lastVisibleElementMaxSize > 65) && typeof lastVisibleLabel === "string") {
|
|
171
|
-
setLastElementMaxWidth(lastVisibleElementMaxSize);
|
|
172
|
-
setOverflow(true);
|
|
173
|
-
setOverflowAmount(measuredHiddenTags);
|
|
174
|
-
setNonOverFlowedValues(measuredVisibleTags);
|
|
175
|
-
} else if (hasOverflow && hasHiddenTags) {
|
|
176
|
-
setLastElementMaxWidth(0);
|
|
177
|
-
setOverflow(false);
|
|
178
|
-
setOverflowAmount(measuredHiddenTags + 1);
|
|
179
|
-
setNonOverFlowedValues(measuredVisibleTags.slice(0, -1));
|
|
180
|
-
} else {
|
|
181
|
-
setOverflow(false);
|
|
182
|
-
setOverflowAmount(measuredHiddenTags);
|
|
183
|
-
setNonOverFlowedValues(measuredVisibleTags);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
setDisplayShadowCopy(false);
|
|
187
|
-
}, [displayShadowCopy, potentiallyNonOverflowedValues, selectedData.selectedValues.length, getWidth]);
|
|
188
|
-
react.useEffect(() => {
|
|
189
|
-
setSelectedData({
|
|
190
|
-
type: "update"
|
|
191
|
-
});
|
|
192
|
-
}, [setSelectedData, options]);
|
|
193
|
-
const shouldDisplayValues = react.useMemo(() => {
|
|
194
|
-
if (multiselect) {
|
|
195
|
-
return potentiallyNonOverflowedValues.length > 0 || selectedData.selectedValues.some((selectedValue) => findOptionInOptions.findOptionInOptions(options, selectedValue) !== void 0);
|
|
196
|
-
}
|
|
197
|
-
return selectedData.selectedValues[0] !== void 0 && findOptionInOptions.findOptionInOptions(options, selectedData.selectedValues[0]) !== void 0;
|
|
198
|
-
}, [multiselect, options, potentiallyNonOverflowedValues.length, selectedData.selectedValues]);
|
|
199
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-controls": dropdownId, "aria-expanded": isDropdownVisible, "aria-label": label, autoFocus, className: selectBar_css.selectBar({
|
|
200
|
-
disabled,
|
|
201
|
-
dropdownVisible: isDropdownVisible,
|
|
202
|
-
readOnly,
|
|
203
|
-
size,
|
|
204
|
-
state
|
|
205
|
-
}), "data-disabled": disabled, "data-readonly": readOnly, "data-testid": dataTestId, id, onClick: openable ? () => setIsDropdownVisible(!isDropdownVisible) : void 0, onKeyDown: (event) => {
|
|
206
|
-
if (event.key === "ArrowDown") {
|
|
207
|
-
if (!isDropdownVisible) {
|
|
208
|
-
setIsDropdownVisible(true);
|
|
209
|
-
} else {
|
|
210
|
-
document.getElementById(`option-0`)?.focus();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (event.key === " ") {
|
|
214
|
-
event.preventDefault();
|
|
215
|
-
}
|
|
216
|
-
return ["Enter", " "].includes(event.key) && openable ? setIsDropdownVisible(!isDropdownVisible) : null;
|
|
217
|
-
}, ref: innerRef, role: "combobox", tabIndex: 0, children: [
|
|
218
|
-
shouldDisplayValues ? /* @__PURE__ */ jsxRuntime.jsx(DisplayValues, { disabled, displayShadowCopy, lastElementMaxWidth, measureRef, nonOverflowedValues, overflow, overflowAmount, overflowed: !!overflowAmount, potentiallyNonOverflowedValues, readOnly, refPlusTag, refTag, size }) : /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", className: selectBar_css.selectinputPlaceholder, disabled, prominence: "weak", sentiment: "neutral", variant: size === "large" ? "body" : "bodySmall", children: placeholder }),
|
|
219
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index$2.Stack, { alignItems: "center", className: selectBar_css.selectbarState, direction: "row", gap: 1, ref: arrowRef, children: [
|
|
220
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.AlertCircleIcon, { sentiment: "danger" }) : null,
|
|
221
|
-
success && !error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.CheckCircleIcon, { sentiment: "success" }) : null,
|
|
222
|
-
clearable && selectedData.selectedValues.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Button, { "aria-label": "clear value", "data-testid": "clear-all", disabled: disabled || !selectedData.selectedValues[0] || readOnly, onClick: (event) => {
|
|
223
|
-
event.stopPropagation();
|
|
224
|
-
setSelectedData({
|
|
225
|
-
type: "clearAll"
|
|
226
|
-
});
|
|
227
|
-
if (multiselect) {
|
|
228
|
-
onChange?.([]);
|
|
229
|
-
} else {
|
|
230
|
-
onChange?.("");
|
|
231
|
-
}
|
|
232
|
-
}, sentiment: "neutral", size: "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) }) : null,
|
|
233
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon.ArrowDownIcon, { "aria-label": "show dropdown", disabled: disabled || readOnly, sentiment: "neutral", size: "small" })
|
|
234
|
-
] })
|
|
235
|
-
] }) });
|
|
236
|
-
};
|
|
237
|
-
exports.SelectBar = SelectBar;
|
|
@@ -1,34 +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 dropdown = "uv_5kpm8k0";
|
|
6
|
-
var dropdownContainer = "uv_5kpm8k1";
|
|
7
|
-
var dropdownContainerUnGrouped = "uv_5kpm8k2";
|
|
8
|
-
var dropdownGroup = "uv_5kpm8k3";
|
|
9
|
-
var dropdownGroupSelectable = "uv_5kpm8k4";
|
|
10
|
-
var dropdownGroupWrapper = "uv_5kpm8k5";
|
|
11
|
-
var dropdownItem = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_5kpm8k6", variantClassNames: { selected: { true: "uv_5kpm8k7" }, disabled: { true: "uv_5kpm8k8" } }, defaultVariants: { disabled: false, selected: false }, compoundVariants: [] });
|
|
12
|
-
var footer = "uv_5kpm8k9";
|
|
13
|
-
var dropdownCheckbox = "uv_5kpm8ka";
|
|
14
|
-
var dropdownEmptyState = "uv_5kpm8kb";
|
|
15
|
-
var dropdownLoadMore = "uv_5kpm8kc";
|
|
16
|
-
var dropdownInfo = "uv_5kpm8kd";
|
|
17
|
-
var dropdownInfoTextItem = "uv_5kpm8ke";
|
|
18
|
-
var dropdownInfoContainer = "uv_5kpm8kf";
|
|
19
|
-
var searchBar = "uv_5kpm8kg";
|
|
20
|
-
exports.dropdown = dropdown;
|
|
21
|
-
exports.dropdownCheckbox = dropdownCheckbox;
|
|
22
|
-
exports.dropdownContainer = dropdownContainer;
|
|
23
|
-
exports.dropdownContainerUnGrouped = dropdownContainerUnGrouped;
|
|
24
|
-
exports.dropdownEmptyState = dropdownEmptyState;
|
|
25
|
-
exports.dropdownGroup = dropdownGroup;
|
|
26
|
-
exports.dropdownGroupSelectable = dropdownGroupSelectable;
|
|
27
|
-
exports.dropdownGroupWrapper = dropdownGroupWrapper;
|
|
28
|
-
exports.dropdownInfo = dropdownInfo;
|
|
29
|
-
exports.dropdownInfoContainer = dropdownInfoContainer;
|
|
30
|
-
exports.dropdownInfoTextItem = dropdownInfoTextItem;
|
|
31
|
-
exports.dropdownItem = dropdownItem;
|
|
32
|
-
exports.dropdownLoadMore = dropdownLoadMore;
|
|
33
|
-
exports.footer = footer;
|
|
34
|
-
exports.searchBar = searchBar;
|
|
@@ -1,22 +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 maxWidthTag = "var(--uv_1ba7knd0)";
|
|
6
|
-
var minWidthTag = "var(--uv_1ba7knd1)";
|
|
7
|
-
var selectbarState = "uv_1ba7knd2";
|
|
8
|
-
var selectinputPlaceholder = "uv_1ba7knd3";
|
|
9
|
-
var selectBar = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_1ba7knd5 uv_1ba7knd4", variantClassNames: { size: { small: "uv_1ba7knd6", medium: "uv_1ba7knd7", large: "uv_1ba7knd8" }, state: { neutral: "uv_1ba7knd9", success: "uv_1ba7knda", danger: "uv_1ba7kndb" }, dropdownVisible: { true: "uv_1ba7kndc" }, readOnly: { true: "uv_1ba7kndd" }, disabled: { true: "uv_1ba7knde" } }, defaultVariants: { state: "neutral", size: "large", dropdownVisible: false, readOnly: false, disabled: false }, compoundVariants: [[{ dropdownVisible: true, state: "neutral" }, "uv_1ba7kndf"], [{ dropdownVisible: true, state: "success" }, "uv_1ba7kndg"], [{ dropdownVisible: true, state: "danger" }, "uv_1ba7kndh"]] });
|
|
10
|
-
var selectBarTags = { hidden: "uv_1ba7kndj uv_1ba7kndi", visible: "uv_1ba7kndk uv_1ba7kndi" };
|
|
11
|
-
var selectedValues = "uv_1ba7kndl";
|
|
12
|
-
var plusTag = "uv_1ba7kndm";
|
|
13
|
-
var multiselectStack = "uv_1ba7kndn";
|
|
14
|
-
exports.maxWidthTag = maxWidthTag;
|
|
15
|
-
exports.minWidthTag = minWidthTag;
|
|
16
|
-
exports.multiselectStack = multiselectStack;
|
|
17
|
-
exports.plusTag = plusTag;
|
|
18
|
-
exports.selectBar = selectBar;
|
|
19
|
-
exports.selectBarTags = selectBarTags;
|
|
20
|
-
exports.selectbarState = selectbarState;
|
|
21
|
-
exports.selectedValues = selectedValues;
|
|
22
|
-
exports.selectinputPlaceholder = selectinputPlaceholder;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const findOptionInOptions = (options, optionValue) => {
|
|
4
|
-
let flatOptions = [];
|
|
5
|
-
if (!Array.isArray(options)) {
|
|
6
|
-
flatOptions = Object.keys(options).flatMap((group) => options[group]);
|
|
7
|
-
} else {
|
|
8
|
-
flatOptions = options;
|
|
9
|
-
}
|
|
10
|
-
return flatOptions.find((option) => option.value === optionValue);
|
|
11
|
-
};
|
|
12
|
-
exports.findOptionInOptions = findOptionInOptions;
|
|
@@ -1,68 +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$1 = require("../Label/index.cjs");
|
|
7
|
-
const index = require("../Stack/index.cjs");
|
|
8
|
-
const index$2 = require("../Text/index.cjs");
|
|
9
|
-
const Dropdown = require("./components/Dropdown.cjs");
|
|
10
|
-
const SelectBar = require("./components/SelectBar.cjs");
|
|
11
|
-
const SelectInputProvider = require("./SelectInputProvider.cjs");
|
|
12
|
-
const styles_css = require("./styles.css.cjs");
|
|
13
|
-
const SelectInput = ({
|
|
14
|
-
name,
|
|
15
|
-
id,
|
|
16
|
-
onBlur,
|
|
17
|
-
onFocus,
|
|
18
|
-
onChange,
|
|
19
|
-
"aria-label": ariaLabel,
|
|
20
|
-
value,
|
|
21
|
-
label,
|
|
22
|
-
helper,
|
|
23
|
-
options,
|
|
24
|
-
size = "large",
|
|
25
|
-
emptyState,
|
|
26
|
-
descriptionDirection = "column",
|
|
27
|
-
success,
|
|
28
|
-
error,
|
|
29
|
-
"data-testid": dataTestId,
|
|
30
|
-
className,
|
|
31
|
-
tooltip,
|
|
32
|
-
footer,
|
|
33
|
-
placeholderSearch = "Search in list",
|
|
34
|
-
placeholder = "Select item",
|
|
35
|
-
searchable = true,
|
|
36
|
-
disabled = false,
|
|
37
|
-
readOnly = false,
|
|
38
|
-
clearable = false,
|
|
39
|
-
multiselect = false,
|
|
40
|
-
required = false,
|
|
41
|
-
labelDescription,
|
|
42
|
-
autofocus,
|
|
43
|
-
loadMore,
|
|
44
|
-
optionalInfoPlacement = "right",
|
|
45
|
-
isLoading,
|
|
46
|
-
selectAll,
|
|
47
|
-
selectAllGroup = false,
|
|
48
|
-
dropdownAlign,
|
|
49
|
-
portalTarget,
|
|
50
|
-
onOpen,
|
|
51
|
-
style
|
|
52
|
-
}) => {
|
|
53
|
-
const localId = react.useId();
|
|
54
|
-
const finalId = id ?? localId;
|
|
55
|
-
const dropdownId = react.useId();
|
|
56
|
-
const ref = react.useRef(null);
|
|
57
|
-
const numberOfOptions = Array.isArray(options) ? options.length : Object.values(options).reduce((acc, current) => acc + current.filter((option) => !option.disabled).length, 0);
|
|
58
|
-
const finalDataTestId = dataTestId ?? `select-input-${name ?? "name"}`;
|
|
59
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SelectInputProvider.SelectInputProvider, { multiselect, numberOfOptions, onChange, onOpen, options, refSelect: ref, selectAll, selectAllGroup, value, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { "aria-label": name, className: `${className ? `${className} ` : ""}${styles_css.selectinputContainer}`, onBlur, onFocus, style, children: [
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.jsx(Dropdown.Dropdown, { descriptionDirection, dropdownAlign, emptyState, footer, id: dropdownId, isLoading, loadMore, optionalInfoPlacement, placeholder: placeholderSearch, portalTarget, refSelect: ref, searchable, size, children: /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { "aria-label": ariaLabel, gap: 0.5, children: [
|
|
61
|
-
label || labelDescription ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { htmlFor: finalId, labelDescription, required, size, children: label }) : null,
|
|
62
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectBar.SelectBar, { autoFocus: autofocus, clearable, "data-testid": finalDataTestId, disabled, dropdownId, error, id: finalId, innerRef: ref, label, placeholder, readOnly, size, success, tooltip })
|
|
63
|
-
] }) }),
|
|
64
|
-
!error && !success && helper ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Text, { as: "p", className: styles_css.selectinputHelper, prominence: "weak", sentiment: "neutral", variant: "caption", children: helper }) : null,
|
|
65
|
-
error && typeof error === "string" || success ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Text, { as: "p", className: styles_css.selectinputHelper, prominence: "default", sentiment: error ? "danger" : "success", variant: "caption", children: error || success }) : null
|
|
66
|
-
] }) });
|
|
67
|
-
};
|
|
68
|
-
exports.SelectInput = SelectInput;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
var selectinputContainer = "uv_uf6pag0";
|
|
5
|
-
var selectinputHelper = "uv_uf6pag1";
|
|
6
|
-
exports.selectinputContainer = selectinputContainer;
|
|
7
|
-
exports.selectinputHelper = selectinputHelper;
|
|
@@ -1,149 +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 ProductIcon = require("@ultraviolet/icons/product");
|
|
6
|
-
const themes = require("@ultraviolet/themes");
|
|
7
|
-
const dynamic = require("@vanilla-extract/dynamic");
|
|
8
|
-
const react = require("react");
|
|
9
|
-
const index$3 = require("../Checkbox/index.cjs");
|
|
10
|
-
const index$2 = require("../Radio/index.cjs");
|
|
11
|
-
const index = require("../Stack/index.cjs");
|
|
12
|
-
const index$1 = require("../Tooltip/index.cjs");
|
|
13
|
-
const styles_css = require("./styles.css.cjs");
|
|
14
|
-
const variables_css = require("./variables.css.cjs");
|
|
15
|
-
function _interopNamespaceCompat(e) {
|
|
16
|
-
if (e && typeof e === "object" && "default" in e) return e;
|
|
17
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
18
|
-
if (e) {
|
|
19
|
-
for (const k in e) {
|
|
20
|
-
if (k !== "default") {
|
|
21
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: () => e[k]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
n.default = e;
|
|
30
|
-
return Object.freeze(n);
|
|
31
|
-
}
|
|
32
|
-
const ProductIcon__namespace = /* @__PURE__ */ _interopNamespaceCompat(ProductIcon);
|
|
33
|
-
const SelectableCard = react.forwardRef(({
|
|
34
|
-
name,
|
|
35
|
-
value,
|
|
36
|
-
onChange,
|
|
37
|
-
showTick = false,
|
|
38
|
-
type = "radio",
|
|
39
|
-
checked = false,
|
|
40
|
-
disabled = false,
|
|
41
|
-
children,
|
|
42
|
-
className,
|
|
43
|
-
isError,
|
|
44
|
-
onFocus,
|
|
45
|
-
onBlur,
|
|
46
|
-
tooltip,
|
|
47
|
-
id,
|
|
48
|
-
label,
|
|
49
|
-
"data-testid": dataTestId,
|
|
50
|
-
productIcon,
|
|
51
|
-
illustration,
|
|
52
|
-
"aria-label": ariaLabel,
|
|
53
|
-
style
|
|
54
|
-
}, ref) => {
|
|
55
|
-
const theme = themes.useTheme();
|
|
56
|
-
const innerRef = react.useRef(null);
|
|
57
|
-
const childrenRef = react.useRef(null);
|
|
58
|
-
const [svgContent, setSvgContent] = react.useState(null);
|
|
59
|
-
const image = react.useMemo(() => {
|
|
60
|
-
if (illustration) {
|
|
61
|
-
return "illustration";
|
|
62
|
-
}
|
|
63
|
-
if (productIcon) {
|
|
64
|
-
return "icon";
|
|
65
|
-
}
|
|
66
|
-
return "none";
|
|
67
|
-
}, [illustration, productIcon]);
|
|
68
|
-
react.useEffect(() => {
|
|
69
|
-
if (illustration?.endsWith(".svg")) {
|
|
70
|
-
fetch(illustration).then((response) => response.text()).then((svg) => {
|
|
71
|
-
const updatedSvg = svg.replace(/fill="[^"]*"/g, `fill="${theme.colors.neutral.backgroundStronger}"`).replace(/width="[^"]*"/g, `width="220px"`).replace(/height="[^"]*"/g, `height="220px"`);
|
|
72
|
-
setSvgContent(updatedSvg);
|
|
73
|
-
}).catch(() => null);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const ProductIconUsed = productIcon ? ProductIcon__namespace[`${productIcon.charAt(0).toUpperCase() + productIcon.slice(1)}ProductIcon`] : null;
|
|
77
|
-
const ParentContainer = react.useCallback(({
|
|
78
|
-
children: subChildren
|
|
79
|
-
}) => {
|
|
80
|
-
if (tooltip) {
|
|
81
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(index$1.Tooltip, { containerFullHeight: true, text: tooltip, children: subChildren }) });
|
|
82
|
-
}
|
|
83
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$1.Tooltip, { children: subChildren });
|
|
84
|
-
}, [tooltip]);
|
|
85
|
-
const IllustrationContainer = react.useCallback(({
|
|
86
|
-
children: subChildren
|
|
87
|
-
}) => {
|
|
88
|
-
if (ProductIconUsed || illustration) {
|
|
89
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "stretch", direction: "row", flex: 1, justifyContent: "space-between", width: "100%", children: [
|
|
90
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { className: styles_css.illustrationSelectableCard, children: subChildren }),
|
|
91
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Stack, { justifyContent: "center", children: ProductIconUsed ? /* @__PURE__ */ jsxRuntime.jsx(ProductIconUsed, { size: "large" }) : null }),
|
|
92
|
-
illustration ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.divSelectableCard, children: illustration.endsWith(".svg") && svgContent ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
className: styles_css.imageSelectableCard,
|
|
96
|
-
dangerouslySetInnerHTML: {
|
|
97
|
-
__html: svgContent
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("img", { alt: "illustration", className: styles_css.imageSelectableCard, src: illustration, width: 220 }) }) : null
|
|
101
|
-
] });
|
|
102
|
-
}
|
|
103
|
-
return subChildren;
|
|
104
|
-
}, [ProductIconUsed, illustration, svgContent]);
|
|
105
|
-
const onKeyDown = react.useCallback((event) => {
|
|
106
|
-
if (event.key === " " && innerRef?.current) {
|
|
107
|
-
event.preventDefault();
|
|
108
|
-
innerRef.current.click();
|
|
109
|
-
}
|
|
110
|
-
}, [innerRef]);
|
|
111
|
-
const isComplexChildren = ["function", "array", "object"].includes(typeof children);
|
|
112
|
-
const onClickContainer = react.useCallback((event) => {
|
|
113
|
-
if (innerRef.current && !disabled) {
|
|
114
|
-
const inputElement = innerRef.current;
|
|
115
|
-
const labelElement = document.querySelector(`label[for="${inputElement.id}"]`);
|
|
116
|
-
const targetNode = event.target;
|
|
117
|
-
if (!inputElement.contains(targetNode) && !labelElement?.contains(targetNode)) {
|
|
118
|
-
inputElement.click();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}, [disabled]);
|
|
122
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ParentContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "start", className: `${className ? `${className} ` : ""}${styles_css.containerSelectableCard({
|
|
123
|
-
cursor: type === "checkbox" && isComplexChildren ? "default" : "custom",
|
|
124
|
-
image
|
|
125
|
-
})} ${styles_css.labelContainerSelectableCard[label ? "label" : "noLabel"]}`, "data-checked": checked, "data-disabled": disabled, "data-error": isError, "data-testid": dataTestId, "data-type": type, direction: label ? "column" : "row", flex: 1, gap: 0.5, onClick: type === "checkbox" && isComplexChildren ? void 0 : onClickContainer, onKeyDown, ref, role: "button", style: {
|
|
126
|
-
...dynamic.assignInlineVars({
|
|
127
|
-
[variables_css.inputDisplay]: !showTick ? "none" : "inline",
|
|
128
|
-
[variables_css.labelDisplay]: !showTick && !label ? "none" : "inline",
|
|
129
|
-
[variables_css.widthSelectable]: label ? "100%" : "auto"
|
|
130
|
-
}),
|
|
131
|
-
...style
|
|
132
|
-
}, tabIndex: disabled ? void 0 : 0, children: /* @__PURE__ */ jsxRuntime.jsxs(IllustrationContainer, { children: [
|
|
133
|
-
type === "radio" ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Radio, { checked, className: styles_css.selectableElementSelectableCard, "data-error": isError, disabled, error: isError, id, name, onBlur, onChange, onFocus, ref: innerRef, tabIndex: -1, value, ...label ? {
|
|
134
|
-
label
|
|
135
|
-
} : {
|
|
136
|
-
"aria-label": ariaLabel
|
|
137
|
-
} }) : /* @__PURE__ */ jsxRuntime.jsx(index$3.Checkbox, { checked, className: styles_css.selectableElementSelectableCard, "data-error": isError, disabled, error: isError, id, name, onBlur, onChange, onFocus, ref: innerRef, tabIndex: -1, value, ...label ? {
|
|
138
|
-
"aria-label": void 0,
|
|
139
|
-
children: label
|
|
140
|
-
} : {
|
|
141
|
-
"aria-label": ariaLabel
|
|
142
|
-
} }),
|
|
143
|
-
children ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { className: styles_css.stackSelectableCard, "data-has-default-cursor": type === "checkbox" && isComplexChildren, "data-has-label": !!label && showTick, onKeyDown: (event) => event.stopPropagation(), ref: childrenRef, width: "100%", children: typeof children === "function" ? children({
|
|
144
|
-
checked,
|
|
145
|
-
disabled
|
|
146
|
-
}) : children }) : null
|
|
147
|
-
] }) }) });
|
|
148
|
-
});
|
|
149
|
-
exports.SelectableCard = SelectableCard;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
;/* empty css */
|
|
5
|
-
;/* empty css */
|
|
6
|
-
;/* empty css */
|
|
7
|
-
const createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
8
|
-
var containerSelectableCard = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_475tnd0", variantClassNames: { image: { none: "uv_475tnd1", icon: "uv_475tnd2", illustration: "uv_475tnd3" }, cursor: { "default": "uv_475tnd4", custom: "uv_475tnd5" } }, defaultVariants: { image: "none", cursor: "custom" }, compoundVariants: [] });
|
|
9
|
-
var labelContainerSelectableCard = { label: "uv_475tnd6", noLabel: "uv_475tnd7" };
|
|
10
|
-
var divSelectableCard = "uv_475tnd8";
|
|
11
|
-
var imageSelectableCard = "uv_475tnd9";
|
|
12
|
-
var illustrationSelectableCard = "uv_475tnda";
|
|
13
|
-
var stackSelectableCard = "uv_475tndb";
|
|
14
|
-
var selectableElementSelectableCard = "uv_475tndc";
|
|
15
|
-
exports.containerSelectableCard = containerSelectableCard;
|
|
16
|
-
exports.divSelectableCard = divSelectableCard;
|
|
17
|
-
exports.illustrationSelectableCard = illustrationSelectableCard;
|
|
18
|
-
exports.imageSelectableCard = imageSelectableCard;
|
|
19
|
-
exports.labelContainerSelectableCard = labelContainerSelectableCard;
|
|
20
|
-
exports.selectableElementSelectableCard = selectableElementSelectableCard;
|
|
21
|
-
exports.stackSelectableCard = stackSelectableCard;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
var inputDisplay = "var(--uv_18vc4d30)";
|
|
4
|
-
var labelDisplay = "var(--uv_18vc4d31)";
|
|
5
|
-
var widthSelectable = "var(--uv_18vc4d32)";
|
|
6
|
-
exports.inputDisplay = inputDisplay;
|
|
7
|
-
exports.labelDisplay = labelDisplay;
|
|
8
|
-
exports.widthSelectable = widthSelectable;
|
|
@@ -1,75 +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$1 = require("../Label/index.cjs");
|
|
7
|
-
const index$2 = require("../Row/index.cjs");
|
|
8
|
-
const index$4 = require("../SelectableCard/index.cjs");
|
|
9
|
-
const index = require("../Stack/index.cjs");
|
|
10
|
-
const index$3 = require("../Text/index.cjs");
|
|
11
|
-
const styles_css = require("./styles.css.cjs");
|
|
12
|
-
const SelectableCardGroupContext = react.createContext(void 0);
|
|
13
|
-
const CardSelectableCard = ({
|
|
14
|
-
value,
|
|
15
|
-
disabled,
|
|
16
|
-
children,
|
|
17
|
-
className,
|
|
18
|
-
isError,
|
|
19
|
-
onFocus,
|
|
20
|
-
onBlur,
|
|
21
|
-
tooltip,
|
|
22
|
-
id,
|
|
23
|
-
label,
|
|
24
|
-
style,
|
|
25
|
-
"data-testid": dataTestId
|
|
26
|
-
}) => {
|
|
27
|
-
const context = react.useContext(SelectableCardGroupContext);
|
|
28
|
-
if (!context) {
|
|
29
|
-
throw new Error("SelectableCardGroup.Card can only be used inside a SelectableCardGroup");
|
|
30
|
-
}
|
|
31
|
-
const {
|
|
32
|
-
groupName,
|
|
33
|
-
onChange,
|
|
34
|
-
groupValue,
|
|
35
|
-
type,
|
|
36
|
-
showTick,
|
|
37
|
-
error
|
|
38
|
-
} = context;
|
|
39
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index$4.SelectableCard, { checked: typeof groupValue === "object" ? groupValue.includes(value) : groupValue === value, className, "data-testid": dataTestId, disabled, id, isError: isError || error, label, name: groupName, onBlur, onChange, onFocus, showTick, style, tooltip, type, value, children });
|
|
40
|
-
};
|
|
41
|
-
const SelectableCardGroup = ({
|
|
42
|
-
legend,
|
|
43
|
-
legendDescription,
|
|
44
|
-
value,
|
|
45
|
-
className,
|
|
46
|
-
helper,
|
|
47
|
-
error,
|
|
48
|
-
columns = 1,
|
|
49
|
-
children,
|
|
50
|
-
onChange,
|
|
51
|
-
name,
|
|
52
|
-
required = false,
|
|
53
|
-
type,
|
|
54
|
-
showTick = false
|
|
55
|
-
}) => {
|
|
56
|
-
const contextValue = react.useMemo(() => ({
|
|
57
|
-
error: !!error,
|
|
58
|
-
groupName: name,
|
|
59
|
-
groupValue: value,
|
|
60
|
-
onChange,
|
|
61
|
-
required,
|
|
62
|
-
showTick,
|
|
63
|
-
type
|
|
64
|
-
}), [name, value, onChange, required, type, showTick, error]);
|
|
65
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SelectableCardGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { gap: 1, children: [
|
|
66
|
-
/* @__PURE__ */ jsxRuntime.jsx("fieldset", { className: `${className ? `${className} ` : ""}${styles_css.selectableCardGroupFieldSet}`, children: /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { gap: 1.5, children: [
|
|
67
|
-
legend ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { as: "legend", labelDescription: legendDescription, required, children: legend }) : null,
|
|
68
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$2.Row, { gap: 2, templateColumns: `repeat(${columns}, minmax(0, 1fr))`, children })
|
|
69
|
-
] }) }),
|
|
70
|
-
helper ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Text, { as: "span", prominence: "weak", sentiment: "neutral", variant: "caption", children: helper }) : null,
|
|
71
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Text, { as: "span", sentiment: "danger", variant: "caption", children: error }) : null
|
|
72
|
-
] }) });
|
|
73
|
-
};
|
|
74
|
-
SelectableCardGroup.Card = CardSelectableCard;
|
|
75
|
-
exports.SelectableCardGroup = SelectableCardGroup;
|