@techzyapp/ui-library 1.0.8 → 1.0.10

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 (333) hide show
  1. package/dist/{Alert-BL8hDdEl.js → Alert-B3rDvpbO.js} +3 -3
  2. package/dist/{Alert-BL8hDdEl.js.map → Alert-B3rDvpbO.js.map} +1 -1
  3. package/dist/{Alert-C9yBIMq0.cjs → Alert-D99G0StL.cjs} +2 -2
  4. package/dist/{Alert-C9yBIMq0.cjs.map → Alert-D99G0StL.cjs.map} +1 -1
  5. package/dist/AuthLayout-DGCe90w0.js +43 -0
  6. package/dist/AuthLayout-DGCe90w0.js.map +1 -0
  7. package/dist/AuthLayout-pvqB9w-B.cjs +2 -0
  8. package/dist/AuthLayout-pvqB9w-B.cjs.map +1 -0
  9. package/dist/{Breadcrumbs-DhBx2UgK.cjs → Breadcrumbs-BnxhmyK5.cjs} +2 -2
  10. package/dist/{Breadcrumbs-DhBx2UgK.cjs.map → Breadcrumbs-BnxhmyK5.cjs.map} +1 -1
  11. package/dist/{Breadcrumbs-BC_QSlJZ.js → Breadcrumbs-DvgctFLS.js} +3 -3
  12. package/dist/{Breadcrumbs-BC_QSlJZ.js.map → Breadcrumbs-DvgctFLS.js.map} +1 -1
  13. package/dist/{Button-BT8XmR_T.js → Button-CUsXYM-m.js} +2 -2
  14. package/dist/{Button-BT8XmR_T.js.map → Button-CUsXYM-m.js.map} +1 -1
  15. package/dist/{Button-C_HPI97g.cjs → Button-Cj6pckNl.cjs} +2 -2
  16. package/dist/{Button-C_HPI97g.cjs.map → Button-Cj6pckNl.cjs.map} +1 -1
  17. package/dist/{Calendar-CCCife5b.cjs → Calendar-Br4C0x0n.cjs} +2 -2
  18. package/dist/{Calendar-CCCife5b.cjs.map → Calendar-Br4C0x0n.cjs.map} +1 -1
  19. package/dist/{Calendar-B9mXn_zD.js → Calendar-CE_9WNAB.js} +3 -3
  20. package/dist/{Calendar-B9mXn_zD.js.map → Calendar-CE_9WNAB.js.map} +1 -1
  21. package/dist/{Card-DfVntHqn.cjs → Card-DD9SWHzZ.cjs} +2 -2
  22. package/dist/{Card-DfVntHqn.cjs.map → Card-DD9SWHzZ.cjs.map} +1 -1
  23. package/dist/{Card-DHPAefzg.js → Card-DhpudGvF.js} +2 -2
  24. package/dist/{Card-DHPAefzg.js.map → Card-DhpudGvF.js.map} +1 -1
  25. package/dist/{Chip-BoHt3WYS.cjs → Chip-B2lY4TJ0.cjs} +2 -2
  26. package/dist/{Chip-BoHt3WYS.cjs.map → Chip-B2lY4TJ0.cjs.map} +1 -1
  27. package/dist/{Chip-DX3QECcs.js → Chip-DulHqhuf.js} +2 -2
  28. package/dist/{Chip-DX3QECcs.js.map → Chip-DulHqhuf.js.map} +1 -1
  29. package/dist/{CodeBlock-CPWEOym2.js → CodeBlock-DwBMghs2.js} +3 -3
  30. package/dist/{CodeBlock-CPWEOym2.js.map → CodeBlock-DwBMghs2.js.map} +1 -1
  31. package/dist/{CodeBlock-DKhIGQBg.cjs → CodeBlock-EhB7v9-R.cjs} +2 -2
  32. package/dist/{CodeBlock-DKhIGQBg.cjs.map → CodeBlock-EhB7v9-R.cjs.map} +1 -1
  33. package/dist/{ColorPicker-2qD8vZkR.js → ColorPicker-DJgTeHht.js} +3 -3
  34. package/dist/{ColorPicker-2qD8vZkR.js.map → ColorPicker-DJgTeHht.js.map} +1 -1
  35. package/dist/{ColorPicker-BAJWvC3h.cjs → ColorPicker-Dc1y9Zuu.cjs} +2 -2
  36. package/dist/{ColorPicker-BAJWvC3h.cjs.map → ColorPicker-Dc1y9Zuu.cjs.map} +1 -1
  37. package/dist/{ColorPickerPanel-CovWDIRt.js → ColorPickerPanel-9tOQUL38.js} +2 -2
  38. package/dist/{ColorPickerPanel-CovWDIRt.js.map → ColorPickerPanel-9tOQUL38.js.map} +1 -1
  39. package/dist/{ColorPickerPanel-CkB2pNnX.cjs → ColorPickerPanel-nXEliruE.cjs} +2 -2
  40. package/dist/{ColorPickerPanel-CkB2pNnX.cjs.map → ColorPickerPanel-nXEliruE.cjs.map} +1 -1
  41. package/dist/{ConfigProvider-DFy6pL-C.cjs → ConfigProvider-BHNx-NHV.cjs} +2 -2
  42. package/dist/{ConfigProvider-DFy6pL-C.cjs.map → ConfigProvider-BHNx-NHV.cjs.map} +1 -1
  43. package/dist/{ConfigProvider-sEZzNTeU.js → ConfigProvider-BYruQYHC.js} +2 -2
  44. package/dist/{ConfigProvider-sEZzNTeU.js.map → ConfigProvider-BYruQYHC.js.map} +1 -1
  45. package/dist/CopyButton-B4-OYsYr.js +31 -0
  46. package/dist/CopyButton-B4-OYsYr.js.map +1 -0
  47. package/dist/CopyButton-D_DCLHhb.cjs +2 -0
  48. package/dist/CopyButton-D_DCLHhb.cjs.map +1 -0
  49. package/dist/{DatePicker-TLaQ3ZyB.cjs → DatePicker-CEczjGZy.cjs} +2 -2
  50. package/dist/{DatePicker-TLaQ3ZyB.cjs.map → DatePicker-CEczjGZy.cjs.map} +1 -1
  51. package/dist/{DatePicker-BVHriq5B.js → DatePicker-DkvfSN1K.js} +4 -4
  52. package/dist/{DatePicker-BVHriq5B.js.map → DatePicker-DkvfSN1K.js.map} +1 -1
  53. package/dist/{DateTimePicker-Dq2jJ2yb.cjs → DateTimePicker-CDyGxUBX.cjs} +2 -2
  54. package/dist/{DateTimePicker-Dq2jJ2yb.cjs.map → DateTimePicker-CDyGxUBX.cjs.map} +1 -1
  55. package/dist/{DateTimePicker-BWxsgyGB.js → DateTimePicker-DPomyrnN.js} +7 -7
  56. package/dist/{DateTimePicker-BWxsgyGB.js.map → DateTimePicker-DPomyrnN.js.map} +1 -1
  57. package/dist/{EmptyState-B2WgeL-H.cjs → EmptyState-B77utgEn.cjs} +2 -2
  58. package/dist/{EmptyState-B2WgeL-H.cjs.map → EmptyState-B77utgEn.cjs.map} +1 -1
  59. package/dist/{EmptyState-D8eUxb8v.js → EmptyState-CVyFXprK.js} +2 -2
  60. package/dist/{EmptyState-D8eUxb8v.js.map → EmptyState-CVyFXprK.js.map} +1 -1
  61. package/dist/FileCard-Cpc5frNm.js +148 -0
  62. package/dist/FileCard-Cpc5frNm.js.map +1 -0
  63. package/dist/FileCard-CsGW2sxE.cjs +2 -0
  64. package/dist/FileCard-CsGW2sxE.cjs.map +1 -0
  65. package/dist/{FileUploader-I0G-2WSe.js → FileUploader-B_nKMh_K.js} +5 -5
  66. package/dist/{FileUploader-I0G-2WSe.js.map → FileUploader-B_nKMh_K.js.map} +1 -1
  67. package/dist/{FileUploader-qsnWX-i5.cjs → FileUploader-DDi_uzIx.cjs} +2 -2
  68. package/dist/{FileUploader-qsnWX-i5.cjs.map → FileUploader-DDi_uzIx.cjs.map} +1 -1
  69. package/dist/{Flag-Bxl1Pa9m.cjs → Flag-BJLWKB9J.cjs} +2 -2
  70. package/dist/{Flag-Bxl1Pa9m.cjs.map → Flag-BJLWKB9J.cjs.map} +1 -1
  71. package/dist/{Flag-CvIo_Eqp.js → Flag-Ck1xK22A.js} +2 -2
  72. package/dist/{Flag-CvIo_Eqp.js.map → Flag-Ck1xK22A.js.map} +1 -1
  73. package/dist/{FullscreenToggle-CRMGYmB8.js → FullscreenToggle-DmC0jTay.js} +3 -3
  74. package/dist/{FullscreenToggle-CRMGYmB8.js.map → FullscreenToggle-DmC0jTay.js.map} +1 -1
  75. package/dist/{FullscreenToggle-CEOkPSLp.cjs → FullscreenToggle-MCxGzAEe.cjs} +2 -2
  76. package/dist/{FullscreenToggle-CEOkPSLp.cjs.map → FullscreenToggle-MCxGzAEe.cjs.map} +1 -1
  77. package/dist/{IconButton-BZ2jJn_T.js → IconButton-B8FPGgDn.js} +2 -2
  78. package/dist/{IconButton-BZ2jJn_T.js.map → IconButton-B8FPGgDn.js.map} +1 -1
  79. package/dist/{IconButton-ChUfK0pG.cjs → IconButton-BoY2y_pV.cjs} +2 -2
  80. package/dist/{IconButton-ChUfK0pG.cjs.map → IconButton-BoY2y_pV.cjs.map} +1 -1
  81. package/dist/{Loader-plA9fgHf.cjs → Loader-Cwb1bOHj.cjs} +2 -2
  82. package/dist/{Loader-plA9fgHf.cjs.map → Loader-Cwb1bOHj.cjs.map} +1 -1
  83. package/dist/{Loader-DFlpw5Zc.js → Loader-UzzqvFyo.js} +2 -2
  84. package/dist/{Loader-DFlpw5Zc.js.map → Loader-UzzqvFyo.js.map} +1 -1
  85. package/dist/Masonry-9LrJKlhI.cjs +2 -0
  86. package/dist/Masonry-9LrJKlhI.cjs.map +1 -0
  87. package/dist/Masonry-BsRWG-oN.js +92 -0
  88. package/dist/Masonry-BsRWG-oN.js.map +1 -0
  89. package/dist/{Modal-BaieUdge.cjs → Modal-CO3c3sGY.cjs} +2 -2
  90. package/dist/{Modal-BaieUdge.cjs.map → Modal-CO3c3sGY.cjs.map} +1 -1
  91. package/dist/{Modal-CRH_i5uU.js → Modal-XMRDPHvQ.js} +3 -3
  92. package/dist/{Modal-CRH_i5uU.js.map → Modal-XMRDPHvQ.js.map} +1 -1
  93. package/dist/{MultiSelect-BmkzNHTE.js → MultiSelect-BPLctumx.js} +4 -4
  94. package/dist/{MultiSelect-BmkzNHTE.js.map → MultiSelect-BPLctumx.js.map} +1 -1
  95. package/dist/{MultiSelect-Cb-N8GIs.cjs → MultiSelect-DVOVHuIm.cjs} +2 -2
  96. package/dist/{MultiSelect-Cb-N8GIs.cjs.map → MultiSelect-DVOVHuIm.cjs.map} +1 -1
  97. package/dist/{NumberField-DBwNn3-f.cjs → NumberField-BH237Vt2.cjs} +2 -2
  98. package/dist/{NumberField-DBwNn3-f.cjs.map → NumberField-BH237Vt2.cjs.map} +1 -1
  99. package/dist/{NumberField-D71JI2Wv.js → NumberField-X2HsSpu9.js} +3 -3
  100. package/dist/{NumberField-D71JI2Wv.js.map → NumberField-X2HsSpu9.js.map} +1 -1
  101. package/dist/{OtpField-DOz-JmuX.js → OtpField-CB05q0NX.js} +2 -2
  102. package/dist/{OtpField-DOz-JmuX.js.map → OtpField-CB05q0NX.js.map} +1 -1
  103. package/dist/{OtpField-C-SiHxKa.cjs → OtpField-CXP59zM2.cjs} +2 -2
  104. package/dist/{OtpField-C-SiHxKa.cjs.map → OtpField-CXP59zM2.cjs.map} +1 -1
  105. package/dist/{PageLayout-qF5ThZKO.cjs → PageLayout-CuVuZEbR.cjs} +2 -2
  106. package/dist/{PageLayout-qF5ThZKO.cjs.map → PageLayout-CuVuZEbR.cjs.map} +1 -1
  107. package/dist/{PageLayout-BIdgUKsN.js → PageLayout-WKWnj5cw.js} +2 -2
  108. package/dist/{PageLayout-BIdgUKsN.js.map → PageLayout-WKWnj5cw.js.map} +1 -1
  109. package/dist/{PageNotFound-CsgH9tY0.js → PageNotFound-CmT-Wr9m.js} +5 -5
  110. package/dist/{PageNotFound-CsgH9tY0.js.map → PageNotFound-CmT-Wr9m.js.map} +1 -1
  111. package/dist/{PageNotFound-DObWgQ0Z.cjs → PageNotFound-CxLUFoJa.cjs} +2 -2
  112. package/dist/{PageNotFound-DObWgQ0Z.cjs.map → PageNotFound-CxLUFoJa.cjs.map} +1 -1
  113. package/dist/{Pagination-Kj7ZDi3N.js → Pagination-BuP4N1bj.js} +2 -2
  114. package/dist/{Pagination-Kj7ZDi3N.js.map → Pagination-BuP4N1bj.js.map} +1 -1
  115. package/dist/{Pagination-S3hENjDy.cjs → Pagination-Dcs_Znx3.cjs} +2 -2
  116. package/dist/{Pagination-S3hENjDy.cjs.map → Pagination-Dcs_Znx3.cjs.map} +1 -1
  117. package/dist/{RemoveDialog-BZ0gUf1p.cjs → RemoveDialog-Cwtq9wAt.cjs} +2 -2
  118. package/dist/{RemoveDialog-BZ0gUf1p.cjs.map → RemoveDialog-Cwtq9wAt.cjs.map} +1 -1
  119. package/dist/{RemoveDialog-D9a0GttZ.js → RemoveDialog-DU6MqkO8.js} +4 -4
  120. package/dist/{RemoveDialog-D9a0GttZ.js.map → RemoveDialog-DU6MqkO8.js.map} +1 -1
  121. package/dist/{RichTextEditor-BX6twJ9D.cjs → RichTextEditor-GxbnzLRe.cjs} +2 -2
  122. package/dist/{RichTextEditor-BX6twJ9D.cjs.map → RichTextEditor-GxbnzLRe.cjs.map} +1 -1
  123. package/dist/{RichTextEditor-D05Czeif.js → RichTextEditor-k-NlWb4Y.js} +7 -7
  124. package/dist/{RichTextEditor-D05Czeif.js.map → RichTextEditor-k-NlWb4Y.js.map} +1 -1
  125. package/dist/{RootLayout-BR_pPr3d.cjs → RootLayout-4GV6dfdB.cjs} +2 -2
  126. package/dist/{RootLayout-BR_pPr3d.cjs.map → RootLayout-4GV6dfdB.cjs.map} +1 -1
  127. package/dist/{RootLayout-CgI03ZNA.js → RootLayout-BPSWgWlI.js} +11 -11
  128. package/dist/{RootLayout-CgI03ZNA.js.map → RootLayout-BPSWgWlI.js.map} +1 -1
  129. package/dist/{Select-BZPA2Ytp.js → Select-D7KJ-YMU.js} +3 -3
  130. package/dist/{Select-BZPA2Ytp.js.map → Select-D7KJ-YMU.js.map} +1 -1
  131. package/dist/{Select-Dpl8dq_9.cjs → Select-DjMZec8c.cjs} +2 -2
  132. package/dist/{Select-Dpl8dq_9.cjs.map → Select-DjMZec8c.cjs.map} +1 -1
  133. package/dist/{Sidebar-6SAObU0u.cjs → Sidebar-CT_NUo_7.cjs} +2 -2
  134. package/dist/{Sidebar-6SAObU0u.cjs.map → Sidebar-CT_NUo_7.cjs.map} +1 -1
  135. package/dist/{Sidebar-DEBW6lDA.js → Sidebar-Csd3iKbS.js} +3 -3
  136. package/dist/{Sidebar-DEBW6lDA.js.map → Sidebar-Csd3iKbS.js.map} +1 -1
  137. package/dist/{SpeedDial-Dex0rF2z.cjs → SpeedDial-CyiPagdu.cjs} +2 -2
  138. package/dist/{SpeedDial-Dex0rF2z.cjs.map → SpeedDial-CyiPagdu.cjs.map} +1 -1
  139. package/dist/{SpeedDial-C3PnANAx.js → SpeedDial-DEWzAGXi.js} +2 -2
  140. package/dist/{SpeedDial-C3PnANAx.js.map → SpeedDial-DEWzAGXi.js.map} +1 -1
  141. package/dist/{Stepper-0e90ZJaw.js → Stepper-CS6s0dMF.js} +2 -2
  142. package/dist/{Stepper-0e90ZJaw.js.map → Stepper-CS6s0dMF.js.map} +1 -1
  143. package/dist/{Stepper-yKwUaxOU.cjs → Stepper-PW7c45PV.cjs} +2 -2
  144. package/dist/{Stepper-yKwUaxOU.cjs.map → Stepper-PW7c45PV.cjs.map} +1 -1
  145. package/dist/{Table-BekBXEnW.cjs → Table-C_Ov-kvK.cjs} +2 -2
  146. package/dist/{Table-BekBXEnW.cjs.map → Table-C_Ov-kvK.cjs.map} +1 -1
  147. package/dist/{Table-KEOUL2u3.js → Table-IIAKXYOh.js} +15 -15
  148. package/dist/{Table-KEOUL2u3.js.map → Table-IIAKXYOh.js.map} +1 -1
  149. package/dist/{Tabs-DYUS945Y.cjs → Tabs-CaHTJ99w.cjs} +2 -2
  150. package/dist/{Tabs-DYUS945Y.cjs.map → Tabs-CaHTJ99w.cjs.map} +1 -1
  151. package/dist/{Tabs-BHk2B50R.js → Tabs-D3wztVB1.js} +2 -2
  152. package/dist/{Tabs-BHk2B50R.js.map → Tabs-D3wztVB1.js.map} +1 -1
  153. package/dist/{TagsField-DKh9SbG5.cjs → TagsField-BQIwSX5m.cjs} +2 -2
  154. package/dist/{TagsField-DKh9SbG5.cjs.map → TagsField-BQIwSX5m.cjs.map} +1 -1
  155. package/dist/{TagsField-BkC5OmIT.js → TagsField-BR9Z5pik.js} +4 -4
  156. package/dist/{TagsField-BkC5OmIT.js.map → TagsField-BR9Z5pik.js.map} +1 -1
  157. package/dist/{TextField-12HcFD7u.js → TextField-Bg4TwkVD.js} +3 -3
  158. package/dist/{TextField-12HcFD7u.js.map → TextField-Bg4TwkVD.js.map} +1 -1
  159. package/dist/{TextField-C9cPPP-B.cjs → TextField-fmt7aacg.cjs} +2 -2
  160. package/dist/{TextField-C9cPPP-B.cjs.map → TextField-fmt7aacg.cjs.map} +1 -1
  161. package/dist/{ThemeToggle-DIXVvqZ7.cjs → ThemeToggle-Cz5I2-DL.cjs} +2 -2
  162. package/dist/{ThemeToggle-DIXVvqZ7.cjs.map → ThemeToggle-Cz5I2-DL.cjs.map} +1 -1
  163. package/dist/{ThemeToggle-DUtDXl1Z.js → ThemeToggle-DEfXczDs.js} +3 -3
  164. package/dist/{ThemeToggle-DUtDXl1Z.js.map → ThemeToggle-DEfXczDs.js.map} +1 -1
  165. package/dist/{TimeColumns-BLhP81oI.js → TimeColumns-B-vtakk8.js} +2 -2
  166. package/dist/{TimeColumns-BLhP81oI.js.map → TimeColumns-B-vtakk8.js.map} +1 -1
  167. package/dist/{TimeColumns-CgjyPGjs.cjs → TimeColumns-IBmjExao.cjs} +2 -2
  168. package/dist/{TimeColumns-CgjyPGjs.cjs.map → TimeColumns-IBmjExao.cjs.map} +1 -1
  169. package/dist/{TimePicker-CNAXFtJa.cjs → TimePicker-B-c6uIaY.cjs} +2 -2
  170. package/dist/{TimePicker-CNAXFtJa.cjs.map → TimePicker-B-c6uIaY.cjs.map} +1 -1
  171. package/dist/{TimePicker-CJWjGVqT.js → TimePicker-i2RnZHV1.js} +5 -5
  172. package/dist/{TimePicker-CJWjGVqT.js.map → TimePicker-i2RnZHV1.js.map} +1 -1
  173. package/dist/{Toaster-B3Mut6eM.js → Toaster-Da8F_SFV.js} +2 -2
  174. package/dist/{Toaster-B3Mut6eM.js.map → Toaster-Da8F_SFV.js.map} +1 -1
  175. package/dist/{Toaster-CYt_Hvlh.cjs → Toaster-qdS8Urgy.cjs} +2 -2
  176. package/dist/{Toaster-CYt_Hvlh.cjs.map → Toaster-qdS8Urgy.cjs.map} +1 -1
  177. package/dist/TranslatedFields-C30ww45c.cjs +2 -0
  178. package/dist/TranslatedFields-C30ww45c.cjs.map +1 -0
  179. package/dist/TranslatedFields-Ck9JTF27.js +86 -0
  180. package/dist/TranslatedFields-Ck9JTF27.js.map +1 -0
  181. package/dist/{UserCard-Dve-LOSB.js → UserCard-0ZF29bkK.js} +3 -3
  182. package/dist/{UserCard-Dve-LOSB.js.map → UserCard-0ZF29bkK.js.map} +1 -1
  183. package/dist/{UserCard-sIguy8Jp.cjs → UserCard-C8rC_gzD.cjs} +2 -2
  184. package/dist/{UserCard-sIguy8Jp.cjs.map → UserCard-C8rC_gzD.cjs.map} +1 -1
  185. package/dist/components/Alert/index.cjs +1 -1
  186. package/dist/components/Alert/index.js +1 -1
  187. package/dist/components/AuthLayout/AuthLayout.d.cts +39 -0
  188. package/dist/components/AuthLayout/AuthLayout.d.ts +39 -0
  189. package/dist/components/AuthLayout/index.cjs +2 -0
  190. package/dist/components/AuthLayout/index.cjs.map +1 -0
  191. package/dist/components/AuthLayout/index.d.cts +2 -0
  192. package/dist/components/AuthLayout/index.d.ts +2 -0
  193. package/dist/components/AuthLayout/index.js +6 -0
  194. package/dist/components/AuthLayout/index.js.map +1 -0
  195. package/dist/components/Breadcrumbs/index.cjs +1 -1
  196. package/dist/components/Breadcrumbs/index.js +1 -1
  197. package/dist/components/Button/index.cjs +1 -1
  198. package/dist/components/Button/index.js +1 -1
  199. package/dist/components/Card/index.cjs +1 -1
  200. package/dist/components/Card/index.js +1 -1
  201. package/dist/components/Chip/index.cjs +1 -1
  202. package/dist/components/Chip/index.js +1 -1
  203. package/dist/components/CodeBlock/index.cjs +1 -1
  204. package/dist/components/CodeBlock/index.js +1 -1
  205. package/dist/components/ColorPicker/index.cjs +1 -1
  206. package/dist/components/ColorPicker/index.js +1 -1
  207. package/dist/components/CopyButton/CopyButton.d.cts +32 -0
  208. package/dist/components/CopyButton/CopyButton.d.ts +32 -0
  209. package/dist/components/CopyButton/index.cjs +2 -0
  210. package/dist/components/CopyButton/index.cjs.map +1 -0
  211. package/dist/components/CopyButton/index.d.cts +2 -0
  212. package/dist/components/CopyButton/index.d.ts +2 -0
  213. package/dist/components/CopyButton/index.js +6 -0
  214. package/dist/components/CopyButton/index.js.map +1 -0
  215. package/dist/components/DatePicker/index.cjs +1 -1
  216. package/dist/components/DatePicker/index.js +1 -1
  217. package/dist/components/DateTimePicker/index.cjs +1 -1
  218. package/dist/components/DateTimePicker/index.js +1 -1
  219. package/dist/components/EmptyState/index.cjs +1 -1
  220. package/dist/components/EmptyState/index.js +1 -1
  221. package/dist/components/FileCard/FileCard.d.cts +45 -0
  222. package/dist/components/FileCard/FileCard.d.ts +45 -0
  223. package/dist/components/FileCard/index.cjs +2 -0
  224. package/dist/components/FileCard/index.cjs.map +1 -0
  225. package/dist/components/FileCard/index.d.cts +2 -0
  226. package/dist/components/FileCard/index.d.ts +2 -0
  227. package/dist/components/FileCard/index.js +6 -0
  228. package/dist/components/FileCard/index.js.map +1 -0
  229. package/dist/components/FileUploader/index.cjs +1 -1
  230. package/dist/components/FileUploader/index.js +1 -1
  231. package/dist/components/Flag/index.cjs +1 -1
  232. package/dist/components/Flag/index.js +1 -1
  233. package/dist/components/FullscreenToggle/index.cjs +1 -1
  234. package/dist/components/FullscreenToggle/index.js +1 -1
  235. package/dist/components/IconButton/index.cjs +1 -1
  236. package/dist/components/IconButton/index.js +1 -1
  237. package/dist/components/Loader/index.cjs +1 -1
  238. package/dist/components/Loader/index.js +1 -1
  239. package/dist/components/Masonry/Masonry.d.cts +14 -7
  240. package/dist/components/Masonry/Masonry.d.ts +14 -7
  241. package/dist/components/Masonry/index.cjs +1 -1
  242. package/dist/components/Masonry/index.js +1 -1
  243. package/dist/components/Modal/index.cjs +1 -1
  244. package/dist/components/Modal/index.js +1 -1
  245. package/dist/components/MultiSelect/index.cjs +1 -1
  246. package/dist/components/MultiSelect/index.js +1 -1
  247. package/dist/components/NumberField/index.cjs +1 -1
  248. package/dist/components/NumberField/index.js +1 -1
  249. package/dist/components/OtpField/index.cjs +1 -1
  250. package/dist/components/OtpField/index.js +1 -1
  251. package/dist/components/PageLayout/index.cjs +1 -1
  252. package/dist/components/PageLayout/index.js +1 -1
  253. package/dist/components/PageNotFound/index.cjs +1 -1
  254. package/dist/components/PageNotFound/index.js +1 -1
  255. package/dist/components/Pagination/index.cjs +1 -1
  256. package/dist/components/Pagination/index.js +1 -1
  257. package/dist/components/RemoveDialog/index.cjs +1 -1
  258. package/dist/components/RemoveDialog/index.js +1 -1
  259. package/dist/components/RichTextEditor/index.cjs +1 -1
  260. package/dist/components/RichTextEditor/index.js +1 -1
  261. package/dist/components/RootLayout/index.cjs +1 -1
  262. package/dist/components/RootLayout/index.js +1 -1
  263. package/dist/components/Select/index.cjs +1 -1
  264. package/dist/components/Select/index.js +1 -1
  265. package/dist/components/Sidebar/index.cjs +1 -1
  266. package/dist/components/Sidebar/index.js +1 -1
  267. package/dist/components/SpeedDial/index.cjs +1 -1
  268. package/dist/components/SpeedDial/index.js +1 -1
  269. package/dist/components/Stepper/index.cjs +1 -1
  270. package/dist/components/Stepper/index.js +1 -1
  271. package/dist/components/Table/index.cjs +1 -1
  272. package/dist/components/Table/index.js +1 -1
  273. package/dist/components/Tabs/index.cjs +1 -1
  274. package/dist/components/Tabs/index.js +1 -1
  275. package/dist/components/TagsField/index.cjs +1 -1
  276. package/dist/components/TagsField/index.js +1 -1
  277. package/dist/components/TextField/index.cjs +1 -1
  278. package/dist/components/TextField/index.js +1 -1
  279. package/dist/components/ThemeToggle/index.cjs +1 -1
  280. package/dist/components/ThemeToggle/index.js +1 -1
  281. package/dist/components/TimePicker/index.cjs +1 -1
  282. package/dist/components/TimePicker/index.js +1 -1
  283. package/dist/components/Toast/index.cjs +1 -1
  284. package/dist/components/Toast/index.js +1 -1
  285. package/dist/components/TranslatedFields/TranslatedFields.d.cts +9 -2
  286. package/dist/components/TranslatedFields/TranslatedFields.d.ts +9 -2
  287. package/dist/components/TranslatedFields/index.cjs +1 -1
  288. package/dist/components/TranslatedFields/index.js +1 -1
  289. package/dist/components/UserCard/index.cjs +1 -1
  290. package/dist/components/UserCard/index.js +1 -1
  291. package/dist/components/index.d.cts +3 -0
  292. package/dist/components/index.d.ts +3 -0
  293. package/dist/entries/components.cjs +1 -1
  294. package/dist/entries/components.js +147 -141
  295. package/dist/entries/components.js.map +1 -1
  296. package/dist/entries/hooks.cjs +1 -1
  297. package/dist/entries/hooks.d.cts +2 -0
  298. package/dist/entries/hooks.d.ts +2 -0
  299. package/dist/entries/hooks.js +6 -4
  300. package/dist/entries/hooks.js.map +1 -1
  301. package/dist/entries/i18n.cjs +1 -1
  302. package/dist/entries/i18n.js +2 -2
  303. package/dist/entries/theme.cjs +1 -1
  304. package/dist/entries/theme.js +1 -1
  305. package/dist/hooks/index.d.cts +2 -0
  306. package/dist/hooks/index.d.ts +2 -0
  307. package/dist/hooks/useClipboard.d.cts +28 -0
  308. package/dist/hooks/useClipboard.d.ts +28 -0
  309. package/dist/i18n/messages.d.cts +3 -0
  310. package/dist/i18n/messages.d.ts +3 -0
  311. package/dist/index.cjs +1 -1
  312. package/dist/index.css +1 -1
  313. package/dist/index.js +196 -188
  314. package/dist/index.js.map +1 -1
  315. package/dist/{messages-CVISEA5N.js → messages-BOKick2l.js} +35 -14
  316. package/dist/messages-BOKick2l.js.map +1 -0
  317. package/dist/{messages-BJiUtJ2E.cjs → messages-Jxz2YMcA.cjs} +9 -9
  318. package/dist/messages-Jxz2YMcA.cjs.map +1 -0
  319. package/dist/useClipboard-BjTIX-4g.cjs +2 -0
  320. package/dist/useClipboard-BjTIX-4g.cjs.map +1 -0
  321. package/dist/useClipboard-CEw_Juiq.js +23 -0
  322. package/dist/useClipboard-CEw_Juiq.js.map +1 -0
  323. package/package.json +4 -3
  324. package/dist/Masonry-BObKcPmo.js +0 -82
  325. package/dist/Masonry-BObKcPmo.js.map +0 -1
  326. package/dist/Masonry-BVphuk2X.cjs +0 -2
  327. package/dist/Masonry-BVphuk2X.cjs.map +0 -1
  328. package/dist/TranslatedFields-BEaS1esD.js +0 -82
  329. package/dist/TranslatedFields-BEaS1esD.js.map +0 -1
  330. package/dist/TranslatedFields-DshwXj6d.cjs +0 -2
  331. package/dist/TranslatedFields-DshwXj6d.cjs.map +0 -1
  332. package/dist/messages-BJiUtJ2E.cjs.map +0 -1
  333. package/dist/messages-CVISEA5N.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton-ChUfK0pG.cjs","sources":["../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './IconButton.module.css'\n\nexport type IconButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type IconButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: IconButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — square: width === height === `--tz-control-height-*` (matches `Button` heights). */\n size?: IconButtonSize\n /** Shows the loader in the icon's place and blocks interaction (also sets the native `disabled`). */\n loading?: boolean\n /** Circular shape instead of the default rounded square. */\n rounded?: boolean\n /** Ignores all interaction (no clicks, hover or focus) while keeping the normal look — unlike `disabled`, it's not dimmed. */\n nonClickable?: boolean\n /** The icon to render — typically an `<Icon />`. Swapped for the loader while `loading`. */\n children?: ReactNode\n}\n\n/**\n * A square, text-less button for a single icon. Shares `Button`'s variants,\n * colors and sizing, but its width equals its height (the matching\n * `--tz-control-height-*`). Pass an `<Icon />` (or any node) as the child;\n * while `loading` it's replaced by the `Loader`. Provide an `aria-label` since\n * there's no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n rounded = false,\n disabled = false,\n nonClickable = false,\n className,\n style,\n type = 'button',\n tabIndex,\n children,\n ...props\n },\n ref,\n) {\n // size the icon child to match the button (an explicit icon `size` still wins)\n const icon =\n isValidElement(children) && !loading\n ? cloneElement(children as ReactElement<{ size?: IconButtonSize }>, {\n size: (children.props as { size?: IconButtonSize }).size ?? size,\n })\n : children\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n aria-disabled={nonClickable || undefined}\n tabIndex={nonClickable ? -1 : tabIndex}\n className={clsx(\n styles.iconButton,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n nonClickable && styles.nonClickable,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {loading ? <Loader size={size} aria-hidden=\"true\" /> : icon}\n </button>\n )\n})\n"],"names":["IconButton","forwardRef","variant","color","size","loading","rounded","disabled","nonClickable","className","style","type","tabIndex","children","props","ref","icon","isValidElement","cloneElement","jsx","clsx","styles","Loader"],"mappings":"+eAyCaA,EAAaC,EAAAA,WAA+C,SACvE,CACE,QAAAC,EAAU,YACV,MAAAC,EAAQ,SACR,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,aAAAC,EAAe,GACf,UAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,SACP,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EACJC,EAAAA,eAAeJ,CAAQ,GAAK,CAACR,EACzBa,EAAAA,aAAaL,EAAqD,CAChE,KAAOA,EAAS,MAAoC,MAAQT,CAAA,CAC7D,EACDS,EAEN,OACEM,EAAAA,IAAC,SAAA,CACC,IAAAJ,EACA,KAAAJ,EACA,SAAUJ,GAAYF,EACtB,YAAWA,GAAW,OACtB,gBAAeG,GAAgB,OAC/B,SAAUA,EAAe,GAAKI,EAC9B,UAAWQ,EAAAA,KACTC,EAAO,WACPA,EAAOnB,CAAO,EACdmB,EAAOjB,CAAI,EACXE,GAAWe,EAAO,QAClBhB,GAAWgB,EAAO,QAClBd,GAAYc,EAAO,SACnBb,GAAgBa,EAAO,aACvBZ,CAAA,EAEF,MACE,CACE,eAAgB,kBAAkBN,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGO,CAAA,EAGN,GAAGI,EAEH,WAAUK,EAAAA,IAACG,EAAAA,OAAA,CAAO,KAAAlB,EAAY,cAAY,OAAO,EAAKY,CAAA,CAAA,CAG7D,CAAC"}
1
+ {"version":3,"file":"IconButton-BoY2y_pV.cjs","sources":["../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './IconButton.module.css'\n\nexport type IconButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type IconButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: IconButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — square: width === height === `--tz-control-height-*` (matches `Button` heights). */\n size?: IconButtonSize\n /** Shows the loader in the icon's place and blocks interaction (also sets the native `disabled`). */\n loading?: boolean\n /** Circular shape instead of the default rounded square. */\n rounded?: boolean\n /** Ignores all interaction (no clicks, hover or focus) while keeping the normal look — unlike `disabled`, it's not dimmed. */\n nonClickable?: boolean\n /** The icon to render — typically an `<Icon />`. Swapped for the loader while `loading`. */\n children?: ReactNode\n}\n\n/**\n * A square, text-less button for a single icon. Shares `Button`'s variants,\n * colors and sizing, but its width equals its height (the matching\n * `--tz-control-height-*`). Pass an `<Icon />` (or any node) as the child;\n * while `loading` it's replaced by the `Loader`. Provide an `aria-label` since\n * there's no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n rounded = false,\n disabled = false,\n nonClickable = false,\n className,\n style,\n type = 'button',\n tabIndex,\n children,\n ...props\n },\n ref,\n) {\n // size the icon child to match the button (an explicit icon `size` still wins)\n const icon =\n isValidElement(children) && !loading\n ? cloneElement(children as ReactElement<{ size?: IconButtonSize }>, {\n size: (children.props as { size?: IconButtonSize }).size ?? size,\n })\n : children\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n aria-disabled={nonClickable || undefined}\n tabIndex={nonClickable ? -1 : tabIndex}\n className={clsx(\n styles.iconButton,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n nonClickable && styles.nonClickable,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {loading ? <Loader size={size} aria-hidden=\"true\" /> : icon}\n </button>\n )\n})\n"],"names":["IconButton","forwardRef","variant","color","size","loading","rounded","disabled","nonClickable","className","style","type","tabIndex","children","props","ref","icon","isValidElement","cloneElement","jsx","clsx","styles","Loader"],"mappings":"+eAyCaA,EAAaC,EAAAA,WAA+C,SACvE,CACE,QAAAC,EAAU,YACV,MAAAC,EAAQ,SACR,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,aAAAC,EAAe,GACf,UAAAC,EACA,MAAAC,EACA,KAAAC,EAAO,SACP,SAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EACJC,EAAAA,eAAeJ,CAAQ,GAAK,CAACR,EACzBa,EAAAA,aAAaL,EAAqD,CAChE,KAAOA,EAAS,MAAoC,MAAQT,CAAA,CAC7D,EACDS,EAEN,OACEM,EAAAA,IAAC,SAAA,CACC,IAAAJ,EACA,KAAAJ,EACA,SAAUJ,GAAYF,EACtB,YAAWA,GAAW,OACtB,gBAAeG,GAAgB,OAC/B,SAAUA,EAAe,GAAKI,EAC9B,UAAWQ,EAAAA,KACTC,EAAO,WACPA,EAAOnB,CAAO,EACdmB,EAAOjB,CAAI,EACXE,GAAWe,EAAO,QAClBhB,GAAWgB,EAAO,QAClBd,GAAYc,EAAO,SACnBb,GAAgBa,EAAO,aACvBZ,CAAA,EAEF,MACE,CACE,eAAgB,kBAAkBN,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGO,CAAA,EAGN,GAAGI,EAEH,WAAUK,EAAAA,IAACG,EAAAA,OAAA,CAAO,KAAAlB,EAAY,cAAY,OAAO,EAAKY,CAAA,CAAA,CAG7D,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const c=require("react/jsx-runtime"),d=require("react"),_=require("clsx"),q=require("./ConfigProvider-DFy6pL-C.cjs"),i="_loader_qv0xq_2",u="_sm_qv0xq_16",m="_md_qv0xq_22",x="_lg_qv0xq_28",s={loader:i,"tz-loader-spin":"_tz-loader-spin_qv0xq_1",sm:u,md:m,lg:x},v=d.forwardRef(function({size:o="md",color:e,className:t,style:r,...a},l){const n=q.useT();return c.jsx("span",{ref:l,role:"status","aria-label":n("loader.label"),...a,className:_.clsx(s.loader,s[o],t),style:e?{color:`var(--tz-color-${e})`,...r}:r})});exports.Loader=v;
2
- //# sourceMappingURL=Loader-plA9fgHf.cjs.map
1
+ "use strict";const c=require("react/jsx-runtime"),d=require("react"),_=require("clsx"),q=require("./ConfigProvider-BHNx-NHV.cjs"),i="_loader_qv0xq_2",u="_sm_qv0xq_16",m="_md_qv0xq_22",x="_lg_qv0xq_28",s={loader:i,"tz-loader-spin":"_tz-loader-spin_qv0xq_1",sm:u,md:m,lg:x},v=d.forwardRef(function({size:o="md",color:e,className:t,style:r,...a},l){const n=q.useT();return c.jsx("span",{ref:l,role:"status","aria-label":n("loader.label"),...a,className:_.clsx(s.loader,s[o],t),style:e?{color:`var(--tz-color-${e})`,...r}:r})});exports.Loader=v;
2
+ //# sourceMappingURL=Loader-Cwb1bOHj.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader-plA9fgHf.cjs","sources":["../src/components/Loader/Loader.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Loader.module.css'\n\nexport type LoaderSize = 'sm' | 'md' | 'lg'\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {\n /** Preset size — matches the Icon sizes: `sm` 14px · `md` 18px · `lg` 22px. Defaults to `md`. */\n size?: LoaderSize\n /** Theme palette token used to color the spinner. Omit to inherit the surrounding text color (`currentColor`). */\n color?: ThemeColor\n}\n\n/**\n * A circular spinner. Works standalone as a loading indicator or inside a\n * `Button`, where it inherits the button color via `currentColor` unless an\n * explicit `color` is given.\n */\nexport const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(\n { size = 'md', color, className, style, ...props },\n ref,\n) {\n const t = useT()\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label={t('loader.label')}\n {...props}\n className={clsx(styles.loader, styles[size], className)}\n style={color ? ({ color: `var(--tz-color-${color})`, ...style } as CSSProperties) : style}\n />\n )\n})\n"],"names":["Loader","forwardRef","size","color","className","style","props","ref","t","useT","jsx","clsx","styles"],"mappings":"gRAmBaA,EAASC,EAAAA,WAAyC,SAC7D,CAAE,KAAAC,EAAO,KAAM,MAAAC,EAAO,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAA,EAC3CC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACV,OACEC,EAAAA,IAAC,OAAA,CACC,IAAAH,EACA,KAAK,SACL,aAAYC,EAAE,cAAc,EAC3B,GAAGF,EACJ,UAAWK,EAAAA,KAAKC,EAAO,OAAQA,EAAOV,CAAI,EAAGE,CAAS,EACtD,MAAOD,EAAS,CAAE,MAAO,kBAAkBA,CAAK,IAAK,GAAGE,GAA4BA,CAAA,CAAA,CAG1F,CAAC"}
1
+ {"version":3,"file":"Loader-Cwb1bOHj.cjs","sources":["../src/components/Loader/Loader.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Loader.module.css'\n\nexport type LoaderSize = 'sm' | 'md' | 'lg'\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {\n /** Preset size — matches the Icon sizes: `sm` 14px · `md` 18px · `lg` 22px. Defaults to `md`. */\n size?: LoaderSize\n /** Theme palette token used to color the spinner. Omit to inherit the surrounding text color (`currentColor`). */\n color?: ThemeColor\n}\n\n/**\n * A circular spinner. Works standalone as a loading indicator or inside a\n * `Button`, where it inherits the button color via `currentColor` unless an\n * explicit `color` is given.\n */\nexport const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(\n { size = 'md', color, className, style, ...props },\n ref,\n) {\n const t = useT()\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label={t('loader.label')}\n {...props}\n className={clsx(styles.loader, styles[size], className)}\n style={color ? ({ color: `var(--tz-color-${color})`, ...style } as CSSProperties) : style}\n />\n )\n})\n"],"names":["Loader","forwardRef","size","color","className","style","props","ref","t","useT","jsx","clsx","styles"],"mappings":"gRAmBaA,EAASC,EAAAA,WAAyC,SAC7D,CAAE,KAAAC,EAAO,KAAM,MAAAC,EAAO,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAA,EAC3CC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACV,OACEC,EAAAA,IAAC,OAAA,CACC,IAAAH,EACA,KAAK,SACL,aAAYC,EAAE,cAAc,EAC3B,GAAGF,EACJ,UAAWK,EAAAA,KAAKC,EAAO,OAAQA,EAAOV,CAAI,EAAGE,CAAS,EACtD,MAAOD,EAAS,CAAE,MAAO,kBAAkBA,CAAK,IAAK,GAAGE,GAA4BA,CAAA,CAAA,CAG1F,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _ } from "react/jsx-runtime";
2
2
  import { forwardRef as d } from "react";
3
3
  import { clsx as n } from "clsx";
4
- import { a as c } from "./ConfigProvider-sEZzNTeU.js";
4
+ import { a as c } from "./ConfigProvider-BYruQYHC.js";
5
5
  const q = "_loader_qv0xq_2", i = "_sm_qv0xq_16", p = "_md_qv0xq_22", x = "_lg_qv0xq_28", s = {
6
6
  loader: q,
7
7
  "tz-loader-spin": "_tz-loader-spin_qv0xq_1",
@@ -25,4 +25,4 @@ const q = "_loader_qv0xq_2", i = "_sm_qv0xq_16", p = "_md_qv0xq_22", x = "_lg_qv
25
25
  export {
26
26
  L
27
27
  };
28
- //# sourceMappingURL=Loader-DFlpw5Zc.js.map
28
+ //# sourceMappingURL=Loader-UzzqvFyo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader-DFlpw5Zc.js","sources":["../src/components/Loader/Loader.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Loader.module.css'\n\nexport type LoaderSize = 'sm' | 'md' | 'lg'\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {\n /** Preset size — matches the Icon sizes: `sm` 14px · `md` 18px · `lg` 22px. Defaults to `md`. */\n size?: LoaderSize\n /** Theme palette token used to color the spinner. Omit to inherit the surrounding text color (`currentColor`). */\n color?: ThemeColor\n}\n\n/**\n * A circular spinner. Works standalone as a loading indicator or inside a\n * `Button`, where it inherits the button color via `currentColor` unless an\n * explicit `color` is given.\n */\nexport const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(\n { size = 'md', color, className, style, ...props },\n ref,\n) {\n const t = useT()\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label={t('loader.label')}\n {...props}\n className={clsx(styles.loader, styles[size], className)}\n style={color ? ({ color: `var(--tz-color-${color})`, ...style } as CSSProperties) : style}\n />\n )\n})\n"],"names":["Loader","forwardRef","size","color","className","style","props","ref","t","useT","jsx","clsx","styles"],"mappings":";;;;;;;;;;GAmBaA,IAASC,EAAyC,SAC7D,EAAE,MAAAC,IAAO,MAAM,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GAC3CC,GACA;AACA,QAAMC,IAAIC,EAAA;AACV,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,MAAK;AAAA,MACL,cAAYC,EAAE,cAAc;AAAA,MAC3B,GAAGF;AAAA,MACJ,WAAWK,EAAKC,EAAO,QAAQA,EAAOV,CAAI,GAAGE,CAAS;AAAA,MACtD,OAAOD,IAAS,EAAE,OAAO,kBAAkBA,CAAK,KAAK,GAAGE,MAA4BA;AAAA,IAAA;AAAA,EAAA;AAG1F,CAAC;"}
1
+ {"version":3,"file":"Loader-UzzqvFyo.js","sources":["../src/components/Loader/Loader.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Loader.module.css'\n\nexport type LoaderSize = 'sm' | 'md' | 'lg'\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {\n /** Preset size — matches the Icon sizes: `sm` 14px · `md` 18px · `lg` 22px. Defaults to `md`. */\n size?: LoaderSize\n /** Theme palette token used to color the spinner. Omit to inherit the surrounding text color (`currentColor`). */\n color?: ThemeColor\n}\n\n/**\n * A circular spinner. Works standalone as a loading indicator or inside a\n * `Button`, where it inherits the button color via `currentColor` unless an\n * explicit `color` is given.\n */\nexport const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(\n { size = 'md', color, className, style, ...props },\n ref,\n) {\n const t = useT()\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label={t('loader.label')}\n {...props}\n className={clsx(styles.loader, styles[size], className)}\n style={color ? ({ color: `var(--tz-color-${color})`, ...style } as CSSProperties) : style}\n />\n )\n})\n"],"names":["Loader","forwardRef","size","color","className","style","props","ref","t","useT","jsx","clsx","styles"],"mappings":";;;;;;;;;;GAmBaA,IAASC,EAAyC,SAC7D,EAAE,MAAAC,IAAO,MAAM,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GAC3CC,GACA;AACA,QAAMC,IAAIC,EAAA;AACV,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,MAAK;AAAA,MACL,cAAYC,EAAE,cAAc;AAAA,MAC3B,GAAGF;AAAA,MACJ,WAAWK,EAAKC,EAAO,QAAQA,EAAOV,CAAI,GAAGE,CAAS;AAAA,MACtD,OAAOD,IAAS,EAAE,OAAO,kBAAkBA,CAAK,KAAK,GAAGE,MAA4BA;AAAA,IAAA;AAAA,EAAA;AAG1F,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const v=require("react/jsx-runtime"),s=require("react"),Q=require("./Flex-C6tHC8n7.cjs"),P=require("./breakpoints-Dpnh6BbG.cjs"),X=require("./useMediaQuery-CHMrI6Dy.cjs"),j={xxs:4,xs:8,sm:16,md:24,lg:32,xl:40,xxl:48};function _(r){if(r==null)return 0;if(typeof r=="number")return r;if(r in j)return j[r];const a=parseFloat(r);return Number.isFinite(a)?a:0}const D=(r,a)=>r.length===a.length&&r.every((h,y)=>h===a[y]),G=s.forwardRef(function({columns:a=3,minColumnWidth:h,gap:y="md",padding:A,className:B,style:L,children:q,...O},x){const R=s.useMemo(()=>s.Children.toArray(q),[q]),u=R.length,w=X.useBreakpointMatches(),H=Math.max(1,P.resolveResponsive(a,w)??1),c=_(P.resolveResponsive(y,w)),M=s.useRef(null),S=s.useRef([]),[g,T]=s.useState(0),[d,W]=s.useState({top:0,left:0,bottom:0}),[z,$]=s.useState([]),I=s.useCallback(t=>{M.current=t,typeof x=="function"?x(t):x&&(x.current=t)},[x]),l=h!=null?g>0?Math.max(1,Math.floor((g+c)/(h+c))):1:H,m=l>0&&g>0?(g-(l-1)*c)/l:0,{positions:F,layoutHeight:N}=s.useMemo(()=>{if(m<=0)return{positions:[],layoutHeight:0};const t=new Array(l).fill(0),e=[];for(let f=0;f<u;f++){let i=0;for(let p=1;p<l;p++)t[p]<t[i]&&(i=p);e.push({x:d.left+i*(m+c),y:d.top+t[i]}),t[i]+=(z[f]||0)+c}const n=t.reduce((f,i)=>Math.max(f,i),0);return{positions:e,layoutHeight:n>0?n-c:0}},[m,l,c,u,z,d.left,d.top]),C=m>0&&F.length===u,b=s.useCallback(()=>{const t=M.current;if(!t)return;const e=getComputedStyle(t),n=parseFloat(e.paddingLeft)||0,f=parseFloat(e.paddingRight)||0,i=parseFloat(e.paddingTop)||0,p=parseFloat(e.paddingBottom)||0,E=Math.max(0,t.clientWidth-n-f);T(o=>o===E?o:E),W(o=>o.top===i&&o.left===n&&o.bottom===p?o:{top:i,left:n,bottom:p});const k=S.current.slice(0,u).map(o=>o?o.offsetHeight:0);$(o=>D(o,k)?o:k)},[u]);return s.useLayoutEffect(b,[b,R,H,h,c]),s.useEffect(()=>{const t=M.current;if(!t||typeof ResizeObserver>"u")return;const e=new ResizeObserver(()=>b());return e.observe(t),S.current.slice(0,u).forEach(n=>n&&e.observe(n)),()=>e.disconnect()},[b,u]),v.jsx("div",{ref:I,className:B,"data-columns":l,style:{position:"relative",boxSizing:"border-box",width:"100%",padding:Q.space(A),height:C?d.top+N+d.bottom:void 0,...L},...O,children:R.map((t,e)=>v.jsx("div",{ref:n=>{S.current[e]=n},style:C?{position:"absolute",top:0,left:0,width:m,transform:`translate(${F[e].x}px, ${F[e].y}px)`,boxSizing:"border-box"}:{boxSizing:"border-box"},children:t},e))})});exports.Masonry=G;
2
+ //# sourceMappingURL=Masonry-9LrJKlhI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Masonry-9LrJKlhI.cjs","sources":["../src/components/Masonry/Masonry.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\nimport { resolveResponsive, type Responsive } from '../../theme/breakpoints'\nimport { useBreakpointMatches } from '../../hooks/useMediaQuery'\n\n// `--tz-space-*` scale in px — the gap must be a number to bake into item positions\nconst SPACE_PX: Record<string, number> = {\n xxs: 4,\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n xxl: 48,\n}\n\n/** Resolve a `Spacing` gap to a px number for layout math (token → scale, number → px, else parse). */\nfunction spacePx(value: Spacing | undefined): number {\n if (value == null) return 0\n if (typeof value === 'number') return value\n if (value in SPACE_PX) return SPACE_PX[value]\n const n = parseFloat(value)\n return Number.isFinite(n) ? n : 0\n}\n\nexport interface MasonryProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Number of columns. Either a fixed number, or a **desktop-first** map keyed by the shared\n * `Breakpoint`s (`xs`/`sm`/`md`/`lg`/`xl`) — each entry applies at that breakpoint's max-width and\n * below, until a smaller one overrides it, with the largest defined key as the base for wider screens.\n * Defaults to `3`. Ignored when `minColumnWidth` is set.\n *\n * @example columns={2} // always 2\n * @example columns={{ xs: 1, md: 3 }} // 1 on phones (≤767.98), 3 up to md, 3 above\n */\n columns?: Responsive<number>\n /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */\n minColumnWidth?: number\n /**\n * Gap between items, horizontally and vertically. Either a single value (a `--tz-space-*` key, a px\n * number, or a px-like CSS value) or a **desktop-first** breakpoint map — same resolution as `columns`.\n * Defaults to `md`.\n *\n * @example gap=\"md\"\n * @example gap={{ xs: 'sm', md: 'lg' }} // tighter on phones, looser from md up\n */\n gap?: Responsive<Spacing>\n /** Padding around the grid (token key, px number, or CSS value). */\n padding?: Spacing\n /** The items to lay out. */\n children?: ReactNode\n}\n\nconst arraysEqual = (a: number[], b: number[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * A masonry layout — packs items of varying heights into balanced columns, always adding the next item\n * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed\n * grid. Reading order flows left-to-right across the columns.\n *\n * **Every child is rendered once, in a single stable container, and placed by absolute positioning**\n * (measured in the DOM; a `ResizeObserver` re-lays-out on width / content changes). Resizing only moves\n * each child (its `transform`) — a child **never** changes DOM parent, so React never remounts it and\n * **child state is preserved** across resizes (an input's text, a nested widget's items, focus). Until\n * the first measure it falls back to a single stacked column (SSR / first paint), then switches to the\n * measured layout — same elements, no remount.\n *\n * `columns` is a fixed number or a desktop-first breakpoint map (`{ xs: 1, md: 3 }`); `minColumnWidth`\n * is a responsive alternative (overrides `columns`); `gap` spaces items on both axes and is itself\n * responsive the same way. Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer\n * `style` merges last.\n */\nexport const Masonry = forwardRef<HTMLDivElement, MasonryProps>(function Masonry(\n { columns = 3, minColumnWidth, gap = 'md', padding, className, style, children, ...props },\n ref,\n) {\n const items = useMemo(() => Children.toArray(children), [children])\n const count = items.length\n\n const matches = useBreakpointMatches()\n const resolvedColumns = Math.max(1, resolveResponsive(columns, matches) ?? 1)\n const gapPx = spacePx(resolveResponsive(gap, matches))\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n\n // measured: the content width + the container's own padding insets + each item's height\n const [width, setWidth] = useState(0)\n const [inset, setInset] = useState({ top: 0, left: 0, bottom: 0 })\n const [heights, setHeights] = useState<number[]>([])\n\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n // column count: from minColumnWidth (measured) or the resolved fixed/responsive `columns`\n const colCount =\n minColumnWidth != null\n ? width > 0\n ? Math.max(1, Math.floor((width + gapPx) / (minColumnWidth + gapPx)))\n : 1\n : resolvedColumns\n const colWidth = colCount > 0 && width > 0 ? (width - (colCount - 1) * gapPx) / colCount : 0\n\n // greedily place each item (in order) into the shortest column, as an absolute (x, y)\n const { positions, layoutHeight } = useMemo(() => {\n if (colWidth <= 0) return { positions: [] as Array<{ x: number; y: number }>, layoutHeight: 0 }\n const colH = new Array(colCount).fill(0)\n const pos: Array<{ x: number; y: number }> = []\n for (let i = 0; i < count; i++) {\n let min = 0\n for (let c = 1; c < colCount; c++) if (colH[c] < colH[min]) min = c\n pos.push({ x: inset.left + min * (colWidth + gapPx), y: inset.top + colH[min] })\n colH[min] += (heights[i] || 0) + gapPx\n }\n const tallest = colH.reduce((a, b) => Math.max(a, b), 0)\n return { positions: pos, layoutHeight: tallest > 0 ? tallest - gapPx : 0 }\n }, [colWidth, colCount, gapPx, count, heights, inset.left, inset.top])\n\n const positioned = colWidth > 0 && positions.length === count\n\n // measure the content width, padding insets, and item heights (before paint + on resize)\n const measure = useCallback(() => {\n const root = rootRef.current\n if (!root) return\n const cs = getComputedStyle(root)\n const padL = parseFloat(cs.paddingLeft) || 0\n const padR = parseFloat(cs.paddingRight) || 0\n const padT = parseFloat(cs.paddingTop) || 0\n const padB = parseFloat(cs.paddingBottom) || 0\n const contentW = Math.max(0, root.clientWidth - padL - padR)\n\n setWidth((prev) => (prev === contentW ? prev : contentW))\n setInset((prev) =>\n prev.top === padT && prev.left === padL && prev.bottom === padB\n ? prev\n : { top: padT, left: padL, bottom: padB },\n )\n const next = itemRefs.current.slice(0, count).map((el) => (el ? el.offsetHeight : 0))\n setHeights((prev) => (arraysEqual(prev, next) ? prev : next))\n }, [count])\n\n // measure before paint (mount + when the item set / column count / gap changes)\n useLayoutEffect(measure, [measure, items, resolvedColumns, minColumnWidth, gapPx])\n\n // re-lay-out on container resize and on any item resizing (image loads, dynamic content, …)\n useEffect(() => {\n const root = rootRef.current\n if (!root || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver(() => measure())\n ro.observe(root)\n itemRefs.current.slice(0, count).forEach((el) => el && ro.observe(el))\n return () => ro.disconnect()\n }, [measure, count])\n\n return (\n <div\n ref={setRootRef}\n className={className}\n data-columns={colCount}\n style={{\n position: 'relative',\n boxSizing: 'border-box',\n width: '100%',\n padding: space(padding),\n height: positioned ? inset.top + layoutHeight + inset.bottom : undefined,\n ...style,\n }}\n {...props}\n >\n {items.map((item, i) => (\n <div\n key={i}\n ref={(el) => {\n itemRefs.current[i] = el\n }}\n style={\n positioned\n ? ({\n position: 'absolute',\n top: 0,\n left: 0,\n width: colWidth,\n transform: `translate(${positions[i].x}px, ${positions[i].y}px)`,\n boxSizing: 'border-box',\n } as CSSProperties)\n : ({ boxSizing: 'border-box' } as CSSProperties)\n }\n >\n {item}\n </div>\n ))}\n </div>\n )\n})\n"],"names":["SPACE_PX","spacePx","value","n","arraysEqual","a","b","v","i","Masonry","forwardRef","columns","minColumnWidth","gap","padding","className","style","children","props","ref","items","useMemo","Children","count","matches","useBreakpointMatches","resolvedColumns","resolveResponsive","gapPx","rootRef","useRef","itemRefs","width","setWidth","useState","inset","setInset","heights","setHeights","setRootRef","useCallback","node","colCount","colWidth","positions","layoutHeight","colH","pos","min","c","tallest","positioned","measure","root","cs","padL","padR","padT","padB","contentW","prev","next","el","useLayoutEffect","useEffect","ro","jsx","space","item"],"mappings":"wLAkBMA,EAAmC,CACvC,IAAK,EACL,GAAI,EACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,IAAK,EACP,EAGA,SAASC,EAAQC,EAAoC,CACnD,GAAIA,GAAS,KAAM,MAAO,GAC1B,GAAI,OAAOA,GAAU,SAAU,OAAOA,EACtC,GAAIA,KAASF,EAAU,OAAOA,EAASE,CAAK,EAC5C,MAAMC,EAAI,WAAWD,CAAK,EAC1B,OAAO,OAAO,SAASC,CAAC,EAAIA,EAAI,CAClC,CA8BA,MAAMC,EAAc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EAAUpC,CAAC,EAAE,CAAC,MAC3D,UAAW,YAAA,EAEZ,CAAE,UAAW,YAAA,EAGnB,SAAA4D,CAAA,EAjBI5D,CAAA,CAmBR,CAAA,CAAA,CAGP,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { jsx as B } from "react/jsx-runtime";
2
+ import { forwardRef as G, useMemo as L, Children as J, useRef as k, useState as F, useCallback as v, useLayoutEffect as K, useEffect as Q } from "react";
3
+ import { s as U } from "./Flex-BFn4P1tJ.js";
4
+ import { r as O } from "./breakpoints-BbDakdqF.js";
5
+ import { u as V } from "./useMediaQuery-DrDUrkmJ.js";
6
+ const T = {
7
+ xxs: 4,
8
+ xs: 8,
9
+ sm: 16,
10
+ md: 24,
11
+ lg: 32,
12
+ xl: 40,
13
+ xxl: 48
14
+ };
15
+ function Y(n) {
16
+ if (n == null) return 0;
17
+ if (typeof n == "number") return n;
18
+ if (n in T) return T[n];
19
+ const c = parseFloat(n);
20
+ return Number.isFinite(c) ? c : 0;
21
+ }
22
+ const Z = (n, c) => n.length === c.length && n.every((d, b) => d === c[b]), rt = G(function({ columns: c = 3, minColumnWidth: d, gap: b = "md", padding: W, className: $, style: j, children: H, ...q }, m) {
23
+ const y = L(() => J.toArray(H), [H]), a = y.length, S = V(), z = Math.max(1, O(c, S) ?? 1), i = Y(O(b, S)), R = k(null), M = k([]), [x, I] = F(0), [u, N] = F({ top: 0, left: 0, bottom: 0 }), [E, X] = F([]), _ = v(
24
+ (t) => {
25
+ R.current = t, typeof m == "function" ? m(t) : m && (m.current = t);
26
+ },
27
+ [m]
28
+ ), l = d != null ? x > 0 ? Math.max(1, Math.floor((x + i) / (d + i))) : 1 : z, h = l > 0 && x > 0 ? (x - (l - 1) * i) / l : 0, { positions: w, layoutHeight: D } = L(() => {
29
+ if (h <= 0) return { positions: [], layoutHeight: 0 };
30
+ const t = new Array(l).fill(0), o = [];
31
+ for (let f = 0; f < a; f++) {
32
+ let r = 0;
33
+ for (let p = 1; p < l; p++) t[p] < t[r] && (r = p);
34
+ o.push({ x: u.left + r * (h + i), y: u.top + t[r] }), t[r] += (E[f] || 0) + i;
35
+ }
36
+ const s = t.reduce((f, r) => Math.max(f, r), 0);
37
+ return { positions: o, layoutHeight: s > 0 ? s - i : 0 };
38
+ }, [h, l, i, a, E, u.left, u.top]), C = h > 0 && w.length === a, g = v(() => {
39
+ const t = R.current;
40
+ if (!t) return;
41
+ const o = getComputedStyle(t), s = parseFloat(o.paddingLeft) || 0, f = parseFloat(o.paddingRight) || 0, r = parseFloat(o.paddingTop) || 0, p = parseFloat(o.paddingBottom) || 0, P = Math.max(0, t.clientWidth - s - f);
42
+ I((e) => e === P ? e : P), N(
43
+ (e) => e.top === r && e.left === s && e.bottom === p ? e : { top: r, left: s, bottom: p }
44
+ );
45
+ const A = M.current.slice(0, a).map((e) => e ? e.offsetHeight : 0);
46
+ X((e) => Z(e, A) ? e : A);
47
+ }, [a]);
48
+ return K(g, [g, y, z, d, i]), Q(() => {
49
+ const t = R.current;
50
+ if (!t || typeof ResizeObserver > "u") return;
51
+ const o = new ResizeObserver(() => g());
52
+ return o.observe(t), M.current.slice(0, a).forEach((s) => s && o.observe(s)), () => o.disconnect();
53
+ }, [g, a]), /* @__PURE__ */ B(
54
+ "div",
55
+ {
56
+ ref: _,
57
+ className: $,
58
+ "data-columns": l,
59
+ style: {
60
+ position: "relative",
61
+ boxSizing: "border-box",
62
+ width: "100%",
63
+ padding: U(W),
64
+ height: C ? u.top + D + u.bottom : void 0,
65
+ ...j
66
+ },
67
+ ...q,
68
+ children: y.map((t, o) => /* @__PURE__ */ B(
69
+ "div",
70
+ {
71
+ ref: (s) => {
72
+ M.current[o] = s;
73
+ },
74
+ style: C ? {
75
+ position: "absolute",
76
+ top: 0,
77
+ left: 0,
78
+ width: h,
79
+ transform: `translate(${w[o].x}px, ${w[o].y}px)`,
80
+ boxSizing: "border-box"
81
+ } : { boxSizing: "border-box" },
82
+ children: t
83
+ },
84
+ o
85
+ ))
86
+ }
87
+ );
88
+ });
89
+ export {
90
+ rt as M
91
+ };
92
+ //# sourceMappingURL=Masonry-BsRWG-oN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Masonry-BsRWG-oN.js","sources":["../src/components/Masonry/Masonry.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\nimport { resolveResponsive, type Responsive } from '../../theme/breakpoints'\nimport { useBreakpointMatches } from '../../hooks/useMediaQuery'\n\n// `--tz-space-*` scale in px — the gap must be a number to bake into item positions\nconst SPACE_PX: Record<string, number> = {\n xxs: 4,\n xs: 8,\n sm: 16,\n md: 24,\n lg: 32,\n xl: 40,\n xxl: 48,\n}\n\n/** Resolve a `Spacing` gap to a px number for layout math (token → scale, number → px, else parse). */\nfunction spacePx(value: Spacing | undefined): number {\n if (value == null) return 0\n if (typeof value === 'number') return value\n if (value in SPACE_PX) return SPACE_PX[value]\n const n = parseFloat(value)\n return Number.isFinite(n) ? n : 0\n}\n\nexport interface MasonryProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Number of columns. Either a fixed number, or a **desktop-first** map keyed by the shared\n * `Breakpoint`s (`xs`/`sm`/`md`/`lg`/`xl`) — each entry applies at that breakpoint's max-width and\n * below, until a smaller one overrides it, with the largest defined key as the base for wider screens.\n * Defaults to `3`. Ignored when `minColumnWidth` is set.\n *\n * @example columns={2} // always 2\n * @example columns={{ xs: 1, md: 3 }} // 1 on phones (≤767.98), 3 up to md, 3 above\n */\n columns?: Responsive<number>\n /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */\n minColumnWidth?: number\n /**\n * Gap between items, horizontally and vertically. Either a single value (a `--tz-space-*` key, a px\n * number, or a px-like CSS value) or a **desktop-first** breakpoint map — same resolution as `columns`.\n * Defaults to `md`.\n *\n * @example gap=\"md\"\n * @example gap={{ xs: 'sm', md: 'lg' }} // tighter on phones, looser from md up\n */\n gap?: Responsive<Spacing>\n /** Padding around the grid (token key, px number, or CSS value). */\n padding?: Spacing\n /** The items to lay out. */\n children?: ReactNode\n}\n\nconst arraysEqual = (a: number[], b: number[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * A masonry layout — packs items of varying heights into balanced columns, always adding the next item\n * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed\n * grid. Reading order flows left-to-right across the columns.\n *\n * **Every child is rendered once, in a single stable container, and placed by absolute positioning**\n * (measured in the DOM; a `ResizeObserver` re-lays-out on width / content changes). Resizing only moves\n * each child (its `transform`) — a child **never** changes DOM parent, so React never remounts it and\n * **child state is preserved** across resizes (an input's text, a nested widget's items, focus). Until\n * the first measure it falls back to a single stacked column (SSR / first paint), then switches to the\n * measured layout — same elements, no remount.\n *\n * `columns` is a fixed number or a desktop-first breakpoint map (`{ xs: 1, md: 3 }`); `minColumnWidth`\n * is a responsive alternative (overrides `columns`); `gap` spaces items on both axes and is itself\n * responsive the same way. Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer\n * `style` merges last.\n */\nexport const Masonry = forwardRef<HTMLDivElement, MasonryProps>(function Masonry(\n { columns = 3, minColumnWidth, gap = 'md', padding, className, style, children, ...props },\n ref,\n) {\n const items = useMemo(() => Children.toArray(children), [children])\n const count = items.length\n\n const matches = useBreakpointMatches()\n const resolvedColumns = Math.max(1, resolveResponsive(columns, matches) ?? 1)\n const gapPx = spacePx(resolveResponsive(gap, matches))\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n\n // measured: the content width + the container's own padding insets + each item's height\n const [width, setWidth] = useState(0)\n const [inset, setInset] = useState({ top: 0, left: 0, bottom: 0 })\n const [heights, setHeights] = useState<number[]>([])\n\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n // column count: from minColumnWidth (measured) or the resolved fixed/responsive `columns`\n const colCount =\n minColumnWidth != null\n ? width > 0\n ? Math.max(1, Math.floor((width + gapPx) / (minColumnWidth + gapPx)))\n : 1\n : resolvedColumns\n const colWidth = colCount > 0 && width > 0 ? (width - (colCount - 1) * gapPx) / colCount : 0\n\n // greedily place each item (in order) into the shortest column, as an absolute (x, y)\n const { positions, layoutHeight } = useMemo(() => {\n if (colWidth <= 0) return { positions: [] as Array<{ x: number; y: number }>, layoutHeight: 0 }\n const colH = new Array(colCount).fill(0)\n const pos: Array<{ x: number; y: number }> = []\n for (let i = 0; i < count; i++) {\n let min = 0\n for (let c = 1; c < colCount; c++) if (colH[c] < colH[min]) min = c\n pos.push({ x: inset.left + min * (colWidth + gapPx), y: inset.top + colH[min] })\n colH[min] += (heights[i] || 0) + gapPx\n }\n const tallest = colH.reduce((a, b) => Math.max(a, b), 0)\n return { positions: pos, layoutHeight: tallest > 0 ? tallest - gapPx : 0 }\n }, [colWidth, colCount, gapPx, count, heights, inset.left, inset.top])\n\n const positioned = colWidth > 0 && positions.length === count\n\n // measure the content width, padding insets, and item heights (before paint + on resize)\n const measure = useCallback(() => {\n const root = rootRef.current\n if (!root) return\n const cs = getComputedStyle(root)\n const padL = parseFloat(cs.paddingLeft) || 0\n const padR = parseFloat(cs.paddingRight) || 0\n const padT = parseFloat(cs.paddingTop) || 0\n const padB = parseFloat(cs.paddingBottom) || 0\n const contentW = Math.max(0, root.clientWidth - padL - padR)\n\n setWidth((prev) => (prev === contentW ? prev : contentW))\n setInset((prev) =>\n prev.top === padT && prev.left === padL && prev.bottom === padB\n ? prev\n : { top: padT, left: padL, bottom: padB },\n )\n const next = itemRefs.current.slice(0, count).map((el) => (el ? el.offsetHeight : 0))\n setHeights((prev) => (arraysEqual(prev, next) ? prev : next))\n }, [count])\n\n // measure before paint (mount + when the item set / column count / gap changes)\n useLayoutEffect(measure, [measure, items, resolvedColumns, minColumnWidth, gapPx])\n\n // re-lay-out on container resize and on any item resizing (image loads, dynamic content, …)\n useEffect(() => {\n const root = rootRef.current\n if (!root || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver(() => measure())\n ro.observe(root)\n itemRefs.current.slice(0, count).forEach((el) => el && ro.observe(el))\n return () => ro.disconnect()\n }, [measure, count])\n\n return (\n <div\n ref={setRootRef}\n className={className}\n data-columns={colCount}\n style={{\n position: 'relative',\n boxSizing: 'border-box',\n width: '100%',\n padding: space(padding),\n height: positioned ? inset.top + layoutHeight + inset.bottom : undefined,\n ...style,\n }}\n {...props}\n >\n {items.map((item, i) => (\n <div\n key={i}\n ref={(el) => {\n itemRefs.current[i] = el\n }}\n style={\n positioned\n ? ({\n position: 'absolute',\n top: 0,\n left: 0,\n width: colWidth,\n transform: `translate(${positions[i].x}px, ${positions[i].y}px)`,\n boxSizing: 'border-box',\n } as CSSProperties)\n : ({ boxSizing: 'border-box' } as CSSProperties)\n }\n >\n {item}\n </div>\n ))}\n </div>\n )\n})\n"],"names":["SPACE_PX","spacePx","value","n","arraysEqual","a","b","v","i","Masonry","forwardRef","columns","minColumnWidth","gap","padding","className","style","children","props","ref","items","useMemo","Children","count","matches","useBreakpointMatches","resolvedColumns","resolveResponsive","gapPx","rootRef","useRef","itemRefs","width","setWidth","useState","inset","setInset","heights","setHeights","setRootRef","useCallback","node","colCount","colWidth","positions","layoutHeight","colH","pos","min","c","tallest","positioned","measure","root","cs","padL","padR","padT","padB","contentW","prev","next","el","useLayoutEffect","useEffect","ro","jsx","space","item"],"mappings":";;;;;AAkBA,MAAMA,IAAmC;AAAA,EACvC,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAGA,SAASC,EAAQC,GAAoC;AACnD,MAAIA,KAAS,KAAM,QAAO;AAC1B,MAAI,OAAOA,KAAU,SAAU,QAAOA;AACtC,MAAIA,KA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I,CAACgD,GAAM5D,MAChB,gBAAA0D;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,KAAK,CAACJ,MAAO;AACX,YAAA/B,EAAS,QAAQvB,CAAC,IAAIsD;AAAA,UACxB;AAAA,UACA,OACEX,IACK;AAAA,YACC,UAAU;AAAA,YACV,KAAK;AAAA,YACL,MAAM;AAAA,YACN,OAAOR;AAAA,YACP,WAAW,aAAaC,EAAUpC,CAAC,EAAE,CAAC,OAAOoC,EAAUpC,CAAC,EAAE,CAAC;AAAA,YAC3D,WAAW;AAAA,UAAA,IAEZ,EAAE,WAAW,aAAA;AAAA,UAGnB,UAAA4D;AAAA,QAAA;AAAA,QAjBI5D;AAAA,MAAA,CAmBR;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),l=require("react"),A=require("clsx"),Q=require("./names-C2Yj1p3u.cjs"),L=require("./Icon-CXTl_QAP.cjs"),$=require("./IconButton-ChUfK0pG.cjs"),W=require("react-dom"),X=require("./useLockBodyScroll-CIXHZo-Q.cjs"),Y=require("./ConfigProvider-DFy6pL-C.cjs"),Z="_overlay_gwv2a_6",w={overlay:Z},H=l.forwardRef(function({open:a,onClose:s,closeOnBackdrop:k=!0,closeOnEscape:g=!0,lockScroll:N=!0,dim:c,className:i,style:d,children:q,onKeyDown:u,onMouseDown:_,onClick:x,...I},T){const j=l.useRef(null),[E,m]=l.useState(!1);X.useLockBodyScroll(a&&N),l.useEffect(()=>{if(!a){m(!1);return}const e=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(e)},[a]);const D=e=>{e.key==="Escape"&&(e.stopPropagation(),g&&(s==null||s())),u==null||u(e)},h=e=>{j.current=e.target,_==null||_(e)},R=e=>{k&&e.target===e.currentTarget&&j.current===e.currentTarget&&(s==null||s()),x==null||x(e)};return!a||typeof document>"u"?null:W.createPortal(r.jsx("div",{ref:T,className:A.clsx(w.overlay,i),"data-open":E?"true":"false",style:c!=null?{"--tz-overlay-dim":c,...d}:d,onKeyDown:D,onMouseDown:h,onClick:R,...I,children:q}),document.body)}),C="_overlay_1d22k_3",ee="_modal_1d22k_14",te="_sm_1d22k_37",re="_md_1d22k_40",ne="_lg_1d22k_43",le="_fullScreen_1d22k_46",ae="_header_1d22k_58",se="_headerDivided_1d22k_67",ce="_headerMain_1d22k_70",de="_icon_1d22k_77",oe="_headerText_1d22k_80",ie="_title_1d22k_87",ue="_subtitle_1d22k_99",fe="_close_1d22k_111",_e="_body_1d22k_116",me="_footer_1d22k_124",n={overlay:C,modal:ee,sm:te,md:re,lg:ne,fullScreen:le,header:ae,headerDivided:se,headerMain:ce,icon:de,headerText:oe,title:ie,subtitle:ue,close:fe,body:_e,footer:me},he=new Set(Q.ICON_NAMES),S='a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), textarea:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), select:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',be=l.forwardRef(function({open:a,onClose:s,size:k="md",scrollBehavior:g="outside",placement:N="center",title:c,description:i,icon:d,color:q="accent",footer:u,showCloseButton:_=!0,closeOnBackdrop:x=!0,closeOnEscape:I=!0,ariaLabel:T,className:j,style:E,children:m,...D},h){const R=Y.useT(),e=l.useRef(null),O=l.useRef(null),B=l.useRef(null),P=l.useId(),p=l.useId();l.useEffect(()=>{var f,y,v;if(!a)return;const t=document.activeElement,o=((f=O.current)==null?void 0:f.querySelector(S))??((y=B.current)==null?void 0:y.querySelector(S))??((v=e.current)==null?void 0:v.querySelector(S))??e.current;return o==null||o.focus({preventScroll:!0}),()=>{var b;t!=null&&t.isConnected&&((b=t.focus)==null||b.call(t))}},[a]);const U=t=>{e.current=t,typeof h=="function"?h(t):h&&(h.current=t)},V=t=>{if(t.key!=="Tab")return;const o=e.current;if(!o)return;const f=[...o.querySelectorAll(S)].filter(z=>z.offsetParent!==null||z===document.activeElement);if(f.length===0){t.preventDefault(),o.focus();return}const y=f[0],v=f[f.length-1],b=document.activeElement;t.shiftKey&&(b===y||b===o)?(t.preventDefault(),v.focus()):!t.shiftKey&&b===v&&(t.preventDefault(),y.focus())};if(!a)return null;const F=N!=="center",M=d==null?null:typeof d=="string"&&he.has(d)?r.jsx(L.Icon,{name:d}):d,G=c!=null||i!=null||M!=null||_,J=m!=null||u!=null;return r.jsx(H,{open:a,onClose:s,closeOnBackdrop:x,closeOnEscape:I,onKeyDown:V,className:n.overlay,"data-size":k,"data-placement":N,"data-scroll":F?"inside":g,children:r.jsxs("div",{ref:U,className:A.clsx(n.modal,n[k],j),role:"dialog","aria-modal":"true","aria-labelledby":c!=null?P:void 0,"aria-label":c==null?T:void 0,"aria-describedby":i!=null?p:void 0,tabIndex:-1,style:E,...D,children:[G&&r.jsxs("div",{className:A.clsx(n.header,J&&n.headerDivided),children:[r.jsxs("div",{className:n.headerMain,children:[M!=null&&r.jsx($.IconButton,{variant:"filled",size:"sm",color:q,nonClickable:!0,"aria-hidden":!0,className:n.icon,children:M}),(c!=null||i!=null)&&r.jsxs("div",{className:n.headerText,children:[c!=null&&r.jsx("div",{id:P,className:n.title,children:c}),i!=null&&r.jsx("div",{id:p,className:n.subtitle,children:i})]})]}),_&&r.jsx($.IconButton,{variant:"filled",color:"primary",size:"sm",className:n.close,"aria-label":R("common.close"),onClick:s,children:r.jsx(L.Icon,{name:"Close"})})]}),m!=null&&r.jsx("div",{ref:O,className:n.body,children:m}),u!=null&&r.jsx("div",{ref:B,className:n.footer,children:u})]})})});exports.Modal=be;exports.Overlay=H;
2
- //# sourceMappingURL=Modal-BaieUdge.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),l=require("react"),A=require("clsx"),Q=require("./names-C2Yj1p3u.cjs"),L=require("./Icon-CXTl_QAP.cjs"),$=require("./IconButton-BoY2y_pV.cjs"),W=require("react-dom"),X=require("./useLockBodyScroll-CIXHZo-Q.cjs"),Y=require("./ConfigProvider-BHNx-NHV.cjs"),Z="_overlay_gwv2a_6",w={overlay:Z},H=l.forwardRef(function({open:a,onClose:s,closeOnBackdrop:k=!0,closeOnEscape:g=!0,lockScroll:N=!0,dim:c,className:i,style:d,children:q,onKeyDown:u,onMouseDown:_,onClick:x,...I},T){const j=l.useRef(null),[E,m]=l.useState(!1);X.useLockBodyScroll(a&&N),l.useEffect(()=>{if(!a){m(!1);return}const e=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(e)},[a]);const D=e=>{e.key==="Escape"&&(e.stopPropagation(),g&&(s==null||s())),u==null||u(e)},h=e=>{j.current=e.target,_==null||_(e)},R=e=>{k&&e.target===e.currentTarget&&j.current===e.currentTarget&&(s==null||s()),x==null||x(e)};return!a||typeof document>"u"?null:W.createPortal(r.jsx("div",{ref:T,className:A.clsx(w.overlay,i),"data-open":E?"true":"false",style:c!=null?{"--tz-overlay-dim":c,...d}:d,onKeyDown:D,onMouseDown:h,onClick:R,...I,children:q}),document.body)}),C="_overlay_1d22k_3",ee="_modal_1d22k_14",te="_sm_1d22k_37",re="_md_1d22k_40",ne="_lg_1d22k_43",le="_fullScreen_1d22k_46",ae="_header_1d22k_58",se="_headerDivided_1d22k_67",ce="_headerMain_1d22k_70",de="_icon_1d22k_77",oe="_headerText_1d22k_80",ie="_title_1d22k_87",ue="_subtitle_1d22k_99",fe="_close_1d22k_111",_e="_body_1d22k_116",me="_footer_1d22k_124",n={overlay:C,modal:ee,sm:te,md:re,lg:ne,fullScreen:le,header:ae,headerDivided:se,headerMain:ce,icon:de,headerText:oe,title:ie,subtitle:ue,close:fe,body:_e,footer:me},he=new Set(Q.ICON_NAMES),S='a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), textarea:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), select:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',be=l.forwardRef(function({open:a,onClose:s,size:k="md",scrollBehavior:g="outside",placement:N="center",title:c,description:i,icon:d,color:q="accent",footer:u,showCloseButton:_=!0,closeOnBackdrop:x=!0,closeOnEscape:I=!0,ariaLabel:T,className:j,style:E,children:m,...D},h){const R=Y.useT(),e=l.useRef(null),O=l.useRef(null),B=l.useRef(null),P=l.useId(),p=l.useId();l.useEffect(()=>{var f,y,v;if(!a)return;const t=document.activeElement,o=((f=O.current)==null?void 0:f.querySelector(S))??((y=B.current)==null?void 0:y.querySelector(S))??((v=e.current)==null?void 0:v.querySelector(S))??e.current;return o==null||o.focus({preventScroll:!0}),()=>{var b;t!=null&&t.isConnected&&((b=t.focus)==null||b.call(t))}},[a]);const U=t=>{e.current=t,typeof h=="function"?h(t):h&&(h.current=t)},V=t=>{if(t.key!=="Tab")return;const o=e.current;if(!o)return;const f=[...o.querySelectorAll(S)].filter(z=>z.offsetParent!==null||z===document.activeElement);if(f.length===0){t.preventDefault(),o.focus();return}const y=f[0],v=f[f.length-1],b=document.activeElement;t.shiftKey&&(b===y||b===o)?(t.preventDefault(),v.focus()):!t.shiftKey&&b===v&&(t.preventDefault(),y.focus())};if(!a)return null;const F=N!=="center",M=d==null?null:typeof d=="string"&&he.has(d)?r.jsx(L.Icon,{name:d}):d,G=c!=null||i!=null||M!=null||_,J=m!=null||u!=null;return r.jsx(H,{open:a,onClose:s,closeOnBackdrop:x,closeOnEscape:I,onKeyDown:V,className:n.overlay,"data-size":k,"data-placement":N,"data-scroll":F?"inside":g,children:r.jsxs("div",{ref:U,className:A.clsx(n.modal,n[k],j),role:"dialog","aria-modal":"true","aria-labelledby":c!=null?P:void 0,"aria-label":c==null?T:void 0,"aria-describedby":i!=null?p:void 0,tabIndex:-1,style:E,...D,children:[G&&r.jsxs("div",{className:A.clsx(n.header,J&&n.headerDivided),children:[r.jsxs("div",{className:n.headerMain,children:[M!=null&&r.jsx($.IconButton,{variant:"filled",size:"sm",color:q,nonClickable:!0,"aria-hidden":!0,className:n.icon,children:M}),(c!=null||i!=null)&&r.jsxs("div",{className:n.headerText,children:[c!=null&&r.jsx("div",{id:P,className:n.title,children:c}),i!=null&&r.jsx("div",{id:p,className:n.subtitle,children:i})]})]}),_&&r.jsx($.IconButton,{variant:"filled",color:"primary",size:"sm",className:n.close,"aria-label":R("common.close"),onClick:s,children:r.jsx(L.Icon,{name:"Close"})})]}),m!=null&&r.jsx("div",{ref:O,className:n.body,children:m}),u!=null&&r.jsx("div",{ref:B,className:n.footer,children:u})]})})});exports.Modal=be;exports.Overlay=H;
2
+ //# sourceMappingURL=Modal-CO3c3sGY.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal-BaieUdge.cjs","sources":["../src/components/Overlay/Overlay.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Overlay.module.css'\n\nexport interface OverlayProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the overlay is mounted + shown — gates the portal and drives the fade-in. */\n open: boolean\n /** Requested dismiss — fired on a backdrop click (`closeOnBackdrop`) or Escape (`closeOnEscape`). */\n onClose?: () => void\n /** Close when the scrim itself (outside the content) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed while focus is within the overlay. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Lock page scroll while open. Defaults to `true`. */\n lockScroll?: boolean\n /** Scrim darkness — the black backdrop's alpha (0–1). Defaults to `0.45`. */\n dim?: number\n /** Overlay content — typically a centered dialog / box / media. */\n children?: ReactNode\n}\n\n/**\n * The shared backdrop primitive behind every dimmed, page-blocking surface (`Modal`, the FileUploader\n * lightbox). Portals a fixed full-viewport scrim to `<body>`, locks page scroll, fades in (opacity keyed\n * off a rAF `visible` flag → `data-open`), and dismisses on **backdrop-click** (gated on the pointer-down\n * AND click both landing on the scrim, so a text-selection drag ending on it doesn't close) / **Escape**\n * (swallowed via `stopPropagation` so it can't reach a React-tree ancestor overlay). Centers its children\n * by default; consumers layer their own padding / scroll / placement via `className` + `data-*` and read\n * the shared `data-open` on the scrim for their own box's enter transform. A consumer `onKeyDown` still\n * fires (after the Escape handling) so it can add e.g. a Tab focus-trap. Internal — no `index.ts`, so it's\n * never exposed as a package subpath; import it via `../Overlay/Overlay`. The ref points at the scrim div.\n */\nexport const Overlay = forwardRef<HTMLDivElement, OverlayProps>(function Overlay(\n {\n open,\n onClose,\n closeOnBackdrop = true,\n closeOnEscape = true,\n lockScroll = true,\n dim,\n className,\n style,\n children,\n onKeyDown,\n onMouseDown,\n onClick,\n ...props\n },\n ref,\n) {\n const mouseDownTarget = useRef<EventTarget | null>(null)\n const [visible, setVisible] = useState(false)\n\n useLockBodyScroll(open && lockScroll)\n\n // enter animation: flip `visible` on the frame after mount so the opacity transition runs\n useEffect(() => {\n if (!open) {\n setVisible(false)\n return\n }\n const raf = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(raf)\n }, [open])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n // the overlay owns the page — swallow Escape so it can't reach a React-tree ancestor overlay (e.g.\n // an outer Modal) even when this one isn't Escape-dismissible\n event.stopPropagation()\n if (closeOnEscape) onClose?.()\n }\n onKeyDown?.(event)\n }\n // remember where the pointer went down so the click handler can tell a scrim click from a drag that\n // started inside the content and ended on the scrim (a text-selection drag)\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n mouseDownTarget.current = event.target\n onMouseDown?.(event)\n }\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n closeOnBackdrop &&\n event.target === event.currentTarget &&\n mouseDownTarget.current === event.currentTarget\n ) {\n onClose?.()\n }\n onClick?.(event)\n }\n\n if (!open || typeof document === 'undefined') return null\n\n return createPortal(\n <div\n ref={ref}\n className={clsx(styles.overlay, className)}\n data-open={visible ? 'true' : 'false'}\n style={dim != null ? ({ '--tz-overlay-dim': dim, ...style } as CSSProperties) : style}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...props}\n >\n {children}\n </div>,\n document.body,\n )\n})\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport styles from './Modal.module.css'\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'fullScreen'\nexport type ModalScrollBehavior = 'inside' | 'outside'\nexport type ModalPlacement = 'center' | 'left' | 'right'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Focusable descendants used by the focus trap + initial focus. */\n// every clause excludes tabindex=\"-1\" so decorative/programmatic-only nodes (e.g. the header's\n// `nonClickable aria-hidden` IconButton) don't count as trap boundaries or initial-focus targets\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the modal is open — gates the portal and drives the enter animation. */\n open: boolean\n /** Called when a dismiss is requested (close button, backdrop click, or Escape). */\n onClose: () => void\n /** Preset width: `sm` 360 · `md` 620 · `lg` 900 px, or `fullScreen` (fills the viewport). Defaults to `md`. */\n size?: ModalSize\n /**\n * Where overflow scrolls when the content is taller than the viewport: `outside` (default — the\n * whole dialog grows and the overlay/page scrolls) or `inside` (the body scrolls while the header +\n * footer stay pinned). Ignored for side-drawer placements (`left`/`right`), which always scroll inside.\n */\n scrollBehavior?: ModalScrollBehavior\n /**\n * Where the dialog sits: `center` (default — the standard centered modal), or `left` / `right` to\n * make it a **full-height side drawer** (sheet) that slides in from that edge. A drawer takes its\n * width from `size`, fills the viewport height, and always scrolls its body inside (header + footer\n * stay pinned).\n */\n placement?: ModalPlacement\n /** Header title. When set, labels the dialog (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title (e.g. a confirm prompt). */\n description?: ReactNode\n /** Leading header icon shown in a tinted box (like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Footer slot — right-aligned actions over a top divider (e.g. Cancel / Confirm buttons). */\n footer?: ReactNode\n /** Show the header × close button. Defaults to `true`. */\n showCloseButton?: boolean\n /** Close when the backdrop (outside the dialog) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Dialog body. */\n children?: ReactNode\n}\n\n/**\n * A centered, backdrop-dimmed overlay dialog. Portaled to `<body>`, it locks page scroll while open,\n * traps Tab focus inside, restores focus to the previously-focused element on close, and dismisses on\n * close button / backdrop click / Escape (each toggleable). Sizes are `sm`/`md`/`lg` (max-width caps)\n * or `fullScreen`; `scrollBehavior` picks inside-body vs. whole-dialog scrolling. `placement` turns it\n * into a full-height side drawer (`left`/`right`) that slides in from the edge. The header mirrors\n * `Card` — an optional tinted `icon` box + `title` + `description`. Controlled by `open` + `onClose`.\n * The forwarded ref points at the dialog element.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <Modal open={isOpen} onClose={close} title=\"Edit\" footer={<Button onClick={close}>Done</Button>}>\n * …\n * </Modal>\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n size = 'md',\n scrollBehavior = 'outside',\n placement = 'center',\n title,\n description,\n icon,\n color = 'accent',\n footer,\n showCloseButton = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n ariaLabel,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const panelRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const titleId = useId()\n const descId = useId()\n\n // portal + scrim + scroll-lock + fade-in + backdrop-dismiss are handled by the shared `<Overlay>`\n\n // focus management: move focus into the dialog on open — prefer a body field (form modals land on\n // their first input), else the first footer action (confirm dialogs land on Cancel/Confirm, not the\n // × button), else any control, else the dialog itself; restore focus to the trigger on close\n useEffect(() => {\n if (!open) return\n const previouslyFocused = document.activeElement as HTMLElement | null\n const target =\n bodyRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n footerRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current\n // preventScroll so opening an `outside`-scroll modal doesn't jump the overlay to a below-fold control\n target?.focus({ preventScroll: true })\n // only restore if the element is still mounted (it may have unmounted while the modal was open)\n return () => {\n if (previouslyFocused?.isConnected) previouslyFocused.focus?.()\n }\n }, [open])\n\n // merge the panel ref (positioning/focus) with the forwarded ref (consumer access)\n const setPanelRef = (node: HTMLDivElement | null) => {\n panelRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n // trap Tab within the dialog so focus can't strand on the locked page behind it (Escape + backdrop\n // dismissal live in `<Overlay>`; this fires after the overlay's own handler)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const panel = panelRef.current\n if (!panel) return\n const focusables = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n panel.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === panel)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n if (!open) return null\n\n // a side drawer (left/right) is always full-height with the body scrolling inside (header/footer pinned)\n const isDrawer = placement !== 'center'\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader = title != null || description != null || renderedIcon != null || showCloseButton\n // a divider sets the header apart from the body/footer, like Card\n const headerDivided = children != null || footer != null\n\n return (\n <Overlay\n open={open}\n onClose={onClose}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n className={styles.overlay}\n data-size={size}\n data-placement={placement}\n data-scroll={isDrawer ? 'inside' : scrollBehavior}\n >\n <div\n ref={setPanelRef}\n className={clsx(styles.modal, styles[size], className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n </div>\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n {children != null && (\n <div ref={bodyRef} className={styles.body}>\n {children}\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["Overlay","forwardRef","open","onClose","closeOnBackdrop","closeOnEscape","lockScroll","dim","className","style","children","onKeyDown","onMouseDown","onClick","props","ref","mouseDownTarget","useRef","visible","setVisible","useState","useLockBodyScroll","useEffect","raf","handleKeyDown","event","handleMouseDown","handleClick","createPortal","jsx","clsx","styles","ICON_NAME_SET","ICON_NAMES","FOCUSABLE","Modal","size","scrollBehavior","placement","title","description","icon","color","footer","showCloseButton","ariaLabel","forwardedRef","t","useT","panelRef","bodyRef","footerRef","titleId","useId","descId","previouslyFocused","target","_a","_b","_c","setPanelRef","node","handleTabTrap","panel","focusables","el","first","last","active","isDrawer","renderedIcon","Icon","hasHeader","headerDivided","jsxs","IconButton"],"mappings":"oVA4CaA,EAAUC,EAAAA,WAAyC,SAC9D,CACE,KAAAC,EACA,QAAAC,EACA,gBAAAC,EAAkB,GAClB,cAAAC,EAAgB,GAChB,WAAAC,EAAa,GACb,IAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAkBC,EAAAA,OAA2B,IAAI,EACjD,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EAE5CC,EAAAA,kBAAkBnB,GAAQI,CAAU,EAGpCgB,EAAAA,UAAU,IAAM,CACd,GAAI,CAACpB,EAAM,CACTiB,EAAW,EAAK,EAChB,MACF,CACA,MAAMI,EAAM,sBAAsB,IAAMJ,EAAW,EAAI,CAAC,EACxD,MAAO,IAAM,qBAAqBI,CAAG,CACvC,EAAG,CAACrB,CAAI,CAAC,EAET,MAAMsB,EAAiBC,GAAyC,CAC1DA,EAAM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CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,EAEJ,EACCI,GACCf,EAAAA,IAAC8C,EAAAA,WAAA,CACC,QAAQ,SACR,MAAM,UACN,KAAK,KACL,UAAW5C,EAAO,MAClB,aAAYgB,EAAE,cAAc,EAC5B,QAAS5C,EAET,SAAA0B,EAAAA,IAAC0C,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,EAEJ,EAED7D,GAAY,MACXmB,MAAC,MAAA,CAAI,IAAKqB,EAAS,UAAWnB,EAAO,KAClC,SAAArB,CAAA,CACH,EAEDiC,GAAU,MACTd,MAAC,MAAA,CAAI,IAAKsB,EAAW,UAAWpB,EAAO,OACpC,SAAAY,CAAA,CACH,CAAA,CAAA,CAAA,CAEJ,CAAA,CAGN,CAAC"}
1
+ {"version":3,"file":"Modal-CO3c3sGY.cjs","sources":["../src/components/Overlay/Overlay.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Overlay.module.css'\n\nexport interface OverlayProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the overlay is mounted + shown — gates the portal and drives the fade-in. */\n open: boolean\n /** Requested dismiss — fired on a backdrop click (`closeOnBackdrop`) or Escape (`closeOnEscape`). */\n onClose?: () => void\n /** Close when the scrim itself (outside the content) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed while focus is within the overlay. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Lock page scroll while open. Defaults to `true`. */\n lockScroll?: boolean\n /** Scrim darkness — the black backdrop's alpha (0–1). Defaults to `0.45`. */\n dim?: number\n /** Overlay content — typically a centered dialog / box / media. */\n children?: ReactNode\n}\n\n/**\n * The shared backdrop primitive behind every dimmed, page-blocking surface (`Modal`, the FileUploader\n * lightbox). Portals a fixed full-viewport scrim to `<body>`, locks page scroll, fades in (opacity keyed\n * off a rAF `visible` flag → `data-open`), and dismisses on **backdrop-click** (gated on the pointer-down\n * AND click both landing on the scrim, so a text-selection drag ending on it doesn't close) / **Escape**\n * (swallowed via `stopPropagation` so it can't reach a React-tree ancestor overlay). Centers its children\n * by default; consumers layer their own padding / scroll / placement via `className` + `data-*` and read\n * the shared `data-open` on the scrim for their own box's enter transform. A consumer `onKeyDown` still\n * fires (after the Escape handling) so it can add e.g. a Tab focus-trap. Internal — no `index.ts`, so it's\n * never exposed as a package subpath; import it via `../Overlay/Overlay`. The ref points at the scrim div.\n */\nexport const Overlay = forwardRef<HTMLDivElement, OverlayProps>(function Overlay(\n {\n open,\n onClose,\n closeOnBackdrop = true,\n closeOnEscape = true,\n lockScroll = true,\n dim,\n className,\n style,\n children,\n onKeyDown,\n onMouseDown,\n onClick,\n ...props\n },\n ref,\n) {\n const mouseDownTarget = useRef<EventTarget | null>(null)\n const [visible, setVisible] = useState(false)\n\n useLockBodyScroll(open && lockScroll)\n\n // enter animation: flip `visible` on the frame after mount so the opacity transition runs\n useEffect(() => {\n if (!open) {\n setVisible(false)\n return\n }\n const raf = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(raf)\n }, [open])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n // the overlay owns the page — swallow Escape so it can't reach a React-tree ancestor overlay (e.g.\n // an outer Modal) even when this one isn't Escape-dismissible\n event.stopPropagation()\n if (closeOnEscape) onClose?.()\n }\n onKeyDown?.(event)\n }\n // remember where the pointer went down so the click handler can tell a scrim click from a drag that\n // started inside the content and ended on the scrim (a text-selection drag)\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n mouseDownTarget.current = event.target\n onMouseDown?.(event)\n }\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n closeOnBackdrop &&\n event.target === event.currentTarget &&\n mouseDownTarget.current === event.currentTarget\n ) {\n onClose?.()\n }\n onClick?.(event)\n }\n\n if (!open || typeof document === 'undefined') return null\n\n return createPortal(\n <div\n ref={ref}\n className={clsx(styles.overlay, className)}\n data-open={visible ? 'true' : 'false'}\n style={dim != null ? ({ '--tz-overlay-dim': dim, ...style } as CSSProperties) : style}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...props}\n >\n {children}\n </div>,\n document.body,\n )\n})\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport styles from './Modal.module.css'\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'fullScreen'\nexport type ModalScrollBehavior = 'inside' | 'outside'\nexport type ModalPlacement = 'center' | 'left' | 'right'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Focusable descendants used by the focus trap + initial focus. */\n// every clause excludes tabindex=\"-1\" so decorative/programmatic-only nodes (e.g. the header's\n// `nonClickable aria-hidden` IconButton) don't count as trap boundaries or initial-focus targets\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the modal is open — gates the portal and drives the enter animation. */\n open: boolean\n /** Called when a dismiss is requested (close button, backdrop click, or Escape). */\n onClose: () => void\n /** Preset width: `sm` 360 · `md` 620 · `lg` 900 px, or `fullScreen` (fills the viewport). Defaults to `md`. */\n size?: ModalSize\n /**\n * Where overflow scrolls when the content is taller than the viewport: `outside` (default — the\n * whole dialog grows and the overlay/page scrolls) or `inside` (the body scrolls while the header +\n * footer stay pinned). Ignored for side-drawer placements (`left`/`right`), which always scroll inside.\n */\n scrollBehavior?: ModalScrollBehavior\n /**\n * Where the dialog sits: `center` (default — the standard centered modal), or `left` / `right` to\n * make it a **full-height side drawer** (sheet) that slides in from that edge. A drawer takes its\n * width from `size`, fills the viewport height, and always scrolls its body inside (header + footer\n * stay pinned).\n */\n placement?: ModalPlacement\n /** Header title. When set, labels the dialog (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title (e.g. a confirm prompt). */\n description?: ReactNode\n /** Leading header icon shown in a tinted box (like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Footer slot — right-aligned actions over a top divider (e.g. Cancel / Confirm buttons). */\n footer?: ReactNode\n /** Show the header × close button. Defaults to `true`. */\n showCloseButton?: boolean\n /** Close when the backdrop (outside the dialog) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Dialog body. */\n children?: ReactNode\n}\n\n/**\n * A centered, backdrop-dimmed overlay dialog. Portaled to `<body>`, it locks page scroll while open,\n * traps Tab focus inside, restores focus to the previously-focused element on close, and dismisses on\n * close button / backdrop click / Escape (each toggleable). Sizes are `sm`/`md`/`lg` (max-width caps)\n * or `fullScreen`; `scrollBehavior` picks inside-body vs. whole-dialog scrolling. `placement` turns it\n * into a full-height side drawer (`left`/`right`) that slides in from the edge. The header mirrors\n * `Card` — an optional tinted `icon` box + `title` + `description`. Controlled by `open` + `onClose`.\n * The forwarded ref points at the dialog element.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <Modal open={isOpen} onClose={close} title=\"Edit\" footer={<Button onClick={close}>Done</Button>}>\n * …\n * </Modal>\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n size = 'md',\n scrollBehavior = 'outside',\n placement = 'center',\n title,\n description,\n icon,\n color = 'accent',\n footer,\n showCloseButton = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n ariaLabel,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const panelRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const titleId = useId()\n const descId = useId()\n\n // portal + scrim + scroll-lock + fade-in + backdrop-dismiss are handled by the shared `<Overlay>`\n\n // focus management: move focus into the dialog on open — prefer a body field (form modals land on\n // their first input), else the first footer action (confirm dialogs land on Cancel/Confirm, not the\n // × button), else any control, else the dialog itself; restore focus to the trigger on close\n useEffect(() => {\n if (!open) return\n const previouslyFocused = document.activeElement as HTMLElement | null\n const target =\n bodyRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n footerRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current\n // preventScroll so opening an `outside`-scroll modal doesn't jump the overlay to a below-fold control\n target?.focus({ preventScroll: true })\n // only restore if the element is still mounted (it may have unmounted while the modal was open)\n return () => {\n if (previouslyFocused?.isConnected) previouslyFocused.focus?.()\n }\n }, [open])\n\n // merge the panel ref (positioning/focus) with the forwarded ref (consumer access)\n const setPanelRef = (node: HTMLDivElement | null) => {\n panelRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n // trap Tab within the dialog so focus can't strand on the locked page behind it (Escape + backdrop\n // dismissal live in `<Overlay>`; this fires after the overlay's own handler)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const panel = panelRef.current\n if (!panel) return\n const focusables = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n panel.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === panel)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n if (!open) return null\n\n // a side drawer (left/right) is always full-height with the body scrolling inside (header/footer pinned)\n const isDrawer = placement !== 'center'\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader = title != null || description != null || renderedIcon != null || showCloseButton\n // a divider sets the header apart from the body/footer, like Card\n const headerDivided = children != null || footer != null\n\n return (\n <Overlay\n open={open}\n onClose={onClose}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n className={styles.overlay}\n data-size={size}\n data-placement={placement}\n data-scroll={isDrawer ? 'inside' : scrollBehavior}\n >\n <div\n ref={setPanelRef}\n className={clsx(styles.modal, styles[size], className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n </div>\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n {children != null && (\n <div ref={bodyRef} className={styles.body}>\n {children}\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["Overlay","forwardRef","open","onClose","closeOnBackdrop","closeOnEscape","lockScroll","dim","className","style","children","onKeyDown","onMouseDown","onClick","props","ref","mouseDownTarget","useRef","visible","setVisible","useState","useLockBodyScroll","useEffect","raf","handleKeyDown","event","handleMouseDown","handleClick","createPortal","jsx","clsx","styles","ICON_NAME_SET","ICON_NAMES","FOCUSABLE","Modal","size","scrollBehavior","placement","title","description","icon","color","footer","showCloseButton","ariaLabel","forwardedRef","t","useT","panelRef","bodyRef","footerRef","titleId","useId","descId","previouslyFocused","target","_a","_b","_c","setPanelRef","node","handleTabTrap","panel","focusables","el","first","last","active","isDrawer","renderedIcon","Icon","hasHeader","headerDivided","jsxs","IconButton"],"mappings":"oVA4CaA,EAAUC,EAAAA,WAAyC,SAC9D,CACE,KAAAC,EACA,QAAAC,EACA,gBAAAC,EAAkB,GAClB,cAAAC,EAAgB,GAChB,WAAAC,EAAa,GACb,IAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAkBC,EAAAA,OAA2B,IAAI,EACjD,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EAE5CC,EAAAA,kBAAkBnB,GAAQI,CAAU,EAGpCgB,EAAAA,UAAU,IAAM,CACd,GAAI,CAACpB,EAAM,CACTiB,EAAW,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WACpB,SAAA,CAAAQ,GAAS,YACP,MAAA,CAAI,GAAIa,EAAS,UAAWrB,EAAO,MACjC,SAAAQ,CAAA,CACH,EAEDC,GAAe,MACdX,MAAC,MAAA,CAAI,GAAIyB,EAAQ,UAAWvB,EAAO,SAChC,SAAAS,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,EAEJ,EACCI,GACCf,EAAAA,IAAC8C,EAAAA,WAAA,CACC,QAAQ,SACR,MAAM,UACN,KAAK,KACL,UAAW5C,EAAO,MAClB,aAAYgB,EAAE,cAAc,EAC5B,QAAS5C,EAET,SAAA0B,EAAAA,IAAC0C,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,CACrB,EAEJ,EAED7D,GAAY,MACXmB,MAAC,MAAA,CAAI,IAAKqB,EAAS,UAAWnB,EAAO,KAClC,SAAArB,CAAA,CACH,EAEDiC,GAAU,MACTd,MAAC,MAAA,CAAI,IAAKsB,EAAW,UAAWpB,EAAO,OACpC,SAAAY,CAAA,CACH,CAAA,CAAA,CAAA,CAEJ,CAAA,CAGN,CAAC"}
@@ -3,10 +3,10 @@ import { forwardRef as U, useRef as p, useState as Y, useEffect as V, useId as $
3
3
  import { clsx as P } from "clsx";
4
4
  import { a as Z } from "./names-D8ABK2Wk.js";
5
5
  import { I as H } from "./Icon-CophpkHo.js";
6
- import { I as K } from "./IconButton-BZ2jJn_T.js";
6
+ import { I as K } from "./IconButton-B8FPGgDn.js";
7
7
  import { createPortal as w } from "react-dom";
8
8
  import { u as C } from "./useLockBodyScroll-DwBILLPK.js";
9
- import { a as ee } from "./ConfigProvider-sEZzNTeU.js";
9
+ import { a as ee } from "./ConfigProvider-BYruQYHC.js";
10
10
  const te = "_overlay_gwv2a_6", ae = {
11
11
  overlay: te
12
12
  }, re = U(function({
@@ -192,4 +192,4 @@ export {
192
192
  Ae as M,
193
193
  re as O
194
194
  };
195
- //# sourceMappingURL=Modal-CRH_i5uU.js.map
195
+ //# sourceMappingURL=Modal-XMRDPHvQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal-CRH_i5uU.js","sources":["../src/components/Overlay/Overlay.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Overlay.module.css'\n\nexport interface OverlayProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the overlay is mounted + shown — gates the portal and drives the fade-in. */\n open: boolean\n /** Requested dismiss — fired on a backdrop click (`closeOnBackdrop`) or Escape (`closeOnEscape`). */\n onClose?: () => void\n /** Close when the scrim itself (outside the content) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed while focus is within the overlay. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Lock page scroll while open. Defaults to `true`. */\n lockScroll?: boolean\n /** Scrim darkness — the black backdrop's alpha (0–1). Defaults to `0.45`. */\n dim?: number\n /** Overlay content — typically a centered dialog / box / media. */\n children?: ReactNode\n}\n\n/**\n * The shared backdrop primitive behind every dimmed, page-blocking surface (`Modal`, the FileUploader\n * lightbox). Portals a fixed full-viewport scrim to `<body>`, locks page scroll, fades in (opacity keyed\n * off a rAF `visible` flag → `data-open`), and dismisses on **backdrop-click** (gated on the pointer-down\n * AND click both landing on the scrim, so a text-selection drag ending on it doesn't close) / **Escape**\n * (swallowed via `stopPropagation` so it can't reach a React-tree ancestor overlay). Centers its children\n * by default; consumers layer their own padding / scroll / placement via `className` + `data-*` and read\n * the shared `data-open` on the scrim for their own box's enter transform. A consumer `onKeyDown` still\n * fires (after the Escape handling) so it can add e.g. a Tab focus-trap. Internal — no `index.ts`, so it's\n * never exposed as a package subpath; import it via `../Overlay/Overlay`. The ref points at the scrim div.\n */\nexport const Overlay = forwardRef<HTMLDivElement, OverlayProps>(function Overlay(\n {\n open,\n onClose,\n closeOnBackdrop = true,\n closeOnEscape = true,\n lockScroll = true,\n dim,\n className,\n style,\n children,\n onKeyDown,\n onMouseDown,\n onClick,\n ...props\n },\n ref,\n) {\n const mouseDownTarget = useRef<EventTarget | null>(null)\n const [visible, setVisible] = useState(false)\n\n useLockBodyScroll(open && lockScroll)\n\n // enter animation: flip `visible` on the frame after mount so the opacity transition runs\n useEffect(() => {\n if (!open) {\n setVisible(false)\n return\n }\n const raf = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(raf)\n }, [open])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n // the overlay owns the page — swallow Escape so it can't reach a React-tree ancestor overlay (e.g.\n // an outer Modal) even when this one isn't Escape-dismissible\n event.stopPropagation()\n if (closeOnEscape) onClose?.()\n }\n onKeyDown?.(event)\n }\n // remember where the pointer went down so the click handler can tell a scrim click from a drag that\n // started inside the content and ended on the scrim (a text-selection drag)\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n mouseDownTarget.current = event.target\n onMouseDown?.(event)\n }\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n closeOnBackdrop &&\n event.target === event.currentTarget &&\n mouseDownTarget.current === event.currentTarget\n ) {\n onClose?.()\n }\n onClick?.(event)\n }\n\n if (!open || typeof document === 'undefined') return null\n\n return createPortal(\n <div\n ref={ref}\n className={clsx(styles.overlay, className)}\n data-open={visible ? 'true' : 'false'}\n style={dim != null ? ({ '--tz-overlay-dim': dim, ...style } as CSSProperties) : style}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...props}\n >\n {children}\n </div>,\n document.body,\n )\n})\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport styles from './Modal.module.css'\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'fullScreen'\nexport type ModalScrollBehavior = 'inside' | 'outside'\nexport type ModalPlacement = 'center' | 'left' | 'right'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Focusable descendants used by the focus trap + initial focus. */\n// every clause excludes tabindex=\"-1\" so decorative/programmatic-only nodes (e.g. the header's\n// `nonClickable aria-hidden` IconButton) don't count as trap boundaries or initial-focus targets\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the modal is open — gates the portal and drives the enter animation. */\n open: boolean\n /** Called when a dismiss is requested (close button, backdrop click, or Escape). */\n onClose: () => void\n /** Preset width: `sm` 360 · `md` 620 · `lg` 900 px, or `fullScreen` (fills the viewport). Defaults to `md`. */\n size?: ModalSize\n /**\n * Where overflow scrolls when the content is taller than the viewport: `outside` (default — the\n * whole dialog grows and the overlay/page scrolls) or `inside` (the body scrolls while the header +\n * footer stay pinned). Ignored for side-drawer placements (`left`/`right`), which always scroll inside.\n */\n scrollBehavior?: ModalScrollBehavior\n /**\n * Where the dialog sits: `center` (default — the standard centered modal), or `left` / `right` to\n * make it a **full-height side drawer** (sheet) that slides in from that edge. A drawer takes its\n * width from `size`, fills the viewport height, and always scrolls its body inside (header + footer\n * stay pinned).\n */\n placement?: ModalPlacement\n /** Header title. When set, labels the dialog (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title (e.g. a confirm prompt). */\n description?: ReactNode\n /** Leading header icon shown in a tinted box (like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Footer slot — right-aligned actions over a top divider (e.g. Cancel / Confirm buttons). */\n footer?: ReactNode\n /** Show the header × close button. Defaults to `true`. */\n showCloseButton?: boolean\n /** Close when the backdrop (outside the dialog) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Dialog body. */\n children?: ReactNode\n}\n\n/**\n * A centered, backdrop-dimmed overlay dialog. Portaled to `<body>`, it locks page scroll while open,\n * traps Tab focus inside, restores focus to the previously-focused element on close, and dismisses on\n * close button / backdrop click / Escape (each toggleable). Sizes are `sm`/`md`/`lg` (max-width caps)\n * or `fullScreen`; `scrollBehavior` picks inside-body vs. whole-dialog scrolling. `placement` turns it\n * into a full-height side drawer (`left`/`right`) that slides in from the edge. The header mirrors\n * `Card` — an optional tinted `icon` box + `title` + `description`. Controlled by `open` + `onClose`.\n * The forwarded ref points at the dialog element.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <Modal open={isOpen} onClose={close} title=\"Edit\" footer={<Button onClick={close}>Done</Button>}>\n * …\n * </Modal>\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n size = 'md',\n scrollBehavior = 'outside',\n placement = 'center',\n title,\n description,\n icon,\n color = 'accent',\n footer,\n showCloseButton = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n ariaLabel,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const panelRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const titleId = useId()\n const descId = useId()\n\n // portal + scrim + scroll-lock + fade-in + backdrop-dismiss are handled by the shared `<Overlay>`\n\n // focus management: move focus into the dialog on open — prefer a body field (form modals land on\n // their first input), else the first footer action (confirm dialogs land on Cancel/Confirm, not the\n // × button), else any control, else the dialog itself; restore focus to the trigger on close\n useEffect(() => {\n if (!open) return\n const previouslyFocused = document.activeElement as HTMLElement | null\n const target =\n bodyRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n footerRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current\n // preventScroll so opening an `outside`-scroll modal doesn't jump the overlay to a below-fold control\n target?.focus({ preventScroll: true })\n // only restore if the element is still mounted (it may have unmounted while the modal was open)\n return () => {\n if (previouslyFocused?.isConnected) previouslyFocused.focus?.()\n }\n }, [open])\n\n // merge the panel ref (positioning/focus) with the forwarded ref (consumer access)\n const setPanelRef = (node: HTMLDivElement | null) => {\n panelRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n // trap Tab within the dialog so focus can't strand on the locked page behind it (Escape + backdrop\n // dismissal live in `<Overlay>`; this fires after the overlay's own handler)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const panel = panelRef.current\n if (!panel) return\n const focusables = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n panel.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === panel)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n if (!open) return null\n\n // a side drawer (left/right) is always full-height with the body scrolling inside (header/footer pinned)\n const isDrawer = placement !== 'center'\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader = title != null || description != null || renderedIcon != null || showCloseButton\n // a divider sets the header apart from the body/footer, like Card\n const headerDivided = children != null || footer != null\n\n return (\n <Overlay\n open={open}\n onClose={onClose}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n className={styles.overlay}\n data-size={size}\n data-placement={placement}\n data-scroll={isDrawer ? 'inside' : scrollBehavior}\n >\n <div\n ref={setPanelRef}\n className={clsx(styles.modal, styles[size], className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n </div>\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n {children != null && (\n <div ref={bodyRef} className={styles.body}>\n {children}\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["Overlay","forwardRef","open","onClose","closeOnBackdrop","closeOnEscape","lockScroll","dim","className","style","children","onKeyDown","onMouseDown","onClick","props","ref","mouseDownTarget","useRef","visible","setVisible","useState","useLockBodyScroll","useEffect","raf","handleKeyDown","event","handleMouseDown","handleClick","createPortal","jsx","clsx","styles","ICON_NAME_SET","ICON_NAMES","FOCUSABLE","Modal","size","scrollBehavior","placement","title","description","icon","color","footer","showCloseButton","ariaLabel","forwardedRef","t","useT","panelRef","bodyRef","footerRef","titleId","useId","descId","previouslyFocused","target","_a","_b","_c","setPanelRef","node","handleTabTrap","panel","focusables","el","first","last","active","isDrawer","renderedIcon","Icon","hasHeader","headerDivided","jsxs","IconButton"],"mappings":";;;;;;;;;;;GA4CaA,KAAUC,EAAyC,SAC9D;AAAA,EACE,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,eAAAC,IAAgB;AAAA,EAChB,YAAAC,IAAa;AAAA,EACb,KAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAkBC,EAA2B,IAAI,GACjD,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK;AAE5C,EAAAC,EAAkBnB,KAAQI,CAAU,GAGpCgB,EAAU,MAAM;AACd,QAAI,CAACpB,GAAM;AACT,MAAAiB,EAAW,EAAK;AAChB;AAAA,IACF;AACA,UAAMI,IAAM,sBAAsB,MAAMJ,EAAW,EAAI,CAAC;AACxD,WAAO,MAAM,qBAAqBI,CAAG;AAAA,EACvC,GAAG,CAACrB,CAAI,CAAC;AAET,QAAMsB,IAAgB,CAACC,MAAyC;AAC9D,IAAIA,EAAM,QAAQ,aAGhBA,EAAM,gBAAA,GACFpB,MAAeF,KAAA,QAAAA,OAErBQ,KAAA,QAAAA,EAAYc;AAAA,EACd,GAGMC,IAAkB,CAACD,MAAsC;AAC7D,IAAAT,EAAgB,UAAUS,EAAM,QAChCb,KAAA,QAAAA,EAAca;AAAA,EAChB,GACME,IAAc,C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EAAO;AAAA,oBAEjB,UAAAuC;AAAA,kBAAA;AAAA,gBAAA;AAAA,iBAGH/B,KAAS,QAAQC,KAAe,2BAC/B,OAAA,EAAI,WAAWT,EAAO,YACpB,UAAA;AAAA,kBAAAQ,KAAS,0BACP,OAAA,EAAI,IAAIa,GAAS,WAAWrB,EAAO,OACjC,UAAAQ,EAAA,CACH;AAAA,kBAEDC,KAAe,QACd,gBAAAX,EAAC,OAAA,EAAI,IAAIyB,GAAQ,WAAWvB,EAAO,UAChC,UAAAS,EAAA,CACH;AAAA,gBAAA,EAAA,CAEJ;AAAA,cAAA,GAEJ;AAAA,cACCI,KACC,gBAAAf;AAAA,gBAAC8C;AAAA,gBAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,WAAW5C,EAAO;AAAA,kBAClB,cAAYgB,EAAE,cAAc;AAAA,kBAC5B,SAAS5C;AAAA,kBAET,UAAA,gBAAA0B,EAAC0C,GAAA,EAAK,MAAK,QAAA,CAAQ;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrB,GAEJ;AAAA,YAED7D,KAAY,QACX,gBAAAmB,EAAC,OAAA,EAAI,KAAKqB,GAAS,WAAWnB,EAAO,MAClC,UAAArB,EAAA,CACH;AAAA,YAEDiC,KAAU,QACT,gBAAAd,EAAC,OAAA,EAAI,KAAKsB,GAAW,WAAWpB,EAAO,QACpC,UAAAY,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"Modal-XMRDPHvQ.js","sources":["../src/components/Overlay/Overlay.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Overlay.module.css'\n\nexport interface OverlayProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the overlay is mounted + shown — gates the portal and drives the fade-in. */\n open: boolean\n /** Requested dismiss — fired on a backdrop click (`closeOnBackdrop`) or Escape (`closeOnEscape`). */\n onClose?: () => void\n /** Close when the scrim itself (outside the content) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed while focus is within the overlay. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Lock page scroll while open. Defaults to `true`. */\n lockScroll?: boolean\n /** Scrim darkness — the black backdrop's alpha (0–1). Defaults to `0.45`. */\n dim?: number\n /** Overlay content — typically a centered dialog / box / media. */\n children?: ReactNode\n}\n\n/**\n * The shared backdrop primitive behind every dimmed, page-blocking surface (`Modal`, the FileUploader\n * lightbox). Portals a fixed full-viewport scrim to `<body>`, locks page scroll, fades in (opacity keyed\n * off a rAF `visible` flag → `data-open`), and dismisses on **backdrop-click** (gated on the pointer-down\n * AND click both landing on the scrim, so a text-selection drag ending on it doesn't close) / **Escape**\n * (swallowed via `stopPropagation` so it can't reach a React-tree ancestor overlay). Centers its children\n * by default; consumers layer their own padding / scroll / placement via `className` + `data-*` and read\n * the shared `data-open` on the scrim for their own box's enter transform. A consumer `onKeyDown` still\n * fires (after the Escape handling) so it can add e.g. a Tab focus-trap. Internal — no `index.ts`, so it's\n * never exposed as a package subpath; import it via `../Overlay/Overlay`. The ref points at the scrim div.\n */\nexport const Overlay = forwardRef<HTMLDivElement, OverlayProps>(function Overlay(\n {\n open,\n onClose,\n closeOnBackdrop = true,\n closeOnEscape = true,\n lockScroll = true,\n dim,\n className,\n style,\n children,\n onKeyDown,\n onMouseDown,\n onClick,\n ...props\n },\n ref,\n) {\n const mouseDownTarget = useRef<EventTarget | null>(null)\n const [visible, setVisible] = useState(false)\n\n useLockBodyScroll(open && lockScroll)\n\n // enter animation: flip `visible` on the frame after mount so the opacity transition runs\n useEffect(() => {\n if (!open) {\n setVisible(false)\n return\n }\n const raf = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(raf)\n }, [open])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n // the overlay owns the page — swallow Escape so it can't reach a React-tree ancestor overlay (e.g.\n // an outer Modal) even when this one isn't Escape-dismissible\n event.stopPropagation()\n if (closeOnEscape) onClose?.()\n }\n onKeyDown?.(event)\n }\n // remember where the pointer went down so the click handler can tell a scrim click from a drag that\n // started inside the content and ended on the scrim (a text-selection drag)\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n mouseDownTarget.current = event.target\n onMouseDown?.(event)\n }\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n closeOnBackdrop &&\n event.target === event.currentTarget &&\n mouseDownTarget.current === event.currentTarget\n ) {\n onClose?.()\n }\n onClick?.(event)\n }\n\n if (!open || typeof document === 'undefined') return null\n\n return createPortal(\n <div\n ref={ref}\n className={clsx(styles.overlay, className)}\n data-open={visible ? 'true' : 'false'}\n style={dim != null ? ({ '--tz-overlay-dim': dim, ...style } as CSSProperties) : style}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...props}\n >\n {children}\n </div>,\n document.body,\n )\n})\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport styles from './Modal.module.css'\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'fullScreen'\nexport type ModalScrollBehavior = 'inside' | 'outside'\nexport type ModalPlacement = 'center' | 'left' | 'right'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Focusable descendants used by the focus trap + initial focus. */\n// every clause excludes tabindex=\"-1\" so decorative/programmatic-only nodes (e.g. the header's\n// `nonClickable aria-hidden` IconButton) don't count as trap boundaries or initial-focus targets\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the modal is open — gates the portal and drives the enter animation. */\n open: boolean\n /** Called when a dismiss is requested (close button, backdrop click, or Escape). */\n onClose: () => void\n /** Preset width: `sm` 360 · `md` 620 · `lg` 900 px, or `fullScreen` (fills the viewport). Defaults to `md`. */\n size?: ModalSize\n /**\n * Where overflow scrolls when the content is taller than the viewport: `outside` (default — the\n * whole dialog grows and the overlay/page scrolls) or `inside` (the body scrolls while the header +\n * footer stay pinned). Ignored for side-drawer placements (`left`/`right`), which always scroll inside.\n */\n scrollBehavior?: ModalScrollBehavior\n /**\n * Where the dialog sits: `center` (default — the standard centered modal), or `left` / `right` to\n * make it a **full-height side drawer** (sheet) that slides in from that edge. A drawer takes its\n * width from `size`, fills the viewport height, and always scrolls its body inside (header + footer\n * stay pinned).\n */\n placement?: ModalPlacement\n /** Header title. When set, labels the dialog (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title (e.g. a confirm prompt). */\n description?: ReactNode\n /** Leading header icon shown in a tinted box (like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Footer slot — right-aligned actions over a top divider (e.g. Cancel / Confirm buttons). */\n footer?: ReactNode\n /** Show the header × close button. Defaults to `true`. */\n showCloseButton?: boolean\n /** Close when the backdrop (outside the dialog) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Dialog body. */\n children?: ReactNode\n}\n\n/**\n * A centered, backdrop-dimmed overlay dialog. Portaled to `<body>`, it locks page scroll while open,\n * traps Tab focus inside, restores focus to the previously-focused element on close, and dismisses on\n * close button / backdrop click / Escape (each toggleable). Sizes are `sm`/`md`/`lg` (max-width caps)\n * or `fullScreen`; `scrollBehavior` picks inside-body vs. whole-dialog scrolling. `placement` turns it\n * into a full-height side drawer (`left`/`right`) that slides in from the edge. The header mirrors\n * `Card` — an optional tinted `icon` box + `title` + `description`. Controlled by `open` + `onClose`.\n * The forwarded ref points at the dialog element.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <Modal open={isOpen} onClose={close} title=\"Edit\" footer={<Button onClick={close}>Done</Button>}>\n * …\n * </Modal>\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n size = 'md',\n scrollBehavior = 'outside',\n placement = 'center',\n title,\n description,\n icon,\n color = 'accent',\n footer,\n showCloseButton = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n ariaLabel,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const panelRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const titleId = useId()\n const descId = useId()\n\n // portal + scrim + scroll-lock + fade-in + backdrop-dismiss are handled by the shared `<Overlay>`\n\n // focus management: move focus into the dialog on open — prefer a body field (form modals land on\n // their first input), else the first footer action (confirm dialogs land on Cancel/Confirm, not the\n // × button), else any control, else the dialog itself; restore focus to the trigger on close\n useEffect(() => {\n if (!open) return\n const previouslyFocused = document.activeElement as HTMLElement | null\n const target =\n bodyRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n footerRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current\n // preventScroll so opening an `outside`-scroll modal doesn't jump the overlay to a below-fold control\n target?.focus({ preventScroll: true })\n // only restore if the element is still mounted (it may have unmounted while the modal was open)\n return () => {\n if (previouslyFocused?.isConnected) previouslyFocused.focus?.()\n }\n }, [open])\n\n // merge the panel ref (positioning/focus) with the forwarded ref (consumer access)\n const setPanelRef = (node: HTMLDivElement | null) => {\n panelRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n // trap Tab within the dialog so focus can't strand on the locked page behind it (Escape + backdrop\n // dismissal live in `<Overlay>`; this fires after the overlay's own handler)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const panel = panelRef.current\n if (!panel) return\n const focusables = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n panel.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === panel)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n if (!open) return null\n\n // a side drawer (left/right) is always full-height with the body scrolling inside (header/footer pinned)\n const isDrawer = placement !== 'center'\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader = title != null || description != null || renderedIcon != null || showCloseButton\n // a divider sets the header apart from the body/footer, like Card\n const headerDivided = children != null || footer != null\n\n return (\n <Overlay\n open={open}\n onClose={onClose}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n className={styles.overlay}\n data-size={size}\n data-placement={placement}\n data-scroll={isDrawer ? 'inside' : scrollBehavior}\n >\n <div\n ref={setPanelRef}\n className={clsx(styles.modal, styles[size], className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n </div>\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n {children != null && (\n <div ref={bodyRef} className={styles.body}>\n {children}\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["Overlay","forwardRef","open","onClose","closeOnBackdrop","closeOnEscape","lockScroll","dim","className","style","children","onKeyDown","onMouseDown","onClick","props","ref","mouseDownTarget","useRef","visible","setVisible","useState","useLockBodyScroll","useEffect","raf","handleKeyDown","event","handleMouseDown","handleClick","createPortal","jsx","clsx","styles","ICON_NAME_SET","ICON_NAMES","FOCUSABLE","Modal","size","scrollBehavior","placement","title","description","icon","color","footer","showCloseButton","ariaLabel","forwardedRef","t","useT","panelRef","bodyRef","footerRef","titleId","useId","descId","previouslyFocused","target","_a","_b","_c","setPanelRef","node","handleTabTrap","panel","focusables","el","first","last","active","isDrawer","renderedIcon","Ic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GAAQ,WAAWvB,EAAO,UAChC,UAAAS,EAAA,CACH;AAAA,gBAAA,EAAA,CAEJ;AAAA,cAAA,GAEJ;AAAA,cACCI,KACC,gBAAAf;AAAA,gBAAC8C;AAAA,gBAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,OAAM;AAAA,kBACN,MAAK;AAAA,kBACL,WAAW5C,EAAO;AAAA,kBAClB,cAAYgB,EAAE,cAAc;AAAA,kBAC5B,SAAS5C;AAAA,kBAET,UAAA,gBAAA0B,EAAC0C,GAAA,EAAK,MAAK,QAAA,CAAQ;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrB,GAEJ;AAAA,YAED7D,KAAY,QACX,gBAAAmB,EAAC,OAAA,EAAI,KAAKqB,GAAS,WAAWnB,EAAO,MAClC,UAAArB,EAAA,CACH;AAAA,YAEDiC,KAAU,QACT,gBAAAd,EAAC,OAAA,EAAI,KAAKsB,GAAW,WAAWpB,EAAO,QACpC,UAAAY,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN,CAAC;"}
@@ -3,13 +3,13 @@ import { forwardRef as Me, useId as Ce, useState as R, useRef as D, useCallback
3
3
  import { clsx as K } from "clsx";
4
4
  import { u as Be } from "./formContext-B7ln1Miy.js";
5
5
  import { F as Re } from "./FloatingPanel-BG9Uag__.js";
6
- import { C as qe } from "./Chip-DX3QECcs.js";
6
+ import { C as qe } from "./Chip-DulHqhuf.js";
7
7
  import { I as V } from "./Icon-CophpkHo.js";
8
8
  import { L as Ke } from "./List-LqbfF6gU.js";
9
9
  import { L as Ve } from "./ListItem-B4Upc0Hy.js";
10
- import { L as We } from "./Loader-DFlpw5Zc.js";
10
+ import { L as We } from "./Loader-UzzqvFyo.js";
11
11
  import { T as W } from "./Typography-Cta6Rg4L.js";
12
- import { a as $e } from "./ConfigProvider-sEZzNTeU.js";
12
+ import { a as $e } from "./ConfigProvider-BYruQYHC.js";
13
13
  const Ae = "_field_16ykc_1", Fe = "_fullWidth_16ykc_7", Oe = "_label_16ykc_12", Pe = "_required_16ykc_21", Se = "_control_16ykc_27", He = "_filled_16ykc_47", je = "_open_16ykc_51", Qe = "_error_16ykc_56", Ue = "_disabled_16ykc_64", ze = "_chips_16ykc_31", Ge = "_value_16ykc_84", Je = "_valueLabel_16ykc_91", Xe = "_placeholder_16ykc_96", Ye = "_clear_16ykc_100", Ze = "_chevron_16ykc_117", er = "_sm_16ykc_127", rr = "_md_16ykc_131", lr = "_lg_16ykc_135", tr = "_helper_16ykc_140", or = "_popover_16ykc_145", ar = "_search_16ykc_152", cr = "_searchIcon_16ykc_161", sr = "_searchInput_16ykc_165", nr = "_listbox_16ykc_180", ir = "_active_16ykc_188", dr = "_noOptions_16ykc_192", ur = "_loading_16ykc_198", l = {
14
14
  field: Ae,
15
15
  fullWidth: Fe,
@@ -347,4 +347,4 @@ const Ae = "_field_16ykc_1", Fe = "_fullWidth_16ykc_7", Oe = "_label_16ykc_12",
347
347
  export {
348
348
  Dr as M
349
349
  };
350
- //# sourceMappingURL=MultiSelect-BmkzNHTE.js.map
350
+ //# sourceMappingURL=MultiSelect-BPLctumx.js.map