@techzyapp/ui-library 1.0.8 → 1.0.9

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 (321) hide show
  1. package/dist/{Alert-BL8hDdEl.js → Alert-B3rDvpbO.js} +3 -3
  2. package/dist/{Alert-BL8hDdEl.js.map → Alert-B3rDvpbO.js.map} +1 -1
  3. package/dist/{Alert-C9yBIMq0.cjs → Alert-D99G0StL.cjs} +2 -2
  4. package/dist/{Alert-C9yBIMq0.cjs.map → Alert-D99G0StL.cjs.map} +1 -1
  5. package/dist/{Breadcrumbs-DhBx2UgK.cjs → Breadcrumbs-BnxhmyK5.cjs} +2 -2
  6. package/dist/{Breadcrumbs-DhBx2UgK.cjs.map → Breadcrumbs-BnxhmyK5.cjs.map} +1 -1
  7. package/dist/{Breadcrumbs-BC_QSlJZ.js → Breadcrumbs-DvgctFLS.js} +3 -3
  8. package/dist/{Breadcrumbs-BC_QSlJZ.js.map → Breadcrumbs-DvgctFLS.js.map} +1 -1
  9. package/dist/{Button-BT8XmR_T.js → Button-CUsXYM-m.js} +2 -2
  10. package/dist/{Button-BT8XmR_T.js.map → Button-CUsXYM-m.js.map} +1 -1
  11. package/dist/{Button-C_HPI97g.cjs → Button-Cj6pckNl.cjs} +2 -2
  12. package/dist/{Button-C_HPI97g.cjs.map → Button-Cj6pckNl.cjs.map} +1 -1
  13. package/dist/{Calendar-CCCife5b.cjs → Calendar-Br4C0x0n.cjs} +2 -2
  14. package/dist/{Calendar-CCCife5b.cjs.map → Calendar-Br4C0x0n.cjs.map} +1 -1
  15. package/dist/{Calendar-B9mXn_zD.js → Calendar-CE_9WNAB.js} +3 -3
  16. package/dist/{Calendar-B9mXn_zD.js.map → Calendar-CE_9WNAB.js.map} +1 -1
  17. package/dist/{Card-DfVntHqn.cjs → Card-DD9SWHzZ.cjs} +2 -2
  18. package/dist/{Card-DfVntHqn.cjs.map → Card-DD9SWHzZ.cjs.map} +1 -1
  19. package/dist/{Card-DHPAefzg.js → Card-DhpudGvF.js} +2 -2
  20. package/dist/{Card-DHPAefzg.js.map → Card-DhpudGvF.js.map} +1 -1
  21. package/dist/{Chip-BoHt3WYS.cjs → Chip-B2lY4TJ0.cjs} +2 -2
  22. package/dist/{Chip-BoHt3WYS.cjs.map → Chip-B2lY4TJ0.cjs.map} +1 -1
  23. package/dist/{Chip-DX3QECcs.js → Chip-DulHqhuf.js} +2 -2
  24. package/dist/{Chip-DX3QECcs.js.map → Chip-DulHqhuf.js.map} +1 -1
  25. package/dist/{CodeBlock-CPWEOym2.js → CodeBlock-DwBMghs2.js} +3 -3
  26. package/dist/{CodeBlock-CPWEOym2.js.map → CodeBlock-DwBMghs2.js.map} +1 -1
  27. package/dist/{CodeBlock-DKhIGQBg.cjs → CodeBlock-EhB7v9-R.cjs} +2 -2
  28. package/dist/{CodeBlock-DKhIGQBg.cjs.map → CodeBlock-EhB7v9-R.cjs.map} +1 -1
  29. package/dist/{ColorPicker-2qD8vZkR.js → ColorPicker-DJgTeHht.js} +3 -3
  30. package/dist/{ColorPicker-2qD8vZkR.js.map → ColorPicker-DJgTeHht.js.map} +1 -1
  31. package/dist/{ColorPicker-BAJWvC3h.cjs → ColorPicker-Dc1y9Zuu.cjs} +2 -2
  32. package/dist/{ColorPicker-BAJWvC3h.cjs.map → ColorPicker-Dc1y9Zuu.cjs.map} +1 -1
  33. package/dist/{ColorPickerPanel-CovWDIRt.js → ColorPickerPanel-9tOQUL38.js} +2 -2
  34. package/dist/{ColorPickerPanel-CovWDIRt.js.map → ColorPickerPanel-9tOQUL38.js.map} +1 -1
  35. package/dist/{ColorPickerPanel-CkB2pNnX.cjs → ColorPickerPanel-nXEliruE.cjs} +2 -2
  36. package/dist/{ColorPickerPanel-CkB2pNnX.cjs.map → ColorPickerPanel-nXEliruE.cjs.map} +1 -1
  37. package/dist/{ConfigProvider-DFy6pL-C.cjs → ConfigProvider-BHNx-NHV.cjs} +2 -2
  38. package/dist/{ConfigProvider-DFy6pL-C.cjs.map → ConfigProvider-BHNx-NHV.cjs.map} +1 -1
  39. package/dist/{ConfigProvider-sEZzNTeU.js → ConfigProvider-BYruQYHC.js} +2 -2
  40. package/dist/{ConfigProvider-sEZzNTeU.js.map → ConfigProvider-BYruQYHC.js.map} +1 -1
  41. package/dist/CopyButton-B4-OYsYr.js +31 -0
  42. package/dist/CopyButton-B4-OYsYr.js.map +1 -0
  43. package/dist/CopyButton-D_DCLHhb.cjs +2 -0
  44. package/dist/CopyButton-D_DCLHhb.cjs.map +1 -0
  45. package/dist/{DatePicker-TLaQ3ZyB.cjs → DatePicker-CEczjGZy.cjs} +2 -2
  46. package/dist/{DatePicker-TLaQ3ZyB.cjs.map → DatePicker-CEczjGZy.cjs.map} +1 -1
  47. package/dist/{DatePicker-BVHriq5B.js → DatePicker-DkvfSN1K.js} +4 -4
  48. package/dist/{DatePicker-BVHriq5B.js.map → DatePicker-DkvfSN1K.js.map} +1 -1
  49. package/dist/{DateTimePicker-Dq2jJ2yb.cjs → DateTimePicker-CDyGxUBX.cjs} +2 -2
  50. package/dist/{DateTimePicker-Dq2jJ2yb.cjs.map → DateTimePicker-CDyGxUBX.cjs.map} +1 -1
  51. package/dist/{DateTimePicker-BWxsgyGB.js → DateTimePicker-DPomyrnN.js} +7 -7
  52. package/dist/{DateTimePicker-BWxsgyGB.js.map → DateTimePicker-DPomyrnN.js.map} +1 -1
  53. package/dist/{EmptyState-B2WgeL-H.cjs → EmptyState-B77utgEn.cjs} +2 -2
  54. package/dist/{EmptyState-B2WgeL-H.cjs.map → EmptyState-B77utgEn.cjs.map} +1 -1
  55. package/dist/{EmptyState-D8eUxb8v.js → EmptyState-CVyFXprK.js} +2 -2
  56. package/dist/{EmptyState-D8eUxb8v.js.map → EmptyState-CVyFXprK.js.map} +1 -1
  57. package/dist/FileCard-Cpc5frNm.js +148 -0
  58. package/dist/FileCard-Cpc5frNm.js.map +1 -0
  59. package/dist/FileCard-CsGW2sxE.cjs +2 -0
  60. package/dist/FileCard-CsGW2sxE.cjs.map +1 -0
  61. package/dist/{FileUploader-I0G-2WSe.js → FileUploader-B_nKMh_K.js} +5 -5
  62. package/dist/{FileUploader-I0G-2WSe.js.map → FileUploader-B_nKMh_K.js.map} +1 -1
  63. package/dist/{FileUploader-qsnWX-i5.cjs → FileUploader-DDi_uzIx.cjs} +2 -2
  64. package/dist/{FileUploader-qsnWX-i5.cjs.map → FileUploader-DDi_uzIx.cjs.map} +1 -1
  65. package/dist/{Flag-Bxl1Pa9m.cjs → Flag-BJLWKB9J.cjs} +2 -2
  66. package/dist/{Flag-Bxl1Pa9m.cjs.map → Flag-BJLWKB9J.cjs.map} +1 -1
  67. package/dist/{Flag-CvIo_Eqp.js → Flag-Ck1xK22A.js} +2 -2
  68. package/dist/{Flag-CvIo_Eqp.js.map → Flag-Ck1xK22A.js.map} +1 -1
  69. package/dist/{FullscreenToggle-CRMGYmB8.js → FullscreenToggle-DmC0jTay.js} +3 -3
  70. package/dist/{FullscreenToggle-CRMGYmB8.js.map → FullscreenToggle-DmC0jTay.js.map} +1 -1
  71. package/dist/{FullscreenToggle-CEOkPSLp.cjs → FullscreenToggle-MCxGzAEe.cjs} +2 -2
  72. package/dist/{FullscreenToggle-CEOkPSLp.cjs.map → FullscreenToggle-MCxGzAEe.cjs.map} +1 -1
  73. package/dist/{IconButton-BZ2jJn_T.js → IconButton-B8FPGgDn.js} +2 -2
  74. package/dist/{IconButton-BZ2jJn_T.js.map → IconButton-B8FPGgDn.js.map} +1 -1
  75. package/dist/{IconButton-ChUfK0pG.cjs → IconButton-BoY2y_pV.cjs} +2 -2
  76. package/dist/{IconButton-ChUfK0pG.cjs.map → IconButton-BoY2y_pV.cjs.map} +1 -1
  77. package/dist/{Loader-plA9fgHf.cjs → Loader-Cwb1bOHj.cjs} +2 -2
  78. package/dist/{Loader-plA9fgHf.cjs.map → Loader-Cwb1bOHj.cjs.map} +1 -1
  79. package/dist/{Loader-DFlpw5Zc.js → Loader-UzzqvFyo.js} +2 -2
  80. package/dist/{Loader-DFlpw5Zc.js.map → Loader-UzzqvFyo.js.map} +1 -1
  81. package/dist/Masonry-9LrJKlhI.cjs +2 -0
  82. package/dist/Masonry-9LrJKlhI.cjs.map +1 -0
  83. package/dist/Masonry-BsRWG-oN.js +92 -0
  84. package/dist/Masonry-BsRWG-oN.js.map +1 -0
  85. package/dist/{Modal-BaieUdge.cjs → Modal-CO3c3sGY.cjs} +2 -2
  86. package/dist/{Modal-BaieUdge.cjs.map → Modal-CO3c3sGY.cjs.map} +1 -1
  87. package/dist/{Modal-CRH_i5uU.js → Modal-XMRDPHvQ.js} +3 -3
  88. package/dist/{Modal-CRH_i5uU.js.map → Modal-XMRDPHvQ.js.map} +1 -1
  89. package/dist/{MultiSelect-BmkzNHTE.js → MultiSelect-BPLctumx.js} +4 -4
  90. package/dist/{MultiSelect-BmkzNHTE.js.map → MultiSelect-BPLctumx.js.map} +1 -1
  91. package/dist/{MultiSelect-Cb-N8GIs.cjs → MultiSelect-DVOVHuIm.cjs} +2 -2
  92. package/dist/{MultiSelect-Cb-N8GIs.cjs.map → MultiSelect-DVOVHuIm.cjs.map} +1 -1
  93. package/dist/{NumberField-DBwNn3-f.cjs → NumberField-BH237Vt2.cjs} +2 -2
  94. package/dist/{NumberField-DBwNn3-f.cjs.map → NumberField-BH237Vt2.cjs.map} +1 -1
  95. package/dist/{NumberField-D71JI2Wv.js → NumberField-X2HsSpu9.js} +3 -3
  96. package/dist/{NumberField-D71JI2Wv.js.map → NumberField-X2HsSpu9.js.map} +1 -1
  97. package/dist/{OtpField-DOz-JmuX.js → OtpField-CB05q0NX.js} +2 -2
  98. package/dist/{OtpField-DOz-JmuX.js.map → OtpField-CB05q0NX.js.map} +1 -1
  99. package/dist/{OtpField-C-SiHxKa.cjs → OtpField-CXP59zM2.cjs} +2 -2
  100. package/dist/{OtpField-C-SiHxKa.cjs.map → OtpField-CXP59zM2.cjs.map} +1 -1
  101. package/dist/{PageLayout-qF5ThZKO.cjs → PageLayout-CuVuZEbR.cjs} +2 -2
  102. package/dist/{PageLayout-qF5ThZKO.cjs.map → PageLayout-CuVuZEbR.cjs.map} +1 -1
  103. package/dist/{PageLayout-BIdgUKsN.js → PageLayout-WKWnj5cw.js} +2 -2
  104. package/dist/{PageLayout-BIdgUKsN.js.map → PageLayout-WKWnj5cw.js.map} +1 -1
  105. package/dist/{PageNotFound-CsgH9tY0.js → PageNotFound-CmT-Wr9m.js} +5 -5
  106. package/dist/{PageNotFound-CsgH9tY0.js.map → PageNotFound-CmT-Wr9m.js.map} +1 -1
  107. package/dist/{PageNotFound-DObWgQ0Z.cjs → PageNotFound-CxLUFoJa.cjs} +2 -2
  108. package/dist/{PageNotFound-DObWgQ0Z.cjs.map → PageNotFound-CxLUFoJa.cjs.map} +1 -1
  109. package/dist/{Pagination-Kj7ZDi3N.js → Pagination-BuP4N1bj.js} +2 -2
  110. package/dist/{Pagination-Kj7ZDi3N.js.map → Pagination-BuP4N1bj.js.map} +1 -1
  111. package/dist/{Pagination-S3hENjDy.cjs → Pagination-Dcs_Znx3.cjs} +2 -2
  112. package/dist/{Pagination-S3hENjDy.cjs.map → Pagination-Dcs_Znx3.cjs.map} +1 -1
  113. package/dist/{RemoveDialog-BZ0gUf1p.cjs → RemoveDialog-Cwtq9wAt.cjs} +2 -2
  114. package/dist/{RemoveDialog-BZ0gUf1p.cjs.map → RemoveDialog-Cwtq9wAt.cjs.map} +1 -1
  115. package/dist/{RemoveDialog-D9a0GttZ.js → RemoveDialog-DU6MqkO8.js} +4 -4
  116. package/dist/{RemoveDialog-D9a0GttZ.js.map → RemoveDialog-DU6MqkO8.js.map} +1 -1
  117. package/dist/{RichTextEditor-BX6twJ9D.cjs → RichTextEditor-GxbnzLRe.cjs} +2 -2
  118. package/dist/{RichTextEditor-BX6twJ9D.cjs.map → RichTextEditor-GxbnzLRe.cjs.map} +1 -1
  119. package/dist/{RichTextEditor-D05Czeif.js → RichTextEditor-k-NlWb4Y.js} +7 -7
  120. package/dist/{RichTextEditor-D05Czeif.js.map → RichTextEditor-k-NlWb4Y.js.map} +1 -1
  121. package/dist/{RootLayout-BR_pPr3d.cjs → RootLayout-4GV6dfdB.cjs} +2 -2
  122. package/dist/{RootLayout-BR_pPr3d.cjs.map → RootLayout-4GV6dfdB.cjs.map} +1 -1
  123. package/dist/{RootLayout-CgI03ZNA.js → RootLayout-BPSWgWlI.js} +11 -11
  124. package/dist/{RootLayout-CgI03ZNA.js.map → RootLayout-BPSWgWlI.js.map} +1 -1
  125. package/dist/{Select-BZPA2Ytp.js → Select-D7KJ-YMU.js} +3 -3
  126. package/dist/{Select-BZPA2Ytp.js.map → Select-D7KJ-YMU.js.map} +1 -1
  127. package/dist/{Select-Dpl8dq_9.cjs → Select-DjMZec8c.cjs} +2 -2
  128. package/dist/{Select-Dpl8dq_9.cjs.map → Select-DjMZec8c.cjs.map} +1 -1
  129. package/dist/{Sidebar-6SAObU0u.cjs → Sidebar-CT_NUo_7.cjs} +2 -2
  130. package/dist/{Sidebar-6SAObU0u.cjs.map → Sidebar-CT_NUo_7.cjs.map} +1 -1
  131. package/dist/{Sidebar-DEBW6lDA.js → Sidebar-Csd3iKbS.js} +3 -3
  132. package/dist/{Sidebar-DEBW6lDA.js.map → Sidebar-Csd3iKbS.js.map} +1 -1
  133. package/dist/{SpeedDial-Dex0rF2z.cjs → SpeedDial-CyiPagdu.cjs} +2 -2
  134. package/dist/{SpeedDial-Dex0rF2z.cjs.map → SpeedDial-CyiPagdu.cjs.map} +1 -1
  135. package/dist/{SpeedDial-C3PnANAx.js → SpeedDial-DEWzAGXi.js} +2 -2
  136. package/dist/{SpeedDial-C3PnANAx.js.map → SpeedDial-DEWzAGXi.js.map} +1 -1
  137. package/dist/{Stepper-0e90ZJaw.js → Stepper-CS6s0dMF.js} +2 -2
  138. package/dist/{Stepper-0e90ZJaw.js.map → Stepper-CS6s0dMF.js.map} +1 -1
  139. package/dist/{Stepper-yKwUaxOU.cjs → Stepper-PW7c45PV.cjs} +2 -2
  140. package/dist/{Stepper-yKwUaxOU.cjs.map → Stepper-PW7c45PV.cjs.map} +1 -1
  141. package/dist/{Table-BekBXEnW.cjs → Table-C_Ov-kvK.cjs} +2 -2
  142. package/dist/{Table-BekBXEnW.cjs.map → Table-C_Ov-kvK.cjs.map} +1 -1
  143. package/dist/{Table-KEOUL2u3.js → Table-IIAKXYOh.js} +15 -15
  144. package/dist/{Table-KEOUL2u3.js.map → Table-IIAKXYOh.js.map} +1 -1
  145. package/dist/{Tabs-DYUS945Y.cjs → Tabs-CaHTJ99w.cjs} +2 -2
  146. package/dist/{Tabs-DYUS945Y.cjs.map → Tabs-CaHTJ99w.cjs.map} +1 -1
  147. package/dist/{Tabs-BHk2B50R.js → Tabs-D3wztVB1.js} +2 -2
  148. package/dist/{Tabs-BHk2B50R.js.map → Tabs-D3wztVB1.js.map} +1 -1
  149. package/dist/{TagsField-DKh9SbG5.cjs → TagsField-BQIwSX5m.cjs} +2 -2
  150. package/dist/{TagsField-DKh9SbG5.cjs.map → TagsField-BQIwSX5m.cjs.map} +1 -1
  151. package/dist/{TagsField-BkC5OmIT.js → TagsField-BR9Z5pik.js} +4 -4
  152. package/dist/{TagsField-BkC5OmIT.js.map → TagsField-BR9Z5pik.js.map} +1 -1
  153. package/dist/{TextField-12HcFD7u.js → TextField-Bg4TwkVD.js} +3 -3
  154. package/dist/{TextField-12HcFD7u.js.map → TextField-Bg4TwkVD.js.map} +1 -1
  155. package/dist/{TextField-C9cPPP-B.cjs → TextField-fmt7aacg.cjs} +2 -2
  156. package/dist/{TextField-C9cPPP-B.cjs.map → TextField-fmt7aacg.cjs.map} +1 -1
  157. package/dist/{ThemeToggle-DIXVvqZ7.cjs → ThemeToggle-Cz5I2-DL.cjs} +2 -2
  158. package/dist/{ThemeToggle-DIXVvqZ7.cjs.map → ThemeToggle-Cz5I2-DL.cjs.map} +1 -1
  159. package/dist/{ThemeToggle-DUtDXl1Z.js → ThemeToggle-DEfXczDs.js} +3 -3
  160. package/dist/{ThemeToggle-DUtDXl1Z.js.map → ThemeToggle-DEfXczDs.js.map} +1 -1
  161. package/dist/{TimeColumns-BLhP81oI.js → TimeColumns-B-vtakk8.js} +2 -2
  162. package/dist/{TimeColumns-BLhP81oI.js.map → TimeColumns-B-vtakk8.js.map} +1 -1
  163. package/dist/{TimeColumns-CgjyPGjs.cjs → TimeColumns-IBmjExao.cjs} +2 -2
  164. package/dist/{TimeColumns-CgjyPGjs.cjs.map → TimeColumns-IBmjExao.cjs.map} +1 -1
  165. package/dist/{TimePicker-CNAXFtJa.cjs → TimePicker-B-c6uIaY.cjs} +2 -2
  166. package/dist/{TimePicker-CNAXFtJa.cjs.map → TimePicker-B-c6uIaY.cjs.map} +1 -1
  167. package/dist/{TimePicker-CJWjGVqT.js → TimePicker-i2RnZHV1.js} +5 -5
  168. package/dist/{TimePicker-CJWjGVqT.js.map → TimePicker-i2RnZHV1.js.map} +1 -1
  169. package/dist/{Toaster-B3Mut6eM.js → Toaster-Da8F_SFV.js} +2 -2
  170. package/dist/{Toaster-B3Mut6eM.js.map → Toaster-Da8F_SFV.js.map} +1 -1
  171. package/dist/{Toaster-CYt_Hvlh.cjs → Toaster-qdS8Urgy.cjs} +2 -2
  172. package/dist/{Toaster-CYt_Hvlh.cjs.map → Toaster-qdS8Urgy.cjs.map} +1 -1
  173. package/dist/TranslatedFields-C30ww45c.cjs +2 -0
  174. package/dist/TranslatedFields-C30ww45c.cjs.map +1 -0
  175. package/dist/TranslatedFields-Ck9JTF27.js +86 -0
  176. package/dist/TranslatedFields-Ck9JTF27.js.map +1 -0
  177. package/dist/{UserCard-Dve-LOSB.js → UserCard-0ZF29bkK.js} +3 -3
  178. package/dist/{UserCard-Dve-LOSB.js.map → UserCard-0ZF29bkK.js.map} +1 -1
  179. package/dist/{UserCard-sIguy8Jp.cjs → UserCard-C8rC_gzD.cjs} +2 -2
  180. package/dist/{UserCard-sIguy8Jp.cjs.map → UserCard-C8rC_gzD.cjs.map} +1 -1
  181. package/dist/components/Alert/index.cjs +1 -1
  182. package/dist/components/Alert/index.js +1 -1
  183. package/dist/components/Breadcrumbs/index.cjs +1 -1
  184. package/dist/components/Breadcrumbs/index.js +1 -1
  185. package/dist/components/Button/index.cjs +1 -1
  186. package/dist/components/Button/index.js +1 -1
  187. package/dist/components/Card/index.cjs +1 -1
  188. package/dist/components/Card/index.js +1 -1
  189. package/dist/components/Chip/index.cjs +1 -1
  190. package/dist/components/Chip/index.js +1 -1
  191. package/dist/components/CodeBlock/index.cjs +1 -1
  192. package/dist/components/CodeBlock/index.js +1 -1
  193. package/dist/components/ColorPicker/index.cjs +1 -1
  194. package/dist/components/ColorPicker/index.js +1 -1
  195. package/dist/components/CopyButton/CopyButton.d.cts +32 -0
  196. package/dist/components/CopyButton/CopyButton.d.ts +32 -0
  197. package/dist/components/CopyButton/index.cjs +2 -0
  198. package/dist/components/CopyButton/index.cjs.map +1 -0
  199. package/dist/components/CopyButton/index.d.cts +2 -0
  200. package/dist/components/CopyButton/index.d.ts +2 -0
  201. package/dist/components/CopyButton/index.js +6 -0
  202. package/dist/components/CopyButton/index.js.map +1 -0
  203. package/dist/components/DatePicker/index.cjs +1 -1
  204. package/dist/components/DatePicker/index.js +1 -1
  205. package/dist/components/DateTimePicker/index.cjs +1 -1
  206. package/dist/components/DateTimePicker/index.js +1 -1
  207. package/dist/components/EmptyState/index.cjs +1 -1
  208. package/dist/components/EmptyState/index.js +1 -1
  209. package/dist/components/FileCard/FileCard.d.cts +45 -0
  210. package/dist/components/FileCard/FileCard.d.ts +45 -0
  211. package/dist/components/FileCard/index.cjs +2 -0
  212. package/dist/components/FileCard/index.cjs.map +1 -0
  213. package/dist/components/FileCard/index.d.cts +2 -0
  214. package/dist/components/FileCard/index.d.ts +2 -0
  215. package/dist/components/FileCard/index.js +6 -0
  216. package/dist/components/FileCard/index.js.map +1 -0
  217. package/dist/components/FileUploader/index.cjs +1 -1
  218. package/dist/components/FileUploader/index.js +1 -1
  219. package/dist/components/Flag/index.cjs +1 -1
  220. package/dist/components/Flag/index.js +1 -1
  221. package/dist/components/FullscreenToggle/index.cjs +1 -1
  222. package/dist/components/FullscreenToggle/index.js +1 -1
  223. package/dist/components/IconButton/index.cjs +1 -1
  224. package/dist/components/IconButton/index.js +1 -1
  225. package/dist/components/Loader/index.cjs +1 -1
  226. package/dist/components/Loader/index.js +1 -1
  227. package/dist/components/Masonry/Masonry.d.cts +14 -7
  228. package/dist/components/Masonry/Masonry.d.ts +14 -7
  229. package/dist/components/Masonry/index.cjs +1 -1
  230. package/dist/components/Masonry/index.js +1 -1
  231. package/dist/components/Modal/index.cjs +1 -1
  232. package/dist/components/Modal/index.js +1 -1
  233. package/dist/components/MultiSelect/index.cjs +1 -1
  234. package/dist/components/MultiSelect/index.js +1 -1
  235. package/dist/components/NumberField/index.cjs +1 -1
  236. package/dist/components/NumberField/index.js +1 -1
  237. package/dist/components/OtpField/index.cjs +1 -1
  238. package/dist/components/OtpField/index.js +1 -1
  239. package/dist/components/PageLayout/index.cjs +1 -1
  240. package/dist/components/PageLayout/index.js +1 -1
  241. package/dist/components/PageNotFound/index.cjs +1 -1
  242. package/dist/components/PageNotFound/index.js +1 -1
  243. package/dist/components/Pagination/index.cjs +1 -1
  244. package/dist/components/Pagination/index.js +1 -1
  245. package/dist/components/RemoveDialog/index.cjs +1 -1
  246. package/dist/components/RemoveDialog/index.js +1 -1
  247. package/dist/components/RichTextEditor/index.cjs +1 -1
  248. package/dist/components/RichTextEditor/index.js +1 -1
  249. package/dist/components/RootLayout/index.cjs +1 -1
  250. package/dist/components/RootLayout/index.js +1 -1
  251. package/dist/components/Select/index.cjs +1 -1
  252. package/dist/components/Select/index.js +1 -1
  253. package/dist/components/Sidebar/index.cjs +1 -1
  254. package/dist/components/Sidebar/index.js +1 -1
  255. package/dist/components/SpeedDial/index.cjs +1 -1
  256. package/dist/components/SpeedDial/index.js +1 -1
  257. package/dist/components/Stepper/index.cjs +1 -1
  258. package/dist/components/Stepper/index.js +1 -1
  259. package/dist/components/Table/index.cjs +1 -1
  260. package/dist/components/Table/index.js +1 -1
  261. package/dist/components/Tabs/index.cjs +1 -1
  262. package/dist/components/Tabs/index.js +1 -1
  263. package/dist/components/TagsField/index.cjs +1 -1
  264. package/dist/components/TagsField/index.js +1 -1
  265. package/dist/components/TextField/index.cjs +1 -1
  266. package/dist/components/TextField/index.js +1 -1
  267. package/dist/components/ThemeToggle/index.cjs +1 -1
  268. package/dist/components/ThemeToggle/index.js +1 -1
  269. package/dist/components/TimePicker/index.cjs +1 -1
  270. package/dist/components/TimePicker/index.js +1 -1
  271. package/dist/components/Toast/index.cjs +1 -1
  272. package/dist/components/Toast/index.js +1 -1
  273. package/dist/components/TranslatedFields/TranslatedFields.d.cts +9 -2
  274. package/dist/components/TranslatedFields/TranslatedFields.d.ts +9 -2
  275. package/dist/components/TranslatedFields/index.cjs +1 -1
  276. package/dist/components/TranslatedFields/index.js +1 -1
  277. package/dist/components/UserCard/index.cjs +1 -1
  278. package/dist/components/UserCard/index.js +1 -1
  279. package/dist/components/index.d.cts +2 -0
  280. package/dist/components/index.d.ts +2 -0
  281. package/dist/entries/components.cjs +1 -1
  282. package/dist/entries/components.js +125 -121
  283. package/dist/entries/components.js.map +1 -1
  284. package/dist/entries/hooks.cjs +1 -1
  285. package/dist/entries/hooks.d.cts +2 -0
  286. package/dist/entries/hooks.d.ts +2 -0
  287. package/dist/entries/hooks.js +6 -4
  288. package/dist/entries/hooks.js.map +1 -1
  289. package/dist/entries/i18n.cjs +1 -1
  290. package/dist/entries/i18n.js +2 -2
  291. package/dist/entries/theme.cjs +1 -1
  292. package/dist/entries/theme.js +1 -1
  293. package/dist/hooks/index.d.cts +2 -0
  294. package/dist/hooks/index.d.ts +2 -0
  295. package/dist/hooks/useClipboard.d.cts +28 -0
  296. package/dist/hooks/useClipboard.d.ts +28 -0
  297. package/dist/i18n/messages.d.cts +3 -0
  298. package/dist/i18n/messages.d.ts +3 -0
  299. package/dist/index.cjs +1 -1
  300. package/dist/index.css +1 -1
  301. package/dist/index.js +192 -186
  302. package/dist/index.js.map +1 -1
  303. package/dist/{messages-CVISEA5N.js → messages-BOKick2l.js} +35 -14
  304. package/dist/messages-BOKick2l.js.map +1 -0
  305. package/dist/{messages-BJiUtJ2E.cjs → messages-Jxz2YMcA.cjs} +9 -9
  306. package/dist/messages-Jxz2YMcA.cjs.map +1 -0
  307. package/dist/useClipboard-BjTIX-4g.cjs +2 -0
  308. package/dist/useClipboard-BjTIX-4g.cjs.map +1 -0
  309. package/dist/useClipboard-CEw_Juiq.js +23 -0
  310. package/dist/useClipboard-CEw_Juiq.js.map +1 -0
  311. package/package.json +4 -3
  312. package/dist/Masonry-BObKcPmo.js +0 -82
  313. package/dist/Masonry-BObKcPmo.js.map +0 -1
  314. package/dist/Masonry-BVphuk2X.cjs +0 -2
  315. package/dist/Masonry-BVphuk2X.cjs.map +0 -1
  316. package/dist/TranslatedFields-BEaS1esD.js +0 -82
  317. package/dist/TranslatedFields-BEaS1esD.js.map +0 -1
  318. package/dist/TranslatedFields-DshwXj6d.cjs +0 -2
  319. package/dist/TranslatedFields-DshwXj6d.cjs.map +0 -1
  320. package/dist/messages-BJiUtJ2E.cjs.map +0 -1
  321. package/dist/messages-CVISEA5N.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Card-DfVntHqn.cjs","sources":["../src/components/Card/Card.tsx"],"sourcesContent":["import { forwardRef, useId, useState, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport type { ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './Card.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Header title (left, next to the icon). */\n title?: ReactNode\n /** Secondary muted line shown under the `title` (e.g. a short description). */\n subtitle?: ReactNode\n /** Leading header icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the card flat (used by `PageLayout`). Cards are shadowless, so this currently adds no visual difference — it's a styling hook, not a distinct look. */\n flat?: boolean\n /** Header actions, placed at the end of the header row (before the collapse toggle). */\n actions?: ReactNode\n /** Footer content (e.g. actions), pinned to the **right** of the footer row. */\n footer?: ReactNode\n /** Footer content pinned to the **left** of the footer row (opposite `footer`). */\n footerStart?: ReactNode\n /** Adds a collapse/expand toggle to the header that folds the body + footer. */\n collapsible?: boolean\n /** Controlled collapsed state. */\n collapsed?: boolean\n /** Initial collapsed state for uncontrolled use. Defaults to `false`. */\n defaultCollapsed?: boolean\n /** Fires with the next collapsed state when the toggle is clicked. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Card body. */\n children?: ReactNode\n}\n\n/**\n * A surface card with an optional header (icon + title + actions), a body, and a footer for actions.\n * `collapsible` adds a chevron that smoothly folds the body + footer (controlled via `collapsed`/\n * `onCollapsedChange`, or uncontrolled via `defaultCollapsed`). Token-only styling.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n {\n title,\n subtitle,\n icon,\n color = 'accent',\n flat = false,\n actions,\n footer,\n footerStart,\n collapsible = false,\n collapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n className,\n children,\n ...props\n },\n ref,\n) {\n const isControlled = collapsed !== undefined\n const [internal, setInternal] = useState(defaultCollapsed)\n const isCollapsed = collapsible && (isControlled ? collapsed! : internal)\n const collapsibleId = useId() // ties the toggle to the fold region via aria-controls\n\n const toggle = () => {\n const next = !isCollapsed\n if (!isControlled) setInternal(next)\n onCollapsedChange?.(next)\n }\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader =\n title != null || subtitle != null || renderedIcon != null || actions != null || collapsible\n const hasBody = children != null && children !== ''\n const hasFooter = footer != null || footerStart != null\n const hasCollapsibleContent = hasBody || hasFooter\n // The header is separated by a divider only while content is visible beneath it.\n const headerDivided = hasCollapsibleContent && !isCollapsed\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, flat && styles.flat, isCollapsed && styles.collapsed, className)}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || subtitle != null) && (\n <div className={styles.headerText}>\n {title != null && <div className={styles.title}>{title}</div>}\n {subtitle != null && <div className={styles.subtitle}>{subtitle}</div>}\n </div>\n )}\n </div>\n {(actions != null || collapsible) && (\n <div className={styles.actions}>\n {!isCollapsed && actions}\n {collapsible && (\n <IconButton\n variant=\"text\"\n size=\"sm\"\n aria-label={isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={!isCollapsed}\n aria-controls={collapsibleId}\n onClick={toggle}\n >\n <Icon\n name=\"ArrowUp3\"\n className={styles.chevron}\n data-collapsed={isCollapsed ? 'true' : 'false'}\n />\n </IconButton>\n )}\n </div>\n )}\n </div>\n )}\n {hasCollapsibleContent && (\n <div\n id={collapsibleId}\n className={clsx(styles.collapsible, collapsible && styles.foldable)}\n >\n <div className={styles.collapsibleInner}>\n {hasBody && <div className={styles.body}>{children}</div>}\n {hasFooter && (\n <div className={styles.footer}>\n <div className={styles.footerStart}>{footerStart}</div>\n <div className={styles.footerEnd}>{footer}</div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Card","forwardRef","title","subtitle","icon","color","flat","actions","footer","footerStart","collapsible","collapsed","defaultCollapsed","onCollapsedChange","className","children","props","ref","isControlled","internal","setInternal","useState","isCollapsed","collapsibleId","useId","toggle","next","renderedIcon","jsx","Icon","hasHeader","hasB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IAAC,MAAA,CAAI,UAAWS,EAAO,UAAY,SAAA7B,CAAA,CAAO,CAAA,CAAA,CAC5C,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,CAIR,CAAC"}
1
+ {"version":3,"file":"Card-DD9SWHzZ.cjs","sources":["../src/components/Card/Card.tsx"],"sourcesContent":["import { forwardRef, useId, useState, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport type { ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './Card.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Header title (left, next to the icon). */\n title?: ReactNode\n /** Secondary muted line shown under the `title` (e.g. a short description). */\n subtitle?: ReactNode\n /** Leading header icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the card flat (used by `PageLayout`). Cards are shadowless, so this currently adds no visual difference — it's a styling hook, not a distinct look. */\n flat?: boolean\n /** Header actions, placed at the end of the header row (before the collapse toggle). */\n actions?: ReactNode\n /** Footer content (e.g. actions), pinned to the **right** of the footer row. */\n footer?: ReactNode\n /** Footer content pinned to the **left** of the footer row (opposite `footer`). */\n footerStart?: ReactNode\n /** Adds a collapse/expand toggle to the header that folds the body + footer. */\n collapsible?: boolean\n /** Controlled collapsed state. */\n collapsed?: boolean\n /** Initial collapsed state for uncontrolled use. Defaults to `false`. */\n defaultCollapsed?: boolean\n /** Fires with the next collapsed state when the toggle is clicked. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Card body. */\n children?: ReactNode\n}\n\n/**\n * A surface card with an optional header (icon + title + actions), a body, and a footer for actions.\n * `collapsible` adds a chevron that smoothly folds the body + footer (controlled via `collapsed`/\n * `onCollapsedChange`, or uncontrolled via `defaultCollapsed`). Token-only styling.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n {\n title,\n subtitle,\n icon,\n color = 'accent',\n flat = false,\n actions,\n footer,\n footerStart,\n collapsible = false,\n collapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n className,\n children,\n ...props\n },\n ref,\n) {\n const isControlled = collapsed !== undefined\n const [internal, setInternal] = useState(defaultCollapsed)\n const isCollapsed = collapsible && (isControlled ? collapsed! : internal)\n const collapsibleId = useId() // ties the toggle to the fold region via aria-controls\n\n const toggle = () => {\n const next = !isCollapsed\n if (!isControlled) setInternal(next)\n onCollapsedChange?.(next)\n }\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader =\n title != null || subtitle != null || renderedIcon != null || actions != null || collapsible\n const hasBody = children != null && children !== ''\n const hasFooter = footer != null || footerStart != null\n const hasCollapsibleContent = hasBody || hasFooter\n // The header is separated by a divider only while content is visible beneath it.\n const headerDivided = hasCollapsibleContent && !isCollapsed\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, flat && styles.flat, isCollapsed && styles.collapsed, className)}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || subtitle != null) && (\n <div className={styles.headerText}>\n {title != null && <div className={styles.title}>{title}</div>}\n {subtitle != null && <div className={styles.subtitle}>{subtitle}</div>}\n </div>\n )}\n </div>\n {(actions != null || collapsible) && (\n <div className={styles.actions}>\n {!isCollapsed && actions}\n {collapsible && (\n <IconButton\n variant=\"text\"\n size=\"sm\"\n aria-label={isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={!isCollapsed}\n aria-controls={collapsibleId}\n onClick={toggle}\n >\n <Icon\n name=\"ArrowUp3\"\n className={styles.chevron}\n data-collapsed={isCollapsed ? 'true' : 'false'}\n />\n </IconButton>\n )}\n </div>\n )}\n </div>\n )}\n {hasCollapsibleContent && (\n <div\n id={collapsibleId}\n className={clsx(styles.collapsible, collapsible && styles.foldable)}\n >\n <div className={styles.collapsibleInner}>\n {hasBody && <div className={styles.body}>{children}</div>}\n {hasFooter && (\n <div className={styles.footer}>\n <div className={styles.footerStart}>{footerStart}</div>\n <div className={styles.footerEnd}>{footer}</div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Card","forwardRef","title","subtitle","icon","color","flat","actions","footer","footerStart","collapsible","collapsed","defaultCollapsed","onCollapsedChange","className","children","props","ref","isControlled","internal","setInternal","useState","isCollapsed","collapsibleId","useId","toggle","next","renderedIcon","jsx","Icon","hasHeader","hasBody","hasFooter","hasCollapsibleContent","headerDivided","jsxs","clsx","styles","IconButton"],"mappings":"k1BAQMA,GAAgB,IAAI,IAAYC,YAAU,EAoCnCC,GAAOC,EAAAA,WAAsC,SACxD,CACE,MAAAC,EACA,SAAAC,EACA,KAAAC,EACA,MAAAC,EAAQ,SACR,KAAAC,EAAO,GACP,QAAAC,EACA,OAAAC,EACA,YAAAC,EACA,YAAAC,EAAc,GACd,UAAAC,EACA,iBAAAC,EAAmB,GACnB,kBAAAC,EACA,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAeP,IAAc,OAC7B,CAACQ,EAAUC,CAAW,EAAIC,EAAAA,SAAST,CAAgB,EACnDU,EAAcZ,IAAgBQ,EAAeP,EAAaQ,GAC1DI,EAAgBC,EAAAA,MAAA,EAEhBC,EAAS,IAAM,CACnB,MAAMC,EAAO,CAACJ,EACTJ,GAAcE,EAAYM,CAAI,EACnCb,GAAA,MAAAA,EAAoBa,EACtB,EAEMC,EACJvB,GAAQ,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,WACrC,gBAAe,CAACA,EAChB,gBAAeC,EACf,QAASE,EAET,SAAAG,EAAAA,IAACC,EAAAA,KAAA,CACC,KAAK,WACL,UAAWQ,EAAO,QAClB,iBAAgBf,EAAc,OAAS,OAAA,CAAA,CACzC,CAAA,CACF,CAAA,CAEJ,CAAA,EAEJ,EAEDW,GACCL,EAAAA,IAAC,MAAA,CACC,GAAIL,EACJ,UAAWa,EAAAA,KAAKC,EAAO,YAAa3B,GAAe2B,EAAO,QAAQ,EAElE,SAAAF,EAAAA,KAAC,MAAA,CAAI,UAAWE,EAAO,iBACpB,SAAA,CAAAN,GAAWH,EAAAA,IAAC,MAAA,CAAI,UAAWS,EAAO,KAAO,SAAAtB,EAAS,EAClDiB,GACCG,EAAAA,KAAC,MAAA,CAAI,UAAWE,EAAO,OACrB,SAAA,CAAAT,EAAAA,IAAC,MAAA,CAAI,UAAWS,EAAO,YAAc,SAAA5B,EAAY,EACjDmB,EAAAA,IAAC,MAAA,CAAI,UAAWS,EAAO,UAAY,SAAA7B,CAAA,CAAO,CAAA,CAAA,CAC5C,CAAA,CAAA,CAEJ,CAAA,CAAA,CACF,CAAA,CAAA,CAIR,CAAC"}
@@ -3,7 +3,7 @@ import { forwardRef as B, useState as O, useId as F } from "react";
3
3
  import { clsx as v } from "clsx";
4
4
  import { I as x } from "./Icon-CophpkHo.js";
5
5
  import { a as H } from "./names-D8ABK2Wk.js";
6
- import { I as E } from "./IconButton-BZ2jJn_T.js";
6
+ import { I as E } from "./IconButton-B8FPGgDn.js";
7
7
  const R = "_card_voi4g_3", U = "_flat_voi4g_14", q = "_header_voi4g_18", G = "_headerDivided_voi4g_27", J = "_headerMain_voi4g_31", K = "_icon_voi4g_39", L = "_headerText_voi4g_43", P = "_title_voi4g_51", Q = "_subtitle_voi4g_64", V = "_actions_voi4g_78", W = "_chevron_voi4g_85", X = "_collapsible_voi4g_93", Y = "_collapsed_voi4g_98", Z = "_collapsibleInner_voi4g_101", $ = "_foldable_voi4g_110", ee = "_body_voi4g_114", oe = "_footer_voi4g_118", ae = "_footerStart_voi4g_127", le = "_footerEnd_voi4g_128", e = {
8
8
  card: R,
9
9
  flat: U,
@@ -115,4 +115,4 @@ const R = "_card_voi4g_3", U = "_flat_voi4g_14", q = "_header_voi4g_18", G = "_h
115
115
  export {
116
116
  ve as C
117
117
  };
118
- //# sourceMappingURL=Card-DHPAefzg.js.map
118
+ //# sourceMappingURL=Card-DhpudGvF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card-DHPAefzg.js","sources":["../src/components/Card/Card.tsx"],"sourcesContent":["import { forwardRef, useId, useState, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport type { ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './Card.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Header title (left, next to the icon). */\n title?: ReactNode\n /** Secondary muted line shown under the `title` (e.g. a short description). */\n subtitle?: ReactNode\n /** Leading header icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the card flat (used by `PageLayout`). Cards are shadowless, so this currently adds no visual difference — it's a styling hook, not a distinct look. */\n flat?: boolean\n /** Header actions, placed at the end of the header row (before the collapse toggle). */\n actions?: ReactNode\n /** Footer content (e.g. actions), pinned to the **right** of the footer row. */\n footer?: ReactNode\n /** Footer content pinned to the **left** of the footer row (opposite `footer`). */\n footerStart?: ReactNode\n /** Adds a collapse/expand toggle to the header that folds the body + footer. */\n collapsible?: boolean\n /** Controlled collapsed state. */\n collapsed?: boolean\n /** Initial collapsed state for uncontrolled use. Defaults to `false`. */\n defaultCollapsed?: boolean\n /** Fires with the next collapsed state when the toggle is clicked. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Card body. */\n children?: ReactNode\n}\n\n/**\n * A surface card with an optional header (icon + title + actions), a body, and a footer for actions.\n * `collapsible` adds a chevron that smoothly folds the body + footer (controlled via `collapsed`/\n * `onCollapsedChange`, or uncontrolled via `defaultCollapsed`). Token-only styling.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n {\n title,\n subtitle,\n icon,\n color = 'accent',\n flat = false,\n actions,\n footer,\n footerStart,\n collapsible = false,\n collapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n className,\n children,\n ...props\n },\n ref,\n) {\n const isControlled = collapsed !== undefined\n const [internal, setInternal] = useState(defaultCollapsed)\n const isCollapsed = collapsible && (isControlled ? collapsed! : internal)\n const collapsibleId = useId() // ties the toggle to the fold region via aria-controls\n\n const toggle = () => {\n const next = !isCollapsed\n if (!isControlled) setInternal(next)\n onCollapsedChange?.(next)\n }\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader =\n title != null || subtitle != null || renderedIcon != null || actions != null || collapsible\n const hasBody = children != null && children !== ''\n const hasFooter = footer != null || footerStart != null\n const hasCollapsibleContent = hasBody || hasFooter\n // The header is separated by a divider only while content is visible beneath it.\n const headerDivided = hasCollapsibleContent && !isCollapsed\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, flat && styles.flat, isCollapsed && styles.collapsed, className)}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || subtitle != null) && (\n <div className={styles.headerText}>\n {title != null && <div className={styles.title}>{title}</div>}\n {subtitle != null && <div className={styles.subtitle}>{subtitle}</div>}\n </div>\n )}\n </div>\n {(actions != null || collapsible) && (\n <div className={styles.actions}>\n {!isCollapsed && actions}\n {collapsible && (\n <IconButton\n variant=\"text\"\n size=\"sm\"\n aria-label={isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={!isCollapsed}\n aria-controls={collapsibleId}\n onClick={toggle}\n >\n <Icon\n name=\"ArrowUp3\"\n className={styles.chevron}\n data-collapsed={isCollapsed ? 'true' : 'false'}\n />\n </IconButton>\n )}\n </div>\n )}\n </div>\n )}\n {hasCollapsibleContent && (\n <div\n id={collapsibleId}\n className={clsx(styles.collapsible, collapsible && styles.foldable)}\n >\n <div className={styles.collapsibleInner}>\n {hasBody && <div className={styles.body}>{children}</div>}\n {hasFooter && (\n <div className={styles.footer}>\n <div className={styles.footerStart}>{footerStart}</div>\n <div className={styles.footerEnd}>{footer}</div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Card","forwardRef","title","subtitle","icon","color","flat","actions","footer","footerStart","collapsible","collapsed","defaultCollapsed","onCollapsedChange","className","children","props","ref","isControlled","internal","setInternal","useState","isCollapsed","collapsibleId","useId","toggle","next","renderedIcon","jsx","Icon","hasHeader","hasBody","hasFooter","hasCollapsibleContent","headerDivided","jsxs","clsx","styles","IconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;GAQMA,KAAgB,IAAI,IAAYC,CAAU,GAoCnCC,KAAOC,EAAsC,SACxD;AAAA,EACE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAeP,MAAc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O;AAAA,cAAA,EAAA,CAC5C;AAAA,YAAA,EAAA,CAEJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"Card-DhpudGvF.js","sources":["../src/components/Card/Card.tsx"],"sourcesContent":["import { forwardRef, useId, useState, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport type { ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport styles from './Card.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Header title (left, next to the icon). */\n title?: ReactNode\n /** Secondary muted line shown under the `title` (e.g. a short description). */\n subtitle?: ReactNode\n /** Leading header icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the card flat (used by `PageLayout`). Cards are shadowless, so this currently adds no visual difference — it's a styling hook, not a distinct look. */\n flat?: boolean\n /** Header actions, placed at the end of the header row (before the collapse toggle). */\n actions?: ReactNode\n /** Footer content (e.g. actions), pinned to the **right** of the footer row. */\n footer?: ReactNode\n /** Footer content pinned to the **left** of the footer row (opposite `footer`). */\n footerStart?: ReactNode\n /** Adds a collapse/expand toggle to the header that folds the body + footer. */\n collapsible?: boolean\n /** Controlled collapsed state. */\n collapsed?: boolean\n /** Initial collapsed state for uncontrolled use. Defaults to `false`. */\n defaultCollapsed?: boolean\n /** Fires with the next collapsed state when the toggle is clicked. */\n onCollapsedChange?: (collapsed: boolean) => void\n /** Card body. */\n children?: ReactNode\n}\n\n/**\n * A surface card with an optional header (icon + title + actions), a body, and a footer for actions.\n * `collapsible` adds a chevron that smoothly folds the body + footer (controlled via `collapsed`/\n * `onCollapsedChange`, or uncontrolled via `defaultCollapsed`). Token-only styling.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n {\n title,\n subtitle,\n icon,\n color = 'accent',\n flat = false,\n actions,\n footer,\n footerStart,\n collapsible = false,\n collapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n className,\n children,\n ...props\n },\n ref,\n) {\n const isControlled = collapsed !== undefined\n const [internal, setInternal] = useState(defaultCollapsed)\n const isCollapsed = collapsible && (isControlled ? collapsed! : internal)\n const collapsibleId = useId() // ties the toggle to the fold region via aria-controls\n\n const toggle = () => {\n const next = !isCollapsed\n if (!isControlled) setInternal(next)\n onCollapsedChange?.(next)\n }\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader =\n title != null || subtitle != null || renderedIcon != null || actions != null || collapsible\n const hasBody = children != null && children !== ''\n const hasFooter = footer != null || footerStart != null\n const hasCollapsibleContent = hasBody || hasFooter\n // The header is separated by a divider only while content is visible beneath it.\n const headerDivided = hasCollapsibleContent && !isCollapsed\n\n return (\n <div\n ref={ref}\n className={clsx(styles.card, flat && styles.flat, isCollapsed && styles.collapsed, className)}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || subtitle != null) && (\n <div className={styles.headerText}>\n {title != null && <div className={styles.title}>{title}</div>}\n {subtitle != null && <div className={styles.subtitle}>{subtitle}</div>}\n </div>\n )}\n </div>\n {(actions != null || collapsible) && (\n <div className={styles.actions}>\n {!isCollapsed && actions}\n {collapsible && (\n <IconButton\n variant=\"text\"\n size=\"sm\"\n aria-label={isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={!isCollapsed}\n aria-controls={collapsibleId}\n onClick={toggle}\n >\n <Icon\n name=\"ArrowUp3\"\n className={styles.chevron}\n data-collapsed={isCollapsed ? 'true' : 'false'}\n />\n </IconButton>\n )}\n </div>\n )}\n </div>\n )}\n {hasCollapsibleContent && (\n <div\n id={collapsibleId}\n className={clsx(styles.collapsible, collapsible && styles.foldable)}\n >\n <div className={styles.collapsibleInner}>\n {hasBody && <div className={styles.body}>{children}</div>}\n {hasFooter && (\n <div className={styles.footer}>\n <div className={styles.footerStart}>{footerStart}</div>\n <div className={styles.footerEnd}>{footer}</div>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Card","forwardRef","title","subtitle","icon","color","flat","actions","footer","footerStart","collapsible","collapsed","defaultCollapsed","onCollapsedChange","className","children","props","ref","isControlled","internal","setInternal","useState","isCollapsed","collapsibleId","useId","toggle","next","renderedIcon","jsx","Icon","hasHeader","hasBody","hasFooter","hasCollapsibleContent","headerDivided","jsxs","clsx","styles","IconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;GAQMA,KAAgB,IAAI,IAAYC,CAAU,GAoCnCC,KAAOC,EAAsC,SACxD;AAAA,EACE,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,WAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAeP,MAAc,QAC7B,CAACQ,GAAUC,CAAW,IAAIC,EAAST,CAAgB,GACnDU,IAAcZ,MAAgBQ,IAAeP,IAAaQ,IAC1DI,IAAgBC,EAAA,GAEhBC,IAAS,MAAM;AACnB,UAAMC,IAAO,CAACJ;AACd,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jsx-runtime"),w=require("react"),C=require("clsx"),I=require("./Icon-CXTl_QAP.cjs"),q=require("./ConfigProvider-DFy6pL-C.cjs"),A="_chip_1yjgf_3",B="_sm_1yjgf_20",N="_md_1yjgf_25",z="_lg_1yjgf_30",P="_contained_1yjgf_37",R="_filled_1yjgf_42",T="_outlined_1yjgf_46",$="_text_1yjgf_51",E="_clickable_1yjgf_57",M="_disabled_1yjgf_82",D="_startIcon_1yjgf_89",F="_avatar_1yjgf_95",G="_withAvatar_1yjgf_102",H="_withDelete_1yjgf_106",J="_deleteBtn_1yjgf_127",t={chip:A,sm:B,md:N,lg:z,contained:P,filled:R,outlined:T,text:$,clickable:E,disabled:M,startIcon:D,avatar:F,withAvatar:G,withDelete:H,deleteBtn:J},L=w.forwardRef(function({variant:f="filled",color:r="primary",size:_="md",clickable:u=!1,disabled:n=!1,startIcon:d,avatar:l,onDelete:s,deleteIcon:g,deleteLabel:j,deleteTabIndex:h,className:y,style:m,children:i,onKeyDown:o,...p},b){const x=q.useT(),a=u&&!n,v=e=>{e.stopPropagation(),n||s==null||s()},k=e=>{a&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.currentTarget.click()),o==null||o(e)};return c.jsxs("div",{ref:b,className:C.clsx(t.chip,t[f],t[_],a&&t.clickable,n&&t.disabled,l&&t.withAvatar,s&&t.withDelete,y),style:{"--tz-btn-rgb":`var(--tz-color-${r}-rgb)`,"--tz-btn-on":`var(--tz-color-${r}-contrast, #fff)`,...m},role:a?"button":void 0,tabIndex:a?0:void 0,"aria-disabled":n||void 0,onKeyDown:k,...p,children:[l?c.jsx("span",{className:t.avatar,children:l}):d?c.jsx("span",{className:t.startIcon,children:d}):null,i!=null&&i!==""?c.jsx("span",{children:i}):null,s?c.jsx("button",{type:"button",className:t.deleteBtn,onClick:v,onMouseDown:e=>e.preventDefault(),"aria-label":j??x("common.remove"),tabIndex:h,disabled:n,children:g??c.jsx(I.Icon,{name:"CloseCircle",size:_})}):null]})});exports.Chip=L;
2
- //# sourceMappingURL=Chip-BoHt3WYS.cjs.map
1
+ "use strict";const c=require("react/jsx-runtime"),w=require("react"),C=require("clsx"),I=require("./Icon-CXTl_QAP.cjs"),q=require("./ConfigProvider-BHNx-NHV.cjs"),A="_chip_1yjgf_3",B="_sm_1yjgf_20",N="_md_1yjgf_25",z="_lg_1yjgf_30",P="_contained_1yjgf_37",R="_filled_1yjgf_42",T="_outlined_1yjgf_46",$="_text_1yjgf_51",E="_clickable_1yjgf_57",M="_disabled_1yjgf_82",D="_startIcon_1yjgf_89",F="_avatar_1yjgf_95",G="_withAvatar_1yjgf_102",H="_withDelete_1yjgf_106",J="_deleteBtn_1yjgf_127",t={chip:A,sm:B,md:N,lg:z,contained:P,filled:R,outlined:T,text:$,clickable:E,disabled:M,startIcon:D,avatar:F,withAvatar:G,withDelete:H,deleteBtn:J},L=w.forwardRef(function({variant:f="filled",color:r="primary",size:_="md",clickable:u=!1,disabled:n=!1,startIcon:d,avatar:l,onDelete:s,deleteIcon:g,deleteLabel:j,deleteTabIndex:h,className:y,style:m,children:i,onKeyDown:o,...p},b){const x=q.useT(),a=u&&!n,v=e=>{e.stopPropagation(),n||s==null||s()},k=e=>{a&&(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.currentTarget.click()),o==null||o(e)};return c.jsxs("div",{ref:b,className:C.clsx(t.chip,t[f],t[_],a&&t.clickable,n&&t.disabled,l&&t.withAvatar,s&&t.withDelete,y),style:{"--tz-btn-rgb":`var(--tz-color-${r}-rgb)`,"--tz-btn-on":`var(--tz-color-${r}-contrast, #fff)`,...m},role:a?"button":void 0,tabIndex:a?0:void 0,"aria-disabled":n||void 0,onKeyDown:k,...p,children:[l?c.jsx("span",{className:t.avatar,children:l}):d?c.jsx("span",{className:t.startIcon,children:d}):null,i!=null&&i!==""?c.jsx("span",{children:i}):null,s?c.jsx("button",{type:"button",className:t.deleteBtn,onClick:v,onMouseDown:e=>e.preventDefault(),"aria-label":j??x("common.remove"),tabIndex:h,disabled:n,children:g??c.jsx(I.Icon,{name:"CloseCircle",size:_})}):null]})});exports.Chip=L;
2
+ //# sourceMappingURL=Chip-B2lY4TJ0.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip-BoHt3WYS.cjs","sources":["../src/components/Chip/Chip.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport styles from './Chip.module.css'\n\nexport type ChipVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ChipSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Visual style. Defaults to `filled` (a soft tinted chip). */\n variant?: ChipVariant\n /** Theme palette token that tints the chip. Defaults to `primary`. */\n color?: ThemeColor\n /** Preset size — height + font. Defaults to `md`. */\n size?: ChipSize\n /** Makes the chip interactive (hover, pointer, keyboard, `onClick`). Off by default (a static tag). */\n clickable?: boolean\n /** Dims the chip and disables all interaction. */\n disabled?: boolean\n /** Leading icon (e.g. an `<Icon />`). Ignored when `avatar` is set. */\n startIcon?: ReactNode\n /** Leading avatar (e.g. an `<Avatar />`), sized to the chip and flush to the left. */\n avatar?: ReactNode\n /** When provided, shows a trailing delete button that calls this (its click won't trigger `onClick`). */\n onDelete?: () => void\n /** Custom delete icon. Defaults to a `CloseCircle`. */\n deleteIcon?: ReactNode\n /** Accessible label for the delete button. Defaults to `\"Remove\"`. */\n deleteLabel?: string\n /** Tab index for the delete button — pass `-1` when the chip lives inside a composite widget (e.g. a multi-select) that owns keyboard focus. */\n deleteTabIndex?: number\n /** Chip label. */\n children?: ReactNode\n}\n\n/**\n * A compact tag/token. Static by default; `clickable` makes it an interactive `role=\"button\"`\n * (hover + Enter/Space). Supports a leading `startIcon` or `avatar` and a trailing delete button via\n * `onDelete`. Tinted by `color` through the shared `--tz-btn-rgb` / `--tz-btn-on` pattern across the\n * four standard variants. Token-only styling.\n */\nexport const Chip = forwardRef<HTMLDivElement, ChipProps>(function Chip(\n {\n variant = 'filled',\n color = 'primary',\n size = 'md',\n clickable = false,\n disabled = false,\n startIcon,\n avatar,\n onDelete,\n deleteIcon,\n deleteLabel,\n deleteTabIndex,\n className,\n style,\n children,\n onKeyDown,\n ...props\n },\n ref,\n) {\n const t = useT()\n const interactive = clickable && !disabled\n\n const handleDelete = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (!disabled) onDelete?.()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (interactive && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n event.currentTarget.click()\n }\n onKeyDown?.(event)\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.chip,\n styles[variant],\n styles[size],\n interactive && styles.clickable,\n disabled && styles.disabled,\n avatar && styles.withAvatar,\n onDelete && styles.withDelete,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n role={interactive ? 'button' : undefined}\n tabIndex={interactive ? 0 : undefined}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {avatar ? (\n <span className={styles.avatar}>{avatar}</span>\n ) : startIcon ? (\n <span className={styles.startIcon}>{startIcon}</span>\n ) : null}\n {children != null && children !== '' ? <span>{children}</span> : null}\n {onDelete ? (\n <button\n type=\"button\"\n className={styles.deleteBtn}\n onClick={handleDelete}\n onMouseDown={(event) => event.preventDefault()}\n aria-label={deleteLabel ?? t('common.remove')}\n tabIndex={deleteTabIndex}\n disabled={disabled}\n >\n {deleteIcon ?? <Icon name=\"CloseCircle\" size={size} />}\n </button>\n ) : null}\n </div>\n )\n})\n"],"names":["Chip","forwardRef","variant","color","size","clickable","disabled","startIcon","avatar","onDelete","deleteIcon","deleteLabel","deleteTabIndex","className","style","children","onKeyDown","props","ref","t","useT","interactive","handleDelete","event","handleKeyDown","jsxs","clsx","styles","jsx","Icon"],"mappings":"2nBAiDaA,EAAOC,EAAAA,WAAsC,SACxD,CACE,QAAAC,EAAU,SACV,MAAAC,EAAQ,UACR,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,UAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,eAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAchB,GAAa,CAACC,EAE5BgB,EAAgBC,GAAyC,CAC7DA,EAAM,gBAAA,EACDjB,GAAUG,GAAA,MAAAA,GACjB,EAEMe,EAAiBD,GAAyC,CAC1DF,IAAgBE,EAAM,MAAQ,SAAWA,EAAM,MAAQ,OACzDA,EAAM,eAAA,EACNA,EAAM,cAAc,MAAA,GAEtBP,GAAA,MAAAA,EAAYO,EACd,EAEA,OACEE,EAAAA,KAAC,MAAA,CACC,IAAAP,EACA,UAAWQ,EAAAA,KACTC,EAAO,KACPA,EAAOzB,CAAO,EACdyB,EAAOvB,CAAI,EACXiB,GAAeM,EAAO,UACtBrB,GAAYqB,EAAO,SACnBnB,GAAUmB,EAAO,WACjBlB,GAAYkB,EAAO,WACnBd,CAAA,EAEF,MACE,CACE,eAAgB,kBAAkBV,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGW,CAAA,EAGP,KAAMO,EAAc,SAAW,OAC/B,SAAUA,EAAc,EAAI,OAC5B,gBAAef,GAAY,OAC3B,UAAWkB,EACV,GAAGP,EAEH,SAAA,CAAAT,EACCoB,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAO,OAAS,SAAAnB,EAAO,EACtCD,EACFqB,MAAC,OAAA,CAAK,UAAWD,EAAO,UAAY,WAAU,EAC5C,KACHZ,GAAY,MAAQA,IAAa,GAAKa,EAAAA,IAAC,OAAA,CAAM,SAAAb,EAAS,EAAU,KAChEN,EACCmB,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWD,EAAO,UAClB,QAASL,EACT,YAAcC,GAAUA,EAAM,eAAA,EAC9B,aAAYZ,GAAeQ,EAAE,eAAe,EAC5C,SAAUP,EACV,SAAAN,EAEC,SAAAI,GAAckB,MAACC,EAAAA,KAAA,CAAK,KAAK,cAAc,KAAAzB,CAAA,CAAY,CAAA,CAAA,EAEpD,IAAA,CAAA,CAAA,CAGV,CAAC"}
1
+ {"version":3,"file":"Chip-B2lY4TJ0.cjs","sources":["../src/components/Chip/Chip.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport styles from './Chip.module.css'\n\nexport type ChipVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ChipSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Visual style. Defaults to `filled` (a soft tinted chip). */\n variant?: ChipVariant\n /** Theme palette token that tints the chip. Defaults to `primary`. */\n color?: ThemeColor\n /** Preset size — height + font. Defaults to `md`. */\n size?: ChipSize\n /** Makes the chip interactive (hover, pointer, keyboard, `onClick`). Off by default (a static tag). */\n clickable?: boolean\n /** Dims the chip and disables all interaction. */\n disabled?: boolean\n /** Leading icon (e.g. an `<Icon />`). Ignored when `avatar` is set. */\n startIcon?: ReactNode\n /** Leading avatar (e.g. an `<Avatar />`), sized to the chip and flush to the left. */\n avatar?: ReactNode\n /** When provided, shows a trailing delete button that calls this (its click won't trigger `onClick`). */\n onDelete?: () => void\n /** Custom delete icon. Defaults to a `CloseCircle`. */\n deleteIcon?: ReactNode\n /** Accessible label for the delete button. Defaults to `\"Remove\"`. */\n deleteLabel?: string\n /** Tab index for the delete button — pass `-1` when the chip lives inside a composite widget (e.g. a multi-select) that owns keyboard focus. */\n deleteTabIndex?: number\n /** Chip label. */\n children?: ReactNode\n}\n\n/**\n * A compact tag/token. Static by default; `clickable` makes it an interactive `role=\"button\"`\n * (hover + Enter/Space). Supports a leading `startIcon` or `avatar` and a trailing delete button via\n * `onDelete`. Tinted by `color` through the shared `--tz-btn-rgb` / `--tz-btn-on` pattern across the\n * four standard variants. Token-only styling.\n */\nexport const Chip = forwardRef<HTMLDivElement, ChipProps>(function Chip(\n {\n variant = 'filled',\n color = 'primary',\n size = 'md',\n clickable = false,\n disabled = false,\n startIcon,\n avatar,\n onDelete,\n deleteIcon,\n deleteLabel,\n deleteTabIndex,\n className,\n style,\n children,\n onKeyDown,\n ...props\n },\n ref,\n) {\n const t = useT()\n const interactive = clickable && !disabled\n\n const handleDelete = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (!disabled) onDelete?.()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (interactive && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n event.currentTarget.click()\n }\n onKeyDown?.(event)\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.chip,\n styles[variant],\n styles[size],\n interactive && styles.clickable,\n disabled && styles.disabled,\n avatar && styles.withAvatar,\n onDelete && styles.withDelete,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n role={interactive ? 'button' : undefined}\n tabIndex={interactive ? 0 : undefined}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {avatar ? (\n <span className={styles.avatar}>{avatar}</span>\n ) : startIcon ? (\n <span className={styles.startIcon}>{startIcon}</span>\n ) : null}\n {children != null && children !== '' ? <span>{children}</span> : null}\n {onDelete ? (\n <button\n type=\"button\"\n className={styles.deleteBtn}\n onClick={handleDelete}\n onMouseDown={(event) => event.preventDefault()}\n aria-label={deleteLabel ?? t('common.remove')}\n tabIndex={deleteTabIndex}\n disabled={disabled}\n >\n {deleteIcon ?? <Icon name=\"CloseCircle\" size={size} />}\n </button>\n ) : null}\n </div>\n )\n})\n"],"names":["Chip","forwardRef","variant","color","size","clickable","disabled","startIcon","avatar","onDelete","deleteIcon","deleteLabel","deleteTabIndex","className","style","children","onKeyDown","props","ref","t","useT","interactive","handleDelete","event","handleKeyDown","jsxs","clsx","styles","jsx","Icon"],"mappings":"2nBAiDaA,EAAOC,EAAAA,WAAsC,SACxD,CACE,QAAAC,EAAU,SACV,MAAAC,EAAQ,UACR,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,UAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,EACA,eAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAchB,GAAa,CAACC,EAE5BgB,EAAgBC,GAAyC,CAC7DA,EAAM,gBAAA,EACDjB,GAAUG,GAAA,MAAAA,GACjB,EAEMe,EAAiBD,GAAyC,CAC1DF,IAAgBE,EAAM,MAAQ,SAAWA,EAAM,MAAQ,OACzDA,EAAM,eAAA,EACNA,EAAM,cAAc,MAAA,GAEtBP,GAAA,MAAAA,EAAYO,EACd,EAEA,OACEE,EAAAA,KAAC,MAAA,CACC,IAAAP,EACA,UAAWQ,EAAAA,KACTC,EAAO,KACPA,EAAOzB,CAAO,EACdyB,EAAOvB,CAAI,EACXiB,GAAeM,EAAO,UACtBrB,GAAYqB,EAAO,SACnBnB,GAAUmB,EAAO,WACjBlB,GAAYkB,EAAO,WACnBd,CAAA,EAEF,MACE,CACE,eAAgB,kBAAkBV,CAAK,QACvC,cAAe,kBAAkBA,CAAK,mBACtC,GAAGW,CAAA,EAGP,KAAMO,EAAc,SAAW,OAC/B,SAAUA,EAAc,EAAI,OAC5B,gBAAef,GAAY,OAC3B,UAAWkB,EACV,GAAGP,EAEH,SAAA,CAAAT,EACCoB,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAO,OAAS,SAAAnB,EAAO,EACtCD,EACFqB,MAAC,OAAA,CAAK,UAAWD,EAAO,UAAY,WAAU,EAC5C,KACHZ,GAAY,MAAQA,IAAa,GAAKa,EAAAA,IAAC,OAAA,CAAM,SAAAb,EAAS,EAAU,KAChEN,EACCmB,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWD,EAAO,UAClB,QAASL,EACT,YAAcC,GAAUA,EAAM,eAAA,EAC9B,aAAYZ,GAAeQ,EAAE,eAAe,EAC5C,SAAUP,EACV,SAAAN,EAEC,SAAAI,GAAckB,MAACC,EAAAA,KAAA,CAAK,KAAK,cAAc,KAAAzB,CAAA,CAAY,CAAA,CAAA,EAEpD,IAAA,CAAA,CAAA,CAGV,CAAC"}
@@ -2,7 +2,7 @@ import { jsxs as w, jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as I } from "react";
3
3
  import { clsx as C } from "clsx";
4
4
  import { I as A } from "./Icon-CophpkHo.js";
5
- import { a as B } from "./ConfigProvider-sEZzNTeU.js";
5
+ import { a as B } from "./ConfigProvider-BYruQYHC.js";
6
6
  const N = "_chip_1yjgf_3", z = "_sm_1yjgf_20", T = "_md_1yjgf_25", $ = "_lg_1yjgf_30", E = "_contained_1yjgf_37", M = "_filled_1yjgf_42", P = "_outlined_1yjgf_46", R = "_text_1yjgf_51", q = "_clickable_1yjgf_57", D = "_disabled_1yjgf_82", F = "_startIcon_1yjgf_89", G = "_avatar_1yjgf_95", H = "_withAvatar_1yjgf_102", J = "_withDelete_1yjgf_106", L = "_deleteBtn_1yjgf_127", t = {
7
7
  chip: N,
8
8
  sm: z,
@@ -89,4 +89,4 @@ const N = "_chip_1yjgf_3", z = "_sm_1yjgf_20", T = "_md_1yjgf_25", $ = "_lg_1yjg
89
89
  export {
90
90
  X as C
91
91
  };
92
- //# sourceMappingURL=Chip-DX3QECcs.js.map
92
+ //# sourceMappingURL=Chip-DulHqhuf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip-DX3QECcs.js","sources":["../src/components/Chip/Chip.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport styles from './Chip.module.css'\n\nexport type ChipVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ChipSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Visual style. Defaults to `filled` (a soft tinted chip). */\n variant?: ChipVariant\n /** Theme palette token that tints the chip. Defaults to `primary`. */\n color?: ThemeColor\n /** Preset size — height + font. Defaults to `md`. */\n size?: ChipSize\n /** Makes the chip interactive (hover, pointer, keyboard, `onClick`). Off by default (a static tag). */\n clickable?: boolean\n /** Dims the chip and disables all interaction. */\n disabled?: boolean\n /** Leading icon (e.g. an `<Icon />`). Ignored when `avatar` is set. */\n startIcon?: ReactNode\n /** Leading avatar (e.g. an `<Avatar />`), sized to the chip and flush to the left. */\n avatar?: ReactNode\n /** When provided, shows a trailing delete button that calls this (its click won't trigger `onClick`). */\n onDelete?: () => void\n /** Custom delete icon. Defaults to a `CloseCircle`. */\n deleteIcon?: ReactNode\n /** Accessible label for the delete button. Defaults to `\"Remove\"`. */\n deleteLabel?: string\n /** Tab index for the delete button — pass `-1` when the chip lives inside a composite widget (e.g. a multi-select) that owns keyboard focus. */\n deleteTabIndex?: number\n /** Chip label. */\n children?: ReactNode\n}\n\n/**\n * A compact tag/token. Static by default; `clickable` makes it an interactive `role=\"button\"`\n * (hover + Enter/Space). Supports a leading `startIcon` or `avatar` and a trailing delete button via\n * `onDelete`. Tinted by `color` through the shared `--tz-btn-rgb` / `--tz-btn-on` pattern across the\n * four standard variants. Token-only styling.\n */\nexport const Chip = forwardRef<HTMLDivElement, ChipProps>(function Chip(\n {\n variant = 'filled',\n color = 'primary',\n size = 'md',\n clickable = false,\n disabled = false,\n startIcon,\n avatar,\n onDelete,\n deleteIcon,\n deleteLabel,\n deleteTabIndex,\n className,\n style,\n children,\n onKeyDown,\n ...props\n },\n ref,\n) {\n const t = useT()\n const interactive = clickable && !disabled\n\n const handleDelete = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (!disabled) onDelete?.()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (interactive && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n event.currentTarget.click()\n }\n onKeyDown?.(event)\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.chip,\n styles[variant],\n styles[size],\n interactive && styles.clickable,\n disabled && styles.disabled,\n avatar && styles.withAvatar,\n onDelete && styles.withDelete,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n role={interactive ? 'button' : undefined}\n tabIndex={interactive ? 0 : undefined}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {avatar ? (\n <span className={styles.avatar}>{avatar}</span>\n ) : startIcon ? (\n <span className={styles.startIcon}>{startIcon}</span>\n ) : null}\n {children != null && children !== '' ? <span>{children}</span> : null}\n {onDelete ? (\n <button\n type=\"button\"\n className={styles.deleteBtn}\n onClick={handleDelete}\n onMouseDown={(event) => event.preventDefault()}\n aria-label={deleteLabel ?? t('common.remove')}\n tabIndex={deleteTabIndex}\n disabled={disabled}\n >\n {deleteIcon ?? <Icon name=\"CloseCircle\" size={size} />}\n </button>\n ) : null}\n </div>\n )\n})\n"],"names":["Chip","forwardRef","variant","color","size","clickable","disabled","startIcon","avatar","onDelete","deleteIcon","deleteLabel","deleteTabIndex","className","style","children","onKeyDown","props","ref","t","useT","interactive","handleDelete","event","handleKeyDown","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;GAiDaA,IAAOC,EAAsC,SACxD;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAchB,KAAa,CAACC,GAE5BgB,IAAe,CAACC,MAAyC;AAC7D,IAAAA,EAAM,gBAAA,GACDjB,KAAUG,KAAA,QAAAA;AAAA,EACjB,GAEMe,IAAgB,CAACD,MAAyC;AAC9D,IAAIF,MAAgBE,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACzDA,EAAM,eAAA,GACNA,EAAM,cAAc,MAAA,IAEtBP,KAAA,QAAAA,EAAYO;AAAA,EACd;AAEA,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAP;AAAA,MACA,WAAWQ;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOzB,CAAO;AAAA,QACdyB,EAAOvB,CAAI;AAAA,QACXiB,KAAeM,EAAO;AAAA,QACtBrB,KAAYqB,EAAO;AAAA,QACnBnB,KAAUmB,EAAO;AAAA,QACjBlB,KAAYkB,EAAO;AAAA,QACnBd;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,gBAAgB,kBAAkBV,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGW;AAAA,MAAA;AAAA,MAGP,MAAMO,IAAc,WAAW;AAAA,MAC/B,UAAUA,IAAc,IAAI;AAAA,MAC5B,iBAAef,KAAY;AAAA,MAC3B,WAAWkB;AAAA,MACV,GAAGP;AAAA,MAEH,UAAA;AAAA,QAAAT,IACC,gBAAAoB,EAAC,QAAA,EAAK,WAAWD,EAAO,QAAS,UAAAnB,GAAO,IACtCD,IACF,gBAAAqB,EAAC,QAAA,EAAK,WAAWD,EAAO,WAAY,aAAU,IAC5C;AAAA,QACHZ,KAAY,QAAQA,MAAa,KAAK,gBAAAa,EAAC,QAAA,EAAM,UAAAb,GAAS,IAAU;AAAA,QAChEN,IACC,gBAAAmB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAWD,EAAO;AAAA,YAClB,SAASL;AAAA,YACT,aAAa,CAACC,MAAUA,EAAM,eAAA;AAAA,YAC9B,cAAYZ,KAAeQ,EAAE,eAAe;AAAA,YAC5C,UAAUP;AAAA,YACV,UAAAN;AAAA,YAEC,UAAAI,KAAc,gBAAAkB,EAACC,GAAA,EAAK,MAAK,eAAc,MAAAzB,EAAA,CAAY;AAAA,UAAA;AAAA,QAAA,IAEpD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
1
+ {"version":3,"file":"Chip-DulHqhuf.js","sources":["../src/components/Chip/Chip.tsx"],"sourcesContent":["import {\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport styles from './Chip.module.css'\n\nexport type ChipVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type ChipSize = 'sm' | 'md' | 'lg'\n\nexport interface ChipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Visual style. Defaults to `filled` (a soft tinted chip). */\n variant?: ChipVariant\n /** Theme palette token that tints the chip. Defaults to `primary`. */\n color?: ThemeColor\n /** Preset size — height + font. Defaults to `md`. */\n size?: ChipSize\n /** Makes the chip interactive (hover, pointer, keyboard, `onClick`). Off by default (a static tag). */\n clickable?: boolean\n /** Dims the chip and disables all interaction. */\n disabled?: boolean\n /** Leading icon (e.g. an `<Icon />`). Ignored when `avatar` is set. */\n startIcon?: ReactNode\n /** Leading avatar (e.g. an `<Avatar />`), sized to the chip and flush to the left. */\n avatar?: ReactNode\n /** When provided, shows a trailing delete button that calls this (its click won't trigger `onClick`). */\n onDelete?: () => void\n /** Custom delete icon. Defaults to a `CloseCircle`. */\n deleteIcon?: ReactNode\n /** Accessible label for the delete button. Defaults to `\"Remove\"`. */\n deleteLabel?: string\n /** Tab index for the delete button — pass `-1` when the chip lives inside a composite widget (e.g. a multi-select) that owns keyboard focus. */\n deleteTabIndex?: number\n /** Chip label. */\n children?: ReactNode\n}\n\n/**\n * A compact tag/token. Static by default; `clickable` makes it an interactive `role=\"button\"`\n * (hover + Enter/Space). Supports a leading `startIcon` or `avatar` and a trailing delete button via\n * `onDelete`. Tinted by `color` through the shared `--tz-btn-rgb` / `--tz-btn-on` pattern across the\n * four standard variants. Token-only styling.\n */\nexport const Chip = forwardRef<HTMLDivElement, ChipProps>(function Chip(\n {\n variant = 'filled',\n color = 'primary',\n size = 'md',\n clickable = false,\n disabled = false,\n startIcon,\n avatar,\n onDelete,\n deleteIcon,\n deleteLabel,\n deleteTabIndex,\n className,\n style,\n children,\n onKeyDown,\n ...props\n },\n ref,\n) {\n const t = useT()\n const interactive = clickable && !disabled\n\n const handleDelete = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n if (!disabled) onDelete?.()\n }\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (interactive && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n event.currentTarget.click()\n }\n onKeyDown?.(event)\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n styles.chip,\n styles[variant],\n styles[size],\n interactive && styles.clickable,\n disabled && styles.disabled,\n avatar && styles.withAvatar,\n onDelete && styles.withDelete,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n role={interactive ? 'button' : undefined}\n tabIndex={interactive ? 0 : undefined}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {avatar ? (\n <span className={styles.avatar}>{avatar}</span>\n ) : startIcon ? (\n <span className={styles.startIcon}>{startIcon}</span>\n ) : null}\n {children != null && children !== '' ? <span>{children}</span> : null}\n {onDelete ? (\n <button\n type=\"button\"\n className={styles.deleteBtn}\n onClick={handleDelete}\n onMouseDown={(event) => event.preventDefault()}\n aria-label={deleteLabel ?? t('common.remove')}\n tabIndex={deleteTabIndex}\n disabled={disabled}\n >\n {deleteIcon ?? <Icon name=\"CloseCircle\" size={size} />}\n </button>\n ) : null}\n </div>\n )\n})\n"],"names":["Chip","forwardRef","variant","color","size","clickable","disabled","startIcon","avatar","onDelete","deleteIcon","deleteLabel","deleteTabIndex","className","style","children","onKeyDown","props","ref","t","useT","interactive","handleDelete","event","handleKeyDown","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;GAiDaA,IAAOC,EAAsC,SACxD;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAA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O;AAAA,YAClB,SAASL;AAAA,YACT,aAAa,CAACC,MAAUA,EAAM,eAAA;AAAA,YAC9B,cAAYZ,KAAeQ,EAAE,eAAe;AAAA,YAC5C,UAAUP;AAAA,YACV,UAAAN;AAAA,YAEC,UAAAI,KAAc,gBAAAkB,EAACC,GAAA,EAAK,MAAK,eAAc,MAAAzB,EAAA,CAAY;AAAA,UAAA;AAAA,QAAA,IAEpD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as o, jsxs as _ } from "react/jsx-runtime";
2
2
  import { forwardRef as I, useState as h, useRef as S, useEffect as y } from "react";
3
3
  import { clsx as w } from "clsx";
4
- import { I as g } from "./IconButton-BZ2jJn_T.js";
4
+ import { I as g } from "./IconButton-B8FPGgDn.js";
5
5
  import { I as z } from "./Icon-CophpkHo.js";
6
6
  import { T as E } from "./Tooltip-Cb_FKxT9.js";
7
- import { a as R } from "./ConfigProvider-sEZzNTeU.js";
7
+ import { a as R } from "./ConfigProvider-BYruQYHC.js";
8
8
  const j = "_root_floau_4", M = "_header_floau_15", D = "_title_floau_24", H = "_code_floau_34", L = "_plain_floau_50", O = "_wrap_floau_56", P = "_lineNumbers_floau_62", q = "_copy_floau_77", e = {
9
9
  root: j,
10
10
  header: M,
@@ -93,4 +93,4 @@ const j = "_root_floau_4", M = "_header_floau_15", D = "_title_floau_24", H = "_
93
93
  export {
94
94
  X as C
95
95
  };
96
- //# sourceMappingURL=CodeBlock-CPWEOym2.js.map
96
+ //# sourceMappingURL=CodeBlock-DwBMghs2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock-CPWEOym2.js","sources":["../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { IconButton } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport styles from './CodeBlock.module.css'\n\n// how long the copy button shows the \"copied\" tick before reverting\nconst COPIED_RESET_MS = 1600\n\nexport interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {\n /** The source code to render. */\n code: string\n /** Shiki language id (`'tsx'`, `'json'`, `'bash'`, `'css'`, …). Defaults to `'tsx'`. */\n language?: string\n /**\n * Optional label shown on the left of the header bar (e.g. a filename). The header bar itself always\n * renders (whenever `copyable`), so the copy button lives in it with or without a `title`.\n */\n title?: ReactNode\n /** Show a copy-to-clipboard button (in the header bar). Defaults to `true`. */\n copyable?: boolean\n /** Show line numbers. Defaults to `true`. */\n showLineNumbers?: boolean\n /** Cap the block height in px — taller code scrolls inside. */\n maxHeight?: number\n /** Soft-wrap long lines instead of scrolling horizontally. Defaults to `false`. */\n wrap?: boolean\n}\n\n/**\n * A syntax-highlighted code block with **VS Code colors** — powered by **Shiki** (an optional peer,\n * `npm i shiki`), the actual VS Code highlighting engine, using its **`dark-plus`** theme. The block\n * is **always dark** (in both app modes) — code reads best on a dark surface, and the deep background\n * anchors it regardless of the surrounding light/dark theme. Highlighting is **async and lazy**\n * (`import('shiki')` on first render); until it lands — or if `shiki` isn't installed / the language\n * is unknown — the block shows the plain code (on the same dark surface), so nothing breaks. A header\n * bar always renders (whenever `copyable`, default `true`) and holds the copy button — which flips to a\n * tick on click — with an optional `title` (e.g. a filename) on its left; `showLineNumbers` (default\n * `true`), `maxHeight` (scrolls inside) and `wrap` shape the body. The whole block\n * keeps VS Code's own dark colors (a deliberate literal-color exception, like the Modal scrim); only\n * the outer border/radius uses `--tz-*` tokens.\n */\nexport const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(function CodeBlock(\n {\n code,\n language = 'tsx',\n title,\n copyable = true,\n showLineNumbers = true,\n maxHeight,\n wrap = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [html, setHtml] = useState<string | null>(null)\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<number | undefined>(undefined)\n\n // highlight asynchronously — shiki is an optional peer, loaded lazily on first use; a missing\n // package or an unknown language just leaves the plain (unhighlighted) fallback in place\n useEffect(() => {\n let cancelled = false\n import('shiki')\n .then(({ codeToHtml }) =>\n codeToHtml(code, {\n lang: language,\n // always VS Code's dark theme — the block stays dark in both app modes\n theme: 'dark-plus',\n }),\n )\n .then((out) => {\n if (!cancelled) setHtml(out)\n })\n .catch(() => {\n if (!cancelled) setHtml(null)\n })\n return () => {\n cancelled = true\n }\n }, [code, language])\n\n useEffect(() => () => window.clearTimeout(copyTimer.current), [])\n\n const handleCopy = () => {\n navigator.clipboard\n ?.writeText(code)\n .then(() => {\n setCopied(true)\n window.clearTimeout(copyTimer.current)\n copyTimer.current = window.setTimeout(() => setCopied(false), COPIED_RESET_MS)\n })\n .catch(() => {})\n }\n\n const copyButton = copyable && (\n // the tooltip is hover/focus-driven; clicking flips `copied`, so its content updates to \"Copied!\"\n // while it's still open (the pointer is on the button). `left` keeps it inside the block's\n // `overflow: hidden` bounds.\n <Tooltip\n content={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n placement=\"left\"\n // always a white pill with dark text over the (always-dark) block — set via `style` so it beats\n // Tooltip's own color-derived --tz-btn-rgb (which is spread before the consumer `style`)\n style={{ '--tz-btn-rgb': '255, 255, 255', '--tz-btn-on': '#1e1e1e' } as CSSProperties}\n >\n <IconButton\n variant=\"text\"\n size=\"sm\"\n className={styles.copy}\n // force the button light over the dark surface — passed via `style` so it beats IconButton's\n // own inline `--tz-btn-rgb` (which is spread before the consumer `style`, so this wins)\n style={{ '--tz-btn-rgb': '255, 255, 255' } as CSSProperties}\n aria-label={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n onClick={handleCopy}\n >\n <Icon name={copied ? 'CopySuccess' : 'Copy'} />\n </IconButton>\n </Tooltip>\n )\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style} {...props}>\n {/* the header bar always renders whenever there's a title or a copy button — so the copy icon\n lives in the bar (top-right), never floating over the code */}\n {(title != null || copyButton) && (\n <div className={styles.header}>\n <span className={styles.title}>{title}</span>\n {copyButton}\n </div>\n )}\n <div\n className={clsx(styles.code, wrap && styles.wrap, showLineNumbers && styles.lineNumbers)}\n style={maxHeight != null ? ({ maxHeight } as CSSProperties) : undefined}\n >\n {html != null ? (\n // shiki output is trusted markup — it escapes the source code itself\n <div className={styles.highlighted} dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <pre className={styles.plain}>\n <code>{code}</code>\n </pre>\n )}\n </div>\n </div>\n )\n})\n"],"names":["COPIED_RESET_MS","CodeBlock","forwardRef","code","language","title","copyable","showLineNumbers","maxHeight","wrap","className","style","props","ref","t","useT","html","setHtml","useState","copied","setCopied","copyTimer","useRef","useEffect","cancelled","codeToHtml","out","handleCopy","_a","copyButton","jsx","Tooltip","IconButton","styles","Icon","jsxs","clsx"],"mappings":";;;;;;;;;;;;;;;;GAiBMA,IAAkB,MAmCXC,IAAYC,EAA2C,SAClE;AAAA,EACE,MAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,iBAAAC,IAAkB;AAAA,EAClB,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJ,CAACC,GAAMC,CAAO,IAAIC,EAAwB,IAAI,GAC9C,CAACC,GAAQC,CAAS,IAAIF,EAAS,EAAK,GACpCG,IAAYC,EAA2B,MAAS;AAItD,EAAAC,EAAU,MAAM;AACd,QAAIC,IAAY;AAChB,kBAAO,OAAO,EACX;AAAA,MAAK,CAAC,EAAE,YAAAC,EAAA,MACPA,EAAWtB,GAAM;AAAA,QACf,MAAMC;AAAA;AAAA,QAEN,OAAO;AAAA,MAAA,CACR;AAAA,IAAA,EAEF,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AAAA,KAAAP,KAAS,QAAQwB,MACjB,gBAAAM,EAAC,OAAA,EAAI,WAAWF,EAAO,QACrB,UAAA;AAAA,MAAA,gBAAAH,EAAC,QAAA,EAAK,WAAWG,EAAO,OAAQ,UAAA5B,GAAM;AAAA,MACrCwB;AAAA,IAAA,GACH;AAAA,IAEF,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWM,EAAKH,EAAO,MAAMxB,KAAQwB,EAAO,MAAM1B,KAAmB0B,EAAO,WAAW;AAAA,QACvF,OAAOzB,KAAa,OAAQ,EAAE,WAAAA,MAAgC;AAAA,QAE7D,UAAAQ,KAAQ;AAAA;AAAA,UAEP,gBAAAc,EAAC,SAAI,WAAWG,EAAO,aAAa,yBAAyB,EAAE,QAAQjB,IAAK,CAAG;AAAA,YAE/E,gBAAAc,EAAC,SAAI,WAAWG,EAAO,OACrB,UAAA,gBAAAH,EAAC,QAAA,EAAM,aAAK,EAAA,CACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"CodeBlock-DwBMghs2.js","sources":["../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { IconButton } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport styles from './CodeBlock.module.css'\n\n// how long the copy button shows the \"copied\" tick before reverting\nconst COPIED_RESET_MS = 1600\n\nexport interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {\n /** The source code to render. */\n code: string\n /** Shiki language id (`'tsx'`, `'json'`, `'bash'`, `'css'`, …). Defaults to `'tsx'`. */\n language?: string\n /**\n * Optional label shown on the left of the header bar (e.g. a filename). The header bar itself always\n * renders (whenever `copyable`), so the copy button lives in it with or without a `title`.\n */\n title?: ReactNode\n /** Show a copy-to-clipboard button (in the header bar). Defaults to `true`. */\n copyable?: boolean\n /** Show line numbers. Defaults to `true`. */\n showLineNumbers?: boolean\n /** Cap the block height in px — taller code scrolls inside. */\n maxHeight?: number\n /** Soft-wrap long lines instead of scrolling horizontally. Defaults to `false`. */\n wrap?: boolean\n}\n\n/**\n * A syntax-highlighted code block with **VS Code colors** — powered by **Shiki** (an optional peer,\n * `npm i shiki`), the actual VS Code highlighting engine, using its **`dark-plus`** theme. The block\n * is **always dark** (in both app modes) — code reads best on a dark surface, and the deep background\n * anchors it regardless of the surrounding light/dark theme. Highlighting is **async and lazy**\n * (`import('shiki')` on first render); until it lands — or if `shiki` isn't installed / the language\n * is unknown — the block shows the plain code (on the same dark surface), so nothing breaks. A header\n * bar always renders (whenever `copyable`, default `true`) and holds the copy button — which flips to a\n * tick on click — with an optional `title` (e.g. a filename) on its left; `showLineNumbers` (default\n * `true`), `maxHeight` (scrolls inside) and `wrap` shape the body. The whole block\n * keeps VS Code's own dark colors (a deliberate literal-color exception, like the Modal scrim); only\n * the outer border/radius uses `--tz-*` tokens.\n */\nexport const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(function CodeBlock(\n {\n code,\n language = 'tsx',\n title,\n copyable = true,\n showLineNumbers = true,\n maxHeight,\n wrap = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [html, setHtml] = useState<string | null>(null)\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<number | undefined>(undefined)\n\n // highlight asynchronously — shiki is an optional peer, loaded lazily on first use; a missing\n // package or an unknown language just leaves the plain (unhighlighted) fallback in place\n useEffect(() => {\n let cancelled = false\n import('shiki')\n .then(({ codeToHtml }) =>\n codeToHtml(code, {\n lang: language,\n // always VS Code's dark theme — the block stays dark in both app modes\n theme: 'dark-plus',\n }),\n )\n .then((out) => {\n if (!cancelled) setHtml(out)\n })\n .catch(() => {\n if (!cancelled) setHtml(null)\n })\n return () => {\n cancelled = true\n }\n }, [code, language])\n\n useEffect(() => () => window.clearTimeout(copyTimer.current), [])\n\n const handleCopy = () => {\n navigator.clipboard\n ?.writeText(code)\n .then(() => {\n setCopied(true)\n window.clearTimeout(copyTimer.current)\n copyTimer.current = window.setTimeout(() => setCopied(false), COPIED_RESET_MS)\n })\n .catch(() => {})\n }\n\n const copyButton = copyable && (\n // the tooltip is hover/focus-driven; clicking flips `copied`, so its content updates to \"Copied!\"\n // while it's still open (the pointer is on the button). `left` keeps it inside the block's\n // `overflow: hidden` bounds.\n <Tooltip\n content={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n placement=\"left\"\n // always a white pill with dark text over the (always-dark) block — set via `style` so it beats\n // Tooltip's own color-derived --tz-btn-rgb (which is spread before the consumer `style`)\n style={{ '--tz-btn-rgb': '255, 255, 255', '--tz-btn-on': '#1e1e1e' } as CSSProperties}\n >\n <IconButton\n variant=\"text\"\n size=\"sm\"\n className={styles.copy}\n // force the button light over the dark surface — passed via `style` so it beats IconButton's\n // own inline `--tz-btn-rgb` (which is spread before the consumer `style`, so this wins)\n style={{ '--tz-btn-rgb': '255, 255, 255' } as CSSProperties}\n aria-label={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n onClick={handleCopy}\n >\n <Icon name={copied ? 'CopySuccess' : 'Copy'} />\n </IconButton>\n </Tooltip>\n )\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style} {...props}>\n {/* the header bar always renders whenever there's a title or a copy button — so the copy icon\n lives in the bar (top-right), never floating over the code */}\n {(title != null || copyButton) && (\n <div className={styles.header}>\n <span className={styles.title}>{title}</span>\n {copyButton}\n </div>\n )}\n <div\n className={clsx(styles.code, wrap && styles.wrap, showLineNumbers && styles.lineNumbers)}\n style={maxHeight != null ? ({ maxHeight } as CSSProperties) : undefined}\n >\n {html != null ? (\n // shiki output is trusted markup — it escapes the source code itself\n <div className={styles.highlighted} dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <pre className={styles.plain}>\n <code>{code}</code>\n </pre>\n )}\n </div>\n </div>\n )\n})\n"],"names":["COPIED_RESET_MS","CodeBlock","forwardRef","code","language","title","copyable","showLineNumbers","maxHeight","wrap","className","style","props","ref","t","useT","html","setHtml","useState","copied","setCopied","copyTimer","useRef","useEffect","cancelled","codeToHtml","out","handleCopy","_a","copyButton","jsx","Tooltip","IconButton","styles","Icon","jsxs","clsx"],"mappings":";;;;;;;;;;;;;;;;GAiBMA,IAAkB,MAmCXC,IAAYC,EAA2C,SAClE;AAAA,EACE,MAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,iBAAAC,IAAkB;AAAA,EAClB,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJ,CAACC,GAAMC,CAAO,IAAIC,EAAwB,IAAI,GAC9C,CAACC,GAAQC,CAAS,IAAIF,EAAS,EAAK,GACpCG,IAAYC,EAA2B,MAAS;AAItD,EAAAC,EAAU,MAAM;AACd,QAAIC,IAAY;AAChB,kBAAO,OAAO,EACX;AAAA,MAAK,CAAC,EAAE,YAAAC,EAAA,MACPA,EAAWtB,GAAM;AAAA,QACf,MAAMC;AAAA;AAAA,QAEN,OAAO;AAAA,MAAA,CACR;AAAA,IAAA,EAEF,KAAK,CAACsB,MAAQ;AACb,MAAKF,KAAWP,EAAQS,CAAG;AAAA,IAC7B,CAAC,EACA,MAAM,MAAM;AACX,MAAKF,KAAWP,EAAQ,IAAI;AAAA,IAC9B,CAAC,GACI,MAAM;AACX,MAAAO,IAAY;AAAA,IACd;AAAA,EACF,GAAG,CAACrB,GAAMC,CAAQ,CAAC,GAEnBmB,EAAU,MAAM,MAAM,OAAO,aAAaF,EAAU,OAAO,GAAG,EAAE;AAEhE,QAAMM,IAAa,MAAM;;AACvB,KAAAC,IAAA,UAAU,cAAV,Q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,EAAE,WAAAA,MAAgC;AAAA,QAE7D,UAAAQ,KAAQ;AAAA;AAAA,UAEP,gBAAAc,EAAC,SAAI,WAAWG,EAAO,aAAa,yBAAyB,EAAE,QAAQjB,IAAK,CAAG;AAAA,YAE/E,gBAAAc,EAAC,SAAI,WAAWG,EAAO,OACrB,UAAA,gBAAAH,EAAC,QAAA,EAAM,aAAK,EAAA,CACd;AAAA,MAAA;AAAA,IAAA;AAAA,EAEJ,GACF;AAEJ,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";var v=Object.create;var y=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var E=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of I(e))!g.call(t,n)&&n!==s&&y(t,n,{get:()=>e[n],enumerable:!(i=q(e,n))||i.enumerable});return t};var z=(t,e,s)=>(s=t!=null?v(S(t)):{},E(e||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t));const o=require("react/jsx-runtime"),r=require("react"),w=require("clsx"),R=require("./IconButton-ChUfK0pG.cjs"),M=require("./Icon-CXTl_QAP.cjs"),P=require("./Tooltip-Ao7az09p.cjs"),D=require("./ConfigProvider-DFy6pL-C.cjs"),H="_root_floau_4",L="_header_floau_15",O="_title_floau_24",A="_code_floau_34",F="_plain_floau_50",G="_wrap_floau_56",J="_lineNumbers_floau_62",K="_copy_floau_77",c={root:H,header:L,title:O,code:A,plain:F,wrap:G,lineNumbers:J,copy:K},Q=1600,U=r.forwardRef(function({code:e,language:s="tsx",title:i,copyable:n=!0,showLineNumbers:b=!0,maxHeight:_,wrap:j=!1,className:N,style:B,...C},T){const a=D.useT(),[f,h]=r.useState(null),[u,m]=r.useState(!1),d=r.useRef(void 0);r.useEffect(()=>{let l=!1;return import("shiki").then(({codeToHtml:p})=>p(e,{lang:s,theme:"dark-plus"})).then(p=>{l||h(p)}).catch(()=>{l||h(null)}),()=>{l=!0}},[e,s]),r.useEffect(()=>()=>window.clearTimeout(d.current),[]);const k=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{m(!0),window.clearTimeout(d.current),d.current=window.setTimeout(()=>m(!1),Q)}).catch(()=>{})},x=n&&o.jsx(P.Tooltip,{content:a(u?"codeBlock.copied":"codeBlock.copy"),placement:"left",style:{"--tz-btn-rgb":"255, 255, 255","--tz-btn-on":"#1e1e1e"},children:o.jsx(R.IconButton,{variant:"text",size:"sm",className:c.copy,style:{"--tz-btn-rgb":"255, 255, 255"},"aria-label":a(u?"codeBlock.copied":"codeBlock.copy"),onClick:k,children:o.jsx(M.Icon,{name:u?"CopySuccess":"Copy"})})});return o.jsxs("div",{ref:T,className:w.clsx(c.root,N),style:B,...C,children:[(i!=null||x)&&o.jsxs("div",{className:c.header,children:[o.jsx("span",{className:c.title,children:i}),x]}),o.jsx("div",{className:w.clsx(c.code,j&&c.wrap,b&&c.lineNumbers),style:_!=null?{maxHeight:_}:void 0,children:f!=null?o.jsx("div",{className:c.highlighted,dangerouslySetInnerHTML:{__html:f}}):o.jsx("pre",{className:c.plain,children:o.jsx("code",{children:e})})})]})});exports.CodeBlock=U;
2
- //# sourceMappingURL=CodeBlock-DKhIGQBg.cjs.map
1
+ "use strict";var v=Object.create;var y=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var E=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of I(e))!g.call(t,n)&&n!==s&&y(t,n,{get:()=>e[n],enumerable:!(i=q(e,n))||i.enumerable});return t};var z=(t,e,s)=>(s=t!=null?v(S(t)):{},E(e||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t));const o=require("react/jsx-runtime"),r=require("react"),w=require("clsx"),R=require("./IconButton-BoY2y_pV.cjs"),M=require("./Icon-CXTl_QAP.cjs"),P=require("./Tooltip-Ao7az09p.cjs"),D=require("./ConfigProvider-BHNx-NHV.cjs"),H="_root_floau_4",L="_header_floau_15",O="_title_floau_24",A="_code_floau_34",F="_plain_floau_50",G="_wrap_floau_56",J="_lineNumbers_floau_62",K="_copy_floau_77",c={root:H,header:L,title:O,code:A,plain:F,wrap:G,lineNumbers:J,copy:K},Q=1600,U=r.forwardRef(function({code:e,language:s="tsx",title:i,copyable:n=!0,showLineNumbers:b=!0,maxHeight:_,wrap:j=!1,className:N,style:B,...C},T){const a=D.useT(),[f,h]=r.useState(null),[u,m]=r.useState(!1),d=r.useRef(void 0);r.useEffect(()=>{let l=!1;return import("shiki").then(({codeToHtml:p})=>p(e,{lang:s,theme:"dark-plus"})).then(p=>{l||h(p)}).catch(()=>{l||h(null)}),()=>{l=!0}},[e,s]),r.useEffect(()=>()=>window.clearTimeout(d.current),[]);const k=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{m(!0),window.clearTimeout(d.current),d.current=window.setTimeout(()=>m(!1),Q)}).catch(()=>{})},x=n&&o.jsx(P.Tooltip,{content:a(u?"codeBlock.copied":"codeBlock.copy"),placement:"left",style:{"--tz-btn-rgb":"255, 255, 255","--tz-btn-on":"#1e1e1e"},children:o.jsx(R.IconButton,{variant:"text",size:"sm",className:c.copy,style:{"--tz-btn-rgb":"255, 255, 255"},"aria-label":a(u?"codeBlock.copied":"codeBlock.copy"),onClick:k,children:o.jsx(M.Icon,{name:u?"CopySuccess":"Copy"})})});return o.jsxs("div",{ref:T,className:w.clsx(c.root,N),style:B,...C,children:[(i!=null||x)&&o.jsxs("div",{className:c.header,children:[o.jsx("span",{className:c.title,children:i}),x]}),o.jsx("div",{className:w.clsx(c.code,j&&c.wrap,b&&c.lineNumbers),style:_!=null?{maxHeight:_}:void 0,children:f!=null?o.jsx("div",{className:c.highlighted,dangerouslySetInnerHTML:{__html:f}}):o.jsx("pre",{className:c.plain,children:o.jsx("code",{children:e})})})]})});exports.CodeBlock=U;
2
+ //# sourceMappingURL=CodeBlock-EhB7v9-R.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlock-DKhIGQBg.cjs","sources":["../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { IconButton } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport styles from './CodeBlock.module.css'\n\n// how long the copy button shows the \"copied\" tick before reverting\nconst COPIED_RESET_MS = 1600\n\nexport interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {\n /** The source code to render. */\n code: string\n /** Shiki language id (`'tsx'`, `'json'`, `'bash'`, `'css'`, …). Defaults to `'tsx'`. */\n language?: string\n /**\n * Optional label shown on the left of the header bar (e.g. a filename). The header bar itself always\n * renders (whenever `copyable`), so the copy button lives in it with or without a `title`.\n */\n title?: ReactNode\n /** Show a copy-to-clipboard button (in the header bar). Defaults to `true`. */\n copyable?: boolean\n /** Show line numbers. Defaults to `true`. */\n showLineNumbers?: boolean\n /** Cap the block height in px — taller code scrolls inside. */\n maxHeight?: number\n /** Soft-wrap long lines instead of scrolling horizontally. Defaults to `false`. */\n wrap?: boolean\n}\n\n/**\n * A syntax-highlighted code block with **VS Code colors** — powered by **Shiki** (an optional peer,\n * `npm i shiki`), the actual VS Code highlighting engine, using its **`dark-plus`** theme. The block\n * is **always dark** (in both app modes) — code reads best on a dark surface, and the deep background\n * anchors it regardless of the surrounding light/dark theme. Highlighting is **async and lazy**\n * (`import('shiki')` on first render); until it lands — or if `shiki` isn't installed / the language\n * is unknown — the block shows the plain code (on the same dark surface), so nothing breaks. A header\n * bar always renders (whenever `copyable`, default `true`) and holds the copy button — which flips to a\n * tick on click — with an optional `title` (e.g. a filename) on its left; `showLineNumbers` (default\n * `true`), `maxHeight` (scrolls inside) and `wrap` shape the body. The whole block\n * keeps VS Code's own dark colors (a deliberate literal-color exception, like the Modal scrim); only\n * the outer border/radius uses `--tz-*` tokens.\n */\nexport const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(function CodeBlock(\n {\n code,\n language = 'tsx',\n title,\n copyable = true,\n showLineNumbers = true,\n maxHeight,\n wrap = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [html, setHtml] = useState<string | null>(null)\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<number | undefined>(undefined)\n\n // highlight asynchronously — shiki is an optional peer, loaded lazily on first use; a missing\n // package or an unknown language just leaves the plain (unhighlighted) fallback in place\n useEffect(() => {\n let cancelled = false\n import('shiki')\n .then(({ codeToHtml }) =>\n codeToHtml(code, {\n lang: language,\n // always VS Code's dark theme — the block stays dark in both app modes\n theme: 'dark-plus',\n }),\n )\n .then((out) => {\n if (!cancelled) setHtml(out)\n })\n .catch(() => {\n if (!cancelled) setHtml(null)\n })\n return () => {\n cancelled = true\n }\n }, [code, language])\n\n useEffect(() => () => window.clearTimeout(copyTimer.current), [])\n\n const handleCopy = () => {\n navigator.clipboard\n ?.writeText(code)\n .then(() => {\n setCopied(true)\n window.clearTimeout(copyTimer.current)\n copyTimer.current = window.setTimeout(() => setCopied(false), COPIED_RESET_MS)\n })\n .catch(() => {})\n }\n\n const copyButton = copyable && (\n // the tooltip is hover/focus-driven; clicking flips `copied`, so its content updates to \"Copied!\"\n // while it's still open (the pointer is on the button). `left` keeps it inside the block's\n // `overflow: hidden` bounds.\n <Tooltip\n content={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n placement=\"left\"\n // always a white pill with dark text over the (always-dark) block — set via `style` so it beats\n // Tooltip's own color-derived --tz-btn-rgb (which is spread before the consumer `style`)\n style={{ '--tz-btn-rgb': '255, 255, 255', '--tz-btn-on': '#1e1e1e' } as CSSProperties}\n >\n <IconButton\n variant=\"text\"\n size=\"sm\"\n className={styles.copy}\n // force the button light over the dark surface — passed via `style` so it beats IconButton's\n // own inline `--tz-btn-rgb` (which is spread before the consumer `style`, so this wins)\n style={{ '--tz-btn-rgb': '255, 255, 255' } as CSSProperties}\n aria-label={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n onClick={handleCopy}\n >\n <Icon name={copied ? 'CopySuccess' : 'Copy'} />\n </IconButton>\n </Tooltip>\n )\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style} {...props}>\n {/* the header bar always renders whenever there's a title or a copy button — so the copy icon\n lives in the bar (top-right), never floating over the code */}\n {(title != null || copyButton) && (\n <div className={styles.header}>\n <span className={styles.title}>{title}</span>\n {copyButton}\n </div>\n )}\n <div\n className={clsx(styles.code, wrap && styles.wrap, showLineNumbers && styles.lineNumbers)}\n style={maxHeight != null ? ({ maxHeight } as CSSProperties) : undefined}\n >\n {html != null ? (\n // shiki output is trusted markup — it escapes the source code itself\n <div className={styles.highlighted} dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <pre className={styles.plain}>\n <code>{code}</code>\n </pre>\n )}\n </div>\n </div>\n )\n})\n"],"names":["COPIED_RESET_MS","CodeBlock","forwardRef","code","language","title","copyable","showLineNumbers","maxHeight","wrap","className","style","props","ref","t","useT","html","setHtml","useState","copied","setCopied","copyTimer","useRef","useEffect","cancelled","codeToHtml","out","handleCopy","_a","copyButton","jsx","Tooltip","IconButton","styles","Icon","jsxs","clsx"],"mappings":"k6BAiBMA,EAAkB,KAmCXC,EAAYC,EAAAA,WAA2C,SAClE,CACE,KAAAC,EACA,SAAAC,EAAW,MACX,MAAAC,EACA,SAAAC,EAAW,GACX,gBAAAC,EAAkB,GAClB,UAAAC,EACA,KAAAC,EAAO,GACP,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAwB,IAAI,EAC9C,CAACC,EAAQC,CAAS,EAAIF,EAAAA,SAAS,EAAK,EACpCG,EA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AA,EAAAP,GAAS,MAAQwB,IACjBM,EAAAA,KAAC,MAAA,CAAI,UAAWF,EAAO,OACrB,SAAA,CAAAH,EAAAA,IAAC,OAAA,CAAK,UAAWG,EAAO,MAAQ,SAAA5B,EAAM,EACrCwB,CAAA,EACH,EAEFC,EAAAA,IAAC,MAAA,CACC,UAAWM,EAAAA,KAAKH,EAAO,KAAMxB,GAAQwB,EAAO,KAAM1B,GAAmB0B,EAAO,WAAW,EACvF,MAAOzB,GAAa,KAAQ,CAAE,UAAAA,GAAgC,OAE7D,SAAAQ,GAAQ,KAEPc,MAAC,OAAI,UAAWG,EAAO,YAAa,wBAAyB,CAAE,OAAQjB,EAAK,CAAG,EAE/Ec,EAAAA,IAAC,OAAI,UAAWG,EAAO,MACrB,SAAAH,EAAAA,IAAC,OAAA,CAAM,WAAK,CAAA,CACd,CAAA,CAAA,CAEJ,EACF,CAEJ,CAAC"}
1
+ {"version":3,"file":"CodeBlock-EhB7v9-R.cjs","sources":["../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { IconButton } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport styles from './CodeBlock.module.css'\n\n// how long the copy button shows the \"copied\" tick before reverting\nconst COPIED_RESET_MS = 1600\n\nexport interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'title'> {\n /** The source code to render. */\n code: string\n /** Shiki language id (`'tsx'`, `'json'`, `'bash'`, `'css'`, …). Defaults to `'tsx'`. */\n language?: string\n /**\n * Optional label shown on the left of the header bar (e.g. a filename). The header bar itself always\n * renders (whenever `copyable`), so the copy button lives in it with or without a `title`.\n */\n title?: ReactNode\n /** Show a copy-to-clipboard button (in the header bar). Defaults to `true`. */\n copyable?: boolean\n /** Show line numbers. Defaults to `true`. */\n showLineNumbers?: boolean\n /** Cap the block height in px — taller code scrolls inside. */\n maxHeight?: number\n /** Soft-wrap long lines instead of scrolling horizontally. Defaults to `false`. */\n wrap?: boolean\n}\n\n/**\n * A syntax-highlighted code block with **VS Code colors** — powered by **Shiki** (an optional peer,\n * `npm i shiki`), the actual VS Code highlighting engine, using its **`dark-plus`** theme. The block\n * is **always dark** (in both app modes) — code reads best on a dark surface, and the deep background\n * anchors it regardless of the surrounding light/dark theme. Highlighting is **async and lazy**\n * (`import('shiki')` on first render); until it lands — or if `shiki` isn't installed / the language\n * is unknown — the block shows the plain code (on the same dark surface), so nothing breaks. A header\n * bar always renders (whenever `copyable`, default `true`) and holds the copy button — which flips to a\n * tick on click — with an optional `title` (e.g. a filename) on its left; `showLineNumbers` (default\n * `true`), `maxHeight` (scrolls inside) and `wrap` shape the body. The whole block\n * keeps VS Code's own dark colors (a deliberate literal-color exception, like the Modal scrim); only\n * the outer border/radius uses `--tz-*` tokens.\n */\nexport const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(function CodeBlock(\n {\n code,\n language = 'tsx',\n title,\n copyable = true,\n showLineNumbers = true,\n maxHeight,\n wrap = false,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const [html, setHtml] = useState<string | null>(null)\n const [copied, setCopied] = useState(false)\n const copyTimer = useRef<number | undefined>(undefined)\n\n // highlight asynchronously — shiki is an optional peer, loaded lazily on first use; a missing\n // package or an unknown language just leaves the plain (unhighlighted) fallback in place\n useEffect(() => {\n let cancelled = false\n import('shiki')\n .then(({ codeToHtml }) =>\n codeToHtml(code, {\n lang: language,\n // always VS Code's dark theme — the block stays dark in both app modes\n theme: 'dark-plus',\n }),\n )\n .then((out) => {\n if (!cancelled) setHtml(out)\n })\n .catch(() => {\n if (!cancelled) setHtml(null)\n })\n return () => {\n cancelled = true\n }\n }, [code, language])\n\n useEffect(() => () => window.clearTimeout(copyTimer.current), [])\n\n const handleCopy = () => {\n navigator.clipboard\n ?.writeText(code)\n .then(() => {\n setCopied(true)\n window.clearTimeout(copyTimer.current)\n copyTimer.current = window.setTimeout(() => setCopied(false), COPIED_RESET_MS)\n })\n .catch(() => {})\n }\n\n const copyButton = copyable && (\n // the tooltip is hover/focus-driven; clicking flips `copied`, so its content updates to \"Copied!\"\n // while it's still open (the pointer is on the button). `left` keeps it inside the block's\n // `overflow: hidden` bounds.\n <Tooltip\n content={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n placement=\"left\"\n // always a white pill with dark text over the (always-dark) block — set via `style` so it beats\n // Tooltip's own color-derived --tz-btn-rgb (which is spread before the consumer `style`)\n style={{ '--tz-btn-rgb': '255, 255, 255', '--tz-btn-on': '#1e1e1e' } as CSSProperties}\n >\n <IconButton\n variant=\"text\"\n size=\"sm\"\n className={styles.copy}\n // force the button light over the dark surface — passed via `style` so it beats IconButton's\n // own inline `--tz-btn-rgb` (which is spread before the consumer `style`, so this wins)\n style={{ '--tz-btn-rgb': '255, 255, 255' } as CSSProperties}\n aria-label={copied ? t('codeBlock.copied') : t('codeBlock.copy')}\n onClick={handleCopy}\n >\n <Icon name={copied ? 'CopySuccess' : 'Copy'} />\n </IconButton>\n </Tooltip>\n )\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style} {...props}>\n {/* the header bar always renders whenever there's a title or a copy button — so the copy icon\n lives in the bar (top-right), never floating over the code */}\n {(title != null || copyButton) && (\n <div className={styles.header}>\n <span className={styles.title}>{title}</span>\n {copyButton}\n </div>\n )}\n <div\n className={clsx(styles.code, wrap && styles.wrap, showLineNumbers && styles.lineNumbers)}\n style={maxHeight != null ? ({ maxHeight } as CSSProperties) : undefined}\n >\n {html != null ? (\n // shiki output is trusted markup — it escapes the source code itself\n <div className={styles.highlighted} dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <pre className={styles.plain}>\n <code>{code}</code>\n </pre>\n )}\n </div>\n </div>\n )\n})\n"],"names":["COPIED_RESET_MS","CodeBlock","forwardRef","code","language","title","copyable","showLineNumbers","maxHeight","wrap","className","style","props","ref","t","useT","html","setHtml","useState","copied","setCopied","copyTimer","useRef","useEffect","cancelled","codeToHtml","out","handleCopy","_a","copyButton","jsx","Tooltip","IconButton","styles","Icon","jsxs","clsx"],"mappings":"k6BAiBMA,EAAkB,KAmCXC,EAAYC,EAAAA,WAA2C,SAClE,CACE,KAAAC,EACA,SAAAC,EAAW,MACX,MAAAC,EACA,SAAAC,EAAW,GACX,gBAAAC,EAAkB,GAClB,UAAAC,EACA,KAAAC,EAAO,GACP,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAwB,IAAI,EAC9C,CAACC,EAAQC,CAAS,EAAIF,EAAAA,SAAS,EAAK,EACpCG,EAAYC,EAAAA,OAA2B,MAAS,EAItDC,EAAAA,UAAU,IAAM,CACd,IAAIC,EAAY,GAChB,cAAO,OAAO,EACX,KAAK,CAAC,CAAE,WAAAC,CAAA,IACPA,EAAWtB,EAAM,CACf,KAAMC,EAEN,MAAO,WAAA,CACR,CAAA,EAEF,KAAMsB,GAAQ,CACRF,GAAWP,EAAQS,CAAG,CAC7B,CAAC,EACA,MAAM,IAAM,CACNF,GAAWP,EAAQ,IAAI,CAC9B,CAAC,EACI,IAAM,CACXO,EAAY,EACd,CACF,EAAG,CAACrB,EAAMC,CAAQ,CAAC,EAEnBmB,EAAAA,UAAU,IAAM,IAAM,OAAO,aAAaF,EAAU,OAAO,EAAG,EAAE,EAEhE,MAAMM,EAAa,IAAM,QACvBC,EAAA,UAAU,YAAV,MAAAA,EACI,UAAUzB,GACX,KAAK,IAAM,CACViB,EAAU,EAAI,EACd,OAAO,aAAaC,EAAU,OAAO,EACrCA,EAAU,QAAU,OAAO,WAAW,IAAMD,EAAU,EAAK,EAAGpB,CAAe,CAC/E,GACC,MAAM,IAAM,CAAC,EAClB,EAEM6B,EAAavB,GAIjBwB,EAAAA,IAACC,EAAAA,QAAA,CACC,QAAkBjB,EAATK,EAAW,mBAAwB,gBAAN,EACtC,UAAU,OAGV,MAAO,CAAE,eAAgB,gBAAiB,cAAe,SAAA,EAEzD,SAAAW,EAAAA,IAACE,EAAAA,WAAA,CACC,QAAQ,OACR,KAAK,KACL,UAAWC,EAAO,KAGlB,MAAO,CAAE,eAAgB,eAAA,EACzB,aAAqBnB,EAATK,EAAW,mBAAwB,gBAAN,EACzC,QAASQ,EAET,SAAAG,EAAAA,IAACI,OAAA,CAAK,KAAMf,EAAS,cAAgB,MAAA,CAAQ,CAAA,CAAA,CAC/C,CAAA,EAIJ,OACEgB,EAAAA,KAAC,MAAA,CAAI,IAAAtB,EAAU,UAAWuB,EAAAA,KAAKH,EAAO,KAAMvB,CAAS,EAAG,MAAAC,EAAe,GAAGC,EAGtE,SAAA,EAAAP,GAAS,MAAQwB,IACjBM,EAAAA,KAAC,MAAA,CAAI,UAAWF,EAAO,OACrB,SAAA,CAAAH,EAAAA,IAAC,OAAA,CAAK,UAAWG,EAAO,MAAQ,SAAA5B,EAAM,EACrCwB,CAAA,EACH,EAEFC,EAAAA,IAAC,MAAA,CACC,UAAWM,EAAAA,KAAKH,EAAO,KAAMxB,GAAQwB,EAAO,KAAM1B,GAAmB0B,EAAO,WAAW,EACvF,MAAOzB,GAAa,KAAQ,CAAE,UAAAA,GAAgC,OAE7D,SAAAQ,GAAQ,KAEPc,MAAC,OAAI,UAAWG,EAAO,YAAa,wBAAyB,CAAE,OAAQjB,EAAK,CAAG,EAE/Ec,EAAAA,IAAC,OAAI,UAAWG,EAAO,MACrB,SAAAH,EAAAA,IAAC,OAAA,CAAM,WAAK,CAAA,CACd,CAAA,CAAA,CAEJ,EACF,CAEJ,CAAC"}
@@ -4,8 +4,8 @@ import { clsx as p } from "clsx";
4
4
  import { u as or } from "./formContext-B7ln1Miy.js";
5
5
  import { F as lr } from "./FloatingPanel-BG9Uag__.js";
6
6
  import { T as S } from "./Typography-Cta6Rg4L.js";
7
- import { p as sr, f as tr, s as e, C as ar } from "./ColorPickerPanel-CovWDIRt.js";
8
- import { a as ir } from "./ConfigProvider-sEZzNTeU.js";
7
+ import { p as sr, f as tr, s as e, C as ar } from "./ColorPickerPanel-9tOQUL38.js";
8
+ import { a as ir } from "./ConfigProvider-BYruQYHC.js";
9
9
  const nr = 232, Cr = rr(function({
10
10
  label: u,
11
11
  size: j = "md",
@@ -116,4 +116,4 @@ const nr = 232, Cr = rr(function({
116
116
  export {
117
117
  Cr as C
118
118
  };
119
- //# sourceMappingURL=ColorPicker-2qD8vZkR.js.map
119
+ //# sourceMappingURL=ColorPicker-DJgTeHht.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker-2qD8vZkR.js","sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Typography } from '../Typography'\nimport { ColorPickerPanel } from './ColorPickerPanel'\nimport { formatColor, parseColor } from './colorUtils'\nimport styles from './ColorPicker.module.css'\n\nexport type ColorPickerSize = 'sm' | 'md' | 'lg'\n\n/** Popover width (px). */\nconst POPOVER_WIDTH = 232\n\nexport interface ColorPickerProps {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — control height, swatch and font. */\n size?: ColorPickerSize\n /** Marks the field invalid: red border/ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Disables the field. */\n disabled?: boolean\n /** Controlled value — a CSS color string: `#rrggbb` hex, or `rgba(r, g, b, a)` when translucent. */\n value?: string\n /** Initial value for uncontrolled use (hex or `rgb()`/`rgba()`). */\n defaultValue?: string\n /** Fires with the next color: `#rrggbb` when opaque, `rgba(r, g, b, a)` when not (or `''` when cleared). */\n onChange?: (color: string) => void\n /** Quick-pick swatches shown in the popover. Defaults to a curated palette. */\n swatches?: string[]\n /** Form field name — auto-binds to a surrounding `<Form>` (value is the hex string). */\n name?: string\n /** Placeholder shown in the trigger when no color is set. Omit to show nothing. */\n placeholder?: string\n /** Id for the trigger (label association). */\n id?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A color field with a beautiful popover picker: a saturation/value square, a hue slider, an alpha\n * (opacity) slider, a color input, quick-pick swatches and a clear button. The input accepts hex\n * (`#rgb`/`#rrggbb`/`#rrggbbaa`) or `rgb()`/`rgba()`, and the value comes back as `#rrggbb` when\n * fully opaque or `rgba(r, g, b, a)` when translucent. Clicking the trigger opens the popover, which\n * — like `Dropdown` — is portaled to `<body>`, opens below (flips above only when it would\n * overflow), locks page scroll and re-positions on scroll/resize. Controlled (`value` + `onChange`)\n * or uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is\n * the color string; validate with e.g. `z.string().regex(/^#[0-9a-f]{6}$/i, 'Pick a color')`, or a\n * looser pattern if you allow `rgba()`). Styling uses `--tz-*` tokens (the spectrum gradients and\n * the alpha checkerboard are the unavoidable exceptions).\n */\nexport const ColorPicker = forwardRef<HTMLButtonElement, ColorPickerProps>(function ColorPicker(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n disabled = false,\n value,\n defaultValue,\n onChange,\n swatches,\n name,\n placeholder,\n id: idProp,\n className,\n style,\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the hex string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentColor = isControlled ? externalValue! : internal\n const parsed = parseColor(currentColor || '')\n // canonical string for the value (`#rrggbb` when opaque, `rgba(...)` when not), null when unset\n const displayValue = parsed ? formatColor(parsed) : null\n // hex shows uppercase in the trigger; rgba() stays as-is\n const displayText = displayValue\n ? displayValue[0] === '#'\n ? displayValue.toUpperCase()\n : displayValue\n : null\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // ── popover (positioning / scroll-lock / dismiss come from FloatingPanel) ──────────────────────\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const [open, setOpen] = useState(false)\n\n const setTriggerRef = useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLButtonElement | null }).current = node\n },\n [ref],\n )\n\n const closePopover = useCallback((refocus: boolean) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }, [])\n\n // mark the form field touched when focus leaves the whole widget — but not when it moves into the\n // (portaled) popover or stays on the trigger, so a form-bound picker shows its error like every\n // other popover field (Select/DatePicker) instead of only after submit\n const handleTriggerBlur = (event: FocusEvent<HTMLButtonElement>) => {\n const next = event.relatedTarget as Node | null\n if (next && (popoverRef.current?.contains(next) || triggerRef.current?.contains(next))) return\n bound?.onBlur(event as unknown as FocusEvent<HTMLInputElement>)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n styles[size],\n fullWidth && styles.fullWidth,\n resolvedError && styles.error,\n disabled && styles.disabled,\n className,\n )}\n style={style}\n >\n {label != null && (\n <label htmlFor={id} className={styles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <button\n ref={setTriggerRef}\n id={id}\n name={name}\n type=\"button\"\n className={clsx(styles.control, open && styles.open)}\n disabled={disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n aria-label={label || parsed || placeholder ? undefined : t('colorPicker.pick')}\n onClick={() => setOpen((o) => !o)}\n onBlur={handleTriggerBlur}\n >\n <span className={clsx(styles.value, !parsed && styles.placeholder)}>\n {displayText ?? placeholder}\n </span>\n <span\n className={clsx(styles.preview, !parsed && styles.previewEmpty)}\n style={parsed ? ({ '--cp-fill': displayValue } as CSSProperties) : undefined}\n aria-hidden=\"true\"\n />\n </button>\n\n <FloatingPanel\n ref={popoverRef}\n open={open}\n triggerRef={triggerRef}\n onClose={closePopover}\n role=\"dialog\"\n ariaLabel=\"Color picker\"\n width={POPOVER_WIDTH}\n >\n <ColorPickerPanel value={currentColor} onChange={commit} swatches={swatches} />\n </FloatingPanel>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={styles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["POPOVER_WIDTH","ColorPicker","forwardRef","label","size","error","helperText","required","fullWidth","disabled","value","defaultValue","onChange","swatches","name","placeholder","idProp","className","style","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentColor","parsed","parseColor","displayValue","formatColor","displayText","resolvedError","resolvedHelperText","commit","color","triggerRef","useRef","popoverRef","open","setOpen","setTriggerRef","useCallback","node","closePopover","refocus","_a","handleTriggerBlur","event","next","_b","jsxs","clsx","styles","jsx","Typography","o","FloatingPanel","ColorPickerPanel"],"mappings":";;;;;;;;AAsBA,M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IR,CAAC;"}
1
+ {"version":3,"file":"ColorPicker-DJgTeHht.js","sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Typography } from '../Typography'\nimport { ColorPickerPanel } from './ColorPickerPanel'\nimport { formatColor, parseColor } from './colorUtils'\nimport styles from './ColorPicker.module.css'\n\nexport type ColorPickerSize = 'sm' | 'md' | 'lg'\n\n/** Popover width (px). */\nconst POPOVER_WIDTH = 232\n\nexport interface ColorPickerProps {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — control height, swatch and font. */\n size?: ColorPickerSize\n /** Marks the field invalid: red border/ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Disables the field. */\n disabled?: boolean\n /** Controlled value — a CSS color string: `#rrggbb` hex, or `rgba(r, g, b, a)` when translucent. */\n value?: string\n /** Initial value for uncontrolled use (hex or `rgb()`/`rgba()`). */\n defaultValue?: string\n /** Fires with the next color: `#rrggbb` when opaque, `rgba(r, g, b, a)` when not (or `''` when cleared). */\n onChange?: (color: string) => void\n /** Quick-pick swatches shown in the popover. Defaults to a curated palette. */\n swatches?: string[]\n /** Form field name — auto-binds to a surrounding `<Form>` (value is the hex string). */\n name?: string\n /** Placeholder shown in the trigger when no color is set. Omit to show nothing. */\n placeholder?: string\n /** Id for the trigger (label association). */\n id?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A color field with a beautiful popover picker: a saturation/value square, a hue slider, an alpha\n * (opacity) slider, a color input, quick-pick swatches and a clear button. The input accepts hex\n * (`#rgb`/`#rrggbb`/`#rrggbbaa`) or `rgb()`/`rgba()`, and the value comes back as `#rrggbb` when\n * fully opaque or `rgba(r, g, b, a)` when translucent. Clicking the trigger opens the popover, which\n * — like `Dropdown` — is portaled to `<body>`, opens below (flips above only when it would\n * overflow), locks page scroll and re-positions on scroll/resize. Controlled (`value` + `onChange`)\n * or uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is\n * the color string; validate with e.g. `z.string().regex(/^#[0-9a-f]{6}$/i, 'Pick a color')`, or a\n * looser pattern if you allow `rgba()`). Styling uses `--tz-*` tokens (the spectrum gradients and\n * the alpha checkerboard are the unavoidable exceptions).\n */\nexport const ColorPicker = forwardRef<HTMLButtonElement, ColorPickerProps>(function ColorPicker(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n disabled = false,\n value,\n defaultValue,\n onChange,\n swatches,\n name,\n placeholder,\n id: idProp,\n className,\n style,\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the hex string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentColor = isControlled ? externalValue! : internal\n const parsed = parseColor(currentColor || '')\n // canonical string for the value (`#rrggbb` when opaque, `rgba(...)` when not), null when unset\n const displayValue = parsed ? formatColor(parsed) : null\n // hex shows uppercase in the trigger; rgba() stays as-is\n const displayText = displayValue\n ? displayValue[0] === '#'\n ? displayValue.toUpperCase()\n : displayValue\n : null\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // ── popover (positioning / scroll-lock / dismiss come from FloatingPanel) ──────────────────────\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const [open, setOpen] = useState(false)\n\n const setTriggerRef = useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLButtonElement | null }).current = node\n },\n [ref],\n )\n\n const closePopover = useCallback((refocus: boolean) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }, [])\n\n // mark the form field touched when focus leaves the whole widget — but not when it moves into the\n // (portaled) popover or stays on the trigger, so a form-bound picker shows its error like every\n // other popover field (Select/DatePicker) instead of only after submit\n const handleTriggerBlur = (event: FocusEvent<HTMLButtonElement>) => {\n const next = event.relatedTarget as Node | null\n if (next && (popoverRef.current?.contains(next) || triggerRef.current?.contains(next))) return\n bound?.onBlur(event as unknown as FocusEvent<HTMLInputElement>)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n styles[size],\n fullWidth && styles.fullWidth,\n resolvedError && styles.error,\n disabled && styles.disabled,\n className,\n )}\n style={style}\n >\n {label != null && (\n <label htmlFor={id} className={styles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <button\n ref={setTriggerRef}\n id={id}\n name={name}\n type=\"button\"\n className={clsx(styles.control, open && styles.open)}\n disabled={disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n aria-label={label || parsed || placeholder ? undefined : t('colorPicker.pick')}\n onClick={() => setOpen((o) => !o)}\n onBlur={handleTriggerBlur}\n >\n <span className={clsx(styles.value, !parsed && styles.placeholder)}>\n {displayText ?? placeholder}\n </span>\n <span\n className={clsx(styles.preview, !parsed && styles.previewEmpty)}\n style={parsed ? ({ '--cp-fill': displayValue } as CSSProperties) : undefined}\n aria-hidden=\"true\"\n />\n </button>\n\n <FloatingPanel\n ref={popoverRef}\n open={open}\n triggerRef={triggerRef}\n onClose={closePopover}\n role=\"dialog\"\n ariaLabel=\"Color picker\"\n width={POPOVER_WIDTH}\n >\n <ColorPickerPanel value={currentColor} onChange={commit} swatches={swatches} />\n </FloatingPanel>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={styles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["POPOVER_WIDTH","ColorPicker","forwardRef","label","size","error","helperText","required","fullWidth","disabled","value","defaultValue","onChange","swatches","name","placeholder","idProp","className","style","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentColor","parsed","parseColor","displayValue","formatColor","displayText","resolvedError","resolvedHelperText","commit","color","triggerRef","useRef","popoverRef","open","setOpen","setTriggerRef","useCallback","node","closePopover","refocus","_a","handleTriggerBlur","event","next","_b","jsxs","clsx","styles","jsx","Typography","o","FloatingPanel","ColorPickerPanel"],"mappings":";;;;;;;;AAsBA,MAAMA,KAAgB,KA+CTC,KAAcC,GAAgD,SACzE;AAAA,EACE,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,IAAIC;AAAA,EACJ,WAAAC;AAAA,EACA,OAAAC;AACF,GACAC,GACA;AACA,QAAMC,IAAIC,GAAA,GACJC,IAAUC,G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,GAC9D,UAAAtB,KAAezB,EAAA,CAClB;AAAA,cACA,gBAAAgD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWF,EAAKC,EAAO,SAAS,CAAC1B,KAAU0B,EAAO,YAAY;AAAA,kBAC9D,OAAO1B,IAAU,EAAE,aAAaE,MAAmC;AAAA,kBACnE,eAAY;AAAA,gBAAA;AAAA,cAAA;AAAA,YACd;AAAA,UAAA;AAAA,QAAA;AAAA,QAGF,gBAAAyB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,KAAKnB;AAAA,YACL,MAAAC;AAAA,YACA,YAAAH;AAAA,YACA,SAASQ;AAAA,YACT,MAAK;AAAA,YACL,WAAU;AAAA,YACV,OAAOrD;AAAA,YAEP,4BAACmE,IAAA,EAAiB,OAAOhC,GAAc,UAAUQ,GAAQ,UAAA9B,EAAA,CAAoB;AAAA,UAAA;AAAA,QAAA;AAAA,QAG9E6B,KAAsB,QACrB,gBAAAqB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAIvC;AAAA,YACJ,SAAQ;AAAA,YACR,OAAOgB,IAAgB,UAAU;AAAA,YACjC,WAAWqB,EAAO;AAAA,YAEjB,UAAApB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),t=require("react"),p=require("clsx"),X=require("./formContext-bTWrqdEV.cjs"),Y=require("./FloatingPanel-U6sGYiSK.cjs"),I=require("./Typography-BFatE1_A.cjs"),e=require("./ColorPickerPanel-CkB2pNnX.cjs"),Z=require("./ConfigProvider-DFy6pL-C.cjs"),ee=232,se=t.forwardRef(function({label:y,size:w="md",error:S,helperText:V,required:E=!1,fullWidth:O=!0,disabled:C=!1,value:P,defaultValue:H,onChange:f,swatches:W,name:o,placeholder:g,id:D,className:L,style:U},a){const _=Z.useT(),$=t.useId(),x=D??$,j=`${x}-helper`,c=X.useFormContext(),k=!!(c&&o),l=c&&o?c.field(o):void 0,T=P!==void 0?P:k?c.values[o]??"":void 0,q=T!==void 0,[z,A]=t.useState(H??""),R=q?T:z,i=e.parseColor(R||""),u=i?e.formatColor(i):null,G=u?u[0]==="#"?u.toUpperCase():u:null,v=S??(l==null?void 0:l.error)??!1,h=V??(l==null?void 0:l.helperText),J=s=>{q||A(s),k&&c.setValue(o,s),f==null||f(s)},d=t.useRef(null),N=t.useRef(null),[m,b]=t.useState(!1),K=t.useCallback(s=>{d.current=s,typeof a=="function"?a(s):a&&(a.current=s)},[a]),M=t.useCallback(s=>{var n;b(!1),s&&((n=d.current)==null||n.focus())},[]),Q=s=>{var B,F;const n=s.relatedTarget;n&&((B=N.current)!=null&&B.contains(n)||(F=d.current)!=null&&F.contains(n))||l==null||l.onBlur(s)};return r.jsxs("div",{className:p.clsx(e.styles.field,e.styles[w],O&&e.styles.fullWidth,v&&e.styles.error,C&&e.styles.disabled,L),style:U,children:[y!=null&&r.jsxs("label",{htmlFor:x,className:e.styles.label,children:[r.jsx(I.Typography,{as:"span",variant:"bodySmall",color:"muted",children:y}),E&&r.jsx("span",{className:e.styles.required,"aria-hidden":"true",children:"*"})]}),r.jsxs("button",{ref:K,id:x,name:o,type:"button",className:p.clsx(e.styles.control,m&&e.styles.open),disabled:C,"aria-haspopup":"dialog","aria-expanded":m,"aria-invalid":v||void 0,"aria-describedby":h!=null?j:void 0,"aria-label":y||i||g?void 0:_("colorPicker.pick"),onClick:()=>b(s=>!s),onBlur:Q,children:[r.jsx("span",{className:p.clsx(e.styles.value,!i&&e.styles.placeholder),children:G??g}),r.jsx("span",{className:p.clsx(e.styles.preview,!i&&e.styles.previewEmpty),style:i?{"--cp-fill":u}:void 0,"aria-hidden":"true"})]}),r.jsx(Y.FloatingPanel,{ref:N,open:m,triggerRef:d,onClose:M,role:"dialog",ariaLabel:"Color picker",width:ee,children:r.jsx(e.ColorPickerPanel,{value:R,onChange:J,swatches:W})}),h!=null&&r.jsx(I.Typography,{as:"span",id:j,variant:"bodySmall",color:v?"error":"muted",className:e.styles.helper,children:h})]})});exports.ColorPicker=se;
2
- //# sourceMappingURL=ColorPicker-BAJWvC3h.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),t=require("react"),p=require("clsx"),X=require("./formContext-bTWrqdEV.cjs"),Y=require("./FloatingPanel-U6sGYiSK.cjs"),I=require("./Typography-BFatE1_A.cjs"),e=require("./ColorPickerPanel-nXEliruE.cjs"),Z=require("./ConfigProvider-BHNx-NHV.cjs"),ee=232,se=t.forwardRef(function({label:y,size:w="md",error:S,helperText:V,required:E=!1,fullWidth:O=!0,disabled:C=!1,value:P,defaultValue:H,onChange:f,swatches:W,name:o,placeholder:g,id:D,className:L,style:U},a){const _=Z.useT(),$=t.useId(),x=D??$,j=`${x}-helper`,c=X.useFormContext(),k=!!(c&&o),l=c&&o?c.field(o):void 0,T=P!==void 0?P:k?c.values[o]??"":void 0,q=T!==void 0,[z,A]=t.useState(H??""),R=q?T:z,i=e.parseColor(R||""),u=i?e.formatColor(i):null,G=u?u[0]==="#"?u.toUpperCase():u:null,v=S??(l==null?void 0:l.error)??!1,h=V??(l==null?void 0:l.helperText),J=s=>{q||A(s),k&&c.setValue(o,s),f==null||f(s)},d=t.useRef(null),N=t.useRef(null),[m,b]=t.useState(!1),K=t.useCallback(s=>{d.current=s,typeof a=="function"?a(s):a&&(a.current=s)},[a]),M=t.useCallback(s=>{var n;b(!1),s&&((n=d.current)==null||n.focus())},[]),Q=s=>{var B,F;const n=s.relatedTarget;n&&((B=N.current)!=null&&B.contains(n)||(F=d.current)!=null&&F.contains(n))||l==null||l.onBlur(s)};return r.jsxs("div",{className:p.clsx(e.styles.field,e.styles[w],O&&e.styles.fullWidth,v&&e.styles.error,C&&e.styles.disabled,L),style:U,children:[y!=null&&r.jsxs("label",{htmlFor:x,className:e.styles.label,children:[r.jsx(I.Typography,{as:"span",variant:"bodySmall",color:"muted",children:y}),E&&r.jsx("span",{className:e.styles.required,"aria-hidden":"true",children:"*"})]}),r.jsxs("button",{ref:K,id:x,name:o,type:"button",className:p.clsx(e.styles.control,m&&e.styles.open),disabled:C,"aria-haspopup":"dialog","aria-expanded":m,"aria-invalid":v||void 0,"aria-describedby":h!=null?j:void 0,"aria-label":y||i||g?void 0:_("colorPicker.pick"),onClick:()=>b(s=>!s),onBlur:Q,children:[r.jsx("span",{className:p.clsx(e.styles.value,!i&&e.styles.placeholder),children:G??g}),r.jsx("span",{className:p.clsx(e.styles.preview,!i&&e.styles.previewEmpty),style:i?{"--cp-fill":u}:void 0,"aria-hidden":"true"})]}),r.jsx(Y.FloatingPanel,{ref:N,open:m,triggerRef:d,onClose:M,role:"dialog",ariaLabel:"Color picker",width:ee,children:r.jsx(e.ColorPickerPanel,{value:R,onChange:J,swatches:W})}),h!=null&&r.jsx(I.Typography,{as:"span",id:j,variant:"bodySmall",color:v?"error":"muted",className:e.styles.helper,children:h})]})});exports.ColorPicker=se;
2
+ //# sourceMappingURL=ColorPicker-Dc1y9Zuu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker-BAJWvC3h.cjs","sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Typography } from '../Typography'\nimport { ColorPickerPanel } from './ColorPickerPanel'\nimport { formatColor, parseColor } from './colorUtils'\nimport styles from './ColorPicker.module.css'\n\nexport type ColorPickerSize = 'sm' | 'md' | 'lg'\n\n/** Popover width (px). */\nconst POPOVER_WIDTH = 232\n\nexport interface ColorPickerProps {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — control height, swatch and font. */\n size?: ColorPickerSize\n /** Marks the field invalid: red border/ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Disables the field. */\n disabled?: boolean\n /** Controlled value — a CSS color string: `#rrggbb` hex, or `rgba(r, g, b, a)` when translucent. */\n value?: string\n /** Initial value for uncontrolled use (hex or `rgb()`/`rgba()`). */\n defaultValue?: string\n /** Fires with the next color: `#rrggbb` when opaque, `rgba(r, g, b, a)` when not (or `''` when cleared). */\n onChange?: (color: string) => void\n /** Quick-pick swatches shown in the popover. Defaults to a curated palette. */\n swatches?: string[]\n /** Form field name — auto-binds to a surrounding `<Form>` (value is the hex string). */\n name?: string\n /** Placeholder shown in the trigger when no color is set. Omit to show nothing. */\n placeholder?: string\n /** Id for the trigger (label association). */\n id?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A color field with a beautiful popover picker: a saturation/value square, a hue slider, an alpha\n * (opacity) slider, a color input, quick-pick swatches and a clear button. The input accepts hex\n * (`#rgb`/`#rrggbb`/`#rrggbbaa`) or `rgb()`/`rgba()`, and the value comes back as `#rrggbb` when\n * fully opaque or `rgba(r, g, b, a)` when translucent. Clicking the trigger opens the popover, which\n * — like `Dropdown` — is portaled to `<body>`, opens below (flips above only when it would\n * overflow), locks page scroll and re-positions on scroll/resize. Controlled (`value` + `onChange`)\n * or uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is\n * the color string; validate with e.g. `z.string().regex(/^#[0-9a-f]{6}$/i, 'Pick a color')`, or a\n * looser pattern if you allow `rgba()`). Styling uses `--tz-*` tokens (the spectrum gradients and\n * the alpha checkerboard are the unavoidable exceptions).\n */\nexport const ColorPicker = forwardRef<HTMLButtonElement, ColorPickerProps>(function ColorPicker(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n disabled = false,\n value,\n defaultValue,\n onChange,\n swatches,\n name,\n placeholder,\n id: idProp,\n className,\n style,\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the hex string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentColor = isControlled ? externalValue! : internal\n const parsed = parseColor(currentColor || '')\n // canonical string for the value (`#rrggbb` when opaque, `rgba(...)` when not), null when unset\n const displayValue = parsed ? formatColor(parsed) : null\n // hex shows uppercase in the trigger; rgba() stays as-is\n const displayText = displayValue\n ? displayValue[0] === '#'\n ? displayValue.toUpperCase()\n : displayValue\n : null\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // ── popover (positioning / scroll-lock / dismiss come from FloatingPanel) ──────────────────────\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const [open, setOpen] = useState(false)\n\n const setTriggerRef = useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLButtonElement | null }).current = node\n },\n [ref],\n )\n\n const closePopover = useCallback((refocus: boolean) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }, [])\n\n // mark the form field touched when focus leaves the whole widget — but not when it moves into the\n // (portaled) popover or stays on the trigger, so a form-bound picker shows its error like every\n // other popover field (Select/DatePicker) instead of only after submit\n const handleTriggerBlur = (event: FocusEvent<HTMLButtonElement>) => {\n const next = event.relatedTarget as Node | null\n if (next && (popoverRef.current?.contains(next) || triggerRef.current?.contains(next))) return\n bound?.onBlur(event as unknown as FocusEvent<HTMLInputElement>)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n styles[size],\n fullWidth && styles.fullWidth,\n resolvedError && styles.error,\n disabled && styles.disabled,\n className,\n )}\n style={style}\n >\n {label != null && (\n <label htmlFor={id} className={styles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <button\n ref={setTriggerRef}\n id={id}\n name={name}\n type=\"button\"\n className={clsx(styles.control, open && styles.open)}\n disabled={disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n aria-label={label || parsed || placeholder ? undefined : t('colorPicker.pick')}\n onClick={() => setOpen((o) => !o)}\n onBlur={handleTriggerBlur}\n >\n <span className={clsx(styles.value, !parsed && styles.placeholder)}>\n {displayText ?? placeholder}\n </span>\n <span\n className={clsx(styles.preview, !parsed && styles.previewEmpty)}\n style={parsed ? ({ '--cp-fill': displayValue } as CSSProperties) : undefined}\n aria-hidden=\"true\"\n />\n </button>\n\n <FloatingPanel\n ref={popoverRef}\n open={open}\n triggerRef={triggerRef}\n onClose={closePopover}\n role=\"dialog\"\n ariaLabel=\"Color picker\"\n width={POPOVER_WIDTH}\n >\n <ColorPickerPanel value={currentColor} onChange={commit} swatches={swatches} />\n </FloatingPanel>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={styles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["POPOVER_WIDTH","ColorPicker","forwardRef","label","size","error","helperText","required","fullWidth","disabled","value","defaultValue","onChange","swatches","name","placeholder","idProp","className","style","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentColor","parsed","parseColor","displayValue","formatColor","displayText","resolvedError","resolvedHelperText","commit","color","triggerRef","useRef","popoverRef","open","setOpen","setTriggerRef","useCallback","node","closePopover","refocus","_a","handleTriggerBlur","event","next","_b","jsxs","clsx","styles","jsx","Typography","o","FloatingPanel","ColorPickerPanel"],"mappings":"wSAsBMA,GAAgB,IA+CTC,GAAcC,EAAAA,WAAgD,SACzE,CACE,MAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EACA,YAAAC,EACA,GAAIC,EACJ,UAAAC,EACA,MAAAC,CACF,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAUC,EAAAA,MAAA,EACVC,EAAKR,GAAUM,EACfG,EAAW,GAAGD,CAAE,UAGhBE,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQZ,GAC9Be,EAAQH,GAAQZ,EAAOY,EAAK,MAAMZ,CAAI,EAAI,OAE1CgB,EACJpB,IAAU,OACNA,EACAkB,EACIF,EAAM,OAAOZ,CAAK,GAA4B,GAChD,OACFiB,EAAeD,IAAkB,OACjC,CAACE,EAAUC,CAAW,EAAIC,EAAAA,SAAiBvB,GAAgB,EAAE,EAC7DwB,EAAeJ,EAAeD,EAAiBE,EAC/CI,EAASC,EAAAA,WAAWF,GAAgB,EAAE,EAEtCG,EAAeF,EAASG,cAAYH,CAAM,EAAI,KAE9CI,EAAcF,EAChBA,EAAa,CAAC,IAAM,IAClBA,EAAa,cACbA,EACF,KAEEG,EAAgBpC,IAASwB,GAAA,YAAAA,EAAO,QAAS,GACzCa,EAAqBpC,IAAcuB,GAAA,YAAAA,EAAO,YAE1Cc,EAAUC,GAAkB,CAC3Bb,GAAcE,EAAYW,CAAK,EAChChB,GAAa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AK,SACL,UAAW+C,EAAAA,KAAKC,EAAAA,OAAO,QAASd,GAAQc,EAAAA,OAAO,IAAI,EACnD,SAAArD,EACA,gBAAc,SACd,gBAAeuC,EACf,eAAcP,GAAiB,OAC/B,mBAAkBC,GAAsB,KAAOjB,EAAW,OAC1D,aAAYtB,GAASiC,GAAUrB,EAAc,OAAYK,EAAE,kBAAkB,EAC7E,QAAS,IAAM6B,EAASgB,GAAM,CAACA,CAAC,EAChC,OAAQT,EAER,SAAA,CAAAO,EAAAA,IAAC,OAAA,CAAK,UAAWF,EAAAA,KAAKC,EAAAA,OAAO,MAAO,CAAC1B,GAAU0B,EAAAA,OAAO,WAAW,EAC9D,SAAAtB,GAAezB,CAAA,CAClB,EACAgD,EAAAA,IAAC,OAAA,CACC,UAAWF,EAAAA,KAAKC,SAAO,QAAS,CAAC1B,GAAU0B,EAAAA,OAAO,YAAY,EAC9D,MAAO1B,EAAU,CAAE,YAAaE,GAAmC,OACnE,cAAY,MAAA,CAAA,CACd,CAAA,CAAA,EAGFyB,EAAAA,IAACG,EAAAA,cAAA,CACC,IAAKnB,EACL,KAAAC,EACA,WAAAH,EACA,QAASQ,EACT,KAAK,SACL,UAAU,eACV,MAAOrD,GAEP,eAACmE,EAAAA,iBAAA,CAAiB,MAAOhC,EAAc,SAAUQ,EAAQ,SAAA9B,CAAA,CAAoB,CAAA,CAAA,EAG9E6B,GAAsB,MACrBqB,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAG,OACH,GAAIvC,EACJ,QAAQ,YACR,MAAOgB,EAAgB,QAAU,QACjC,UAAWqB,EAAAA,OAAO,OAEjB,SAAApB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
1
+ {"version":3,"file":"ColorPicker-Dc1y9Zuu.cjs","sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Typography } from '../Typography'\nimport { ColorPickerPanel } from './ColorPickerPanel'\nimport { formatColor, parseColor } from './colorUtils'\nimport styles from './ColorPicker.module.css'\n\nexport type ColorPickerSize = 'sm' | 'md' | 'lg'\n\n/** Popover width (px). */\nconst POPOVER_WIDTH = 232\n\nexport interface ColorPickerProps {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — control height, swatch and font. */\n size?: ColorPickerSize\n /** Marks the field invalid: red border/ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Disables the field. */\n disabled?: boolean\n /** Controlled value — a CSS color string: `#rrggbb` hex, or `rgba(r, g, b, a)` when translucent. */\n value?: string\n /** Initial value for uncontrolled use (hex or `rgb()`/`rgba()`). */\n defaultValue?: string\n /** Fires with the next color: `#rrggbb` when opaque, `rgba(r, g, b, a)` when not (or `''` when cleared). */\n onChange?: (color: string) => void\n /** Quick-pick swatches shown in the popover. Defaults to a curated palette. */\n swatches?: string[]\n /** Form field name — auto-binds to a surrounding `<Form>` (value is the hex string). */\n name?: string\n /** Placeholder shown in the trigger when no color is set. Omit to show nothing. */\n placeholder?: string\n /** Id for the trigger (label association). */\n id?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A color field with a beautiful popover picker: a saturation/value square, a hue slider, an alpha\n * (opacity) slider, a color input, quick-pick swatches and a clear button. The input accepts hex\n * (`#rgb`/`#rrggbb`/`#rrggbbaa`) or `rgb()`/`rgba()`, and the value comes back as `#rrggbb` when\n * fully opaque or `rgba(r, g, b, a)` when translucent. Clicking the trigger opens the popover, which\n * — like `Dropdown` — is portaled to `<body>`, opens below (flips above only when it would\n * overflow), locks page scroll and re-positions on scroll/resize. Controlled (`value` + `onChange`)\n * or uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is\n * the color string; validate with e.g. `z.string().regex(/^#[0-9a-f]{6}$/i, 'Pick a color')`, or a\n * looser pattern if you allow `rgba()`). Styling uses `--tz-*` tokens (the spectrum gradients and\n * the alpha checkerboard are the unavoidable exceptions).\n */\nexport const ColorPicker = forwardRef<HTMLButtonElement, ColorPickerProps>(function ColorPicker(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n disabled = false,\n value,\n defaultValue,\n onChange,\n swatches,\n name,\n placeholder,\n id: idProp,\n className,\n style,\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the hex string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentColor = isControlled ? externalValue! : internal\n const parsed = parseColor(currentColor || '')\n // canonical string for the value (`#rrggbb` when opaque, `rgba(...)` when not), null when unset\n const displayValue = parsed ? formatColor(parsed) : null\n // hex shows uppercase in the trigger; rgba() stays as-is\n const displayText = displayValue\n ? displayValue[0] === '#'\n ? displayValue.toUpperCase()\n : displayValue\n : null\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // ── popover (positioning / scroll-lock / dismiss come from FloatingPanel) ──────────────────────\n const triggerRef = useRef<HTMLButtonElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const [open, setOpen] = useState(false)\n\n const setTriggerRef = useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLButtonElement | null }).current = node\n },\n [ref],\n )\n\n const closePopover = useCallback((refocus: boolean) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }, [])\n\n // mark the form field touched when focus leaves the whole widget — but not when it moves into the\n // (portaled) popover or stays on the trigger, so a form-bound picker shows its error like every\n // other popover field (Select/DatePicker) instead of only after submit\n const handleTriggerBlur = (event: FocusEvent<HTMLButtonElement>) => {\n const next = event.relatedTarget as Node | null\n if (next && (popoverRef.current?.contains(next) || triggerRef.current?.contains(next))) return\n bound?.onBlur(event as unknown as FocusEvent<HTMLInputElement>)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n styles[size],\n fullWidth && styles.fullWidth,\n resolvedError && styles.error,\n disabled && styles.disabled,\n className,\n )}\n style={style}\n >\n {label != null && (\n <label htmlFor={id} className={styles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <button\n ref={setTriggerRef}\n id={id}\n name={name}\n type=\"button\"\n className={clsx(styles.control, open && styles.open)}\n disabled={disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n aria-label={label || parsed || placeholder ? undefined : t('colorPicker.pick')}\n onClick={() => setOpen((o) => !o)}\n onBlur={handleTriggerBlur}\n >\n <span className={clsx(styles.value, !parsed && styles.placeholder)}>\n {displayText ?? placeholder}\n </span>\n <span\n className={clsx(styles.preview, !parsed && styles.previewEmpty)}\n style={parsed ? ({ '--cp-fill': displayValue } as CSSProperties) : undefined}\n aria-hidden=\"true\"\n />\n </button>\n\n <FloatingPanel\n ref={popoverRef}\n open={open}\n triggerRef={triggerRef}\n onClose={closePopover}\n role=\"dialog\"\n ariaLabel=\"Color picker\"\n width={POPOVER_WIDTH}\n >\n <ColorPickerPanel value={currentColor} onChange={commit} swatches={swatches} />\n </FloatingPanel>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={styles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["POPOVER_WIDTH","ColorPicker","forwardRef","label","size","error","helperText","required","fullWidth","disabled","value","defaultValue","onChange","swatches","name","placeholder","idProp","className","style","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentColor","parsed","parseColor","displayValue","formatColor","displayText","resolvedError","resolvedHelperText","commit","color","triggerRef","useRef","popoverRef","open","setOpen","setTriggerRef","useCallback","node","closePopover","refocus","_a","handleTriggerBlur","event","next","_b","jsxs","clsx","styles","jsx","Typography","o","FloatingPanel","ColorPickerPanel"],"mappings":"wSAsBMA,GAAgB,IA+CTC,GAAcC,EAAAA,WAAgD,SACzE,CACE,MAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EACA,YAAAC,EACA,GAAIC,EACJ,UAAAC,EACA,MAAAC,CACF,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAUC,EAAAA,MAAA,EACVC,EAAKR,GAAUM,EACfG,EAAW,GAAGD,CAAE,UAGhBE,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQZ,GAC9Be,EAAQH,GAAQZ,EAAOY,EAAK,MAAMZ,CAAI,EAAI,OAE1CgB,EACJpB,IAAU,OACNA,EACAkB,EACIF,EAAM,OAAOZ,CAAK,GAA4B,GAChD,OACFiB,EAAeD,IAAkB,OACjC,CAACE,E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AA,CAAA,EAG9E6B,GAAsB,MACrBqB,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAG,OACH,GAAIvC,EACJ,QAAQ,YACR,MAAOgB,EAAgB,QAAU,QACjC,UAAWqB,EAAAA,OAAO,OAEjB,SAAApB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
@@ -2,7 +2,7 @@ import { jsxs as N, jsx as m } from "react/jsx-runtime";
2
2
  import { useState as R, useRef as E, useEffect as P } from "react";
3
3
  import { clsx as te } from "clsx";
4
4
  import { I as L } from "./Icon-CophpkHo.js";
5
- import { a as re } from "./ConfigProvider-sEZzNTeU.js";
5
+ import { a as re } from "./ConfigProvider-BYruQYHC.js";
6
6
  const f = (s) => Math.min(1, Math.max(0, s)), y = (s) => Math.min(255, Math.max(0, Math.round(s)));
7
7
  function ne(s) {
8
8
  let n = s.trim().replace(/^#/, "");
@@ -333,4 +333,4 @@ export {
333
333
  F as p,
334
334
  _ as s
335
335
  };
336
- //# sourceMappingURL=ColorPickerPanel-CovWDIRt.js.map
336
+ //# sourceMappingURL=ColorPickerPanel-9tOQUL38.js.map