@povio/ui 3.3.0-rc.3 → 3.3.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 (84) hide show
  1. package/README.md +15 -1
  2. package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
  3. package/dist/components/buttons/Button/button.cva.d.ts +1 -1
  4. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  5. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  6. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  7. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +5 -1
  8. package/dist/components/inputs/Checkbox/CheckboxGroup.js +234 -201
  9. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
  10. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  11. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +170 -273
  12. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -147
  13. package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
  14. package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
  15. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
  16. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
  17. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
  18. package/dist/components/inputs/DateTime/shared/DateField.js +135 -301
  19. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +142 -338
  20. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  21. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +144 -134
  22. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +2 -0
  23. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +33 -0
  24. package/dist/components/inputs/File/FileUpload.js +1 -1
  25. package/dist/components/inputs/File/InputUpload.js +65 -261
  26. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
  27. package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
  28. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
  29. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
  30. package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
  31. package/dist/components/inputs/FormField/FormField.js +34 -47
  32. package/dist/components/inputs/Input/NumberInput/NumberInput.js +2 -1
  33. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +77 -314
  34. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
  35. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +56 -2
  36. package/dist/components/inputs/Selection/Select/QuerySelect.js +82 -94
  37. package/dist/components/inputs/Selection/Select/Select.js +3 -3
  38. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
  39. package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
  40. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
  41. package/dist/components/inputs/Selection/shared/querySelect.utils.js +1 -0
  42. package/dist/components/inputs/Selection/shared/select.context.js +19 -9
  43. package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
  44. package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
  45. package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
  46. package/dist/components/inputs/shared/InputClear.js +24 -40
  47. package/dist/components/inputs/shared/input.cva.js +1 -1
  48. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  49. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  50. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  51. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  52. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
  53. package/dist/components/shared/pagination/Pagination.js +22 -108
  54. package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
  55. package/dist/components/status/Alert/Alert.js +30 -97
  56. package/dist/components/table/InfiniteTable.js +16 -67
  57. package/dist/components/table/Table.d.ts +2 -8
  58. package/dist/components/table/Table.js +33 -55
  59. package/dist/components/text/Typography/Typography.js +8 -23
  60. package/dist/config/confirmation.context.js +1 -1
  61. package/dist/config/theme.context.js +45 -98
  62. package/dist/config/uiConfig.context.d.ts +1 -0
  63. package/dist/config/uiConfig.context.js +10 -40
  64. package/dist/config/uiOverrides.context.d.ts +0 -1
  65. package/dist/helpers/dynamicColumns.js +2 -1
  66. package/dist/hooks/useDebounceCallback.js +17 -51
  67. package/dist/hooks/useFormAutosave.js +33 -120
  68. package/dist/hooks/useLongPressRepeat.js +20 -55
  69. package/dist/index.d.ts +1 -1
  70. package/dist/index.js +2 -2
  71. package/dist/utils/date-time.utils.d.ts +0 -1
  72. package/dist/utils/date-time.utils.js +21 -45
  73. package/dist/utils/intl.utils.d.ts +7 -0
  74. package/dist/utils/intl.utils.js +38 -0
  75. package/dist/utils/intl.utils.spec.d.ts +1 -0
  76. package/package.json +2 -2
  77. package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
  78. package/dist/components/inputs/FormField/formField.cva.js +0 -16
  79. package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
  80. package/dist/components/table/TableColumnFilterInput.js +0 -108
  81. package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
  82. package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
  83. package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
  84. package/dist/components/table/TableColumnFilterRow.js +0 -68
@@ -1,8 +1,7 @@
1
1
  import { ObjectUtils } from "../utils/object.utils.js";
2
2
  import { useAutosave } from "./useAutosave.js";
3
3
  import { useForm } from "./useForm.js";
4
- import { c } from "react/compiler-runtime";
5
- import { useEffect, useRef } from "react";
4
+ import { useCallback, useEffect, useRef } from "react";
6
5
  //#region src/hooks/useFormAutosave.ts
7
6
  var getResetTimeoutErrorMessage = (resetTimeout) => `Form Reset Timeout (${resetTimeout}ms) - Action Required
8
7
  Problem: Form values weren't reset after submission.
@@ -16,130 +15,44 @@ Solutions:
16
15
  1. Ensure reset dependencies include all relevant state variables
17
16
  2. Confirm your submission handler updates state properly (check query invalidation)
18
17
  3. For slower operations, consider increasing the timeout threshold`;
19
- function useFormAutosave(t0) {
20
- const $ = c(32);
21
- let autosaveDelay;
22
- let enableAutosave;
23
- let getResetValues;
24
- let normalizeAutosaveData;
25
- let onAutosave;
26
- let props;
27
- let resetDeps;
28
- let t1;
29
- let t2;
30
- if ($[0] !== t0) {
31
- ({autosaveDelay, enableAutosave, autosaveOn: t1, normalizeAutosaveData, onAutosave, getResetValues, resetDeps, resetTimeout: t2, ...props} = t0);
32
- $[0] = t0;
33
- $[1] = autosaveDelay;
34
- $[2] = enableAutosave;
35
- $[3] = getResetValues;
36
- $[4] = normalizeAutosaveData;
37
- $[5] = onAutosave;
38
- $[6] = props;
39
- $[7] = resetDeps;
40
- $[8] = t1;
41
- $[9] = t2;
42
- } else {
43
- autosaveDelay = $[1];
44
- enableAutosave = $[2];
45
- getResetValues = $[3];
46
- normalizeAutosaveData = $[4];
47
- onAutosave = $[5];
48
- props = $[6];
49
- resetDeps = $[7];
50
- t1 = $[8];
51
- t2 = $[9];
52
- }
53
- const autosaveOn = t1 === void 0 ? "change" : t1;
54
- const resetTimeout = t2 === void 0 ? 5e3 : t2;
55
- let t3;
56
- if ($[10] !== getResetValues) {
57
- t3 = getResetValues();
58
- $[10] = getResetValues;
59
- $[11] = t3;
60
- } else t3 = $[11];
61
- let t4;
62
- if ($[12] !== props || $[13] !== t3) {
63
- t4 = {
64
- ...props,
65
- defaultValues: t3
66
- };
67
- $[12] = props;
68
- $[13] = t3;
69
- $[14] = t4;
70
- } else t4 = $[14];
71
- const form = useForm(t4);
18
+ function useFormAutosave({ autosaveDelay, enableAutosave, autosaveOn = "change", normalizeAutosaveData, onAutosave, getResetValues, resetDeps, resetTimeout = 5e3, ...props }) {
19
+ const form = useForm({
20
+ ...props,
21
+ defaultValues: getResetValues()
22
+ });
72
23
  const shouldResetFormValuesRef = useRef(false);
73
24
  const resetFormValuesTimeoutRef = useRef(void 0);
74
- let t5;
75
- if ($[15] !== form || $[16] !== getResetValues) {
76
- t5 = () => {
77
- const resetValues = getResetValues();
78
- if (resetValues === void 0) return;
79
- const resetFormValues = async () => {
80
- const keepStateOptions = shouldResetFormValuesRef.current ? { keepDirtyValues: true } : void 0;
81
- shouldResetFormValuesRef.current = false;
82
- let values = resetValues;
83
- if (ObjectUtils.isFunction(resetValues)) values = await resetValues();
84
- form.reset(values, keepStateOptions);
85
- };
86
- resetFormValues();
87
- };
88
- $[15] = form;
89
- $[16] = getResetValues;
90
- $[17] = t5;
91
- } else t5 = $[17];
92
- let t6;
93
- if ($[18] !== resetDeps) {
94
- t6 = [...resetDeps];
95
- $[18] = resetDeps;
96
- $[19] = t6;
97
- } else t6 = $[19];
98
- useEffect(t5, t6);
99
- let t7;
100
- if ($[20] !== resetTimeout) {
101
- t7 = () => {
102
- shouldResetFormValuesRef.current = true;
103
- if (resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
104
- resetFormValuesTimeoutRef.current = setTimeout(() => {
105
- if (shouldResetFormValuesRef.current) throw new Error(getResetTimeoutErrorMessage(resetTimeout));
106
- }, resetTimeout);
25
+ useEffect(() => {
26
+ const resetValues = getResetValues();
27
+ if (resetValues === void 0) return;
28
+ const resetFormValues = async () => {
29
+ const keepStateOptions = shouldResetFormValuesRef.current ? { keepDirtyValues: true } : void 0;
30
+ shouldResetFormValuesRef.current = false;
31
+ let values = resetValues;
32
+ if (ObjectUtils.isFunction(resetValues)) values = await resetValues();
33
+ form.reset(values, keepStateOptions);
107
34
  };
108
- $[20] = resetTimeout;
109
- $[21] = t7;
110
- } else t7 = $[21];
111
- const onSaveSuccess = t7;
112
- let t8;
113
- if ($[22] !== normalizeAutosaveData || $[23] !== onAutosave) {
114
- t8 = (data) => {
35
+ resetFormValues();
36
+ }, [...resetDeps]);
37
+ const onSaveSuccess = () => {
38
+ shouldResetFormValuesRef.current = true;
39
+ if (resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
40
+ resetFormValuesTimeoutRef.current = setTimeout(() => {
41
+ if (shouldResetFormValuesRef.current) throw new Error(getResetTimeoutErrorMessage(resetTimeout));
42
+ }, resetTimeout);
43
+ };
44
+ useAutosave({
45
+ form,
46
+ delay: autosaveDelay,
47
+ enabled: enableAutosave,
48
+ trigger: autosaveOn,
49
+ onSave: useCallback((data) => {
115
50
  const normalizedData = normalizeAutosaveData ? normalizeAutosaveData(data) : data;
116
51
  if (!normalizedData || ObjectUtils.isEmpty(normalizedData)) return Promise.resolve(void 0);
117
52
  return onAutosave(normalizedData);
118
- };
119
- $[22] = normalizeAutosaveData;
120
- $[23] = onAutosave;
121
- $[24] = t8;
122
- } else t8 = $[24];
123
- const onSave = t8;
124
- let t9;
125
- if ($[25] !== autosaveDelay || $[26] !== autosaveOn || $[27] !== enableAutosave || $[28] !== form || $[29] !== onSave || $[30] !== onSaveSuccess) {
126
- t9 = {
127
- form,
128
- delay: autosaveDelay,
129
- enabled: enableAutosave,
130
- trigger: autosaveOn,
131
- onSave,
132
- onSaveSuccess
133
- };
134
- $[25] = autosaveDelay;
135
- $[26] = autosaveOn;
136
- $[27] = enableAutosave;
137
- $[28] = form;
138
- $[29] = onSave;
139
- $[30] = onSaveSuccess;
140
- $[31] = t9;
141
- } else t9 = $[31];
142
- useAutosave(t9);
53
+ }, [normalizeAutosaveData, onAutosave]),
54
+ onSaveSuccess
55
+ });
143
56
  return form;
144
57
  }
145
58
  //#endregion
@@ -1,64 +1,29 @@
1
- import { c } from "react/compiler-runtime";
2
1
  import { useEffect, useRef } from "react";
3
2
  //#region src/hooks/useLongPressRepeat.ts
4
- var useLongPressRepeat = (t0) => {
5
- const $ = c(10);
6
- const { onPress, enabled: t1, interval: t2, timeout: t3 } = t0;
7
- const enabled = t1 === void 0 ? true : t1;
8
- const interval = t2 === void 0 ? 85 : t2;
9
- const timeout = t3 === void 0 ? 500 : t3;
3
+ var useLongPressRepeat = ({ onPress, enabled = true, interval = 85, timeout = 500 }) => {
10
4
  const intervalRef = useRef(void 0);
11
- let t4;
12
- let t5;
13
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
14
- t4 = () => () => {
5
+ useEffect(() => {
6
+ return () => {
15
7
  clearInterval(intervalRef.current);
16
8
  };
17
- t5 = [];
18
- $[0] = t4;
19
- $[1] = t5;
20
- } else {
21
- t4 = $[0];
22
- t5 = $[1];
23
- }
24
- useEffect(t4, t5);
25
- let t6;
26
- if ($[2] !== enabled || $[3] !== interval || $[4] !== onPress || $[5] !== timeout) {
27
- t6 = () => {
28
- onPress(false);
29
- if (!enabled) return;
30
- intervalRef.current = setTimeout(() => {
9
+ }, []);
10
+ const onPressStart = () => {
11
+ onPress(false);
12
+ if (!enabled) return;
13
+ intervalRef.current = setTimeout(() => {
14
+ onPress(true);
15
+ intervalRef.current = setInterval(() => {
31
16
  onPress(true);
32
- intervalRef.current = setInterval(() => {
33
- onPress(true);
34
- }, interval);
35
- }, timeout);
36
- };
37
- $[2] = enabled;
38
- $[3] = interval;
39
- $[4] = onPress;
40
- $[5] = timeout;
41
- $[6] = t6;
42
- } else t6 = $[6];
43
- const onPressStart = t6;
44
- let t7;
45
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
46
- t7 = () => {
47
- clearInterval(intervalRef.current);
48
- };
49
- $[7] = t7;
50
- } else t7 = $[7];
51
- const onPressEnd = t7;
52
- let t8;
53
- if ($[8] !== onPressStart) {
54
- t8 = {
55
- onPressStart,
56
- onPressEnd
57
- };
58
- $[8] = onPressStart;
59
- $[9] = t8;
60
- } else t8 = $[9];
61
- return t8;
17
+ }, interval);
18
+ }, timeout);
19
+ };
20
+ const onPressEnd = () => {
21
+ clearInterval(intervalRef.current);
22
+ };
23
+ return {
24
+ onPressStart,
25
+ onPressEnd
26
+ };
62
27
  };
63
28
  //#endregion
64
29
  export { useLongPressRepeat };
package/dist/index.d.ts CHANGED
@@ -193,7 +193,6 @@ export { inputUploadButtonDefinition, inputUploadDropZoneDefinition, } from './c
193
193
  export { progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition, } from './components/inputs/File/shared/progressBar.cva';
194
194
  export type { ProgressBarConfig, ProgressBarTrackConfig, ProgressBarVariantProps, } from './components/inputs/File/shared/progressBar.cva';
195
195
  export { formFieldHeaderDefinition } from './components/inputs/FormField/formFieldHeader.cva';
196
- export { formFieldDefinition } from './components/inputs/FormField/formField.cva';
197
196
  export { formFieldErrorDefinition } from './components/inputs/FormField/formFieldError.cva';
198
197
  export { formFieldHelperDefinition } from './components/inputs/FormField/formFieldHelper.cva';
199
198
  export { textAreaWrapperDefinition } from './components/inputs/Input/TextArea/TextArea.cva';
@@ -254,6 +253,7 @@ export { DateTimeUtils } from './utils/date-time.utils';
254
253
  export { DomUtils } from './utils/dom.utils';
255
254
  export { FileUtils } from './utils/file.utils';
256
255
  export { isEqual } from './utils/isEqual';
256
+ export { IntlUtils } from './utils/intl.utils';
257
257
  export { logger } from './utils/logger';
258
258
  export { ObjectUtils } from './utils/object.utils';
259
259
  export { QueriesUtils } from './utils/queries.utils';
package/dist/index.js CHANGED
@@ -77,12 +77,12 @@ import { Checkbox } from "./components/inputs/Checkbox/Checkbox.js";
77
77
  import { formFieldHeaderDefinition } from "./components/inputs/FormField/formFieldHeader.cva.js";
78
78
  import { labelDefinition } from "./components/inputs/shared/label.cva.js";
79
79
  import { formFieldHelperDefinition } from "./components/inputs/FormField/formFieldHelper.cva.js";
80
- import { formFieldDefinition } from "./components/inputs/FormField/formField.cva.js";
81
80
  import { FormField } from "./components/inputs/FormField/FormField.js";
82
81
  import { inputBaseDefinition, inputClearClassDefinition, inputContentWrapperDefinition, inputSideDefinition, inputSizeDefinition } from "./components/inputs/shared/input.cva.js";
83
82
  import { CheckboxGroup } from "./components/inputs/Checkbox/CheckboxGroup.js";
84
83
  import { useLongPressRepeat } from "./hooks/useLongPressRepeat.js";
85
84
  import { useScrollableListBox } from "./hooks/useScrollableListBox.js";
85
+ import { IntlUtils } from "./utils/intl.utils.js";
86
86
  import { DateTimeUtils } from "./utils/date-time.utils.js";
87
87
  import { datePickerInputContentRowDefinition } from "./components/inputs/DateTime/shared/datePickerInput.cva.js";
88
88
  import { popoverDefinition } from "./components/shared/popover.cva.js";
@@ -177,4 +177,4 @@ import { useSorting } from "./hooks/useSorting.js";
177
177
  import { useTableColumnConfig } from "./hooks/useTableColumnConfig.js";
178
178
  import { ArrayUtils } from "./utils/array.utils.js";
179
179
  import { QueriesUtils } from "./utils/queries.utils.js";
180
- export { Accordion, ActionModal, Alert, AlignCenterIcon, AlignLeftIcon, AlignLeftRightIcon, AlignRightIcon, ArrayUtils, ArrowDropDownIcon, ArrowDropUpIcon, ArrowLeftIcon, ArrowRightIcon, Autocomplete, BoldIcon, BottomSheet, Breadcrumbs, BulletedListIcon, Button, CalendarIcon, CellText, CheckIcon, Checkbox, CheckboxCheckmarkIcon, CheckboxGroup, CheckboxIndeterminateIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ClockIcon, CloseIcon, ColumnConfigModal, Confirmation, DatePicker, DateRangePicker, DateTimeIcon, DateTimePicker, DateTimeUtils, DateUtils, DomUtils, Drawer, FileUpload, FileUploadContainer, FileUtils, Form, FormField, HeaderText, HighlightIcon, HighlightOnIcon, HomeIcon, IconButton, InfiniteTable, InfoIcon, InlineIconButton, InputUpload, Inputs, ItalicIcon, Link, LinkContext, LinkIcon, Loader, Menu, MenuIcon, MenuItem, MenuPopover, Modal, NumberInput, NumberRangeInput, NumberedListIcon, ObjectUtils, PaginatedTable, Pagination, PaginationList, PasswordInput, Pill, PillButton, PointerHorizontalIcon, PointerVerticalIcon, ProgressBar, QueriesUtils, QueryAutocomplete, QuerySelect, RadioGroup, ResponsivePopover, RestUtils, RoutingUtils, Segment, Select, SendIcon, Slider, SplitButton, Stepper, StrikethroughIcon, StringUtils, Table, Tag, TextArea, TextButton, TextColorIcon, TextInput, ThemeContext, TimePicker, Toast, ToastContainer, Toggle, ToggleButton, Tooltip, TooltipEllipsis, Typography, UIConfig, UIOverrides, UIRouter, UnderlinedIcon, VisibilityIcon, VisibilityOffIcon, ZodUtils, accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition, alertDefinition, breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition, buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, checkboxContentRowDefinition, checkboxContentWrapperDefinition, checkboxDefinition, checkboxGroupLabelDefinition, checkboxIconDefinition, compoundMapper, createKeyInteractionsHandler, datePickerInputContentRowDefinition, dynamicColumns, dynamicInputs, fileUploadDropZoneDefinition, formFieldDefinition, formFieldErrorDefinition, formFieldHeaderDefinition, formFieldHelperDefinition, getKeyInteractionAction, inputBaseDefinition, inputClearClassDefinition, inputContentWrapperDefinition, inputSideDefinition, inputSizeDefinition, inputUploadButtonDefinition, inputUploadDropZoneDefinition, isEqual, labelDefinition, linkDefinition, loaderDefinition, loaderWrapperDefinition, logger, menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition, modalContentDefinition, modalMainDefinition, modalOverlayDefinition, ns, pillButtonContentDefinition, pillButtonDefinition, popoverDefinition, progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition, radioContentRowDefinition, radioContentWrapperDefinition, radioDefinition, resources, segmentDefinition, segmentItemDefinition, selectInputTagsContentWrapperDefinition, selectListBoxItemDefinition, selectPopoverDefinition, statusIconDefinition, statusSeparatorDefinition, stepperDefinition, stepperIconDefinition, stepperItemDefinition, stepperNumberDefinition, stepperSeparatorDefinition, stepperSubtextDefinition, stepperTitleDefinition, tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition, tagDefinition, textAreaWrapperDefinition, toastDefinition, statusIconDefinition$1 as toastStatusIconDefinition, statusSeparatorDefinition$1 as toastStatusSeparatorDefinition, toggleDefinition, tooltipDefinition, tooltipPointerHorizontalDefinition, tooltipPointerVerticalDefinition, tooltipTextDefinition, tooltipWrapperTriggerDefinition, typographyDefinition, uiOutlineClass, useAutosave, useBreakpoint, useDebounceCallback, useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo, useFilters, useForm, useFormAutosave, useIntersectionObserver, useKeyInteractions, useLocalStorage, useLongPressRepeat, usePagination, useScrollableListBox, useSorting, useStateAndRef, useTableColumnConfig, useTableNav, useToast, useTranslationMemo };
180
+ export { Accordion, ActionModal, Alert, AlignCenterIcon, AlignLeftIcon, AlignLeftRightIcon, AlignRightIcon, ArrayUtils, ArrowDropDownIcon, ArrowDropUpIcon, ArrowLeftIcon, ArrowRightIcon, Autocomplete, BoldIcon, BottomSheet, Breadcrumbs, BulletedListIcon, Button, CalendarIcon, CellText, CheckIcon, Checkbox, CheckboxCheckmarkIcon, CheckboxGroup, CheckboxIndeterminateIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ClockIcon, CloseIcon, ColumnConfigModal, Confirmation, DatePicker, DateRangePicker, DateTimeIcon, DateTimePicker, DateTimeUtils, DateUtils, DomUtils, Drawer, FileUpload, FileUploadContainer, FileUtils, Form, FormField, HeaderText, HighlightIcon, HighlightOnIcon, HomeIcon, IconButton, InfiniteTable, InfoIcon, InlineIconButton, InputUpload, Inputs, IntlUtils, ItalicIcon, Link, LinkContext, LinkIcon, Loader, Menu, MenuIcon, MenuItem, MenuPopover, Modal, NumberInput, NumberRangeInput, NumberedListIcon, ObjectUtils, PaginatedTable, Pagination, PaginationList, PasswordInput, Pill, PillButton, PointerHorizontalIcon, PointerVerticalIcon, ProgressBar, QueriesUtils, QueryAutocomplete, QuerySelect, RadioGroup, ResponsivePopover, RestUtils, RoutingUtils, Segment, Select, SendIcon, Slider, SplitButton, Stepper, StrikethroughIcon, StringUtils, Table, Tag, TextArea, TextButton, TextColorIcon, TextInput, ThemeContext, TimePicker, Toast, ToastContainer, Toggle, ToggleButton, Tooltip, TooltipEllipsis, Typography, UIConfig, UIOverrides, UIRouter, UnderlinedIcon, VisibilityIcon, VisibilityOffIcon, ZodUtils, accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition, alertDefinition, breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition, buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, checkboxContentRowDefinition, checkboxContentWrapperDefinition, checkboxDefinition, checkboxGroupLabelDefinition, checkboxIconDefinition, compoundMapper, createKeyInteractionsHandler, datePickerInputContentRowDefinition, dynamicColumns, dynamicInputs, fileUploadDropZoneDefinition, formFieldErrorDefinition, formFieldHeaderDefinition, formFieldHelperDefinition, getKeyInteractionAction, inputBaseDefinition, inputClearClassDefinition, inputContentWrapperDefinition, inputSideDefinition, inputSizeDefinition, inputUploadButtonDefinition, inputUploadDropZoneDefinition, isEqual, labelDefinition, linkDefinition, loaderDefinition, loaderWrapperDefinition, logger, menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition, modalContentDefinition, modalMainDefinition, modalOverlayDefinition, ns, pillButtonContentDefinition, pillButtonDefinition, popoverDefinition, progressBarDefinition, progressBarFillDefinition, progressBarTrackDefinition, progressBarTrackWrapperDefinition, progressBarValueDefinition, radioContentRowDefinition, radioContentWrapperDefinition, radioDefinition, resources, segmentDefinition, segmentItemDefinition, selectInputTagsContentWrapperDefinition, selectListBoxItemDefinition, selectPopoverDefinition, statusIconDefinition, statusSeparatorDefinition, stepperDefinition, stepperIconDefinition, stepperItemDefinition, stepperNumberDefinition, stepperSeparatorDefinition, stepperSubtextDefinition, stepperTitleDefinition, tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition, tagDefinition, textAreaWrapperDefinition, toastDefinition, statusIconDefinition$1 as toastStatusIconDefinition, statusSeparatorDefinition$1 as toastStatusSeparatorDefinition, toggleDefinition, tooltipDefinition, tooltipPointerHorizontalDefinition, tooltipPointerVerticalDefinition, tooltipTextDefinition, tooltipWrapperTriggerDefinition, typographyDefinition, uiOutlineClass, useAutosave, useBreakpoint, useDebounceCallback, useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo, useFilters, useForm, useFormAutosave, useIntersectionObserver, useKeyInteractions, useLocalStorage, useLongPressRepeat, usePagination, useScrollableListBox, useSorting, useStateAndRef, useTableColumnConfig, useTableNav, useToast, useTranslationMemo };
@@ -38,6 +38,5 @@ export declare namespace DateTimeUtils {
38
38
  export function fromUTCISOToCalendarDate(isoString: string): CalendarDate;
39
39
  export function fromCalendarDateTimeToUTCISO(calendarDateTime: CalendarDateTime): string;
40
40
  export function fromUTCISOToCalendarDateTime(isoString: string, timeZone?: string): CalendarDateTime;
41
- export function formatTextDateToCalendarDateTime(textDate: string | null, timeZone?: string, locale?: string): CalendarDateTime | null;
42
41
  export {};
43
42
  }
@@ -1,3 +1,4 @@
1
+ import { IntlUtils } from "./intl.utils.js";
1
2
  import { CalendarDate, CalendarDateTime, DateFormatter, fromDate, getLocalTimeZone, parseAbsolute } from "@internationalized/date";
2
3
  import { DateTime } from "luxon";
3
4
  //#region src/utils/date-time.utils.ts
@@ -5,33 +6,42 @@ var DateTimeUtils;
5
6
  (function(_DateTimeUtils) {
6
7
  const DATE_SAMPLE_DATE_UTC = new Date(Date.UTC(2e3, 10, 22));
7
8
  const TIME_SAMPLE_DATE_UTC = new Date(Date.UTC(2e3, 10, 22, 6, 45));
9
+ const timeFormatters = /* @__PURE__ */ new Map();
8
10
  const getDayMonthFormat = (shouldForceLeadingZeros = false) => shouldForceLeadingZeros ? "2-digit" : "numeric";
9
11
  const getTimeHourFormat = (shouldForceLeadingZeros = false) => shouldForceLeadingZeros ? "2-digit" : "numeric";
10
- const getDatePlaceholderFormatter = (locale, options) => new Intl.DateTimeFormat(locale, {
12
+ const getDatePlaceholderFormatter = (locale, options) => IntlUtils.getDateTimeFormatter(locale, {
11
13
  day: getDayMonthFormat(options?.shouldForceLeadingZeros),
12
14
  month: getDayMonthFormat(options?.shouldForceLeadingZeros),
13
15
  year: "numeric"
14
16
  });
15
- const getTimePlaceholderFormatter = (locale) => new Intl.DateTimeFormat(locale, {
17
+ const getTimePlaceholderFormatter = (locale) => IntlUtils.getDateTimeFormatter(locale, {
16
18
  hour: "2-digit",
17
19
  minute: "2-digit"
18
20
  });
19
21
  const getResolvedLocale = (locale) => {
20
22
  if (locale) return locale;
21
- return new Intl.DateTimeFormat().resolvedOptions().locale;
23
+ return IntlUtils.getDateTimeFormatter().resolvedOptions().locale;
22
24
  };
23
- const getDateFormatter = (locale, options) => new Intl.DateTimeFormat(getResolvedLocale(locale), {
25
+ const getDateFormatter = (locale, options) => IntlUtils.getDateTimeFormatter(getResolvedLocale(locale), {
24
26
  day: getDayMonthFormat(options?.shouldForceLeadingZeros),
25
27
  month: getDayMonthFormat(options?.shouldForceLeadingZeros),
26
28
  year: "numeric",
27
29
  timeZone: "UTC"
28
30
  });
29
- const getTimeFormatter = (locale, options) => new DateFormatter(getResolvedLocale(locale), {
30
- hour: getTimeHourFormat(options?.shouldForceLeadingZeros),
31
- minute: "2-digit",
32
- timeZone: "UTC"
33
- });
34
- const getDateTimeFormatter = (locale, options) => new Intl.DateTimeFormat(getResolvedLocale(locale), {
31
+ const getTimeFormatter = (locale, options) => {
32
+ const resolvedLocale = getResolvedLocale(locale);
33
+ const key = `${resolvedLocale}|${options?.shouldForceLeadingZeros ?? false}`;
34
+ const cachedFormatter = timeFormatters.get(key);
35
+ if (cachedFormatter) return cachedFormatter;
36
+ const formatter = new DateFormatter(resolvedLocale, {
37
+ hour: getTimeHourFormat(options?.shouldForceLeadingZeros),
38
+ minute: "2-digit",
39
+ timeZone: "UTC"
40
+ });
41
+ timeFormatters.set(key, formatter);
42
+ return formatter;
43
+ };
44
+ const getDateTimeFormatter = (locale, options) => IntlUtils.getDateTimeFormatter(getResolvedLocale(locale), {
35
45
  day: getDayMonthFormat(options?.shouldForceLeadingZeros),
36
46
  month: getDayMonthFormat(options?.shouldForceLeadingZeros),
37
47
  year: "numeric",
@@ -39,22 +49,8 @@ var DateTimeUtils;
39
49
  minute: "2-digit",
40
50
  timeZone: "UTC"
41
51
  });
42
- const getLocaleDateFormat = (locale) => {
43
- const sampleDate = new Date(Date.UTC(2e3, 10, 22));
44
- return new Intl.DateTimeFormat(locale, {
45
- day: "2-digit",
46
- month: "2-digit",
47
- year: "numeric",
48
- timeZone: "UTC"
49
- }).formatToParts(sampleDate).map((part) => {
50
- if (part.type === "day") return "dd";
51
- if (part.type === "month") return "MM";
52
- if (part.type === "year") return "yyyy";
53
- return part.value;
54
- }).join("");
55
- };
56
52
  const repeatLocalizedFieldLabel = (type, length, locale) => {
57
- const placeholderChar = new Intl.DisplayNames(getResolvedLocale(locale), { type: "dateTimeField" }).of(type)?.trim().charAt(0).toLocaleLowerCase(getResolvedLocale(locale));
53
+ const placeholderChar = IntlUtils.getDisplayNamesFormatter(getResolvedLocale(locale), { type: "dateTimeField" }).of(type)?.trim().charAt(0).toLocaleLowerCase(getResolvedLocale(locale));
58
54
  if (!placeholderChar) return null;
59
55
  return placeholderChar.repeat(length);
60
56
  };
@@ -191,26 +187,6 @@ var DateTimeUtils;
191
187
  return new CalendarDateTime(zonedDateTime.year, zonedDateTime.month, zonedDateTime.day, zonedDateTime.hour, zonedDateTime.minute, zonedDateTime.second, zonedDateTime.millisecond);
192
188
  }
193
189
  _DateTimeUtils.fromUTCISOToCalendarDateTime = fromUTCISOToCalendarDateTime;
194
- function formatTextDateToCalendarDateTime(textDate, timeZone, locale) {
195
- if (!textDate?.includes("hh")) return null;
196
- const datePart = textDate.split(",").at(0)?.trim();
197
- if (!datePart) return null;
198
- const resolvedTimeZone = resolveTimeZone(timeZone);
199
- const resolvedLocale = locale || Intl.DateTimeFormat().resolvedOptions().locale;
200
- const localeDateFormat = getLocaleDateFormat(resolvedLocale);
201
- const parseOptions = {
202
- zone: resolvedTimeZone,
203
- locale: resolvedLocale
204
- };
205
- let parsedDateTime = DateTime.fromFormat(datePart, localeDateFormat, parseOptions);
206
- if (!parsedDateTime.isValid && localeDateFormat.includes("yyyy")) {
207
- const shortYearFormat = localeDateFormat.replace("yyyy", "yy");
208
- parsedDateTime = DateTime.fromFormat(datePart, shortYearFormat, parseOptions);
209
- }
210
- if (!parsedDateTime.isValid) return null;
211
- return new CalendarDateTime(parsedDateTime.year, parsedDateTime.month, parsedDateTime.day, 0, 0, 0, 0);
212
- }
213
- _DateTimeUtils.formatTextDateToCalendarDateTime = formatTextDateToCalendarDateTime;
214
190
  })(DateTimeUtils || (DateTimeUtils = {}));
215
191
  //#endregion
216
192
  export { DateTimeUtils };
@@ -0,0 +1,7 @@
1
+ type IntlLocale = Intl.LocalesArgument;
2
+ export declare namespace IntlUtils {
3
+ const getDateTimeFormatter: (locale?: IntlLocale, options?: Intl.DateTimeFormatOptions) => Intl.DateTimeFormat;
4
+ const getDisplayNamesFormatter: (locale: IntlLocale, options: Intl.DisplayNamesOptions) => Intl.DisplayNames;
5
+ const getNumberFormatter: (locale?: IntlLocale, options?: Intl.NumberFormatOptions) => Intl.NumberFormat;
6
+ }
7
+ export {};
@@ -0,0 +1,38 @@
1
+ //#region src/utils/intl.utils.ts
2
+ var formatterCacheKey = (locale, options) => {
3
+ const locales = Array.isArray(locale) ? locale.map(String) : locale ? [String(locale)] : [];
4
+ const normalizedOptions = Object.entries(options ?? {}).sort(([left], [right]) => left.localeCompare(right));
5
+ return JSON.stringify([locales, normalizedOptions]);
6
+ };
7
+ var IntlUtils;
8
+ (function(_IntlUtils) {
9
+ const dateTimeFormatters = /* @__PURE__ */ new Map();
10
+ const displayNamesFormatters = /* @__PURE__ */ new Map();
11
+ const numberFormatters = /* @__PURE__ */ new Map();
12
+ _IntlUtils.getDateTimeFormatter = (locale, options) => {
13
+ const key = formatterCacheKey(locale, options);
14
+ const cachedFormatter = dateTimeFormatters.get(key);
15
+ if (cachedFormatter) return cachedFormatter;
16
+ const formatter = new Intl.DateTimeFormat(locale, options);
17
+ dateTimeFormatters.set(key, formatter);
18
+ return formatter;
19
+ };
20
+ _IntlUtils.getDisplayNamesFormatter = (locale, options) => {
21
+ const key = formatterCacheKey(locale, options);
22
+ const cachedFormatter = displayNamesFormatters.get(key);
23
+ if (cachedFormatter) return cachedFormatter;
24
+ const formatter = new Intl.DisplayNames(locale, options);
25
+ displayNamesFormatters.set(key, formatter);
26
+ return formatter;
27
+ };
28
+ _IntlUtils.getNumberFormatter = (locale, options) => {
29
+ const key = formatterCacheKey(locale, options);
30
+ const cachedFormatter = numberFormatters.get(key);
31
+ if (cachedFormatter) return cachedFormatter;
32
+ const formatter = new Intl.NumberFormat(locale, options);
33
+ numberFormatters.set(key, formatter);
34
+ return formatter;
35
+ };
36
+ })(IntlUtils || (IntlUtils = {}));
37
+ //#endregion
38
+ export { IntlUtils };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "3.3.0-rc.3",
3
+ "version": "3.3.0",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,6 @@
30
30
  "@react-stately/calendar": "^3.9.2",
31
31
  "@react-stately/datepicker": "^3.16.0",
32
32
  "@react-types/shared": "^3.33.0",
33
- "@tanstack/react-query": "~5.90.21",
34
33
  "@tanstack/react-table": "^8.21.3",
35
34
  "axios": "^1.13.2",
36
35
  "class-variance-authority": "^0.7.1",
@@ -52,6 +51,7 @@
52
51
  "peerDependencies": {
53
52
  "@casl/ability": "^6.7.3",
54
53
  "@casl/react": "^5.0.0",
54
+ "@tanstack/react-query": "^5.89.0",
55
55
  "@tiptap/core": "^3.19.0",
56
56
  "@tiptap/extension-color": "^3.19.0",
57
57
  "@tiptap/extension-heading": "^3.19.0",
@@ -1,11 +0,0 @@
1
- export declare const formFieldDefinition: {
2
- base: string[];
3
- config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
4
- readonly as: {
5
- readonly default: "";
6
- readonly filter: "";
7
- readonly floating: "";
8
- readonly inline: "";
9
- };
10
- }>;
11
- };
@@ -1,16 +0,0 @@
1
- import { UIOverrides } from "../../../config/uiOverrides.context.js";
2
- //#region src/components/inputs/FormField/formField.cva.ts
3
- var formFieldDefinition = UIOverrides.defineConfig({
4
- base: [""],
5
- config: {
6
- variants: { as: {
7
- default: "",
8
- filter: "",
9
- floating: "",
10
- inline: ""
11
- } },
12
- defaultVariants: { as: "default" }
13
- }
14
- });
15
- //#endregion
16
- export { formFieldDefinition };
@@ -1,9 +0,0 @@
1
- import { InputDef } from '../inputs/Inputs/InputItem';
2
- import { UseFormReturn } from 'react-hook-form';
3
- interface TableColumnFilterInputProps<TFilterData extends Record<string, any>> {
4
- form: UseFormReturn<TFilterData>;
5
- inputDef: InputDef<TFilterData>;
6
- className?: string;
7
- }
8
- export declare const TableColumnFilterInput: <TFilterData extends Record<string, any>>({ form, inputDef, className, }: TableColumnFilterInputProps<TFilterData>) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -1,108 +0,0 @@
1
- import { Inputs } from "../inputs/Inputs/Inputs.js";
2
- import { c } from "react/compiler-runtime";
3
- import { jsx } from "react/jsx-runtime";
4
- import { clsx } from "clsx";
5
- //#region src/components/table/TableColumnFilterInput.tsx
6
- var TableColumnFilterInput = (t0) => {
7
- const $ = c(28);
8
- const { form, inputDef, className } = t0;
9
- const filterKey = String(inputDef.name);
10
- const inputProps = inputDef.props;
11
- const t1 = inputProps?.className;
12
- let t2;
13
- if ($[0] !== t1) {
14
- t2 = clsx("w-full min-w-0 max-w-full", t1, "[&_label]:sr-only");
15
- $[0] = t1;
16
- $[1] = t2;
17
- } else t2 = $[1];
18
- const t3 = inputProps?.containerClassName;
19
- let t4;
20
- if ($[2] !== t3) {
21
- t4 = clsx("w-full min-w-0 max-w-full", t3);
22
- $[2] = t3;
23
- $[3] = t4;
24
- } else t4 = $[3];
25
- const t5 = inputProps?.inputClassName;
26
- let t6;
27
- if ($[4] !== t5) {
28
- t6 = clsx("min-w-0 max-w-full truncate", t5);
29
- $[4] = t5;
30
- $[5] = t6;
31
- } else t6 = $[5];
32
- let t7;
33
- if ($[6] !== inputProps || $[7] !== t2 || $[8] !== t4 || $[9] !== t6) {
34
- t7 = {
35
- ...inputProps,
36
- as: "filter",
37
- className: t2,
38
- containerClassName: t4,
39
- inputClassName: t6,
40
- hideLabel: true,
41
- isClearable: true,
42
- placeholder: "",
43
- size: "extra-small"
44
- };
45
- $[6] = inputProps;
46
- $[7] = t2;
47
- $[8] = t4;
48
- $[9] = t6;
49
- $[10] = t7;
50
- } else t7 = $[10];
51
- const props = t7;
52
- let t8;
53
- if ($[11] !== filterKey || $[12] !== inputDef.label) {
54
- t8 = typeof inputDef.label === "string" && inputDef.label.trim() ? inputDef.label : filterKey;
55
- $[11] = filterKey;
56
- $[12] = inputDef.label;
57
- $[13] = t8;
58
- } else t8 = $[13];
59
- let t9;
60
- if ($[14] !== inputDef || $[15] !== props || $[16] !== t8) {
61
- t9 = {
62
- ...inputDef,
63
- label: t8,
64
- placeholder: "",
65
- props
66
- };
67
- $[14] = inputDef;
68
- $[15] = props;
69
- $[16] = t8;
70
- $[17] = t9;
71
- } else t9 = $[17];
72
- const inlineInputDef = t9;
73
- let t10;
74
- if ($[18] !== className) {
75
- t10 = clsx("w-full min-w-0 max-w-full [&>*]:w-full [&_*]:min-w-0", className);
76
- $[18] = className;
77
- $[19] = t10;
78
- } else t10 = $[19];
79
- let t11;
80
- if ($[20] !== inlineInputDef) {
81
- t11 = [inlineInputDef];
82
- $[20] = inlineInputDef;
83
- $[21] = t11;
84
- } else t11 = $[21];
85
- let t12;
86
- if ($[22] !== form || $[23] !== t11) {
87
- t12 = /* @__PURE__ */ jsx(Inputs, {
88
- form,
89
- inputDefs: t11
90
- });
91
- $[22] = form;
92
- $[23] = t11;
93
- $[24] = t12;
94
- } else t12 = $[24];
95
- let t13;
96
- if ($[25] !== t10 || $[26] !== t12) {
97
- t13 = /* @__PURE__ */ jsx("div", {
98
- className: t10,
99
- children: t12
100
- });
101
- $[25] = t10;
102
- $[26] = t12;
103
- $[27] = t13;
104
- } else t13 = $[27];
105
- return t13;
106
- };
107
- //#endregion
108
- export { TableColumnFilterInput };
@@ -1,5 +0,0 @@
1
- interface TableColumnFilterPlaceholderProps {
2
- label?: string;
3
- }
4
- export declare const TableColumnFilterPlaceholder: ({ label }: TableColumnFilterPlaceholderProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};