@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,63 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const useClipboard = require("react-use-clipboard");
|
|
8
|
-
const index$2 = require("../Button/index.cjs");
|
|
9
|
-
const index$3 = require("../Loader/index.cjs");
|
|
10
|
-
const index$1 = require("../Text/index.cjs");
|
|
11
|
-
const index = require("../Tooltip/index.cjs");
|
|
12
|
-
const styles_css = require("./styles.css.cjs");
|
|
13
|
-
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
14
|
-
const useClipboard__default = /* @__PURE__ */ _interopDefaultCompat(useClipboard);
|
|
15
|
-
const COPY_DURATION = 2500;
|
|
16
|
-
const TagInner = ({
|
|
17
|
-
children,
|
|
18
|
-
isLoading = false,
|
|
19
|
-
onClose,
|
|
20
|
-
disabled = false
|
|
21
|
-
}) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { "aria-disabled": disabled, as: "span", className: styles_css.textTag, oneLine: true, variant: "caption", children }),
|
|
23
|
-
onClose && !isLoading ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Button, { "aria-label": "Close tag", className: styles_css.closeButtonTag, "data-testid": "close-tag", disabled, onClick: onClose, sentiment: "neutral", size: "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, { size: "small" }) }) : null,
|
|
24
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Loader, { active: true, size: "small" }) : null
|
|
25
|
-
] });
|
|
26
|
-
const Tag = ({
|
|
27
|
-
children,
|
|
28
|
-
isLoading,
|
|
29
|
-
onClose,
|
|
30
|
-
copiable = false,
|
|
31
|
-
copyText = "Copy",
|
|
32
|
-
copiedText = "Copied!",
|
|
33
|
-
disabled,
|
|
34
|
-
sentiment = "neutral",
|
|
35
|
-
className,
|
|
36
|
-
style,
|
|
37
|
-
"data-testid": dataTestId
|
|
38
|
-
}) => {
|
|
39
|
-
const stringChildren = react.useMemo(() => {
|
|
40
|
-
if (typeof children === "string") {
|
|
41
|
-
return children;
|
|
42
|
-
}
|
|
43
|
-
if (Array.isArray(children)) {
|
|
44
|
-
return children.filter((child) => typeof child === "string").join("");
|
|
45
|
-
}
|
|
46
|
-
return "";
|
|
47
|
-
}, [children]);
|
|
48
|
-
const [isCopied, setCopied] = useClipboard__default.default(stringChildren, {
|
|
49
|
-
successDuration: COPY_DURATION
|
|
50
|
-
});
|
|
51
|
-
if (copiable && !disabled) {
|
|
52
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { text: isCopied ? copiedText : copyText, children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: `${className ? `${className} ` : ""}${styles_css.containerTag({
|
|
53
|
-
copiable,
|
|
54
|
-
disabled,
|
|
55
|
-
sentiment
|
|
56
|
-
})}`, "data-testid": dataTestId, disabled, onClick: setCopied, children: /* @__PURE__ */ jsxRuntime.jsx(TagInner, { disabled, isLoading, onClose, children }) }) });
|
|
57
|
-
}
|
|
58
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${className ? `${className} ` : ""}${styles_css.containerTag({
|
|
59
|
-
disabled,
|
|
60
|
-
sentiment
|
|
61
|
-
})}`, "data-testid": dataTestId, style, children: /* @__PURE__ */ jsxRuntime.jsx(TagInner, { disabled, isLoading, onClose, children }) });
|
|
62
|
-
};
|
|
63
|
-
exports.Tag = Tag;
|
|
@@ -1,10 +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 containerTag = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_d6zknp0", variantClassNames: { copiable: { true: "uv_d6zknp1" }, sentiment: { danger: "uv_d6zknp2", info: "uv_d6zknp3", neutral: "uv_d6zknp4", primary: "uv_d6zknp5", secondary: "uv_d6zknp6", success: "uv_d6zknp7", warning: "uv_d6zknp8" }, disabled: { true: "uv_d6zknp9" } }, defaultVariants: { copiable: false, disabled: false, sentiment: "neutral" }, compoundVariants: [] });
|
|
6
|
-
var textTag = "uv_d6zknpa";
|
|
7
|
-
var closeButtonTag = "uv_d6zknpb";
|
|
8
|
-
exports.closeButtonTag = closeButtonTag;
|
|
9
|
-
exports.containerTag = containerTag;
|
|
10
|
-
exports.textTag = textTag;
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const index$4 = require("../Button/index.cjs");
|
|
8
|
-
const index$1 = require("../Label/index.cjs");
|
|
9
|
-
const index = require("../Stack/index.cjs");
|
|
10
|
-
const index$3 = require("../Tag/index.cjs");
|
|
11
|
-
const index$5 = require("../Text/index.cjs");
|
|
12
|
-
const index$2 = require("../Tooltip/index.cjs");
|
|
13
|
-
const styles_css = require("./styles.css.cjs");
|
|
14
|
-
const ids = require("../../utils/ids.cjs");
|
|
15
|
-
const STATUS = {
|
|
16
|
-
IDLE: "idle",
|
|
17
|
-
LOADING: "loading"
|
|
18
|
-
};
|
|
19
|
-
const convertTagArrayToTagStateArray = (tags) => (tags ?? [])?.map((tag, index2) => typeof tag === "object" ? {
|
|
20
|
-
...tag,
|
|
21
|
-
index: ids.getUUID(`tag-${index2}`)
|
|
22
|
-
} : {
|
|
23
|
-
index: ids.getUUID(`tag-${index2}`),
|
|
24
|
-
label: tag
|
|
25
|
-
});
|
|
26
|
-
const TagInput = ({
|
|
27
|
-
disabled = false,
|
|
28
|
-
id,
|
|
29
|
-
name,
|
|
30
|
-
onChange,
|
|
31
|
-
placeholder,
|
|
32
|
-
value,
|
|
33
|
-
className,
|
|
34
|
-
"data-testid": dataTestId,
|
|
35
|
-
"aria-label": ariaLabel,
|
|
36
|
-
label,
|
|
37
|
-
labelDescription,
|
|
38
|
-
required = false,
|
|
39
|
-
size = "large",
|
|
40
|
-
error,
|
|
41
|
-
success,
|
|
42
|
-
helper,
|
|
43
|
-
readOnly = false,
|
|
44
|
-
tooltip,
|
|
45
|
-
clearable = false,
|
|
46
|
-
style
|
|
47
|
-
}) => {
|
|
48
|
-
const [tagInputState, setTagInput] = react.useState(convertTagArrayToTagStateArray(value));
|
|
49
|
-
const [input, setInput] = react.useState("");
|
|
50
|
-
const [status, setStatus] = react.useState({});
|
|
51
|
-
const uniqueId = react.useId();
|
|
52
|
-
const localId = id ?? uniqueId;
|
|
53
|
-
react.useEffect(() => {
|
|
54
|
-
setTagInput(convertTagArrayToTagStateArray(value));
|
|
55
|
-
}, [value, setTagInput]);
|
|
56
|
-
const inputRef = react.useRef(null);
|
|
57
|
-
const dispatchOnChange = (newState) => {
|
|
58
|
-
const changes = newState.map((tag) => typeof tag === "object" ? tag?.label : tag);
|
|
59
|
-
onChange?.(changes);
|
|
60
|
-
};
|
|
61
|
-
const handleContainerClick = () => {
|
|
62
|
-
if (inputRef.current) {
|
|
63
|
-
inputRef?.current?.focus();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const onInputChange = (e) => {
|
|
67
|
-
setInput(e.target.value);
|
|
68
|
-
};
|
|
69
|
-
const addTag = () => {
|
|
70
|
-
const newTagInput = input ? [...tagInputState, {
|
|
71
|
-
index: ids.getUUID("tag"),
|
|
72
|
-
label: input
|
|
73
|
-
}] : tagInputState;
|
|
74
|
-
setInput("");
|
|
75
|
-
setTagInput(newTagInput);
|
|
76
|
-
if (newTagInput.length !== tagInputState.length && newTagInput) {
|
|
77
|
-
setStatus({
|
|
78
|
-
[newTagInput[newTagInput.length - 1].index]: STATUS.LOADING
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
try {
|
|
82
|
-
dispatchOnChange(newTagInput);
|
|
83
|
-
if (newTagInput) {
|
|
84
|
-
setStatus({
|
|
85
|
-
[newTagInput[newTagInput.length - 1].index]: STATUS.IDLE
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
setTagInput(tagInputState);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const deleteTag = (tagIndex) => {
|
|
93
|
-
setStatus({
|
|
94
|
-
[tagIndex]: STATUS.LOADING
|
|
95
|
-
});
|
|
96
|
-
const findIndex = tagInputState.findIndex(({
|
|
97
|
-
index: index2
|
|
98
|
-
}) => index2 === tagIndex);
|
|
99
|
-
const newTagInput = [...tagInputState];
|
|
100
|
-
newTagInput.splice(findIndex, 1);
|
|
101
|
-
try {
|
|
102
|
-
dispatchOnChange(newTagInput);
|
|
103
|
-
setTagInput(newTagInput);
|
|
104
|
-
setStatus({
|
|
105
|
-
[tagIndex]: STATUS.IDLE
|
|
106
|
-
});
|
|
107
|
-
} catch {
|
|
108
|
-
setTagInput(tagInputState);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const handleInputKeydown = (event) => {
|
|
112
|
-
if (event.key === " " || event.key === "Enter") {
|
|
113
|
-
addTag();
|
|
114
|
-
event.preventDefault();
|
|
115
|
-
}
|
|
116
|
-
if (event.key === "Backspace" && inputRef?.current?.selectionStart === 0 && tagInputState.length > 0) {
|
|
117
|
-
event.preventDefault();
|
|
118
|
-
if (tagInputState) {
|
|
119
|
-
deleteTag(tagInputState[tagInputState.length - 1].index);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const clearAll = () => {
|
|
124
|
-
setInput("");
|
|
125
|
-
setTagInput([]);
|
|
126
|
-
dispatchOnChange([]);
|
|
127
|
-
};
|
|
128
|
-
const helperSentiment = react.useMemo(() => {
|
|
129
|
-
if (error) {
|
|
130
|
-
return "danger";
|
|
131
|
-
}
|
|
132
|
-
if (success) {
|
|
133
|
-
return "success";
|
|
134
|
-
}
|
|
135
|
-
return "neutral";
|
|
136
|
-
}, [error, success]);
|
|
137
|
-
const computedClearable = clearable && tagInputState.length > 0;
|
|
138
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { className, gap: "0.5", children: [
|
|
139
|
-
label || labelDescription ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { htmlFor: id ?? localId, labelDescription, required, size, children: label }) : null,
|
|
140
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(index$2.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className ? `${className} ` : ""}${styles_css.tagInputContainer({
|
|
141
|
-
size
|
|
142
|
-
})}`, "data-disabled": disabled, "data-error": !!error, "data-readonly": readOnly, "data-success": !!success, "data-testid": dataTestId, onClick: handleContainerClick, onKeyDown: (event) => {
|
|
143
|
-
if ([" ", "Enter"].includes(event.key)) {
|
|
144
|
-
handleContainerClick();
|
|
145
|
-
}
|
|
146
|
-
}, children: [
|
|
147
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_css.tagInputDataContainer, children: [
|
|
148
|
-
tagInputState.map((tag) => /* @__PURE__ */ jsxRuntime.jsx(index$3.Tag, { disabled, isLoading: status[tag.index] === STATUS.LOADING, onClose: !readOnly ? (e) => {
|
|
149
|
-
e.stopPropagation();
|
|
150
|
-
deleteTag(tag.index);
|
|
151
|
-
} : void 0, sentiment: "neutral", children: tag.label }, tag.index)),
|
|
152
|
-
!disabled ? /* @__PURE__ */ jsxRuntime.jsx("input", { "aria-label": ariaLabel, className: styles_css.tagInput, "data-size": size, id: localId, name, onBlur: addTag, onChange: onInputChange, onKeyDown: handleInputKeydown, placeholder: tagInputState.length === 0 ? placeholder : "", readOnly, ref: inputRef, style, type: "text", value: input }) : null
|
|
153
|
-
] }),
|
|
154
|
-
computedClearable || success || error ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_css.tagInputStateContainer, children: [
|
|
155
|
-
computedClearable ? /* @__PURE__ */ jsxRuntime.jsx(index$4.Button, { "aria-label": "clear value", disabled, onClick: clearAll, sentiment: "neutral", size: "xsmall", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) }) : null,
|
|
156
|
-
success ? /* @__PURE__ */ jsxRuntime.jsx(Icon.CheckCircleOutlineIcon, { disabled, sentiment: "success", size: "small" }) : null,
|
|
157
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.AlertCircleIcon, { disabled, sentiment: "danger", size: "small" }) : null
|
|
158
|
-
] }) : null
|
|
159
|
-
] }) }) }),
|
|
160
|
-
error || typeof success === "string" || helper ? /* @__PURE__ */ jsxRuntime.jsx(index$5.Text, { as: "span", disabled: disabled || readOnly, prominence: !error && !success ? "weak" : void 0, sentiment: helperSentiment, variant: "caption", children: error || success || helper }) : null
|
|
161
|
-
] });
|
|
162
|
-
};
|
|
163
|
-
exports.TagInput = TagInput;
|
|
@@ -1,12 +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 tagInputContainer = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_sjgcm20", variantClassNames: { size: { large: "uv_sjgcm21", small: "uv_sjgcm22", medium: "uv_sjgcm23" } }, defaultVariants: { size: "large" }, compoundVariants: [] });
|
|
6
|
-
var tagInputDataContainer = "uv_sjgcm24";
|
|
7
|
-
var tagInputStateContainer = "uv_sjgcm25";
|
|
8
|
-
var tagInput = "uv_sjgcm26";
|
|
9
|
-
exports.tagInput = tagInput;
|
|
10
|
-
exports.tagInputContainer = tagInputContainer;
|
|
11
|
-
exports.tagInputDataContainer = tagInputDataContainer;
|
|
12
|
-
exports.tagInputStateContainer = tagInputStateContainer;
|
|
@@ -1,163 +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("../Popover/index.cjs");
|
|
8
|
-
const index$1 = require("../Tag/index.cjs");
|
|
9
|
-
const constant = require("./constant.cjs");
|
|
10
|
-
const styles_css = require("./styles.css.cjs");
|
|
11
|
-
const DEFAULT_POPOVER_MAX_HEIGHT = "16rem";
|
|
12
|
-
const DEFAULT_TAGS = [];
|
|
13
|
-
const getTagLabel = (tag) => typeof tag === "object" ? tag.label : tag;
|
|
14
|
-
const TagList = ({
|
|
15
|
-
maxLength = 600,
|
|
16
|
-
tags = DEFAULT_TAGS,
|
|
17
|
-
threshold = 1,
|
|
18
|
-
multiline = false,
|
|
19
|
-
popoverTitle,
|
|
20
|
-
popoverPlacement,
|
|
21
|
-
popoverMaxHeight = DEFAULT_POPOVER_MAX_HEIGHT,
|
|
22
|
-
copiable,
|
|
23
|
-
copyText,
|
|
24
|
-
copiedText,
|
|
25
|
-
className,
|
|
26
|
-
"data-testid": dataTestId,
|
|
27
|
-
style
|
|
28
|
-
}) => {
|
|
29
|
-
const containerRef = react.useRef(null);
|
|
30
|
-
const measureRef = react.useRef(null);
|
|
31
|
-
const popoverTriggerRef = react.useRef(null);
|
|
32
|
-
const [isReady, setIsReady] = react.useState(false);
|
|
33
|
-
const [isPopoverVisible, setIsPopoverVisible] = react.useState(false);
|
|
34
|
-
const [popoverTriggerWidth, setPopoverTriggerWidth] = react.useState(0);
|
|
35
|
-
const [visibleTags, setVisibleTags] = react.useState([]);
|
|
36
|
-
const [hiddenTags, setHiddenTags] = react.useState([]);
|
|
37
|
-
const memoizedResult = react.useMemo(() => {
|
|
38
|
-
let tmpThreshold2 = threshold;
|
|
39
|
-
while (tmpThreshold2 > 1 && tags.length > 0 && tags.slice(0, tmpThreshold2).reduce((acc, tag) => acc + getTagLabel(tag), "").length > maxLength) {
|
|
40
|
-
tmpThreshold2 -= 1;
|
|
41
|
-
}
|
|
42
|
-
const potentiallyVisibleTagsLength = Math.max(1, tags.length > tmpThreshold2 || false ? tmpThreshold2 : tags.length);
|
|
43
|
-
const potentiallyVisibleTags2 = tags.slice(0, potentiallyVisibleTagsLength);
|
|
44
|
-
const surelyHiddenTags2 = tags.slice(potentiallyVisibleTagsLength);
|
|
45
|
-
return {
|
|
46
|
-
potentiallyVisibleTags: potentiallyVisibleTags2,
|
|
47
|
-
surelyHiddenTags: surelyHiddenTags2,
|
|
48
|
-
tmpThreshold: tmpThreshold2
|
|
49
|
-
};
|
|
50
|
-
}, [maxLength, tags, threshold]);
|
|
51
|
-
const {
|
|
52
|
-
tmpThreshold,
|
|
53
|
-
potentiallyVisibleTags,
|
|
54
|
-
surelyHiddenTags
|
|
55
|
-
} = memoizedResult;
|
|
56
|
-
react.useEffect(() => {
|
|
57
|
-
if (tags.length === 0 || !containerRef.current || !measureRef.current) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (multiline) {
|
|
61
|
-
setVisibleTags(potentiallyVisibleTags);
|
|
62
|
-
setHiddenTags(surelyHiddenTags);
|
|
63
|
-
setIsReady(true);
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const parentWidth = containerRef.current.parentElement?.offsetWidth || 0;
|
|
67
|
-
const toMeasureElements = measureRef.current.children[0].children;
|
|
68
|
-
const [firstTag, ...restOfToMeasureElements] = [...toMeasureElements];
|
|
69
|
-
const {
|
|
70
|
-
measuredVisibleTags,
|
|
71
|
-
measuredHiddenTags
|
|
72
|
-
} = restOfToMeasureElements.reduce((accumulator, currentValue, index2) => {
|
|
73
|
-
const newAccumulatedWidth = accumulator.accumulatedWidth + currentValue.offsetWidth + Number.parseInt(constant.TAGS_GAP, 10);
|
|
74
|
-
return {
|
|
75
|
-
accumulatedWidth: newAccumulatedWidth,
|
|
76
|
-
measuredHiddenTags: [...accumulator.measuredHiddenTags, newAccumulatedWidth > parentWidth && tags[index2 + 1]].filter(Boolean),
|
|
77
|
-
measuredVisibleTags: [...accumulator.measuredVisibleTags, newAccumulatedWidth <= parentWidth && tags[index2 + 1]].filter(Boolean)
|
|
78
|
-
};
|
|
79
|
-
}, {
|
|
80
|
-
accumulatedWidth: firstTag.offsetWidth + Number.parseInt(constant.TAGS_GAP, 10),
|
|
81
|
-
measuredHiddenTags: [],
|
|
82
|
-
measuredVisibleTags: [tags[0]]
|
|
83
|
-
// we need to always show one tag
|
|
84
|
-
});
|
|
85
|
-
const finalHiddenTags = [...measuredHiddenTags, ...surelyHiddenTags];
|
|
86
|
-
setVisibleTags(measuredVisibleTags);
|
|
87
|
-
setHiddenTags(finalHiddenTags);
|
|
88
|
-
if (finalHiddenTags.length === 0) {
|
|
89
|
-
setIsReady(true);
|
|
90
|
-
}
|
|
91
|
-
}, [multiline, potentiallyVisibleTags, surelyHiddenTags, tags, threshold, tmpThreshold]);
|
|
92
|
-
react.useEffect(() => {
|
|
93
|
-
if (!isReady && popoverTriggerRef.current?.offsetWidth) {
|
|
94
|
-
const newPopoverTriggerWidth = popoverTriggerRef.current.offsetWidth;
|
|
95
|
-
setPopoverTriggerWidth(newPopoverTriggerWidth);
|
|
96
|
-
const tagsContainer = containerRef.current;
|
|
97
|
-
const tagsContainerWidth = containerRef.current?.offsetWidth || 0;
|
|
98
|
-
const parentWidth = tagsContainer?.parentElement?.offsetWidth || 0;
|
|
99
|
-
if (visibleTags.length > 1 && hiddenTags.length > 0 && tagsContainerWidth + newPopoverTriggerWidth > parentWidth) {
|
|
100
|
-
const visibleTagsCopy = visibleTags.filter((_, index2) => index2 < visibleTags.length - 1);
|
|
101
|
-
const tagToMove = visibleTags[visibleTags.length - 1];
|
|
102
|
-
setVisibleTags(visibleTagsCopy);
|
|
103
|
-
setHiddenTags([tagToMove, ...hiddenTags]);
|
|
104
|
-
}
|
|
105
|
-
setIsReady(true);
|
|
106
|
-
}
|
|
107
|
-
}, [hiddenTags, isReady, threshold, visibleTags, visibleTags.length]);
|
|
108
|
-
react.useEffect(() => {
|
|
109
|
-
if (isReady && measureRef.current?.parentNode) {
|
|
110
|
-
measureRef.current.remove();
|
|
111
|
-
}
|
|
112
|
-
}, [isReady]);
|
|
113
|
-
if (tags.length === 0) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
const renderTag = (tag, index2, isEllipsis = false) => typeof tag !== "string" && tag.icon ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
117
|
-
index$1.Tag,
|
|
118
|
-
{
|
|
119
|
-
className: isEllipsis ? "ellipsed" : "",
|
|
120
|
-
copiable,
|
|
121
|
-
copiedText,
|
|
122
|
-
copyText,
|
|
123
|
-
children: [
|
|
124
|
-
tag.icon,
|
|
125
|
-
getTagLabel(tag)
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
`${getTagLabel(tag)}-${index2}`
|
|
129
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(index$1.Tag, { className: isEllipsis ? "ellipsed" : "", copiable, copiedText, copyText, children: getTagLabel(tag) }, `${getTagLabel(tag)}-${index2}`);
|
|
130
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${className ? `${className} ` : ""}${styles_css.tagListContainer}`, "data-testid": dataTestId, style: {
|
|
131
|
-
visibility: isReady ? "visible" : "hidden",
|
|
132
|
-
...style
|
|
133
|
-
}, children: [
|
|
134
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles_css.tagContainer({
|
|
135
|
-
multiline
|
|
136
|
-
})} ${visibleTags.length === 1 && hiddenTags.length === 0 || popoverTriggerWidth ? styles_css.ellipsisContainer : ""}`, "data-testid": `${dataTestId ?? "taglist"}-container`, ref: containerRef, style: dynamic.assignInlineVars({
|
|
137
|
-
[styles_css.popoverTriggerWidthVar]: `${popoverTriggerWidth || 0}px`
|
|
138
|
-
}), children: visibleTags.map((tag, index2) => renderTag(
|
|
139
|
-
tag,
|
|
140
|
-
index2,
|
|
141
|
-
// add ellipsis to last tag
|
|
142
|
-
index2 === visibleTags.length - 1
|
|
143
|
-
)) }),
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: measureRef, style: {
|
|
145
|
-
position: "absolute",
|
|
146
|
-
visibility: "hidden",
|
|
147
|
-
whiteSpace: "nowrap"
|
|
148
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.tagContainer({
|
|
149
|
-
multiline
|
|
150
|
-
}), "data-testid": `${dataTestId ?? "taglist"}-measure-container`, children: potentiallyVisibleTags.map((tag, index2) => renderTag(tag, index2)) }) }),
|
|
151
|
-
hiddenTags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(index.Popover, { content: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_css.tagContainer({
|
|
152
|
-
multiline: true
|
|
153
|
-
}), children: hiddenTags.map((tag, index2) => renderTag(tag, index2)) }), maxHeight: popoverMaxHeight, onClose: () => setIsPopoverVisible(false), placement: popoverPlacement, size: "small", title: popoverTitle, visible: isPopoverVisible, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_css.tagsWrapper, "data-testid": `${dataTestId ?? "taglist"}-open`, onClick: () => setIsPopoverVisible(true), onKeyDown: (event) => {
|
|
154
|
-
if ([" ", "Enter"].includes(event.key)) {
|
|
155
|
-
setIsPopoverVisible(true);
|
|
156
|
-
}
|
|
157
|
-
}, ref: popoverTriggerRef, tabIndex: 0, children: [
|
|
158
|
-
"+",
|
|
159
|
-
hiddenTags.length
|
|
160
|
-
] }) })
|
|
161
|
-
] });
|
|
162
|
-
};
|
|
163
|
-
exports.TagList = TagList;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
const createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
|
|
5
|
-
var popoverTriggerWidthVar = "var(--uv_1f9zr5y0)";
|
|
6
|
-
var tagListContainer = "uv_1f9zr5y1";
|
|
7
|
-
var tagContainer = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_1f9zr5y2", variantClassNames: { multiline: { true: "uv_1f9zr5y3" } }, defaultVariants: {}, compoundVariants: [] });
|
|
8
|
-
var ellipsisContainer = "uv_1f9zr5y4";
|
|
9
|
-
var tagsWrapper = "uv_1f9zr5y5";
|
|
10
|
-
exports.ellipsisContainer = ellipsisContainer;
|
|
11
|
-
exports.popoverTriggerWidthVar = popoverTriggerWidthVar;
|
|
12
|
-
exports.tagContainer = tagContainer;
|
|
13
|
-
exports.tagListContainer = tagListContainer;
|
|
14
|
-
exports.tagsWrapper = tagsWrapper;
|
|
@@ -1,53 +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 recursivelyGetChildrenString = require("../../helpers/recursivelyGetChildrenString.cjs");
|
|
8
|
-
const useIsOverflowing = require("../../hooks/useIsOverflowing.cjs");
|
|
9
|
-
const index = require("../Tooltip/index.cjs");
|
|
10
|
-
const style_css = require("./style.css.cjs");
|
|
11
|
-
const variables_css = require("./variables.css.cjs");
|
|
12
|
-
const Text = ({
|
|
13
|
-
variant,
|
|
14
|
-
children,
|
|
15
|
-
as: Component = "div",
|
|
16
|
-
sentiment,
|
|
17
|
-
oneLine = false,
|
|
18
|
-
placement,
|
|
19
|
-
prominence = "default",
|
|
20
|
-
className,
|
|
21
|
-
disabled = false,
|
|
22
|
-
italic = false,
|
|
23
|
-
underline = false,
|
|
24
|
-
strikeThrough = false,
|
|
25
|
-
id,
|
|
26
|
-
dir,
|
|
27
|
-
whiteSpace,
|
|
28
|
-
htmlFor,
|
|
29
|
-
"data-testid": dataTestId,
|
|
30
|
-
"aria-hidden": ariaHidden,
|
|
31
|
-
style
|
|
32
|
-
}) => {
|
|
33
|
-
const elementRef = react.useRef(null);
|
|
34
|
-
const isOverflowing = useIsOverflowing.useIsOverflowing(elementRef);
|
|
35
|
-
const finalStringChildren = recursivelyGetChildrenString(children);
|
|
36
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Tooltip, { text: oneLine && isOverflowing ? finalStringChildren : "", children: /* @__PURE__ */ jsxRuntime.jsx(Component, { "aria-hidden": ariaHidden, className: `${className ? `${className} ` : ""}${style_css.text({
|
|
37
|
-
disabled,
|
|
38
|
-
italic,
|
|
39
|
-
oneLine,
|
|
40
|
-
prominence,
|
|
41
|
-
sentiment,
|
|
42
|
-
strikeThrough,
|
|
43
|
-
underline,
|
|
44
|
-
variant
|
|
45
|
-
})}`, "data-testid": dataTestId, dir, htmlFor, id, ref: elementRef, style: {
|
|
46
|
-
...dynamic.assignInlineVars({
|
|
47
|
-
[variables_css.placementText]: placement,
|
|
48
|
-
[variables_css.whiteSpaceText]: whiteSpace
|
|
49
|
-
}),
|
|
50
|
-
...style
|
|
51
|
-
}, children }) });
|
|
52
|
-
};
|
|
53
|
-
exports.Text = Text;
|
|
@@ -1,6 +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 text = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_m4c9ow0", variantClassNames: { strikeThrough: { true: "uv_m4c9ow1", false: "uv_m4c9ow2" }, italic: { true: "uv_m4c9ow3", false: "uv_m4c9ow4" }, underline: { true: "uv_m4c9ow5", false: "uv_m4c9ow6" }, oneLine: { true: "uv_m4c9ow7", false: "uv_m4c9ow8" }, sentiment: { primary: "uv_m4c9ow9", secondary: "uv_m4c9owa", neutral: "uv_m4c9owb", success: "uv_m4c9owc", danger: "uv_m4c9owd", warning: "uv_m4c9owe", info: "uv_m4c9owf", black: "uv_m4c9owg", white: "uv_m4c9owh" }, prominence: { "default": "uv_m4c9owi", strong: "uv_m4c9owj", stronger: "uv_m4c9owk", weak: "uv_m4c9owl" }, variant: { body: "uv_m4c9owm", bodySmall: "uv_m4c9own", bodySmallStrong: "uv_m4c9owo", bodySmallStronger: "uv_m4c9owp", bodyStrong: "uv_m4c9owq", bodyStronger: "uv_m4c9owr", caption: "uv_m4c9ows", captionSmall: "uv_m4c9owt", captionSmallStrong: "uv_m4c9owu", captionSmallStronger: "uv_m4c9owv", captionStrong: "uv_m4c9oww", captionStronger: "uv_m4c9owx", code: "uv_m4c9owy", codeStrong: "uv_m4c9owz", codeStronger: "uv_m4c9ow10", heading: "uv_m4c9ow11", headingLarge: "uv_m4c9ow12", headingLargeStrong: "uv_m4c9ow13", headingLargeStronger: "uv_m4c9ow14", headingSmall: "uv_m4c9ow15", headingSmallStrong: "uv_m4c9ow16", headingSmallStronger: "uv_m4c9ow17", headingStrong: "uv_m4c9ow18", headingStronger: "uv_m4c9ow19" }, disabled: { true: "uv_m4c9ow1a", false: "uv_m4c9ow1b" } }, defaultVariants: { strikeThrough: false, italic: false, underline: false, oneLine: false, sentiment: void 0, prominence: "default", variant: "body", disabled: false }, compoundVariants: [[{ sentiment: "primary", prominence: "default", disabled: false }, "uv_m4c9ow1c"], [{ sentiment: "primary", prominence: "strong", disabled: false }, "uv_m4c9ow1d"], [{ sentiment: "primary", prominence: "stronger", disabled: false }, "uv_m4c9ow1e"], [{ sentiment: "primary", prominence: "weak", disabled: false }, "uv_m4c9ow1f"], [{ sentiment: "secondary", prominence: "default", disabled: false }, "uv_m4c9ow1g"], [{ sentiment: "secondary", prominence: "strong", disabled: false }, "uv_m4c9ow1h"], [{ sentiment: "secondary", prominence: "stronger", disabled: false }, "uv_m4c9ow1i"], [{ sentiment: "secondary", prominence: "weak", disabled: false }, "uv_m4c9ow1j"], [{ sentiment: "danger", prominence: "default", disabled: false }, "uv_m4c9ow1k"], [{ sentiment: "danger", prominence: "strong", disabled: false }, "uv_m4c9ow1l"], [{ sentiment: "danger", prominence: "stronger", disabled: false }, "uv_m4c9ow1m"], [{ sentiment: "danger", prominence: "weak", disabled: false }, "uv_m4c9ow1n"], [{ sentiment: "info", prominence: "default", disabled: false }, "uv_m4c9ow1o"], [{ sentiment: "info", prominence: "strong", disabled: false }, "uv_m4c9ow1p"], [{ sentiment: "info", prominence: "stronger", disabled: false }, "uv_m4c9ow1q"], [{ sentiment: "info", prominence: "weak", disabled: false }, "uv_m4c9ow1r"], [{ sentiment: "success", prominence: "default", disabled: false }, "uv_m4c9ow1s"], [{ sentiment: "success", prominence: "strong", disabled: false }, "uv_m4c9ow1t"], [{ sentiment: "success", prominence: "stronger", disabled: false }, "uv_m4c9ow1u"], [{ sentiment: "success", prominence: "weak", disabled: false }, "uv_m4c9ow1v"], [{ sentiment: "warning", prominence: "default", disabled: false }, "uv_m4c9ow1w"], [{ sentiment: "warning", prominence: "strong", disabled: false }, "uv_m4c9ow1x"], [{ sentiment: "warning", prominence: "stronger", disabled: false }, "uv_m4c9ow1y"], [{ sentiment: "warning", prominence: "weak", disabled: false }, "uv_m4c9ow1z"], [{ sentiment: "neutral", prominence: "default", disabled: false }, "uv_m4c9ow20"], [{ sentiment: "neutral", prominence: "strong", disabled: false }, "uv_m4c9ow21"], [{ sentiment: "neutral", prominence: "stronger", disabled: false }, "uv_m4c9ow22"], [{ sentiment: "neutral", prominence: "weak", disabled: false }, "uv_m4c9ow23"], [{ sentiment: "black", prominence: "default", disabled: false }, "uv_m4c9ow24"], [{ sentiment: "black", prominence: "strong", disabled: false }, "uv_m4c9ow25"], [{ sentiment: "black", prominence: "stronger", disabled: false }, "uv_m4c9ow26"], [{ sentiment: "black", prominence: "weak", disabled: false }, "uv_m4c9ow27"], [{ sentiment: "white", prominence: "default", disabled: false }, "uv_m4c9ow28"], [{ sentiment: "white", prominence: "strong", disabled: false }, "uv_m4c9ow29"], [{ sentiment: "white", prominence: "stronger", disabled: false }, "uv_m4c9ow2a"], [{ sentiment: "white", prominence: "weak", disabled: false }, "uv_m4c9ow2b"], [{ sentiment: "primary", prominence: "default", disabled: true }, "uv_m4c9ow2c"], [{ sentiment: "primary", prominence: "strong", disabled: true }, "uv_m4c9ow2d"], [{ sentiment: "primary", prominence: "stronger", disabled: true }, "uv_m4c9ow2e"], [{ sentiment: "primary", prominence: "weak", disabled: true }, "uv_m4c9ow2f"], [{ sentiment: "secondary", prominence: "default", disabled: true }, "uv_m4c9ow2g"], [{ sentiment: "secondary", prominence: "strong", disabled: true }, "uv_m4c9ow2h"], [{ sentiment: "secondary", prominence: "stronger", disabled: true }, "uv_m4c9ow2i"], [{ sentiment: "secondary", prominence: "weak", disabled: true }, "uv_m4c9ow2j"], [{ sentiment: "danger", prominence: "default", disabled: true }, "uv_m4c9ow2k"], [{ sentiment: "danger", prominence: "strong", disabled: true }, "uv_m4c9ow2l"], [{ sentiment: "danger", prominence: "stronger", disabled: true }, "uv_m4c9ow2m"], [{ sentiment: "danger", prominence: "weak", disabled: true }, "uv_m4c9ow2n"], [{ sentiment: "info", prominence: "default", disabled: true }, "uv_m4c9ow2o"], [{ sentiment: "info", prominence: "strong", disabled: true }, "uv_m4c9ow2p"], [{ sentiment: "info", prominence: "stronger", disabled: true }, "uv_m4c9ow2q"], [{ sentiment: "info", prominence: "weak", disabled: true }, "uv_m4c9ow2r"], [{ sentiment: "success", prominence: "default", disabled: true }, "uv_m4c9ow2s"], [{ sentiment: "success", prominence: "strong", disabled: true }, "uv_m4c9ow2t"], [{ sentiment: "success", prominence: "stronger", disabled: true }, "uv_m4c9ow2u"], [{ sentiment: "success", prominence: "weak", disabled: true }, "uv_m4c9ow2v"], [{ sentiment: "warning", prominence: "default", disabled: true }, "uv_m4c9ow2w"], [{ sentiment: "warning", prominence: "strong", disabled: true }, "uv_m4c9ow2x"], [{ sentiment: "warning", prominence: "stronger", disabled: true }, "uv_m4c9ow2y"], [{ sentiment: "warning", prominence: "weak", disabled: true }, "uv_m4c9ow2z"], [{ sentiment: "neutral", prominence: "default", disabled: true }, "uv_m4c9ow30"], [{ sentiment: "neutral", prominence: "strong", disabled: true }, "uv_m4c9ow31"], [{ sentiment: "neutral", prominence: "stronger", disabled: true }, "uv_m4c9ow32"], [{ sentiment: "neutral", prominence: "weak", disabled: true }, "uv_m4c9ow33"], [{ sentiment: "black", prominence: "default", disabled: true }, "uv_m4c9ow34"], [{ sentiment: "black", prominence: "strong", disabled: true }, "uv_m4c9ow35"], [{ sentiment: "black", prominence: "stronger", disabled: true }, "uv_m4c9ow36"], [{ sentiment: "black", prominence: "weak", disabled: true }, "uv_m4c9ow37"], [{ sentiment: "white", prominence: "default", disabled: true }, "uv_m4c9ow38"], [{ sentiment: "white", prominence: "strong", disabled: true }, "uv_m4c9ow39"], [{ sentiment: "white", prominence: "stronger", disabled: true }, "uv_m4c9ow3a"], [{ sentiment: "white", prominence: "weak", disabled: true }, "uv_m4c9ow3b"], [{ prominence: "default", disabled: false }, "uv_m4c9ow3c"], [{ prominence: "strong", disabled: false }, "uv_m4c9ow3d"], [{ prominence: "stronger", disabled: false }, "uv_m4c9ow3e"], [{ prominence: "weak", disabled: false }, "uv_m4c9ow3f"]] });
|
|
6
|
-
exports.text = text;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
var placementText = "var(--uv_qabug40)";
|
|
5
|
-
var whiteSpaceText = "var(--uv_qabug41)";
|
|
6
|
-
exports.placementText = placementText;
|
|
7
|
-
exports.whiteSpaceText = whiteSpaceText;
|
|
@@ -1,123 +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 themes = require("@ultraviolet/themes");
|
|
7
|
-
const dynamic = require("@vanilla-extract/dynamic");
|
|
8
|
-
const react = require("react");
|
|
9
|
-
const index$3 = require("../Button/index.cjs");
|
|
10
|
-
const constants = require("../Button/constants.cjs");
|
|
11
|
-
const index$1 = require("../Label/index.cjs");
|
|
12
|
-
const index$4 = require("../Row/index.cjs");
|
|
13
|
-
const index = require("../Stack/index.cjs");
|
|
14
|
-
const index$5 = require("../Text/index.cjs");
|
|
15
|
-
const index$2 = require("../Tooltip/index.cjs");
|
|
16
|
-
const styles_css = require("./styles.css.cjs");
|
|
17
|
-
const STATE_ICON_SIZE = "small";
|
|
18
|
-
const TextArea = react.forwardRef(({
|
|
19
|
-
id,
|
|
20
|
-
className,
|
|
21
|
-
tabIndex,
|
|
22
|
-
value,
|
|
23
|
-
onChange,
|
|
24
|
-
placeholder,
|
|
25
|
-
rows = 3,
|
|
26
|
-
maxRows,
|
|
27
|
-
disabled = false,
|
|
28
|
-
readOnly = false,
|
|
29
|
-
success,
|
|
30
|
-
error,
|
|
31
|
-
helper,
|
|
32
|
-
minLength,
|
|
33
|
-
maxLength,
|
|
34
|
-
tooltip,
|
|
35
|
-
label,
|
|
36
|
-
autoFocus,
|
|
37
|
-
required = false,
|
|
38
|
-
"data-testid": dataTestId,
|
|
39
|
-
name,
|
|
40
|
-
onFocus,
|
|
41
|
-
onBlur,
|
|
42
|
-
onKeyDown,
|
|
43
|
-
clearable = false,
|
|
44
|
-
labelDescription,
|
|
45
|
-
"aria-label": ariaLabel,
|
|
46
|
-
style
|
|
47
|
-
}, ref) => {
|
|
48
|
-
const localId = react.useId();
|
|
49
|
-
const theme = themes.useTheme();
|
|
50
|
-
const textAreaRef = react.useRef(null);
|
|
51
|
-
react.useImperativeHandle(ref, () => textAreaRef.current);
|
|
52
|
-
react.useEffect(() => {
|
|
53
|
-
const textArea = textAreaRef.current;
|
|
54
|
-
const padding = theme.space["1.5"];
|
|
55
|
-
if (!textArea) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const updateHeight = () => {
|
|
59
|
-
if (textArea && rows === "auto" && !maxRows) {
|
|
60
|
-
textArea.style.height = "auto";
|
|
61
|
-
textArea.style.resize = "none";
|
|
62
|
-
textArea.style.height = `${textArea.scrollHeight + 2}px`;
|
|
63
|
-
} else if (textArea && maxRows) {
|
|
64
|
-
const lineHeight = Number.parseFloat(getComputedStyle(textArea).lineHeight);
|
|
65
|
-
textArea.style.height = "auto";
|
|
66
|
-
const maxHeight = maxRows * lineHeight;
|
|
67
|
-
textArea.style.height = `${textArea.scrollHeight + 2}px`;
|
|
68
|
-
textArea.style.maxHeight = `calc(${maxHeight}px + 2*${padding})`;
|
|
69
|
-
if (typeof rows === "number") {
|
|
70
|
-
const minHeight = rows * lineHeight;
|
|
71
|
-
textArea.style.minHeight = `calc(${minHeight}px + 2*${padding})`;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
requestAnimationFrame(updateHeight);
|
|
76
|
-
}, [value, rows, theme, maxRows, textAreaRef.current?.value]);
|
|
77
|
-
const sentiment = react.useMemo(() => {
|
|
78
|
-
if (error) {
|
|
79
|
-
return "danger";
|
|
80
|
-
}
|
|
81
|
-
if (success) {
|
|
82
|
-
return "success";
|
|
83
|
-
}
|
|
84
|
-
return "neutral";
|
|
85
|
-
}, [error, success]);
|
|
86
|
-
const notice = success || error || helper;
|
|
87
|
-
const computedClearable = clearable && !!value;
|
|
88
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { className, gap: "0.5", children: [
|
|
89
|
-
label || labelDescription ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { htmlFor: id ?? localId, labelDescription, required, children: label }) : null,
|
|
90
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$2.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_css.textareaWrapper, children: [
|
|
91
|
-
/* @__PURE__ */ jsxRuntime.jsx("textarea", { "aria-invalid": !!error, "aria-label": ariaLabel, autoFocus, className: styles_css.textArea({
|
|
92
|
-
error: !!error,
|
|
93
|
-
success: !!success
|
|
94
|
-
}), "data-testid": dataTestId, disabled, id: id ?? localId, maxLength, minLength, name, onBlur, onChange: (event) => {
|
|
95
|
-
onChange(event.currentTarget.value);
|
|
96
|
-
}, onFocus, onKeyDown, placeholder, readOnly: !!readOnly, ref: textAreaRef, rows: rows !== "auto" ? rows : 1, style: {
|
|
97
|
-
...dynamic.assignInlineVars({
|
|
98
|
-
[styles_css.paddingRightVar]: `calc(${theme.space[computedClearable && (!!success || !!error) ? "4" : "3"]} + ${computedClearable ? `${constants.SIZE_HEIGHT.xsmall}px` : "0px"} + ${!!success || !!error ? `${STATE_ICON_SIZE}px` : "0px"})`
|
|
99
|
-
}),
|
|
100
|
-
...style
|
|
101
|
-
}, tabIndex, value }),
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "center", className: styles_css.textAreaClearableContainer, direction: "row", gap: "1", children: [
|
|
103
|
-
computedClearable ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Button, { "aria-label": "clear value", onClick: () => {
|
|
104
|
-
onChange("");
|
|
105
|
-
}, sentiment: "neutral", size: "xsmall", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) }) : null,
|
|
106
|
-
success && !error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.CheckCircleIcon, { sentiment: "success", size: STATE_ICON_SIZE }) : null,
|
|
107
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.AlertCircleIcon, { sentiment: "danger" }) : null
|
|
108
|
-
] })
|
|
109
|
-
] }) }),
|
|
110
|
-
notice || maxLength ? /* @__PURE__ */ jsxRuntime.jsxs(index$4.Row, { gap: "1", templateColumns: "minmax(0, 1fr) min-content", children: [
|
|
111
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
112
|
-
error || success || typeof helper === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$5.Text, { as: "p", disabled, prominence: !error && !success ? "weak" : "default", sentiment, variant: "caption", children: error || success || helper }) : null,
|
|
113
|
-
!error && !success && typeof helper !== "string" && helper ? helper : null
|
|
114
|
-
] }),
|
|
115
|
-
maxLength ? /* @__PURE__ */ jsxRuntime.jsxs(index$5.Text, { as: "div", prominence: "weak", sentiment: "neutral", variant: "caption", children: [
|
|
116
|
-
value?.length ?? 0,
|
|
117
|
-
"/",
|
|
118
|
-
maxLength
|
|
119
|
-
] }) : null
|
|
120
|
-
] }) : null
|
|
121
|
-
] });
|
|
122
|
-
});
|
|
123
|
-
exports.TextArea = TextArea;
|