@techzyapp/ui-library 1.0.40 → 1.0.42

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 (546) hide show
  1. package/README.md +14 -8
  2. package/dist/AdminRoot-DufZpgdm.js +100 -0
  3. package/dist/AdminRoot-DufZpgdm.js.map +1 -0
  4. package/dist/AdminRoot-DwJ5jdXr.cjs +2 -0
  5. package/dist/AdminRoot-DwJ5jdXr.cjs.map +1 -0
  6. package/dist/Alert-C8BBxL_7.cjs +2 -0
  7. package/dist/Alert-C8BBxL_7.cjs.map +1 -0
  8. package/dist/Alert-D6oBxBdP.js +70 -0
  9. package/dist/Alert-D6oBxBdP.js.map +1 -0
  10. package/dist/AuthLayout-exuNQicH.cjs.map +1 -1
  11. package/dist/AuthLayout-q8pbCGdt.js.map +1 -1
  12. package/dist/{Breadcrumbs-hi6dJhfN.cjs → Breadcrumbs-B-olYVdw.cjs} +2 -2
  13. package/dist/Breadcrumbs-B-olYVdw.cjs.map +1 -0
  14. package/dist/{Breadcrumbs-Dqhk-dY2.js → Breadcrumbs-cXET6OM5.js} +3 -3
  15. package/dist/Breadcrumbs-cXET6OM5.js.map +1 -0
  16. package/dist/{Button-Bst_NtPJ.js → Button-0ZgdNjX-.js} +2 -2
  17. package/dist/{Button-Bst_NtPJ.js.map → Button-0ZgdNjX-.js.map} +1 -1
  18. package/dist/{Button-CYZoF18-.cjs → Button-CwrDiZek.cjs} +2 -2
  19. package/dist/{Button-CYZoF18-.cjs.map → Button-CwrDiZek.cjs.map} +1 -1
  20. package/dist/{Calendar-OYXsfuWz.js → Calendar-CxzdnzdK.js} +3 -3
  21. package/dist/{Calendar-OYXsfuWz.js.map → Calendar-CxzdnzdK.js.map} +1 -1
  22. package/dist/{Calendar-CMNBHtvY.cjs → Calendar-d3CX5UJp.cjs} +2 -2
  23. package/dist/{Calendar-CMNBHtvY.cjs.map → Calendar-d3CX5UJp.cjs.map} +1 -1
  24. package/dist/Card-CjqStov5.js +129 -0
  25. package/dist/Card-CjqStov5.js.map +1 -0
  26. package/dist/Card-CxnUoWsi.cjs +2 -0
  27. package/dist/Card-CxnUoWsi.cjs.map +1 -0
  28. package/dist/{Chip-B7cAHjlx.cjs → Chip-BkU3yx6G.cjs} +2 -2
  29. package/dist/Chip-BkU3yx6G.cjs.map +1 -0
  30. package/dist/{Chip-D5ZZs3QH.js → Chip-CzJjbaKx.js} +2 -2
  31. package/dist/Chip-CzJjbaKx.js.map +1 -0
  32. package/dist/ChoiceCardGroup-C7Eengyd.cjs +2 -0
  33. package/dist/ChoiceCardGroup-C7Eengyd.cjs.map +1 -0
  34. package/dist/ChoiceCardGroup-q0yN-TeQ.js +180 -0
  35. package/dist/{ChoiceCardGroup-143hR0v_.cjs.map → ChoiceCardGroup-q0yN-TeQ.js.map} +1 -1
  36. package/dist/{CodeBlock-DrWRSRmO.js → CodeBlock-BHcvQrs9.js} +3 -3
  37. package/dist/CodeBlock-BHcvQrs9.js.map +1 -0
  38. package/dist/{CodeBlock-C3mG_seZ.cjs → CodeBlock-DRBQ_S5t.cjs} +2 -2
  39. package/dist/CodeBlock-DRBQ_S5t.cjs.map +1 -0
  40. package/dist/{ColorPicker-w7NdprlW.js → ColorPicker-BQKFdTNr.js} +51 -51
  41. package/dist/{ColorPicker-w7NdprlW.js.map → ColorPicker-BQKFdTNr.js.map} +1 -1
  42. package/dist/ColorPicker-BzCEMN7B.cjs +2 -0
  43. package/dist/{ColorPicker-C1pDI4su.cjs.map → ColorPicker-BzCEMN7B.cjs.map} +1 -1
  44. package/dist/{ColorPickerPanel-CKMd-dqd.js → ColorPickerPanel-DKTKC9KH.js} +2 -2
  45. package/dist/{ColorPickerPanel-CKMd-dqd.js.map → ColorPickerPanel-DKTKC9KH.js.map} +1 -1
  46. package/dist/{ColorPickerPanel-BbgujQ3X.cjs → ColorPickerPanel-kl2jUix-.cjs} +2 -2
  47. package/dist/{ColorPickerPanel-BbgujQ3X.cjs.map → ColorPickerPanel-kl2jUix-.cjs.map} +1 -1
  48. package/dist/{ColorRamp-D9_5JULy.cjs → ColorRamp-n7muILK3.cjs} +2 -2
  49. package/dist/{ColorRamp-D9_5JULy.cjs.map → ColorRamp-n7muILK3.cjs.map} +1 -1
  50. package/dist/{ColorRamp-Mp_ddhmb.js → ColorRamp-yfMyJCyx.js} +2 -2
  51. package/dist/{ColorRamp-Mp_ddhmb.js.map → ColorRamp-yfMyJCyx.js.map} +1 -1
  52. package/dist/ConfigProvider-BaiTKZKC.cjs +2 -0
  53. package/dist/ConfigProvider-BaiTKZKC.cjs.map +1 -0
  54. package/dist/ConfigProvider-D61cpCz-.js +379 -0
  55. package/dist/ConfigProvider-D61cpCz-.js.map +1 -0
  56. package/dist/{CopyButton-DZeYcG68.cjs → CopyButton-DlSi82gv.cjs} +2 -2
  57. package/dist/{CopyButton-DZeYcG68.cjs.map → CopyButton-DlSi82gv.cjs.map} +1 -1
  58. package/dist/{CopyButton-Yg5ZVTiX.js → CopyButton-ecxn-ghi.js} +3 -3
  59. package/dist/{CopyButton-Yg5ZVTiX.js.map → CopyButton-ecxn-ghi.js.map} +1 -1
  60. package/dist/DatePicker-BjZ_P21i.cjs +2 -0
  61. package/dist/{DatePicker-CXRsT-lt.cjs.map → DatePicker-BjZ_P21i.cjs.map} +1 -1
  62. package/dist/{DatePicker-BMJlfCKB.js → DatePicker-CAGpJbDi.js} +42 -42
  63. package/dist/{DatePicker-BMJlfCKB.js.map → DatePicker-CAGpJbDi.js.map} +1 -1
  64. package/dist/{DateTimePicker-B-Jjejzm.js → DateTimePicker-BJmF0Su6.js} +50 -50
  65. package/dist/DateTimePicker-BJmF0Su6.js.map +1 -0
  66. package/dist/DateTimePicker-DZqWQeUL.cjs +2 -0
  67. package/dist/DateTimePicker-DZqWQeUL.cjs.map +1 -0
  68. package/dist/{DescriptionList-S9C6Tp90.cjs → DescriptionList-CvPDn-kh.cjs} +2 -2
  69. package/dist/DescriptionList-CvPDn-kh.cjs.map +1 -0
  70. package/dist/{DescriptionList-CG08_qwT.js → DescriptionList-Knq5eCiY.js} +4 -4
  71. package/dist/DescriptionList-Knq5eCiY.js.map +1 -0
  72. package/dist/{Dropdown-DYYhzKSo.cjs → Dropdown-CMjURWYd.cjs} +2 -2
  73. package/dist/{Dropdown-DYYhzKSo.cjs.map → Dropdown-CMjURWYd.cjs.map} +1 -1
  74. package/dist/{Dropdown-CcC-Hwx4.js → Dropdown-CnDBlB02.js} +2 -2
  75. package/dist/{Dropdown-CcC-Hwx4.js.map → Dropdown-CnDBlB02.js.map} +1 -1
  76. package/dist/{EmptyState-DnGds1ch.cjs → EmptyState-CX1g47y_.cjs} +2 -2
  77. package/dist/{EmptyState-DnGds1ch.cjs.map → EmptyState-CX1g47y_.cjs.map} +1 -1
  78. package/dist/{EmptyState-BCoPw8jf.js → EmptyState-Dqtpmtje.js} +2 -2
  79. package/dist/{EmptyState-BCoPw8jf.js.map → EmptyState-Dqtpmtje.js.map} +1 -1
  80. package/dist/{ErrorBoundary-JCNa0_Ys.cjs → ErrorBoundary-B8KwWXXp.cjs} +2 -2
  81. package/dist/{ErrorBoundary-JCNa0_Ys.cjs.map → ErrorBoundary-B8KwWXXp.cjs.map} +1 -1
  82. package/dist/{ErrorBoundary-BILk_3fM.js → ErrorBoundary-Dos7VLb-.js} +3 -3
  83. package/dist/{ErrorBoundary-BILk_3fM.js.map → ErrorBoundary-Dos7VLb-.js.map} +1 -1
  84. package/dist/{ErrorState-MQBeyF2n.cjs → ErrorState-CwCqd2PU.cjs} +2 -2
  85. package/dist/{ErrorState-MQBeyF2n.cjs.map → ErrorState-CwCqd2PU.cjs.map} +1 -1
  86. package/dist/{ErrorState-DI28ZCJN.js → ErrorState-KhzrGIJ-.js} +7 -7
  87. package/dist/{ErrorState-DI28ZCJN.js.map → ErrorState-KhzrGIJ-.js.map} +1 -1
  88. package/dist/{FileCard-Cl88Gu6L.cjs → FileCard-DEc10T2G.cjs} +2 -2
  89. package/dist/FileCard-DEc10T2G.cjs.map +1 -0
  90. package/dist/{FileCard-5QvVkO1-.js → FileCard-SSuFS13E.js} +3 -3
  91. package/dist/FileCard-SSuFS13E.js.map +1 -0
  92. package/dist/{FileUploader-FMVbj7rz.cjs → FileUploader-D58_6kDA.cjs} +2 -2
  93. package/dist/FileUploader-D58_6kDA.cjs.map +1 -0
  94. package/dist/{FileUploader-DwAl3UXI.js → FileUploader-DfYOBFa4.js} +5 -5
  95. package/dist/FileUploader-DfYOBFa4.js.map +1 -0
  96. package/dist/{Flag-Do7x-AhS.cjs → Flag-B1ZvZVXi.cjs} +2 -2
  97. package/dist/{Flag-Do7x-AhS.cjs.map → Flag-B1ZvZVXi.cjs.map} +1 -1
  98. package/dist/{Flag-DfA2t0yd.js → Flag-BEIqYQZg.js} +2 -2
  99. package/dist/{Flag-DfA2t0yd.js.map → Flag-BEIqYQZg.js.map} +1 -1
  100. package/dist/FloatingPanel-C5c_eMQ0.js.map +1 -1
  101. package/dist/FloatingPanel-tGCG2nhA.cjs.map +1 -1
  102. package/dist/{FullscreenToggle-DM6wWZ1a.js → FullscreenToggle-I_In47BB.js} +3 -3
  103. package/dist/{FullscreenToggle-DM6wWZ1a.js.map → FullscreenToggle-I_In47BB.js.map} +1 -1
  104. package/dist/{FullscreenToggle-Bbb_z2xj.cjs → FullscreenToggle-Po769CoC.cjs} +2 -2
  105. package/dist/{FullscreenToggle-Bbb_z2xj.cjs.map → FullscreenToggle-Po769CoC.cjs.map} +1 -1
  106. package/dist/{IconButton-CQ25TtBc.cjs → IconButton-CxSXEYce.cjs} +2 -2
  107. package/dist/{IconButton-CQ25TtBc.cjs.map → IconButton-CxSXEYce.cjs.map} +1 -1
  108. package/dist/{IconButton-06pmftMo.js → IconButton-D9MCwRK_.js} +2 -2
  109. package/dist/{IconButton-06pmftMo.js.map → IconButton-D9MCwRK_.js.map} +1 -1
  110. package/dist/{List-CwuAJDTi.js → List-2Y3ktTcF.js} +2 -2
  111. package/dist/{List-CwuAJDTi.js.map → List-2Y3ktTcF.js.map} +1 -1
  112. package/dist/{List-B5Ppe9R1.cjs → List-CKoNx21F.cjs} +2 -2
  113. package/dist/{List-B5Ppe9R1.cjs.map → List-CKoNx21F.cjs.map} +1 -1
  114. package/dist/{ListItem-BWNIbyTh.js → ListItem-2Lr5_NRY.js} +15 -15
  115. package/dist/{ListItem-BWNIbyTh.js.map → ListItem-2Lr5_NRY.js.map} +1 -1
  116. package/dist/ListItem-DkCYXucd.cjs +2 -0
  117. package/dist/{ListItem-Qo1Tt6Fi.cjs.map → ListItem-DkCYXucd.cjs.map} +1 -1
  118. package/dist/{Loader-B5Pm8AaT.cjs → Loader-5zp2MPm5.cjs} +2 -2
  119. package/dist/{Loader-B5Pm8AaT.cjs.map → Loader-5zp2MPm5.cjs.map} +1 -1
  120. package/dist/{Loader-Bj5uwVR9.js → Loader-Bluu6z0-.js} +2 -2
  121. package/dist/{Loader-Bj5uwVR9.js.map → Loader-Bluu6z0-.js.map} +1 -1
  122. package/dist/{LocationPicker-D-sT4rSe.cjs → LocationPicker-CGHXTIml.cjs} +2 -2
  123. package/dist/{LocationPicker-D-sT4rSe.cjs.map → LocationPicker-CGHXTIml.cjs.map} +1 -1
  124. package/dist/{LocationPicker-Ce8aLubZ.js → LocationPicker-hULpHBVG.js} +7 -7
  125. package/dist/{LocationPicker-Ce8aLubZ.js.map → LocationPicker-hULpHBVG.js.map} +1 -1
  126. package/dist/{Modal-DTnB_mGg.js → Modal-C6Zgwz_6.js} +3 -3
  127. package/dist/Modal-C6Zgwz_6.js.map +1 -0
  128. package/dist/{Modal-DjSOhZqd.cjs → Modal-D9_OG53G.cjs} +2 -2
  129. package/dist/Modal-D9_OG53G.cjs.map +1 -0
  130. package/dist/{MultiSelect-C4RvohFY.cjs → MultiSelect-BdPvjiTj.cjs} +2 -2
  131. package/dist/{MultiSelect-C4RvohFY.cjs.map → MultiSelect-BdPvjiTj.cjs.map} +1 -1
  132. package/dist/{MultiSelect-Dn8l5z52.js → MultiSelect-CHLMpim4.js} +4 -4
  133. package/dist/{MultiSelect-Dn8l5z52.js.map → MultiSelect-CHLMpim4.js.map} +1 -1
  134. package/dist/{NumberField-DvQ5UP1R.js → NumberField-BlpFmetF.js} +3 -3
  135. package/dist/{NumberField-DvQ5UP1R.js.map → NumberField-BlpFmetF.js.map} +1 -1
  136. package/dist/{NumberField-C3TLdAgT.cjs → NumberField-C-FZ-uRI.cjs} +2 -2
  137. package/dist/{NumberField-C3TLdAgT.cjs.map → NumberField-C-FZ-uRI.cjs.map} +1 -1
  138. package/dist/OtpField-D4-r7I0A.js +174 -0
  139. package/dist/OtpField-D4-r7I0A.js.map +1 -0
  140. package/dist/OtpField-Drjy2wwq.cjs +2 -0
  141. package/dist/OtpField-Drjy2wwq.cjs.map +1 -0
  142. package/dist/{PageError-aUV0vUfB.cjs → PageError-DXUOkE14.cjs} +2 -2
  143. package/dist/{PageError-aUV0vUfB.cjs.map → PageError-DXUOkE14.cjs.map} +1 -1
  144. package/dist/{PageError-BORFaxGW.js → PageError-DyDj1wQZ.js} +5 -5
  145. package/dist/{PageError-BORFaxGW.js.map → PageError-DyDj1wQZ.js.map} +1 -1
  146. package/dist/{PageLayout-rtEl8uqS.cjs → PageLayout-CoG0AaUs.cjs} +2 -2
  147. package/dist/PageLayout-CoG0AaUs.cjs.map +1 -0
  148. package/dist/{PageLayout-ojiBEcxI.js → PageLayout-nsJa8CbT.js} +4 -4
  149. package/dist/PageLayout-nsJa8CbT.js.map +1 -0
  150. package/dist/{PageNotFound-D536Tshv.js → PageNotFound-BNNwMkwE.js} +5 -5
  151. package/dist/{PageNotFound-D536Tshv.js.map → PageNotFound-BNNwMkwE.js.map} +1 -1
  152. package/dist/{PageNotFound-f-dxrnol.cjs → PageNotFound-CGSxT_n9.cjs} +2 -2
  153. package/dist/{PageNotFound-f-dxrnol.cjs.map → PageNotFound-CGSxT_n9.cjs.map} +1 -1
  154. package/dist/Pagination-CZtewveA.cjs +2 -0
  155. package/dist/Pagination-CZtewveA.cjs.map +1 -0
  156. package/dist/Pagination-tuWRnGwR.js +139 -0
  157. package/dist/Pagination-tuWRnGwR.js.map +1 -0
  158. package/dist/PaletteField-CTPl3D43.js +56 -0
  159. package/dist/PaletteField-CTPl3D43.js.map +1 -0
  160. package/dist/PaletteField-PDcu2vUp.cjs +2 -0
  161. package/dist/PaletteField-PDcu2vUp.cjs.map +1 -0
  162. package/dist/{PhoneField-DzLTXJcw.cjs → PhoneField-BPYg5ZHW.cjs} +2 -2
  163. package/dist/{PhoneField-DzLTXJcw.cjs.map → PhoneField-BPYg5ZHW.cjs.map} +1 -1
  164. package/dist/{PhoneField-CjYw-Unw.js → PhoneField-pdWDCszb.js} +4 -4
  165. package/dist/{PhoneField-CjYw-Unw.js.map → PhoneField-pdWDCszb.js.map} +1 -1
  166. package/dist/{Popconfirm-B3GhhrRM.js → Popconfirm-CMVzLaC_.js} +3 -3
  167. package/dist/{Popconfirm-B3GhhrRM.js.map → Popconfirm-CMVzLaC_.js.map} +1 -1
  168. package/dist/{Popconfirm-CYc8ywDI.cjs → Popconfirm-cNpJmkuR.cjs} +2 -2
  169. package/dist/{Popconfirm-CYc8ywDI.cjs.map → Popconfirm-cNpJmkuR.cjs.map} +1 -1
  170. package/dist/Popover-DsYUT23r.cjs.map +1 -1
  171. package/dist/Popover-WaVH3jsN.js.map +1 -1
  172. package/dist/{Progress-ZNQrxw_Q.js → Progress-BNEFGn-O.js} +2 -2
  173. package/dist/{Progress-ZNQrxw_Q.js.map → Progress-BNEFGn-O.js.map} +1 -1
  174. package/dist/{Progress-BABBBG2y.cjs → Progress-x12Rkh06.cjs} +2 -2
  175. package/dist/{Progress-BABBBG2y.cjs.map → Progress-x12Rkh06.cjs.map} +1 -1
  176. package/dist/QrCode-CrNJZV_8.js +81 -0
  177. package/dist/QrCode-CrNJZV_8.js.map +1 -0
  178. package/dist/QrCode-TcQQE0h7.cjs +2 -0
  179. package/dist/QrCode-TcQQE0h7.cjs.map +1 -0
  180. package/dist/{RemoveDialog-ayAfGXpB.js → RemoveDialog-ARFp1UJM.js} +5 -5
  181. package/dist/{RemoveDialog-ayAfGXpB.js.map → RemoveDialog-ARFp1UJM.js.map} +1 -1
  182. package/dist/{RemoveDialog-B_Y18MeJ.cjs → RemoveDialog-IWOAQFNK.cjs} +2 -2
  183. package/dist/{RemoveDialog-B_Y18MeJ.cjs.map → RemoveDialog-IWOAQFNK.cjs.map} +1 -1
  184. package/dist/RichTextEditor-C9jT2cLl.cjs +2 -0
  185. package/dist/RichTextEditor-C9jT2cLl.cjs.map +1 -0
  186. package/dist/{RichTextEditor-itYD1PfE.js → RichTextEditor-DrwJUEYz.js} +148 -148
  187. package/dist/RichTextEditor-DrwJUEYz.js.map +1 -0
  188. package/dist/RootLayout-CZ2GQ8XA.js +647 -0
  189. package/dist/RootLayout-CZ2GQ8XA.js.map +1 -0
  190. package/dist/RootLayout-DStUP263.cjs +2 -0
  191. package/dist/RootLayout-DStUP263.cjs.map +1 -0
  192. package/dist/{Select-1FWkryTK.cjs → Select-C2DIfuoB.cjs} +2 -2
  193. package/dist/{Select-1FWkryTK.cjs.map → Select-C2DIfuoB.cjs.map} +1 -1
  194. package/dist/{Select-K0a_7ROf.js → Select-KGsA8PbI.js} +3 -3
  195. package/dist/{Select-K0a_7ROf.js.map → Select-KGsA8PbI.js.map} +1 -1
  196. package/dist/{Sidebar-Dg15hPpM.js → Sidebar-_pcwxdd8.js} +133 -131
  197. package/dist/{Sidebar-Dg15hPpM.js.map → Sidebar-_pcwxdd8.js.map} +1 -1
  198. package/dist/Sidebar-wK1_xaY_.cjs +2 -0
  199. package/dist/{Sidebar-C3-u3Agj.cjs.map → Sidebar-wK1_xaY_.cjs.map} +1 -1
  200. package/dist/Slider-CXAz9SUY.cjs +2 -0
  201. package/dist/Slider-CXAz9SUY.cjs.map +1 -0
  202. package/dist/Slider-Cpc5_dPl.js +185 -0
  203. package/dist/Slider-Cpc5_dPl.js.map +1 -0
  204. package/dist/{SpeedDial-D6me6w_m.cjs → SpeedDial-BT_boD06.cjs} +2 -2
  205. package/dist/{SpeedDial-D6me6w_m.cjs.map → SpeedDial-BT_boD06.cjs.map} +1 -1
  206. package/dist/{SpeedDial-CEBAWIYo.js → SpeedDial-SMMfes9f.js} +2 -2
  207. package/dist/{SpeedDial-CEBAWIYo.js.map → SpeedDial-SMMfes9f.js.map} +1 -1
  208. package/dist/{Stepper-wPPs57uZ.cjs → Stepper-BmA_DjTS.cjs} +2 -2
  209. package/dist/Stepper-BmA_DjTS.cjs.map +1 -0
  210. package/dist/{Stepper-BN0GsRZW.js → Stepper-CR0Mlkq7.js} +2 -2
  211. package/dist/Stepper-CR0Mlkq7.js.map +1 -0
  212. package/dist/{Table-CFl3OYlo.cjs → Table-BkjY1Lwt.cjs} +2 -2
  213. package/dist/Table-BkjY1Lwt.cjs.map +1 -0
  214. package/dist/{Table-DChIfjqj.js → Table-D-F68lcm.js} +18 -18
  215. package/dist/Table-D-F68lcm.js.map +1 -0
  216. package/dist/{Tabs-BAKPWO4g.cjs → Tabs-Cgp6D1WP.cjs} +2 -2
  217. package/dist/{Tabs-BAKPWO4g.cjs.map → Tabs-Cgp6D1WP.cjs.map} +1 -1
  218. package/dist/{Tabs-DfVFgOfs.js → Tabs-DP0aZ5TB.js} +2 -2
  219. package/dist/{Tabs-DfVFgOfs.js.map → Tabs-DP0aZ5TB.js.map} +1 -1
  220. package/dist/TagsField-9nKu6ZW4.cjs +2 -0
  221. package/dist/TagsField-9nKu6ZW4.cjs.map +1 -0
  222. package/dist/{TagsField-CoBRqcjW.js → TagsField-CcY9MTMw.js} +64 -64
  223. package/dist/TagsField-CcY9MTMw.js.map +1 -0
  224. package/dist/{TextField-0gFvIFs8.js → TextField-0WvJsHhA.js} +3 -3
  225. package/dist/{TextField-0gFvIFs8.js.map → TextField-0WvJsHhA.js.map} +1 -1
  226. package/dist/{TextField-BL6OAJcP.cjs → TextField-C5MgCQIV.cjs} +2 -2
  227. package/dist/{TextField-BL6OAJcP.cjs.map → TextField-C5MgCQIV.cjs.map} +1 -1
  228. package/dist/{ThemeToggle-BgKfcb02.cjs → ThemeToggle-BvcCxRpF.cjs} +2 -2
  229. package/dist/{ThemeToggle-BgKfcb02.cjs.map → ThemeToggle-BvcCxRpF.cjs.map} +1 -1
  230. package/dist/ThemeToggle-DmCePuTy.js +28 -0
  231. package/dist/{ThemeToggle-_SUmLxmU.js.map → ThemeToggle-DmCePuTy.js.map} +1 -1
  232. package/dist/{TimeColumns-DkJsIu1w.cjs → TimeColumns-Q-vsHFZU.cjs} +2 -2
  233. package/dist/{TimeColumns-DkJsIu1w.cjs.map → TimeColumns-Q-vsHFZU.cjs.map} +1 -1
  234. package/dist/{TimeColumns-BE1sLoRV.js → TimeColumns-WJRHQuFv.js} +2 -2
  235. package/dist/{TimeColumns-BE1sLoRV.js.map → TimeColumns-WJRHQuFv.js.map} +1 -1
  236. package/dist/TimePicker-CvbQFzBf.cjs +2 -0
  237. package/dist/{TimePicker-6nHQx0P5.cjs.map → TimePicker-CvbQFzBf.cjs.map} +1 -1
  238. package/dist/{TimePicker-Bv2qIFf9.js → TimePicker-DJDuSxAg.js} +54 -54
  239. package/dist/{TimePicker-Bv2qIFf9.js.map → TimePicker-DJDuSxAg.js.map} +1 -1
  240. package/dist/{Toaster-Fq6-ImDJ.js → Toaster-Bb5YEN5j.js} +2 -2
  241. package/dist/{Toaster-Fq6-ImDJ.js.map → Toaster-Bb5YEN5j.js.map} +1 -1
  242. package/dist/{Toaster-Brcspf7v.cjs → Toaster-Dy1AonLa.cjs} +2 -2
  243. package/dist/{Toaster-Brcspf7v.cjs.map → Toaster-Dy1AonLa.cjs.map} +1 -1
  244. package/dist/TranslatedFields-CuK5KKzE.cjs +2 -0
  245. package/dist/TranslatedFields-CuK5KKzE.cjs.map +1 -0
  246. package/dist/TranslatedFields-DKXznBtD.js +86 -0
  247. package/dist/TranslatedFields-DKXznBtD.js.map +1 -0
  248. package/dist/{UserCard-1ubnvBV6.cjs → UserCard-DbudGMvG.cjs} +2 -2
  249. package/dist/UserCard-DbudGMvG.cjs.map +1 -0
  250. package/dist/{UserCard-DcTLEHFu.js → UserCard-UG_Cwe-Y.js} +3 -3
  251. package/dist/UserCard-UG_Cwe-Y.js.map +1 -0
  252. package/dist/app/AdminRoot.d.cts +13 -3
  253. package/dist/app/AdminRoot.d.ts +13 -3
  254. package/dist/components/Alert/Alert.d.cts +1 -1
  255. package/dist/components/Alert/Alert.d.ts +1 -1
  256. package/dist/components/Alert/index.cjs +1 -1
  257. package/dist/components/Alert/index.js +1 -1
  258. package/dist/components/AuthLayout/AuthLayout.d.cts +2 -2
  259. package/dist/components/AuthLayout/AuthLayout.d.ts +2 -2
  260. package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +2 -1
  261. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
  262. package/dist/components/Breadcrumbs/index.cjs +1 -1
  263. package/dist/components/Breadcrumbs/index.js +1 -1
  264. package/dist/components/Button/index.cjs +1 -1
  265. package/dist/components/Button/index.js +1 -1
  266. package/dist/components/Card/Card.d.cts +1 -1
  267. package/dist/components/Card/Card.d.ts +1 -1
  268. package/dist/components/Card/index.cjs +1 -1
  269. package/dist/components/Card/index.js +1 -1
  270. package/dist/components/Chip/Chip.d.cts +1 -1
  271. package/dist/components/Chip/Chip.d.ts +1 -1
  272. package/dist/components/Chip/index.cjs +1 -1
  273. package/dist/components/Chip/index.js +1 -1
  274. package/dist/components/ChoiceCard/ChoiceCard.d.cts +1 -1
  275. package/dist/components/ChoiceCard/ChoiceCard.d.ts +1 -1
  276. package/dist/components/ChoiceCard/index.cjs +1 -1
  277. package/dist/components/ChoiceCard/index.js +1 -1
  278. package/dist/components/CodeBlock/CodeBlock.d.cts +1 -1
  279. package/dist/components/CodeBlock/CodeBlock.d.ts +1 -1
  280. package/dist/components/CodeBlock/index.cjs +1 -1
  281. package/dist/components/CodeBlock/index.js +1 -1
  282. package/dist/components/ColorPicker/index.cjs +1 -1
  283. package/dist/components/ColorPicker/index.js +1 -1
  284. package/dist/components/ColorRamp/index.cjs +1 -1
  285. package/dist/components/ColorRamp/index.js +1 -1
  286. package/dist/components/CopyButton/index.cjs +1 -1
  287. package/dist/components/CopyButton/index.js +1 -1
  288. package/dist/components/DatePicker/index.cjs +1 -1
  289. package/dist/components/DatePicker/index.js +1 -1
  290. package/dist/components/DateTimePicker/DateTimePicker.d.cts +2 -2
  291. package/dist/components/DateTimePicker/DateTimePicker.d.ts +2 -2
  292. package/dist/components/DateTimePicker/index.cjs +1 -1
  293. package/dist/components/DateTimePicker/index.js +1 -1
  294. package/dist/components/DescriptionList/DescriptionList.d.cts +1 -1
  295. package/dist/components/DescriptionList/DescriptionList.d.ts +1 -1
  296. package/dist/components/DescriptionList/index.cjs +1 -1
  297. package/dist/components/DescriptionList/index.js +1 -1
  298. package/dist/components/Dropdown/index.cjs +1 -1
  299. package/dist/components/Dropdown/index.js +1 -1
  300. package/dist/components/EmptyState/index.cjs +1 -1
  301. package/dist/components/EmptyState/index.js +1 -1
  302. package/dist/components/ErrorState/index.cjs +1 -1
  303. package/dist/components/ErrorState/index.js +2 -2
  304. package/dist/components/FileCard/FileCard.d.cts +5 -2
  305. package/dist/components/FileCard/FileCard.d.ts +5 -2
  306. package/dist/components/FileCard/index.cjs +1 -1
  307. package/dist/components/FileCard/index.js +1 -1
  308. package/dist/components/FileUploader/FileUploader.d.cts +5 -5
  309. package/dist/components/FileUploader/FileUploader.d.ts +5 -5
  310. package/dist/components/FileUploader/index.cjs +1 -1
  311. package/dist/components/FileUploader/index.js +1 -1
  312. package/dist/components/Flag/index.cjs +1 -1
  313. package/dist/components/Flag/index.js +1 -1
  314. package/dist/components/FloatingPanel/FloatingPanel.d.cts +6 -5
  315. package/dist/components/FloatingPanel/FloatingPanel.d.ts +6 -5
  316. package/dist/components/FullscreenToggle/index.cjs +1 -1
  317. package/dist/components/FullscreenToggle/index.js +1 -1
  318. package/dist/components/IconButton/index.cjs +1 -1
  319. package/dist/components/IconButton/index.js +1 -1
  320. package/dist/components/List/index.cjs +1 -1
  321. package/dist/components/List/index.js +2 -2
  322. package/dist/components/Loader/Loader.d.cts +1 -1
  323. package/dist/components/Loader/Loader.d.ts +1 -1
  324. package/dist/components/Loader/index.cjs +1 -1
  325. package/dist/components/Loader/index.js +1 -1
  326. package/dist/components/LocationPicker/index.cjs +1 -1
  327. package/dist/components/LocationPicker/index.js +1 -1
  328. package/dist/components/Modal/Modal.d.cts +1 -1
  329. package/dist/components/Modal/Modal.d.ts +1 -1
  330. package/dist/components/Modal/index.cjs +1 -1
  331. package/dist/components/Modal/index.js +1 -1
  332. package/dist/components/MultiSelect/index.cjs +1 -1
  333. package/dist/components/MultiSelect/index.js +1 -1
  334. package/dist/components/NumberField/index.cjs +1 -1
  335. package/dist/components/NumberField/index.js +1 -1
  336. package/dist/components/OtpField/OtpField.d.cts +1 -1
  337. package/dist/components/OtpField/OtpField.d.ts +1 -1
  338. package/dist/components/OtpField/index.cjs +1 -1
  339. package/dist/components/OtpField/index.js +1 -1
  340. package/dist/components/PageError/index.cjs +1 -1
  341. package/dist/components/PageError/index.js +1 -1
  342. package/dist/components/PageLayout/PageLayout.d.cts +2 -2
  343. package/dist/components/PageLayout/PageLayout.d.ts +2 -2
  344. package/dist/components/PageLayout/index.cjs +1 -1
  345. package/dist/components/PageLayout/index.js +1 -1
  346. package/dist/components/PageNotFound/index.cjs +1 -1
  347. package/dist/components/PageNotFound/index.js +1 -1
  348. package/dist/components/Pagination/index.cjs +1 -1
  349. package/dist/components/Pagination/index.js +1 -1
  350. package/dist/components/PaletteField/PaletteField.d.cts +8 -2
  351. package/dist/components/PaletteField/PaletteField.d.ts +8 -2
  352. package/dist/components/PaletteField/index.cjs +1 -1
  353. package/dist/components/PaletteField/index.js +1 -1
  354. package/dist/components/PhoneField/index.cjs +1 -1
  355. package/dist/components/PhoneField/index.js +1 -1
  356. package/dist/components/Popconfirm/index.cjs +1 -1
  357. package/dist/components/Popconfirm/index.js +1 -1
  358. package/dist/components/Popover/Popover.d.cts +1 -1
  359. package/dist/components/Popover/Popover.d.ts +1 -1
  360. package/dist/components/Progress/index.cjs +1 -1
  361. package/dist/components/Progress/index.js +1 -1
  362. package/dist/components/QrCode/QrCode.d.cts +5 -2
  363. package/dist/components/QrCode/QrCode.d.ts +5 -2
  364. package/dist/components/QrCode/index.cjs +1 -1
  365. package/dist/components/QrCode/index.js +1 -1
  366. package/dist/components/RemoveDialog/index.cjs +1 -1
  367. package/dist/components/RemoveDialog/index.js +1 -1
  368. package/dist/components/RichTextEditor/RichTextEditor.d.cts +1 -1
  369. package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  370. package/dist/components/RichTextEditor/index.cjs +1 -1
  371. package/dist/components/RichTextEditor/index.js +1 -1
  372. package/dist/components/RootLayout/RootLayout.d.cts +26 -6
  373. package/dist/components/RootLayout/RootLayout.d.ts +26 -6
  374. package/dist/components/RootLayout/SettingsDrawer.d.cts +8 -2
  375. package/dist/components/RootLayout/SettingsDrawer.d.ts +8 -2
  376. package/dist/components/RootLayout/index.cjs +1 -1
  377. package/dist/components/RootLayout/index.d.cts +1 -1
  378. package/dist/components/RootLayout/index.d.ts +1 -1
  379. package/dist/components/RootLayout/index.js +1 -1
  380. package/dist/components/Select/index.cjs +1 -1
  381. package/dist/components/Select/index.js +1 -1
  382. package/dist/components/Sidebar/index.cjs +1 -1
  383. package/dist/components/Sidebar/index.js +1 -1
  384. package/dist/components/Slider/Slider.d.cts +2 -2
  385. package/dist/components/Slider/Slider.d.ts +2 -2
  386. package/dist/components/Slider/index.cjs +1 -1
  387. package/dist/components/Slider/index.js +1 -1
  388. package/dist/components/SpeedDial/index.cjs +1 -1
  389. package/dist/components/SpeedDial/index.js +1 -1
  390. package/dist/components/Stepper/Stepper.d.cts +2 -2
  391. package/dist/components/Stepper/Stepper.d.ts +2 -2
  392. package/dist/components/Stepper/index.cjs +1 -1
  393. package/dist/components/Stepper/index.js +1 -1
  394. package/dist/components/Table/Table.d.cts +1 -1
  395. package/dist/components/Table/Table.d.ts +1 -1
  396. package/dist/components/Table/index.cjs +1 -1
  397. package/dist/components/Table/index.js +1 -1
  398. package/dist/components/Tabs/index.cjs +1 -1
  399. package/dist/components/Tabs/index.js +1 -1
  400. package/dist/components/TagsField/TagsField.d.cts +1 -1
  401. package/dist/components/TagsField/TagsField.d.ts +1 -1
  402. package/dist/components/TagsField/index.cjs +1 -1
  403. package/dist/components/TagsField/index.js +1 -1
  404. package/dist/components/TextField/index.cjs +1 -1
  405. package/dist/components/TextField/index.js +1 -1
  406. package/dist/components/ThemeToggle/index.cjs +1 -1
  407. package/dist/components/ThemeToggle/index.js +1 -1
  408. package/dist/components/TimePicker/index.cjs +1 -1
  409. package/dist/components/TimePicker/index.js +1 -1
  410. package/dist/components/Toast/index.cjs +1 -1
  411. package/dist/components/Toast/index.js +1 -1
  412. package/dist/components/TranslatedFields/TranslatedFields.d.cts +1 -1
  413. package/dist/components/TranslatedFields/TranslatedFields.d.ts +1 -1
  414. package/dist/components/TranslatedFields/index.cjs +1 -1
  415. package/dist/components/TranslatedFields/index.js +1 -1
  416. package/dist/components/UserCard/UserCard.d.cts +6 -5
  417. package/dist/components/UserCard/UserCard.d.ts +6 -5
  418. package/dist/components/UserCard/index.cjs +1 -1
  419. package/dist/components/UserCard/index.js +1 -1
  420. package/dist/entries/app.cjs +1 -1
  421. package/dist/entries/app.js +1 -1
  422. package/dist/entries/components.cjs +1 -1
  423. package/dist/entries/components.js +56 -56
  424. package/dist/entries/i18n.cjs +1 -1
  425. package/dist/entries/i18n.js +2 -2
  426. package/dist/entries/theme.cjs +1 -1
  427. package/dist/entries/theme.d.cts +2 -2
  428. package/dist/entries/theme.d.ts +2 -2
  429. package/dist/entries/theme.js +12 -11
  430. package/dist/form/useForm.d.cts +1 -1
  431. package/dist/form/useForm.d.ts +1 -1
  432. package/dist/hooks/useMediaQuery.d.cts +3 -3
  433. package/dist/hooks/useMediaQuery.d.ts +3 -3
  434. package/dist/i18n/messages.d.cts +26 -0
  435. package/dist/i18n/messages.d.ts +26 -0
  436. package/dist/index.cjs +1 -1
  437. package/dist/index.css +3 -3
  438. package/dist/index.js +232 -231
  439. package/dist/{messages-CMgYU5p6.js → messages-BiRLMy1E.js} +228 -46
  440. package/dist/messages-BiRLMy1E.js.map +1 -0
  441. package/dist/messages-C_fRRCg6.cjs +36 -0
  442. package/dist/messages-C_fRRCg6.cjs.map +1 -0
  443. package/dist/theme/ConfigProvider.d.cts +47 -7
  444. package/dist/theme/ConfigProvider.d.ts +47 -7
  445. package/dist/theme/index.d.cts +2 -2
  446. package/dist/theme/index.d.ts +2 -2
  447. package/dist/useForm-CGbJ44Gp.js.map +1 -1
  448. package/dist/useForm-CSw6r1n1.cjs.map +1 -1
  449. package/dist/{useHomeTo-MfvJxziQ.cjs → useHomeTo-BaM7kBDh.cjs} +2 -2
  450. package/dist/{useHomeTo-MfvJxziQ.cjs.map → useHomeTo-BaM7kBDh.cjs.map} +1 -1
  451. package/dist/{useHomeTo-Ckq7scIY.js → useHomeTo-DQj9tVZI.js} +2 -2
  452. package/dist/{useHomeTo-Ckq7scIY.js.map → useHomeTo-DQj9tVZI.js.map} +1 -1
  453. package/dist/useMediaQuery-CHMrI6Dy.cjs.map +1 -1
  454. package/dist/useMediaQuery-DrDUrkmJ.js.map +1 -1
  455. package/dist/{useOptionMenu-3YlvxPAM.cjs → useOptionMenu-BKC1y6oj.cjs} +2 -2
  456. package/dist/{useOptionMenu-3YlvxPAM.cjs.map → useOptionMenu-BKC1y6oj.cjs.map} +1 -1
  457. package/dist/{useOptionMenu-BBsyUow1.js → useOptionMenu-Dom1-bqm.js} +5 -5
  458. package/dist/{useOptionMenu-BBsyUow1.js.map → useOptionMenu-Dom1-bqm.js.map} +1 -1
  459. package/package.json +1 -1
  460. package/dist/AdminRoot-CRTBGUxq.cjs +0 -2
  461. package/dist/AdminRoot-CRTBGUxq.cjs.map +0 -1
  462. package/dist/AdminRoot-JOgiNkJA.js +0 -107
  463. package/dist/AdminRoot-JOgiNkJA.js.map +0 -1
  464. package/dist/Alert-CY8iU1zd.cjs +0 -2
  465. package/dist/Alert-CY8iU1zd.cjs.map +0 -1
  466. package/dist/Alert-CtUr-0s8.js +0 -70
  467. package/dist/Alert-CtUr-0s8.js.map +0 -1
  468. package/dist/Breadcrumbs-Dqhk-dY2.js.map +0 -1
  469. package/dist/Breadcrumbs-hi6dJhfN.cjs.map +0 -1
  470. package/dist/Card-B91LGIzF.js +0 -128
  471. package/dist/Card-B91LGIzF.js.map +0 -1
  472. package/dist/Card-CkZtVNyV.cjs +0 -2
  473. package/dist/Card-CkZtVNyV.cjs.map +0 -1
  474. package/dist/Chip-B7cAHjlx.cjs.map +0 -1
  475. package/dist/Chip-D5ZZs3QH.js.map +0 -1
  476. package/dist/ChoiceCardGroup-143hR0v_.cjs +0 -2
  477. package/dist/ChoiceCardGroup-Cx8CtmPl.js +0 -180
  478. package/dist/ChoiceCardGroup-Cx8CtmPl.js.map +0 -1
  479. package/dist/CodeBlock-C3mG_seZ.cjs.map +0 -1
  480. package/dist/CodeBlock-DrWRSRmO.js.map +0 -1
  481. package/dist/ColorPicker-C1pDI4su.cjs +0 -2
  482. package/dist/ConfigProvider-B_Bb6pk1.cjs +0 -2
  483. package/dist/ConfigProvider-B_Bb6pk1.cjs.map +0 -1
  484. package/dist/ConfigProvider-DeMASTVo.js +0 -347
  485. package/dist/ConfigProvider-DeMASTVo.js.map +0 -1
  486. package/dist/DatePicker-CXRsT-lt.cjs +0 -2
  487. package/dist/DateTimePicker-B-Jjejzm.js.map +0 -1
  488. package/dist/DateTimePicker-BuTIRTUX.cjs +0 -2
  489. package/dist/DateTimePicker-BuTIRTUX.cjs.map +0 -1
  490. package/dist/DescriptionList-CG08_qwT.js.map +0 -1
  491. package/dist/DescriptionList-S9C6Tp90.cjs.map +0 -1
  492. package/dist/FileCard-5QvVkO1-.js.map +0 -1
  493. package/dist/FileCard-Cl88Gu6L.cjs.map +0 -1
  494. package/dist/FileUploader-DwAl3UXI.js.map +0 -1
  495. package/dist/FileUploader-FMVbj7rz.cjs.map +0 -1
  496. package/dist/ListItem-Qo1Tt6Fi.cjs +0 -2
  497. package/dist/Modal-DTnB_mGg.js.map +0 -1
  498. package/dist/Modal-DjSOhZqd.cjs.map +0 -1
  499. package/dist/OtpField-Dy4O1MeD.js +0 -174
  500. package/dist/OtpField-Dy4O1MeD.js.map +0 -1
  501. package/dist/OtpField-OdkuKKcV.cjs +0 -2
  502. package/dist/OtpField-OdkuKKcV.cjs.map +0 -1
  503. package/dist/PageLayout-ojiBEcxI.js.map +0 -1
  504. package/dist/PageLayout-rtEl8uqS.cjs.map +0 -1
  505. package/dist/Pagination-DoDGKGpQ.js +0 -139
  506. package/dist/Pagination-DoDGKGpQ.js.map +0 -1
  507. package/dist/Pagination-Ffv6IFIU.cjs +0 -2
  508. package/dist/Pagination-Ffv6IFIU.cjs.map +0 -1
  509. package/dist/PaletteField-ChG2VQtS.js +0 -54
  510. package/dist/PaletteField-ChG2VQtS.js.map +0 -1
  511. package/dist/PaletteField-DQ1OvXqe.cjs +0 -2
  512. package/dist/PaletteField-DQ1OvXqe.cjs.map +0 -1
  513. package/dist/QrCode-B9YbQNVc.js +0 -80
  514. package/dist/QrCode-B9YbQNVc.js.map +0 -1
  515. package/dist/QrCode-CNVYpz9j.cjs +0 -2
  516. package/dist/QrCode-CNVYpz9j.cjs.map +0 -1
  517. package/dist/RichTextEditor-DSvSaszc.cjs +0 -2
  518. package/dist/RichTextEditor-DSvSaszc.cjs.map +0 -1
  519. package/dist/RichTextEditor-itYD1PfE.js.map +0 -1
  520. package/dist/RootLayout-BlYjYAYk.js +0 -582
  521. package/dist/RootLayout-BlYjYAYk.js.map +0 -1
  522. package/dist/RootLayout-D5nlzYlH.cjs +0 -2
  523. package/dist/RootLayout-D5nlzYlH.cjs.map +0 -1
  524. package/dist/Sidebar-C3-u3Agj.cjs +0 -2
  525. package/dist/Slider-0joKXhPo.cjs +0 -2
  526. package/dist/Slider-0joKXhPo.cjs.map +0 -1
  527. package/dist/Slider-CwZYxDO0.js +0 -184
  528. package/dist/Slider-CwZYxDO0.js.map +0 -1
  529. package/dist/Stepper-BN0GsRZW.js.map +0 -1
  530. package/dist/Stepper-wPPs57uZ.cjs.map +0 -1
  531. package/dist/Table-CFl3OYlo.cjs.map +0 -1
  532. package/dist/Table-DChIfjqj.js.map +0 -1
  533. package/dist/TagsField-5mbyaFQZ.cjs +0 -2
  534. package/dist/TagsField-5mbyaFQZ.cjs.map +0 -1
  535. package/dist/TagsField-CoBRqcjW.js.map +0 -1
  536. package/dist/ThemeToggle-_SUmLxmU.js +0 -28
  537. package/dist/TimePicker-6nHQx0P5.cjs +0 -2
  538. package/dist/TranslatedFields-CVc0NvXa.cjs +0 -2
  539. package/dist/TranslatedFields-CVc0NvXa.cjs.map +0 -1
  540. package/dist/TranslatedFields-CmRhRGC_.js +0 -86
  541. package/dist/TranslatedFields-CmRhRGC_.js.map +0 -1
  542. package/dist/UserCard-1ubnvBV6.cjs.map +0 -1
  543. package/dist/UserCard-DcTLEHFu.js.map +0 -1
  544. package/dist/messages-CMgYU5p6.js.map +0 -1
  545. package/dist/messages-h22vS9zn.cjs +0 -36
  546. package/dist/messages-h22vS9zn.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfigProvider-DeMASTVo.js","sources":["../src/theme/applyTheme.ts","../src/theme/ConfigProvider.tsx"],"sourcesContent":["export interface ThemePalette {\n primary: string\n /**\n * A free theme color (near-white by default) selectable via the `color` prop — it is **no longer**\n * the component surface (elevated panels use `--tz-color-surface`).\n */\n secondary: string\n /**\n * The rear-most page background — the `<body>` fill + the shell canvas that the floating panels sit\n * on; nothing else uses it. Built-in defaults: a soft off-white in light mode, a near-black in dark mode.\n */\n background: string\n /**\n * The elevated **panel surface** — cards, sidebar, inputs/forms, dropdowns, modals (the panels that\n * float over `--tz-color-background`). Built-in defaults: white in light mode, a touch lighter than\n * the canvas in dark mode. Configurable per mode like any theme color.\n */\n surface: string\n /** The single accent color — the default tint for controls (`Button`, `IconButton`, …). */\n accent: string\n success: string\n error: string\n info: string\n warning: string\n}\n\n/** Names of the theme palette tokens (maps to `--tz-color-<name>`). */\nexport type ThemeColor = keyof ThemePalette\n\nfunction hexToRgbTriplet(hex: string): string {\n let h = hex.trim().replace(/^#/, '')\n if (h.length === 3) {\n h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2]\n }\n const int = parseInt(h, 16)\n return `${(int >> 16) & 255}, ${(int >> 8) & 255}, ${int & 255}`\n}\n\n/**\n * Picks a readable text color (near-black or white) to sit on top of a solid\n * fill — used by `contained` controls so the label stays legible on light\n * colors (e.g. a light `primary` in dark mode).\n */\nfunction contrastColor(rgbTriplet: string): string {\n const [r, g, b] = rgbTriplet.split(',').map((n) => Number(n.trim()))\n const yiq = (r * 299 + g * 587 + b * 114) / 1000\n return yiq >= 150 ? '#04202b' : '#ffffff'\n}\n\n/**\n * Per-color overrides for the `contained` label color, where the automatic\n * luminance pick isn't the desired look:\n * - `secondary`: near-white fill that blends with the page, so the label uses\n * the primary color (flips with the mode) to stay readable without a border.\n * - `warning`: keep the plain white label by design.\n */\nconst CONTRAST_OVERRIDE: Readonly<Record<string, string>> = {\n secondary: 'rgb(var(--tz-color-primary-rgb))',\n warning: '#ffffff',\n}\n\nexport function applyTheme(\n theme: Partial<ThemePalette>,\n target: HTMLElement = document.documentElement,\n): void {\n for (const [name, value] of Object.entries(theme)) {\n if (!value) continue\n const triplet = hexToRgbTriplet(value)\n target.style.setProperty(`--tz-color-${name}-rgb`, triplet)\n target.style.setProperty(\n `--tz-color-${name}-contrast`,\n CONTRAST_OVERRIDE[name] ?? contrastColor(triplet),\n )\n }\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react'\nimport { applyTheme, type ThemeColor, type ThemePalette } from './applyTheme'\nimport { setBreakpoints, type Breakpoint } from './breakpoints'\nimport { DEFAULT_TRANSLATIONS_NAMESPACE } from '../helpers/translations'\nimport type { IconName } from '../icons/names'\nimport {\n createAppTranslator,\n createTranslator,\n type AppMessages,\n type AppTranslator,\n type MessageOverrides,\n type Translator,\n} from '../i18n/messages'\n\nexport type ThemeMode = 'light' | 'dark'\n/**\n * Global corner shape. `rounded` (default) leaves every radius as designed; `square` flattens every\n * library corner by zeroing the WHOLE `--tz-radius-*` scale (theme.css, under `[data-tz-shape='square']`)\n * — including the `pill` / `round` steps every decorative pill and circle uses. Purely token-driven: no\n * `!important`, no universal selector, and the consuming app's own elements are untouched. The `Loader`\n * ring and the `EmptyState` icon puck use a literal `50%` (off the scale) and stay round.\n */\nexport type ThemeShape = 'rounded' | 'square'\n\nexport interface ThemeColors {\n /** Light-mode palette. Override any subset of the theme colors — the rest use the library defaults. */\n light?: Partial<ThemePalette>\n /** Dark-mode overrides, layered on the (merged) light palette + the library's dark defaults. */\n dark?: Partial<ThemePalette>\n}\n\n/** A content locale the app supports — a tab in `<TranslatedFields>`. */\nexport interface LocaleConfig {\n /** BCP-47 locale code, e.g. `'en-US'`. Namespaces the form field names and is the tab's fallback label. */\n code: string\n /** Human-readable tab label. Falls back to `code`. */\n label?: string\n}\n\n/** Theme settings — color overrides + initial mode. Lives under `Config.theme`. */\nexport interface ThemeConfig {\n /** Theme color overrides. Omit entirely to use the library's built-in theme. */\n colors?: ThemeColors\n /** Initial color mode. */\n mode?: ThemeMode\n /**\n * Default font family — the app-wide default the user's Settings choice overrides (persisted). One of\n * the pre-imported presets (`Inter` / `Roboto` / `Lato`) or any Google Font family name. Defaults to\n * `Inter`. A non-preset family is loaded on demand at runtime.\n */\n fontFamily?: string\n /**\n * Default corner shape — the app-wide default the user's Settings choice overrides (persisted).\n * `rounded` (default) leaves every radius as designed; `square` zeroes the whole `--tz-radius-*` scale\n * (pills and circles included) — token-driven, so the app's own elements are never touched. Only the\n * `Loader` ring and the `EmptyState` icon puck (a literal `50%`) stay round.\n */\n shape?: ThemeShape\n /**\n * Override the shared responsive **breakpoint** bounds (px, max-width). Keys are fixed\n * (`xxs`/`xs`/`sm`/`md`/`lg`/`xl`/`xxl`); pass any subset — the rest keep their defaults. Drives the\n * **JS** responsive layer (`useMediaQuery` tokens, `Flex`/`Grid`/`Masonry` responsive props); note\n * component CSS `@media` rules are compiled and don't follow a runtime override. E.g.\n * `breakpoints: { md: 1200, xl: 1600 }`.\n */\n breakpoints?: Partial<Record<Breakpoint, number>>\n}\n\n/**\n * The configurable key / param **names** the library's components read — grouped under `Config.keys`\n * so they live in one place. Each is overridable; omit one to use its built-in default. Grows over\n * time (e.g. `page` / `size` for paginated tables ⇒ `?page=1&size=10`).\n */\nexport interface KeysConfig {\n /**\n * URL query param name a **top-level** `<Tabs>` syncs its active tab to (e.g. `'view'` ⇒ `?view=…`),\n * unless that strip sets its own `queryKey` (or `queryKey={null}` to opt out). Defaults to `'tab'`.\n */\n tabQueryKey?: string\n /**\n * URL query param name a **nested** `<Tabs>` (one rendered inside another tab's panel) syncs to, so it\n * doesn't collide with the outer strip's `tabQueryKey` (e.g. `?tab=…&nestedTab=…`). Auto-applied by\n * nesting depth; overridable per strip via `queryKey`. Defaults to `'nestedTab'`.\n */\n nestedTabQueryKey?: string\n /**\n * URL query param name a `<Stepper queryKey>` (the bare/`true` form) syncs its active step to\n * (**1-based**, e.g. `?step=2`); a string `queryKey` overrides it per stepper. Defaults to `'step'`.\n * (The sync itself is **opt-in** — a stepper with no `queryKey` never touches the URL.)\n */\n stepQueryKey?: string\n /**\n * Top-level namespace word for `<TranslatedFields>`' form names + the nested object — e.g.\n * `'languages'` ⇒ `languages[en-US].title`. Defaults to `'translations'`.\n */\n translationsNamespace?: string\n}\n\n/**\n * How a `<Table>` builds its **server-request** params — the query it hands the consumer (as `params` /\n * `query`) in `onChange`, so a server-mode fetch doesn't hand-map page/size/search/sort every time. This is\n * the **backend transport** layer, distinct from `keys.*QueryKey` (the browser-URL sync, always page-based\n * for shareable links). Set once in `config.table.query`, override per table via the `queryMapping` prop.\n * Every field is optional; the defaults reproduce the browser-URL shape (`?page=1&size=10&search=…&sort=-key`).\n */\nexport interface TableQueryConfig {\n /** Request param name for the page / offset. Defaults to `'page'` (e.g. `'skip'` for an offset API). */\n pageParam?: string\n /** Request param name for the page size. Defaults to `'size'` (e.g. `'limit'`). */\n sizeParam?: string\n /** Request param name for the search query (omitted when the search is empty). Defaults to `'search'` (e.g. `'q'`). */\n searchParam?: string\n /**\n * Request param name holding the sort **key**. Defaults to `'sort'` (e.g. `'sortBy'`). With\n * `sortFormat: 'field'` this single param also carries the direction (`-key` = desc); with `'separate'`\n * the direction goes to `sortOrderParam`.\n */\n sortParam?: string\n /**\n * Pagination style. `'page'` (default) emits the **1-based page number** as-is (`page=2`); `'offset'`\n * emits a **zero-based offset** `(page - 1) * size` instead (`skip=10`), for skip/offset APIs.\n */\n pagination?: 'page' | 'offset'\n /**\n * Sort encoding. `'field'` (default) is a single param with a `-` prefix for descending (`sort=-price`);\n * `'separate'` splits into two params — the key in `sortParam` + the direction in `sortOrderParam`\n * (`sortBy=price&order=desc`); `'suffix'` appends the direction value to the key in a single param\n * (`sort=priceAsc` / `sort=priceDesc` with `ascValue: 'Asc'` / `descValue: 'Desc'`).\n */\n sortFormat?: 'field' | 'separate' | 'suffix'\n /** Direction param name when `sortFormat: 'separate'`. Defaults to `'order'`. */\n sortOrderParam?: string\n /**\n * Value emitted for an ascending sort — the `sortOrderParam` value when `sortFormat: 'separate'`, or the\n * suffix appended to the key when `sortFormat: 'suffix'`. Defaults to `'asc'`.\n */\n ascValue?: string\n /**\n * Value emitted for a descending sort — the `sortOrderParam` value when `sortFormat: 'separate'`, or the\n * suffix appended to the key when `sortFormat: 'suffix'`. Defaults to `'desc'`.\n */\n descValue?: string\n /**\n * What to emit for the size param when the **\"All\"** rows-per-page choice is active. A `string`/`number`\n * sets `size=<allValue>` (e.g. `0` for APIs where `limit=0` means \"all\"); omit it (default) to drop the\n * size param entirely (many APIs treat a missing limit as unbounded).\n */\n allValue?: string | number\n /**\n * How a **`multiSelect`** filter serializes into the request query: `'repeat'` (default — `cat=a&cat=b`),\n * `'csv'` (`cat=a,b`), or `'indexed'` (`cat[0]=a&cat[1]=b`).\n */\n multiSelectFormat?: 'repeat' | 'csv' | 'indexed'\n /**\n * Suffix appended to a **range** filter's param for its lower / upper bound — e.g. `Min`/`Max` (default)\n * → `priceMin`/`priceMax`; set `'_gte'`/`'_lte'`, `'[gte]'`/`'[lte]'`, `'From'`/`'To'`, … to match your API.\n */\n rangeMinSuffix?: string\n rangeMaxSuffix?: string\n}\n\n/** `<Table>`-specific configuration. Grows over time; today just the server-request query mapping. */\nexport interface TableConfig {\n /** How `<Table>` builds its server-request params (emitted as `params` / `query` in `onChange`). */\n query?: TableQueryConfig\n}\n\n/** Signed-in user shown in the shell header avatar + its account menu (see `HeaderConfig`). */\nexport interface HeaderUser {\n /** Full name — shown as the menu's name line. */\n name?: string\n /** Email shown under the name in the account menu. */\n email?: string\n /** Avatar image URL (falls back to a user icon). */\n avatar?: string\n}\n\n/**\n * One custom item in the header account menu (rendered between the user block and **Sign out**). Give it a\n * `to` (a real router link — an `href`, middle-click / ⌘-click open a new tab), an `onClick`, or both\n * (`onClick` runs first, then the navigation). With neither, a development warning is logged.\n */\nexport interface HeaderMenuItem {\n /** Visible label. */\n label: string\n /** Leading icon (`IconName`). Optional. */\n icon?: IconName\n /** Runs on click (before any `to` navigation); the menu closes afterwards. */\n onClick?: () => void\n /** Router path the item links to (rendered as a router `Link`, so it has an `href`). */\n to?: string\n /** Path params for `to` (e.g. `{ id: '7' }` for `/users/$id`). */\n params?: Record<string, string>\n /** Search params for `to`. */\n search?: Record<string, unknown>\n /** Renders the item disabled. Optional. */\n disabled?: boolean\n /** Tint, e.g. `'error'` for a destructive item. Default: inherit. */\n color?: ThemeColor\n}\n\n/** The `header.environment` badge, spelled out — e.g. `{ label: 'QA', color: 'info' }`. */\nexport interface HeaderEnvironment {\n /** Chip text, shown as given. */\n label: string\n /** Chip tint. Defaults to `warning`. */\n color?: ThemeColor\n /** Leading icon. Defaults to `Code` (a build, not the live app); `false` hides it. */\n icon?: IconName | false\n}\n\n/**\n * An app action button in the shell header — rendered as an `IconButton` in the same style as the built-in\n * header controls (with a `Tooltip` and an optional count / dot badge), left of them. On narrow screens\n * (`xs`) the actions move into the account menu (when there is one).\n */\nexport interface HeaderAction {\n /** Icon on the button (`IconName`). */\n icon: IconName\n /** Accessible name + tooltip text (and the item label once it moves into the account menu). */\n label: string\n /** Runs on click. */\n onClick?: () => void\n /** Router path to navigate to on click (instead of / as well as `onClick`). */\n to?: string\n /** Path params for `to`. */\n params?: Record<string, string>\n /** Search params for `to`. */\n search?: Record<string, unknown>\n /** Count / text badge pinned to the button (e.g. unread notifications). A numeric `0` is hidden. */\n badge?: number | string\n /** A plain indicator dot instead of a count. */\n dot?: boolean\n /** Badge / dot tint. Defaults to `error`. */\n badgeColor?: ThemeColor\n /** Icon tint. Defaults to the header controls' tint (`accent`). */\n color?: ThemeColor\n /** Renders the button disabled. */\n disabled?: boolean\n}\n\n/**\n * `RootLayout` header configuration — the shell's top-bar controls. Set it once app-wide in\n * `config.header`, or per shell via the `RootLayout` `header` prop (the prop wins, merged over config).\n */\nexport interface HeaderConfig {\n /** Show the built-in light/dark theme toggle. Defaults to `true`. */\n theme?: boolean\n /**\n * Make the shell header **stick to the top on scroll** (fixed) instead of scrolling away (static).\n * This is the app-wide default; the user can flip it in the **Settings** drawer and their choice is\n * persisted (`localStorage['tz-header-sticky']`), overriding this. Defaults to `false` (static).\n */\n sticky?: boolean\n /** Show the browser-fullscreen toggle (auto-hides where the Fullscreen API is unavailable). Defaults to `false`. */\n fullscreen?: boolean\n /** Show the **Settings** button (opens the right-side drawer to pick the per-mode `accent`). Defaults to `true`. */\n settings?: boolean\n /** Show the nav search over the sidebar's pages (with suggestions). Defaults to `true`. */\n search?: boolean\n /**\n * Show the header **language switcher** (the `Global`-icon dropdown of `config.i18n.languages`).\n * Defaults to `true`, but it only renders when more than one UI language is configured — so pass\n * `false` to hide it even with several languages (the panel stays on its current/default language).\n */\n languages?: boolean\n /** Show the breadcrumb trail at the top of the content. Defaults to **`true`**. */\n breadcrumbs?: boolean\n /** When provided, an account `Avatar` appears; its menu has a **Sign Out** item that calls this. */\n onLogout?: () => void\n /** Signed-in user — shown in the header avatar and as a header block atop the account menu. */\n user?: HeaderUser\n /**\n * Extra items in the header account menu, rendered between the user block and **Sign out**, in order.\n * Only shown when `onLogout` is set (the menu does not exist otherwise). A `Divider` separates them\n * from **Sign out**. (When merging a `RootLayout`/`AdminRoot` `header` prop over `config.header`, the\n * prop's `menu` array **replaces** the config's — arrays don't concatenate.)\n */\n menu?: HeaderMenuItem[]\n /**\n * App action buttons, left of the built-in controls (theme / language / settings / account), in order —\n * styled like them, each with a tooltip and an optional badge. On `xs` they move into the account menu\n * (above the `menu` items) when `onLogout` is set; otherwise they stay in the header. Like `menu`, a\n * `header` prop's `actions` **replaces** the config's.\n */\n actions?: HeaderAction[]\n /**\n * Free-form header content for what `actions` can't express — a text `Button` (\"New Order\"), a `Dropdown`.\n * Rendered left of `actions`; hidden on `xs` (the header has no room there). For an environment badge use\n * `environment`, which stays visible on `xs`.\n */\n extra?: ReactNode\n /**\n * The deployment environment badge — a small chip at the start of the header controls, **shown on every\n * screen size (phones too)**, so nobody mistakes a test build for the real one. Pass the app's env value\n * straight in, the same code everywhere: `environment: import.meta.env.VITE_APP_ENV`. A string is shown with\n * its first letter capitalized (`'staging'` → \"Staging\") in the `warning` color with a `Code` icon;\n * `{ label, color, icon }` sets them.\n * **Nothing renders** when it's empty / `undefined` / `null` or `'production'` / `'prod'` (any case).\n */\n environment?: string | HeaderEnvironment | null\n}\n\n/**\n * UI-language config for the admin panel's **own** static strings (labels, placeholders, aria-labels).\n * Distinct from `locales` (which is content-translation locales for `<TranslatedFields>`). The library\n * ships built-in translations (English + Georgian), so listing `languages` here is enough to get a\n * localized panel — no per-app setup. Any language the library doesn't ship is supplied via `messages`.\n */\nexport interface I18nConfig {\n /**\n * Active UI language on first load (a locale code, e.g. `'ka-GE'`). Defaults to English if listed in\n * `languages`, else the first `languages` entry, else `'en-US'`. The user's switcher choice (persisted)\n * overrides it.\n */\n language?: string\n /**\n * The UI languages the panel offers — drives the Settings language switcher. One entry = a fixed\n * language (no switcher). Defaults to English only. (Reuses the `{ code, label }` shape.)\n */\n languages?: LocaleConfig[]\n /**\n * Extra / override message catalogs for the **library's own** strings, merged **over** the built-ins\n * and keyed by language code or base language (`'ka-GE'` or `'ka'`). Use this to localize into a\n * language the library doesn't ship, or to tweak a built-in string. Unset keys fall back to English.\n */\n messages?: MessageOverrides\n /**\n * Catalogs for the **consuming app's own** UI strings — its section titles, labels, business copy —\n * keyed by language code/base then by any string key the app picks. Read via **`useTranslations()`**,\n * which binds to the active UI language, so the app's text switches together with the panel. Resolution\n * per key: exact code → base language → English (`'en'`) → the key itself. This is the app's own copy;\n * `messages` above is only for the library's built-in strings.\n */\n appMessages?: AppMessages\n}\n\n/**\n * App-level configuration passed to `<ConfigProvider config={…}>`. Groups theming under `theme`,\n * the configurable key/param names under `keys`, and keeps the rest (`locales`, …) at the top — a\n * single place to grow.\n */\nexport interface Config {\n /** Theme settings (color overrides + initial mode). Omit entirely to use the built-in theme. */\n theme?: ThemeConfig\n /** Content locales the app supports — drive `<TranslatedFields>`' tabs (one per locale). */\n locales?: LocaleConfig[]\n /** UI-language config for the panel's own strings (the library ships the translations). See `I18nConfig`. */\n i18n?: I18nConfig\n /**\n * Configurable key / query-param names the components read — e.g. the `<Tabs>` query keys\n * (`tabQueryKey` / `nestedTabQueryKey`) and the `<TranslatedFields>` namespace\n * (`translationsNamespace`). Grows over time (`page`, `size`, …).\n */\n keys?: KeysConfig\n /** `<Table>` config — today the server-request query mapping (`table.query`) shared by every table. */\n table?: TableConfig\n /**\n * `RootLayout` header config, app-wide — the shell top-bar toggles (`theme` / `fullscreen` /\n * `search` / `breadcrumbs`) + the account (`onLogout` / `user`). A `RootLayout`\n * `header` prop is merged over this (the prop wins), so a specific shell can override.\n */\n header?: HeaderConfig\n /** Google Maps settings for `LocationPicker` (the API key etc.), app-wide. See `MapsConfig`. */\n maps?: MapsConfig\n}\n\n/**\n * Google Maps settings, app-wide — read by `LocationPicker` (its own `apiKey` / `mapId` props win). The key is the\n * app's **browser** key (restrict it by HTTP referrer in the Google Cloud console); the Maps JavaScript API is\n * loaded on demand the first time a map renders, so a panel that never shows one never loads it.\n */\nexport interface MapsConfig {\n /** The Google Maps JavaScript API key. */\n apiKey?: string\n /**\n * A Map ID (Google Cloud → Map Management). Optional — with one the pin is an `AdvancedMarkerElement` and the\n * map uses its cloud style; without it a classic marker + the library's light / dark styling are used.\n */\n mapId?: string\n}\n\ninterface ThemeContextValue {\n mode: ThemeMode\n setMode: (mode: ThemeMode) => void\n toggleMode: () => void\n /** The persisted accent-color overrides **per mode** (a hex, or `null` when using that mode's default). */\n accentColors: Record<ThemeMode, string | null>\n /** The configured/default `accent` **per mode** (before any override) — the \"no override\" values. */\n defaultAccentColors: Record<ThemeMode, string>\n /** Set (or clear with `null`) the accent override for `mode` (defaults to the current) — persists + re-applies. */\n setAccentColor: (color: string | null, mode?: ThemeMode) => void\n locales: LocaleConfig[]\n /** Resolved translations namespace (`config.keys.translationsNamespace` ?? the built-in default). */\n translationsNamespace: string\n /** Resolved top-level tabs query key (`config.keys.tabQueryKey` ?? the built-in default). */\n tabQueryKey: string\n /** Resolved nested tabs query key (`config.keys.nestedTabQueryKey` ?? the built-in default). */\n nestedTabQueryKey: string\n /** Resolved stepper query key (`config.keys.stepQueryKey` ?? the built-in default). */\n stepQueryKey: string\n /** The `<Table>` server-request query mapping (`config.table.query` ?? `{}`). Defaults applied by `buildTableQuery`. */\n tableQuery: TableQueryConfig\n /** App-wide `RootLayout` header config (`config.header` ?? `{}`); the `RootLayout` prop merges over it. */\n header: HeaderConfig\n /** App-wide Google Maps settings (`config.maps` ?? `{}`). */\n maps: MapsConfig\n /** Whether the shell header sticks to the top on scroll (fixed) vs scrolls away (static). Persisted. */\n headerSticky: boolean\n /** Set + persist the header sticky/static preference (overrides `config.header.sticky`). */\n setHeaderSticky: (sticky: boolean) => void\n /** The active font family (drives `--tz-font-family`). Persisted; seeded from `config.theme.fontFamily`. */\n fontFamily: string\n /** Set + persist the font family (a preset or any Google Font name; loaded on demand). */\n setFontFamily: (family: string) => void\n /** The active corner shape (`rounded` / `square`, drives `data-tz-shape` on `<html>`). Persisted; seeded from `config.theme.shape`. */\n shape: ThemeShape\n /** Set + persist the corner shape (overrides `config.theme.shape`). */\n setShape: (shape: ThemeShape) => void\n /**\n * `true` while any appearance preference differs from the app's configured default — the mode, either\n * mode's accent, the font, the header sticky choice or the shape. Drives the Settings drawer's Reset.\n */\n hasCustomPreferences: boolean\n /**\n * Reset every appearance preference to the app's configured default (`config.theme.mode` / `fontFamily` /\n * `shape`, `config.header.sticky`, no accent override) and forget the saved choices, so the configured\n * defaults apply again on the next visit. The UI language is not touched (it isn't an appearance setting).\n */\n resetPreferences: () => void\n /** Active UI language code (drives `t`). Persisted; seeded from `config.i18n.language` (default English). */\n language: string\n /** Set + persist the active UI language (must be one of `languages`). */\n setLanguage: (code: string) => void\n /** The UI languages the panel offers (from `config.i18n.languages`, default English only). */\n languages: LocaleConfig[]\n /** Translator for the library's built-in strings, bound to the active `language`. */\n t: Translator\n /** Translator for the **app's own** strings (`config.i18n.appMessages`), bound to the active `language`. */\n appT: AppTranslator\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null)\nconst STORAGE_KEY = 'tz-theme-mode'\n/** Where the user's picked accent-color override is persisted, **per mode** (survives reloads). */\nconst accentStorageKey = (mode: ThemeMode) => `tz-accent-color-${mode}`\n/** Where the user's header sticky/static choice is persisted (survives reloads). */\nconst HEADER_STICKY_KEY = 'tz-header-sticky'\n/** Where the user's chosen font family is persisted (survives reloads). */\nconst FONT_STORAGE_KEY = 'tz-font-family'\n/** Where the user's chosen corner shape is persisted (survives reloads). */\nconst SHAPE_STORAGE_KEY = 'tz-shape'\n/** Where the user's chosen UI language is persisted (survives reloads). */\nconst LOCALE_KEY = 'tz-locale'\n/** Default UI languages when `config.i18n.languages` is unset — English only. */\nconst DEFAULT_LANGUAGES: LocaleConfig[] = [{ code: 'en-US', label: 'English' }]\n/** The default font family (matches the `--tz-font-family` token's primary family). */\nexport const DEFAULT_FONT_FAMILY = 'Inter'\n/** Families already in the shipped CSS (only the default) — these skip the runtime `<link>` load. */\nconst BUNDLED_FONTS: readonly string[] = [DEFAULT_FONT_FAMILY]\n/** The full fallback stack applied to `--tz-font-family` for a chosen family (mirrors theme.css). */\nconst fontStack = (family: string) =>\n `'${family}', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif`\n\n/** Add the Google Fonts preconnect hints once, so the on-demand font fetch isn't delayed by DNS/TLS. */\nfunction ensureFontPreconnect() {\n if (typeof document === 'undefined' || document.getElementById('tz-font-preconnect')) return\n const api = document.createElement('link')\n api.id = 'tz-font-preconnect'\n api.rel = 'preconnect'\n api.href = 'https://fonts.googleapis.com'\n document.head.appendChild(api)\n const gstatic = document.createElement('link')\n gstatic.rel = 'preconnect'\n gstatic.href = 'https://fonts.gstatic.com'\n gstatic.crossOrigin = 'anonymous'\n document.head.appendChild(gstatic)\n}\n\n/**\n * Ensure a Google Fonts stylesheet `<link>` exists for `family` (deduped by id). Only the default\n * (`Inter`) ships pre-imported, so every other family — the Roboto/Lato presets and any custom pick —\n * is loaded here on first use. Bare family request (no weight axes) so it works for any font — Google\n * serves the available weights.\n */\nfunction ensureFontLoaded(family: string) {\n if (typeof document === 'undefined' || BUNDLED_FONTS.includes(family)) return\n const id = `tz-font-${family.trim().replace(/\\s+/g, '-').toLowerCase()}`\n if (document.getElementById(id)) return\n ensureFontPreconnect()\n const link = document.createElement('link')\n link.id = id\n link.rel = 'stylesheet'\n link.href = `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family.trim()).replace(/%20/g, '+')}&display=swap`\n document.head.appendChild(link)\n}\n/** The built-in default URL query param name a **top-level** `<Tabs>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_TABS_QUERY_KEY = 'tab'\n/** The built-in default URL query param name a **nested** `<Tabs>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_NESTED_TAB_QUERY_KEY = 'nestedTab'\n/** The built-in default URL query param name a `<Stepper>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_STEP_QUERY_KEY = 'step'\n/** Stable empty-locales fallback so the context value memo doesn't churn when no locales are configured. */\nconst EMPTY_LOCALES: LocaleConfig[] = []\n/** Stable empty table-query fallback so the context memo doesn't churn when no `table.query` is configured. */\nconst EMPTY_TABLE_QUERY: TableQueryConfig = {}\n/** Stable empty header fallback so the context memo doesn't churn when no `header` is configured. */\nconst EMPTY_HEADER: HeaderConfig = {}\nconst EMPTY_MAPS: MapsConfig = {}\n\n/**\n * The library's built-in light palette — the single source of truth for every theme color's default\n * value. Apps override any subset via `config.colors.light`; the rest fall back to these. (theme.css\n * holds only the structure that references these values, not the values themselves.)\n */\nconst DEFAULT_LIGHT_COLORS: ThemePalette = {\n primary: '#13404e',\n secondary: '#ffffff',\n background: '#f9f9f9', // the rear + shell canvas — a soft off-white behind the white panels\n surface: '#ffffff', // the elevated panels (cards, sidebar, inputs, dropdowns, modals)\n accent: '#056472',\n success: '#00a854',\n error: '#f04134',\n info: '#039aa1',\n warning: '#ffbf00',\n}\n\n/**\n * Built-in dark-mode overrides — only the colors that differ from light; everything else inherits the\n * (merged) light palette. Apps override any of these via `config.colors.dark`.\n */\nconst DEFAULT_DARK_COLORS: Partial<ThemePalette> = {\n primary: '#e6e8eb',\n secondary: '#191919',\n background: '#0f0f0f', // the near-black rear + canvas\n surface: '#191919', // a touch lighter than the canvas, for the elevated panels\n accent: '#16a6b4', // a brighter teal — the light-mode accent is too dark on the dark canvas\n success: '#00a854',\n error: '#f04134',\n info: '#039aa1',\n warning: '#ffbf00',\n}\n\nfunction getInitialMode(fallback: ThemeMode): ThemeMode {\n const stored = localStorage.getItem(STORAGE_KEY)\n return stored === 'light' || stored === 'dark' ? stored : fallback\n}\n\n/** The persisted per-mode accent-color overrides (a hex string per mode, or `null` when none picked). */\nfunction getInitialAccentByMode(): Record<ThemeMode, string | null> {\n return {\n light: localStorage.getItem(accentStorageKey('light')) || null,\n dark: localStorage.getItem(accentStorageKey('dark')) || null,\n }\n}\n\n/** The persisted header sticky choice (`fallback` = the app's `config.header.sticky` when unset). */\nfunction getInitialHeaderSticky(fallback: boolean): boolean {\n const stored = localStorage.getItem(HEADER_STICKY_KEY)\n return stored === '1' ? true : stored === '0' ? false : fallback\n}\n\n/** The persisted font family (`fallback` = `config.theme.fontFamily` ?? the default when unset). */\nfunction getInitialFont(fallback: string): string {\n return localStorage.getItem(FONT_STORAGE_KEY) || fallback\n}\n\n/** The persisted corner shape (`fallback` = `config.theme.shape` ?? `rounded` when unset / invalid). */\nfunction getInitialShape(fallback: ThemeShape): ThemeShape {\n const stored = localStorage.getItem(SHAPE_STORAGE_KEY)\n return stored === 'rounded' || stored === 'square' ? stored : fallback\n}\n\n/**\n * The initial UI language: the persisted choice (if still offered), else `config.i18n.language`, else\n * English if it's among the offered languages, else the first offered, else `'en-US'`. Always clamped\n * to a code that's actually in `languages`.\n */\nfunction getInitialLanguage(languages: LocaleConfig[], configLanguage?: string): string {\n const codes = languages.map((l) => l.code)\n const stored = localStorage.getItem(LOCALE_KEY)\n if (stored && codes.includes(stored)) return stored\n if (configLanguage && codes.includes(configLanguage)) return configLanguage\n return codes.find((c) => c.toLowerCase().startsWith('en')) ?? codes[0] ?? 'en-US'\n}\n\nexport interface ConfigProviderProps {\n /** App config — theme overrides, initial mode, locales. Omit for the built-in defaults (light mode). */\n config?: Config\n children: ReactNode\n}\n\nexport function ConfigProvider({ config, children }: ConfigProviderProps) {\n const [mode, setModeState] = useState<ThemeMode>(() =>\n getInitialMode(config?.theme?.mode ?? 'light'),\n )\n // user-picked accents that override the configured/default `accent` — kept PER MODE; persisted\n const [accentByMode, setAccentByMode] =\n useState<Record<ThemeMode, string | null>>(getInitialAccentByMode)\n // user's header sticky/static choice — persisted; seeded from config.header.sticky (default static)\n const [headerSticky, setHeaderStickyState] = useState<boolean>(() =>\n getInitialHeaderSticky(config?.header?.sticky ?? false),\n )\n // user's chosen font family — persisted; seeded from config.theme.fontFamily (default Inter)\n const [fontFamily, setFontFamilyState] = useState<string>(() =>\n getInitialFont(config?.theme?.fontFamily ?? DEFAULT_FONT_FAMILY),\n )\n // user's chosen corner shape — persisted; seeded from config.theme.shape (default rounded)\n const [shape, setShapeState] = useState<ThemeShape>(() =>\n getInitialShape(config?.theme?.shape ?? 'rounded'),\n )\n // UI languages offered + the active one (persisted; seeded from config.i18n, default English)\n const languages = config?.i18n?.languages ?? DEFAULT_LANGUAGES\n const i18nMessages = config?.i18n?.messages\n const appMessages = config?.i18n?.appMessages\n const [language, setLanguageState] = useState<string>(() =>\n getInitialLanguage(languages, config?.i18n?.language),\n )\n const colors = config?.theme?.colors\n\n // the configured/default palette for BOTH modes, before any accent override:\n // light = library defaults then the app's light overrides; dark = that, then the library dark deltas,\n // then the app's dark overrides. (Both computed so the Settings drawer can offer a picker per mode.)\n const basePalettes = useMemo(() => {\n const light = { ...DEFAULT_LIGHT_COLORS, ...colors?.light }\n const dark = { ...light, ...DEFAULT_DARK_COLORS, ...colors?.dark }\n return { light, dark }\n }, [colors])\n // the accent per mode when there's NO override — exposed so UI needn't hardcode it\n const defaultAccentColors = useMemo(\n () => ({ light: basePalettes.light.accent, dark: basePalettes.dark.accent }),\n [basePalettes],\n )\n\n // Commit a mode's resolved theme straight to `<html>` (CSS vars + attrs + persisted mode). Called\n // **eagerly** on change (so the DOM updates the instant you toggle, NOT after React re-renders the\n // whole subtree — which is what made the switch feel ~1s late) and from the effect below (initial\n // mount / accent change / external `setMode`). Idempotent, so applying twice is harmless.\n const applyMode = useCallback(\n (nextMode: ThemeMode, accent: string | null = accentByMode[nextMode]) => {\n const base = basePalettes[nextMode]\n applyTheme(accent ? { ...base, accent } : base)\n const root = document.documentElement\n root.setAttribute('data-tz-theme', nextMode)\n root.style.setProperty('color-scheme', nextMode)\n },\n [basePalettes, accentByMode],\n )\n\n useLayoutEffect(() => {\n applyMode(mode)\n }, [applyMode, mode])\n\n // commit the app's breakpoint overrides to the shared store (before paint, so token media queries\n // resolve to the configured bounds without a flash). Serialized dep so an inline object doesn't refire.\n const breakpointsConfig = config?.theme?.breakpoints\n useLayoutEffect(() => {\n setBreakpoints(breakpointsConfig)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(breakpointsConfig ?? null)])\n\n const setMode = useCallback(\n (next: ThemeMode) => {\n applyMode(next) // eager DOM update — don't wait for the re-render/commit\n setModeState(next)\n localStorage.setItem(STORAGE_KEY, next) // persisted only on a user choice (not on every mount)\n },\n [applyMode],\n )\n\n const toggleMode = useCallback(\n () => setMode(mode === 'light' ? 'dark' : 'light'),\n [mode, setMode],\n )\n\n // set (or clear with `null`) the accent override for `target` (defaults to the current mode); persists\n const setAccentColor = useCallback(\n (color: string | null, target?: ThemeMode) => {\n const m = target ?? mode\n setAccentByMode((prev) => ({ ...prev, [m]: color }))\n if (color) localStorage.setItem(accentStorageKey(m), color)\n else localStorage.removeItem(accentStorageKey(m))\n if (m === mode) applyMode(mode, color) // eager for the active mode\n },\n [mode, applyMode],\n )\n\n // set + persist the header sticky preference (overrides config.header.sticky)\n const setHeaderSticky = useCallback((sticky: boolean) => {\n setHeaderStickyState(sticky)\n localStorage.setItem(HEADER_STICKY_KEY, sticky ? '1' : '0')\n }, [])\n\n // apply the font: load it (if not preloaded) + write the stack to --tz-font-family on <html>.\n // Eager on change + in a layout effect (mount / external change), like the mode/accent commit.\n const applyFont = useCallback((family: string) => {\n ensureFontLoaded(family)\n document.documentElement.style.setProperty('--tz-font-family', fontStack(family))\n }, [])\n useLayoutEffect(() => {\n applyFont(fontFamily)\n }, [applyFont, fontFamily])\n // set + persist the chosen font family (overrides config.theme.fontFamily)\n const setFontFamily = useCallback(\n (family: string) => {\n const next = family.trim() || DEFAULT_FONT_FAMILY\n applyFont(next) // eager — don't wait for the re-render\n setFontFamilyState(next)\n localStorage.setItem(FONT_STORAGE_KEY, next)\n },\n [applyFont],\n )\n\n // apply the corner shape: write `data-tz-shape` on <html> — theme.css zeroes the `--tz-radius-*`\n // scale under `[data-tz-shape='square']`. Eager on change + in a layout effect, like the mode commit.\n const applyShape = useCallback((next: ThemeShape) => {\n document.documentElement.setAttribute('data-tz-shape', next)\n }, [])\n useLayoutEffect(() => {\n applyShape(shape)\n }, [applyShape, shape])\n // set + persist the chosen corner shape (overrides config.theme.shape)\n const setShape = useCallback(\n (next: ThemeShape) => {\n applyShape(next) // eager — don't wait for the re-render\n setShapeState(next)\n localStorage.setItem(SHAPE_STORAGE_KEY, next)\n },\n [applyShape],\n )\n\n // the app's configured defaults — what Reset returns to (and what \"unchanged\" is measured against)\n const defaultMode = config?.theme?.mode ?? 'light'\n const defaultSticky = config?.header?.sticky ?? false\n const defaultFont = config?.theme?.fontFamily ?? DEFAULT_FONT_FAMILY\n const defaultShape = config?.theme?.shape ?? 'rounded'\n const hasCustomPreferences =\n mode !== defaultMode ||\n accentByMode.light != null ||\n accentByMode.dark != null ||\n headerSticky !== defaultSticky ||\n fontFamily !== defaultFont ||\n shape !== defaultShape\n // reset every appearance preference to the configured default + forget the saved choices (eager DOM\n // commits like the individual setters), so the configured defaults apply again on the next visit too\n const resetPreferences = useCallback(() => {\n for (const key of [\n STORAGE_KEY,\n accentStorageKey('light'),\n accentStorageKey('dark'),\n HEADER_STICKY_KEY,\n FONT_STORAGE_KEY,\n SHAPE_STORAGE_KEY,\n ]) {\n localStorage.removeItem(key)\n }\n setAccentByMode({ light: null, dark: null })\n applyMode(defaultMode, null)\n setModeState(defaultMode)\n setHeaderStickyState(defaultSticky)\n applyFont(defaultFont)\n setFontFamilyState(defaultFont)\n applyShape(defaultShape)\n setShapeState(defaultShape)\n }, [applyMode, applyFont, applyShape, defaultMode, defaultSticky, defaultFont, defaultShape])\n\n // set + persist the active UI language\n const setLanguage = useCallback((code: string) => {\n setLanguageState(code)\n localStorage.setItem(LOCALE_KEY, code)\n }, [])\n // the translator bound to the active language (rebuilt only when the language or overrides change)\n const t = useMemo<Translator>(\n () => createTranslator(language, i18nMessages),\n [language, i18nMessages],\n )\n // the app's-own-strings translator, bound to the same active language (rebuilt on language/catalog change)\n const appT = useMemo<AppTranslator>(\n () => createAppTranslator(language, appMessages),\n [language, appMessages],\n )\n\n const locales = config?.locales ?? EMPTY_LOCALES\n const translationsNamespace =\n config?.keys?.translationsNamespace ?? DEFAULT_TRANSLATIONS_NAMESPACE\n const tabQueryKey = config?.keys?.tabQueryKey ?? DEFAULT_TABS_QUERY_KEY\n const nestedTabQueryKey = config?.keys?.nestedTabQueryKey ?? DEFAULT_NESTED_TAB_QUERY_KEY\n const stepQueryKey = config?.keys?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY\n const tableQuery = config?.table?.query ?? EMPTY_TABLE_QUERY\n const headerConfig = config?.header ?? EMPTY_HEADER\n const mapsConfig = config?.maps ?? EMPTY_MAPS\n\n const value = useMemo<ThemeContextValue>(\n () => ({\n mode,\n setMode,\n toggleMode,\n accentColors: accentByMode,\n defaultAccentColors,\n setAccentColor,\n locales,\n translationsNamespace,\n tabQueryKey,\n nestedTabQueryKey,\n stepQueryKey,\n tableQuery,\n header: headerConfig,\n maps: mapsConfig,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n shape,\n setShape,\n hasCustomPreferences,\n resetPreferences,\n language,\n setLanguage,\n languages,\n t,\n appT,\n }),\n [\n mode,\n setMode,\n toggleMode,\n accentByMode,\n defaultAccentColors,\n setAccentColor,\n locales,\n translationsNamespace,\n tabQueryKey,\n nestedTabQueryKey,\n stepQueryKey,\n tableQuery,\n headerConfig,\n mapsConfig,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n shape,\n setShape,\n hasCustomPreferences,\n resetPreferences,\n language,\n setLanguage,\n languages,\n t,\n appT,\n ],\n )\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n}\n\nexport function useTheme(): ThemeContextValue {\n const value = useContext(ThemeContext)\n if (!value) {\n throw new Error('useTheme must be used within a <ConfigProvider>')\n }\n return value\n}\n\n/**\n * The content locales configured on `<ConfigProvider config={{ locales }}>`. Lenient — returns `[]`\n * outside a provider (locales are optional), so `<TranslatedFields>` can also take a `locales` prop.\n */\nexport function useLocales(): LocaleConfig[] {\n return useContext(ThemeContext)?.locales ?? EMPTY_LOCALES\n}\n\n/** Fallback English translator so a component used **without** a `<ConfigProvider>` still shows text. */\nconst DEFAULT_TRANSLATOR: Translator = createTranslator('en')\n/** Fallback app translator (no catalogs) — returns the key itself, so `useTranslations()` is safe anywhere. */\nconst DEFAULT_APP_TRANSLATOR: AppTranslator = createAppTranslator('en')\n\n/**\n * The translator for the library's built-in UI strings, bound to the active `config.i18n` language.\n * **Lenient** — outside a provider it returns an English translator, so components render standalone\n * (and in tests) with their default English labels. Use it for any built-in string:\n * `t('select.noOptions')`.\n */\nexport function useT(): Translator {\n return useContext(ThemeContext)?.t ?? DEFAULT_TRANSLATOR\n}\n\n/**\n * Translator for the **consuming app's own** strings — the catalogs passed to\n * `<ConfigProvider config={{ i18n: { appMessages } }}>` — bound to the active UI language, so the app's\n * copy switches together with the panel. Free-form string keys; per key it resolves exact code → base\n * language → English (`'en'`) → the key itself, with `{name}` interpolation:\n *\n * ```tsx\n * const t = useTranslations()\n * <PageLayout title={t('customer-transactions.title')} />\n * <p>{t('customer-transactions.count', { count: 128 })}</p>\n * ```\n *\n * **Lenient** — outside a provider (or with no `appMessages`) it echoes the key back, so it's safe\n * anywhere. Use `useT()` for the library's built-in strings; use this for your own.\n */\nexport function useTranslations(): AppTranslator {\n return useContext(ThemeContext)?.appT ?? DEFAULT_APP_TRANSLATOR\n}\n\n/**\n * The active UI language + switcher data: `{ language, setLanguage, languages }`. Lenient outside a\n * provider (English, single language, no-op setter) so it's safe to call anywhere.\n */\nexport function useLanguage(): {\n language: string\n setLanguage: (code: string) => void\n languages: LocaleConfig[]\n} {\n const ctx = useContext(ThemeContext)\n return {\n language: ctx?.language ?? 'en-US',\n setLanguage: ctx?.setLanguage ?? (() => {}),\n languages: ctx?.languages ?? DEFAULT_LANGUAGES,\n }\n}\n\n/**\n * The translations namespace configured on `<ConfigProvider config={{ keys: { translationsNamespace } }}>`,\n * resolved against the built-in default (`'translations'`). Lenient outside a provider. Use it to pass\n * the same namespace to the helpers, e.g. `buildTranslations(codes, fields, useTranslationsNamespace())`.\n */\nexport function useTranslationsNamespace(): string {\n return useContext(ThemeContext)?.translationsNamespace ?? DEFAULT_TRANSLATIONS_NAMESPACE\n}\n\n/**\n * The default top-level tabs query key configured on `<ConfigProvider config={{ keys: { tabQueryKey } }}>`,\n * resolved against the built-in default (`'tab'`). Lenient outside a provider. A top-level `<Tabs>` reads\n * it as the fallback for an omitted `queryKey`, so every tab strip URL-syncs out of the box.\n */\nexport function useTabsQueryKey(): string {\n return useContext(ThemeContext)?.tabQueryKey ?? DEFAULT_TABS_QUERY_KEY\n}\n\n/**\n * The default nested tabs query key configured on\n * `<ConfigProvider config={{ keys: { nestedTabQueryKey } }}>`, resolved against the built-in default\n * (`'nestedTab'`). Lenient outside a provider. A `<Tabs>` nested inside another tab's panel uses this\n * (instead of `tabQueryKey`) so the two strips don't collide on the same URL param.\n */\nexport function useNestedTabQueryKey(): string {\n return useContext(ThemeContext)?.nestedTabQueryKey ?? DEFAULT_NESTED_TAB_QUERY_KEY\n}\n\n/**\n * The default stepper query key configured on `<ConfigProvider config={{ keys: { stepQueryKey } }}>`,\n * resolved against the built-in default (`'step'`). Lenient outside a provider. A `<Stepper queryKey>`\n * (the bare/`true` opt-in form) reads it as the param name; a string `queryKey` overrides it.\n */\nexport function useStepQueryKey(): string {\n return useContext(ThemeContext)?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY\n}\n\n/**\n * The `<Table>` server-request query mapping configured on `<ConfigProvider config={{ table: { query } }}>`\n * (`{}` when unset / outside a provider). `<Table>` merges its own `queryMapping` prop over this, then feeds\n * the result to `buildTableQuery`, which applies the field defaults — so an unconfigured table emits the\n * default page-based `?page=…&size=…&search=…&sort=…` shape.\n */\nexport function useTableQueryConfig(): TableQueryConfig {\n return useContext(ThemeContext)?.tableQuery ?? EMPTY_TABLE_QUERY\n}\n\n/**\n * The app-wide `RootLayout` header config set on `<ConfigProvider config={{ header }}>` (`{}` when\n * unset / outside a provider). `RootLayout` merges its own `header` prop over this (the prop wins), so\n * a specific shell can override the app-wide defaults.\n */\nexport function useHeaderConfig(): HeaderConfig {\n return useContext(ThemeContext)?.header ?? EMPTY_HEADER\n}\n\n/** The app-wide Google Maps settings (`config.maps`; `{}` when unset / outside a provider). */\nexport function useMapsConfig(): MapsConfig {\n return useContext(ThemeContext)?.maps ?? EMPTY_MAPS\n}\n\n/** The active light / dark mode — lenient (`'light'` outside a provider), for components that only read it. */\nexport function useColorMode(): ThemeMode {\n return useContext(ThemeContext)?.mode ?? 'light'\n}\n"],"names":["hexToRgbTriplet","hex","h","int","contrastColor","rgbTriplet","r","g","b","n","CONTRAST_OVERRIDE","applyTheme","theme","target","name","value","triplet","ThemeContext","createContext","STORAGE_KEY","accentStorageKey","mode","HEADER_STICKY_KEY","FONT_STORAGE_KEY","SHAPE_STORAGE_KEY","LOCALE_KEY","DEFAULT_LANGUAGES","DEFAULT_FONT_FAMILY","BUNDLED_FONTS","fontStack","family","ensureFontPreconnect","api","gstatic","ensureFontLoaded","id","link","DEFAULT_TABS_QUERY_KEY","DEFAULT_NESTED_TAB_QUERY_KEY","DEFAULT_STEP_QUERY_KEY","EMPTY_LOCALES","EMPTY_TABLE_QUERY","EMPTY_HEADER","EMPTY_MAPS","DEFAULT_LIGHT_COLORS","DEFAULT_DARK_COLORS","getInitialMode","fallback","stored","getInitialAccentByMode","getInitialHeaderSticky","getInitialFont","getInitialShape","getInitialLanguage","languages","configLanguage","codes","l","c","ConfigProvider","config","children","setModeState","useState","_a","accentByMode","setAccentByMode","headerSticky","setHeaderStickyState","fontFamily","setFontFamilyState","shape","setShapeState","i18nMessages","_b","appMessages","_c","language","setLanguageState","colors","_d","basePalettes","useMemo","light","dark","defaultAccentColors","applyMode","useCallback","nextMode","accent","base","root","useLayoutEffect","breakpointsConfig","_e","setBreakpoints","setMode","next","toggleMode","setAccentColor","color","m","prev","setHeaderSticky","sticky","applyFont","setFontFamily","applyShape","setShape","defaultMode","_f","defaultSticky","_g","defaultFont","_h","defaultShape","_i","hasCustomPreferences","resetPreferences","key","setLanguage","code","t","createTranslator","appT","createAppTranslator","locales","translationsNamespace","_j","DEFAULT_TRANSLATIONS_NAMESPACE","tabQueryKey","_k","nestedTabQueryKey","_l","stepQueryKey","_m","tableQuery","_n","headerConfig","mapsConfig","jsx","useTheme","useContext","useLocales","DEFAULT_TRANSLATOR","DEFAULT_APP_TRANSLATOR","useT","useTranslations","useLanguage","ctx","useTranslationsNamespace","useTabsQueryKey","useNestedTabQueryKey","useStepQueryKey","useTableQueryConfig","useHeaderConfig","useMapsConfig","useColorMode"],"mappings":";;;;;AA6BA,SAASA,GAAgBC,GAAqB;AAC5C,MAAIC,IAAID,EAAI,KAAA,EAAO,QAAQ,MAAM,EAAE;AACnC,EAAIC,EAAE,WAAW,MACfA,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC;AAE5C,QAAMC,IAAM,SAASD,GAAG,EAAE;AAC1B,SAAO,GAAIC,KAAO,KAAM,GAAG,KAAMA,KAAO,IAAK,GAAG,KAAKA,IAAM,GAAG;AAChE;AAOA,SAASC,GAAcC,GAA4B;AACjD,QAAM,CAACC,GAAGC,GAAGC,CAAC,IAAIH,EAAW,MAAM,GAAG,EAAE,IAAI,CAACI,MAAM,OAAOA,EAAE,KAAA,CAAM,CAAC;AAEnE,UADaH,IAAI,MAAMC,IAAI,MAA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gBAAA+C,EAA0B,SAAQrB;AAC3C;AAGO,SAASkH,KAA0B;;AACxC,WAAO7F,IAAA8E,EAAW7H,CAAY,MAAvB,gBAAA+C,EAA0B,SAAQ;AAC3C;"}
@@ -1,2 +0,0 @@
1
- "use strict";const n=require("react/jsx-runtime"),r=require("react"),W=require("clsx"),Ie=require("./formContext-bTWrqdEV.cjs"),Ce=require("./FloatingPanel-tGCG2nhA.cjs"),_=require("./Icon-B6lz-V0A.cjs"),ke=require("./IconButton-CQ25TtBc.cjs"),G=require("./Typography-d97DdbNd.cjs"),je=require("./Calendar-CMNBHtvY.cjs"),t=require("./DatePicker.module-BDtTsg8M.cjs"),Se=require("./ConfigProvider-B_Bb6pk1.cjs"),ge=r.forwardRef(function({label:b,size:C="md",error:J,helperText:K,required:Q=!1,fullWidth:U=!0,disabled:f=!1,value:k,defaultValue:X,onChange:j,format:c="DD/MM/YYYY",valueFormat:S="YYYY-MM-DDTHH:mm:ss",placeholder:Z,min:ee,max:te,disabledDate:g,weekStartsOn:se=1,clearable:re=!0,name:i,id:ne,className:oe,style:ae},u){const F=Se.useT(),le=r.useId(),m=ne??le,O=`${m}-helper`,ce=`${m}-label`,y=Ie.useFormContext(),h=!!(y&&i),o=h?y.field(i):void 0,ie=k!==void 0?k:h?y.values[i]??"":void 0,w=k!==void 0||h,[ue,de]=r.useState(X??""),x=w?ie:ue,a=t.parseValue(x,S),D=J??(o==null?void 0:o.error)??!1,q=K??(o==null?void 0:o.helperText),M=t.parseISO(ee),B=t.parseISO(te),pe=t.maskFromFormat(c),v=e=>{e!==x&&(w||de(e),h&&y.setValue(i,e),j==null||j(e))},P=e=>v(e?t.formatValue(e,S):""),R=e=>!a||!e.isSame(a,"day"),[T,d]=r.useState(()=>a?a.format(c):"");r.useEffect(()=>{d(a?a.format(c):"")},[x,c,S]);const N=r.useRef(null),Y=r.useRef(null),[p,V]=r.useState(!1),[fe,E]=r.useState(()=>a??t.today()),me=r.useCallback(e=>{Y.current=e,typeof u=="function"?u(e):u&&(u.current=e)},[u]),I=r.useRef(void 0);I.current=o?()=>o.onBlur({}):void 0;const H=r.useRef(null),L=r.useCallback(e=>{var s,l;V(!1),(s=I.current)==null||s.call(I),e&&((l=Y.current)==null||l.focus())},[]);r.useEffect(()=>{p&&E(a??t.today())},[p]);const ye=e=>{const s=t.applyMask(e,pe);if(d(s),s===""){v("");return}const l=t.parseInput(s,c);l&&!$(l)&&R(l)&&P(l)},$=e=>M&&e.isBefore(M,"day")||B&&e.isAfter(B,"day")?!0:!!(g&&g(t.toISO(e))),he=e=>{var z,A;const s=t.parseInput(T,c);T===""?v(""):s&&!$(s)?(R(s)&&P(s),d(s.format(c))):d(a?a.format(c):"");const l=e.relatedTarget;l&&((z=H.current)!=null&&z.contains(l)||(A=N.current)!=null&&A.contains(l))||o==null||o.onBlur(e)},xe=e=>{const s=t.parseISO(e);s&&R(s)&&P(s),L(!0)},ve=C==="sm"?"sm":"md";return n.jsxs("div",{className:W.clsx(t.styles.field,t.styles[C],U&&t.styles.fullWidth,D&&t.styles.error,f&&t.styles.disabled,oe),style:ae,children:[b!=null&&n.jsxs("label",{htmlFor:m,className:t.styles.label,children:[n.jsx(G.Typography,{as:"span",variant:"bodySmall",color:"muted",children:b}),Q&&n.jsx("span",{className:t.styles.required,"aria-hidden":"true",children:"*"})]}),n.jsxs("div",{ref:N,className:W.clsx(t.styles.control,p&&t.styles.open),children:[n.jsx("input",{ref:me,id:m,name:i,className:t.styles.input,value:T,placeholder:Z??c.toLowerCase(),disabled:f,inputMode:"numeric",autoComplete:"off","aria-invalid":D||void 0,"aria-describedby":q!=null?O:void 0,onChange:e=>ye(e.target.value),onBlur:he}),re&&x!==""&&!f&&n.jsx("button",{type:"button",className:t.styles.clear,"aria-label":F("datePicker.clear"),tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:()=>{var e;v(""),d(""),(e=Y.current)==null||e.focus()},children:n.jsx(_.Icon,{name:"CloseCircle",size:"sm"})}),n.jsx(ke.IconButton,{type:"button",variant:"text",color:"primary",size:C,disabled:f,"aria-label":F("datePicker.open"),"aria-haspopup":"dialog","aria-expanded":p,className:t.styles.calendarButton,onMouseDown:e=>e.preventDefault(),onClick:()=>V(e=>!e),children:n.jsx(_.Icon,{name:"Calendar3",size:ve})})]}),n.jsx(Ce.FloatingPanel,{ref:H,open:p,triggerRef:N,onClose:L,role:"dialog",ariaLabel:"Choose date",trapFocus:!0,className:t.styles.popover,children:n.jsx(je.Calendar,{value:a,month:fe,onMonthChange:E,onSelect:xe,min:M,max:B,disabledDate:g,weekStartsOn:se,autoFocus:!0,labelId:ce})}),q!=null&&n.jsx(G.Typography,{as:"span",id:O,variant:"bodySmall",color:D?"error":"muted",className:t.styles.helper,children:q})]})});exports.DatePicker=ge;
2
- //# sourceMappingURL=DatePicker-CXRsT-lt.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimePicker-B-Jjejzm.js","sources":["../src/components/DateTimePicker/DateTimePicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { useFormContext } from '../../form/formContext'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tabs } from '../Tabs'\nimport { Typography } from '../Typography'\nimport { Calendar } from '../DatePicker/Calendar'\nimport {\n applyMask,\n localWallToUtc,\n maskFromFormat,\n parseISO,\n parseInput,\n parseValue,\n today,\n toISO,\n utcToLocalWall,\n type Dayjs,\n} from '../DatePicker/dateUtils'\nimport styles from '../DatePicker/DatePicker.module.css'\nimport dt from './DateTimePicker.module.css'\nimport { TimeColumns } from './TimeColumns'\n\nexport type DateTimePickerSize = 'sm' | 'md' | 'lg'\n\nexport interface DateTimePickerProps {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — control height, font and calendar density. */\n size?: DateTimePickerSize\n /** Marks the field invalid: red border/ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Disables the field. */\n disabled?: boolean\n /** Controlled value — a datetime string in `valueFormat` (default ISO datetime; `''` = empty). */\n value?: string\n /** Initial value for uncontrolled use (in `valueFormat`). */\n defaultValue?: string\n /** Fires with the next datetime in `valueFormat` (`''` when cleared). */\n onChange?: (value: string) => void\n /**\n * Display + typed-input format (dayjs tokens). Defaults to `'DD/MM/YYYY HH:mm:ss'` (or `hh:mm:ss A`\n * when `hour12`; the `:ss` is dropped when `showSeconds` is `false`).\n */\n format?: string\n /**\n * Wire format of `value`/`defaultValue`/`onChange` (dayjs tokens), decoupled from the displayed\n * `format`. Defaults to the ISO datetime `'YYYY-MM-DDTHH:mm:ss[Z]'` when `utc` (the `Z` marks the\n * value as UTC, e.g. `'2026-06-10T09:35:00Z'`), or `'YYYY-MM-DDTHH:mm:ss'` (no `Z`) when `utc={false}`.\n * Incoming values are parsed **leniently** (this format, then any ISO-8601 string — so a backend\n * datetime like `'2026-06-10T09:35:49.6134342'` with or without `Z` is accepted).\n */\n valueFormat?: string\n /**\n * Treat the value as **UTC** and display/edit in the viewer's **local** timezone (default `true`).\n * Set `false` to disable timezone conversion entirely — the field shows and emits the value's exact\n * wall-clock (what you pick is what's sent, no UTC shift).\n */\n utc?: boolean\n /** 12-hour clock (1–12 + AM/PM) instead of 24-hour (0–23). Defaults to `false`. */\n hour12?: boolean\n /** Minute increment for the minutes column. Defaults to `1`. */\n minuteStep?: number\n /** Show the seconds column + `:ss` in the default format. Defaults to `true`; pass `false` to hide seconds. */\n showSeconds?: boolean\n /** Placeholder shown when empty. Defaults to the lowercased `format`. */\n placeholder?: string\n /** Earliest selectable date (ISO date or datetime; day-level bound on the calendar). */\n min?: string\n /** Latest selectable date (ISO date or datetime; day-level bound on the calendar). */\n max?: string\n /** Disables specific dates — receives each day as an ISO `'YYYY-MM-DD'` string. */\n disabledDate?: (date: string) => boolean\n /** First day of the week: 0 = Sunday … 6 = Saturday. Defaults to `1` (Monday). */\n weekStartsOn?: number\n /** Shows a clear (×) button when a value is set. Defaults to `true`. */\n clearable?: boolean\n /** Form field name — auto-binds to a surrounding `<Form>` (value is the datetime string). */\n name?: string\n /** Id for the input (label association). */\n id?: string\n className?: string\n style?: CSSProperties\n}\n\nfunction defaultFormatFor(hour12: boolean, showSeconds: boolean): string {\n const time = hour12\n ? showSeconds\n ? 'hh:mm:ss A'\n : 'hh:mm A'\n : showSeconds\n ? 'HH:mm:ss'\n : 'HH:mm'\n return `DD/MM/YYYY ${time}`\n}\n\n/**\n * A datetime field with a typed, masked input **and** a popover combining the keyboard-navigable\n * `Calendar` (date) with scrollable time columns (hour / minute / optional second + AM/PM in 12-hour\n * mode). All math runs in **UTC** so the instant never drifts with the viewer's timezone; the value is a\n * string in `valueFormat` (UTC ISO datetime with a `Z` by default, or no `Z` when `utc={false}`) — incoming values are parsed\n * leniently (a richer backend datetime is accepted) and the chosen instant is emitted in that format.\n * Picking a date keeps the time and vice-versa, and the popover stays open until you click away,\n * press Escape, or hit Done. Supports `hour12`, `minuteStep`, `showSeconds`, `min`/`max`,\n * `disabledDate`, `weekStartsOn`, and `clearable`. Controlled (`value` + `onChange`) or uncontrolled\n * (`defaultValue`), and binds to a surrounding `<Form>` by `name`. Requires the `dayjs` peer dependency.\n */\nexport const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(\n function DateTimePicker(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n disabled = false,\n value,\n defaultValue,\n onChange,\n format: formatProp,\n valueFormat: valueFormatProp,\n utc = true,\n hour12 = false,\n minuteStep = 1,\n showSeconds = true,\n placeholder,\n min,\n max,\n disabledDate,\n weekStartsOn = 1,\n clearable = true,\n name,\n id: idProp,\n className,\n style,\n },\n ref,\n ) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n const labelId = `${id}-label`\n const format = formatProp ?? defaultFormatFor(hour12, showSeconds)\n // when the value is UTC, the wire string carries a `Z` (\"…09:35:00Z\"); `utc={false}` emits the\n // bare wall-clock (no zone designator). Override either via `valueFormat`.\n const valueFormat = valueFormatProp ?? (utc ? 'YYYY-MM-DDTHH:mm:ss[Z]' : 'YYYY-MM-DDTHH:mm:ss')\n\n // ── value (controlled / form-bound / uncontrolled) — a `valueFormat` datetime string ────────────\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = isFormBound ? form!.field(name!) : undefined\n const externalValue =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : undefined\n const isControlled = value !== undefined || isFormBound\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentValue = isControlled ? externalValue! : internal\n // when `utc`, parse the UTC value and show it in the viewer's LOCAL time (value stays UTC, emit\n // converts back); when `utc={false}`, show/emit the value's exact wall-clock (no tz conversion)\n const toDisplay = (instant: Dayjs | null) => (utc ? utcToLocalWall(instant) : instant)\n const selected = toDisplay(parseValue(currentValue, valueFormat))\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const minDate = toDisplay(parseValue(min, valueFormat))\n const maxDate = toDisplay(parseValue(max, valueFormat))\n const mask = maskFromFormat(format)\n // precision the user can actually type — driven by the display `format`, not just `showSeconds`\n const timeUnit = /s/.test(format) ? 'second' : 'minute'\n\n const commit = (next: string) => {\n if (next === currentValue) return // skip redundant onChange / setValue with an unchanged value\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n // emit a datetime in the wire `valueFormat` (time preserved), or '' to clear. Re-picking the same\n // instant is a no-op (string equality alone would leak a spurious emit for sub-second source values)\n const commitDateTime = (d: Dayjs | null) => {\n if (d && selected && d.isSame(selected, 'second')) return\n // local-wall → UTC for the wire value (or emit the wall-clock as-is when `utc={false}`)\n commit(d ? (utc ? localWallToUtc(d) : d).format(valueFormat) : '')\n }\n\n // true when `d` differs from the current value at the input's precision — gates typed-input commits\n // so a no-op round-trip (focus/blur) never rewrites an unchanged value's finer time\n const changed = (d: Dayjs) => !selected || !d.isSame(selected, timeUnit)\n\n // input display text (kept in sync with the committed value; free while typing an incomplete value)\n const [inputText, setInputText] = useState<string>(() =>\n selected ? selected.format(format) : '',\n )\n useEffect(() => {\n setInputText(selected ? selected.format(format) : '')\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentValue, format, valueFormat])\n\n // ── popover ──────────────────────────────────────────────────────────────────────────────────\n const triggerRef = useRef<HTMLDivElement | null>(null)\n const inputRef = useRef<HTMLInputElement | null>(null)\n const [open, setOpen] = useState(false)\n const [viewMonth, setViewMonth] = useState<Dayjs>(() => selected ?? today())\n // which popover tab is active — controlled so picking a day can auto-advance to Time\n const [tab, setTab] = useState<'date' | 'time'>('date')\n const advanceRef = useRef(false) // set when a day-pick advances to Time → move focus there\n\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLInputElement | null }).current = node\n },\n [ref],\n )\n\n const fieldBlurRef = useRef<(() => void) | undefined>(undefined)\n fieldBlurRef.current = bound\n ? () => bound.onBlur({} as FocusEvent<HTMLInputElement>)\n : undefined\n\n // the floating panel forwards its node here, for the blur check + the auto-advance focus move\n const popoverRef = useRef<HTMLDivElement | null>(null)\n\n const closePopover = useCallback((refocus: boolean) => {\n setOpen(false)\n fieldBlurRef.current?.()\n if (refocus) inputRef.current?.focus()\n }, [])\n\n useEffect(() => {\n if (open) {\n setViewMonth(selected ?? today())\n setTab('date') // always open on the Date tab\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open])\n\n // after a day-pick auto-advances to the Time tab, move focus onto it so the focus trap holds\n // (the just-picked calendar cell has unmounted); a manual tab switch never triggers this\n useEffect(() => {\n if (tab === 'time' && advanceRef.current) {\n advanceRef.current = false\n popoverRef.current\n ?.querySelector<HTMLElement>('[role=\"tab\"][aria-selected=\"true\"]')\n ?.focus()\n }\n }, [tab, popoverRef])\n\n const isOutOfRange = (d: Dayjs): boolean => {\n if (minDate && d.isBefore(minDate, 'day')) return true\n if (maxDate && d.isAfter(maxDate, 'day')) return true\n return Boolean(disabledDate && disabledDate(toISO(d)))\n }\n\n const handleInputChange = (raw: string) => {\n const masked = applyMask(raw, mask)\n setInputText(masked)\n if (masked === '') {\n commit('') // emptying the field clears the value\n return\n }\n const parsed = parseInput(masked, format)\n if (parsed && !isOutOfRange(parsed) && changed(parsed)) commitDateTime(parsed)\n }\n\n const handleInputBlur = (event: FocusEvent<HTMLInputElement>) => {\n const parsed = parseInput(inputText, format)\n if (inputText === '') {\n commit('') // an emptied field stays cleared\n } else if (parsed && !isOutOfRange(parsed)) {\n if (changed(parsed)) commitDateTime(parsed)\n setInputText(parsed.format(format))\n } else {\n setInputText(selected ? selected.format(format) : '')\n }\n const nextEl = event.relatedTarget as Node | null\n if (nextEl && (popoverRef.current?.contains(nextEl) || triggerRef.current?.contains(nextEl)))\n return\n bound?.onBlur(event)\n }\n\n // picking a day keeps the current time; picking a time keeps the current day — the popover stays open\n const handleSelectDate = (iso: string) => {\n const date = parseISO(iso)\n if (!date) return\n const base = selected ?? today()\n commitDateTime(date.hour(base.hour()).minute(base.minute()).second(base.second()))\n advanceRef.current = true\n setTab('time') // picking a day advances to the Time tab\n }\n const handleTimeChange = (next: Dayjs) => commitDateTime(next)\n\n const iconSize: 'sm' | 'md' = size === 'sm' ? 'sm' : 'md'\n\n return (\n <div\n className={clsx(\n styles.field,\n styles[size],\n fullWidth && styles.fullWidth,\n resolvedError && styles.error,\n disabled && styles.disabled,\n className,\n )}\n style={style}\n >\n {label != null && (\n <label htmlFor={id} className={styles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div ref={triggerRef} className={clsx(styles.control, open && styles.open)}>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n className={styles.input}\n value={inputText}\n placeholder={placeholder ?? format.toLowerCase()}\n disabled={disabled}\n autoComplete=\"off\"\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n onChange={(e) => handleInputChange(e.target.value)}\n onBlur={handleInputBlur}\n />\n\n {clearable && currentValue !== '' && !disabled && (\n <button\n type=\"button\"\n className={styles.clear}\n aria-label={t('dateTimePicker.clear')}\n tabIndex={-1}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n commit('')\n setInputText('')\n inputRef.current?.focus()\n }}\n >\n <Icon name=\"CloseCircle\" size=\"sm\" />\n </button>\n )}\n\n <IconButton\n type=\"button\"\n variant=\"text\"\n color=\"primary\"\n size={size}\n disabled={disabled}\n aria-label={t('dateTimePicker.open')}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={styles.calendarButton}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setOpen((o) => !o)}\n >\n <Icon name=\"Calendar3\" size={iconSize} />\n </IconButton>\n </div>\n\n <FloatingPanel\n ref={popoverRef}\n open={open}\n triggerRef={triggerRef}\n onClose={closePopover}\n role=\"dialog\"\n ariaLabel=\"Choose date and time\"\n trapFocus\n className={clsx(styles.popover, dt.popover)}\n >\n <Tabs\n className={dt.tabs}\n aria-label={t('dateTimePicker.label')}\n fullWidth\n autoFocus\n // the Date/Time tabs are internal popover UI — never sync them to the page URL\n queryKey={null}\n value={tab}\n onChange={(v) => setTab(v as 'date' | 'time')}\n items={[\n {\n value: 'date',\n label: t('dateTimePicker.dateTab'),\n icon: 'Calendar3',\n content: (\n <Calendar\n value={selected}\n month={viewMonth}\n onMonthChange={setViewMonth}\n onSelect={handleSelectDate}\n min={minDate}\n max={maxDate}\n disabledDate={disabledDate}\n weekStartsOn={weekStartsOn}\n labelId={labelId}\n />\n ),\n },\n {\n value: 'time',\n label: t('dateTimePicker.timeTab'),\n icon: 'Clock',\n content: (\n <div className={dt.timePane}>\n <TimeColumns\n value={selected}\n onChange={handleTimeChange}\n hour12={hour12}\n minuteStep={minuteStep}\n showSeconds={showSeconds}\n />\n </div>\n ),\n },\n ]}\n />\n <div className={dt.footer}>\n <Button size=\"sm\" variant=\"filled\" color=\"primary\" onClick={() => closePopover(true)}>\n {t('common.done')}\n </Button>\n </div>\n </FloatingPanel>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={styles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n },\n)\n"],"names":["defaultFormatFor","hour12","showSeconds","DateTimePicker","forwardRef","label","size","error","helperText","required","fullWidth","disabled","value","defaultValue","onChange","formatProp","valueFormatProp","utc","minuteStep","placeholder","min","max","disabledDate","weekStartsOn","clearable","name","idProp","className","style","ref","t","useT","reactId","useId","id","helperId","labelId","format","valueFormat","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentValue","toDisplay","instant","utcToLocalWall","selected","parseValue","resolvedError","resolvedHelperText","minDate","maxDate","mask","maskFromFormat","timeUnit","commit","next","commitDateTime","d","localWallToUtc","changed","inputText","setInputText","useEffect","triggerRef","useRef","inputRef","open","setOpen","viewMonth","setViewMonth","today","tab","setTab","advanceRef","setInputRef","useCallback","node","fieldBlurRef","popoverRef","closePopover","refocus","_a","_b","isOutOfRange","toISO","handleInputChange","raw","masked","applyMask","parsed","parseInput","handleInputBlur","event","nextEl","handleSelectDate","iso","date","parseISO","base","handleTimeChange","iconSize","jsxs","clsx","styles","jsx","Typography","Icon","IconButton","o","FloatingPanel","dt","Tabs","v","Calendar","TimeColumns","Button"],"mappings":";;;;;;;;;;;;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AnC;AAAA,4BACA,cAAAC;AAAA,4BACA,SAAAa;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBACF;AAAA,sBAGJ;AAAA,wBACE,OAAO;AAAA,wBACP,OAAON,EAAE,wBAAwB;AAAA,wBACjC,MAAM;AAAA,wBACN,SACE,gBAAAiF,EAAC,OAAA,EAAI,WAAWM,EAAG,UACjB,UAAA,gBAAAN;AAAA,0BAACU;AAAA,0BAAA;AAAA,4BACC,OAAOrE;AAAA,4BACP,UAAUsD;AAAA,4BACV,QAAAzG;AAAA,4BACA,YAAAiB;AAAA,4BACA,aAAAhB;AAAA,0BAAA;AAAA,wBAAA,EACF,CACF;AAAA,sBAAA;AAAA,oBAEJ;AAAA,kBACF;AAAA,gBAAA;AAAA,gBAEF,gBAAA6G,EAAC,SAAI,WAAWM,EAAG,QACjB,UAAA,gBAAAN,EAACW,IAAA,EAAO,MAAK,MAAK,SAAQ,UAAS,OAAM,WAAU,SAAS,MAAMpC,GAAa,EAAI,GAChF,UAAAxD,EAAE,aAAa,EAAA,CAClB,EAAA,CACF;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGDyB,KAAsB,QACrB,gBAAAwD;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,IAAG;AAAA,cACH,IAAI7E;AAAA,cACJ,SAAQ;AAAA,cACR,OAAOmB,IAAgB,UAAU;AAAA,cACjC,WAAWwD,EAAO;AAAA,cAEjB,UAAAvD;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
@@ -1,2 +0,0 @@
1
- "use strict";const r=require("react/jsx-runtime"),a=require("react"),A=require("clsx"),Ne=require("./formContext-bTWrqdEV.cjs"),Re=require("./FloatingPanel-tGCG2nhA.cjs"),Ye=require("./Button-CYZoF18-.cjs"),te=require("./Icon-B6lz-V0A.cjs"),He=require("./IconButton-CQ25TtBc.cjs"),Ve=require("./Tabs-BAKPWO4g.cjs"),se=require("./Typography-d97DdbNd.cjs"),Ee=require("./Calendar-CMNBHtvY.cjs"),t=require("./DatePicker.module-BDtTsg8M.cjs"),y=require("./TimeColumns-DkJsIu1w.cjs"),Oe=require("./ConfigProvider-B_Bb6pk1.cjs");function we(L,u){return`DD/MM/YYYY ${L?u?"hh:mm:ss A":"hh:mm A":u?"HH:mm:ss":"HH:mm"}`}const We=a.forwardRef(function({label:u,size:v="md",error:re,helperText:ae,required:oe=!1,fullWidth:ne=!0,disabled:x=!1,value:g,defaultValue:le,onChange:P,format:ce,valueFormat:ie,utc:F=!0,hour12:$=!1,minuteStep:ue=1,showSeconds:z=!0,placeholder:me,min:de,max:fe,disabledDate:S,weekStartsOn:pe=1,clearable:he=!0,name:m,id:ye,className:ve,style:xe},d){const i=Oe.useT(),Te=a.useId(),T=ye??Te,U=`${T}-helper`,Ce=`${T}-label`,c=ce??we($,z),f=ie??(F?"YYYY-MM-DDTHH:mm:ss[Z]":"YYYY-MM-DDTHH:mm:ss"),C=Ne.useFormContext(),b=!!(C&&m),l=b?C.field(m):void 0,be=g!==void 0?g:b?C.values[m]??"":void 0,K=g!==void 0||b,[je,ke]=a.useState(le??""),j=K?be:je,B=e=>F?t.utcToLocalWall(e):e,o=B(t.parseValue(j,f)),M=re??(l==null?void 0:l.error)??!1,N=ae??(l==null?void 0:l.helperText),R=B(t.parseValue(de,f)),Y=B(t.parseValue(fe,f)),Ie=t.maskFromFormat(c),qe=/s/.test(c)?"second":"minute",k=e=>{e!==j&&(K||ke(e),b&&C.setValue(m,e),P==null||P(e))},I=e=>{e&&o&&e.isSame(o,"second")||k(e?(F?t.localWallToUtc(e):e).format(f):"")},Z=e=>!o||!e.isSame(o,qe),[H,p]=a.useState(()=>o?o.format(c):"");a.useEffect(()=>{p(o?o.format(c):"")},[j,c,f]);const V=a.useRef(null),E=a.useRef(null),[h,_]=a.useState(!1),[De,G]=a.useState(()=>o??t.today()),[O,w]=a.useState("date"),W=a.useRef(!1),ge=a.useCallback(e=>{E.current=e,typeof d=="function"?d(e):d&&(d.current=e)},[d]),q=a.useRef(void 0);q.current=l?()=>l.onBlur({}):void 0;const D=a.useRef(null),J=a.useCallback(e=>{var s,n;_(!1),(s=q.current)==null||s.call(q),e&&((n=E.current)==null||n.focus())},[]);a.useEffect(()=>{h&&(G(o??t.today()),w("date"))},[h]),a.useEffect(()=>{var e,s;O==="time"&&W.current&&(W.current=!1,(s=(e=D.current)==null?void 0:e.querySelector('[role="tab"][aria-selected="true"]'))==null||s.focus())},[O,D]);const Q=e=>R&&e.isBefore(R,"day")||Y&&e.isAfter(Y,"day")?!0:!!(S&&S(t.toISO(e))),Pe=e=>{const s=t.applyMask(e,Ie);if(p(s),s===""){k("");return}const n=t.parseInput(s,c);n&&!Q(n)&&Z(n)&&I(n)},Fe=e=>{var X,ee;const s=t.parseInput(H,c);H===""?k(""):s&&!Q(s)?(Z(s)&&I(s),p(s.format(c))):p(o?o.format(c):"");const n=e.relatedTarget;n&&((X=D.current)!=null&&X.contains(n)||(ee=V.current)!=null&&ee.contains(n))||l==null||l.onBlur(e)},Se=e=>{const s=t.parseISO(e);if(!s)return;const n=o??t.today();I(s.hour(n.hour()).minute(n.minute()).second(n.second())),W.current=!0,w("time")},Be=e=>I(e),Me=v==="sm"?"sm":"md";return r.jsxs("div",{className:A.clsx(t.styles.field,t.styles[v],ne&&t.styles.fullWidth,M&&t.styles.error,x&&t.styles.disabled,ve),style:xe,children:[u!=null&&r.jsxs("label",{htmlFor:T,className:t.styles.label,children:[r.jsx(se.Typography,{as:"span",variant:"bodySmall",color:"muted",children:u}),oe&&r.jsx("span",{className:t.styles.required,"aria-hidden":"true",children:"*"})]}),r.jsxs("div",{ref:V,className:A.clsx(t.styles.control,h&&t.styles.open),children:[r.jsx("input",{ref:ge,id:T,name:m,className:t.styles.input,value:H,placeholder:me??c.toLowerCase(),disabled:x,autoComplete:"off","aria-invalid":M||void 0,"aria-describedby":N!=null?U:void 0,onChange:e=>Pe(e.target.value),onBlur:Fe}),he&&j!==""&&!x&&r.jsx("button",{type:"button",className:t.styles.clear,"aria-label":i("dateTimePicker.clear"),tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:()=>{var e;k(""),p(""),(e=E.current)==null||e.focus()},children:r.jsx(te.Icon,{name:"CloseCircle",size:"sm"})}),r.jsx(He.IconButton,{type:"button",variant:"text",color:"primary",size:v,disabled:x,"aria-label":i("dateTimePicker.open"),"aria-haspopup":"dialog","aria-expanded":h,className:t.styles.calendarButton,onMouseDown:e=>e.preventDefault(),onClick:()=>_(e=>!e),children:r.jsx(te.Icon,{name:"Calendar3",size:Me})})]}),r.jsxs(Re.FloatingPanel,{ref:D,open:h,triggerRef:V,onClose:J,role:"dialog",ariaLabel:"Choose date and time",trapFocus:!0,className:A.clsx(t.styles.popover,y.dt.popover),children:[r.jsx(Ve.Tabs,{className:y.dt.tabs,"aria-label":i("dateTimePicker.label"),fullWidth:!0,autoFocus:!0,queryKey:null,value:O,onChange:e=>w(e),items:[{value:"date",label:i("dateTimePicker.dateTab"),icon:"Calendar3",content:r.jsx(Ee.Calendar,{value:o,month:De,onMonthChange:G,onSelect:Se,min:R,max:Y,disabledDate:S,weekStartsOn:pe,labelId:Ce})},{value:"time",label:i("dateTimePicker.timeTab"),icon:"Clock",content:r.jsx("div",{className:y.dt.timePane,children:r.jsx(y.TimeColumns,{value:o,onChange:Be,hour12:$,minuteStep:ue,showSeconds:z})})}]}),r.jsx("div",{className:y.dt.footer,children:r.jsx(Ye.Button,{size:"sm",variant:"filled",color:"primary",onClick:()=>J(!0),children:i("common.done")})})]}),N!=null&&r.jsx(se.Typography,{as:"span",id:U,variant:"bodySmall",color:M?"error":"muted",className:t.styles.helper,children:N})]})});exports.DateTimePicker=We;
2
- //# sourceMappingURL=DateTimePicker-BuTIRTUX.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimePicker-BuTIRTUX.cjs","sources":["../src/components/DateTimePicker/DateTimePicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { useFormContext } from '../../form/formContext'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tabs } from '../Tabs'\nimport { Typography } from '../Typography'\nimport { Calendar } from '../DatePicker/Calendar'\nimport {\n applyMask,\n localWallToUtc,\n maskFromFormat,\n parseISO,\n parseInput,\n parseValue,\n today,\n toISO,\n utcToLocalWall,\n type Dayjs,\n} from '../DatePicker/dateUtils'\nimport styles from '../DatePicker/DatePicker.module.css'\nimport dt from './DateTimePicker.module.css'\nimport { TimeColumns } from './TimeColumns'\n\nexport type DateTimePickerSize = 'sm' | 'md' | 'lg'\n\nexport interface DateTimePickerProps {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — control height, font and calendar density. */\n size?: DateTimePickerSize\n /** Marks the field invalid: red border/ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Disables the field. */\n disabled?: boolean\n /** Controlled value — a datetime string in `valueFormat` (default ISO datetime; `''` = empty). */\n value?: string\n /** Initial value for uncontrolled use (in `valueFormat`). */\n defaultValue?: string\n /** Fires with the next datetime in `valueFormat` (`''` when cleared). */\n onChange?: (value: string) => void\n /**\n * Display + typed-input format (dayjs tokens). Defaults to `'DD/MM/YYYY HH:mm:ss'` (or `hh:mm:ss A`\n * when `hour12`; the `:ss` is dropped when `showSeconds` is `false`).\n */\n format?: string\n /**\n * Wire format of `value`/`defaultValue`/`onChange` (dayjs tokens), decoupled from the displayed\n * `format`. Defaults to the ISO datetime `'YYYY-MM-DDTHH:mm:ss[Z]'` when `utc` (the `Z` marks the\n * value as UTC, e.g. `'2026-06-10T09:35:00Z'`), or `'YYYY-MM-DDTHH:mm:ss'` (no `Z`) when `utc={false}`.\n * Incoming values are parsed **leniently** (this format, then any ISO-8601 string — so a backend\n * datetime like `'2026-06-10T09:35:49.6134342'` with or without `Z` is accepted).\n */\n valueFormat?: string\n /**\n * Treat the value as **UTC** and display/edit in the viewer's **local** timezone (default `true`).\n * Set `false` to disable timezone conversion entirely — the field shows and emits the value's exact\n * wall-clock (what you pick is what's sent, no UTC shift).\n */\n utc?: boolean\n /** 12-hour clock (1–12 + AM/PM) instead of 24-hour (0–23). Defaults to `false`. */\n hour12?: boolean\n /** Minute increment for the minutes column. Defaults to `1`. */\n minuteStep?: number\n /** Show the seconds column + `:ss` in the default format. Defaults to `true`; pass `false` to hide seconds. */\n showSeconds?: boolean\n /** Placeholder shown when empty. Defaults to the lowercased `format`. */\n placeholder?: string\n /** Earliest selectable date (ISO date or datetime; day-level bound on the calendar). */\n min?: string\n /** Latest selectable date (ISO date or datetime; day-level bound on the calendar). */\n max?: string\n /** Disables specific dates — receives each day as an ISO `'YYYY-MM-DD'` string. */\n disabledDate?: (date: string) => boolean\n /** First day of the week: 0 = Sunday … 6 = Saturday. Defaults to `1` (Monday). */\n weekStartsOn?: number\n /** Shows a clear (×) button when a value is set. Defaults to `true`. */\n clearable?: boolean\n /** Form field name — auto-binds to a surrounding `<Form>` (value is the datetime string). */\n name?: string\n /** Id for the input (label association). */\n id?: string\n className?: string\n style?: CSSProperties\n}\n\nfunction defaultFormatFor(hour12: boolean, showSeconds: boolean): string {\n const time = hour12\n ? showSeconds\n ? 'hh:mm:ss A'\n : 'hh:mm A'\n : showSeconds\n ? 'HH:mm:ss'\n : 'HH:mm'\n return `DD/MM/YYYY ${time}`\n}\n\n/**\n * A datetime field with a typed, masked input **and** a popover combining the keyboard-navigable\n * `Calendar` (date) with scrollable time columns (hour / minute / optional second + AM/PM in 12-hour\n * mode). All math runs in **UTC** so the instant never drifts with the viewer's timezone; the value is a\n * string in `valueFormat` (UTC ISO datetime with a `Z` by default, or no `Z` when `utc={false}`) — incoming values are parsed\n * leniently (a richer backend datetime is accepted) and the chosen instant is emitted in that format.\n * Picking a date keeps the time and vice-versa, and the popover stays open until you click away,\n * press Escape, or hit Done. Supports `hour12`, `minuteStep`, `showSeconds`, `min`/`max`,\n * `disabledDate`, `weekStartsOn`, and `clearable`. Controlled (`value` + `onChange`) or uncontrolled\n * (`defaultValue`), and binds to a surrounding `<Form>` by `name`. Requires the `dayjs` peer dependency.\n */\nexport const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(\n function DateTimePicker(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n disabled = false,\n value,\n defaultValue,\n onChange,\n format: formatProp,\n valueFormat: valueFormatProp,\n utc = true,\n hour12 = false,\n minuteStep = 1,\n showSeconds = true,\n placeholder,\n min,\n max,\n disabledDate,\n weekStartsOn = 1,\n clearable = true,\n name,\n id: idProp,\n className,\n style,\n },\n ref,\n ) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n const labelId = `${id}-label`\n const format = formatProp ?? defaultFormatFor(hour12, showSeconds)\n // when the value is UTC, the wire string carries a `Z` (\"…09:35:00Z\"); `utc={false}` emits the\n // bare wall-clock (no zone designator). Override either via `valueFormat`.\n const valueFormat = valueFormatProp ?? (utc ? 'YYYY-MM-DDTHH:mm:ss[Z]' : 'YYYY-MM-DDTHH:mm:ss')\n\n // ── value (controlled / form-bound / uncontrolled) — a `valueFormat` datetime string ────────────\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = isFormBound ? form!.field(name!) : undefined\n const externalValue =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : undefined\n const isControlled = value !== undefined || isFormBound\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentValue = isControlled ? externalValue! : internal\n // when `utc`, parse the UTC value and show it in the viewer's LOCAL time (value stays UTC, emit\n // converts back); when `utc={false}`, show/emit the value's exact wall-clock (no tz conversion)\n const toDisplay = (instant: Dayjs | null) => (utc ? utcToLocalWall(instant) : instant)\n const selected = toDisplay(parseValue(currentValue, valueFormat))\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const minDate = toDisplay(parseValue(min, valueFormat))\n const maxDate = toDisplay(parseValue(max, valueFormat))\n const mask = maskFromFormat(format)\n // precision the user can actually type — driven by the display `format`, not just `showSeconds`\n const timeUnit = /s/.test(format) ? 'second' : 'minute'\n\n const commit = (next: string) => {\n if (next === currentValue) return // skip redundant onChange / setValue with an unchanged value\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n // emit a datetime in the wire `valueFormat` (time preserved), or '' to clear. Re-picking the same\n // instant is a no-op (string equality alone would leak a spurious emit for sub-second source values)\n const commitDateTime = (d: Dayjs | null) => {\n if (d && selected && d.isSame(selected, 'second')) return\n // local-wall → UTC for the wire value (or emit the wall-clock as-is when `utc={false}`)\n commit(d ? (utc ? localWallToUtc(d) : d).format(valueFormat) : '')\n }\n\n // true when `d` differs from the current value at the input's precision — gates typed-input commits\n // so a no-op round-trip (focus/blur) never rewrites an unchanged value's finer time\n const changed = (d: Dayjs) => !selected || !d.isSame(selected, timeUnit)\n\n // input display text (kept in sync with the committed value; free while typing an incomplete value)\n const [inputText, setInputText] = useState<string>(() =>\n selected ? selected.format(format) : '',\n )\n useEffect(() => {\n setInputText(selected ? selected.format(format) : '')\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentValue, format, valueFormat])\n\n // ── popover ──────────────────────────────────────────────────────────────────────────────────\n const triggerRef = useRef<HTMLDivElement | null>(null)\n const inputRef = useRef<HTMLInputElement | null>(null)\n const [open, setOpen] = useState(false)\n const [viewMonth, setViewMonth] = useState<Dayjs>(() => selected ?? today())\n // which popover tab is active — controlled so picking a day can auto-advance to Time\n const [tab, setTab] = useState<'date' | 'time'>('date')\n const advanceRef = useRef(false) // set when a day-pick advances to Time → move focus there\n\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLInputElement | null }).current = node\n },\n [ref],\n )\n\n const fieldBlurRef = useRef<(() => void) | undefined>(undefined)\n fieldBlurRef.current = bound\n ? () => bound.onBlur({} as FocusEvent<HTMLInputElement>)\n : undefined\n\n // the floating panel forwards its node here, for the blur check + the auto-advance focus move\n const popoverRef = useRef<HTMLDivElement | null>(null)\n\n const closePopover = useCallback((refocus: boolean) => {\n setOpen(false)\n fieldBlurRef.current?.()\n if (refocus) inputRef.current?.focus()\n }, [])\n\n useEffect(() => {\n if (open) {\n setViewMonth(selected ?? today())\n setTab('date') // always open on the Date tab\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open])\n\n // after a day-pick auto-advances to the Time tab, move focus onto it so the focus trap holds\n // (the just-picked calendar cell has unmounted); a manual tab switch never triggers this\n useEffect(() => {\n if (tab === 'time' && advanceRef.current) {\n advanceRef.current = false\n popoverRef.current\n ?.querySelector<HTMLElement>('[role=\"tab\"][aria-selected=\"true\"]')\n ?.focus()\n }\n }, [tab, popoverRef])\n\n const isOutOfRange = (d: Dayjs): boolean => {\n if (minDate && d.isBefore(minDate, 'day')) return true\n if (maxDate && d.isAfter(maxDate, 'day')) return true\n return Boolean(disabledDate && disabledDate(toISO(d)))\n }\n\n const handleInputChange = (raw: string) => {\n const masked = applyMask(raw, mask)\n setInputText(masked)\n if (masked === '') {\n commit('') // emptying the field clears the value\n return\n }\n const parsed = parseInput(masked, format)\n if (parsed && !isOutOfRange(parsed) && changed(parsed)) commitDateTime(parsed)\n }\n\n const handleInputBlur = (event: FocusEvent<HTMLInputElement>) => {\n const parsed = parseInput(inputText, format)\n if (inputText === '') {\n commit('') // an emptied field stays cleared\n } else if (parsed && !isOutOfRange(parsed)) {\n if (changed(parsed)) commitDateTime(parsed)\n setInputText(parsed.format(format))\n } else {\n setInputText(selected ? selected.format(format) : '')\n }\n const nextEl = event.relatedTarget as Node | null\n if (nextEl && (popoverRef.current?.contains(nextEl) || triggerRef.current?.contains(nextEl)))\n return\n bound?.onBlur(event)\n }\n\n // picking a day keeps the current time; picking a time keeps the current day — the popover stays open\n const handleSelectDate = (iso: string) => {\n const date = parseISO(iso)\n if (!date) return\n const base = selected ?? today()\n commitDateTime(date.hour(base.hour()).minute(base.minute()).second(base.second()))\n advanceRef.current = true\n setTab('time') // picking a day advances to the Time tab\n }\n const handleTimeChange = (next: Dayjs) => commitDateTime(next)\n\n const iconSize: 'sm' | 'md' = size === 'sm' ? 'sm' : 'md'\n\n return (\n <div\n className={clsx(\n styles.field,\n styles[size],\n fullWidth && styles.fullWidth,\n resolvedError && styles.error,\n disabled && styles.disabled,\n className,\n )}\n style={style}\n >\n {label != null && (\n <label htmlFor={id} className={styles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div ref={triggerRef} className={clsx(styles.control, open && styles.open)}>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n className={styles.input}\n value={inputText}\n placeholder={placeholder ?? format.toLowerCase()}\n disabled={disabled}\n autoComplete=\"off\"\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n onChange={(e) => handleInputChange(e.target.value)}\n onBlur={handleInputBlur}\n />\n\n {clearable && currentValue !== '' && !disabled && (\n <button\n type=\"button\"\n className={styles.clear}\n aria-label={t('dateTimePicker.clear')}\n tabIndex={-1}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => {\n commit('')\n setInputText('')\n inputRef.current?.focus()\n }}\n >\n <Icon name=\"CloseCircle\" size=\"sm\" />\n </button>\n )}\n\n <IconButton\n type=\"button\"\n variant=\"text\"\n color=\"primary\"\n size={size}\n disabled={disabled}\n aria-label={t('dateTimePicker.open')}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={styles.calendarButton}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setOpen((o) => !o)}\n >\n <Icon name=\"Calendar3\" size={iconSize} />\n </IconButton>\n </div>\n\n <FloatingPanel\n ref={popoverRef}\n open={open}\n triggerRef={triggerRef}\n onClose={closePopover}\n role=\"dialog\"\n ariaLabel=\"Choose date and time\"\n trapFocus\n className={clsx(styles.popover, dt.popover)}\n >\n <Tabs\n className={dt.tabs}\n aria-label={t('dateTimePicker.label')}\n fullWidth\n autoFocus\n // the Date/Time tabs are internal popover UI — never sync them to the page URL\n queryKey={null}\n value={tab}\n onChange={(v) => setTab(v as 'date' | 'time')}\n items={[\n {\n value: 'date',\n label: t('dateTimePicker.dateTab'),\n icon: 'Calendar3',\n content: (\n <Calendar\n value={selected}\n month={viewMonth}\n onMonthChange={setViewMonth}\n onSelect={handleSelectDate}\n min={minDate}\n max={maxDate}\n disabledDate={disabledDate}\n weekStartsOn={weekStartsOn}\n labelId={labelId}\n />\n ),\n },\n {\n value: 'time',\n label: t('dateTimePicker.timeTab'),\n icon: 'Clock',\n content: (\n <div className={dt.timePane}>\n <TimeColumns\n value={selected}\n onChange={handleTimeChange}\n hour12={hour12}\n minuteStep={minuteStep}\n showSeconds={showSeconds}\n />\n </div>\n ),\n },\n ]}\n />\n <div className={dt.footer}>\n <Button size=\"sm\" variant=\"filled\" color=\"primary\" onClick={() => closePopover(true)}>\n {t('common.done')}\n </Button>\n </div>\n </FloatingPanel>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={styles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n },\n)\n"],"names":["defaultFormatFor","hour12","showSeconds","DateTimePicker","forwardRef","label","size","error","helperText","required","fullWidth","disabled","value","defaultValue","onChange","formatProp","valueFormatProp","utc","minuteStep","placeholder","min","max","disabledDate","weekStartsOn","clearable","name","idProp","className","style","ref","t","useT","reactId","useId","id","helperId","labelId","format","valueFormat","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentValue","toDisplay","instant","utcToLocalWall","selected","parseValue","resolvedError","resolvedHelperText","minDate","maxDate","mask","maskFromFormat","timeUnit","commit","next","commitDateTime","d","localWallToUtc","changed","inputText","setInputText","useEffect","triggerRef","useRef","inputRef","open","setOpen","viewMonth","setViewMonth","today","tab","setTab","advanceRef","setInputRef","useCallback","node","fieldBlurRef","popoverRef","closePopover","refocus","_a","_b","isOutOfRange","toISO","handleInputChange","raw","masked","applyMask","parsed","parseInput","handleInputBlur","event","nextEl","handleSelectDate","iso","date","parseISO","base","handleTimeChange","iconSize","jsxs","clsx","styles","jsx","Typography","Icon","IconButton","o","FloatingPanel","dt","Tabs","v","Calendar","TimeColumns","Button"],"mappings":"2gBAyGA,SAASA,GAAiBC,EAAiBC,EAA8B,CAQvE,MAAO,cAPMD,EACTC,EACE,aACA,UACFA,EACE,WACA,OACmB,EAC3B,CAaO,MAAMC,GAAiBC,EAAAA,WAC5B,SACE,CACE,MAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,GACA,WAAAC,GACA,SAAAC,GAAW,GACX,UAAAC,GAAY,GACZ,SAAAC,EAAW,GACX,MAAAC,EACA,aAAAC,GACA,SAAAC,EACA,OAAQC,GACR,YAAaC,GACb,IAAAC,EAAM,GACN,OAAAhB,EAAS,GACT,WAAAiB,GAAa,EACb,YAAAhB,EAAc,GACd,YAAAiB,GACA,IAAAC,GACA,IAAAC,GACA,aAAAC,EACA,aAAAC,GAAe,EACf,UAAAC,GAAY,GACZ,KAAAC,EACA,GAAIC,GACJ,UAAAC,GACA,MAAAC,EAAA,EAEFC,EACA,CACA,MAAMC,EAAIC,GAAAA,KAAA,EACJC,GAAUC,EAAAA,MAAA,EACVC,EAAKR,IAAUM,GACfG,EAAW,GAAGD,CAAE,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AAA,YAAA,CACC,MAAOrE,EACP,SAAUsD,GACV,OAAAzG,EACA,WAAAiB,GACA,YAAAhB,CAAA,CAAA,CACF,CACF,CAAA,CAEJ,CACF,CAAA,EAEF6G,EAAAA,IAAC,OAAI,UAAWM,KAAG,OACjB,SAAAN,MAACW,GAAAA,OAAA,CAAO,KAAK,KAAK,QAAQ,SAAS,MAAM,UAAU,QAAS,IAAMpC,EAAa,EAAI,EAChF,SAAAxD,EAAE,aAAa,CAAA,CAClB,CAAA,CACF,CAAA,CAAA,CAAA,EAGDyB,GAAsB,MACrBwD,EAAAA,IAACC,GAAAA,WAAA,CACC,GAAG,OACH,GAAI7E,EACJ,QAAQ,YACR,MAAOmB,EAAgB,QAAU,QACjC,UAAWwD,EAAAA,OAAO,OAEjB,SAAAvD,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DescriptionList-CG08_qwT.js","sources":["../src/components/DescriptionList/DescriptionList.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { resolveResponsive, type Breakpoint, type Responsive } from '../../theme/breakpoints'\nimport { useBreakpointMatches } from '../../hooks/useMediaQuery'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Icon } from '../Icon'\nimport { CopyButton } from '../CopyButton'\nimport { IconButton } from '../IconButton'\nimport { Skeleton } from '../Skeleton'\nimport { Typography } from '../Typography'\nimport styles from './DescriptionList.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type DescriptionListSize = 'sm' | 'md' | 'lg'\nexport type DescriptionListLayout = 'vertical' | 'horizontal'\nexport type DescriptionListColumns = 1 | 2 | 3 | 4\nexport type DescriptionListValueWeight = 'regular' | 'medium' | 'bold'\n\nexport interface DescriptionItem {\n /** Stable key (defaults to the index). */\n key?: string\n /** The term — \"Entry fee\". */\n label: ReactNode\n /** The value. `null` / `undefined` / `''` / `false` render the `emptyText` placeholder (\"—\"). */\n value?: ReactNode\n /** Columns this pair spans (clamped to the resolved column count) — for long text, addresses, lists. */\n span?: DescriptionListColumns\n /** Show a copy button: `true` copies a string/number `value`; pass a string to copy something else (an id behind a label). */\n copyable?: boolean | string\n /** Drop the pair entirely (e.g. by role). */\n hidden?: boolean\n /** Small leading icon in the label — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n}\n\nexport interface DescriptionListProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'color'\n> {\n /** The label / value pairs, in order. Declarative so `loading` skeletons and `hidden` stay trivial. */\n items: DescriptionItem[]\n /** Column count — a number or a desktop-first breakpoint map. Defaults to `{ xs: 1, sm: 2, lg: 3 }`. */\n columns?: Responsive<DescriptionListColumns>\n /** `vertical` (label above value, default) or `horizontal` (label beside value; stacks again on phones). */\n layout?: DescriptionListLayout\n /** Text + spacing scale. Defaults to `md`. */\n size?: DescriptionListSize\n /** Font weight of the values. Defaults to `regular` (the library's body default); `medium` / `bold` add emphasis. */\n valueWeight?: DescriptionListValueWeight\n /** Frame the list as a surface card (border + radius); `horizontal` also tints the label column. */\n bordered?: boolean\n /** Hairlines between rows. Defaults to `true` (turn off inside an already-ruled container). */\n dividers?: boolean\n /** Label column width for `horizontal` (px number or CSS length). Defaults to `160px`. */\n labelWidth?: number | string\n /**\n * `horizontal` only — the breakpoint at (and below) which the label stacks back above the value.\n * A breakpoint token (`'xxs'` ≤ 576px default, `'xs'` ≤ 768px, …) or `false` to keep the two columns\n * side by side at every width. Uses the shared JS breakpoint layer, so `config.theme.breakpoints` applies.\n */\n stackBelow?: Breakpoint | false\n /** Render shimmering placeholders instead of values — `true` uses `items.length` rows, a number sets the count. */\n loading?: boolean | number\n /** Placeholder for an empty value. Defaults to `\"—\"`. */\n emptyText?: ReactNode\n /** Optional header title. */\n title?: ReactNode\n /** Leading header icon (a tinted box before the title, like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the header icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Muted line under the title. */\n subtitle?: ReactNode\n /** Header slot on the right (buttons, a status chip …). */\n actions?: ReactNode\n}\n\nconst DEFAULT_COLUMNS: Responsive<DescriptionListColumns> = { xs: 1, sm: 2, lg: 3 }\n\nconst isEmpty = (value: ReactNode) => value == null || value === '' || value === false\n\n/** What `copyable` copies: an explicit string, else a string / number value; nothing for rich nodes. */\nconst copyTextOf = (item: DescriptionItem): string | undefined => {\n if (typeof item.copyable === 'string') return item.copyable\n if (typeof item.value === 'string' || typeof item.value === 'number') return String(item.value)\n return undefined\n}\n\n/** Lay the items on a `cols`-wide grid the way CSS auto-placement will (spans clamped, wrapping rows). */\nconst placeItems = (items: DescriptionItem[], cols: number) => {\n let row = 0\n let col = 0\n return items.map((item) => {\n const span = Math.min(item.span ?? 1, cols)\n if (col + span > cols) {\n row += 1\n col = 0\n }\n const placed = { item, span, row, col }\n col += span\n if (col >= cols) {\n row += 1\n col = 0\n }\n return placed\n })\n}\n\nconst renderIcon = (icon: IconName | ReactNode, size: 'sm' | 'md' = 'sm') =>\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={size} />\n ) : (\n icon\n )\n\n/**\n * Label / value pairs for a **detail page** (the read-only twin of a form: \"User #42\" → Name, Email,\n * Role …). Renders a semantic `<dl>` of `<dt>` / `<dd>` groups laid out on a responsive CSS grid\n * (`columns`, desktop-first breakpoint map — default 1 → 2 → 3), each pair optionally spanning several\n * columns. An optional Card-style header carries an `icon` box (tinted by `color`), `title`,\n * `subtitle` and `actions`. Values are regular weight by default (`valueWeight` adds emphasis) and any node: `null` / `''` show a muted \"—\" placeholder (`emptyText`), string / number\n * values can grow a `CopyButton` (revealed on hover / focus; always visible without hover), and\n * `hidden` drops a pair (e.g. by role). `layout=\"horizontal\"` puts the label beside the value in a\n * `labelWidth` column and stacks back on phones (`stackBelow` — a breakpoint, or `false` to never stack); `bordered` frames the list as a surface card (tinting the\n * label column when horizontal). `loading` swaps the values for `Skeleton` lines of the same shape.\n * Rows are separated by hairline `dividers`. Token-only; the grid is never `overflow: hidden` so the\n * copy tooltip is never clipped. `forwardRef` to the root `<div>`.\n */\nexport const DescriptionList = forwardRef<HTMLDivElement, DescriptionListProps>(\n function DescriptionList(\n {\n items,\n columns = DEFAULT_COLUMNS,\n layout = 'vertical',\n size = 'md',\n valueWeight = 'regular',\n bordered = false,\n dividers = true,\n labelWidth = 160,\n stackBelow = 'xxs',\n loading = false,\n emptyText = '\\u2014',\n title,\n icon,\n color = 'accent',\n subtitle,\n actions,\n className,\n style,\n ...props\n },\n ref,\n ) {\n const t = useT()\n const id = useId()\n const titleId = `${id}-title`\n const matches = useBreakpointMatches()\n const cols = resolveResponsive(columns, matches) ?? 1\n const stacked = layout === 'horizontal' && stackBelow !== false && matches[stackBelow]\n\n const visible = items.filter((item) => !item.hidden)\n // Grid placement (span-aware) — the last row drops its hairline (nothing follows it, and in `bordered`\n // it would double the frame's border), and its first cell rounds the frame's bottom-left corner\n // (`bordered` + `horizontal` tints the label column, and that tint must not bleed past the radius).\n const placed = placeItems(visible, cols)\n const lastRow = placed.length ? placed[placed.length - 1].row : 0\n const skeletonRows = typeof loading === 'number' ? loading : visible.length || 6\n const hasHeader = title != null || subtitle != null || actions != null || icon != null\n\n const vars = {\n '--dl-cols': cols,\n '--dl-label-w': typeof labelWidth === 'number' ? `${labelWidth}px` : labelWidth,\n } as CSSProperties\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.root,\n styles[size],\n styles[layout],\n valueWeight !== 'regular' && styles[`value${valueWeight === 'bold' ? 'Bold' : 'Medium'}`],\n bordered && styles.bordered,\n dividers && styles.dividers,\n stacked && styles.stacked,\n className,\n )}\n style={{ ...vars, ...style }}\n {...props}\n >\n {hasHeader && (\n <div className={styles.header}>\n <div className={styles.headerMain}>\n {icon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.headerIcon}\n >\n {renderIcon(icon, 'md')}\n </IconButton>\n )}\n {(title != null || subtitle != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <Typography as=\"h3\" id={titleId} variant=\"subtitle\" className={styles.title}>\n {title}\n </Typography>\n )}\n {subtitle != null && (\n <Typography as=\"p\" variant=\"bodySmall\" color=\"muted\">\n {subtitle}\n </Typography>\n )}\n </div>\n )}\n </div>\n {actions != null && <div className={styles.actions}>{actions}</div>}\n </div>\n )}\n\n <dl\n className={styles.grid}\n aria-labelledby={title != null ? titleId : undefined}\n aria-busy={loading ? true : undefined}\n aria-label={loading ? t('descriptionList.loading') : undefined}\n >\n {loading\n ? Array.from({ length: skeletonRows }, (_, i) => (\n <div key={i} className={styles.item} aria-hidden=\"true\">\n <dt className={styles.label}>\n <Skeleton width=\"40%\" height=\"0.9em\" />\n </dt>\n <dd className={styles.value}>\n <Skeleton width=\"70%\" height=\"1.1em\" />\n </dd>\n </div>\n ))\n : placed.map(({ item, span, row, col }, i) => {\n const empty = isEmpty(item.value)\n const copy = !empty && item.copyable ? copyTextOf(item) : undefined\n return (\n <div\n key={item.key ?? i}\n className={clsx(\n styles.item,\n row === lastRow && styles.lastRow,\n row === lastRow && col === 0 && styles.lastRowStart,\n )}\n style={{ '--dl-span': span } as CSSProperties}\n >\n <dt className={styles.label}>\n {item.icon != null && (\n <span className={styles.labelIcon} aria-hidden=\"true\">\n {renderIcon(item.icon)}\n </span>\n )}\n {item.label}\n </dt>\n <dd className={styles.value}>\n <span className={styles.valueText}>\n {empty ? (\n <span\n className={styles.placeholder}\n aria-label={t('descriptionList.empty')}\n >\n {emptyText}\n </span>\n ) : (\n item.value\n )}\n </span>\n {copy != null && (\n <span className={styles.copy}>\n <CopyButton\n value={copy}\n size=\"sm\"\n variant=\"text\"\n className={styles.copyButton}\n />\n </span>\n )}\n </dd>\n </div>\n )\n })}\n </dl>\n </div>\n )\n },\n)\n"],"names":["ICON_NAME_SET","ICON_NAMES","DEFAULT_COLUMNS","isEmpty","value","copyTextOf","item","placeItems","items","cols","row","col","span","placed","renderIcon","icon","size","jsx","Icon","DescriptionList","forwardRef","columns","layout","valueWeight","bordered","dividers","labelWidth","stackBelow","loading","emptyText","title","color","subtitle","actions","className","style","props","ref","t","useT","titleId","useId","matches","useBreakpointMatches","resolveResponsive","stacked","visible","lastRow","skeletonRows","hasHeader","vars","jsxs","clsx","styles","IconButton","Typography","_","i","Skeleton","empty","copy","CopyButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAaMA,KAAgB,IAAI,IAAYC,CAAU,GAkE1CC,KAAsD,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,EAAA,GAE1EC,KAAU,CAACC,MAAqBA,KAAS,QAAQA,MAAU,MAAMA,MAAU,IAG3EC,KAAa,CAACC,MAA8C;AAChE,MAAI,OAAOA,EAAK,YAAa,iBAAiBA,EAAK;AACnD,MAAI,OAAOA,EAAK,SAAU,YAAY,OAAOA,EAAK,SAAU,SAAU,QAAO,OAAOA,EAAK,KAAK;AAEhG,GAGMC,KAAa,CAACC,GAA0BC,MAAiB;AAC7D,MAAIC,IAAM,GACNC,IAAM;AACV,SAAOH,EAAM,IAAI,CAACF,MAAS;AACzB,UAAMM,IAAO,KAAK,IAAIN,EAAK,QAAQ,GAAGG,CAAI;AAC1C,IAAIE,IAAMC,IAAOH,MACfC,KAAO,GACPC,IAAM;AAER,UAAME,IAAS,EAAE,MAAAP,GAAM,MAAAM,GAAM,KAAAF,GAAK,KAAAC,EAAA;AAClC,WAAAA,KAAOC,GACHD,KAAOF,MACTC,KAAO,GACPC,IAAM,IAEDE;AAAA,EACT,CAAC;AACH,GAEMC,IAAa,CAACC,GAA4BC,IAAoB,SAClE,OAAOD,KAAS,YAAYf,GAAc,IAAIe,CAAI,IAChD,gBAAAE,EAACC,KAAK,MAAMH,GAAkB,MAAAC,GAAY,IAE1CD,GAgBSI,KAAkBC;AA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gBAAApC,EAAC,QAAA,EAAK,WAAWoC,EAAO,WACrB,UAAAM,IACC,gBAAA1C;AAAA,0BAAC;AAAA,0BAAA;AAAA,4BACC,WAAWoC,EAAO;AAAA,4BAClB,cAAYf,EAAE,uBAAuB;AAAA,4BAEpC,UAAAT;AAAA,0BAAA;AAAA,wBAAA,IAGHvB,EAAK,OAET;AAAA,wBACCsD,KAAQ,QACP,gBAAA3C,EAAC,QAAA,EAAK,WAAWoC,EAAO,MACtB,UAAA,gBAAApC;AAAA,0BAAC4C;AAAA,0BAAA;AAAA,4BACC,OAAOD;AAAA,4BACP,MAAK;AAAA,4BACL,SAAQ;AAAA,4BACR,WAAWP,EAAO;AAAA,0BAAA;AAAA,wBAAA,EACpB,CACF;AAAA,sBAAA,EAAA,CAEJ;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAvCK/C,EAAK,OAAOmD;AAAA,gBAAA;AAAA,cA0CvB,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACP;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DescriptionList-S9C6Tp90.cjs","sources":["../src/components/DescriptionList/DescriptionList.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { resolveResponsive, type Breakpoint, type Responsive } from '../../theme/breakpoints'\nimport { useBreakpointMatches } from '../../hooks/useMediaQuery'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Icon } from '../Icon'\nimport { CopyButton } from '../CopyButton'\nimport { IconButton } from '../IconButton'\nimport { Skeleton } from '../Skeleton'\nimport { Typography } from '../Typography'\nimport styles from './DescriptionList.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type DescriptionListSize = 'sm' | 'md' | 'lg'\nexport type DescriptionListLayout = 'vertical' | 'horizontal'\nexport type DescriptionListColumns = 1 | 2 | 3 | 4\nexport type DescriptionListValueWeight = 'regular' | 'medium' | 'bold'\n\nexport interface DescriptionItem {\n /** Stable key (defaults to the index). */\n key?: string\n /** The term — \"Entry fee\". */\n label: ReactNode\n /** The value. `null` / `undefined` / `''` / `false` render the `emptyText` placeholder (\"—\"). */\n value?: ReactNode\n /** Columns this pair spans (clamped to the resolved column count) — for long text, addresses, lists. */\n span?: DescriptionListColumns\n /** Show a copy button: `true` copies a string/number `value`; pass a string to copy something else (an id behind a label). */\n copyable?: boolean | string\n /** Drop the pair entirely (e.g. by role). */\n hidden?: boolean\n /** Small leading icon in the label — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n}\n\nexport interface DescriptionListProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'title' | 'color'\n> {\n /** The label / value pairs, in order. Declarative so `loading` skeletons and `hidden` stay trivial. */\n items: DescriptionItem[]\n /** Column count — a number or a desktop-first breakpoint map. Defaults to `{ xs: 1, sm: 2, lg: 3 }`. */\n columns?: Responsive<DescriptionListColumns>\n /** `vertical` (label above value, default) or `horizontal` (label beside value; stacks again on phones). */\n layout?: DescriptionListLayout\n /** Text + spacing scale. Defaults to `md`. */\n size?: DescriptionListSize\n /** Font weight of the values. Defaults to `regular` (the library's body default); `medium` / `bold` add emphasis. */\n valueWeight?: DescriptionListValueWeight\n /** Frame the list as a surface card (border + radius); `horizontal` also tints the label column. */\n bordered?: boolean\n /** Hairlines between rows. Defaults to `true` (turn off inside an already-ruled container). */\n dividers?: boolean\n /** Label column width for `horizontal` (px number or CSS length). Defaults to `160px`. */\n labelWidth?: number | string\n /**\n * `horizontal` only — the breakpoint at (and below) which the label stacks back above the value.\n * A breakpoint token (`'xxs'` ≤ 576px default, `'xs'` ≤ 768px, …) or `false` to keep the two columns\n * side by side at every width. Uses the shared JS breakpoint layer, so `config.theme.breakpoints` applies.\n */\n stackBelow?: Breakpoint | false\n /** Render shimmering placeholders instead of values — `true` uses `items.length` rows, a number sets the count. */\n loading?: boolean | number\n /** Placeholder for an empty value. Defaults to `\"—\"`. */\n emptyText?: ReactNode\n /** Optional header title. */\n title?: ReactNode\n /** Leading header icon (a tinted box before the title, like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the header icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Muted line under the title. */\n subtitle?: ReactNode\n /** Header slot on the right (buttons, a status chip …). */\n actions?: ReactNode\n}\n\nconst DEFAULT_COLUMNS: Responsive<DescriptionListColumns> = { xs: 1, sm: 2, lg: 3 }\n\nconst isEmpty = (value: ReactNode) => value == null || value === '' || value === false\n\n/** What `copyable` copies: an explicit string, else a string / number value; nothing for rich nodes. */\nconst copyTextOf = (item: DescriptionItem): string | undefined => {\n if (typeof item.copyable === 'string') return item.copyable\n if (typeof item.value === 'string' || typeof item.value === 'number') return String(item.value)\n return undefined\n}\n\n/** Lay the items on a `cols`-wide grid the way CSS auto-placement will (spans clamped, wrapping rows). */\nconst placeItems = (items: DescriptionItem[], cols: number) => {\n let row = 0\n let col = 0\n return items.map((item) => {\n const span = Math.min(item.span ?? 1, cols)\n if (col + span > cols) {\n row += 1\n col = 0\n }\n const placed = { item, span, row, col }\n col += span\n if (col >= cols) {\n row += 1\n col = 0\n }\n return placed\n })\n}\n\nconst renderIcon = (icon: IconName | ReactNode, size: 'sm' | 'md' = 'sm') =>\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={size} />\n ) : (\n icon\n )\n\n/**\n * Label / value pairs for a **detail page** (the read-only twin of a form: \"User #42\" → Name, Email,\n * Role …). Renders a semantic `<dl>` of `<dt>` / `<dd>` groups laid out on a responsive CSS grid\n * (`columns`, desktop-first breakpoint map — default 1 → 2 → 3), each pair optionally spanning several\n * columns. An optional Card-style header carries an `icon` box (tinted by `color`), `title`,\n * `subtitle` and `actions`. Values are regular weight by default (`valueWeight` adds emphasis) and any node: `null` / `''` show a muted \"—\" placeholder (`emptyText`), string / number\n * values can grow a `CopyButton` (revealed on hover / focus; always visible without hover), and\n * `hidden` drops a pair (e.g. by role). `layout=\"horizontal\"` puts the label beside the value in a\n * `labelWidth` column and stacks back on phones (`stackBelow` — a breakpoint, or `false` to never stack); `bordered` frames the list as a surface card (tinting the\n * label column when horizontal). `loading` swaps the values for `Skeleton` lines of the same shape.\n * Rows are separated by hairline `dividers`. Token-only; the grid is never `overflow: hidden` so the\n * copy tooltip is never clipped. `forwardRef` to the root `<div>`.\n */\nexport const DescriptionList = forwardRef<HTMLDivElement, DescriptionListProps>(\n function DescriptionList(\n {\n items,\n columns = DEFAULT_COLUMNS,\n layout = 'vertical',\n size = 'md',\n valueWeight = 'regular',\n bordered = false,\n dividers = true,\n labelWidth = 160,\n stackBelow = 'xxs',\n loading = false,\n emptyText = '\\u2014',\n title,\n icon,\n color = 'accent',\n subtitle,\n actions,\n className,\n style,\n ...props\n },\n ref,\n ) {\n const t = useT()\n const id = useId()\n const titleId = `${id}-title`\n const matches = useBreakpointMatches()\n const cols = resolveResponsive(columns, matches) ?? 1\n const stacked = layout === 'horizontal' && stackBelow !== false && matches[stackBelow]\n\n const visible = items.filter((item) => !item.hidden)\n // Grid placement (span-aware) — the last row drops its hairline (nothing follows it, and in `bordered`\n // it would double the frame's border), and its first cell rounds the frame's bottom-left corner\n // (`bordered` + `horizontal` tints the label column, and that tint must not bleed past the radius).\n const placed = placeItems(visible, cols)\n const lastRow = placed.length ? placed[placed.length - 1].row : 0\n const skeletonRows = typeof loading === 'number' ? loading : visible.length || 6\n const hasHeader = title != null || subtitle != null || actions != null || icon != null\n\n const vars = {\n '--dl-cols': cols,\n '--dl-label-w': typeof labelWidth === 'number' ? `${labelWidth}px` : labelWidth,\n } as CSSProperties\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.root,\n styles[size],\n styles[layout],\n valueWeight !== 'regular' && styles[`value${valueWeight === 'bold' ? 'Bold' : 'Medium'}`],\n bordered && styles.bordered,\n dividers && styles.dividers,\n stacked && styles.stacked,\n className,\n )}\n style={{ ...vars, ...style }}\n {...props}\n >\n {hasHeader && (\n <div className={styles.header}>\n <div className={styles.headerMain}>\n {icon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.headerIcon}\n >\n {renderIcon(icon, 'md')}\n </IconButton>\n )}\n {(title != null || subtitle != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <Typography as=\"h3\" id={titleId} variant=\"subtitle\" className={styles.title}>\n {title}\n </Typography>\n )}\n {subtitle != null && (\n <Typography as=\"p\" variant=\"bodySmall\" color=\"muted\">\n {subtitle}\n </Typography>\n )}\n </div>\n )}\n </div>\n {actions != null && <div className={styles.actions}>{actions}</div>}\n </div>\n )}\n\n <dl\n className={styles.grid}\n aria-labelledby={title != null ? titleId : undefined}\n aria-busy={loading ? true : undefined}\n aria-label={loading ? t('descriptionList.loading') : undefined}\n >\n {loading\n ? Array.from({ length: skeletonRows }, (_, i) => (\n <div key={i} className={styles.item} aria-hidden=\"true\">\n <dt className={styles.label}>\n <Skeleton width=\"40%\" height=\"0.9em\" />\n </dt>\n <dd className={styles.value}>\n <Skeleton width=\"70%\" height=\"1.1em\" />\n </dd>\n </div>\n ))\n : placed.map(({ item, span, row, col }, i) => {\n const empty = isEmpty(item.value)\n const copy = !empty && item.copyable ? copyTextOf(item) : undefined\n return (\n <div\n key={item.key ?? i}\n className={clsx(\n styles.item,\n row === lastRow && styles.lastRow,\n row === lastRow && col === 0 && styles.lastRowStart,\n )}\n style={{ '--dl-span': span } as CSSProperties}\n >\n <dt className={styles.label}>\n {item.icon != null && (\n <span className={styles.labelIcon} aria-hidden=\"true\">\n {renderIcon(item.icon)}\n </span>\n )}\n {item.label}\n </dt>\n <dd className={styles.value}>\n <span className={styles.valueText}>\n {empty ? (\n <span\n className={styles.placeholder}\n aria-label={t('descriptionList.empty')}\n >\n {emptyText}\n </span>\n ) : (\n item.value\n )}\n </span>\n {copy != null && (\n <span className={styles.copy}>\n <CopyButton\n value={copy}\n size=\"sm\"\n variant=\"text\"\n className={styles.copyButton}\n />\n </span>\n )}\n </dd>\n </div>\n )\n })}\n </dl>\n </div>\n )\n },\n)\n"],"names":["ICON_NAME_SET","ICON_NAMES","DEFAULT_COLUMNS","isEmpty","value","copyTextOf","item","placeItems","items","cols","row","col","span","placed","renderIcon","icon","size","jsx","Icon","DescriptionList","forwardRef","columns","layout","valueWeight","bordered","dividers","labelWidth","stackBelow","loading","emptyText","title","color","subtitle","actions","className","style","props","ref","t","useT","titleId","useId","matches","useBreakpointMatches","resolveResponsive","stacked","visible","lastRow","skeletonRows","hasHeader","vars","jsxs","clsx","styles","IconButton","Typography","_","i","Skeleton","empty","copy","CopyButton"],"mappings":"qzCAaMA,GAAgB,IAAI,IAAYC,YAAU,EAkE1CC,GAAsD,CAAE,GAAI,EAAG,GAAI,EAAG,GAAI,CAAA,EAE1EC,GAAWC,GAAqBA,GAAS,MAAQA,IAAU,IAAMA,IAAU,GAG3EC,GAAcC,GAA8C,CAChE,GAAI,OAAOA,EAAK,UAAa,gBAAiBA,EAAK,SACnD,GAAI,OAAOA,EAAK,OAAU,UAAY,OAAOA,EAAK,OAAU,SAAU,OAAO,OAAOA,EAAK,KAAK,CAEhG,EAGMC,GAAa,CAACC,EAA0BC,IAAiB,CAC7D,IAAIC,EAAM,EACNC,EAAM,EACV,OAAOH,EAAM,IAAKF,GAAS,CACzB,MAAMM,EAAO,KAAK,IAAIN,EAAK,MAAQ,EAAGG,CAAI,EACtCE,EAAMC,EAAOH,IACfC,GAAO,EACPC,EAAM,GAER,MAAME,EAAS,CAAE,KAAAP,EAAM,KAAAM,EAAM,IAAAF,EAAK,IAAAC,CAAA,EAClC,OAAAA,GAAOC,EACHD,GAAOF,IACTC,GAAO,EACPC,EAAM,GAEDE,CACT,CAAC,CACH,EAEMC,EAAa,CAACC,EAA4BC,EAAoB,OAClE,OAAOD,GAAS,UAAYf,GAAc,IAAIe,CAAI,EAChDE,EAAAA,IAACC,QAA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C,CAAA,CAAA,CACP,CAAA,CAAA,CAGN,CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileCard-5QvVkO1-.js","sources":["../src/components/FileCard/FileCard.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Avatar, type AvatarSize } from '../Avatar'\nimport { IconButton } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\nimport type { IconName } from '../../icons/names'\nimport styles from './FileCard.module.css'\n\nexport type FileCardSize = AvatarSize\n\nconst IMAGE_EXTS = new Set([\n 'png',\n 'jpg',\n 'jpeg',\n 'webp',\n 'svg',\n 'gif',\n 'avif',\n 'bmp',\n 'ico',\n 'heic',\n])\n\n// a leading icon per file family (non-image); everything else gets the generic document icon\nconst FILE_ICONS: Record<string, IconName> = {\n pdf: 'DocumentText',\n doc: 'DocumentText',\n docx: 'DocumentText',\n txt: 'DocumentText',\n rtf: 'DocumentText',\n md: 'DocumentText',\n csv: 'DocumentText',\n xls: 'DocumentText',\n xlsx: 'DocumentText',\n json: 'DocumentCode',\n xml: 'DocumentCode',\n zip: 'Folder',\n rar: 'Folder',\n '7z': 'Folder',\n mp4: 'VideoSquare',\n mov: 'VideoSquare',\n webm: 'VideoSquare',\n mp3: 'MusicSquare',\n wav: 'MusicSquare',\n}\n\n/** The lowercased extension from a file name, else the subtype from a MIME `type` (`image/png` → `png`). */\nfunction extensionOf(name: string, type?: string): string {\n const dot = name.lastIndexOf('.')\n if (dot > 0 && name.length - dot <= 7) return name.slice(dot + 1).toLowerCase()\n if (type && type.includes('/')) return type.slice(type.indexOf('/') + 1).toLowerCase()\n return ''\n}\n\n/** Split `report.pdf` into `{ base: 'report', ext: '.pdf' }` so the base can ellipsize and the type stays. */\nfunction splitName(name: string): { base: string; ext: string } {\n const dot = name.lastIndexOf('.')\n return dot > 0 && name.length - dot <= 7\n ? { base: name.slice(0, dot), ext: name.slice(dot) }\n : { base: name, ext: '' }\n}\n\n/** Human-readable byte size — `2411724` → `\"2.3 MB\"`. */\nfunction formatBytes(bytes: number): string {\n if (!Number.isFinite(bytes) || bytes < 0) return ''\n if (bytes < 1024) return `${bytes} B`\n const units = ['KB', 'MB', 'GB', 'TB']\n let value = bytes / 1024\n let i = 0\n while (value >= 1024 && i < units.length - 1) {\n value /= 1024\n i += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[i]}`\n}\n\nexport interface FileCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** File name — shown middle-truncated (`test-file-na….pdf`) so the extension always stays visible. */\n name: string\n /** File URL — the download target and, for an image, the thumbnail `src`. */\n src?: string\n /** File type — an extension (`'pdf'`) or MIME (`'image/png'`). Derived from `name` when omitted. */\n type?: string\n /** Force image vs. file rendering. Inferred from `type` / `name` / `src` when omitted. */\n image?: boolean\n /** File size — a **bytes** number (auto-formatted to `\"2.3 MB\"`) or a preformatted string. Shown after the type. */\n fileSize?: number | string\n /**\n * When no `fileSize` is given, fetch it from `src` via a `HEAD` request (reads `Content-Length`). Off\n * by default — it's a network call and needs CORS to expose the header; prefer passing `fileSize` from\n * the backend. Fails silently (no size shown) when unavailable.\n */\n fetchSize?: boolean\n /** Meta line under the name — overrides the derived `TYPE · size`. */\n meta?: ReactNode\n /** Theme token tinting the avatar / file-icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Size — scales the avatar, text and padding. Defaults to `md`. */\n size?: FileCardSize\n /** Show the download control (only when there's a `src` or `onDownload`). Defaults to `true`. */\n downloadable?: boolean\n /** Custom download handler — replaces the default (a download of `src`). */\n onDownload?: () => void\n}\n\n/**\n * A compact, read-only **file card** for displaying a file that already exists (e.g. from the backend) —\n * an image or a document (`pdf` / `docx` / `csv` / `svg` / …). Shows a leading **`Avatar`** (the image\n * thumbnail via `src`, or a type-based file icon in a tinted square), the **name** middle-truncated so\n * the extension is never lost, the **type** underneath, and a **download** control. Simple to drop in —\n * pass `name` (+ `src` for the thumbnail/download). Not to be confused with `FileUploader` (which\n * *collects* files to upload); this only *displays* one. Token-only styling.\n *\n * @example\n * <FileCard name=\"annual-report.pdf\" src=\"/files/annual-report.pdf\" />\n * <FileCard name=\"avatar.png\" src={url} meta=\"240 KB\" />\n */\nexport const FileCard = forwardRef<HTMLDivElement, FileCardProps>(function FileCard(\n {\n name,\n src,\n type,\n image,\n fileSize,\n fetchSize = false,\n meta,\n color = 'accent',\n size = 'md',\n downloadable = true,\n onDownload,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const ext = extensionOf(name, type)\n const isImage = image ?? (type?.startsWith('image/') || IMAGE_EXTS.has(ext))\n const { base, ext: nameExt } = splitName(name)\n\n // optional auto size via a HEAD request (only when opted in and no explicit fileSize)\n const [fetchedSize, setFetchedSize] = useState<number | null>(null)\n useEffect(() => {\n if (!fetchSize || fileSize != null || !src || typeof fetch === 'undefined') return\n let cancelled = false\n fetch(src, { method: 'HEAD' })\n .then((res) => {\n const len = res.headers.get('content-length')\n if (!cancelled && len) setFetchedSize(Number(len))\n })\n .catch(() => {})\n return () => {\n cancelled = true\n }\n }, [fetchSize, fileSize, src])\n\n const sizeText =\n fileSize != null\n ? typeof fileSize === 'number'\n ? formatBytes(fileSize)\n : fileSize\n : fetchedSize != null\n ? formatBytes(fetchedSize)\n : ''\n // \"TYPE · 2.3 MB\" (either part optional) — overridden wholesale by `meta`\n const derivedMeta = [ext ? ext.toUpperCase() : '', sizeText].filter(Boolean).join(' · ')\n const metaLine = meta ?? (derivedMeta || null)\n\n const handleDownload = () => {\n if (onDownload) return onDownload()\n if (!src) return\n const a = document.createElement('a')\n a.href = src\n a.download = name\n a.rel = 'noopener'\n a.click()\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.fileCard, styles[size], className)}\n style={{ '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n {...props}\n >\n <Avatar\n className={styles.avatar}\n src={isImage ? src : undefined}\n icon={isImage ? undefined : (FILE_ICONS[ext] ?? 'Document')}\n name={name}\n shape=\"square\"\n size={size}\n color={color}\n />\n <div className={styles.body}>\n <span className={styles.name} title={name}>\n <span className={styles.nameBase}>{base}</span>\n {nameExt && <span className={styles.nameExt}>{nameExt}</span>}\n </span>\n {metaLine != null && (\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\" uppercase className={styles.type}>\n {metaLine}\n </Typography>\n )}\n </div>\n {downloadable && (src || onDownload) && (\n <IconButton\n variant=\"filled\"\n size={size === 'lg' ? 'md' : 'sm'}\n className={styles.download}\n aria-label={t('fileCard.download', { name })}\n onClick={handleDownload}\n >\n <Icon name=\"ImportArrow\" />\n </IconButton>\n )}\n </div>\n )\n})\n"],"names":["IMAGE_EXTS","FILE_ICONS","extensionOf","name","type","dot","splitName","formatBytes","bytes","units","value","i","FileCard","forwardRef","src","image","fileSize","fetchSize","meta","color","size","downloadable","onDownload","className","style","props","ref","t","useT","ext","isImage","base","nameExt","fetchedSize","setFetchedSize","useState","useEffect","cancelled","res","len","sizeText","derivedMeta","metaLine","handleDownload","a","jsxs","clsx","styles","jsx","Avatar","Typography","IconButton","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;GAmBMA,yBAAiB,IAAI;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAGKC,KAAuC;AAAA,EAC3C,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,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K,MAAK,cAAA,CAAc;AAAA,UAAA;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileCard-Cl88Gu6L.cjs","sources":["../src/components/FileCard/FileCard.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Avatar, type AvatarSize } from '../Avatar'\nimport { IconButton } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\nimport type { IconName } from '../../icons/names'\nimport styles from './FileCard.module.css'\n\nexport type FileCardSize = AvatarSize\n\nconst IMAGE_EXTS = new Set([\n 'png',\n 'jpg',\n 'jpeg',\n 'webp',\n 'svg',\n 'gif',\n 'avif',\n 'bmp',\n 'ico',\n 'heic',\n])\n\n// a leading icon per file family (non-image); everything else gets the generic document icon\nconst FILE_ICONS: Record<string, IconName> = {\n pdf: 'DocumentText',\n doc: 'DocumentText',\n docx: 'DocumentText',\n txt: 'DocumentText',\n rtf: 'DocumentText',\n md: 'DocumentText',\n csv: 'DocumentText',\n xls: 'DocumentText',\n xlsx: 'DocumentText',\n json: 'DocumentCode',\n xml: 'DocumentCode',\n zip: 'Folder',\n rar: 'Folder',\n '7z': 'Folder',\n mp4: 'VideoSquare',\n mov: 'VideoSquare',\n webm: 'VideoSquare',\n mp3: 'MusicSquare',\n wav: 'MusicSquare',\n}\n\n/** The lowercased extension from a file name, else the subtype from a MIME `type` (`image/png` → `png`). */\nfunction extensionOf(name: string, type?: string): string {\n const dot = name.lastIndexOf('.')\n if (dot > 0 && name.length - dot <= 7) return name.slice(dot + 1).toLowerCase()\n if (type && type.includes('/')) return type.slice(type.indexOf('/') + 1).toLowerCase()\n return ''\n}\n\n/** Split `report.pdf` into `{ base: 'report', ext: '.pdf' }` so the base can ellipsize and the type stays. */\nfunction splitName(name: string): { base: string; ext: string } {\n const dot = name.lastIndexOf('.')\n return dot > 0 && name.length - dot <= 7\n ? { base: name.slice(0, dot), ext: name.slice(dot) }\n : { base: name, ext: '' }\n}\n\n/** Human-readable byte size — `2411724` → `\"2.3 MB\"`. */\nfunction formatBytes(bytes: number): string {\n if (!Number.isFinite(bytes) || bytes < 0) return ''\n if (bytes < 1024) return `${bytes} B`\n const units = ['KB', 'MB', 'GB', 'TB']\n let value = bytes / 1024\n let i = 0\n while (value >= 1024 && i < units.length - 1) {\n value /= 1024\n i += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[i]}`\n}\n\nexport interface FileCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** File name — shown middle-truncated (`test-file-na….pdf`) so the extension always stays visible. */\n name: string\n /** File URL — the download target and, for an image, the thumbnail `src`. */\n src?: string\n /** File type — an extension (`'pdf'`) or MIME (`'image/png'`). Derived from `name` when omitted. */\n type?: string\n /** Force image vs. file rendering. Inferred from `type` / `name` / `src` when omitted. */\n image?: boolean\n /** File size — a **bytes** number (auto-formatted to `\"2.3 MB\"`) or a preformatted string. Shown after the type. */\n fileSize?: number | string\n /**\n * When no `fileSize` is given, fetch it from `src` via a `HEAD` request (reads `Content-Length`). Off\n * by default — it's a network call and needs CORS to expose the header; prefer passing `fileSize` from\n * the backend. Fails silently (no size shown) when unavailable.\n */\n fetchSize?: boolean\n /** Meta line under the name — overrides the derived `TYPE · size`. */\n meta?: ReactNode\n /** Theme token tinting the avatar / file-icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Size — scales the avatar, text and padding. Defaults to `md`. */\n size?: FileCardSize\n /** Show the download control (only when there's a `src` or `onDownload`). Defaults to `true`. */\n downloadable?: boolean\n /** Custom download handler — replaces the default (a download of `src`). */\n onDownload?: () => void\n}\n\n/**\n * A compact, read-only **file card** for displaying a file that already exists (e.g. from the backend) —\n * an image or a document (`pdf` / `docx` / `csv` / `svg` / …). Shows a leading **`Avatar`** (the image\n * thumbnail via `src`, or a type-based file icon in a tinted square), the **name** middle-truncated so\n * the extension is never lost, the **type** underneath, and a **download** control. Simple to drop in —\n * pass `name` (+ `src` for the thumbnail/download). Not to be confused with `FileUploader` (which\n * *collects* files to upload); this only *displays* one. Token-only styling.\n *\n * @example\n * <FileCard name=\"annual-report.pdf\" src=\"/files/annual-report.pdf\" />\n * <FileCard name=\"avatar.png\" src={url} meta=\"240 KB\" />\n */\nexport const FileCard = forwardRef<HTMLDivElement, FileCardProps>(function FileCard(\n {\n name,\n src,\n type,\n image,\n fileSize,\n fetchSize = false,\n meta,\n color = 'accent',\n size = 'md',\n downloadable = true,\n onDownload,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const ext = extensionOf(name, type)\n const isImage = image ?? (type?.startsWith('image/') || IMAGE_EXTS.has(ext))\n const { base, ext: nameExt } = splitName(name)\n\n // optional auto size via a HEAD request (only when opted in and no explicit fileSize)\n const [fetchedSize, setFetchedSize] = useState<number | null>(null)\n useEffect(() => {\n if (!fetchSize || fileSize != null || !src || typeof fetch === 'undefined') return\n let cancelled = false\n fetch(src, { method: 'HEAD' })\n .then((res) => {\n const len = res.headers.get('content-length')\n if (!cancelled && len) setFetchedSize(Number(len))\n })\n .catch(() => {})\n return () => {\n cancelled = true\n }\n }, [fetchSize, fileSize, src])\n\n const sizeText =\n fileSize != null\n ? typeof fileSize === 'number'\n ? formatBytes(fileSize)\n : fileSize\n : fetchedSize != null\n ? formatBytes(fetchedSize)\n : ''\n // \"TYPE · 2.3 MB\" (either part optional) — overridden wholesale by `meta`\n const derivedMeta = [ext ? ext.toUpperCase() : '', sizeText].filter(Boolean).join(' · ')\n const metaLine = meta ?? (derivedMeta || null)\n\n const handleDownload = () => {\n if (onDownload) return onDownload()\n if (!src) return\n const a = document.createElement('a')\n a.href = src\n a.download = name\n a.rel = 'noopener'\n a.click()\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.fileCard, styles[size], className)}\n style={{ '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n {...props}\n >\n <Avatar\n className={styles.avatar}\n src={isImage ? src : undefined}\n icon={isImage ? undefined : (FILE_ICONS[ext] ?? 'Document')}\n name={name}\n shape=\"square\"\n size={size}\n color={color}\n />\n <div className={styles.body}>\n <span className={styles.name} title={name}>\n <span className={styles.nameBase}>{base}</span>\n {nameExt && <span className={styles.nameExt}>{nameExt}</span>}\n </span>\n {metaLine != null && (\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\" uppercase className={styles.type}>\n {metaLine}\n </Typography>\n )}\n </div>\n {downloadable && (src || onDownload) && (\n <IconButton\n variant=\"filled\"\n size={size === 'lg' ? 'md' : 'sm'}\n className={styles.download}\n aria-label={t('fileCard.download', { name })}\n onClick={handleDownload}\n >\n <Icon name=\"ImportArrow\" />\n </IconButton>\n )}\n </div>\n )\n})\n"],"names":["IMAGE_EXTS","FILE_ICONS","extensionOf","name","type","dot","splitName","formatBytes","bytes","units","value","i","FileCard","forwardRef","src","image","fileSize","fetchSize","meta","color","size","downloadable","onDownload","className","style","props","ref","t","useT","ext","isImage","base","nameExt","fetchedSize","setFetchedSize","useState","useEffect","cancelled","res","len","sizeText","derivedMeta","metaLine","handleDownload","a","jsxs","clsx","styles","jsx","Avatar","Typography","IconButton","Icon"],"mappings":"2kBAmBMA,MAAiB,IAAI,CACzB,MACA,MACA,OACA,OACA,MACA,MACA,OACA,MACA,MACA,MACF,CAAC,EAGKC,EAAuC,CAC3C,IAAK,eACL,IAAK,eACL,KAAM,eACN,IAAK,eACL,IAAK,eACL,GAAI,eACJ,IAAK,eACL,IAAK,eACL,KAAM,eACN,KAAM,eACN,IAAK,eACL,IAAK,SACL,IAAK,SACL,KAAM,SACN,IAAK,cACL,IAAK,cACL,KAAM,cACN,IAAK,cACL,IAAK,aACP,EAGA,SAASC,EAAYC,EAAcC,EAAuB,CACxD,MAAMC,EAAMF,EAAK,YAAY,GAAG,EAChC,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