@techzyapp/ui-library 1.0.49 → 1.0.50

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 (468) hide show
  1. package/dist/{Accordion-DOrTQJB9.js → Accordion-C6vW_OMd.js} +2 -2
  2. package/dist/{Accordion-DOrTQJB9.js.map → Accordion-C6vW_OMd.js.map} +1 -1
  3. package/dist/{Accordion-CFyeLfPT.cjs → Accordion-Icvl9S8c.cjs} +2 -2
  4. package/dist/{Accordion-CFyeLfPT.cjs.map → Accordion-Icvl9S8c.cjs.map} +1 -1
  5. package/dist/{AdminRoot-DYM9r25r.js → AdminRoot-C5l8PIyi.js} +9 -9
  6. package/dist/{AdminRoot-DYM9r25r.js.map → AdminRoot-C5l8PIyi.js.map} +1 -1
  7. package/dist/{AdminRoot-CGf-Q8Hs.cjs → AdminRoot-MEfy9xtz.cjs} +2 -2
  8. package/dist/{AdminRoot-CGf-Q8Hs.cjs.map → AdminRoot-MEfy9xtz.cjs.map} +1 -1
  9. package/dist/{Alert-QvfNBhlU.cjs → Alert--ZnlCjaL.cjs} +2 -2
  10. package/dist/{Alert-QvfNBhlU.cjs.map → Alert--ZnlCjaL.cjs.map} +1 -1
  11. package/dist/{Alert-Bo_XgY-A.js → Alert-BVs-GcZQ.js} +4 -4
  12. package/dist/{Alert-Bo_XgY-A.js.map → Alert-BVs-GcZQ.js.map} +1 -1
  13. package/dist/{AuthGuard-C2eA3mJA.cjs → AuthGuard-Cm-tqCto.cjs} +2 -2
  14. package/dist/{AuthGuard-C2eA3mJA.cjs.map → AuthGuard-Cm-tqCto.cjs.map} +1 -1
  15. package/dist/{AuthGuard-Ck31lvBA.js → AuthGuard-DJ_mMwfg.js} +2 -2
  16. package/dist/{AuthGuard-Ck31lvBA.js.map → AuthGuard-DJ_mMwfg.js.map} +1 -1
  17. package/dist/{AuthLayout-BI1wLuDl.js → AuthLayout-BDRJFSpi.js} +2 -2
  18. package/dist/{AuthLayout-BI1wLuDl.js.map → AuthLayout-BDRJFSpi.js.map} +1 -1
  19. package/dist/{AuthLayout-Bzlsvicf.cjs → AuthLayout-D7mSMdM4.cjs} +2 -2
  20. package/dist/{AuthLayout-Bzlsvicf.cjs.map → AuthLayout-D7mSMdM4.cjs.map} +1 -1
  21. package/dist/{Avatar-BBqX1732.cjs → Avatar-BwGJl-ru.cjs} +2 -2
  22. package/dist/{Avatar-BBqX1732.cjs.map → Avatar-BwGJl-ru.cjs.map} +1 -1
  23. package/dist/{Avatar-CaYyv5wk.js → Avatar-C4qgzth2.js} +2 -2
  24. package/dist/{Avatar-CaYyv5wk.js.map → Avatar-C4qgzth2.js.map} +1 -1
  25. package/dist/{AvatarGroup-DrkzAt1-.cjs → AvatarGroup-B8u8ONs5.cjs} +2 -2
  26. package/dist/{AvatarGroup-DrkzAt1-.cjs.map → AvatarGroup-B8u8ONs5.cjs.map} +1 -1
  27. package/dist/{AvatarGroup-6fhm-van.js → AvatarGroup-BqxTFzRc.js} +2 -2
  28. package/dist/{AvatarGroup-6fhm-van.js.map → AvatarGroup-BqxTFzRc.js.map} +1 -1
  29. package/dist/{Breadcrumbs-CqGS32x5.cjs → Breadcrumbs-D4wv2-T7.cjs} +2 -2
  30. package/dist/{Breadcrumbs-CqGS32x5.cjs.map → Breadcrumbs-D4wv2-T7.cjs.map} +1 -1
  31. package/dist/{Breadcrumbs-BEv57tuJ.js → Breadcrumbs-HGk4DKrc.js} +4 -4
  32. package/dist/{Breadcrumbs-BEv57tuJ.js.map → Breadcrumbs-HGk4DKrc.js.map} +1 -1
  33. package/dist/{Button-DZWYeAno.js → Button-7mgXcRdw.js} +2 -2
  34. package/dist/{Button-DZWYeAno.js.map → Button-7mgXcRdw.js.map} +1 -1
  35. package/dist/{Button-BtiFpRie.cjs → Button-DAvQCGIw.cjs} +2 -2
  36. package/dist/{Button-BtiFpRie.cjs.map → Button-DAvQCGIw.cjs.map} +1 -1
  37. package/dist/{Calendar-7W9xNVBZ.js → Calendar-B1ZJHqjB.js} +4 -4
  38. package/dist/{Calendar-7W9xNVBZ.js.map → Calendar-B1ZJHqjB.js.map} +1 -1
  39. package/dist/{Calendar-Bgh_3Vk2.cjs → Calendar-BPYjqBy9.cjs} +2 -2
  40. package/dist/{Calendar-Bgh_3Vk2.cjs.map → Calendar-BPYjqBy9.cjs.map} +1 -1
  41. package/dist/{Card-KfmWG9Uz.cjs → Card-B-Qso__1.cjs} +2 -2
  42. package/dist/{Card-KfmWG9Uz.cjs.map → Card-B-Qso__1.cjs.map} +1 -1
  43. package/dist/{Card-ckOd617g.js → Card-vFsIhkyR.js} +4 -4
  44. package/dist/{Card-ckOd617g.js.map → Card-vFsIhkyR.js.map} +1 -1
  45. package/dist/{Chip-Crzm7Eux.js → Chip-CU0J7HJa.js} +3 -3
  46. package/dist/{Chip-Crzm7Eux.js.map → Chip-CU0J7HJa.js.map} +1 -1
  47. package/dist/{Chip-BDUsue_R.cjs → Chip-CovsonP1.cjs} +2 -2
  48. package/dist/{Chip-BDUsue_R.cjs.map → Chip-CovsonP1.cjs.map} +1 -1
  49. package/dist/{ChoiceCardGroup-D37XREKV.js → ChoiceCardGroup-BBqUbFLS.js} +2 -2
  50. package/dist/{ChoiceCardGroup-D37XREKV.js.map → ChoiceCardGroup-BBqUbFLS.js.map} +1 -1
  51. package/dist/{ChoiceCardGroup-Cj_YFj6C.cjs → ChoiceCardGroup-bnKFPDYz.cjs} +2 -2
  52. package/dist/{ChoiceCardGroup-Cj_YFj6C.cjs.map → ChoiceCardGroup-bnKFPDYz.cjs.map} +1 -1
  53. package/dist/{CodeBlock-rnGAu2DQ.cjs → CodeBlock-B404V_cc.cjs} +2 -2
  54. package/dist/{CodeBlock-rnGAu2DQ.cjs.map → CodeBlock-B404V_cc.cjs.map} +1 -1
  55. package/dist/{CodeBlock-CX8_dMPD.js → CodeBlock-DvJ45qEp.js} +4 -4
  56. package/dist/{CodeBlock-CX8_dMPD.js.map → CodeBlock-DvJ45qEp.js.map} +1 -1
  57. package/dist/{ColorPicker-CwLivdAt.js → ColorPicker-C4slmEZC.js} +3 -3
  58. package/dist/{ColorPicker-CwLivdAt.js.map → ColorPicker-C4slmEZC.js.map} +1 -1
  59. package/dist/{ColorPicker-BaAdcqR9.cjs → ColorPicker-_RBW51XB.cjs} +2 -2
  60. package/dist/{ColorPicker-BaAdcqR9.cjs.map → ColorPicker-_RBW51XB.cjs.map} +1 -1
  61. package/dist/{ColorPickerPanel-IOhJJF1R.cjs → ColorPickerPanel-CNspBZre.cjs} +2 -2
  62. package/dist/{ColorPickerPanel-IOhJJF1R.cjs.map → ColorPickerPanel-CNspBZre.cjs.map} +1 -1
  63. package/dist/{ColorPickerPanel-CkrSIf35.js → ColorPickerPanel-CQNfIbgc.js} +3 -3
  64. package/dist/{ColorPickerPanel-CkrSIf35.js.map → ColorPickerPanel-CQNfIbgc.js.map} +1 -1
  65. package/dist/{ColorRamp-DbFOsspz.js → ColorRamp-DQZZiE5I.js} +2 -2
  66. package/dist/{ColorRamp-DbFOsspz.js.map → ColorRamp-DQZZiE5I.js.map} +1 -1
  67. package/dist/{ColorRamp-BCy8a7ks.cjs → ColorRamp-DuO7gkru.cjs} +2 -2
  68. package/dist/{ColorRamp-BCy8a7ks.cjs.map → ColorRamp-DuO7gkru.cjs.map} +1 -1
  69. package/dist/{ConfigProvider-CYSpuSMJ.cjs → ConfigProvider-BFhkb0BV.cjs} +2 -2
  70. package/dist/{ConfigProvider-CYSpuSMJ.cjs.map → ConfigProvider-BFhkb0BV.cjs.map} +1 -1
  71. package/dist/{ConfigProvider-DtyUlWk6.js → ConfigProvider-bXX8dnhY.js} +2 -2
  72. package/dist/{ConfigProvider-DtyUlWk6.js.map → ConfigProvider-bXX8dnhY.js.map} +1 -1
  73. package/dist/{CopyButton-DUG5s3TM.cjs → CopyButton-B2V6guZ0.cjs} +2 -2
  74. package/dist/{CopyButton-DUG5s3TM.cjs.map → CopyButton-B2V6guZ0.cjs.map} +1 -1
  75. package/dist/{CopyButton-LURMuaYw.js → CopyButton-DfYAslz-.js} +4 -4
  76. package/dist/{CopyButton-LURMuaYw.js.map → CopyButton-DfYAslz-.js.map} +1 -1
  77. package/dist/{DashedButton-BX8hfY1x.cjs → DashedButton-CZ2hjLxT.cjs} +2 -2
  78. package/dist/{DashedButton-BX8hfY1x.cjs.map → DashedButton-CZ2hjLxT.cjs.map} +1 -1
  79. package/dist/{DashedButton-wcmXTYBw.js → DashedButton-meJSIY61.js} +2 -2
  80. package/dist/{DashedButton-wcmXTYBw.js.map → DashedButton-meJSIY61.js.map} +1 -1
  81. package/dist/{DatePicker-CSIBYSZt.js → DatePicker-CNUDjOxA.js} +5 -5
  82. package/dist/{DatePicker-CSIBYSZt.js.map → DatePicker-CNUDjOxA.js.map} +1 -1
  83. package/dist/{DatePicker-Bw9gLB8o.cjs → DatePicker-DrIHa1j1.cjs} +2 -2
  84. package/dist/{DatePicker-Bw9gLB8o.cjs.map → DatePicker-DrIHa1j1.cjs.map} +1 -1
  85. package/dist/{DateTimePicker-kikKdt0F.cjs → DateTimePicker-BzwxaOPb.cjs} +2 -2
  86. package/dist/{DateTimePicker-kikKdt0F.cjs.map → DateTimePicker-BzwxaOPb.cjs.map} +1 -1
  87. package/dist/{DateTimePicker-C9F2yJMf.js → DateTimePicker-CvWNDbib.js} +8 -8
  88. package/dist/{DateTimePicker-C9F2yJMf.js.map → DateTimePicker-CvWNDbib.js.map} +1 -1
  89. package/dist/{DescriptionList-DnGkHdzT.cjs → DescriptionList-Bed1MHU8.cjs} +2 -2
  90. package/dist/{DescriptionList-DnGkHdzT.cjs.map → DescriptionList-Bed1MHU8.cjs.map} +1 -1
  91. package/dist/{DescriptionList-kfNXbf_D.js → DescriptionList-BgMNjHJQ.js} +5 -5
  92. package/dist/{DescriptionList-kfNXbf_D.js.map → DescriptionList-BgMNjHJQ.js.map} +1 -1
  93. package/dist/{Dropdown-C_y9_dVn.cjs → Dropdown-DNL7RWdL.cjs} +2 -2
  94. package/dist/{Dropdown-C_y9_dVn.cjs.map → Dropdown-DNL7RWdL.cjs.map} +1 -1
  95. package/dist/{Dropdown-D-D_Z1Jo.js → Dropdown-iWbHokT7.js} +2 -2
  96. package/dist/{Dropdown-D-D_Z1Jo.js.map → Dropdown-iWbHokT7.js.map} +1 -1
  97. package/dist/{EmptyState-BM5LrRLq.cjs → EmptyState-BzwrOICc.cjs} +2 -2
  98. package/dist/{EmptyState-BM5LrRLq.cjs.map → EmptyState-BzwrOICc.cjs.map} +1 -1
  99. package/dist/{EmptyState-DrSj2XV_.js → EmptyState-CmcjJl_K.js} +3 -3
  100. package/dist/{EmptyState-DrSj2XV_.js.map → EmptyState-CmcjJl_K.js.map} +1 -1
  101. package/dist/{ErrorBoundary-yz669VEu.cjs → ErrorBoundary-BcZgeSsu.cjs} +2 -2
  102. package/dist/{ErrorBoundary-yz669VEu.cjs.map → ErrorBoundary-BcZgeSsu.cjs.map} +1 -1
  103. package/dist/{ErrorBoundary-DsP4hO_V.js → ErrorBoundary-TfeJetWc.js} +3 -3
  104. package/dist/{ErrorBoundary-DsP4hO_V.js.map → ErrorBoundary-TfeJetWc.js.map} +1 -1
  105. package/dist/{ErrorState-BThPIYaM.cjs → ErrorState-CzWz5UcX.cjs} +2 -2
  106. package/dist/{ErrorState-BThPIYaM.cjs.map → ErrorState-CzWz5UcX.cjs.map} +1 -1
  107. package/dist/{ErrorState-DEngucdq.js → ErrorState-EjIhdq7S.js} +8 -8
  108. package/dist/{ErrorState-DEngucdq.js.map → ErrorState-EjIhdq7S.js.map} +1 -1
  109. package/dist/{FileCard-CmCESTQd.js → FileCard-CmMxVyk3.js} +5 -5
  110. package/dist/{FileCard-CmCESTQd.js.map → FileCard-CmMxVyk3.js.map} +1 -1
  111. package/dist/{FileCard-wxDT2rj9.cjs → FileCard-Cxr1_eF2.cjs} +2 -2
  112. package/dist/{FileCard-wxDT2rj9.cjs.map → FileCard-Cxr1_eF2.cjs.map} +1 -1
  113. package/dist/{FileUploader-Dp1r4Sxc.js → FileUploader-2cXBI4Nh.js} +7 -7
  114. package/dist/{FileUploader-Dp1r4Sxc.js.map → FileUploader-2cXBI4Nh.js.map} +1 -1
  115. package/dist/{FileUploader-DBNRp5eT.cjs → FileUploader-BkM1t2aE.cjs} +2 -2
  116. package/dist/{FileUploader-DBNRp5eT.cjs.map → FileUploader-BkM1t2aE.cjs.map} +1 -1
  117. package/dist/{Flag-B6OhgwZr.cjs → Flag-CWp81_zX.cjs} +2 -2
  118. package/dist/{Flag-B6OhgwZr.cjs.map → Flag-CWp81_zX.cjs.map} +1 -1
  119. package/dist/{Flag-Q3vI7cgt.js → Flag-IQolG3j6.js} +2 -2
  120. package/dist/{Flag-Q3vI7cgt.js.map → Flag-IQolG3j6.js.map} +1 -1
  121. package/dist/{FullscreenToggle-WGsbE3Op.js → FullscreenToggle-B1DH_-k3.js} +4 -4
  122. package/dist/{FullscreenToggle-WGsbE3Op.js.map → FullscreenToggle-B1DH_-k3.js.map} +1 -1
  123. package/dist/{FullscreenToggle-DVdQriWB.cjs → FullscreenToggle-DXVAeN3M.cjs} +2 -2
  124. package/dist/{FullscreenToggle-DVdQriWB.cjs.map → FullscreenToggle-DXVAeN3M.cjs.map} +1 -1
  125. package/dist/Icon-BoQmbW7j.cjs +2 -0
  126. package/dist/Icon-BoQmbW7j.cjs.map +1 -0
  127. package/dist/{Icon-B7DJn8Tw.js → Icon-DMMO32p6.js} +72 -71
  128. package/dist/Icon-DMMO32p6.js.map +1 -0
  129. package/dist/{IconButton-DSPdv-oI.cjs → IconButton-ChhZqleN.cjs} +2 -2
  130. package/dist/{IconButton-DSPdv-oI.cjs.map → IconButton-ChhZqleN.cjs.map} +1 -1
  131. package/dist/{IconButton-iWbUJAz7.js → IconButton-s5hohjxu.js} +2 -2
  132. package/dist/{IconButton-iWbUJAz7.js.map → IconButton-s5hohjxu.js.map} +1 -1
  133. package/dist/{ImageEditor-C40dp2-V.cjs → ImageEditor-C8tFTX4e.cjs} +2 -2
  134. package/dist/{ImageEditor-C40dp2-V.cjs.map → ImageEditor-C8tFTX4e.cjs.map} +1 -1
  135. package/dist/{ImageEditor-BDNys8pq.js → ImageEditor-DWbWjGQ8.js} +8 -8
  136. package/dist/{ImageEditor-BDNys8pq.js.map → ImageEditor-DWbWjGQ8.js.map} +1 -1
  137. package/dist/{List-DS91CZUt.js → List-DQlEG_S5.js} +2 -2
  138. package/dist/{List-DS91CZUt.js.map → List-DQlEG_S5.js.map} +1 -1
  139. package/dist/{List-CLUXeaXS.cjs → List-Dfa7mlSZ.cjs} +2 -2
  140. package/dist/{List-CLUXeaXS.cjs.map → List-Dfa7mlSZ.cjs.map} +1 -1
  141. package/dist/{ListItem-Ezmdk7q-.js → ListItem-CLmg9xKQ.js} +2 -2
  142. package/dist/{ListItem-Ezmdk7q-.js.map → ListItem-CLmg9xKQ.js.map} +1 -1
  143. package/dist/{ListItem-CguNjf-u.cjs → ListItem-CWM2fUS2.cjs} +2 -2
  144. package/dist/{ListItem-CguNjf-u.cjs.map → ListItem-CWM2fUS2.cjs.map} +1 -1
  145. package/dist/{Loader-RyFTP2X5.cjs → Loader-BCrMy9NU.cjs} +2 -2
  146. package/dist/{Loader-RyFTP2X5.cjs.map → Loader-BCrMy9NU.cjs.map} +1 -1
  147. package/dist/{Loader-DD1vfqmN.js → Loader-CShIWNfG.js} +2 -2
  148. package/dist/{Loader-DD1vfqmN.js.map → Loader-CShIWNfG.js.map} +1 -1
  149. package/dist/{LocationPicker-B594f0bz.cjs → LocationPicker-8Tt0zJU4.cjs} +2 -2
  150. package/dist/{LocationPicker-B594f0bz.cjs.map → LocationPicker-8Tt0zJU4.cjs.map} +1 -1
  151. package/dist/{LocationPicker-DpmYaYyd.js → LocationPicker-DsV_s2Ur.js} +8 -8
  152. package/dist/{LocationPicker-DpmYaYyd.js.map → LocationPicker-DsV_s2Ur.js.map} +1 -1
  153. package/dist/{Modal-DVGTD2Ck.js → Modal-BO7fHn0r.js} +4 -4
  154. package/dist/{Modal-DVGTD2Ck.js.map → Modal-BO7fHn0r.js.map} +1 -1
  155. package/dist/{Modal-7cCok6fV.cjs → Modal-yj92WLay.cjs} +2 -2
  156. package/dist/{Modal-7cCok6fV.cjs.map → Modal-yj92WLay.cjs.map} +1 -1
  157. package/dist/{MultiSelect-DTKNjUDH.cjs → MultiSelect-B6JZb_5N.cjs} +2 -2
  158. package/dist/{MultiSelect-DTKNjUDH.cjs.map → MultiSelect-B6JZb_5N.cjs.map} +1 -1
  159. package/dist/{MultiSelect-D-X833xt.js → MultiSelect-D-QWlfwD.js} +5 -5
  160. package/dist/{MultiSelect-D-X833xt.js.map → MultiSelect-D-QWlfwD.js.map} +1 -1
  161. package/dist/{NumberField-Xz4yQMlm.cjs → NumberField-CS5VMnk4.cjs} +2 -2
  162. package/dist/{NumberField-Xz4yQMlm.cjs.map → NumberField-CS5VMnk4.cjs.map} +1 -1
  163. package/dist/{NumberField-OPOl0Yph.js → NumberField-D_UxKjVN.js} +4 -4
  164. package/dist/{NumberField-OPOl0Yph.js.map → NumberField-D_UxKjVN.js.map} +1 -1
  165. package/dist/{OtpField-kd0YghZq.cjs → OtpField-BuS_8j9L.cjs} +2 -2
  166. package/dist/{OtpField-kd0YghZq.cjs.map → OtpField-BuS_8j9L.cjs.map} +1 -1
  167. package/dist/{OtpField-CLrDMNtS.js → OtpField-CpjDid5_.js} +2 -2
  168. package/dist/{OtpField-CLrDMNtS.js.map → OtpField-CpjDid5_.js.map} +1 -1
  169. package/dist/{PageError-v6MAH_OL.cjs → PageError-CTEOASeb.cjs} +2 -2
  170. package/dist/{PageError-v6MAH_OL.cjs.map → PageError-CTEOASeb.cjs.map} +1 -1
  171. package/dist/{PageError-BIiZDzey.js → PageError-DjyJrGmR.js} +5 -5
  172. package/dist/{PageError-BIiZDzey.js.map → PageError-DjyJrGmR.js.map} +1 -1
  173. package/dist/{PageLayout-DH3jochw.cjs → PageLayout-BYKRmCAL.cjs} +2 -2
  174. package/dist/{PageLayout-DH3jochw.cjs.map → PageLayout-BYKRmCAL.cjs.map} +1 -1
  175. package/dist/{PageLayout-BjaPfXvb.js → PageLayout-Cz1OhQZ7.js} +5 -5
  176. package/dist/{PageLayout-BjaPfXvb.js.map → PageLayout-Cz1OhQZ7.js.map} +1 -1
  177. package/dist/{PageNotFound-C1oSsMG-.js → PageNotFound-CwBtrllo.js} +5 -5
  178. package/dist/{PageNotFound-C1oSsMG-.js.map → PageNotFound-CwBtrllo.js.map} +1 -1
  179. package/dist/{PageNotFound-Cse4bROv.cjs → PageNotFound-u9Q4KG6B.cjs} +2 -2
  180. package/dist/{PageNotFound-Cse4bROv.cjs.map → PageNotFound-u9Q4KG6B.cjs.map} +1 -1
  181. package/dist/{Pagination-BNJdqcu4.js → Pagination-CLjNwqie.js} +3 -3
  182. package/dist/{Pagination-BNJdqcu4.js.map → Pagination-CLjNwqie.js.map} +1 -1
  183. package/dist/{Pagination-DkmfEmgK.cjs → Pagination-HtS5gPnd.cjs} +2 -2
  184. package/dist/{Pagination-DkmfEmgK.cjs.map → Pagination-HtS5gPnd.cjs.map} +1 -1
  185. package/dist/{PaletteField-DqZl1mK0.cjs → PaletteField-BSgx5pxh.cjs} +2 -2
  186. package/dist/{PaletteField-DqZl1mK0.cjs.map → PaletteField-BSgx5pxh.cjs.map} +1 -1
  187. package/dist/{PaletteField-Cdky6Zka.js → PaletteField-Bk7cnSla.js} +3 -3
  188. package/dist/{PaletteField-Cdky6Zka.js.map → PaletteField-Bk7cnSla.js.map} +1 -1
  189. package/dist/{PhoneField-jq-3_i_b.cjs → PhoneField-CzFv2Vci.cjs} +2 -2
  190. package/dist/{PhoneField-jq-3_i_b.cjs.map → PhoneField-CzFv2Vci.cjs.map} +1 -1
  191. package/dist/{PhoneField-DmFaJJEa.js → PhoneField-DhoumZNG.js} +5 -5
  192. package/dist/{PhoneField-DmFaJJEa.js.map → PhoneField-DhoumZNG.js.map} +1 -1
  193. package/dist/{Popconfirm-KOE9gGi6.cjs → Popconfirm-Cb9LlmZb.cjs} +2 -2
  194. package/dist/{Popconfirm-KOE9gGi6.cjs.map → Popconfirm-Cb9LlmZb.cjs.map} +1 -1
  195. package/dist/{Popconfirm-D-8ZG2WR.js → Popconfirm-D7J5JbF-.js} +4 -4
  196. package/dist/{Popconfirm-D-8ZG2WR.js.map → Popconfirm-D7J5JbF-.js.map} +1 -1
  197. package/dist/{Progress-CdX666FP.js → Progress-Bt2LDqbD.js} +2 -2
  198. package/dist/{Progress-CdX666FP.js.map → Progress-Bt2LDqbD.js.map} +1 -1
  199. package/dist/{Progress-7EyhPtnu.cjs → Progress-dAtQ2BN-.cjs} +2 -2
  200. package/dist/{Progress-7EyhPtnu.cjs.map → Progress-dAtQ2BN-.cjs.map} +1 -1
  201. package/dist/{QrCode-ClIJjjvF.cjs → QrCode-FHUAxI8u.cjs} +2 -2
  202. package/dist/{QrCode-ClIJjjvF.cjs.map → QrCode-FHUAxI8u.cjs.map} +1 -1
  203. package/dist/{QrCode-D7ocSDi7.js → QrCode-jaDZxZkv.js} +2 -2
  204. package/dist/{QrCode-D7ocSDi7.js.map → QrCode-jaDZxZkv.js.map} +1 -1
  205. package/dist/{RemoveDialog-DTzRPLaT.js → RemoveDialog-DdO5E3Wl.js} +6 -6
  206. package/dist/{RemoveDialog-DTzRPLaT.js.map → RemoveDialog-DdO5E3Wl.js.map} +1 -1
  207. package/dist/{RemoveDialog-UsSX5z8Y.cjs → RemoveDialog-eGNxdyoO.cjs} +2 -2
  208. package/dist/{RemoveDialog-UsSX5z8Y.cjs.map → RemoveDialog-eGNxdyoO.cjs.map} +1 -1
  209. package/dist/{RichTextEditor-Bh0Q3dIW.cjs → RichTextEditor-CoYuQurR.cjs} +2 -2
  210. package/dist/{RichTextEditor-Bh0Q3dIW.cjs.map → RichTextEditor-CoYuQurR.cjs.map} +1 -1
  211. package/dist/{RichTextEditor-BMctlkVC.js → RichTextEditor-DHRiJchI.js} +10 -10
  212. package/dist/{RichTextEditor-BMctlkVC.js.map → RichTextEditor-DHRiJchI.js.map} +1 -1
  213. package/dist/{RootLayout-BztZetpk.cjs → RootLayout-CEplIlVR.cjs} +2 -2
  214. package/dist/{RootLayout-BztZetpk.cjs.map → RootLayout-CEplIlVR.cjs.map} +1 -1
  215. package/dist/{RootLayout-CTkv4iQJ.js → RootLayout-pd66MZtI.js} +21 -21
  216. package/dist/{RootLayout-CTkv4iQJ.js.map → RootLayout-pd66MZtI.js.map} +1 -1
  217. package/dist/{Select-CmonDIIU.js → Select-C2iiQLMh.js} +4 -4
  218. package/dist/{Select-CmonDIIU.js.map → Select-C2iiQLMh.js.map} +1 -1
  219. package/dist/{Select-BzVyK6Ne.cjs → Select-CvW_T9R-.cjs} +2 -2
  220. package/dist/{Select-BzVyK6Ne.cjs.map → Select-CvW_T9R-.cjs.map} +1 -1
  221. package/dist/Sidebar-CqGCazeA.cjs +2 -0
  222. package/dist/Sidebar-CqGCazeA.cjs.map +1 -0
  223. package/dist/Sidebar-DuUhzQBi.js +543 -0
  224. package/dist/Sidebar-DuUhzQBi.js.map +1 -0
  225. package/dist/{Slider-Oe9VSAdy.cjs → Slider-DlPMPdHA.cjs} +2 -2
  226. package/dist/{Slider-Oe9VSAdy.cjs.map → Slider-DlPMPdHA.cjs.map} +1 -1
  227. package/dist/{Slider-C7Wb3q_F.js → Slider-UY29adRu.js} +2 -2
  228. package/dist/{Slider-C7Wb3q_F.js.map → Slider-UY29adRu.js.map} +1 -1
  229. package/dist/{SpeedDial-DpIXoYHB.cjs → SpeedDial-Cms5pJ9t.cjs} +2 -2
  230. package/dist/{SpeedDial-DpIXoYHB.cjs.map → SpeedDial-Cms5pJ9t.cjs.map} +1 -1
  231. package/dist/{SpeedDial-CCGQlwn2.js → SpeedDial-DOWefQgo.js} +3 -3
  232. package/dist/{SpeedDial-CCGQlwn2.js.map → SpeedDial-DOWefQgo.js.map} +1 -1
  233. package/dist/{Stepper-PBDU60G_.cjs → Stepper-4wCyTnwi.cjs} +2 -2
  234. package/dist/{Stepper-PBDU60G_.cjs.map → Stepper-4wCyTnwi.cjs.map} +1 -1
  235. package/dist/{Stepper-D_WKS1RG.js → Stepper-yQEJkbUJ.js} +3 -3
  236. package/dist/{Stepper-D_WKS1RG.js.map → Stepper-yQEJkbUJ.js.map} +1 -1
  237. package/dist/{SwatchPicker-DS4WY2eM.js → SwatchPicker-BI0XHphv.js} +2 -2
  238. package/dist/{SwatchPicker-DS4WY2eM.js.map → SwatchPicker-BI0XHphv.js.map} +1 -1
  239. package/dist/{SwatchPicker-DCjE0T80.cjs → SwatchPicker-QYtqEUxX.cjs} +2 -2
  240. package/dist/{SwatchPicker-DCjE0T80.cjs.map → SwatchPicker-QYtqEUxX.cjs.map} +1 -1
  241. package/dist/{Table-DZQVa_PE.js → Table-CNrt1EWm.js} +19 -19
  242. package/dist/{Table-DZQVa_PE.js.map → Table-CNrt1EWm.js.map} +1 -1
  243. package/dist/{Table-CZ4n4-TN.cjs → Table-D4pqLNtE.cjs} +2 -2
  244. package/dist/{Table-CZ4n4-TN.cjs.map → Table-D4pqLNtE.cjs.map} +1 -1
  245. package/dist/{Tabs-Byhqm-TE.cjs → Tabs-D6qrgZTM.cjs} +2 -2
  246. package/dist/{Tabs-Byhqm-TE.cjs.map → Tabs-D6qrgZTM.cjs.map} +1 -1
  247. package/dist/{Tabs-B063mP-v.js → Tabs-lezN63jW.js} +3 -3
  248. package/dist/{Tabs-B063mP-v.js.map → Tabs-lezN63jW.js.map} +1 -1
  249. package/dist/{TagsField-g_LtwYgz.cjs → TagsField-BIJEDyfz.cjs} +2 -2
  250. package/dist/{TagsField-g_LtwYgz.cjs.map → TagsField-BIJEDyfz.cjs.map} +1 -1
  251. package/dist/{TagsField-hQFYyNcM.js → TagsField-D_a2I8eU.js} +5 -5
  252. package/dist/{TagsField-hQFYyNcM.js.map → TagsField-D_a2I8eU.js.map} +1 -1
  253. package/dist/{TextField-Dfpk0jOg.js → TextField-BsC2zoHI.js} +4 -4
  254. package/dist/{TextField-Dfpk0jOg.js.map → TextField-BsC2zoHI.js.map} +1 -1
  255. package/dist/{TextField-D4s2hGSd.cjs → TextField-CXDBlP-8.cjs} +2 -2
  256. package/dist/{TextField-D4s2hGSd.cjs.map → TextField-CXDBlP-8.cjs.map} +1 -1
  257. package/dist/{ThemeToggle-BQQ3eswr.js → ThemeToggle-Dh6XxqM7.js} +4 -4
  258. package/dist/{ThemeToggle-BQQ3eswr.js.map → ThemeToggle-Dh6XxqM7.js.map} +1 -1
  259. package/dist/{ThemeToggle-BTTI7Jz0.cjs → ThemeToggle-zbKf4ph5.cjs} +2 -2
  260. package/dist/{ThemeToggle-BTTI7Jz0.cjs.map → ThemeToggle-zbKf4ph5.cjs.map} +1 -1
  261. package/dist/{TimeColumns-BpjhrNCq.js → TimeColumns-CR__2LXh.js} +2 -2
  262. package/dist/{TimeColumns-BpjhrNCq.js.map → TimeColumns-CR__2LXh.js.map} +1 -1
  263. package/dist/{TimeColumns-DZYGWWG_.cjs → TimeColumns-CjBeUPtV.cjs} +2 -2
  264. package/dist/{TimeColumns-DZYGWWG_.cjs.map → TimeColumns-CjBeUPtV.cjs.map} +1 -1
  265. package/dist/{TimePicker-mzoMIlpq.js → TimePicker-BakQ-wPd.js} +6 -6
  266. package/dist/{TimePicker-mzoMIlpq.js.map → TimePicker-BakQ-wPd.js.map} +1 -1
  267. package/dist/{TimePicker-DChtZgBs.cjs → TimePicker-DtqmD2bH.cjs} +2 -2
  268. package/dist/{TimePicker-DChtZgBs.cjs.map → TimePicker-DtqmD2bH.cjs.map} +1 -1
  269. package/dist/{Timeline-DOojNvLG.cjs → Timeline-CFKbPpAV.cjs} +2 -2
  270. package/dist/{Timeline-DOojNvLG.cjs.map → Timeline-CFKbPpAV.cjs.map} +1 -1
  271. package/dist/{Timeline-Dg03dwTN.js → Timeline-zCHcq7Ra.js} +2 -2
  272. package/dist/{Timeline-Dg03dwTN.js.map → Timeline-zCHcq7Ra.js.map} +1 -1
  273. package/dist/{Toaster-lonArt-H.cjs → Toaster-BpXPWJ_n.cjs} +2 -2
  274. package/dist/{Toaster-lonArt-H.cjs.map → Toaster-BpXPWJ_n.cjs.map} +1 -1
  275. package/dist/{Toaster-79DvOW80.js → Toaster-C5jWNL-o.js} +3 -3
  276. package/dist/{Toaster-79DvOW80.js.map → Toaster-C5jWNL-o.js.map} +1 -1
  277. package/dist/{ToggleButtonGroup-CGNRLxjg.cjs → ToggleButtonGroup-CbKtjm8O.cjs} +2 -2
  278. package/dist/{ToggleButtonGroup-CGNRLxjg.cjs.map → ToggleButtonGroup-CbKtjm8O.cjs.map} +1 -1
  279. package/dist/{ToggleButtonGroup-K6ZcrTZT.js → ToggleButtonGroup-D3Jltv0z.js} +2 -2
  280. package/dist/{ToggleButtonGroup-K6ZcrTZT.js.map → ToggleButtonGroup-D3Jltv0z.js.map} +1 -1
  281. package/dist/{TranslatedFields-CHHtXO_n.js → TranslatedFields-C8oxlGIQ.js} +5 -5
  282. package/dist/{TranslatedFields-CHHtXO_n.js.map → TranslatedFields-C8oxlGIQ.js.map} +1 -1
  283. package/dist/{TranslatedFields-BYpMrYaw.cjs → TranslatedFields-Che_ZPHk.cjs} +2 -2
  284. package/dist/{TranslatedFields-BYpMrYaw.cjs.map → TranslatedFields-Che_ZPHk.cjs.map} +1 -1
  285. package/dist/{UserCard-SlkCgZS9.cjs → UserCard-DlrdIJHW.cjs} +2 -2
  286. package/dist/{UserCard-SlkCgZS9.cjs.map → UserCard-DlrdIJHW.cjs.map} +1 -1
  287. package/dist/{UserCard-BJFNP_nl.js → UserCard-Dr1A_bdA.js} +5 -5
  288. package/dist/{UserCard-BJFNP_nl.js.map → UserCard-Dr1A_bdA.js.map} +1 -1
  289. package/dist/{authLayoutRoute-CgSQIDD5.cjs → authLayoutRoute-CPLqQVvx.cjs} +2 -2
  290. package/dist/{authLayoutRoute-CgSQIDD5.cjs.map → authLayoutRoute-CPLqQVvx.cjs.map} +1 -1
  291. package/dist/{authLayoutRoute-CEFmEYy7.js → authLayoutRoute-nSZq8JYA.js} +2 -2
  292. package/dist/{authLayoutRoute-CEFmEYy7.js.map → authLayoutRoute-nSZq8JYA.js.map} +1 -1
  293. package/dist/chunks/icons/{62-Bfupp-0A.js → 62-9nuZO-ct.js} +9 -10
  294. package/dist/chunks/icons/{62-CZZzM1ev.cjs → 62-DQQ1U3IB.cjs} +1 -1
  295. package/dist/components/Accordion/index.cjs +1 -1
  296. package/dist/components/Accordion/index.js +1 -1
  297. package/dist/components/Alert/index.cjs +1 -1
  298. package/dist/components/Alert/index.js +1 -1
  299. package/dist/components/AuthLayout/index.cjs +1 -1
  300. package/dist/components/AuthLayout/index.js +1 -1
  301. package/dist/components/Avatar/index.cjs +1 -1
  302. package/dist/components/Avatar/index.js +2 -2
  303. package/dist/components/Breadcrumbs/index.cjs +1 -1
  304. package/dist/components/Breadcrumbs/index.js +1 -1
  305. package/dist/components/Button/index.cjs +1 -1
  306. package/dist/components/Button/index.js +1 -1
  307. package/dist/components/Card/index.cjs +1 -1
  308. package/dist/components/Card/index.js +1 -1
  309. package/dist/components/Chip/index.cjs +1 -1
  310. package/dist/components/Chip/index.js +1 -1
  311. package/dist/components/ChoiceCard/index.cjs +1 -1
  312. package/dist/components/ChoiceCard/index.js +1 -1
  313. package/dist/components/CodeBlock/index.cjs +1 -1
  314. package/dist/components/CodeBlock/index.js +1 -1
  315. package/dist/components/ColorPicker/index.cjs +1 -1
  316. package/dist/components/ColorPicker/index.js +1 -1
  317. package/dist/components/ColorRamp/index.cjs +1 -1
  318. package/dist/components/ColorRamp/index.js +1 -1
  319. package/dist/components/CopyButton/index.cjs +1 -1
  320. package/dist/components/CopyButton/index.js +1 -1
  321. package/dist/components/DashedButton/index.cjs +1 -1
  322. package/dist/components/DashedButton/index.js +1 -1
  323. package/dist/components/DatePicker/index.cjs +1 -1
  324. package/dist/components/DatePicker/index.js +1 -1
  325. package/dist/components/DateTimePicker/index.cjs +1 -1
  326. package/dist/components/DateTimePicker/index.js +1 -1
  327. package/dist/components/DescriptionList/index.cjs +1 -1
  328. package/dist/components/DescriptionList/index.js +1 -1
  329. package/dist/components/Dropdown/index.cjs +1 -1
  330. package/dist/components/Dropdown/index.js +1 -1
  331. package/dist/components/EmptyState/index.cjs +1 -1
  332. package/dist/components/EmptyState/index.js +1 -1
  333. package/dist/components/ErrorState/index.cjs +1 -1
  334. package/dist/components/ErrorState/index.js +2 -2
  335. package/dist/components/FileCard/index.cjs +1 -1
  336. package/dist/components/FileCard/index.js +1 -1
  337. package/dist/components/FileUploader/index.cjs +1 -1
  338. package/dist/components/FileUploader/index.js +1 -1
  339. package/dist/components/Flag/index.cjs +1 -1
  340. package/dist/components/Flag/index.js +1 -1
  341. package/dist/components/FullscreenToggle/index.cjs +1 -1
  342. package/dist/components/FullscreenToggle/index.js +1 -1
  343. package/dist/components/Icon/index.cjs +1 -1
  344. package/dist/components/Icon/index.js +1 -1
  345. package/dist/components/IconButton/index.cjs +1 -1
  346. package/dist/components/IconButton/index.js +1 -1
  347. package/dist/components/ImageEditor/index.cjs +1 -1
  348. package/dist/components/ImageEditor/index.js +1 -1
  349. package/dist/components/List/index.cjs +1 -1
  350. package/dist/components/List/index.js +2 -2
  351. package/dist/components/Loader/index.cjs +1 -1
  352. package/dist/components/Loader/index.js +1 -1
  353. package/dist/components/LocationPicker/index.cjs +1 -1
  354. package/dist/components/LocationPicker/index.js +1 -1
  355. package/dist/components/Modal/index.cjs +1 -1
  356. package/dist/components/Modal/index.js +1 -1
  357. package/dist/components/MultiSelect/index.cjs +1 -1
  358. package/dist/components/MultiSelect/index.js +1 -1
  359. package/dist/components/NumberField/index.cjs +1 -1
  360. package/dist/components/NumberField/index.js +1 -1
  361. package/dist/components/OtpField/index.cjs +1 -1
  362. package/dist/components/OtpField/index.js +1 -1
  363. package/dist/components/PageError/index.cjs +1 -1
  364. package/dist/components/PageError/index.js +1 -1
  365. package/dist/components/PageLayout/index.cjs +1 -1
  366. package/dist/components/PageLayout/index.js +1 -1
  367. package/dist/components/PageNotFound/index.cjs +1 -1
  368. package/dist/components/PageNotFound/index.js +1 -1
  369. package/dist/components/Pagination/index.cjs +1 -1
  370. package/dist/components/Pagination/index.js +1 -1
  371. package/dist/components/PaletteField/index.cjs +1 -1
  372. package/dist/components/PaletteField/index.js +1 -1
  373. package/dist/components/PhoneField/index.cjs +1 -1
  374. package/dist/components/PhoneField/index.js +1 -1
  375. package/dist/components/Popconfirm/index.cjs +1 -1
  376. package/dist/components/Popconfirm/index.js +1 -1
  377. package/dist/components/Progress/index.cjs +1 -1
  378. package/dist/components/Progress/index.js +1 -1
  379. package/dist/components/QrCode/index.cjs +1 -1
  380. package/dist/components/QrCode/index.js +1 -1
  381. package/dist/components/RemoveDialog/index.cjs +1 -1
  382. package/dist/components/RemoveDialog/index.js +1 -1
  383. package/dist/components/RichTextEditor/index.cjs +1 -1
  384. package/dist/components/RichTextEditor/index.js +1 -1
  385. package/dist/components/RootLayout/index.cjs +1 -1
  386. package/dist/components/RootLayout/index.js +1 -1
  387. package/dist/components/Select/index.cjs +1 -1
  388. package/dist/components/Select/index.js +1 -1
  389. package/dist/components/Sidebar/Sidebar.d.cts +40 -4
  390. package/dist/components/Sidebar/Sidebar.d.ts +40 -4
  391. package/dist/components/Sidebar/index.cjs +1 -1
  392. package/dist/components/Sidebar/index.d.cts +2 -1
  393. package/dist/components/Sidebar/index.d.ts +2 -1
  394. package/dist/components/Sidebar/index.js +5 -4
  395. package/dist/components/Slider/index.cjs +1 -1
  396. package/dist/components/Slider/index.js +1 -1
  397. package/dist/components/SpeedDial/index.cjs +1 -1
  398. package/dist/components/SpeedDial/index.js +1 -1
  399. package/dist/components/Stepper/index.cjs +1 -1
  400. package/dist/components/Stepper/index.js +1 -1
  401. package/dist/components/SwatchPicker/index.cjs +1 -1
  402. package/dist/components/SwatchPicker/index.js +1 -1
  403. package/dist/components/Table/index.cjs +1 -1
  404. package/dist/components/Table/index.js +1 -1
  405. package/dist/components/Tabs/index.cjs +1 -1
  406. package/dist/components/Tabs/index.js +1 -1
  407. package/dist/components/TagsField/index.cjs +1 -1
  408. package/dist/components/TagsField/index.js +1 -1
  409. package/dist/components/TextField/index.cjs +1 -1
  410. package/dist/components/TextField/index.js +1 -1
  411. package/dist/components/ThemeToggle/index.cjs +1 -1
  412. package/dist/components/ThemeToggle/index.js +1 -1
  413. package/dist/components/TimePicker/index.cjs +1 -1
  414. package/dist/components/TimePicker/index.js +1 -1
  415. package/dist/components/Timeline/index.cjs +1 -1
  416. package/dist/components/Timeline/index.js +1 -1
  417. package/dist/components/Toast/index.cjs +1 -1
  418. package/dist/components/Toast/index.js +1 -1
  419. package/dist/components/ToggleButton/index.cjs +1 -1
  420. package/dist/components/ToggleButton/index.js +1 -1
  421. package/dist/components/TranslatedFields/index.cjs +1 -1
  422. package/dist/components/TranslatedFields/index.js +1 -1
  423. package/dist/components/UserCard/index.cjs +1 -1
  424. package/dist/components/UserCard/index.js +1 -1
  425. package/dist/entries/app.cjs +1 -1
  426. package/dist/entries/app.js +1 -1
  427. package/dist/entries/auth.cjs +1 -1
  428. package/dist/entries/auth.js +2 -2
  429. package/dist/entries/components.cjs +1 -1
  430. package/dist/entries/components.js +157 -156
  431. package/dist/entries/i18n.cjs +1 -1
  432. package/dist/entries/i18n.js +2 -2
  433. package/dist/entries/icons.cjs +1 -1
  434. package/dist/entries/icons.js +1 -1
  435. package/dist/entries/theme.cjs +1 -1
  436. package/dist/entries/theme.js +1 -1
  437. package/dist/i18n/messages.d.cts +4 -0
  438. package/dist/i18n/messages.d.ts +4 -0
  439. package/dist/index.cjs +1 -1
  440. package/dist/index.css +1 -1
  441. package/dist/index.js +173 -172
  442. package/dist/{messages-DeQuvGln.js → messages-CZbb1xNN.js} +29 -15
  443. package/dist/messages-CZbb1xNN.js.map +1 -0
  444. package/dist/messages-D4ooXnUr.cjs +36 -0
  445. package/dist/messages-D4ooXnUr.cjs.map +1 -0
  446. package/dist/useHomeTo---51HTJ0.cjs +2 -0
  447. package/dist/useHomeTo---51HTJ0.cjs.map +1 -0
  448. package/dist/useHomeTo-CJj94TdV.js +10 -0
  449. package/dist/useHomeTo-CJj94TdV.js.map +1 -0
  450. package/dist/{useOptionMenu-6ZffgbYG.cjs → useOptionMenu-DS___46k.cjs} +2 -2
  451. package/dist/{useOptionMenu-6ZffgbYG.cjs.map → useOptionMenu-DS___46k.cjs.map} +1 -1
  452. package/dist/{useOptionMenu-CxM6FHXL.js → useOptionMenu-Sp2d3Bzi.js} +6 -6
  453. package/dist/{useOptionMenu-CxM6FHXL.js.map → useOptionMenu-Sp2d3Bzi.js.map} +1 -1
  454. package/package.json +1 -1
  455. package/dist/Icon-B7DJn8Tw.js.map +0 -1
  456. package/dist/Icon-CBg21lKA.cjs +0 -2
  457. package/dist/Icon-CBg21lKA.cjs.map +0 -1
  458. package/dist/Sidebar-CLr-DyQ_.js +0 -522
  459. package/dist/Sidebar-CLr-DyQ_.js.map +0 -1
  460. package/dist/Sidebar-CM-jZfj5.cjs +0 -2
  461. package/dist/Sidebar-CM-jZfj5.cjs.map +0 -1
  462. package/dist/messages-DeQuvGln.js.map +0 -1
  463. package/dist/messages-dL9MkVze.cjs +0 -36
  464. package/dist/messages-dL9MkVze.cjs.map +0 -1
  465. package/dist/useHomeTo-BLSvhJd5.js +0 -25
  466. package/dist/useHomeTo-BLSvhJd5.js.map +0 -1
  467. package/dist/useHomeTo-cXCg1tf0.cjs +0 -2
  468. package/dist/useHomeTo-cXCg1tf0.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown-D-D_Z1Jo.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import {\n cloneElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { List, type ListItemSize } from '../List'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Dropdown.module.css'\n\nexport type DropdownPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end'\n\ninterface Position {\n top: number\n left: number\n side: 'top' | 'bottom'\n maxHeight: number\n minWidth?: number\n}\n\nexport interface DropdownProps {\n /** The element that opens the menu (e.g. a `Button` / `IconButton`). Cloned to wire click + a11y. */\n trigger: ReactElement\n /** Menu content — typically `ListItem`s (composed inside a `role=\"menu\"` `List`). */\n children: ReactNode\n /** Preferred placement. Flips to the opposite side automatically when it would overflow. Default `bottom-start`. */\n placement?: DropdownPlacement\n /** Menu size — sets the panel min-width (`sm` 150 · `md` 190 · `lg` 220) and the items' density. Default `md`. */\n size?: ListItemSize\n /**\n * Apply the size-based min-width (`sm` 150 · `md` 190 · `lg` 220px). Defaults to `true`; set `false`\n * to let the menu size to its content instead (the items' density still tracks `size`).\n */\n minWidth?: boolean\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Close the menu when an item inside is clicked. Defaults to `true`. */\n closeOnSelect?: boolean\n /** Make the menu at least as wide as the trigger (select-like). Defaults to `false`. */\n matchTriggerWidth?: boolean\n /** Prevents opening. */\n disabled?: boolean\n /** Gap between the trigger and the menu, in px. Defaults to `6`. */\n offset?: number\n /** Class applied to the floating panel. */\n className?: string\n /** Style applied to the floating panel. */\n style?: CSSProperties\n}\n\n/** Distance the menu is kept from the viewport edges (px). */\nconst VIEWPORT_PADDING = 8\n/** Focusable menu items, used for arrow-key roving. */\nconst FOCUSABLE =\n '[role=\"menuitem\"],[role=\"button\"],a[href],button:not([disabled]),[tabindex]:not([tabindex=\"-1\"])'\n\nfunction focusableItems(panel: HTMLElement | null): HTMLElement[] {\n if (!panel) return []\n return Array.from(panel.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (el) => el.getAttribute('aria-disabled') !== 'true' && el.offsetParent !== null,\n )\n}\n\n/**\n * A floating menu anchored to a `trigger`. Opens on trigger click; closes on outside click, `Escape`,\n * or selecting an item. The panel is portaled to `document.body` and positioned with collision\n * handling — it **flips** to the opposite side when it would overflow, clamps within the viewport, and\n * re-positions on scroll/resize (a too-tall menu caps its height and scrolls). Arrow keys move between\n * items; `Escape` returns focus to the trigger. Compose `ListItem`s as `children`.\n */\nexport function Dropdown({\n trigger,\n children,\n placement = 'bottom-start',\n size = 'md',\n minWidth = true,\n open,\n defaultOpen = false,\n onOpenChange,\n closeOnSelect = true,\n matchTriggerWidth = false,\n disabled = false,\n offset = 6,\n className,\n style,\n}: DropdownProps) {\n const menuId = useId()\n const triggerRef = useRef<HTMLElement | null>(null)\n const panelRef = useRef<HTMLDivElement | null>(null)\n\n const isControlled = open !== undefined\n const [internalOpen, setInternalOpen] = useState(defaultOpen)\n const isOpen = isControlled ? open : internalOpen\n const [visible, setVisible] = useState(false)\n const [pos, setPos] = useState<Position | null>(null)\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next)\n onOpenChange?.(next)\n },\n [isControlled, onOpenChange],\n )\n const close = useCallback(() => setOpen(false), [setOpen])\n\n // lock page scroll while the menu is open (no scrollbar shift)\n useLockBodyScroll(isOpen)\n\n // ── positioning: flip when it would overflow, clamp inside the viewport ──\n const update = useCallback(() => {\n const triggerEl = triggerRef.current\n const panel = panelRef.current\n if (!triggerEl || !panel) return\n\n const rect = triggerEl.getBoundingClientRect()\n const panelW = panel.offsetWidth\n const panelH = panel.offsetHeight\n const vw = window.innerWidth\n const vh = window.innerHeight\n const pad = VIEWPORT_PADDING\n\n const spaceBelow = vh - rect.bottom - offset - pad\n const spaceAbove = rect.top - offset - pad\n let side: 'top' | 'bottom' = placement.startsWith('bottom') ? 'bottom' : 'top'\n // flip only when the preferred side can't fit AND the opposite side has more room\n if (side === 'bottom' && panelH > spaceBelow && spaceAbove > spaceBelow) side = 'top'\n else if (side === 'top' && panelH > spaceAbove && spaceBelow > spaceAbove) side = 'bottom'\n\n const available = side === 'bottom' ? spaceBelow : spaceAbove\n const maxHeight = Math.max(0, available)\n const usedH = Math.min(panelH, maxHeight)\n\n let top = side === 'bottom' ? rect.bottom + offset : rect.top - offset - usedH\n top = Math.min(Math.max(top, pad), Math.max(pad, vh - pad - usedH))\n\n let left = placement.endsWith('end') ? rect.right - panelW : rect.left\n left = Math.min(Math.max(left, pad), Math.max(pad, vw - pad - panelW))\n\n setPos({ top, left, side, maxHeight, minWidth: matchTriggerWidth ? rect.width : undefined })\n }, [placement, offset, matchTriggerWidth])\n\n // position synchronously before paint whenever the menu is open\n useLayoutEffect(() => {\n if (!isOpen) {\n setVisible(false)\n return\n }\n update()\n }, [isOpen, update])\n\n // enter transition + reposition listeners while open\n useEffect(() => {\n if (!isOpen) return\n const raf = requestAnimationFrame(() => setVisible(true))\n\n const onReposition = () => update()\n window.addEventListener('resize', onReposition)\n window.addEventListener('scroll', onReposition, true)\n let ro: ResizeObserver | undefined\n if (typeof ResizeObserver !== 'undefined') {\n ro = new ResizeObserver(onReposition)\n if (panelRef.current) ro.observe(panelRef.current)\n if (triggerRef.current) ro.observe(triggerRef.current)\n }\n\n return () => {\n cancelAnimationFrame(raf)\n window.removeEventListener('resize', onReposition)\n window.removeEventListener('scroll', onReposition, true)\n ro?.disconnect()\n }\n }, [isOpen, update])\n\n // outside click + keyboard (Escape, arrow roving)\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (event: PointerEvent) => {\n const target = event.target as Node\n if (triggerRef.current?.contains(target) || panelRef.current?.contains(target)) return\n close()\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault()\n close()\n triggerRef.current?.focus()\n } else if (event.key === 'Tab') {\n // Tab would move focus by portal DOM order (end of <body>), orphaning the open menu — close it\n // and let focus continue naturally from the trigger (Select/MultiSelect do the same)\n close()\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault()\n const items = focusableItems(panelRef.current)\n if (!items.length) return\n const current = items.indexOf(document.activeElement as HTMLElement)\n const delta = event.key === 'ArrowDown' ? 1 : -1\n const next = (current + delta + items.length) % items.length\n items[next]?.focus()\n }\n }\n document.addEventListener('pointerdown', onPointerDown, true)\n document.addEventListener('keydown', onKeyDown)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown, true)\n document.removeEventListener('keydown', onKeyDown)\n }\n }, [isOpen, close])\n\n // focus the first item once the menu is open and positioned\n useEffect(() => {\n if (!isOpen) return\n const raf = requestAnimationFrame(() => focusableItems(panelRef.current)[0]?.focus())\n return () => cancelAnimationFrame(raf)\n }, [isOpen])\n\n const triggerProps = trigger.props as {\n onClick?: (event: ReactMouseEvent) => void\n onKeyDown?: (event: ReactKeyboardEvent) => void\n ref?: Ref<HTMLElement>\n }\n const originalRef = triggerProps.ref\n\n const clonedTrigger = cloneElement(trigger as ReactElement<Record<string, unknown>>, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node\n if (typeof originalRef === 'function') originalRef(node)\n else if (originalRef) (originalRef as { current: HTMLElement | null }).current = node\n },\n onClick: (event: ReactMouseEvent) => {\n triggerProps.onClick?.(event)\n if (!disabled) setOpen(!isOpen)\n },\n onKeyDown: (event: ReactKeyboardEvent) => {\n triggerProps.onKeyDown?.(event)\n stopEscape(event)\n },\n 'aria-haspopup': 'menu',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? menuId : undefined,\n })\n\n // Escape while the menu is open closes THIS menu only — stopped here so it can't bubble (through the React\n // tree; the panel is portaled) to an enclosing Modal / drawer / editor Overlay and dismiss that too.\n // Stopping it also keeps it from the document listener above, hence the explicit close.\n const stopEscape = (event: ReactKeyboardEvent) => {\n if (event.key !== 'Escape' || !isOpen) return\n event.stopPropagation()\n event.preventDefault()\n close()\n triggerRef.current?.focus()\n }\n\n const handlePanelClick = (event: ReactMouseEvent) => {\n if (!closeOnSelect) return\n const item = (event.target as HTMLElement).closest(FOCUSABLE)\n if (item && item.getAttribute('aria-disabled') !== 'true') {\n close()\n triggerRef.current?.focus()\n }\n }\n\n return (\n <>\n {clonedTrigger}\n {isOpen &&\n createPortal(\n <div\n ref={panelRef}\n id={menuId}\n className={clsx(styles.panel, minWidth && styles[size], className)}\n data-open={visible ? 'true' : 'false'}\n data-side={pos?.side ?? 'bottom'}\n style={{\n position: 'fixed',\n top: pos?.top ?? 0,\n left: pos?.left ?? 0,\n maxHeight: pos?.maxHeight,\n minWidth: pos?.minWidth,\n visibility: pos ? 'visible' : 'hidden',\n ...style,\n }}\n onClick={handlePanelClick}\n onKeyDown={stopEscape}\n >\n <List role=\"menu\" size={size} padding=\"xs\">\n {children}\n </List>\n </div>,\n document.body,\n )}\n </>\n )\n}\n"],"names":["VIEWPORT_PADDING","FOCUSABLE","focusableItems","panel","el","Dropdown","trigger","children","placement","size","minWidth","open","defaultOpen","onOpenChange","closeOnSelect","matchTriggerWidth","disabled","offset","className","style","menuId","useId","triggerRef","useRef","panelRef","isControlled","internalOpen","setInternalOpen","useState","isOpen","visible","setVisible","pos","setPos","setOpen","useCallback","next","close","useLockBodyScroll","update","triggerEl","rect","panelW","panelH","vw","vh","pad","spaceBelow","spaceAbove","side","maxHeight","usedH","top","left","useLayoutEffect","useEffect","raf","onReposition","ro","onPointerDown","event","target","_a","_b","onKeyDown","items","current","delta","triggerProps","originalRef","clonedTrigger","cloneElement","node","stopEscape","handlePanelClick","item","jsxs","Fragment","createPortal","jsx","clsx","styles","List"],"mappings":";;;;;;;;;;;GAkEMA,KAAmB,GAEnBC,IACJ;AAEF,SAASC,EAAeC,GAA0C;AAChE,SAAKA,IACE,MAAM,KAAKA,EAAM,iBAA8BF,CAAS,CAAC,EAAE;AAAA,IAChE,CAACG,MAAOA,EAAG,aAAa,eAAe,MAAM,UAAUA,EAAG,iBAAiB;AAAA,EAAA,IAF1D,CAAA;AAIrB;AASO,SAASC,GAAS;AAAA,EACvB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,UAAAC,IA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IACAzC,KACCiD;AAAA,MACE,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAKvD;AAAA,UACL,IAAIJ;AAAA,UACJ,WAAW4D,GAAKC,EAAO,OAAOvE,KAAYuE,EAAOxE,CAAI,GAAGS,CAAS;AAAA,UACjE,aAAWY,IAAU,SAAS;AAAA,UAC9B,cAAWE,KAAA,gBAAAA,EAAK,SAAQ;AAAA,UACxB,OAAO;AAAA,YACL,UAAU;AAAA,YACV,MAAKA,KAAA,gBAAAA,EAAK,QAAO;AAAA,YACjB,OAAMA,KAAA,gBAAAA,EAAK,SAAQ;AAAA,YACnB,WAAWA,KAAA,gBAAAA,EAAK;AAAA,YAChB,UAAUA,KAAA,gBAAAA,EAAK;AAAA,YACf,YAAYA,IAAM,YAAY;AAAA,YAC9B,GAAGb;AAAA,UAAA;AAAA,UAEL,SAASuD;AAAA,UACT,WAAWD;AAAA,UAEX,4BAACS,IAAA,EAAK,MAAK,QAAO,MAAAzE,GAAY,SAAQ,MACnC,UAAAF,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAEF,SAAS;AAAA,IAAA;AAAA,EACX,GACJ;AAEJ;"}
1
+ {"version":3,"file":"Dropdown-iWbHokT7.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["import {\n cloneElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { List, type ListItemSize } from '../List'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Dropdown.module.css'\n\nexport type DropdownPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end'\n\ninterface Position {\n top: number\n left: number\n side: 'top' | 'bottom'\n maxHeight: number\n minWidth?: number\n}\n\nexport interface DropdownProps {\n /** The element that opens the menu (e.g. a `Button` / `IconButton`). Cloned to wire click + a11y. */\n trigger: ReactElement\n /** Menu content — typically `ListItem`s (composed inside a `role=\"menu\"` `List`). */\n children: ReactNode\n /** Preferred placement. Flips to the opposite side automatically when it would overflow. Default `bottom-start`. */\n placement?: DropdownPlacement\n /** Menu size — sets the panel min-width (`sm` 150 · `md` 190 · `lg` 220) and the items' density. Default `md`. */\n size?: ListItemSize\n /**\n * Apply the size-based min-width (`sm` 150 · `md` 190 · `lg` 220px). Defaults to `true`; set `false`\n * to let the menu size to its content instead (the items' density still tracks `size`).\n */\n minWidth?: boolean\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Close the menu when an item inside is clicked. Defaults to `true`. */\n closeOnSelect?: boolean\n /** Make the menu at least as wide as the trigger (select-like). Defaults to `false`. */\n matchTriggerWidth?: boolean\n /** Prevents opening. */\n disabled?: boolean\n /** Gap between the trigger and the menu, in px. Defaults to `6`. */\n offset?: number\n /** Class applied to the floating panel. */\n className?: string\n /** Style applied to the floating panel. */\n style?: CSSProperties\n}\n\n/** Distance the menu is kept from the viewport edges (px). */\nconst VIEWPORT_PADDING = 8\n/** Focusable menu items, used for arrow-key roving. */\nconst FOCUSABLE =\n '[role=\"menuitem\"],[role=\"button\"],a[href],button:not([disabled]),[tabindex]:not([tabindex=\"-1\"])'\n\nfunction focusableItems(panel: HTMLElement | null): HTMLElement[] {\n if (!panel) return []\n return Array.from(panel.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (el) => el.getAttribute('aria-disabled') !== 'true' && el.offsetParent !== null,\n )\n}\n\n/**\n * A floating menu anchored to a `trigger`. Opens on trigger click; closes on outside click, `Escape`,\n * or selecting an item. The panel is portaled to `document.body` and positioned with collision\n * handling — it **flips** to the opposite side when it would overflow, clamps within the viewport, and\n * re-positions on scroll/resize (a too-tall menu caps its height and scrolls). Arrow keys move between\n * items; `Escape` returns focus to the trigger. Compose `ListItem`s as `children`.\n */\nexport function Dropdown({\n trigger,\n children,\n placement = 'bottom-start',\n size = 'md',\n minWidth = true,\n open,\n defaultOpen = false,\n onOpenChange,\n closeOnSelect = true,\n matchTriggerWidth = false,\n disabled = false,\n offset = 6,\n className,\n style,\n}: DropdownProps) {\n const menuId = useId()\n const triggerRef = useRef<HTMLElement | null>(null)\n const panelRef = useRef<HTMLDivElement | null>(null)\n\n const isControlled = open !== undefined\n const [internalOpen, setInternalOpen] = useState(defaultOpen)\n const isOpen = isControlled ? open : internalOpen\n const [visible, setVisible] = useState(false)\n const [pos, setPos] = useState<Position | null>(null)\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next)\n onOpenChange?.(next)\n },\n [isControlled, onOpenChange],\n )\n const close = useCallback(() => setOpen(false), [setOpen])\n\n // lock page scroll while the menu is open (no scrollbar shift)\n useLockBodyScroll(isOpen)\n\n // ── positioning: flip when it would overflow, clamp inside the viewport ──\n const update = useCallback(() => {\n const triggerEl = triggerRef.current\n const panel = panelRef.current\n if (!triggerEl || !panel) return\n\n const rect = triggerEl.getBoundingClientRect()\n const panelW = panel.offsetWidth\n const panelH = panel.offsetHeight\n const vw = window.innerWidth\n const vh = window.innerHeight\n const pad = VIEWPORT_PADDING\n\n const spaceBelow = vh - rect.bottom - offset - pad\n const spaceAbove = rect.top - offset - pad\n let side: 'top' | 'bottom' = placement.startsWith('bottom') ? 'bottom' : 'top'\n // flip only when the preferred side can't fit AND the opposite side has more room\n if (side === 'bottom' && panelH > spaceBelow && spaceAbove > spaceBelow) side = 'top'\n else if (side === 'top' && panelH > spaceAbove && spaceBelow > spaceAbove) side = 'bottom'\n\n const available = side === 'bottom' ? spaceBelow : spaceAbove\n const maxHeight = Math.max(0, available)\n const usedH = Math.min(panelH, maxHeight)\n\n let top = side === 'bottom' ? rect.bottom + offset : rect.top - offset - usedH\n top = Math.min(Math.max(top, pad), Math.max(pad, vh - pad - usedH))\n\n let left = placement.endsWith('end') ? rect.right - panelW : rect.left\n left = Math.min(Math.max(left, pad), Math.max(pad, vw - pad - panelW))\n\n setPos({ top, left, side, maxHeight, minWidth: matchTriggerWidth ? rect.width : undefined })\n }, [placement, offset, matchTriggerWidth])\n\n // position synchronously before paint whenever the menu is open\n useLayoutEffect(() => {\n if (!isOpen) {\n setVisible(false)\n return\n }\n update()\n }, [isOpen, update])\n\n // enter transition + reposition listeners while open\n useEffect(() => {\n if (!isOpen) return\n const raf = requestAnimationFrame(() => setVisible(true))\n\n const onReposition = () => update()\n window.addEventListener('resize', onReposition)\n window.addEventListener('scroll', onReposition, true)\n let ro: ResizeObserver | undefined\n if (typeof ResizeObserver !== 'undefined') {\n ro = new ResizeObserver(onReposition)\n if (panelRef.current) ro.observe(panelRef.current)\n if (triggerRef.current) ro.observe(triggerRef.current)\n }\n\n return () => {\n cancelAnimationFrame(raf)\n window.removeEventListener('resize', onReposition)\n window.removeEventListener('scroll', onReposition, true)\n ro?.disconnect()\n }\n }, [isOpen, update])\n\n // outside click + keyboard (Escape, arrow roving)\n useEffect(() => {\n if (!isOpen) return\n const onPointerDown = (event: PointerEvent) => {\n const target = event.target as Node\n if (triggerRef.current?.contains(target) || panelRef.current?.contains(target)) return\n close()\n }\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault()\n close()\n triggerRef.current?.focus()\n } else if (event.key === 'Tab') {\n // Tab would move focus by portal DOM order (end of <body>), orphaning the open menu — close it\n // and let focus continue naturally from the trigger (Select/MultiSelect do the same)\n close()\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault()\n const items = focusableItems(panelRef.current)\n if (!items.length) return\n const current = items.indexOf(document.activeElement as HTMLElement)\n const delta = event.key === 'ArrowDown' ? 1 : -1\n const next = (current + delta + items.length) % items.length\n items[next]?.focus()\n }\n }\n document.addEventListener('pointerdown', onPointerDown, true)\n document.addEventListener('keydown', onKeyDown)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown, true)\n document.removeEventListener('keydown', onKeyDown)\n }\n }, [isOpen, close])\n\n // focus the first item once the menu is open and positioned\n useEffect(() => {\n if (!isOpen) return\n const raf = requestAnimationFrame(() => focusableItems(panelRef.current)[0]?.focus())\n return () => cancelAnimationFrame(raf)\n }, [isOpen])\n\n const triggerProps = trigger.props as {\n onClick?: (event: ReactMouseEvent) => void\n onKeyDown?: (event: ReactKeyboardEvent) => void\n ref?: Ref<HTMLElement>\n }\n const originalRef = triggerProps.ref\n\n const clonedTrigger = cloneElement(trigger as ReactElement<Record<string, unknown>>, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node\n if (typeof originalRef === 'function') originalRef(node)\n else if (originalRef) (originalRef as { current: HTMLElement | null }).current = node\n },\n onClick: (event: ReactMouseEvent) => {\n triggerProps.onClick?.(event)\n if (!disabled) setOpen(!isOpen)\n },\n onKeyDown: (event: ReactKeyboardEvent) => {\n triggerProps.onKeyDown?.(event)\n stopEscape(event)\n },\n 'aria-haspopup': 'menu',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? menuId : undefined,\n })\n\n // Escape while the menu is open closes THIS menu only — stopped here so it can't bubble (through the React\n // tree; the panel is portaled) to an enclosing Modal / drawer / editor Overlay and dismiss that too.\n // Stopping it also keeps it from the document listener above, hence the explicit close.\n const stopEscape = (event: ReactKeyboardEvent) => {\n if (event.key !== 'Escape' || !isOpen) return\n event.stopPropagation()\n event.preventDefault()\n close()\n triggerRef.current?.focus()\n }\n\n const handlePanelClick = (event: ReactMouseEvent) => {\n if (!closeOnSelect) return\n const item = (event.target as HTMLElement).closest(FOCUSABLE)\n if (item && item.getAttribute('aria-disabled') !== 'true') {\n close()\n triggerRef.current?.focus()\n }\n }\n\n return (\n <>\n {clonedTrigger}\n {isOpen &&\n createPortal(\n <div\n ref={panelRef}\n id={menuId}\n className={clsx(styles.panel, minWidth && styles[size], className)}\n data-open={visible ? 'true' : 'false'}\n data-side={pos?.side ?? 'bottom'}\n style={{\n position: 'fixed',\n top: pos?.top ?? 0,\n left: pos?.left ?? 0,\n maxHeight: pos?.maxHeight,\n minWidth: pos?.minWidth,\n visibility: pos ? 'visible' : 'hidden',\n ...style,\n }}\n onClick={handlePanelClick}\n onKeyDown={stopEscape}\n >\n <List role=\"menu\" size={size} padding=\"xs\">\n {children}\n </List>\n </div>,\n document.body,\n )}\n </>\n )\n}\n"],"names":["VIEWPORT_PADDING","FOCUSABLE","focusableItems","panel","el","Dropdown","trigger","children","placement","size","minWidth","open","defaultOpen","onOpenChange","closeOnSelect","matchTriggerWidth","disabled","offset","className","style","menuId","useId","triggerRef","useRef","panelRef","isControlled","internalOpen","setInternalOpen","useState","isOpen","visible","setVisible","pos","setPos","setOpen","useCallback","next","close","useLockBodyScroll","update","triggerEl","rect","panelW","panelH","vw","vh","pad","spaceBelow","spaceAbove","side","maxHeight","usedH","top","left","useLayoutEffect","useEffect","raf","onReposition","ro","onPointerDown","event","target","_a","_b","onKeyDown","items","current","delta","triggerProps","originalRef","clonedTrigger","cloneElement","node","stopEscape","handlePanelClick","item","jsxs","Fragment","createPortal","jsx","clsx","styles","List"],"mappings":";;;;;;;;;;;GAkEMA,KAAmB,GAEnBC,IACJ;AAEF,SAASC,EAAeC,GAA0C;AAChE,SAAKA,IACE,MAAM,KAAKA,EAAM,iBAA8BF,CAAS,CAAC,EAAE;AAAA,IAChE,CAACG,MAAOA,EAAG,aAAa,eAAe,MAAM,UAAUA,EAAG,iBAAiB;AAAA,EAAA,IAF1D,CAAA;AAIrB;AASO,SAASC,GAAS;AAAA,EACvB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,mBAAAC,IAAoB;AAAA,EACp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AO,OAAOvE,KAAYuE,EAAOxE,CAAI,GAAGS,CAAS;AAAA,UACjE,aAAWY,IAAU,SAAS;AAAA,UAC9B,cAAWE,KAAA,gBAAAA,EAAK,SAAQ;AAAA,UACxB,OAAO;AAAA,YACL,UAAU;AAAA,YACV,MAAKA,KAAA,gBAAAA,EAAK,QAAO;AAAA,YACjB,OAAMA,KAAA,gBAAAA,EAAK,SAAQ;AAAA,YACnB,WAAWA,KAAA,gBAAAA,EAAK;AAAA,YAChB,UAAUA,KAAA,gBAAAA,EAAK;AAAA,YACf,YAAYA,IAAM,YAAY;AAAA,YAC9B,GAAGb;AAAA,UAAA;AAAA,UAEL,SAASuD;AAAA,UACT,WAAWD;AAAA,UAEX,4BAACS,IAAA,EAAK,MAAK,QAAO,MAAAzE,GAAY,SAAQ,MACnC,UAAAF,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,MAEF,SAAS;AAAA,IAAA;AAAA,EACX,GACJ;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),S=require("react"),N=require("clsx"),c=require("./Icon-CBg21lKA.cjs"),j=require("./ConfigProvider-CYSpuSMJ.cjs"),g="_emptyState_1vpxy_3",h="_sm_1vpxy_17",f="_md_1vpxy_23",E="_lg_1vpxy_29",I="_icon_1vpxy_37",q="_title_1vpxy_55",b="_description_1vpxy_61",C="_action_1vpxy_70",O="_pattern_1vpxy_77",T="_tinted_1vpxy_100",t={emptyState:g,sm:h,md:f,lg:E,icon:I,title:q,description:b,action:C,pattern:O,tinted:T},w=new Set(c.ICON_NAMES),z=S.forwardRef(function({icon:n,title:_,description:i,action:r,size:d="md",pattern:p=!0,color:s,className:m,style:l,children:x,...y},u){const v=j.useT(),o=_??v("emptyState.title"),a=n===!1?null:n==null?e.jsx(c.Icon,{name:"FolderOpen"}):typeof n=="string"&&w.has(n)?e.jsx(c.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)`,...l}:l,...y,children:[a!=null&&e.jsx("div",{className:t.icon,"aria-hidden":!0,children:a}),o!=null&&e.jsx("div",{className:t.title,children:o}),i!=null&&e.jsx("div",{className:t.description,children:i}),r!=null&&e.jsx("div",{className:t.action,children:r}),x]})});exports.EmptyState=z;
2
- //# sourceMappingURL=EmptyState-BM5LrRLq.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),S=require("react"),N=require("clsx"),c=require("./Icon-BoQmbW7j.cjs"),j=require("./ConfigProvider-BFhkb0BV.cjs"),g="_emptyState_1vpxy_3",h="_sm_1vpxy_17",f="_md_1vpxy_23",E="_lg_1vpxy_29",I="_icon_1vpxy_37",q="_title_1vpxy_55",b="_description_1vpxy_61",C="_action_1vpxy_70",O="_pattern_1vpxy_77",T="_tinted_1vpxy_100",t={emptyState:g,sm:h,md:f,lg:E,icon:I,title:q,description:b,action:C,pattern:O,tinted:T},w=new Set(c.ICON_NAMES),z=S.forwardRef(function({icon:n,title:_,description:i,action:r,size:d="md",pattern:p=!0,color:s,className:m,style:l,children:x,...y},u){const v=j.useT(),o=_??v("emptyState.title"),a=n===!1?null:n==null?e.jsx(c.Icon,{name:"FolderOpen"}):typeof n=="string"&&w.has(n)?e.jsx(c.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)`,...l}:l,...y,children:[a!=null&&e.jsx("div",{className:t.icon,"aria-hidden":!0,children:a}),o!=null&&e.jsx("div",{className:t.title,children:o}),i!=null&&e.jsx("div",{className:t.description,children:i}),r!=null&&e.jsx("div",{className:t.action,children:r}),x]})});exports.EmptyState=z;
2
+ //# sourceMappingURL=EmptyState-BzwrOICc.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState-BM5LrRLq.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":"ycASMA,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-BzwrOICc.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":"ycASMA,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,8 +1,8 @@
1
1
  import { jsx as n, jsxs as f } from "react/jsx-runtime";
2
2
  import { forwardRef as S } from "react";
3
3
  import { clsx as N } from "clsx";
4
- import { b as c, a as h } from "./Icon-B7DJn8Tw.js";
5
- import { a as g } from "./ConfigProvider-DtyUlWk6.js";
4
+ import { b as c, a as h } from "./Icon-DMMO32p6.js";
5
+ import { a as g } from "./ConfigProvider-bXX8dnhY.js";
6
6
  const E = "_emptyState_1vpxy_3", b = "_sm_1vpxy_17", I = "_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 = {
7
7
  emptyState: E,
8
8
  sm: b,
@@ -54,4 +54,4 @@ const E = "_emptyState_1vpxy_3", b = "_sm_1vpxy_17", I = "_md_1vpxy_23", O = "_l
54
54
  export {
55
55
  D as E
56
56
  };
57
- //# sourceMappingURL=EmptyState-DrSj2XV_.js.map
57
+ //# sourceMappingURL=EmptyState-CmcjJl_K.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState-DrSj2XV_.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;AAA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{ 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,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),c=require("react"),u=require("./ErrorState-BThPIYaM.cjs"),h=require("./ConfigProvider-CYSpuSMJ.cjs"),l=c.forwardRef(function({error:r,fallback:t,description:s,compact:o=!0,...a},p){return r==null||r===!1?null:n.jsx(u.ErrorState,{ref:p,error:r,description:s??t,compact:o,...a})}),d=(e=[],r=[])=>e.length!==r.length||e.some((t,s)=>!Object.is(t,r[s])),i=e=>e instanceof Error?e:new Error(String(e));function f({error:e,reset:r}){const t=h.useT();return n.jsx(u.ErrorState,{variant:"block",error:e,description:t("errorState.description"),onRetry:r})}class E extends c.Component{constructor(){super(...arguments),this.state={error:null},this.reset=()=>{var r,t;this.setState({error:null}),(t=(r=this.props).onReset)==null||t.call(r)}}static getDerivedStateFromError(r){return{error:i(r)}}componentDidCatch(r,t){var s,o;(o=(s=this.props).onError)==null||o.call(s,i(r),t)}componentDidUpdate(r,t){this.state.error&&t.error&&d(r.resetKeys,this.props.resetKeys)&&this.reset()}render(){const{error:r}=this.state;if(!r)return this.props.children;const{fallback:t}=this.props;return typeof t=="function"?t(r,this.reset):t!==void 0?t:n.jsx(f,{error:r,reset:this.reset})}}exports.ErrorBoundary=E;exports.QueryError=l;
2
- //# sourceMappingURL=ErrorBoundary-yz669VEu.cjs.map
1
+ "use strict";const n=require("react/jsx-runtime"),c=require("react"),u=require("./ErrorState-CzWz5UcX.cjs"),h=require("./ConfigProvider-BFhkb0BV.cjs"),l=c.forwardRef(function({error:r,fallback:t,description:s,compact:o=!0,...a},p){return r==null||r===!1?null:n.jsx(u.ErrorState,{ref:p,error:r,description:s??t,compact:o,...a})}),d=(e=[],r=[])=>e.length!==r.length||e.some((t,s)=>!Object.is(t,r[s])),i=e=>e instanceof Error?e:new Error(String(e));function f({error:e,reset:r}){const t=h.useT();return n.jsx(u.ErrorState,{variant:"block",error:e,description:t("errorState.description"),onRetry:r})}class E extends c.Component{constructor(){super(...arguments),this.state={error:null},this.reset=()=>{var r,t;this.setState({error:null}),(t=(r=this.props).onReset)==null||t.call(r)}}static getDerivedStateFromError(r){return{error:i(r)}}componentDidCatch(r,t){var s,o;(o=(s=this.props).onError)==null||o.call(s,i(r),t)}componentDidUpdate(r,t){this.state.error&&t.error&&d(r.resetKeys,this.props.resetKeys)&&this.reset()}render(){const{error:r}=this.state;if(!r)return this.props.children;const{fallback:t}=this.props;return typeof t=="function"?t(r,this.reset):t!==void 0?t:n.jsx(f,{error:r,reset:this.reset})}}exports.ErrorBoundary=E;exports.QueryError=l;
2
+ //# sourceMappingURL=ErrorBoundary-BcZgeSsu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary-yz669VEu.cjs","sources":["../src/components/ErrorState/QueryError.tsx","../src/components/ErrorState/ErrorBoundary.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { ErrorState, type ErrorStateProps } from './ErrorState'\n\nexport interface QueryErrorProps extends ErrorStateProps {\n /** The query's error (`query.error`). `null` / `undefined` → renders nothing. */\n error: unknown\n /**\n * The user-facing sentence (\"Could not load players.\"). Shown instead of the raw message, which then\n * only appears in the Details dialog's dev dump. Same as `description`, which wins when both are set.\n */\n fallback?: ReactNode\n}\n\n/**\n * The react-query-style one-liner: `<QueryError error={users.error} onRetry={users.refetch}\n * fallback=\"Could not load players.\" />`. Renders nothing while `error` is empty, otherwise an\n * `ErrorState` — an alert banner by default; with `variant=\"block\"` it's **compact by default** (pass\n * `compact={false}` for the hero). Everything else passes through to `ErrorState`.\n */\nexport const QueryError = forwardRef<HTMLDivElement, QueryErrorProps>(function QueryError(\n { error, fallback, description, compact = true, ...props },\n ref,\n) {\n if (error == null || error === false) return null\n return (\n <ErrorState\n ref={ref}\n error={error}\n description={description ?? fallback}\n compact={compact}\n {...props}\n />\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 (\n <ErrorState\n variant=\"block\"\n error={error}\n description={t('errorState.description')}\n onRetry={reset}\n />\n )\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":["QueryError","forwardRef","error","fallback","description","compact","props","ref","jsx","ErrorState","keysChanged","a","b","v","i","toError","value","DefaultFallback","reset","useT","ErrorBoundary","Component","_b","_a","info","prev","prevState"],"mappings":"uJAmBaA,EAAaC,EAAAA,WAA4C,SACpE,CAAE,MAAAC,EAAO,SAAAC,EAAU,YAAAC,EAAa,QAAAC,EAAU,GAAM,GAAGC,CAAA,EACnDC,EACA,CACA,OAAIL,GAAS,MAAQA,IAAU,GAAc,KAE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A,EAAO,OAAO,KAAK,MAAM,SAC9B,KAAM,CAAE,SAAAC,GAAa,KAAK,MAC1B,OAAI,OAAOA,GAAa,WAAmBA,EAASD,EAAO,KAAK,KAAK,EACjEC,IAAa,OAAkBA,EAC5BK,EAAAA,IAACS,EAAA,CAAgB,MAAAf,EAAc,MAAO,KAAK,MAAO,CAC3D,CACF"}
1
+ {"version":3,"file":"ErrorBoundary-BcZgeSsu.cjs","sources":["../src/components/ErrorState/QueryError.tsx","../src/components/ErrorState/ErrorBoundary.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { ErrorState, type ErrorStateProps } from './ErrorState'\n\nexport interface QueryErrorProps extends ErrorStateProps {\n /** The query's error (`query.error`). `null` / `undefined` → renders nothing. */\n error: unknown\n /**\n * The user-facing sentence (\"Could not load players.\"). Shown instead of the raw message, which then\n * only appears in the Details dialog's dev dump. Same as `description`, which wins when both are set.\n */\n fallback?: ReactNode\n}\n\n/**\n * The react-query-style one-liner: `<QueryError error={users.error} onRetry={users.refetch}\n * fallback=\"Could not load players.\" />`. Renders nothing while `error` is empty, otherwise an\n * `ErrorState` — an alert banner by default; with `variant=\"block\"` it's **compact by default** (pass\n * `compact={false}` for the hero). Everything else passes through to `ErrorState`.\n */\nexport const QueryError = forwardRef<HTMLDivElement, QueryErrorProps>(function QueryError(\n { error, fallback, description, compact = true, ...props },\n ref,\n) {\n if (error == null || error === false) return null\n return (\n <ErrorState\n ref={ref}\n error={error}\n description={description ?? fallback}\n compact={compact}\n {...props}\n />\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 (\n <ErrorState\n variant=\"block\"\n error={error}\n description={t('errorState.description')}\n onRetry={reset}\n />\n )\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":["QueryError","forwardRef","error","fallback","description","compact","props","ref","jsx","ErrorState","keysChanged","a","b","v","i","toError","value","DefaultFallback","reset","useT","ErrorBoundary","Component","_b","_a","info","prev","prevState"],"mappings":"uJAmBaA,EAAaC,EAAAA,WAA4C,SACpE,CAAE,MAAAC,EAAO,SAAAC,EAAU,YAAAC,EAAa,QAAAC,EAAU,GAAM,GAAGC,CAAA,EACnDC,EACA,CACA,OAAIL,GAAS,MAAQA,IAAU,GAAc,KAE3CM,EAAAA,IAACC,EAAAA,WAAA,CACC,IAAAF,EACA,MAAAL,EACA,YAAaE,GAAeD,EAC5B,QAAAE,EACC,GAAGC,CAAA,CAAA,CAGV,CAAC,ECVKI,EAAc,CAACC,EAAe,CAAA,EAAIC,EAAe,CAAA,IACrDD,EAAE,SAAWC,EAAE,QAAUD,EAAE,KAAK,CAACE,EAAGC,IAAM,CAAC,OAAO,GAAGD,EAAGD,EAAEE,CAAC,CAAC,CAAC,EAEzDC,EAAWC,GAAoBA,aAAiB,MAAQA,EAAQ,IAAI,MAAM,OAAOA,CAAK,CAAC,EAG7F,SAASC,EAAgB,CAAE,MAAAf,EAAO,MAAAgB,GAA8C,CAC9E,MAAM,EAAIC,EAAAA,KAAA,EAGV,OACEX,EAAAA,IAACC,EAAAA,WAAA,CACC,QAAQ,QACR,MAAAP,EACA,YAAa,EAAE,wBAAwB,EACvC,QAASgB,CAAA,CAAA,CAGf,CAUO,MAAME,UAAsBC,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,GAC7BC,GAAAC,EAAA,KAAK,OAAM,UAAX,MAAAD,EAAA,KAAAC,EACF,CAAA,CAnBA,OAAO,yBAAyBrB,EAAoC,CAClE,MAAO,CAAE,MAAOa,EAAQb,CAAK,CAAA,CAC/B,CAEA,kBAAkBA,EAAgBsB,EAAiB,UACjDF,GAAAC,EAAA,KAAK,OAAM,UAAX,MAAAD,EAAA,KAAAC,EAAqBR,EAAQb,CAAK,EAAGsB,EACvC,CAEA,mBAAmBC,EAA0BC,EAA+B,CAGtE,KAAK,MAAM,OAASA,EAAU,OAAShB,EAAYe,EAAK,UAAW,KAAK,MAAM,SAAS,GACzF,KAAK,MAAA,CAET,CAOA,QAAS,CACP,KAAM,CAAE,MAAAvB,GAAU,KAAK,MACvB,GAAI,CAACA,EAAO,OAAO,KAAK,MAAM,SAC9B,KAAM,CAAE,SAAAC,GAAa,KAAK,MAC1B,OAAI,OAAOA,GAAa,WAAmBA,EAASD,EAAO,KAAK,KAAK,EACjEC,IAAa,OAAkBA,EAC5BK,EAAAA,IAACS,EAAA,CAAgB,MAAAf,EAAc,MAAO,KAAK,MAAO,CAC3D,CACF"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as u, Component as f } from "react";
3
- import { E as a } from "./ErrorState-DEngucdq.js";
4
- import { a as h } from "./ConfigProvider-DtyUlWk6.js";
3
+ import { E as a } from "./ErrorState-EjIhdq7S.js";
4
+ import { a as h } from "./ConfigProvider-bXX8dnhY.js";
5
5
  const S = u(function({ error: r, fallback: t, description: o, compact: s = !0, ...c }, p) {
6
6
  return r == null || r === !1 ? null : /* @__PURE__ */ n(
7
7
  a,
@@ -54,4 +54,4 @@ export {
54
54
  k as E,
55
55
  S as Q
56
56
  };
57
- //# sourceMappingURL=ErrorBoundary-DsP4hO_V.js.map
57
+ //# sourceMappingURL=ErrorBoundary-TfeJetWc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary-DsP4hO_V.js","sources":["../src/components/ErrorState/QueryError.tsx","../src/components/ErrorState/ErrorBoundary.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { ErrorState, type ErrorStateProps } from './ErrorState'\n\nexport interface QueryErrorProps extends ErrorStateProps {\n /** The query's error (`query.error`). `null` / `undefined` → renders nothing. */\n error: unknown\n /**\n * The user-facing sentence (\"Could not load players.\"). Shown instead of the raw message, which then\n * only appears in the Details dialog's dev dump. Same as `description`, which wins when both are set.\n */\n fallback?: ReactNode\n}\n\n/**\n * The react-query-style one-liner: `<QueryError error={users.error} onRetry={users.refetch}\n * fallback=\"Could not load players.\" />`. Renders nothing while `error` is empty, otherwise an\n * `ErrorState` — an alert banner by default; with `variant=\"block\"` it's **compact by default** (pass\n * `compact={false}` for the hero). Everything else passes through to `ErrorState`.\n */\nexport const QueryError = forwardRef<HTMLDivElement, QueryErrorProps>(function QueryError(\n { error, fallback, description, compact = true, ...props },\n ref,\n) {\n if (error == null || error === false) return null\n return (\n <ErrorState\n ref={ref}\n error={error}\n description={description ?? fallback}\n compact={compact}\n {...props}\n />\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 (\n <ErrorState\n variant=\"block\"\n error={error}\n description={t('errorState.description')}\n onRetry={reset}\n />\n )\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":["QueryError","forwardRef","error","fallback","description","compact","props","ref","jsx","ErrorState","keysChanged","a","b","v","i","toError","value","DefaultFallback","reset","useT","ErrorBoundary","Component","_b","_a","info","prev","prevState"],"mappings":";;;;AAmBO,MAAMA,IAAaC,EAA4C,SACpE,EAAE,OAAA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AAA,KAAAC,GAAqBR,EAAQb,CAAK,GAAGsB;AAAA,EACvC;AAAA,EAEA,mBAAmBC,GAA0BC,GAA+B;AAG1E,IAAI,KAAK,MAAM,SAASA,EAAU,SAAShB,EAAYe,EAAK,WAAW,KAAK,MAAM,SAAS,KACzF,KAAK,MAAA;AAAA,EAET;AAAA,EAOA,SAAS;AACP,UAAM,EAAE,OAAAvB,MAAU,KAAK;AACvB,QAAI,CAACA,EAAO,QAAO,KAAK,MAAM;AAC9B,UAAM,EAAE,UAAAC,MAAa,KAAK;AAC1B,WAAI,OAAOA,KAAa,aAAmBA,EAASD,GAAO,KAAK,KAAK,IACjEC,MAAa,SAAkBA,IAC5B,gBAAAK,EAACS,GAAA,EAAgB,OAAAf,GAAc,OAAO,KAAK,OAAO;AAAA,EAC3D;AACF;"}
1
+ {"version":3,"file":"ErrorBoundary-TfeJetWc.js","sources":["../src/components/ErrorState/QueryError.tsx","../src/components/ErrorState/ErrorBoundary.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { ErrorState, type ErrorStateProps } from './ErrorState'\n\nexport interface QueryErrorProps extends ErrorStateProps {\n /** The query's error (`query.error`). `null` / `undefined` → renders nothing. */\n error: unknown\n /**\n * The user-facing sentence (\"Could not load players.\"). Shown instead of the raw message, which then\n * only appears in the Details dialog's dev dump. Same as `description`, which wins when both are set.\n */\n fallback?: ReactNode\n}\n\n/**\n * The react-query-style one-liner: `<QueryError error={users.error} onRetry={users.refetch}\n * fallback=\"Could not load players.\" />`. Renders nothing while `error` is empty, otherwise an\n * `ErrorState` — an alert banner by default; with `variant=\"block\"` it's **compact by default** (pass\n * `compact={false}` for the hero). Everything else passes through to `ErrorState`.\n */\nexport const QueryError = forwardRef<HTMLDivElement, QueryErrorProps>(function QueryError(\n { error, fallback, description, compact = true, ...props },\n ref,\n) {\n if (error == null || error === false) return null\n return (\n <ErrorState\n ref={ref}\n error={error}\n description={description ?? fallback}\n compact={compact}\n {...props}\n />\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 (\n <ErrorState\n variant=\"block\"\n error={error}\n description={t('errorState.description')}\n onRetry={reset}\n />\n )\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":["QueryError","forwardRef","error","fallback","description","compact","props","ref","jsx","ErrorState","keysChanged","a","b","v","i","toError","value","DefaultFallback","reset","useT","ErrorBoundary","Component","_b","_a","info","prev","prevState"],"mappings":";;;;AAmBO,MAAMA,IAAaC,EAA4C,SACpE,EAAE,OAAAC,GAAO,UAAAC,GAAU,aAAAC,GAAa,SAAAC,IAAU,IAAM,GAAGC,EAAA,GACnDC,GACA;AACA,SAAIL,KAAS,QAAQA,MAAU,KAAc,OAE3C,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,OAAAL;AAAA,MACA,aAAaE,KAAeD;AAAA,MAC5B,SAAAE;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC,GCVKI,IAAc,CAACC,IAAe,CAAA,GAAIC,IAAe,CAAA,MACrDD,EAAE,WAAWC,EAAE,UAAUD,EAAE,KAAK,CAACE,GAAGC,MAAM,CAAC,OAAO,GAAGD,GAAGD,EAAEE,CAAC,CAAC,CAAC,GAEzDC,IAAU,CAACC,MAAoBA,aAAiB,QAAQA,IAAQ,IAAI,MAAM,OAAOA,CAAK,CAAC;AAG7F,SAASC,EAAgB,EAAE,OAAAf,GAAO,OAAAgB,KAA8C;AAC9E,QAAM,IAAIC,EAAA;AAGV,SACE,gBAAAX;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,OAAAP;AAAA,MACA,aAAa,EAAE,wBAAwB;AAAA,MACvC,SAASgB;AAAA,IAAA;AAAA,EAAA;AAGf;AAUO,MAAME,UAAsBC,EAAkD;AAAA,EAA9E,cAAA;AAAA,UAAA,GAAA,SAAA,GACL,KAAA,QAA4B,EAAE,OAAO,KAAA,GAkBrC,KAAA,QAAQ,MAAM;;AACZ,WAAK,SAAS,EAAE,OAAO,KAAA,CAAM,IAC7BC,KAAAC,IAAA,KAAK,OAAM,YAAX,QAAAD,EAAA,KAAAC;AAAA,IACF;AAAA,EAAA;AAAA,EAnBA,OAAO,yBAAyBrB,GAAoC;AAClE,WAAO,EAAE,OAAOa,EAAQb,CAAK,EAAA;AAAA,EAC/B;AAAA,EAEA,kBAAkBA,GAAgBsB,GAAiB;;AACjD,KAAAF,KAAAC,IAAA,KAAK,OAAM,YAAX,QAAAD,EAAA,KAAAC,GAAqBR,EAAQb,CAAK,GAAGsB;AAAA,EACvC;AAAA,EAEA,mBAAmBC,GAA0BC,GAA+B;AAG1E,IAAI,KAAK,MAAM,SAASA,EAAU,SAAShB,EAAYe,EAAK,WAAW,KAAK,MAAM,SAAS,KACzF,KAAK,MAAA;AAAA,EAET;AAAA,EAOA,SAAS;AACP,UAAM,EAAE,OAAAvB,MAAU,KAAK;AACvB,QAAI,CAACA,EAAO,QAAO,KAAK,MAAM;AAC9B,UAAM,EAAE,UAAAC,MAAa,KAAK;AAC1B,WAAI,OAAOA,KAAa,aAAmBA,EAASD,GAAO,KAAK,KAAK,IACjEC,MAAa,SAAkBA,IAC5B,gBAAAK,EAACS,GAAA,EAAgB,OAAAf,GAAc,OAAO,KAAK,OAAO;AAAA,EAC3D;AACF;"}
@@ -1,4 +1,4 @@
1
- "use strict";const r=require("react/jsx-runtime"),V=require("react"),b=require("clsx"),Q=require("./Alert-QvfNBhlU.cjs"),d=require("./Button-BtiFpRie.cjs"),U=require("./EmptyState-BM5LrRLq.cjs"),_=require("./Icon-CBg21lKA.cjs"),W=require("./IconButton-DSPdv-oI.cjs"),X=require("./Tooltip-DmMq5R1x.cjs"),n=require("./errorMessage-C7N4KvUS.cjs"),Y=require("./useClipboard-BjTIX-4g.cjs"),Z=require("./Modal-7cCok6fV.cjs"),w=require("./ConfigProvider-CYSpuSMJ.cjs"),P="_errorState_o523f_4",L="_actions_o523f_9",rr="_fieldErrors_o523f_18",er="_field_o523f_18",tr="_compact_o523f_32",or="_pre_o523f_37",sr="_alertVariant_o523f_53",nr="_alertTitle_o523f_56",lr="_alertBody_o523f_60",ar="_alertActions_o523f_65",t={errorState:P,actions:L,fieldErrors:rr,field:er,compact:tr,pre:or,alertVariant:sr,alertTitle:nr,alertBody:lr,alertActions:ar};function cr({open:I,onClose:o,report:u}){const s=w.useT(),{copy:h,copied:a}=Y.useClipboard();return r.jsx(Z.Modal,{open:I,onClose:o,title:s("errorState.detailsTitle"),icon:"Danger",color:"error",size:"lg",scrollBehavior:"inside",footer:r.jsxs(r.Fragment,{children:[r.jsx(d.Button,{variant:"text",color:"primary",onClick:o,children:s("common.close")}),r.jsx(d.Button,{startIcon:r.jsx(_.Icon,{name:a?"CopySuccess":"Copy"}),onClick:()=>void h(u),children:s(a?"clipboard.copied":"clipboard.copy")})]}),children:r.jsx("pre",{className:t.pre,children:u})})}const ir=V.forwardRef(function({error:o,variant:u="alert",title:s,description:h,icon:a,onRetry:c,retrying:m=!1,retryLabel:x,showDetails:C="dev",compact:S=!1,traceId:y,fieldErrors:T,fieldLabels:v,size:R,pattern:G,action:p,className:N,children:k,...A},z){const e=w.useT(),[H,E]=V.useState(!1),f=n.getErrorMessage(o,l=>e("errorState.requestFailed",{status:l})),g=y===!1?void 0:y??n.getErrorTraceId(o),B=T===!1?void 0:T??n.getErrorFieldErrors(o),J=B&&Object.keys(B).length>0?r.jsx("ul",{className:t.fieldErrors,children:Object.entries(B).map(([l,K])=>r.jsxs("li",{children:[r.jsx("span",{className:t.field,children:(v==null?void 0:v[l])??n.humanizeField(l)})," —"," ",K]},l))}):void 0,q=h??J??f??e("errorState.description"),$=a===void 0?n.isNetworkError(o)?"CloudCross":"Danger":a,j=(C==="dev"?n.isDev():C)?n.getErrorDetails(o):void 0,D=n.getErrorStatus(o),i=g!=null||j!=null?[g!=null&&`${e("errorState.traceId")}: ${g}`,D!=null&&`${e("errorState.status")}: ${D}`,f!=null&&(q===f||j!=null)&&`${e("errorState.message")}: ${f}`,j!=null&&`
1
+ "use strict";const r=require("react/jsx-runtime"),V=require("react"),b=require("clsx"),Q=require("./Alert--ZnlCjaL.cjs"),d=require("./Button-DAvQCGIw.cjs"),U=require("./EmptyState-BzwrOICc.cjs"),_=require("./Icon-BoQmbW7j.cjs"),W=require("./IconButton-ChhZqleN.cjs"),X=require("./Tooltip-DmMq5R1x.cjs"),n=require("./errorMessage-C7N4KvUS.cjs"),Y=require("./useClipboard-BjTIX-4g.cjs"),Z=require("./Modal-yj92WLay.cjs"),w=require("./ConfigProvider-BFhkb0BV.cjs"),P="_errorState_o523f_4",L="_actions_o523f_9",rr="_fieldErrors_o523f_18",er="_field_o523f_18",tr="_compact_o523f_32",or="_pre_o523f_37",sr="_alertVariant_o523f_53",nr="_alertTitle_o523f_56",lr="_alertBody_o523f_60",ar="_alertActions_o523f_65",t={errorState:P,actions:L,fieldErrors:rr,field:er,compact:tr,pre:or,alertVariant:sr,alertTitle:nr,alertBody:lr,alertActions:ar};function cr({open:I,onClose:o,report:u}){const s=w.useT(),{copy:h,copied:a}=Y.useClipboard();return r.jsx(Z.Modal,{open:I,onClose:o,title:s("errorState.detailsTitle"),icon:"Danger",color:"error",size:"lg",scrollBehavior:"inside",footer:r.jsxs(r.Fragment,{children:[r.jsx(d.Button,{variant:"text",color:"primary",onClick:o,children:s("common.close")}),r.jsx(d.Button,{startIcon:r.jsx(_.Icon,{name:a?"CopySuccess":"Copy"}),onClick:()=>void h(u),children:s(a?"clipboard.copied":"clipboard.copy")})]}),children:r.jsx("pre",{className:t.pre,children:u})})}const ir=V.forwardRef(function({error:o,variant:u="alert",title:s,description:h,icon:a,onRetry:c,retrying:m=!1,retryLabel:x,showDetails:C="dev",compact:S=!1,traceId:y,fieldErrors:T,fieldLabels:v,size:R,pattern:G,action:p,className:N,children:k,...A},z){const e=w.useT(),[H,E]=V.useState(!1),f=n.getErrorMessage(o,l=>e("errorState.requestFailed",{status:l})),g=y===!1?void 0:y??n.getErrorTraceId(o),B=T===!1?void 0:T??n.getErrorFieldErrors(o),J=B&&Object.keys(B).length>0?r.jsx("ul",{className:t.fieldErrors,children:Object.entries(B).map(([l,K])=>r.jsxs("li",{children:[r.jsx("span",{className:t.field,children:(v==null?void 0:v[l])??n.humanizeField(l)})," —"," ",K]},l))}):void 0,q=h??J??f??e("errorState.description"),$=a===void 0?n.isNetworkError(o)?"CloudCross":"Danger":a,j=(C==="dev"?n.isDev():C)?n.getErrorDetails(o):void 0,D=n.getErrorStatus(o),i=g!=null||j!=null?[g!=null&&`${e("errorState.traceId")}: ${g}`,D!=null&&`${e("errorState.status")}: ${D}`,f!=null&&(q===f||j!=null)&&`${e("errorState.message")}: ${f}`,j!=null&&`
2
2
  ${j}`].filter(Boolean).join(`
3
3
  `):void 0,F=i!=null?r.jsx(cr,{open:H,onClose:()=>E(!1),report:i}):null;if(u==="alert"){const l=i!=null||c!=null||p!=null?r.jsxs("span",{className:t.alertActions,children:[c!=null&&r.jsx(X.Tooltip,{content:x??e("errorState.retry"),children:r.jsx(W.IconButton,{size:"sm",variant:"text",color:"error","aria-label":typeof x=="string"?x:e("errorState.retry"),loading:m,disabled:m,onClick:c,children:r.jsx(_.Icon,{name:"RefreshArrow2"})})}),i!=null&&r.jsx(d.Button,{size:"sm",variant:"filled",color:"error",onClick:()=>E(!0),children:e("errorState.details")}),p]}):void 0;return r.jsxs(r.Fragment,{children:[r.jsxs(Q.Alert,{ref:z,color:"error",icon:$,action:l,className:b.clsx(t.alertVariant,N),...A,children:[s!=null&&r.jsx("span",{className:t.alertTitle,children:s}),r.jsx("span",{className:t.alertBody,children:q}),k]}),F]})}const M=c!=null?r.jsx(d.Button,{size:"sm",variant:"outlined",color:"primary",startIcon:r.jsx(_.Icon,{name:"RefreshRight"}),loading:m,disabled:m,onClick:c,children:x??e("errorState.retry")}):null,O=i!=null?r.jsx(d.Button,{size:"sm",variant:"text",color:"primary",startIcon:r.jsx(_.Icon,{name:"DocumentText"}),onClick:()=>E(!0),children:e("errorState.details")}):null;return r.jsxs(r.Fragment,{children:[r.jsx(U.EmptyState,{ref:z,role:"alert",color:"error",icon:$,title:s??e("errorState.title"),description:q,size:R??(S?"sm":"md"),pattern:G??!S,action:M||O||p?r.jsxs("span",{className:t.actions,children:[M,O,p]}):void 0,className:b.clsx(t.errorState,S&&t.compact,N),...A,children:k}),F]})});exports.ErrorState=ir;
4
- //# sourceMappingURL=ErrorState-BThPIYaM.cjs.map
4
+ //# sourceMappingURL=ErrorState-CzWz5UcX.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState-BThPIYaM.cjs","sources":["../src/components/ErrorState/ErrorDetailsModal.tsx","../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["import { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport styles from './ErrorState.module.css'\n\nexport interface ErrorDetailsModalProps {\n open: boolean\n onClose: () => void\n /** The whole report — shown as-is and copied by the Copy button. */\n report: string\n}\n\n/**\n * Internal to `ErrorState`: the \"Details\" dialog — the error report (trace id, status, message, then the stack /\n * raw dump when allowed) in one monospace block, with **Copy** (the whole report, flips to \"Copied!\") and\n * **Close** in the footer, so a user can paste it into a support ticket in one go.\n */\nexport function ErrorDetailsModal({ open, onClose, report }: ErrorDetailsModalProps) {\n const t = useT()\n const { copy, copied } = useClipboard()\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={t('errorState.detailsTitle')}\n icon=\"Danger\"\n color=\"error\"\n size=\"lg\"\n scrollBehavior=\"inside\"\n footer={\n <>\n <Button variant=\"text\" color=\"primary\" onClick={onClose}>\n {t('common.close')}\n </Button>\n <Button\n startIcon={<Icon name={copied ? 'CopySuccess' : 'Copy'} />}\n onClick={() => void copy(report)}\n >\n {copied ? t('clipboard.copied') : t('clipboard.copy')}\n </Button>\n </>\n }\n >\n <pre className={styles.pre}>{report}</pre>\n </Modal>\n )\n}\n","import { forwardRef, useState, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Alert } from '../Alert'\nimport { Button } from '../Button'\nimport { EmptyState, type EmptyStateProps } from '../EmptyState'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\nimport {\n getErrorDetails,\n getErrorFieldErrors,\n getErrorMessage,\n getErrorStatus,\n getErrorTraceId,\n humanizeField,\n isNetworkError,\n isDev,\n} from './errorMessage'\nimport { ErrorDetailsModal } from './ErrorDetailsModal'\nimport styles from './ErrorState.module.css'\n\nexport type ErrorStateVariant = 'block' | 'alert'\n\nexport interface ErrorStateProps extends Omit<EmptyStateProps, 'icon' | 'title' | 'color'> {\n /**\n * The shape. `'alert'` (default) — a red `Alert` banner: the message (no default title), then Try Again /\n * Details / `action` in the alert's action slot; it fits anywhere — above a form, in a modal, in a card.\n * `'block'` — the `EmptyState`-style block (puck, title, centred message, the buttons below), for an area\n * whose data failed to load, or a whole page (`PageError`). `compact` and `pattern` apply to `'block'` only.\n */\n variant?: ErrorStateVariant\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 /**\n * Heading. Alert: none unless given — the message is the point. Block: defaults to the localized \"Something\n * Went Wrong\".\n */\n title?: ReactNode\n /**\n * Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger` in both variants (the alert\n * replaces the Alert's own × icon), or `CloudCross` when the request never got a response (an explicit\n * `status: 0` / network error code), tinted `error`.\n */\n icon?: IconName | ReactNode | false\n /** Adds a \"Try Again\" button that calls this (e.g. a query's `refetch`). */\n onRetry?: () => void\n /**\n * The retry is running (e.g. `query.isFetching`) — the \"Try Again\" button shows its loader and is disabled,\n * so a slow refetch doesn't look like a dead click. Defaults to `false`.\n */\n retrying?: boolean\n /** Retry button label. Defaults to the localized \"Try Again\". */\n retryLabel?: ReactNode\n /**\n * Include the technical dump (the stack, or the raw error as JSON) in the **Details** dialog. `'dev'`\n * (default) only in development builds; `true` always; `false` never. The Details button itself shows\n * whenever there's a trace id or this dump — never inline on the page.\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 — it matches a report to the server log. It isn't shown on the page: it leads the\n * **Details** dialog (with a copy button), and its presence alone shows the Details button, production\n * included. 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` (`getErrorFieldErrors`: `error.fieldErrors` — an object, a\n * method or a `{ field, message }[]` —, `error.details`, `error.response.data.errors`); `false` hides them. In a form, put them on the inputs instead.\n */\n fieldErrors?: Record<string, string> | false\n /**\n * Labels for the field-error keys (`{ newPassword: 'New Password' }`). A key without one is shown humanized\n * and Title Cased (`newPassword` / `new_password` → \"New Password\"; a dotted path keeps its last segment).\n */\n fieldLabels?: Record<string, ReactNode>\n}\n\n/**\n * The \"it broke\" counterpart of `EmptyState`. By default (`variant=\"alert\"`) a red `Alert` banner with a `Danger`\n * icon: the failure's own message (extracted from an `Error`, a string, an axios-style `response.data.message`, a\n * `{ message }`, or a raw `{ status }` → \"Request failed (404)\"), or a 400's per-field `fieldErrors` list; then\n * **Try Again** (`onRetry`, spinning while `retrying`) and **Details** in its action slot. `variant=\"block\"` is the\n * `EmptyState`-style block (an `error`-tinted puck, a \"Something Went Wrong\" title, the same buttons below);\n * `compact` is its inline size. **Details** opens a dialog with the full report — the server's `traceId`, the\n * status, the message, and the stack in development (`showDetails`) — in one block with a copy button. Announced\n * once (`role=\"alert\"`). `forwardRef` to the root; any other `EmptyState` prop passes through to the block.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n {\n error,\n variant = 'alert',\n title,\n description,\n icon,\n onRetry,\n retrying = false,\n retryLabel,\n showDetails = 'dev',\n compact = false,\n traceId: traceIdProp,\n fieldErrors: fieldErrorsProp,\n fieldLabels,\n size,\n pattern,\n action,\n className,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [detailsOpen, setDetailsOpen] = useState(false)\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}>{fieldLabels?.[field] ?? humanizeField(field)}</span> —{' '}\n {msg}\n </li>\n ))}\n </ul>\n ) : undefined\n const body = description ?? fieldErrorList ?? message ?? t('errorState.description')\n const resolvedIcon = icon === undefined ? (isNetworkError(error) ? 'CloudCross' : 'Danger') : icon\n\n // the \"Details\" report — trace id, status, message, then the stack / raw dump (dev only by default). The\n // button shows when there's something worth opening: a trace id (always — it's what support asks for) or\n // the technical dump.\n const technical = (showDetails === 'dev' ? isDev() : showDetails)\n ? getErrorDetails(error)\n : undefined\n const status = getErrorStatus(error)\n const report =\n traceId != null || technical != null\n ? [\n traceId != null && `${t('errorState.traceId')}: ${traceId}`,\n status != null && `${t('errorState.status')}: ${status}`,\n // the raw message only where it's already visible, or with the dev dump — a `description` /\n // `fallback` (or PageError) hides it on purpose\n message != null &&\n (body === message || technical != null) &&\n `${t('errorState.message')}: ${message}`,\n technical != null && `\\n${technical}`,\n ]\n .filter(Boolean)\n .join('\\n')\n : undefined\n const detailsModal =\n report != null ? (\n <ErrorDetailsModal open={detailsOpen} onClose={() => setDetailsOpen(false)} report={report} />\n ) : null\n\n // ── alert (default): a banner — the message, then Try Again / Details / action in the action slot ──\n if (variant === 'alert') {\n const alertActions =\n report != null || onRetry != null || action != null ? (\n <span className={styles.alertActions}>\n {/* an icon-only retry (tooltip + aria-label) keeps the slot narrow, so the message keeps its room on\n small screens */}\n {onRetry != null && (\n <Tooltip content={retryLabel ?? t('errorState.retry')}>\n <IconButton\n size=\"sm\"\n variant=\"text\"\n color=\"error\"\n aria-label={typeof retryLabel === 'string' ? retryLabel : t('errorState.retry')}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n <Icon name=\"RefreshArrow2\" />\n </IconButton>\n </Tooltip>\n )}\n {report != null && (\n <Button size=\"sm\" variant=\"filled\" color=\"error\" onClick={() => setDetailsOpen(true)}>\n {t('errorState.details')}\n </Button>\n )}\n {action}\n </span>\n ) : undefined\n return (\n <>\n <Alert\n ref={ref}\n color=\"error\"\n icon={resolvedIcon}\n action={alertActions}\n className={clsx(styles.alertVariant, className)}\n {...props}\n >\n {title != null && <span className={styles.alertTitle}>{title}</span>}\n <span className={styles.alertBody}>{body}</span>\n {children}\n </Alert>\n {detailsModal}\n </>\n )\n }\n\n // ── block: the EmptyState-style hero / compact block ──\n const retry =\n onRetry != null ? (\n <Button\n size=\"sm\"\n variant=\"outlined\"\n color=\"primary\"\n startIcon={<Icon name=\"RefreshRight\" />}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n {retryLabel ?? t('errorState.retry')}\n </Button>\n ) : null\n const detailsButton =\n report != null ? (\n <Button\n size=\"sm\"\n variant=\"text\"\n color=\"primary\"\n startIcon={<Icon name=\"DocumentText\" />}\n onClick={() => setDetailsOpen(true)}\n >\n {t('errorState.details')}\n </Button>\n ) : null\n\n return (\n <>\n <EmptyState\n ref={ref}\n // one announcement, assertive: an error is what the user needs to know now (role=\"alert\" already\n // implies aria-live=\"assertive\" — pairing it with \"polite\" was contradictory)\n role=\"alert\"\n color=\"error\"\n icon={resolvedIcon}\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={body}\n size={size ?? (compact ? 'sm' : 'md')}\n pattern={pattern ?? !compact}\n action={\n retry || detailsButton || action ? (\n <span className={styles.actions}>\n {retry}\n {detailsButton}\n {action}\n </span>\n ) : undefined\n }\n className={clsx(styles.errorState, compact && styles.compact, className)}\n {...props}\n >\n {children}\n </EmptyState>\n {detailsModal}\n </>\n )\n})\n"],"names":["ErrorDetailsModal","open","onClose","report","t","useT","copy","copied","useClipboard","jsx","Modal","jsxs","Fragment","Button","Icon","styles","ErrorState","forwardRef","error","variant","title","description","icon","onRetry","retrying","retryLabel","showDetails","compact","traceIdProp","fieldErrorsProp","fieldLabels","size","pattern","action","className","children","props","ref","detailsOpen","setDetailsOpen","useState","message","getErrorMessage","status","traceId","getErrorTraceId","fieldErrors","getErrorFieldErrors","fieldErrorList","field","msg","humanizeField","body","resolvedIcon","isNetworkError","technical","isDev","getErrorDetails","getErrorStatus","detailsModal","alertActions","Tooltip","IconButton","Alert","clsx","retry","detailsButton","EmptyState"],"mappings":"g0BAmBO,SAASA,GAAkB,CAAE,KAAAC,EAAM,QAAAC,EAAS,OAAAC,GAAkC,CACnF,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAAE,KAAAC,EAAM,OAAAC,CAAA,EAAWC,eAAA,EACzB,OACEC,EAAAA,IAACC,EAAAA,MAAA,CACC,KAAAT,EACA,QAAAC,EACA,MAAOE,EAAE,yBAAyB,EAClC,KAAK,SACL,MAAM,QACN,KAAK,KACL,eAAe,SACf,OACEO,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAH,EAAAA,IAACI,EAAAA,OAAA,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D,EAAAA,WAAA,CACC,IAAA9B,EAGA,KAAK,QACL,MAAM,QACN,KAAMgB,EACN,MAAOjC,GAAShB,EAAE,kBAAkB,EAEpC,YAAagD,EACb,KAAMrB,IAASJ,EAAU,KAAO,MAChC,QAASK,GAAW,CAACL,EACrB,OACEsC,GAASC,GAAiBjC,SACvB,OAAA,CAAK,UAAWlB,EAAO,QACrB,SAAA,CAAAkD,EACAC,EACAjC,CAAA,CAAA,CACH,EACE,OAEN,UAAW+B,EAAAA,KAAKjD,EAAO,WAAYY,GAAWZ,EAAO,QAASmB,CAAS,EACtE,GAAGE,EAEH,SAAAD,CAAA,CAAA,EAEFwB,CAAA,EACH,CAEJ,CAAC"}
1
+ {"version":3,"file":"ErrorState-CzWz5UcX.cjs","sources":["../src/components/ErrorState/ErrorDetailsModal.tsx","../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["import { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport styles from './ErrorState.module.css'\n\nexport interface ErrorDetailsModalProps {\n open: boolean\n onClose: () => void\n /** The whole report — shown as-is and copied by the Copy button. */\n report: string\n}\n\n/**\n * Internal to `ErrorState`: the \"Details\" dialog — the error report (trace id, status, message, then the stack /\n * raw dump when allowed) in one monospace block, with **Copy** (the whole report, flips to \"Copied!\") and\n * **Close** in the footer, so a user can paste it into a support ticket in one go.\n */\nexport function ErrorDetailsModal({ open, onClose, report }: ErrorDetailsModalProps) {\n const t = useT()\n const { copy, copied } = useClipboard()\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={t('errorState.detailsTitle')}\n icon=\"Danger\"\n color=\"error\"\n size=\"lg\"\n scrollBehavior=\"inside\"\n footer={\n <>\n <Button variant=\"text\" color=\"primary\" onClick={onClose}>\n {t('common.close')}\n </Button>\n <Button\n startIcon={<Icon name={copied ? 'CopySuccess' : 'Copy'} />}\n onClick={() => void copy(report)}\n >\n {copied ? t('clipboard.copied') : t('clipboard.copy')}\n </Button>\n </>\n }\n >\n <pre className={styles.pre}>{report}</pre>\n </Modal>\n )\n}\n","import { forwardRef, useState, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Alert } from '../Alert'\nimport { Button } from '../Button'\nimport { EmptyState, type EmptyStateProps } from '../EmptyState'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\nimport {\n getErrorDetails,\n getErrorFieldErrors,\n getErrorMessage,\n getErrorStatus,\n getErrorTraceId,\n humanizeField,\n isNetworkError,\n isDev,\n} from './errorMessage'\nimport { ErrorDetailsModal } from './ErrorDetailsModal'\nimport styles from './ErrorState.module.css'\n\nexport type ErrorStateVariant = 'block' | 'alert'\n\nexport interface ErrorStateProps extends Omit<EmptyStateProps, 'icon' | 'title' | 'color'> {\n /**\n * The shape. `'alert'` (default) — a red `Alert` banner: the message (no default title), then Try Again /\n * Details / `action` in the alert's action slot; it fits anywhere — above a form, in a modal, in a card.\n * `'block'` — the `EmptyState`-style block (puck, title, centred message, the buttons below), for an area\n * whose data failed to load, or a whole page (`PageError`). `compact` and `pattern` apply to `'block'` only.\n */\n variant?: ErrorStateVariant\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 /**\n * Heading. Alert: none unless given — the message is the point. Block: defaults to the localized \"Something\n * Went Wrong\".\n */\n title?: ReactNode\n /**\n * Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger` in both variants (the alert\n * replaces the Alert's own × icon), or `CloudCross` when the request never got a response (an explicit\n * `status: 0` / network error code), tinted `error`.\n */\n icon?: IconName | ReactNode | false\n /** Adds a \"Try Again\" button that calls this (e.g. a query's `refetch`). */\n onRetry?: () => void\n /**\n * The retry is running (e.g. `query.isFetching`) — the \"Try Again\" button shows its loader and is disabled,\n * so a slow refetch doesn't look like a dead click. Defaults to `false`.\n */\n retrying?: boolean\n /** Retry button label. Defaults to the localized \"Try Again\". */\n retryLabel?: ReactNode\n /**\n * Include the technical dump (the stack, or the raw error as JSON) in the **Details** dialog. `'dev'`\n * (default) only in development builds; `true` always; `false` never. The Details button itself shows\n * whenever there's a trace id or this dump — never inline on the page.\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 — it matches a report to the server log. It isn't shown on the page: it leads the\n * **Details** dialog (with a copy button), and its presence alone shows the Details button, production\n * included. 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` (`getErrorFieldErrors`: `error.fieldErrors` — an object, a\n * method or a `{ field, message }[]` —, `error.details`, `error.response.data.errors`); `false` hides them. In a form, put them on the inputs instead.\n */\n fieldErrors?: Record<string, string> | false\n /**\n * Labels for the field-error keys (`{ newPassword: 'New Password' }`). A key without one is shown humanized\n * and Title Cased (`newPassword` / `new_password` → \"New Password\"; a dotted path keeps its last segment).\n */\n fieldLabels?: Record<string, ReactNode>\n}\n\n/**\n * The \"it broke\" counterpart of `EmptyState`. By default (`variant=\"alert\"`) a red `Alert` banner with a `Danger`\n * icon: the failure's own message (extracted from an `Error`, a string, an axios-style `response.data.message`, a\n * `{ message }`, or a raw `{ status }` → \"Request failed (404)\"), or a 400's per-field `fieldErrors` list; then\n * **Try Again** (`onRetry`, spinning while `retrying`) and **Details** in its action slot. `variant=\"block\"` is the\n * `EmptyState`-style block (an `error`-tinted puck, a \"Something Went Wrong\" title, the same buttons below);\n * `compact` is its inline size. **Details** opens a dialog with the full report — the server's `traceId`, the\n * status, the message, and the stack in development (`showDetails`) — in one block with a copy button. Announced\n * once (`role=\"alert\"`). `forwardRef` to the root; any other `EmptyState` prop passes through to the block.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n {\n error,\n variant = 'alert',\n title,\n description,\n icon,\n onRetry,\n retrying = false,\n retryLabel,\n showDetails = 'dev',\n compact = false,\n traceId: traceIdProp,\n fieldErrors: fieldErrorsProp,\n fieldLabels,\n size,\n pattern,\n action,\n className,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [detailsOpen, setDetailsOpen] = useState(false)\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}>{fieldLabels?.[field] ?? humanizeField(field)}</span> —{' '}\n {msg}\n </li>\n ))}\n </ul>\n ) : undefined\n const body = description ?? fieldErrorList ?? message ?? t('errorState.description')\n const resolvedIcon = icon === undefined ? (isNetworkError(error) ? 'CloudCross' : 'Danger') : icon\n\n // the \"Details\" report — trace id, status, message, then the stack / raw dump (dev only by default). The\n // button shows when there's something worth opening: a trace id (always — it's what support asks for) or\n // the technical dump.\n const technical = (showDetails === 'dev' ? isDev() : showDetails)\n ? getErrorDetails(error)\n : undefined\n const status = getErrorStatus(error)\n const report =\n traceId != null || technical != null\n ? [\n traceId != null && `${t('errorState.traceId')}: ${traceId}`,\n status != null && `${t('errorState.status')}: ${status}`,\n // the raw message only where it's already visible, or with the dev dump — a `description` /\n // `fallback` (or PageError) hides it on purpose\n message != null &&\n (body === message || technical != null) &&\n `${t('errorState.message')}: ${message}`,\n technical != null && `\\n${technical}`,\n ]\n .filter(Boolean)\n .join('\\n')\n : undefined\n const detailsModal =\n report != null ? (\n <ErrorDetailsModal open={detailsOpen} onClose={() => setDetailsOpen(false)} report={report} />\n ) : null\n\n // ── alert (default): a banner — the message, then Try Again / Details / action in the action slot ──\n if (variant === 'alert') {\n const alertActions =\n report != null || onRetry != null || action != null ? (\n <span className={styles.alertActions}>\n {/* an icon-only retry (tooltip + aria-label) keeps the slot narrow, so the message keeps its room on\n small screens */}\n {onRetry != null && (\n <Tooltip content={retryLabel ?? t('errorState.retry')}>\n <IconButton\n size=\"sm\"\n variant=\"text\"\n color=\"error\"\n aria-label={typeof retryLabel === 'string' ? retryLabel : t('errorState.retry')}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n <Icon name=\"RefreshArrow2\" />\n </IconButton>\n </Tooltip>\n )}\n {report != null && (\n <Button size=\"sm\" variant=\"filled\" color=\"error\" onClick={() => setDetailsOpen(true)}>\n {t('errorState.details')}\n </Button>\n )}\n {action}\n </span>\n ) : undefined\n return (\n <>\n <Alert\n ref={ref}\n color=\"error\"\n icon={resolvedIcon}\n action={alertActions}\n className={clsx(styles.alertVariant, className)}\n {...props}\n >\n {title != null && <span className={styles.alertTitle}>{title}</span>}\n <span className={styles.alertBody}>{body}</span>\n {children}\n </Alert>\n {detailsModal}\n </>\n )\n }\n\n // ── block: the EmptyState-style hero / compact block ──\n const retry =\n onRetry != null ? (\n <Button\n size=\"sm\"\n variant=\"outlined\"\n color=\"primary\"\n startIcon={<Icon name=\"RefreshRight\" />}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n {retryLabel ?? t('errorState.retry')}\n </Button>\n ) : null\n const detailsButton =\n report != null ? (\n <Button\n size=\"sm\"\n variant=\"text\"\n color=\"primary\"\n startIcon={<Icon name=\"DocumentText\" />}\n onClick={() => setDetailsOpen(true)}\n >\n {t('errorState.details')}\n </Button>\n ) : null\n\n return (\n <>\n <EmptyState\n ref={ref}\n // one announcement, assertive: an error is what the user needs to know now (role=\"alert\" already\n // implies aria-live=\"assertive\" — pairing it with \"polite\" was contradictory)\n role=\"alert\"\n color=\"error\"\n icon={resolvedIcon}\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={body}\n size={size ?? (compact ? 'sm' : 'md')}\n pattern={pattern ?? !compact}\n action={\n retry || detailsButton || action ? (\n <span className={styles.actions}>\n {retry}\n {detailsButton}\n {action}\n </span>\n ) : undefined\n }\n className={clsx(styles.errorState, compact && styles.compact, className)}\n {...props}\n >\n {children}\n </EmptyState>\n {detailsModal}\n </>\n )\n})\n"],"names":["ErrorDetailsModal","open","onClose","report","t","useT","copy","copied","useClipboard","jsx","Modal","jsxs","Fragment","Button","Icon","styles","ErrorState","forwardRef","error","variant","title","description","icon","onRetry","retrying","retryLabel","showDetails","compact","traceIdProp","fieldErrorsProp","fieldLabels","size","pattern","action","className","children","props","ref","detailsOpen","setDetailsOpen","useState","message","getErrorMessage","status","traceId","getErrorTraceId","fieldErrors","getErrorFieldErrors","fieldErrorList","field","msg","humanizeField","body","resolvedIcon","isNetworkError","technical","isDev","getErrorDetails","getErrorStatus","detailsModal","alertActions","Tooltip","IconButton","Alert","clsx","retry","detailsButton","EmptyState"],"mappings":"g0BAmBO,SAASA,GAAkB,CAAE,KAAAC,EAAM,QAAAC,EAAS,OAAAC,GAAkC,CACnF,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAAE,KAAAC,EAAM,OAAAC,CAAA,EAAWC,eAAA,EACzB,OACEC,EAAAA,IAACC,EAAAA,MAAA,CACC,KAAAT,EACA,QAAAC,EACA,MAAOE,EAAE,yBAAyB,EAClC,KAAK,SACL,MAAM,QACN,KAAK,KACL,eAAe,SACf,OACEO,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAH,EAAAA,IAACI,EAAAA,OAAA,CAAO,QAAQ,OAAO,MAAM,UAAU,QAASX,EAC7C,SAAAE,EAAE,cAAc,CAAA,CACnB,EACAK,EAAAA,IAACI,EAAAA,OAAA,CACC,UAAWJ,EAAAA,IAACK,OAAA,CAAK,KAAMP,EAAS,cAAgB,OAAQ,E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,OACEsC,GAASC,GAAiBjC,SACvB,OAAA,CAAK,UAAWlB,EAAO,QACrB,SAAA,CAAAkD,EACAC,EACAjC,CAAA,CAAA,CACH,EACE,OAEN,UAAW+B,EAAAA,KAAKjD,EAAO,WAAYY,GAAWZ,EAAO,QAASmB,CAAS,EACtE,GAAGE,EAEH,SAAAD,CAAA,CAAA,EAEFwB,CAAA,EACH,CAEJ,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { jsx as r, jsxs as s, Fragment as T } from "react/jsx-runtime";
2
2
  import { forwardRef as R, useState as U } from "react";
3
3
  import { clsx as w } from "clsx";
4
- import { A as W } from "./Alert-Bo_XgY-A.js";
5
- import { B as d } from "./Button-DZWYeAno.js";
6
- import { E as X } from "./EmptyState-DrSj2XV_.js";
7
- import { b as S } from "./Icon-B7DJn8Tw.js";
8
- import { I as Y } from "./IconButton-iWbUJAz7.js";
4
+ import { A as W } from "./Alert-BVs-GcZQ.js";
5
+ import { B as d } from "./Button-7mgXcRdw.js";
6
+ import { E as X } from "./EmptyState-CmcjJl_K.js";
7
+ import { b as S } from "./Icon-DMMO32p6.js";
8
+ import { I as Y } from "./IconButton-s5hohjxu.js";
9
9
  import { T as Z } from "./Tooltip-BbT0uNzy.js";
10
10
  import { b as P, d as L, a as rr, h as tr, i as er, f as or, g as ar, c as lr } from "./errorMessage-C83fB2h5.js";
11
11
  import { u as sr } from "./useClipboard-CEw_Juiq.js";
12
- import { M as nr } from "./Modal-DVGTD2Ck.js";
13
- import { a as q } from "./ConfigProvider-DtyUlWk6.js";
12
+ import { M as nr } from "./Modal-BO7fHn0r.js";
13
+ import { a as q } from "./ConfigProvider-bXX8dnhY.js";
14
14
  const ir = "_errorState_o523f_4", cr = "_actions_o523f_9", dr = "_fieldErrors_o523f_18", mr = "_field_o523f_18", fr = "_compact_o523f_32", pr = "_pre_o523f_37", ur = "_alertVariant_o523f_53", _r = "_alertTitle_o523f_56", hr = "_alertBody_o523f_60", Sr = "_alertActions_o523f_65", e = {
15
15
  errorState: ir,
16
16
  actions: cr,
@@ -175,4 +175,4 @@ ${h}`
175
175
  export {
176
176
  Dr as E
177
177
  };
178
- //# sourceMappingURL=ErrorState-DEngucdq.js.map
178
+ //# sourceMappingURL=ErrorState-EjIhdq7S.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState-DEngucdq.js","sources":["../src/components/ErrorState/ErrorDetailsModal.tsx","../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["import { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport styles from './ErrorState.module.css'\n\nexport interface ErrorDetailsModalProps {\n open: boolean\n onClose: () => void\n /** The whole report — shown as-is and copied by the Copy button. */\n report: string\n}\n\n/**\n * Internal to `ErrorState`: the \"Details\" dialog — the error report (trace id, status, message, then the stack /\n * raw dump when allowed) in one monospace block, with **Copy** (the whole report, flips to \"Copied!\") and\n * **Close** in the footer, so a user can paste it into a support ticket in one go.\n */\nexport function ErrorDetailsModal({ open, onClose, report }: ErrorDetailsModalProps) {\n const t = useT()\n const { copy, copied } = useClipboard()\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={t('errorState.detailsTitle')}\n icon=\"Danger\"\n color=\"error\"\n size=\"lg\"\n scrollBehavior=\"inside\"\n footer={\n <>\n <Button variant=\"text\" color=\"primary\" onClick={onClose}>\n {t('common.close')}\n </Button>\n <Button\n startIcon={<Icon name={copied ? 'CopySuccess' : 'Copy'} />}\n onClick={() => void copy(report)}\n >\n {copied ? t('clipboard.copied') : t('clipboard.copy')}\n </Button>\n </>\n }\n >\n <pre className={styles.pre}>{report}</pre>\n </Modal>\n )\n}\n","import { forwardRef, useState, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Alert } from '../Alert'\nimport { Button } from '../Button'\nimport { EmptyState, type EmptyStateProps } from '../EmptyState'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\nimport {\n getErrorDetails,\n getErrorFieldErrors,\n getErrorMessage,\n getErrorStatus,\n getErrorTraceId,\n humanizeField,\n isNetworkError,\n isDev,\n} from './errorMessage'\nimport { ErrorDetailsModal } from './ErrorDetailsModal'\nimport styles from './ErrorState.module.css'\n\nexport type ErrorStateVariant = 'block' | 'alert'\n\nexport interface ErrorStateProps extends Omit<EmptyStateProps, 'icon' | 'title' | 'color'> {\n /**\n * The shape. `'alert'` (default) — a red `Alert` banner: the message (no default title), then Try Again /\n * Details / `action` in the alert's action slot; it fits anywhere — above a form, in a modal, in a card.\n * `'block'` — the `EmptyState`-style block (puck, title, centred message, the buttons below), for an area\n * whose data failed to load, or a whole page (`PageError`). `compact` and `pattern` apply to `'block'` only.\n */\n variant?: ErrorStateVariant\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 /**\n * Heading. Alert: none unless given — the message is the point. Block: defaults to the localized \"Something\n * Went Wrong\".\n */\n title?: ReactNode\n /**\n * Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger` in both variants (the alert\n * replaces the Alert's own × icon), or `CloudCross` when the request never got a response (an explicit\n * `status: 0` / network error code), tinted `error`.\n */\n icon?: IconName | ReactNode | false\n /** Adds a \"Try Again\" button that calls this (e.g. a query's `refetch`). */\n onRetry?: () => void\n /**\n * The retry is running (e.g. `query.isFetching`) — the \"Try Again\" button shows its loader and is disabled,\n * so a slow refetch doesn't look like a dead click. Defaults to `false`.\n */\n retrying?: boolean\n /** Retry button label. Defaults to the localized \"Try Again\". */\n retryLabel?: ReactNode\n /**\n * Include the technical dump (the stack, or the raw error as JSON) in the **Details** dialog. `'dev'`\n * (default) only in development builds; `true` always; `false` never. The Details button itself shows\n * whenever there's a trace id or this dump — never inline on the page.\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 — it matches a report to the server log. It isn't shown on the page: it leads the\n * **Details** dialog (with a copy button), and its presence alone shows the Details button, production\n * included. 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` (`getErrorFieldErrors`: `error.fieldErrors` — an object, a\n * method or a `{ field, message }[]` —, `error.details`, `error.response.data.errors`); `false` hides them. In a form, put them on the inputs instead.\n */\n fieldErrors?: Record<string, string> | false\n /**\n * Labels for the field-error keys (`{ newPassword: 'New Password' }`). A key without one is shown humanized\n * and Title Cased (`newPassword` / `new_password` → \"New Password\"; a dotted path keeps its last segment).\n */\n fieldLabels?: Record<string, ReactNode>\n}\n\n/**\n * The \"it broke\" counterpart of `EmptyState`. By default (`variant=\"alert\"`) a red `Alert` banner with a `Danger`\n * icon: the failure's own message (extracted from an `Error`, a string, an axios-style `response.data.message`, a\n * `{ message }`, or a raw `{ status }` → \"Request failed (404)\"), or a 400's per-field `fieldErrors` list; then\n * **Try Again** (`onRetry`, spinning while `retrying`) and **Details** in its action slot. `variant=\"block\"` is the\n * `EmptyState`-style block (an `error`-tinted puck, a \"Something Went Wrong\" title, the same buttons below);\n * `compact` is its inline size. **Details** opens a dialog with the full report — the server's `traceId`, the\n * status, the message, and the stack in development (`showDetails`) — in one block with a copy button. Announced\n * once (`role=\"alert\"`). `forwardRef` to the root; any other `EmptyState` prop passes through to the block.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n {\n error,\n variant = 'alert',\n title,\n description,\n icon,\n onRetry,\n retrying = false,\n retryLabel,\n showDetails = 'dev',\n compact = false,\n traceId: traceIdProp,\n fieldErrors: fieldErrorsProp,\n fieldLabels,\n size,\n pattern,\n action,\n className,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [detailsOpen, setDetailsOpen] = useState(false)\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}>{fieldLabels?.[field] ?? humanizeField(field)}</span> —{' '}\n {msg}\n </li>\n ))}\n </ul>\n ) : undefined\n const body = description ?? fieldErrorList ?? message ?? t('errorState.description')\n const resolvedIcon = icon === undefined ? (isNetworkError(error) ? 'CloudCross' : 'Danger') : icon\n\n // the \"Details\" report — trace id, status, message, then the stack / raw dump (dev only by default). The\n // button shows when there's something worth opening: a trace id (always — it's what support asks for) or\n // the technical dump.\n const technical = (showDetails === 'dev' ? isDev() : showDetails)\n ? getErrorDetails(error)\n : undefined\n const status = getErrorStatus(error)\n const report =\n traceId != null || technical != null\n ? [\n traceId != null && `${t('errorState.traceId')}: ${traceId}`,\n status != null && `${t('errorState.status')}: ${status}`,\n // the raw message only where it's already visible, or with the dev dump — a `description` /\n // `fallback` (or PageError) hides it on purpose\n message != null &&\n (body === message || technical != null) &&\n `${t('errorState.message')}: ${message}`,\n technical != null && `\\n${technical}`,\n ]\n .filter(Boolean)\n .join('\\n')\n : undefined\n const detailsModal =\n report != null ? (\n <ErrorDetailsModal open={detailsOpen} onClose={() => setDetailsOpen(false)} report={report} />\n ) : null\n\n // ── alert (default): a banner — the message, then Try Again / Details / action in the action slot ──\n if (variant === 'alert') {\n const alertActions =\n report != null || onRetry != null || action != null ? (\n <span className={styles.alertActions}>\n {/* an icon-only retry (tooltip + aria-label) keeps the slot narrow, so the message keeps its room on\n small screens */}\n {onRetry != null && (\n <Tooltip content={retryLabel ?? t('errorState.retry')}>\n <IconButton\n size=\"sm\"\n variant=\"text\"\n color=\"error\"\n aria-label={typeof retryLabel === 'string' ? retryLabel : t('errorState.retry')}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n <Icon name=\"RefreshArrow2\" />\n </IconButton>\n </Tooltip>\n )}\n {report != null && (\n <Button size=\"sm\" variant=\"filled\" color=\"error\" onClick={() => setDetailsOpen(true)}>\n {t('errorState.details')}\n </Button>\n )}\n {action}\n </span>\n ) : undefined\n return (\n <>\n <Alert\n ref={ref}\n color=\"error\"\n icon={resolvedIcon}\n action={alertActions}\n className={clsx(styles.alertVariant, className)}\n {...props}\n >\n {title != null && <span className={styles.alertTitle}>{title}</span>}\n <span className={styles.alertBody}>{body}</span>\n {children}\n </Alert>\n {detailsModal}\n </>\n )\n }\n\n // ── block: the EmptyState-style hero / compact block ──\n const retry =\n onRetry != null ? (\n <Button\n size=\"sm\"\n variant=\"outlined\"\n color=\"primary\"\n startIcon={<Icon name=\"RefreshRight\" />}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n {retryLabel ?? t('errorState.retry')}\n </Button>\n ) : null\n const detailsButton =\n report != null ? (\n <Button\n size=\"sm\"\n variant=\"text\"\n color=\"primary\"\n startIcon={<Icon name=\"DocumentText\" />}\n onClick={() => setDetailsOpen(true)}\n >\n {t('errorState.details')}\n </Button>\n ) : null\n\n return (\n <>\n <EmptyState\n ref={ref}\n // one announcement, assertive: an error is what the user needs to know now (role=\"alert\" already\n // implies aria-live=\"assertive\" — pairing it with \"polite\" was contradictory)\n role=\"alert\"\n color=\"error\"\n icon={resolvedIcon}\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={body}\n size={size ?? (compact ? 'sm' : 'md')}\n pattern={pattern ?? !compact}\n action={\n retry || detailsButton || action ? (\n <span className={styles.actions}>\n {retry}\n {detailsButton}\n {action}\n </span>\n ) : undefined\n }\n className={clsx(styles.errorState, compact && styles.compact, className)}\n {...props}\n >\n {children}\n </EmptyState>\n {detailsModal}\n </>\n )\n})\n"],"names":["ErrorDetailsModal","open","onClose","report","t","useT","copy","copied","useClipboard","jsx","Modal","jsxs","Fragment","Button","Icon","styles","ErrorState","forwardRef","error","variant","title","description","icon","onRetry","retrying","retryLabel","showDetails","compact","traceIdProp","fieldErrorsProp","fieldLabels","size","pattern","action","className","children","props","ref","detailsOpen","setDetailsOpen","useState","message","getErrorMessage","status","traceId","getErrorTraceId","fieldErrors","getErrorFieldErrors","fieldErrorList","field","msg","humanizeField","body","resolvedIcon","isNetworkError","technical","isDev","getErrorDetails","getErrorStatus","detailsModal","alertActions","Tooltip","IconButton","Alert","clsx","retry","detailsButton","EmptyState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,GAAkB,EAAE,MAAAC,GAAM,SAAAC,GAAS,QAAAC,KAAkC;AACnF,QAAMC,IAAIC,EAAA,GACJ,EAAE,MAAAC,GAAM,QAAAC,EAAA,IAAWC,GAAA;AACzB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAT;AAAA,MACA,SAAAC;AAAA,MACA,OAAOE,EAAE,yBAAyB;AAAA,MAClC,MAAK;AAAA,MACL,OAAM;AAAA,MACN,MAAK;AAAA,MACL,gBAAe;AAAA,MACf,QACE,gBAAAO,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAH,EAACI,GAAA,EAAO,SAAQ,QAAO,OAAM,WAAU,SAASX,GAC7C,UAAAE,EAAE,cAAc,EAAA,CACnB;AAAA,QACA,gBAAAK;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,WAAW,gBAAAJ,EAACK,GAAA,EAAK,MAAMP,IAAS,gBAAgB,QAAQ;AAAA,YACxD,SAAS,MAAM,KAAKD,EAAKH,CAAM;AAAA,YAE9B,UAASC,EAATG,IAAW,qBAAwB,gBAAN;AAAA,UAAsB;AAAA,QAAA;AAAA,MACtD,GACF;AAAA,MAGF,UAAA,gBAAAE,EAAC,OA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EvB;AAEN,SACE,gBAAA5B,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAH;AAAA,MAAC0D;AAAA,MAAA;AAAA,QACC,KAAA9B;AAAA,QAGA,MAAK;AAAA,QACL,OAAM;AAAA,QACN,MAAMgB;AAAA,QACN,OAAOjC,KAAS,EAAE,kBAAkB;AAAA,QAEpC,aAAagC;AAAA,QACb,MAAMrB,MAASJ,IAAU,OAAO;AAAA,QAChC,SAASK,KAAW,CAACL;AAAA,QACrB,QACEsC,KAASC,KAAiBjC,sBACvB,QAAA,EAAK,WAAWlB,EAAO,SACrB,UAAA;AAAA,UAAAkD;AAAA,UACAC;AAAA,UACAjC;AAAA,QAAA,EAAA,CACH,IACE;AAAA,QAEN,WAAW+B,EAAKjD,EAAO,YAAYY,KAAWZ,EAAO,SAASmB,CAAS;AAAA,QACtE,GAAGE;AAAA,QAEH,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEFwB;AAAA,EAAA,GACH;AAEJ,CAAC;"}
1
+ {"version":3,"file":"ErrorState-EjIhdq7S.js","sources":["../src/components/ErrorState/ErrorDetailsModal.tsx","../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["import { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport styles from './ErrorState.module.css'\n\nexport interface ErrorDetailsModalProps {\n open: boolean\n onClose: () => void\n /** The whole report — shown as-is and copied by the Copy button. */\n report: string\n}\n\n/**\n * Internal to `ErrorState`: the \"Details\" dialog — the error report (trace id, status, message, then the stack /\n * raw dump when allowed) in one monospace block, with **Copy** (the whole report, flips to \"Copied!\") and\n * **Close** in the footer, so a user can paste it into a support ticket in one go.\n */\nexport function ErrorDetailsModal({ open, onClose, report }: ErrorDetailsModalProps) {\n const t = useT()\n const { copy, copied } = useClipboard()\n return (\n <Modal\n open={open}\n onClose={onClose}\n title={t('errorState.detailsTitle')}\n icon=\"Danger\"\n color=\"error\"\n size=\"lg\"\n scrollBehavior=\"inside\"\n footer={\n <>\n <Button variant=\"text\" color=\"primary\" onClick={onClose}>\n {t('common.close')}\n </Button>\n <Button\n startIcon={<Icon name={copied ? 'CopySuccess' : 'Copy'} />}\n onClick={() => void copy(report)}\n >\n {copied ? t('clipboard.copied') : t('clipboard.copy')}\n </Button>\n </>\n }\n >\n <pre className={styles.pre}>{report}</pre>\n </Modal>\n )\n}\n","import { forwardRef, useState, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { Alert } from '../Alert'\nimport { Button } from '../Button'\nimport { EmptyState, type EmptyStateProps } from '../EmptyState'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\nimport {\n getErrorDetails,\n getErrorFieldErrors,\n getErrorMessage,\n getErrorStatus,\n getErrorTraceId,\n humanizeField,\n isNetworkError,\n isDev,\n} from './errorMessage'\nimport { ErrorDetailsModal } from './ErrorDetailsModal'\nimport styles from './ErrorState.module.css'\n\nexport type ErrorStateVariant = 'block' | 'alert'\n\nexport interface ErrorStateProps extends Omit<EmptyStateProps, 'icon' | 'title' | 'color'> {\n /**\n * The shape. `'alert'` (default) — a red `Alert` banner: the message (no default title), then Try Again /\n * Details / `action` in the alert's action slot; it fits anywhere — above a form, in a modal, in a card.\n * `'block'` — the `EmptyState`-style block (puck, title, centred message, the buttons below), for an area\n * whose data failed to load, or a whole page (`PageError`). `compact` and `pattern` apply to `'block'` only.\n */\n variant?: ErrorStateVariant\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 /**\n * Heading. Alert: none unless given — the message is the point. Block: defaults to the localized \"Something\n * Went Wrong\".\n */\n title?: ReactNode\n /**\n * Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger` in both variants (the alert\n * replaces the Alert's own × icon), or `CloudCross` when the request never got a response (an explicit\n * `status: 0` / network error code), tinted `error`.\n */\n icon?: IconName | ReactNode | false\n /** Adds a \"Try Again\" button that calls this (e.g. a query's `refetch`). */\n onRetry?: () => void\n /**\n * The retry is running (e.g. `query.isFetching`) — the \"Try Again\" button shows its loader and is disabled,\n * so a slow refetch doesn't look like a dead click. Defaults to `false`.\n */\n retrying?: boolean\n /** Retry button label. Defaults to the localized \"Try Again\". */\n retryLabel?: ReactNode\n /**\n * Include the technical dump (the stack, or the raw error as JSON) in the **Details** dialog. `'dev'`\n * (default) only in development builds; `true` always; `false` never. The Details button itself shows\n * whenever there's a trace id or this dump — never inline on the page.\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 — it matches a report to the server log. It isn't shown on the page: it leads the\n * **Details** dialog (with a copy button), and its presence alone shows the Details button, production\n * included. 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` (`getErrorFieldErrors`: `error.fieldErrors` — an object, a\n * method or a `{ field, message }[]` —, `error.details`, `error.response.data.errors`); `false` hides them. In a form, put them on the inputs instead.\n */\n fieldErrors?: Record<string, string> | false\n /**\n * Labels for the field-error keys (`{ newPassword: 'New Password' }`). A key without one is shown humanized\n * and Title Cased (`newPassword` / `new_password` → \"New Password\"; a dotted path keeps its last segment).\n */\n fieldLabels?: Record<string, ReactNode>\n}\n\n/**\n * The \"it broke\" counterpart of `EmptyState`. By default (`variant=\"alert\"`) a red `Alert` banner with a `Danger`\n * icon: the failure's own message (extracted from an `Error`, a string, an axios-style `response.data.message`, a\n * `{ message }`, or a raw `{ status }` → \"Request failed (404)\"), or a 400's per-field `fieldErrors` list; then\n * **Try Again** (`onRetry`, spinning while `retrying`) and **Details** in its action slot. `variant=\"block\"` is the\n * `EmptyState`-style block (an `error`-tinted puck, a \"Something Went Wrong\" title, the same buttons below);\n * `compact` is its inline size. **Details** opens a dialog with the full report — the server's `traceId`, the\n * status, the message, and the stack in development (`showDetails`) — in one block with a copy button. Announced\n * once (`role=\"alert\"`). `forwardRef` to the root; any other `EmptyState` prop passes through to the block.\n */\nexport const ErrorState = forwardRef<HTMLDivElement, ErrorStateProps>(function ErrorState(\n {\n error,\n variant = 'alert',\n title,\n description,\n icon,\n onRetry,\n retrying = false,\n retryLabel,\n showDetails = 'dev',\n compact = false,\n traceId: traceIdProp,\n fieldErrors: fieldErrorsProp,\n fieldLabels,\n size,\n pattern,\n action,\n className,\n children,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [detailsOpen, setDetailsOpen] = useState(false)\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}>{fieldLabels?.[field] ?? humanizeField(field)}</span> —{' '}\n {msg}\n </li>\n ))}\n </ul>\n ) : undefined\n const body = description ?? fieldErrorList ?? message ?? t('errorState.description')\n const resolvedIcon = icon === undefined ? (isNetworkError(error) ? 'CloudCross' : 'Danger') : icon\n\n // the \"Details\" report — trace id, status, message, then the stack / raw dump (dev only by default). The\n // button shows when there's something worth opening: a trace id (always — it's what support asks for) or\n // the technical dump.\n const technical = (showDetails === 'dev' ? isDev() : showDetails)\n ? getErrorDetails(error)\n : undefined\n const status = getErrorStatus(error)\n const report =\n traceId != null || technical != null\n ? [\n traceId != null && `${t('errorState.traceId')}: ${traceId}`,\n status != null && `${t('errorState.status')}: ${status}`,\n // the raw message only where it's already visible, or with the dev dump — a `description` /\n // `fallback` (or PageError) hides it on purpose\n message != null &&\n (body === message || technical != null) &&\n `${t('errorState.message')}: ${message}`,\n technical != null && `\\n${technical}`,\n ]\n .filter(Boolean)\n .join('\\n')\n : undefined\n const detailsModal =\n report != null ? (\n <ErrorDetailsModal open={detailsOpen} onClose={() => setDetailsOpen(false)} report={report} />\n ) : null\n\n // ── alert (default): a banner — the message, then Try Again / Details / action in the action slot ──\n if (variant === 'alert') {\n const alertActions =\n report != null || onRetry != null || action != null ? (\n <span className={styles.alertActions}>\n {/* an icon-only retry (tooltip + aria-label) keeps the slot narrow, so the message keeps its room on\n small screens */}\n {onRetry != null && (\n <Tooltip content={retryLabel ?? t('errorState.retry')}>\n <IconButton\n size=\"sm\"\n variant=\"text\"\n color=\"error\"\n aria-label={typeof retryLabel === 'string' ? retryLabel : t('errorState.retry')}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n <Icon name=\"RefreshArrow2\" />\n </IconButton>\n </Tooltip>\n )}\n {report != null && (\n <Button size=\"sm\" variant=\"filled\" color=\"error\" onClick={() => setDetailsOpen(true)}>\n {t('errorState.details')}\n </Button>\n )}\n {action}\n </span>\n ) : undefined\n return (\n <>\n <Alert\n ref={ref}\n color=\"error\"\n icon={resolvedIcon}\n action={alertActions}\n className={clsx(styles.alertVariant, className)}\n {...props}\n >\n {title != null && <span className={styles.alertTitle}>{title}</span>}\n <span className={styles.alertBody}>{body}</span>\n {children}\n </Alert>\n {detailsModal}\n </>\n )\n }\n\n // ── block: the EmptyState-style hero / compact block ──\n const retry =\n onRetry != null ? (\n <Button\n size=\"sm\"\n variant=\"outlined\"\n color=\"primary\"\n startIcon={<Icon name=\"RefreshRight\" />}\n loading={retrying}\n disabled={retrying}\n onClick={onRetry}\n >\n {retryLabel ?? t('errorState.retry')}\n </Button>\n ) : null\n const detailsButton =\n report != null ? (\n <Button\n size=\"sm\"\n variant=\"text\"\n color=\"primary\"\n startIcon={<Icon name=\"DocumentText\" />}\n onClick={() => setDetailsOpen(true)}\n >\n {t('errorState.details')}\n </Button>\n ) : null\n\n return (\n <>\n <EmptyState\n ref={ref}\n // one announcement, assertive: an error is what the user needs to know now (role=\"alert\" already\n // implies aria-live=\"assertive\" — pairing it with \"polite\" was contradictory)\n role=\"alert\"\n color=\"error\"\n icon={resolvedIcon}\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={body}\n size={size ?? (compact ? 'sm' : 'md')}\n pattern={pattern ?? !compact}\n action={\n retry || detailsButton || action ? (\n <span className={styles.actions}>\n {retry}\n {detailsButton}\n {action}\n </span>\n ) : undefined\n }\n className={clsx(styles.errorState, compact && styles.compact, className)}\n {...props}\n >\n {children}\n </EmptyState>\n {detailsModal}\n </>\n )\n})\n"],"names":["ErrorDetailsModal","open","onClose","report","t","useT","copy","copied","useClipboard","jsx","Modal","jsxs","Fragment","Button","Icon","styles","ErrorState","forwardRef","error","variant","title","description","icon","onRetry","retrying","retryLabel","showDetails","compact","traceIdProp","fieldErrorsProp","fieldLabels","size","pattern","action","className","children","props","ref","detailsOpen","setDetailsOpen","useState","message","getErrorMessage","status","traceId","getErrorTraceId","fieldErrors","getErrorFieldErrors","fieldErrorList","field","msg","humanizeField","body","resolvedIcon","isNetworkError","technical","isDev","getErrorDetails","getErrorStatus","detailsModal","alertActions","Tooltip","IconButton","Alert","clsx","retry","detailsButton","EmptyState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,GAAkB,EAAE,MAAAC,GAAM,SAAAC,GAAS,QAAAC,KAAkC;AACnF,QAAMC,IAAIC,EAAA,GACJ,EAAE,MAAAC,GAAM,QAAAC,EAAA,IAAWC,GAAA;AACzB,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAT;AAAA,MACA,SAAAC;AAAA,MACA,OAAOE,EAAE,yBAAyB;AAAA,MAClC,MAAK;AAAA,MACL,OAAM;AAAA,MACN,MAAK;AAAA,MACL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AAA,MACN,WAAW,gBAAAJ,EAACK,GAAA,EAAK,MAAK,eAAA,CAAe;AAAA,MACrC,SAASU;AAAA,MACT,UAAUA;AAAA,MACV,SAASD;AAAA,MAER,UAAAE,KAAc,EAAE,kBAAkB;AAAA,IAAA;AAAA,EAAA,IAEnC,MACAyC,IACJ/D,KAAU,OACR,gBAAAM;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,WAAW,gBAAAJ,EAACK,GAAA,EAAK,MAAK,eAAA,CAAe;AAAA,MACrC,SAAS,MAAMyB,EAAe,EAAI;AAAA,MAEjC,YAAE,oBAAoB;AAAA,IAAA;AAAA,EAAA,IAEvB;AAEN,SACE,gBAAA5B,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAH;AAAA,MAAC0D;AAAA,MAAA;AAAA,QACC,KAAA9B;AAAA,QAGA,MAAK;AAAA,QACL,OAAM;AAAA,QACN,MAAMgB;AAAA,QACN,OAAOjC,KAAS,EAAE,kBAAkB;AAAA,QAEpC,aAAagC;AAAA,QACb,MAAMrB,MAASJ,IAAU,OAAO;AAAA,QAChC,SAASK,KAAW,CAACL;AAAA,QACrB,QACEsC,KAASC,KAAiBjC,sBACvB,QAAA,EAAK,WAAWlB,EAAO,SACrB,UAAA;AAAA,UAAAkD;AAAA,UACAC;AAAA,UACAjC;AAAA,QAAA,EAAA,CACH,IACE;AAAA,QAEN,WAAW+B,EAAKjD,EAAO,YAAYY,KAAWZ,EAAO,SAASmB,CAAS;AAAA,QACtE,GAAGE;AAAA,QAEH,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEFwB;AAAA,EAAA,GACH;AAEJ,CAAC;"}
@@ -1,11 +1,11 @@
1
1
  import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
2
  import { forwardRef as A, useState as O, useEffect as y } from "react";
3
3
  import { clsx as L } from "clsx";
4
- import { A as $ } from "./Avatar-CaYyv5wk.js";
5
- import { I as V } from "./IconButton-iWbUJAz7.js";
6
- import { b as k } from "./Icon-B7DJn8Tw.js";
4
+ import { A as $ } from "./Avatar-C4qgzth2.js";
5
+ import { I as V } from "./IconButton-s5hohjxu.js";
6
+ import { b as k } from "./Icon-DMMO32p6.js";
7
7
  import { T as G } from "./Typography-ChSuxgkc.js";
8
- import { a as H } from "./ConfigProvider-DtyUlWk6.js";
8
+ import { a as H } from "./ConfigProvider-bXX8dnhY.js";
9
9
  const K = "_fileCard_1s46h_3", R = "_avatar_1s46h_26", U = "_body_1s46h_31", W = "_name_1s46h_40", X = "_nameBase_1s46h_47", z = "_nameExt_1s46h_53", J = "_type_1s46h_59", P = "_download_1s46h_63", Q = "_sm_1s46h_68", Y = "_md_1s46h_79", Z = "_lg_1s46h_83", o = {
10
10
  fileCard: K,
11
11
  avatar: R,
@@ -146,4 +146,4 @@ const ue = A(function({
146
146
  export {
147
147
  ue as F
148
148
  };
149
- //# sourceMappingURL=FileCard-CmCESTQd.js.map
149
+ //# sourceMappingURL=FileCard-CmMxVyk3.js.map