@povio/ui 3.4.0-rc.19 → 3.4.0-rc.20

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 (738) hide show
  1. package/README.md +11 -0
  2. package/dist/{components/navigation/Accordion/accordion.types.d.ts → Accordion-CgNQw-pZ.d.ts} +5 -2
  3. package/dist/Accordion-DT1wcBFP.js +552 -0
  4. package/dist/ActionModal-DLeVinly.d.ts +26 -0
  5. package/dist/Alert-1gjUqXaO.js +240 -0
  6. package/dist/Alert-C0GAvkdO.d.ts +33 -0
  7. package/dist/Autocomplete-CYT1Vk1F.d.ts +15 -0
  8. package/dist/BottomSheet-BWKej2PR.d.ts +34 -0
  9. package/dist/BottomSheet-Cwci3M8j.js +448 -0
  10. package/dist/Breadcrumbs-DrmLNtmQ.js +534 -0
  11. package/dist/Breadcrumbs-pSLRyeOe.d.ts +19 -0
  12. package/dist/Button-C_FOjIn-.d.ts +30 -0
  13. package/dist/Button-Cq7t4Xxl.js +160 -0
  14. package/dist/{components/buttons/Button/button.cva.js → Button-Dlm1NyTJ.js} +69 -4
  15. package/dist/{components/buttons/shared/ButtonContent.js → ButtonContent-17xvQXod.js} +34 -7
  16. package/dist/Calendar-C9Dbdkkl.js +654 -0
  17. package/dist/{components/inputs/shared/CheckContent.js → CheckContent-DzWpxKGq.js} +5 -5
  18. package/dist/Checkbox-DyEipBjR.js +403 -0
  19. package/dist/Checkbox-Ee9K3u2J.d.ts +24 -0
  20. package/dist/{components/inputs/Checkbox/checkbox.cva.js → CheckboxCheckmark-C7Oq15ms.js} +38 -4
  21. package/dist/CheckboxGroup-D-sNgUMN.d.ts +28 -0
  22. package/dist/{components/inputs/DateTime/DatePicker/DatePicker.js → DatePicker-DM_tCN-6.js} +23 -29
  23. package/dist/{components/inputs/DateTime/DatePicker/DatePicker.d.ts → DatePicker-DclmenVd.d.ts} +7 -8
  24. package/dist/DatePickerInput-BC-q8HcY.d.ts +18 -0
  25. package/dist/DatePickerInput-C2z1kgaC.js +598 -0
  26. package/dist/{components/inputs/DateTime/DateRangePicker/DateRangePicker.js → DateRangePicker-BmScgvEH.js} +466 -32
  27. package/dist/{components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts → DateRangePicker-DjkIlnMl.d.ts} +9 -11
  28. package/dist/{components/inputs/DateTime/DateTimePicker/DateTimePicker.js → DateTimePicker-CAFB33ih.js} +23 -29
  29. package/dist/{components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts → DateTimePicker-aDvcYnVk.d.ts} +7 -9
  30. package/dist/Dialog-BQN4Z3bO.js +4505 -0
  31. package/dist/Drawer-DnSLe85M.d.ts +18 -0
  32. package/dist/FileTrigger-eHfAkdXd.js +2186 -0
  33. package/dist/FileUpload-CHgnF4Nm.d.ts +7 -0
  34. package/dist/FileUpload-Cb--_Mbk.js +766 -0
  35. package/dist/FileUploadContainer-Co33mh7x.d.ts +5 -0
  36. package/dist/Form-B4Sbjn__.d.ts +49 -0
  37. package/dist/Form-CKUcoaMX.js +8 -0
  38. package/dist/FormField-DoGaUqFm.js +235 -0
  39. package/dist/FormField-FvutosEE.d.ts +80 -0
  40. package/dist/{components/inputs/FormField/FormFieldError.d.ts → FormFieldError-BT4uxbKY.d.ts} +1 -1
  41. package/dist/FormFieldError-CFg0Wn3i.js +26 -0
  42. package/dist/HeaderText-BrZaEuIn.d.ts +19 -0
  43. package/dist/Hidden-BtagiSrf.js +32 -0
  44. package/dist/IconButton-uO0Mjcqw.d.ts +14 -0
  45. package/dist/InlineIconButton-CLiZzTVJ.d.ts +16 -0
  46. package/dist/Input-TO1R-KsB.js +45 -0
  47. package/dist/{components/inputs/Inputs/InputItem.js → InputItem-DYNprOmw.js} +19 -19
  48. package/dist/InputUpload-BqKQcew0.d.ts +66 -0
  49. package/dist/InputUpload-k_RRfoeF.js +233 -0
  50. package/dist/{components/inputs/Inputs/Inputs.js → Inputs-BapBcBa7.js} +2 -2
  51. package/dist/Inputs-DncFwdP2.d.ts +13 -0
  52. package/dist/Label-C0MdchIz.js +17 -0
  53. package/dist/Link-BBMgG7TX.js +82 -0
  54. package/dist/Link-BvAKCJcB.js +42 -0
  55. package/dist/Link-DwUGkr9s.d.ts +23 -0
  56. package/dist/ListBox-HE5uFtiS.js +739 -0
  57. package/dist/Loader-C6YkWZOO.js +113 -0
  58. package/dist/{components/status/Loader/loader.cva.d.ts → Loader-Sbr1b0iU.d.ts} +7 -3
  59. package/dist/{components/Menu/menu.cva.d.ts → Menu-CLA3gTYc.d.ts} +22 -3
  60. package/dist/{components/Menu/MenuMobile.js → Menu-Db_stvqw.js} +48 -12
  61. package/dist/MenuDesktop-BjK3K8gs.js +248 -0
  62. package/dist/{components/Menu/MenuItem.d.ts → MenuItem-ChgmtbQw.d.ts} +2 -2
  63. package/dist/Modal-BVL1P0ls.d.ts +53 -0
  64. package/dist/Modal-CYvIKx5Z.js +204 -0
  65. package/dist/{components/overlays/Modal/Modal.js → Modal-CkSO1C1n.js} +13 -12
  66. package/dist/NumberFormatter-KUrW7GbE.js +122 -0
  67. package/dist/NumberInput-mTYSZkqH.d.ts +26 -0
  68. package/dist/NumberRangeInput-BsATw2M1.js +403 -0
  69. package/dist/NumberRangeInput-DS6_DIEc.d.ts +44 -0
  70. package/dist/OverlayArrow-BrSp26z2.js +654 -0
  71. package/dist/Pagination-YrWwwM_f.d.ts +12 -0
  72. package/dist/PaginationList-71pjqcQ0.d.ts +18 -0
  73. package/dist/PaginationList-DJfUpGY9.js +218 -0
  74. package/dist/PasswordInput-BUZPRoOL.js +63 -0
  75. package/dist/PasswordInput-XI0n5I1s.d.ts +10 -0
  76. package/dist/Pill-DSt6f4Eq.d.ts +18 -0
  77. package/dist/PillButton-NdrR6uVR.d.ts +15 -0
  78. package/dist/PressResponder-q8UTUsf0.js +63 -0
  79. package/dist/ProgressBar-C8dtVA-1.js +58 -0
  80. package/dist/{components/inputs/File/shared/progressBar.cva.d.ts → ProgressBar-DG-ClG9v.d.ts} +8 -3
  81. package/dist/QuerySelect-W0euIrkL.d.ts +23 -0
  82. package/dist/RSPContexts-DHQi1l7F.js +12 -0
  83. package/dist/RadioGroup-CNSTNHYN.js +569 -0
  84. package/dist/{components/inputs/RadioGroup/radio.cva.d.ts → RadioGroup-D6-jU_Hb.d.ts} +25 -4
  85. package/dist/ResponsivePopover-CokwzUr4.d.ts +19 -0
  86. package/dist/{components/segment/Segment.js → Segment-Cndlojxv.js} +119 -16
  87. package/dist/{components/segment/Segment.d.ts → Segment-IpdajE4h.d.ts} +4 -4
  88. package/dist/{components/inputs/Selection/Select/Select.js → Select-CCNQ4Bso.js} +11 -15
  89. package/dist/{components/inputs/Selection/Select/Select.d.ts → Select-CNTaUjfL.d.ts} +5 -6
  90. package/dist/SelectBase-C4lPY7Hc.d.ts +97 -0
  91. package/dist/SelectionIndicator-qJF4qfyY.js +758 -0
  92. package/dist/Slider-C2VnHdQq.js +818 -0
  93. package/dist/Slider-HF31GF1t.d.ts +22 -0
  94. package/dist/SplitButton-CnyLnCrQ.d.ts +15 -0
  95. package/dist/{components/navigation/Stepper/stepper.cva.d.ts → Stepper-JUO4MbZx.d.ts} +36 -3
  96. package/dist/Stepper-yN3fNyGt.js +336 -0
  97. package/dist/{components/text/Tag/tag.cva.d.ts → Tag-CXfTBg6q.d.ts} +18 -3
  98. package/dist/{components/text/Tag/tag.cva.js → Tag-DCo_fVLl.js} +43 -3
  99. package/dist/Text-BTtw_Syz.js +5 -0
  100. package/dist/TextArea-8_TYSixS.d.ts +20 -0
  101. package/dist/TextArea-CS-2txl7.js +175 -0
  102. package/dist/TextButton-BdefN7SL.d.ts +15 -0
  103. package/dist/{components/inputs/TextEditor/TextEditor.d.ts → TextEditor-CXDFpX_q.d.ts} +4 -4
  104. package/dist/TextEditor-p0CqH_71.js +3439 -0
  105. package/dist/{components/inputs/DateTime/TimePicker/TimePicker.d.ts → TimePicker-Bspfhoo_.d.ts} +6 -6
  106. package/dist/{components/inputs/DateTime/TimePicker/TimePicker.js → TimePicker-DLzbOPrC.js} +126 -25
  107. package/dist/Toast-4Q3O7cKx.js +957 -0
  108. package/dist/{components/status/Toast/toast.cva.d.ts → Toast-DDkev3SZ.d.ts} +18 -4
  109. package/dist/Toggle-CgD4ykP4.js +177 -0
  110. package/dist/{components/inputs/Toggle/toggle.cva.d.ts → Toggle-TDp5YtaQ.d.ts} +20 -4
  111. package/dist/ToggleButton-BuEhb8eu.d.ts +12 -0
  112. package/dist/ToggleButton-D94yRla8.js +216 -0
  113. package/dist/Tooltip-KfGHmXdx.js +539 -0
  114. package/dist/{components/overlays/Tooltip/tooltip.cva.d.ts → Tooltip-zaZ0d1jz.d.ts} +16 -3
  115. package/dist/TooltipEllipsis-Di9Dvd4x.d.ts +11 -0
  116. package/dist/{components/inputs/shared/InputClear.js → TooltipWrapper-CLMp_zj4.js} +31 -6
  117. package/dist/{components/text/Typography/Typography.js → Typography-AcUd9df8.js} +3 -3
  118. package/dist/{components/text/Typography/Typography.d.ts → Typography-BiHrVFpz.d.ts} +2 -2
  119. package/dist/VisuallyHidden-DjaDVPQT.js +43 -0
  120. package/dist/autocomplete-B2Ol8qjV.d.ts +16 -0
  121. package/dist/{components/buttons/Button/button.cva.d.ts → button.cva-zMNkoZH8.d.ts} +3 -4
  122. package/dist/{components/buttons/shared/buttonContent.cva.d.ts → buttonContent.cva-CIOaLH0a.d.ts} +3 -3
  123. package/dist/check-M2G7r3oH.js +13 -0
  124. package/dist/checkbox-CGea408G.d.ts +9 -0
  125. package/dist/checkbox-group-BdjjQ24I.d.ts +9 -0
  126. package/dist/{components/inputs/Checkbox/checkbox.cva.d.ts → checkbox.cva-Caaf2Ysq.d.ts} +3 -4
  127. package/dist/chevron-down-Ciz9yP9R.js +13 -0
  128. package/dist/chevron-left-VO8YZrXZ.js +13 -0
  129. package/dist/chevron-right-C_M98bh3.js +13 -0
  130. package/dist/chevron-up-CHRnDSA3.js +13 -0
  131. package/dist/chevrons-right-BXdmZ2TS.js +29 -0
  132. package/dist/clsx-CnD0nOiA.js +16 -0
  133. package/dist/{types/common.d.ts → common-UBFya8WY.d.ts} +1 -1
  134. package/dist/components/accordion.d.ts +1 -2
  135. package/dist/components/accordion.js +1 -1
  136. package/dist/components/action-modal.d.ts +1 -25
  137. package/dist/components/action-modal.js +5 -5
  138. package/dist/components/alert.d.ts +1 -13
  139. package/dist/components/alert.js +1 -113
  140. package/dist/components/autocomplete.d.ts +1 -15
  141. package/dist/components/autocomplete.js +9 -13
  142. package/dist/components/bottom-sheet.d.ts +1 -33
  143. package/dist/components/bottom-sheet.js +1 -330
  144. package/dist/components/breadcrumbs.d.ts +1 -18
  145. package/dist/components/breadcrumbs.js +1 -262
  146. package/dist/components/button.d.ts +2 -2
  147. package/dist/components/button.js +1 -1
  148. package/dist/components/checkbox-group.d.ts +1 -27
  149. package/dist/components/checkbox-group.js +13 -15
  150. package/dist/components/checkbox.d.ts +1 -23
  151. package/dist/components/checkbox.js +1 -79
  152. package/dist/components/date-picker.d.ts +1 -1
  153. package/dist/components/date-picker.js +1 -1
  154. package/dist/components/date-range-picker.d.ts +1 -1
  155. package/dist/components/date-range-picker.js +1 -1
  156. package/dist/components/date-time-picker.d.ts +1 -1
  157. package/dist/components/date-time-picker.js +1 -1
  158. package/dist/components/drawer.d.ts +1 -17
  159. package/dist/components/drawer.js +8 -7
  160. package/dist/components/file-upload-container.d.ts +2 -4
  161. package/dist/components/file-upload-container.js +1 -1
  162. package/dist/components/file-upload.d.ts +2 -6
  163. package/dist/components/file-upload.js +1 -213
  164. package/dist/components/form-field.d.ts +1 -23
  165. package/dist/components/form-field.js +1 -46
  166. package/dist/components/icon-button.d.ts +1 -13
  167. package/dist/components/icon-button.js +2 -2
  168. package/dist/components/inline-icon-button.d.ts +1 -15
  169. package/dist/components/inline-icon-button.js +1 -1
  170. package/dist/components/input-upload.d.ts +1 -6
  171. package/dist/components/input-upload.js +1 -117
  172. package/dist/components/link.d.ts +1 -10
  173. package/dist/components/link.js +1 -32
  174. package/dist/components/loader.d.ts +1 -6
  175. package/dist/components/loader.js +1 -88
  176. package/dist/components/menu.d.ts +2 -2
  177. package/dist/components/menu.js +2 -2
  178. package/dist/components/modal.d.ts +1 -1
  179. package/dist/components/modal.js +1 -1
  180. package/dist/components/number-input.d.ts +1 -26
  181. package/dist/components/number-input.js +23 -26
  182. package/dist/components/number-range-input.d.ts +1 -38
  183. package/dist/components/number-range-input.js +1 -266
  184. package/dist/components/pagination-list.d.ts +1 -17
  185. package/dist/components/pagination-list.js +1 -206
  186. package/dist/components/pagination.d.ts +1 -11
  187. package/dist/components/pagination.js +4 -4
  188. package/dist/components/password-input.d.ts +1 -9
  189. package/dist/components/password-input.js +1 -22
  190. package/dist/components/pill-button.d.ts +1 -14
  191. package/dist/components/pill-button.js +8 -7
  192. package/dist/components/pill.d.ts +1 -17
  193. package/dist/components/pill.js +9 -9
  194. package/dist/components/progress-bar.d.ts +1 -1
  195. package/dist/components/progress-bar.js +1 -1
  196. package/dist/components/query-autocomplete.d.ts +3 -3
  197. package/dist/components/query-autocomplete.js +5 -6
  198. package/dist/components/query-select.d.ts +1 -18
  199. package/dist/components/query-select.js +6 -7
  200. package/dist/components/radio-group.d.ts +1 -23
  201. package/dist/components/radio-group.js +1 -164
  202. package/dist/components/responsive-popover.d.ts +1 -18
  203. package/dist/components/responsive-popover.js +9 -9
  204. package/dist/components/segment.d.ts +2 -2
  205. package/dist/components/segment.js +1 -1
  206. package/dist/components/select.d.ts +2 -3
  207. package/dist/components/select.js +1 -1
  208. package/dist/components/slider.d.ts +1 -21
  209. package/dist/components/slider.js +1 -102
  210. package/dist/components/split-button.d.ts +1 -14
  211. package/dist/components/split-button.js +4 -4
  212. package/dist/components/stepper.d.ts +1 -2
  213. package/dist/components/stepper.js +1 -1
  214. package/dist/components/tag.d.ts +1 -17
  215. package/dist/components/tag.js +1 -42
  216. package/dist/components/text-area.d.ts +1 -20
  217. package/dist/components/text-area.js +1 -137
  218. package/dist/components/text-button.d.ts +1 -14
  219. package/dist/components/text-button.js +1 -1
  220. package/dist/components/text-input.d.ts +1 -26
  221. package/dist/components/text-input.js +18 -20
  222. package/dist/components/time-picker.d.ts +1 -1
  223. package/dist/components/time-picker.js +1 -1
  224. package/dist/components/toast.d.ts +1 -2
  225. package/dist/components/toast.js +1 -1
  226. package/dist/components/toggle-button.d.ts +1 -11
  227. package/dist/components/toggle-button.js +1 -1
  228. package/dist/components/toggle.d.ts +1 -18
  229. package/dist/components/toggle.js +1 -73
  230. package/dist/components/tooltip-ellipsis.d.ts +1 -10
  231. package/dist/components/tooltip-ellipsis.js +2 -2
  232. package/dist/components/tooltip.d.ts +1 -15
  233. package/dist/components/tooltip.js +1 -169
  234. package/dist/components/typography.d.ts +2 -2
  235. package/dist/components/typography.js +1 -1
  236. package/dist/components/use-toast.d.ts +1 -15
  237. package/dist/components/use-toast.js +6 -7
  238. package/dist/{utils/compoundMapper.d.ts → compoundMapper-CMoX98D2.d.ts} +1 -1
  239. package/dist/{utils/compoundMapper.js → compoundMapper-Di3SKZnS.js} +1 -1
  240. package/dist/config/confirmation.d.ts +1 -1
  241. package/dist/config/confirmation.js +1 -1
  242. package/dist/config/link-context.d.ts +2 -2
  243. package/dist/config/link-context.js +1 -1
  244. package/dist/config/resources.d.ts +1 -1
  245. package/dist/config/resources.js +1 -1
  246. package/dist/config/theme-context.d.ts +1 -1
  247. package/dist/config/theme-context.js +1 -1
  248. package/dist/config/ui-config.d.ts +1 -1
  249. package/dist/config/ui-config.js +1 -1
  250. package/dist/config/ui-overrides.d.ts +1 -1
  251. package/dist/config/ui-overrides.js +1 -1
  252. package/dist/config/ui-router.d.ts +1 -1
  253. package/dist/config/ui-router.js +1 -1
  254. package/dist/{config/confirmation.context.d.ts → confirmation.context-BJ8gTx7U.d.ts} +2 -2
  255. package/dist/{config/confirmation.context.js → confirmation.context-C1-ZF9CW.js} +3 -3
  256. package/dist/context-CLFkoJMP.js +93 -0
  257. package/dist/createLucideIcon-CskCrR9z.js +125 -0
  258. package/dist/date-picker-BpSowet-.d.ts +9 -0
  259. package/dist/date-range-picker-aO65H4wV.d.ts +9 -0
  260. package/dist/date-time-picker-DWo2GFg7.d.ts +9 -0
  261. package/dist/{utils/date-time.utils.js → date-time.utils-0F9qduim.js} +2 -2
  262. package/dist/{utils/date-time.utils.d.ts → date-time.utils-Cu9TVj46.d.ts} +1 -1
  263. package/dist/{rhf/date.transforms.js → date.transforms-DLg-eFcE.js} +1 -1
  264. package/dist/{utils/date.utils.js → date.utils-B8_QF9y6.js} +1 -1
  265. package/dist/{utils/date.utils.d.ts → date.utils-BoQnMRlF.d.ts} +1 -1
  266. package/dist/{components/inputs/DateTime/shared/TimePickerForm.js → datePickerValue.utils-Dh-nA1Yv.js} +78 -13
  267. package/dist/{rhf/Inputs2.js → dynamicInputs-4JB41qRW.js} +27 -23
  268. package/dist/dynamicInputs-BekIlDGf.d.ts +753 -0
  269. package/dist/{helpers/dynamicInputs.js → dynamicInputs-D8j0ko24.js} +16 -16
  270. package/dist/{rhf/fieldAdapter.d.ts → fieldAdapter-C4sDFC8f.d.ts} +2 -2
  271. package/dist/{rhf/fieldAdapter.js → fieldAdapter-C_3uizcT.js} +22 -1
  272. package/dist/file-upload-DDIJKLW8.d.ts +10 -0
  273. package/dist/{utils/file.utils.d.ts → file.utils-Crb-mIHs.d.ts} +1 -1
  274. package/dist/{utils/file.utils.js → file.utils-DqQxnuAm.js} +1 -1
  275. package/dist/{components/inputs/File/fileUpload.types.d.ts → fileUpload.types-CQkPqELk.d.ts} +15 -8
  276. package/dist/{hooks/useForm.d.ts → form.binding-DWlFTecs.d.ts} +8 -3
  277. package/dist/{components/inputs/shared/form.binding.js → form.binding-DyZ4fH8l.js} +8 -2
  278. package/dist/{components/inputs/shared/form.types.d.ts → form.types-B9Vp8q2g.d.ts} +2 -2
  279. package/dist/{rhf/form.types.d.ts → form.types-ZNGbcqJS.d.ts} +1 -1
  280. package/dist/hooks/use-filters.d.ts +1 -1
  281. package/dist/hooks/use-filters.js +1 -1
  282. package/dist/hooks/use-local-storage.d.ts +1 -1
  283. package/dist/hooks/use-local-storage.js +1 -1
  284. package/dist/hooks/use-translation-memo.d.ts +1 -1
  285. package/dist/hooks/use-translation-memo.js +1 -1
  286. package/dist/i18n-C2TBJvnh.js +300 -0
  287. package/dist/{config/i18n.d.ts → i18n-DjqhCCJq.d.ts} +1 -1
  288. package/dist/icons.d.ts +2 -2
  289. package/dist/icons.js +2 -2
  290. package/dist/index-B8r_kiw4.d.ts +193 -0
  291. package/dist/index.d.ts +101 -165
  292. package/dist/index.js +64 -105
  293. package/dist/input-upload-Apyx1Mvy.d.ts +9 -0
  294. package/dist/{components/inputs/shared/input.cva.d.ts → input.cva-CfgCOIQW.d.ts} +2 -3
  295. package/dist/{components/inputs/shared/input.cva.js → input.cva-KYGD4Bdz.js} +4 -4
  296. package/dist/{utils/intl.utils.d.ts → intl.utils-NaOZUD2G.d.ts} +1 -1
  297. package/dist/{utils/intl.utils.js → intl.utils-zwAFoZ0U.js} +1 -1
  298. package/dist/intlStrings-DrQB127v.js +346 -0
  299. package/dist/{config/link.context.d.ts → link.context-BFXwgVLP.d.ts} +2 -2
  300. package/dist/{config/link.context.js → link.context-J7aQtMOr.js} +2 -2
  301. package/dist/logger-BPhG2izn.js +309 -0
  302. package/dist/logger-N35Xhi14.d.ts +10 -0
  303. package/dist/lucide-react-BJRvqSeV.d.ts +23 -0
  304. package/dist/{components/overlays/Modal/modal.cva.js → modal.cva-CbziPHSN.js} +2 -3
  305. package/dist/number-input-D0YwMCGh.d.ts +8 -0
  306. package/dist/number-range-input-BtPXUX0k.d.ts +8 -0
  307. package/dist/numberStatic.utils-C9_kWMXJ.js +723 -0
  308. package/dist/openLink-BFEMFlhB.js +187 -0
  309. package/dist/{components/outline.clsx.js → outline.clsx-50W_vNDl.js} +2 -2
  310. package/dist/{components/outline.clsx.d.ts → outline.clsx-B1hjrX9t.d.ts} +1 -1
  311. package/dist/password-input-euv4tHdl.d.ts +8 -0
  312. package/dist/{components/buttons/PillButton/pillButton.cva.d.ts → pillButton.cva-Da0WFN39.d.ts} +3 -4
  313. package/dist/{components/buttons/PillButton/pillButton.cva.js → pillButton.cva-DbwzixcK.js} +5 -6
  314. package/dist/{components/shared/popover.cva.js → popover.cva-CXha_UMQ.js} +2 -2
  315. package/dist/queries.utils-CmbhAoHU.js +18 -0
  316. package/dist/query-autocomplete-BwU-94pi.d.ts +14 -0
  317. package/dist/query-select-CBgR2Tua.d.ts +15 -0
  318. package/dist/{components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts → queryAutocomplete.types-3ezR8y7k.d.ts} +6 -6
  319. package/dist/radio-group-DVGKZRnt.d.ts +9 -0
  320. package/dist/react-aria/components.d.ts +1 -0
  321. package/dist/react-aria/components.js +1 -0
  322. package/dist/react-aria/hooks.d.ts +1 -0
  323. package/dist/react-aria/hooks.js +1 -0
  324. package/dist/react-aria/index.d.ts +1 -0
  325. package/dist/react-aria/index.js +1 -0
  326. package/dist/react-aria/state.d.ts +1 -0
  327. package/dist/react-aria/state.js +1 -0
  328. package/dist/react-aria/types.d.ts +1 -0
  329. package/dist/react-aria/types.js +0 -0
  330. package/dist/rhf/autocomplete.d.ts +2 -15
  331. package/dist/rhf/autocomplete.js +1 -2
  332. package/dist/rhf/checkbox-group.d.ts +2 -8
  333. package/dist/rhf/checkbox-group.js +1 -2
  334. package/dist/rhf/checkbox.d.ts +2 -8
  335. package/dist/rhf/checkbox.js +2 -3
  336. package/dist/rhf/date-picker.d.ts +2 -8
  337. package/dist/rhf/date-picker.js +3 -4
  338. package/dist/rhf/date-range-picker.d.ts +2 -8
  339. package/dist/rhf/date-range-picker.js +3 -4
  340. package/dist/rhf/date-time-picker.d.ts +2 -8
  341. package/dist/rhf/date-time-picker.js +3 -4
  342. package/dist/rhf/file-upload.d.ts +2 -9
  343. package/dist/rhf/file-upload.js +2 -3
  344. package/dist/rhf/input-upload.d.ts +2 -9
  345. package/dist/rhf/input-upload.js +2 -3
  346. package/dist/rhf/inputs.d.ts +4 -0
  347. package/dist/rhf/inputs.js +1 -2
  348. package/dist/rhf/number-input.d.ts +2 -7
  349. package/dist/rhf/number-input.js +1 -2
  350. package/dist/rhf/number-range-input.d.ts +2 -7
  351. package/dist/rhf/number-range-input.js +2 -3
  352. package/dist/rhf/password-input.d.ts +2 -7
  353. package/dist/rhf/password-input.js +2 -3
  354. package/dist/rhf/query-autocomplete.d.ts +1 -13
  355. package/dist/rhf/query-autocomplete.js +1 -2
  356. package/dist/rhf/query-select.d.ts +1 -14
  357. package/dist/rhf/query-select.js +1 -2
  358. package/dist/rhf/radio-group.d.ts +2 -8
  359. package/dist/rhf/radio-group.js +2 -3
  360. package/dist/rhf/segment.d.ts +2 -8
  361. package/dist/rhf/segment.js +2 -3
  362. package/dist/rhf/select.d.ts +2 -15
  363. package/dist/rhf/select.js +2 -3
  364. package/dist/rhf/slider.d.ts +2 -7
  365. package/dist/rhf/slider.js +2 -3
  366. package/dist/rhf/text-area.d.ts +2 -7
  367. package/dist/rhf/text-area.js +2 -3
  368. package/dist/rhf/text-editor.d.ts +2 -7
  369. package/dist/rhf/text-editor.js +2 -3
  370. package/dist/rhf/text-input.d.ts +2 -7
  371. package/dist/rhf/text-input.js +1 -2
  372. package/dist/rhf/time-picker.d.ts +2 -8
  373. package/dist/rhf/time-picker.js +3 -4
  374. package/dist/rhf/toggle.d.ts +2 -8
  375. package/dist/rhf/toggle.js +2 -3
  376. package/dist/{rhf/useFormAutosave.js → rhf-Ca72CryM.js} +116 -6
  377. package/dist/rhf.d.ts +101 -167
  378. package/dist/rhf.js +64 -105
  379. package/dist/rolldown-runtime-DUp30N8C.js +28 -0
  380. package/dist/{config/router.context.d.ts → router.context-BOYRh2p9.d.ts} +1 -1
  381. package/dist/{config/router.context.js → router.context-DSE1y7gW.js} +4 -4
  382. package/dist/{utils/routing.utils.js → routing.utils-UTQonIhB.js} +1 -1
  383. package/dist/schemas-BkfyFvBp.js +4004 -0
  384. package/dist/schemas-CAtYiHoz.d.ts +2127 -0
  385. package/dist/segment-CSZWTNMz.d.ts +9 -0
  386. package/dist/{components/segment/segment.types.d.ts → segment.types-POFeFf4n.d.ts} +24 -5
  387. package/dist/select-ZL6iOiG0.d.ts +16 -0
  388. package/dist/slider--ZPodYa6.d.ts +8 -0
  389. package/dist/staticDateTimeSegments-CKL9PuGV.js +1501 -0
  390. package/dist/staticSelect.utils-DkiDwfGr.js +4041 -0
  391. package/dist/{utils/string.utils.js → string.utils-BPgv6QwA.js} +1 -1
  392. package/dist/{utils/string.utils.d.ts → string.utils-Cj6AB7uZ.d.ts} +1 -1
  393. package/dist/styles/input.d.ts +1 -1
  394. package/dist/styles/outline.d.ts +1 -1
  395. package/dist/styles/outline.js +1 -1
  396. package/dist/tanstack/autocomplete.d.ts +1 -1
  397. package/dist/tanstack/checkbox-group.d.ts +1 -1
  398. package/dist/tanstack/checkbox.d.ts +1 -1
  399. package/dist/tanstack/checkbox.js +1 -1
  400. package/dist/tanstack/date-picker.d.ts +1 -1
  401. package/dist/tanstack/date-picker.js +1 -1
  402. package/dist/tanstack/date-range-picker.d.ts +1 -1
  403. package/dist/tanstack/date-range-picker.js +1 -1
  404. package/dist/tanstack/date-time-picker.d.ts +1 -1
  405. package/dist/tanstack/date-time-picker.js +1 -1
  406. package/dist/tanstack/file-upload.d.ts +2 -2
  407. package/dist/tanstack/file-upload.js +1 -1
  408. package/dist/tanstack/form.d.ts +2 -3
  409. package/dist/tanstack/form.js +1 -3
  410. package/dist/tanstack/input-upload.d.ts +1 -2
  411. package/dist/tanstack/input-upload.js +1 -1
  412. package/dist/tanstack/inputs.d.ts +4 -5
  413. package/dist/tanstack/inputs.js +2 -2
  414. package/dist/tanstack/number-input.d.ts +1 -1
  415. package/dist/tanstack/number-range-input.d.ts +1 -2
  416. package/dist/tanstack/number-range-input.js +1 -1
  417. package/dist/tanstack/password-input.d.ts +1 -1
  418. package/dist/tanstack/password-input.js +1 -1
  419. package/dist/tanstack/query-select.d.ts +1 -1
  420. package/dist/tanstack/radio-group.d.ts +1 -1
  421. package/dist/tanstack/radio-group.js +1 -1
  422. package/dist/tanstack/segment.d.ts +2 -2
  423. package/dist/tanstack/segment.js +1 -1
  424. package/dist/tanstack/select.d.ts +1 -1
  425. package/dist/tanstack/select.js +1 -1
  426. package/dist/tanstack/slider.d.ts +1 -1
  427. package/dist/tanstack/slider.js +1 -1
  428. package/dist/tanstack/table.d.ts +2 -12
  429. package/dist/tanstack/table.js +1 -11
  430. package/dist/tanstack/text-area.d.ts +1 -1
  431. package/dist/tanstack/text-area.js +1 -1
  432. package/dist/tanstack/text-editor.d.ts +1 -1
  433. package/dist/tanstack/text-editor.js +1 -1
  434. package/dist/tanstack/text-input.d.ts +1 -1
  435. package/dist/tanstack/time-picker.d.ts +1 -1
  436. package/dist/tanstack/time-picker.js +1 -1
  437. package/dist/tanstack/toggle.d.ts +1 -1
  438. package/dist/tanstack/toggle.js +1 -1
  439. package/dist/tanstack.d.ts +86 -150
  440. package/dist/tanstack.js +74 -121
  441. package/dist/text-area-BhZAEqfI.d.ts +8 -0
  442. package/dist/text-editor-Dq-YYIuF.d.ts +8 -0
  443. package/dist/text-editor.d.ts +1 -1
  444. package/dist/text-editor.js +1 -1
  445. package/dist/text-input-F-mBSHby.d.ts +8 -0
  446. package/dist/{config/theme.context.js → theme.context-CCXz56lV.js} +5 -5
  447. package/dist/{config/theme.context.d.ts → theme.context-rPpAYJZo.d.ts} +4 -4
  448. package/dist/time-picker-5w_eDDNn.d.ts +9 -0
  449. package/dist/toggle-D-Dg5YGf.d.ts +9 -0
  450. package/dist/types/index.d.ts +1 -1
  451. package/dist/types-BV15_DBT.d.ts +1150 -0
  452. package/dist/{components/text/Typography/typography.cva.d.ts → typography.cva-7RYwLrA7.d.ts} +2 -3
  453. package/dist/{components/text/Typography/typography.cva.js → typography.cva-BI0FyIqm.js} +2 -2
  454. package/dist/uiConfig.context-SBtRegKv.js +359 -0
  455. package/dist/{config/uiConfig.context.d.ts → uiConfig.context-pJj1iUnQ.d.ts} +20 -18
  456. package/dist/{config/uiOverrides.context.d.ts → uiOverrides.context-BdokYcGO.d.ts} +43 -6
  457. package/dist/{utils/style-merge.util.js → uiOverrides.context-Bfm2n-n8.js} +165 -2
  458. package/dist/{hooks/useBreakpoint.js → useBreakpoint-D0s71F97.js} +3 -3
  459. package/dist/useButton-iUReggbG.js +55 -0
  460. package/dist/useControlledState-Bk39gTui.js +31 -0
  461. package/dist/useEvent-BROAXUSg.js +22 -0
  462. package/dist/{components/inputs/Input/shared/InputContent.js → useFieldAccessibility-CmbhtqBy.js} +27 -10
  463. package/dist/useFilter-BOG2VldJ.js +44 -0
  464. package/dist/{hooks/useFilters.d.ts → useFilters-6IOuvBTm.d.ts} +3 -3
  465. package/dist/{hooks/useFilters.js → useFilters-AA70NuXo.js} +9 -9
  466. package/dist/useFocusRing-DuXtCnJj.js +141 -0
  467. package/dist/useFormAutosave-BXqu0xAQ.js +296 -0
  468. package/dist/useFormReset-BhJH8XnS.js +18 -0
  469. package/dist/useFormValidation-DLZqyNVp.js +115 -0
  470. package/dist/useFormValidationState-Bpry7Uk5.js +142 -0
  471. package/dist/useHover-DwfnacVy.js +1210 -0
  472. package/dist/{hooks/useIntersectionObserver.js → useIntersectionObserver-DYfHnGGU.js} +2 -2
  473. package/dist/useLabel-BFvzYK5u.js +27 -0
  474. package/dist/useLabels-B3G1H2cw.js +16 -0
  475. package/dist/{hooks/useLocalStorage.js → useLocalStorage-PlcaJ1tP.js} +2 -2
  476. package/dist/{hooks/useLocalStorage.d.ts → useLocalStorage-kcEdRxqC.d.ts} +3 -3
  477. package/dist/useLocalizedStringFormatter-C2M9mXF2.js +108 -0
  478. package/dist/useNumberFormatter-CTdFIKV_.js +10 -0
  479. package/dist/usePress-CANxCO5-.js +491 -0
  480. package/dist/{hooks/useQueryAutocomplete.js → useQueryAutocomplete-CraXvRm_.js} +51 -2
  481. package/dist/useSpinButton-C3wyKHU7.js +577 -0
  482. package/dist/{components/inputs/Skeleton/InputFrame.js → useStaticInputHandoff-COJdSrME.js} +92 -13
  483. package/dist/useTableColumnConfig-_XJr8Cor.js +1638 -0
  484. package/dist/useTableNav-BoQOVqZF.d.ts +274 -0
  485. package/dist/useTextField-De01RThI.js +77 -0
  486. package/dist/useToast-gQ9gzrbt.d.ts +16 -0
  487. package/dist/useToggle-DDay--cY.js +62 -0
  488. package/dist/useToggleState-Dyx-sAjp.js +23 -0
  489. package/dist/{hooks/useTranslationMemo.js → useTranslationMemo-CrZbeyBv.js} +1 -1
  490. package/dist/{hooks/useTranslationMemo.d.ts → useTranslationMemo-Dy3p6m1g.d.ts} +1 -1
  491. package/dist/utils/compound-mapper.d.ts +1 -1
  492. package/dist/utils/compound-mapper.js +1 -1
  493. package/dist/utils/date-time.d.ts +1 -1
  494. package/dist/utils/date-time.js +1 -1
  495. package/dist/utils/date.d.ts +1 -1
  496. package/dist/utils/date.js +1 -1
  497. package/dist/utils/file.d.ts +1 -1
  498. package/dist/utils/file.js +1 -1
  499. package/dist/utils/intl.d.ts +1 -1
  500. package/dist/utils/intl.js +1 -1
  501. package/dist/utils/logger.d.ts +1 -9
  502. package/dist/utils/logger.js +1 -1
  503. package/dist/utils/string.d.ts +1 -1
  504. package/dist/utils/string.js +1 -1
  505. package/dist/x-BYOEO0gW.js +16 -0
  506. package/dist/zod.utils-Nz_Tbo_v.js +24 -0
  507. package/package.json +26 -1
  508. package/dist/assets/locales/en/translation.js +0 -148
  509. package/dist/assets/locales/sl/translation.js +0 -146
  510. package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +0 -44
  511. package/dist/components/Breadcrumbs/breadcrumbs.cva.js +0 -27
  512. package/dist/components/Menu/Menu.d.ts +0 -23
  513. package/dist/components/Menu/Menu.js +0 -27
  514. package/dist/components/Menu/MenuDesktop.js +0 -48
  515. package/dist/components/Menu/MenuItem.js +0 -46
  516. package/dist/components/Menu/MenuPopover.d.ts +0 -7
  517. package/dist/components/Menu/MenuPopover.js +0 -121
  518. package/dist/components/Menu/menu.cva.js +0 -34
  519. package/dist/components/buttons/Button/Button.d.ts +0 -30
  520. package/dist/components/buttons/Button/Button.js +0 -66
  521. package/dist/components/buttons/shared/buttonContent.cva.js +0 -30
  522. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -25
  523. package/dist/components/inputs/DateTime/shared/Calendar.js +0 -180
  524. package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -145
  525. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -55
  526. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -119
  527. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -173
  528. package/dist/components/inputs/DateTime/shared/DateField.js +0 -155
  529. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +0 -12
  530. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -197
  531. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -48
  532. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -46
  533. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -27
  534. package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -90
  535. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -98
  536. package/dist/components/inputs/DateTime/shared/TimeField.js +0 -19
  537. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -101
  538. package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -100
  539. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -8
  540. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -17
  541. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
  542. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -38
  543. package/dist/components/inputs/DateTime/shared/datePickerValue.utils.js +0 -4
  544. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -100
  545. package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +0 -19
  546. package/dist/components/inputs/File/inputUpload.types.d.ts +0 -39
  547. package/dist/components/inputs/File/inputUpload.types.js +0 -9
  548. package/dist/components/inputs/File/shared/FileCard.js +0 -58
  549. package/dist/components/inputs/File/shared/FileCardList.js +0 -22
  550. package/dist/components/inputs/File/shared/FileUploadContent.js +0 -67
  551. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -58
  552. package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -112
  553. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -117
  554. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -79
  555. package/dist/components/inputs/File/shared/InputUploadContent.js +0 -56
  556. package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -29
  557. package/dist/components/inputs/File/shared/ProgressBar.d.ts +0 -8
  558. package/dist/components/inputs/File/shared/ProgressBar.js +0 -33
  559. package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -18
  560. package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -42
  561. package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +0 -26
  562. package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -39
  563. package/dist/components/inputs/File/shared/progressBar.cva.js +0 -28
  564. package/dist/components/inputs/FormField/FormFieldError.js +0 -15
  565. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +0 -16
  566. package/dist/components/inputs/FormField/FormFieldHeader.js +0 -41
  567. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -17
  568. package/dist/components/inputs/FormField/FormFieldHelper.js +0 -16
  569. package/dist/components/inputs/FormField/FormFieldLabel.js +0 -28
  570. package/dist/components/inputs/FormField/formFieldError.cva.d.ts +0 -14
  571. package/dist/components/inputs/FormField/formFieldError.cva.js +0 -14
  572. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -14
  573. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
  574. package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +0 -14
  575. package/dist/components/inputs/FormField/formFieldHelper.cva.js +0 -14
  576. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -12
  577. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -149
  578. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -9
  579. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  580. package/dist/components/inputs/Input/shared/InputContent.d.ts +0 -27
  581. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  582. package/dist/components/inputs/Inputs/Form.d.ts +0 -26
  583. package/dist/components/inputs/Inputs/Form.js +0 -45
  584. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -86
  585. package/dist/components/inputs/Inputs/Inputs.d.ts +0 -13
  586. package/dist/components/inputs/RadioGroup/radio.cva.js +0 -85
  587. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -40
  588. package/dist/components/inputs/Selection/shared/SelectBase.js +0 -38
  589. package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -173
  590. package/dist/components/inputs/Selection/shared/SelectInput.js +0 -204
  591. package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -31
  592. package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -75
  593. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -54
  594. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -35
  595. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -41
  596. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -27
  597. package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -128
  598. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -25
  599. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -8
  600. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -44
  601. package/dist/components/inputs/Selection/shared/select.context.js +0 -231
  602. package/dist/components/inputs/Selection/shared/select.types.d.ts +0 -62
  603. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -9
  604. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  605. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -13
  606. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
  607. package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +0 -17
  608. package/dist/components/inputs/Selection/shared/selectItem.cva.js +0 -24
  609. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
  610. package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -84
  611. package/dist/components/inputs/TextEditor/TextEditor.js +0 -158
  612. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -18
  613. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -56
  614. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -72
  615. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -43
  616. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -24
  617. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -32
  618. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -25
  619. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -43
  620. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -66
  621. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -54
  622. package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
  623. package/dist/components/inputs/Toggle/toggle.cva.js +0 -35
  624. package/dist/components/inputs/shared/TooltipWrapper.js +0 -25
  625. package/dist/components/inputs/shared/form.binding.d.ts +0 -7
  626. package/dist/components/inputs/shared/form.types.js +0 -8
  627. package/dist/components/inputs/shared/label.cva.d.ts +0 -19
  628. package/dist/components/inputs/shared/label.cva.js +0 -74
  629. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -11
  630. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  631. package/dist/components/inputs/shared/useFieldAccessibility.js +0 -19
  632. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -83
  633. package/dist/components/navigation/Accordion/Accordion.d.ts +0 -5
  634. package/dist/components/navigation/Accordion/Accordion.js +0 -81
  635. package/dist/components/navigation/Accordion/AccordionItem.js +0 -108
  636. package/dist/components/navigation/Accordion/accordion.cva.d.ts +0 -86
  637. package/dist/components/navigation/Accordion/accordion.cva.js +0 -129
  638. package/dist/components/navigation/Stepper/Stepper.d.ts +0 -5
  639. package/dist/components/navigation/Stepper/Stepper.js +0 -79
  640. package/dist/components/navigation/Stepper/StepperItem.js +0 -126
  641. package/dist/components/navigation/Stepper/StepperSeparator.js +0 -30
  642. package/dist/components/navigation/Stepper/stepper.cva.js +0 -116
  643. package/dist/components/navigation/Stepper/stepper.types.d.ts +0 -33
  644. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +0 -78
  645. package/dist/components/overlays/Modal/Modal.d.ts +0 -19
  646. package/dist/components/overlays/Modal/modal.cva.d.ts +0 -37
  647. package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -44
  648. package/dist/components/segment/SegmentItem.js +0 -85
  649. package/dist/components/segment/segment.cva.d.ts +0 -22
  650. package/dist/components/segment/segment.cva.js +0 -30
  651. package/dist/components/shared/pagination/minWidth.cva.js +0 -11
  652. package/dist/components/shared/popover.cva.d.ts +0 -9
  653. package/dist/components/status/Alert/alert.cva.d.ts +0 -22
  654. package/dist/components/status/Alert/alert.cva.js +0 -67
  655. package/dist/components/status/Loader/loader.cva.js +0 -27
  656. package/dist/components/status/Toast/Toast.d.ts +0 -17
  657. package/dist/components/status/Toast/Toast.js +0 -82
  658. package/dist/components/status/Toast/toast.cva.js +0 -211
  659. package/dist/components/status/shared/status.cva.d.ts +0 -34
  660. package/dist/components/status/shared/status.cva.js +0 -65
  661. package/dist/components/table/CellText.d.ts +0 -11
  662. package/dist/components/table/CellText.js +0 -22
  663. package/dist/components/table/ColumnConfig.d.ts +0 -15
  664. package/dist/components/table/ColumnConfig.js +0 -188
  665. package/dist/components/table/HeaderText.d.ts +0 -11
  666. package/dist/components/table/HeaderText.js +0 -21
  667. package/dist/components/table/InfiniteTable.d.ts +0 -12
  668. package/dist/components/table/InfiniteTable.js +0 -79
  669. package/dist/components/table/PaginatedTable.d.ts +0 -13
  670. package/dist/components/table/PaginatedTable.js +0 -94
  671. package/dist/components/table/Table.d.ts +0 -40
  672. package/dist/components/table/Table.js +0 -267
  673. package/dist/components/table/table.cva.d.ts +0 -46
  674. package/dist/components/table/table.cva.js +0 -49
  675. package/dist/components/text/Link/link.cva.d.ts +0 -15
  676. package/dist/components/text/Link/link.cva.js +0 -12
  677. package/dist/config/i18n.js +0 -10
  678. package/dist/config/uiConfig.context.js +0 -169
  679. package/dist/config/uiOverrides.context.js +0 -113
  680. package/dist/helpers/dynamicColumns.d.ts +0 -46
  681. package/dist/helpers/dynamicColumns.js +0 -276
  682. package/dist/helpers/dynamicInputs.d.ts +0 -78
  683. package/dist/hooks/useAutosave.d.ts +0 -13
  684. package/dist/hooks/useAutosave.js +0 -87
  685. package/dist/hooks/useBreakpoint.d.ts +0 -5
  686. package/dist/hooks/useDebounceCallback.d.ts +0 -9
  687. package/dist/hooks/useDebounceCallback.js +0 -59
  688. package/dist/hooks/useDeepCompare.d.ts +0 -7
  689. package/dist/hooks/useDeepCompare.js +0 -23
  690. package/dist/hooks/useForm.js +0 -101
  691. package/dist/hooks/useFormAutosave.d.ts +0 -17
  692. package/dist/hooks/useFormAutosave.js +0 -74
  693. package/dist/hooks/useIntersectionObserver.d.ts +0 -10
  694. package/dist/hooks/useKeyInteractions.d.ts +0 -23
  695. package/dist/hooks/useKeyInteractions.js +0 -54
  696. package/dist/hooks/useLongPressRepeat.d.ts +0 -12
  697. package/dist/hooks/useLongPressRepeat.js +0 -64
  698. package/dist/hooks/usePagination.d.ts +0 -10
  699. package/dist/hooks/usePagination.js +0 -62
  700. package/dist/hooks/useScrollableListBox.d.ts +0 -6
  701. package/dist/hooks/useScrollableListBox.js +0 -47
  702. package/dist/hooks/useSorting.d.ts +0 -9
  703. package/dist/hooks/useSorting.js +0 -80
  704. package/dist/hooks/useStateAndRef.d.ts +0 -6
  705. package/dist/hooks/useStateAndRef.js +0 -31
  706. package/dist/hooks/useTableColumnConfig.d.ts +0 -20
  707. package/dist/hooks/useTableColumnConfig.js +0 -133
  708. package/dist/hooks/useTableNav.d.ts +0 -86
  709. package/dist/hooks/useTableNav.js +0 -365
  710. package/dist/rhf/Inputs.d.ts +0 -79
  711. package/dist/rhf/components.d.ts +0 -43
  712. package/dist/rhf/dynamicInputs.d.ts +0 -20
  713. package/dist/rhf/dynamicInputs.js +0 -5
  714. package/dist/rhf/entry.utils.js +0 -22
  715. package/dist/rhf/inputs2.d.ts +0 -6
  716. package/dist/rhf/useAutosave.d.ts +0 -13
  717. package/dist/rhf/useAutosave.js +0 -71
  718. package/dist/rhf/useForm.d.ts +0 -18
  719. package/dist/rhf/useForm.js +0 -48
  720. package/dist/rhf/useFormAutosave.d.ts +0 -18
  721. package/dist/types/error-handling.d.ts +0 -9
  722. package/dist/utils/array.utils.d.ts +0 -6
  723. package/dist/utils/array.utils.js +0 -10
  724. package/dist/utils/dom.utils.d.ts +0 -8
  725. package/dist/utils/dom.utils.js +0 -19
  726. package/dist/utils/isEqual.d.ts +0 -4
  727. package/dist/utils/isEqual.js +0 -59
  728. package/dist/utils/logger2.d.ts +0 -2
  729. package/dist/utils/logger2.js +0 -19
  730. package/dist/utils/object.utils.d.ts +0 -13
  731. package/dist/utils/object.utils.js +0 -38
  732. package/dist/utils/queries.utils.d.ts +0 -7
  733. package/dist/utils/queries.utils.js +0 -9
  734. package/dist/utils/query.utils.js +0 -8
  735. package/dist/utils/routing.utils.d.ts +0 -7
  736. package/dist/utils/style-merge.util.d.ts +0 -40
  737. package/dist/utils/zod.utils.d.ts +0 -23
  738. package/dist/utils/zod.utils.js +0 -24
@@ -0,0 +1,1638 @@
1
+ import { t as createLucideIcon } from "./createLucideIcon-CskCrR9z.js";
2
+ import { t as UIConfig } from "./uiConfig.context-SBtRegKv.js";
3
+ import { t as ChevronDown } from "./chevron-down-Ciz9yP9R.js";
4
+ import { t as ChevronUp } from "./chevron-up-CHRnDSA3.js";
5
+ import { t as clsx } from "./clsx-CnD0nOiA.js";
6
+ import { t as Checkbox } from "./Checkbox-DyEipBjR.js";
7
+ import { t as UIOverrides } from "./uiOverrides.context-Bfm2n-n8.js";
8
+ import { t as Typography } from "./Typography-AcUd9df8.js";
9
+ import { t as Loader } from "./Loader-C6YkWZOO.js";
10
+ import { InlineIconButton } from "./components/inline-icon-button.js";
11
+ import "./i18n-C2TBJvnh.js";
12
+ import { t as useIntersectionObserver } from "./useIntersectionObserver-DYfHnGGU.js";
13
+ import { t as IntlUtils } from "./intl.utils-zwAFoZ0U.js";
14
+ import { t as DateUtils } from "./date.utils-B8_QF9y6.js";
15
+ import { f as ZodISODateTime, i as ZodEnum, l as ZodString, n as ZodBoolean, o as ZodNumber, s as ZodObject, t as ZodArray } from "./schemas-BkfyFvBp.js";
16
+ import { t as StringUtils } from "./string.utils-BPgv6QwA.js";
17
+ import { t as ZodUtils } from "./zod.utils-Nz_Tbo_v.js";
18
+ import { t as Modal } from "./Modal-CkSO1C1n.js";
19
+ import { Pagination } from "./components/pagination.js";
20
+ import { t as logger } from "./logger-BPhG2izn.js";
21
+ import { t as useTranslationMemo } from "./useTranslationMemo-CrZbeyBv.js";
22
+ import { t as UIRouter } from "./router.context-DSE1y7gW.js";
23
+ import { t as RoutingUtils } from "./routing.utils-UTQonIhB.js";
24
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
25
+ import { c } from "react/compiler-runtime";
26
+ import { jsx, jsxs } from "react/jsx-runtime";
27
+ import { useTranslation } from "react-i18next";
28
+ import { DndContext, KeyboardSensor, MouseSensor, TouchSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
29
+ import { restrictToVerticalAxis } from "@dnd-kit/modifiers";
30
+ import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
31
+ import { CSS } from "@dnd-kit/utilities";
32
+ import { createPaginatedRowModel, createSortedRowModel, flexRender, stockFeatures, tableFeatures, useTable } from "@tanstack/react-table";
33
+ import i18next from "i18next";
34
+ /**
35
+ * @license lucide-react v1.28.0 - ISC
36
+ *
37
+ * This source code is licensed under the ISC license.
38
+ * See the LICENSE file in the root directory of this source tree.
39
+ */
40
+ const GripVertical = createLucideIcon("grip-vertical", [
41
+ ["circle", {
42
+ cx: "9",
43
+ cy: "12",
44
+ r: "1",
45
+ key: "1vctgf"
46
+ }],
47
+ ["circle", {
48
+ cx: "9",
49
+ cy: "5",
50
+ r: "1",
51
+ key: "hp0tcf"
52
+ }],
53
+ ["circle", {
54
+ cx: "9",
55
+ cy: "19",
56
+ r: "1",
57
+ key: "fkjjf6"
58
+ }],
59
+ ["circle", {
60
+ cx: "15",
61
+ cy: "12",
62
+ r: "1",
63
+ key: "1tmaij"
64
+ }],
65
+ ["circle", {
66
+ cx: "15",
67
+ cy: "5",
68
+ r: "1",
69
+ key: "19l28e"
70
+ }],
71
+ ["circle", {
72
+ cx: "15",
73
+ cy: "19",
74
+ r: "1",
75
+ key: "f4zoj3"
76
+ }]
77
+ ]);
78
+ //#endregion
79
+ //#region src/components/table/table.cva.ts
80
+ const tableRowDefinition = UIOverrides.defineConfig({
81
+ base: [
82
+ "h-9 max-h-12",
83
+ "hover:bg-elevation-fill-default-2",
84
+ "disabled:opacity-50",
85
+ "selected:bg-elevation-fill-default-2",
86
+ "hover:selected:bg-interactive-subtle-secondary-hover",
87
+ "data-clickable:cursor-pointer",
88
+ "focus-within:bg-elevation-fill-default-2"
89
+ ],
90
+ config: { variants: { alternatingBackground: {
91
+ even: "even:bg-elevation-fill-inverted-4/5",
92
+ odd: "odd:bg-elevation-fill-inverted-4/5"
93
+ } } }
94
+ });
95
+ const theadDefinition = UIOverrides.defineConfig({ base: ["group/table-head sticky top-0 z-sticky data-is-sticky:shadow-2"] });
96
+ const tableHeadRowDefinition = UIOverrides.defineConfig({ base: ["h-8 w-full"] });
97
+ const tableHeadDataDefinition = UIOverrides.defineConfig({
98
+ base: ["border-b border-b-elevation-outline-default-1 border-solid px-table-header-cell-container-side-default py-table-header-cell-container-height-default text-left", "group-data-[is-sticky=true]/table-head:bg-elevation-fill-default-1"],
99
+ config: {
100
+ variants: { hasRightBorder: {
101
+ true: "border-l border-l-elevation-outline-default-1 border-solid",
102
+ false: ""
103
+ } },
104
+ defaultVariants: { hasRightBorder: true }
105
+ }
106
+ });
107
+ const tableDataDefinition = UIOverrides.defineConfig({
108
+ base: [
109
+ "relative h-0-5 overflow-hidden text-ellipsis whitespace-nowrap border-t border-t-transparent px-2",
110
+ "border-b border-b-elevation-outline-default-1",
111
+ "has-[*>[data-hovered]:not([data-disabled])]:hover:border-b-input-outlined-outline-hover",
112
+ "has-[*>[data-invalid]]:border-b-input-outlined-outline-error!",
113
+ "has-[*>[data-focused]]:border-b-input-outlined-outline-active"
114
+ ],
115
+ config: {
116
+ variants: { hasRightBorder: {
117
+ true: "border-l border-l-elevation-outline-default-1",
118
+ false: ""
119
+ } },
120
+ defaultVariants: { hasRightBorder: true }
121
+ }
122
+ });
123
+ const tableHeaderTextDefinition = UIOverrides.defineConfig({ base: ["overflow-hidden text-ellipsis px-table-cell-content-side-m py-table-cell-content-height-m text-text-default-1"] });
124
+ const tableCellTextDefinition = UIOverrides.defineConfig({ base: ["block overflow-hidden text-ellipsis text-text-default-2"] });
125
+ //#endregion
126
+ //#region src/components/table/CellText.tsx
127
+ const CellText = (props) => {
128
+ const uiConfig = UIConfig.useConfig();
129
+ const { variant = uiConfig.tableCellText.variant, size = uiConfig.tableCellText.size, children, style, className } = props;
130
+ const cellTextCva = UIOverrides.useCva("table.cellTextCva", tableCellTextDefinition);
131
+ return /* @__PURE__ */ jsx(Typography, {
132
+ className: cellTextCva({ className }),
133
+ as: "span",
134
+ variant,
135
+ size,
136
+ style,
137
+ "data-rac": true,
138
+ children
139
+ });
140
+ };
141
+ //#endregion
142
+ //#region src/components/table/HeaderText.tsx
143
+ const HeaderText = (props) => {
144
+ const uiConfig = UIConfig.useConfig();
145
+ const { variant = uiConfig.tableHeaderText.variant, size = uiConfig.tableHeaderText.size, children, style, className } = props;
146
+ const headerTextCva = UIOverrides.useCva("table.headerTextCva", tableHeaderTextDefinition);
147
+ return /* @__PURE__ */ jsx(Typography, {
148
+ className: headerTextCva({ className }),
149
+ as: "span",
150
+ variant,
151
+ size,
152
+ style,
153
+ children
154
+ });
155
+ };
156
+ //#endregion
157
+ //#region src/hooks/useTableNav.ts
158
+ const Selectors = {
159
+ Cell: "[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],td,th",
160
+ Row: "[role=\"row\"],tr",
161
+ RowGroup: "[role=\"rowgroup\"],thead,tbody,tfoot",
162
+ /** Selector from here: https://github.com/Shopify/polaris/blob/main/polaris-react/src/utilities/focus.ts#L10 */
163
+ Focusable: "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not([aria-disabled=\"true\"]):not([tabindex=\"-1\"]):not(:disabled),*[tabindex]"
164
+ };
165
+ var DataGridNav = class {
166
+ constructor(config = {}) {
167
+ this.keys = [];
168
+ this.activeCell = null;
169
+ this.debugLog = (functionName, message) => {
170
+ if (this.debug) logger.info(`[${functionName}]: ${message}`);
171
+ };
172
+ const { selectors = {}, pageUpDown, debug = false } = config;
173
+ this.selectors = {
174
+ ...Selectors,
175
+ ...selectors
176
+ };
177
+ this.pageUpDown = pageUpDown;
178
+ this.keys = [];
179
+ this.debug = debug;
180
+ this.disabled = false;
181
+ }
182
+ /**
183
+ * Disables the keyboard listener in cases
184
+ * that elements inside the grid need to use
185
+ * arrows keys etc., like select dropdowns
186
+ */
187
+ disable() {
188
+ this.disabled = true;
189
+ }
190
+ /**
191
+ * Enables the keyboard listeners
192
+ */
193
+ enable() {
194
+ this.disabled = false;
195
+ }
196
+ isFocusable(el) {
197
+ return el instanceof HTMLElement || el instanceof SVGElement;
198
+ }
199
+ getActiveCell() {
200
+ return this.activeCell;
201
+ }
202
+ /** Used as a keyboard listener for key up */
203
+ tableKeyUp() {
204
+ this.keys = [];
205
+ }
206
+ /** Used as a keyboard listener for key down */
207
+ tableKeyDown(e) {
208
+ if (this.disabled) return;
209
+ /**
210
+ * Avoid page scrolling etc.
211
+ * Enable default behavior for:
212
+ * Tab, Shift + Tab
213
+ * TODO: Actually it will be better to just prevent
214
+ * in ArrowKeys and PageKeys maybe?
215
+ * Or should the consumer stop propagation?!
216
+ * Cannot work with preventDefault as it will
217
+ * first capture the event from an input in cell for example
218
+ */
219
+ if ("ArrowDown" === e.key || "ArrowUp" === e.key || "ArrowLeft" === e.key || "ArrowRight" === e.key) e.preventDefault();
220
+ /**
221
+ * Add key to the stack if it's
222
+ * not the same with the last (long press)
223
+ */
224
+ if (this.keys.length === 0 || this.keys[this.keys.length - 1] !== e.key) this.keys.push(e.key);
225
+ /**
226
+ * Need to check if we are inside a grid cell
227
+ * or not to enable/disable Grid Navigation
228
+ */
229
+ if (!(e.target instanceof Element)) return;
230
+ const cell = e.target.parentElement?.closest(`${this.selectors.Cell},${this.selectors.Row}`);
231
+ if (!cell) return;
232
+ if (cell.matches(this.selectors.Cell)) this.cellNavigation(e);
233
+ else this.gridNavigation(e);
234
+ }
235
+ /**
236
+ * Handles the navigation inside a cell
237
+ */
238
+ cellNavigation(e) {
239
+ if (!(e.target instanceof Element)) return;
240
+ /**
241
+ * Keys: Escape
242
+ * Restore grid navigation
243
+ */
244
+ if (e.key === "Escape") {
245
+ const cell = e.target.closest(this.selectors.Cell);
246
+ if (cell && this.isFocusable(cell)) {
247
+ cell.focus();
248
+ return;
249
+ }
250
+ }
251
+ /**
252
+ * Keys: ArrowRight, ArrowDown
253
+ * Move to the next focusable cell, or the first one
254
+ *
255
+ * Arrow Down disabled:
256
+ * https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
257
+ */
258
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") {
259
+ const cell = e.target.closest(this.selectors.Cell);
260
+ if (!cell) return;
261
+ const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
262
+ const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
263
+ const widgetToFocus = focusableWidgets[widgetIdx === focusableWidgets.length - 1 ? 0 : widgetIdx + 1];
264
+ if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
265
+ return;
266
+ }
267
+ /**
268
+ * Keys: ArrowLeft, ArrowUp
269
+ * Move to the previous focusable cell, or the last one
270
+ *
271
+ * Arrow Up disabled:
272
+ * https://github.com/w3c/aria-practices/issues/2739#issuecomment-1613538972
273
+ */
274
+ if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
275
+ const cell = e.target.closest(this.selectors.Cell);
276
+ if (!cell) return;
277
+ const focusableWidgets = [...cell.querySelectorAll(this.selectors.Focusable)];
278
+ const widgetIdx = focusableWidgets.findIndex((el) => el === e.target);
279
+ const widgetToFocus = focusableWidgets[widgetIdx === 0 ? focusableWidgets.length - 1 : widgetIdx - 1];
280
+ if (this.isFocusable(widgetToFocus)) widgetToFocus.focus();
281
+ }
282
+ }
283
+ /**
284
+ * Handles the navigation outside a cell
285
+ * on the grid level
286
+ */
287
+ gridNavigation(e) {
288
+ const { target } = e;
289
+ if (!(e.target instanceof Element)) return;
290
+ if (!(target instanceof Element)) return;
291
+ if (this.keys.length === 1) {
292
+ /**
293
+ * Keys: Enter
294
+ * Should move focus inside the cell to the first focusable element:
295
+ * https://www.w3.org/WAI/ARIA/apg/patterns/grid/#gridNav_inside
296
+ */
297
+ if (/^[a-zA-Z0-9]$/.test(e.key)) {
298
+ const cell = e.target.querySelector(this.selectors.Focusable);
299
+ if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
300
+ cell.focus();
301
+ cell.value = `${cell.value}${e.key}`;
302
+ e.preventDefault();
303
+ }
304
+ return;
305
+ }
306
+ if (e.key === "Backspace") {
307
+ const cell = e.target.querySelector(this.selectors.Focusable);
308
+ if (cell && this.isFocusable(cell) && cell instanceof HTMLInputElement) {
309
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set;
310
+ if (nativeInputValueSetter) {
311
+ nativeInputValueSetter.call(cell, "");
312
+ const ev = new Event("input", { bubbles: true });
313
+ cell.dispatchEvent(ev);
314
+ }
315
+ }
316
+ return;
317
+ }
318
+ if (e.key === "Enter") {
319
+ const cell = e.target.querySelector(this.selectors.Focusable);
320
+ if (cell && this.isFocusable(cell)) {
321
+ if (cell.getAttribute("data-type") === "select-trigger") {
322
+ cell.click();
323
+ return;
324
+ }
325
+ cell.focus();
326
+ e.preventDefault();
327
+ }
328
+ return;
329
+ }
330
+ /**
331
+ * Keys: ArrowLeft, ArrowRight
332
+ * Should move focus to the next/previous cell
333
+ */
334
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
335
+ const direction = e.key === "ArrowLeft" ? "prev" : "next";
336
+ const cell = e.target.closest(this.selectors.Cell);
337
+ let nextCell = null;
338
+ if (direction === "next" && cell?.nextElementSibling instanceof HTMLElement) nextCell = cell.nextElementSibling;
339
+ if (direction === "prev" && cell?.previousElementSibling instanceof HTMLElement) nextCell = cell.previousElementSibling;
340
+ if (nextCell && this.isFocusable(nextCell)) {
341
+ nextCell.focus();
342
+ e.preventDefault();
343
+ }
344
+ }
345
+ /**
346
+ * Keys: Up,Down
347
+ * Should move focus to the same column of the next/previous row
348
+ */
349
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
350
+ this.verticalCellNavigation(e);
351
+ return;
352
+ }
353
+ /**
354
+ * Keys: PageUp, PageDown
355
+ * Should move focus to the first/last row
356
+ * or a predefined number of rows if user provides a value
357
+ */
358
+ if (e.key === "PageUp" || e.key === "PageDown") {
359
+ this.pageCellNavigation(e);
360
+ return;
361
+ }
362
+ /**
363
+ * Keys: Home, End
364
+ * Should move focus to the first/last cell of the current row
365
+ */
366
+ if (e.key === "Home" || e.key === "End") {
367
+ const rowChildren = [...e.target.closest(this.selectors.Row)?.children || []];
368
+ if (e.key === "End") rowChildren.reverse();
369
+ this.focusOnFirstCell(rowChildren);
370
+ }
371
+ } else {
372
+ /**
373
+ * Keys: Control + Home, Control + End
374
+ * Should move focus to the first/last cell of the first/last row
375
+ */
376
+ const [firstKey, secondKey] = this.keys;
377
+ if (firstKey === "Control" && (secondKey === "Home" || secondKey === "End")) {
378
+ const siblings = e.target.closest(this.selectors.Row).parentElement?.children;
379
+ if (!siblings) return;
380
+ const rowChildren = [...(secondKey === "Home" ? siblings[0] : siblings[siblings.length - 1])?.children || []];
381
+ if (secondKey === "End") rowChildren.reverse();
382
+ this.focusOnFirstCell(rowChildren);
383
+ }
384
+ }
385
+ }
386
+ pageCellNavigation(e) {
387
+ if (!(e.target instanceof Element)) return;
388
+ const row = e.target.closest(this.selectors.Row);
389
+ const cell = e.target.closest(this.selectors.Cell);
390
+ if (row && cell) {
391
+ const position = this.getColumnIndex(cell);
392
+ if (position === void 0) return;
393
+ const direction = e.key === "PageUp" ? "prev" : "next";
394
+ const siblings = row.parentElement?.children;
395
+ if (!siblings) return;
396
+ let destinationRow;
397
+ if (this.pageUpDown) {
398
+ const methodClbk = direction === "prev" ? "previousSibling" : "nextSibling";
399
+ let sibling = row[methodClbk];
400
+ if (sibling === null) return;
401
+ let lastVisitedSibling = sibling;
402
+ for (let i = 0; i < this.pageUpDown - 1 && sibling; i++) {
403
+ sibling = sibling[methodClbk];
404
+ if (sibling) lastVisitedSibling = sibling;
405
+ }
406
+ destinationRow = sibling || lastVisitedSibling;
407
+ } else destinationRow = direction === "prev" ? siblings[0] : siblings[siblings.length - 1];
408
+ if (!destinationRow || !(destinationRow instanceof Element)) return;
409
+ const child = destinationRow.children[position];
410
+ if (child && this.isFocusable(child)) child.focus();
411
+ }
412
+ }
413
+ verticalCellNavigation(e) {
414
+ if (!(e.target instanceof Element)) return;
415
+ const row = e.target.closest(this.selectors.Row);
416
+ const cell = e.target.closest(this.selectors.Cell);
417
+ if (row && cell) {
418
+ const cellPosition = this.getColumnIndex(cell);
419
+ const rowPosition = this.getRowIndex(row);
420
+ if (cellPosition === void 0 || rowPosition === void 0) return;
421
+ const direction = e.key === "ArrowUp" ? "prev" : "next";
422
+ /** Find previous rowgroup and focus on the proper cell */
423
+ if (rowPosition === 0 && direction === "prev") {
424
+ const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
425
+ const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
426
+ const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
427
+ if (currentRowGroupIdx !== 0) {
428
+ const rows = [...siblingRowGroups[currentRowGroupIdx - 1].querySelectorAll(this.selectors.Row)];
429
+ const child = rows[rows.length - 1].children[cellPosition];
430
+ if (child && this.isFocusable(child)) child.focus();
431
+ return;
432
+ }
433
+ }
434
+ /** Find next rowgroup and focus on the proper cell */
435
+ if (rowPosition === [...row.parentElement?.querySelectorAll(this.selectors.Row) || []].length - 1 && direction === "next") {
436
+ const currentRowGroup = row.parentElement?.closest(this.selectors.RowGroup);
437
+ const siblingRowGroups = [...currentRowGroup?.parentElement?.children || []];
438
+ const currentRowGroupIdx = siblingRowGroups.findIndex((el) => el === currentRowGroup);
439
+ if (currentRowGroupIdx !== siblingRowGroups.length - 1) {
440
+ const child = [...siblingRowGroups[currentRowGroupIdx + 1].querySelectorAll(this.selectors.Row)][0].children[cellPosition];
441
+ if (child && this.isFocusable(child)) child.focus();
442
+ return;
443
+ }
444
+ return;
445
+ }
446
+ /** Navigation in the same rowgroup */
447
+ const destinationRow = this.findUntil(direction, row, this.selectors.Row);
448
+ if (!destinationRow) return;
449
+ const child = destinationRow.children[cellPosition];
450
+ if (child && this.isFocusable(child)) child.focus();
451
+ }
452
+ }
453
+ /**
454
+ * Sending a row `Element` and then the first cell will be focused.
455
+ *
456
+ * If you want to focus the last cell then the row children can be passed in
457
+ * reversed order
458
+ */
459
+ focusOnFirstCell(el) {
460
+ for (let i = 0; i < el.length; i++) {
461
+ const child = el[i];
462
+ if (this.isFocusable(child)) {
463
+ child.focus();
464
+ return;
465
+ }
466
+ }
467
+ }
468
+ /**
469
+ * Get the column index of a `cell` based on the first `row` parent.
470
+ * `cellIndex` could be used, but it's not supported in HTML tables.
471
+ */
472
+ getColumnIndex(cell) {
473
+ let position = 0;
474
+ const siblings = cell?.parentNode?.children;
475
+ if (!siblings) return;
476
+ while (cell !== siblings[position] && siblings[position] !== void 0) position++;
477
+ if (siblings[position] === void 0) return;
478
+ return position;
479
+ }
480
+ /**
481
+ * Get the row index of a `row` based
482
+ * on its sibling rows
483
+ */
484
+ getRowIndex(row) {
485
+ let position = 0;
486
+ const siblings = row?.parentNode?.children;
487
+ if (!siblings) return;
488
+ while (row !== siblings[position] && siblings[position] !== void 0) position++;
489
+ if (siblings[position] === void 0) return;
490
+ return position;
491
+ }
492
+ /**
493
+ * Equivalent to prevUntil/nextUntil in jQuery
494
+ * https://api.jquery.com/prevUntil/
495
+ */
496
+ findUntil(direction, el, matchSelector, exitSelector) {
497
+ let element = el;
498
+ const method = direction === "next" ? "nextSibling" : "previousSibling";
499
+ while (element[method]) {
500
+ const sibling = element[method];
501
+ if (!sibling) return null;
502
+ if (exitSelector && sibling instanceof Element && sibling.matches(exitSelector)) return null;
503
+ if (sibling instanceof Element && sibling.matches(matchSelector)) return sibling;
504
+ element = sibling;
505
+ }
506
+ return null;
507
+ }
508
+ };
509
+ function useTableNav(options) {
510
+ const nav = new DataGridNav(options);
511
+ return {
512
+ listeners: {
513
+ onKeyDown: (e) => nav.tableKeyDown(e),
514
+ onKeyUp: () => nav.tableKeyUp()
515
+ },
516
+ tableNav: nav
517
+ };
518
+ }
519
+ //#endregion
520
+ //#region src/components/table/Table.tsx
521
+ const tableFeaturesConfig = tableFeatures({
522
+ ...stockFeatures,
523
+ sortedRowModel: createSortedRowModel(),
524
+ paginatedRowModel: createPaginatedRowModel()
525
+ });
526
+ const CustomCellContext = (context) => {
527
+ return {
528
+ ...context,
529
+ original: context.row.original,
530
+ data: context.row.original,
531
+ value: context.getValue()
532
+ };
533
+ };
534
+ const renderCell = (Comp, props) => {
535
+ const rendered = flexRender(Comp, props);
536
+ return typeof rendered === "string" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
537
+ };
538
+ const RowDragHandleCell = ({ rowId }) => {
539
+ const { attributes, listeners } = useSortable({ id: rowId });
540
+ return /* @__PURE__ */ jsx(InlineIconButton, {
541
+ ...attributes,
542
+ ...listeners,
543
+ className: "cursor-move p-1",
544
+ label: "Drag handle",
545
+ icon: GripVertical
546
+ });
547
+ };
548
+ const AutoDragHandleCell = ({ row }) => /* @__PURE__ */ jsx(RowDragHandleCell, { rowId: row.id });
549
+ const DraggableRow = ({ row, showCellBorder, onRowClick, onDoubleClick, tableRowCva, tableDataCva, hasOnClick, ...props }) => {
550
+ const { transform, transition, setNodeRef, isDragging } = useSortable({ id: row.id });
551
+ const style = {
552
+ transform: CSS.Transform.toString(transform),
553
+ transition,
554
+ opacity: isDragging ? .8 : 1,
555
+ zIndex: isDragging ? 1 : 0,
556
+ position: "relative"
557
+ };
558
+ return /* @__PURE__ */ jsx("tr", {
559
+ ref: setNodeRef,
560
+ style,
561
+ "data-clickable": hasOnClick || row.getCanSelect() || void 0,
562
+ "data-selected": row.getIsSelected() || void 0,
563
+ className: clsx(tableRowCva(props)),
564
+ onClick: () => {
565
+ if (onRowClick) {
566
+ onRowClick(row.original);
567
+ return;
568
+ }
569
+ if (row.getCanSelect()) row.toggleSelected();
570
+ },
571
+ onDoubleClick: () => onDoubleClick?.(row.original),
572
+ children: row.getVisibleCells().map((cell, cellIndex) => {
573
+ const columnMeta = cell.column.columnDef.meta ?? {};
574
+ return /* @__PURE__ */ jsx("td", {
575
+ tabIndex: -1,
576
+ className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta.cellClass, columnMeta.width),
577
+ children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
578
+ }, cell.id);
579
+ })
580
+ });
581
+ };
582
+ const Table$1 = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, className, sorting, setSorting, columnOrder, setColumnOrder, columnVisibility, setColumnVisibility, bulkSelectionActions: ActionHeader, enableDragDrop = false, onDragEnd, onReorder, getRowId, enableRowSelection, enableMultiRowSelection = false, defaultSelectedRows, onRowSelectionChange, ...props }) => {
583
+ const tableRowCva = UIOverrides.useCva("table.rowCva", tableRowDefinition);
584
+ const theadCva = UIOverrides.useCva("table.theadCva", theadDefinition);
585
+ const tableHeadRowCva = UIOverrides.useCva("table.headRowCva", tableHeadRowDefinition);
586
+ const tableHeadDataCva = UIOverrides.useCva("table.headDataCva", tableHeadDataDefinition);
587
+ const tableDataCva = UIOverrides.useCva("table.dataCva", tableDataDefinition);
588
+ const ref = useRef(null);
589
+ const { listeners } = useTableNav();
590
+ const data = useMemo(() => items ?? [], [items]);
591
+ const [internalSelectedRows, setInternalSelectedRows] = useState({});
592
+ const { rowSelection, handleRowSelectionChange } = useMemo(() => {
593
+ const hasExternalRowSelection = defaultSelectedRows !== void 0 && onRowSelectionChange !== void 0;
594
+ return {
595
+ rowSelection: hasExternalRowSelection ? defaultSelectedRows : internalSelectedRows,
596
+ handleRowSelectionChange: hasExternalRowSelection ? onRowSelectionChange : setInternalSelectedRows
597
+ };
598
+ }, [
599
+ defaultSelectedRows,
600
+ onRowSelectionChange,
601
+ internalSelectedRows
602
+ ]);
603
+ const baseColumns = useMemo(() => typeof columns === "function" ? columns(i18next.t) : columns, [columns]);
604
+ const tableColumns = useMemo(() => {
605
+ if (enableDragDrop && getRowId) return [{
606
+ id: "drag-handle",
607
+ header: "",
608
+ meta: { width: "w-12" },
609
+ cell: AutoDragHandleCell,
610
+ enableSorting: false
611
+ }, ...baseColumns];
612
+ return baseColumns;
613
+ }, [
614
+ baseColumns,
615
+ enableDragDrop,
616
+ getRowId
617
+ ]);
618
+ const [isSticky, setIsSticky] = useState(false);
619
+ const onIntersectionChange = useCallback((entry) => {
620
+ setIsSticky(entry.intersectionRatio < 1);
621
+ }, []);
622
+ const { ref: stickyRef } = useIntersectionObserver({ onIntersectionChange });
623
+ const table = useTable({
624
+ features: tableFeaturesConfig,
625
+ data,
626
+ columns: tableColumns,
627
+ state: {
628
+ sorting,
629
+ columnOrder,
630
+ columnVisibility,
631
+ rowSelection
632
+ },
633
+ rowCount: items.length,
634
+ manualPagination: true,
635
+ onColumnOrderChange: setColumnOrder,
636
+ onColumnVisibilityChange: setColumnVisibility,
637
+ onSortingChange: setSorting,
638
+ onRowSelectionChange: handleRowSelectionChange,
639
+ manualSorting: true,
640
+ autoResetPageIndex: false,
641
+ autoResetExpanded: false,
642
+ defaultColumn: { sortDescFirst: true },
643
+ enableRowSelection,
644
+ enableMultiRowSelection,
645
+ getRowId: getRowId ? (row) => String(getRowId(row)) : void 0
646
+ });
647
+ const dataIds = useMemo(() => {
648
+ if (!enableDragDrop || !getRowId) return [];
649
+ return data.map((item) => getRowId(item));
650
+ }, [
651
+ data,
652
+ enableDragDrop,
653
+ getRowId
654
+ ]);
655
+ const handleDragEnd = useCallback((event) => {
656
+ const { active, over } = event;
657
+ if (!active || !over || active.id === over.id) return;
658
+ if (getRowId && (onReorder || onDragEnd)) {
659
+ if (onReorder) {
660
+ const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
661
+ const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
662
+ if (oldIndex !== -1 && newIndex !== -1) onReorder(arrayMove(items, oldIndex, newIndex));
663
+ }
664
+ onDragEnd?.(event);
665
+ }
666
+ }, [
667
+ onDragEnd,
668
+ onReorder,
669
+ items,
670
+ getRowId
671
+ ]);
672
+ const sensors = useSensors(useSensor(MouseSensor, {}), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
673
+ const selectedRows = table.getSelectedRowModel().rows;
674
+ const columnCount = table.getHeaderGroups()[0].headers.length;
675
+ const isAnyRowSelected = selectedRows.length > 0 && !!ActionHeader;
676
+ const hasOnClick = !!onRowClick || !!onDoubleClick;
677
+ const tableElement = /* @__PURE__ */ jsxs("table", {
678
+ className: clsx("w-full", className),
679
+ ...listeners,
680
+ children: [/* @__PURE__ */ jsxs("thead", {
681
+ className: clsx(theadCva({})),
682
+ "data-is-sticky": isSticky || void 0,
683
+ children: [/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("th", {
684
+ ref: stickyRef,
685
+ className: "-mt-px block"
686
+ }) }), table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
687
+ className: clsx(tableHeadRowCva({})),
688
+ children: headerGroup.headers.filter((header) => {
689
+ if (isAnyRowSelected && header.index > 0) return false;
690
+ return header.column.getIsVisible();
691
+ }).map((header_0, index) => {
692
+ const columnMeta = header_0.column.columnDef.meta ?? {};
693
+ return /* @__PURE__ */ jsx("th", {
694
+ colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
695
+ tabIndex: -1,
696
+ className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
697
+ children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
698
+ type: "button",
699
+ "aria-label": "Sort column",
700
+ className: clsx("flex select-none items-center gap-1 text-text-default-1", header_0.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-elevation-fill-default-2" : "cursor-default", columnMeta.sortClass),
701
+ onClick: header_0.column.getToggleSortingHandler(),
702
+ children: [typeof header_0.column.columnDef.header === "function" ? flexRender(header_0.column.columnDef.header, header_0.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header_0.column.columnDef.header }), {
703
+ asc: /* @__PURE__ */ jsx(ChevronUp, {
704
+ width: 18,
705
+ height: 18
706
+ }),
707
+ desc: /* @__PURE__ */ jsx(ChevronDown, {
708
+ width: 18,
709
+ height: 18
710
+ })
711
+ }[header_0.column.getIsSorted()] ?? null]
712
+ })
713
+ }, header_0.id);
714
+ })
715
+ }, headerGroup.id))]
716
+ }), /* @__PURE__ */ jsx("tbody", {
717
+ ref,
718
+ className: "relative",
719
+ children: enableDragDrop ? /* @__PURE__ */ jsx(SortableContext, {
720
+ items: dataIds,
721
+ strategy: verticalListSortingStrategy,
722
+ children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
723
+ row: row_0,
724
+ showCellBorder,
725
+ onRowClick,
726
+ onDoubleClick,
727
+ tableRowCva,
728
+ tableHeadDataCva,
729
+ tableDataCva,
730
+ hasOnClick,
731
+ ...props
732
+ }, row_0.id))
733
+ }) : table.getRowModel().rows.map((row_1) => {
734
+ return /* @__PURE__ */ jsx("tr", {
735
+ className: clsx(tableRowCva({ ...props })),
736
+ onClick: () => {
737
+ if (onRowClick) {
738
+ onRowClick(row_1.original);
739
+ return;
740
+ }
741
+ if (row_1.getCanSelect()) row_1.toggleSelected();
742
+ },
743
+ onDoubleClick: () => onDoubleClick?.(row_1.original),
744
+ "data-clickable": hasOnClick || row_1.getCanSelect() || void 0,
745
+ "data-selected": row_1.getIsSelected() || void 0,
746
+ children: row_1.getVisibleCells().map((cell, cellIndex) => {
747
+ const columnMeta_0 = cell.column.columnDef.meta ?? {};
748
+ return /* @__PURE__ */ jsx("td", {
749
+ tabIndex: -1,
750
+ className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta_0.cellClass, columnMeta_0.width),
751
+ children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
752
+ }, cell.id);
753
+ })
754
+ }, row_1.id);
755
+ })
756
+ })]
757
+ });
758
+ if (enableDragDrop) return /* @__PURE__ */ jsx(DndContext, {
759
+ collisionDetection: closestCenter,
760
+ modifiers: [restrictToVerticalAxis],
761
+ onDragEnd: handleDragEnd,
762
+ sensors,
763
+ children: tableElement
764
+ });
765
+ return tableElement;
766
+ };
767
+ //#endregion
768
+ //#region src/components/table/ColumnConfig.tsx
769
+ const VisibilityCell = (t0) => {
770
+ const $ = c(7);
771
+ const { original, onToggle } = t0;
772
+ let t1;
773
+ if ($[0] !== onToggle || $[1] !== original.id) {
774
+ t1 = () => onToggle(original.id);
775
+ $[0] = onToggle;
776
+ $[1] = original.id;
777
+ $[2] = t1;
778
+ } else t1 = $[2];
779
+ const t2 = original.label;
780
+ let t3;
781
+ if ($[3] !== original.visible || $[4] !== t1 || $[5] !== t2) {
782
+ t3 = /* @__PURE__ */ jsx(Checkbox, {
783
+ isSelected: original.visible,
784
+ onChange: t1,
785
+ hideLabel: true,
786
+ children: t2
787
+ });
788
+ $[3] = original.visible;
789
+ $[4] = t1;
790
+ $[5] = t2;
791
+ $[6] = t3;
792
+ } else t3 = $[6];
793
+ return t3;
794
+ };
795
+ const getColumns = (t, handleToggleVisibility) => [{
796
+ id: "name",
797
+ header: t(($) => $.ui.table.column, { ns: "ui" }),
798
+ meta: { width: "flex-1" },
799
+ accessorKey: "label"
800
+ }, {
801
+ id: "visible",
802
+ header: t(($) => $.ui.table.show, { ns: "ui" }),
803
+ meta: { width: "w-20" },
804
+ cell: ({ original }) => /* @__PURE__ */ jsx(VisibilityCell, {
805
+ original,
806
+ onToggle: handleToggleVisibility
807
+ })
808
+ }];
809
+ function ColumnConfigModal(t0) {
810
+ const $ = c(27);
811
+ const { isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange } = t0;
812
+ const { t } = useTranslation("ui");
813
+ let t1;
814
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
815
+ t1 = [];
816
+ $[0] = t1;
817
+ } else t1 = $[0];
818
+ const [data, setData] = useState(t1);
819
+ let t2;
820
+ let t3;
821
+ if ($[1] !== configColumns || $[2] !== visibleColumns) {
822
+ t2 = () => {
823
+ setData(configColumns.map((column) => {
824
+ const columnId = column.id ?? column.accessorKey;
825
+ return {
826
+ id: columnId,
827
+ label: column.header,
828
+ visible: visibleColumns?.[columnId] ?? true
829
+ };
830
+ }));
831
+ };
832
+ t3 = [configColumns, visibleColumns];
833
+ $[1] = configColumns;
834
+ $[2] = visibleColumns;
835
+ $[3] = t2;
836
+ $[4] = t3;
837
+ } else {
838
+ t2 = $[3];
839
+ t3 = $[4];
840
+ }
841
+ useEffect(t2, t3);
842
+ let t4;
843
+ if ($[5] !== onVisibilityChange || $[6] !== visibleColumns) {
844
+ t4 = (columnId_0) => {
845
+ const newVisible = {
846
+ ...visibleColumns,
847
+ [columnId_0]: !visibleColumns[columnId_0]
848
+ };
849
+ onVisibilityChange(newVisible);
850
+ };
851
+ $[5] = onVisibilityChange;
852
+ $[6] = visibleColumns;
853
+ $[7] = t4;
854
+ } else t4 = $[7];
855
+ const handleToggleVisibility = t4;
856
+ let t5;
857
+ if ($[8] !== handleToggleVisibility) {
858
+ t5 = (translateFn) => getColumns(translateFn, handleToggleVisibility);
859
+ $[8] = handleToggleVisibility;
860
+ $[9] = t5;
861
+ } else t5 = $[9];
862
+ const columns = useTranslationMemo(t5);
863
+ let t6;
864
+ if ($[10] !== onOrderChange) {
865
+ t6 = (reorderedItems) => {
866
+ setData(reorderedItems);
867
+ onOrderChange(reorderedItems.map(_temp$2));
868
+ };
869
+ $[10] = onOrderChange;
870
+ $[11] = t6;
871
+ } else t6 = $[11];
872
+ const handleReorder = t6;
873
+ if (!isOpen) return null;
874
+ let t7;
875
+ if ($[12] !== t) {
876
+ t7 = t(_temp2$2);
877
+ $[12] = t;
878
+ $[13] = t7;
879
+ } else t7 = $[13];
880
+ let t8;
881
+ if ($[14] !== t7) {
882
+ t8 = /* @__PURE__ */ jsx(Typography, {
883
+ as: "h2",
884
+ variant: "prominent-1",
885
+ size: "title-5",
886
+ children: t7
887
+ });
888
+ $[14] = t7;
889
+ $[15] = t8;
890
+ } else t8 = $[15];
891
+ let t9;
892
+ if ($[16] !== columns || $[17] !== data || $[18] !== handleReorder) {
893
+ t9 = /* @__PURE__ */ jsx("div", {
894
+ className: "max-h-96 overflow-y-auto",
895
+ children: /* @__PURE__ */ jsx(Table$1, {
896
+ items: data,
897
+ columns,
898
+ showCellBorder: true,
899
+ className: "w-full",
900
+ enableDragDrop: true,
901
+ getRowId: _temp3,
902
+ onReorder: handleReorder
903
+ })
904
+ });
905
+ $[16] = columns;
906
+ $[17] = data;
907
+ $[18] = handleReorder;
908
+ $[19] = t9;
909
+ } else t9 = $[19];
910
+ let t10;
911
+ if ($[20] !== t8 || $[21] !== t9) {
912
+ t10 = /* @__PURE__ */ jsxs("div", {
913
+ className: "flex flex-col gap-2 p-4",
914
+ children: [t8, t9]
915
+ });
916
+ $[20] = t8;
917
+ $[21] = t9;
918
+ $[22] = t10;
919
+ } else t10 = $[22];
920
+ let t11;
921
+ if ($[23] !== isOpen || $[24] !== onClose || $[25] !== t10) {
922
+ t11 = /* @__PURE__ */ jsx(Modal, {
923
+ isOpen,
924
+ onClose,
925
+ showCloseIcon: true,
926
+ children: t10
927
+ });
928
+ $[23] = isOpen;
929
+ $[24] = onClose;
930
+ $[25] = t10;
931
+ $[26] = t11;
932
+ } else t11 = $[26];
933
+ return t11;
934
+ }
935
+ function _temp3(row) {
936
+ return row.id;
937
+ }
938
+ function _temp2$2($) {
939
+ return $.ui.table.configureColumns;
940
+ }
941
+ function _temp$2(item) {
942
+ return item.id;
943
+ }
944
+ //#endregion
945
+ //#region src/components/table/InfiniteTable.tsx
946
+ const InfiniteTable = (t0) => {
947
+ const $ = c(20);
948
+ let fetchNextPage;
949
+ let hasNextPage;
950
+ let rest;
951
+ let t1;
952
+ if ($[0] !== t0) {
953
+ ({hasNextPage, isFetchingNextPage: t1, fetchNextPage, ...rest} = t0);
954
+ $[0] = t0;
955
+ $[1] = fetchNextPage;
956
+ $[2] = hasNextPage;
957
+ $[3] = rest;
958
+ $[4] = t1;
959
+ } else {
960
+ fetchNextPage = $[1];
961
+ hasNextPage = $[2];
962
+ rest = $[3];
963
+ t1 = $[4];
964
+ }
965
+ const isFetchingNextPage = t1 === void 0 ? false : t1;
966
+ let t2;
967
+ if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
968
+ t2 = () => {
969
+ if (!isFetchingNextPage && hasNextPage) fetchNextPage();
970
+ };
971
+ $[5] = fetchNextPage;
972
+ $[6] = hasNextPage;
973
+ $[7] = isFetchingNextPage;
974
+ $[8] = t2;
975
+ } else t2 = $[8];
976
+ const handleLoadMore = t2;
977
+ let t3;
978
+ if ($[9] !== handleLoadMore) {
979
+ t3 = {
980
+ onIntersection: handleLoadMore,
981
+ rootMargin: "100px"
982
+ };
983
+ $[9] = handleLoadMore;
984
+ $[10] = t3;
985
+ } else t3 = $[10];
986
+ const { ref } = useIntersectionObserver(t3);
987
+ let t4;
988
+ if ($[11] !== rest) {
989
+ t4 = /* @__PURE__ */ jsx(Table$1, { ...rest });
990
+ $[11] = rest;
991
+ $[12] = t4;
992
+ } else t4 = $[12];
993
+ let t5;
994
+ if ($[13] !== hasNextPage || $[14] !== isFetchingNextPage || $[15] !== ref) {
995
+ t5 = (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
996
+ ref,
997
+ className: "flex justify-center py-4",
998
+ children: /* @__PURE__ */ jsx(Loader, {})
999
+ });
1000
+ $[13] = hasNextPage;
1001
+ $[14] = isFetchingNextPage;
1002
+ $[15] = ref;
1003
+ $[16] = t5;
1004
+ } else t5 = $[16];
1005
+ let t6;
1006
+ if ($[17] !== t4 || $[18] !== t5) {
1007
+ t6 = /* @__PURE__ */ jsxs("div", {
1008
+ className: "flex flex-col",
1009
+ children: [t4, t5]
1010
+ });
1011
+ $[17] = t4;
1012
+ $[18] = t5;
1013
+ $[19] = t6;
1014
+ } else t6 = $[19];
1015
+ return t6;
1016
+ };
1017
+ //#endregion
1018
+ //#region src/components/table/PaginatedTable.tsx
1019
+ const PaginatedTable = (t0) => {
1020
+ const $ = c(24);
1021
+ let items;
1022
+ let pagination;
1023
+ let rest;
1024
+ let setPagination;
1025
+ let totalItems;
1026
+ if ($[0] !== t0) {
1027
+ ({pagination, setPagination, items, totalItems, ...rest} = t0);
1028
+ $[0] = t0;
1029
+ $[1] = items;
1030
+ $[2] = pagination;
1031
+ $[3] = rest;
1032
+ $[4] = setPagination;
1033
+ $[5] = totalItems;
1034
+ } else {
1035
+ items = $[1];
1036
+ pagination = $[2];
1037
+ rest = $[3];
1038
+ setPagination = $[4];
1039
+ totalItems = $[5];
1040
+ }
1041
+ let t1;
1042
+ if ($[6] !== items) {
1043
+ t1 = items ?? [];
1044
+ $[6] = items;
1045
+ $[7] = t1;
1046
+ } else t1 = $[7];
1047
+ let t2;
1048
+ if ($[8] !== rest || $[9] !== t1) {
1049
+ t2 = /* @__PURE__ */ jsx(Table$1, {
1050
+ ...rest,
1051
+ items: t1
1052
+ });
1053
+ $[8] = rest;
1054
+ $[9] = t1;
1055
+ $[10] = t2;
1056
+ } else t2 = $[10];
1057
+ const t3 = totalItems ?? 0;
1058
+ let t4;
1059
+ let t5;
1060
+ if ($[11] !== pagination || $[12] !== setPagination) {
1061
+ t4 = (page) => setPagination({
1062
+ ...pagination,
1063
+ pageIndex: page
1064
+ });
1065
+ t5 = (pageSize) => setPagination({
1066
+ ...pagination,
1067
+ pageSize,
1068
+ pageIndex: 1
1069
+ });
1070
+ $[11] = pagination;
1071
+ $[12] = setPagination;
1072
+ $[13] = t4;
1073
+ $[14] = t5;
1074
+ } else {
1075
+ t4 = $[13];
1076
+ t5 = $[14];
1077
+ }
1078
+ let t6;
1079
+ if ($[15] !== pagination.pageIndex || $[16] !== pagination.pageSize || $[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
1080
+ t6 = /* @__PURE__ */ jsx(Pagination, {
1081
+ page: pagination.pageIndex,
1082
+ pageSize: pagination.pageSize,
1083
+ totalItems: t3,
1084
+ onPageChange: t4,
1085
+ onPageSizeChange: t5
1086
+ });
1087
+ $[15] = pagination.pageIndex;
1088
+ $[16] = pagination.pageSize;
1089
+ $[17] = t3;
1090
+ $[18] = t4;
1091
+ $[19] = t5;
1092
+ $[20] = t6;
1093
+ } else t6 = $[20];
1094
+ let t7;
1095
+ if ($[21] !== t2 || $[22] !== t6) {
1096
+ t7 = /* @__PURE__ */ jsxs("div", {
1097
+ className: "flex flex-col gap-4",
1098
+ children: [t2, t6]
1099
+ });
1100
+ $[21] = t2;
1101
+ $[22] = t6;
1102
+ $[23] = t7;
1103
+ } else t7 = $[23];
1104
+ return t7;
1105
+ };
1106
+ //#endregion
1107
+ //#region src/helpers/dynamicColumns.ts
1108
+ const DEFAULT_NAMESPACE = "dynamicColumns";
1109
+ const FORMAT_MAP = {
1110
+ datetime: (value) => DateUtils.formatDate(new Date(value)),
1111
+ dateRange: (value) => {
1112
+ return `${DateUtils.formatDate(new Date(value.start))} - ${DateUtils.formatDate(new Date(value.end))}`;
1113
+ },
1114
+ enum: (value) => StringUtils.capitalize(value),
1115
+ number: (value) => IntlUtils.getNumberFormatter(i18next.language).format(value),
1116
+ string: (value) => String(value),
1117
+ boolean: (value) => {
1118
+ const key = `${DEFAULT_NAMESPACE}.${value ? "yes" : "no"}`;
1119
+ if (i18next.exists(key)) return String(i18next.t(key));
1120
+ return value ? "Yes" : "No";
1121
+ }
1122
+ };
1123
+ const ZOD_TYPE_FORMAT_MAP = [
1124
+ [ZodEnum, FORMAT_MAP.enum],
1125
+ [ZodNumber, FORMAT_MAP.number],
1126
+ [ZodString, FORMAT_MAP.string],
1127
+ [ZodBoolean, FORMAT_MAP.boolean],
1128
+ [ZodISODateTime, FORMAT_MAP.datetime]
1129
+ ];
1130
+ const configValueToColumnDef = (value) => {
1131
+ if (typeof value === "function" || typeof value === "string") return { cell: value };
1132
+ if (typeof value === "boolean" || value === void 0) return {};
1133
+ return value;
1134
+ };
1135
+ const convertEntriesToColumnDefs = (entries) => {
1136
+ return entries.map(([key, value]) => [key, configValueToColumnDef(value)]);
1137
+ };
1138
+ const customConfigValueToColumnDef = (value) => {
1139
+ if (typeof value === "string") return {
1140
+ accessorKey: value,
1141
+ cell: value
1142
+ };
1143
+ if (typeof value === "function") return { cell: value };
1144
+ return value;
1145
+ };
1146
+ const convertCustomEntriesToColumnDefs = (entries) => {
1147
+ return entries.map(([key, value]) => [key, customConfigValueToColumnDef(value)]);
1148
+ };
1149
+ const excludeEntries = (entries) => {
1150
+ return entries.filter(([, value]) => value !== false && value !== void 0);
1151
+ };
1152
+ const sortColumns = (columns, orderKeys) => {
1153
+ if (!orderKeys) return columns;
1154
+ const wildcardIndex = orderKeys.indexOf("*");
1155
+ if (wildcardIndex === -1) return columns.sort((columnA, columnB) => {
1156
+ const idA = columnA.id;
1157
+ const idB = columnB.id;
1158
+ const orderMap = new Map(orderKeys.map((key, index) => [String(key), index]));
1159
+ const orderA = orderMap.get(String(idA));
1160
+ const orderB = orderMap.get(String(idB));
1161
+ if (orderA !== void 0 && orderB !== void 0) return orderA - orderB;
1162
+ if (orderA !== void 0 && orderB === void 0) return -1;
1163
+ if (orderA === void 0 && orderB !== void 0) return 1;
1164
+ return 0;
1165
+ });
1166
+ const beforeWildcard = orderKeys.slice(0, wildcardIndex);
1167
+ const afterWildcard = orderKeys.slice(wildcardIndex + 1);
1168
+ const beforeMap = new Map(beforeWildcard.map((key, index) => [String(key), index]));
1169
+ const afterMap = new Map(afterWildcard.map((key, index) => [String(key), index]));
1170
+ const before = [];
1171
+ const middle = [];
1172
+ const after = [];
1173
+ columns.forEach((column) => {
1174
+ const id = String(column.id);
1175
+ if (beforeMap.has(id)) before.push(column);
1176
+ else if (afterMap.has(id)) after.push(column);
1177
+ else middle.push(column);
1178
+ });
1179
+ before.sort((a, b) => beforeMap.get(String(a.id)) - beforeMap.get(String(b.id)));
1180
+ after.sort((a, b) => afterMap.get(String(a.id)) - afterMap.get(String(b.id)));
1181
+ return [
1182
+ ...before,
1183
+ ...middle,
1184
+ ...after
1185
+ ];
1186
+ };
1187
+ const formatValueByType = (value, schemaType) => {
1188
+ if (value === null || value === void 0) return null;
1189
+ if (ZodUtils.isDateRange(schemaType)) return FORMAT_MAP.dateRange(value);
1190
+ const unwrappedType = ZodUtils.unwrapZodType(schemaType);
1191
+ if (unwrappedType instanceof ZodArray) {
1192
+ if (!Array.isArray(value)) return null;
1193
+ const elementType = unwrappedType.element;
1194
+ return value.map((element) => formatValueByType(element, elementType)).join(", ");
1195
+ }
1196
+ const formatFunction = ZOD_TYPE_FORMAT_MAP.find(([zodType]) => unwrappedType instanceof zodType)?.[1];
1197
+ if (formatFunction) return formatFunction(value);
1198
+ return String(value);
1199
+ };
1200
+ const getNestedValue = (obj, path) => {
1201
+ return path.split(".").reduce((current, key) => {
1202
+ return current && typeof current === "object" ? current[key] : void 0;
1203
+ }, obj);
1204
+ };
1205
+ const getKeyType = (schema, key) => {
1206
+ const pathParts = key.split(".");
1207
+ let currentType = schema.shape[pathParts[0]];
1208
+ for (let i = 1; i < pathParts.length; i++) if (currentType instanceof ZodObject) currentType = currentType.shape[pathParts[i]];
1209
+ else {
1210
+ currentType = schema.shape[key];
1211
+ break;
1212
+ }
1213
+ return currentType;
1214
+ };
1215
+ const getCellFunction = (schema, schemaKey, columnDef, options) => {
1216
+ const { cell } = columnDef;
1217
+ if (typeof cell === "function") return cell;
1218
+ return ({ data }) => {
1219
+ const key = typeof cell === "string" ? cell : schemaKey;
1220
+ const value = getNestedValue(data, key);
1221
+ const keyType = getKeyType(schema, key);
1222
+ let finalValue = !options.disableFormatting?.includes(key) ? formatValueByType(value, keyType) : value;
1223
+ if (options.emptyValue && !finalValue) finalValue = options.emptyValue;
1224
+ if (options.globalWrapper) return options.globalWrapper(finalValue);
1225
+ return finalValue;
1226
+ };
1227
+ };
1228
+ const normalizeSortable = (sortable) => {
1229
+ if (!sortable) return;
1230
+ if (Array.isArray(sortable)) return sortable;
1231
+ if (sortable instanceof ZodEnum) return Object.values(sortable.enum);
1232
+ };
1233
+ const getDefaultColumnHeader = (key, options) => {
1234
+ const localeKey = `${options.namespace ?? DEFAULT_NAMESPACE}.${key}`;
1235
+ if (i18next.exists(localeKey)) return String(i18next.t(localeKey));
1236
+ return StringUtils.capitalize(key);
1237
+ };
1238
+ const overridePresetColumnsHeaders = (presetColumns, options) => {
1239
+ const namespace = options.namespace ?? DEFAULT_NAMESPACE;
1240
+ return presetColumns.map((columnDef) => {
1241
+ const localeKey = `${namespace}.${columnDef.id}`;
1242
+ const header = i18next.exists(localeKey) ? i18next.t(localeKey) : columnDef.header;
1243
+ return {
1244
+ ...columnDef,
1245
+ header: typeof header === "string" ? header : columnDef.header
1246
+ };
1247
+ });
1248
+ };
1249
+ const populateColumnDef = (schema, key, columnDef, options, sortableKeys) => {
1250
+ const id = columnDef.id ?? key;
1251
+ const enableSorting = columnDef.enableSorting ?? sortableKeys?.includes(id) ?? false;
1252
+ const header = columnDef.header ?? getDefaultColumnHeader(key, options);
1253
+ const cell = getCellFunction(schema, key, columnDef, options);
1254
+ return {
1255
+ ...columnDef,
1256
+ id,
1257
+ accessorKey: key,
1258
+ meta: {
1259
+ width: "flex-1",
1260
+ ...options.globalMeta,
1261
+ ...columnDef.meta
1262
+ },
1263
+ header,
1264
+ enableSorting,
1265
+ cell
1266
+ };
1267
+ };
1268
+ const populateCustomColumnDef = (schema, key, columnDef, options, sortableKeys) => {
1269
+ const id = columnDef.id ?? key;
1270
+ const accessorKey = columnDef.accessorKey ?? id;
1271
+ const enableSorting = columnDef.enableSorting ?? sortableKeys?.includes(id) ?? false;
1272
+ const header = columnDef.header ?? getDefaultColumnHeader(key, options);
1273
+ const cell = getCellFunction(schema, key, columnDef, options);
1274
+ return {
1275
+ ...columnDef,
1276
+ id,
1277
+ accessorKey,
1278
+ meta: {
1279
+ width: "flex-1",
1280
+ ...options.globalMeta,
1281
+ ...columnDef.meta
1282
+ },
1283
+ header,
1284
+ enableSorting,
1285
+ cell
1286
+ };
1287
+ };
1288
+ const addMissingSchemaFields = (schema, existingColumns, options, sortableKeys) => {
1289
+ const schemaFields = getAllSchemaKeys(schema);
1290
+ const definedFields = new Set(existingColumns.map((col) => col.id));
1291
+ const additionalColumns = schemaFields.filter((field) => !definedFields.has(field)).map((field) => {
1292
+ return populateColumnDef(schema, field, {}, options, sortableKeys);
1293
+ });
1294
+ return [...existingColumns, ...additionalColumns];
1295
+ };
1296
+ const removeOverriddenPresetColumns = (presetColumns, options) => {
1297
+ if (presetColumns.length === 0) return presetColumns;
1298
+ const usedColumnsIds = Object.entries(options.columns ?? {}).map(([key, value]) => {
1299
+ return value.id ?? key;
1300
+ });
1301
+ const usedCustomColumnsIds = Object.entries(options.customColumns ?? {}).map(([key, value]) => {
1302
+ return value.id ?? key;
1303
+ });
1304
+ const usedIds = /* @__PURE__ */ new Set([...usedColumnsIds, ...usedCustomColumnsIds]);
1305
+ return presetColumns.filter((column) => {
1306
+ if (!column.id) return true;
1307
+ return !usedIds.has(column.id);
1308
+ });
1309
+ };
1310
+ const getAllSchemaKeys = (schema) => {
1311
+ const keys = [];
1312
+ const { shape } = schema;
1313
+ const traverse = (obj, prefix = "") => {
1314
+ Object.entries(obj).forEach(([key, value]) => {
1315
+ const currentPath = prefix ? `${prefix}.${key}` : key;
1316
+ keys.push(currentPath);
1317
+ if (value instanceof ZodObject) traverse(value.shape, currentPath);
1318
+ });
1319
+ };
1320
+ traverse(shape);
1321
+ return keys;
1322
+ };
1323
+ const validateCustomColumnKeys = (schema, customColumnKeys) => {
1324
+ const schemaKeys = getAllSchemaKeys(schema);
1325
+ const invalidCustomColumnKeys = customColumnKeys.filter((key) => schemaKeys.includes(key));
1326
+ if (invalidCustomColumnKeys.length > 0) throw new Error(`Invalid custom column keys: [${invalidCustomColumnKeys.join(", ")}]. Custom column keys cannot be part of the schema. Define these columns in the "columns" property instead.`);
1327
+ };
1328
+ const validateOptionKeyArray = (usedKeys, optionKeys, optionName) => {
1329
+ if (!optionKeys) return;
1330
+ const extraUnusedKeys = optionKeys.filter((key) => !usedKeys.has(key));
1331
+ if (extraUnusedKeys.length > 0) throw new Error(`Found unnecessary keys in "${optionName}": [${extraUnusedKeys.join(", ")}].\n\nAll available options are: [${Array.from(usedKeys).join(", ")}].`);
1332
+ };
1333
+ const validateParams = (schema, presetColumns, options) => {
1334
+ const { columns, customColumns, sortable, order, disableFormatting, includeAll } = options;
1335
+ const columnKeys = Object.keys(columns ?? {});
1336
+ const customColumnKeys = customColumns ? Object.keys(customColumns) : [];
1337
+ const usedKeys = /* @__PURE__ */ new Set([...columnKeys, ...customColumnKeys]);
1338
+ const presetKeys = presetColumns.map((column) => column.id).filter((id) => id !== void 0);
1339
+ const schemaKeys = includeAll ? getAllSchemaKeys(schema) : [];
1340
+ const allKeys = /* @__PURE__ */ new Set([
1341
+ ...presetKeys,
1342
+ ...usedKeys,
1343
+ ...schemaKeys,
1344
+ "*"
1345
+ ]);
1346
+ if (customColumns) validateCustomColumnKeys(schema, customColumnKeys);
1347
+ if (Array.isArray(sortable)) validateOptionKeyArray(usedKeys, sortable, "sortable");
1348
+ validateOptionKeyArray(allKeys, order, "order");
1349
+ validateOptionKeyArray(usedKeys, disableFormatting, "disableFormatting");
1350
+ };
1351
+ const dynamicColumns = ({ schema, preset = [], options }) => {
1352
+ validateParams(schema, preset, options);
1353
+ const sortableKeys = normalizeSortable(options.sortable);
1354
+ let entries = Object.entries(options.columns ?? {});
1355
+ entries = excludeEntries(entries);
1356
+ entries = convertEntriesToColumnDefs(entries);
1357
+ const columns = entries.map(([key, value]) => {
1358
+ return populateColumnDef(schema, key, value, options, sortableKeys);
1359
+ });
1360
+ let customEntries = Object.entries(options.customColumns ?? {});
1361
+ customEntries = convertCustomEntriesToColumnDefs(customEntries);
1362
+ const customColumns = customEntries.map(([key, value]) => {
1363
+ return populateCustomColumnDef(schema, key, value, options, sortableKeys);
1364
+ });
1365
+ let presetColumns = removeOverriddenPresetColumns(preset, options);
1366
+ if (options.overridePresetLocales) presetColumns = overridePresetColumnsHeaders(presetColumns, options);
1367
+ const mergedColumns = [
1368
+ ...presetColumns,
1369
+ ...columns,
1370
+ ...customColumns
1371
+ ];
1372
+ const allColumns = options.includeAll ? addMissingSchemaFields(schema, mergedColumns, options, sortableKeys) : mergedColumns;
1373
+ return sortColumns(allColumns, options.order);
1374
+ };
1375
+ //#endregion
1376
+ //#region src/hooks/usePagination.ts
1377
+ const DEFAULT_STATE = {
1378
+ pageIndex: 1,
1379
+ pageSize: 20
1380
+ };
1381
+ function usePagination(defaultPagination) {
1382
+ const $ = c(12);
1383
+ const { replace, searchParams } = UIRouter.useUIRouter();
1384
+ let t0;
1385
+ if ($[0] !== defaultPagination || $[1] !== searchParams) {
1386
+ t0 = defaultPagination ?? {
1387
+ pageIndex: searchParams.has("page") ? Number.parseInt(searchParams.get("page") ?? "", 10) : DEFAULT_STATE.pageIndex,
1388
+ pageSize: searchParams.has("size") ? Number.parseInt(searchParams.get("size") ?? "", 10) : DEFAULT_STATE.pageSize
1389
+ };
1390
+ $[0] = defaultPagination;
1391
+ $[1] = searchParams;
1392
+ $[2] = t0;
1393
+ } else t0 = $[2];
1394
+ const [pagination, setPagination] = useState(t0);
1395
+ let t1;
1396
+ if ($[3] !== pagination.pageIndex || $[4] !== pagination.pageSize || $[5] !== replace || $[6] !== searchParams) {
1397
+ t1 = () => {
1398
+ const params = new URLSearchParams(searchParams);
1399
+ params.delete("size");
1400
+ params.delete("page");
1401
+ if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
1402
+ if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", pagination.pageIndex.toString());
1403
+ if (params.toString() === searchParams.toString()) return;
1404
+ replace(".", RoutingUtils.toRouterSearch(params));
1405
+ };
1406
+ $[3] = pagination.pageIndex;
1407
+ $[4] = pagination.pageSize;
1408
+ $[5] = replace;
1409
+ $[6] = searchParams;
1410
+ $[7] = t1;
1411
+ } else t1 = $[7];
1412
+ let t2;
1413
+ if ($[8] !== pagination) {
1414
+ t2 = [pagination];
1415
+ $[8] = pagination;
1416
+ $[9] = t2;
1417
+ } else t2 = $[9];
1418
+ useEffect(t1, t2);
1419
+ let t3;
1420
+ if ($[10] !== pagination) {
1421
+ t3 = {
1422
+ pagination,
1423
+ setPagination,
1424
+ pageIndex: pagination.pageIndex,
1425
+ pageSize: pagination.pageSize
1426
+ };
1427
+ $[10] = pagination;
1428
+ $[11] = t3;
1429
+ } else t3 = $[11];
1430
+ return t3;
1431
+ }
1432
+ //#endregion
1433
+ //#region src/hooks/useSorting.ts
1434
+ function useSorting(defaultSorting, t0) {
1435
+ const $ = c(16);
1436
+ const prefix = t0 === void 0 ? "" : t0;
1437
+ const { replace, searchParams } = UIRouter.useUIRouter();
1438
+ let t1;
1439
+ if ($[0] !== defaultSorting || $[1] !== prefix || $[2] !== searchParams) {
1440
+ t1 = defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map(_temp$1) ?? [];
1441
+ $[0] = defaultSorting;
1442
+ $[1] = prefix;
1443
+ $[2] = searchParams;
1444
+ $[3] = t1;
1445
+ } else t1 = $[3];
1446
+ const [sorting, setSorting] = useState(t1);
1447
+ let t2;
1448
+ if ($[4] !== sorting) {
1449
+ t2 = sorting.map(_temp2$1).join(",");
1450
+ $[4] = sorting;
1451
+ $[5] = t2;
1452
+ } else t2 = $[5];
1453
+ const order = t2;
1454
+ let t3;
1455
+ if ($[6] !== order || $[7] !== prefix || $[8] !== replace || $[9] !== searchParams) {
1456
+ t3 = () => {
1457
+ const params = new URLSearchParams(searchParams);
1458
+ const orderKey = prefix ? `order-${prefix}` : "order";
1459
+ params.delete(orderKey);
1460
+ if (order) params.set(orderKey, order);
1461
+ if (params.toString() === searchParams.toString()) return;
1462
+ replace(".", RoutingUtils.toRouterSearch(params));
1463
+ };
1464
+ $[6] = order;
1465
+ $[7] = prefix;
1466
+ $[8] = replace;
1467
+ $[9] = searchParams;
1468
+ $[10] = t3;
1469
+ } else t3 = $[10];
1470
+ let t4;
1471
+ if ($[11] !== order) {
1472
+ t4 = [order];
1473
+ $[11] = order;
1474
+ $[12] = t4;
1475
+ } else t4 = $[12];
1476
+ useEffect(t3, t4);
1477
+ let t5;
1478
+ if ($[13] !== order || $[14] !== sorting) {
1479
+ t5 = {
1480
+ sorting,
1481
+ setSorting,
1482
+ order
1483
+ };
1484
+ $[13] = order;
1485
+ $[14] = sorting;
1486
+ $[15] = t5;
1487
+ } else t5 = $[15];
1488
+ return t5;
1489
+ }
1490
+ function _temp2$1(field) {
1491
+ return `${field.desc ? "-" : "+"}${field.id}`;
1492
+ }
1493
+ function _temp$1(item) {
1494
+ if (item.startsWith("-")) return {
1495
+ id: item.slice(1),
1496
+ desc: true
1497
+ };
1498
+ if (item.startsWith("+")) return {
1499
+ id: item.slice(1),
1500
+ desc: false
1501
+ };
1502
+ return {
1503
+ id: item,
1504
+ desc: false
1505
+ };
1506
+ }
1507
+ //#endregion
1508
+ //#region src/hooks/useTableColumnConfig.ts
1509
+ function sortByKeyOrder(data, orderedKeys = []) {
1510
+ return [...data].sort((a, b) => {
1511
+ return orderedKeys.findIndex((key) => key === (a.id ?? a.accessorKey)) - orderedKeys.findIndex((key) => key === (b.id ?? b.accessorKey));
1512
+ });
1513
+ }
1514
+ function useTableColumnConfig(defaultColumns, t0) {
1515
+ const $ = c(31);
1516
+ let t1;
1517
+ if ($[0] !== t0) {
1518
+ t1 = t0 === void 0 ? {} : t0;
1519
+ $[0] = t0;
1520
+ $[1] = t1;
1521
+ } else t1 = $[1];
1522
+ const options = t1;
1523
+ let t2;
1524
+ if ($[2] !== defaultColumns) {
1525
+ t2 = () => defaultColumns.reduce(_temp, {});
1526
+ $[2] = defaultColumns;
1527
+ $[3] = t2;
1528
+ } else t2 = $[3];
1529
+ const [internalVisibleColumns, setInternalVisibleColumns] = useState(t2);
1530
+ let t3;
1531
+ if ($[4] !== defaultColumns) {
1532
+ t3 = () => defaultColumns.map(_temp2);
1533
+ $[4] = defaultColumns;
1534
+ $[5] = t3;
1535
+ } else t3 = $[5];
1536
+ const [internalColumnOrder, setInternalColumnOrder] = useState(t3);
1537
+ let t4;
1538
+ let t5;
1539
+ if ($[6] !== options.visibleColumns) {
1540
+ t4 = () => {
1541
+ if (options.visibleColumns) setInternalVisibleColumns(options.visibleColumns);
1542
+ };
1543
+ t5 = [options.visibleColumns];
1544
+ $[6] = options.visibleColumns;
1545
+ $[7] = t4;
1546
+ $[8] = t5;
1547
+ } else {
1548
+ t4 = $[7];
1549
+ t5 = $[8];
1550
+ }
1551
+ useEffect(t4, t5);
1552
+ let t6;
1553
+ let t7;
1554
+ if ($[9] !== options.columnOrder) {
1555
+ t6 = () => {
1556
+ if (options.columnOrder) setInternalColumnOrder(options.columnOrder);
1557
+ };
1558
+ t7 = [options.columnOrder];
1559
+ $[9] = options.columnOrder;
1560
+ $[10] = t6;
1561
+ $[11] = t7;
1562
+ } else {
1563
+ t6 = $[10];
1564
+ t7 = $[11];
1565
+ }
1566
+ useEffect(t6, t7);
1567
+ let t8;
1568
+ if ($[12] !== options) {
1569
+ t8 = (value) => {
1570
+ setInternalVisibleColumns(value);
1571
+ options?.onVisibilityChange?.(value);
1572
+ };
1573
+ $[12] = options;
1574
+ $[13] = t8;
1575
+ } else t8 = $[13];
1576
+ const handleVisibilityChange = t8;
1577
+ let t9;
1578
+ if ($[14] !== options) {
1579
+ t9 = (value_0) => {
1580
+ setInternalColumnOrder(value_0);
1581
+ options?.onOrderChange?.(value_0);
1582
+ };
1583
+ $[14] = options;
1584
+ $[15] = t9;
1585
+ } else t9 = $[15];
1586
+ const handleOrderChange = t9;
1587
+ let t10;
1588
+ if ($[16] !== defaultColumns || $[17] !== internalColumnOrder) {
1589
+ t10 = sortByKeyOrder(defaultColumns, internalColumnOrder);
1590
+ $[16] = defaultColumns;
1591
+ $[17] = internalColumnOrder;
1592
+ $[18] = t10;
1593
+ } else t10 = $[18];
1594
+ const configColumns = t10;
1595
+ let t11;
1596
+ if ($[19] !== configColumns || $[20] !== internalVisibleColumns) {
1597
+ let t12;
1598
+ if ($[22] !== internalVisibleColumns) {
1599
+ t12 = (col_1) => internalVisibleColumns?.[col_1.id ?? col_1.accessorKey] ?? true;
1600
+ $[22] = internalVisibleColumns;
1601
+ $[23] = t12;
1602
+ } else t12 = $[23];
1603
+ t11 = configColumns.filter(t12);
1604
+ $[19] = configColumns;
1605
+ $[20] = internalVisibleColumns;
1606
+ $[21] = t11;
1607
+ } else t11 = $[21];
1608
+ const columns = t11;
1609
+ let t12;
1610
+ if ($[24] !== columns || $[25] !== configColumns || $[26] !== handleOrderChange || $[27] !== handleVisibilityChange || $[28] !== internalColumnOrder || $[29] !== internalVisibleColumns) {
1611
+ t12 = {
1612
+ configColumns,
1613
+ columns,
1614
+ visibleColumns: internalVisibleColumns,
1615
+ columnOrder: internalColumnOrder,
1616
+ onVisibilityChange: handleVisibilityChange,
1617
+ onOrderChange: handleOrderChange
1618
+ };
1619
+ $[24] = columns;
1620
+ $[25] = configColumns;
1621
+ $[26] = handleOrderChange;
1622
+ $[27] = handleVisibilityChange;
1623
+ $[28] = internalColumnOrder;
1624
+ $[29] = internalVisibleColumns;
1625
+ $[30] = t12;
1626
+ } else t12 = $[30];
1627
+ return t12;
1628
+ }
1629
+ function _temp2(col_0) {
1630
+ return col_0.id ?? col_0.accessorKey;
1631
+ }
1632
+ function _temp(acc, col) {
1633
+ const key = col.id ?? col.accessorKey;
1634
+ acc[key] = true;
1635
+ return acc;
1636
+ }
1637
+ //#endregion
1638
+ export { tableRowDefinition as _, PaginatedTable as a, Table$1 as c, CellText as d, tableCellTextDefinition as f, tableHeaderTextDefinition as g, tableHeadRowDefinition as h, dynamicColumns as i, useTableNav as l, tableHeadDataDefinition as m, useSorting as n, InfiniteTable as o, tableDataDefinition as p, usePagination as r, ColumnConfigModal as s, useTableColumnConfig as t, HeaderText as u };