@povio/ui 3.0.0-rc.3 → 3.1.0

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 (309) hide show
  1. package/README.md +39 -0
  2. package/dist/assets/icons/AlignCenter.js +11 -26
  3. package/dist/assets/icons/AlignLeft.js +11 -26
  4. package/dist/assets/icons/AlignLeftRight.js +11 -26
  5. package/dist/assets/icons/AlignRight.js +11 -26
  6. package/dist/assets/icons/ArrowDropDown.js +11 -26
  7. package/dist/assets/icons/ArrowDropUp.js +11 -26
  8. package/dist/assets/icons/ArrowLeft.js +11 -26
  9. package/dist/assets/icons/ArrowRight.js +11 -26
  10. package/dist/assets/icons/Bold.js +11 -26
  11. package/dist/assets/icons/BulletedList.js +11 -26
  12. package/dist/assets/icons/Calendar.js +13 -28
  13. package/dist/assets/icons/Check.js +13 -28
  14. package/dist/assets/icons/CheckCircle.js +11 -26
  15. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  16. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  17. package/dist/assets/icons/ChevronDown.js +13 -28
  18. package/dist/assets/icons/ChevronLeft.js +13 -28
  19. package/dist/assets/icons/ChevronRight.js +13 -28
  20. package/dist/assets/icons/ChevronUp.js +13 -28
  21. package/dist/assets/icons/ChevronsLeft.js +13 -28
  22. package/dist/assets/icons/ChevronsRight.js +13 -28
  23. package/dist/assets/icons/Clock.js +11 -26
  24. package/dist/assets/icons/Close.js +11 -26
  25. package/dist/assets/icons/DateTime.js +14 -35
  26. package/dist/assets/icons/DragIndicator.js +11 -26
  27. package/dist/assets/icons/File.js +13 -28
  28. package/dist/assets/icons/Highlight.js +11 -26
  29. package/dist/assets/icons/HighlightOn.js +15 -49
  30. package/dist/assets/icons/Home.js +11 -26
  31. package/dist/assets/icons/Info.js +16 -37
  32. package/dist/assets/icons/Italic.js +11 -26
  33. package/dist/assets/icons/Link.js +11 -26
  34. package/dist/assets/icons/Menu.js +11 -26
  35. package/dist/assets/icons/NumberedList.js +11 -26
  36. package/dist/assets/icons/PointerHorizontal.js +11 -26
  37. package/dist/assets/icons/PointerVertical.js +11 -26
  38. package/dist/assets/icons/Search.js +11 -26
  39. package/dist/assets/icons/Send.js +13 -28
  40. package/dist/assets/icons/Strikethrough.js +11 -26
  41. package/dist/assets/icons/TextColor.js +14 -48
  42. package/dist/assets/icons/Today.js +11 -26
  43. package/dist/assets/icons/Underlined.js +13 -28
  44. package/dist/assets/icons/Upload.js +14 -35
  45. package/dist/assets/icons/Visibility.js +11 -26
  46. package/dist/assets/icons/VisibilityOff.js +11 -26
  47. package/dist/assets/icons/WarningFilled.js +13 -28
  48. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  49. package/dist/components/Menu/Menu.d.ts +4 -0
  50. package/dist/components/Menu/Menu.js +2 -18
  51. package/dist/components/Menu/MenuDesktop.js +7 -41
  52. package/dist/components/Menu/MenuItem.js +9 -32
  53. package/dist/components/Menu/MenuMobile.d.ts +1 -1
  54. package/dist/components/Menu/MenuMobile.js +39 -97
  55. package/dist/components/Menu/MenuPopover.js +29 -105
  56. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  57. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  58. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  59. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  60. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  61. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  62. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  63. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  64. package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
  65. package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
  66. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  67. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  68. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  69. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
  70. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -373
  71. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
  72. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
  73. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
  74. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
  75. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
  76. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
  77. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
  78. package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
  79. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
  80. package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
  81. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
  82. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
  83. package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
  84. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
  85. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  86. package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
  87. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
  88. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
  89. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
  90. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
  91. package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +4 -1
  92. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -81
  93. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  94. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  95. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  96. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  97. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  98. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
  99. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
  100. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  101. package/dist/components/inputs/File/FileUpload.js +45 -88
  102. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  103. package/dist/components/inputs/File/InputUpload.js +79 -317
  104. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  105. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  106. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  107. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  108. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  109. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  110. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  111. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  112. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  113. package/dist/components/inputs/File/shared/ProgressBar.d.ts +2 -2
  114. package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
  115. package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
  116. package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
  117. package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
  118. package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
  119. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  120. package/dist/components/inputs/FormField/FormField.js +37 -119
  121. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  122. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  123. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  124. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  125. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  126. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  127. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  128. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  129. package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
  130. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  131. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  132. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  133. package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
  134. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  135. package/dist/components/inputs/Inputs/Form.js +11 -40
  136. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
  137. package/dist/components/inputs/Inputs/InputItem.js +14 -69
  138. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  139. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
  140. package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
  141. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -45
  142. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
  143. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  144. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
  145. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  146. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
  147. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  148. package/dist/components/inputs/Selection/Select/Select.js +18 -227
  149. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -8
  150. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  151. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  152. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  153. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  154. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -397
  155. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  156. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  157. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  158. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  159. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  160. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  161. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  162. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  163. package/dist/components/inputs/Selection/shared/SelectMobile.js +6 -11
  164. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  165. package/dist/components/inputs/Selection/shared/select.context.js +36 -67
  166. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  167. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  168. package/dist/components/inputs/Slider/Slider.d.ts +1 -2
  169. package/dist/components/inputs/Slider/Slider.js +76 -265
  170. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  171. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  172. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  173. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  174. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  175. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  176. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  177. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  178. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  179. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  180. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  181. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  182. package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
  183. package/dist/components/inputs/Toggle/Toggle.js +37 -214
  184. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  185. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  186. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  187. package/dist/components/inputs/shared/CheckContent.js +11 -21
  188. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  189. package/dist/components/inputs/shared/InputClear.js +12 -88
  190. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  191. package/dist/components/inputs/shared/input.cva.d.ts +0 -28
  192. package/dist/components/inputs/shared/input.cva.js +4 -38
  193. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  194. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  195. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  196. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  197. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  198. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  199. package/dist/components/overlays/BottomSheet/BottomSheet.js +25 -98
  200. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  201. package/dist/components/overlays/Drawer/Drawer.js +22 -64
  202. package/dist/components/overlays/Modal/modal.cva.js +1 -1
  203. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
  204. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -83
  205. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  206. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  207. package/dist/components/segment/Segment.js +57 -218
  208. package/dist/components/segment/SegmentItem.js +10 -67
  209. package/dist/components/shared/pagination/Pagination.js +22 -108
  210. package/dist/components/shared/pagination/PaginationList.js +64 -167
  211. package/dist/components/status/Alert/Alert.js +30 -97
  212. package/dist/components/status/Loader/Loader.js +22 -77
  213. package/dist/components/status/Toast/Toast.js +17 -22
  214. package/dist/components/status/Toast/toast.cva.d.ts +14 -3
  215. package/dist/components/status/Toast/toast.cva.js +12 -10
  216. package/dist/components/status/Toast/useToast.js +57 -62
  217. package/dist/components/table/ColumnConfig.js +54 -158
  218. package/dist/components/table/InfiniteTable.js +16 -67
  219. package/dist/components/table/PaginatedTable.js +18 -84
  220. package/dist/components/table/Table.js +30 -30
  221. package/dist/components/table/table.cva.d.ts +7 -0
  222. package/dist/components/table/table.cva.js +2 -1
  223. package/dist/components/text/Link/Link.js +7 -19
  224. package/dist/components/text/Pill/Pill.d.ts +15 -0
  225. package/dist/components/text/Pill/Pill.js +44 -0
  226. package/dist/components/text/Typography/Typography.js +8 -23
  227. package/dist/config/confirmation.context.js +1 -1
  228. package/dist/config/link.context.js +9 -23
  229. package/dist/config/router.context.js +16 -42
  230. package/dist/config/theme.context.js +45 -98
  231. package/dist/config/uiConfig.context.d.ts +10 -21
  232. package/dist/config/uiConfig.context.js +18 -69
  233. package/dist/config/uiOverrides.context.d.ts +10 -20
  234. package/dist/config/uiOverrides.context.js +14 -54
  235. package/dist/helpers/dynamicInputs.d.ts +5 -5
  236. package/dist/helpers/dynamicInputs.js +0 -3
  237. package/dist/hooks/useAutosave.d.ts +1 -2
  238. package/dist/hooks/useAutosave.js +4 -12
  239. package/dist/hooks/useBreakpoint.js +3 -16
  240. package/dist/hooks/useDebounceCallback.js +17 -51
  241. package/dist/hooks/useFilters.js +64 -125
  242. package/dist/hooks/useForm.js +8 -42
  243. package/dist/hooks/useFormAutosave.d.ts +1 -3
  244. package/dist/hooks/useFormAutosave.js +30 -122
  245. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  246. package/dist/hooks/useIntersectionObserver.js +24 -91
  247. package/dist/hooks/useLocalStorage.js +10 -43
  248. package/dist/hooks/useLongPressRepeat.js +20 -55
  249. package/dist/hooks/usePagination.js +19 -49
  250. package/dist/hooks/useScrollableListBox.js +16 -37
  251. package/dist/hooks/useSorting.js +28 -69
  252. package/dist/hooks/useStateAndRef.js +7 -21
  253. package/dist/hooks/useTableColumnConfig.js +31 -124
  254. package/dist/hooks/useTranslationMemo.js +5 -25
  255. package/dist/index.d.ts +7 -16
  256. package/dist/index.js +6 -13
  257. package/dist/tw-ui-plugin.js +0 -6
  258. package/dist/utils/date-time.utils.d.ts +10 -38
  259. package/dist/utils/date-time.utils.js +22 -136
  260. package/package.json +1 -1
  261. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
  262. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -16
  263. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
  264. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
  265. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
  266. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  267. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  268. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -40
  269. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
  270. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  271. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -13
  272. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
  273. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  274. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  275. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  276. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
  277. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -8
  278. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  279. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  280. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  281. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -37
  282. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  283. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
  284. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  285. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  286. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -14
  287. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
  288. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
  289. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  290. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
  291. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
  292. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  293. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
  294. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  295. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
  296. package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
  297. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -8
  298. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  299. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  300. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  301. package/dist/hooks/useAutosave.spec.d.ts +0 -1
  302. package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
  303. package/dist/hooks/useKeyInteractions.d.ts +0 -20
  304. package/dist/hooks/useKeyInteractions.js +0 -54
  305. package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
  306. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  307. package/dist/hooks/useQueryAutocomplete.js +0 -72
  308. package/dist/utils/query.utils.d.ts +0 -4
  309. package/dist/utils/query.utils.js +0 -8
@@ -1,305 +1,131 @@
1
1
  import { DateSegmentItem } from "./DateSegmentItem.js";
2
2
  import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
3
- import { c } from "react/compiler-runtime";
4
3
  import { Fragment, jsx } from "react/jsx-runtime";
5
4
  import { clsx } from "clsx";
6
- import { useEffect, useImperativeHandle, useRef } from "react";
5
+ import { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from "react";
7
6
  import { useDateField, useLocale } from "react-aria";
8
7
  import { createCalendar } from "@internationalized/date";
9
8
  import { DateTime } from "luxon";
10
9
  import { useDateFieldState } from "react-stately";
11
10
  //#region src/components/inputs/DateTime/shared/DateField.tsx
12
- var omitNullValue = ({ value: _value, ...props }) => props;
13
- var DateField = (t0) => {
14
- const $ = c(62);
15
- const { ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, dateGranularity: t1, isTimeOptional: t2, format, timeZone, ...props } = t0;
16
- const dateGranularity = t1 === void 0 ? "day" : t1;
17
- const isTimeOptional = t2 === void 0 ? false : t2;
11
+ var DateField = ({ ref, onClearChange, hidePlaceholder, isDisabled, disableManualEntry, dateGranularity = "day", isTimeOptional = false, format, timeZone, ...props }) => {
18
12
  const { locale } = useLocale();
19
- const previousValueRef = useRef(props.value);
20
- const dateFieldProps = props.value == null ? omitNullValue(props) : props;
21
- let t3;
22
- if ($[0] !== dateFieldProps || $[1] !== disableManualEntry || $[2] !== isDisabled || $[3] !== locale) {
23
- t3 = {
24
- ...dateFieldProps,
25
- isDisabled,
26
- isReadOnly: disableManualEntry,
27
- locale,
28
- createCalendar
29
- };
30
- $[0] = dateFieldProps;
31
- $[1] = disableManualEntry;
32
- $[2] = isDisabled;
33
- $[3] = locale;
34
- $[4] = t3;
35
- } else t3 = $[4];
36
- const state = useDateFieldState(t3);
13
+ const state = useDateFieldState({
14
+ ...props,
15
+ isDisabled,
16
+ isReadOnly: disableManualEntry,
17
+ locale,
18
+ createCalendar
19
+ });
37
20
  const dataFieldRef = useRef(null);
38
- let t4;
39
- if ($[5] !== dateFieldProps || $[6] !== disableManualEntry || $[7] !== isDisabled) {
40
- t4 = {
41
- ...dateFieldProps,
42
- isDisabled,
43
- isReadOnly: disableManualEntry
44
- };
45
- $[5] = dateFieldProps;
46
- $[6] = disableManualEntry;
47
- $[7] = isDisabled;
48
- $[8] = t4;
49
- } else t4 = $[8];
50
- const { fieldProps } = useDateField(t4, state, dataFieldRef);
51
- let t5;
52
- if ($[9] !== dateGranularity) {
53
- t5 = (segmentType) => {
54
- if (dateGranularity === "day") return true;
55
- if (dateGranularity === "month") return segmentType !== "day";
56
- if (dateGranularity === "year") return segmentType === "year";
57
- return true;
58
- };
59
- $[9] = dateGranularity;
60
- $[10] = t5;
61
- } else t5 = $[10];
62
- const isSegmentVisible = t5;
63
- let t6;
64
- if ($[11] !== isSegmentVisible || $[12] !== state.segments) {
65
- t6 = () => {
66
- const segments = [];
67
- for (const segment of state.segments) if (segment.type !== "literal") {
68
- if (isSegmentVisible(segment.type)) segments.push(segment);
69
- } else if (segments.length > 0 && segments.at(-1)?.type !== "literal") segments.push(segment);
70
- return segments;
71
- };
72
- $[11] = isSegmentVisible;
73
- $[12] = state.segments;
74
- $[13] = t6;
75
- } else t6 = $[13];
76
- const getSegmentsToRender = t6;
77
- let t7;
78
- if ($[14] !== getSegmentsToRender) {
79
- t7 = getSegmentsToRender();
80
- $[14] = getSegmentsToRender;
81
- $[15] = t7;
82
- } else t7 = $[15];
83
- const segmentsToRender = t7;
84
- let t8;
85
- if ($[16] !== isTimeOptional || $[17] !== props || $[18] !== state) {
86
- t8 = () => {
87
- const monthSegment = state.segments.find(_temp);
88
- const daySegment = state.segments.find(_temp2);
89
- const yearSegment = state.segments.find(_temp3);
90
- const hourSegment = state.segments.find(_temp4);
91
- const minuteSegment = state.segments.find(_temp5);
92
- const isMonthFilled = monthSegment && !monthSegment.isPlaceholder;
93
- const isDayFilled = daySegment && !daySegment.isPlaceholder;
94
- const isYearFilled = yearSegment && !yearSegment.isPlaceholder && yearSegment.text?.length > 0;
95
- const isYearEmpty = yearSegment && !(parseInt(yearSegment.text) && yearSegment.text?.length === 4);
96
- const isDateFilled = isMonthFilled && isDayFilled && isYearFilled;
97
- const isHourEmpty = hourSegment && (hourSegment.isPlaceholder || Number.isNaN(parseInt(hourSegment.text ?? "", 10)));
98
- const isMinuteEmpty = minuteSegment && (minuteSegment.isPlaceholder || Number.isNaN(parseInt(minuteSegment.text ?? "", 10)));
99
- if (!isTimeOptional && isDateFilled && minuteSegment && isMinuteEmpty) {
100
- let minute = minuteSegment?.value || 0;
101
- if (minuteSegment?.text?.length && minuteSegment?.text?.length > 0) {
102
- minute = parseInt(minuteSegment?.text ?? "00");
103
- if (isNaN(minute)) minute = 0;
104
- }
105
- state.setSegment("minute", minute);
21
+ const { fieldProps } = useDateField({
22
+ ...props,
23
+ isDisabled,
24
+ isReadOnly: disableManualEntry
25
+ }, state, dataFieldRef);
26
+ const isSegmentVisible = useCallback((segmentType) => {
27
+ if (dateGranularity === "day") return true;
28
+ if (dateGranularity === "month") return segmentType !== "day";
29
+ if (dateGranularity === "year") return segmentType === "year";
30
+ return true;
31
+ }, [dateGranularity]);
32
+ const getSegmentsToRender = useCallback(() => {
33
+ const segments = [];
34
+ for (const segment of state.segments) if (segment.type !== "literal") {
35
+ if (isSegmentVisible(segment.type)) segments.push(segment);
36
+ } else if (segments.length > 0 && segments.at(-1)?.type !== "literal") segments.push(segment);
37
+ return segments;
38
+ }, [state.segments, isSegmentVisible]);
39
+ const segmentsToRender = useMemo(() => getSegmentsToRender(), [getSegmentsToRender]);
40
+ const autoFixYear = () => {
41
+ const monthSegment = state.segments.find((segment) => segment.type === "month");
42
+ const daySegment = state.segments.find((segment) => segment.type === "day");
43
+ const yearSegment = state.segments.find((segment) => segment.type === "year");
44
+ const hourSegment = state.segments.find((segment) => segment.type === "hour");
45
+ const minuteSegment = state.segments.find((segment) => segment.type === "minute");
46
+ const isMonthFilled = monthSegment && !monthSegment.isPlaceholder;
47
+ const isDayFilled = daySegment && !daySegment.isPlaceholder;
48
+ const isYearFilled = yearSegment && !yearSegment.isPlaceholder && yearSegment.text?.length > 0;
49
+ const isYearEmpty = yearSegment && !(parseInt(yearSegment.text) && yearSegment.text?.length === 4);
50
+ const isDateFilled = isMonthFilled && isDayFilled && isYearFilled;
51
+ const isHourEmpty = hourSegment && (hourSegment.isPlaceholder || Number.isNaN(parseInt(hourSegment.text ?? "", 10)));
52
+ const isMinuteEmpty = minuteSegment && (minuteSegment.isPlaceholder || Number.isNaN(parseInt(minuteSegment.text ?? "", 10)));
53
+ if (!isTimeOptional && isDateFilled && minuteSegment && isMinuteEmpty) {
54
+ let minute = minuteSegment?.value || 0;
55
+ if (minuteSegment?.text?.length && minuteSegment?.text?.length > 0) {
56
+ minute = parseInt(minuteSegment?.text ?? "00");
57
+ if (isNaN(minute)) minute = 0;
106
58
  }
107
- if (!isTimeOptional && isDateFilled && hourSegment && isHourEmpty) {
108
- let hour = hourSegment?.value || 0;
109
- if (hourSegment?.text?.length && hourSegment?.text?.length > 0) {
110
- hour = parseInt(hourSegment?.text ?? "00");
111
- if (isNaN(hour)) hour = 0;
112
- }
113
- state.setSegment("hour", hour);
59
+ state.setSegment("minute", minute);
60
+ }
61
+ if (!isTimeOptional && isDateFilled && hourSegment && isHourEmpty) {
62
+ let hour = hourSegment?.value || 0;
63
+ if (hourSegment?.text?.length && hourSegment?.text?.length > 0) {
64
+ hour = parseInt(hourSegment?.text ?? "00");
65
+ if (isNaN(hour)) hour = 0;
114
66
  }
115
- if (isMonthFilled && isDayFilled && isYearEmpty) {
116
- let year = (/* @__PURE__ */ new Date()).getFullYear();
117
- if (yearSegment?.text?.length && yearSegment?.text?.length === 2) year = parseInt(`20${yearSegment?.text}`);
118
- state.setSegment("year", year);
119
- const correctedValue = state.value?.set({ year });
120
- if (correctedValue) props.onChange?.(correctedValue);
67
+ state.setSegment("hour", hour);
68
+ }
69
+ if (isMonthFilled && isDayFilled && isYearEmpty) {
70
+ let year = (/* @__PURE__ */ new Date()).getFullYear();
71
+ if (yearSegment?.text?.length && yearSegment?.text?.length === 2) year = parseInt(`20${yearSegment?.text}`);
72
+ state.setSegment("year", year);
73
+ }
74
+ };
75
+ const handleBlur = (e) => {
76
+ fieldProps.onBlur?.(e);
77
+ if (!state.value) return;
78
+ const currentValue = state.value;
79
+ const { year } = currentValue;
80
+ if (year >= 0 && year <= 99) {
81
+ const correctedYear = year <= 50 ? 2e3 + year : 1900 + year;
82
+ const correctedDate = currentValue.set({ year: correctedYear });
83
+ if (correctedDate) {
84
+ state.setValue(correctedDate);
85
+ props.onChange?.(correctedDate);
121
86
  }
122
- };
123
- $[16] = isTimeOptional;
124
- $[17] = props;
125
- $[18] = state;
126
- $[19] = t8;
127
- } else t8 = $[19];
128
- const autoFixYear = t8;
129
- let t9;
130
- if ($[20] !== fieldProps || $[21] !== props || $[22] !== state) {
131
- t9 = (e) => {
132
- fieldProps.onBlur?.(e);
133
- if (!state.value) return;
134
- const currentValue = state.value;
135
- const { year: year_0 } = currentValue;
136
- if (year_0 >= 0 && year_0 <= 99) {
137
- const correctedYear = year_0 <= 50 ? 2e3 + year_0 : 1900 + year_0;
138
- const correctedDate = currentValue.set({ year: correctedYear });
139
- if (correctedDate) {
140
- state.setValue(correctedDate);
141
- props.onChange?.(correctedDate);
142
- }
143
- }
144
- };
145
- $[20] = fieldProps;
146
- $[21] = props;
147
- $[22] = state;
148
- $[23] = t9;
149
- } else t9 = $[23];
150
- const handleBlur = t9;
151
- let t10;
152
- if ($[24] !== autoFixYear || $[25] !== state) {
153
- t10 = () => ({
154
- clearField: () => {
155
- state.setValue(null);
156
- },
157
- autoFixYear
158
- });
159
- $[24] = autoFixYear;
160
- $[25] = state;
161
- $[26] = t10;
162
- } else t10 = $[26];
163
- useImperativeHandle(ref, t10);
164
- let t11;
165
- if ($[27] !== previousValueRef || $[28] !== props.value || $[29] !== state) {
166
- t11 = () => {
167
- if (previousValueRef.current != null && props.value == null && state.value !== null) state.setValue(null);
168
- previousValueRef.current = props.value;
169
- };
170
- $[27] = previousValueRef;
171
- $[28] = props.value;
172
- $[29] = state;
173
- $[30] = t11;
174
- } else t11 = $[30];
175
- let t12;
176
- if ($[31] !== props.value || $[32] !== state) {
177
- t12 = [props.value, state];
178
- $[31] = props.value;
179
- $[32] = state;
180
- $[33] = t12;
181
- } else t12 = $[33];
182
- useEffect(t11, t12);
183
- let t13;
184
- let t14;
185
- if ($[34] !== onClearChange || $[35] !== state.segments) {
186
- t13 = () => {
187
- onClearChange?.(state.segments.some(_temp6));
188
- };
189
- t14 = [state.segments, onClearChange];
190
- $[34] = onClearChange;
191
- $[35] = state.segments;
192
- $[36] = t13;
193
- $[37] = t14;
194
- } else {
195
- t13 = $[36];
196
- t14 = $[37];
197
- }
198
- useEffect(t13, t14);
199
- let t15;
200
- if ($[38] !== disableManualEntry || $[39] !== format || $[40] !== state.value || $[41] !== timeZone) {
201
- const getFormattedDisplayValue = () => {
202
- if (!disableManualEntry) return null;
203
- if (!format) return null;
204
- if (!state.value) return null;
205
- const jsDate = DateTimeUtils.fromDateValueToLocal(state.value, timeZone);
206
- const formattedDate = DateTime.fromJSDate(jsDate);
207
- if (!formattedDate.isValid) return null;
208
- return formattedDate.toFormat(format);
209
- };
210
- t15 = getFormattedDisplayValue();
211
- $[38] = disableManualEntry;
212
- $[39] = format;
213
- $[40] = state.value;
214
- $[41] = timeZone;
215
- $[42] = t15;
216
- } else t15 = $[42];
217
- const formattedDisplayValue = t15;
218
- let t16;
219
- if ($[43] !== hidePlaceholder || $[44] !== isDisabled || $[45] !== segmentsToRender || $[46] !== state) {
220
- t16 = /* @__PURE__ */ jsx(Fragment, { children: segmentsToRender.map((segment_6, i) => /* @__PURE__ */ jsx(DateSegmentItem, {
221
- segment: segment_6,
222
- state,
223
- isDisabled,
224
- hidePlaceholder
225
- }, i)) });
226
- $[43] = hidePlaceholder;
227
- $[44] = isDisabled;
228
- $[45] = segmentsToRender;
229
- $[46] = state;
230
- $[47] = t16;
231
- } else t16 = $[47];
232
- let fieldContent = t16;
233
- if (formattedDisplayValue) {
234
- const t17 = isDisabled && "text-interactive-text-secondary-disabled";
235
- let t18;
236
- if ($[48] !== t17) {
237
- t18 = clsx("select-none", t17);
238
- $[48] = t17;
239
- $[49] = t18;
240
- } else t18 = $[49];
241
- let t19;
242
- if ($[50] !== formattedDisplayValue || $[51] !== t18) {
243
- t19 = /* @__PURE__ */ jsx("span", {
244
- className: t18,
245
- children: formattedDisplayValue
246
- });
247
- $[50] = formattedDisplayValue;
248
- $[51] = t18;
249
- $[52] = t19;
250
- } else t19 = $[52];
251
- fieldContent = t19;
252
- }
253
- const t17 = disableManualEntry && "pointer-events-none";
254
- let t18;
255
- if ($[53] !== t17) {
256
- t18 = clsx("relative w-full", t17);
257
- $[53] = t17;
258
- $[54] = t18;
259
- } else t18 = $[54];
260
- let t19;
261
- if ($[55] !== fieldContent) {
262
- t19 = /* @__PURE__ */ jsx("div", {
87
+ }
88
+ };
89
+ useImperativeHandle(ref, () => ({
90
+ clearField: () => {
91
+ state.setValue(null);
92
+ for (const segment of state.segments) if (segment.type !== "literal") state.clearSegment(segment.type);
93
+ },
94
+ autoFixYear
95
+ }));
96
+ useEffect(() => {
97
+ onClearChange?.(state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false));
98
+ }, [state.segments, onClearChange]);
99
+ const getFormattedDisplayValue = () => {
100
+ if (!disableManualEntry) return null;
101
+ if (!format) return null;
102
+ if (!state.value) return null;
103
+ const jsDate = DateTimeUtils.fromDateValueToLocal(state.value, timeZone);
104
+ const formattedDate = DateTime.fromJSDate(jsDate);
105
+ if (!formattedDate.isValid) return null;
106
+ return formattedDate.toFormat(format);
107
+ };
108
+ const formattedDisplayValue = getFormattedDisplayValue();
109
+ let fieldContent = /* @__PURE__ */ jsx(Fragment, { children: segmentsToRender.map((segment, i) => /* @__PURE__ */ jsx(DateSegmentItem, {
110
+ segment,
111
+ state,
112
+ isDisabled,
113
+ hidePlaceholder
114
+ }, i)) });
115
+ if (formattedDisplayValue) fieldContent = /* @__PURE__ */ jsx("span", {
116
+ className: clsx("select-none", isDisabled && "text-interactive-text-secondary-disabled"),
117
+ children: formattedDisplayValue
118
+ });
119
+ return /* @__PURE__ */ jsx("div", {
120
+ ...fieldProps,
121
+ ref: dataFieldRef,
122
+ onBlur: handleBlur,
123
+ className: clsx("relative w-full", disableManualEntry && "pointer-events-none"),
124
+ children: /* @__PURE__ */ jsx("div", {
263
125
  className: "flex",
264
126
  children: fieldContent
265
- });
266
- $[55] = fieldContent;
267
- $[56] = t19;
268
- } else t19 = $[56];
269
- let t20;
270
- if ($[57] !== fieldProps || $[58] !== handleBlur || $[59] !== t18 || $[60] !== t19) {
271
- t20 = /* @__PURE__ */ jsx("div", {
272
- ...fieldProps,
273
- ref: dataFieldRef,
274
- onBlur: handleBlur,
275
- className: t18,
276
- children: t19
277
- });
278
- $[57] = fieldProps;
279
- $[58] = handleBlur;
280
- $[59] = t18;
281
- $[60] = t19;
282
- $[61] = t20;
283
- } else t20 = $[61];
284
- return t20;
127
+ })
128
+ });
285
129
  };
286
- function _temp(segment_0) {
287
- return segment_0.type === "month";
288
- }
289
- function _temp2(segment_1) {
290
- return segment_1.type === "day";
291
- }
292
- function _temp3(segment_2) {
293
- return segment_2.type === "year";
294
- }
295
- function _temp4(segment_3) {
296
- return segment_3.type === "hour";
297
- }
298
- function _temp5(segment_4) {
299
- return segment_4.type === "minute";
300
- }
301
- function _temp6(segment_5) {
302
- return segment_5.type !== "literal" && segment_5.isPlaceholder === false;
303
- }
304
130
  //#endregion
305
131
  export { DateField };
@@ -1,6 +1,5 @@
1
1
  import { Ref } from 'react';
2
2
  import { DatePickerAria } from 'react-aria';
3
- import { DatePickerTodayIcon, DatePickerTodayIconButtonComponent, DatePickerTodayIconButtonSize, DatePickerTodayIconPlacement } from './datePicker.types';
4
3
  import { FormFieldHeaderProps } from '../../FormField/FormFieldHeader';
5
4
  import { InputVariantProps } from '../../shared/input.cva';
6
5
  export interface DatePickerInputHandle {
@@ -12,35 +11,25 @@ interface DatePickerInputProps extends InputVariantProps {
12
11
  groupProps: DatePickerAria["groupProps"];
13
12
  fieldProps: DatePickerAria["fieldProps"];
14
13
  endFieldProps?: DatePickerAria["fieldProps"];
15
- fieldValue?: DatePickerAria["fieldProps"]["value"];
16
- endFieldValue?: DatePickerAria["fieldProps"]["value"];
17
- isValueControlled?: boolean;
18
- hasValue?: boolean;
19
14
  buttonProps: DatePickerAria["buttonProps"];
20
15
  isDisabled?: boolean;
21
16
  isInvalid?: boolean;
22
17
  disableDropdown?: boolean;
23
18
  isDateTime?: boolean;
24
- shouldShrinkInput?: boolean;
25
19
  isClearable?: boolean;
26
20
  headerProps?: FormFieldHeaderProps;
27
- todayIcon?: DatePickerTodayIcon;
28
- todayIconButtonSize?: DatePickerTodayIconButtonSize;
29
- todayIconButtonComponent?: DatePickerTodayIconButtonComponent;
30
- todayIconPlacement?: DatePickerTodayIconPlacement;
21
+ todayIcon?: boolean;
31
22
  isDirty?: boolean;
32
23
  isRequired?: boolean;
33
24
  disableManualEntry?: boolean;
34
- autoFixYear?: boolean;
35
25
  placeholder?: string;
36
26
  className?: string;
37
27
  onOpenDropdown?: () => void;
38
28
  dateGranularity?: "day" | "month" | "year";
39
29
  timeZone?: string;
30
+ autoFixYear?: boolean;
40
31
  isTimeOptional?: boolean;
41
32
  format?: string;
42
- fireBlurOnChange?: boolean;
43
- onClear?: () => void;
44
33
  }
45
- export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize, todayIconButtonComponent, todayIconPlacement, isDirty, isRequired, disableManualEntry, autoFixYear, placeholder, className, onOpenDropdown, dateGranularity, timeZone: timeZoneProp, isTimeOptional, format, fireBlurOnChange, onClear: onClearProp, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
34
+ export declare const DatePickerInput: ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, isDirty, isRequired, disableManualEntry, placeholder, className, onOpenDropdown, dateGranularity, timeZone, autoFixYear, isTimeOptional, format, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
46
35
  export {};