@techzyapp/ui-library 1.0.21 → 1.0.23

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 (335) hide show
  1. package/dist/{AdminRoot-BDRLuMX6.cjs → AdminRoot-C7Idu7FQ.cjs} +2 -2
  2. package/dist/AdminRoot-C7Idu7FQ.cjs.map +1 -0
  3. package/dist/{AdminRoot-DvF0js0q.js → AdminRoot-aDy6rNqI.js} +4 -4
  4. package/dist/AdminRoot-aDy6rNqI.js.map +1 -0
  5. package/dist/{Alert-CwoRkKq4.cjs → Alert-Cl1zxmX9.cjs} +2 -2
  6. package/dist/{Alert-CwoRkKq4.cjs.map → Alert-Cl1zxmX9.cjs.map} +1 -1
  7. package/dist/{Alert-DPYmdaWs.js → Alert-D6VL2C-E.js} +3 -3
  8. package/dist/{Alert-DPYmdaWs.js.map → Alert-D6VL2C-E.js.map} +1 -1
  9. package/dist/{Breadcrumbs-CknDBLMw.cjs → Breadcrumbs-BnFW4LgK.cjs} +2 -2
  10. package/dist/{Breadcrumbs-CknDBLMw.cjs.map → Breadcrumbs-BnFW4LgK.cjs.map} +1 -1
  11. package/dist/{Breadcrumbs-l0PlUpQ4.js → Breadcrumbs-CicfjfIu.js} +3 -3
  12. package/dist/{Breadcrumbs-l0PlUpQ4.js.map → Breadcrumbs-CicfjfIu.js.map} +1 -1
  13. package/dist/{Button-RljTGqHl.js → Button-Cfxd7qhd.js} +2 -2
  14. package/dist/{Button-RljTGqHl.js.map → Button-Cfxd7qhd.js.map} +1 -1
  15. package/dist/{Button-BdihbLYJ.cjs → Button-ZplrHYKw.cjs} +2 -2
  16. package/dist/{Button-BdihbLYJ.cjs.map → Button-ZplrHYKw.cjs.map} +1 -1
  17. package/dist/{Calendar-CKCikOQL.js → Calendar-DTxCT-ki.js} +3 -3
  18. package/dist/{Calendar-CKCikOQL.js.map → Calendar-DTxCT-ki.js.map} +1 -1
  19. package/dist/{Calendar-DVg1uQuj.cjs → Calendar-S9vyp-qv.cjs} +2 -2
  20. package/dist/{Calendar-DVg1uQuj.cjs.map → Calendar-S9vyp-qv.cjs.map} +1 -1
  21. package/dist/{Card-BYFuYD-a.cjs → Card-BeE2ohcn.cjs} +2 -2
  22. package/dist/{Card-BYFuYD-a.cjs.map → Card-BeE2ohcn.cjs.map} +1 -1
  23. package/dist/{Card-B0bYi4g2.js → Card-eXJfA4rU.js} +2 -2
  24. package/dist/{Card-B0bYi4g2.js.map → Card-eXJfA4rU.js.map} +1 -1
  25. package/dist/{Chip-CdKUtUGE.cjs → Chip-B4XERWb_.cjs} +2 -2
  26. package/dist/{Chip-CdKUtUGE.cjs.map → Chip-B4XERWb_.cjs.map} +1 -1
  27. package/dist/{Chip-BiqfnRUi.js → Chip-BOXXdzap.js} +2 -2
  28. package/dist/{Chip-BiqfnRUi.js.map → Chip-BOXXdzap.js.map} +1 -1
  29. package/dist/{CodeBlock-CAAggVXS.cjs → CodeBlock-C7_A6CTT.cjs} +2 -2
  30. package/dist/{CodeBlock-CAAggVXS.cjs.map → CodeBlock-C7_A6CTT.cjs.map} +1 -1
  31. package/dist/{CodeBlock-BX_0tpk3.js → CodeBlock-D_PRiWMq.js} +3 -3
  32. package/dist/{CodeBlock-BX_0tpk3.js.map → CodeBlock-D_PRiWMq.js.map} +1 -1
  33. package/dist/{ColorPicker-BCSaT1A-.cjs → ColorPicker-ClVpWf77.cjs} +2 -2
  34. package/dist/{ColorPicker-BCSaT1A-.cjs.map → ColorPicker-ClVpWf77.cjs.map} +1 -1
  35. package/dist/{ColorPicker-DhSlvwNj.js → ColorPicker-DAjs7PmR.js} +3 -3
  36. package/dist/{ColorPicker-DhSlvwNj.js.map → ColorPicker-DAjs7PmR.js.map} +1 -1
  37. package/dist/{ColorPickerPanel-D4t3b9bB.js → ColorPickerPanel-BGzm2had.js} +2 -2
  38. package/dist/{ColorPickerPanel-D4t3b9bB.js.map → ColorPickerPanel-BGzm2had.js.map} +1 -1
  39. package/dist/{ColorPickerPanel-BOGYXXF1.cjs → ColorPickerPanel-Dk6bI0Xy.cjs} +2 -2
  40. package/dist/{ColorPickerPanel-BOGYXXF1.cjs.map → ColorPickerPanel-Dk6bI0Xy.cjs.map} +1 -1
  41. package/dist/{ConfigProvider-DT0yrgmd.js → ConfigProvider-Blhvj6UQ.js} +2 -2
  42. package/dist/ConfigProvider-Blhvj6UQ.js.map +1 -0
  43. package/dist/{ConfigProvider-C7DUWHrb.cjs → ConfigProvider-CUG8Mfy2.cjs} +2 -2
  44. package/dist/ConfigProvider-CUG8Mfy2.cjs.map +1 -0
  45. package/dist/{CopyButton-BEY1gJzK.js → CopyButton-Bv7L4xJf.js} +3 -3
  46. package/dist/{CopyButton-BEY1gJzK.js.map → CopyButton-Bv7L4xJf.js.map} +1 -1
  47. package/dist/{CopyButton-3585thVM.cjs → CopyButton-COF3hIV-.cjs} +2 -2
  48. package/dist/{CopyButton-3585thVM.cjs.map → CopyButton-COF3hIV-.cjs.map} +1 -1
  49. package/dist/{DatePicker-CEFGgXLF.js → DatePicker-DZfOvxUR.js} +4 -4
  50. package/dist/{DatePicker-CEFGgXLF.js.map → DatePicker-DZfOvxUR.js.map} +1 -1
  51. package/dist/{DatePicker-Dyj2halw.cjs → DatePicker-kA-xn5ET.cjs} +2 -2
  52. package/dist/{DatePicker-Dyj2halw.cjs.map → DatePicker-kA-xn5ET.cjs.map} +1 -1
  53. package/dist/{DateTimePicker-hmYBEuUM.js → DateTimePicker-BxBXhSN_.js} +7 -7
  54. package/dist/{DateTimePicker-hmYBEuUM.js.map → DateTimePicker-BxBXhSN_.js.map} +1 -1
  55. package/dist/{DateTimePicker-CjX4-8PP.cjs → DateTimePicker-DEGmn5UX.cjs} +2 -2
  56. package/dist/{DateTimePicker-CjX4-8PP.cjs.map → DateTimePicker-DEGmn5UX.cjs.map} +1 -1
  57. package/dist/{EmptyState-Bj-vX_UV.cjs → EmptyState-DlX-BLLI.cjs} +2 -2
  58. package/dist/{EmptyState-Bj-vX_UV.cjs.map → EmptyState-DlX-BLLI.cjs.map} +1 -1
  59. package/dist/{EmptyState-DJDNLKT7.js → EmptyState-Du4vA3bC.js} +2 -2
  60. package/dist/{EmptyState-DJDNLKT7.js.map → EmptyState-Du4vA3bC.js.map} +1 -1
  61. package/dist/{FileCard-C9Ncifnu.js → FileCard-juQ1fWbG.js} +3 -3
  62. package/dist/{FileCard-C9Ncifnu.js.map → FileCard-juQ1fWbG.js.map} +1 -1
  63. package/dist/{FileCard-Dr5-z1R3.cjs → FileCard-zyCpTrJ-.cjs} +2 -2
  64. package/dist/{FileCard-Dr5-z1R3.cjs.map → FileCard-zyCpTrJ-.cjs.map} +1 -1
  65. package/dist/{FileUploader-XFmBNkA0.js → FileUploader-DL9atihI.js} +5 -5
  66. package/dist/{FileUploader-XFmBNkA0.js.map → FileUploader-DL9atihI.js.map} +1 -1
  67. package/dist/{FileUploader-DeyZENqq.cjs → FileUploader-DOe3CyJB.cjs} +2 -2
  68. package/dist/{FileUploader-DeyZENqq.cjs.map → FileUploader-DOe3CyJB.cjs.map} +1 -1
  69. package/dist/{Flag-Bs0xNP-P.js → Flag-BxRrjCTB.js} +2 -2
  70. package/dist/{Flag-Bs0xNP-P.js.map → Flag-BxRrjCTB.js.map} +1 -1
  71. package/dist/{Flag-Bxnx26DM.cjs → Flag-DFKHYnqk.cjs} +2 -2
  72. package/dist/{Flag-Bxnx26DM.cjs.map → Flag-DFKHYnqk.cjs.map} +1 -1
  73. package/dist/{FullscreenToggle-DMlp05UN.js → FullscreenToggle-BMCNsyzb.js} +3 -3
  74. package/dist/{FullscreenToggle-DMlp05UN.js.map → FullscreenToggle-BMCNsyzb.js.map} +1 -1
  75. package/dist/{FullscreenToggle-BncatGKj.cjs → FullscreenToggle-BNK7RcRq.cjs} +2 -2
  76. package/dist/{FullscreenToggle-BncatGKj.cjs.map → FullscreenToggle-BNK7RcRq.cjs.map} +1 -1
  77. package/dist/{IconButton-Lv0sDDR9.cjs → IconButton-B9eVM18U.cjs} +2 -2
  78. package/dist/{IconButton-Lv0sDDR9.cjs.map → IconButton-B9eVM18U.cjs.map} +1 -1
  79. package/dist/{IconButton-DXMmtuLA.js → IconButton-CfvsE_p3.js} +2 -2
  80. package/dist/{IconButton-DXMmtuLA.js.map → IconButton-CfvsE_p3.js.map} +1 -1
  81. package/dist/Link-BQlvsu9V.js +48 -0
  82. package/dist/Link-BQlvsu9V.js.map +1 -0
  83. package/dist/Link-GZT51mKx.cjs +2 -0
  84. package/dist/Link-GZT51mKx.cjs.map +1 -0
  85. package/dist/{Loader-53HFNMVX.cjs → Loader-CxLrhAz9.cjs} +2 -2
  86. package/dist/{Loader-53HFNMVX.cjs.map → Loader-CxLrhAz9.cjs.map} +1 -1
  87. package/dist/{Loader-WsjQFl4p.js → Loader-DwmyJFwG.js} +2 -2
  88. package/dist/{Loader-WsjQFl4p.js.map → Loader-DwmyJFwG.js.map} +1 -1
  89. package/dist/{Modal-DBYcoCbJ.js → Modal-Cx0JEQ-j.js} +3 -3
  90. package/dist/{Modal-DBYcoCbJ.js.map → Modal-Cx0JEQ-j.js.map} +1 -1
  91. package/dist/{Modal-V6eyGSzW.cjs → Modal-DXZdMmJh.cjs} +2 -2
  92. package/dist/{Modal-V6eyGSzW.cjs.map → Modal-DXZdMmJh.cjs.map} +1 -1
  93. package/dist/{MultiSelect-DS2DRpaP.cjs → MultiSelect-DfhyGxDU.cjs} +2 -2
  94. package/dist/{MultiSelect-DS2DRpaP.cjs.map → MultiSelect-DfhyGxDU.cjs.map} +1 -1
  95. package/dist/{MultiSelect-BsYPr3LD.js → MultiSelect-yGlvweEq.js} +4 -4
  96. package/dist/{MultiSelect-BsYPr3LD.js.map → MultiSelect-yGlvweEq.js.map} +1 -1
  97. package/dist/{NumberField-DC3TdGTt.cjs → NumberField-B7yPXIw_.cjs} +2 -2
  98. package/dist/{NumberField-DC3TdGTt.cjs.map → NumberField-B7yPXIw_.cjs.map} +1 -1
  99. package/dist/{NumberField-mFb9pKCx.js → NumberField-cAjPU1P5.js} +3 -3
  100. package/dist/{NumberField-mFb9pKCx.js.map → NumberField-cAjPU1P5.js.map} +1 -1
  101. package/dist/{OtpField-BYj9SDHb.cjs → OtpField-BujZAy2A.cjs} +2 -2
  102. package/dist/{OtpField-BYj9SDHb.cjs.map → OtpField-BujZAy2A.cjs.map} +1 -1
  103. package/dist/{OtpField-1ullIIZQ.js → OtpField-D0eTOLtg.js} +2 -2
  104. package/dist/{OtpField-1ullIIZQ.js.map → OtpField-D0eTOLtg.js.map} +1 -1
  105. package/dist/{PageLayout-pYL43wI9.cjs → PageLayout-BSHyKoQ4.cjs} +2 -2
  106. package/dist/{PageLayout-pYL43wI9.cjs.map → PageLayout-BSHyKoQ4.cjs.map} +1 -1
  107. package/dist/{PageLayout-qf0H_EmS.js → PageLayout-C9Je7kfF.js} +2 -2
  108. package/dist/{PageLayout-qf0H_EmS.js.map → PageLayout-C9Je7kfF.js.map} +1 -1
  109. package/dist/{PageNotFound-YGVMVvyG.js → PageNotFound-CUN2OntP.js} +5 -5
  110. package/dist/{PageNotFound-YGVMVvyG.js.map → PageNotFound-CUN2OntP.js.map} +1 -1
  111. package/dist/{PageNotFound-D1795gJ7.cjs → PageNotFound-voB9ylPF.cjs} +2 -2
  112. package/dist/{PageNotFound-D1795gJ7.cjs.map → PageNotFound-voB9ylPF.cjs.map} +1 -1
  113. package/dist/{Pagination-WJq_7QNi.cjs → Pagination-BUGaylZa.cjs} +2 -2
  114. package/dist/{Pagination-WJq_7QNi.cjs.map → Pagination-BUGaylZa.cjs.map} +1 -1
  115. package/dist/{Pagination-BTvUJiee.js → Pagination-BaVHgIWT.js} +2 -2
  116. package/dist/{Pagination-BTvUJiee.js.map → Pagination-BaVHgIWT.js.map} +1 -1
  117. package/dist/QrCode-Bcj9_Emc.js +70 -0
  118. package/dist/QrCode-Bcj9_Emc.js.map +1 -0
  119. package/dist/QrCode-DfDfGhG-.cjs +2 -0
  120. package/dist/QrCode-DfDfGhG-.cjs.map +1 -0
  121. package/dist/{RemoveDialog-BSQ6EMW-.js → RemoveDialog-BpL2-gnz.js} +4 -4
  122. package/dist/{RemoveDialog-BSQ6EMW-.js.map → RemoveDialog-BpL2-gnz.js.map} +1 -1
  123. package/dist/{RemoveDialog-BhcwsY0q.cjs → RemoveDialog-DGt_72we.cjs} +2 -2
  124. package/dist/{RemoveDialog-BhcwsY0q.cjs.map → RemoveDialog-DGt_72we.cjs.map} +1 -1
  125. package/dist/{RichTextEditor-Bc1fhvzn.cjs → RichTextEditor-BuoywqBu.cjs} +2 -2
  126. package/dist/{RichTextEditor-Bc1fhvzn.cjs.map → RichTextEditor-BuoywqBu.cjs.map} +1 -1
  127. package/dist/{RichTextEditor-CaGPtwXe.js → RichTextEditor-C_6pzqYY.js} +7 -7
  128. package/dist/{RichTextEditor-CaGPtwXe.js.map → RichTextEditor-C_6pzqYY.js.map} +1 -1
  129. package/dist/RootLayout-1am1CwPQ.cjs +2 -0
  130. package/dist/RootLayout-1am1CwPQ.cjs.map +1 -0
  131. package/dist/RootLayout-x7qWzXPc.js +479 -0
  132. package/dist/RootLayout-x7qWzXPc.js.map +1 -0
  133. package/dist/{Select-Cx1Yl8nq.cjs → Select-CVy5BnKe.cjs} +2 -2
  134. package/dist/{Select-Cx1Yl8nq.cjs.map → Select-CVy5BnKe.cjs.map} +1 -1
  135. package/dist/{Select-vKZzS9K4.js → Select-ChT-6_bM.js} +3 -3
  136. package/dist/{Select-vKZzS9K4.js.map → Select-ChT-6_bM.js.map} +1 -1
  137. package/dist/Sidebar-D2MsR33k.cjs +2 -0
  138. package/dist/Sidebar-D2MsR33k.cjs.map +1 -0
  139. package/dist/Sidebar-ZA1wxCez.js +553 -0
  140. package/dist/Sidebar-ZA1wxCez.js.map +1 -0
  141. package/dist/{SpeedDial-D6sO-9ES.cjs → SpeedDial-B9JTNNUU.cjs} +2 -2
  142. package/dist/{SpeedDial-D6sO-9ES.cjs.map → SpeedDial-B9JTNNUU.cjs.map} +1 -1
  143. package/dist/{SpeedDial-Bb0ioXaO.js → SpeedDial-DUYQMDCY.js} +2 -2
  144. package/dist/{SpeedDial-Bb0ioXaO.js.map → SpeedDial-DUYQMDCY.js.map} +1 -1
  145. package/dist/{Stepper-CVY8NJEI.cjs → Stepper-BaC934rb.cjs} +2 -2
  146. package/dist/{Stepper-CVY8NJEI.cjs.map → Stepper-BaC934rb.cjs.map} +1 -1
  147. package/dist/{Stepper-BaEOUnYe.js → Stepper-D89I17pC.js} +2 -2
  148. package/dist/{Stepper-BaEOUnYe.js.map → Stepper-D89I17pC.js.map} +1 -1
  149. package/dist/{Table-wn-B7iLj.js → Table-CdIQ5Wfh.js} +15 -15
  150. package/dist/{Table-wn-B7iLj.js.map → Table-CdIQ5Wfh.js.map} +1 -1
  151. package/dist/{Table-AQ7yJhtW.cjs → Table-DvgBWTLx.cjs} +2 -2
  152. package/dist/{Table-AQ7yJhtW.cjs.map → Table-DvgBWTLx.cjs.map} +1 -1
  153. package/dist/{Tabs-DJMfAUni.js → Tabs-8-klG-y-.js} +2 -2
  154. package/dist/{Tabs-DJMfAUni.js.map → Tabs-8-klG-y-.js.map} +1 -1
  155. package/dist/{Tabs-BtcJ2jBl.cjs → Tabs-CejCwV3O.cjs} +2 -2
  156. package/dist/{Tabs-BtcJ2jBl.cjs.map → Tabs-CejCwV3O.cjs.map} +1 -1
  157. package/dist/{TagsField-Bvh6Fm5Y.js → TagsField-BQLqUckB.js} +4 -4
  158. package/dist/{TagsField-Bvh6Fm5Y.js.map → TagsField-BQLqUckB.js.map} +1 -1
  159. package/dist/{TagsField-4x3RmGwt.cjs → TagsField-BSAd4eUr.cjs} +2 -2
  160. package/dist/{TagsField-4x3RmGwt.cjs.map → TagsField-BSAd4eUr.cjs.map} +1 -1
  161. package/dist/{TextField-DcdwUA9d.js → TextField-B4YtjNUs.js} +3 -3
  162. package/dist/{TextField-DcdwUA9d.js.map → TextField-B4YtjNUs.js.map} +1 -1
  163. package/dist/{TextField-DNqnpAWB.cjs → TextField-DzYGA_St.cjs} +2 -2
  164. package/dist/{TextField-DNqnpAWB.cjs.map → TextField-DzYGA_St.cjs.map} +1 -1
  165. package/dist/{ThemeToggle-BVQmSMsj.js → ThemeToggle-B4_zRHJY.js} +3 -3
  166. package/dist/{ThemeToggle-BVQmSMsj.js.map → ThemeToggle-B4_zRHJY.js.map} +1 -1
  167. package/dist/{ThemeToggle-isboxfZk.cjs → ThemeToggle-BKk0eFiB.cjs} +2 -2
  168. package/dist/{ThemeToggle-isboxfZk.cjs.map → ThemeToggle-BKk0eFiB.cjs.map} +1 -1
  169. package/dist/{TimeColumns-DxFjjtc7.cjs → TimeColumns-BAzRrkqY.cjs} +2 -2
  170. package/dist/{TimeColumns-DxFjjtc7.cjs.map → TimeColumns-BAzRrkqY.cjs.map} +1 -1
  171. package/dist/{TimeColumns-CFy_PynH.js → TimeColumns-CAPyli9V.js} +2 -2
  172. package/dist/{TimeColumns-CFy_PynH.js.map → TimeColumns-CAPyli9V.js.map} +1 -1
  173. package/dist/{TimePicker-v1yA7Igl.cjs → TimePicker-BUnXYR5g.cjs} +2 -2
  174. package/dist/{TimePicker-v1yA7Igl.cjs.map → TimePicker-BUnXYR5g.cjs.map} +1 -1
  175. package/dist/{TimePicker-ZO7jOJVa.js → TimePicker-BebBSlQF.js} +5 -5
  176. package/dist/{TimePicker-ZO7jOJVa.js.map → TimePicker-BebBSlQF.js.map} +1 -1
  177. package/dist/{Toaster-Qnsq3guQ.cjs → Toaster-B2rO4BkG.cjs} +2 -2
  178. package/dist/{Toaster-Qnsq3guQ.cjs.map → Toaster-B2rO4BkG.cjs.map} +1 -1
  179. package/dist/{Toaster-C6UK_2TB.js → Toaster-ywqAKP8s.js} +2 -2
  180. package/dist/{Toaster-C6UK_2TB.js.map → Toaster-ywqAKP8s.js.map} +1 -1
  181. package/dist/{TranslatedFields-Bo5rZ7so.js → TranslatedFields-C-wlh51E.js} +5 -5
  182. package/dist/{TranslatedFields-Bo5rZ7so.js.map → TranslatedFields-C-wlh51E.js.map} +1 -1
  183. package/dist/{TranslatedFields-CLMvRpJi.cjs → TranslatedFields-DQQUb0RD.cjs} +2 -2
  184. package/dist/{TranslatedFields-CLMvRpJi.cjs.map → TranslatedFields-DQQUb0RD.cjs.map} +1 -1
  185. package/dist/{UserCard-CIjZz5xd.cjs → UserCard-Be1kl0TZ.cjs} +2 -2
  186. package/dist/{UserCard-CIjZz5xd.cjs.map → UserCard-Be1kl0TZ.cjs.map} +1 -1
  187. package/dist/{UserCard-454Kc7JS.js → UserCard-BqWt0S-c.js} +3 -3
  188. package/dist/{UserCard-454Kc7JS.js.map → UserCard-BqWt0S-c.js.map} +1 -1
  189. package/dist/app/AdminRoot.d.cts +4 -1
  190. package/dist/app/AdminRoot.d.ts +4 -1
  191. package/dist/components/Alert/index.cjs +1 -1
  192. package/dist/components/Alert/index.js +1 -1
  193. package/dist/components/Breadcrumbs/index.cjs +1 -1
  194. package/dist/components/Breadcrumbs/index.js +1 -1
  195. package/dist/components/Button/index.cjs +1 -1
  196. package/dist/components/Button/index.js +1 -1
  197. package/dist/components/Card/index.cjs +1 -1
  198. package/dist/components/Card/index.js +1 -1
  199. package/dist/components/Chip/index.cjs +1 -1
  200. package/dist/components/Chip/index.js +1 -1
  201. package/dist/components/CodeBlock/index.cjs +1 -1
  202. package/dist/components/CodeBlock/index.js +1 -1
  203. package/dist/components/ColorPicker/index.cjs +1 -1
  204. package/dist/components/ColorPicker/index.js +1 -1
  205. package/dist/components/CopyButton/index.cjs +1 -1
  206. package/dist/components/CopyButton/index.js +1 -1
  207. package/dist/components/DatePicker/index.cjs +1 -1
  208. package/dist/components/DatePicker/index.js +1 -1
  209. package/dist/components/DateTimePicker/index.cjs +1 -1
  210. package/dist/components/DateTimePicker/index.js +1 -1
  211. package/dist/components/EmptyState/index.cjs +1 -1
  212. package/dist/components/EmptyState/index.js +1 -1
  213. package/dist/components/FileCard/index.cjs +1 -1
  214. package/dist/components/FileCard/index.js +1 -1
  215. package/dist/components/FileUploader/index.cjs +1 -1
  216. package/dist/components/FileUploader/index.js +1 -1
  217. package/dist/components/Flag/index.cjs +1 -1
  218. package/dist/components/Flag/index.js +1 -1
  219. package/dist/components/FullscreenToggle/index.cjs +1 -1
  220. package/dist/components/FullscreenToggle/index.js +1 -1
  221. package/dist/components/IconButton/index.cjs +1 -1
  222. package/dist/components/IconButton/index.js +1 -1
  223. package/dist/components/Link/Link.d.cts +44 -0
  224. package/dist/components/Link/Link.d.ts +44 -0
  225. package/dist/components/Link/index.cjs +2 -0
  226. package/dist/components/Link/index.cjs.map +1 -0
  227. package/dist/components/Link/index.d.cts +3 -0
  228. package/dist/components/Link/index.d.ts +3 -0
  229. package/dist/components/Link/index.js +6 -0
  230. package/dist/components/Link/index.js.map +1 -0
  231. package/dist/components/Loader/index.cjs +1 -1
  232. package/dist/components/Loader/index.js +1 -1
  233. package/dist/components/Modal/index.cjs +1 -1
  234. package/dist/components/Modal/index.js +1 -1
  235. package/dist/components/MultiSelect/index.cjs +1 -1
  236. package/dist/components/MultiSelect/index.js +1 -1
  237. package/dist/components/NumberField/index.cjs +1 -1
  238. package/dist/components/NumberField/index.js +1 -1
  239. package/dist/components/OtpField/index.cjs +1 -1
  240. package/dist/components/OtpField/index.js +1 -1
  241. package/dist/components/PageLayout/index.cjs +1 -1
  242. package/dist/components/PageLayout/index.js +1 -1
  243. package/dist/components/PageNotFound/index.cjs +1 -1
  244. package/dist/components/PageNotFound/index.js +1 -1
  245. package/dist/components/Pagination/index.cjs +1 -1
  246. package/dist/components/Pagination/index.js +1 -1
  247. package/dist/components/QrCode/QrCode.d.cts +46 -0
  248. package/dist/components/QrCode/QrCode.d.ts +46 -0
  249. package/dist/components/QrCode/index.cjs +2 -0
  250. package/dist/components/QrCode/index.cjs.map +1 -0
  251. package/dist/components/QrCode/index.d.cts +2 -0
  252. package/dist/components/QrCode/index.d.ts +2 -0
  253. package/dist/components/QrCode/index.js +6 -0
  254. package/dist/components/QrCode/index.js.map +1 -0
  255. package/dist/components/RemoveDialog/index.cjs +1 -1
  256. package/dist/components/RemoveDialog/index.js +1 -1
  257. package/dist/components/RichTextEditor/index.cjs +1 -1
  258. package/dist/components/RichTextEditor/index.js +1 -1
  259. package/dist/components/RootLayout/ActionSet.d.cts +27 -0
  260. package/dist/components/RootLayout/ActionSet.d.ts +27 -0
  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/Sidebar.d.cts +55 -3
  266. package/dist/components/Sidebar/Sidebar.d.ts +55 -3
  267. package/dist/components/Sidebar/index.cjs +1 -1
  268. package/dist/components/Sidebar/index.d.cts +1 -0
  269. package/dist/components/Sidebar/index.d.ts +1 -0
  270. package/dist/components/Sidebar/index.js +1 -1
  271. package/dist/components/SpeedDial/index.cjs +1 -1
  272. package/dist/components/SpeedDial/index.js +1 -1
  273. package/dist/components/Stepper/index.cjs +1 -1
  274. package/dist/components/Stepper/index.js +1 -1
  275. package/dist/components/Table/index.cjs +1 -1
  276. package/dist/components/Table/index.js +1 -1
  277. package/dist/components/Tabs/index.cjs +1 -1
  278. package/dist/components/Tabs/index.js +1 -1
  279. package/dist/components/TagsField/index.cjs +1 -1
  280. package/dist/components/TagsField/index.js +1 -1
  281. package/dist/components/TextField/index.cjs +1 -1
  282. package/dist/components/TextField/index.js +1 -1
  283. package/dist/components/ThemeToggle/index.cjs +1 -1
  284. package/dist/components/ThemeToggle/index.js +1 -1
  285. package/dist/components/TimePicker/index.cjs +1 -1
  286. package/dist/components/TimePicker/index.js +1 -1
  287. package/dist/components/Toast/index.cjs +1 -1
  288. package/dist/components/Toast/index.js +1 -1
  289. package/dist/components/TranslatedFields/index.cjs +1 -1
  290. package/dist/components/TranslatedFields/index.js +1 -1
  291. package/dist/components/UserCard/index.cjs +1 -1
  292. package/dist/components/UserCard/index.js +1 -1
  293. package/dist/components/index.d.cts +2 -0
  294. package/dist/components/index.d.ts +2 -0
  295. package/dist/entries/app.cjs +1 -1
  296. package/dist/entries/app.js +1 -1
  297. package/dist/entries/components.cjs +1 -1
  298. package/dist/entries/components.js +112 -108
  299. package/dist/entries/components.js.map +1 -1
  300. package/dist/entries/i18n.cjs +1 -1
  301. package/dist/entries/i18n.js +2 -2
  302. package/dist/entries/theme.cjs +1 -1
  303. package/dist/entries/theme.d.cts +1 -1
  304. package/dist/entries/theme.d.ts +1 -1
  305. package/dist/entries/theme.js +1 -1
  306. package/dist/i18n/messages.d.cts +1 -0
  307. package/dist/i18n/messages.d.ts +1 -0
  308. package/dist/index.cjs +1 -1
  309. package/dist/index.css +1 -1
  310. package/dist/index.js +115 -111
  311. package/dist/index.js.map +1 -1
  312. package/dist/{messages-CGHhwf6F.js → messages-CL8uoIRj.js} +8 -1
  313. package/dist/messages-CL8uoIRj.js.map +1 -0
  314. package/dist/messages-Dvn_tEp0.cjs +36 -0
  315. package/dist/messages-Dvn_tEp0.cjs.map +1 -0
  316. package/dist/theme/ConfigProvider.d.cts +22 -1
  317. package/dist/theme/ConfigProvider.d.ts +22 -1
  318. package/dist/theme/index.d.cts +1 -1
  319. package/dist/theme/index.d.ts +1 -1
  320. package/package.json +6 -1
  321. package/dist/AdminRoot-BDRLuMX6.cjs.map +0 -1
  322. package/dist/AdminRoot-DvF0js0q.js.map +0 -1
  323. package/dist/ConfigProvider-C7DUWHrb.cjs.map +0 -1
  324. package/dist/ConfigProvider-DT0yrgmd.js.map +0 -1
  325. package/dist/RootLayout-BNwHsuhC.js +0 -422
  326. package/dist/RootLayout-BNwHsuhC.js.map +0 -1
  327. package/dist/RootLayout-CB-3FgOp.cjs +0 -2
  328. package/dist/RootLayout-CB-3FgOp.cjs.map +0 -1
  329. package/dist/Sidebar-CJ7DtOqb.js +0 -513
  330. package/dist/Sidebar-CJ7DtOqb.js.map +0 -1
  331. package/dist/Sidebar-Cv95DJxZ.cjs +0 -2
  332. package/dist/Sidebar-Cv95DJxZ.cjs.map +0 -1
  333. package/dist/messages-CGHhwf6F.js.map +0 -1
  334. package/dist/messages-DZJyiaf9.cjs +0 -36
  335. package/dist/messages-DZJyiaf9.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton-DXMmtuLA.js","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":";;;;;;;;;;;;;;;;;GAyCaA,IAAaC,EAA+C,SACvE;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IACJC,EAAeJ,CAAQ,KAAK,CAACR,IACzBa,EAAaL,GAAqD;AAAA,IAChE,MAAOA,EAAS,MAAoC,QAAQT;AAAA,EAAA,CAC7D,IACDS;AAEN,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAJ;AAAA,MACA,MAAAJ;AAAA,MACA,UAAUJ,KAAYF;AAAA,MACtB,aAAWA,KAAW;AAAA,MACtB,iBAAeG,KAAgB;AAAA,MAC/B,UAAUA,IAAe,KAAKI;AAAA,MAC9B,WAAWQ;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOnB,CAAO;AAAA,QACdmB,EAAOjB,CAAI;AAAA,QACXE,KAAWe,EAAO;AAAA,QAClBhB,KAAWgB,EAAO;AAAA,QAClBd,KAAYc,EAAO;AAAA,QACnBb,KAAgBa,EAAO;AAAA,QACvBZ;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,gBAAgB,kBAAkBN,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGO;AAAA,MAAA;AAAA,MAGN,GAAGI;AAAA,MAEH,cAAU,gBAAAK,EAACG,GAAA,EAAO,MAAAlB,GAAY,eAAY,QAAO,IAAKY;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
1
+ {"version":3,"file":"IconButton-CfvsE_p3.js","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":";;;;;;;;;;;;;;;;;GAyCaA,IAAaC,EAA+C,SACvE;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IACJC,EAAeJ,CAAQ,KAAK,CAACR,IACzBa,EAAaL,GAAqD;AAAA,IAChE,MAAOA,EAAS,MAAoC,QAAQT;AAAA,EAAA,CAC7D,IACDS;AAEN,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAJ;AAAA,MACA,MAAAJ;AAAA,MACA,UAAUJ,KAAYF;AAAA,MACtB,aAAWA,KAAW;AAAA,MACtB,iBAAeG,KAAgB;AAAA,MAC/B,UAAUA,IAAe,KAAKI;AAAA,MAC9B,WAAWQ;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOnB,CAAO;AAAA,QACdmB,EAAOjB,CAAI;AAAA,QACXE,KAAWe,EAAO;AAAA,QAClBhB,KAAWgB,EAAO;AAAA,QAClBd,KAAYc,EAAO;AAAA,QACnBb,KAAgBa,EAAO;AAAA,QACvBZ;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,gBAAgB,kBAAkBN,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGO;AAAA,MAAA;AAAA,MAGN,GAAGI;AAAA,MAEH,cAAU,gBAAAK,EAACG,GAAA,EAAO,MAAAlB,GAAY,eAAY,QAAO,IAAKY;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
@@ -0,0 +1,48 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ import { clsx as v } from "clsx";
4
+ import { createLink as k } from "@tanstack/react-router";
5
+ const w = "_link_12wv1_3", f = "_sm_12wv1_18", L = "_md_12wv1_21", b = "_lg_12wv1_24", h = "_hover_12wv1_29", u = "_always_12wv1_32", x = "_disabled_12wv1_46", t = {
6
+ link: w,
7
+ sm: f,
8
+ md: L,
9
+ lg: b,
10
+ hover: h,
11
+ always: u,
12
+ disabled: x
13
+ }, a = i(function({
14
+ color: n = "primary",
15
+ size: r = "md",
16
+ underline: e = "hover",
17
+ disabled: o = !1,
18
+ className: _,
19
+ style: c,
20
+ ...m
21
+ }, d) {
22
+ return /* @__PURE__ */ s(
23
+ "a",
24
+ {
25
+ ref: d,
26
+ className: v(
27
+ t.link,
28
+ t[r],
29
+ t[e],
30
+ o && t.disabled,
31
+ _
32
+ ),
33
+ style: { "--tz-link-rgb": `var(--tz-color-${n}-rgb)`, ...c },
34
+ "aria-disabled": o || void 0,
35
+ ...m
36
+ }
37
+ );
38
+ }), y = k(a), R = i(function(n, r) {
39
+ if (n.external) {
40
+ const { external: e, ...o } = n;
41
+ return /* @__PURE__ */ s(a, { ref: r, ...o });
42
+ }
43
+ return /* @__PURE__ */ s(y, { ref: r, ...n });
44
+ });
45
+ export {
46
+ R as L
47
+ };
48
+ //# sourceMappingURL=Link-BQlvsu9V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link-BQlvsu9V.js","sources":["../src/components/Link/Link.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { createLink, type LinkComponentProps } from '@tanstack/react-router'\nimport type { ThemeColor } from '../../theme'\nimport styles from './Link.module.css'\n\nexport type LinkUnderline = 'none' | 'hover' | 'always'\nexport type LinkSize = 'sm' | 'md' | 'lg'\n\ninterface LinkStyleProps {\n /** Theme palette token for the link text. Defaults to `primary`. */\n color?: ThemeColor\n /** Font-size step (matches the `Typography` scale — `md` = body). Defaults to `md`. */\n size?: LinkSize\n /** When the underline shows. Defaults to `'hover'`. */\n underline?: LinkUnderline\n /** Muted, non-interactive look (`pointer-events: none` + `aria-disabled`). */\n disabled?: boolean\n}\n\n/** The styled `<a>` — the element `createLink` wraps into a router `Link`, and the one rendered directly\n * for `external` (plain `href`) links. Not exported on its own; use `Link`. */\nexport interface LinkAnchorProps\n extends LinkStyleProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {}\n\nconst LinkAnchor = forwardRef<HTMLAnchorElement, LinkAnchorProps>(function LinkAnchor(\n {\n color = 'primary',\n size = 'md',\n underline = 'hover',\n disabled = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n return (\n <a\n ref={ref}\n className={clsx(\n styles.link,\n styles[size],\n styles[underline],\n disabled && styles.disabled,\n className,\n )}\n style={{ '--tz-link-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n aria-disabled={disabled || undefined}\n {...props}\n />\n )\n})\n\n/** The fully-typed TanStack Router link built from the styled anchor (typed `to`, `params`, active state, preload). */\nconst RouterLink = createLink(LinkAnchor)\n\n/** A plain external anchor (bypasses the router) — pass `external` with an `href`. */\nexport type ExternalLinkProps = { external: true } & LinkAnchorProps\n/** A typed in-app router link — pass `to` (and `params` / `search` / …). */\nexport type RouterLinkProps = { external?: false } & LinkComponentProps<typeof LinkAnchor>\nexport type LinkProps = ExternalLinkProps | RouterLinkProps\n\n/**\n * A styled text link. By default it's a **TanStack Router** link — pass `to` (plus `params` / `search` /\n * `hash` / …) for typed in-app navigation with active state + preloading. Pass **`external`** (with an\n * `href`) for a plain `<a>` to an outside URL (add your own `target` / `rel`). Tinted via `color`\n * (default `primary`); `size` (`sm`/`md`/`lg`, default `md` = `Typography` body); `underline` (`'none'` /\n * `'hover'` / `'always'`, default `'hover'`); `disabled`\n * for a muted, non-interactive look. Requires `@tanstack/react-router` (peer) for the routed mode.\n *\n * @example\n * <Link to=\"/users\">Users</Link>\n * <Link to=\"/users/$id\" params={{ id }}>Profile</Link>\n * <Link href=\"https://techzy.app\" external target=\"_blank\" rel=\"noreferrer\">Website</Link>\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(props, ref) {\n if (props.external) {\n const { external: _external, ...rest } = props\n return <LinkAnchor ref={ref} {...rest} />\n }\n return <RouterLink ref={ref} {...props} />\n})\n"],"names":["LinkAnchor","forwardRef","color","size","underline","disabled","className","style","props","ref","jsx","clsx","styles","RouterLink","createLink","Link","_external","rest"],"mappings":";;;;;;;;;;;;GAyBMA,IAAaC,EAA+C,SAChE;AAAA,EACE,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOT,CAAI;AAAA,QACXS,EAAOR,CAAS;AAAA,QAChBC,KAAYO,EAAO;AAAA,QACnBN;AAAA,MAAA;AAAA,MAEF,OAAO,EAAE,iBAAiB,kBAAkBJ,CAAK,SAAS,GAAGK,EAAA;AAAA,MAC7D,iBAAeF,KAAY;AAAA,MAC1B,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC,GAGKK,IAAaC,EAAWd,CAAU,GAqB3Be,IAAOd,EAAyC,SAAcO,GAAOC,GAAK;AACrF,MAAID,EAAM,UAAU;AAClB,UAAM,EAAE,UAAUQ,GAAW,GAAGC,MAAST;AACzC,WAAO,gBAAAE,EAACV,GAAA,EAAW,KAAAS,GAAW,GAAGQ,EAAA,CAAM;AAAA,EACzC;AACA,SAAO,gBAAAP,EAACG,GAAA,EAAW,KAAAJ,GAAW,GAAGD,EAAA,CAAO;AAC1C,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const t=require("react/jsx-runtime"),c=require("react"),v=require("clsx"),k=require("@tanstack/react-router"),w="_link_12wv1_3",m="_sm_12wv1_18",x="_md_12wv1_21",f="_lg_12wv1_24",L="_hover_12wv1_29",b="_always_12wv1_32",h="_disabled_12wv1_46",r={link:w,sm:m,md:x,lg:f,hover:L,always:b,disabled:h},i=c.forwardRef(function({color:n="primary",size:e="md",underline:o="hover",disabled:s=!1,className:l,style:_,...d},u){return t.jsx("a",{ref:u,className:v.clsx(r.link,r[e],r[o],s&&r.disabled,l),style:{"--tz-link-rgb":`var(--tz-color-${n}-rgb)`,..._},"aria-disabled":s||void 0,...d})}),y=k.createLink(i),g=c.forwardRef(function(n,e){if(n.external){const{external:o,...s}=n;return t.jsx(i,{ref:e,...s})}return t.jsx(y,{ref:e,...n})});exports.Link=g;
2
+ //# sourceMappingURL=Link-GZT51mKx.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link-GZT51mKx.cjs","sources":["../src/components/Link/Link.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { createLink, type LinkComponentProps } from '@tanstack/react-router'\nimport type { ThemeColor } from '../../theme'\nimport styles from './Link.module.css'\n\nexport type LinkUnderline = 'none' | 'hover' | 'always'\nexport type LinkSize = 'sm' | 'md' | 'lg'\n\ninterface LinkStyleProps {\n /** Theme palette token for the link text. Defaults to `primary`. */\n color?: ThemeColor\n /** Font-size step (matches the `Typography` scale — `md` = body). Defaults to `md`. */\n size?: LinkSize\n /** When the underline shows. Defaults to `'hover'`. */\n underline?: LinkUnderline\n /** Muted, non-interactive look (`pointer-events: none` + `aria-disabled`). */\n disabled?: boolean\n}\n\n/** The styled `<a>` — the element `createLink` wraps into a router `Link`, and the one rendered directly\n * for `external` (plain `href`) links. Not exported on its own; use `Link`. */\nexport interface LinkAnchorProps\n extends LinkStyleProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'color'> {}\n\nconst LinkAnchor = forwardRef<HTMLAnchorElement, LinkAnchorProps>(function LinkAnchor(\n {\n color = 'primary',\n size = 'md',\n underline = 'hover',\n disabled = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n return (\n <a\n ref={ref}\n className={clsx(\n styles.link,\n styles[size],\n styles[underline],\n disabled && styles.disabled,\n className,\n )}\n style={{ '--tz-link-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n aria-disabled={disabled || undefined}\n {...props}\n />\n )\n})\n\n/** The fully-typed TanStack Router link built from the styled anchor (typed `to`, `params`, active state, preload). */\nconst RouterLink = createLink(LinkAnchor)\n\n/** A plain external anchor (bypasses the router) — pass `external` with an `href`. */\nexport type ExternalLinkProps = { external: true } & LinkAnchorProps\n/** A typed in-app router link — pass `to` (and `params` / `search` / …). */\nexport type RouterLinkProps = { external?: false } & LinkComponentProps<typeof LinkAnchor>\nexport type LinkProps = ExternalLinkProps | RouterLinkProps\n\n/**\n * A styled text link. By default it's a **TanStack Router** link — pass `to` (plus `params` / `search` /\n * `hash` / …) for typed in-app navigation with active state + preloading. Pass **`external`** (with an\n * `href`) for a plain `<a>` to an outside URL (add your own `target` / `rel`). Tinted via `color`\n * (default `primary`); `size` (`sm`/`md`/`lg`, default `md` = `Typography` body); `underline` (`'none'` /\n * `'hover'` / `'always'`, default `'hover'`); `disabled`\n * for a muted, non-interactive look. Requires `@tanstack/react-router` (peer) for the routed mode.\n *\n * @example\n * <Link to=\"/users\">Users</Link>\n * <Link to=\"/users/$id\" params={{ id }}>Profile</Link>\n * <Link href=\"https://techzy.app\" external target=\"_blank\" rel=\"noreferrer\">Website</Link>\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(props, ref) {\n if (props.external) {\n const { external: _external, ...rest } = props\n return <LinkAnchor ref={ref} {...rest} />\n }\n return <RouterLink ref={ref} {...props} />\n})\n"],"names":["LinkAnchor","forwardRef","color","size","underline","disabled","className","style","props","ref","jsx","clsx","styles","RouterLink","createLink","Link","_external","rest"],"mappings":"sTAyBMA,EAAaC,EAAAA,WAA+C,SAChE,CACE,MAAAC,EAAQ,UACR,KAAAC,EAAO,KACP,UAAAC,EAAY,QACZ,SAAAC,EAAW,GACX,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,OACEC,EAAAA,IAAC,IAAA,CACC,IAAAD,EACA,UAAWE,EAAAA,KACTC,EAAO,KACPA,EAAOT,CAAI,EACXS,EAAOR,CAAS,EAChBC,GAAYO,EAAO,SACnBN,CAAA,EAEF,MAAO,CAAE,gBAAiB,kBAAkBJ,CAAK,QAAS,GAAGK,CAAA,EAC7D,gBAAeF,GAAY,OAC1B,GAAGG,CAAA,CAAA,CAGV,CAAC,EAGKK,EAAaC,EAAAA,WAAWd,CAAU,EAqB3Be,EAAOd,EAAAA,WAAyC,SAAcO,EAAOC,EAAK,CACrF,GAAID,EAAM,SAAU,CAClB,KAAM,CAAE,SAAUQ,EAAW,GAAGC,GAAST,EACzC,OAAOE,EAAAA,IAACV,EAAA,CAAW,IAAAS,EAAW,GAAGQ,CAAA,CAAM,CACzC,CACA,OAAOP,EAAAA,IAACG,EAAA,CAAW,IAAAJ,EAAW,GAAGD,CAAA,CAAO,CAC1C,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const c=require("react/jsx-runtime"),d=require("react"),_=require("clsx"),q=require("./ConfigProvider-C7DUWHrb.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-53HFNMVX.cjs.map
1
+ "use strict";const c=require("react/jsx-runtime"),d=require("react"),_=require("clsx"),q=require("./ConfigProvider-CUG8Mfy2.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-CxLrhAz9.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader-53HFNMVX.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-CxLrhAz9.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-DT0yrgmd.js";
4
+ import { a as c } from "./ConfigProvider-Blhvj6UQ.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-WsjQFl4p.js.map
28
+ //# sourceMappingURL=Loader-DwmyJFwG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Loader-WsjQFl4p.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-DwmyJFwG.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;"}
@@ -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-r21QPjcU.js";
5
5
  import { I as H } from "./Icon-DaTvzLBu.js";
6
- import { I as K } from "./IconButton-DXMmtuLA.js";
6
+ import { I as K } from "./IconButton-CfvsE_p3.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-DT0yrgmd.js";
9
+ import { a as ee } from "./ConfigProvider-Blhvj6UQ.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-DBYcoCbJ.js.map
195
+ //# sourceMappingURL=Modal-Cx0JEQ-j.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal-DBYcoCbJ.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,QAA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ardRef,\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,CAACF,MAAsC;AACzD,IACErB,KACAqB,EAAM,WAAWA,EAAM,iBACvBT,EAAgB,YAAYS,EAAM,kBAElCtB,KAAA,QAAAA,MAEFU,KAAA,QAAAA,EAAUY;A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AAA;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,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),l=require("react"),A=require("clsx"),Q=require("./names-BJnFU_5m.cjs"),L=require("./Icon-BVULqOJD.cjs"),$=require("./IconButton-Lv0sDDR9.cjs"),W=require("react-dom"),X=require("./useLockBodyScroll-CIXHZo-Q.cjs"),Y=require("./ConfigProvider-C7DUWHrb.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-V6eyGSzW.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),l=require("react"),A=require("clsx"),Q=require("./names-BJnFU_5m.cjs"),L=require("./Icon-BVULqOJD.cjs"),$=require("./IconButton-B9eVM18U.cjs"),W=require("react-dom"),X=require("./useLockBodyScroll-CIXHZo-Q.cjs"),Y=require("./ConfigProvider-CUG8Mfy2.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-DXZdMmJh.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal-V6eyGSzW.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,EAAk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C,EAAAA,WAAA,CACC,QAAQ,SACR,KAAK,KACL,MAAAjC,EACA,aAAY,GACZ,cAAW,GACX,UAAWX,EAAO,KAEjB,SAAAuC,CAAA,CAAA,GAGH/B,GAAS,MAAQC,GAAe,cAC/B,MAAA,CAAI,UAAWT,EAAO,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"}
1
+ {"version":3,"file":"Modal-DXZdMmJh.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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C,OAAI,UAAW5C,EAAAA,KAAKC,EAAO,OAAQ0C,GAAiB1C,EAAO,aAAa,EACvE,SAAA,CAAA2C,EAAAA,KAAC,MAAA,CAAI,UAAW3C,EAAO,WACpB,SAAA,CAAAuC,GAAgB,MACfzC,EAAAA,IAAC8C,EAAAA,WAAA,CACC,QAAQ,SACR,KAAK,KACL,MAAAjC,EACA,aAAY,GACZ,cAAW,GACX,UAAWX,EAAO,KAEjB,SAAAuC,CAAA,CAAA,GAGH/B,GAAS,MAAQC,GAAe,cAC/B,MAAA,CAAI,UAAWT,EAAO,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"}
@@ -1,2 +1,2 @@
1
- "use strict";const t=require("react/jsx-runtime"),o=require("react"),R=require("clsx"),we=require("./formContext-bTWrqdEV.cjs"),De=require("./FloatingPanel-U6sGYiSK.cjs"),Ne=require("./Chip-CdKUtUGE.cjs"),E=require("./Icon-BVULqOJD.cjs"),qe=require("./List-ChXO0Hz-.cjs"),Le=require("./ListItem-yXXjtepZ.cjs"),Te=require("./Loader-53HFNMVX.cjs"),M=require("./Typography-BFatE1_A.cjs"),Ce=require("./ConfigProvider-C7DUWHrb.cjs"),Re="_field_16ykc_1",Ee="_fullWidth_16ykc_7",Me="_label_16ykc_12",Se="_required_16ykc_21",Be="_control_16ykc_27",Pe="_filled_16ykc_47",Ke="_open_16ykc_51",Ve="_error_16ykc_56",We="_disabled_16ykc_64",$e="_chips_16ykc_31",Ae="_value_16ykc_84",Fe="_valueLabel_16ykc_91",Oe="_placeholder_16ykc_96",He="_clear_16ykc_100",Qe="_chevron_16ykc_117",Ue="_sm_16ykc_127",ze="_md_16ykc_131",Ge="_lg_16ykc_135",Je="_helper_16ykc_140",Xe="_popover_16ykc_145",Ye="_search_16ykc_152",Ze="_searchIcon_16ykc_161",es="_searchInput_16ykc_165",ss="_listbox_16ykc_180",ts="_active_16ykc_188",rs="_noOptions_16ykc_192",ls="_loading_16ykc_198",r={field:Re,fullWidth:Ee,label:Me,required:Se,control:Be,filled:Pe,open:Ke,error:Ve,disabled:We,chips:$e,value:Ae,valueLabel:Fe,placeholder:Oe,clear:He,chevron:Qe,sm:Ue,md:ze,lg:Ge,helper:Je,popover:Xe,search:Ye,searchIcon:Ze,searchInput:es,listbox:ss,active:ts,noOptions:rs,loading:ls},cs=o.forwardRef(function({label:w,options:D,size:b="md",error:ce,helperText:oe,required:Q=!1,fullWidth:ae=!0,disabled:p=!1,value:S,defaultValue:ne,onChange:B,placeholder:ie,color:ue="primary",clearable:de=!0,searchable:d=!1,searchPlaceholder:fe,onSearchChange:k,loading:pe=!1,loadingText:he,noOptionsText:N,name:_,id:me,className:_e,style:ye},x){const ve=o.useId(),g=me??ve,P=`${g}-label`,K=`${g}-listbox`,U=`${g}-helper`,V=e=>`${g}-opt-${e}`,I=Ce.useT(),z=fe??I("common.search"),q=we.useFormContext(),L=!!(q&&_),n=L?q.field(_):void 0,be=S!==void 0?S:L?q.values[_]??[]:void 0,G=S!==void 0||L,[ke,xe]=o.useState(ne??[]),i=G?be:ke,W=ce??(n==null?void 0:n.error)??!1,$=oe??(n==null?void 0:n.helperText),A=e=>{G||xe(e),L&&q.setValue(_,e),B==null||B(e)},y=o.useRef(null),J=o.useRef(null),F=o.useRef({buffer:"",timer:0}),T=o.useRef(void 0);T.current=n?()=>n.onBlur({}):void 0;const[l,X]=o.useState(!1),[m,Y]=o.useState(""),[h,f]=o.useState(-1),ge=o.useCallback(e=>{y.current=e,typeof x=="function"?x(e):x&&(x.current=e)},[x]),a=o.useMemo(()=>{if(!d||k||!m.trim())return D;const e=m.trim().toLowerCase();return D.filter(s=>s.label.toLowerCase().includes(e))},[d,k,m,D]),v=o.useCallback((e,s)=>{let c=e;for(;c>=0&&c<a.length;){if(!a[c].disabled)return c;c+=s}return-1},[a]),Z=o.useRef(null),C=o.useCallback(e=>{var s,c;X(!1),Y(""),window.clearTimeout(F.current.timer),F.current.buffer="",(s=T.current)==null||s.call(T),e&&((c=y.current)==null||c.focus())},[]);o.useEffect(()=>{l&&(f(v(0,1)),d&&requestAnimationFrame(()=>{var e;return(e=J.current)==null?void 0:e.focus()}))},[l]),o.useEffect(()=>{var e,s;!l||h<0||(s=(e=document.getElementById(V(h)))==null?void 0:e.scrollIntoView)==null||s.call(e,{block:"nearest"})},[l,h]),o.useEffect(()=>{l&&d&&f(v(0,1))},[m]),o.useEffect(()=>{l&&f(e=>e<a.length?e:v(0,1))},[a.length]);const j=()=>{p||X(!0)},O=e=>{!e||e.disabled||A(i.includes(e.value)?i.filter(s=>s!==e.value):[...i,e.value])},ee=e=>A(i.filter(s=>s!==e)),se=e=>{f(s=>{const c=s<0?e>0?0:a.length-1:s+e,u=v(c,e);return u===-1?s:u})},Ie=e=>{const s=F.current;window.clearTimeout(s.timer),s.buffer+=e.toLowerCase(),s.timer=window.setTimeout(()=>s.buffer="",500);const c=a.findIndex(u=>!u.disabled&&u.label.toLowerCase().startsWith(s.buffer));c>=0&&f(c)},te=e=>{if(!p)switch(e.key){case"ArrowDown":e.preventDefault(),l?se(1):j();break;case"ArrowUp":e.preventDefault(),l?se(-1):j();break;case"Enter":e.preventDefault(),l?O(a[h]):j();break;case" ":l?d||(e.preventDefault(),O(a[h])):(e.preventDefault(),j());break;case"Escape":l&&(e.preventDefault(),e.stopPropagation(),C(!0));break;case"Tab":l&&C(!0);break;case"Backspace":l&&(!d||m==="")&&i.length>0&&(e.preventDefault(),ee(i[i.length-1]));break;case"Home":l&&(e.preventDefault(),f(v(0,1)));break;case"End":l&&(e.preventDefault(),f(v(a.length-1,-1)));break;default:!d&&l&&e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&Ie(e.key)}},je=e=>{var c,u;const s=e.relatedTarget;s&&((c=Z.current)!=null&&c.contains(s)||(u=y.current)!=null&&u.contains(s))||n==null||n.onBlur(e)},re=l&&h>=0?V(h):void 0,le=b==="sm"?16:b==="md"?14:12,H=i.length>0;return t.jsxs("div",{className:R.clsx(r.field,r[b],ae&&r.fullWidth,W&&r.error,p&&r.disabled,_e),style:ye,children:[w!=null&&t.jsxs("span",{id:P,className:r.label,onClick:()=>{var e;return!p&&((e=y.current)==null?void 0:e.focus())},children:[t.jsx(M.Typography,{as:"span",variant:"bodySmall",color:"muted",children:w}),Q&&t.jsx("span",{className:r.required,"aria-hidden":"true",children:"*"})]}),t.jsxs("div",{ref:ge,id:g,..._?{name:_}:{},role:"combobox",tabIndex:p?-1:0,"aria-haspopup":"listbox","aria-expanded":l,"aria-controls":l?K:void 0,"aria-activedescendant":d?void 0:re,"aria-labelledby":w!=null?P:void 0,"aria-disabled":p||void 0,"aria-required":Q||void 0,"aria-invalid":W||void 0,"aria-describedby":$!=null?U:void 0,className:R.clsx(r.control,l&&r.open,H&&r.filled),onClick:()=>l?C(!1):j(),onKeyDown:te,onBlur:je,children:[H?t.jsx("span",{className:r.chips,children:i.map(e=>{const s=D.find(c=>c.value===e);return t.jsx(Ne.Chip,{size:b,color:ue,disabled:p,onDelete:()=>ee(e),deleteLabel:`Remove ${(s==null?void 0:s.label)??e}`,deleteTabIndex:-1,children:(s==null?void 0:s.label)??e},e)})}):t.jsx("span",{className:R.clsx(r.value,r.placeholder),children:t.jsx("span",{className:r.valueLabel,children:ie??I("select.placeholder")})}),de&&H&&!p&&t.jsx("button",{type:"button",className:r.clear,"aria-label":I("multiSelect.clearAll"),tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:e=>{var s;e.stopPropagation(),A([]),(s=y.current)==null||s.focus()},children:t.jsx(E.Icon,{name:"CloseCircle",size:"sm"})}),t.jsx(E.Icon,{name:"ArrowDown4",className:r.chevron,style:{width:le,height:le},"aria-hidden":"true"})]}),t.jsxs(De.FloatingPanel,{ref:Z,open:l,triggerRef:y,onClose:C,matchTriggerWidth:!0,className:r.popover,children:[d&&t.jsxs("div",{className:r.search,children:[t.jsx(E.Icon,{name:"SearchNormal",size:"sm",className:r.searchIcon,"aria-hidden":"true"}),t.jsx("input",{ref:J,className:r.searchInput,type:"text",role:"combobox","aria-expanded":"true","aria-controls":K,"aria-activedescendant":re,"aria-autocomplete":"list","aria-label":z,placeholder:z,value:m,spellCheck:!1,onChange:e=>{Y(e.target.value),k==null||k(e.target.value)},onKeyDown:te})]}),t.jsx(qe.List,{role:"listbox",id:K,"aria-labelledby":w!=null?P:void 0,"aria-multiselectable":"true",size:b,className:r.listbox,onMouseLeave:()=>f(-1),children:pe?t.jsxs("div",{className:r.loading,children:[t.jsx(Te.Loader,{size:"sm"}),t.jsx(M.Typography,{as:"span",variant:"bodySmall",color:"muted",children:he??I("common.loading")})]}):a.length===0?t.jsx("div",{className:r.noOptions,children:t.jsx(M.Typography,{as:"span",variant:"bodySmall",color:"muted",children:N==null?I("select.noOptions"):typeof N=="function"?N(m):N})}):a.map((e,s)=>{const c=i.includes(e.value);return t.jsx(Le.ListItem,{id:V(s),role:"option",tabIndex:-1,"aria-selected":c,"aria-current":void 0,clickable:!0,selected:c,disabled:e.disabled,icon:e.icon,className:R.clsx(s===h&&r.active),trailing:c?t.jsx(E.Icon,{name:"TickCircle",size:"sm"}):void 0,onMouseEnter:()=>!e.disabled&&f(s),onMouseDown:u=>u.preventDefault(),onClick:()=>O(e),children:e.label},e.value)})})]}),$!=null&&t.jsx(M.Typography,{as:"span",id:U,variant:"bodySmall",color:W?"error":"muted",className:r.helper,children:$})]})});exports.MultiSelect=cs;
2
- //# sourceMappingURL=MultiSelect-DS2DRpaP.cjs.map
1
+ "use strict";const t=require("react/jsx-runtime"),o=require("react"),R=require("clsx"),we=require("./formContext-bTWrqdEV.cjs"),De=require("./FloatingPanel-U6sGYiSK.cjs"),Ne=require("./Chip-B4XERWb_.cjs"),E=require("./Icon-BVULqOJD.cjs"),qe=require("./List-ChXO0Hz-.cjs"),Le=require("./ListItem-yXXjtepZ.cjs"),Te=require("./Loader-CxLrhAz9.cjs"),M=require("./Typography-BFatE1_A.cjs"),Ce=require("./ConfigProvider-CUG8Mfy2.cjs"),Re="_field_16ykc_1",Ee="_fullWidth_16ykc_7",Me="_label_16ykc_12",Se="_required_16ykc_21",Be="_control_16ykc_27",Pe="_filled_16ykc_47",Ke="_open_16ykc_51",Ve="_error_16ykc_56",We="_disabled_16ykc_64",$e="_chips_16ykc_31",Ae="_value_16ykc_84",Fe="_valueLabel_16ykc_91",Oe="_placeholder_16ykc_96",He="_clear_16ykc_100",Qe="_chevron_16ykc_117",Ue="_sm_16ykc_127",ze="_md_16ykc_131",Ge="_lg_16ykc_135",Je="_helper_16ykc_140",Xe="_popover_16ykc_145",Ye="_search_16ykc_152",Ze="_searchIcon_16ykc_161",es="_searchInput_16ykc_165",ss="_listbox_16ykc_180",ts="_active_16ykc_188",rs="_noOptions_16ykc_192",ls="_loading_16ykc_198",r={field:Re,fullWidth:Ee,label:Me,required:Se,control:Be,filled:Pe,open:Ke,error:Ve,disabled:We,chips:$e,value:Ae,valueLabel:Fe,placeholder:Oe,clear:He,chevron:Qe,sm:Ue,md:ze,lg:Ge,helper:Je,popover:Xe,search:Ye,searchIcon:Ze,searchInput:es,listbox:ss,active:ts,noOptions:rs,loading:ls},cs=o.forwardRef(function({label:w,options:D,size:b="md",error:ce,helperText:oe,required:Q=!1,fullWidth:ae=!0,disabled:p=!1,value:S,defaultValue:ne,onChange:B,placeholder:ie,color:ue="primary",clearable:de=!0,searchable:d=!1,searchPlaceholder:fe,onSearchChange:k,loading:pe=!1,loadingText:he,noOptionsText:N,name:_,id:me,className:_e,style:ye},x){const ve=o.useId(),g=me??ve,P=`${g}-label`,K=`${g}-listbox`,U=`${g}-helper`,V=e=>`${g}-opt-${e}`,I=Ce.useT(),z=fe??I("common.search"),q=we.useFormContext(),L=!!(q&&_),n=L?q.field(_):void 0,be=S!==void 0?S:L?q.values[_]??[]:void 0,G=S!==void 0||L,[ke,xe]=o.useState(ne??[]),i=G?be:ke,W=ce??(n==null?void 0:n.error)??!1,$=oe??(n==null?void 0:n.helperText),A=e=>{G||xe(e),L&&q.setValue(_,e),B==null||B(e)},y=o.useRef(null),J=o.useRef(null),F=o.useRef({buffer:"",timer:0}),T=o.useRef(void 0);T.current=n?()=>n.onBlur({}):void 0;const[l,X]=o.useState(!1),[m,Y]=o.useState(""),[h,f]=o.useState(-1),ge=o.useCallback(e=>{y.current=e,typeof x=="function"?x(e):x&&(x.current=e)},[x]),a=o.useMemo(()=>{if(!d||k||!m.trim())return D;const e=m.trim().toLowerCase();return D.filter(s=>s.label.toLowerCase().includes(e))},[d,k,m,D]),v=o.useCallback((e,s)=>{let c=e;for(;c>=0&&c<a.length;){if(!a[c].disabled)return c;c+=s}return-1},[a]),Z=o.useRef(null),C=o.useCallback(e=>{var s,c;X(!1),Y(""),window.clearTimeout(F.current.timer),F.current.buffer="",(s=T.current)==null||s.call(T),e&&((c=y.current)==null||c.focus())},[]);o.useEffect(()=>{l&&(f(v(0,1)),d&&requestAnimationFrame(()=>{var e;return(e=J.current)==null?void 0:e.focus()}))},[l]),o.useEffect(()=>{var e,s;!l||h<0||(s=(e=document.getElementById(V(h)))==null?void 0:e.scrollIntoView)==null||s.call(e,{block:"nearest"})},[l,h]),o.useEffect(()=>{l&&d&&f(v(0,1))},[m]),o.useEffect(()=>{l&&f(e=>e<a.length?e:v(0,1))},[a.length]);const j=()=>{p||X(!0)},O=e=>{!e||e.disabled||A(i.includes(e.value)?i.filter(s=>s!==e.value):[...i,e.value])},ee=e=>A(i.filter(s=>s!==e)),se=e=>{f(s=>{const c=s<0?e>0?0:a.length-1:s+e,u=v(c,e);return u===-1?s:u})},Ie=e=>{const s=F.current;window.clearTimeout(s.timer),s.buffer+=e.toLowerCase(),s.timer=window.setTimeout(()=>s.buffer="",500);const c=a.findIndex(u=>!u.disabled&&u.label.toLowerCase().startsWith(s.buffer));c>=0&&f(c)},te=e=>{if(!p)switch(e.key){case"ArrowDown":e.preventDefault(),l?se(1):j();break;case"ArrowUp":e.preventDefault(),l?se(-1):j();break;case"Enter":e.preventDefault(),l?O(a[h]):j();break;case" ":l?d||(e.preventDefault(),O(a[h])):(e.preventDefault(),j());break;case"Escape":l&&(e.preventDefault(),e.stopPropagation(),C(!0));break;case"Tab":l&&C(!0);break;case"Backspace":l&&(!d||m==="")&&i.length>0&&(e.preventDefault(),ee(i[i.length-1]));break;case"Home":l&&(e.preventDefault(),f(v(0,1)));break;case"End":l&&(e.preventDefault(),f(v(a.length-1,-1)));break;default:!d&&l&&e.key.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&Ie(e.key)}},je=e=>{var c,u;const s=e.relatedTarget;s&&((c=Z.current)!=null&&c.contains(s)||(u=y.current)!=null&&u.contains(s))||n==null||n.onBlur(e)},re=l&&h>=0?V(h):void 0,le=b==="sm"?16:b==="md"?14:12,H=i.length>0;return t.jsxs("div",{className:R.clsx(r.field,r[b],ae&&r.fullWidth,W&&r.error,p&&r.disabled,_e),style:ye,children:[w!=null&&t.jsxs("span",{id:P,className:r.label,onClick:()=>{var e;return!p&&((e=y.current)==null?void 0:e.focus())},children:[t.jsx(M.Typography,{as:"span",variant:"bodySmall",color:"muted",children:w}),Q&&t.jsx("span",{className:r.required,"aria-hidden":"true",children:"*"})]}),t.jsxs("div",{ref:ge,id:g,..._?{name:_}:{},role:"combobox",tabIndex:p?-1:0,"aria-haspopup":"listbox","aria-expanded":l,"aria-controls":l?K:void 0,"aria-activedescendant":d?void 0:re,"aria-labelledby":w!=null?P:void 0,"aria-disabled":p||void 0,"aria-required":Q||void 0,"aria-invalid":W||void 0,"aria-describedby":$!=null?U:void 0,className:R.clsx(r.control,l&&r.open,H&&r.filled),onClick:()=>l?C(!1):j(),onKeyDown:te,onBlur:je,children:[H?t.jsx("span",{className:r.chips,children:i.map(e=>{const s=D.find(c=>c.value===e);return t.jsx(Ne.Chip,{size:b,color:ue,disabled:p,onDelete:()=>ee(e),deleteLabel:`Remove ${(s==null?void 0:s.label)??e}`,deleteTabIndex:-1,children:(s==null?void 0:s.label)??e},e)})}):t.jsx("span",{className:R.clsx(r.value,r.placeholder),children:t.jsx("span",{className:r.valueLabel,children:ie??I("select.placeholder")})}),de&&H&&!p&&t.jsx("button",{type:"button",className:r.clear,"aria-label":I("multiSelect.clearAll"),tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:e=>{var s;e.stopPropagation(),A([]),(s=y.current)==null||s.focus()},children:t.jsx(E.Icon,{name:"CloseCircle",size:"sm"})}),t.jsx(E.Icon,{name:"ArrowDown4",className:r.chevron,style:{width:le,height:le},"aria-hidden":"true"})]}),t.jsxs(De.FloatingPanel,{ref:Z,open:l,triggerRef:y,onClose:C,matchTriggerWidth:!0,className:r.popover,children:[d&&t.jsxs("div",{className:r.search,children:[t.jsx(E.Icon,{name:"SearchNormal",size:"sm",className:r.searchIcon,"aria-hidden":"true"}),t.jsx("input",{ref:J,className:r.searchInput,type:"text",role:"combobox","aria-expanded":"true","aria-controls":K,"aria-activedescendant":re,"aria-autocomplete":"list","aria-label":z,placeholder:z,value:m,spellCheck:!1,onChange:e=>{Y(e.target.value),k==null||k(e.target.value)},onKeyDown:te})]}),t.jsx(qe.List,{role:"listbox",id:K,"aria-labelledby":w!=null?P:void 0,"aria-multiselectable":"true",size:b,className:r.listbox,onMouseLeave:()=>f(-1),children:pe?t.jsxs("div",{className:r.loading,children:[t.jsx(Te.Loader,{size:"sm"}),t.jsx(M.Typography,{as:"span",variant:"bodySmall",color:"muted",children:he??I("common.loading")})]}):a.length===0?t.jsx("div",{className:r.noOptions,children:t.jsx(M.Typography,{as:"span",variant:"bodySmall",color:"muted",children:N==null?I("select.noOptions"):typeof N=="function"?N(m):N})}):a.map((e,s)=>{const c=i.includes(e.value);return t.jsx(Le.ListItem,{id:V(s),role:"option",tabIndex:-1,"aria-selected":c,"aria-current":void 0,clickable:!0,selected:c,disabled:e.disabled,icon:e.icon,className:R.clsx(s===h&&r.active),trailing:c?t.jsx(E.Icon,{name:"TickCircle",size:"sm"}):void 0,onMouseEnter:()=>!e.disabled&&f(s),onMouseDown:u=>u.preventDefault(),onClick:()=>O(e),children:e.label},e.value)})})]}),$!=null&&t.jsx(M.Typography,{as:"span",id:U,variant:"bodySmall",color:W?"error":"muted",className:r.helper,children:$})]})});exports.MultiSelect=cs;
2
+ //# sourceMappingURL=MultiSelect-DfhyGxDU.cjs.map