@povio/ui 2.2.12 → 2.3.0-rc.10

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 (284) 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.d.ts +2 -1
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  56. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  57. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  58. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  60. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  61. package/dist/components/inputs/Checkbox/Checkbox.js +172 -35
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +10 -5
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +121 -20
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +10 -5
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +215 -111
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +11 -5
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +123 -19
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +5 -3
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +448 -104
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +330 -119
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  81. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -3
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +355 -135
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +14 -0
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +97 -11
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +207 -65
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  95. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
  96. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
  97. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
  98. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +6 -0
  99. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +21 -0
  100. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
  101. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
  102. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +31 -0
  103. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +80 -0
  104. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  105. package/dist/components/inputs/File/FileUpload.js +87 -44
  106. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  107. package/dist/components/inputs/File/InputUpload.js +317 -79
  108. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  109. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  110. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  111. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  112. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  113. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  114. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  115. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
  116. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  117. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  118. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  119. package/dist/components/inputs/FormField/FormField.js +119 -37
  120. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  121. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  122. package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
  123. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  124. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  125. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  126. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  127. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
  128. package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
  129. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
  130. package/dist/components/inputs/Input/NumberInput/NumberInput.js +332 -81
  131. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
  132. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
  133. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
  134. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +479 -0
  135. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  136. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -0
  137. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
  138. package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
  139. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
  140. package/dist/components/inputs/Input/TextInput/TextInput.js +321 -80
  141. package/dist/components/inputs/Input/shared/InputContent.js +192 -59
  142. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
  143. package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
  144. package/dist/components/inputs/Inputs/Form.js +40 -11
  145. package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
  146. package/dist/components/inputs/Inputs/InputItem.js +69 -14
  147. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  148. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
  149. package/dist/components/inputs/RadioGroup/RadioGroup.js +352 -60
  150. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
  151. package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
  152. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
  153. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +109 -7
  154. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
  155. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +34 -8
  156. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
  157. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
  158. package/dist/components/inputs/Selection/Select/QuerySelect.js +122 -0
  159. package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
  160. package/dist/components/inputs/Selection/Select/Select.js +132 -5
  161. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
  162. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
  163. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  164. package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
  165. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  166. package/dist/components/inputs/Selection/shared/SelectInput.js +337 -115
  167. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  168. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  169. package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
  170. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  171. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  172. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  173. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  174. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  175. package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
  176. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  177. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  178. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +6 -0
  179. package/dist/components/inputs/Selection/shared/querySelect.utils.js +13 -0
  180. package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
  181. package/dist/components/inputs/Selection/shared/select.context.js +57 -34
  182. package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
  183. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
  184. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
  185. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  186. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  187. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
  188. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
  189. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
  190. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  191. package/dist/components/inputs/Skeleton/InputFrame.d.ts +79 -0
  192. package/dist/components/inputs/Skeleton/InputFrame.js +526 -0
  193. package/dist/components/inputs/Slider/Slider.js +250 -74
  194. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
  195. package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
  196. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  197. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  198. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  199. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  200. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  201. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  202. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  203. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  204. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  205. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  206. package/dist/components/inputs/Toggle/Toggle.js +189 -37
  207. package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
  208. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  209. package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
  210. package/dist/components/inputs/shared/CheckContent.js +21 -11
  211. package/dist/components/inputs/shared/InputClear.d.ts +2 -1
  212. package/dist/components/inputs/shared/InputClear.js +79 -10
  213. package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
  214. package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
  215. package/dist/components/inputs/shared/input.cva.d.ts +10 -0
  216. package/dist/components/inputs/shared/input.cva.js +32 -4
  217. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
  218. package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
  219. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
  220. package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
  221. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  222. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  223. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  224. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  225. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  226. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  227. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  228. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  229. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  230. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  231. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  232. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  233. package/dist/components/segment/Segment.js +218 -57
  234. package/dist/components/segment/SegmentItem.js +67 -10
  235. package/dist/components/shared/pagination/Pagination.js +108 -22
  236. package/dist/components/shared/pagination/PaginationList.js +167 -64
  237. package/dist/components/status/Alert/Alert.js +97 -30
  238. package/dist/components/status/Loader/Loader.js +77 -22
  239. package/dist/components/status/Toast/Toast.js +21 -13
  240. package/dist/components/status/Toast/useToast.js +62 -57
  241. package/dist/components/table/ColumnConfig.js +158 -54
  242. package/dist/components/table/InfiniteTable.js +67 -16
  243. package/dist/components/table/PaginatedTable.js +84 -18
  244. package/dist/components/table/Table.js +28 -27
  245. package/dist/components/text/Link/Link.js +19 -7
  246. package/dist/components/text/Typography/Typography.js +23 -8
  247. package/dist/config/confirmation.context.js +1 -1
  248. package/dist/config/link.context.js +23 -9
  249. package/dist/config/router.context.d.ts +3 -4
  250. package/dist/config/router.context.js +42 -18
  251. package/dist/config/theme.context.js +98 -45
  252. package/dist/config/uiConfig.context.d.ts +15 -3
  253. package/dist/config/uiConfig.context.js +55 -11
  254. package/dist/config/uiStyle.context.d.ts +27 -4
  255. package/dist/config/uiStyle.context.js +15 -5
  256. package/dist/helpers/dynamicInputs.d.ts +5 -5
  257. package/dist/helpers/dynamicInputs.js +3 -0
  258. package/dist/hooks/useBreakpoint.js +16 -3
  259. package/dist/hooks/useDebounceCallback.js +51 -17
  260. package/dist/hooks/useFilters.js +145 -80
  261. package/dist/hooks/useForm.js +42 -8
  262. package/dist/hooks/useFormAutosave.js +101 -30
  263. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  264. package/dist/hooks/useIntersectionObserver.js +91 -24
  265. package/dist/hooks/useLocalStorage.js +43 -10
  266. package/dist/hooks/useLongPressRepeat.js +55 -20
  267. package/dist/hooks/usePagination.js +51 -17
  268. package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
  269. package/dist/hooks/useQueryAutocomplete.js +57 -0
  270. package/dist/hooks/useScrollableListBox.js +37 -16
  271. package/dist/hooks/useSorting.js +71 -27
  272. package/dist/hooks/useStateAndRef.js +21 -7
  273. package/dist/hooks/useTableColumnConfig.js +124 -31
  274. package/dist/hooks/useTranslationMemo.js +25 -5
  275. package/dist/index.d.ts +7 -0
  276. package/dist/index.js +5 -3
  277. package/dist/tw-ui-plugin.js +2 -0
  278. package/dist/utils/date-time.utils.d.ts +31 -10
  279. package/dist/utils/date-time.utils.js +117 -22
  280. package/dist/utils/query.utils.d.ts +4 -0
  281. package/dist/utils/query.utils.js +8 -0
  282. package/dist/utils/routing.utils.d.ts +1 -0
  283. package/dist/utils/routing.utils.js +14 -0
  284. package/package.json +2 -2
@@ -1,166 +1,386 @@
1
- import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
2
- import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
3
1
  import { UIStyle } from "../../../../config/uiStyle.context.js";
4
2
  import { Typography } from "../../../text/Typography/Typography.js";
5
- import { IconButton } from "../../../buttons/IconButton/IconButton.js";
3
+ import { UIConfig } from "../../../../config/uiConfig.context.js";
6
4
  import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
7
- import { TodayIcon } from "../../../../assets/icons/Today.js";
8
5
  import { DateField } from "./DateField.js";
6
+ import { datePickerInputContentRow } from "./datePickerInput.cva.js";
7
+ import { getDatePickerTodayIcon } from "./datePickerTodayIcon.js";
9
8
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
10
9
  import { InputClear } from "../../shared/InputClear.js";
11
10
  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 { useCallback, useImperativeHandle, useRef, useState } from "react";
14
+ import { 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 = ({ 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;
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];
22
35
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
23
36
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
37
+ const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
24
38
  const [canClear, setCanClear] = useState(false);
25
- const { hoverProps, isHovered } = useHover({ isDisabled });
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);
26
46
  const [isFocused, setIsFocused] = useState(false);
27
- const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: (isFocusWithin) => {
28
- setIsFocused(isFocusWithin);
29
- if (!isFocusWithin && autoFixYear) {
30
- dateFieldRef.current?.autoFixYear();
31
- endDateFieldRef.current?.autoFixYear();
32
- }
33
- } });
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);
34
60
  const { isFocusVisible } = useFocusVisible();
35
61
  const dateFieldRef = useRef(null);
36
62
  const endDateFieldRef = useRef(null);
37
63
  const containerRef = useRef(null);
38
- useImperativeHandle(ref, () => ({
39
- clear: () => {
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 = () => {
40
94
  dateFieldRef.current?.clearField();
41
95
  fieldProps.onChange?.(null);
42
96
  endDateFieldRef.current?.clearField();
43
- if (endFieldProps) endFieldProps.onChange?.(null);
97
+ endFieldProps?.onChange?.(null);
44
98
  setCanClear(false);
45
99
  fieldProps.onBlur?.(null);
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
- };
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;
68
128
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
69
- return /* @__PURE__ */ jsxs("div", {
70
- ref: containerRef,
71
- className: clsx(inputBaseCva({
72
- variant,
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, {
73
183
  as,
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
- }),
113
- disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
114
- size: "label-1",
115
- className: "text-text-default-3",
116
- children: placeholder
117
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
118
- ref: dateFieldRef,
119
- ...fieldProps,
120
- isDisabled,
121
- isInvalid,
122
- onClearChange,
123
- hidePlaceholder,
124
- disableManualEntry,
125
- dateGranularity,
126
- isTimeOptional,
127
- format,
128
- timeZone: effectiveTimeZone
129
- }), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
130
- className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
131
- children: "–"
132
- }), /* @__PURE__ */ jsx(DateField, {
133
- ref: endDateFieldRef,
134
- ...endFieldProps,
135
- isDisabled,
136
- isInvalid,
137
- onClearChange,
138
- hidePlaceholder,
139
- disableManualEntry,
140
- isTimeOptional,
141
- format,
142
- timeZone: effectiveTimeZone
143
- })] })] })
144
- ]
145
- })]
146
- }), /* @__PURE__ */ jsxs("div", {
147
- className: clsx(inputSizeCva({
148
- size,
149
- as
150
- }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
151
- children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
152
- onClear,
153
- show: canClear
154
- }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
155
- label: "",
156
- color: "secondary",
157
- ...buttonProps,
158
- icon: isDateTime ? DateTimeIcon : CalendarIcon,
159
- isDisabled,
160
- className: "border-0!"
161
- })]
162
- })]
163
- });
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;
164
384
  };
165
385
  //#endregion
166
386
  export { DatePickerInput };
@@ -1,4 +1,5 @@
1
1
  import { DateFieldState, DateSegment } from '@react-stately/datepicker';
2
+ import { HTMLAttributes, ReactNode, Ref } from 'react';
2
3
  interface DateSegmentProps {
3
4
  state: DateFieldState;
4
5
  segment: DateSegment;
@@ -8,4 +9,17 @@ interface DateSegmentProps {
8
9
  }
9
10
  export declare const getPlaceholder: (segment: DateSegment) => string | null;
10
11
  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;
11
25
  export {};
@@ -1,3 +1,4 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import { clsx } from "clsx";
3
4
  import { useRef } from "react";
@@ -12,20 +13,105 @@ var getPlaceholder = (segment) => {
12
13
  default: return segment.placeholder;
13
14
  }
14
15
  };
15
- var DateSegmentItem = ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }) => {
16
+ var DateSegmentItem = (t0) => {
17
+ const $ = c(12);
18
+ const { segment, state, isDisabled, timePickerOnly, hidePlaceholder } = t0;
16
19
  const ref = useRef(null);
17
20
  const { segmentProps } = useDateSegment(segment, state, ref);
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", {
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", {
24
84
  "aria-hidden": "true",
25
85
  className: "pointer-events-none",
26
- children: getPlaceholder(segment)
27
- }), segment.isPlaceholder ? "" : segment.text] })
28
- });
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;
29
115
  };
30
116
  //#endregion
31
- export { DateSegmentItem, getPlaceholder };
117
+ export { DateSegmentItem, DateSegmentItemView, getPlaceholder };