@povio/ui 2.3.0-rc.1 → 2.3.0-rc.11

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.
Files changed (206) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +166 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +35 -14
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +125 -109
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +33 -15
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +391 -117
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +4 -8
  83. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +8 -8
  84. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  85. package/dist/components/inputs/File/FileUpload.js +86 -44
  86. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  87. package/dist/components/inputs/File/InputUpload.js +317 -79
  88. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  89. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  90. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  91. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  92. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  93. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  94. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  95. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  96. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  97. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  98. package/dist/components/inputs/FormField/FormField.js +119 -37
  99. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  100. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  101. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  102. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  103. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  104. package/dist/components/inputs/Input/NumberInput/NumberInput.js +261 -84
  105. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  106. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +321 -77
  107. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  108. package/dist/components/inputs/Input/TextArea/TextArea.js +303 -90
  109. package/dist/components/inputs/Input/TextInput/TextInput.js +250 -84
  110. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  111. package/dist/components/inputs/Inputs/Form.js +40 -11
  112. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
  113. package/dist/components/inputs/Inputs/InputItem.js +65 -16
  114. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  115. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  116. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +11 -4
  117. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
  118. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  119. package/dist/components/inputs/Selection/Select/Select.js +24 -7
  120. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  121. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  122. package/dist/components/inputs/Selection/shared/SelectInput.js +335 -136
  123. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  124. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  125. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  126. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  127. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  128. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  129. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  130. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  131. package/dist/components/inputs/Selection/shared/select.context.js +35 -35
  132. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  133. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  134. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  135. package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
  136. package/dist/components/inputs/Skeleton/InputFrame.js +442 -116
  137. package/dist/components/inputs/Slider/Slider.js +250 -74
  138. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  139. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  140. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  141. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  142. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  143. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  144. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  145. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  146. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  147. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  148. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  149. package/dist/components/inputs/Toggle/Toggle.js +187 -40
  150. package/dist/components/inputs/shared/CheckContent.js +21 -10
  151. package/dist/components/inputs/shared/InputClear.js +78 -21
  152. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  153. package/dist/components/inputs/shared/input.cva.js +13 -3
  154. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
  155. package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
  156. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  157. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  158. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  159. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  160. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  161. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  162. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  163. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  164. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  165. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  166. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  167. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  168. package/dist/components/segment/Segment.js +218 -57
  169. package/dist/components/segment/SegmentItem.js +67 -10
  170. package/dist/components/shared/pagination/Pagination.js +108 -22
  171. package/dist/components/shared/pagination/PaginationList.js +167 -64
  172. package/dist/components/status/Alert/Alert.js +97 -30
  173. package/dist/components/status/Loader/Loader.js +77 -22
  174. package/dist/components/status/Toast/Toast.js +21 -13
  175. package/dist/components/status/Toast/useToast.js +62 -57
  176. package/dist/components/table/ColumnConfig.js +158 -54
  177. package/dist/components/table/InfiniteTable.js +67 -16
  178. package/dist/components/table/PaginatedTable.js +84 -18
  179. package/dist/components/table/Table.js +28 -27
  180. package/dist/components/text/Link/Link.js +19 -7
  181. package/dist/components/text/Typography/Typography.js +23 -8
  182. package/dist/config/confirmation.context.js +1 -1
  183. package/dist/config/link.context.js +23 -9
  184. package/dist/config/router.context.js +42 -16
  185. package/dist/config/theme.context.js +98 -45
  186. package/dist/config/uiConfig.context.js +39 -8
  187. package/dist/config/uiStyle.context.js +15 -5
  188. package/dist/helpers/dynamicInputs.d.ts +1 -1
  189. package/dist/hooks/useBreakpoint.js +16 -3
  190. package/dist/hooks/useDebounceCallback.js +51 -17
  191. package/dist/hooks/useFilters.js +125 -64
  192. package/dist/hooks/useForm.js +42 -8
  193. package/dist/hooks/useFormAutosave.js +101 -30
  194. package/dist/hooks/useIntersectionObserver.js +86 -32
  195. package/dist/hooks/useLocalStorage.js +43 -10
  196. package/dist/hooks/useLongPressRepeat.js +55 -20
  197. package/dist/hooks/usePagination.js +49 -19
  198. package/dist/hooks/useQueryAutocomplete.js +1 -0
  199. package/dist/hooks/useScrollableListBox.js +37 -16
  200. package/dist/hooks/useSorting.js +69 -28
  201. package/dist/hooks/useStateAndRef.js +21 -7
  202. package/dist/hooks/useTableColumnConfig.js +124 -31
  203. package/dist/hooks/useTranslationMemo.js +25 -5
  204. package/dist/index.js +2 -2
  205. package/dist/utils/date-time.utils.js +7 -13
  206. package/package.json +1 -1
@@ -6,91 +6,226 @@ import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
6
6
  import { InputClear } from "../../shared/InputClear.js";
7
7
  import { inputBase, inputSize } from "../../shared/input.cva.js";
8
8
  import { TimeField } from "./TimeField.js";
9
+ import { c } from "react/compiler-runtime";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  import { clsx } from "clsx";
11
12
  import { useState } from "react";
12
13
  import { Button } from "react-aria-components";
13
14
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
14
15
  //#region src/components/inputs/DateTime/shared/TimePickerInput.tsx
15
- var TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, ...props }) => {
16
+ var TimePickerInput = (t0) => {
17
+ const $ = c(65);
18
+ const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, ...props } = t0;
16
19
  const uiConfig = UIConfig.useConfig();
17
20
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
18
21
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
19
- const { hoverProps, isHovered } = useHover({ isDisabled });
22
+ let t1;
23
+ if ($[0] !== isDisabled) {
24
+ t1 = { isDisabled };
25
+ $[0] = isDisabled;
26
+ $[1] = t1;
27
+ } else t1 = $[1];
28
+ const { hoverProps, isHovered } = useHover(t1);
20
29
  const [isFocused, setIsFocused] = useState(false);
21
- const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
30
+ let t2;
31
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
32
+ t2 = { onFocusWithinChange: setIsFocused };
33
+ $[2] = t2;
34
+ } else t2 = $[2];
35
+ const { focusWithinProps } = useFocusWithin(t2);
22
36
  const { isFocusVisible } = useFocusVisible();
23
37
  const hidePlaceholder = as === "floating" && !state.value && !isFocused;
24
- const canClear = state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false);
25
- return /* @__PURE__ */ jsxs("div", {
26
- ref,
27
- className: clsx(inputBaseCva({
28
- variant,
38
+ let t3;
39
+ if ($[3] !== state.segments) {
40
+ t3 = state.segments.some(_temp);
41
+ $[3] = state.segments;
42
+ $[4] = t3;
43
+ } else t3 = $[4];
44
+ const canClear = t3;
45
+ const t4 = clsx(inputBaseCva({
46
+ variant,
47
+ as,
48
+ ...props
49
+ }), "group/date-picker-content relative min-w-input-width-min-width", "flex items-center justify-between gap-input-gap-input-text-to-elements", className);
50
+ const t5 = isHovered || void 0;
51
+ const t6 = isDisabled || void 0;
52
+ const t7 = isDisabled || void 0;
53
+ const t8 = isInvalid || void 0;
54
+ const t9 = state.value === null || void 0;
55
+ const t10 = isFocused || void 0;
56
+ const t11 = isFocused && isFocusVisible || void 0;
57
+ const t12 = state.value !== null || void 0;
58
+ const t13 = isDirty || void 0;
59
+ const t14 = isRequired || void 0;
60
+ const t15 = state.value !== null || void 0;
61
+ let t16;
62
+ if ($[5] !== as || $[6] !== inputSizeCva || $[7] !== size) {
63
+ t16 = clsx(inputSizeCva({
64
+ size,
65
+ as
66
+ }), "flex w-full items-center gap-input-gap-input-text-to-elements pr-0!");
67
+ $[5] = as;
68
+ $[6] = inputSizeCva;
69
+ $[7] = size;
70
+ $[8] = t16;
71
+ } else t16 = $[8];
72
+ let t17;
73
+ if ($[9] !== disableManualEntry || $[10] !== onPress) {
74
+ t17 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
75
+ onPress,
76
+ className: "absolute inset-0 z-0"
77
+ });
78
+ $[9] = disableManualEntry;
79
+ $[10] = onPress;
80
+ $[11] = t17;
81
+ } else t17 = $[11];
82
+ let t18;
83
+ if ($[12] !== as || $[13] !== headerProps) {
84
+ t18 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
29
85
  as,
30
- ...props
31
- }), "group/date-picker-content relative min-w-input-width-min-width", "flex items-center justify-between gap-input-gap-input-text-to-elements", className),
32
- "data-rac": "",
33
- "data-datetime-input": "",
34
- "data-hovered": isHovered || void 0,
35
- "data-disabled": isDisabled || void 0,
36
- "data-is-disabled": isDisabled || void 0,
37
- "data-invalid": isInvalid || void 0,
38
- "data-is-empty": state.value === null || void 0,
39
- "data-focus-within": isFocused || void 0,
40
- "data-focus-visible": isFocused && isFocusVisible || void 0,
41
- "data-has-selection": state.value !== null || void 0,
42
- "data-is-dirty": isDirty || void 0,
43
- "data-is-required": isRequired || void 0,
44
- "data-is-filled": state.value !== null || void 0,
45
- ...fieldProps,
46
- ...focusWithinProps,
47
- ...hoverProps,
48
- children: [/* @__PURE__ */ jsxs("div", {
49
- className: clsx(inputSizeCva({
50
- size,
51
- as
52
- }), "flex w-full items-center gap-input-gap-input-text-to-elements pr-0!"),
86
+ ...headerProps
87
+ });
88
+ $[12] = as;
89
+ $[13] = headerProps;
90
+ $[14] = t18;
91
+ } else t18 = $[14];
92
+ let t19;
93
+ if ($[15] !== disableManualEntry || $[16] !== fieldProps || $[17] !== hidePlaceholder || $[18] !== isDisabled || $[19] !== placeholder || $[20] !== state) {
94
+ t19 = /* @__PURE__ */ jsx("div", { children: disableManualEntry && placeholder && !state.value ? /* @__PURE__ */ jsx(Typography, {
95
+ size: "label-1",
96
+ className: "text-text-default-3",
97
+ children: placeholder
98
+ }) : /* @__PURE__ */ jsx(TimeField, {
99
+ fieldProps,
100
+ state,
101
+ isDisabled,
102
+ hidePlaceholder
103
+ }) });
104
+ $[15] = disableManualEntry;
105
+ $[16] = fieldProps;
106
+ $[17] = hidePlaceholder;
107
+ $[18] = isDisabled;
108
+ $[19] = placeholder;
109
+ $[20] = state;
110
+ $[21] = t19;
111
+ } else t19 = $[21];
112
+ let t20;
113
+ if ($[22] !== t16 || $[23] !== t17 || $[24] !== t18 || $[25] !== t19) {
114
+ t20 = /* @__PURE__ */ jsxs("div", {
115
+ className: t16,
53
116
  children: [
54
- disableManualEntry && /* @__PURE__ */ jsx(Button, {
55
- onPress,
56
- className: "absolute inset-0 z-0"
57
- }),
58
- as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
59
- as,
60
- ...headerProps
61
- }),
62
- /* @__PURE__ */ jsx("div", { children: disableManualEntry && placeholder && !state.value ? /* @__PURE__ */ jsx(Typography, {
63
- size: "label-1",
64
- className: "text-text-default-3",
65
- children: placeholder
66
- }) : /* @__PURE__ */ jsx(TimeField, {
67
- fieldProps,
68
- state,
69
- isDisabled,
70
- hidePlaceholder
71
- }) })
117
+ t17,
118
+ t18,
119
+ t19
72
120
  ]
73
- }), /* @__PURE__ */ jsxs("div", {
74
- className: clsx(inputSizeCva({
75
- size,
76
- as
77
- }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
78
- children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
79
- onClear: () => {
80
- state.setValue(null);
81
- fieldProps.onBlur?.(null);
82
- },
83
- show: canClear
84
- }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
85
- label: "",
86
- color: "secondary",
87
- onPress,
88
- icon: uiConfig.dateInput.timeIcon,
89
- isDisabled,
90
- className: "border-0!"
91
- })]
92
- })]
93
- });
121
+ });
122
+ $[22] = t16;
123
+ $[23] = t17;
124
+ $[24] = t18;
125
+ $[25] = t19;
126
+ $[26] = t20;
127
+ } else t20 = $[26];
128
+ let t21;
129
+ if ($[27] !== as || $[28] !== inputSizeCva || $[29] !== size) {
130
+ t21 = clsx(inputSizeCva({
131
+ size,
132
+ as
133
+ }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
134
+ $[27] = as;
135
+ $[28] = inputSizeCva;
136
+ $[29] = size;
137
+ $[30] = t21;
138
+ } else t21 = $[30];
139
+ let t22;
140
+ if ($[31] !== canClear || $[32] !== fieldProps || $[33] !== isClearable || $[34] !== state) {
141
+ t22 = isClearable && /* @__PURE__ */ jsx(InputClear, {
142
+ onClear: () => {
143
+ state.setValue(null);
144
+ fieldProps.onBlur?.(null);
145
+ },
146
+ show: canClear
147
+ });
148
+ $[31] = canClear;
149
+ $[32] = fieldProps;
150
+ $[33] = isClearable;
151
+ $[34] = state;
152
+ $[35] = t22;
153
+ } else t22 = $[35];
154
+ let t23;
155
+ if ($[36] !== disableDropdown || $[37] !== disableManualEntry || $[38] !== isDisabled || $[39] !== onPress || $[40] !== uiConfig) {
156
+ t23 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
157
+ label: "",
158
+ color: "secondary",
159
+ onPress,
160
+ icon: uiConfig.dateInput.timeIcon,
161
+ isDisabled,
162
+ className: "border-0!"
163
+ });
164
+ $[36] = disableDropdown;
165
+ $[37] = disableManualEntry;
166
+ $[38] = isDisabled;
167
+ $[39] = onPress;
168
+ $[40] = uiConfig;
169
+ $[41] = t23;
170
+ } else t23 = $[41];
171
+ let t24;
172
+ if ($[42] !== t21 || $[43] !== t22 || $[44] !== t23) {
173
+ t24 = /* @__PURE__ */ jsxs("div", {
174
+ className: t21,
175
+ children: [t22, t23]
176
+ });
177
+ $[42] = t21;
178
+ $[43] = t22;
179
+ $[44] = t23;
180
+ $[45] = t24;
181
+ } else t24 = $[45];
182
+ let t25;
183
+ if ($[46] !== fieldProps || $[47] !== focusWithinProps || $[48] !== hoverProps || $[49] !== ref || $[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t13 || $[54] !== t14 || $[55] !== t15 || $[56] !== t20 || $[57] !== t24 || $[58] !== t4 || $[59] !== t5 || $[60] !== t6 || $[61] !== t7 || $[62] !== t8 || $[63] !== t9) {
184
+ t25 = /* @__PURE__ */ jsxs("div", {
185
+ ref,
186
+ className: t4,
187
+ "data-rac": "",
188
+ "data-datetime-input": "",
189
+ "data-hovered": t5,
190
+ "data-disabled": t6,
191
+ "data-is-disabled": t7,
192
+ "data-invalid": t8,
193
+ "data-is-empty": t9,
194
+ "data-focus-within": t10,
195
+ "data-focus-visible": t11,
196
+ "data-has-selection": t12,
197
+ "data-is-dirty": t13,
198
+ "data-is-required": t14,
199
+ "data-is-filled": t15,
200
+ ...fieldProps,
201
+ ...focusWithinProps,
202
+ ...hoverProps,
203
+ children: [t20, t24]
204
+ });
205
+ $[46] = fieldProps;
206
+ $[47] = focusWithinProps;
207
+ $[48] = hoverProps;
208
+ $[49] = ref;
209
+ $[50] = t10;
210
+ $[51] = t11;
211
+ $[52] = t12;
212
+ $[53] = t13;
213
+ $[54] = t14;
214
+ $[55] = t15;
215
+ $[56] = t20;
216
+ $[57] = t24;
217
+ $[58] = t4;
218
+ $[59] = t5;
219
+ $[60] = t6;
220
+ $[61] = t7;
221
+ $[62] = t8;
222
+ $[63] = t9;
223
+ $[64] = t25;
224
+ } else t25 = $[64];
225
+ return t25;
94
226
  };
227
+ function _temp(segment) {
228
+ return segment.type !== "literal" && segment.isPlaceholder === false;
229
+ }
95
230
  //#endregion
96
231
  export { TimePickerInput };
@@ -1,19 +1,29 @@
1
1
  import { Typography } from "../../../text/Typography/Typography.js";
2
2
  import { useScrollableListBox } from "../../../../hooks/useScrollableListBox.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  import { clsx } from "clsx";
5
- import { useMemo, useRef } from "react";
6
+ import { useRef } from "react";
6
7
  import { ListBox, ListBoxItem } from "react-aria-components";
7
8
  import { today } from "@internationalized/date";
8
9
  import { useDateFormatter } from "@react-aria/i18n";
9
10
  //#region src/components/inputs/DateTime/shared/YearPicker.tsx
10
- var YearPicker = ({ state, onSelectionChange, onDateChange, onCommit, selectedDate }) => {
11
- const formatter = useDateFormatter({
12
- year: "numeric",
13
- timeZone: state.timeZone
14
- });
15
- const years = useMemo(() => {
16
- const arr = [];
11
+ var YearPicker = (t0) => {
12
+ const $ = c(22);
13
+ const { state, onSelectionChange, onDateChange, onCommit, selectedDate } = t0;
14
+ let t1;
15
+ if ($[0] !== state.timeZone) {
16
+ t1 = {
17
+ year: "numeric",
18
+ timeZone: state.timeZone
19
+ };
20
+ $[0] = state.timeZone;
21
+ $[1] = t1;
22
+ } else t1 = $[1];
23
+ const formatter = useDateFormatter(t1);
24
+ let arr;
25
+ if ($[2] !== formatter || $[3] !== state.timeZone) {
26
+ arr = [];
17
27
  for (let i = -100; i <= 100; i++) {
18
28
  const date = today(state.timeZone).add({ years: i });
19
29
  arr.push({
@@ -21,80 +31,121 @@ var YearPicker = ({ state, onSelectionChange, onDateChange, onCommit, selectedDa
21
31
  formatted: formatter.format(date.toDate(state.timeZone))
22
32
  });
23
33
  }
24
- return arr;
25
- }, [state.timeZone, formatter]);
34
+ $[2] = formatter;
35
+ $[3] = state.timeZone;
36
+ $[4] = arr;
37
+ } else arr = $[4];
38
+ const years = arr;
26
39
  const isYearDisabled = (year) => {
27
40
  if (state.minValue && year < state.minValue.year) return true;
28
41
  if (state.maxValue && year > state.maxValue.year) return true;
29
42
  return false;
30
43
  };
31
- const getSelectedYearIndex = () => {
32
- if (selectedDate) {
33
- const selectedIndexFromValue = years.findIndex((year) => year.value === selectedDate.year);
34
- if (selectedIndexFromValue >= 0) return selectedIndexFromValue;
35
- }
36
- const focusedYearIndex = years.findIndex((year) => year.value === state.focusedDate.year);
37
- if (focusedYearIndex < 0) return null;
38
- return focusedYearIndex;
39
- };
40
- const selectedYearIndex = getSelectedYearIndex();
44
+ let t2;
45
+ if ($[5] !== selectedDate || $[6] !== state.focusedDate || $[7] !== years) {
46
+ t2 = () => {
47
+ if (selectedDate) {
48
+ const selectedIndexFromValue = years.findIndex((year_0) => year_0.value === selectedDate.year);
49
+ if (selectedIndexFromValue >= 0) return selectedIndexFromValue;
50
+ }
51
+ const focusedYearIndex = years.findIndex((year_1) => year_1.value === state.focusedDate.year);
52
+ if (focusedYearIndex < 0) return null;
53
+ return focusedYearIndex;
54
+ };
55
+ $[5] = selectedDate;
56
+ $[6] = state.focusedDate;
57
+ $[7] = years;
58
+ $[8] = t2;
59
+ } else t2 = $[8];
60
+ const selectedYearIndex = t2();
41
61
  const lastPressedYearIndexRef = useRef(null);
42
- const listBoxSelectionProps = {};
43
- if (selectedYearIndex !== null) listBoxSelectionProps.selectedKeys = [selectedYearIndex];
44
- const parseYearIndexFromKey = (key) => {
45
- if (typeof key === "number") return key;
46
- if (typeof key === "string") {
47
- const parsedIndex = Number.parseInt(key, 10);
48
- if (!Number.isNaN(parsedIndex)) return parsedIndex;
49
- }
50
- return null;
51
- };
62
+ let listBoxSelectionProps;
63
+ if ($[9] !== selectedYearIndex) {
64
+ listBoxSelectionProps = {};
65
+ if (selectedYearIndex !== null) listBoxSelectionProps.selectedKeys = [selectedYearIndex];
66
+ $[9] = selectedYearIndex;
67
+ $[10] = listBoxSelectionProps;
68
+ } else listBoxSelectionProps = $[10];
69
+ const parseYearIndexFromKey = _temp;
52
70
  const { ref } = useScrollableListBox();
53
- return /* @__PURE__ */ jsx(ListBox, {
54
- ref,
55
- autoFocus: true,
56
- "aria-label": "Year",
57
- selectionMode: "single",
58
- ...listBoxSelectionProps,
59
- onSelectionChange: (key) => {
60
- if (key === "all") return;
61
- const selectedKey = [...key][0];
71
+ const T0 = ListBox;
72
+ const t3 = true;
73
+ const t4 = "Year";
74
+ const t5 = "single";
75
+ let t6;
76
+ if ($[11] !== onDateChange || $[12] !== onSelectionChange || $[13] !== state || $[14] !== years) {
77
+ t6 = (key_0) => {
78
+ if (key_0 === "all") return;
79
+ const selectedKey = [...key_0][0];
62
80
  const selectedYearIndexValue = parseYearIndexFromKey(selectedKey);
63
81
  if (selectedYearIndexValue !== null && years[selectedYearIndexValue]) {
64
82
  const nextSelectedDate = state.focusedDate.set({ year: years[selectedYearIndexValue].value });
65
83
  state.setFocusedDate(nextSelectedDate);
66
84
  onDateChange?.(nextSelectedDate);
67
85
  }
68
- onSelectionChange(key);
69
- },
70
- className: "h-80 max-h-full min-h-0 w-full shrink-0 overflow-y-auto md:h-72 md:w-80",
71
- children: years.map((year, index) => {
72
- const isDisabled = isYearDisabled(year.value);
73
- return /* @__PURE__ */ jsx(ListBoxItem, {
74
- id: index,
75
- textValue: year.formatted,
76
- isDisabled,
77
- onPress: () => {
78
- const isSecondConsecutivePress = lastPressedYearIndexRef.current === index;
79
- lastPressedYearIndexRef.current = index;
80
- const nextSelectedDate = state.focusedDate.set({ year: year.value });
81
- state.setFocusedDate(nextSelectedDate);
82
- onDateChange?.(nextSelectedDate);
83
- if (!isSecondConsecutivePress) return;
84
- if (!selectedDate) return;
85
- if (selectedYearIndex === null) return;
86
- if (index !== selectedYearIndex) return;
87
- onCommit?.();
88
- },
89
- className: clsx("flex px-4 py-2 text-interactive-text-secondary-idle outline-none", "border-elevation-outline-default-1 border-b border-solid bg-elevation-fill-default-1 last:border-b-0", "hover:text-interactive-text-secondary-hover", "selected:bg-interactive-contained-primary-idle selected:text-interactive-text-secondary-idle-inverted", "focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted", isDisabled ? "cursor-default opacity-50" : "cursor-pointer"),
90
- children: /* @__PURE__ */ jsx(Typography, {
91
- as: "span",
92
- size: "label-2",
93
- children: year.formatted
94
- })
95
- }, index);
96
- })
86
+ onSelectionChange(key_0);
87
+ };
88
+ $[11] = onDateChange;
89
+ $[12] = onSelectionChange;
90
+ $[13] = state;
91
+ $[14] = years;
92
+ $[15] = t6;
93
+ } else t6 = $[15];
94
+ const t7 = "h-80 max-h-full min-h-0 w-full shrink-0 overflow-y-auto md:h-72 md:w-80";
95
+ const t8 = years.map((year_2, index) => {
96
+ const isDisabled = isYearDisabled(year_2.value);
97
+ return /* @__PURE__ */ jsx(ListBoxItem, {
98
+ id: index,
99
+ textValue: year_2.formatted,
100
+ isDisabled,
101
+ onPress: () => {
102
+ const isSecondConsecutivePress = lastPressedYearIndexRef.current === index;
103
+ lastPressedYearIndexRef.current = index;
104
+ const nextSelectedDate_0 = state.focusedDate.set({ year: year_2.value });
105
+ state.setFocusedDate(nextSelectedDate_0);
106
+ onDateChange?.(nextSelectedDate_0);
107
+ if (!isSecondConsecutivePress) return;
108
+ if (!selectedDate) return;
109
+ if (selectedYearIndex === null) return;
110
+ if (index !== selectedYearIndex) return;
111
+ onCommit?.();
112
+ },
113
+ className: clsx("flex px-4 py-2 text-interactive-text-secondary-idle outline-none", "border-elevation-outline-default-1 border-b border-solid bg-elevation-fill-default-1 last:border-b-0", "hover:text-interactive-text-secondary-hover", "selected:bg-interactive-contained-primary-idle selected:text-interactive-text-secondary-idle-inverted", "focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted", isDisabled ? "cursor-default opacity-50" : "cursor-pointer"),
114
+ children: /* @__PURE__ */ jsx(Typography, {
115
+ as: "span",
116
+ size: "label-2",
117
+ children: year_2.formatted
118
+ })
119
+ }, index);
97
120
  });
121
+ let t9;
122
+ if ($[16] !== T0 || $[17] !== listBoxSelectionProps || $[18] !== ref || $[19] !== t6 || $[20] !== t8) {
123
+ t9 = /* @__PURE__ */ jsx(T0, {
124
+ ref,
125
+ autoFocus: t3,
126
+ "aria-label": t4,
127
+ selectionMode: t5,
128
+ ...listBoxSelectionProps,
129
+ onSelectionChange: t6,
130
+ className: t7,
131
+ children: t8
132
+ });
133
+ $[16] = T0;
134
+ $[17] = listBoxSelectionProps;
135
+ $[18] = ref;
136
+ $[19] = t6;
137
+ $[20] = t8;
138
+ $[21] = t9;
139
+ } else t9 = $[21];
140
+ return t9;
98
141
  };
142
+ function _temp(key) {
143
+ if (typeof key === "number") return key;
144
+ if (typeof key === "string") {
145
+ const parsedIndex = Number.parseInt(key, 10);
146
+ if (!Number.isNaN(parsedIndex)) return parsedIndex;
147
+ }
148
+ return null;
149
+ }
99
150
  //#endregion
100
151
  export { YearPicker };
@@ -7,29 +7,25 @@ interface StaticSegmentProps {
7
7
  interface StaticCalendarDateSegmentsProps extends StaticSegmentProps {
8
8
  value?: CalendarDate | null;
9
9
  locale: string;
10
- placeholder?: string;
11
10
  shouldForceLeadingZeros?: boolean;
12
11
  }
13
12
  interface StaticCalendarDateTimeSegmentsProps extends StaticSegmentProps {
14
13
  value?: DateValue | null;
15
14
  locale: string;
16
- placeholder?: string;
17
15
  shouldForceLeadingZeros?: boolean;
18
16
  }
19
17
  interface StaticDateRangeSegmentsProps extends StaticSegmentProps {
20
18
  start?: CalendarDate | null;
21
19
  end?: CalendarDate | null;
22
20
  locale: string;
23
- placeholder?: string;
24
21
  shouldForceLeadingZeros?: boolean;
25
22
  }
26
23
  interface StaticTimeSegmentsProps extends StaticSegmentProps {
27
24
  value?: TimeValue | null;
28
25
  locale: string;
29
- placeholder?: string;
30
26
  }
31
- export declare const getStaticCalendarDateSegments: ({ value, locale, placeholder, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticCalendarDateSegmentsProps) => import("react/jsx-runtime").JSX.Element;
32
- export declare const getStaticCalendarDateTimeSegments: ({ value, locale, placeholder, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticCalendarDateTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
33
- export declare const getStaticDateRangeSegments: ({ start, end, locale, placeholder, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticDateRangeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
34
- export declare const getStaticTimeSegments: ({ value, locale, placeholder, isDisabled, hidePlaceholder, }: StaticTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const getStaticCalendarDateSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticCalendarDateSegmentsProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const getStaticCalendarDateTimeSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticCalendarDateTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const getStaticDateRangeSegments: ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticDateRangeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
30
+ export declare const getStaticTimeSegments: ({ value, locale, isDisabled, hidePlaceholder }: StaticTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
35
31
  export {};
@@ -2,26 +2,26 @@ import { DateSegmentItemView } from "./DateSegmentItem.js";
2
2
  import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/inputs/DateTime/shared/staticDateTimeSegments.tsx
5
- var getStaticCalendarDateSegments = ({ value, locale, placeholder, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
5
+ var getStaticCalendarDateSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
6
6
  const hasValue = !!value;
7
- return renderStaticSegments(value ? DateTimeUtils.formatCalendarDateLocalized(value, locale, { shouldForceLeadingZeros }) : placeholder ?? DateTimeUtils.getDatePlaceholder(locale, { shouldForceLeadingZeros }), {
7
+ return renderStaticSegments(value ? DateTimeUtils.formatCalendarDateLocalized(value, locale, { shouldForceLeadingZeros }) : DateTimeUtils.getDatePlaceholder(locale, { shouldForceLeadingZeros }), {
8
8
  isPlaceholder: !hasValue,
9
9
  isInputEmpty: !hasValue,
10
10
  isDisabled,
11
11
  hidePlaceholder
12
12
  });
13
13
  };
14
- var getStaticCalendarDateTimeSegments = ({ value, locale, placeholder, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
14
+ var getStaticCalendarDateTimeSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
15
15
  const hasValue = !!(value && "hour" in value);
16
- return renderStaticSegments(hasValue ? DateTimeUtils.formatCalendarDateTimeLocalized(value, locale, { shouldForceLeadingZeros }) : placeholder ?? DateTimeUtils.getDateTimePlaceholder(locale, { shouldForceLeadingZeros }), {
16
+ return renderStaticSegments(hasValue ? DateTimeUtils.formatCalendarDateTimeLocalized(value, locale, { shouldForceLeadingZeros }) : DateTimeUtils.getDateTimePlaceholder(locale, { shouldForceLeadingZeros }), {
17
17
  isPlaceholder: !hasValue,
18
18
  isInputEmpty: !hasValue,
19
19
  isDisabled,
20
20
  hidePlaceholder
21
21
  });
22
22
  };
23
- var getStaticDateRangeSegments = ({ start, end, locale, placeholder, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
24
- const defaultPlaceholder = placeholder ?? DateTimeUtils.getDatePlaceholder(locale, { shouldForceLeadingZeros });
23
+ var getStaticDateRangeSegments = ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
24
+ const defaultPlaceholder = DateTimeUtils.getDatePlaceholder(locale, { shouldForceLeadingZeros });
25
25
  return /* @__PURE__ */ jsxs(Fragment, { children: [
26
26
  renderStaticSegments(start ? DateTimeUtils.formatCalendarDateLocalized(start, locale, { shouldForceLeadingZeros }) : defaultPlaceholder, {
27
27
  isPlaceholder: !start,
@@ -41,9 +41,9 @@ var getStaticDateRangeSegments = ({ start, end, locale, placeholder, shouldForce
41
41
  })
42
42
  ] });
43
43
  };
44
- var getStaticTimeSegments = ({ value, locale, placeholder, isDisabled, hidePlaceholder }) => {
44
+ var getStaticTimeSegments = ({ value, locale, isDisabled, hidePlaceholder }) => {
45
45
  const hasValue = !!value;
46
- return renderStaticSegments(value ? DateTimeUtils.formatTimeLocalized(value, locale) : placeholder ?? DateTimeUtils.getTimePlaceholder(locale), {
46
+ return renderStaticSegments(value ? DateTimeUtils.formatTimeLocalized(value, locale) : DateTimeUtils.getTimePlaceholder(locale), {
47
47
  isPlaceholder: !hasValue,
48
48
  isInputEmpty: !hasValue,
49
49
  isDisabled,