@povio/ui 2.2.5 → 2.2.7

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 (262) hide show
  1. package/dist/assets/icons/AlignCenter.js +3 -1
  2. package/dist/assets/icons/AlignLeft.js +3 -1
  3. package/dist/assets/icons/AlignLeftRight.js +3 -1
  4. package/dist/assets/icons/AlignRight.js +3 -1
  5. package/dist/assets/icons/ArrowDropDown.js +3 -1
  6. package/dist/assets/icons/ArrowDropUp.js +3 -1
  7. package/dist/assets/icons/ArrowLeft.js +3 -1
  8. package/dist/assets/icons/ArrowRight.js +3 -1
  9. package/dist/assets/icons/Bold.js +3 -1
  10. package/dist/assets/icons/BulletedList.js +3 -1
  11. package/dist/assets/icons/Calendar.js +3 -1
  12. package/dist/assets/icons/Check.js +3 -1
  13. package/dist/assets/icons/CheckCircle.js +3 -1
  14. package/dist/assets/icons/CheckboxCheckmark.js +3 -1
  15. package/dist/assets/icons/CheckboxIndeterminate.js +3 -1
  16. package/dist/assets/icons/ChevronDown.js +3 -1
  17. package/dist/assets/icons/ChevronLeft.js +3 -1
  18. package/dist/assets/icons/ChevronRight.js +3 -1
  19. package/dist/assets/icons/ChevronUp.js +3 -1
  20. package/dist/assets/icons/ChevronsLeft.js +3 -1
  21. package/dist/assets/icons/ChevronsRight.js +3 -1
  22. package/dist/assets/icons/Clock.js +3 -1
  23. package/dist/assets/icons/Close.js +3 -1
  24. package/dist/assets/icons/DateTime.js +3 -1
  25. package/dist/assets/icons/DragIndicator.js +3 -1
  26. package/dist/assets/icons/File.js +3 -1
  27. package/dist/assets/icons/Highlight.js +3 -1
  28. package/dist/assets/icons/HighlightOn.js +3 -1
  29. package/dist/assets/icons/Home.js +3 -1
  30. package/dist/assets/icons/Info.js +3 -1
  31. package/dist/assets/icons/Italic.js +3 -1
  32. package/dist/assets/icons/Link.js +3 -1
  33. package/dist/assets/icons/Menu.js +3 -1
  34. package/dist/assets/icons/NumberedList.js +3 -1
  35. package/dist/assets/icons/PointerHorizontal.js +3 -1
  36. package/dist/assets/icons/PointerVertical.js +3 -1
  37. package/dist/assets/icons/Search.js +15 -0
  38. package/dist/assets/icons/Send.js +3 -1
  39. package/dist/assets/icons/Strikethrough.js +3 -1
  40. package/dist/assets/icons/TextColor.js +3 -1
  41. package/dist/assets/icons/Today.js +3 -1
  42. package/dist/assets/icons/Underlined.js +3 -1
  43. package/dist/assets/icons/Upload.js +3 -1
  44. package/dist/assets/icons/Visibility.js +3 -1
  45. package/dist/assets/icons/VisibilityOff.js +3 -1
  46. package/dist/assets/icons/WarningFilled.js +3 -1
  47. package/dist/assets/locales/en/translation.json.js +1 -0
  48. package/dist/assets/locales/sl/translation.json.js +1 -0
  49. package/dist/components/Breadcrumbs/Breadcrumbs.js +5 -3
  50. package/dist/components/Breadcrumbs/breadcrumbs.cva.js +7 -5
  51. package/dist/components/Menu/Menu.js +3 -1
  52. package/dist/components/Menu/MenuDesktop.js +3 -1
  53. package/dist/components/Menu/MenuItem.js +3 -1
  54. package/dist/components/Menu/MenuMobile.js +4 -1
  55. package/dist/components/Menu/MenuPopover.js +3 -1
  56. package/dist/components/Menu/menu.cva.js +6 -4
  57. package/dist/components/buttons/Button/Button.js +3 -1
  58. package/dist/components/buttons/Button/button.cva.js +7 -5
  59. package/dist/components/buttons/IconButton/IconButton.js +3 -1
  60. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +3 -1
  61. package/dist/components/buttons/PillButton/PillButton.js +3 -1
  62. package/dist/components/buttons/PillButton/pillButton.cva.js +6 -4
  63. package/dist/components/buttons/SplitButton/SplitButton.js +3 -1
  64. package/dist/components/buttons/TextButton/TextButton.js +3 -1
  65. package/dist/components/buttons/ToggleButton/ToggleButton.js +3 -1
  66. package/dist/components/buttons/shared/ButtonContent.js +3 -1
  67. package/dist/components/buttons/shared/buttonContent.cva.js +2 -1
  68. package/dist/components/inputs/Checkbox/Checkbox.js +4 -2
  69. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +3 -1
  70. package/dist/components/inputs/Checkbox/checkbox.cva.js +7 -4
  71. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +3 -1
  72. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +10 -8
  73. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +3 -1
  74. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +3 -1
  75. package/dist/components/inputs/DateTime/shared/Calendar.js +3 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -1
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +3 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +3 -1
  79. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +5 -3
  80. package/dist/components/inputs/DateTime/shared/DateField.js +3 -1
  81. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +3 -1
  82. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +4 -2
  83. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +6 -14
  84. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +4 -2
  85. package/dist/components/inputs/DateTime/shared/MonthPicker.js +3 -1
  86. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +3 -1
  87. package/dist/components/inputs/DateTime/shared/TimeField.js +3 -1
  88. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +3 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +3 -1
  90. package/dist/components/inputs/DateTime/shared/YearPicker.js +3 -1
  91. package/dist/components/inputs/File/FileUpload.d.ts +1 -1
  92. package/dist/components/inputs/File/FileUpload.js +21 -7
  93. package/dist/components/inputs/File/FileUploadContainer.js +3 -1
  94. package/dist/components/inputs/File/InputUpload.js +3 -1
  95. package/dist/components/inputs/File/fileUpload.types.d.ts +11 -1
  96. package/dist/components/inputs/File/shared/FileCard.js +3 -1
  97. package/dist/components/inputs/File/shared/FileCardList.js +4 -2
  98. package/dist/components/inputs/File/shared/FileUploadContent.js +3 -1
  99. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -1
  100. package/dist/components/inputs/File/shared/FileUploadContentError.js +5 -3
  101. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +6 -4
  102. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +6 -4
  103. package/dist/components/inputs/File/shared/InputUploadContent.js +4 -2
  104. package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -1
  105. package/dist/components/inputs/File/shared/ProgressBar.js +3 -1
  106. package/dist/components/inputs/File/shared/fileUpload.cva.js +4 -2
  107. package/dist/components/inputs/File/shared/inputUploadButton.cva.js +6 -3
  108. package/dist/components/inputs/FormField/FormField.js +11 -1
  109. package/dist/components/inputs/FormField/FormFieldError.js +5 -3
  110. package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
  111. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +4 -2
  112. package/dist/components/inputs/FormField/FormFieldHelper.d.ts +8 -0
  113. package/dist/components/inputs/FormField/FormFieldHelper.js +14 -0
  114. package/dist/components/inputs/FormField/FormFieldLabel.js +4 -1
  115. package/dist/components/inputs/FormField/formFieldError.cva.d.ts +6 -0
  116. package/dist/components/inputs/FormField/formFieldError.cva.js +11 -0
  117. package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +6 -0
  118. package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -0
  119. package/dist/components/inputs/Input/NumberInput/NumberInput.js +3 -1
  120. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +4 -2
  121. package/dist/components/inputs/Input/TextArea/TextArea.js +3 -1
  122. package/dist/components/inputs/Input/TextInput/TextInput.js +3 -1
  123. package/dist/components/inputs/Input/shared/InputContent.js +4 -1
  124. package/dist/components/inputs/Inputs/Form.js +2 -0
  125. package/dist/components/inputs/Inputs/InputItem.js +2 -0
  126. package/dist/components/inputs/Inputs/Inputs.js +2 -0
  127. package/dist/components/inputs/RadioGroup/RadioGroup.js +6 -4
  128. package/dist/components/inputs/RadioGroup/radio.cva.js +6 -3
  129. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +3 -1
  130. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -1
  131. package/dist/components/inputs/Selection/Select/Select.js +3 -1
  132. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
  133. package/dist/components/inputs/Selection/shared/SelectBase.js +5 -2
  134. package/dist/components/inputs/Selection/shared/SelectDesktop.js +4 -2
  135. package/dist/components/inputs/Selection/shared/SelectInput.js +4 -2
  136. package/dist/components/inputs/Selection/shared/SelectInputTags.js +3 -1
  137. package/dist/components/inputs/Selection/shared/SelectListBox.js +4 -2
  138. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +5 -3
  139. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +4 -2
  140. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +4 -2
  141. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +4 -2
  142. package/dist/components/inputs/Selection/shared/SelectMobile.js +19 -13
  143. package/dist/components/inputs/Selection/shared/select.context.js +20 -18
  144. package/dist/components/inputs/Selection/shared/useSelectItems.js +6 -4
  145. package/dist/components/inputs/Slider/Slider.js +3 -1
  146. package/dist/components/inputs/TextEditor/TextEditor.js +3 -1
  147. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +3 -1
  148. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +3 -1
  149. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +4 -2
  150. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +4 -2
  151. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +3 -1
  152. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +3 -1
  153. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +3 -1
  154. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +4 -2
  155. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +4 -2
  156. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +4 -2
  157. package/dist/components/inputs/TextEditor/textEditor.types.js +3 -1
  158. package/dist/components/inputs/Toggle/Toggle.js +3 -1
  159. package/dist/components/inputs/Toggle/toggle.cva.js +5 -2
  160. package/dist/components/inputs/shared/CheckContent.js +4 -1
  161. package/dist/components/inputs/shared/InputClear.js +5 -3
  162. package/dist/components/inputs/shared/TooltipWrapper.js +3 -1
  163. package/dist/components/inputs/shared/input.cva.js +6 -4
  164. package/dist/components/inputs/shared/label.cva.js +9 -2
  165. package/dist/components/navigation/Accordion/Accordion.js +3 -1
  166. package/dist/components/navigation/Accordion/AccordionItem.js +3 -1
  167. package/dist/components/navigation/Accordion/accordion.cva.js +12 -10
  168. package/dist/components/navigation/Stepper/Stepper.js +3 -1
  169. package/dist/components/navigation/Stepper/StepperItem.js +3 -1
  170. package/dist/components/navigation/Stepper/StepperSeparator.js +3 -1
  171. package/dist/components/navigation/Stepper/stepper.cva.js +9 -7
  172. package/dist/components/outline.clsx.js +4 -2
  173. package/dist/components/overlays/ActionModal/ActionModal.js +3 -1
  174. package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +5 -0
  175. package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -7
  176. package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +13 -0
  177. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +38 -0
  178. package/dist/components/overlays/Drawer/Drawer.js +3 -1
  179. package/dist/components/overlays/Modal/Modal.js +4 -2
  180. package/dist/components/overlays/Modal/modal.cva.js +5 -3
  181. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +7 -10
  182. package/dist/components/overlays/Tooltip/Tooltip.js +7 -2
  183. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +3 -1
  184. package/dist/components/overlays/Tooltip/tooltip.cva.js +6 -4
  185. package/dist/components/segment/Segment.js +3 -1
  186. package/dist/components/segment/SegmentItem.js +3 -1
  187. package/dist/components/segment/segment.cva.js +4 -2
  188. package/dist/components/shared/pagination/Pagination.js +4 -2
  189. package/dist/components/shared/pagination/PaginationList.js +4 -2
  190. package/dist/components/shared/pagination/minWidth.cva.js +3 -1
  191. package/dist/components/shared/popover.cva.js +3 -1
  192. package/dist/components/status/Alert/Alert.js +3 -1
  193. package/dist/components/status/Alert/alert.cva.js +3 -1
  194. package/dist/components/status/Loader/Loader.js +3 -1
  195. package/dist/components/status/Loader/loader.cva.js +4 -2
  196. package/dist/components/status/Toast/Toast.js +15 -6
  197. package/dist/components/status/Toast/toast.cva.js +6 -20
  198. package/dist/components/status/Toast/useToast.js +3 -1
  199. package/dist/components/status/shared/status.cva.js +4 -2
  200. package/dist/components/table/CellText.d.ts +2 -1
  201. package/dist/components/table/CellText.js +18 -10
  202. package/dist/components/table/ColumnConfig.js +3 -1
  203. package/dist/components/table/HeaderText.d.ts +5 -2
  204. package/dist/components/table/HeaderText.js +17 -7
  205. package/dist/components/table/InfiniteTable.js +3 -1
  206. package/dist/components/table/PaginatedTable.js +3 -1
  207. package/dist/components/table/Table.js +5 -3
  208. package/dist/components/table/table.cva.d.ts +6 -0
  209. package/dist/components/table/table.cva.js +9 -5
  210. package/dist/components/text/Link/Link.js +3 -1
  211. package/dist/components/text/Link/link.cva.js +3 -1
  212. package/dist/components/text/Tag/Tag.d.ts +3 -0
  213. package/dist/components/text/Tag/Tag.js +9 -4
  214. package/dist/components/text/Tag/tag.cva.js +3 -1
  215. package/dist/components/text/Typography/Typography.js +3 -1
  216. package/dist/components/text/Typography/typography.cva.js +3 -1
  217. package/dist/config/confirmation.context.js +4 -2
  218. package/dist/config/i18n.js +4 -2
  219. package/dist/config/link.context.js +3 -1
  220. package/dist/config/router.context.js +3 -1
  221. package/dist/config/theme.context.js +8 -6
  222. package/dist/config/uiConfig.context.d.ts +10 -2
  223. package/dist/config/uiConfig.context.js +25 -4
  224. package/dist/config/uiStyle.context.d.ts +9 -1
  225. package/dist/config/uiStyle.context.js +3 -1
  226. package/dist/helpers/dynamicColumns.js +4 -2
  227. package/dist/helpers/dynamicInputs.js +5 -3
  228. package/dist/hooks/useAutosave.js +2 -0
  229. package/dist/hooks/useBreakpoint.js +5 -3
  230. package/dist/hooks/useDebounceCallback.js +2 -0
  231. package/dist/hooks/useDeepCompare.js +5 -3
  232. package/dist/hooks/useFilters.js +3 -1
  233. package/dist/hooks/useForm.js +2 -0
  234. package/dist/hooks/useFormAutosave.js +2 -0
  235. package/dist/hooks/useIntersectionObserver.js +3 -1
  236. package/dist/hooks/useLocalStorage.js +3 -1
  237. package/dist/hooks/useLongPressRepeat.js +3 -1
  238. package/dist/hooks/usePagination.js +2 -0
  239. package/dist/hooks/useScrollableListBox.js +2 -0
  240. package/dist/hooks/useSorting.js +2 -0
  241. package/dist/hooks/useStateAndRef.js +3 -1
  242. package/dist/hooks/useTableColumnConfig.js +2 -0
  243. package/dist/hooks/useTableNav.js +124 -20
  244. package/dist/hooks/useTranslationMemo.js +2 -0
  245. package/dist/index.js +1 -1
  246. package/dist/tw-ui-plugin.js +4 -2
  247. package/dist/utils/array.utils.js +3 -1
  248. package/dist/utils/compoundMapper.js +3 -1
  249. package/dist/utils/date-time.utils.js +3 -1
  250. package/dist/utils/date.utils.js +3 -1
  251. package/dist/utils/dom.utils.js +3 -1
  252. package/dist/utils/file.utils.d.ts +4 -0
  253. package/dist/utils/file.utils.js +10 -3
  254. package/dist/utils/isEqual.js +3 -1
  255. package/dist/utils/logger.js +3 -1
  256. package/dist/utils/object.utils.js +3 -1
  257. package/dist/utils/queries.utils.js +3 -1
  258. package/dist/utils/rest.utils.js +3 -1
  259. package/dist/utils/routing.utils.js +3 -1
  260. package/dist/utils/string.utils.js +3 -1
  261. package/dist/utils/zod.utils.js +3 -1
  262. package/package.json +2 -2
@@ -2,7 +2,8 @@ import { ObjectUtils } from "../utils/object.utils.js";
2
2
  import { useDeepCompareMemo } from "../hooks/useDeepCompare.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { createContext, use } from "react";
5
- let UIConfig;
5
+ //#region src/config/uiConfig.context.tsx
6
+ var UIConfig;
6
7
  (function(_UIConfig) {
7
8
  const DEFAULT_CONFIG = {
8
9
  input: {
@@ -29,7 +30,8 @@ let UIConfig;
29
30
  selectionMode: "single",
30
31
  isSearchable: false,
31
32
  selectedTagsType: "list",
32
- collapseAfter: 3
33
+ collapseAfter: 3,
34
+ hideSearchIcon: false
33
35
  },
34
36
  toggle: { variant: "default" },
35
37
  slider: {
@@ -50,8 +52,26 @@ let UIConfig;
50
52
  },
51
53
  bottomSheet: {
52
54
  closeDragThreshold: 100,
53
- closeVelocityThreshold: 200
54
- }
55
+ closeVelocityThreshold: 200,
56
+ hideThumb: false,
57
+ headerTypography: {
58
+ size: "label-2",
59
+ variant: "prominent-1"
60
+ }
61
+ },
62
+ tableHeaderText: {
63
+ variant: "default",
64
+ size: "label-1"
65
+ },
66
+ tableCellText: {
67
+ variant: "default",
68
+ size: "label-1"
69
+ },
70
+ tag: {
71
+ textVariant: "default",
72
+ textSize: "label-2"
73
+ },
74
+ toast: { variant: "outlined" }
55
75
  };
56
76
  const Context = createContext(DEFAULT_CONFIG);
57
77
  _UIConfig.Provider = ({ config = {}, children }) => {
@@ -70,4 +90,5 @@ let UIConfig;
70
90
  return context;
71
91
  };
72
92
  })(UIConfig || (UIConfig = {}));
93
+ //#endregion
73
94
  export { UIConfig };
@@ -4,6 +4,8 @@ import { BreadcrumbChevronVariantProps, BreadcrumbIconVariantProps, BreadcrumbIt
4
4
  import { ButtonVariantProps } from '../components/buttons/Button/button.cva';
5
5
  import { PillButtonVariants } from '../components/buttons/PillButton/pillButton.cva';
6
6
  import { CheckboxIconVariantProps, CheckboxVariantProps } from '../components/inputs/Checkbox/checkbox.cva';
7
+ import { FormFieldErrorVariantProps } from '../components/inputs/FormField/formFieldError.cva';
8
+ import { FormFieldHelperVariantProps } from '../components/inputs/FormField/formFieldHelper.cva';
7
9
  import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
8
10
  import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
9
11
  import { LabelBaseProps } from '../components/inputs/shared/label.cva';
@@ -17,7 +19,7 @@ import { SegmentItemVariantProps, SegmentVariantProps } from '../components/segm
17
19
  import { PopoverVariantProps } from '../components/shared/popover.cva';
18
20
  import { AlertVariantProps } from '../components/status/Alert/alert.cva';
19
21
  import { ToastVariantProps } from '../components/status/Toast/toast.cva';
20
- import { TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableRowVariantProps } from '../components/table/table.cva';
22
+ import { TableCellTextVariantProps, TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableHeaderTextVariantProps, TableRowVariantProps } from '../components/table/table.cva';
21
23
  import { LinkVariantProps } from '../components/text/Link/link.cva';
22
24
  import { TagVariantProps } from '../components/text/Tag/tag.cva';
23
25
  import { TypographyVariantProps } from '../components/text/Typography/typography.cva';
@@ -86,6 +88,8 @@ export declare namespace UIStyle {
86
88
  headDataCva?: Cva<TableHeadDataVariantProps>;
87
89
  rowCva?: Cva<TableRowVariantProps>;
88
90
  dataCva?: Cva<TableDataVariantProps>;
91
+ headerTextCva?: Cva<TableHeaderTextVariantProps>;
92
+ cellTextCva?: Cva<TableCellTextVariantProps>;
89
93
  };
90
94
  tooltip: {
91
95
  cva?: Cva<TooltipVariantProps>;
@@ -139,6 +143,10 @@ export declare namespace UIStyle {
139
143
  popover: {
140
144
  cva?: Cva<PopoverVariantProps>;
141
145
  };
146
+ formField: {
147
+ errorLabelCva?: Cva<FormFieldErrorVariantProps>;
148
+ helperLabelCva?: Cva<FormFieldHelperVariantProps>;
149
+ };
142
150
  }
143
151
  interface ProviderProps {
144
152
  config?: Partial<Options>;
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { createContext, use } from "react";
3
- let UIStyle;
3
+ //#region src/config/uiStyle.context.tsx
4
+ var UIStyle;
4
5
  (function(_UIStyle) {
5
6
  const Context = createContext(null);
6
7
  _UIStyle.Provider = ({ children, config }) => {
@@ -25,4 +26,5 @@ let UIStyle;
25
26
  return uiStyle[k1]?.[k2] ?? fallback;
26
27
  };
27
28
  })(UIStyle || (UIStyle = {}));
29
+ //#endregion
28
30
  export { UIStyle };
@@ -3,6 +3,7 @@ import { ZodUtils } from "../utils/zod.utils.js";
3
3
  import { DateUtils } from "../utils/date.utils.js";
4
4
  import { z } from "zod";
5
5
  import i18next from "i18next";
6
+ //#region src/helpers/dynamicColumns.ts
6
7
  var DEFAULT_NAMESPACE = "dynamicColumns";
7
8
  var FORMAT_MAP = {
8
9
  datetime: (value) => DateUtils.formatDate(new Date(value)),
@@ -47,7 +48,7 @@ var convertCustomEntriesToColumnDefs = (entries) => {
47
48
  var excludeEntries = (entries) => {
48
49
  return entries.filter(([, value]) => value !== false && value !== void 0);
49
50
  };
50
- const sortColumns = (columns, orderKeys) => {
51
+ var sortColumns = (columns, orderKeys) => {
51
52
  if (!orderKeys) return columns;
52
53
  const wildcardIndex = orderKeys.indexOf("*");
53
54
  if (wildcardIndex === -1) return columns.sort((columnA, columnB) => {
@@ -246,7 +247,7 @@ var validateParams = (schema, presetColumns, options) => {
246
247
  validateOptionKeyArray(allKeys, order, "order");
247
248
  validateOptionKeyArray(usedKeys, disableFormatting, "disableFormatting");
248
249
  };
249
- const dynamicColumns = ({ schema, preset = [], options }) => {
250
+ var dynamicColumns = ({ schema, preset = [], options }) => {
250
251
  validateParams(schema, preset, options);
251
252
  const sortableKeys = normalizeSortable(options.sortable);
252
253
  let entries = Object.entries(options.columns ?? {});
@@ -269,4 +270,5 @@ const dynamicColumns = ({ schema, preset = [], options }) => {
269
270
  ];
270
271
  return sortColumns(options.includeAll ? addMissingSchemaFields(schema, mergedColumns, options, sortableKeys) : mergedColumns, options.order);
271
272
  };
273
+ //#endregion
272
274
  export { dynamicColumns };
@@ -2,6 +2,7 @@ import { StringUtils } from "../utils/string.utils.js";
2
2
  import { ZodUtils } from "../utils/zod.utils.js";
3
3
  import { z } from "zod";
4
4
  import i18next from "i18next";
5
+ //#region src/helpers/dynamicInputs.ts
5
6
  var defaultComponentTypes = {
6
7
  datetime: "datePicker",
7
8
  dateRange: "dateRangePicker",
@@ -52,7 +53,7 @@ var convertInputsConfigToObjectDefinitions = (entries) => {
52
53
  return [key, inputConfigToObjectDefinition(value)];
53
54
  });
54
55
  };
55
- const getDefaultInputComponentType = (schemaType) => {
56
+ var getDefaultInputComponentType = (schemaType) => {
56
57
  if (ZodUtils.isDateRange(schemaType)) return defaultComponentTypes.dateRange;
57
58
  const unwrappedType = ZodUtils.unwrapZodType(schemaType);
58
59
  const componentType = ZOD_TYPE_COMPONENT_TYPE.find(([zodType]) => unwrappedType instanceof zodType)?.[1];
@@ -67,7 +68,7 @@ var getDefaultSelectionItems = (keyType) => {
67
68
  }));
68
69
  return [];
69
70
  };
70
- const getDefaultSelectionMode = (keyType) => {
71
+ var getDefaultSelectionMode = (keyType) => {
71
72
  return keyType instanceof z.ZodArray ? "multiple" : "single";
72
73
  };
73
74
  var getDefaultProps = (componentType, keyType) => {
@@ -171,7 +172,7 @@ var addMissingSchemaFields = (schema, existingInputDefs, options) => {
171
172
  });
172
173
  return [...existingInputDefs, ...additionalInputDefs];
173
174
  };
174
- const dynamicInputs = ({ schema, preset = [], options }) => {
175
+ var dynamicInputs = ({ schema, preset = [], options }) => {
175
176
  validateParams(schema, preset, options);
176
177
  let entries = Object.entries(options.inputs ?? {});
177
178
  entries = excludeEntries(entries);
@@ -183,4 +184,5 @@ const dynamicInputs = ({ schema, preset = [], options }) => {
183
184
  const mergedInputDefs = [...presetInputDefs, ...inputDefs];
184
185
  return sortInputDefs(options.includeAll ? addMissingSchemaFields(schema, mergedInputDefs, options) : mergedInputDefs, options.order);
185
186
  };
187
+ //#endregion
186
188
  export { dynamicInputs, getDefaultInputComponentType };
@@ -2,6 +2,7 @@ import { ObjectUtils } from "../utils/object.utils.js";
2
2
  import { isEqual } from "../utils/isEqual.js";
3
3
  import { useEffect, useRef } from "react";
4
4
  import { useFormState, useWatch } from "react-hook-form";
5
+ //#region src/hooks/useAutosave.ts
5
6
  function isNilOrEqual(left, right) {
6
7
  if (ObjectUtils.isNil(left) && ObjectUtils.isNil(right)) return true;
7
8
  return isEqual(left, right);
@@ -59,4 +60,5 @@ function useAutosave({ form, delay = 500, enabled = true, onSave, onSaveSuccess
59
60
  reset
60
61
  ]);
61
62
  }
63
+ //#endregion
62
64
  export { useAutosave };
@@ -1,5 +1,6 @@
1
1
  import { useMemo } from "react";
2
2
  import { useMediaQuery } from "react-responsive";
3
+ //#region src/hooks/useBreakpoint.ts
3
4
  var breakpoints = null;
4
5
  function getBreakpoints() {
5
6
  if (breakpoints) return breakpoints;
@@ -21,8 +22,9 @@ function getBreakpoints() {
21
22
  return breakpoints;
22
23
  }
23
24
  function useBreakpoint(breakpointKey) {
24
- const breakpoints$1 = useMemo(() => getBreakpoints(), []);
25
- if (!breakpoints$1) throw new Error("Tailwind config is missing theme.screens");
26
- return useMediaQuery({ query: `(min-width: ${breakpoints$1[breakpointKey]})` });
25
+ const breakpoints = useMemo(() => getBreakpoints(), []);
26
+ if (!breakpoints) throw new Error("Tailwind config is missing theme.screens");
27
+ return useMediaQuery({ query: `(min-width: ${breakpoints[breakpointKey]})` });
27
28
  }
29
+ //#endregion
28
30
  export { useBreakpoint };
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
+ //#region src/hooks/useDebounceCallback.ts
2
3
  function useDebounceCallback(callback, { delay = 500 } = {}) {
3
4
  const timeoutRef = useRef(null);
4
5
  const [isDebouncing, setIsDebouncing] = useState(false);
@@ -20,4 +21,5 @@ function useDebounceCallback(callback, { delay = 500 } = {}) {
20
21
  isDebouncing
21
22
  };
22
23
  }
24
+ //#endregion
23
25
  export { useDebounceCallback };
@@ -1,12 +1,13 @@
1
1
  import { isEqual } from "../utils/isEqual.js";
2
2
  import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
3
- const useDeepCompareEffect = (callback, dependencies) => {
3
+ //#region src/hooks/useDeepCompare.ts
4
+ var useDeepCompareEffect = (callback, dependencies) => {
4
5
  return useEffect(callback, useDeepCompareDeps(dependencies));
5
6
  };
6
- const useDeepCompareLayoutEffect = (callback, dependencies) => {
7
+ var useDeepCompareLayoutEffect = (callback, dependencies) => {
7
8
  return useLayoutEffect(callback, useDeepCompareDeps(dependencies));
8
9
  };
9
- const useDeepCompareMemo = (factory, dependencies) => {
10
+ var useDeepCompareMemo = (factory, dependencies) => {
10
11
  return useMemo(factory, useDeepCompareDeps(dependencies));
11
12
  };
12
13
  var useDeepCompareDeps = (value) => {
@@ -18,4 +19,5 @@ var useDeepCompareDeps = (value) => {
18
19
  }
19
20
  return [signalRef.current];
20
21
  };
22
+ //#endregion
21
23
  export { useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo };
@@ -1,6 +1,7 @@
1
1
  import { UIRouter } from "../config/router.context.js";
2
2
  import { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import { z } from "zod";
4
+ //#region src/hooks/useFilters.ts
4
5
  function getFieldType(schema, fieldKey) {
5
6
  if (!schema || !schema.shape) return "unknown";
6
7
  let fieldSchema = schema.shape[fieldKey];
@@ -44,7 +45,7 @@ var parseFilterFromQuery = (searchParams, schema) => {
44
45
  }
45
46
  return filter;
46
47
  };
47
- const useFilters = (defaultFilterValues, prefix = "", schema) => {
48
+ var useFilters = (defaultFilterValues, prefix = "", schema) => {
48
49
  const { searchParams, pathname, replace } = UIRouter.useUIRouter();
49
50
  const [filterData, setFilterData] = useState(() => parseFilterFromQuery(searchParams, schema));
50
51
  useEffect(() => {
@@ -118,4 +119,5 @@ const useFilters = (defaultFilterValues, prefix = "", schema) => {
118
119
  clearAllFilters
119
120
  ]);
120
121
  };
122
+ //#endregion
121
123
  export { useFilters };
@@ -1,6 +1,7 @@
1
1
  import { useMemo } from "react";
2
2
  import { useForm } from "react-hook-form";
3
3
  import { zodResolver } from "@hookform/resolvers/zod";
4
+ //#region src/hooks/useForm.ts
4
5
  function useForm$1({ resolver, zodSchema, defaultValues, ...props }) {
5
6
  const formResolver = useMemo(() => resolver ?? (zodSchema ? zodResolver(zodSchema) : void 0), [resolver, zodSchema]);
6
7
  return useForm({
@@ -9,4 +10,5 @@ function useForm$1({ resolver, zodSchema, defaultValues, ...props }) {
9
10
  defaultValues
10
11
  });
11
12
  }
13
+ //#endregion
12
14
  export { useForm$1 as useForm };
@@ -2,6 +2,7 @@ import { ObjectUtils } from "../utils/object.utils.js";
2
2
  import { useAutosave } from "./useAutosave.js";
3
3
  import { useForm } from "./useForm.js";
4
4
  import { useEffect, useRef } from "react";
5
+ //#region src/hooks/useFormAutosave.ts
5
6
  var getResetTimeoutErrorMessage = (resetTimeout) => `Form Reset Timeout (${resetTimeout}ms) - Action Required
6
7
  Problem: Form values weren't reset after submission.
7
8
 
@@ -49,4 +50,5 @@ function useFormAutosave({ autosaveDelay, enableAutosave, onAutosave, getResetVa
49
50
  });
50
51
  return form;
51
52
  }
53
+ //#endregion
52
54
  export { useFormAutosave };
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useRef } from "react";
2
- const useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, rootMargin, threshold }) => {
2
+ //#region src/hooks/useIntersectionObserver.ts
3
+ var useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, rootMargin, threshold }) => {
3
4
  const ref = useRef(null);
4
5
  useEffect(() => {
5
6
  const observer = new IntersectionObserver((entries) => {
@@ -20,4 +21,5 @@ const useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, r
20
21
  ]);
21
22
  return { ref };
22
23
  };
24
+ //#endregion
23
25
  export { useIntersectionObserver };
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useState } from "react";
2
+ //#region src/hooks/useLocalStorage.ts
2
3
  var getValue = (key, schema) => {
3
4
  if (!localStorage) return null;
4
5
  const lsValue = localStorage.getItem(key);
@@ -13,7 +14,7 @@ var getValue = (key, schema) => {
13
14
  if (parsedValue.success) return parsedValue.data;
14
15
  else return null;
15
16
  };
16
- const useLocalStorage = ({ key, schema }) => {
17
+ var useLocalStorage = ({ key, schema }) => {
17
18
  const [value, setValue] = useState(() => getValue(key, schema));
18
19
  return {
19
20
  value,
@@ -32,4 +33,5 @@ const useLocalStorage = ({ key, schema }) => {
32
33
  }, [key])
33
34
  };
34
35
  };
36
+ //#endregion
35
37
  export { useLocalStorage };
@@ -1,5 +1,6 @@
1
1
  import { useEffect, useRef } from "react";
2
- const useLongPressRepeat = ({ onPress, enabled = true, interval = 85, timeout = 500 }) => {
2
+ //#region src/hooks/useLongPressRepeat.ts
3
+ var useLongPressRepeat = ({ onPress, enabled = true, interval = 85, timeout = 500 }) => {
3
4
  const intervalRef = useRef(void 0);
4
5
  useEffect(() => {
5
6
  return () => {
@@ -24,4 +25,5 @@ const useLongPressRepeat = ({ onPress, enabled = true, interval = 85, timeout =
24
25
  onPressEnd
25
26
  };
26
27
  };
28
+ //#endregion
27
29
  export { useLongPressRepeat };
@@ -1,5 +1,6 @@
1
1
  import { UIRouter } from "../config/router.context.js";
2
2
  import { useEffect, useState } from "react";
3
+ //#region src/hooks/usePagination.ts
3
4
  var DEFAULT_STATE = {
4
5
  pageIndex: 1,
5
6
  pageSize: 20
@@ -23,4 +24,5 @@ function usePagination(defaultPagination) {
23
24
  pageSize: pagination.pageSize
24
25
  };
25
26
  }
27
+ //#endregion
26
28
  export { usePagination };
@@ -1,5 +1,6 @@
1
1
  import { useBreakpoint } from "./useBreakpoint.js";
2
2
  import { useEffect, useRef } from "react";
3
+ //#region src/hooks/useScrollableListBox.ts
3
4
  function useScrollableListBox() {
4
5
  const ref = useRef(null);
5
6
  const isDesktop = useBreakpoint("md");
@@ -21,4 +22,5 @@ function useScrollableListBox() {
21
22
  }, [ref, isDesktop]);
22
23
  return { ref };
23
24
  }
25
+ //#endregion
24
26
  export { useScrollableListBox };
@@ -1,5 +1,6 @@
1
1
  import { UIRouter } from "../config/router.context.js";
2
2
  import { useEffect, useMemo, useState } from "react";
3
+ //#region src/hooks/useSorting.ts
3
4
  function useSorting(defaultSorting, prefix = "") {
4
5
  const { pathname, replace, searchParams } = UIRouter.useUIRouter();
5
6
  const [sorting, setSorting] = useState(defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map((item) => {
@@ -31,4 +32,5 @@ function useSorting(defaultSorting, prefix = "") {
31
32
  order
32
33
  };
33
34
  }
35
+ //#endregion
34
36
  export { useSorting };
@@ -1,6 +1,7 @@
1
1
  import { ObjectUtils } from "../utils/object.utils.js";
2
2
  import { useCallback, useRef, useState } from "react";
3
- const useStateAndRef = (initialState) => {
3
+ //#region src/hooks/useStateAndRef.ts
4
+ var useStateAndRef = (initialState) => {
4
5
  const [state, setState] = useState(initialState);
5
6
  const ref = useRef(state);
6
7
  return [
@@ -12,4 +13,5 @@ const useStateAndRef = (initialState) => {
12
13
  }, [setState])
13
14
  ];
14
15
  };
16
+ //#endregion
15
17
  export { useStateAndRef };
@@ -1,4 +1,5 @@
1
1
  import { useCallback, useEffect, useMemo, useState } from "react";
2
+ //#region src/hooks/useTableColumnConfig.ts
2
3
  function sortByKeyOrder(data, orderedKeys = []) {
3
4
  return [...data].sort((a, b) => {
4
5
  return orderedKeys.findIndex((key) => key === (a.id ?? a.accessorKey)) - orderedKeys.findIndex((key) => key === (b.id ?? b.accessorKey));
@@ -35,4 +36,5 @@ function useTableColumnConfig(defaultColumns, options = {}) {
35
36
  onOrderChange: handleOrderChange
36
37
  };
37
38
  }
39
+ //#endregion
38
40
  export { useTableColumnConfig };