@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,231 +1,89 @@
1
+ import { ClockIcon } from "../../../../assets/icons/Clock.js";
1
2
  import { UIStyle } from "../../../../config/uiStyle.context.js";
2
3
  import { Typography } from "../../../text/Typography/Typography.js";
3
- import { UIConfig } from "../../../../config/uiConfig.context.js";
4
4
  import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
5
5
  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";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
11
10
  import { clsx } from "clsx";
12
11
  import { useState } from "react";
13
12
  import { Button } from "react-aria-components";
14
13
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
15
14
  //#region src/components/inputs/DateTime/shared/TimePickerInput.tsx
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;
19
- const uiConfig = UIConfig.useConfig();
15
+ var TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, ...props }) => {
20
16
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
21
17
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
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);
18
+ const { hoverProps, isHovered } = useHover({ isDisabled });
29
19
  const [isFocused, setIsFocused] = useState(false);
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);
20
+ const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
36
21
  const { isFocusVisible } = useFocusVisible();
37
22
  const hidePlaceholder = as === "floating" && !state.value && !isFocused;
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, {
23
+ const canClear = state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false);
24
+ return /* @__PURE__ */ jsxs("div", {
25
+ ref,
26
+ className: clsx(inputBaseCva({
27
+ variant,
85
28
  as,
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,
29
+ ...props
30
+ }), "group/date-picker-content relative min-w-input-width-min-width", "flex items-center justify-between gap-input-gap-input-text-to-elements", className),
31
+ "data-rac": "",
32
+ "data-datetime-input": "",
33
+ "data-hovered": isHovered || void 0,
34
+ "data-disabled": isDisabled || void 0,
35
+ "data-invalid": isInvalid || void 0,
36
+ "data-is-empty": state.value === null || void 0,
37
+ "data-focus-within": isFocused || void 0,
38
+ "data-focus-visible": isFocused && isFocusVisible || void 0,
39
+ "data-has-selection": state.value !== null || void 0,
40
+ "data-is-dirty": isDirty || void 0,
41
+ ...fieldProps,
42
+ ...focusWithinProps,
43
+ ...hoverProps,
44
+ children: [/* @__PURE__ */ jsxs("div", {
45
+ className: clsx(inputSizeCva({
46
+ size,
47
+ as
48
+ }), "flex w-full items-center gap-input-gap-input-text-to-elements pr-0!"),
116
49
  children: [
117
- t17,
118
- t18,
119
- t19
50
+ disableManualEntry && /* @__PURE__ */ jsx(Button, {
51
+ onPress,
52
+ className: "absolute inset-0 z-0"
53
+ }),
54
+ as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
55
+ as,
56
+ ...headerProps
57
+ }),
58
+ /* @__PURE__ */ jsx("div", { children: disableManualEntry && placeholder && !state.value ? /* @__PURE__ */ jsx(Typography, {
59
+ size: "label-1",
60
+ className: "text-text-default-3",
61
+ children: placeholder
62
+ }) : /* @__PURE__ */ jsx(TimeField, {
63
+ fieldProps,
64
+ state,
65
+ isDisabled,
66
+ hidePlaceholder
67
+ }) })
120
68
  ]
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;
69
+ }), /* @__PURE__ */ jsxs("div", {
70
+ className: clsx(inputSizeCva({
71
+ size,
72
+ as
73
+ }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
74
+ children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
75
+ onClear: () => state.setValue(null),
76
+ show: canClear
77
+ }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
78
+ label: "",
79
+ color: "secondary",
80
+ onPress,
81
+ icon: ClockIcon,
82
+ isDisabled,
83
+ className: "border-0!"
84
+ })]
85
+ })]
86
+ });
226
87
  };
227
- function _temp(segment) {
228
- return segment.type !== "literal" && segment.isPlaceholder === false;
229
- }
230
88
  //#endregion
231
89
  export { TimePickerInput };
@@ -1,29 +1,19 @@
1
1
  import { Typography } from "../../../text/Typography/Typography.js";
2
2
  import { useScrollableListBox } from "../../../../hooks/useScrollableListBox.js";
3
- import { c } from "react/compiler-runtime";
4
3
  import { jsx } from "react/jsx-runtime";
5
4
  import { clsx } from "clsx";
6
- import { useRef } from "react";
5
+ import { useMemo, useRef } from "react";
7
6
  import { ListBox, ListBoxItem } from "react-aria-components";
8
7
  import { today } from "@internationalized/date";
9
8
  import { useDateFormatter } from "@react-aria/i18n";
10
9
  //#region src/components/inputs/DateTime/shared/YearPicker.tsx
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 = [];
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 = [];
27
17
  for (let i = -100; i <= 100; i++) {
28
18
  const date = today(state.timeZone).add({ years: i });
29
19
  arr.push({
@@ -31,121 +21,80 @@ var YearPicker = (t0) => {
31
21
  formatted: formatter.format(date.toDate(state.timeZone))
32
22
  });
33
23
  }
34
- $[2] = formatter;
35
- $[3] = state.timeZone;
36
- $[4] = arr;
37
- } else arr = $[4];
38
- const years = arr;
24
+ return arr;
25
+ }, [state.timeZone, formatter]);
39
26
  const isYearDisabled = (year) => {
40
27
  if (state.minValue && year < state.minValue.year) return true;
41
28
  if (state.maxValue && year > state.maxValue.year) return true;
42
29
  return false;
43
30
  };
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();
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();
61
41
  const lastPressedYearIndexRef = useRef(null);
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;
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
+ };
70
52
  const { ref } = useScrollableListBox();
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];
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];
80
62
  const selectedYearIndexValue = parseYearIndexFromKey(selectedKey);
81
63
  if (selectedYearIndexValue !== null && years[selectedYearIndexValue]) {
82
64
  const nextSelectedDate = state.focusedDate.set({ year: years[selectedYearIndexValue].value });
83
65
  state.setFocusedDate(nextSelectedDate);
84
66
  onDateChange?.(nextSelectedDate);
85
67
  }
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);
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
+ })
120
97
  });
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;
141
98
  };
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
- }
150
99
  //#endregion
151
100
  export { YearPicker };