@techzyapp/ui-library 1.0.28 → 1.0.29

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 (357) hide show
  1. package/dist/{AdminRoot-BTvmassR.js → AdminRoot-9HGp3Mds.js} +5 -5
  2. package/dist/{AdminRoot-BTvmassR.js.map → AdminRoot-9HGp3Mds.js.map} +1 -1
  3. package/dist/{AdminRoot-DM-cZCpN.cjs → AdminRoot-D24UJ-4a.cjs} +2 -2
  4. package/dist/{AdminRoot-DM-cZCpN.cjs.map → AdminRoot-D24UJ-4a.cjs.map} +1 -1
  5. package/dist/{Alert-v-lelDih.js → Alert-CJono1TJ.js} +3 -3
  6. package/dist/{Alert-v-lelDih.js.map → Alert-CJono1TJ.js.map} +1 -1
  7. package/dist/{Alert-CFm6MU0u.cjs → Alert-VFQuuII6.cjs} +2 -2
  8. package/dist/{Alert-CFm6MU0u.cjs.map → Alert-VFQuuII6.cjs.map} +1 -1
  9. package/dist/{Breadcrumbs-3wHPNa0P.cjs → Breadcrumbs-DCEHxpSi.cjs} +2 -2
  10. package/dist/{Breadcrumbs-3wHPNa0P.cjs.map → Breadcrumbs-DCEHxpSi.cjs.map} +1 -1
  11. package/dist/{Breadcrumbs-Cgd-u3aK.js → Breadcrumbs-XWU8tRvs.js} +3 -3
  12. package/dist/{Breadcrumbs-Cgd-u3aK.js.map → Breadcrumbs-XWU8tRvs.js.map} +1 -1
  13. package/dist/{Button-BLW9yV8W.js → Button-CWMNNiia.js} +2 -2
  14. package/dist/{Button-BLW9yV8W.js.map → Button-CWMNNiia.js.map} +1 -1
  15. package/dist/{Button-KRGjJdMV.cjs → Button-CusxDmfq.cjs} +2 -2
  16. package/dist/{Button-KRGjJdMV.cjs.map → Button-CusxDmfq.cjs.map} +1 -1
  17. package/dist/{Calendar-CoTCOOUu.cjs → Calendar-BEQbZixA.cjs} +2 -2
  18. package/dist/{Calendar-CoTCOOUu.cjs.map → Calendar-BEQbZixA.cjs.map} +1 -1
  19. package/dist/{Calendar-sLA-xa0B.js → Calendar-Db3rr1VD.js} +3 -3
  20. package/dist/{Calendar-sLA-xa0B.js.map → Calendar-Db3rr1VD.js.map} +1 -1
  21. package/dist/{Card-zTkvreQu.cjs → Card-CUUh4mlB.cjs} +2 -2
  22. package/dist/{Card-zTkvreQu.cjs.map → Card-CUUh4mlB.cjs.map} +1 -1
  23. package/dist/{Card-6fiSEC0z.js → Card-MxYfQTOY.js} +2 -2
  24. package/dist/{Card-6fiSEC0z.js.map → Card-MxYfQTOY.js.map} +1 -1
  25. package/dist/{Chip-CqOqfafx.cjs → Chip-D12KcV4_.cjs} +2 -2
  26. package/dist/{Chip-CqOqfafx.cjs.map → Chip-D12KcV4_.cjs.map} +1 -1
  27. package/dist/{Chip-C-5Z5wsC.js → Chip-Zh1OB9nV.js} +2 -2
  28. package/dist/{Chip-C-5Z5wsC.js.map → Chip-Zh1OB9nV.js.map} +1 -1
  29. package/dist/{CodeBlock-rPaqO7yD.js → CodeBlock-CkrTnpcj.js} +3 -3
  30. package/dist/{CodeBlock-rPaqO7yD.js.map → CodeBlock-CkrTnpcj.js.map} +1 -1
  31. package/dist/{CodeBlock-DFiHDZXh.cjs → CodeBlock-DAM7BkHK.cjs} +2 -2
  32. package/dist/{CodeBlock-DFiHDZXh.cjs.map → CodeBlock-DAM7BkHK.cjs.map} +1 -1
  33. package/dist/{ColorPicker-Bqypsy5E.cjs → ColorPicker-BcCozxIe.cjs} +2 -2
  34. package/dist/{ColorPicker-Bqypsy5E.cjs.map → ColorPicker-BcCozxIe.cjs.map} +1 -1
  35. package/dist/{ColorPicker-DXDAXvlA.js → ColorPicker-DqxVgUoD.js} +3 -3
  36. package/dist/{ColorPicker-DXDAXvlA.js.map → ColorPicker-DqxVgUoD.js.map} +1 -1
  37. package/dist/{ColorPickerPanel-C9ARc_uD.cjs → ColorPickerPanel-DAOESLCe.cjs} +2 -2
  38. package/dist/{ColorPickerPanel-C9ARc_uD.cjs.map → ColorPickerPanel-DAOESLCe.cjs.map} +1 -1
  39. package/dist/{ColorPickerPanel-6lQC1URc.js → ColorPickerPanel-DZjN8NNn.js} +2 -2
  40. package/dist/{ColorPickerPanel-6lQC1URc.js.map → ColorPickerPanel-DZjN8NNn.js.map} +1 -1
  41. package/dist/{ColorRamp-DQ8wkgvF.js → ColorRamp-DS5LVpRF.js} +2 -2
  42. package/dist/{ColorRamp-DQ8wkgvF.js.map → ColorRamp-DS5LVpRF.js.map} +1 -1
  43. package/dist/{ColorRamp-B9OWxCOK.cjs → ColorRamp-_KwlPQ-T.cjs} +2 -2
  44. package/dist/{ColorRamp-B9OWxCOK.cjs.map → ColorRamp-_KwlPQ-T.cjs.map} +1 -1
  45. package/dist/{ConfigProvider-B_RSn9bb.js → ConfigProvider-BbsI15b-.js} +2 -2
  46. package/dist/{ConfigProvider-B_RSn9bb.js.map → ConfigProvider-BbsI15b-.js.map} +1 -1
  47. package/dist/{ConfigProvider-BElY0HuV.cjs → ConfigProvider-ByLHqXpv.cjs} +2 -2
  48. package/dist/{ConfigProvider-BElY0HuV.cjs.map → ConfigProvider-ByLHqXpv.cjs.map} +1 -1
  49. package/dist/{CopyButton-BplPYm8i.js → CopyButton-D4s8aeSE.js} +3 -3
  50. package/dist/{CopyButton-BplPYm8i.js.map → CopyButton-D4s8aeSE.js.map} +1 -1
  51. package/dist/{CopyButton-B5aicGl3.cjs → CopyButton-SFwjKod9.cjs} +2 -2
  52. package/dist/{CopyButton-B5aicGl3.cjs.map → CopyButton-SFwjKod9.cjs.map} +1 -1
  53. package/dist/{DatePicker-U5TJ9FYM.js → DatePicker-DGwjCHfd.js} +4 -4
  54. package/dist/{DatePicker-U5TJ9FYM.js.map → DatePicker-DGwjCHfd.js.map} +1 -1
  55. package/dist/{DatePicker-Cdl2JYBd.cjs → DatePicker-ENbn2Vab.cjs} +2 -2
  56. package/dist/{DatePicker-Cdl2JYBd.cjs.map → DatePicker-ENbn2Vab.cjs.map} +1 -1
  57. package/dist/{DateTimePicker-DUFtddxJ.cjs → DateTimePicker-BQUmsFwX.cjs} +2 -2
  58. package/dist/{DateTimePicker-DUFtddxJ.cjs.map → DateTimePicker-BQUmsFwX.cjs.map} +1 -1
  59. package/dist/{DateTimePicker-laJsZYJX.js → DateTimePicker-CwVkQiun.js} +7 -7
  60. package/dist/{DateTimePicker-laJsZYJX.js.map → DateTimePicker-CwVkQiun.js.map} +1 -1
  61. package/dist/{DescriptionList-Y9jF_4L0.js → DescriptionList-0qjKr6GN.js} +4 -4
  62. package/dist/{DescriptionList-Y9jF_4L0.js.map → DescriptionList-0qjKr6GN.js.map} +1 -1
  63. package/dist/{DescriptionList-BCvOX8fg.cjs → DescriptionList-U5z2Faf4.cjs} +2 -2
  64. package/dist/{DescriptionList-BCvOX8fg.cjs.map → DescriptionList-U5z2Faf4.cjs.map} +1 -1
  65. package/dist/{EmptyState-CO_NRZ6w.cjs → EmptyState-B2_4BN4l.cjs} +2 -2
  66. package/dist/{EmptyState-CO_NRZ6w.cjs.map → EmptyState-B2_4BN4l.cjs.map} +1 -1
  67. package/dist/{EmptyState-BtwuzX9Z.js → EmptyState-DwT9_HW7.js} +2 -2
  68. package/dist/{EmptyState-BtwuzX9Z.js.map → EmptyState-DwT9_HW7.js.map} +1 -1
  69. package/dist/ErrorBoundary-CYSOAQlB.cjs +2 -0
  70. package/dist/ErrorBoundary-CYSOAQlB.cjs.map +1 -0
  71. package/dist/ErrorBoundary-CsDHKYB4.js +163 -0
  72. package/dist/ErrorBoundary-CsDHKYB4.js.map +1 -0
  73. package/dist/{FileCard-C3a2yDhK.js → FileCard-B9f9RoXS.js} +3 -3
  74. package/dist/{FileCard-C3a2yDhK.js.map → FileCard-B9f9RoXS.js.map} +1 -1
  75. package/dist/{FileCard-DKjDQRzZ.cjs → FileCard-zuUYik-F.cjs} +2 -2
  76. package/dist/{FileCard-DKjDQRzZ.cjs.map → FileCard-zuUYik-F.cjs.map} +1 -1
  77. package/dist/{FileUploader-CuOHWkiG.js → FileUploader-Dh2zA50t.js} +5 -5
  78. package/dist/{FileUploader-CuOHWkiG.js.map → FileUploader-Dh2zA50t.js.map} +1 -1
  79. package/dist/{FileUploader-VIOg03pl.cjs → FileUploader-Y8hiyIpp.cjs} +2 -2
  80. package/dist/{FileUploader-VIOg03pl.cjs.map → FileUploader-Y8hiyIpp.cjs.map} +1 -1
  81. package/dist/{Flag-aOQncoEZ.cjs → Flag-BpTQAgbD.cjs} +2 -2
  82. package/dist/{Flag-aOQncoEZ.cjs.map → Flag-BpTQAgbD.cjs.map} +1 -1
  83. package/dist/{Flag-kpUfmrwC.js → Flag-CmDXvd7j.js} +2 -2
  84. package/dist/{Flag-kpUfmrwC.js.map → Flag-CmDXvd7j.js.map} +1 -1
  85. package/dist/{FullscreenToggle-CMifmPD3.js → FullscreenToggle-2IYIS5KF.js} +3 -3
  86. package/dist/{FullscreenToggle-CMifmPD3.js.map → FullscreenToggle-2IYIS5KF.js.map} +1 -1
  87. package/dist/{FullscreenToggle-BSwxQEaG.cjs → FullscreenToggle-CeGgw3z1.cjs} +2 -2
  88. package/dist/{FullscreenToggle-BSwxQEaG.cjs.map → FullscreenToggle-CeGgw3z1.cjs.map} +1 -1
  89. package/dist/{IconButton-A2B0bqC-.cjs → IconButton-BNa0yLcv.cjs} +2 -2
  90. package/dist/{IconButton-A2B0bqC-.cjs.map → IconButton-BNa0yLcv.cjs.map} +1 -1
  91. package/dist/{IconButton-Dq17Fekm.js → IconButton-GU3Ud4Zg.js} +2 -2
  92. package/dist/{IconButton-Dq17Fekm.js.map → IconButton-GU3Ud4Zg.js.map} +1 -1
  93. package/dist/{Loader-CwyoKoWY.js → Loader-C1uaCtx6.js} +2 -2
  94. package/dist/{Loader-CwyoKoWY.js.map → Loader-C1uaCtx6.js.map} +1 -1
  95. package/dist/{Loader-D9nteBXt.cjs → Loader-Cpr9-OOZ.cjs} +2 -2
  96. package/dist/{Loader-D9nteBXt.cjs.map → Loader-Cpr9-OOZ.cjs.map} +1 -1
  97. package/dist/{Modal-CQDcYS-Y.cjs → Modal-DFeBHv-Q.cjs} +2 -2
  98. package/dist/{Modal-CQDcYS-Y.cjs.map → Modal-DFeBHv-Q.cjs.map} +1 -1
  99. package/dist/{Modal-cz6JIsZn.js → Modal-DHP2R3K3.js} +3 -3
  100. package/dist/{Modal-cz6JIsZn.js.map → Modal-DHP2R3K3.js.map} +1 -1
  101. package/dist/{MultiSelect-C6l0LpIs.js → MultiSelect-B-FPQ08c.js} +4 -4
  102. package/dist/{MultiSelect-C6l0LpIs.js.map → MultiSelect-B-FPQ08c.js.map} +1 -1
  103. package/dist/{MultiSelect-BIwE6wb7.cjs → MultiSelect-S5VG9g3l.cjs} +2 -2
  104. package/dist/{MultiSelect-BIwE6wb7.cjs.map → MultiSelect-S5VG9g3l.cjs.map} +1 -1
  105. package/dist/{NumberField-BpUTV_Qn.js → NumberField-CzyvDMRV.js} +3 -3
  106. package/dist/{NumberField-BpUTV_Qn.js.map → NumberField-CzyvDMRV.js.map} +1 -1
  107. package/dist/{NumberField-IyhO4OpJ.cjs → NumberField-SSGXlF8U.cjs} +2 -2
  108. package/dist/{NumberField-IyhO4OpJ.cjs.map → NumberField-SSGXlF8U.cjs.map} +1 -1
  109. package/dist/{OtpField-BoLxbGtY.js → OtpField-CMoJqcx1.js} +2 -2
  110. package/dist/{OtpField-BoLxbGtY.js.map → OtpField-CMoJqcx1.js.map} +1 -1
  111. package/dist/{OtpField-HMrxkdiy.cjs → OtpField-Pr7Ch0El.cjs} +2 -2
  112. package/dist/{OtpField-HMrxkdiy.cjs.map → OtpField-Pr7Ch0El.cjs.map} +1 -1
  113. package/dist/{PageLayout-DtWG-6dn.cjs → PageLayout-BIMkjq-q.cjs} +2 -2
  114. package/dist/{PageLayout-DtWG-6dn.cjs.map → PageLayout-BIMkjq-q.cjs.map} +1 -1
  115. package/dist/{PageLayout-G8F1WgC-.js → PageLayout-Ctr-IEzX.js} +2 -2
  116. package/dist/{PageLayout-G8F1WgC-.js.map → PageLayout-Ctr-IEzX.js.map} +1 -1
  117. package/dist/{PageNotFound-DG8xXPL3.cjs → PageNotFound-CnhBheI4.cjs} +2 -2
  118. package/dist/{PageNotFound-DG8xXPL3.cjs.map → PageNotFound-CnhBheI4.cjs.map} +1 -1
  119. package/dist/{PageNotFound-CeKIMZ55.js → PageNotFound-KKJTeaRF.js} +5 -5
  120. package/dist/{PageNotFound-CeKIMZ55.js.map → PageNotFound-KKJTeaRF.js.map} +1 -1
  121. package/dist/{Pagination-Br8P3KwE.cjs → Pagination-BD5WOW98.cjs} +2 -2
  122. package/dist/{Pagination-Br8P3KwE.cjs.map → Pagination-BD5WOW98.cjs.map} +1 -1
  123. package/dist/{Pagination-CE1uKrR4.js → Pagination-Oyms2ERd.js} +2 -2
  124. package/dist/{Pagination-CE1uKrR4.js.map → Pagination-Oyms2ERd.js.map} +1 -1
  125. package/dist/{PaletteField-BBPbkDcp.js → PaletteField-BHzzzdou.js} +3 -3
  126. package/dist/{PaletteField-BBPbkDcp.js.map → PaletteField-BHzzzdou.js.map} +1 -1
  127. package/dist/{PaletteField-DwvSn6V6.cjs → PaletteField-CCQGW5LC.cjs} +2 -2
  128. package/dist/{PaletteField-DwvSn6V6.cjs.map → PaletteField-CCQGW5LC.cjs.map} +1 -1
  129. package/dist/{PhoneField-BclMbl7L.cjs → PhoneField-5zGY4Wko.cjs} +2 -2
  130. package/dist/{PhoneField-BclMbl7L.cjs.map → PhoneField-5zGY4Wko.cjs.map} +1 -1
  131. package/dist/{PhoneField-B-L0xAtD.js → PhoneField-CBfmChPx.js} +4 -4
  132. package/dist/{PhoneField-B-L0xAtD.js.map → PhoneField-CBfmChPx.js.map} +1 -1
  133. package/dist/{Popconfirm-BgpvCBy1.js → Popconfirm-BtGDhqrc.js} +3 -3
  134. package/dist/{Popconfirm-BgpvCBy1.js.map → Popconfirm-BtGDhqrc.js.map} +1 -1
  135. package/dist/{Popconfirm-DD8F8SXn.cjs → Popconfirm-CkBdntxV.cjs} +2 -2
  136. package/dist/{Popconfirm-DD8F8SXn.cjs.map → Popconfirm-CkBdntxV.cjs.map} +1 -1
  137. package/dist/{Progress-_aZ8XOJr.cjs → Progress-Bwxx71Ns.cjs} +2 -2
  138. package/dist/{Progress-_aZ8XOJr.cjs.map → Progress-Bwxx71Ns.cjs.map} +1 -1
  139. package/dist/{Progress-L5koRRJp.js → Progress-pTbaOSDd.js} +2 -2
  140. package/dist/{Progress-L5koRRJp.js.map → Progress-pTbaOSDd.js.map} +1 -1
  141. package/dist/{QueryError-tBuIQRgv.js → QueryError-Bu_MNGek.js} +2 -2
  142. package/dist/{QueryError-tBuIQRgv.js.map → QueryError-Bu_MNGek.js.map} +1 -1
  143. package/dist/{QueryError-BMH8X69O.cjs → QueryError-C01oichG.cjs} +2 -2
  144. package/dist/{QueryError-BMH8X69O.cjs.map → QueryError-C01oichG.cjs.map} +1 -1
  145. package/dist/{RemoveDialog-DBKYnTYU.cjs → RemoveDialog-Bm2mJB3l.cjs} +2 -2
  146. package/dist/{RemoveDialog-DBKYnTYU.cjs.map → RemoveDialog-Bm2mJB3l.cjs.map} +1 -1
  147. package/dist/{RemoveDialog-C9_UzFBf.js → RemoveDialog-C2uJzWi-.js} +5 -5
  148. package/dist/{RemoveDialog-C9_UzFBf.js.map → RemoveDialog-C2uJzWi-.js.map} +1 -1
  149. package/dist/{RichTextEditor-fXcbUjTl.js → RichTextEditor-BDAWmQrN.js} +7 -7
  150. package/dist/{RichTextEditor-fXcbUjTl.js.map → RichTextEditor-BDAWmQrN.js.map} +1 -1
  151. package/dist/{RichTextEditor-DTz7Qcn_.cjs → RichTextEditor-D4HpPT3C.cjs} +2 -2
  152. package/dist/{RichTextEditor-DTz7Qcn_.cjs.map → RichTextEditor-D4HpPT3C.cjs.map} +1 -1
  153. package/dist/{RootLayout-p8ArA6wA.js → RootLayout-CxncyjCz.js} +13 -13
  154. package/dist/{RootLayout-p8ArA6wA.js.map → RootLayout-CxncyjCz.js.map} +1 -1
  155. package/dist/{RootLayout-DG2dXhXn.cjs → RootLayout-XEcU_MBs.cjs} +2 -2
  156. package/dist/{RootLayout-DG2dXhXn.cjs.map → RootLayout-XEcU_MBs.cjs.map} +1 -1
  157. package/dist/{Select-BuVfUiw-.cjs → Select-CVVJKAtS.cjs} +2 -2
  158. package/dist/{Select-BuVfUiw-.cjs.map → Select-CVVJKAtS.cjs.map} +1 -1
  159. package/dist/{Select-BAR_aVSz.js → Select-d9LDI8O3.js} +3 -3
  160. package/dist/{Select-BAR_aVSz.js.map → Select-d9LDI8O3.js.map} +1 -1
  161. package/dist/{Sidebar-NI5HGGYF.cjs → Sidebar-B8ecHwZr.cjs} +2 -2
  162. package/dist/{Sidebar-NI5HGGYF.cjs.map → Sidebar-B8ecHwZr.cjs.map} +1 -1
  163. package/dist/{Sidebar-CsWcjSTx.js → Sidebar-BgCfnZBF.js} +3 -3
  164. package/dist/{Sidebar-CsWcjSTx.js.map → Sidebar-BgCfnZBF.js.map} +1 -1
  165. package/dist/{SpeedDial-DF-ILheU.js → SpeedDial-CBVwgnFp.js} +2 -2
  166. package/dist/{SpeedDial-DF-ILheU.js.map → SpeedDial-CBVwgnFp.js.map} +1 -1
  167. package/dist/{SpeedDial-C_rZkHmF.cjs → SpeedDial-CEr2JWQb.cjs} +2 -2
  168. package/dist/{SpeedDial-C_rZkHmF.cjs.map → SpeedDial-CEr2JWQb.cjs.map} +1 -1
  169. package/dist/{Stepper-CT7n113R.cjs → Stepper-DOSc03YV.cjs} +2 -2
  170. package/dist/{Stepper-CT7n113R.cjs.map → Stepper-DOSc03YV.cjs.map} +1 -1
  171. package/dist/{Stepper-B39Ax_w6.js → Stepper-DtYamv1q.js} +2 -2
  172. package/dist/{Stepper-B39Ax_w6.js.map → Stepper-DtYamv1q.js.map} +1 -1
  173. package/dist/{Table-CH_oiEP3.js → Table-AzNzUAkl.js} +15 -15
  174. package/dist/{Table-CH_oiEP3.js.map → Table-AzNzUAkl.js.map} +1 -1
  175. package/dist/{Table-DD_uysnY.cjs → Table-CrpWhZUg.cjs} +2 -2
  176. package/dist/{Table-DD_uysnY.cjs.map → Table-CrpWhZUg.cjs.map} +1 -1
  177. package/dist/{Tabs-C1N9FgAq.cjs → Tabs-CMnLXRjA.cjs} +2 -2
  178. package/dist/{Tabs-C1N9FgAq.cjs.map → Tabs-CMnLXRjA.cjs.map} +1 -1
  179. package/dist/{Tabs-By86Cmpw.js → Tabs-D1RGhKsa.js} +2 -2
  180. package/dist/{Tabs-By86Cmpw.js.map → Tabs-D1RGhKsa.js.map} +1 -1
  181. package/dist/{TagsField-RX-x45-j.cjs → TagsField-DcuSn7wL.cjs} +2 -2
  182. package/dist/{TagsField-RX-x45-j.cjs.map → TagsField-DcuSn7wL.cjs.map} +1 -1
  183. package/dist/{TagsField-BiOyAadf.js → TagsField-DuQEFHZ3.js} +4 -4
  184. package/dist/{TagsField-BiOyAadf.js.map → TagsField-DuQEFHZ3.js.map} +1 -1
  185. package/dist/{TextField-CdbanZuk.cjs → TextField-E85pvJQC.cjs} +2 -2
  186. package/dist/{TextField-CdbanZuk.cjs.map → TextField-E85pvJQC.cjs.map} +1 -1
  187. package/dist/{TextField-CkronCRC.js → TextField-SGYWviFf.js} +3 -3
  188. package/dist/{TextField-CkronCRC.js.map → TextField-SGYWviFf.js.map} +1 -1
  189. package/dist/{ThemeToggle-C4QhDd76.cjs → ThemeToggle-BdlxzYNt.cjs} +2 -2
  190. package/dist/{ThemeToggle-C4QhDd76.cjs.map → ThemeToggle-BdlxzYNt.cjs.map} +1 -1
  191. package/dist/{ThemeToggle-BYUEH6be.js → ThemeToggle-C2kjFrD_.js} +3 -3
  192. package/dist/{ThemeToggle-BYUEH6be.js.map → ThemeToggle-C2kjFrD_.js.map} +1 -1
  193. package/dist/{TimeColumns-yzjScNU8.js → TimeColumns-BS1d0qOp.js} +2 -2
  194. package/dist/{TimeColumns-yzjScNU8.js.map → TimeColumns-BS1d0qOp.js.map} +1 -1
  195. package/dist/{TimeColumns-Cl0_IRf0.cjs → TimeColumns-D7-O4Qyt.cjs} +2 -2
  196. package/dist/{TimeColumns-Cl0_IRf0.cjs.map → TimeColumns-D7-O4Qyt.cjs.map} +1 -1
  197. package/dist/{TimePicker-CoIdMv1S.js → TimePicker-DlzYNDN1.js} +5 -5
  198. package/dist/{TimePicker-CoIdMv1S.js.map → TimePicker-DlzYNDN1.js.map} +1 -1
  199. package/dist/{TimePicker-CJGVGETl.cjs → TimePicker-Dzb3gycP.cjs} +2 -2
  200. package/dist/{TimePicker-CJGVGETl.cjs.map → TimePicker-Dzb3gycP.cjs.map} +1 -1
  201. package/dist/{Toaster-lv5cJhib.cjs → Toaster-Cummylmj.cjs} +2 -2
  202. package/dist/{Toaster-lv5cJhib.cjs.map → Toaster-Cummylmj.cjs.map} +1 -1
  203. package/dist/{Toaster-Dhz2mYq_.js → Toaster-cu5XyKeE.js} +2 -2
  204. package/dist/{Toaster-Dhz2mYq_.js.map → Toaster-cu5XyKeE.js.map} +1 -1
  205. package/dist/{TranslatedFields-BCJ86Tqp.cjs → TranslatedFields-CbTlgKnh.cjs} +2 -2
  206. package/dist/{TranslatedFields-BCJ86Tqp.cjs.map → TranslatedFields-CbTlgKnh.cjs.map} +1 -1
  207. package/dist/{TranslatedFields-BtNUAyrY.js → TranslatedFields-Ccjhq2YL.js} +5 -5
  208. package/dist/{TranslatedFields-BtNUAyrY.js.map → TranslatedFields-Ccjhq2YL.js.map} +1 -1
  209. package/dist/{UserCard-CiQUrZjb.cjs → UserCard-BfHHfkDr.cjs} +2 -2
  210. package/dist/{UserCard-CiQUrZjb.cjs.map → UserCard-BfHHfkDr.cjs.map} +1 -1
  211. package/dist/{UserCard-B-eNyZuT.js → UserCard-Bs8kuV2j.js} +3 -3
  212. package/dist/{UserCard-B-eNyZuT.js.map → UserCard-Bs8kuV2j.js.map} +1 -1
  213. package/dist/components/Alert/index.cjs +1 -1
  214. package/dist/components/Alert/index.js +1 -1
  215. package/dist/components/Breadcrumbs/index.cjs +1 -1
  216. package/dist/components/Breadcrumbs/index.js +1 -1
  217. package/dist/components/Button/index.cjs +1 -1
  218. package/dist/components/Button/index.js +1 -1
  219. package/dist/components/Card/index.cjs +1 -1
  220. package/dist/components/Card/index.js +1 -1
  221. package/dist/components/Chip/index.cjs +1 -1
  222. package/dist/components/Chip/index.js +1 -1
  223. package/dist/components/CodeBlock/index.cjs +1 -1
  224. package/dist/components/CodeBlock/index.js +1 -1
  225. package/dist/components/ColorPicker/index.cjs +1 -1
  226. package/dist/components/ColorPicker/index.js +1 -1
  227. package/dist/components/ColorRamp/index.cjs +1 -1
  228. package/dist/components/ColorRamp/index.js +1 -1
  229. package/dist/components/CopyButton/index.cjs +1 -1
  230. package/dist/components/CopyButton/index.js +1 -1
  231. package/dist/components/DatePicker/index.cjs +1 -1
  232. package/dist/components/DatePicker/index.js +1 -1
  233. package/dist/components/DateTimePicker/index.cjs +1 -1
  234. package/dist/components/DateTimePicker/index.js +1 -1
  235. package/dist/components/DescriptionList/index.cjs +1 -1
  236. package/dist/components/DescriptionList/index.js +1 -1
  237. package/dist/components/EmptyState/index.cjs +1 -1
  238. package/dist/components/EmptyState/index.js +1 -1
  239. package/dist/components/ErrorState/ErrorState.d.cts +13 -1
  240. package/dist/components/ErrorState/ErrorState.d.ts +13 -1
  241. package/dist/components/ErrorState/errorMessage.d.cts +12 -0
  242. package/dist/components/ErrorState/errorMessage.d.ts +12 -0
  243. package/dist/components/ErrorState/index.cjs +1 -1
  244. package/dist/components/ErrorState/index.d.cts +1 -1
  245. package/dist/components/ErrorState/index.d.ts +1 -1
  246. package/dist/components/ErrorState/index.js +6 -4
  247. package/dist/components/FileCard/index.cjs +1 -1
  248. package/dist/components/FileCard/index.js +1 -1
  249. package/dist/components/FileUploader/index.cjs +1 -1
  250. package/dist/components/FileUploader/index.js +1 -1
  251. package/dist/components/Flag/index.cjs +1 -1
  252. package/dist/components/Flag/index.js +1 -1
  253. package/dist/components/FullscreenToggle/index.cjs +1 -1
  254. package/dist/components/FullscreenToggle/index.js +1 -1
  255. package/dist/components/IconButton/index.cjs +1 -1
  256. package/dist/components/IconButton/index.js +1 -1
  257. package/dist/components/Loader/index.cjs +1 -1
  258. package/dist/components/Loader/index.js +1 -1
  259. package/dist/components/Modal/index.cjs +1 -1
  260. package/dist/components/Modal/index.js +1 -1
  261. package/dist/components/MultiSelect/index.cjs +1 -1
  262. package/dist/components/MultiSelect/index.js +1 -1
  263. package/dist/components/NumberField/index.cjs +1 -1
  264. package/dist/components/NumberField/index.js +1 -1
  265. package/dist/components/OtpField/index.cjs +1 -1
  266. package/dist/components/OtpField/index.js +1 -1
  267. package/dist/components/PageLayout/index.cjs +1 -1
  268. package/dist/components/PageLayout/index.js +1 -1
  269. package/dist/components/PageNotFound/index.cjs +1 -1
  270. package/dist/components/PageNotFound/index.js +1 -1
  271. package/dist/components/Pagination/index.cjs +1 -1
  272. package/dist/components/Pagination/index.js +1 -1
  273. package/dist/components/PaletteField/index.cjs +1 -1
  274. package/dist/components/PaletteField/index.js +1 -1
  275. package/dist/components/PhoneField/index.cjs +1 -1
  276. package/dist/components/PhoneField/index.js +1 -1
  277. package/dist/components/Popconfirm/index.cjs +1 -1
  278. package/dist/components/Popconfirm/index.js +1 -1
  279. package/dist/components/Progress/index.cjs +1 -1
  280. package/dist/components/Progress/index.js +1 -1
  281. package/dist/components/RemoveDialog/index.cjs +1 -1
  282. package/dist/components/RemoveDialog/index.js +1 -1
  283. package/dist/components/RichTextEditor/index.cjs +1 -1
  284. package/dist/components/RichTextEditor/index.js +1 -1
  285. package/dist/components/RootLayout/index.cjs +1 -1
  286. package/dist/components/RootLayout/index.js +1 -1
  287. package/dist/components/Select/index.cjs +1 -1
  288. package/dist/components/Select/index.js +1 -1
  289. package/dist/components/Sidebar/index.cjs +1 -1
  290. package/dist/components/Sidebar/index.js +1 -1
  291. package/dist/components/SpeedDial/index.cjs +1 -1
  292. package/dist/components/SpeedDial/index.js +1 -1
  293. package/dist/components/Stepper/index.cjs +1 -1
  294. package/dist/components/Stepper/index.js +1 -1
  295. package/dist/components/Table/index.cjs +1 -1
  296. package/dist/components/Table/index.js +1 -1
  297. package/dist/components/Tabs/index.cjs +1 -1
  298. package/dist/components/Tabs/index.js +1 -1
  299. package/dist/components/TagsField/index.cjs +1 -1
  300. package/dist/components/TagsField/index.js +1 -1
  301. package/dist/components/TextField/index.cjs +1 -1
  302. package/dist/components/TextField/index.js +1 -1
  303. package/dist/components/ThemeToggle/index.cjs +1 -1
  304. package/dist/components/ThemeToggle/index.js +1 -1
  305. package/dist/components/TimePicker/index.cjs +1 -1
  306. package/dist/components/TimePicker/index.js +1 -1
  307. package/dist/components/Toast/index.cjs +1 -1
  308. package/dist/components/Toast/index.js +1 -1
  309. package/dist/components/TranslatedFields/index.cjs +1 -1
  310. package/dist/components/TranslatedFields/index.js +1 -1
  311. package/dist/components/UserCard/index.cjs +1 -1
  312. package/dist/components/UserCard/index.js +1 -1
  313. package/dist/entries/app.cjs +1 -1
  314. package/dist/entries/app.js +1 -1
  315. package/dist/entries/components.cjs +1 -1
  316. package/dist/entries/components.js +144 -142
  317. package/dist/entries/hooks.cjs +1 -1
  318. package/dist/entries/hooks.d.cts +2 -0
  319. package/dist/entries/hooks.d.ts +2 -0
  320. package/dist/entries/hooks.js +9 -8
  321. package/dist/entries/i18n.cjs +1 -1
  322. package/dist/entries/i18n.js +2 -2
  323. package/dist/entries/theme.cjs +1 -1
  324. package/dist/entries/theme.js +1 -1
  325. package/dist/hooks/index.d.cts +2 -0
  326. package/dist/hooks/index.d.ts +2 -0
  327. package/dist/hooks/useTableQuery.d.cts +56 -0
  328. package/dist/hooks/useTableQuery.d.ts +56 -0
  329. package/dist/i18n/messages.d.cts +1 -0
  330. package/dist/i18n/messages.d.ts +1 -0
  331. package/dist/index.cjs +1 -1
  332. package/dist/index.css +1 -1
  333. package/dist/index.js +247 -244
  334. package/dist/{messages-BF2ft7yD.js → messages-DCefu6Pn.js} +20 -13
  335. package/dist/messages-DCefu6Pn.js.map +1 -0
  336. package/dist/messages-FiUqCKjJ.cjs +36 -0
  337. package/dist/messages-FiUqCKjJ.cjs.map +1 -0
  338. package/dist/useForm-CN-qCrP7.js +144 -0
  339. package/dist/useForm-CN-qCrP7.js.map +1 -0
  340. package/dist/useForm-WvV361y6.cjs +2 -0
  341. package/dist/useForm-WvV361y6.cjs.map +1 -0
  342. package/dist/{useOptionMenu-C0xSaZ4t.cjs → useOptionMenu-BoWyPgbY.cjs} +2 -2
  343. package/dist/{useOptionMenu-C0xSaZ4t.cjs.map → useOptionMenu-BoWyPgbY.cjs.map} +1 -1
  344. package/dist/{useOptionMenu-Cq_eHdab.js → useOptionMenu-D7EbYG9A.js} +3 -3
  345. package/dist/{useOptionMenu-Cq_eHdab.js.map → useOptionMenu-D7EbYG9A.js.map} +1 -1
  346. package/package.json +2 -1
  347. package/dist/ErrorBoundary-DJ6R1M9k.js +0 -126
  348. package/dist/ErrorBoundary-DJ6R1M9k.js.map +0 -1
  349. package/dist/ErrorBoundary-unvC1vZQ.cjs +0 -2
  350. package/dist/ErrorBoundary-unvC1vZQ.cjs.map +0 -1
  351. package/dist/messages-BF2ft7yD.js.map +0 -1
  352. package/dist/messages-ihnE1jVG.cjs +0 -36
  353. package/dist/messages-ihnE1jVG.cjs.map +0 -1
  354. package/dist/useForm-B_5wDIER.js +0 -126
  355. package/dist/useForm-B_5wDIER.js.map +0 -1
  356. package/dist/useForm-C7erBHt0.cjs +0 -2
  357. package/dist/useForm-C7erBHt0.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";const s=require("react/jsx-runtime"),R=require("react"),S=require("clsx"),G=require("./breakpoints-Dpnh6BbG.cjs"),J=require("./useMediaQuery-CHMrI6Dy.cjs"),K=require("./names-BJnFU_5m.cjs"),V=require("./Icon-BVULqOJD.cjs"),X=require("./CopyButton-B5aicGl3.cjs"),Y=require("./IconButton-A2B0bqC-.cjs"),k=require("./Skeleton-DK0lAjS9.cjs"),q=require("./Typography-B6ASPrzT.cjs"),Z=require("./ConfigProvider-BElY0HuV.cjs"),W="_root_1hhb1_4",ee="_sm_1hhb1_14",se="_md_1hhb1_22",te="_lg_1hhb1_30",ae="_header_1hhb1_40",le="_headerMain_1hhb1_49",ne="_headerIcon_1hhb1_56",oe="_headerText_1hhb1_59",re="_title_1hhb1_65",ce="_actions_1hhb1_68",de="_grid_1hhb1_80",he="_item_1hhb1_87",ie="_dividers_1hhb1_95",_e="_lastRow_1hhb1_99",ue="_label_1hhb1_103",pe="_labelIcon_1hhb1_111",be="_value_1hhb1_116",me="_valueMedium_1hhb1_125",ve="_valueBold_1hhb1_128",xe="_valueText_1hhb1_131",ye="_placeholder_1hhb1_135",je="_copy_1hhb1_148",Ne="_copyButton_1hhb1_156",fe="_horizontal_1hhb1_172",ge="_stacked_1hhb1_170",Ie="_bordered_1hhb1_184",we="_lastRowStart_1hhb1_213",e={root:W,sm:ee,md:se,lg:te,header:ae,headerMain:le,headerIcon:ne,headerText:oe,title:re,actions:ce,grid:de,item:he,dividers:ie,lastRow:_e,label:ue,labelIcon:pe,value:be,valueMedium:me,valueBold:ve,valueText:xe,placeholder:ye,copy:je,copyButton:Ne,horizontal:fe,stacked:ge,bordered:Ie,lastRowStart:we},Te=new Set(K.ICON_NAMES),Me={xs:1,sm:2,lg:3},Re=t=>t==null||t===""||t===!1,Se=t=>{if(typeof t.copyable=="string")return t.copyable;if(typeof t.value=="string"||typeof t.value=="number")return String(t.value)},ke=(t,n)=>{let r=0,l=0;return t.map(h=>{const o=Math.min(h.span??1,n);l+o>n&&(r+=1,l=0);const u={item:h,span:o,row:r,col:l};return l+=o,l>=n&&(r+=1,l=0),u})},B=(t,n="sm")=>typeof t=="string"&&Te.has(t)?s.jsx(V.Icon,{name:t,size:n}):t,qe=R.forwardRef(function({items:n,columns:r=Me,layout:l="vertical",size:h="md",valueWeight:o="regular",bordered:u=!1,dividers:C=!0,labelWidth:p=160,stackBelow:x="xxs",loading:c=!1,emptyText:L="—",title:d,icon:b,color:z="accent",subtitle:i,actions:m,className:E,style:A,...D},O){const y=Z.useT(),j=`${R.useId()}-title`,N=J.useBreakpointMatches(),f=G.resolveResponsive(r,N)??1,$=l==="horizontal"&&x!==!1&&N[x],g=n.filter(a=>!a.hidden),_=ke(g,f),I=_.length?_[_.length-1].row:0,U=typeof c=="number"?c:g.length||6,F=d!=null||i!=null||m!=null||b!=null,H={"--dl-cols":f,"--dl-label-w":typeof p=="number"?`${p}px`:p};return s.jsxs("div",{ref:O,className:S.clsx(e.root,e[h],e[l],o!=="regular"&&e[`value${o==="bold"?"Bold":"Medium"}`],u&&e.bordered,C&&e.dividers,$&&e.stacked,E),style:{...H,...A},...D,children:[F&&s.jsxs("div",{className:e.header,children:[s.jsxs("div",{className:e.headerMain,children:[b!=null&&s.jsx(Y.IconButton,{variant:"filled",size:"sm",color:z,nonClickable:!0,"aria-hidden":!0,className:e.headerIcon,children:B(b,"md")}),(d!=null||i!=null)&&s.jsxs("div",{className:e.headerText,children:[d!=null&&s.jsx(q.Typography,{as:"h3",id:j,variant:"subtitle",className:e.title,children:d}),i!=null&&s.jsx(q.Typography,{as:"p",variant:"bodySmall",color:"muted",children:i})]})]}),m!=null&&s.jsx("div",{className:e.actions,children:m})]}),s.jsx("dl",{className:e.grid,"aria-labelledby":d!=null?j:void 0,"aria-busy":c?!0:void 0,"aria-label":c?y("descriptionList.loading"):void 0,children:c?Array.from({length:U},(a,v)=>s.jsxs("div",{className:e.item,"aria-hidden":"true",children:[s.jsx("dt",{className:e.label,children:s.jsx(k.Skeleton,{width:"40%",height:"0.9em"})}),s.jsx("dd",{className:e.value,children:s.jsx(k.Skeleton,{width:"70%",height:"1.1em"})})]},v)):_.map(({item:a,span:v,row:w,col:P},Q)=>{const T=Re(a.value),M=!T&&a.copyable?Se(a):void 0;return s.jsxs("div",{className:S.clsx(e.item,w===I&&e.lastRow,w===I&&P===0&&e.lastRowStart),style:{"--dl-span":v},children:[s.jsxs("dt",{className:e.label,children:[a.icon!=null&&s.jsx("span",{className:e.labelIcon,"aria-hidden":"true",children:B(a.icon)}),a.label]}),s.jsxs("dd",{className:e.value,children:[s.jsx("span",{className:e.valueText,children:T?s.jsx("span",{className:e.placeholder,"aria-label":y("descriptionList.empty"),children:L}):a.value}),M!=null&&s.jsx("span",{className:e.copy,children:s.jsx(X.CopyButton,{value:M,size:"sm",variant:"text",className:e.copyButton})})]})]},a.key??Q)})})]})});exports.DescriptionList=qe;
2
- //# sourceMappingURL=DescriptionList-BCvOX8fg.cjs.map
1
+ "use strict";const s=require("react/jsx-runtime"),R=require("react"),S=require("clsx"),G=require("./breakpoints-Dpnh6BbG.cjs"),J=require("./useMediaQuery-CHMrI6Dy.cjs"),K=require("./names-BJnFU_5m.cjs"),V=require("./Icon-BVULqOJD.cjs"),X=require("./CopyButton-SFwjKod9.cjs"),Y=require("./IconButton-BNa0yLcv.cjs"),k=require("./Skeleton-DK0lAjS9.cjs"),q=require("./Typography-B6ASPrzT.cjs"),Z=require("./ConfigProvider-ByLHqXpv.cjs"),W="_root_1hhb1_4",ee="_sm_1hhb1_14",se="_md_1hhb1_22",te="_lg_1hhb1_30",ae="_header_1hhb1_40",le="_headerMain_1hhb1_49",ne="_headerIcon_1hhb1_56",oe="_headerText_1hhb1_59",re="_title_1hhb1_65",ce="_actions_1hhb1_68",de="_grid_1hhb1_80",he="_item_1hhb1_87",ie="_dividers_1hhb1_95",_e="_lastRow_1hhb1_99",ue="_label_1hhb1_103",pe="_labelIcon_1hhb1_111",be="_value_1hhb1_116",me="_valueMedium_1hhb1_125",ve="_valueBold_1hhb1_128",xe="_valueText_1hhb1_131",ye="_placeholder_1hhb1_135",je="_copy_1hhb1_148",Ne="_copyButton_1hhb1_156",fe="_horizontal_1hhb1_172",ge="_stacked_1hhb1_170",Ie="_bordered_1hhb1_184",we="_lastRowStart_1hhb1_213",e={root:W,sm:ee,md:se,lg:te,header:ae,headerMain:le,headerIcon:ne,headerText:oe,title:re,actions:ce,grid:de,item:he,dividers:ie,lastRow:_e,label:ue,labelIcon:pe,value:be,valueMedium:me,valueBold:ve,valueText:xe,placeholder:ye,copy:je,copyButton:Ne,horizontal:fe,stacked:ge,bordered:Ie,lastRowStart:we},Te=new Set(K.ICON_NAMES),Me={xs:1,sm:2,lg:3},Re=t=>t==null||t===""||t===!1,Se=t=>{if(typeof t.copyable=="string")return t.copyable;if(typeof t.value=="string"||typeof t.value=="number")return String(t.value)},ke=(t,n)=>{let r=0,l=0;return t.map(h=>{const o=Math.min(h.span??1,n);l+o>n&&(r+=1,l=0);const u={item:h,span:o,row:r,col:l};return l+=o,l>=n&&(r+=1,l=0),u})},B=(t,n="sm")=>typeof t=="string"&&Te.has(t)?s.jsx(V.Icon,{name:t,size:n}):t,qe=R.forwardRef(function({items:n,columns:r=Me,layout:l="vertical",size:h="md",valueWeight:o="regular",bordered:u=!1,dividers:C=!0,labelWidth:p=160,stackBelow:x="xxs",loading:c=!1,emptyText:L="—",title:d,icon:b,color:z="accent",subtitle:i,actions:m,className:E,style:A,...D},O){const y=Z.useT(),j=`${R.useId()}-title`,N=J.useBreakpointMatches(),f=G.resolveResponsive(r,N)??1,$=l==="horizontal"&&x!==!1&&N[x],g=n.filter(a=>!a.hidden),_=ke(g,f),I=_.length?_[_.length-1].row:0,U=typeof c=="number"?c:g.length||6,F=d!=null||i!=null||m!=null||b!=null,H={"--dl-cols":f,"--dl-label-w":typeof p=="number"?`${p}px`:p};return s.jsxs("div",{ref:O,className:S.clsx(e.root,e[h],e[l],o!=="regular"&&e[`value${o==="bold"?"Bold":"Medium"}`],u&&e.bordered,C&&e.dividers,$&&e.stacked,E),style:{...H,...A},...D,children:[F&&s.jsxs("div",{className:e.header,children:[s.jsxs("div",{className:e.headerMain,children:[b!=null&&s.jsx(Y.IconButton,{variant:"filled",size:"sm",color:z,nonClickable:!0,"aria-hidden":!0,className:e.headerIcon,children:B(b,"md")}),(d!=null||i!=null)&&s.jsxs("div",{className:e.headerText,children:[d!=null&&s.jsx(q.Typography,{as:"h3",id:j,variant:"subtitle",className:e.title,children:d}),i!=null&&s.jsx(q.Typography,{as:"p",variant:"bodySmall",color:"muted",children:i})]})]}),m!=null&&s.jsx("div",{className:e.actions,children:m})]}),s.jsx("dl",{className:e.grid,"aria-labelledby":d!=null?j:void 0,"aria-busy":c?!0:void 0,"aria-label":c?y("descriptionList.loading"):void 0,children:c?Array.from({length:U},(a,v)=>s.jsxs("div",{className:e.item,"aria-hidden":"true",children:[s.jsx("dt",{className:e.label,children:s.jsx(k.Skeleton,{width:"40%",height:"0.9em"})}),s.jsx("dd",{className:e.value,children:s.jsx(k.Skeleton,{width:"70%",height:"1.1em"})})]},v)):_.map(({item:a,span:v,row:w,col:P},Q)=>{const T=Re(a.value),M=!T&&a.copyable?Se(a):void 0;return s.jsxs("div",{className:S.clsx(e.item,w===I&&e.lastRow,w===I&&P===0&&e.lastRowStart),style:{"--dl-span":v},children:[s.jsxs("dt",{className:e.label,children:[a.icon!=null&&s.jsx("span",{className:e.labelIcon,"aria-hidden":"true",children:B(a.icon)}),a.label]}),s.jsxs("dd",{className:e.value,children:[s.jsx("span",{className:e.valueText,children:T?s.jsx("span",{className:e.placeholder,"aria-label":y("descriptionList.empty"),children:L}):a.value}),M!=null&&s.jsx("span",{className:e.copy,children:s.jsx(X.CopyButton,{value:M,size:"sm",variant:"text",className:e.copyButton})})]})]},a.key??Q)})})]})});exports.DescriptionList=qe;
2
+ //# sourceMappingURL=DescriptionList-U5z2Faf4.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DescriptionList-BCvOX8fg.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":"y1CAaMA,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,EAA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A,CAAK,UAAWoC,EAAO,KACtB,SAAApC,EAAAA,IAAC4C,EAAAA,WAAA,CACC,MAAOD,EACP,KAAK,KACL,QAAQ,OACR,UAAWP,EAAO,UAAA,CAAA,CACpB,CACF,CAAA,CAAA,CAEJ,CAAA,CAAA,EAvCK/C,EAAK,KAAOmD,CAAA,CA0CvB,CAAC,CAAA,CAAA,CACP,CAAA,CAAA,CAGN,CACF"}
1
+ {"version":3,"file":"DescriptionList-U5z2Faf4.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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C,IAAQqC,GAAWM,EAAO,QAC1B3C,IAAQqC,GAAWpC,IAAQ,GAAK0C,EAAO,YAAA,EAEzC,MAAO,CAAE,YAAazC,CAAA,EAEtB,SAAA,CAAAuC,EAAAA,KAAC,KAAA,CAAG,UAAWE,EAAO,MACnB,SAAA,CAAA/C,EAAK,MAAQ,MACZW,EAAAA,IAAC,OAAA,CAAK,UAAWoC,EAAO,UAAW,cAAY,OAC5C,SAAAvC,EAAWR,EAAK,IAAI,EACvB,EAEDA,EAAK,KAAA,EACR,EACA6C,EAAAA,KAAC,KAAA,CAAG,UAAWE,EAAO,MACpB,SAAA,CAAApC,EAAAA,IAAC,OAAA,CAAK,UAAWoC,EAAO,UACrB,SAAAM,EACC1C,EAAAA,IAAC,OAAA,CACC,UAAWoC,EAAO,YAClB,aAAYf,EAAE,uBAAuB,EAEpC,SAAAT,CAAA,CAAA,EAGHvB,EAAK,MAET,EACCsD,GAAQ,MACP3C,EAAAA,IAAC,OAAA,CAAK,UAAWoC,EAAO,KACtB,SAAApC,EAAAA,IAAC4C,EAAAA,WAAA,CACC,MAAOD,EACP,KAAK,KACL,QAAQ,OACR,UAAWP,EAAO,UAAA,CAAA,CACpB,CACF,CAAA,CAAA,CAEJ,CAAA,CAAA,EAvCK/C,EAAK,KAAOmD,CAAA,CA0CvB,CAAC,CAAA,CAAA,CACP,CAAA,CAAA,CAGN,CACF"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),S=require("react"),N=require("clsx"),a=require("./Icon-BVULqOJD.cjs"),j=require("./names-BJnFU_5m.cjs"),g=require("./ConfigProvider-BElY0HuV.cjs"),h="_emptyState_1vpxy_3",f="_sm_1vpxy_17",q="_md_1vpxy_23",E="_lg_1vpxy_29",I="_icon_1vpxy_37",b="_title_1vpxy_55",C="_description_1vpxy_61",O="_action_1vpxy_70",T="_pattern_1vpxy_77",w="_tinted_1vpxy_100",t={emptyState:h,sm:f,md:q,lg:E,icon:I,title:b,description:C,action:O,pattern:T,tinted:w},z=new Set(j.ICON_NAMES),A=S.forwardRef(function({icon:n,title:_,description:c,action:i,size:d="md",pattern:p=!0,color:s,className:m,style:r,children:x,...y},u){const v=g.useT(),l=_??v("emptyState.title"),o=n===!1?null:n==null?e.jsx(a.Icon,{name:"FolderOpen"}):typeof n=="string"&&z.has(n)?e.jsx(a.Icon,{name:n}):n;return e.jsxs("div",{ref:u,className:N.clsx(t.emptyState,t[d],p&&t.pattern,s&&t.tinted,m),style:s?{"--tz-btn-rgb":`var(--tz-color-${s}-rgb)`,...r}:r,...y,children:[o!=null&&e.jsx("div",{className:t.icon,"aria-hidden":!0,children:o}),l!=null&&e.jsx("div",{className:t.title,children:l}),c!=null&&e.jsx("div",{className:t.description,children:c}),i!=null&&e.jsx("div",{className:t.action,children:i}),x]})});exports.EmptyState=A;
2
- //# sourceMappingURL=EmptyState-CO_NRZ6w.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),S=require("react"),N=require("clsx"),a=require("./Icon-BVULqOJD.cjs"),j=require("./names-BJnFU_5m.cjs"),g=require("./ConfigProvider-ByLHqXpv.cjs"),h="_emptyState_1vpxy_3",f="_sm_1vpxy_17",q="_md_1vpxy_23",E="_lg_1vpxy_29",I="_icon_1vpxy_37",b="_title_1vpxy_55",C="_description_1vpxy_61",O="_action_1vpxy_70",T="_pattern_1vpxy_77",w="_tinted_1vpxy_100",t={emptyState:h,sm:f,md:q,lg:E,icon:I,title:b,description:C,action:O,pattern:T,tinted:w},z=new Set(j.ICON_NAMES),A=S.forwardRef(function({icon:n,title:_,description:c,action:i,size:d="md",pattern:p=!0,color:s,className:m,style:r,children:x,...y},u){const v=g.useT(),l=_??v("emptyState.title"),o=n===!1?null:n==null?e.jsx(a.Icon,{name:"FolderOpen"}):typeof n=="string"&&z.has(n)?e.jsx(a.Icon,{name:n}):n;return e.jsxs("div",{ref:u,className:N.clsx(t.emptyState,t[d],p&&t.pattern,s&&t.tinted,m),style:s?{"--tz-btn-rgb":`var(--tz-color-${s}-rgb)`,...r}:r,...y,children:[o!=null&&e.jsx("div",{className:t.icon,"aria-hidden":!0,children:o}),l!=null&&e.jsx("div",{className:t.title,children:l}),c!=null&&e.jsx("div",{className:t.description,children:c}),i!=null&&e.jsx("div",{className:t.action,children:i}),x]})});exports.EmptyState=A;
2
+ //# sourceMappingURL=EmptyState-B2_4BN4l.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState-CO_NRZ6w.cjs","sources":["../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './EmptyState.module.css'\n\nexport type EmptyStateSize = 'sm' | 'md' | 'lg'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Leading glyph shown in a soft circle — an `IconName`, any node, or `false` to hide it. Defaults to `FolderOpen`. */\n icon?: IconName | ReactNode | false\n /** Heading line. Defaults to `\"No Results Found\"`. */\n title?: ReactNode\n /** Muted description under the title (e.g. a hint on what to do next). */\n description?: ReactNode\n /** Action slot under the text — e.g. an \"Add Item\" or \"Clear Filters\" button. */\n action?: ReactNode\n /** Size — scales the icon, text, and vertical padding. Defaults to `md`. */\n size?: EmptyStateSize\n /**\n * Polished \"hero\" look: a faded grid backdrop (fades out toward the edges) + an elevated icon\n * (gradient + drop shadow). Defaults to `true`; pass `pattern={false}` for the flat, compact placeholder.\n */\n pattern?: boolean\n /** Tint the icon puck with a theme color (e.g. `error` for a failure). Omitted → the neutral muted puck. */\n color?: ThemeColor\n /** Extra content rendered below the action. */\n children?: ReactNode\n}\n\n/**\n * The empty-state placeholder — drop it in wherever a page, table, list, or gallery has nothing to\n * show (no records yet, no search matches). A centered, muted glyph in a soft circle + a `title` +\n * an optional `description` and `action` (e.g. a \"Add Item\" / \"Clear Filters\" button). Neutral by\n * design; pass a custom `icon` node for a tinted glyph. Token-only styling.\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n {\n icon,\n title,\n description,\n action,\n size = 'md',\n pattern = true,\n color,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const resolvedTitle = title ?? t('emptyState.title')\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name=\"FolderOpen\" />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.emptyState,\n styles[size],\n pattern && styles.pattern,\n color && styles.tinted,\n className,\n )}\n style={\n (color\n ? { '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style }\n : style) as CSSProperties\n }\n {...props}\n >\n {renderedIcon != null && (\n <div className={styles.icon} aria-hidden>\n {renderedIcon}\n </div>\n )}\n {resolvedTitle != null && <div className={styles.title}>{resolvedTitle}</div>}\n {description != null && <div className={styles.description}>{description}</div>}\n {action != null && <div className={styles.action}>{action}</div>}\n {children}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","EmptyState","forwardRef","icon","title","description","action","size","pattern","color","className","style","children","props","ref","t","useT","resolvedTitle","renderedIcon","jsx","Icon","jsxs","clsx","styles"],"mappings":"2eASMA,EAAgB,IAAI,IAAYC,YAAU,EA8BnCC,EAAaC,EAAAA,WAA4C,SACpE,CACE,KAAAC,EACA,MAAAC,EACA,YAAAC,EACA,OAAAC,EACA,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAgBb,GAASW,EAAE,kBAAkB,EAC7CG,EACJf,IAAS,GAAQ,KAAOA,GAAQ,KAC9BgB,MAACC,EAAAA,KAAA,CAAK,KAAK,YAAA,CAAa,EACtB,OAAOjB,GAAS,UAAYJ,EAAc,IAAII,CAAI,EACpDgB,MAACC,EAAAA,KAAA,CAAK,KAAMjB,CAAA,CAAkB,EAE9BA,EAGJ,OACEkB,EAAAA,KAAC,MAAA,CACC,IAAAP,EACA,UAAWQ,EAAAA,KACTC,EAAO,WACPA,EAAOhB,CAAI,EACXC,GAAWe,EAAO,QAClBd,GAASc,EAAO,OAChBb,CAAA,EAEF,MACGD,EACG,CAAE,eAAgB,kBAAkBA,CAAK,QAAS,GAAGE,CAAA,EACrDA,EAEL,GAAGE,EAEH,SAAA,CAAAK,GAAgB,YACd,MAAA,CAAI,UAAWK,EAAO,KAAM,cAAW,GACrC,SAAAL,CAAA,CACH,EAEDD,GAAiB,MAAQE,EAAAA,IAAC,OAAI,UAAWI,EAAO,MAAQ,SAAAN,EAAc,EACtEZ,GAAe,MAAQc,EAAAA,IAAC,OAAI,UAAWI,EAAO,YAAc,SAAAlB,EAAY,EACxEC,GAAU,MAAQa,EAAAA,IAAC,OAAI,UAAWI,EAAO,OAAS,SAAAjB,EAAO,EACzDM,CAAA,CAAA,CAAA,CAGP,CAAC"}
1
+ {"version":3,"file":"EmptyState-B2_4BN4l.cjs","sources":["../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './EmptyState.module.css'\n\nexport type EmptyStateSize = 'sm' | 'md' | 'lg'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Leading glyph shown in a soft circle — an `IconName`, any node, or `false` to hide it. Defaults to `FolderOpen`. */\n icon?: IconName | ReactNode | false\n /** Heading line. Defaults to `\"No Results Found\"`. */\n title?: ReactNode\n /** Muted description under the title (e.g. a hint on what to do next). */\n description?: ReactNode\n /** Action slot under the text — e.g. an \"Add Item\" or \"Clear Filters\" button. */\n action?: ReactNode\n /** Size — scales the icon, text, and vertical padding. Defaults to `md`. */\n size?: EmptyStateSize\n /**\n * Polished \"hero\" look: a faded grid backdrop (fades out toward the edges) + an elevated icon\n * (gradient + drop shadow). Defaults to `true`; pass `pattern={false}` for the flat, compact placeholder.\n */\n pattern?: boolean\n /** Tint the icon puck with a theme color (e.g. `error` for a failure). Omitted → the neutral muted puck. */\n color?: ThemeColor\n /** Extra content rendered below the action. */\n children?: ReactNode\n}\n\n/**\n * The empty-state placeholder — drop it in wherever a page, table, list, or gallery has nothing to\n * show (no records yet, no search matches). A centered, muted glyph in a soft circle + a `title` +\n * an optional `description` and `action` (e.g. a \"Add Item\" / \"Clear Filters\" button). Neutral by\n * design; pass a custom `icon` node for a tinted glyph. Token-only styling.\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n {\n icon,\n title,\n description,\n action,\n size = 'md',\n pattern = true,\n color,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const resolvedTitle = title ?? t('emptyState.title')\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name=\"FolderOpen\" />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.emptyState,\n styles[size],\n pattern && styles.pattern,\n color && styles.tinted,\n className,\n )}\n style={\n (color\n ? { '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style }\n : style) as CSSProperties\n }\n {...props}\n >\n {renderedIcon != null && (\n <div className={styles.icon} aria-hidden>\n {renderedIcon}\n </div>\n )}\n {resolvedTitle != null && <div className={styles.title}>{resolvedTitle}</div>}\n {description != null && <div className={styles.description}>{description}</div>}\n {action != null && <div className={styles.action}>{action}</div>}\n {children}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","EmptyState","forwardRef","icon","title","description","action","size","pattern","color","className","style","children","props","ref","t","useT","resolvedTitle","renderedIcon","jsx","Icon","jsxs","clsx","styles"],"mappings":"2eASMA,EAAgB,IAAI,IAAYC,YAAU,EA8BnCC,EAAaC,EAAAA,WAA4C,SACpE,CACE,KAAAC,EACA,MAAAC,EACA,YAAAC,EACA,OAAAC,EACA,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAgBb,GAASW,EAAE,kBAAkB,EAC7CG,EACJf,IAAS,GAAQ,KAAOA,GAAQ,KAC9BgB,MAACC,EAAAA,KAAA,CAAK,KAAK,YAAA,CAAa,EACtB,OAAOjB,GAAS,UAAYJ,EAAc,IAAII,CAAI,EACpDgB,MAACC,EAAAA,KAAA,CAAK,KAAMjB,CAAA,CAAkB,EAE9BA,EAGJ,OACEkB,EAAAA,KAAC,MAAA,CACC,IAAAP,EACA,UAAWQ,EAAAA,KACTC,EAAO,WACPA,EAAOhB,CAAI,EACXC,GAAWe,EAAO,QAClBd,GAASc,EAAO,OAChBb,CAAA,EAEF,MACGD,EACG,CAAE,eAAgB,kBAAkBA,CAAK,QAAS,GAAGE,CAAA,EACrDA,EAEL,GAAGE,EAEH,SAAA,CAAAK,GAAgB,YACd,MAAA,CAAI,UAAWK,EAAO,KAAM,cAAW,GACrC,SAAAL,CAAA,CACH,EAEDD,GAAiB,MAAQE,EAAAA,IAAC,OAAI,UAAWI,EAAO,MAAQ,SAAAN,EAAc,EACtEZ,GAAe,MAAQc,EAAAA,IAAC,OAAI,UAAWI,EAAO,YAAc,SAAAlB,EAAY,EACxEC,GAAU,MAAQa,EAAAA,IAAC,OAAI,UAAWI,EAAO,OAAS,SAAAjB,EAAO,EACzDM,CAAA,CAAA,CAAA,CAGP,CAAC"}
@@ -3,7 +3,7 @@ import { forwardRef as S } from "react";
3
3
  import { clsx as N } from "clsx";
4
4
  import { I as c } from "./Icon-DaTvzLBu.js";
5
5
  import { a as h } from "./names-r21QPjcU.js";
6
- import { a as g } from "./ConfigProvider-B_RSn9bb.js";
6
+ import { a as g } from "./ConfigProvider-BbsI15b-.js";
7
7
  const E = "_emptyState_1vpxy_3", I = "_sm_1vpxy_17", b = "_md_1vpxy_23", O = "_lg_1vpxy_29", T = "_icon_1vpxy_37", j = "_title_1vpxy_55", w = "_description_1vpxy_61", z = "_action_1vpxy_70", A = "_pattern_1vpxy_77", C = "_tinted_1vpxy_100", t = {
8
8
  emptyState: E,
9
9
  sm: I,
@@ -55,4 +55,4 @@ const E = "_emptyState_1vpxy_3", I = "_sm_1vpxy_17", b = "_md_1vpxy_23", O = "_l
55
55
  export {
56
56
  G as E
57
57
  };
58
- //# sourceMappingURL=EmptyState-BtwuzX9Z.js.map
58
+ //# sourceMappingURL=EmptyState-DwT9_HW7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState-BtwuzX9Z.js","sources":["../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './EmptyState.module.css'\n\nexport type EmptyStateSize = 'sm' | 'md' | 'lg'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Leading glyph shown in a soft circle — an `IconName`, any node, or `false` to hide it. Defaults to `FolderOpen`. */\n icon?: IconName | ReactNode | false\n /** Heading line. Defaults to `\"No Results Found\"`. */\n title?: ReactNode\n /** Muted description under the title (e.g. a hint on what to do next). */\n description?: ReactNode\n /** Action slot under the text — e.g. an \"Add Item\" or \"Clear Filters\" button. */\n action?: ReactNode\n /** Size — scales the icon, text, and vertical padding. Defaults to `md`. */\n size?: EmptyStateSize\n /**\n * Polished \"hero\" look: a faded grid backdrop (fades out toward the edges) + an elevated icon\n * (gradient + drop shadow). Defaults to `true`; pass `pattern={false}` for the flat, compact placeholder.\n */\n pattern?: boolean\n /** Tint the icon puck with a theme color (e.g. `error` for a failure). Omitted → the neutral muted puck. */\n color?: ThemeColor\n /** Extra content rendered below the action. */\n children?: ReactNode\n}\n\n/**\n * The empty-state placeholder — drop it in wherever a page, table, list, or gallery has nothing to\n * show (no records yet, no search matches). A centered, muted glyph in a soft circle + a `title` +\n * an optional `description` and `action` (e.g. a \"Add Item\" / \"Clear Filters\" button). Neutral by\n * design; pass a custom `icon` node for a tinted glyph. Token-only styling.\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n {\n icon,\n title,\n description,\n action,\n size = 'md',\n pattern = true,\n color,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const resolvedTitle = title ?? t('emptyState.title')\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name=\"FolderOpen\" />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.emptyState,\n styles[size],\n pattern && styles.pattern,\n color && styles.tinted,\n className,\n )}\n style={\n (color\n ? { '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style }\n : style) as CSSProperties\n }\n {...props}\n >\n {renderedIcon != null && (\n <div className={styles.icon} aria-hidden>\n {renderedIcon}\n </div>\n )}\n {resolvedTitle != null && <div className={styles.title}>{resolvedTitle}</div>}\n {description != null && <div className={styles.description}>{description}</div>}\n {action != null && <div className={styles.action}>{action}</div>}\n {children}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","EmptyState","forwardRef","icon","title","description","action","size","pattern","color","className","style","children","props","ref","t","useT","resolvedTitle","renderedIcon","jsx","Icon","jsxs","clsx","styles"],"mappings":";;;;;;;;;;;;;;;;;GASMA,IAAgB,IAAI,IAAYC,CAAU,GA8BnCC,IAAaC,EAA4C,SACpE;AAAA,EACE,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAgBb,KAASW,EAAE,kBAAkB,GAC7CG,IACJf,MAAS,KAAQ,OAAOA,KAAQ,OAC9B,gBAAAgB,EAACC,GAAA,EAAK,MAAK,aAAA,CAAa,IACtB,OAAOjB,KAAS,YAAYJ,EAAc,IAAII,CAAI,IACpD,gBAAAgB,EAACC,GAAA,EAAK,MAAMjB,EAAA,CAAkB,IAE9BA;AAGJ,SACE,gBAAAkB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAP;AAAA,MACA,WAAWQ;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOhB,CAAI;AAAA,QACXC,KAAWe,EAAO;AAAA,QAClBd,KAASc,EAAO;AAAA,QAChBb;AAAA,MAAA;AAAA,MAEF,OACGD,IACG,EAAE,gBAAgB,kBAAkBA,CAAK,SAAS,GAAGE,EAAA,IACrDA;AAAA,MAEL,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAK,KAAgB,0BACd,OAAA,EAAI,WAAWK,EAAO,MAAM,eAAW,IACrC,UAAAL,EAAA,CACH;AAAA,QAEDD,KAAiB,QAAQ,gBAAAE,EAAC,SAAI,WAAWI,EAAO,OAAQ,UAAAN,GAAc;AAAA,QACtEZ,KAAe,QAAQ,gBAAAc,EAAC,SAAI,WAAWI,EAAO,aAAc,UAAAlB,GAAY;AAAA,QACxEC,KAAU,QAAQ,gBAAAa,EAAC,SAAI,WAAWI,EAAO,QAAS,UAAAjB,GAAO;AAAA,QACzDM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"EmptyState-DwT9_HW7.js","sources":["../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './EmptyState.module.css'\n\nexport type EmptyStateSize = 'sm' | 'md' | 'lg'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Leading glyph shown in a soft circle — an `IconName`, any node, or `false` to hide it. Defaults to `FolderOpen`. */\n icon?: IconName | ReactNode | false\n /** Heading line. Defaults to `\"No Results Found\"`. */\n title?: ReactNode\n /** Muted description under the title (e.g. a hint on what to do next). */\n description?: ReactNode\n /** Action slot under the text — e.g. an \"Add Item\" or \"Clear Filters\" button. */\n action?: ReactNode\n /** Size — scales the icon, text, and vertical padding. Defaults to `md`. */\n size?: EmptyStateSize\n /**\n * Polished \"hero\" look: a faded grid backdrop (fades out toward the edges) + an elevated icon\n * (gradient + drop shadow). Defaults to `true`; pass `pattern={false}` for the flat, compact placeholder.\n */\n pattern?: boolean\n /** Tint the icon puck with a theme color (e.g. `error` for a failure). Omitted → the neutral muted puck. */\n color?: ThemeColor\n /** Extra content rendered below the action. */\n children?: ReactNode\n}\n\n/**\n * The empty-state placeholder — drop it in wherever a page, table, list, or gallery has nothing to\n * show (no records yet, no search matches). A centered, muted glyph in a soft circle + a `title` +\n * an optional `description` and `action` (e.g. a \"Add Item\" / \"Clear Filters\" button). Neutral by\n * design; pass a custom `icon` node for a tinted glyph. Token-only styling.\n */\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(function EmptyState(\n {\n icon,\n title,\n description,\n action,\n size = 'md',\n pattern = true,\n color,\n className,\n style,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const resolvedTitle = title ?? t('emptyState.title')\n const renderedIcon =\n icon === false ? null : icon == null ? (\n <Icon name=\"FolderOpen\" />\n ) : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.emptyState,\n styles[size],\n pattern && styles.pattern,\n color && styles.tinted,\n className,\n )}\n style={\n (color\n ? { '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style }\n : style) as CSSProperties\n }\n {...props}\n >\n {renderedIcon != null && (\n <div className={styles.icon} aria-hidden>\n {renderedIcon}\n </div>\n )}\n {resolvedTitle != null && <div className={styles.title}>{resolvedTitle}</div>}\n {description != null && <div className={styles.description}>{description}</div>}\n {action != null && <div className={styles.action}>{action}</div>}\n {children}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","EmptyState","forwardRef","icon","title","description","action","size","pattern","color","className","style","children","props","ref","t","useT","resolvedTitle","renderedIcon","jsx","Icon","jsxs","clsx","styles"],"mappings":";;;;;;;;;;;;;;;;;GASMA,IAAgB,IAAI,IAAYC,CAAU,GA8BnCC,IAAaC,EAA4C,SACpE;AAAA,EACE,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAgBb,KAASW,EAAE,kBAAkB,GAC7CG,IACJf,MAAS,KAAQ,OAAOA,KAAQ,OAC9B,gBAAAgB,EAACC,GAAA,EAAK,MAAK,aAAA,CAAa,IACtB,OAAOjB,KAAS,YAAYJ,EAAc,IAAII,CAAI,IACpD,gBAAAgB,EAACC,GAAA,EAAK,MAAMjB,EAAA,CAAkB,IAE9BA;AAGJ,SACE,gBAAAkB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAP;AAAA,MACA,WAAWQ;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOhB,CAAI;AAAA,QACXC,KAAWe,EAAO;AAAA,QAClBd,KAASc,EAAO;AAAA,QAChBb;AAAA,MAAA;AAAA,MAEF,OACGD,IACG,EAAE,gBAAgB,kBAAkBA,CAAK,SAAS,GAAGE,EAAA,IACrDA;AAAA,MAEL,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAK,KAAgB,0BACd,OAAA,EAAI,WAAWK,EAAO,MAAM,eAAW,IACrC,UAAAL,EAAA,CACH;AAAA,QAEDD,KAAiB,QAAQ,gBAAAE,EAAC,SAAI,WAAWI,EAAO,OAAQ,UAAAN,GAAc;AAAA,QACtEZ,KAAe,QAAQ,gBAAAc,EAAC,SAAI,WAAWI,EAAO,aAAc,UAAAlB,GAAY;AAAA,QACxEC,KAAU,QAAQ,gBAAAa,EAAC,SAAI,WAAWI,EAAO,QAAS,UAAAjB,GAAO;AAAA,QACzDM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const n=require("react/jsx-runtime"),v=require("react"),z=require("clsx"),M=require("./Button-CusxDmfq.cjs"),$=require("./CopyButton-SFwjKod9.cjs"),w=require("./EmptyState-B2_4BN4l.cjs"),K=require("./Icon-BVULqOJD.cjs"),S=require("./ConfigProvider-ByLHqXpv.cjs");function x(t,r=e=>`Request failed (${e})`){var c,u,o;if(t==null||t===!1)return;if(typeof t=="string")return t.trim()||void 0;if(typeof t!="object")return String(t);const e=t,s=(u=(c=e.response)==null?void 0:c.data)==null?void 0:u.message;if(typeof s=="string"&&s.trim())return s.trim();if(typeof e.message=="string"&&e.message.trim())return e.message.trim();const i=typeof e.status=="number"?e.status:(o=e.response)==null?void 0:o.status;if(typeof i=="number")return r(i)}function I(t){if(t!=null){if(t instanceof Error)return t.stack||`${t.name}: ${t.message}`;if(typeof t=="string")return t;try{return JSON.stringify(t,null,2)}catch{return String(t)}}}function b(t){var s,i;if(t==null||typeof t!="object")return;const r=t,e=typeof r.traceId=="string"?r.traceId:(i=(s=r.response)==null?void 0:s.data)==null?void 0:i.traceId;return typeof e=="string"&&e.trim()?e.trim():void 0}function N(t){var i,c;if(t==null||typeof t!="object")return;const r=t,e=r.fieldErrors??((c=(i=r.response)==null?void 0:i.data)==null?void 0:c.errors);if(e==null||typeof e!="object"||Array.isArray(e))return;const s={};for(const[u,o]of Object.entries(e))typeof o=="string"&&o.trim()?s[u]=o:Array.isArray(o)&&typeof o[0]=="string"&&(s[u]=o[0]);return Object.keys(s).length>0?s:void 0}const V="_errorState_iuur1_4",J="_actions_iuur1_9",L="_fieldErrors_iuur1_18",U="_field_iuur1_18",G="_trace_iuur1_32",H="_traceId_iuur1_39",Q="_compact_iuur1_45",W="_details_iuur1_50",X="_summary_iuur1_56",Y="_pre_iuur1_63",a={errorState:V,actions:J,fieldErrors:L,field:U,trace:G,traceId:H,compact:Q,details:W,summary:X,pre:Y},Z=typeof process<"u"&&process.env.NODE_ENV!=="production",q=v.forwardRef(function({error:r,title:e,description:s,icon:i="Danger",onRetry:c,retryLabel:u,showDetails:o="dev",compact:f=!1,traceId:y,fieldErrors:g,size:D,pattern:k,action:h,className:C,children:O,...B},R){const l=S.useT(),F=x(r,d=>l("errorState.requestFailed",{status:d})),p=y===!1?void 0:y??b(r),m=g===!1?void 0:g??N(r),A=m&&Object.keys(m).length>0?n.jsx("ul",{className:a.fieldErrors,children:Object.entries(m).map(([d,T])=>n.jsxs("li",{children:[n.jsx("span",{className:a.field,children:d})," — ",T]},d))}):void 0,E=(o==="dev"?Z:o)?I(r):void 0,_=c!=null?n.jsx(M.Button,{size:"sm",variant:"outlined",color:"primary",startIcon:n.jsx(K.Icon,{name:"RefreshRight"}),onClick:c,children:u??l("errorState.retry")}):null;return n.jsxs(w.EmptyState,{ref:R,role:"alert","aria-live":"polite",color:"error",icon:i,title:e??l("errorState.title"),description:s??A??F??l("errorState.description"),size:D??(f?"sm":"md"),pattern:k??!f,action:_||h?n.jsxs("span",{className:a.actions,children:[_,h]}):void 0,className:z.clsx(a.errorState,f&&a.compact,C),...B,children:[p!=null&&n.jsxs("span",{className:a.trace,children:[n.jsxs("span",{children:[l("errorState.traceId"),": ",n.jsx("code",{className:a.traceId,children:p})]}),n.jsx($.CopyButton,{value:p,size:"sm",variant:"text",color:"primary"})]}),E!=null&&n.jsxs("details",{className:a.details,children:[n.jsx("summary",{className:a.summary,children:l("errorState.details")}),n.jsx("pre",{className:a.pre,children:E})]}),O]})}),P=(t=[],r=[])=>t.length!==r.length||t.some((e,s)=>!Object.is(e,r[s])),j=t=>t instanceof Error?t:new Error(String(t));function tt({error:t,reset:r}){const e=S.useT();return n.jsx(q,{error:t,description:e("errorState.description"),onRetry:r})}class et extends v.Component{constructor(){super(...arguments),this.state={error:null},this.reset=()=>{var r,e;this.setState({error:null}),(e=(r=this.props).onReset)==null||e.call(r)}}static getDerivedStateFromError(r){return{error:j(r)}}componentDidCatch(r,e){var s,i;(i=(s=this.props).onError)==null||i.call(s,j(r),e)}componentDidUpdate(r,e){this.state.error&&e.error&&P(r.resetKeys,this.props.resetKeys)&&this.reset()}render(){const{error:r}=this.state;if(!r)return this.props.children;const{fallback:e}=this.props;return typeof e=="function"?e(r,this.reset):e!==void 0?e:n.jsx(tt,{error:r,reset:this.reset})}}exports.ErrorBoundary=et;exports.ErrorState=q;exports.getErrorDetails=I;exports.getErrorFieldErrors=N;exports.getErrorMessage=x;exports.getErrorTraceId=b;
2
+ //# sourceMappingURL=ErrorBoundary-CYSOAQlB.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary-CYSOAQlB.cjs","sources":["../src/components/ErrorState/errorMessage.ts","../src/components/ErrorState/ErrorState.tsx","../src/components/ErrorState/ErrorBoundary.tsx"],"sourcesContent":["/**\n * Pull a human-readable message out of whatever was thrown / returned — the shapes admin apps actually see:\n *\n * 1. an axios-style error with a server body — `error.response.data.message` (the backend's own sentence)\n * 2. an `Error` (or anything with a string `message`) — `error.message`\n * 3. a raw HTTP response / status object — `{ status: 404, statusText }` → `\"Request failed (404)\"`\n * 4. a plain string\n *\n * Returns `undefined` when nothing usable is found (the caller shows its generic fallback). Pure — pass\n * `requestFailed` to localize case 3 (`{status}` is interpolated).\n */\nexport function getErrorMessage(\n error: unknown,\n requestFailed: (status: number) => string = (status) => `Request failed (${status})`,\n): string | undefined {\n if (error == null || error === false) return undefined\n if (typeof error === 'string') return error.trim() || undefined\n if (typeof error !== 'object') return String(error)\n\n const e = error as {\n message?: unknown\n status?: unknown\n response?: { data?: { message?: unknown }; status?: unknown }\n }\n const serverMessage = e.response?.data?.message\n if (typeof serverMessage === 'string' && serverMessage.trim()) return serverMessage.trim()\n if (typeof e.message === 'string' && e.message.trim()) return e.message.trim()\n const status = typeof e.status === 'number' ? e.status : e.response?.status\n if (typeof status === 'number') return requestFailed(status)\n return undefined\n}\n\n/** A stack / detail dump for the developer-facing details panel (Error → `name: message` + stack). */\nexport function getErrorDetails(error: unknown): string | undefined {\n if (error == null) return undefined\n if (error instanceof Error) return error.stack || `${error.name}: ${error.message}`\n if (typeof error === 'string') return error\n try {\n return JSON.stringify(error, null, 2)\n } catch {\n return String(error)\n }\n}\n\n/**\n * The server's **trace id** for a failed request — the handle that matches a user's report to the server\n * log. Read from `error.traceId` (e.g. an app `ApiError` carrying the response envelope's `traceId`) or an\n * axios-style `error.response.data.traceId`. `undefined` when there is none.\n */\nexport function getErrorTraceId(error: unknown): string | undefined {\n if (error == null || typeof error !== 'object') return undefined\n const e = error as { traceId?: unknown; response?: { data?: { traceId?: unknown } } }\n const id = typeof e.traceId === 'string' ? e.traceId : e.response?.data?.traceId\n return typeof id === 'string' && id.trim() ? id.trim() : undefined\n}\n\n/**\n * Per-field validation messages of a `400` — `{ field: 'message' }`. Read from `error.fieldErrors` (an app\n * `ApiError`) or an axios-style `error.response.data.errors` (ASP.NET sends a string **or** an array of\n * strings per field — the first string wins). `undefined` when there are none.\n */\nexport function getErrorFieldErrors(error: unknown): Record<string, string> | undefined {\n if (error == null || typeof error !== 'object') return undefined\n const e = error as { fieldErrors?: unknown; response?: { data?: { errors?: unknown } } }\n const raw = e.fieldErrors ?? e.response?.data?.errors\n if (raw == null || typeof raw !== 'object' || Array.isArray(raw)) return undefined\n const out: Record<string, string> = {}\n for (const [field, message] of Object.entries(raw as Record<string, unknown>)) {\n if (typeof message === 'string' && message.trim()) out[field] = message\n else if (Array.isArray(message) && typeof message[0] === 'string') out[field] = message[0]\n }\n return Object.keys(out).length > 0 ? out : undefined\n}\n","import { forwardRef, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Button } from '../Button'\nimport { CopyButton } from '../CopyButton'\nimport { EmptyState, type EmptyStateProps } from '../EmptyState'\nimport { Icon } from '../Icon'\nimport type { IconName } from '../../icons/names'\nimport {\n getErrorDetails,\n getErrorFieldErrors,\n getErrorMessage,\n getErrorTraceId,\n} from './errorMessage'\nimport styles from './ErrorState.module.css'\n\n// `process.env.NODE_ENV` is inlined by every consumer bundler (React's own convention); declared locally\n// since the library ships without `@types/node`.\ndeclare const process: { env: { NODE_ENV?: string } } | undefined\nconst IS_DEV = typeof process !== 'undefined' && process.env.NODE_ENV !== 'production'\n\nexport interface ErrorStateProps extends Omit<EmptyStateProps, 'icon' | 'title' | 'color'> {\n /**\n * What failed — an `Error`, a string, an axios-style error, a `{ message }` or a raw `{ status }`\n * response. Its message becomes the description (unless `description` is given) and its stack feeds\n * the details panel.\n */\n error?: unknown\n /** Heading. Defaults to the localized \"Something went wrong\". */\n title?: ReactNode\n /** Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger`, tinted `error`. */\n icon?: IconName | ReactNode | false\n /** Adds a \"Try again\" button that calls this (e.g. a query's `refetch`). */\n onRetry?: () => void\n /** Retry button label. Defaults to the localized \"Try again\". */\n retryLabel?: ReactNode\n /**\n * Show a collapsible technical details panel (stack / raw error). `'dev'` (default) shows it only in\n * development builds; `true` always; `false` never.\n */\n showDetails?: boolean | 'dev'\n /** The inline variant — small, no hero pattern — for inside a table, card or panel. Defaults to `false`. */\n compact?: boolean\n /**\n * The server's trace id, shown under the message with a copy button (it matches a report to the server\n * log). Defaults to the one on `error` (`error.traceId` / `error.response.data.traceId`); `false` hides it.\n */\n traceId?: string | false\n /**\n * Per-field validation messages (`{ field: message }`), listed as the description when there's no explicit\n * `description`. Defaults to the ones on `error` (`error.fieldErrors` / `error.response.data.errors`);\n * `false` hides them. In a form, put them on the inputs instead.\n */\n fieldErrors?: Record<string, string> | false\n}\n\n/**\n * The \"loading failed\" counterpart of `EmptyState` — a semantic preset over it: an `error`-tinted\n * `Danger` puck, a localized \"Something went wrong\" title, the failure's own message as the description\n * (extracted from an `Error`, a string, an axios-style `response.data.message`, a `{ message }`, or a raw\n * `{ status }` response → \"Request failed (404)\"), an optional **Try again** button (`onRetry`), and a\n * developer-only details panel with the stack (`showDetails`, default `'dev'`). `compact` is the inline\n * variant for a table / card. The server's `traceId` (copyable) and a 400's per-field `fieldErrors` are shown\n * when the error carries them. Announced to assistive tech (`role=\"alert\"`, `aria-live=\"polite\"`).\n * `forwardRef` to the root; any other `EmptyState` prop (`size`, `pattern`, `action`, …) passes through.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n {\n error,\n title,\n description,\n icon = 'Danger',\n onRetry,\n retryLabel,\n showDetails = 'dev',\n compact = false,\n traceId: traceIdProp,\n fieldErrors: fieldErrorsProp,\n size,\n pattern,\n action,\n className,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const message = getErrorMessage(error, (status) => t('errorState.requestFailed', { status }))\n const traceId = traceIdProp === false ? undefined : (traceIdProp ?? getErrorTraceId(error))\n const fieldErrors =\n fieldErrorsProp === false ? undefined : (fieldErrorsProp ?? getErrorFieldErrors(error))\n const fieldErrorList =\n fieldErrors && Object.keys(fieldErrors).length > 0 ? (\n <ul className={styles.fieldErrors}>\n {Object.entries(fieldErrors).map(([field, msg]) => (\n <li key={field}>\n <span className={styles.field}>{field}</span> — {msg}\n </li>\n ))}\n </ul>\n ) : undefined\n const details = (showDetails === 'dev' ? IS_DEV : showDetails)\n ? getErrorDetails(error)\n : undefined\n\n const retry =\n onRetry != null ? (\n <Button\n size=\"sm\"\n variant=\"outlined\"\n color=\"primary\"\n startIcon={<Icon name=\"RefreshRight\" />}\n onClick={onRetry}\n >\n {retryLabel ?? t('errorState.retry')}\n </Button>\n ) : null\n\n return (\n <EmptyState\n ref={ref}\n role=\"alert\"\n aria-live=\"polite\"\n color=\"error\"\n icon={icon}\n title={title ?? t('errorState.title')}\n // a 400's message is the generic \"validation errors occurred\" — the per-field list is the useful part\n description={description ?? fieldErrorList ?? message ?? t('errorState.description')}\n size={size ?? (compact ? 'sm' : 'md')}\n pattern={pattern ?? !compact}\n action={\n retry || action ? (\n <span className={styles.actions}>\n {retry}\n {action}\n </span>\n ) : undefined\n }\n className={clsx(styles.errorState, compact && styles.compact, className)}\n {...props}\n >\n {traceId != null && (\n <span className={styles.trace}>\n <span>\n {t('errorState.traceId')}: <code className={styles.traceId}>{traceId}</code>\n </span>\n <CopyButton value={traceId} size=\"sm\" variant=\"text\" color=\"primary\" />\n </span>\n )}\n {details != null && (\n <details className={styles.details}>\n <summary className={styles.summary}>{t('errorState.details')}</summary>\n <pre className={styles.pre}>{details}</pre>\n </details>\n )}\n {children}\n </EmptyState>\n )\n})\n","import { Component, type ErrorInfo, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { ErrorState } from './ErrorState'\n\nexport interface ErrorBoundaryProps {\n /**\n * What to render after a crash — a node, or `(error, reset) => node`. Defaults to an `ErrorState` with\n * a friendly description, a **Try again** button (`reset`) and the stack in dev.\n */\n fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode)\n /** Report the crash (e.g. `Sentry.captureException`). */\n onError?: (error: Error, info: ErrorInfo) => void\n /** Called after the boundary resets (Try again, or a `resetKeys` change). */\n onReset?: () => void\n /** Reset automatically when any of these change (shallow) — e.g. `[location.pathname]` clears on navigation. */\n resetKeys?: unknown[]\n children?: ReactNode\n}\n\ninterface ErrorBoundaryState {\n error: Error | null\n}\n\nconst keysChanged = (a: unknown[] = [], b: unknown[] = []) =>\n a.length !== b.length || a.some((v, i) => !Object.is(v, b[i]))\n\nconst toError = (value: unknown) => (value instanceof Error ? value : new Error(String(value)))\n\n/** The default crash screen — a function component so it can read the localized strings. */\nfunction DefaultFallback({ error, reset }: { error: Error; reset: () => void }) {\n const t = useT()\n // a render crash message (\"Cannot read properties of undefined\") is for developers, not users —\n // the description stays friendly and the raw error lives in the dev-only details panel\n return <ErrorState error={error} description={t('errorState.description')} onRetry={reset} />\n}\n\n/**\n * Catches render errors in its subtree and shows a fallback instead of unmounting the whole app (a\n * white screen). The one class component in the library — React only offers error boundaries as\n * classes. `fallback` is a node or `(error, reset) => node` (default: an `ErrorState` with Try again);\n * `onError` reports the crash (Sentry); `resetKeys` resets it when they change (e.g. the route path, so\n * navigating away recovers); `onReset` runs after any reset. `AdminRoot` mounts one around the page\n * content automatically, so a crashing page keeps the sidebar + header.\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n state: ErrorBoundaryState = { error: null }\n\n static getDerivedStateFromError(error: unknown): ErrorBoundaryState {\n return { error: toError(error) }\n }\n\n componentDidCatch(error: unknown, info: ErrorInfo) {\n this.props.onError?.(toError(error), info)\n }\n\n componentDidUpdate(prev: ErrorBoundaryProps, prevState: ErrorBoundaryState) {\n // reset only an error that was ALREADY showing before the keys changed — if the key change itself is\n // what crashed the subtree (same render), resetting would just re-render it into a second throw\n if (this.state.error && prevState.error && keysChanged(prev.resetKeys, this.props.resetKeys)) {\n this.reset()\n }\n }\n\n reset = () => {\n this.setState({ error: null })\n this.props.onReset?.()\n }\n\n render() {\n const { error } = this.state\n if (!error) return this.props.children\n const { fallback } = this.props\n if (typeof fallback === 'function') return fallback(error, this.reset)\n if (fallback !== undefined) return fallback\n return <DefaultFallback error={error} reset={this.reset} />\n }\n}\n"],"names":["getErrorMessage","error","requestFailed","status","serverMessage","_b","_a","_c","getErrorDetails","getErrorTraceId","e","id","getErrorFieldErrors","raw","out","field","message","IS_DEV","ErrorState","forwardRef","title","description","icon","onRetry","retryLabel","showDetails","compact","traceIdProp","fieldErrorsProp","size","pattern","action","className","children","props","ref","t","useT","traceId","fieldErrors","fieldErrorList","jsx","styles","msg","jsxs","details","retry","Button","Icon","EmptyState","clsx","CopyButton","keysChanged","a","b","v","i","toError","value","DefaultFallback","reset","ErrorBoundary","Component","info","prev","prevState","fallback"],"mappings":"oRAWO,SAASA,EACdC,EACAC,EAA6CC,GAAW,mBAAmBA,CAAM,IAC7D,WACpB,GAAIF,GAAS,MAAQA,IAAU,GAAO,OACtC,GAAI,OAAOA,GAAU,SAAU,OAAOA,EAAM,QAAU,OACtD,GAAI,OAAOA,GAAU,SAAU,OAAO,OAAOA,CAAK,EAElD,MAAM,EAAIA,EAKJG,GAAgBC,GAAAC,EAAA,EAAE,WAAF,YAAAA,EAAY,OAAZ,YAAAD,EAAkB,QACxC,GAAI,OAAOD,GAAkB,UAAYA,EAAc,OAAQ,OAAOA,EAAc,KAAA,EACpF,GAAI,OAAO,EAAE,SAAY,UAAY,EAAE,QAAQ,OAAQ,OAAO,EAAE,QAAQ,KAAA,EACxE,MAAMD,EAAS,OAAO,EAAE,QAAW,SAAW,EAAE,QAASI,EAAA,EAAE,WAAF,YAAAA,EAAY,OACrE,GAAI,OAAOJ,GAAW,SAAU,OAAOD,EAAcC,CAAM,CAE7D,CAGO,SAASK,EAAgBP,EAA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EAAO,CAC7F,CAUO,MAAMC,WAAsBC,EAAAA,SAAkD,CAA9E,aAAA,CAAA,MAAA,GAAA,SAAA,EACL,KAAA,MAA4B,CAAE,MAAO,IAAA,EAkBrC,KAAA,MAAQ,IAAM,SACZ,KAAK,SAAS,CAAE,MAAO,IAAA,CAAM,GAC7BzD,GAAAC,EAAA,KAAK,OAAM,UAAX,MAAAD,EAAA,KAAAC,EACF,CAAA,CAnBA,OAAO,yBAAyBL,EAAoC,CAClE,MAAO,CAAE,MAAOwD,EAAQxD,CAAK,CAAA,CAC/B,CAEA,kBAAkBA,EAAgB8D,EAAiB,UACjD1D,GAAAC,EAAA,KAAK,OAAM,UAAX,MAAAD,EAAA,KAAAC,EAAqBmD,EAAQxD,CAAK,EAAG8D,EACvC,CAEA,mBAAmBC,EAA0BC,EAA+B,CAGtE,KAAK,MAAM,OAASA,EAAU,OAASb,EAAYY,EAAK,UAAW,KAAK,MAAM,SAAS,GACzF,KAAK,MAAA,CAET,CAOA,QAAS,CACP,KAAM,CAAE,MAAA/D,GAAU,KAAK,MACvB,GAAI,CAACA,EAAO,OAAO,KAAK,MAAM,SAC9B,KAAM,CAAE,SAAAiE,GAAa,KAAK,MAC1B,OAAI,OAAOA,GAAa,WAAmBA,EAASjE,EAAO,KAAK,KAAK,EACjEiE,IAAa,OAAkBA,EAC5BzB,EAAAA,IAACkB,GAAA,CAAgB,MAAA1D,EAAc,MAAO,KAAK,MAAO,CAC3D,CACF"}
@@ -0,0 +1,163 @@
1
+ import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
+ import { forwardRef as A, Component as B } from "react";
3
+ import { clsx as F } from "clsx";
4
+ import { B as z } from "./Button-CWMNNiia.js";
5
+ import { C as $ } from "./CopyButton-D4s8aeSE.js";
6
+ import { E as q } from "./EmptyState-DwT9_HW7.js";
7
+ import { I as w } from "./Icon-DaTvzLBu.js";
8
+ import { a as I } from "./ConfigProvider-BbsI15b-.js";
9
+ function K(t, e = (r) => `Request failed (${r})`) {
10
+ var c, l, n;
11
+ if (t == null || t === !1) return;
12
+ if (typeof t == "string") return t.trim() || void 0;
13
+ if (typeof t != "object") return String(t);
14
+ const r = t, s = (l = (c = r.response) == null ? void 0 : c.data) == null ? void 0 : l.message;
15
+ if (typeof s == "string" && s.trim()) return s.trim();
16
+ if (typeof r.message == "string" && r.message.trim()) return r.message.trim();
17
+ const i = typeof r.status == "number" ? r.status : (n = r.response) == null ? void 0 : n.status;
18
+ if (typeof i == "number") return e(i);
19
+ }
20
+ function M(t) {
21
+ if (t != null) {
22
+ if (t instanceof Error) return t.stack || `${t.name}: ${t.message}`;
23
+ if (typeof t == "string") return t;
24
+ try {
25
+ return JSON.stringify(t, null, 2);
26
+ } catch {
27
+ return String(t);
28
+ }
29
+ }
30
+ }
31
+ function T(t) {
32
+ var s, i;
33
+ if (t == null || typeof t != "object") return;
34
+ const e = t, r = typeof e.traceId == "string" ? e.traceId : (i = (s = e.response) == null ? void 0 : s.data) == null ? void 0 : i.traceId;
35
+ return typeof r == "string" && r.trim() ? r.trim() : void 0;
36
+ }
37
+ function V(t) {
38
+ var i, c;
39
+ if (t == null || typeof t != "object") return;
40
+ const e = t, r = e.fieldErrors ?? ((c = (i = e.response) == null ? void 0 : i.data) == null ? void 0 : c.errors);
41
+ if (r == null || typeof r != "object" || Array.isArray(r)) return;
42
+ const s = {};
43
+ for (const [l, n] of Object.entries(r))
44
+ typeof n == "string" && n.trim() ? s[l] = n : Array.isArray(n) && typeof n[0] == "string" && (s[l] = n[0]);
45
+ return Object.keys(s).length > 0 ? s : void 0;
46
+ }
47
+ const J = "_errorState_iuur1_4", L = "_actions_iuur1_9", U = "_fieldErrors_iuur1_18", G = "_field_iuur1_18", H = "_trace_iuur1_32", Q = "_traceId_iuur1_39", W = "_compact_iuur1_45", X = "_details_iuur1_50", Y = "_summary_iuur1_56", Z = "_pre_iuur1_63", o = {
48
+ errorState: J,
49
+ actions: L,
50
+ fieldErrors: U,
51
+ field: G,
52
+ trace: H,
53
+ traceId: Q,
54
+ compact: W,
55
+ details: X,
56
+ summary: Y,
57
+ pre: Z
58
+ }, P = typeof process < "u" && process.env.NODE_ENV !== "production", tt = A(function({
59
+ error: e,
60
+ title: r,
61
+ description: s,
62
+ icon: i = "Danger",
63
+ onRetry: c,
64
+ retryLabel: l,
65
+ showDetails: n = "dev",
66
+ compact: m = !1,
67
+ traceId: g,
68
+ fieldErrors: h,
69
+ size: b,
70
+ pattern: N,
71
+ action: _,
72
+ className: j,
73
+ children: k,
74
+ ...D
75
+ }, O) {
76
+ const u = I(), x = K(e, (f) => u("errorState.requestFailed", { status: f })), p = g === !1 ? void 0 : g ?? T(e), y = h === !1 ? void 0 : h ?? V(e), C = y && Object.keys(y).length > 0 ? /* @__PURE__ */ a("ul", { className: o.fieldErrors, children: Object.entries(y).map(([f, R]) => /* @__PURE__ */ d("li", { children: [
77
+ /* @__PURE__ */ a("span", { className: o.field, children: f }),
78
+ " — ",
79
+ R
80
+ ] }, f)) }) : void 0, E = (n === "dev" ? P : n) ? M(e) : void 0, v = c != null ? /* @__PURE__ */ a(
81
+ z,
82
+ {
83
+ size: "sm",
84
+ variant: "outlined",
85
+ color: "primary",
86
+ startIcon: /* @__PURE__ */ a(w, { name: "RefreshRight" }),
87
+ onClick: c,
88
+ children: l ?? u("errorState.retry")
89
+ }
90
+ ) : null;
91
+ return /* @__PURE__ */ d(
92
+ q,
93
+ {
94
+ ref: O,
95
+ role: "alert",
96
+ "aria-live": "polite",
97
+ color: "error",
98
+ icon: i,
99
+ title: r ?? u("errorState.title"),
100
+ description: s ?? C ?? x ?? u("errorState.description"),
101
+ size: b ?? (m ? "sm" : "md"),
102
+ pattern: N ?? !m,
103
+ action: v || _ ? /* @__PURE__ */ d("span", { className: o.actions, children: [
104
+ v,
105
+ _
106
+ ] }) : void 0,
107
+ className: F(o.errorState, m && o.compact, j),
108
+ ...D,
109
+ children: [
110
+ p != null && /* @__PURE__ */ d("span", { className: o.trace, children: [
111
+ /* @__PURE__ */ d("span", { children: [
112
+ u("errorState.traceId"),
113
+ ": ",
114
+ /* @__PURE__ */ a("code", { className: o.traceId, children: p })
115
+ ] }),
116
+ /* @__PURE__ */ a($, { value: p, size: "sm", variant: "text", color: "primary" })
117
+ ] }),
118
+ E != null && /* @__PURE__ */ d("details", { className: o.details, children: [
119
+ /* @__PURE__ */ a("summary", { className: o.summary, children: u("errorState.details") }),
120
+ /* @__PURE__ */ a("pre", { className: o.pre, children: E })
121
+ ] }),
122
+ k
123
+ ]
124
+ }
125
+ );
126
+ }), rt = (t = [], e = []) => t.length !== e.length || t.some((r, s) => !Object.is(r, e[s])), S = (t) => t instanceof Error ? t : new Error(String(t));
127
+ function et({ error: t, reset: e }) {
128
+ const r = I();
129
+ return /* @__PURE__ */ a(tt, { error: t, description: r("errorState.description"), onRetry: e });
130
+ }
131
+ class dt extends B {
132
+ constructor() {
133
+ super(...arguments), this.state = { error: null }, this.reset = () => {
134
+ var e, r;
135
+ this.setState({ error: null }), (r = (e = this.props).onReset) == null || r.call(e);
136
+ };
137
+ }
138
+ static getDerivedStateFromError(e) {
139
+ return { error: S(e) };
140
+ }
141
+ componentDidCatch(e, r) {
142
+ var s, i;
143
+ (i = (s = this.props).onError) == null || i.call(s, S(e), r);
144
+ }
145
+ componentDidUpdate(e, r) {
146
+ this.state.error && r.error && rt(e.resetKeys, this.props.resetKeys) && this.reset();
147
+ }
148
+ render() {
149
+ const { error: e } = this.state;
150
+ if (!e) return this.props.children;
151
+ const { fallback: r } = this.props;
152
+ return typeof r == "function" ? r(e, this.reset) : r !== void 0 ? r : /* @__PURE__ */ a(et, { error: e, reset: this.reset });
153
+ }
154
+ }
155
+ export {
156
+ dt as E,
157
+ tt as a,
158
+ V as b,
159
+ K as c,
160
+ T as d,
161
+ M as g
162
+ };
163
+ //# sourceMappingURL=ErrorBoundary-CsDHKYB4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorBoundary-CsDHKYB4.js","sources":["../src/components/ErrorState/errorMessage.ts","../src/components/ErrorState/ErrorState.tsx","../src/components/ErrorState/ErrorBoundary.tsx"],"sourcesContent":["/**\n * Pull a human-readable message out of whatever was thrown / returned — the shapes admin apps actually see:\n *\n * 1. an axios-style error with a server body — `error.response.data.message` (the backend's own sentence)\n * 2. an `Error` (or anything with a string `message`) — `error.message`\n * 3. a raw HTTP response / status object — `{ status: 404, statusText }` → `\"Request failed (404)\"`\n * 4. a plain string\n *\n * Returns `undefined` when nothing usable is found (the caller shows its generic fallback). Pure — pass\n * `requestFailed` to localize case 3 (`{status}` is interpolated).\n */\nexport function getErrorMessage(\n error: unknown,\n requestFailed: (status: number) => string = (status) => `Request failed (${status})`,\n): string | undefined {\n if (error == null || error === false) return undefined\n if (typeof error === 'string') return error.trim() || undefined\n if (typeof error !== 'object') return String(error)\n\n const e = error as {\n message?: unknown\n status?: unknown\n response?: { data?: { message?: unknown }; status?: unknown }\n }\n const serverMessage = e.response?.data?.message\n if (typeof serverMessage === 'string' && serverMessage.trim()) return serverMessage.trim()\n if (typeof e.message === 'string' && e.message.trim()) return e.message.trim()\n const status = typeof e.status === 'number' ? e.status : e.response?.status\n if (typeof status === 'number') return requestFailed(status)\n return undefined\n}\n\n/** A stack / detail dump for the developer-facing details panel (Error → `name: message` + stack). */\nexport function getErrorDetails(error: unknown): string | undefined {\n if (error == null) return undefined\n if (error instanceof Error) return error.stack || `${error.name}: ${error.message}`\n if (typeof error === 'string') return error\n try {\n return JSON.stringify(error, null, 2)\n } catch {\n return String(error)\n }\n}\n\n/**\n * The server's **trace id** for a failed request — the handle that matches a user's report to the server\n * log. Read from `error.traceId` (e.g. an app `ApiError` carrying the response envelope's `traceId`) or an\n * axios-style `error.response.data.traceId`. `undefined` when there is none.\n */\nexport function getErrorTraceId(error: unknown): string | undefined {\n if (error == null || typeof error !== 'object') return undefined\n const e = error as { traceId?: unknown; response?: { data?: { traceId?: unknown } } }\n const id = typeof e.traceId === 'string' ? e.traceId : e.response?.data?.traceId\n return typeof id === 'string' && id.trim() ? id.trim() : undefined\n}\n\n/**\n * Per-field validation messages of a `400` — `{ field: 'message' }`. Read from `error.fieldErrors` (an app\n * `ApiError`) or an axios-style `error.response.data.errors` (ASP.NET sends a string **or** an array of\n * strings per field — the first string wins). `undefined` when there are none.\n */\nexport function getErrorFieldErrors(error: unknown): Record<string, string> | undefined {\n if (error == null || typeof error !== 'object') return undefined\n const e = error as { fieldErrors?: unknown; response?: { data?: { errors?: unknown } } }\n const raw = e.fieldErrors ?? e.response?.data?.errors\n if (raw == null || typeof raw !== 'object' || Array.isArray(raw)) return undefined\n const out: Record<string, string> = {}\n for (const [field, message] of Object.entries(raw as Record<string, unknown>)) {\n if (typeof message === 'string' && message.trim()) out[field] = message\n else if (Array.isArray(message) && typeof message[0] === 'string') out[field] = message[0]\n }\n return Object.keys(out).length > 0 ? out : undefined\n}\n","import { forwardRef, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Button } from '../Button'\nimport { CopyButton } from '../CopyButton'\nimport { EmptyState, type EmptyStateProps } from '../EmptyState'\nimport { Icon } from '../Icon'\nimport type { IconName } from '../../icons/names'\nimport {\n getErrorDetails,\n getErrorFieldErrors,\n getErrorMessage,\n getErrorTraceId,\n} from './errorMessage'\nimport styles from './ErrorState.module.css'\n\n// `process.env.NODE_ENV` is inlined by every consumer bundler (React's own convention); declared locally\n// since the library ships without `@types/node`.\ndeclare const process: { env: { NODE_ENV?: string } } | undefined\nconst IS_DEV = typeof process !== 'undefined' && process.env.NODE_ENV !== 'production'\n\nexport interface ErrorStateProps extends Omit<EmptyStateProps, 'icon' | 'title' | 'color'> {\n /**\n * What failed — an `Error`, a string, an axios-style error, a `{ message }` or a raw `{ status }`\n * response. Its message becomes the description (unless `description` is given) and its stack feeds\n * the details panel.\n */\n error?: unknown\n /** Heading. Defaults to the localized \"Something went wrong\". */\n title?: ReactNode\n /** Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger`, tinted `error`. */\n icon?: IconName | ReactNode | false\n /** Adds a \"Try again\" button that calls this (e.g. a query's `refetch`). */\n onRetry?: () => void\n /** Retry button label. Defaults to the localized \"Try again\". */\n retryLabel?: ReactNode\n /**\n * Show a collapsible technical details panel (stack / raw error). `'dev'` (default) shows it only in\n * development builds; `true` always; `false` never.\n */\n showDetails?: boolean | 'dev'\n /** The inline variant — small, no hero pattern — for inside a table, card or panel. Defaults to `false`. */\n compact?: boolean\n /**\n * The server's trace id, shown under the message with a copy button (it matches a report to the server\n * log). Defaults to the one on `error` (`error.traceId` / `error.response.data.traceId`); `false` hides it.\n */\n traceId?: string | false\n /**\n * Per-field validation messages (`{ field: message }`), listed as the description when there's no explicit\n * `description`. Defaults to the ones on `error` (`error.fieldErrors` / `error.response.data.errors`);\n * `false` hides them. In a form, put them on the inputs instead.\n */\n fieldErrors?: Record<string, string> | false\n}\n\n/**\n * The \"loading failed\" counterpart of `EmptyState` — a semantic preset over it: an `error`-tinted\n * `Danger` puck, a localized \"Something went wrong\" title, the failure's own message as the description\n * (extracted from an `Error`, a string, an axios-style `response.data.message`, a `{ message }`, or a raw\n * `{ status }` response → \"Request failed (404)\"), an optional **Try again** button (`onRetry`), and a\n * developer-only details panel with the stack (`showDetails`, default `'dev'`). `compact` is the inline\n * variant for a table / card. The server's `traceId` (copyable) and a 400's per-field `fieldErrors` are shown\n * when the error carries them. Announced to assistive tech (`role=\"alert\"`, `aria-live=\"polite\"`).\n * `forwardRef` to the root; any other `EmptyState` prop (`size`, `pattern`, `action`, …) passes through.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n {\n error,\n title,\n description,\n icon = 'Danger',\n onRetry,\n retryLabel,\n showDetails = 'dev',\n compact = false,\n traceId: traceIdProp,\n fieldErrors: fieldErrorsProp,\n size,\n pattern,\n action,\n className,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const message = getErrorMessage(error, (status) => t('errorState.requestFailed', { status }))\n const traceId = traceIdProp === false ? undefined : (traceIdProp ?? getErrorTraceId(error))\n const fieldErrors =\n fieldErrorsProp === false ? undefined : (fieldErrorsProp ?? getErrorFieldErrors(error))\n const fieldErrorList =\n fieldErrors && Object.keys(fieldErrors).length > 0 ? (\n <ul className={styles.fieldErrors}>\n {Object.entries(fieldErrors).map(([field, msg]) => (\n <li key={field}>\n <span className={styles.field}>{field}</span> — {msg}\n </li>\n ))}\n </ul>\n ) : undefined\n const details = (showDetails === 'dev' ? IS_DEV : showDetails)\n ? getErrorDetails(error)\n : undefined\n\n const retry =\n onRetry != null ? (\n <Button\n size=\"sm\"\n variant=\"outlined\"\n color=\"primary\"\n startIcon={<Icon name=\"RefreshRight\" />}\n onClick={onRetry}\n >\n {retryLabel ?? t('errorState.retry')}\n </Button>\n ) : null\n\n return (\n <EmptyState\n ref={ref}\n role=\"alert\"\n aria-live=\"polite\"\n color=\"error\"\n icon={icon}\n title={title ?? t('errorState.title')}\n // a 400's message is the generic \"validation errors occurred\" — the per-field list is the useful part\n description={description ?? fieldErrorList ?? message ?? t('errorState.description')}\n size={size ?? (compact ? 'sm' : 'md')}\n pattern={pattern ?? !compact}\n action={\n retry || action ? (\n <span className={styles.actions}>\n {retry}\n {action}\n </span>\n ) : undefined\n }\n className={clsx(styles.errorState, compact && styles.compact, className)}\n {...props}\n >\n {traceId != null && (\n <span className={styles.trace}>\n <span>\n {t('errorState.traceId')}: <code className={styles.traceId}>{traceId}</code>\n </span>\n <CopyButton value={traceId} size=\"sm\" variant=\"text\" color=\"primary\" />\n </span>\n )}\n {details != null && (\n <details className={styles.details}>\n <summary className={styles.summary}>{t('errorState.details')}</summary>\n <pre className={styles.pre}>{details}</pre>\n </details>\n )}\n {children}\n </EmptyState>\n )\n})\n","import { Component, type ErrorInfo, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { ErrorState } from './ErrorState'\n\nexport interface ErrorBoundaryProps {\n /**\n * What to render after a crash — a node, or `(error, reset) => node`. Defaults to an `ErrorState` with\n * a friendly description, a **Try again** button (`reset`) and the stack in dev.\n */\n fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode)\n /** Report the crash (e.g. `Sentry.captureException`). */\n onError?: (error: Error, info: ErrorInfo) => void\n /** Called after the boundary resets (Try again, or a `resetKeys` change). */\n onReset?: () => void\n /** Reset automatically when any of these change (shallow) — e.g. `[location.pathname]` clears on navigation. */\n resetKeys?: unknown[]\n children?: ReactNode\n}\n\ninterface ErrorBoundaryState {\n error: Error | null\n}\n\nconst keysChanged = (a: unknown[] = [], b: unknown[] = []) =>\n a.length !== b.length || a.some((v, i) => !Object.is(v, b[i]))\n\nconst toError = (value: unknown) => (value instanceof Error ? value : new Error(String(value)))\n\n/** The default crash screen — a function component so it can read the localized strings. */\nfunction DefaultFallback({ error, reset }: { error: Error; reset: () => void }) {\n const t = useT()\n // a render crash message (\"Cannot read properties of undefined\") is for developers, not users —\n // the description stays friendly and the raw error lives in the dev-only details panel\n return <ErrorState error={error} description={t('errorState.description')} onRetry={reset} />\n}\n\n/**\n * Catches render errors in its subtree and shows a fallback instead of unmounting the whole app (a\n * white screen). The one class component in the library — React only offers error boundaries as\n * classes. `fallback` is a node or `(error, reset) => node` (default: an `ErrorState` with Try again);\n * `onError` reports the crash (Sentry); `resetKeys` resets it when they change (e.g. the route path, so\n * navigating away recovers); `onReset` runs after any reset. `AdminRoot` mounts one around the page\n * content automatically, so a crashing page keeps the sidebar + header.\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n state: ErrorBoundaryState = { error: null }\n\n static getDerivedStateFromError(error: unknown): ErrorBoundaryState {\n return { error: toError(error) }\n }\n\n componentDidCatch(error: unknown, info: ErrorInfo) {\n this.props.onError?.(toError(error), info)\n }\n\n componentDidUpdate(prev: ErrorBoundaryProps, prevState: ErrorBoundaryState) {\n // reset only an error that was ALREADY showing before the keys changed — if the key change itself is\n // what crashed the subtree (same render), resetting would just re-render it into a second throw\n if (this.state.error && prevState.error && keysChanged(prev.resetKeys, this.props.resetKeys)) {\n this.reset()\n }\n }\n\n reset = () => {\n this.setState({ error: null })\n this.props.onReset?.()\n }\n\n render() {\n const { error } = this.state\n if (!error) return this.props.children\n const { fallback } = this.props\n if (typeof fallback === 'function') return fallback(error, this.reset)\n if (fallback !== undefined) return fallback\n return <DefaultFallback error={error} reset={this.reset} />\n }\n}\n"],"names":["getErrorMessage","error","requestFailed","status","e","serverMessage","_b","_a","_c","getErrorDetails","getErrorTraceId","id","getErrorFieldErrors","raw","out","field","message","IS_DEV","ErrorState","forwardRef","title","description","icon","onRetry","retryLabel","showDetails","compact","traceIdProp","fieldErrorsProp","size","pattern","action","className","children","props","ref","t","useT","traceId","fieldErrors","fieldErrorList","jsx","styles","msg","jsxs","details","retry","Button","Icon","EmptyState","clsx","CopyButton","keysChanged","a","b","v","i","toError","value","DefaultFallback","reset","ErrorBoundary","Component","info","prev","prevState","fallback"],"mappings":";;;;;;;;AAWO,SAASA,EACdC,GACAC,IAA4C,CAACC,MAAW,mBAAmBA,CAAM,KAC7D;;AACpB,MAAIF,KAAS,QAAQA,MAAU,GAAO;AACtC,MAAI,OAAOA,KAAU,SAAU,QAAOA,EAAM,UAAU;AACtD,MAAI,OAAOA,KAAU,SAAU,QAAO,OAAOA,CAAK;AAElD,QAAMG,IAAIH,GAKJI,KAAgBC,KAAAC,IAAAH,EAAE,aAAF,gBAAAG,EAAY,SAAZ,gBAAAD,EAAkB;AACxC,MAAI,OAAOD,KAAkB,YAAYA,EAAc,OAAQ,QAAOA,EAAc,KAAA;AACpF,MAAI,OAAOD,EAAE,WAAY,YAAYA,EAAE,QAAQ,OAAQ,QAAOA,EAAE,QAAQ,KAAA;AACxE,QAAMD,IAAS,OAAOC,EAAE,UAAW,WAAWA,EAAE,UAASI,IAAAJ,EAAE,aAAF,gBAAAI,EAAY;AACrE,MAAI,OAAOL,KAAW,SAAU,QAAOD,EAAcC,CAAM;AAE7D;AAGO,SAASM,EAAgBR,GAAoC;AAClE,MAAIA,KAAS,MACb;AAAA,QAAIA,aAAi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BA,IAC5B,gBAAAzB,EAACkB,IAAA,EAAgB,OAAA1D,GAAc,OAAO,KAAK,OAAO;AAAA,EAC3D;AACF;"}
@@ -2,10 +2,10 @@ import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
2
  import { forwardRef as S, useState as A, useEffect as O } from "react";
3
3
  import { clsx as y } from "clsx";
4
4
  import { A as L } from "./Avatar-DXNPg23a.js";
5
- import { I as $ } from "./IconButton-Dq17Fekm.js";
5
+ import { I as $ } from "./IconButton-GU3Ud4Zg.js";
6
6
  import { I as V } from "./Icon-DaTvzLBu.js";
7
7
  import { T as G } from "./Typography-CJv5AnRP.js";
8
- import { a as H } from "./ConfigProvider-B_RSn9bb.js";
8
+ import { a as H } from "./ConfigProvider-BbsI15b-.js";
9
9
  const K = "_fileCard_kpeb5_3", R = "_avatar_kpeb5_24", U = "_body_kpeb5_29", W = "_name_kpeb5_38", X = "_nameBase_kpeb5_45", z = "_nameExt_kpeb5_51", J = "_type_kpeb5_57", P = "_download_kpeb5_61", Q = "_sm_kpeb5_66", Y = "_md_kpeb5_77", Z = "_lg_kpeb5_81", o = {
10
10
  fileCard: K,
11
11
  avatar: R,
@@ -146,4 +146,4 @@ const ue = S(function({
146
146
  export {
147
147
  ue as F
148
148
  };
149
- //# sourceMappingURL=FileCard-C3a2yDhK.js.map
149
+ //# sourceMappingURL=FileCard-B9f9RoXS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileCard-C3a2yDhK.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,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AACP;AAGA,SAASC,GAAYC,GAAcC,GAAuB;AACxD,QAAMC,IAAMF,EAAK,YAAY,GAAG;AAChC,SAAIE,IAAM,KAAKF,EAAK,SAASE,KAAO,IAAUF,EAAK,MAAME,IAAM,CAAC,EAAE,YAAA,IAC9DD,KAAQA,EAAK,SAAS,GAAG,IAAUA,EAAK,MAAMA,EAAK,QAAQ,GAAG,IAAI,CAAC,EAAE,YAAA,IAClE;AACT;AAGA,SAASE,GAAUH,GAA6C;AAC9D,QAAME,IAAMF,EAAK,YAAY,GAAG;AAChC,SAAOE,IAAM,KAAKF,E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;AAAA,YACN,MAAAiB;AAAA,YACA,OAAAD;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAA0B,EAAC,OAAA,EAAI,WAAWE,EAAO,MACrB,UAAA;AAAA,UAAA,gBAAAF,EAAC,QAAA,EAAK,WAAWE,EAAO,MAAM,OAAO5C,GACnC,UAAA;AAAA,YAAA,gBAAA6C,EAAC,QAAA,EAAK,WAAWD,EAAO,UAAW,UAAAhB,GAAK;AAAA,YACvCC,KAAW,gBAAAgB,EAAC,QAAA,EAAK,WAAWD,EAAO,SAAU,UAAAf,EAAA,CAAQ;AAAA,UAAA,GACxD;AAAA,UACCU,KAAY,QACX,gBAAAM,EAACE,GAAA,EAAW,IAAG,QAAO,SAAQ,aAAY,OAAM,SAAQ,WAAS,IAAC,WAAWH,EAAO,MACjF,UAAAL,EAAA,CACH;AAAA,QAAA,GAEJ;AAAA,QACCrB,MAAiBP,KAAOQ,MACvB,gBAAA0B;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAM/B,MAAS,OAAO,OAAO;AAAA,YAC7B,WAAW2B,EAAO;AAAA,YAClB,cAAYpB,EAAE,qBAAqB,EAAE,MAAAxB,GAAM;AAAA,YAC3C,SAASwC;AAAA,YAET,UAAA,gBAAAK,EAACI,GAAA,EAAK,MAAK,cAAA,CAAc;AAAA,UAAA;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"FileCard-B9f9RoXS.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,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AACP;AAGA,SAASC,GAAYC,GAAcC,GAAuB;AACxD,QAAMC,IAAMF,EAAK,YAAY,GAAG;AAChC,SAAIE,IAAM,KAAKF,EAAK,SAASE,KAAO,IAAUF,EAAK,MAAME,IAAM,CAAC,EAAE,YAAA,IAC9DD,KAAQA,EAAK,SAAS,GAAG,IAAUA,EAAK,MAAMA,EAAK,QAAQ,GAAG,IAAI,CAAC,EAAE,YAAA,IAClE;AACT;AAGA,SAASE,GAAUH,GAA6C;AAC9D,QAAME,IAAMF,EAAK,YA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;AAAA,YAChD,MAAA1B;AAAA,YACA,OAAM;AAAA,YACN,MAAAiB;AAAA,YACA,OAAAD;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAA0B,EAAC,OAAA,EAAI,WAAWE,EAAO,MACrB,UAAA;AAAA,UAAA,gBAAAF,EAAC,QAAA,EAAK,WAAWE,EAAO,MAAM,OAAO5C,GACnC,UAAA;AAAA,YAAA,gBAAA6C,EAAC,QAAA,EAAK,WAAWD,EAAO,UAAW,UAAAhB,GAAK;AAAA,YACvCC,KAAW,gBAAAgB,EAAC,QAAA,EAAK,WAAWD,EAAO,SAAU,UAAAf,EAAA,CAAQ;AAAA,UAAA,GACxD;AAAA,UACCU,KAAY,QACX,gBAAAM,EAACE,GAAA,EAAW,IAAG,QAAO,SAAQ,aAAY,OAAM,SAAQ,WAAS,IAAC,WAAWH,EAAO,MACjF,UAAAL,EAAA,CACH;AAAA,QAAA,GAEJ;AAAA,QACCrB,MAAiBP,KAAOQ,MACvB,gBAAA0B;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAM/B,MAAS,OAAO,OAAO;AAAA,YAC7B,WAAW2B,EAAO;AAAA,YAClB,cAAYpB,EAAE,qBAAqB,EAAE,MAAAxB,GAAM;AAAA,YAC3C,SAASwC;AAAA,YAET,UAAA,gBAAAK,EAACI,GAAA,EAAK,MAAK,cAAA,CAAc;AAAA,UAAA;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("react/jsx-runtime"),u=require("react"),M=require("clsx"),S=require("./Avatar-DrV_F7Ex.cjs"),A=require("./IconButton-A2B0bqC-.cjs"),O=require("./Icon-BVULqOJD.cjs"),L=require("./Typography-B6ASPrzT.cjs"),$=require("./ConfigProvider-BElY0HuV.cjs"),V="_fileCard_kpeb5_3",G="_avatar_kpeb5_24",R="_body_kpeb5_29",H="_name_kpeb5_38",K="_nameBase_kpeb5_45",P="_nameExt_kpeb5_51",U="_type_kpeb5_57",W="_download_kpeb5_61",X="_sm_kpeb5_66",z="_md_kpeb5_77",J="_lg_kpeb5_81",s={fileCard:V,avatar:G,body:R,name:H,nameBase:K,nameExt:P,type:U,download:W,sm:X,md:z,lg:J},Q=new Set(["png","jpg","jpeg","webp","svg","gif","avif","bmp","ico","heic"]),Y={pdf:"DocumentText",doc:"DocumentText",docx:"DocumentText",txt:"DocumentText",rtf:"DocumentText",md:"DocumentText",csv:"DocumentText",xls:"DocumentText",xlsx:"DocumentText",json:"DocumentCode",xml:"DocumentCode",zip:"Folder",rar:"Folder","7z":"Folder",mp4:"VideoSquare",mov:"VideoSquare",webm:"VideoSquare",mp3:"MusicSquare",wav:"MusicSquare"};function Z(n,e){const t=n.lastIndexOf(".");return t>0&&n.length-t<=7?n.slice(t+1).toLowerCase():e&&e.includes("/")?e.slice(e.indexOf("/")+1).toLowerCase():""}function ee(n){const e=n.lastIndexOf(".");return e>0&&n.length-e<=7?{base:n.slice(0,e),ext:n.slice(e)}:{base:n,ext:""}}function g(n){if(!Number.isFinite(n)||n<0)return"";if(n<1024)return`${n} B`;const e=["KB","MB","GB","TB"];let t=n/1024,a=0;for(;t>=1024&&a<e.length-1;)t/=1024,a+=1;return`${t<10?t.toFixed(1):Math.round(t)} ${e[a]}`}const te=u.forwardRef(function({name:e,src:t,type:a,image:v,fileSize:c,fetchSize:m=!1,meta:C,color:x="accent",size:d="md",downloadable:T=!0,onDownload:i,className:j,style:q,...w},k){const B=$.useT(),l=Z(e,a),f=v??((a==null?void 0:a.startsWith("image/"))||Q.has(l)),{base:D,ext:_}=ee(e),[p,N]=u.useState(null);u.useEffect(()=>{if(!m||c!=null||!t||typeof fetch>"u")return;let r=!1;return fetch(t,{method:"HEAD"}).then(y=>{const b=y.headers.get("content-length");!r&&b&&N(Number(b))}).catch(()=>{}),()=>{r=!0}},[m,c,t]);const E=c!=null?typeof c=="number"?g(c):c:p!=null?g(p):"",I=[l?l.toUpperCase():"",E].filter(Boolean).join(" · "),h=C??(I||null),F=()=>{if(i)return i();if(!t)return;const r=document.createElement("a");r.href=t,r.download=e,r.rel="noopener",r.click()};return o.jsxs("div",{ref:k,className:M.clsx(s.fileCard,s[d],j),style:{"--tz-btn-rgb":`var(--tz-color-${x}-rgb)`,...q},...w,children:[o.jsx(S.Avatar,{className:s.avatar,src:f?t:void 0,icon:f?void 0:Y[l]??"Document",name:e,shape:"square",size:d,color:x}),o.jsxs("div",{className:s.body,children:[o.jsxs("span",{className:s.name,title:e,children:[o.jsx("span",{className:s.nameBase,children:D}),_&&o.jsx("span",{className:s.nameExt,children:_})]}),h!=null&&o.jsx(L.Typography,{as:"span",variant:"bodySmall",color:"muted",uppercase:!0,className:s.type,children:h})]}),T&&(t||i)&&o.jsx(A.IconButton,{variant:"filled",size:d==="lg"?"md":"sm",className:s.download,"aria-label":B("fileCard.download",{name:e}),onClick:F,children:o.jsx(O.Icon,{name:"ImportArrow"})})]})});exports.FileCard=te;
2
- //# sourceMappingURL=FileCard-DKjDQRzZ.cjs.map
1
+ "use strict";const o=require("react/jsx-runtime"),u=require("react"),M=require("clsx"),S=require("./Avatar-DrV_F7Ex.cjs"),A=require("./IconButton-BNa0yLcv.cjs"),O=require("./Icon-BVULqOJD.cjs"),L=require("./Typography-B6ASPrzT.cjs"),$=require("./ConfigProvider-ByLHqXpv.cjs"),V="_fileCard_kpeb5_3",G="_avatar_kpeb5_24",R="_body_kpeb5_29",H="_name_kpeb5_38",K="_nameBase_kpeb5_45",P="_nameExt_kpeb5_51",U="_type_kpeb5_57",W="_download_kpeb5_61",X="_sm_kpeb5_66",z="_md_kpeb5_77",J="_lg_kpeb5_81",s={fileCard:V,avatar:G,body:R,name:H,nameBase:K,nameExt:P,type:U,download:W,sm:X,md:z,lg:J},Q=new Set(["png","jpg","jpeg","webp","svg","gif","avif","bmp","ico","heic"]),Y={pdf:"DocumentText",doc:"DocumentText",docx:"DocumentText",txt:"DocumentText",rtf:"DocumentText",md:"DocumentText",csv:"DocumentText",xls:"DocumentText",xlsx:"DocumentText",json:"DocumentCode",xml:"DocumentCode",zip:"Folder",rar:"Folder","7z":"Folder",mp4:"VideoSquare",mov:"VideoSquare",webm:"VideoSquare",mp3:"MusicSquare",wav:"MusicSquare"};function Z(n,e){const t=n.lastIndexOf(".");return t>0&&n.length-t<=7?n.slice(t+1).toLowerCase():e&&e.includes("/")?e.slice(e.indexOf("/")+1).toLowerCase():""}function ee(n){const e=n.lastIndexOf(".");return e>0&&n.length-e<=7?{base:n.slice(0,e),ext:n.slice(e)}:{base:n,ext:""}}function g(n){if(!Number.isFinite(n)||n<0)return"";if(n<1024)return`${n} B`;const e=["KB","MB","GB","TB"];let t=n/1024,a=0;for(;t>=1024&&a<e.length-1;)t/=1024,a+=1;return`${t<10?t.toFixed(1):Math.round(t)} ${e[a]}`}const te=u.forwardRef(function({name:e,src:t,type:a,image:v,fileSize:c,fetchSize:m=!1,meta:C,color:x="accent",size:d="md",downloadable:T=!0,onDownload:i,className:j,style:q,...w},k){const B=$.useT(),l=Z(e,a),f=v??((a==null?void 0:a.startsWith("image/"))||Q.has(l)),{base:D,ext:_}=ee(e),[p,N]=u.useState(null);u.useEffect(()=>{if(!m||c!=null||!t||typeof fetch>"u")return;let r=!1;return fetch(t,{method:"HEAD"}).then(y=>{const b=y.headers.get("content-length");!r&&b&&N(Number(b))}).catch(()=>{}),()=>{r=!0}},[m,c,t]);const E=c!=null?typeof c=="number"?g(c):c:p!=null?g(p):"",I=[l?l.toUpperCase():"",E].filter(Boolean).join(" · "),h=C??(I||null),F=()=>{if(i)return i();if(!t)return;const r=document.createElement("a");r.href=t,r.download=e,r.rel="noopener",r.click()};return o.jsxs("div",{ref:k,className:M.clsx(s.fileCard,s[d],j),style:{"--tz-btn-rgb":`var(--tz-color-${x}-rgb)`,...q},...w,children:[o.jsx(S.Avatar,{className:s.avatar,src:f?t:void 0,icon:f?void 0:Y[l]??"Document",name:e,shape:"square",size:d,color:x}),o.jsxs("div",{className:s.body,children:[o.jsxs("span",{className:s.name,title:e,children:[o.jsx("span",{className:s.nameBase,children:D}),_&&o.jsx("span",{className:s.nameExt,children:_})]}),h!=null&&o.jsx(L.Typography,{as:"span",variant:"bodySmall",color:"muted",uppercase:!0,className:s.type,children:h})]}),T&&(t||i)&&o.jsx(A.IconButton,{variant:"filled",size:d==="lg"?"md":"sm",className:s.download,"aria-label":B("fileCard.download",{name:e}),onClick:F,children:o.jsx(O.Icon,{name:"ImportArrow"})})]})});exports.FileCard=te;
2
+ //# sourceMappingURL=FileCard-zuUYik-F.cjs.map