@povio/ui 2.3.0-rc.9 → 2.3.1

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 (282) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  48. package/dist/components/Menu/Menu.js +2 -18
  49. package/dist/components/Menu/MenuDesktop.js +7 -41
  50. package/dist/components/Menu/MenuItem.js +9 -32
  51. package/dist/components/Menu/MenuMobile.js +38 -97
  52. package/dist/components/Menu/MenuPopover.js +29 -105
  53. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  56. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  57. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  58. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  60. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  61. package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  81. package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  95. package/dist/components/inputs/File/FileUpload.js +44 -87
  96. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  97. package/dist/components/inputs/File/InputUpload.js +79 -317
  98. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  99. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  100. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  101. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  102. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  103. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  104. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  105. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  106. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  107. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  108. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  109. package/dist/components/inputs/FormField/FormField.js +37 -119
  110. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  111. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  112. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  113. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  114. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  115. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  116. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  117. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  118. package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
  119. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  120. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  121. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  122. package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
  123. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  124. package/dist/components/inputs/Inputs/Form.js +11 -40
  125. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
  126. package/dist/components/inputs/Inputs/InputItem.js +14 -71
  127. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  128. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  129. package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
  130. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  131. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  132. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  133. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
  134. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  135. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
  136. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  137. package/dist/components/inputs/Selection/Select/Select.js +5 -132
  138. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  139. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  140. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  141. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  142. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  143. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
  144. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  145. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  146. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  147. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  148. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  149. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  150. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  151. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  152. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  153. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  154. package/dist/components/inputs/Selection/shared/select.context.js +34 -57
  155. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  157. package/dist/components/inputs/Slider/Slider.js +74 -250
  158. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  159. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  160. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  161. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  162. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  163. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  164. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  165. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  166. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  167. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  168. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  169. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  170. package/dist/components/inputs/Toggle/Toggle.js +37 -189
  171. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  172. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  173. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  174. package/dist/components/inputs/shared/CheckContent.js +11 -21
  175. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  176. package/dist/components/inputs/shared/InputClear.js +13 -79
  177. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  178. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  179. package/dist/components/inputs/shared/input.cva.js +4 -32
  180. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  181. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  182. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  183. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  184. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  185. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  186. package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
  187. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  188. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  189. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  190. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  191. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  192. package/dist/components/segment/Segment.js +57 -218
  193. package/dist/components/segment/SegmentItem.js +10 -67
  194. package/dist/components/shared/pagination/Pagination.js +22 -108
  195. package/dist/components/shared/pagination/PaginationList.js +64 -167
  196. package/dist/components/status/Alert/Alert.js +30 -97
  197. package/dist/components/status/Loader/Loader.js +22 -77
  198. package/dist/components/status/Toast/Toast.js +13 -21
  199. package/dist/components/status/Toast/useToast.js +57 -62
  200. package/dist/components/table/ColumnConfig.js +54 -158
  201. package/dist/components/table/InfiniteTable.js +16 -67
  202. package/dist/components/table/PaginatedTable.js +18 -84
  203. package/dist/components/table/Table.js +27 -28
  204. package/dist/components/text/Link/Link.js +7 -19
  205. package/dist/components/text/Typography/Typography.js +8 -23
  206. package/dist/config/confirmation.context.js +1 -1
  207. package/dist/config/link.context.js +9 -23
  208. package/dist/config/router.context.js +16 -42
  209. package/dist/config/theme.context.js +45 -98
  210. package/dist/config/uiConfig.context.d.ts +6 -16
  211. package/dist/config/uiConfig.context.js +13 -56
  212. package/dist/config/uiStyle.context.d.ts +4 -27
  213. package/dist/config/uiStyle.context.js +5 -15
  214. package/dist/helpers/dynamicInputs.d.ts +5 -5
  215. package/dist/helpers/dynamicInputs.js +0 -3
  216. package/dist/hooks/useBreakpoint.js +3 -16
  217. package/dist/hooks/useDebounceCallback.js +17 -51
  218. package/dist/hooks/useFilters.js +64 -125
  219. package/dist/hooks/useForm.js +8 -42
  220. package/dist/hooks/useFormAutosave.js +30 -101
  221. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  222. package/dist/hooks/useIntersectionObserver.js +24 -91
  223. package/dist/hooks/useLocalStorage.js +10 -43
  224. package/dist/hooks/useLongPressRepeat.js +20 -55
  225. package/dist/hooks/usePagination.js +19 -49
  226. package/dist/hooks/useScrollableListBox.js +16 -37
  227. package/dist/hooks/useSorting.js +28 -69
  228. package/dist/hooks/useStateAndRef.js +7 -21
  229. package/dist/hooks/useTableColumnConfig.js +31 -124
  230. package/dist/hooks/useTranslationMemo.js +5 -25
  231. package/dist/index.d.ts +0 -7
  232. package/dist/index.js +3 -5
  233. package/dist/tw-ui-plugin.js +0 -2
  234. package/dist/utils/date-time.utils.d.ts +10 -31
  235. package/dist/utils/date-time.utils.js +22 -123
  236. package/dist/utils/dom.utils.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
  239. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  240. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  241. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
  242. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
  243. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  244. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  245. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
  246. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
  247. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  248. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  249. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  250. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  251. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  252. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
  254. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  255. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  256. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  257. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  258. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  259. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  260. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
  261. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  262. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  263. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
  264. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
  265. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  266. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  267. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  268. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  269. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  270. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  271. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  272. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
  273. package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
  274. package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
  275. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  276. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  277. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  278. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  279. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  280. package/dist/hooks/useQueryAutocomplete.js +0 -57
  281. package/dist/utils/query.utils.d.ts +0 -4
  282. package/dist/utils/query.utils.js +0 -8
@@ -1,386 +1,167 @@
1
+ import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
2
+ import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
1
3
  import { UIStyle } from "../../../../config/uiStyle.context.js";
2
4
  import { Typography } from "../../../text/Typography/Typography.js";
3
- import { UIConfig } from "../../../../config/uiConfig.context.js";
5
+ import { IconButton } from "../../../buttons/IconButton/IconButton.js";
4
6
  import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
7
+ import { TodayIcon } from "../../../../assets/icons/Today.js";
5
8
  import { DateField } from "./DateField.js";
6
- import { datePickerInputContentRow } from "./datePickerInput.cva.js";
7
- import { getDatePickerTodayIcon } from "./datePickerTodayIcon.js";
8
9
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
9
10
  import { InputClear } from "../../shared/InputClear.js";
10
11
  import { inputBase, inputSize } from "../../shared/input.cva.js";
11
- import { c } from "react/compiler-runtime";
12
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { clsx } from "clsx";
14
- import { useImperativeHandle, useRef, useState } from "react";
14
+ import { useCallback, useImperativeHandle, useRef, useState } from "react";
15
15
  import { Button } from "react-aria-components";
16
16
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
17
17
  import { getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
18
18
  //#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
19
- var DatePickerInput = (t0) => {
20
- const $ = c(98);
21
- const { ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone, isTimeOptional: t5, format, ...props } = t0;
22
- const todayIconButtonSize = t1 === void 0 ? "none" : t1;
23
- const todayIconPlacement = t2 === void 0 ? "content" : t2;
24
- const autoFixYear = t3 === void 0 ? false : t3;
25
- const dateGranularity = t4 === void 0 ? "day" : t4;
26
- const isTimeOptional = t5 === void 0 ? false : t5;
27
- const uiConfig = UIConfig.useConfig();
28
- let effectiveTimeZone;
29
- if ($[0] !== timeZone) {
30
- effectiveTimeZone = getLocalTimeZone();
31
- if (timeZone) effectiveTimeZone = timeZone;
32
- $[0] = timeZone;
33
- $[1] = effectiveTimeZone;
34
- } else effectiveTimeZone = $[1];
19
+ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone, autoFixYear, isTimeOptional = false, format, ...props }) => {
20
+ let effectiveTimeZone = getLocalTimeZone();
21
+ if (timeZone) effectiveTimeZone = timeZone;
35
22
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
36
23
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
37
- const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
38
24
  const [canClear, setCanClear] = useState(false);
39
- let t6;
40
- if ($[2] !== isDisabled) {
41
- t6 = { isDisabled };
42
- $[2] = isDisabled;
43
- $[3] = t6;
44
- } else t6 = $[3];
45
- const { hoverProps, isHovered } = useHover(t6);
25
+ const { hoverProps, isHovered } = useHover({ isDisabled });
46
26
  const [isFocused, setIsFocused] = useState(false);
47
- let t7;
48
- if ($[4] !== autoFixYear) {
49
- t7 = { onFocusWithinChange: (isFocusWithin) => {
50
- setIsFocused(isFocusWithin);
51
- if (!isFocusWithin && autoFixYear) {
52
- dateFieldRef.current?.autoFixYear();
53
- endDateFieldRef.current?.autoFixYear();
54
- }
55
- } };
56
- $[4] = autoFixYear;
57
- $[5] = t7;
58
- } else t7 = $[5];
59
- const { focusWithinProps } = useFocusWithin(t7);
27
+ const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: (isFocusWithin) => {
28
+ setIsFocused(isFocusWithin);
29
+ if (!isFocusWithin && autoFixYear) {
30
+ dateFieldRef.current?.autoFixYear();
31
+ endDateFieldRef.current?.autoFixYear();
32
+ }
33
+ } });
60
34
  const { isFocusVisible } = useFocusVisible();
61
35
  const dateFieldRef = useRef(null);
62
36
  const endDateFieldRef = useRef(null);
63
37
  const containerRef = useRef(null);
64
- let t8;
65
- if ($[6] !== endFieldProps || $[7] !== fieldProps) {
66
- t8 = () => ({
67
- clear: () => {
68
- dateFieldRef.current?.clearField();
69
- fieldProps.onChange?.(null);
70
- endDateFieldRef.current?.clearField();
71
- if (endFieldProps) endFieldProps.onChange?.(null);
72
- setCanClear(false);
73
- fieldProps.onBlur?.(null);
74
- endFieldProps?.onBlur?.(null);
75
- },
76
- getContainer: () => containerRef.current
77
- });
78
- $[6] = endFieldProps;
79
- $[7] = fieldProps;
80
- $[8] = t8;
81
- } else t8 = $[8];
82
- useImperativeHandle(ref, t8);
83
- let t9;
84
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
85
- t9 = (canClearInput) => {
86
- setCanClear(canClearInput);
87
- };
88
- $[9] = t9;
89
- } else t9 = $[9];
90
- const onClearChange = t9;
91
- let t10;
92
- if ($[10] !== endFieldProps || $[11] !== fieldProps) {
93
- t10 = () => {
38
+ useImperativeHandle(ref, () => ({
39
+ clear: () => {
94
40
  dateFieldRef.current?.clearField();
95
41
  fieldProps.onChange?.(null);
96
42
  endDateFieldRef.current?.clearField();
97
- endFieldProps?.onChange?.(null);
43
+ if (endFieldProps) endFieldProps.onChange?.(null);
98
44
  setCanClear(false);
99
45
  fieldProps.onBlur?.(null);
100
- endFieldProps?.onBlur?.(null);
101
- };
102
- $[10] = endFieldProps;
103
- $[11] = fieldProps;
104
- $[12] = t10;
105
- } else t10 = $[12];
106
- const onClear = t10;
107
- let t11;
108
- if ($[13] !== effectiveTimeZone || $[14] !== endFieldProps || $[15] !== fieldProps || $[16] !== isDateTime) {
109
- t11 = () => {
110
- if (isDateTime) {
111
- const calendarDateTime = toCalendarDateTime(now(effectiveTimeZone));
112
- fieldProps.onChange?.(calendarDateTime);
113
- if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
114
- } else {
115
- fieldProps.onChange?.(today(effectiveTimeZone));
116
- if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
117
- }
118
- fieldProps.onBlur?.(null);
119
- endFieldProps?.onBlur?.(null);
120
- };
121
- $[13] = effectiveTimeZone;
122
- $[14] = endFieldProps;
123
- $[15] = fieldProps;
124
- $[16] = isDateTime;
125
- $[17] = t11;
126
- } else t11 = $[17];
127
- const onToday = t11;
46
+ },
47
+ getContainer: () => containerRef.current
48
+ }));
49
+ const onClearChange = useCallback((canClearInput) => {
50
+ setCanClear(canClearInput);
51
+ }, []);
52
+ const onClear = () => {
53
+ dateFieldRef.current?.clearField();
54
+ fieldProps.onChange?.(null);
55
+ endDateFieldRef.current?.clearField();
56
+ setCanClear(false);
57
+ };
58
+ const onToday = () => {
59
+ if (isDateTime) {
60
+ const calendarDateTime = toCalendarDateTime(now(effectiveTimeZone));
61
+ fieldProps.onChange?.(calendarDateTime);
62
+ if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
63
+ } else {
64
+ fieldProps.onChange?.(today(effectiveTimeZone));
65
+ if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
66
+ }
67
+ };
128
68
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
129
- let t12;
130
- if ($[18] !== todayIcon) {
131
- t12 = getDatePickerTodayIcon(todayIcon);
132
- $[18] = todayIcon;
133
- $[19] = t12;
134
- } else t12 = $[19];
135
- const todayIconComponent = t12;
136
- let t13;
137
- if ($[20] !== onToday || $[21] !== todayIconButtonSize || $[22] !== todayIconComponent) {
138
- t13 = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
139
- label: "",
140
- icon: todayIconComponent,
141
- size: todayIconButtonSize,
142
- onPress: onToday,
143
- className: "relative z-1 !border-none"
144
- }) : null;
145
- $[20] = onToday;
146
- $[21] = todayIconButtonSize;
147
- $[22] = todayIconComponent;
148
- $[23] = t13;
149
- } else t13 = $[23];
150
- const todayIconButton = t13;
151
- const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
152
- const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
153
- const t14 = clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", inputBaseCva({
154
- variant,
155
- as,
156
- ...props
157
- }), className);
158
- const t15 = isHovered || void 0;
159
- const t16 = isDisabled || void 0;
160
- const t17 = isDisabled || void 0;
161
- const t18 = isInvalid || void 0;
162
- const t19 = fieldProps.value === null || void 0;
163
- const t20 = isFocused || void 0;
164
- const t21 = isFocused && isFocusVisible || void 0;
165
- const t22 = fieldProps.value !== null || void 0;
166
- const t23 = isDirty || void 0;
167
- const t24 = isRequired || void 0;
168
- const t25 = fieldProps.value !== null || void 0;
169
- let t26;
170
- if ($[24] !== as || $[25] !== inputSizeCva || $[26] !== size) {
171
- t26 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
172
- size,
173
- as
174
- }));
175
- $[24] = as;
176
- $[25] = inputSizeCva;
177
- $[26] = size;
178
- $[27] = t26;
179
- } else t26 = $[27];
180
- let t27;
181
- if ($[28] !== as || $[29] !== headerProps) {
182
- t27 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
69
+ return /* @__PURE__ */ jsxs("div", {
70
+ ref: containerRef,
71
+ className: clsx(inputBaseCva({
72
+ variant,
183
73
  as,
184
- ...headerProps
185
- });
186
- $[28] = as;
187
- $[29] = headerProps;
188
- $[30] = t27;
189
- } else t27 = $[30];
190
- const t28 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
191
- let t29;
192
- if ($[31] !== datePickerInputContentRowCva || $[32] !== size) {
193
- t29 = datePickerInputContentRowCva({ size });
194
- $[31] = datePickerInputContentRowCva;
195
- $[32] = size;
196
- $[33] = t29;
197
- } else t29 = $[33];
198
- let t30;
199
- if ($[34] !== disableManualEntry || $[35] !== isDisabled || $[36] !== onOpenDropdown) {
200
- t30 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
201
- onPress: onOpenDropdown,
202
- className: "absolute inset-0 z-0",
203
- isDisabled
204
- });
205
- $[34] = disableManualEntry;
206
- $[35] = isDisabled;
207
- $[36] = onOpenDropdown;
208
- $[37] = t30;
209
- } else t30 = $[37];
210
- const t31 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
211
- let t32;
212
- if ($[38] !== as || $[39] !== dateGranularity || $[40] !== disableManualEntry || $[41] !== effectiveTimeZone || $[42] !== endFieldProps || $[43] !== fieldProps || $[44] !== format || $[45] !== hidePlaceholder || $[46] !== isDisabled || $[47] !== isInvalid || $[48] !== isTimeOptional || $[49] !== onClearChange || $[50] !== placeholder) {
213
- t32 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
214
- size: "label-1",
215
- className: "text-text-default-3",
216
- children: placeholder
217
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
218
- ref: dateFieldRef,
219
- ...fieldProps,
220
- isDisabled,
221
- isInvalid,
222
- onClearChange,
223
- hidePlaceholder,
224
- disableManualEntry,
225
- dateGranularity,
226
- isTimeOptional,
227
- format,
228
- timeZone: effectiveTimeZone
229
- }), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
230
- className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
231
- children: "–"
232
- }), /* @__PURE__ */ jsx(DateField, {
233
- ref: endDateFieldRef,
234
- ...endFieldProps,
235
- isDisabled,
236
- isInvalid,
237
- onClearChange,
238
- hidePlaceholder,
239
- disableManualEntry,
240
- isTimeOptional,
241
- format,
242
- timeZone: effectiveTimeZone
243
- })] })] });
244
- $[38] = as;
245
- $[39] = dateGranularity;
246
- $[40] = disableManualEntry;
247
- $[41] = effectiveTimeZone;
248
- $[42] = endFieldProps;
249
- $[43] = fieldProps;
250
- $[44] = format;
251
- $[45] = hidePlaceholder;
252
- $[46] = isDisabled;
253
- $[47] = isInvalid;
254
- $[48] = isTimeOptional;
255
- $[49] = onClearChange;
256
- $[50] = placeholder;
257
- $[51] = t32;
258
- } else t32 = $[51];
259
- let t33;
260
- if ($[52] !== t29 || $[53] !== t30 || $[54] !== t31 || $[55] !== t32) {
261
- t33 = /* @__PURE__ */ jsxs("div", {
262
- className: t29,
263
- children: [
264
- t30,
265
- t31,
266
- t32
267
- ]
268
- });
269
- $[52] = t29;
270
- $[53] = t30;
271
- $[54] = t31;
272
- $[55] = t32;
273
- $[56] = t33;
274
- } else t33 = $[56];
275
- let t34;
276
- if ($[57] !== t26 || $[58] !== t27 || $[59] !== t28 || $[60] !== t33) {
277
- t34 = /* @__PURE__ */ jsxs("div", {
278
- className: t26,
279
- children: [
280
- t27,
281
- t28,
282
- t33
283
- ]
284
- });
285
- $[57] = t26;
286
- $[58] = t27;
287
- $[59] = t28;
288
- $[60] = t33;
289
- $[61] = t34;
290
- } else t34 = $[61];
291
- let t35;
292
- if ($[62] !== as || $[63] !== inputSizeCva || $[64] !== size) {
293
- t35 = clsx(inputSizeCva({
294
- size,
295
- as
296
- }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
297
- $[62] = as;
298
- $[63] = inputSizeCva;
299
- $[64] = size;
300
- $[65] = t35;
301
- } else t35 = $[65];
302
- let t36;
303
- if ($[66] !== canClear || $[67] !== isClearable || $[68] !== onClear) {
304
- t36 = isClearable && /* @__PURE__ */ jsx(InputClear, {
305
- onClear,
306
- show: canClear
307
- });
308
- $[66] = canClear;
309
- $[67] = isClearable;
310
- $[68] = onClear;
311
- $[69] = t36;
312
- } else t36 = $[69];
313
- let t37;
314
- if ($[70] !== buttonProps || $[71] !== disableDropdown || $[72] !== disableManualEntry || $[73] !== isDisabled || $[74] !== pickerIcon) {
315
- t37 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
316
- label: "",
317
- color: "secondary",
318
- ...buttonProps,
319
- icon: pickerIcon,
320
- isDisabled,
321
- className: "border-0!"
322
- });
323
- $[70] = buttonProps;
324
- $[71] = disableDropdown;
325
- $[72] = disableManualEntry;
326
- $[73] = isDisabled;
327
- $[74] = pickerIcon;
328
- $[75] = t37;
329
- } else t37 = $[75];
330
- let t38;
331
- if ($[76] !== t35 || $[77] !== t36 || $[78] !== t37) {
332
- t38 = /* @__PURE__ */ jsxs("div", {
333
- className: t35,
334
- children: [t36, t37]
335
- });
336
- $[76] = t35;
337
- $[77] = t36;
338
- $[78] = t37;
339
- $[79] = t38;
340
- } else t38 = $[79];
341
- let t39;
342
- if ($[80] !== focusWithinProps || $[81] !== groupProps || $[82] !== hoverProps || $[83] !== t14 || $[84] !== t15 || $[85] !== t16 || $[86] !== t17 || $[87] !== t18 || $[88] !== t19 || $[89] !== t20 || $[90] !== t21 || $[91] !== t22 || $[92] !== t23 || $[93] !== t24 || $[94] !== t25 || $[95] !== t34 || $[96] !== t38) {
343
- t39 = /* @__PURE__ */ jsxs("div", {
344
- ref: containerRef,
345
- className: t14,
346
- "data-rac": "",
347
- "data-datetime-input": "",
348
- "data-hovered": t15,
349
- "data-disabled": t16,
350
- "data-is-disabled": t17,
351
- "data-invalid": t18,
352
- "data-is-empty": t19,
353
- "data-focus-within": t20,
354
- "data-focus-visible": t21,
355
- "data-has-selection": t22,
356
- "data-is-dirty": t23,
357
- "data-is-required": t24,
358
- "data-is-filled": t25,
359
- ...groupProps,
360
- ...focusWithinProps,
361
- ...hoverProps,
362
- children: [t34, t38]
363
- });
364
- $[80] = focusWithinProps;
365
- $[81] = groupProps;
366
- $[82] = hoverProps;
367
- $[83] = t14;
368
- $[84] = t15;
369
- $[85] = t16;
370
- $[86] = t17;
371
- $[87] = t18;
372
- $[88] = t19;
373
- $[89] = t20;
374
- $[90] = t21;
375
- $[91] = t22;
376
- $[92] = t23;
377
- $[93] = t24;
378
- $[94] = t25;
379
- $[95] = t34;
380
- $[96] = t38;
381
- $[97] = t39;
382
- } else t39 = $[97];
383
- return t39;
74
+ ...props
75
+ }), "group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", className),
76
+ "data-rac": "",
77
+ "data-datetime-input": "",
78
+ "data-hovered": isHovered || void 0,
79
+ "data-disabled": isDisabled || void 0,
80
+ "data-invalid": isInvalid || void 0,
81
+ "data-is-empty": fieldProps.value === null || void 0,
82
+ "data-focus-within": isFocused || void 0,
83
+ "data-focus-visible": isFocused && isFocusVisible || void 0,
84
+ "data-has-selection": fieldProps.value !== null || void 0,
85
+ "data-is-dirty": isDirty || void 0,
86
+ "data-is-required": isRequired || void 0,
87
+ ...groupProps,
88
+ ...focusWithinProps,
89
+ ...hoverProps,
90
+ children: [/* @__PURE__ */ jsxs("div", {
91
+ className: clsx(inputSizeCva({
92
+ size,
93
+ as
94
+ }), "flex w-full items-center gap-input-gap-input-text-to-elements pr-0!"),
95
+ children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
96
+ as,
97
+ ...headerProps
98
+ }), /* @__PURE__ */ jsxs("div", {
99
+ className: "flex items-center gap-input-gap-input-text-to-elements",
100
+ children: [
101
+ disableManualEntry && /* @__PURE__ */ jsx(Button, {
102
+ onPress: onOpenDropdown,
103
+ className: "absolute inset-0 z-0",
104
+ isDisabled
105
+ }),
106
+ todayIcon && /* @__PURE__ */ jsx(IconButton, {
107
+ label: "",
108
+ icon: TodayIcon,
109
+ size: "none",
110
+ onPress: onToday,
111
+ className: "relative z-1",
112
+ isDisabled
113
+ }),
114
+ disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
115
+ size: "label-1",
116
+ className: "text-text-default-3",
117
+ children: placeholder
118
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
119
+ ref: dateFieldRef,
120
+ ...fieldProps,
121
+ isDisabled,
122
+ isInvalid,
123
+ onClearChange,
124
+ hidePlaceholder,
125
+ disableManualEntry,
126
+ dateGranularity,
127
+ isTimeOptional,
128
+ format,
129
+ timeZone: effectiveTimeZone
130
+ }), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
131
+ className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
132
+ children: "–"
133
+ }), /* @__PURE__ */ jsx(DateField, {
134
+ ref: endDateFieldRef,
135
+ ...endFieldProps,
136
+ isDisabled,
137
+ isInvalid,
138
+ onClearChange,
139
+ hidePlaceholder,
140
+ disableManualEntry,
141
+ isTimeOptional,
142
+ format,
143
+ timeZone: effectiveTimeZone
144
+ })] })] })
145
+ ]
146
+ })]
147
+ }), /* @__PURE__ */ jsxs("div", {
148
+ className: clsx(inputSizeCva({
149
+ size,
150
+ as
151
+ }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
152
+ children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
153
+ onClear,
154
+ show: canClear
155
+ }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
156
+ label: "",
157
+ color: "secondary",
158
+ ...buttonProps,
159
+ icon: isDateTime ? DateTimeIcon : CalendarIcon,
160
+ isDisabled,
161
+ className: "border-0!"
162
+ })]
163
+ })]
164
+ });
384
165
  };
385
166
  //#endregion
386
167
  export { DatePickerInput };
@@ -1,5 +1,4 @@
1
1
  import { DateFieldState, DateSegment } from '@react-stately/datepicker';
2
- import { HTMLAttributes, ReactNode, Ref } from 'react';
3
2
  interface DateSegmentProps {
4
3
  state: DateFieldState;
5
4
  segment: DateSegment;
@@ -9,17 +8,4 @@ interface DateSegmentProps {
9
8
  }
10
9
  export declare const getPlaceholder: (segment: DateSegment) => string | null;
11
10
  export declare const DateSegmentItem: ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }: DateSegmentProps) => import("react/jsx-runtime").JSX.Element;
12
- interface DateSegmentItemViewProps {
13
- ref?: Ref<HTMLDivElement>;
14
- segmentProps?: HTMLAttributes<HTMLDivElement>;
15
- type?: DateSegment["type"];
16
- text: ReactNode;
17
- placeholder?: ReactNode;
18
- isPlaceholder?: boolean;
19
- isInputEmpty?: boolean;
20
- isDisabled?: boolean;
21
- timePickerOnly?: boolean;
22
- hidePlaceholder?: boolean;
23
- }
24
- export declare const DateSegmentItemView: ({ ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder, }: DateSegmentItemViewProps) => import("react/jsx-runtime").JSX.Element;
25
11
  export {};
@@ -1,4 +1,3 @@
1
- import { c } from "react/compiler-runtime";
2
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
2
  import { clsx } from "clsx";
4
3
  import { useRef } from "react";
@@ -13,105 +12,20 @@ var getPlaceholder = (segment) => {
13
12
  default: return segment.placeholder;
14
13
  }
15
14
  };
16
- var DateSegmentItem = (t0) => {
17
- const $ = c(12);
18
- const { segment, state, isDisabled, timePickerOnly, hidePlaceholder } = t0;
15
+ var DateSegmentItem = ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }) => {
19
16
  const ref = useRef(null);
20
17
  const { segmentProps } = useDateSegment(segment, state, ref);
21
- const t1 = segment.type;
22
- const t2 = segment.text;
23
- let t3;
24
- if ($[0] !== segment) {
25
- t3 = getPlaceholder(segment);
26
- $[0] = segment;
27
- $[1] = t3;
28
- } else t3 = $[1];
29
- const t4 = !state.value;
30
- let t5;
31
- if ($[2] !== hidePlaceholder || $[3] !== isDisabled || $[4] !== segment.isPlaceholder || $[5] !== segment.text || $[6] !== segment.type || $[7] !== segmentProps || $[8] !== t3 || $[9] !== t4 || $[10] !== timePickerOnly) {
32
- t5 = /* @__PURE__ */ jsx(DateSegmentItemView, {
33
- ref,
34
- segmentProps,
35
- type: t1,
36
- text: t2,
37
- placeholder: t3,
38
- isPlaceholder: segment.isPlaceholder,
39
- isInputEmpty: t4,
40
- isDisabled,
41
- timePickerOnly,
42
- hidePlaceholder
43
- });
44
- $[2] = hidePlaceholder;
45
- $[3] = isDisabled;
46
- $[4] = segment.isPlaceholder;
47
- $[5] = segment.text;
48
- $[6] = segment.type;
49
- $[7] = segmentProps;
50
- $[8] = t3;
51
- $[9] = t4;
52
- $[10] = timePickerOnly;
53
- $[11] = t5;
54
- } else t5 = $[11];
55
- return t5;
56
- };
57
- var DateSegmentItemView = (t0) => {
58
- const $ = c(20);
59
- const { ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
60
- const t1 = isDisabled && "text-interactive-text-secondary-disabled";
61
- const t2 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
62
- const t3 = !isDisabled && !isInputEmpty && "text-text-default-1";
63
- let t4;
64
- if ($[0] !== timePickerOnly || $[1] !== type) {
65
- t4 = type && ["hour", "dayPeriod"].includes(type) && !timePickerOnly && "ml-1";
66
- $[0] = timePickerOnly;
67
- $[1] = type;
68
- $[2] = t4;
69
- } else t4 = $[2];
70
- const t5 = hidePlaceholder && "opacity-0";
71
- let t6;
72
- if ($[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== t5) {
73
- t6 = clsx("box-content rounded-input-rounding-default", t1, t2, t3, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t4, t5);
74
- $[3] = t1;
75
- $[4] = t2;
76
- $[5] = t3;
77
- $[6] = t4;
78
- $[7] = t5;
79
- $[8] = t6;
80
- } else t6 = $[8];
81
- let t7;
82
- if ($[9] !== isPlaceholder || $[10] !== placeholder) {
83
- t7 = isPlaceholder && /* @__PURE__ */ jsx("span", {
18
+ const isInputEmpty = !state.value;
19
+ return /* @__PURE__ */ jsx("div", {
20
+ ...segmentProps,
21
+ ref,
22
+ className: clsx("box-content rounded-input-rounding-default", isDisabled && "text-interactive-text-secondary-disabled", !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1", !isDisabled && !isInputEmpty && "text-text-default-1", "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", ["hour", "dayPeriod"].includes(segment.type) && !timePickerOnly && "ml-1", hidePlaceholder && "opacity-0"),
23
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [segment.isPlaceholder && /* @__PURE__ */ jsx("span", {
84
24
  "aria-hidden": "true",
85
25
  className: "pointer-events-none",
86
- children: placeholder
87
- });
88
- $[9] = isPlaceholder;
89
- $[10] = placeholder;
90
- $[11] = t7;
91
- } else t7 = $[11];
92
- const t8 = isPlaceholder ? "" : text;
93
- let t9;
94
- if ($[12] !== t7 || $[13] !== t8) {
95
- t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
96
- $[12] = t7;
97
- $[13] = t8;
98
- $[14] = t9;
99
- } else t9 = $[14];
100
- let t10;
101
- if ($[15] !== ref || $[16] !== segmentProps || $[17] !== t6 || $[18] !== t9) {
102
- t10 = /* @__PURE__ */ jsx("div", {
103
- ...segmentProps,
104
- ref,
105
- className: t6,
106
- children: t9
107
- });
108
- $[15] = ref;
109
- $[16] = segmentProps;
110
- $[17] = t6;
111
- $[18] = t9;
112
- $[19] = t10;
113
- } else t10 = $[19];
114
- return t10;
26
+ children: getPlaceholder(segment)
27
+ }), segment.isPlaceholder ? "" : segment.text] })
28
+ });
115
29
  };
116
30
  //#endregion
117
- export { DateSegmentItem, DateSegmentItemView, getPlaceholder };
31
+ export { DateSegmentItem, getPlaceholder };