@techzyapp/ui-library 1.0.20 → 1.0.21

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 (377) hide show
  1. package/dist/{Accordion-Dy_dM79Y.cjs → Accordion-P3PNqSER.cjs} +2 -2
  2. package/dist/{Accordion-Dy_dM79Y.cjs.map → Accordion-P3PNqSER.cjs.map} +1 -1
  3. package/dist/{Accordion-CAxa1I-m.js → Accordion-w-w_WxxV.js} +3 -3
  4. package/dist/{Accordion-CAxa1I-m.js.map → Accordion-w-w_WxxV.js.map} +1 -1
  5. package/dist/{AdminRoot-DlpMJNTx.cjs → AdminRoot-BDRLuMX6.cjs} +2 -2
  6. package/dist/{AdminRoot-DlpMJNTx.cjs.map → AdminRoot-BDRLuMX6.cjs.map} +1 -1
  7. package/dist/{AdminRoot-B2J1cHK5.js → AdminRoot-DvF0js0q.js} +4 -4
  8. package/dist/{AdminRoot-B2J1cHK5.js.map → AdminRoot-DvF0js0q.js.map} +1 -1
  9. package/dist/{Alert-DRZdNwDm.cjs → Alert-CwoRkKq4.cjs} +2 -2
  10. package/dist/{Alert-DRZdNwDm.cjs.map → Alert-CwoRkKq4.cjs.map} +1 -1
  11. package/dist/{Alert-yldGvhVM.js → Alert-DPYmdaWs.js} +5 -5
  12. package/dist/{Alert-yldGvhVM.js.map → Alert-DPYmdaWs.js.map} +1 -1
  13. package/dist/{AuthLayout-B1tzhzHo.cjs → AuthLayout-BRUxDgzs.cjs} +2 -2
  14. package/dist/{AuthLayout-B1tzhzHo.cjs.map → AuthLayout-BRUxDgzs.cjs.map} +1 -1
  15. package/dist/{AuthLayout-j7EAPPXT.js → AuthLayout-CP9qu6Bv.js} +2 -2
  16. package/dist/{AuthLayout-j7EAPPXT.js.map → AuthLayout-CP9qu6Bv.js.map} +1 -1
  17. package/dist/{Avatar-_ufXh3AY.cjs → Avatar-Dgf04PBC.cjs} +2 -2
  18. package/dist/{Avatar-_ufXh3AY.cjs.map → Avatar-Dgf04PBC.cjs.map} +1 -1
  19. package/dist/{Avatar-BJVCdo-K.js → Avatar-Q50J8wdN.js} +3 -3
  20. package/dist/{Avatar-BJVCdo-K.js.map → Avatar-Q50J8wdN.js.map} +1 -1
  21. package/dist/{AvatarGroup-DdJf4aT7.js → AvatarGroup-YaNasLMS.js} +2 -2
  22. package/dist/{AvatarGroup-DdJf4aT7.js.map → AvatarGroup-YaNasLMS.js.map} +1 -1
  23. package/dist/{AvatarGroup-TW1pt4tj.cjs → AvatarGroup-uW0SD5P4.cjs} +2 -2
  24. package/dist/{AvatarGroup-TW1pt4tj.cjs.map → AvatarGroup-uW0SD5P4.cjs.map} +1 -1
  25. package/dist/{Breadcrumbs-f0GE4lCI.cjs → Breadcrumbs-CknDBLMw.cjs} +2 -2
  26. package/dist/{Breadcrumbs-f0GE4lCI.cjs.map → Breadcrumbs-CknDBLMw.cjs.map} +1 -1
  27. package/dist/{Breadcrumbs-FpIOHx_q.js → Breadcrumbs-l0PlUpQ4.js} +5 -5
  28. package/dist/{Breadcrumbs-FpIOHx_q.js.map → Breadcrumbs-l0PlUpQ4.js.map} +1 -1
  29. package/dist/{Button-Cu0XdnW6.cjs → Button-BdihbLYJ.cjs} +2 -2
  30. package/dist/{Button-Cu0XdnW6.cjs.map → Button-BdihbLYJ.cjs.map} +1 -1
  31. package/dist/{Button-BkjZ7wEu.js → Button-RljTGqHl.js} +2 -2
  32. package/dist/{Button-BkjZ7wEu.js.map → Button-RljTGqHl.js.map} +1 -1
  33. package/dist/{Calendar-DsJ6GICt.js → Calendar-CKCikOQL.js} +4 -4
  34. package/dist/{Calendar-DsJ6GICt.js.map → Calendar-CKCikOQL.js.map} +1 -1
  35. package/dist/{Calendar-CGQCditF.cjs → Calendar-DVg1uQuj.cjs} +2 -2
  36. package/dist/{Calendar-CGQCditF.cjs.map → Calendar-DVg1uQuj.cjs.map} +1 -1
  37. package/dist/{Card-CumMi_XB.js → Card-B0bYi4g2.js} +4 -4
  38. package/dist/{Card-CumMi_XB.js.map → Card-B0bYi4g2.js.map} +1 -1
  39. package/dist/{Card-DGTGdaTZ.cjs → Card-BYFuYD-a.cjs} +2 -2
  40. package/dist/{Card-DGTGdaTZ.cjs.map → Card-BYFuYD-a.cjs.map} +1 -1
  41. package/dist/Checkbox-ZYOSBYRt.js +98 -0
  42. package/dist/Checkbox-ZYOSBYRt.js.map +1 -0
  43. package/dist/Checkbox-fzJCwe0j.cjs +2 -0
  44. package/dist/Checkbox-fzJCwe0j.cjs.map +1 -0
  45. package/dist/{Chip-D83svOCW.js → Chip-BiqfnRUi.js} +3 -3
  46. package/dist/{Chip-D83svOCW.js.map → Chip-BiqfnRUi.js.map} +1 -1
  47. package/dist/{Chip-CJuAvgst.cjs → Chip-CdKUtUGE.cjs} +2 -2
  48. package/dist/{Chip-CJuAvgst.cjs.map → Chip-CdKUtUGE.cjs.map} +1 -1
  49. package/dist/{ChoiceCardGroup-CvFzZlgI.js → ChoiceCardGroup-DBohUnRj.js} +3 -3
  50. package/dist/{ChoiceCardGroup-CvFzZlgI.js.map → ChoiceCardGroup-DBohUnRj.js.map} +1 -1
  51. package/dist/{ChoiceCardGroup-6eFM1eL0.cjs → ChoiceCardGroup-d0VVTUi5.cjs} +2 -2
  52. package/dist/{ChoiceCardGroup-6eFM1eL0.cjs.map → ChoiceCardGroup-d0VVTUi5.cjs.map} +1 -1
  53. package/dist/{CodeBlock-BK_KXhos.js → CodeBlock-BX_0tpk3.js} +4 -4
  54. package/dist/{CodeBlock-BK_KXhos.js.map → CodeBlock-BX_0tpk3.js.map} +1 -1
  55. package/dist/{CodeBlock-C_UDrrY6.cjs → CodeBlock-CAAggVXS.cjs} +2 -2
  56. package/dist/{CodeBlock-C_UDrrY6.cjs.map → CodeBlock-CAAggVXS.cjs.map} +1 -1
  57. package/dist/{ColorPicker-BmxZnsNC.cjs → ColorPicker-BCSaT1A-.cjs} +2 -2
  58. package/dist/{ColorPicker-BmxZnsNC.cjs.map → ColorPicker-BCSaT1A-.cjs.map} +1 -1
  59. package/dist/{ColorPicker-DLnB_AvZ.js → ColorPicker-DhSlvwNj.js} +3 -3
  60. package/dist/{ColorPicker-DLnB_AvZ.js.map → ColorPicker-DhSlvwNj.js.map} +1 -1
  61. package/dist/{ColorPickerPanel-CoyKplF5.cjs → ColorPickerPanel-BOGYXXF1.cjs} +2 -2
  62. package/dist/{ColorPickerPanel-CoyKplF5.cjs.map → ColorPickerPanel-BOGYXXF1.cjs.map} +1 -1
  63. package/dist/{ColorPickerPanel-CG9idF4A.js → ColorPickerPanel-D4t3b9bB.js} +3 -3
  64. package/dist/{ColorPickerPanel-CG9idF4A.js.map → ColorPickerPanel-D4t3b9bB.js.map} +1 -1
  65. package/dist/{ConfigProvider-h1WoGC3R.cjs → ConfigProvider-C7DUWHrb.cjs} +2 -2
  66. package/dist/{ConfigProvider-h1WoGC3R.cjs.map → ConfigProvider-C7DUWHrb.cjs.map} +1 -1
  67. package/dist/{ConfigProvider-DDuIJSM7.js → ConfigProvider-DT0yrgmd.js} +2 -2
  68. package/dist/{ConfigProvider-DDuIJSM7.js.map → ConfigProvider-DT0yrgmd.js.map} +1 -1
  69. package/dist/{CopyButton-tRMAy59I.cjs → CopyButton-3585thVM.cjs} +2 -2
  70. package/dist/{CopyButton-tRMAy59I.cjs.map → CopyButton-3585thVM.cjs.map} +1 -1
  71. package/dist/{CopyButton-DdQ-8ExN.js → CopyButton-BEY1gJzK.js} +4 -4
  72. package/dist/{CopyButton-DdQ-8ExN.js.map → CopyButton-BEY1gJzK.js.map} +1 -1
  73. package/dist/{DashedButton-q7AOqKUE.cjs → DashedButton-3C4IZuo4.cjs} +2 -2
  74. package/dist/{DashedButton-q7AOqKUE.cjs.map → DashedButton-3C4IZuo4.cjs.map} +1 -1
  75. package/dist/{DashedButton-DeiALUPA.js → DashedButton-BXZAyMtw.js} +3 -3
  76. package/dist/{DashedButton-DeiALUPA.js.map → DashedButton-BXZAyMtw.js.map} +1 -1
  77. package/dist/{DatePicker-pz634ktl.js → DatePicker-CEFGgXLF.js} +5 -5
  78. package/dist/{DatePicker-pz634ktl.js.map → DatePicker-CEFGgXLF.js.map} +1 -1
  79. package/dist/{DatePicker-eryY6Xmx.cjs → DatePicker-Dyj2halw.cjs} +2 -2
  80. package/dist/{DatePicker-eryY6Xmx.cjs.map → DatePicker-Dyj2halw.cjs.map} +1 -1
  81. package/dist/{DateTimePicker-CmH3ZuzN.cjs → DateTimePicker-CjX4-8PP.cjs} +2 -2
  82. package/dist/{DateTimePicker-CmH3ZuzN.cjs.map → DateTimePicker-CjX4-8PP.cjs.map} +1 -1
  83. package/dist/{DateTimePicker-BJLq9Fud.js → DateTimePicker-hmYBEuUM.js} +8 -8
  84. package/dist/{DateTimePicker-BJLq9Fud.js.map → DateTimePicker-hmYBEuUM.js.map} +1 -1
  85. package/dist/{EmptyState-Cxf4H8Cc.cjs → EmptyState-Bj-vX_UV.cjs} +2 -2
  86. package/dist/{EmptyState-Cxf4H8Cc.cjs.map → EmptyState-Bj-vX_UV.cjs.map} +1 -1
  87. package/dist/{EmptyState-B2QPNhWW.js → EmptyState-DJDNLKT7.js} +4 -4
  88. package/dist/{EmptyState-B2QPNhWW.js.map → EmptyState-DJDNLKT7.js.map} +1 -1
  89. package/dist/{FileCard-Do9D72NA.js → FileCard-C9Ncifnu.js} +5 -5
  90. package/dist/{FileCard-Do9D72NA.js.map → FileCard-C9Ncifnu.js.map} +1 -1
  91. package/dist/{FileCard-D0Sa7WJt.cjs → FileCard-Dr5-z1R3.cjs} +2 -2
  92. package/dist/{FileCard-D0Sa7WJt.cjs.map → FileCard-Dr5-z1R3.cjs.map} +1 -1
  93. package/dist/{FileUploader-B1Arfj1a.cjs → FileUploader-DeyZENqq.cjs} +2 -2
  94. package/dist/{FileUploader-B1Arfj1a.cjs.map → FileUploader-DeyZENqq.cjs.map} +1 -1
  95. package/dist/{FileUploader-4900qKEE.js → FileUploader-XFmBNkA0.js} +6 -6
  96. package/dist/{FileUploader-4900qKEE.js.map → FileUploader-XFmBNkA0.js.map} +1 -1
  97. package/dist/{Flag-DNhhLtCC.js → Flag-Bs0xNP-P.js} +2 -2
  98. package/dist/{Flag-DNhhLtCC.js.map → Flag-Bs0xNP-P.js.map} +1 -1
  99. package/dist/{Flag-D7Vlczlw.cjs → Flag-Bxnx26DM.cjs} +2 -2
  100. package/dist/{Flag-D7Vlczlw.cjs.map → Flag-Bxnx26DM.cjs.map} +1 -1
  101. package/dist/{FullscreenToggle-dU2ai_OZ.cjs → FullscreenToggle-BncatGKj.cjs} +2 -2
  102. package/dist/{FullscreenToggle-dU2ai_OZ.cjs.map → FullscreenToggle-BncatGKj.cjs.map} +1 -1
  103. package/dist/{FullscreenToggle-Bc4fB-Mi.js → FullscreenToggle-DMlp05UN.js} +4 -4
  104. package/dist/{FullscreenToggle-Bc4fB-Mi.js.map → FullscreenToggle-DMlp05UN.js.map} +1 -1
  105. package/dist/Icon-BVULqOJD.cjs +2 -0
  106. package/dist/Icon-BVULqOJD.cjs.map +1 -0
  107. package/dist/{Icon-CophpkHo.js → Icon-DaTvzLBu.js} +2 -1
  108. package/dist/Icon-DaTvzLBu.js.map +1 -0
  109. package/dist/{IconButton-DpTxmj3d.js → IconButton-DXMmtuLA.js} +2 -2
  110. package/dist/{IconButton-DpTxmj3d.js.map → IconButton-DXMmtuLA.js.map} +1 -1
  111. package/dist/{IconButton-DyRC514t.cjs → IconButton-Lv0sDDR9.cjs} +2 -2
  112. package/dist/{IconButton-DyRC514t.cjs.map → IconButton-Lv0sDDR9.cjs.map} +1 -1
  113. package/dist/{ListItem-B4Upc0Hy.js → ListItem-Cn15lJBr.js} +3 -3
  114. package/dist/{ListItem-B4Upc0Hy.js.map → ListItem-Cn15lJBr.js.map} +1 -1
  115. package/dist/{ListItem-DWQorRxG.cjs → ListItem-yXXjtepZ.cjs} +2 -2
  116. package/dist/{ListItem-DWQorRxG.cjs.map → ListItem-yXXjtepZ.cjs.map} +1 -1
  117. package/dist/{Loader-B45H2SMP.cjs → Loader-53HFNMVX.cjs} +2 -2
  118. package/dist/{Loader-B45H2SMP.cjs.map → Loader-53HFNMVX.cjs.map} +1 -1
  119. package/dist/{Loader-B9VXX401.js → Loader-WsjQFl4p.js} +2 -2
  120. package/dist/{Loader-B9VXX401.js.map → Loader-WsjQFl4p.js.map} +1 -1
  121. package/dist/{Modal-Us_E-lb2.js → Modal-DBYcoCbJ.js} +5 -5
  122. package/dist/{Modal-Us_E-lb2.js.map → Modal-DBYcoCbJ.js.map} +1 -1
  123. package/dist/{Modal-DsoSz0Sp.cjs → Modal-V6eyGSzW.cjs} +2 -2
  124. package/dist/{Modal-DsoSz0Sp.cjs.map → Modal-V6eyGSzW.cjs.map} +1 -1
  125. package/dist/{MultiSelect-sKk2KzOd.js → MultiSelect-BsYPr3LD.js} +6 -6
  126. package/dist/{MultiSelect-sKk2KzOd.js.map → MultiSelect-BsYPr3LD.js.map} +1 -1
  127. package/dist/{MultiSelect-CtLpWaBX.cjs → MultiSelect-DS2DRpaP.cjs} +2 -2
  128. package/dist/{MultiSelect-CtLpWaBX.cjs.map → MultiSelect-DS2DRpaP.cjs.map} +1 -1
  129. package/dist/{NumberField-C6qj3nCa.cjs → NumberField-DC3TdGTt.cjs} +2 -2
  130. package/dist/{NumberField-C6qj3nCa.cjs.map → NumberField-DC3TdGTt.cjs.map} +1 -1
  131. package/dist/{NumberField-Cz03nksO.js → NumberField-mFb9pKCx.js} +4 -4
  132. package/dist/{NumberField-Cz03nksO.js.map → NumberField-mFb9pKCx.js.map} +1 -1
  133. package/dist/{OtpField-DLXQYMw1.js → OtpField-1ullIIZQ.js} +2 -2
  134. package/dist/{OtpField-DLXQYMw1.js.map → OtpField-1ullIIZQ.js.map} +1 -1
  135. package/dist/{OtpField-B46P6aMy.cjs → OtpField-BYj9SDHb.cjs} +2 -2
  136. package/dist/{OtpField-B46P6aMy.cjs.map → OtpField-BYj9SDHb.cjs.map} +1 -1
  137. package/dist/{PageLayout-BfeRjBek.cjs → PageLayout-pYL43wI9.cjs} +2 -2
  138. package/dist/{PageLayout-BfeRjBek.cjs.map → PageLayout-pYL43wI9.cjs.map} +1 -1
  139. package/dist/{PageLayout-BWU-p_N9.js → PageLayout-qf0H_EmS.js} +2 -2
  140. package/dist/{PageLayout-BWU-p_N9.js.map → PageLayout-qf0H_EmS.js.map} +1 -1
  141. package/dist/{PageNotFound-nvZm-UCG.cjs → PageNotFound-D1795gJ7.cjs} +2 -2
  142. package/dist/{PageNotFound-nvZm-UCG.cjs.map → PageNotFound-D1795gJ7.cjs.map} +1 -1
  143. package/dist/{PageNotFound-B_nTMrCD.js → PageNotFound-YGVMVvyG.js} +5 -5
  144. package/dist/{PageNotFound-B_nTMrCD.js.map → PageNotFound-YGVMVvyG.js.map} +1 -1
  145. package/dist/{Pagination-BYXUhmSz.js → Pagination-BTvUJiee.js} +3 -3
  146. package/dist/{Pagination-BYXUhmSz.js.map → Pagination-BTvUJiee.js.map} +1 -1
  147. package/dist/{Pagination-CsClNqIu.cjs → Pagination-WJq_7QNi.cjs} +2 -2
  148. package/dist/{Pagination-CsClNqIu.cjs.map → Pagination-WJq_7QNi.cjs.map} +1 -1
  149. package/dist/{RemoveDialog-PHdZi9-d.js → RemoveDialog-BSQ6EMW-.js} +5 -5
  150. package/dist/{RemoveDialog-PHdZi9-d.js.map → RemoveDialog-BSQ6EMW-.js.map} +1 -1
  151. package/dist/{RemoveDialog-D5J9TYap.cjs → RemoveDialog-BhcwsY0q.cjs} +2 -2
  152. package/dist/{RemoveDialog-D5J9TYap.cjs.map → RemoveDialog-BhcwsY0q.cjs.map} +1 -1
  153. package/dist/{RichTextEditor-jWv0t3vJ.cjs → RichTextEditor-Bc1fhvzn.cjs} +2 -2
  154. package/dist/{RichTextEditor-jWv0t3vJ.cjs.map → RichTextEditor-Bc1fhvzn.cjs.map} +1 -1
  155. package/dist/{RichTextEditor-BcmsnYGJ.js → RichTextEditor-CaGPtwXe.js} +9 -9
  156. package/dist/{RichTextEditor-BcmsnYGJ.js.map → RichTextEditor-CaGPtwXe.js.map} +1 -1
  157. package/dist/{RootLayout-q_oWf5et.js → RootLayout-BNwHsuhC.js} +31 -31
  158. package/dist/{RootLayout-q_oWf5et.js.map → RootLayout-BNwHsuhC.js.map} +1 -1
  159. package/dist/{RootLayout-DtZcqk9N.cjs → RootLayout-CB-3FgOp.cjs} +2 -2
  160. package/dist/{RootLayout-DtZcqk9N.cjs.map → RootLayout-CB-3FgOp.cjs.map} +1 -1
  161. package/dist/{Select-CWCeBQ8Q.cjs → Select-Cx1Yl8nq.cjs} +2 -2
  162. package/dist/{Select-CWCeBQ8Q.cjs.map → Select-Cx1Yl8nq.cjs.map} +1 -1
  163. package/dist/{Select-UygxT1Ry.js → Select-vKZzS9K4.js} +6 -6
  164. package/dist/{Select-UygxT1Ry.js.map → Select-vKZzS9K4.js.map} +1 -1
  165. package/dist/{Sidebar-C0OJK29L.js → Sidebar-CJ7DtOqb.js} +5 -5
  166. package/dist/{Sidebar-C0OJK29L.js.map → Sidebar-CJ7DtOqb.js.map} +1 -1
  167. package/dist/{Sidebar-BfBggyuh.cjs → Sidebar-Cv95DJxZ.cjs} +2 -2
  168. package/dist/{Sidebar-BfBggyuh.cjs.map → Sidebar-Cv95DJxZ.cjs.map} +1 -1
  169. package/dist/{SpeedDial-DbvOJ4no.js → SpeedDial-Bb0ioXaO.js} +4 -4
  170. package/dist/{SpeedDial-DbvOJ4no.js.map → SpeedDial-Bb0ioXaO.js.map} +1 -1
  171. package/dist/{SpeedDial-cKvuSMuk.cjs → SpeedDial-D6sO-9ES.cjs} +2 -2
  172. package/dist/{SpeedDial-cKvuSMuk.cjs.map → SpeedDial-D6sO-9ES.cjs.map} +1 -1
  173. package/dist/{Stepper-BxGrP6JZ.js → Stepper-BaEOUnYe.js} +4 -4
  174. package/dist/{Stepper-BxGrP6JZ.js.map → Stepper-BaEOUnYe.js.map} +1 -1
  175. package/dist/{Stepper-Db_ALAc4.cjs → Stepper-CVY8NJEI.cjs} +2 -2
  176. package/dist/{Stepper-Db_ALAc4.cjs.map → Stepper-CVY8NJEI.cjs.map} +1 -1
  177. package/dist/{SwatchPicker-DbAU9-ux.cjs → SwatchPicker-CCJltwHI.cjs} +2 -2
  178. package/dist/{SwatchPicker-DbAU9-ux.cjs.map → SwatchPicker-CCJltwHI.cjs.map} +1 -1
  179. package/dist/{SwatchPicker-D30aSrbY.js → SwatchPicker-CqyWngFJ.js} +2 -2
  180. package/dist/{SwatchPicker-D30aSrbY.js.map → SwatchPicker-CqyWngFJ.js.map} +1 -1
  181. package/dist/{Table--pDmXYad.cjs → Table-AQ7yJhtW.cjs} +2 -2
  182. package/dist/{Table--pDmXYad.cjs.map → Table-AQ7yJhtW.cjs.map} +1 -1
  183. package/dist/{Table-CNjnvZ-k.js → Table-wn-B7iLj.js} +17 -17
  184. package/dist/{Table-CNjnvZ-k.js.map → Table-wn-B7iLj.js.map} +1 -1
  185. package/dist/{Tabs-ozklGWmX.cjs → Tabs-BtcJ2jBl.cjs} +2 -2
  186. package/dist/{Tabs-ozklGWmX.cjs.map → Tabs-BtcJ2jBl.cjs.map} +1 -1
  187. package/dist/{Tabs-B0mWCNaC.js → Tabs-DJMfAUni.js} +4 -4
  188. package/dist/{Tabs-B0mWCNaC.js.map → Tabs-DJMfAUni.js.map} +1 -1
  189. package/dist/{TagsField-BIxwLfSJ.cjs → TagsField-4x3RmGwt.cjs} +2 -2
  190. package/dist/{TagsField-BIxwLfSJ.cjs.map → TagsField-4x3RmGwt.cjs.map} +1 -1
  191. package/dist/{TagsField-CGFm17lP.js → TagsField-Bvh6Fm5Y.js} +5 -5
  192. package/dist/{TagsField-CGFm17lP.js.map → TagsField-Bvh6Fm5Y.js.map} +1 -1
  193. package/dist/{TextField-DvKEj36A.cjs → TextField-DNqnpAWB.cjs} +2 -2
  194. package/dist/{TextField-DvKEj36A.cjs.map → TextField-DNqnpAWB.cjs.map} +1 -1
  195. package/dist/{TextField-CRCYLPpr.js → TextField-DcdwUA9d.js} +4 -4
  196. package/dist/{TextField-CRCYLPpr.js.map → TextField-DcdwUA9d.js.map} +1 -1
  197. package/dist/{ThemeToggle-BwW9L115.js → ThemeToggle-BVQmSMsj.js} +4 -4
  198. package/dist/{ThemeToggle-BwW9L115.js.map → ThemeToggle-BVQmSMsj.js.map} +1 -1
  199. package/dist/{ThemeToggle-DxxLN79b.cjs → ThemeToggle-isboxfZk.cjs} +2 -2
  200. package/dist/{ThemeToggle-DxxLN79b.cjs.map → ThemeToggle-isboxfZk.cjs.map} +1 -1
  201. package/dist/{TimeColumns-D3nqkQbh.js → TimeColumns-CFy_PynH.js} +2 -2
  202. package/dist/{TimeColumns-D3nqkQbh.js.map → TimeColumns-CFy_PynH.js.map} +1 -1
  203. package/dist/{TimeColumns-DB-V4KpQ.cjs → TimeColumns-DxFjjtc7.cjs} +2 -2
  204. package/dist/{TimeColumns-DB-V4KpQ.cjs.map → TimeColumns-DxFjjtc7.cjs.map} +1 -1
  205. package/dist/{TimePicker-D51QkQYy.js → TimePicker-ZO7jOJVa.js} +6 -6
  206. package/dist/{TimePicker-D51QkQYy.js.map → TimePicker-ZO7jOJVa.js.map} +1 -1
  207. package/dist/{TimePicker-D__72q2J.cjs → TimePicker-v1yA7Igl.cjs} +2 -2
  208. package/dist/{TimePicker-D__72q2J.cjs.map → TimePicker-v1yA7Igl.cjs.map} +1 -1
  209. package/dist/{Timeline-WkV4k_we.js → Timeline-D3kzt1dy.js} +3 -3
  210. package/dist/{Timeline-WkV4k_we.js.map → Timeline-D3kzt1dy.js.map} +1 -1
  211. package/dist/{Timeline-CoxW0Ia_.cjs → Timeline-ONU_3gi3.cjs} +2 -2
  212. package/dist/{Timeline-CoxW0Ia_.cjs.map → Timeline-ONU_3gi3.cjs.map} +1 -1
  213. package/dist/{Toaster-BynCHvUr.js → Toaster-C6UK_2TB.js} +2 -2
  214. package/dist/{Toaster-BynCHvUr.js.map → Toaster-C6UK_2TB.js.map} +1 -1
  215. package/dist/{Toaster-tHet1M-T.cjs → Toaster-Qnsq3guQ.cjs} +2 -2
  216. package/dist/{Toaster-tHet1M-T.cjs.map → Toaster-Qnsq3guQ.cjs.map} +1 -1
  217. package/dist/{ToggleButtonGroup-BWd7MOcc.js → ToggleButtonGroup-D9odYMzD.js} +3 -3
  218. package/dist/{ToggleButtonGroup-BWd7MOcc.js.map → ToggleButtonGroup-D9odYMzD.js.map} +1 -1
  219. package/dist/{ToggleButtonGroup-DYRLwKKh.cjs → ToggleButtonGroup-M2oj_3mc.cjs} +2 -2
  220. package/dist/{ToggleButtonGroup-DYRLwKKh.cjs.map → ToggleButtonGroup-M2oj_3mc.cjs.map} +1 -1
  221. package/dist/{TranslatedFields-DHRFcB3n.js → TranslatedFields-Bo5rZ7so.js} +5 -5
  222. package/dist/{TranslatedFields-DHRFcB3n.js.map → TranslatedFields-Bo5rZ7so.js.map} +1 -1
  223. package/dist/{TranslatedFields-B3Gli3TZ.cjs → TranslatedFields-CLMvRpJi.cjs} +2 -2
  224. package/dist/{TranslatedFields-B3Gli3TZ.cjs.map → TranslatedFields-CLMvRpJi.cjs.map} +1 -1
  225. package/dist/UserCard-454Kc7JS.js +74 -0
  226. package/dist/UserCard-454Kc7JS.js.map +1 -0
  227. package/dist/UserCard-CIjZz5xd.cjs +2 -0
  228. package/dist/UserCard-CIjZz5xd.cjs.map +1 -0
  229. package/dist/components/Accordion/index.cjs +1 -1
  230. package/dist/components/Accordion/index.js +1 -1
  231. package/dist/components/Alert/index.cjs +1 -1
  232. package/dist/components/Alert/index.js +1 -1
  233. package/dist/components/AuthLayout/index.cjs +1 -1
  234. package/dist/components/AuthLayout/index.js +1 -1
  235. package/dist/components/Avatar/index.cjs +1 -1
  236. package/dist/components/Avatar/index.js +2 -2
  237. package/dist/components/Breadcrumbs/index.cjs +1 -1
  238. package/dist/components/Breadcrumbs/index.js +1 -1
  239. package/dist/components/Button/index.cjs +1 -1
  240. package/dist/components/Button/index.js +1 -1
  241. package/dist/components/Card/index.cjs +1 -1
  242. package/dist/components/Card/index.js +1 -1
  243. package/dist/components/Checkbox/Checkbox.d.cts +7 -0
  244. package/dist/components/Checkbox/Checkbox.d.ts +7 -0
  245. package/dist/components/Checkbox/index.cjs +1 -1
  246. package/dist/components/Checkbox/index.js +1 -1
  247. package/dist/components/Chip/index.cjs +1 -1
  248. package/dist/components/Chip/index.js +1 -1
  249. package/dist/components/ChoiceCard/index.cjs +1 -1
  250. package/dist/components/ChoiceCard/index.js +1 -1
  251. package/dist/components/CodeBlock/index.cjs +1 -1
  252. package/dist/components/CodeBlock/index.js +1 -1
  253. package/dist/components/ColorPicker/index.cjs +1 -1
  254. package/dist/components/ColorPicker/index.js +1 -1
  255. package/dist/components/CopyButton/index.cjs +1 -1
  256. package/dist/components/CopyButton/index.js +1 -1
  257. package/dist/components/DashedButton/index.cjs +1 -1
  258. package/dist/components/DashedButton/index.js +1 -1
  259. package/dist/components/DatePicker/index.cjs +1 -1
  260. package/dist/components/DatePicker/index.js +1 -1
  261. package/dist/components/DateTimePicker/index.cjs +1 -1
  262. package/dist/components/DateTimePicker/index.js +1 -1
  263. package/dist/components/EmptyState/index.cjs +1 -1
  264. package/dist/components/EmptyState/index.js +1 -1
  265. package/dist/components/FileCard/index.cjs +1 -1
  266. package/dist/components/FileCard/index.js +1 -1
  267. package/dist/components/FileUploader/index.cjs +1 -1
  268. package/dist/components/FileUploader/index.js +1 -1
  269. package/dist/components/Flag/index.cjs +1 -1
  270. package/dist/components/Flag/index.js +1 -1
  271. package/dist/components/FullscreenToggle/index.cjs +1 -1
  272. package/dist/components/FullscreenToggle/index.js +1 -1
  273. package/dist/components/Icon/index.cjs +1 -1
  274. package/dist/components/Icon/index.js +2 -2
  275. package/dist/components/IconButton/index.cjs +1 -1
  276. package/dist/components/IconButton/index.js +1 -1
  277. package/dist/components/List/index.cjs +1 -1
  278. package/dist/components/List/index.js +1 -1
  279. package/dist/components/Loader/index.cjs +1 -1
  280. package/dist/components/Loader/index.js +1 -1
  281. package/dist/components/Modal/index.cjs +1 -1
  282. package/dist/components/Modal/index.js +1 -1
  283. package/dist/components/MultiSelect/index.cjs +1 -1
  284. package/dist/components/MultiSelect/index.js +1 -1
  285. package/dist/components/NumberField/index.cjs +1 -1
  286. package/dist/components/NumberField/index.js +1 -1
  287. package/dist/components/OtpField/index.cjs +1 -1
  288. package/dist/components/OtpField/index.js +1 -1
  289. package/dist/components/PageLayout/index.cjs +1 -1
  290. package/dist/components/PageLayout/index.js +1 -1
  291. package/dist/components/PageNotFound/index.cjs +1 -1
  292. package/dist/components/PageNotFound/index.js +1 -1
  293. package/dist/components/Pagination/index.cjs +1 -1
  294. package/dist/components/Pagination/index.js +1 -1
  295. package/dist/components/RemoveDialog/index.cjs +1 -1
  296. package/dist/components/RemoveDialog/index.js +1 -1
  297. package/dist/components/RichTextEditor/index.cjs +1 -1
  298. package/dist/components/RichTextEditor/index.js +1 -1
  299. package/dist/components/RootLayout/index.cjs +1 -1
  300. package/dist/components/RootLayout/index.js +1 -1
  301. package/dist/components/Select/index.cjs +1 -1
  302. package/dist/components/Select/index.js +1 -1
  303. package/dist/components/Sidebar/index.cjs +1 -1
  304. package/dist/components/Sidebar/index.js +1 -1
  305. package/dist/components/SpeedDial/index.cjs +1 -1
  306. package/dist/components/SpeedDial/index.js +1 -1
  307. package/dist/components/Stepper/index.cjs +1 -1
  308. package/dist/components/Stepper/index.js +1 -1
  309. package/dist/components/SwatchPicker/index.cjs +1 -1
  310. package/dist/components/SwatchPicker/index.js +1 -1
  311. package/dist/components/Table/index.cjs +1 -1
  312. package/dist/components/Table/index.js +1 -1
  313. package/dist/components/Tabs/index.cjs +1 -1
  314. package/dist/components/Tabs/index.js +1 -1
  315. package/dist/components/TagsField/index.cjs +1 -1
  316. package/dist/components/TagsField/index.js +1 -1
  317. package/dist/components/TextField/index.cjs +1 -1
  318. package/dist/components/TextField/index.js +1 -1
  319. package/dist/components/ThemeToggle/index.cjs +1 -1
  320. package/dist/components/ThemeToggle/index.js +1 -1
  321. package/dist/components/TimePicker/index.cjs +1 -1
  322. package/dist/components/TimePicker/index.js +1 -1
  323. package/dist/components/Timeline/index.cjs +1 -1
  324. package/dist/components/Timeline/index.js +1 -1
  325. package/dist/components/Toast/index.cjs +1 -1
  326. package/dist/components/Toast/index.js +1 -1
  327. package/dist/components/ToggleButton/index.cjs +1 -1
  328. package/dist/components/ToggleButton/index.js +1 -1
  329. package/dist/components/TranslatedFields/index.cjs +1 -1
  330. package/dist/components/TranslatedFields/index.js +1 -1
  331. package/dist/components/UserCard/UserCard.d.cts +4 -1
  332. package/dist/components/UserCard/UserCard.d.ts +4 -1
  333. package/dist/components/UserCard/index.cjs +1 -1
  334. package/dist/components/UserCard/index.js +1 -1
  335. package/dist/entries/app.cjs +1 -1
  336. package/dist/entries/app.js +1 -1
  337. package/dist/entries/components.cjs +1 -1
  338. package/dist/entries/components.js +53 -53
  339. package/dist/entries/i18n.cjs +1 -1
  340. package/dist/entries/i18n.js +2 -2
  341. package/dist/entries/icons.cjs +1 -1
  342. package/dist/entries/icons.js +2 -2
  343. package/dist/entries/theme.cjs +1 -1
  344. package/dist/entries/theme.js +1 -1
  345. package/dist/i18n/messages.d.cts +1 -0
  346. package/dist/i18n/messages.d.ts +1 -0
  347. package/dist/icons/names.d.cts +3 -3
  348. package/dist/icons/names.d.ts +3 -3
  349. package/dist/index.cjs +1 -1
  350. package/dist/index.css +1 -1
  351. package/dist/index.js +56 -56
  352. package/dist/{messages-FciBtnCL.js → messages-CGHhwf6F.js} +10 -3
  353. package/dist/messages-CGHhwf6F.js.map +1 -0
  354. package/dist/messages-DZJyiaf9.cjs +36 -0
  355. package/dist/messages-DZJyiaf9.cjs.map +1 -0
  356. package/dist/names-BJnFU_5m.cjs +2 -0
  357. package/dist/names-BJnFU_5m.cjs.map +1 -0
  358. package/dist/{names-D8ABK2Wk.js → names-r21QPjcU.js} +3 -2
  359. package/dist/names-r21QPjcU.js.map +1 -0
  360. package/package.json +1 -1
  361. package/dist/Checkbox-DXOzYIAz.cjs +0 -2
  362. package/dist/Checkbox-DXOzYIAz.cjs.map +0 -1
  363. package/dist/Checkbox-XKL_Q5qj.js +0 -84
  364. package/dist/Checkbox-XKL_Q5qj.js.map +0 -1
  365. package/dist/Icon-CXTl_QAP.cjs +0 -2
  366. package/dist/Icon-CXTl_QAP.cjs.map +0 -1
  367. package/dist/Icon-CophpkHo.js.map +0 -1
  368. package/dist/UserCard-D7U-CLbM.js +0 -74
  369. package/dist/UserCard-D7U-CLbM.js.map +0 -1
  370. package/dist/UserCard-GHw2gTx9.cjs +0 -2
  371. package/dist/UserCard-GHw2gTx9.cjs.map +0 -1
  372. package/dist/messages-C0YutUM1.cjs +0 -36
  373. package/dist/messages-C0YutUM1.cjs.map +0 -1
  374. package/dist/messages-FciBtnCL.js.map +0 -1
  375. package/dist/names-C2Yj1p3u.cjs +0 -2
  376. package/dist/names-C2Yj1p3u.cjs.map +0 -1
  377. package/dist/names-D8ABK2Wk.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination-CsClNqIu.cjs","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":"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"}
1
+ {"version":3,"file":"Pagination-WJq_7QNi.cjs","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":"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"}
@@ -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-BkjZ7wEu.js";
4
- import { I as _ } from "./Icon-CophpkHo.js";
5
- import { M as C } from "./Modal-Us_E-lb2.js";
3
+ import { B as s } from "./Button-RljTGqHl.js";
4
+ import { I as _ } from "./Icon-DaTvzLBu.js";
5
+ import { M as C } from "./Modal-DBYcoCbJ.js";
6
6
  import { T as D } from "./Typography-Cta6Rg4L.js";
7
- import { a as R } from "./ConfigProvider-DDuIJSM7.js";
7
+ import { a as R } from "./ConfigProvider-DT0yrgmd.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-PHdZi9-d.js.map
47
+ //# sourceMappingURL=RemoveDialog-BSQ6EMW-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveDialog-PHdZi9-d.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-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,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),i=require("react"),c=require("./Button-Cu0XdnW6.cjs"),j=require("./Icon-CXTl_QAP.cjs"),B=require("./Modal-DsoSz0Sp.cjs"),b=require("./Typography-BFatE1_A.cjs"),q=require("./ConfigProvider-h1WoGC3R.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-D5J9TYap.cjs.map
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 +1 @@
1
- {"version":3,"file":"RemoveDialog-D5J9TYap.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-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,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-Cu0XdnW6.cjs"),ge=require("./ColorPickerPanel-CoyKplF5.cjs"),M=require("./Divider-CzbhdCiD.cjs"),se=require("./Dropdown-Ui7h2TGd.cjs"),Je=require("./FloatingPanel-U6sGYiSK.cjs"),h=require("./Icon-CXTl_QAP.cjs"),O=require("./IconButton-DyRC514t.cjs"),G=require("./ListItem-DWQorRxG.cjs"),Qe=require("./Modal-DsoSz0Sp.cjs"),Xe=require("./TextField-DvKEj36A.cjs"),ce=require("./ConfigProvider-h1WoGC3R.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-jWv0t3vJ.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-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