@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":"Pagination-BTvUJiee.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\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 // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next/last glyphs are the left ones flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabel","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,M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AErB,UAAAA;AAAA,YAAA;AAAA,UAAA,EACH,GAVOA,CAWT,IAEA,gBAAAL,EAAC,QAAwB,WAAWC,EAAO,MAAM,eAAW,IAC1D,4BAAC,QAAA,EAAK,WAAWA,EAAO,UAAU,UAAA,IAAA,CAAC,KAD5B,GAAGI,CAAI,IAAIzD,CAAC,EAErB;AAAA,QAAA;AAAA,QAGH6C;AAAA,UACC;AAAA,UACA;AAAA,UACAJ,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC0B,EAAQ,QAAQ,QAAQJ,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"Pagination-BaVHgIWT.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabel = 'Pagination',\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\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 // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next/last glyphs are the left ones flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabel","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAClB,GAA6C;AAC3C,MAAIH,KAAS,EAAG,QAAO,CAAA;AAGvB,QAAMI,IAAaV,EAAM,GAAG,KAAK,IAAIS,GAAeH,CAAK,CAAC,GACpDK,IAAWX,EAAM,KAAK,IAAIM,IAAQG,IAAgB,GAAGA,IAAgB,CAAC,GAAGH,CAAK,GAG9EM,IAAgB,KAAK;AAAA,IACzB,KAAK,IAAIL,IAAOC,GAAcF,IAAQG,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAC1EC,IAAgB;AAAA,EAAA,GAEZI,IAAc,KAAK;AAAA,IACvB,KAAK,IAAIN,IAAOC,GAAcC,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAClEG,EAAS,SAAS,IAAIA,EAAS,CAAC,IAAI,IAAIL,IAAQ;AAAA,EAAA;AAGlD,SAAO;AAAA,IACL,GAAGI;AAAA;AAAA,IAEH,GAAIE,IAAgBH,IAAgB,IA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AAA,QAAA;AAAA,QAEZM,EAAM;AAAA,UAAI,CAACc,GAAMzD,MAChB,OAAOyD,KAAS,WACd,gBAAAL,EAAC,MAAA,EAAc,WAAWC,EAAO,MAC/B,UAAA,gBAAAD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAWE,EAAKD,EAAO,MAAMI,MAASpB,KAAWgB,EAAO,QAAQ;AAAA,cAChE,cAAYZ,EAAE,mBAAmB,EAAE,MAAMgB,GAAM;AAAA,cAC/C,gBAAcA,MAASpB,IAAU,SAAS;AAAA,cAC1C,UAAAX;AAAA,cACA,SAAS,MAAMY,EAAGmB,CAAI;AAAA,cAErB,UAAAA;AAAA,YAAA;AAAA,UAAA,EACH,GAVOA,CAWT,IAEA,gBAAAL,EAAC,QAAwB,WAAWC,EAAO,MAAM,eAAW,IAC1D,4BAAC,QAAA,EAAK,WAAWA,EAAO,UAAU,UAAA,IAAA,CAAC,KAD5B,GAAGI,CAAI,IAAIzD,CAAC,EAErB;AAAA,QAAA;AAAA,QAGH6C;AAAA,UACC;AAAA,UACA;AAAA,UACAJ,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC0B,EAAQ,QAAQ,QAAQJ,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -0,0 +1,70 @@
1
+ import { jsxs as q, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as w } from "react";
3
+ import { clsx as y } from "clsx";
4
+ import { QRCodeSVG as s } from "qrcode.react";
5
+ import { T as C } from "./Typography-Cta6Rg4L.js";
6
+ const Q = "_root_15ibt_1", z = "_framed_15ibt_12", N = "_code_15ibt_30", R = "_caption_15ibt_35", o = {
7
+ root: Q,
8
+ framed: z,
9
+ code: N,
10
+ caption: R
11
+ }, G = w(function({
12
+ value: d,
13
+ size: e = 180,
14
+ level: l,
15
+ color: a = "text",
16
+ margin: m = 2,
17
+ image: r,
18
+ caption: c,
19
+ framed: f = !0,
20
+ className: p,
21
+ style: h,
22
+ "aria-label": u = "QR code",
23
+ ...v
24
+ }, _) {
25
+ if (s == null)
26
+ throw new Error(
27
+ "QrCode requires the optional peer dependency 'qrcode.react'. Install it with `npm i qrcode.react`."
28
+ );
29
+ const g = l ?? (r ? "H" : "M"), b = r != null ? (() => {
30
+ const t = typeof r == "string" ? { src: r } : r, i = Math.round(e * 0.22);
31
+ return {
32
+ src: t.src,
33
+ width: t.width ?? i,
34
+ height: t.height ?? i,
35
+ excavate: t.excavate ?? !0
36
+ };
37
+ })() : void 0, x = a === "text" ? void 0 : { "--tz-qr-fg": `var(--tz-color-${a})` };
38
+ return /* @__PURE__ */ q(
39
+ "div",
40
+ {
41
+ ref: _,
42
+ role: "img",
43
+ "aria-label": u,
44
+ className: y(o.root, f && o.framed, p),
45
+ style: { ...x, ...h },
46
+ ...v,
47
+ children: [
48
+ /* @__PURE__ */ n(
49
+ s,
50
+ {
51
+ className: o.code,
52
+ value: d,
53
+ size: e,
54
+ level: g,
55
+ marginSize: m,
56
+ fgColor: "var(--tz-qr-fg)",
57
+ bgColor: "var(--tz-qr-bg)",
58
+ imageSettings: b,
59
+ "aria-hidden": !0
60
+ }
61
+ ),
62
+ c != null && /* @__PURE__ */ n(C, { variant: "caption", color: "muted", className: o.caption, children: c })
63
+ ]
64
+ }
65
+ );
66
+ });
67
+ export {
68
+ G as Q
69
+ };
70
+ //# sourceMappingURL=QrCode-Bcj9_Emc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QrCode-Bcj9_Emc.js","sources":["../src/components/QrCode/QrCode.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { QRCodeSVG } from 'qrcode.react'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport styles from './QrCode.module.css'\n\nexport type QrCodeLevel = 'L' | 'M' | 'Q' | 'H'\n\nexport interface QrCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** The encoded text (URL, `otpauth://…` URI, plain string). Required. */\n value: string\n /** Rendered edge length in px. Default `180`. */\n size?: number\n /** Error-correction level. Default `'M'` (`'H'` when `image` is set, so the logo can cover the middle). */\n level?: QrCodeLevel\n /** Module (foreground) tint — a theme token. Default `'text'` (so it follows light/dark). */\n color?: ThemeColor | 'text'\n /** Quiet zone in modules. Default `2`. */\n margin?: number\n /**\n * Optional centre image (a brand mark), as a URL or `{ src, width?, height?, excavate? }`.\n * `excavate` clears the modules under it (default `true`). Sizes default to ~22% of `size`.\n */\n image?: string | { src: string; width?: number; height?: number; excavate?: boolean }\n /** Caption rendered under the code (muted, centred) — e.g. \"Scan with your authenticator app\". */\n caption?: ReactNode\n /**\n * Wrap the code in a soft `surface` frame with padding and radius, so it sits cleanly on the\n * page `background`. Default `true`. Pass `false` for a bare SVG.\n */\n framed?: boolean\n /** Accessible name. Default `\"QR code\"`. The `value` is never exposed as text by this component. */\n 'aria-label'?: string\n}\n\n/**\n * A QR code, rendered as a crisp **SVG** — wraps the optional peer **`qrcode.react`** (`npm i\n * qrcode.react`) so apps don't pull in their own encoder. The modules take a theme `color` token\n * (default `text`) via the `--tz-qr-fg` var; `framed` (default) wraps the code in a soft, elevated card.\n *\n * **Scannability:** a framed code always sits on a **white** card in both light and dark mode, and its\n * default modules stay **dark** in both — a QR must be dark-on-light to read reliably, so the frame is\n * kept white even in dark mode (a deliberate literal-color exception, like `CodeBlock`'s dark surface).\n * A custom `color` is honored as-is (pick one dark enough to scan). The wrapper is `role=\"img\"` with an\n * `aria-label`; the SVG itself is `aria-hidden`, so the encoded `value` is never read out as text.\n */\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(function QrCode(\n {\n value,\n size = 180,\n level,\n color = 'text',\n margin = 2,\n image,\n caption,\n framed = true,\n className,\n style,\n 'aria-label': ariaLabel = 'QR code',\n ...props\n },\n ref,\n) {\n // Static import keeps `qrcode.react` off every other consumer's bundle (only the `./components/QrCode`\n // subpath pulls it in); guard for the case where the optional peer isn't installed / resolves empty.\n if (QRCodeSVG == null) {\n throw new Error(\n \"QrCode requires the optional peer dependency 'qrcode.react'. Install it with `npm i qrcode.react`.\",\n )\n }\n\n // 'H' error correction by default when a centre image is present, so the logo can cover the middle\n // without breaking the code; otherwise 'M'. An explicit `level` always wins.\n const resolvedLevel: QrCodeLevel = level ?? (image ? 'H' : 'M')\n\n const imageSettings =\n image != null\n ? (() => {\n const img = typeof image === 'string' ? { src: image } : image\n const dim = Math.round(size * 0.22)\n return {\n src: img.src,\n width: img.width ?? dim,\n height: img.height ?? dim,\n excavate: img.excavate ?? true,\n }\n })()\n : undefined\n\n // The foreground (modules) follows the `color` token via `--tz-qr-fg`. The default `text` is left to\n // CSS (so `.framed` can force dark modules on the white card in dark mode); a custom token is pinned\n // inline, so it wins over that CSS fallback and is rendered exactly as asked.\n const fgVar = color === 'text' ? undefined : { '--tz-qr-fg': `var(--tz-color-${color})` }\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n className={clsx(styles.root, framed && styles.framed, className)}\n style={{ ...fgVar, ...style } as CSSProperties}\n {...props}\n >\n <QRCodeSVG\n className={styles.code}\n value={value}\n size={size}\n level={resolvedLevel}\n marginSize={margin}\n // colors flow through CSS vars so `.framed` can guarantee contrast per theme (see the module)\n fgColor=\"var(--tz-qr-fg)\"\n bgColor=\"var(--tz-qr-bg)\"\n imageSettings={imageSettings}\n aria-hidden\n />\n {caption != null && (\n <Typography variant=\"caption\" color=\"muted\" className={styles.caption}>\n {caption}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["QrCode","forwardRef","value","size","level","color","margin","image","caption","framed","className","style","ariaLabel","props","ref","QRCodeSVG","resolvedLevel","imageSettings","img","dim","fgVar","jsxs","clsx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R,eAAAW;AAAA,YACA,eAAW;AAAA,UAAA;AAAA,QAAA;AAAA,QAEZT,KAAW,QACV,gBAAAgB,EAACC,GAAA,EAAW,SAAQ,WAAU,OAAM,SAAQ,WAAWF,EAAO,SAC3D,UAAAf,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const o=require("react/jsx-runtime"),b=require("react"),y=require("clsx"),i=require("qrcode.react"),C=require("./Typography-BFatE1_A.cjs"),Q="_root_15ibt_1",w="_framed_15ibt_12",R="_code_15ibt_30",j="_caption_15ibt_35",t={root:Q,framed:w,code:R,caption:j},z=b.forwardRef(function({value:d,size:c=180,level:l,color:n="text",margin:u=2,image:e,caption:s,framed:h=!0,className:f,style:p,"aria-label":_="QR code",...g},q){if(i.QRCodeSVG==null)throw new Error("QrCode requires the optional peer dependency 'qrcode.react'. Install it with `npm i qrcode.react`.");const v=l??(e?"H":"M"),m=e!=null?(()=>{const r=typeof e=="string"?{src:e}:e,a=Math.round(c*.22);return{src:r.src,width:r.width??a,height:r.height??a,excavate:r.excavate??!0}})():void 0,x=n==="text"?void 0:{"--tz-qr-fg":`var(--tz-color-${n})`};return o.jsxs("div",{ref:q,role:"img","aria-label":_,className:y.clsx(t.root,h&&t.framed,f),style:{...x,...p},...g,children:[o.jsx(i.QRCodeSVG,{className:t.code,value:d,size:c,level:v,marginSize:u,fgColor:"var(--tz-qr-fg)",bgColor:"var(--tz-qr-bg)",imageSettings:m,"aria-hidden":!0}),s!=null&&o.jsx(C.Typography,{variant:"caption",color:"muted",className:t.caption,children:s})]})});exports.QrCode=z;
2
+ //# sourceMappingURL=QrCode-DfDfGhG-.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QrCode-DfDfGhG-.cjs","sources":["../src/components/QrCode/QrCode.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { QRCodeSVG } from 'qrcode.react'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport styles from './QrCode.module.css'\n\nexport type QrCodeLevel = 'L' | 'M' | 'Q' | 'H'\n\nexport interface QrCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** The encoded text (URL, `otpauth://…` URI, plain string). Required. */\n value: string\n /** Rendered edge length in px. Default `180`. */\n size?: number\n /** Error-correction level. Default `'M'` (`'H'` when `image` is set, so the logo can cover the middle). */\n level?: QrCodeLevel\n /** Module (foreground) tint — a theme token. Default `'text'` (so it follows light/dark). */\n color?: ThemeColor | 'text'\n /** Quiet zone in modules. Default `2`. */\n margin?: number\n /**\n * Optional centre image (a brand mark), as a URL or `{ src, width?, height?, excavate? }`.\n * `excavate` clears the modules under it (default `true`). Sizes default to ~22% of `size`.\n */\n image?: string | { src: string; width?: number; height?: number; excavate?: boolean }\n /** Caption rendered under the code (muted, centred) — e.g. \"Scan with your authenticator app\". */\n caption?: ReactNode\n /**\n * Wrap the code in a soft `surface` frame with padding and radius, so it sits cleanly on the\n * page `background`. Default `true`. Pass `false` for a bare SVG.\n */\n framed?: boolean\n /** Accessible name. Default `\"QR code\"`. The `value` is never exposed as text by this component. */\n 'aria-label'?: string\n}\n\n/**\n * A QR code, rendered as a crisp **SVG** — wraps the optional peer **`qrcode.react`** (`npm i\n * qrcode.react`) so apps don't pull in their own encoder. The modules take a theme `color` token\n * (default `text`) via the `--tz-qr-fg` var; `framed` (default) wraps the code in a soft, elevated card.\n *\n * **Scannability:** a framed code always sits on a **white** card in both light and dark mode, and its\n * default modules stay **dark** in both — a QR must be dark-on-light to read reliably, so the frame is\n * kept white even in dark mode (a deliberate literal-color exception, like `CodeBlock`'s dark surface).\n * A custom `color` is honored as-is (pick one dark enough to scan). The wrapper is `role=\"img\"` with an\n * `aria-label`; the SVG itself is `aria-hidden`, so the encoded `value` is never read out as text.\n */\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(function QrCode(\n {\n value,\n size = 180,\n level,\n color = 'text',\n margin = 2,\n image,\n caption,\n framed = true,\n className,\n style,\n 'aria-label': ariaLabel = 'QR code',\n ...props\n },\n ref,\n) {\n // Static import keeps `qrcode.react` off every other consumer's bundle (only the `./components/QrCode`\n // subpath pulls it in); guard for the case where the optional peer isn't installed / resolves empty.\n if (QRCodeSVG == null) {\n throw new Error(\n \"QrCode requires the optional peer dependency 'qrcode.react'. Install it with `npm i qrcode.react`.\",\n )\n }\n\n // 'H' error correction by default when a centre image is present, so the logo can cover the middle\n // without breaking the code; otherwise 'M'. An explicit `level` always wins.\n const resolvedLevel: QrCodeLevel = level ?? (image ? 'H' : 'M')\n\n const imageSettings =\n image != null\n ? (() => {\n const img = typeof image === 'string' ? { src: image } : image\n const dim = Math.round(size * 0.22)\n return {\n src: img.src,\n width: img.width ?? dim,\n height: img.height ?? dim,\n excavate: img.excavate ?? true,\n }\n })()\n : undefined\n\n // The foreground (modules) follows the `color` token via `--tz-qr-fg`. The default `text` is left to\n // CSS (so `.framed` can force dark modules on the white card in dark mode); a custom token is pinned\n // inline, so it wins over that CSS fallback and is rendered exactly as asked.\n const fgVar = color === 'text' ? undefined : { '--tz-qr-fg': `var(--tz-color-${color})` }\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n className={clsx(styles.root, framed && styles.framed, className)}\n style={{ ...fgVar, ...style } as CSSProperties}\n {...props}\n >\n <QRCodeSVG\n className={styles.code}\n value={value}\n size={size}\n level={resolvedLevel}\n marginSize={margin}\n // colors flow through CSS vars so `.framed` can guarantee contrast per theme (see the module)\n fgColor=\"var(--tz-qr-fg)\"\n bgColor=\"var(--tz-qr-bg)\"\n imageSettings={imageSettings}\n aria-hidden\n />\n {caption != null && (\n <Typography variant=\"caption\" color=\"muted\" className={styles.caption}>\n {caption}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["QrCode","forwardRef","value","size","level","color","margin","image","caption","framed","className","style","ariaLabel","props","ref","QRCode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CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as e, jsxs as a, Fragment as b } from "react/jsx-runtime";
2
2
  import { forwardRef as v, useState as B } from "react";
3
- import { B as s } from "./Button-RljTGqHl.js";
3
+ import { B as s } from "./Button-Cfxd7qhd.js";
4
4
  import { I as _ } from "./Icon-DaTvzLBu.js";
5
- import { M as C } from "./Modal-DBYcoCbJ.js";
5
+ import { M as C } from "./Modal-Cx0JEQ-j.js";
6
6
  import { T as D } from "./Typography-Cta6Rg4L.js";
7
- import { a as R } from "./ConfigProvider-DT0yrgmd.js";
7
+ import { a as R } from "./ConfigProvider-Blhvj6UQ.js";
8
8
  const T = "_body_1xrr0_3", k = "_iconBox_1xrr0_13", c = {
9
9
  body: T,
10
10
  iconBox: k
@@ -44,4 +44,4 @@ const T = "_body_1xrr0_3", k = "_iconBox_1xrr0_13", c = {
44
44
  export {
45
45
  E as R
46
46
  };
47
- //# sourceMappingURL=RemoveDialog-BSQ6EMW-.js.map
47
+ //# sourceMappingURL=RemoveDialog-BpL2-gnz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveDialog-BSQ6EMW-.js","sources":["../src/components/RemoveDialog/RemoveDialog.tsx"],"sourcesContent":["import { forwardRef, useState, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport { Typography } from '../Typography'\nimport styles from './RemoveDialog.module.css'\n\nexport interface RemoveDialogProps {\n /** Whether the dialog is open. */\n open: boolean\n /** Called on Cancel, the × button, backdrop, or Escape (ignored while a confirm is in flight). */\n onClose: () => void\n /**\n * The destructive action. May be async — while its promise is pending the Delete button shows a\n * loader and the dialog locks (no dismiss); on success the dialog **auto-closes**, on rejection it\n * stays open so the user can retry (surface the error yourself, e.g. a toast).\n */\n onConfirm: () => void | Promise<void>\n /** Header title. Defaults to `\"Remove\"`. */\n title?: ReactNode\n /** Body prompt shown under the icon. Defaults to `\"Are you sure you want to delete?\"`. */\n message?: ReactNode\n /** Confirm (destructive) button label. Defaults to `\"Delete\"`. */\n confirmLabel?: string\n /** Cancel button label. Defaults to `\"Cancel\"`. */\n cancelLabel?: string\n /** External loading override — combined with the internal async-confirm state. */\n loading?: boolean\n}\n\n/**\n * A ready-made delete confirmation — a thin convenience wrapper over `Modal` for the ubiquitous\n * \"Are you sure you want to delete?\" prompt. Hardcodes the destructive flavor (a `Trash` glyph in a\n * soft error circle + an `error` Delete button); just wire `open` / `onClose` / `onConfirm`. An async\n * `onConfirm` drives the button loader and locks dismissal, then auto-closes on success. Built on\n * `Modal`, so it inherits the portal, scroll-lock, focus-trap, and backdrop/Escape dismissal.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <RemoveDialog open={isOpen} onClose={close} onConfirm={() => deleteItem(id)} />\n */\nexport const RemoveDialog = forwardRef<HTMLDivElement, RemoveDialogProps>(function RemoveDialog(\n { open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, loading = false },\n ref,\n) {\n const t = useT()\n const [submitting, setSubmitting] = useState(false)\n const busy = loading || submitting\n\n // dismissal is blocked while the confirm is running (so the delete can't be abandoned mid-flight)\n const handleClose = () => {\n if (!busy) onClose()\n }\n\n const handleConfirm = async () => {\n try {\n setSubmitting(true)\n await onConfirm()\n onClose() // auto-close on success\n } catch {\n // keep the dialog open on failure so the user can retry; the consumer surfaces the error\n } finally {\n setSubmitting(false)\n }\n }\n\n return (\n <Modal\n ref={ref}\n open={open}\n onClose={handleClose}\n size=\"sm\"\n title={title ?? t('removeDialog.title')}\n showCloseButton={!busy}\n closeOnBackdrop={!busy}\n closeOnEscape={!busy}\n footer={\n <>\n <Button variant=\"text\" onClick={handleClose} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button color=\"error\" variant=\"filled\" onClick={handleConfirm} loading={busy}>\n {confirmLabel ?? t('common.delete')}\n </Button>\n </>\n }\n >\n <div className={styles.body}>\n <div className={styles.iconBox} aria-hidden>\n <Icon name=\"Trash\" />\n </div>\n <Typography align=\"center\">{message ?? t('removeDialog.message')}</Typography>\n </div>\n </Modal>\n )\n})\n"],"names":["RemoveDialog","forwardRef","open","onClose","onConfirm","title","message","confirmLabel","cancelLabel","loading","ref","t","useT","submitting","setSubmitting","useState","busy","handleClose","handleConfirm","jsx","Modal","jsxs","Fragment","Button","styles","Icon","Typography"],"mappings":";;;;;;;;;;GA0CaA,IAAeC,EAA8C,SACxE,EAAE,MAAAC,GAAM,SAAAC,GAAS,WAAAC,GAAW,OAAAC,GAAO,SAAAC,GAAS,cAAAC,GAAc,aAAAC,GAAa,SAAAC,IAAU,GAAA,GACjFC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJ,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5CC,IAAOP,KAAWI,GAGlBI,IAAc,MAAM;AACxB,IAAKD,KAAMb,EAAA;AAAA,EACb,GAEMe,IAAgB,YAAY;AAChC,QAAI;AACF,MAAAJ,EAAc,EAAI,GAClB,MAAMV,EAAA,GACND,EAAA;AAAA,IACF,QAAQ;AAAA,IAER,UAAA;AACE,MAAAW,EAAc,EAAK;AAAA,IACrB;AAAA,EACF;AAEA,SACE,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACA,MAAAR;AAAA,MACA,SAASe;AAAA,MACT,MAAK;AAAA,MACL,OAAOZ,KAASM,EAAE,oBAAoB;AAAA,MACtC,iBAAiB,CAACK;AAAA,MAClB,iBAAiB,CAACA;AAAA,MAClB,eAAe,CAACA;AAAA,MAChB,QACE,gBAAAK,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAH,EAACI,GAAA,EAAO,SAAQ,QAAO,SAASN,GAAa,UAAUD,GACpD,UAAAR,KAAeG,EAAE,eAAe,EAAA,CACnC;AAAA,QACA,gBAAAQ,EAACI,GAAA,EAAO,OAAM,SAAQ,SAAQ,UAAS,SAASL,GAAe,SAASF,GACrE,UAAAT,KAAgBI,EAAE,eAAe,EAAA,CACpC;AAAA,MAAA,GACF;AAAA,MAGF,UAAA,gBAAAU,EAAC,OAAA,EAAI,WAAWG,EAAO,MACrB,UAAA;AAAA,QAAA,gBAAAL,EAAC,OAAA,EAAI,WAAWK,EAAO,SAAS,eAAW,IACzC,UAAA,gBAAAL,EAACM,GAAA,EAAK,MAAK,QAAA,CAAQ,EAAA,CACrB;AAAA,0BACCC,GAAA,EAAW,OAAM,UAAU,UAAApB,KAAWK,EAAE,sBAAsB,EAAA,CAAE;AAAA,MAAA,EAAA,CACnE;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"RemoveDialog-BpL2-gnz.js","sources":["../src/components/RemoveDialog/RemoveDialog.tsx"],"sourcesContent":["import { forwardRef, useState, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport { Typography } from '../Typography'\nimport styles from './RemoveDialog.module.css'\n\nexport interface RemoveDialogProps {\n /** Whether the dialog is open. */\n open: boolean\n /** Called on Cancel, the × button, backdrop, or Escape (ignored while a confirm is in flight). */\n onClose: () => void\n /**\n * The destructive action. May be async — while its promise is pending the Delete button shows a\n * loader and the dialog locks (no dismiss); on success the dialog **auto-closes**, on rejection it\n * stays open so the user can retry (surface the error yourself, e.g. a toast).\n */\n onConfirm: () => void | Promise<void>\n /** Header title. Defaults to `\"Remove\"`. */\n title?: ReactNode\n /** Body prompt shown under the icon. Defaults to `\"Are you sure you want to delete?\"`. */\n message?: ReactNode\n /** Confirm (destructive) button label. Defaults to `\"Delete\"`. */\n confirmLabel?: string\n /** Cancel button label. Defaults to `\"Cancel\"`. */\n cancelLabel?: string\n /** External loading override — combined with the internal async-confirm state. */\n loading?: boolean\n}\n\n/**\n * A ready-made delete confirmation — a thin convenience wrapper over `Modal` for the ubiquitous\n * \"Are you sure you want to delete?\" prompt. Hardcodes the destructive flavor (a `Trash` glyph in a\n * soft error circle + an `error` Delete button); just wire `open` / `onClose` / `onConfirm`. An async\n * `onConfirm` drives the button loader and locks dismissal, then auto-closes on success. Built on\n * `Modal`, so it inherits the portal, scroll-lock, focus-trap, and backdrop/Escape dismissal.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <RemoveDialog open={isOpen} onClose={close} onConfirm={() => deleteItem(id)} />\n */\nexport const RemoveDialog = forwardRef<HTMLDivElement, RemoveDialogProps>(function RemoveDialog(\n { open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, loading = false },\n ref,\n) {\n const t = useT()\n const [submitting, setSubmitting] = useState(false)\n const busy = loading || submitting\n\n // dismissal is blocked while the confirm is running (so the delete can't be abandoned mid-flight)\n const handleClose = () => {\n if (!busy) onClose()\n }\n\n const handleConfirm = async () => {\n try {\n setSubmitting(true)\n await onConfirm()\n onClose() // auto-close on success\n } catch {\n // keep the dialog open on failure so the user can retry; the consumer surfaces the error\n } finally {\n setSubmitting(false)\n }\n }\n\n return (\n <Modal\n ref={ref}\n open={open}\n onClose={handleClose}\n size=\"sm\"\n title={title ?? t('removeDialog.title')}\n showCloseButton={!busy}\n closeOnBackdrop={!busy}\n closeOnEscape={!busy}\n footer={\n <>\n <Button variant=\"text\" onClick={handleClose} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button color=\"error\" variant=\"filled\" onClick={handleConfirm} loading={busy}>\n {confirmLabel ?? t('common.delete')}\n </Button>\n </>\n }\n >\n <div className={styles.body}>\n <div className={styles.iconBox} aria-hidden>\n <Icon name=\"Trash\" />\n </div>\n <Typography align=\"center\">{message ?? t('removeDialog.message')}</Typography>\n </div>\n </Modal>\n )\n})\n"],"names":["RemoveDialog","forwardRef","open","onClose","onConfirm","title","message","confirmLabel","cancelLabel","loading","ref","t","useT","submitting","setSubmitting","useState","busy","handleClose","handleConfirm","jsx","Modal","jsxs","Fragment","Button","styles","Icon","Typography"],"mappings":";;;;;;;;;;GA0CaA,IAAeC,EAA8C,SACxE,EAAE,MAAAC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,EAAE,sBAAsB,EAAA,CAAE;AAAA,MAAA,EAAA,CACnE;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),i=require("react"),c=require("./Button-BdihbLYJ.cjs"),j=require("./Icon-BVULqOJD.cjs"),B=require("./Modal-V6eyGSzW.cjs"),b=require("./Typography-BFatE1_A.cjs"),q=require("./ConfigProvider-C7DUWHrb.cjs"),p="_body_1xrr0_3",C="_iconBox_1xrr0_13",a={body:p,iconBox:C},_=i.forwardRef(function({open:l,onClose:s,onConfirm:d,title:u,message:m,confirmLabel:x,cancelLabel:h,loading:g=!1},y){const n=q.useT(),[f,t]=i.useState(!1),o=g||f,r=()=>{o||s()},v=async()=>{try{t(!0),await d(),s()}catch{}finally{t(!1)}};return e.jsx(B.Modal,{ref:y,open:l,onClose:r,size:"sm",title:u??n("removeDialog.title"),showCloseButton:!o,closeOnBackdrop:!o,closeOnEscape:!o,footer:e.jsxs(e.Fragment,{children:[e.jsx(c.Button,{variant:"text",onClick:r,disabled:o,children:h??n("common.cancel")}),e.jsx(c.Button,{color:"error",variant:"filled",onClick:v,loading:o,children:x??n("common.delete")})]}),children:e.jsxs("div",{className:a.body,children:[e.jsx("div",{className:a.iconBox,"aria-hidden":!0,children:e.jsx(j.Icon,{name:"Trash"})}),e.jsx(b.Typography,{align:"center",children:m??n("removeDialog.message")})]})})});exports.RemoveDialog=_;
2
- //# sourceMappingURL=RemoveDialog-BhcwsY0q.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),i=require("react"),c=require("./Button-ZplrHYKw.cjs"),j=require("./Icon-BVULqOJD.cjs"),B=require("./Modal-DXZdMmJh.cjs"),b=require("./Typography-BFatE1_A.cjs"),q=require("./ConfigProvider-CUG8Mfy2.cjs"),p="_body_1xrr0_3",C="_iconBox_1xrr0_13",a={body:p,iconBox:C},_=i.forwardRef(function({open:l,onClose:s,onConfirm:d,title:u,message:m,confirmLabel:x,cancelLabel:h,loading:g=!1},y){const n=q.useT(),[f,t]=i.useState(!1),o=g||f,r=()=>{o||s()},v=async()=>{try{t(!0),await d(),s()}catch{}finally{t(!1)}};return e.jsx(B.Modal,{ref:y,open:l,onClose:r,size:"sm",title:u??n("removeDialog.title"),showCloseButton:!o,closeOnBackdrop:!o,closeOnEscape:!o,footer:e.jsxs(e.Fragment,{children:[e.jsx(c.Button,{variant:"text",onClick:r,disabled:o,children:h??n("common.cancel")}),e.jsx(c.Button,{color:"error",variant:"filled",onClick:v,loading:o,children:x??n("common.delete")})]}),children:e.jsxs("div",{className:a.body,children:[e.jsx("div",{className:a.iconBox,"aria-hidden":!0,children:e.jsx(j.Icon,{name:"Trash"})}),e.jsx(b.Typography,{align:"center",children:m??n("removeDialog.message")})]})})});exports.RemoveDialog=_;
2
+ //# sourceMappingURL=RemoveDialog-DGt_72we.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveDialog-BhcwsY0q.cjs","sources":["../src/components/RemoveDialog/RemoveDialog.tsx"],"sourcesContent":["import { forwardRef, useState, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport { Typography } from '../Typography'\nimport styles from './RemoveDialog.module.css'\n\nexport interface RemoveDialogProps {\n /** Whether the dialog is open. */\n open: boolean\n /** Called on Cancel, the × button, backdrop, or Escape (ignored while a confirm is in flight). */\n onClose: () => void\n /**\n * The destructive action. May be async — while its promise is pending the Delete button shows a\n * loader and the dialog locks (no dismiss); on success the dialog **auto-closes**, on rejection it\n * stays open so the user can retry (surface the error yourself, e.g. a toast).\n */\n onConfirm: () => void | Promise<void>\n /** Header title. Defaults to `\"Remove\"`. */\n title?: ReactNode\n /** Body prompt shown under the icon. Defaults to `\"Are you sure you want to delete?\"`. */\n message?: ReactNode\n /** Confirm (destructive) button label. Defaults to `\"Delete\"`. */\n confirmLabel?: string\n /** Cancel button label. Defaults to `\"Cancel\"`. */\n cancelLabel?: string\n /** External loading override — combined with the internal async-confirm state. */\n loading?: boolean\n}\n\n/**\n * A ready-made delete confirmation — a thin convenience wrapper over `Modal` for the ubiquitous\n * \"Are you sure you want to delete?\" prompt. Hardcodes the destructive flavor (a `Trash` glyph in a\n * soft error circle + an `error` Delete button); just wire `open` / `onClose` / `onConfirm`. An async\n * `onConfirm` drives the button loader and locks dismissal, then auto-closes on success. Built on\n * `Modal`, so it inherits the portal, scroll-lock, focus-trap, and backdrop/Escape dismissal.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <RemoveDialog open={isOpen} onClose={close} onConfirm={() => deleteItem(id)} />\n */\nexport const RemoveDialog = forwardRef<HTMLDivElement, RemoveDialogProps>(function RemoveDialog(\n { open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, loading = false },\n ref,\n) {\n const t = useT()\n const [submitting, setSubmitting] = useState(false)\n const busy = loading || submitting\n\n // dismissal is blocked while the confirm is running (so the delete can't be abandoned mid-flight)\n const handleClose = () => {\n if (!busy) onClose()\n }\n\n const handleConfirm = async () => {\n try {\n setSubmitting(true)\n await onConfirm()\n onClose() // auto-close on success\n } catch {\n // keep the dialog open on failure so the user can retry; the consumer surfaces the error\n } finally {\n setSubmitting(false)\n }\n }\n\n return (\n <Modal\n ref={ref}\n open={open}\n onClose={handleClose}\n size=\"sm\"\n title={title ?? t('removeDialog.title')}\n showCloseButton={!busy}\n closeOnBackdrop={!busy}\n closeOnEscape={!busy}\n footer={\n <>\n <Button variant=\"text\" onClick={handleClose} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button color=\"error\" variant=\"filled\" onClick={handleConfirm} loading={busy}>\n {confirmLabel ?? t('common.delete')}\n </Button>\n </>\n }\n >\n <div className={styles.body}>\n <div className={styles.iconBox} aria-hidden>\n <Icon name=\"Trash\" />\n </div>\n <Typography align=\"center\">{message ?? t('removeDialog.message')}</Typography>\n </div>\n </Modal>\n )\n})\n"],"names":["RemoveDialog","forwardRef","open","onClose","onConfirm","title","message","confirmLabel","cancelLabel","loading","ref","t","useT","submitting","setSubmitting","useState","busy","handleClose","handleConfirm","jsx","Modal","jsxs","Fragment","Button","styles","Icon","Typography"],"mappings":"0TA0CaA,EAAeC,EAAAA,WAA8C,SACxE,CAAE,KAAAC,EAAM,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,QAAAC,EAAS,aAAAC,EAAc,YAAAC,EAAa,QAAAC,EAAU,EAAA,EACjFC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAK,EAC5CC,EAAOP,GAAWI,EAGlBI,EAAc,IAAM,CACnBD,GAAMb,EAAA,CACb,EAEMe,EAAgB,SAAY,CAChC,GAAI,CACFJ,EAAc,EAAI,EAClB,MAAMV,EAAA,EACND,EAAA,CACF,MAAQ,CAER,QAAA,CACEW,EAAc,EAAK,CACrB,CACF,EAEA,OACEK,EAAAA,IAACC,EAAAA,MAAA,CACC,IAAAV,EACA,KAAAR,EACA,QAASe,EACT,KAAK,KACL,MAAOZ,GAASM,EAAE,oBAAoB,EACtC,gBAAiB,CAACK,EAClB,gBAAiB,CAACA,EAClB,cAAe,CAACA,EAChB,OACEK,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAH,EAAAA,IAACI,EAAAA,OAAA,CAAO,QAAQ,OAAO,QAASN,EAAa,SAAUD,EACpD,SAAAR,GAAeG,EAAE,eAAe,CAAA,CACnC,EACAQ,EAAAA,IAACI,EAAAA,OAAA,CAAO,MAAM,QAAQ,QAAQ,SAAS,QAASL,EAAe,QAASF,EACrE,SAAAT,GAAgBI,EAAE,eAAe,CAAA,CACpC,CAAA,EACF,EAGF,SAAAU,EAAAA,KAAC,MAAA,CAAI,UAAWG,EAAO,KACrB,SAAA,CAAAL,EAAAA,IAAC,MAAA,CAAI,UAAWK,EAAO,QAAS,cAAW,GACzC,SAAAL,EAAAA,IAACM,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CACrB,QACCC,EAAAA,WAAA,CAAW,MAAM,SAAU,SAAApB,GAAWK,EAAE,sBAAsB,CAAA,CAAE,CAAA,CAAA,CACnE,CAAA,CAAA,CAGN,CAAC"}
1
+ {"version":3,"file":"RemoveDialog-DGt_72we.cjs","sources":["../src/components/RemoveDialog/RemoveDialog.tsx"],"sourcesContent":["import { forwardRef, useState, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { Button } from '../Button'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport { Typography } from '../Typography'\nimport styles from './RemoveDialog.module.css'\n\nexport interface RemoveDialogProps {\n /** Whether the dialog is open. */\n open: boolean\n /** Called on Cancel, the × button, backdrop, or Escape (ignored while a confirm is in flight). */\n onClose: () => void\n /**\n * The destructive action. May be async — while its promise is pending the Delete button shows a\n * loader and the dialog locks (no dismiss); on success the dialog **auto-closes**, on rejection it\n * stays open so the user can retry (surface the error yourself, e.g. a toast).\n */\n onConfirm: () => void | Promise<void>\n /** Header title. Defaults to `\"Remove\"`. */\n title?: ReactNode\n /** Body prompt shown under the icon. Defaults to `\"Are you sure you want to delete?\"`. */\n message?: ReactNode\n /** Confirm (destructive) button label. Defaults to `\"Delete\"`. */\n confirmLabel?: string\n /** Cancel button label. Defaults to `\"Cancel\"`. */\n cancelLabel?: string\n /** External loading override — combined with the internal async-confirm state. */\n loading?: boolean\n}\n\n/**\n * A ready-made delete confirmation — a thin convenience wrapper over `Modal` for the ubiquitous\n * \"Are you sure you want to delete?\" prompt. Hardcodes the destructive flavor (a `Trash` glyph in a\n * soft error circle + an `error` Delete button); just wire `open` / `onClose` / `onConfirm`. An async\n * `onConfirm` drives the button loader and locks dismissal, then auto-closes on success. Built on\n * `Modal`, so it inherits the portal, scroll-lock, focus-trap, and backdrop/Escape dismissal.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <RemoveDialog open={isOpen} onClose={close} onConfirm={() => deleteItem(id)} />\n */\nexport const RemoveDialog = forwardRef<HTMLDivElement, RemoveDialogProps>(function RemoveDialog(\n { open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, loading = false },\n ref,\n) {\n const t = useT()\n const [submitting, setSubmitting] = useState(false)\n const busy = loading || submitting\n\n // dismissal is blocked while the confirm is running (so the delete can't be abandoned mid-flight)\n const handleClose = () => {\n if (!busy) onClose()\n }\n\n const handleConfirm = async () => {\n try {\n setSubmitting(true)\n await onConfirm()\n onClose() // auto-close on success\n } catch {\n // keep the dialog open on failure so the user can retry; the consumer surfaces the error\n } finally {\n setSubmitting(false)\n }\n }\n\n return (\n <Modal\n ref={ref}\n open={open}\n onClose={handleClose}\n size=\"sm\"\n title={title ?? t('removeDialog.title')}\n showCloseButton={!busy}\n closeOnBackdrop={!busy}\n closeOnEscape={!busy}\n footer={\n <>\n <Button variant=\"text\" onClick={handleClose} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button color=\"error\" variant=\"filled\" onClick={handleConfirm} loading={busy}>\n {confirmLabel ?? t('common.delete')}\n </Button>\n </>\n }\n >\n <div className={styles.body}>\n <div className={styles.iconBox} aria-hidden>\n <Icon name=\"Trash\" />\n </div>\n <Typography align=\"center\">{message ?? t('removeDialog.message')}</Typography>\n </div>\n </Modal>\n )\n})\n"],"names":["RemoveDialog","forwardRef","open","onClose","onConfirm","title","message","confirmLabel","cancelLabel","loading","ref","t","useT","submitting","setSubmitting","useState","busy","handleClose","handleConfirm","jsx","Modal","jsxs","Fragment","Button","styles","Icon","Typography"],"mappings":"0TA0CaA,EAAeC,EAAAA,WAA8C,SACxE,CAAE,KAAAC,EAAM,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,QAAAC,EAAS,aAAAC,EAAc,YAAAC,EAAa,QAAAC,EAAU,EAAA,EACjFC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAACC,EAAYC,CAAa,EAAIC,EAAAA,SAAS,EAAK,EAC5CC,EAAOP,GAAWI,EAGlBI,EAAc,IAAM,CACnBD,GAAMb,EAAA,CACb,EAEMe,EAAgB,SAAY,CAChC,GAAI,CACFJ,EAAc,EAAI,EAClB,MAAMV,EAAA,EACND,EAAA,CACF,MAAQ,CAER,QAAA,CACEW,EAAc,EAAK,CACrB,CACF,EAEA,OACEK,EAAAA,IAACC,EAAAA,MAAA,CACC,IAAAV,EACA,KAAAR,EACA,QAASe,EACT,KAAK,KACL,MAAOZ,GAASM,EAAE,oBAAoB,EACtC,gBAAiB,CAACK,EAClB,gBAAiB,CAACA,EAClB,cAAe,CAACA,EAChB,OACEK,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAH,EAAAA,IAACI,EAAAA,OAAA,CAAO,QAAQ,OAAO,QAASN,EAAa,SAAUD,EACpD,SAAAR,GAAeG,EAAE,eAAe,CAAA,CACnC,EACAQ,EAAAA,IAACI,EAAAA,OAAA,CAAO,MAAM,QAAQ,QAAQ,SAAS,QAASL,EAAe,QAASF,EACrE,SAAAT,GAAgBI,EAAE,eAAe,CAAA,CACpC,CAAA,EACF,EAGF,SAAAU,EAAAA,KAAC,MAAA,CAAI,UAAWG,EAAO,KACrB,SAAA,CAAAL,EAAAA,IAAC,MAAA,CAAI,UAAWK,EAAO,QAAS,cAAW,GACzC,SAAAL,EAAAA,IAACM,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CACrB,QACCC,EAAAA,WAAA,CAAW,MAAM,SAAU,SAAApB,GAAWK,EAAE,sBAAsB,CAAA,CAAE,CAAA,CAAA,CACnE,CAAA,CAAA,CAGN,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),a=require("react"),$e=require("clsx"),c=require("lexical"),we=require("@lexical/react/LexicalComposer"),ve=require("@lexical/react/LexicalComposerContext"),Be=require("@lexical/react/LexicalRichTextPlugin"),Fe=require("@lexical/react/LexicalContentEditable"),Ue=require("@lexical/react/LexicalErrorBoundary"),Pe=require("@lexical/react/LexicalHistoryPlugin"),He=require("@lexical/react/LexicalListPlugin"),Ve=require("@lexical/react/LexicalCheckListPlugin"),ze=require("@lexical/react/LexicalLinkPlugin"),Ge=require("@lexical/react/LexicalMarkdownShortcutPlugin"),le=require("@lexical/markdown"),D=require("@lexical/rich-text"),T=require("@lexical/list"),$=require("@lexical/link"),Le=require("@lexical/html"),Ke=require("./formContext-bTWrqdEV.cjs"),xe=require("./Typography-BFatE1_A.cjs"),We=require("./toastStore-B4Tk2Xk7.cjs"),S=require("@lexical/selection"),I=require("@lexical/utils"),z=require("./Button-BdihbLYJ.cjs"),ge=require("./ColorPickerPanel-BOGYXXF1.cjs"),M=require("./Divider-CzbhdCiD.cjs"),se=require("./Dropdown-Ui7h2TGd.cjs"),Je=require("./FloatingPanel-U6sGYiSK.cjs"),h=require("./Icon-BVULqOJD.cjs"),O=require("./IconButton-Lv0sDDR9.cjs"),G=require("./ListItem-yXXjtepZ.cjs"),Qe=require("./Modal-V6eyGSzW.cjs"),Xe=require("./TextField-DNqnpAWB.cjs"),ce=require("./ConfigProvider-C7DUWHrb.cjs"),Ye=/^(?:https?:|mailto:|tel:|ftp:|#|\/|\?|\.)/i,Ze=/^[a-z][a-z0-9+.-]*:/i;function ae(o){const t=o.trim();return t===""?"":Ye.test(t)||!Ze.test(t)?t:"#"}function Ne(o){const t=o.trim();if(/^data:(?:image|video)\//i.test(t)||/^blob:/i.test(t))return t;const i=ae(t);return i==="#"?"":i}function et(o){return o instanceof HTMLImageElement&&o.src?{node:K(o.getAttribute("src")??o.src,o.alt)}:null}class W extends c.DecoratorNode{static getType(){return"tz-image"}static clone(t){return new W(t.__src,t.__alt,t.__key)}constructor(t,i="",n){super(n),this.__src=Ne(t),this.__alt=i}static importJSON(t){return K(t.src,t.alt)}exportJSON(){return{...super.exportJSON(),type:"tz-image",version:1,src:this.__src,alt:this.__alt}}static importDOM(){return{img:()=>({conversion:et,priority:0})}}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),t.setAttribute("alt",this.__alt),{element:t}}createDOM(){const t=document.createElement("div");return t.style.display="contents",t}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__alt}decorate(){return r.jsx("img",{src:this.__src,alt:this.__alt,draggable:!1})}}function K(o,t=""){return c.$applyNodeReplacement(new W(o,t))}function je(o){return/\.(mp4|webm|ogg|ogv|mov|m4v)(\?.*)?$/i.test(o)}function tt(o){const t=o.match(/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/);if(t)return`https://www.youtube.com/embed/${t[1]}`;const i=o.match(/vimeo\.com\/(?:video\/)?(\d+)/);return i?`https://player.vimeo.com/video/${i[1]}`:o}function ye(o){var i;const t=o.getAttribute("src")||((i=o.querySelector("source"))==null?void 0:i.getAttribute("src"));return t?{node:ue(t)}:null}class J extends c.DecoratorNode{static getType(){return"tz-video"}static clone(t){return new J(t.__src,t.__key)}constructor(t,i){super(i),this.__src=Ne(t)}static importJSON(t){return ue(t.src)}exportJSON(){return{...super.exportJSON(),type:"tz-video",version:1,src:this.__src}}static importDOM(){return{iframe:()=>({conversion:ye,priority:0}),video:()=>({conversion:ye,priority:0})}}exportDOM(){if(je(this.__src)){const i=document.createElement("video");return i.setAttribute("src",this.__src),i.setAttribute("controls","true"),{element:i}}const t=document.createElement("iframe");return t.setAttribute("src",this.__src),t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),{element:t}}createDOM(){const t=document.createElement("div");return t.style.display="contents",t}updateDOM(){return!1}getSrc(){return this.__src}decorate(){return je(this.__src)?r.jsx("video",{src:this.__src,controls:!0}):r.jsx(rt,{src:this.__src})}}function rt({src:o}){const t=ce.useT();return r.jsx("div",{className:"tz-rte-embed",children:r.jsx("iframe",{src:o,title:t("rte.embeddedVideo"),frameBorder:0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}function ue(o){return c.$applyNodeReplacement(new J(tt(o)))}const ot="_editor_16j1l_1",nt="_label_16j1l_9",it="_required_16j1l_15",lt="_helper_16j1l_18",st="_control_16j1l_24",ct="_error_16j1l_38",at="_disabled_16j1l_45",ut="_toolbar_16j1l_51",dt="_sm_16j1l_67",mt="_md_16j1l_71",pt="_lg_16j1l_75",ht="_colorGlyph_16j1l_81",_t="_colorBar_16j1l_89",ft="_shell_16j1l_107",xt="_content_16j1l_110",gt="_placeholder_16j1l_123",jt="_paragraph_16j1l_146",yt="_h1_16j1l_152",Ct="_h2_16j1l_153",vt="_h3_16j1l_154",Lt="_h4_16j1l_155",Nt="_h5_16j1l_156",bt="_h6_16j1l_157",St="_quote_16j1l_176",Tt="_ul_16j1l_183",Et="_ol_16j1l_188",kt="_li_16j1l_193",Rt="_nestedLi_16j1l_196",It="_liChecked_16j1l_200",Mt="_liUnchecked_16j1l_201",Ot="_link_16j1l_238",Dt="_bold_16j1l_245",At="_italic_16j1l_248",qt="_underline_16j1l_251",$t="_strike_16j1l_254",wt="_codeInline_16j1l_260",l={editor:ot,label:nt,required:it,helper:lt,control:st,error:ct,disabled:at,toolbar:ut,sm:dt,md:mt,lg:pt,colorGlyph:ht,colorBar:_t,shell:ft,content:xt,placeholder:gt,paragraph:jt,h1:yt,h2:Ct,h3:vt,h4:Lt,h5:Nt,h6:bt,quote:St,ul:Tt,ol:Et,li:kt,nestedLi:Rt,liChecked:It,liUnchecked:Mt,link:Ot,bold:Dt,italic:At,underline:qt,strike:$t,codeInline:wt},Bt={paragraph:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",quote:"Quote",bullet:"Bullet List",number:"Numbered List",check:"Check List"},Ft=[{type:"paragraph",icon:"Text"},{type:"h1",icon:"Hashtag"},{type:"h2",icon:"Hashtag"},{type:"h3",icon:"Hashtag"}],Ut=[{value:"left",labelKey:"rte.alignLeft",icon:"TextalignLeft"},{value:"center",labelKey:"rte.alignCenter",icon:"TextalignCenter"},{value:"right",labelKey:"rte.alignRight",icon:"TextalignRight"}],Pt=["10px","12px","14px","16px","18px","20px"],Ht={sm:"12px",md:"14px",lg:"16px"};function Vt({color:o,size:t}){return r.jsxs("span",{className:l.colorGlyph,children:[r.jsx(h.Icon,{name:"Brush",size:t}),r.jsx("span",{className:l.colorBar,style:{borderColor:`transparent transparent ${o||"currentColor"} transparent`},"aria-hidden":"true"})]})}function zt({size:o,disabled:t,onImageUpload:i}){const n=ce.useT(),d=e=>Bt[e]??e,[u]=ve.useLexicalComposerContext(),g=a.useRef(null),[C,p]=a.useState(!1),[f,Q]=a.useState(!1),[E,X]=a.useState(!1),[w,Y]=a.useState(!1),[Z,ee]=a.useState(""),[y,k]=a.useState("paragraph"),[j,x]=a.useState("left"),[A,q]=a.useState(""),[B,F]=a.useState(""),[U,P]=a.useState(!1),R=a.useRef(null),[te,_]=a.useState(!1),[be,Se]=a.useState(!1),[m,re]=a.useState(null),[de,me]=a.useState(""),oe=a.useCallback(()=>{const e=c.$getSelection();if(!c.$isRangeSelection(e))return;p(e.hasFormat("bold")),Q(e.hasFormat("italic")),X(e.hasFormat("underline")),F(S.$getSelectionStyleValueForProperty(e,"color","")),q(S.$getSelectionStyleValueForProperty(e,"font-size",""));const s=e.anchor.getNode(),N=s.getParent(),L=$.$isLinkNode(s)?s:$.$isLinkNode(N)?N:null;Y(L!==null),ee((L==null?void 0:L.getURL())??"");const b=s.getKey()==="root"?s:I.$findMatchingParent(s,qe=>{const fe=qe.getParent();return fe===null||fe.getKey()==="root"})??s.getTopLevelElement();x(c.$isElementNode(b)&&b.getFormatType()||"left");const V=I.$getNearestNodeOfType(s,T.ListNode);V?k(V.getListType()):D.$isHeadingNode(b)?k(b.getTag()):D.$isQuoteNode(b)?k("quote"):k("paragraph")},[]);a.useEffect(()=>I.mergeRegister(u.registerUpdateListener(({editorState:e})=>e.read(oe)),u.registerCommand(c.SELECTION_CHANGE_COMMAND,()=>(oe(),!1),c.COMMAND_PRIORITY_LOW),u.registerCommand(c.CAN_UNDO_COMMAND,e=>(_(e),!1),c.COMMAND_PRIORITY_LOW),u.registerCommand(c.CAN_REDO_COMMAND,e=>(Se(e),!1),c.COMMAND_PRIORITY_LOW)),[u,oe]);const ne=e=>u.dispatchCommand(c.FORMAT_TEXT_COMMAND,e),Te=e=>u.dispatchCommand(c.FORMAT_ELEMENT_COMMAND,e),Ee=e=>{F(e),u.update(()=>{const s=c.$getSelection();c.$isRangeSelection(s)&&S.$patchStyleText(s,{color:e||null})})},ke=e=>{q(e),u.update(()=>{const s=c.$getSelection();c.$isRangeSelection(s)&&S.$patchStyleText(s,{"font-size":e||null})})},H=e=>{if(e==="bullet"||e==="number"||e==="check"){if(y===e)u.dispatchCommand(T.REMOVE_LIST_COMMAND,void 0);else{const s=e==="bullet"?T.INSERT_UNORDERED_LIST_COMMAND:e==="number"?T.INSERT_ORDERED_LIST_COMMAND:T.INSERT_CHECK_LIST_COMMAND;u.dispatchCommand(s,void 0)}return}u.update(()=>{const s=c.$getSelection();c.$isRangeSelection(s)&&(e==="paragraph"?S.$setBlocksType(s,()=>c.$createParagraphNode()):e==="quote"?S.$setBlocksType(s,()=>D.$createQuoteNode()):S.$setBlocksType(s,()=>D.$createHeadingNode(e)))})},Re=()=>H(y==="quote"?"paragraph":"quote"),ie=(e,s="")=>{me(s),re(e)},pe=()=>re(null),Ie=()=>{m==null||m.onConfirm(de.trim()),re(null)},Me=()=>ie({icon:"Link2",title:n("rte.linkTitle"),label:n("rte.linkUrl"),placeholder:"https://example.com",confirmLabel:n(w?"common.update":"common.insert"),onConfirm:e=>u.dispatchCommand($.TOGGLE_LINK_COMMAND,e===""?null:ae(e))},Z),Oe=()=>ie({icon:"GalleryAdd",title:n("rte.imageTitle"),label:n("rte.imageUrl"),placeholder:"https://example.com/image.jpg",confirmLabel:n("common.insert"),onConfirm:e=>{e&&u.update(()=>I.$insertNodeToNearestRoot(K(e)))}}),De=async e=>{var N;const s=(N=e.target.files)==null?void 0:N[0];if(e.target.value="",!!s)try{const L=i?await i(s):await Gt(s);u.update(()=>I.$insertNodeToNearestRoot(K(L,s.name)))}catch{We.toast.error(n("rte.imageError"))}},Ae=()=>ie({icon:"VideoSquare",title:n("rte.videoTitle"),label:n("rte.videoUrl"),placeholder:n("rte.videoUrlPlaceholder"),confirmLabel:n("common.insert"),onConfirm:e=>{e&&u.update(()=>I.$insertNodeToNearestRoot(ue(e)))}}),v=(e,s,N,L,b)=>r.jsx(O.IconButton,{variant:e?"filled":"text",color:"primary",size:o,disabled:t,"aria-label":s,"aria-pressed":e,onMouseDown:V=>V.preventDefault(),onClick:N,children:L},b),he=y.startsWith("h")?y:"paragraph",_e=A||Ht[o];return r.jsxs("div",{className:l.toolbar,role:"toolbar","aria-label":n("rte.formatting"),"aria-orientation":"horizontal",children:[r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t||!te,"aria-label":n("rte.undo"),onMouseDown:e=>e.preventDefault(),onClick:()=>u.dispatchCommand(c.UNDO_COMMAND,void 0),children:r.jsx(h.Icon,{name:"UndoArrow"})}),r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t||!be,"aria-label":n("rte.redo"),onMouseDown:e=>e.preventDefault(),onClick:()=>u.dispatchCommand(c.REDO_COMMAND,void 0),children:r.jsx(h.Icon,{name:"RedoArrow"})}),r.jsx(M.Divider,{orientation:"vertical"}),r.jsx(se.Dropdown,{size:o,disabled:t,minWidth:!1,trigger:r.jsx(z.Button,{variant:"text",color:"primary",size:o,disabled:t,endIcon:r.jsx(h.Icon,{name:"ArrowDown4"}),"aria-label":n("rte.fontSize"),onMouseDown:e=>e.preventDefault(),children:_e}),children:Pt.map(e=>r.jsx(G.ListItem,{clickable:!0,selected:e===_e,onClick:()=>ke(e),children:e},e))}),r.jsx(M.Divider,{orientation:"vertical"}),r.jsx(se.Dropdown,{size:o,disabled:t,trigger:r.jsx(z.Button,{variant:"text",color:"primary",size:o,disabled:t,endIcon:r.jsx(h.Icon,{name:"ArrowDown4"}),onMouseDown:e=>e.preventDefault(),children:d(he)}),children:Ft.map(e=>r.jsx(G.ListItem,{clickable:!0,selected:he===e.type,icon:e.icon,onClick:()=>H(e.type),children:d(e.type)},e.type))}),r.jsx(M.Divider,{orientation:"vertical"}),v(C,n("rte.bold"),()=>ne("bold"),r.jsx(h.Icon,{name:"TextBold"})),v(f,n("rte.italic"),()=>ne("italic"),r.jsx(h.Icon,{name:"TextItalic"})),v(E,n("rte.underline"),()=>ne("underline"),r.jsx(h.Icon,{name:"TextUnderline"})),r.jsx(M.Divider,{orientation:"vertical"}),v(y==="bullet",n("rte.bulletList"),()=>H("bullet"),r.jsx(h.Icon,{name:"ListBullet"})),v(y==="number",n("rte.numberedList"),()=>H("number"),r.jsx(h.Icon,{name:"ListNumber"})),v(y==="quote",n("rte.quote"),Re,r.jsx(h.Icon,{name:"QuoteUp"})),r.jsx(M.Divider,{orientation:"vertical"}),Ut.map(e=>v(j===e.value,n(e.labelKey),()=>Te(e.value),r.jsx(h.Icon,{name:e.icon}),e.value)),r.jsx(M.Divider,{orientation:"vertical"}),r.jsx(O.IconButton,{ref:R,variant:"text",color:"primary",size:o,disabled:t,"aria-label":n("rte.textColor"),"aria-expanded":U,onMouseDown:e=>e.preventDefault(),onClick:()=>P(e=>!e),children:r.jsx(Vt,{color:B})}),r.jsx(Je.FloatingPanel,{open:U,triggerRef:R,onClose:e=>{var s;P(!1),e&&((s=R.current)==null||s.focus())},role:"dialog",ariaLabel:n("rte.textColor"),width:232,children:r.jsx(ge.ColorPickerPanel,{value:B||ge.DEFAULT_SWATCHES[0],onChange:Ee,clearable:!1})}),v(w,n("rte.link"),Me,r.jsx(h.Icon,{name:"Link2"})),r.jsxs(se.Dropdown,{size:o,disabled:t,minWidth:!1,trigger:r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t,"aria-label":n("rte.insertImage"),children:r.jsx(h.Icon,{name:"GalleryAdd"})}),children:[r.jsx(G.ListItem,{clickable:!0,icon:"GalleryImport",onClick:()=>{var e;return(e=g.current)==null?void 0:e.click()},children:n("rte.uploadImage")}),r.jsx(G.ListItem,{clickable:!0,icon:"Link",onClick:Oe,children:n("rte.imageByUrl")})]}),r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t,"aria-label":n("rte.insertVideo"),onClick:Ae,children:r.jsx(h.Icon,{name:"VideoSquare"})}),r.jsx("input",{ref:g,type:"file",accept:"image/*",hidden:!0,onChange:De,"aria-hidden":"true",tabIndex:-1}),r.jsx(Qe.Modal,{open:m!==null,onClose:pe,size:"sm",icon:m==null?void 0:m.icon,title:m==null?void 0:m.title,footer:r.jsxs(r.Fragment,{children:[r.jsx(z.Button,{variant:"text",onClick:pe,children:n("common.cancel")}),r.jsx(z.Button,{type:"submit",form:"rte-url-form",children:(m==null?void 0:m.confirmLabel)??n("common.insert")})]}),children:r.jsx("form",{id:"rte-url-form",onSubmit:e=>{e.preventDefault(),Ie()},children:r.jsx(Xe.TextField,{label:m==null?void 0:m.label,placeholder:m==null?void 0:m.placeholder,value:de,onChange:e=>me(e.target.value)})})})]})}function Gt(o){return new Promise((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(n.error),n.readAsDataURL(o)})}const Kt={paragraph:l.paragraph,heading:{h1:l.h1,h2:l.h2,h3:l.h3,h4:l.h4,h5:l.h5,h6:l.h6},quote:l.quote,list:{ul:l.ul,ol:l.ol,listitem:l.li,listitemChecked:l.liChecked,listitemUnchecked:l.liUnchecked,nested:{listitem:l.nestedLi}},link:l.link,text:{bold:l.bold,italic:l.italic,underline:l.underline,strikethrough:l.strike,code:l.codeInline}},Wt=[D.HeadingNode,D.QuoteNode,T.ListNode,T.ListItemNode,$.LinkNode,W,J],Jt=[...le.ELEMENT_TRANSFORMERS,...le.TEXT_FORMAT_TRANSFORMERS,...le.TEXT_MATCH_TRANSFORMERS];function Qt(o){if(typeof document>"u")return o;const t=document.createElement("template");return t.innerHTML=o,t.content.querySelectorAll("[class]").forEach(i=>i.removeAttribute("class")),t.innerHTML}function Xt(){const o=c.$getRoot(),t=o.getFirstChild();return o.getChildrenSize()<=1&&(t===null||c.$isParagraphNode(t)&&t.getChildrenSize()===0)}function Ce(o,t){const i=c.$getRoot();if(i.clear(),t){const n=new DOMParser().parseFromString(t,"text/html"),d=Le.$generateNodesFromDOM(o,n);i.select(),c.$insertNodes(d)}i.getChildrenSize()===0&&i.append(c.$createParagraphNode()),c.$setSelection(null)}function Yt({value:o,defaultValue:t,onChange:i,disabled:n}){const[d]=ve.useLexicalComposerContext(),u=a.useRef(void 0),g=a.useRef(i);return g.current=i,a.useEffect(()=>d.setEditable(!n),[d,n]),a.useEffect(()=>d.registerNodeTransform($.LinkNode,C=>{const p=C.getURL(),f=ae(p);f!==p&&C.setURL(f)}),[d]),a.useEffect(()=>{o!==void 0||!t||(u.current=t,d.update(()=>Ce(d,t),{tag:"history-merge"}))},[]),a.useEffect(()=>{o===void 0||o===u.current||(u.current=o,d.update(()=>Ce(d,o),{tag:"history-merge"}))},[d,o]),a.useEffect(()=>d.registerUpdateListener(({dirtyElements:C,dirtyLeaves:p})=>{C.size===0&&p.size===0||d.read(()=>{const f=Xt()?"":Qt(Le.$generateHtmlFromNodes(d,null));f!==u.current&&(u.current=f,g.current(f))})}),[d]),null}const Zt=a.forwardRef(function({label:t,size:i="md",error:n,helperText:d,required:u=!1,disabled:g=!1,placeholder:C,name:p,value:f,defaultValue:Q,onChange:E,onImageUpload:X,minHeight:w=220,"aria-label":Y="Rich text editor",className:Z,style:ee},y){const k=ce.useT(),j=Ke.useFormContext(),x=j&&p?j.field(p):void 0,A=n??(x==null?void 0:x.error)??!1,q=d??(x==null?void 0:x.helperText),B=j&&p?j.values[p]:void 0,F=f!==void 0?f:j&&p?String(B??""):void 0,U=a.useCallback(_=>{j&&p&&j.setValue(p,_),E==null||E(_)},[j,p,E]),P=_=>x==null?void 0:x.onBlur(_),R=a.useRef(null);a.useEffect(()=>{const _=R.current;_&&(p?_.setAttribute("name",p):_.removeAttribute("name"))},[p]);const te={namespace:"tz-rich-text-editor",theme:Kt,nodes:Wt,editable:!g,onError:_=>{throw _}};return r.jsxs("div",{ref:y,className:$e.clsx(l.editor,l[i],A&&l.error,g&&l.disabled,Z),style:{"--tz-rte-min-height":`${w}px`,...ee},children:[t!=null&&r.jsxs("div",{className:l.label,children:[r.jsx(xe.Typography,{as:"span",variant:"bodySmall",color:"muted",children:t}),u&&r.jsx("span",{className:l.required,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:l.control,children:r.jsxs(we.LexicalComposer,{initialConfig:te,children:[r.jsx(zt,{size:i,disabled:g,onImageUpload:X}),r.jsx("div",{className:l.shell,children:r.jsx(Be.RichTextPlugin,{contentEditable:r.jsx(Fe.ContentEditable,{ref:R,className:l.content,"aria-label":Y,"aria-invalid":A||void 0,onBlur:P}),placeholder:r.jsx("div",{className:l.placeholder,children:C??k("rte.placeholder")}),ErrorBoundary:Ue.LexicalErrorBoundary})}),r.jsx(Pe.HistoryPlugin,{}),r.jsx(He.ListPlugin,{}),r.jsx(Ve.CheckListPlugin,{}),r.jsx(ze.LinkPlugin,{}),r.jsx(Ge.MarkdownShortcutPlugin,{transformers:Jt}),r.jsx(Yt,{value:F,defaultValue:Q,onChange:U,disabled:g})]})}),q!=null&&r.jsx(xe.Typography,{as:"span",variant:"bodySmall",color:A?"error":"muted",className:l.helper,children:q})]})});exports.RichTextEditor=Zt;
2
- //# sourceMappingURL=RichTextEditor-Bc1fhvzn.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),a=require("react"),$e=require("clsx"),c=require("lexical"),we=require("@lexical/react/LexicalComposer"),ve=require("@lexical/react/LexicalComposerContext"),Be=require("@lexical/react/LexicalRichTextPlugin"),Fe=require("@lexical/react/LexicalContentEditable"),Ue=require("@lexical/react/LexicalErrorBoundary"),Pe=require("@lexical/react/LexicalHistoryPlugin"),He=require("@lexical/react/LexicalListPlugin"),Ve=require("@lexical/react/LexicalCheckListPlugin"),ze=require("@lexical/react/LexicalLinkPlugin"),Ge=require("@lexical/react/LexicalMarkdownShortcutPlugin"),le=require("@lexical/markdown"),D=require("@lexical/rich-text"),T=require("@lexical/list"),$=require("@lexical/link"),Le=require("@lexical/html"),Ke=require("./formContext-bTWrqdEV.cjs"),xe=require("./Typography-BFatE1_A.cjs"),We=require("./toastStore-B4Tk2Xk7.cjs"),S=require("@lexical/selection"),I=require("@lexical/utils"),z=require("./Button-ZplrHYKw.cjs"),ge=require("./ColorPickerPanel-Dk6bI0Xy.cjs"),M=require("./Divider-CzbhdCiD.cjs"),se=require("./Dropdown-Ui7h2TGd.cjs"),Je=require("./FloatingPanel-U6sGYiSK.cjs"),h=require("./Icon-BVULqOJD.cjs"),O=require("./IconButton-B9eVM18U.cjs"),G=require("./ListItem-yXXjtepZ.cjs"),Qe=require("./Modal-DXZdMmJh.cjs"),Xe=require("./TextField-DzYGA_St.cjs"),ce=require("./ConfigProvider-CUG8Mfy2.cjs"),Ye=/^(?:https?:|mailto:|tel:|ftp:|#|\/|\?|\.)/i,Ze=/^[a-z][a-z0-9+.-]*:/i;function ae(o){const t=o.trim();return t===""?"":Ye.test(t)||!Ze.test(t)?t:"#"}function Ne(o){const t=o.trim();if(/^data:(?:image|video)\//i.test(t)||/^blob:/i.test(t))return t;const i=ae(t);return i==="#"?"":i}function et(o){return o instanceof HTMLImageElement&&o.src?{node:K(o.getAttribute("src")??o.src,o.alt)}:null}class W extends c.DecoratorNode{static getType(){return"tz-image"}static clone(t){return new W(t.__src,t.__alt,t.__key)}constructor(t,i="",n){super(n),this.__src=Ne(t),this.__alt=i}static importJSON(t){return K(t.src,t.alt)}exportJSON(){return{...super.exportJSON(),type:"tz-image",version:1,src:this.__src,alt:this.__alt}}static importDOM(){return{img:()=>({conversion:et,priority:0})}}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),t.setAttribute("alt",this.__alt),{element:t}}createDOM(){const t=document.createElement("div");return t.style.display="contents",t}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__alt}decorate(){return r.jsx("img",{src:this.__src,alt:this.__alt,draggable:!1})}}function K(o,t=""){return c.$applyNodeReplacement(new W(o,t))}function je(o){return/\.(mp4|webm|ogg|ogv|mov|m4v)(\?.*)?$/i.test(o)}function tt(o){const t=o.match(/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/);if(t)return`https://www.youtube.com/embed/${t[1]}`;const i=o.match(/vimeo\.com\/(?:video\/)?(\d+)/);return i?`https://player.vimeo.com/video/${i[1]}`:o}function ye(o){var i;const t=o.getAttribute("src")||((i=o.querySelector("source"))==null?void 0:i.getAttribute("src"));return t?{node:ue(t)}:null}class J extends c.DecoratorNode{static getType(){return"tz-video"}static clone(t){return new J(t.__src,t.__key)}constructor(t,i){super(i),this.__src=Ne(t)}static importJSON(t){return ue(t.src)}exportJSON(){return{...super.exportJSON(),type:"tz-video",version:1,src:this.__src}}static importDOM(){return{iframe:()=>({conversion:ye,priority:0}),video:()=>({conversion:ye,priority:0})}}exportDOM(){if(je(this.__src)){const i=document.createElement("video");return i.setAttribute("src",this.__src),i.setAttribute("controls","true"),{element:i}}const t=document.createElement("iframe");return t.setAttribute("src",this.__src),t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),{element:t}}createDOM(){const t=document.createElement("div");return t.style.display="contents",t}updateDOM(){return!1}getSrc(){return this.__src}decorate(){return je(this.__src)?r.jsx("video",{src:this.__src,controls:!0}):r.jsx(rt,{src:this.__src})}}function rt({src:o}){const t=ce.useT();return r.jsx("div",{className:"tz-rte-embed",children:r.jsx("iframe",{src:o,title:t("rte.embeddedVideo"),frameBorder:0,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}function ue(o){return c.$applyNodeReplacement(new J(tt(o)))}const ot="_editor_16j1l_1",nt="_label_16j1l_9",it="_required_16j1l_15",lt="_helper_16j1l_18",st="_control_16j1l_24",ct="_error_16j1l_38",at="_disabled_16j1l_45",ut="_toolbar_16j1l_51",dt="_sm_16j1l_67",mt="_md_16j1l_71",pt="_lg_16j1l_75",ht="_colorGlyph_16j1l_81",_t="_colorBar_16j1l_89",ft="_shell_16j1l_107",xt="_content_16j1l_110",gt="_placeholder_16j1l_123",jt="_paragraph_16j1l_146",yt="_h1_16j1l_152",Ct="_h2_16j1l_153",vt="_h3_16j1l_154",Lt="_h4_16j1l_155",Nt="_h5_16j1l_156",bt="_h6_16j1l_157",St="_quote_16j1l_176",Tt="_ul_16j1l_183",Et="_ol_16j1l_188",kt="_li_16j1l_193",Rt="_nestedLi_16j1l_196",It="_liChecked_16j1l_200",Mt="_liUnchecked_16j1l_201",Ot="_link_16j1l_238",Dt="_bold_16j1l_245",At="_italic_16j1l_248",qt="_underline_16j1l_251",$t="_strike_16j1l_254",wt="_codeInline_16j1l_260",l={editor:ot,label:nt,required:it,helper:lt,control:st,error:ct,disabled:at,toolbar:ut,sm:dt,md:mt,lg:pt,colorGlyph:ht,colorBar:_t,shell:ft,content:xt,placeholder:gt,paragraph:jt,h1:yt,h2:Ct,h3:vt,h4:Lt,h5:Nt,h6:bt,quote:St,ul:Tt,ol:Et,li:kt,nestedLi:Rt,liChecked:It,liUnchecked:Mt,link:Ot,bold:Dt,italic:At,underline:qt,strike:$t,codeInline:wt},Bt={paragraph:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",quote:"Quote",bullet:"Bullet List",number:"Numbered List",check:"Check List"},Ft=[{type:"paragraph",icon:"Text"},{type:"h1",icon:"Hashtag"},{type:"h2",icon:"Hashtag"},{type:"h3",icon:"Hashtag"}],Ut=[{value:"left",labelKey:"rte.alignLeft",icon:"TextalignLeft"},{value:"center",labelKey:"rte.alignCenter",icon:"TextalignCenter"},{value:"right",labelKey:"rte.alignRight",icon:"TextalignRight"}],Pt=["10px","12px","14px","16px","18px","20px"],Ht={sm:"12px",md:"14px",lg:"16px"};function Vt({color:o,size:t}){return r.jsxs("span",{className:l.colorGlyph,children:[r.jsx(h.Icon,{name:"Brush",size:t}),r.jsx("span",{className:l.colorBar,style:{borderColor:`transparent transparent ${o||"currentColor"} transparent`},"aria-hidden":"true"})]})}function zt({size:o,disabled:t,onImageUpload:i}){const n=ce.useT(),d=e=>Bt[e]??e,[u]=ve.useLexicalComposerContext(),g=a.useRef(null),[C,p]=a.useState(!1),[f,Q]=a.useState(!1),[E,X]=a.useState(!1),[w,Y]=a.useState(!1),[Z,ee]=a.useState(""),[y,k]=a.useState("paragraph"),[j,x]=a.useState("left"),[A,q]=a.useState(""),[B,F]=a.useState(""),[U,P]=a.useState(!1),R=a.useRef(null),[te,_]=a.useState(!1),[be,Se]=a.useState(!1),[m,re]=a.useState(null),[de,me]=a.useState(""),oe=a.useCallback(()=>{const e=c.$getSelection();if(!c.$isRangeSelection(e))return;p(e.hasFormat("bold")),Q(e.hasFormat("italic")),X(e.hasFormat("underline")),F(S.$getSelectionStyleValueForProperty(e,"color","")),q(S.$getSelectionStyleValueForProperty(e,"font-size",""));const s=e.anchor.getNode(),N=s.getParent(),L=$.$isLinkNode(s)?s:$.$isLinkNode(N)?N:null;Y(L!==null),ee((L==null?void 0:L.getURL())??"");const b=s.getKey()==="root"?s:I.$findMatchingParent(s,qe=>{const fe=qe.getParent();return fe===null||fe.getKey()==="root"})??s.getTopLevelElement();x(c.$isElementNode(b)&&b.getFormatType()||"left");const V=I.$getNearestNodeOfType(s,T.ListNode);V?k(V.getListType()):D.$isHeadingNode(b)?k(b.getTag()):D.$isQuoteNode(b)?k("quote"):k("paragraph")},[]);a.useEffect(()=>I.mergeRegister(u.registerUpdateListener(({editorState:e})=>e.read(oe)),u.registerCommand(c.SELECTION_CHANGE_COMMAND,()=>(oe(),!1),c.COMMAND_PRIORITY_LOW),u.registerCommand(c.CAN_UNDO_COMMAND,e=>(_(e),!1),c.COMMAND_PRIORITY_LOW),u.registerCommand(c.CAN_REDO_COMMAND,e=>(Se(e),!1),c.COMMAND_PRIORITY_LOW)),[u,oe]);const ne=e=>u.dispatchCommand(c.FORMAT_TEXT_COMMAND,e),Te=e=>u.dispatchCommand(c.FORMAT_ELEMENT_COMMAND,e),Ee=e=>{F(e),u.update(()=>{const s=c.$getSelection();c.$isRangeSelection(s)&&S.$patchStyleText(s,{color:e||null})})},ke=e=>{q(e),u.update(()=>{const s=c.$getSelection();c.$isRangeSelection(s)&&S.$patchStyleText(s,{"font-size":e||null})})},H=e=>{if(e==="bullet"||e==="number"||e==="check"){if(y===e)u.dispatchCommand(T.REMOVE_LIST_COMMAND,void 0);else{const s=e==="bullet"?T.INSERT_UNORDERED_LIST_COMMAND:e==="number"?T.INSERT_ORDERED_LIST_COMMAND:T.INSERT_CHECK_LIST_COMMAND;u.dispatchCommand(s,void 0)}return}u.update(()=>{const s=c.$getSelection();c.$isRangeSelection(s)&&(e==="paragraph"?S.$setBlocksType(s,()=>c.$createParagraphNode()):e==="quote"?S.$setBlocksType(s,()=>D.$createQuoteNode()):S.$setBlocksType(s,()=>D.$createHeadingNode(e)))})},Re=()=>H(y==="quote"?"paragraph":"quote"),ie=(e,s="")=>{me(s),re(e)},pe=()=>re(null),Ie=()=>{m==null||m.onConfirm(de.trim()),re(null)},Me=()=>ie({icon:"Link2",title:n("rte.linkTitle"),label:n("rte.linkUrl"),placeholder:"https://example.com",confirmLabel:n(w?"common.update":"common.insert"),onConfirm:e=>u.dispatchCommand($.TOGGLE_LINK_COMMAND,e===""?null:ae(e))},Z),Oe=()=>ie({icon:"GalleryAdd",title:n("rte.imageTitle"),label:n("rte.imageUrl"),placeholder:"https://example.com/image.jpg",confirmLabel:n("common.insert"),onConfirm:e=>{e&&u.update(()=>I.$insertNodeToNearestRoot(K(e)))}}),De=async e=>{var N;const s=(N=e.target.files)==null?void 0:N[0];if(e.target.value="",!!s)try{const L=i?await i(s):await Gt(s);u.update(()=>I.$insertNodeToNearestRoot(K(L,s.name)))}catch{We.toast.error(n("rte.imageError"))}},Ae=()=>ie({icon:"VideoSquare",title:n("rte.videoTitle"),label:n("rte.videoUrl"),placeholder:n("rte.videoUrlPlaceholder"),confirmLabel:n("common.insert"),onConfirm:e=>{e&&u.update(()=>I.$insertNodeToNearestRoot(ue(e)))}}),v=(e,s,N,L,b)=>r.jsx(O.IconButton,{variant:e?"filled":"text",color:"primary",size:o,disabled:t,"aria-label":s,"aria-pressed":e,onMouseDown:V=>V.preventDefault(),onClick:N,children:L},b),he=y.startsWith("h")?y:"paragraph",_e=A||Ht[o];return r.jsxs("div",{className:l.toolbar,role:"toolbar","aria-label":n("rte.formatting"),"aria-orientation":"horizontal",children:[r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t||!te,"aria-label":n("rte.undo"),onMouseDown:e=>e.preventDefault(),onClick:()=>u.dispatchCommand(c.UNDO_COMMAND,void 0),children:r.jsx(h.Icon,{name:"UndoArrow"})}),r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t||!be,"aria-label":n("rte.redo"),onMouseDown:e=>e.preventDefault(),onClick:()=>u.dispatchCommand(c.REDO_COMMAND,void 0),children:r.jsx(h.Icon,{name:"RedoArrow"})}),r.jsx(M.Divider,{orientation:"vertical"}),r.jsx(se.Dropdown,{size:o,disabled:t,minWidth:!1,trigger:r.jsx(z.Button,{variant:"text",color:"primary",size:o,disabled:t,endIcon:r.jsx(h.Icon,{name:"ArrowDown4"}),"aria-label":n("rte.fontSize"),onMouseDown:e=>e.preventDefault(),children:_e}),children:Pt.map(e=>r.jsx(G.ListItem,{clickable:!0,selected:e===_e,onClick:()=>ke(e),children:e},e))}),r.jsx(M.Divider,{orientation:"vertical"}),r.jsx(se.Dropdown,{size:o,disabled:t,trigger:r.jsx(z.Button,{variant:"text",color:"primary",size:o,disabled:t,endIcon:r.jsx(h.Icon,{name:"ArrowDown4"}),onMouseDown:e=>e.preventDefault(),children:d(he)}),children:Ft.map(e=>r.jsx(G.ListItem,{clickable:!0,selected:he===e.type,icon:e.icon,onClick:()=>H(e.type),children:d(e.type)},e.type))}),r.jsx(M.Divider,{orientation:"vertical"}),v(C,n("rte.bold"),()=>ne("bold"),r.jsx(h.Icon,{name:"TextBold"})),v(f,n("rte.italic"),()=>ne("italic"),r.jsx(h.Icon,{name:"TextItalic"})),v(E,n("rte.underline"),()=>ne("underline"),r.jsx(h.Icon,{name:"TextUnderline"})),r.jsx(M.Divider,{orientation:"vertical"}),v(y==="bullet",n("rte.bulletList"),()=>H("bullet"),r.jsx(h.Icon,{name:"ListBullet"})),v(y==="number",n("rte.numberedList"),()=>H("number"),r.jsx(h.Icon,{name:"ListNumber"})),v(y==="quote",n("rte.quote"),Re,r.jsx(h.Icon,{name:"QuoteUp"})),r.jsx(M.Divider,{orientation:"vertical"}),Ut.map(e=>v(j===e.value,n(e.labelKey),()=>Te(e.value),r.jsx(h.Icon,{name:e.icon}),e.value)),r.jsx(M.Divider,{orientation:"vertical"}),r.jsx(O.IconButton,{ref:R,variant:"text",color:"primary",size:o,disabled:t,"aria-label":n("rte.textColor"),"aria-expanded":U,onMouseDown:e=>e.preventDefault(),onClick:()=>P(e=>!e),children:r.jsx(Vt,{color:B})}),r.jsx(Je.FloatingPanel,{open:U,triggerRef:R,onClose:e=>{var s;P(!1),e&&((s=R.current)==null||s.focus())},role:"dialog",ariaLabel:n("rte.textColor"),width:232,children:r.jsx(ge.ColorPickerPanel,{value:B||ge.DEFAULT_SWATCHES[0],onChange:Ee,clearable:!1})}),v(w,n("rte.link"),Me,r.jsx(h.Icon,{name:"Link2"})),r.jsxs(se.Dropdown,{size:o,disabled:t,minWidth:!1,trigger:r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t,"aria-label":n("rte.insertImage"),children:r.jsx(h.Icon,{name:"GalleryAdd"})}),children:[r.jsx(G.ListItem,{clickable:!0,icon:"GalleryImport",onClick:()=>{var e;return(e=g.current)==null?void 0:e.click()},children:n("rte.uploadImage")}),r.jsx(G.ListItem,{clickable:!0,icon:"Link",onClick:Oe,children:n("rte.imageByUrl")})]}),r.jsx(O.IconButton,{variant:"text",color:"primary",size:o,disabled:t,"aria-label":n("rte.insertVideo"),onClick:Ae,children:r.jsx(h.Icon,{name:"VideoSquare"})}),r.jsx("input",{ref:g,type:"file",accept:"image/*",hidden:!0,onChange:De,"aria-hidden":"true",tabIndex:-1}),r.jsx(Qe.Modal,{open:m!==null,onClose:pe,size:"sm",icon:m==null?void 0:m.icon,title:m==null?void 0:m.title,footer:r.jsxs(r.Fragment,{children:[r.jsx(z.Button,{variant:"text",onClick:pe,children:n("common.cancel")}),r.jsx(z.Button,{type:"submit",form:"rte-url-form",children:(m==null?void 0:m.confirmLabel)??n("common.insert")})]}),children:r.jsx("form",{id:"rte-url-form",onSubmit:e=>{e.preventDefault(),Ie()},children:r.jsx(Xe.TextField,{label:m==null?void 0:m.label,placeholder:m==null?void 0:m.placeholder,value:de,onChange:e=>me(e.target.value)})})})]})}function Gt(o){return new Promise((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(n.error),n.readAsDataURL(o)})}const Kt={paragraph:l.paragraph,heading:{h1:l.h1,h2:l.h2,h3:l.h3,h4:l.h4,h5:l.h5,h6:l.h6},quote:l.quote,list:{ul:l.ul,ol:l.ol,listitem:l.li,listitemChecked:l.liChecked,listitemUnchecked:l.liUnchecked,nested:{listitem:l.nestedLi}},link:l.link,text:{bold:l.bold,italic:l.italic,underline:l.underline,strikethrough:l.strike,code:l.codeInline}},Wt=[D.HeadingNode,D.QuoteNode,T.ListNode,T.ListItemNode,$.LinkNode,W,J],Jt=[...le.ELEMENT_TRANSFORMERS,...le.TEXT_FORMAT_TRANSFORMERS,...le.TEXT_MATCH_TRANSFORMERS];function Qt(o){if(typeof document>"u")return o;const t=document.createElement("template");return t.innerHTML=o,t.content.querySelectorAll("[class]").forEach(i=>i.removeAttribute("class")),t.innerHTML}function Xt(){const o=c.$getRoot(),t=o.getFirstChild();return o.getChildrenSize()<=1&&(t===null||c.$isParagraphNode(t)&&t.getChildrenSize()===0)}function Ce(o,t){const i=c.$getRoot();if(i.clear(),t){const n=new DOMParser().parseFromString(t,"text/html"),d=Le.$generateNodesFromDOM(o,n);i.select(),c.$insertNodes(d)}i.getChildrenSize()===0&&i.append(c.$createParagraphNode()),c.$setSelection(null)}function Yt({value:o,defaultValue:t,onChange:i,disabled:n}){const[d]=ve.useLexicalComposerContext(),u=a.useRef(void 0),g=a.useRef(i);return g.current=i,a.useEffect(()=>d.setEditable(!n),[d,n]),a.useEffect(()=>d.registerNodeTransform($.LinkNode,C=>{const p=C.getURL(),f=ae(p);f!==p&&C.setURL(f)}),[d]),a.useEffect(()=>{o!==void 0||!t||(u.current=t,d.update(()=>Ce(d,t),{tag:"history-merge"}))},[]),a.useEffect(()=>{o===void 0||o===u.current||(u.current=o,d.update(()=>Ce(d,o),{tag:"history-merge"}))},[d,o]),a.useEffect(()=>d.registerUpdateListener(({dirtyElements:C,dirtyLeaves:p})=>{C.size===0&&p.size===0||d.read(()=>{const f=Xt()?"":Qt(Le.$generateHtmlFromNodes(d,null));f!==u.current&&(u.current=f,g.current(f))})}),[d]),null}const Zt=a.forwardRef(function({label:t,size:i="md",error:n,helperText:d,required:u=!1,disabled:g=!1,placeholder:C,name:p,value:f,defaultValue:Q,onChange:E,onImageUpload:X,minHeight:w=220,"aria-label":Y="Rich text editor",className:Z,style:ee},y){const k=ce.useT(),j=Ke.useFormContext(),x=j&&p?j.field(p):void 0,A=n??(x==null?void 0:x.error)??!1,q=d??(x==null?void 0:x.helperText),B=j&&p?j.values[p]:void 0,F=f!==void 0?f:j&&p?String(B??""):void 0,U=a.useCallback(_=>{j&&p&&j.setValue(p,_),E==null||E(_)},[j,p,E]),P=_=>x==null?void 0:x.onBlur(_),R=a.useRef(null);a.useEffect(()=>{const _=R.current;_&&(p?_.setAttribute("name",p):_.removeAttribute("name"))},[p]);const te={namespace:"tz-rich-text-editor",theme:Kt,nodes:Wt,editable:!g,onError:_=>{throw _}};return r.jsxs("div",{ref:y,className:$e.clsx(l.editor,l[i],A&&l.error,g&&l.disabled,Z),style:{"--tz-rte-min-height":`${w}px`,...ee},children:[t!=null&&r.jsxs("div",{className:l.label,children:[r.jsx(xe.Typography,{as:"span",variant:"bodySmall",color:"muted",children:t}),u&&r.jsx("span",{className:l.required,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:l.control,children:r.jsxs(we.LexicalComposer,{initialConfig:te,children:[r.jsx(zt,{size:i,disabled:g,onImageUpload:X}),r.jsx("div",{className:l.shell,children:r.jsx(Be.RichTextPlugin,{contentEditable:r.jsx(Fe.ContentEditable,{ref:R,className:l.content,"aria-label":Y,"aria-invalid":A||void 0,onBlur:P}),placeholder:r.jsx("div",{className:l.placeholder,children:C??k("rte.placeholder")}),ErrorBoundary:Ue.LexicalErrorBoundary})}),r.jsx(Pe.HistoryPlugin,{}),r.jsx(He.ListPlugin,{}),r.jsx(Ve.CheckListPlugin,{}),r.jsx(ze.LinkPlugin,{}),r.jsx(Ge.MarkdownShortcutPlugin,{transformers:Jt}),r.jsx(Yt,{value:F,defaultValue:Q,onChange:U,disabled:g})]})}),q!=null&&r.jsx(xe.Typography,{as:"span",variant:"bodySmall",color:A?"error":"muted",className:l.helper,children:q})]})});exports.RichTextEditor=Zt;
2
+ //# sourceMappingURL=RichTextEditor-BuoywqBu.cjs.map