@povio/ui 2.3.0 → 2.3.2-rc.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 (286) 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.d.ts +1 -0
  62. package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
  63. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  64. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
  65. package/dist/components/inputs/Checkbox/checkbox.cva.js +4 -1
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +11 -5
  67. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +364 -76
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +11 -5
  69. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +452 -167
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +12 -5
  71. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +269 -57
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +6 -3
  73. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +605 -130
  74. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
  75. package/dist/components/inputs/DateTime/shared/Calendar.js +332 -119
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +3 -2
  77. package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +3 -2
  79. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
  80. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  81. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  82. package/dist/components/inputs/DateTime/shared/DateField.js +311 -112
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +12 -3
  84. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +382 -138
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
  86. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  88. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  89. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  90. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  91. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  92. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
  94. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +210 -65
  95. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  96. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
  97. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
  98. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
  99. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +14 -0
  100. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +117 -0
  101. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
  102. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
  103. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +39 -0
  104. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
  105. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  106. package/dist/components/inputs/File/FileUpload.js +87 -44
  107. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  108. package/dist/components/inputs/File/InputUpload.js +317 -79
  109. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  110. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  111. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  112. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  113. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  114. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  115. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  116. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
  117. package/dist/components/inputs/File/shared/InputUploadFilled.js +50 -9
  118. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  119. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  120. package/dist/components/inputs/FormField/FormField.js +119 -37
  121. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  122. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  123. package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
  124. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  125. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  126. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  127. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  128. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
  129. package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
  130. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
  131. package/dist/components/inputs/Input/NumberInput/NumberInput.js +450 -95
  132. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
  133. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
  134. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
  135. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +575 -0
  136. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  137. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -0
  138. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
  139. package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
  140. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
  141. package/dist/components/inputs/Input/TextInput/TextInput.js +421 -91
  142. package/dist/components/inputs/Input/shared/InputContent.js +192 -59
  143. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
  144. package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
  145. package/dist/components/inputs/Inputs/Form.js +40 -11
  146. package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
  147. package/dist/components/inputs/Inputs/InputItem.js +69 -14
  148. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  149. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
  150. package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -60
  151. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
  152. package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
  153. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
  154. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +213 -22
  155. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
  156. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +34 -8
  157. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
  158. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
  159. package/dist/components/inputs/Selection/Select/QuerySelect.js +104 -0
  160. package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
  161. package/dist/components/inputs/Selection/Select/Select.js +224 -18
  162. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
  163. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
  164. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  165. package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
  166. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  167. package/dist/components/inputs/Selection/shared/SelectInput.js +330 -116
  168. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  169. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  170. package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
  171. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  172. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  173. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  174. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  175. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  176. package/dist/components/inputs/Selection/shared/SelectMobile.js +12 -5
  177. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  178. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  179. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +7 -0
  180. package/dist/components/inputs/Selection/shared/querySelect.utils.js +24 -0
  181. package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
  182. package/dist/components/inputs/Selection/shared/select.context.js +67 -36
  183. package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
  184. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
  185. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
  186. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  187. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  188. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
  189. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
  190. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
  191. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  192. package/dist/components/inputs/Skeleton/InputFrame.d.ts +80 -0
  193. package/dist/components/inputs/Skeleton/InputFrame.js +528 -0
  194. package/dist/components/inputs/Slider/Slider.d.ts +2 -1
  195. package/dist/components/inputs/Slider/Slider.js +265 -75
  196. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
  197. package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
  198. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  199. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  200. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  201. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  202. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  203. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  204. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  205. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  206. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  207. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  208. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
  209. package/dist/components/inputs/Toggle/Toggle.js +214 -37
  210. package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
  211. package/dist/components/inputs/Toggle/toggle.cva.js +4 -2
  212. package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
  213. package/dist/components/inputs/shared/CheckContent.js +21 -11
  214. package/dist/components/inputs/shared/InputClear.d.ts +2 -1
  215. package/dist/components/inputs/shared/InputClear.js +89 -10
  216. package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
  217. package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
  218. package/dist/components/inputs/shared/input.cva.d.ts +10 -0
  219. package/dist/components/inputs/shared/input.cva.js +54 -14
  220. package/dist/components/inputs/shared/label.cva.js +2 -2
  221. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
  222. package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
  223. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
  224. package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
  225. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  226. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  227. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  228. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  229. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  230. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  231. package/dist/components/overlays/BottomSheet/BottomSheet.js +122 -25
  232. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  233. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  234. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  235. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  236. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  237. package/dist/components/segment/Segment.js +218 -57
  238. package/dist/components/segment/SegmentItem.js +67 -10
  239. package/dist/components/shared/pagination/Pagination.js +108 -22
  240. package/dist/components/shared/pagination/PaginationList.js +167 -64
  241. package/dist/components/status/Alert/Alert.js +97 -30
  242. package/dist/components/status/Loader/Loader.js +77 -22
  243. package/dist/components/status/Toast/Toast.js +21 -13
  244. package/dist/components/status/Toast/useToast.js +62 -57
  245. package/dist/components/table/ColumnConfig.js +158 -54
  246. package/dist/components/table/InfiniteTable.js +67 -16
  247. package/dist/components/table/PaginatedTable.js +84 -18
  248. package/dist/components/table/Table.js +28 -27
  249. package/dist/components/text/Link/Link.js +19 -7
  250. package/dist/components/text/Typography/Typography.js +23 -8
  251. package/dist/config/confirmation.context.js +1 -1
  252. package/dist/config/link.context.js +23 -9
  253. package/dist/config/router.context.js +42 -16
  254. package/dist/config/theme.context.js +98 -45
  255. package/dist/config/uiConfig.context.d.ts +21 -7
  256. package/dist/config/uiConfig.context.js +68 -15
  257. package/dist/config/uiStyle.context.d.ts +27 -4
  258. package/dist/config/uiStyle.context.js +15 -5
  259. package/dist/helpers/dynamicInputs.d.ts +5 -5
  260. package/dist/helpers/dynamicInputs.js +3 -0
  261. package/dist/hooks/useBreakpoint.js +16 -3
  262. package/dist/hooks/useDebounceCallback.js +51 -17
  263. package/dist/hooks/useFilters.js +125 -64
  264. package/dist/hooks/useForm.js +42 -8
  265. package/dist/hooks/useFormAutosave.js +101 -30
  266. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  267. package/dist/hooks/useIntersectionObserver.js +91 -24
  268. package/dist/hooks/useLocalStorage.js +43 -10
  269. package/dist/hooks/useLongPressRepeat.js +55 -20
  270. package/dist/hooks/usePagination.js +49 -19
  271. package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
  272. package/dist/hooks/useQueryAutocomplete.js +57 -0
  273. package/dist/hooks/useScrollableListBox.js +37 -16
  274. package/dist/hooks/useSorting.js +69 -28
  275. package/dist/hooks/useStateAndRef.js +21 -7
  276. package/dist/hooks/useTableColumnConfig.js +124 -31
  277. package/dist/hooks/useTranslationMemo.js +25 -5
  278. package/dist/index.d.ts +7 -0
  279. package/dist/index.js +4 -2
  280. package/dist/tw-ui-plugin.js +8 -1
  281. package/dist/utils/date-time.utils.d.ts +38 -10
  282. package/dist/utils/date-time.utils.js +134 -22
  283. package/dist/utils/dom.utils.js +1 -1
  284. package/dist/utils/query.utils.d.ts +4 -0
  285. package/dist/utils/query.utils.js +8 -0
  286. package/package.json +1 -1
@@ -0,0 +1,117 @@
1
+ import { UIStyle } from "../../../../config/uiStyle.context.js";
2
+ import { UIConfig } from "../../../../config/uiConfig.context.js";
3
+ import { button, buttonContent, buttonIconSize, buttonSize } from "../../../buttons/Button/button.cva.js";
4
+ import { IconButton } from "../../../buttons/IconButton/IconButton.js";
5
+ import { TodayIcon } from "../../../../assets/icons/Today.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { clsx } from "clsx";
9
+ import { cloneElement, isValidElement } from "react";
10
+ //#region src/components/inputs/DateTime/shared/datePickerTodayIcon.tsx
11
+ var getDatePickerTodayIcon = (todayIcon) => {
12
+ if (!todayIcon) return null;
13
+ return todayIcon === true ? TodayIcon : todayIcon;
14
+ };
15
+ var renderDatePickerTodayIcon = (todayIcon, options) => {
16
+ const icon = getDatePickerTodayIcon(todayIcon);
17
+ if (!icon) return;
18
+ const { className, isDisabled, onPress, renderStatic, size = "none" } = options ?? {};
19
+ const todayIconClassName = className ?? "relative z-1";
20
+ if (renderStatic) return /* @__PURE__ */ jsx(StaticDatePickerTodayIcon, {
21
+ icon,
22
+ className: todayIconClassName,
23
+ isDisabled,
24
+ size
25
+ });
26
+ return /* @__PURE__ */ jsx(IconButton, {
27
+ label: "",
28
+ icon,
29
+ size,
30
+ isDisabled,
31
+ onPress,
32
+ className: todayIconClassName
33
+ });
34
+ };
35
+ var StaticDatePickerTodayIcon = (t0) => {
36
+ const $ = c(19);
37
+ const { icon, className, isDisabled, size } = t0;
38
+ const uiConfig = UIConfig.useConfig();
39
+ const buttonCva = UIStyle.useCva("button.cva", button);
40
+ const buttonSizeCva = UIStyle.useCva("button.sizeCva", buttonSize);
41
+ const buttonContentCva = UIStyle.useCva("button.contentCva", buttonContent);
42
+ const buttonIconSizeCva = UIStyle.useCva("button.iconSize", buttonIconSize);
43
+ let t1;
44
+ if ($[0] !== buttonIconSizeCva || $[1] !== icon || $[2] !== size) {
45
+ const iconClassName = buttonIconSizeCva({
46
+ size,
47
+ className: "shrink-0"
48
+ });
49
+ bb0: {
50
+ if (isValidElement(icon)) {
51
+ t1 = cloneElement(icon, { className: clsx(iconClassName, icon.props.className) });
52
+ break bb0;
53
+ }
54
+ const Icon = icon;
55
+ let t2;
56
+ if ($[4] !== Icon || $[5] !== iconClassName) {
57
+ t2 = /* @__PURE__ */ jsx(Icon, { className: iconClassName });
58
+ $[4] = Icon;
59
+ $[5] = iconClassName;
60
+ $[6] = t2;
61
+ } else t2 = $[6];
62
+ t1 = t2;
63
+ }
64
+ $[0] = buttonIconSizeCva;
65
+ $[1] = icon;
66
+ $[2] = size;
67
+ $[3] = t1;
68
+ } else t1 = $[3];
69
+ const renderedIcon = t1;
70
+ const variant = uiConfig.button.variant;
71
+ let t2;
72
+ if ($[7] !== buttonContentCva || $[8] !== buttonCva || $[9] !== buttonSizeCva || $[10] !== className || $[11] !== size || $[12] !== variant) {
73
+ t2 = clsx(buttonCva({
74
+ className,
75
+ size,
76
+ variant,
77
+ width: "hug"
78
+ }), buttonSizeCva({
79
+ iconOnly: true,
80
+ size
81
+ }), buttonContentCva({
82
+ iconOnly: true,
83
+ iconPosition: "left",
84
+ size
85
+ }));
86
+ $[7] = buttonContentCva;
87
+ $[8] = buttonCva;
88
+ $[9] = buttonSizeCva;
89
+ $[10] = className;
90
+ $[11] = size;
91
+ $[12] = variant;
92
+ $[13] = t2;
93
+ } else t2 = $[13];
94
+ let t3;
95
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
96
+ t3 = /* @__PURE__ */ jsx("span", { className: "sr-only" });
97
+ $[14] = t3;
98
+ } else t3 = $[14];
99
+ let t4;
100
+ if ($[15] !== isDisabled || $[16] !== renderedIcon || $[17] !== t2) {
101
+ t4 = /* @__PURE__ */ jsxs("button", {
102
+ type: "button",
103
+ "aria-hidden": "true",
104
+ tabIndex: -1,
105
+ disabled: isDisabled,
106
+ className: t2,
107
+ children: [renderedIcon, t3]
108
+ });
109
+ $[15] = isDisabled;
110
+ $[16] = renderedIcon;
111
+ $[17] = t2;
112
+ $[18] = t4;
113
+ } else t4 = $[18];
114
+ return t4;
115
+ };
116
+ //#endregion
117
+ export { renderDatePickerTodayIcon };
@@ -0,0 +1,2 @@
1
+ import { DateSegment } from '@react-stately/datepicker';
2
+ export declare const getTimeSegmentValue: (segment: DateSegment | undefined, fallbackValue?: number) => number;
@@ -0,0 +1,39 @@
1
+ import { CalendarDate } from '@internationalized/date';
2
+ import { ReactNode } from 'react';
3
+ import { DateValue, TimeValue } from 'react-aria';
4
+ interface StaticSegmentProps {
5
+ isDisabled?: boolean;
6
+ hidePlaceholder?: boolean;
7
+ }
8
+ interface StaticManualEntryPlaceholderProps {
9
+ disableManualEntry?: boolean;
10
+ placeholder?: ReactNode;
11
+ }
12
+ type StaticDateGranularity = "day" | "month" | "year";
13
+ interface StaticCalendarDateSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
14
+ value?: CalendarDate | null;
15
+ locale: string;
16
+ shouldForceLeadingZeros?: boolean;
17
+ dateGranularity?: StaticDateGranularity;
18
+ }
19
+ interface StaticCalendarDateTimeSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
20
+ value?: DateValue | null;
21
+ locale: string;
22
+ shouldForceLeadingZeros?: boolean;
23
+ }
24
+ interface StaticDateRangeSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
25
+ start?: CalendarDate | null;
26
+ end?: CalendarDate | null;
27
+ locale: string;
28
+ shouldForceLeadingZeros?: boolean;
29
+ }
30
+ interface StaticTimeSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
31
+ value?: TimeValue | null;
32
+ locale: string;
33
+ }
34
+ export declare const getStaticCalendarDateSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, dateGranularity, }: StaticCalendarDateSegmentsProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const getStaticCalendarDateTimeSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, }: StaticCalendarDateTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
36
+ export declare const getStaticDateRangeSegments: ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, }: StaticDateRangeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const getStaticTimeSegments: ({ value, locale, isDisabled, hidePlaceholder, disableManualEntry, placeholder, }: StaticTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const getStaticDateTimePlaceholder: (placeholder: ReactNode) => import("react/jsx-runtime").JSX.Element;
39
+ export {};
@@ -0,0 +1,85 @@
1
+ import { Typography } from "../../../text/Typography/Typography.js";
2
+ import { DateSegmentItemView } from "./DateSegmentItem.js";
3
+ import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/inputs/DateTime/shared/staticDateTimeSegments.tsx
6
+ var getStaticCalendarDateSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, dateGranularity = "day" }) => {
7
+ if (disableManualEntry && placeholder && !value) return getStaticDateTimePlaceholder(placeholder);
8
+ return renderStaticDateTimeParts(DateTimeUtils.formatCalendarDatePartsLocalized(value, locale, { shouldForceLeadingZeros }), {
9
+ isDisabled,
10
+ hidePlaceholder,
11
+ dateGranularity
12
+ });
13
+ };
14
+ var getStaticCalendarDateTimeSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder }) => {
15
+ const hasValue = !!(value && "hour" in value);
16
+ if (disableManualEntry && placeholder && !hasValue) return getStaticDateTimePlaceholder(placeholder);
17
+ return renderStaticDateTimeParts(DateTimeUtils.formatCalendarDateTimePartsLocalized(hasValue ? value : null, locale, { shouldForceLeadingZeros }), {
18
+ isDisabled,
19
+ hidePlaceholder,
20
+ segmentRole: "spinbutton"
21
+ });
22
+ };
23
+ var getStaticDateRangeSegments = ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder }) => {
24
+ if (disableManualEntry && placeholder && !start && !end) return getStaticDateTimePlaceholder(placeholder);
25
+ const showSeparator = !hidePlaceholder;
26
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
27
+ renderStaticDateTimeParts(DateTimeUtils.formatCalendarDatePartsLocalized(start, locale, { shouldForceLeadingZeros }), {
28
+ isDisabled,
29
+ hidePlaceholder: hidePlaceholder && !start
30
+ }),
31
+ showSeparator && /* @__PURE__ */ jsx("span", {
32
+ className: isDisabled ? "pointer-events-none select-none text-interactive-text-secondary-disabled" : "pointer-events-none select-none",
33
+ children: "–"
34
+ }),
35
+ renderStaticDateTimeParts(DateTimeUtils.formatCalendarDatePartsLocalized(end, locale, { shouldForceLeadingZeros }), {
36
+ isDisabled,
37
+ hidePlaceholder: hidePlaceholder && !end
38
+ })
39
+ ] });
40
+ };
41
+ var getStaticTimeSegments = ({ value, locale, isDisabled, hidePlaceholder, disableManualEntry, placeholder }) => {
42
+ if (disableManualEntry && placeholder && !value) return getStaticDateTimePlaceholder(placeholder);
43
+ return renderStaticDateTimeParts(DateTimeUtils.formatTimePartsLocalized(value, locale), {
44
+ isDisabled,
45
+ hidePlaceholder,
46
+ timePickerOnly: true
47
+ });
48
+ };
49
+ var getStaticDateTimePlaceholder = (placeholder) => /* @__PURE__ */ jsx(Typography, {
50
+ size: "label-1",
51
+ className: "text-text-default-3",
52
+ children: placeholder
53
+ });
54
+ var renderStaticDateTimeParts = (parts, options) => {
55
+ return /* @__PURE__ */ jsx("div", {
56
+ className: "flex",
57
+ children: getStaticDateTimePartsToRender(parts, options.dateGranularity).map((part, index) => /* @__PURE__ */ jsx(DateSegmentItemView, {
58
+ type: part.type,
59
+ text: part.value,
60
+ placeholder: part.placeholder,
61
+ isPlaceholder: part.isPlaceholder && part.type !== "literal",
62
+ isInputEmpty: parts.some((item) => item.type !== "literal" && item.isPlaceholder),
63
+ isDisabled: options.isDisabled,
64
+ timePickerOnly: options.timePickerOnly,
65
+ hidePlaceholder: options.hidePlaceholder,
66
+ role: part.type === "literal" ? void 0 : options.segmentRole
67
+ }, index))
68
+ });
69
+ };
70
+ var getStaticDateTimePartsToRender = (parts, dateGranularity = "day") => {
71
+ const segments = [];
72
+ for (const part of parts) if (part.type !== "literal") {
73
+ if (isStaticDatePartVisible(part.type, dateGranularity)) segments.push(part);
74
+ } else if (segments.length > 0 && segments.at(-1)?.type !== "literal") segments.push(part);
75
+ if (segments.at(-1)?.type === "literal") segments.pop();
76
+ return segments;
77
+ };
78
+ var isStaticDatePartVisible = (type, dateGranularity) => {
79
+ if (dateGranularity === "day") return true;
80
+ if (dateGranularity === "month") return type !== "day";
81
+ if (dateGranularity === "year") return type === "year";
82
+ return true;
83
+ };
84
+ //#endregion
85
+ export { getStaticCalendarDateSegments, getStaticCalendarDateTimeSegments, getStaticDateRangeSegments, getStaticTimeSegments };
@@ -6,6 +6,7 @@ import { FileCardList } from "./shared/FileCardList.js";
6
6
  import { FileUploadContentEmpty } from "./shared/FileUploadContentEmpty.js";
7
7
  import { FileUploadContent } from "./shared/FileUploadContent.js";
8
8
  import { fileUploadDropZone } from "./shared/fileUpload.cva.js";
9
+ import { c } from "react/compiler-runtime";
9
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
11
  import { clsx } from "clsx";
11
12
  import { useCallback, useState } from "react";
@@ -16,7 +17,7 @@ import { Controller } from "react-hook-form";
16
17
  //#region src/components/inputs/File/FileUpload.tsx
17
18
  var FileUploadBase = (props) => {
18
19
  const { t } = useTranslation("ui");
19
- const { ref: _ref, label, tooltipText, variant = "vertical", as = "button", helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, allowsMultiple = false, hideLabel, acceptedFileTypes, clearOnSuccess, emptyText = t(($) => $.ui.fileUpload.emptyText), uploadText = t(($) => $.ui.fileUpload.uploadText), browseText = t(($) => $.ui.fileUpload.browse), fileUpload, fileRemove, children, listRenderer, onInvalidFileType, defaultState, ...rest } = props;
20
+ const { ref: _ref, label, tooltipText, variant = "vertical", as = "button", helperText, isRequired, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, className, allowsMultiple = false, hideLabel, acceptedFileTypes, clearOnSuccess, emptyText = t(($) => $.ui.fileUpload.emptyText), uploadText = t(($_0) => $_0.ui.fileUpload.uploadText), browseText = t(($_1) => $_1.ui.fileUpload.browse), fileUpload, fileRemove, children, listRenderer, onInvalidFileType, defaultState, ...rest } = props;
20
21
  const ui = UIConfig.useConfig();
21
22
  const getInitialState = () => {
22
23
  if (props.value != null && props.value.length > 0) return props.value;
@@ -46,76 +47,76 @@ var FileUploadBase = (props) => {
46
47
  const labelProps = useLabels({ "aria-label": label });
47
48
  const handleUpload = async (inputFiles) => {
48
49
  const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
49
- const invalidFiles = inputFiles.filter((file) => !FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
50
- if (invalidFiles.length > 0) if (allowsMultiple) onInvalidFileType?.(invalidFiles.map((file) => file.name));
50
+ const invalidFiles = inputFiles.filter((file_0) => !FileUtils.isFileTypeAccepted(file_0, acceptedFileTypes));
51
+ if (invalidFiles.length > 0) if (allowsMultiple) onInvalidFileType?.(invalidFiles.map((file_1) => file_1.name));
51
52
  else onInvalidFileType?.(invalidFiles[0].name);
52
53
  if (acceptedFiles.length === 0 || !fileUpload) return;
53
54
  if (!allowsMultiple) setUploadState([]);
54
55
  const newUploadState = [];
55
- acceptedFiles.forEach((file) => {
56
+ acceptedFiles.forEach((file_2) => {
56
57
  newUploadState.push({
57
58
  state: "uploading",
58
59
  progress: 0,
59
- file,
60
+ file: file_2,
60
61
  abortController: new AbortController()
61
62
  });
62
63
  });
63
64
  const startIndex = allowsMultiple ? uploadState.length : 0;
64
65
  setUploadState((prev) => [...prev, ...newUploadState]);
65
66
  const promises = [];
66
- acceptedFiles.forEach(async (file, index) => {
67
+ acceptedFiles.forEach(async (file_3, index_0) => {
67
68
  promises.push(fileUpload({ data: {
68
- resourceName: file.name,
69
- fileName: file.name,
70
- fileSize: file.size,
69
+ resourceName: file_3.name,
70
+ fileName: file_3.name,
71
+ fileSize: file_3.size,
71
72
  method: "put"
72
- } }, file, {
73
+ } }, file_3, {
73
74
  onUploadProgress: ({ loaded, total }) => {
74
75
  if (total == null) return;
75
76
  const progress = Math.round(loaded / total * 100);
76
- setUploadState((prev) => prev.map((state, i) => i === startIndex + index ? {
77
+ setUploadState((prev_0) => prev_0.map((state, i) => i === startIndex + index_0 ? {
77
78
  ...state,
78
79
  progress
79
80
  } : state));
80
81
  },
81
- abortController: newUploadState[index]?.abortController
82
+ abortController: newUploadState[index_0]?.abortController
82
83
  }));
83
84
  });
84
85
  try {
85
- (await Promise.all(promises)).forEach((res, index) => {
86
- setUploadState((prev) => prev.map((state, i) => i === startIndex + index ? {
87
- ...state,
86
+ (await Promise.all(promises)).forEach((res, index_1) => {
87
+ setUploadState((prev_2) => prev_2.map((state_0, i_1) => i_1 === startIndex + index_1 ? {
88
+ ...state_0,
88
89
  state: "uploaded",
89
90
  id: res.id
90
- } : state));
91
+ } : state_0));
91
92
  });
92
93
  if (clearOnSuccess) setUploadState([]);
93
- } catch (error) {
94
- setUploadState((prev) => prev.filter((_, i) => i < startIndex));
95
- throw error;
94
+ } catch (error_0) {
95
+ setUploadState((prev_1) => prev_1.filter((_, i_0) => i_0 < startIndex));
96
+ throw error_0;
96
97
  }
97
98
  };
98
- const handleSelect = (inputFiles) => {
99
- if (!inputFiles) return;
100
- handleUpload(Array.from(inputFiles));
99
+ const handleSelect = (inputFiles_0) => {
100
+ if (!inputFiles_0) return;
101
+ handleUpload(Array.from(inputFiles_0));
101
102
  };
102
103
  const handleDrop = async (e) => {
103
104
  if (!e.items) return;
104
- const promises = [];
105
- e.items.forEach((item) => {
106
- if (item.kind === "file") promises.push(item.getFile());
105
+ const promises_0 = [];
106
+ e.items.forEach((item_0) => {
107
+ if (item_0.kind === "file") promises_0.push(item_0.getFile());
107
108
  });
108
- handleUpload(await Promise.all(promises));
109
+ handleUpload(await Promise.all(promises_0));
109
110
  };
110
111
  const handleRemove = useCallback((id) => {
111
112
  fileRemove?.({ id });
112
- setUploadState((prev) => prev.filter((state) => state.id !== id));
113
+ setUploadState((prev_3) => prev_3.filter((state_1) => state_1.id !== id));
113
114
  }, [fileRemove]);
114
- const handleCancelUpload = useCallback((index) => {
115
- const findState = uploadState[index];
115
+ const handleCancelUpload = useCallback((index_2) => {
116
+ const findState = uploadState[index_2];
116
117
  if (findState) {
117
118
  findState.abortController?.abort("canceled by user");
118
- setUploadState((prev) => prev.filter((_, i) => i !== index));
119
+ setUploadState((prev_4) => prev_4.filter((__0, i_2) => i_2 !== index_2));
119
120
  }
120
121
  }, [uploadState]);
121
122
  return /* @__PURE__ */ jsxs(FormField, {
@@ -128,6 +129,7 @@ var FileUploadBase = (props) => {
128
129
  ...rest,
129
130
  "data-rac": "",
130
131
  "data-disabled": isDisabled || void 0,
132
+ "data-is-disabled": isDisabled || void 0,
131
133
  "data-invalid": !!error || void 0,
132
134
  "data-multiple": allowsMultiple || void 0,
133
135
  "data-has-files": uploadState.length > 0 || void 0,
@@ -182,22 +184,63 @@ var FileUploadBase = (props) => {
182
184
  });
183
185
  };
184
186
  var FileUpload = (props) => {
187
+ const $ = c(15);
185
188
  if ("formControl" in props && props.formControl) {
186
- const { formControl, ref, ...innerProps } = props;
187
- return /* @__PURE__ */ jsx(Controller, {
188
- control: formControl.control,
189
- name: formControl.name,
190
- render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(FileUploadBase, {
191
- ...innerProps,
192
- ref: mergeRefs(ref, field.ref),
193
- value: field.value,
194
- onChange: field.onChange,
195
- isDisabled: field.disabled || props.isDisabled,
196
- error: props.error ?? error?.message
197
- })
198
- });
189
+ let formControl;
190
+ let innerProps;
191
+ let ref;
192
+ if ($[0] !== props) {
193
+ ({formControl, ref, ...innerProps} = props);
194
+ $[0] = props;
195
+ $[1] = formControl;
196
+ $[2] = innerProps;
197
+ $[3] = ref;
198
+ } else {
199
+ formControl = $[1];
200
+ innerProps = $[2];
201
+ ref = $[3];
202
+ }
203
+ let t0;
204
+ if ($[4] !== innerProps || $[5] !== props.error || $[6] !== props.isDisabled || $[7] !== ref) {
205
+ t0 = (t1) => {
206
+ const { field, fieldState: t2 } = t1;
207
+ const { error } = t2;
208
+ return /* @__PURE__ */ jsx(FileUploadBase, {
209
+ ...innerProps,
210
+ ref: mergeRefs(ref, field.ref),
211
+ value: field.value,
212
+ onChange: field.onChange,
213
+ isDisabled: field.disabled || props.isDisabled,
214
+ error: props.error ?? error?.message
215
+ });
216
+ };
217
+ $[4] = innerProps;
218
+ $[5] = props.error;
219
+ $[6] = props.isDisabled;
220
+ $[7] = ref;
221
+ $[8] = t0;
222
+ } else t0 = $[8];
223
+ let t1;
224
+ if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
225
+ t1 = /* @__PURE__ */ jsx(Controller, {
226
+ control: formControl.control,
227
+ name: formControl.name,
228
+ render: t0
229
+ });
230
+ $[9] = formControl.control;
231
+ $[10] = formControl.name;
232
+ $[11] = t0;
233
+ $[12] = t1;
234
+ } else t1 = $[12];
235
+ return t1;
199
236
  }
200
- return /* @__PURE__ */ jsx(FileUploadBase, { ...props });
237
+ let t0;
238
+ if ($[13] !== props) {
239
+ t0 = /* @__PURE__ */ jsx(FileUploadBase, { ...props });
240
+ $[13] = props;
241
+ $[14] = t0;
242
+ } else t0 = $[14];
243
+ return t0;
201
244
  };
202
245
  //#endregion
203
246
  export { FileUpload };
@@ -1,14 +1,22 @@
1
1
  import { FileUpload } from "./FileUpload.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  //#region src/components/inputs/File/FileUploadContainer.tsx
4
5
  var FileUploadContainer = (props) => {
5
- return /* @__PURE__ */ jsx(FileUpload, {
6
- label: "",
7
- hideLabel: true,
8
- variant: "vertical",
9
- as: "button",
10
- ...props
11
- });
6
+ const $ = c(2);
7
+ let t0;
8
+ if ($[0] !== props) {
9
+ t0 = /* @__PURE__ */ jsx(FileUpload, {
10
+ label: "",
11
+ hideLabel: true,
12
+ variant: "vertical",
13
+ as: "button",
14
+ ...props
15
+ });
16
+ $[0] = props;
17
+ $[1] = t0;
18
+ } else t0 = $[1];
19
+ return t0;
12
20
  };
13
21
  //#endregion
14
22
  export { FileUploadContainer };