@ultraviolet/ui 3.0.0-beta.26 → 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/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/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/styles.css.js +1 -0
- package/dist/components/Popup/variables.css.js +0 -1
- 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 +5 -4
- package/dist/components/ActionBar/index.cjs +0 -22
- package/dist/components/ActionBar/styles.css.cjs +0 -11
- 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 -17
- 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 -291
- package/dist/components/Popup/styles.css.cjs +0 -12
- package/dist/components/Popup/variables.css.cjs +0 -19
- 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,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 paddingRightVar = "var(--uv_hlf4vn0)";
|
|
6
|
-
var textareaWrapper = "uv_hlf4vn1";
|
|
7
|
-
var textAreaClearableContainer = "uv_hlf4vn2";
|
|
8
|
-
var textArea = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_hlf4vn3", variantClassNames: { success: { true: "uv_hlf4vn4" }, error: { true: "uv_hlf4vn5" } }, defaultVariants: { success: false, error: false }, compoundVariants: [] });
|
|
9
|
-
exports.paddingRightVar = paddingRightVar;
|
|
10
|
-
exports.textArea = textArea;
|
|
11
|
-
exports.textAreaClearableContainer = textAreaClearableContainer;
|
|
12
|
-
exports.textareaWrapper = textareaWrapper;
|
|
@@ -1,119 +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$5 = require("../Loader/index.cjs");
|
|
10
|
-
const index = require("../Stack/index.cjs");
|
|
11
|
-
const index$3 = require("../Text/index.cjs");
|
|
12
|
-
const index$2 = require("../Tooltip/index.cjs");
|
|
13
|
-
const styles_css = require("./styles.css.cjs");
|
|
14
|
-
const TextInput = react.forwardRef(({
|
|
15
|
-
id,
|
|
16
|
-
className,
|
|
17
|
-
tabIndex,
|
|
18
|
-
value,
|
|
19
|
-
onChange,
|
|
20
|
-
onChangeValue,
|
|
21
|
-
placeholder,
|
|
22
|
-
disabled = false,
|
|
23
|
-
readOnly = false,
|
|
24
|
-
success,
|
|
25
|
-
error,
|
|
26
|
-
helper,
|
|
27
|
-
tooltip,
|
|
28
|
-
label,
|
|
29
|
-
autoFocus,
|
|
30
|
-
required = false,
|
|
31
|
-
"data-testid": dataTestId,
|
|
32
|
-
name,
|
|
33
|
-
onFocus,
|
|
34
|
-
onBlur,
|
|
35
|
-
clearable = false,
|
|
36
|
-
labelDescription,
|
|
37
|
-
type = "text",
|
|
38
|
-
prefix,
|
|
39
|
-
suffix,
|
|
40
|
-
size = "large",
|
|
41
|
-
loading,
|
|
42
|
-
onRandomize,
|
|
43
|
-
minLength,
|
|
44
|
-
maxLength,
|
|
45
|
-
"aria-labelledby": ariaLabelledBy,
|
|
46
|
-
"aria-label": ariaLabel,
|
|
47
|
-
autoComplete,
|
|
48
|
-
onKeyDown,
|
|
49
|
-
onKeyUp,
|
|
50
|
-
role,
|
|
51
|
-
"aria-live": ariaLive,
|
|
52
|
-
"aria-atomic": ariaAtomic,
|
|
53
|
-
defaultValue,
|
|
54
|
-
style
|
|
55
|
-
}, ref) => {
|
|
56
|
-
const localId = react.useId();
|
|
57
|
-
const [hasFocus, setHasFocus] = react.useState(false);
|
|
58
|
-
const [localValue, setLocalValue] = react.useState(defaultValue);
|
|
59
|
-
const inputRef = react.useRef(null);
|
|
60
|
-
react.useImperativeHandle(ref, () => inputRef.current);
|
|
61
|
-
const [isPasswordVisible, setIsPasswordVisible] = react.useState(false);
|
|
62
|
-
const computedType = type === "password" && isPasswordVisible ? "text" : type;
|
|
63
|
-
const sentiment = react.useMemo(() => {
|
|
64
|
-
if (error) {
|
|
65
|
-
return "danger";
|
|
66
|
-
}
|
|
67
|
-
if (success) {
|
|
68
|
-
return "success";
|
|
69
|
-
}
|
|
70
|
-
return "neutral";
|
|
71
|
-
}, [error, success]);
|
|
72
|
-
const onChangeCallback = react.useCallback((event) => {
|
|
73
|
-
onChange?.(event);
|
|
74
|
-
onChangeValue?.(event.target.value);
|
|
75
|
-
setLocalValue(event.target.value);
|
|
76
|
-
}, [onChange, onChangeValue]);
|
|
77
|
-
const computedValue = value !== void 0 ? value : localValue;
|
|
78
|
-
const computedClearable = clearable && !!computedValue;
|
|
79
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { "aria-atomic": ariaAtomic, "aria-live": ariaLive, className, gap: 0.5, role, children: [
|
|
80
|
-
label || labelDescription ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { htmlFor: id ?? localId, id: ariaLabelledBy, labelDescription, required, size, children: label }) : null,
|
|
81
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(index$2.Tooltip, { text: tooltip, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles_css.inputWrapper} ${styles_css.inputWrapperSizes[size]}`, "data-disabled": disabled, "data-error": !!error, "data-has-focus": hasFocus, "data-readonly": readOnly, "data-success": !!success, children: [
|
|
82
|
-
prefix ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "center", className: styles_css.basicPrefix, "data-size": size, direction: "row", children: typeof prefix === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Text, { as: "span", disabled, sentiment: "neutral", variant: "bodySmall", children: prefix }) : prefix }) : null,
|
|
83
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { "aria-invalid": !!error, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, autoComplete, autoFocus, className: styles_css.inputClass, "data-size": size, "data-testid": dataTestId, defaultValue, disabled, id: id ?? localId, maxLength, minLength, name, onBlur: (event) => {
|
|
84
|
-
setHasFocus(false);
|
|
85
|
-
onBlur?.(event);
|
|
86
|
-
}, onChange: onChangeCallback, onFocus: (event) => {
|
|
87
|
-
setHasFocus(true);
|
|
88
|
-
onFocus?.(event);
|
|
89
|
-
}, onKeyDown, onKeyUp, placeholder, readOnly, ref: inputRef, required, style, tabIndex, type: computedType, value }),
|
|
90
|
-
success || error || loading || computedClearable ? /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "center", className: styles_css.stateStack, direction: "row", gap: 1, children: [
|
|
91
|
-
computedClearable ? /* @__PURE__ */ jsxRuntime.jsx(index$4.Button, { "aria-label": "clear value", disabled: disabled || !computedValue, onClick: () => {
|
|
92
|
-
if (inputRef?.current) {
|
|
93
|
-
inputRef.current.value = "";
|
|
94
|
-
setLocalValue("");
|
|
95
|
-
onChangeCallback({
|
|
96
|
-
currentTarget: {
|
|
97
|
-
value: ""
|
|
98
|
-
},
|
|
99
|
-
target: {
|
|
100
|
-
value: ""
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}, sentiment: "neutral", size: size === "small" ? "xsmall" : "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, { size: "small" }) }) : null,
|
|
105
|
-
success ? /* @__PURE__ */ jsxRuntime.jsx(Icon.CheckCircleIcon, { disabled, sentiment: "success", size: "small" }) : null,
|
|
106
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.AlertCircleIcon, { disabled, sentiment: "danger", size: "small" }) : null,
|
|
107
|
-
loading && !disabled ? /* @__PURE__ */ jsxRuntime.jsx(index$5.Loader, { active: true, size: "small" }) : null
|
|
108
|
-
] }) : null,
|
|
109
|
-
suffix ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "center", className: styles_css.basicSuffix, direction: "row", children: typeof suffix === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Text, { as: "span", disabled, sentiment: "neutral", variant: "bodySmall", children: suffix }) : suffix }) : null,
|
|
110
|
-
type === "password" ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "center", className: styles_css.ctaSuffix, direction: "row", children: /* @__PURE__ */ jsxRuntime.jsx(index$4.Button, { "aria-label": isPasswordVisible ? "hide" : "show", "data-testid": dataTestId ? `${dataTestId}-visibility-button` : void 0, disabled, onClick: () => {
|
|
111
|
-
setIsPasswordVisible(!isPasswordVisible);
|
|
112
|
-
}, sentiment: "neutral", size: size === "small" ? "xsmall" : "small", variant: "ghost", children: isPasswordVisible ? /* @__PURE__ */ jsxRuntime.jsx(Icon.EyeOffIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(Icon.EyeIcon, {}) }) }) : null,
|
|
113
|
-
onRandomize ? /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { alignItems: "center", className: styles_css.ctaSuffix, direction: "row", children: /* @__PURE__ */ jsxRuntime.jsx(index$4.Button, { disabled, onClick: onRandomize, sentiment: "neutral", size: size === "small" ? "xsmall" : "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.AutoFixIcon, {}) }) }) : null
|
|
114
|
-
] }) }) }),
|
|
115
|
-
error || typeof success === "string" || typeof helper === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Text, { as: "p", disabled, prominence: !error && !success ? "weak" : "default", sentiment, variant: "caption", children: error || success || helper }) : null,
|
|
116
|
-
!error && !success && typeof helper !== "string" && helper ? helper : null
|
|
117
|
-
] });
|
|
118
|
-
});
|
|
119
|
-
exports.TextInput = TextInput;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
;/* empty css */
|
|
4
|
-
var basicPrefix = "uv_q3q8041";
|
|
5
|
-
var stateStack = "uv_q3q8042";
|
|
6
|
-
var basicSuffix = "uv_q3q8043";
|
|
7
|
-
var ctaSuffix = "uv_q3q8044";
|
|
8
|
-
var inputClass = "uv_q3q8045";
|
|
9
|
-
var inputWrapperSizes = { large: "uv_q3q8046", medium: "uv_q3q8047", small: "uv_q3q8048" };
|
|
10
|
-
var inputWrapper = "uv_q3q8049";
|
|
11
|
-
exports.basicPrefix = basicPrefix;
|
|
12
|
-
exports.basicSuffix = basicSuffix;
|
|
13
|
-
exports.ctaSuffix = ctaSuffix;
|
|
14
|
-
exports.inputClass = inputClass;
|
|
15
|
-
exports.inputWrapper = inputWrapper;
|
|
16
|
-
exports.inputWrapperSizes = inputWrapperSizes;
|
|
17
|
-
exports.stateStack = stateStack;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const DEFAULT_PLACEHOLDER = {
|
|
4
|
-
h: "00",
|
|
5
|
-
m: "00",
|
|
6
|
-
s: "00"
|
|
7
|
-
};
|
|
8
|
-
const TIME_KEYS = ["h", "m", "s"];
|
|
9
|
-
const DEFAULT_DATE = /* @__PURE__ */ new Date();
|
|
10
|
-
DEFAULT_DATE.setHours(0, 0, 0);
|
|
11
|
-
exports.DEFAULT_DATE = DEFAULT_DATE;
|
|
12
|
-
exports.DEFAULT_PLACEHOLDER = DEFAULT_PLACEHOLDER;
|
|
13
|
-
exports.TIME_KEYS = TIME_KEYS;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const isNumber = (key) => /^\d+$/.test(key);
|
|
4
|
-
const isAOrP = (key) => ["a", "A", "p", "P"].includes(key);
|
|
5
|
-
const isValidNewHour = (old, key, timeFormat) => {
|
|
6
|
-
const newValue = old * 10 + key;
|
|
7
|
-
return timeFormat === 24 && newValue < 24 || timeFormat === 12 && newValue < 13;
|
|
8
|
-
};
|
|
9
|
-
const isCompleteHour = (timeFormat, value) => {
|
|
10
|
-
if (timeFormat === 12 && value > 1) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
if (timeFormat === 24 && value > 2) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
};
|
|
18
|
-
const canConcat = (oldValue, type, key, timeFormat) => type === "h" && isValidNewHour(oldValue, key, timeFormat) || type !== "h" && oldValue < 6 || type !== "h" && oldValue < 6;
|
|
19
|
-
const getLastTypedChar = (value, oldValue) => {
|
|
20
|
-
if (!oldValue) {
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
const oldValueString = oldValue.toString();
|
|
24
|
-
const valueCorrected = value.startsWith("0") ? value.slice(1) : value;
|
|
25
|
-
for (let i = 0; i < valueCorrected.length; i += 1) {
|
|
26
|
-
if (oldValueString[i] !== valueCorrected[i]) {
|
|
27
|
-
return valueCorrected[i];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return "";
|
|
31
|
-
};
|
|
32
|
-
const getValueByType = (type, value) => {
|
|
33
|
-
if (!value) {
|
|
34
|
-
return 0;
|
|
35
|
-
}
|
|
36
|
-
if (type === "h") {
|
|
37
|
-
return value.getHours();
|
|
38
|
-
}
|
|
39
|
-
if (type === "m") {
|
|
40
|
-
return value.getMinutes();
|
|
41
|
-
}
|
|
42
|
-
return value.getSeconds();
|
|
43
|
-
};
|
|
44
|
-
const setValueByType = (type, date, value) => {
|
|
45
|
-
if (type === "h") {
|
|
46
|
-
return date?.setHours(value);
|
|
47
|
-
}
|
|
48
|
-
if (type === "m") {
|
|
49
|
-
return date?.setMinutes(value);
|
|
50
|
-
}
|
|
51
|
-
return date?.setSeconds(value);
|
|
52
|
-
};
|
|
53
|
-
const format = (value, type, timeFormat) => {
|
|
54
|
-
if (type === "h" && timeFormat === 12) {
|
|
55
|
-
return (value % 12 === 0 ? 12 : value % 12).toString().padStart(2, "0");
|
|
56
|
-
}
|
|
57
|
-
return value.toString().padStart(2, "0");
|
|
58
|
-
};
|
|
59
|
-
exports.canConcat = canConcat;
|
|
60
|
-
exports.format = format;
|
|
61
|
-
exports.getLastTypedChar = getLastTypedChar;
|
|
62
|
-
exports.getValueByType = getValueByType;
|
|
63
|
-
exports.isAOrP = isAOrP;
|
|
64
|
-
exports.isCompleteHour = isCompleteHour;
|
|
65
|
-
exports.isNumber = isNumber;
|
|
66
|
-
exports.setValueByType = setValueByType;
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const react = require("react");
|
|
7
|
-
const index$3 = require("../Button/index.cjs");
|
|
8
|
-
const index$1 = require("../Label/index.cjs");
|
|
9
|
-
const index = require("../Stack/index.cjs");
|
|
10
|
-
const index$2 = require("../Text/index.cjs");
|
|
11
|
-
const constants = require("./constants.cjs");
|
|
12
|
-
const helpers = require("./helpers.cjs");
|
|
13
|
-
const styles_css = require("./styles.css.cjs");
|
|
14
|
-
const TimeInput = ({
|
|
15
|
-
label,
|
|
16
|
-
timeFormat = 24,
|
|
17
|
-
value,
|
|
18
|
-
clearable,
|
|
19
|
-
required,
|
|
20
|
-
labelDescription,
|
|
21
|
-
helper,
|
|
22
|
-
size = "large",
|
|
23
|
-
disabled = false,
|
|
24
|
-
readOnly = false,
|
|
25
|
-
error = false,
|
|
26
|
-
onChange,
|
|
27
|
-
onBlur,
|
|
28
|
-
onFocus,
|
|
29
|
-
className,
|
|
30
|
-
id,
|
|
31
|
-
autoFocus,
|
|
32
|
-
style,
|
|
33
|
-
"data-testid": dataTestId,
|
|
34
|
-
placeholder = constants.DEFAULT_PLACEHOLDER,
|
|
35
|
-
"aria-label": ariaLabel
|
|
36
|
-
}) => {
|
|
37
|
-
const localId = react.useId();
|
|
38
|
-
const defaultPeriod = react.useMemo(() => {
|
|
39
|
-
if (value) {
|
|
40
|
-
return value.getHours() >= 12 ? "pm" : "am";
|
|
41
|
-
}
|
|
42
|
-
return void 0;
|
|
43
|
-
}, [value]);
|
|
44
|
-
const [time, setTime] = react.useState(value);
|
|
45
|
-
const [period, setPeriod] = react.useState(defaultPeriod);
|
|
46
|
-
const [filled, setFilled] = react.useState(value ? {
|
|
47
|
-
h: true,
|
|
48
|
-
m: true,
|
|
49
|
-
s: true
|
|
50
|
-
} : {
|
|
51
|
-
h: false,
|
|
52
|
-
m: false,
|
|
53
|
-
s: false
|
|
54
|
-
});
|
|
55
|
-
const refHours = react.useRef(null);
|
|
56
|
-
const refSeconds = react.useRef(null);
|
|
57
|
-
const refMinutes = react.useRef(null);
|
|
58
|
-
const refPeriod = react.useRef(null);
|
|
59
|
-
react.useEffect(() => {
|
|
60
|
-
if (value) {
|
|
61
|
-
setTime(value);
|
|
62
|
-
if (value.getTime() !== time?.getTime()) {
|
|
63
|
-
setFilled({
|
|
64
|
-
h: true,
|
|
65
|
-
m: true,
|
|
66
|
-
s: true
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, [value]);
|
|
71
|
-
const handleChangePeriod = (key) => {
|
|
72
|
-
if (!time) {
|
|
73
|
-
setPeriod(`${key}m`);
|
|
74
|
-
} else if (key.toLowerCase() === "a") {
|
|
75
|
-
if (time.getHours() >= 12) {
|
|
76
|
-
const newTime = new Date(time);
|
|
77
|
-
newTime.setHours(newTime.getHours() - 12);
|
|
78
|
-
setTime(newTime);
|
|
79
|
-
onChange?.(newTime);
|
|
80
|
-
}
|
|
81
|
-
setPeriod("am");
|
|
82
|
-
} else {
|
|
83
|
-
if (time.getHours() < 12) {
|
|
84
|
-
const newTime = new Date(time);
|
|
85
|
-
newTime.setHours(newTime.getHours() + 12);
|
|
86
|
-
setTime(newTime);
|
|
87
|
-
onChange?.(newTime);
|
|
88
|
-
}
|
|
89
|
-
setPeriod("pm");
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const handleChange = (type, key) => {
|
|
93
|
-
const newTime = time ? new Date(time) : constants.DEFAULT_DATE;
|
|
94
|
-
const valueToChange = helpers.getValueByType(type, time);
|
|
95
|
-
if (helpers.canConcat(valueToChange, type, key, timeFormat)) {
|
|
96
|
-
const newValue2 = valueToChange % 10 * 10 + key;
|
|
97
|
-
helpers.setValueByType(type, newTime, newValue2);
|
|
98
|
-
} else {
|
|
99
|
-
helpers.setValueByType(type, newTime, key);
|
|
100
|
-
}
|
|
101
|
-
const newValue = helpers.getValueByType(type, newTime);
|
|
102
|
-
if (type === "s" && newTime && newValue >= 7 && timeFormat === 12) {
|
|
103
|
-
refPeriod.current?.focus();
|
|
104
|
-
} else if (type === "m" && newTime && newValue >= 6) {
|
|
105
|
-
refSeconds.current?.focus();
|
|
106
|
-
}
|
|
107
|
-
if (type === "h" && helpers.isCompleteHour(timeFormat, newValue)) {
|
|
108
|
-
refMinutes.current?.focus();
|
|
109
|
-
}
|
|
110
|
-
const newFilled = {
|
|
111
|
-
...filled
|
|
112
|
-
};
|
|
113
|
-
newFilled[type] = true;
|
|
114
|
-
setTime(newTime);
|
|
115
|
-
onChange?.(newTime);
|
|
116
|
-
setFilled(newFilled);
|
|
117
|
-
};
|
|
118
|
-
const handleIncrease = (type) => {
|
|
119
|
-
const newTime = time ? new Date(time) : constants.DEFAULT_DATE;
|
|
120
|
-
const currentValue = helpers.getValueByType(type, newTime);
|
|
121
|
-
if (type === "h" && timeFormat === 24) {
|
|
122
|
-
helpers.setValueByType(type, newTime, currentValue === 23 ? 0 : currentValue + 1);
|
|
123
|
-
} else if (type === "h" && timeFormat === 12) {
|
|
124
|
-
helpers.setValueByType(type, newTime, currentValue === 12 ? 1 : currentValue + 1);
|
|
125
|
-
} else {
|
|
126
|
-
helpers.setValueByType(type, newTime, currentValue === 59 ? 0 : currentValue + 1);
|
|
127
|
-
}
|
|
128
|
-
const newFilled = {
|
|
129
|
-
...filled
|
|
130
|
-
};
|
|
131
|
-
newFilled[type] = true;
|
|
132
|
-
setTime(newTime);
|
|
133
|
-
onChange?.(newTime);
|
|
134
|
-
setFilled(newFilled);
|
|
135
|
-
};
|
|
136
|
-
const handleDecrease = (type) => {
|
|
137
|
-
const newTime = time ? new Date(time) : constants.DEFAULT_DATE;
|
|
138
|
-
const currentValue = helpers.getValueByType(type, newTime);
|
|
139
|
-
if (type === "h" && timeFormat === 24) {
|
|
140
|
-
helpers.setValueByType(type, newTime, currentValue === 0 ? 23 : currentValue - 1);
|
|
141
|
-
} else if (type === "h" && timeFormat === 12) {
|
|
142
|
-
helpers.setValueByType(type, newTime, currentValue === 1 ? 12 : currentValue - 1);
|
|
143
|
-
} else {
|
|
144
|
-
helpers.setValueByType(type, newTime, currentValue === 0 ? 59 : currentValue - 1);
|
|
145
|
-
}
|
|
146
|
-
const newFilled = {
|
|
147
|
-
...filled
|
|
148
|
-
};
|
|
149
|
-
newFilled[type] = true;
|
|
150
|
-
setTime(newTime);
|
|
151
|
-
onChange?.(newTime);
|
|
152
|
-
setFilled(newFilled);
|
|
153
|
-
};
|
|
154
|
-
const handleNext = (type) => {
|
|
155
|
-
if (type === "h") {
|
|
156
|
-
refMinutes.current?.focus();
|
|
157
|
-
}
|
|
158
|
-
if (type === "m") {
|
|
159
|
-
refSeconds.current?.focus();
|
|
160
|
-
}
|
|
161
|
-
if (type === "s" && timeFormat === 12) {
|
|
162
|
-
refPeriod.current?.focus();
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
const handlePrevious = (type) => {
|
|
166
|
-
if (type === "m") {
|
|
167
|
-
refHours.current?.focus();
|
|
168
|
-
}
|
|
169
|
-
if (type === "s") {
|
|
170
|
-
refMinutes.current?.focus();
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { className, gap: 0.5, style, children: [
|
|
174
|
-
label || labelDescription ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Label, { htmlFor: id ?? localId, labelDescription, required, size, children: label }) : null,
|
|
175
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "center", "aria-label": ariaLabel, "aria-required": required, className: styles_css.timeinputWrapper({
|
|
176
|
-
disabled,
|
|
177
|
-
error: !!error,
|
|
178
|
-
readOnly,
|
|
179
|
-
size
|
|
180
|
-
}), "data-testid": dataTestId, direction: "row", id, justifyContent: "space-between", onBlur, onClick: () => refHours.current?.focus(), onFocus, children: [
|
|
181
|
-
/* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", children: [
|
|
182
|
-
constants.TIME_KEYS.map((type) => {
|
|
183
|
-
const computedRef = () => {
|
|
184
|
-
if (type === "h") {
|
|
185
|
-
return refHours;
|
|
186
|
-
}
|
|
187
|
-
if (type === "m") {
|
|
188
|
-
return refMinutes;
|
|
189
|
-
}
|
|
190
|
-
return refSeconds;
|
|
191
|
-
};
|
|
192
|
-
const fullName = () => {
|
|
193
|
-
if (type === "h") {
|
|
194
|
-
return "hours";
|
|
195
|
-
}
|
|
196
|
-
if (type === "m") {
|
|
197
|
-
return "minutes";
|
|
198
|
-
}
|
|
199
|
-
return "seconds";
|
|
200
|
-
};
|
|
201
|
-
const computeMaxValue = () => {
|
|
202
|
-
if (type === "h" && timeFormat === 12) {
|
|
203
|
-
return 12;
|
|
204
|
-
}
|
|
205
|
-
if (type === "h" && timeFormat === 24) {
|
|
206
|
-
return 23;
|
|
207
|
-
}
|
|
208
|
-
return 59;
|
|
209
|
-
};
|
|
210
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { direction: "row", children: [
|
|
211
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { "aria-label": ariaLabel, "aria-valuemax": computeMaxValue(), "aria-valuemin": type === "h" && timeFormat === 12 ? 1 : 0, "aria-valuenow": filled[type] ? Number.parseInt(helpers.format(helpers.getValueByType(type, time), type, timeFormat), 10) : void 0, autoComplete: "off", autoFocus: autoFocus && type === "h", className: styles_css.timeinput(), "data-size": size, "data-testid": `${fullName()}-input`, disabled, onChange: (event) => {
|
|
212
|
-
if (!readOnly && !disabled) {
|
|
213
|
-
const key = helpers.getLastTypedChar(event.target.value, helpers.getValueByType(type, time));
|
|
214
|
-
if (helpers.isNumber(key)) {
|
|
215
|
-
handleChange(type, Number.parseInt(key, 10));
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}, onClick: (event) => {
|
|
219
|
-
event.stopPropagation();
|
|
220
|
-
}, onKeyDown: (event) => {
|
|
221
|
-
if (!readOnly && !disabled) {
|
|
222
|
-
if (event.key === "ArrowUp") {
|
|
223
|
-
event.preventDefault();
|
|
224
|
-
handleIncrease(type);
|
|
225
|
-
} else if (event.key === "ArrowDown") {
|
|
226
|
-
event.preventDefault();
|
|
227
|
-
handleDecrease(type);
|
|
228
|
-
} else if (event.key === "ArrowLeft") {
|
|
229
|
-
event.preventDefault();
|
|
230
|
-
handlePrevious(type);
|
|
231
|
-
} else if (event.key === "ArrowRight") {
|
|
232
|
-
event.preventDefault();
|
|
233
|
-
handleNext(type);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}, placeholder: placeholder[type], readOnly, ref: computedRef(), role: "spinbutton", value: filled[type] ? helpers.format(helpers.getValueByType(type, time), type, timeFormat) : "" }),
|
|
237
|
-
type === "s" ? null : /* @__PURE__ */ jsxRuntime.jsx(index$2.Text, { as: "span", className: styles_css.timeSeparator, prominence: "default", sentiment: "neutral", variant: "body", children: ":" })
|
|
238
|
-
] }, type);
|
|
239
|
-
}),
|
|
240
|
-
timeFormat === 12 ? /* @__PURE__ */ jsxRuntime.jsx("input", { "aria-label": ariaLabel, "aria-valuemax": 12, "aria-valuemin": 0, "aria-valuenow": period === "am" ? 0 : 12, "aria-valuetext": period, autoComplete: "off", className: styles_css.timeinput({
|
|
241
|
-
period: true
|
|
242
|
-
}), "data-size": size, "data-testid": "am-pm-input", disabled, onChange: (event) => {
|
|
243
|
-
if (!readOnly && !disabled) {
|
|
244
|
-
const key = event.target.value.slice(-1);
|
|
245
|
-
if (helpers.isAOrP(key)) {
|
|
246
|
-
handleChangePeriod(key);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}, onClick: (event) => event.stopPropagation(), onKeyDown: (event) => {
|
|
250
|
-
if (!readOnly && !disabled) {
|
|
251
|
-
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
252
|
-
event.preventDefault();
|
|
253
|
-
handleChangePeriod(period === "am" ? "p" : "a");
|
|
254
|
-
} else if (event.key === "ArrowLeft") {
|
|
255
|
-
event.preventDefault();
|
|
256
|
-
refSeconds.current?.focus();
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}, placeholder: placeholder.period ?? "AM", readOnly, ref: refPeriod, role: "spinbutton", value: period?.toUpperCase() }) : null
|
|
260
|
-
] }),
|
|
261
|
-
error || clearable ? /* @__PURE__ */ jsxRuntime.jsxs(index.Stack, { alignItems: "center", direction: "row", gap: "1", children: [
|
|
262
|
-
error ? /* @__PURE__ */ jsxRuntime.jsx(Icon.AlertCircleIcon, { sentiment: "danger" }) : null,
|
|
263
|
-
clearable ? /* @__PURE__ */ jsxRuntime.jsx(index$3.Button, { "aria-label": "clear value", "data-testid": "clear", disabled: disabled || readOnly, onClick: (event) => {
|
|
264
|
-
event.stopPropagation();
|
|
265
|
-
setTime(void 0);
|
|
266
|
-
onChange?.(void 0);
|
|
267
|
-
}, sentiment: "neutral", size: "small", variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) }) : null
|
|
268
|
-
] }) : null
|
|
269
|
-
] }),
|
|
270
|
-
helper || error ? /* @__PURE__ */ jsxRuntime.jsx(index$2.Text, { as: "p", disabled, prominence: error ? "default" : "weak", sentiment: error ? "danger" : "neutral", variant: "caption", children: error || helper }) : null
|
|
271
|
-
] });
|
|
272
|
-
};
|
|
273
|
-
exports.TimeInput = TimeInput;
|
|
@@ -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 timeinputWrapper = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_yl1780", variantClassNames: { disabled: { true: "uv_yl1781", false: "uv_yl1782" }, readOnly: { true: "uv_yl1783" }, error: { true: "uv_yl1784" }, size: { small: "uv_yl1785", medium: "uv_yl1786", large: "uv_yl1787" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6
|
-
var timeinput = createRuntimeFn.createRuntimeFn({ defaultClassName: "uv_yl1788", variantClassNames: { period: { true: "uv_yl1789" } }, defaultVariants: { period: false }, compoundVariants: [] });
|
|
7
|
-
var timeSeparator = "uv_yl178a";
|
|
8
|
-
exports.timeSeparator = timeSeparator;
|
|
9
|
-
exports.timeinput = timeinput;
|
|
10
|
-
exports.timeinputWrapper = timeinputWrapper;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
5
|
-
const Icon = require("@ultraviolet/icons");
|
|
6
|
-
const reactToastify = require("react-toastify");
|
|
7
|
-
const index$2 = require("../Button/index.cjs");
|
|
8
|
-
const index = require("../Stack/index.cjs");
|
|
9
|
-
const index$1 = require("../Text/index.cjs");
|
|
10
|
-
const styles_css = require("./styles.css.cjs");
|
|
11
|
-
const AUTOCLOSE_DELAY = 6e3;
|
|
12
|
-
const CloseButton = ({
|
|
13
|
-
closeToast,
|
|
14
|
-
sentiment = "success"
|
|
15
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(index$2.Button, { "aria-label": "close", className: styles_css.closeButtonToaster, onClick: closeToast, sentiment, size: "xsmall", children: /* @__PURE__ */ jsxRuntime.jsx(Icon.CloseIcon, {}) });
|
|
16
|
-
const Content = ({
|
|
17
|
-
children
|
|
18
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(index.Stack, { direction: "row", gap: 2, width: "100%", children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(index$1.Text, { as: "span", variant: "bodySmallStrong", children }) : children });
|
|
19
|
-
const toast = {
|
|
20
|
-
error: (children, options, containerId) => reactToastify.toast.error(/* @__PURE__ */ jsxRuntime.jsx(Content, { children }), {
|
|
21
|
-
...options,
|
|
22
|
-
closeButton: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { sentiment: "danger" }),
|
|
23
|
-
containerId: containerId ?? "toaster"
|
|
24
|
-
}),
|
|
25
|
-
success: (children, options, containerId) => reactToastify.toast.success(/* @__PURE__ */ jsxRuntime.jsx(Content, { children }), {
|
|
26
|
-
...options,
|
|
27
|
-
closeButton: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { sentiment: "success" }),
|
|
28
|
-
containerId: containerId ?? "toaster"
|
|
29
|
-
}),
|
|
30
|
-
warning: (children, options, containerId) => reactToastify.toast.warn(/* @__PURE__ */ jsxRuntime.jsx(Content, { children }), {
|
|
31
|
-
...options,
|
|
32
|
-
closeButton: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { sentiment: "warning" }),
|
|
33
|
-
containerId: containerId ?? "toaster"
|
|
34
|
-
})
|
|
35
|
-
};
|
|
36
|
-
const ToastContainer = ({
|
|
37
|
-
newestOnTop,
|
|
38
|
-
limit,
|
|
39
|
-
position = "top-right",
|
|
40
|
-
"data-testid": dataTestId,
|
|
41
|
-
className,
|
|
42
|
-
autoClose,
|
|
43
|
-
containerId = "toaster",
|
|
44
|
-
style
|
|
45
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(reactToastify.ToastContainer, { autoClose: autoClose ?? AUTOCLOSE_DELAY, className: `${className ? `${className} ` : ""}${styles_css.toaster}`, containerId, "data-testid": dataTestId, draggable: false, hideProgressBar: true, icon: false, limit, newestOnTop, pauseOnFocusLoss: false, pauseOnHover: false, position, stacked: true, style, transition: reactToastify.Slide });
|
|
46
|
-
exports.ToastContainer = ToastContainer;
|
|
47
|
-
exports.toast = toast;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
-
import { CloseIcon } from "@ultraviolet/icons";
|
|
4
|
-
import { toast as toast$1, ToastContainer as ToastContainer$1, Slide } from "react-toastify";
|
|
5
|
-
import { Button } from "../Button/index.js";
|
|
6
|
-
import { Stack } from "../Stack/index.js";
|
|
7
|
-
import { Text } from "../Text/index.js";
|
|
8
|
-
import { toaster, closeButtonToaster } from "./styles.css.js";
|
|
9
|
-
const AUTOCLOSE_DELAY = 6e3;
|
|
10
|
-
const CloseButton = ({
|
|
11
|
-
closeToast,
|
|
12
|
-
sentiment = "success"
|
|
13
|
-
}) => /* @__PURE__ */ jsx(Button, { "aria-label": "close", className: closeButtonToaster, onClick: closeToast, sentiment, size: "xsmall", children: /* @__PURE__ */ jsx(CloseIcon, {}) });
|
|
14
|
-
const Content = ({
|
|
15
|
-
children
|
|
16
|
-
}) => /* @__PURE__ */ jsx(Stack, { direction: "row", gap: 2, width: "100%", children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "bodySmallStrong", children }) : children });
|
|
17
|
-
const toast = {
|
|
18
|
-
error: (children, options, containerId) => toast$1.error(/* @__PURE__ */ jsx(Content, { children }), {
|
|
19
|
-
...options,
|
|
20
|
-
closeButton: /* @__PURE__ */ jsx(CloseButton, { sentiment: "danger" }),
|
|
21
|
-
containerId: containerId ?? "toaster"
|
|
22
|
-
}),
|
|
23
|
-
success: (children, options, containerId) => toast$1.success(/* @__PURE__ */ jsx(Content, { children }), {
|
|
24
|
-
...options,
|
|
25
|
-
closeButton: /* @__PURE__ */ jsx(CloseButton, { sentiment: "success" }),
|
|
26
|
-
containerId: containerId ?? "toaster"
|
|
27
|
-
}),
|
|
28
|
-
warning: (children, options, containerId) => toast$1.warn(/* @__PURE__ */ jsx(Content, { children }), {
|
|
29
|
-
...options,
|
|
30
|
-
closeButton: /* @__PURE__ */ jsx(CloseButton, { sentiment: "warning" }),
|
|
31
|
-
containerId: containerId ?? "toaster"
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
|
-
const ToastContainer = ({
|
|
35
|
-
newestOnTop,
|
|
36
|
-
limit,
|
|
37
|
-
position = "top-right",
|
|
38
|
-
"data-testid": dataTestId,
|
|
39
|
-
className,
|
|
40
|
-
autoClose,
|
|
41
|
-
containerId = "toaster",
|
|
42
|
-
style
|
|
43
|
-
}) => /* @__PURE__ */ jsx(ToastContainer$1, { autoClose: autoClose ?? AUTOCLOSE_DELAY, className: `${className ? `${className} ` : ""}${toaster}`, containerId, "data-testid": dataTestId, draggable: false, hideProgressBar: true, icon: false, limit, newestOnTop, pauseOnFocusLoss: false, pauseOnHover: false, position, stacked: true, style, transition: Slide });
|
|
44
|
-
export {
|
|
45
|
-
ToastContainer,
|
|
46
|
-
toast
|
|
47
|
-
};
|