@techzyapp/ui-library 1.0.25 → 1.0.27

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 (478) hide show
  1. package/dist/{AdminRoot-CgvtgUpW.js → AdminRoot-C4OyuOIr.js} +4 -4
  2. package/dist/{AdminRoot-CgvtgUpW.js.map → AdminRoot-C4OyuOIr.js.map} +1 -1
  3. package/dist/{AdminRoot-BkPPRkyQ.cjs → AdminRoot-bHywlbML.cjs} +2 -2
  4. package/dist/{AdminRoot-BkPPRkyQ.cjs.map → AdminRoot-bHywlbML.cjs.map} +1 -1
  5. package/dist/{Alert-udX1ybuC.cjs → Alert-DeGgilkH.cjs} +2 -2
  6. package/dist/{Alert-udX1ybuC.cjs.map → Alert-DeGgilkH.cjs.map} +1 -1
  7. package/dist/{Alert-DXmzM_rh.js → Alert-rNjfqj2Z.js} +3 -3
  8. package/dist/{Alert-DXmzM_rh.js.map → Alert-rNjfqj2Z.js.map} +1 -1
  9. package/dist/{AuthLayout-BRUxDgzs.cjs → AuthLayout-ChILVWZ-.cjs} +2 -2
  10. package/dist/{AuthLayout-BRUxDgzs.cjs.map → AuthLayout-ChILVWZ-.cjs.map} +1 -1
  11. package/dist/{AuthLayout-CP9qu6Bv.js → AuthLayout-zAS3jlYc.js} +2 -2
  12. package/dist/{AuthLayout-CP9qu6Bv.js.map → AuthLayout-zAS3jlYc.js.map} +1 -1
  13. package/dist/{Avatar-Q50J8wdN.js → Avatar-BGPGxry2.js} +25 -25
  14. package/dist/{Avatar-Q50J8wdN.js.map → Avatar-BGPGxry2.js.map} +1 -1
  15. package/dist/Avatar-D_YivyqV.cjs +2 -0
  16. package/dist/{Avatar-Dgf04PBC.cjs.map → Avatar-D_YivyqV.cjs.map} +1 -1
  17. package/dist/{AvatarGroup-uW0SD5P4.cjs → AvatarGroup-Bnf_RSc9.cjs} +2 -2
  18. package/dist/{AvatarGroup-uW0SD5P4.cjs.map → AvatarGroup-Bnf_RSc9.cjs.map} +1 -1
  19. package/dist/{AvatarGroup-YaNasLMS.js → AvatarGroup-Difz4lLR.js} +2 -2
  20. package/dist/{AvatarGroup-YaNasLMS.js.map → AvatarGroup-Difz4lLR.js.map} +1 -1
  21. package/dist/Badge-BmFgusOa.js +50 -0
  22. package/dist/{Badge-DSWigoGC.js.map → Badge-BmFgusOa.js.map} +1 -1
  23. package/dist/Badge-DVbe1rAI.cjs +2 -0
  24. package/dist/{Badge-BQpr2Jee.cjs.map → Badge-DVbe1rAI.cjs.map} +1 -1
  25. package/dist/{Breadcrumbs-DQHHeLId.js → Breadcrumbs-BJHKk0Sn.js} +3 -3
  26. package/dist/{Breadcrumbs-DQHHeLId.js.map → Breadcrumbs-BJHKk0Sn.js.map} +1 -1
  27. package/dist/{Breadcrumbs-CsYTiX2h.cjs → Breadcrumbs-CGcpMlxm.cjs} +2 -2
  28. package/dist/{Breadcrumbs-CsYTiX2h.cjs.map → Breadcrumbs-CGcpMlxm.cjs.map} +1 -1
  29. package/dist/Button-BZ_o-akc.cjs +2 -0
  30. package/dist/{Button-CXmDOzPk.cjs.map → Button-BZ_o-akc.cjs.map} +1 -1
  31. package/dist/Button-obe6rono.js +72 -0
  32. package/dist/{Button-DBs8xnA5.js.map → Button-obe6rono.js.map} +1 -1
  33. package/dist/{Calendar-CtteUt82.js → Calendar-SCih0NtS.js} +4 -4
  34. package/dist/{Calendar-CtteUt82.js.map → Calendar-SCih0NtS.js.map} +1 -1
  35. package/dist/{Calendar-B2nMXk4C.cjs → Calendar-lfpNwivC.cjs} +2 -2
  36. package/dist/{Calendar-B2nMXk4C.cjs.map → Calendar-lfpNwivC.cjs.map} +1 -1
  37. package/dist/{Card-DYKnWt-L.js → Card-BRJV2JZE.js} +2 -2
  38. package/dist/{Card-DYKnWt-L.js.map → Card-BRJV2JZE.js.map} +1 -1
  39. package/dist/{Card-DGF22HbS.cjs → Card-KvvNlchc.cjs} +2 -2
  40. package/dist/{Card-DGF22HbS.cjs.map → Card-KvvNlchc.cjs.map} +1 -1
  41. package/dist/{Chip-DdKhcstm.js → Chip-CQ4cYVl_.js} +31 -31
  42. package/dist/{Chip-DdKhcstm.js.map → Chip-CQ4cYVl_.js.map} +1 -1
  43. package/dist/Chip-CYz4vxHm.cjs +2 -0
  44. package/dist/{Chip-gUH_7nQc.cjs.map → Chip-CYz4vxHm.cjs.map} +1 -1
  45. package/dist/ChoiceCardGroup-D3HL7dHj.js +181 -0
  46. package/dist/{ChoiceCardGroup-DBohUnRj.js.map → ChoiceCardGroup-D3HL7dHj.js.map} +1 -1
  47. package/dist/ChoiceCardGroup-pIOKIUI0.cjs +2 -0
  48. package/dist/{ChoiceCardGroup-d0VVTUi5.cjs.map → ChoiceCardGroup-pIOKIUI0.cjs.map} +1 -1
  49. package/dist/{CodeBlock-DD_d3-sM.js → CodeBlock-DddGTLu1.js} +3 -3
  50. package/dist/{CodeBlock-DD_d3-sM.js.map → CodeBlock-DddGTLu1.js.map} +1 -1
  51. package/dist/{CodeBlock-C6tQtbHU.cjs → CodeBlock-H75dbOvg.cjs} +2 -2
  52. package/dist/{CodeBlock-C6tQtbHU.cjs.map → CodeBlock-H75dbOvg.cjs.map} +1 -1
  53. package/dist/ColorPicker-CKc8k-Dp.cjs +2 -0
  54. package/dist/ColorPicker-CKc8k-Dp.cjs.map +1 -0
  55. package/dist/{ColorPicker-Dw6Qk0iy.js → ColorPicker-Cw-2X6u9.js} +35 -26
  56. package/dist/ColorPicker-Cw-2X6u9.js.map +1 -0
  57. package/dist/ColorPickerPanel-DQ4CFnGa.cjs +2 -0
  58. package/dist/ColorPickerPanel-DQ4CFnGa.cjs.map +1 -0
  59. package/dist/ColorPickerPanel-PYaF5wPL.js +322 -0
  60. package/dist/ColorPickerPanel-PYaF5wPL.js.map +1 -0
  61. package/dist/ColorRamp-AkY9gq6Y.cjs +2 -0
  62. package/dist/ColorRamp-AkY9gq6Y.cjs.map +1 -0
  63. package/dist/ColorRamp-DnlJNKfy.js +126 -0
  64. package/dist/ColorRamp-DnlJNKfy.js.map +1 -0
  65. package/dist/{ConfigProvider-Bszl3Wr3.cjs → ConfigProvider-BicoaBLj.cjs} +2 -2
  66. package/dist/ConfigProvider-BicoaBLj.cjs.map +1 -0
  67. package/dist/{ConfigProvider-DR9YMy9U.js → ConfigProvider-DL9fylMo.js} +2 -2
  68. package/dist/ConfigProvider-DL9fylMo.js.map +1 -0
  69. package/dist/CopyButton-BqFGC-Ca.cjs +2 -0
  70. package/dist/{CopyButton-Ct-8AmmX.cjs.map → CopyButton-BqFGC-Ca.cjs.map} +1 -1
  71. package/dist/CopyButton-D6-kcVCA.js +43 -0
  72. package/dist/{CopyButton-DJ1PSJZU.js.map → CopyButton-D6-kcVCA.js.map} +1 -1
  73. package/dist/DashedButton-B7xodc3N.cjs +2 -0
  74. package/dist/{DashedButton-3C4IZuo4.cjs.map → DashedButton-B7xodc3N.cjs.map} +1 -1
  75. package/dist/DashedButton-iM7kzopW.js +59 -0
  76. package/dist/{DashedButton-BXZAyMtw.js.map → DashedButton-iM7kzopW.js.map} +1 -1
  77. package/dist/{DatePicker-BxEydgfu.cjs → DatePicker-BvGFP2AL.cjs} +2 -2
  78. package/dist/{DatePicker-BxEydgfu.cjs.map → DatePicker-BvGFP2AL.cjs.map} +1 -1
  79. package/dist/{DatePicker-CJioG5M7.js → DatePicker-DP7yASzq.js} +5 -5
  80. package/dist/{DatePicker-CJioG5M7.js.map → DatePicker-DP7yASzq.js.map} +1 -1
  81. package/dist/DatePicker.module-BDtTsg8M.cjs +2 -0
  82. package/dist/{DatePicker.module-tE-tGNBd.cjs.map → DatePicker.module-BDtTsg8M.cjs.map} +1 -1
  83. package/dist/DatePicker.module-CMMQyEhG.js +138 -0
  84. package/dist/{DatePicker.module-BZDftL4g.js.map → DatePicker.module-CMMQyEhG.js.map} +1 -1
  85. package/dist/{DateTimePicker-e2zj2bhS.js → DateTimePicker-CzRduOFz.js} +8 -8
  86. package/dist/{DateTimePicker-e2zj2bhS.js.map → DateTimePicker-CzRduOFz.js.map} +1 -1
  87. package/dist/{DateTimePicker-COEj2Z0F.cjs → DateTimePicker-DOzft9kg.cjs} +2 -2
  88. package/dist/{DateTimePicker-COEj2Z0F.cjs.map → DateTimePicker-DOzft9kg.cjs.map} +1 -1
  89. package/dist/EmptyState-A5nPGnHA.js +38 -0
  90. package/dist/{EmptyState-BTd7aVgu.js.map → EmptyState-A5nPGnHA.js.map} +1 -1
  91. package/dist/EmptyState-CTTOy9aY.cjs +2 -0
  92. package/dist/{EmptyState-Bv4XXnD1.cjs.map → EmptyState-CTTOy9aY.cjs.map} +1 -1
  93. package/dist/{FileCard-DY8N9Lzz.js → FileCard-BmPEEcue.js} +4 -4
  94. package/dist/{FileCard-DY8N9Lzz.js.map → FileCard-BmPEEcue.js.map} +1 -1
  95. package/dist/{FileCard-DW5Ur8Aj.cjs → FileCard-C4BkGMtK.cjs} +2 -2
  96. package/dist/{FileCard-DW5Ur8Aj.cjs.map → FileCard-C4BkGMtK.cjs.map} +1 -1
  97. package/dist/FileUploader-D_F64mob.cjs +2 -0
  98. package/dist/FileUploader-D_F64mob.cjs.map +1 -0
  99. package/dist/{FileUploader-BYF5FvUc.js → FileUploader-Dv_3bjZA.js} +217 -217
  100. package/dist/FileUploader-Dv_3bjZA.js.map +1 -0
  101. package/dist/{Flag-CB4YyPj3.cjs → Flag-BM_2VJ1v.cjs} +2 -2
  102. package/dist/{Flag-CB4YyPj3.cjs.map → Flag-BM_2VJ1v.cjs.map} +1 -1
  103. package/dist/{Flag-yA1y5XzR.js → Flag-CzCEpB8E.js} +2 -2
  104. package/dist/{Flag-yA1y5XzR.js.map → Flag-CzCEpB8E.js.map} +1 -1
  105. package/dist/{FullscreenToggle-0lskYnpx.cjs → FullscreenToggle-BL0nBrsL.cjs} +2 -2
  106. package/dist/{FullscreenToggle-0lskYnpx.cjs.map → FullscreenToggle-BL0nBrsL.cjs.map} +1 -1
  107. package/dist/{FullscreenToggle-jSLruiKt.js → FullscreenToggle-HZQOIa21.js} +3 -3
  108. package/dist/{FullscreenToggle-jSLruiKt.js.map → FullscreenToggle-HZQOIa21.js.map} +1 -1
  109. package/dist/IconButton-B87ipBK3.cjs +2 -0
  110. package/dist/{IconButton-BN-bZxEi.cjs.map → IconButton-B87ipBK3.cjs.map} +1 -1
  111. package/dist/IconButton-CBp8QuTO.js +68 -0
  112. package/dist/{IconButton-BEGWfcVc.js.map → IconButton-CBp8QuTO.js.map} +1 -1
  113. package/dist/Loader-0Imnbael.cjs +2 -0
  114. package/dist/{Loader-B5YqzEYy.cjs.map → Loader-0Imnbael.cjs.map} +1 -1
  115. package/dist/Loader-fffFnQqS.js +28 -0
  116. package/dist/{Loader-BZIa8hwv.js.map → Loader-fffFnQqS.js.map} +1 -1
  117. package/dist/MobileFrame-8FSsYA_w.js +91 -0
  118. package/dist/MobileFrame-8FSsYA_w.js.map +1 -0
  119. package/dist/MobileFrame-Dsfgd_4k.cjs +2 -0
  120. package/dist/MobileFrame-Dsfgd_4k.cjs.map +1 -0
  121. package/dist/{Modal-0V-REVV-.cjs → Modal--e2qGisF.cjs} +2 -2
  122. package/dist/{Modal-0V-REVV-.cjs.map → Modal--e2qGisF.cjs.map} +1 -1
  123. package/dist/{Modal-B7yoFC3o.js → Modal-DJljaPqV.js} +3 -3
  124. package/dist/{Modal-B7yoFC3o.js.map → Modal-DJljaPqV.js.map} +1 -1
  125. package/dist/{MultiSelect-gj9Ymeh2.cjs → MultiSelect-CvecZeMU.cjs} +2 -2
  126. package/dist/{MultiSelect-gj9Ymeh2.cjs.map → MultiSelect-CvecZeMU.cjs.map} +1 -1
  127. package/dist/{MultiSelect-C8xuXaoR.js → MultiSelect-DLoS04lZ.js} +4 -4
  128. package/dist/{MultiSelect-C8xuXaoR.js.map → MultiSelect-DLoS04lZ.js.map} +1 -1
  129. package/dist/{NumberField-CEt95jcC.cjs → NumberField-C_HZXBuw.cjs} +2 -2
  130. package/dist/{NumberField-CEt95jcC.cjs.map → NumberField-C_HZXBuw.cjs.map} +1 -1
  131. package/dist/{NumberField-2yM0mmyj.js → NumberField-DYGVQdL5.js} +4 -4
  132. package/dist/{NumberField-2yM0mmyj.js.map → NumberField-DYGVQdL5.js.map} +1 -1
  133. package/dist/{OtpField-CkliY82J.js → OtpField-CpQr_ZqL.js} +3 -3
  134. package/dist/{OtpField-CkliY82J.js.map → OtpField-CpQr_ZqL.js.map} +1 -1
  135. package/dist/{OtpField-on-K0_fM.cjs → OtpField-DKbUP0F6.cjs} +2 -2
  136. package/dist/{OtpField-on-K0_fM.cjs.map → OtpField-DKbUP0F6.cjs.map} +1 -1
  137. package/dist/{PageLayout-DzPh_G6H.js → PageLayout-CCcPCfJF.js} +2 -2
  138. package/dist/{PageLayout-DzPh_G6H.js.map → PageLayout-CCcPCfJF.js.map} +1 -1
  139. package/dist/{PageLayout-DGHu7Vm3.cjs → PageLayout-CuWXukUv.cjs} +2 -2
  140. package/dist/{PageLayout-DGHu7Vm3.cjs.map → PageLayout-CuWXukUv.cjs.map} +1 -1
  141. package/dist/PageNotFound-JKOnpyHD.cjs +2 -0
  142. package/dist/{PageNotFound-B8_eIT8p.cjs.map → PageNotFound-JKOnpyHD.cjs.map} +1 -1
  143. package/dist/{PageNotFound-CCFfPHgA.js → PageNotFound-LWH2tU5E.js} +9 -9
  144. package/dist/{PageNotFound-CCFfPHgA.js.map → PageNotFound-LWH2tU5E.js.map} +1 -1
  145. package/dist/Pagination-BwtbmITJ.js +139 -0
  146. package/dist/{Pagination-CmskZjcz.js.map → Pagination-BwtbmITJ.js.map} +1 -1
  147. package/dist/Pagination-M7njqOUt.cjs +2 -0
  148. package/dist/{Pagination-BdVebW2L.cjs.map → Pagination-M7njqOUt.cjs.map} +1 -1
  149. package/dist/PaletteField-CUyzLrny.js +54 -0
  150. package/dist/PaletteField-CUyzLrny.js.map +1 -0
  151. package/dist/PaletteField-iBIvOvNi.cjs +2 -0
  152. package/dist/PaletteField-iBIvOvNi.cjs.map +1 -0
  153. package/dist/RadioGroup-Byy-eSY3.cjs +2 -0
  154. package/dist/{RadioGroup-C8u7eNBS.cjs.map → RadioGroup-Byy-eSY3.cjs.map} +1 -1
  155. package/dist/RadioGroup-D_1_Heta.js +141 -0
  156. package/dist/{RadioGroup-DbodUJW8.js.map → RadioGroup-D_1_Heta.js.map} +1 -1
  157. package/dist/RemoveDialog-DUrD2Em8.js +47 -0
  158. package/dist/{RemoveDialog-CV75B0aN.js.map → RemoveDialog-DUrD2Em8.js.map} +1 -1
  159. package/dist/RemoveDialog-FZWYAxRy.cjs +2 -0
  160. package/dist/{RemoveDialog-DmOk0ezc.cjs.map → RemoveDialog-FZWYAxRy.cjs.map} +1 -1
  161. package/dist/{RichTextEditor-Bm8FFbcR.js → RichTextEditor-CG6LoNiw.js} +9 -9
  162. package/dist/RichTextEditor-CG6LoNiw.js.map +1 -0
  163. package/dist/{RichTextEditor-uXddgtlk.cjs → RichTextEditor-mpMCG8jX.cjs} +2 -2
  164. package/dist/RichTextEditor-mpMCG8jX.cjs.map +1 -0
  165. package/dist/RootLayout-CPxDqfGb.cjs +2 -0
  166. package/dist/{RootLayout-kssj9exn.cjs.map → RootLayout-CPxDqfGb.cjs.map} +1 -1
  167. package/dist/RootLayout-D3K-pAMO.js +515 -0
  168. package/dist/{RootLayout-Cf7Rr9Iz.js.map → RootLayout-D3K-pAMO.js.map} +1 -1
  169. package/dist/{Select-CdX3Ks7y.js → Select-BB9oOoWZ.js} +3 -3
  170. package/dist/{Select-CdX3Ks7y.js.map → Select-BB9oOoWZ.js.map} +1 -1
  171. package/dist/{Select-7vEGJCvA.cjs → Select-iP2p5jad.cjs} +2 -2
  172. package/dist/{Select-7vEGJCvA.cjs.map → Select-iP2p5jad.cjs.map} +1 -1
  173. package/dist/{Sidebar-DcKIEfhy.cjs → Sidebar-Boi7UgHV.cjs} +2 -2
  174. package/dist/{Sidebar-DcKIEfhy.cjs.map → Sidebar-Boi7UgHV.cjs.map} +1 -1
  175. package/dist/{Sidebar-YH-DoNG9.js → Sidebar-CsPnv4mu.js} +60 -60
  176. package/dist/{Sidebar-YH-DoNG9.js.map → Sidebar-CsPnv4mu.js.map} +1 -1
  177. package/dist/Slider-D3dbEOQY.cjs +2 -0
  178. package/dist/{Slider-dxYVXRev.cjs.map → Slider-D3dbEOQY.cjs.map} +1 -1
  179. package/dist/Slider-D7SvowmM.js +184 -0
  180. package/dist/{Slider-oGXd5e9X.js.map → Slider-D7SvowmM.js.map} +1 -1
  181. package/dist/{SpeedDial-DWNuC6f8.js → SpeedDial-B8XMUATN.js} +2 -2
  182. package/dist/{SpeedDial-DWNuC6f8.js.map → SpeedDial-B8XMUATN.js.map} +1 -1
  183. package/dist/{SpeedDial-9_Yk8AGx.cjs → SpeedDial-CZ22T8GL.cjs} +2 -2
  184. package/dist/{SpeedDial-9_Yk8AGx.cjs.map → SpeedDial-CZ22T8GL.cjs.map} +1 -1
  185. package/dist/{Stepper-CuqFpamY.js → Stepper-B_e_PGZE.js} +70 -70
  186. package/dist/{Stepper-CuqFpamY.js.map → Stepper-B_e_PGZE.js.map} +1 -1
  187. package/dist/Stepper-BjkkWawQ.cjs +2 -0
  188. package/dist/{Stepper-B1z_u650.cjs.map → Stepper-BjkkWawQ.cjs.map} +1 -1
  189. package/dist/{SwatchPicker-CCJltwHI.cjs → SwatchPicker-C8amdDnA.cjs} +2 -2
  190. package/dist/{SwatchPicker-CCJltwHI.cjs.map → SwatchPicker-C8amdDnA.cjs.map} +1 -1
  191. package/dist/{SwatchPicker-CqyWngFJ.js → SwatchPicker-DXEE9xqY.js} +2 -2
  192. package/dist/{SwatchPicker-CqyWngFJ.js.map → SwatchPicker-DXEE9xqY.js.map} +1 -1
  193. package/dist/Switch-CodRZD3y.cjs +2 -0
  194. package/dist/{Switch-DRkZ6kHJ.cjs.map → Switch-CodRZD3y.cjs.map} +1 -1
  195. package/dist/Switch-ESrhkpJC.js +85 -0
  196. package/dist/{Switch-DMPJ0fhB.js.map → Switch-ESrhkpJC.js.map} +1 -1
  197. package/dist/Table-Cr1zUtNQ.cjs +2 -0
  198. package/dist/Table-Cr1zUtNQ.cjs.map +1 -0
  199. package/dist/{Table-Drdhfm99.js → Table-DdoUcZoN.js} +60 -51
  200. package/dist/Table-DdoUcZoN.js.map +1 -0
  201. package/dist/Tabs-CZDX7BN-.cjs +2 -0
  202. package/dist/{Tabs-BiKDy_fv.cjs.map → Tabs-CZDX7BN-.cjs.map} +1 -1
  203. package/dist/Tabs-v1GEGUDQ.js +190 -0
  204. package/dist/{Tabs-ytbBzAxG.js.map → Tabs-v1GEGUDQ.js.map} +1 -1
  205. package/dist/{TagsField-CEt_PC5y.js → TagsField-B389eDp4.js} +4 -4
  206. package/dist/{TagsField-CEt_PC5y.js.map → TagsField-B389eDp4.js.map} +1 -1
  207. package/dist/{TagsField-DpDbf0ru.cjs → TagsField-OfrpyHZO.cjs} +2 -2
  208. package/dist/{TagsField-DpDbf0ru.cjs.map → TagsField-OfrpyHZO.cjs.map} +1 -1
  209. package/dist/{TextField-BWdmF-HE.js → TextField-7MobCad5.js} +4 -4
  210. package/dist/{TextField-BWdmF-HE.js.map → TextField-7MobCad5.js.map} +1 -1
  211. package/dist/{TextField-Df_kGy2l.cjs → TextField-B785pRgK.cjs} +2 -2
  212. package/dist/{TextField-Df_kGy2l.cjs.map → TextField-B785pRgK.cjs.map} +1 -1
  213. package/dist/TextField.module-6gYcR9TL.js +27 -0
  214. package/dist/TextField.module-6gYcR9TL.js.map +1 -0
  215. package/dist/TextField.module-DsNCo8vN.cjs +2 -0
  216. package/dist/TextField.module-DsNCo8vN.cjs.map +1 -0
  217. package/dist/{ThemeToggle-CgxF6oUu.js → ThemeToggle-BGdvqXad.js} +3 -3
  218. package/dist/{ThemeToggle-CgxF6oUu.js.map → ThemeToggle-BGdvqXad.js.map} +1 -1
  219. package/dist/{ThemeToggle-BJdXhmfc.cjs → ThemeToggle-BkmZ7s_u.cjs} +2 -2
  220. package/dist/{ThemeToggle-BJdXhmfc.cjs.map → ThemeToggle-BkmZ7s_u.cjs.map} +1 -1
  221. package/dist/{TimeColumns-DxVN0V8l.cjs → TimeColumns-B-xm1DGM.cjs} +2 -2
  222. package/dist/{TimeColumns-DxVN0V8l.cjs.map → TimeColumns-B-xm1DGM.cjs.map} +1 -1
  223. package/dist/{TimeColumns-n-fz50mr.js → TimeColumns-BRlDKx_i.js} +3 -3
  224. package/dist/{TimeColumns-n-fz50mr.js.map → TimeColumns-BRlDKx_i.js.map} +1 -1
  225. package/dist/{TimePicker-Bopxx3zU.js → TimePicker-B_3Ubip0.js} +6 -6
  226. package/dist/{TimePicker-Bopxx3zU.js.map → TimePicker-B_3Ubip0.js.map} +1 -1
  227. package/dist/{TimePicker-DvoemiGz.cjs → TimePicker-DvEIdE4v.cjs} +2 -2
  228. package/dist/{TimePicker-DvoemiGz.cjs.map → TimePicker-DvEIdE4v.cjs.map} +1 -1
  229. package/dist/Timeline-CKEosWka.cjs +2 -0
  230. package/dist/{Timeline-ONU_3gi3.cjs.map → Timeline-CKEosWka.cjs.map} +1 -1
  231. package/dist/Timeline-ufVXmpMY.js +71 -0
  232. package/dist/{Timeline-D3kzt1dy.js.map → Timeline-ufVXmpMY.js.map} +1 -1
  233. package/dist/{Toaster-DZSzFse_.cjs → Toaster-BIFRuqbC.cjs} +2 -2
  234. package/dist/{Toaster-DZSzFse_.cjs.map → Toaster-BIFRuqbC.cjs.map} +1 -1
  235. package/dist/{Toaster-BxIY2H4V.js → Toaster-DuzcRbio.js} +2 -2
  236. package/dist/{Toaster-BxIY2H4V.js.map → Toaster-DuzcRbio.js.map} +1 -1
  237. package/dist/{TranslatedFields-BtDLkQy7.cjs → TranslatedFields-D_a0NVKI.cjs} +2 -2
  238. package/dist/{TranslatedFields-BtDLkQy7.cjs.map → TranslatedFields-D_a0NVKI.cjs.map} +1 -1
  239. package/dist/{TranslatedFields-DmR8LKSG.js → TranslatedFields-HmP0Mg5t.js} +5 -5
  240. package/dist/{TranslatedFields-DmR8LKSG.js.map → TranslatedFields-HmP0Mg5t.js.map} +1 -1
  241. package/dist/{UserCard-J8Bpbh3x.js → UserCard-B1phOVKj.js} +4 -4
  242. package/dist/{UserCard-J8Bpbh3x.js.map → UserCard-B1phOVKj.js.map} +1 -1
  243. package/dist/{UserCard-C1yFvVIc.cjs → UserCard-BvOcDm5W.cjs} +2 -2
  244. package/dist/{UserCard-C1yFvVIc.cjs.map → UserCard-BvOcDm5W.cjs.map} +1 -1
  245. package/dist/color-CgR8ybWZ.cjs +2 -0
  246. package/dist/color-CgR8ybWZ.cjs.map +1 -0
  247. package/dist/color-EQJ2DrcQ.js +24 -0
  248. package/dist/color-EQJ2DrcQ.js.map +1 -0
  249. package/dist/components/Alert/index.cjs +1 -1
  250. package/dist/components/Alert/index.js +1 -1
  251. package/dist/components/AuthLayout/index.cjs +1 -1
  252. package/dist/components/AuthLayout/index.js +1 -1
  253. package/dist/components/Avatar/index.cjs +1 -1
  254. package/dist/components/Avatar/index.js +2 -2
  255. package/dist/components/Badge/index.cjs +1 -1
  256. package/dist/components/Badge/index.js +1 -1
  257. package/dist/components/Breadcrumbs/index.cjs +1 -1
  258. package/dist/components/Breadcrumbs/index.js +1 -1
  259. package/dist/components/Button/index.cjs +1 -1
  260. package/dist/components/Button/index.js +1 -1
  261. package/dist/components/Card/index.cjs +1 -1
  262. package/dist/components/Card/index.js +1 -1
  263. package/dist/components/Chip/index.cjs +1 -1
  264. package/dist/components/Chip/index.js +1 -1
  265. package/dist/components/ChoiceCard/index.cjs +1 -1
  266. package/dist/components/ChoiceCard/index.js +1 -1
  267. package/dist/components/CodeBlock/index.cjs +1 -1
  268. package/dist/components/CodeBlock/index.js +1 -1
  269. package/dist/components/ColorPicker/ColorPicker.d.cts +5 -0
  270. package/dist/components/ColorPicker/ColorPicker.d.ts +5 -0
  271. package/dist/components/ColorPicker/ColorPickerPanel.d.cts +6 -1
  272. package/dist/components/ColorPicker/ColorPickerPanel.d.ts +6 -1
  273. package/dist/components/ColorPicker/colorUtils.d.cts +3 -12
  274. package/dist/components/ColorPicker/colorUtils.d.ts +3 -12
  275. package/dist/components/ColorPicker/index.cjs +1 -1
  276. package/dist/components/ColorPicker/index.js +1 -1
  277. package/dist/components/ColorRamp/ColorRamp.d.cts +36 -0
  278. package/dist/components/ColorRamp/ColorRamp.d.ts +36 -0
  279. package/dist/components/ColorRamp/index.cjs +2 -0
  280. package/dist/components/ColorRamp/index.cjs.map +1 -0
  281. package/dist/components/ColorRamp/index.d.cts +3 -0
  282. package/dist/components/ColorRamp/index.d.ts +3 -0
  283. package/dist/components/ColorRamp/index.js +6 -0
  284. package/dist/components/ColorRamp/index.js.map +1 -0
  285. package/dist/components/CopyButton/index.cjs +1 -1
  286. package/dist/components/CopyButton/index.js +1 -1
  287. package/dist/components/DashedButton/index.cjs +1 -1
  288. package/dist/components/DashedButton/index.js +1 -1
  289. package/dist/components/DatePicker/index.cjs +1 -1
  290. package/dist/components/DatePicker/index.js +1 -1
  291. package/dist/components/DateTimePicker/index.cjs +1 -1
  292. package/dist/components/DateTimePicker/index.js +1 -1
  293. package/dist/components/EmptyState/index.cjs +1 -1
  294. package/dist/components/EmptyState/index.js +1 -1
  295. package/dist/components/FileCard/index.cjs +1 -1
  296. package/dist/components/FileCard/index.js +1 -1
  297. package/dist/components/FileUploader/index.cjs +1 -1
  298. package/dist/components/FileUploader/index.js +1 -1
  299. package/dist/components/Flag/index.cjs +1 -1
  300. package/dist/components/Flag/index.js +1 -1
  301. package/dist/components/FullscreenToggle/index.cjs +1 -1
  302. package/dist/components/FullscreenToggle/index.js +1 -1
  303. package/dist/components/IconButton/index.cjs +1 -1
  304. package/dist/components/IconButton/index.js +1 -1
  305. package/dist/components/Loader/index.cjs +1 -1
  306. package/dist/components/Loader/index.js +1 -1
  307. package/dist/components/MobileFrame/MobileFrame.d.cts +45 -0
  308. package/dist/components/MobileFrame/MobileFrame.d.ts +45 -0
  309. package/dist/components/MobileFrame/frames.d.cts +27 -0
  310. package/dist/components/MobileFrame/frames.d.ts +27 -0
  311. package/dist/components/MobileFrame/index.cjs +2 -0
  312. package/dist/components/MobileFrame/index.cjs.map +1 -0
  313. package/dist/components/MobileFrame/index.d.cts +4 -0
  314. package/dist/components/MobileFrame/index.d.ts +4 -0
  315. package/dist/components/MobileFrame/index.js +8 -0
  316. package/dist/components/MobileFrame/index.js.map +1 -0
  317. package/dist/components/Modal/index.cjs +1 -1
  318. package/dist/components/Modal/index.js +1 -1
  319. package/dist/components/MultiSelect/index.cjs +1 -1
  320. package/dist/components/MultiSelect/index.js +1 -1
  321. package/dist/components/NumberField/index.cjs +1 -1
  322. package/dist/components/NumberField/index.js +1 -1
  323. package/dist/components/OtpField/index.cjs +1 -1
  324. package/dist/components/OtpField/index.js +1 -1
  325. package/dist/components/PageLayout/index.cjs +1 -1
  326. package/dist/components/PageLayout/index.js +1 -1
  327. package/dist/components/PageNotFound/index.cjs +1 -1
  328. package/dist/components/PageNotFound/index.js +1 -1
  329. package/dist/components/Pagination/index.cjs +1 -1
  330. package/dist/components/Pagination/index.js +1 -1
  331. package/dist/components/PaletteField/PaletteField.d.cts +30 -0
  332. package/dist/components/PaletteField/PaletteField.d.ts +30 -0
  333. package/dist/components/PaletteField/index.cjs +2 -0
  334. package/dist/components/PaletteField/index.cjs.map +1 -0
  335. package/dist/components/PaletteField/index.d.cts +2 -0
  336. package/dist/components/PaletteField/index.d.ts +2 -0
  337. package/dist/components/PaletteField/index.js +6 -0
  338. package/dist/components/PaletteField/index.js.map +1 -0
  339. package/dist/components/Radio/index.cjs +1 -1
  340. package/dist/components/Radio/index.js +1 -1
  341. package/dist/components/RemoveDialog/index.cjs +1 -1
  342. package/dist/components/RemoveDialog/index.js +1 -1
  343. package/dist/components/RichTextEditor/index.cjs +1 -1
  344. package/dist/components/RichTextEditor/index.js +1 -1
  345. package/dist/components/RootLayout/index.cjs +1 -1
  346. package/dist/components/RootLayout/index.js +1 -1
  347. package/dist/components/Select/index.cjs +1 -1
  348. package/dist/components/Select/index.js +1 -1
  349. package/dist/components/Sidebar/index.cjs +1 -1
  350. package/dist/components/Sidebar/index.js +1 -1
  351. package/dist/components/Slider/index.cjs +1 -1
  352. package/dist/components/Slider/index.js +1 -1
  353. package/dist/components/SpeedDial/index.cjs +1 -1
  354. package/dist/components/SpeedDial/index.js +1 -1
  355. package/dist/components/Stepper/index.cjs +1 -1
  356. package/dist/components/Stepper/index.js +1 -1
  357. package/dist/components/SwatchPicker/index.cjs +1 -1
  358. package/dist/components/SwatchPicker/index.js +1 -1
  359. package/dist/components/Switch/index.cjs +1 -1
  360. package/dist/components/Switch/index.js +1 -1
  361. package/dist/components/Table/index.cjs +1 -1
  362. package/dist/components/Table/index.js +1 -1
  363. package/dist/components/Tabs/index.cjs +1 -1
  364. package/dist/components/Tabs/index.js +1 -1
  365. package/dist/components/TagsField/index.cjs +1 -1
  366. package/dist/components/TagsField/index.js +1 -1
  367. package/dist/components/TextField/index.cjs +1 -1
  368. package/dist/components/TextField/index.js +1 -1
  369. package/dist/components/ThemeToggle/index.cjs +1 -1
  370. package/dist/components/ThemeToggle/index.js +1 -1
  371. package/dist/components/TimePicker/index.cjs +1 -1
  372. package/dist/components/TimePicker/index.js +1 -1
  373. package/dist/components/Timeline/index.cjs +1 -1
  374. package/dist/components/Timeline/index.js +1 -1
  375. package/dist/components/Toast/index.cjs +1 -1
  376. package/dist/components/Toast/index.js +1 -1
  377. package/dist/components/TranslatedFields/index.cjs +1 -1
  378. package/dist/components/TranslatedFields/index.js +1 -1
  379. package/dist/components/UserCard/index.cjs +1 -1
  380. package/dist/components/UserCard/index.js +1 -1
  381. package/dist/components/index.d.cts +3 -0
  382. package/dist/components/index.d.ts +3 -0
  383. package/dist/entries/app.cjs +1 -1
  384. package/dist/entries/app.js +1 -1
  385. package/dist/entries/components.cjs +1 -1
  386. package/dist/entries/components.js +149 -141
  387. package/dist/entries/components.js.map +1 -1
  388. package/dist/entries/helpers.cjs +1 -1
  389. package/dist/entries/helpers.d.cts +2 -0
  390. package/dist/entries/helpers.d.ts +2 -0
  391. package/dist/entries/helpers.js +18 -8
  392. package/dist/entries/helpers.js.map +1 -1
  393. package/dist/entries/i18n.cjs +1 -1
  394. package/dist/entries/i18n.js +2 -2
  395. package/dist/entries/theme.cjs +1 -1
  396. package/dist/entries/theme.js +1 -1
  397. package/dist/helpers/color.d.cts +17 -0
  398. package/dist/helpers/color.d.ts +17 -0
  399. package/dist/helpers/palette.d.cts +68 -0
  400. package/dist/helpers/palette.d.ts +68 -0
  401. package/dist/i18n/messages.d.cts +11 -0
  402. package/dist/i18n/messages.d.ts +11 -0
  403. package/dist/index.cjs +1 -1
  404. package/dist/index.css +16 -12
  405. package/dist/index.js +211 -193
  406. package/dist/index.js.map +1 -1
  407. package/dist/{messages-ogohLC5P.js → messages-B06Kl5rI.js} +100 -23
  408. package/dist/messages-B06Kl5rI.js.map +1 -0
  409. package/dist/{messages-DKT0SRM0.cjs → messages-CJqxqL3t.cjs} +9 -9
  410. package/dist/messages-CJqxqL3t.cjs.map +1 -0
  411. package/dist/palette-B031dM4E.js +70 -0
  412. package/dist/palette-B031dM4E.js.map +1 -0
  413. package/dist/palette-BycMHbED.cjs +2 -0
  414. package/dist/palette-BycMHbED.cjs.map +1 -0
  415. package/dist/theme/ConfigProvider.d.cts +8 -8
  416. package/dist/theme/ConfigProvider.d.ts +8 -8
  417. package/package.json +1 -1
  418. package/dist/Avatar-Dgf04PBC.cjs +0 -2
  419. package/dist/Badge-BQpr2Jee.cjs +0 -2
  420. package/dist/Badge-DSWigoGC.js +0 -50
  421. package/dist/Button-CXmDOzPk.cjs +0 -2
  422. package/dist/Button-DBs8xnA5.js +0 -72
  423. package/dist/Chip-gUH_7nQc.cjs +0 -2
  424. package/dist/ChoiceCardGroup-DBohUnRj.js +0 -181
  425. package/dist/ChoiceCardGroup-d0VVTUi5.cjs +0 -2
  426. package/dist/ColorPicker-DtzFwNWk.cjs +0 -2
  427. package/dist/ColorPicker-DtzFwNWk.cjs.map +0 -1
  428. package/dist/ColorPicker-Dw6Qk0iy.js.map +0 -1
  429. package/dist/ColorPickerPanel--wBX-m7J.cjs +0 -2
  430. package/dist/ColorPickerPanel--wBX-m7J.cjs.map +0 -1
  431. package/dist/ColorPickerPanel-Dp7bnnVf.js +0 -336
  432. package/dist/ColorPickerPanel-Dp7bnnVf.js.map +0 -1
  433. package/dist/ConfigProvider-Bszl3Wr3.cjs.map +0 -1
  434. package/dist/ConfigProvider-DR9YMy9U.js.map +0 -1
  435. package/dist/CopyButton-Ct-8AmmX.cjs +0 -2
  436. package/dist/CopyButton-DJ1PSJZU.js +0 -31
  437. package/dist/DashedButton-3C4IZuo4.cjs +0 -2
  438. package/dist/DashedButton-BXZAyMtw.js +0 -59
  439. package/dist/DatePicker.module-BZDftL4g.js +0 -138
  440. package/dist/DatePicker.module-tE-tGNBd.cjs +0 -2
  441. package/dist/EmptyState-BTd7aVgu.js +0 -38
  442. package/dist/EmptyState-Bv4XXnD1.cjs +0 -2
  443. package/dist/FileUploader-B7VfhcR7.cjs +0 -2
  444. package/dist/FileUploader-B7VfhcR7.cjs.map +0 -1
  445. package/dist/FileUploader-BYF5FvUc.js.map +0 -1
  446. package/dist/IconButton-BEGWfcVc.js +0 -68
  447. package/dist/IconButton-BN-bZxEi.cjs +0 -2
  448. package/dist/Loader-B5YqzEYy.cjs +0 -2
  449. package/dist/Loader-BZIa8hwv.js +0 -29
  450. package/dist/PageNotFound-B8_eIT8p.cjs +0 -2
  451. package/dist/Pagination-BdVebW2L.cjs +0 -2
  452. package/dist/Pagination-CmskZjcz.js +0 -139
  453. package/dist/RadioGroup-C8u7eNBS.cjs +0 -2
  454. package/dist/RadioGroup-DbodUJW8.js +0 -141
  455. package/dist/RemoveDialog-CV75B0aN.js +0 -47
  456. package/dist/RemoveDialog-DmOk0ezc.cjs +0 -2
  457. package/dist/RichTextEditor-Bm8FFbcR.js.map +0 -1
  458. package/dist/RichTextEditor-uXddgtlk.cjs.map +0 -1
  459. package/dist/RootLayout-Cf7Rr9Iz.js +0 -515
  460. package/dist/RootLayout-kssj9exn.cjs +0 -2
  461. package/dist/Slider-dxYVXRev.cjs +0 -2
  462. package/dist/Slider-oGXd5e9X.js +0 -184
  463. package/dist/Stepper-B1z_u650.cjs +0 -2
  464. package/dist/Switch-DMPJ0fhB.js +0 -85
  465. package/dist/Switch-DRkZ6kHJ.cjs +0 -2
  466. package/dist/Table-BPit83Pn.cjs +0 -2
  467. package/dist/Table-BPit83Pn.cjs.map +0 -1
  468. package/dist/Table-Drdhfm99.js.map +0 -1
  469. package/dist/Tabs-BiKDy_fv.cjs +0 -2
  470. package/dist/Tabs-ytbBzAxG.js +0 -190
  471. package/dist/TextField.module-QePvGeJ3.js +0 -27
  472. package/dist/TextField.module-QePvGeJ3.js.map +0 -1
  473. package/dist/TextField.module-m-UllwzG.cjs +0 -2
  474. package/dist/TextField.module-m-UllwzG.cjs.map +0 -1
  475. package/dist/Timeline-D3kzt1dy.js +0 -71
  476. package/dist/Timeline-ONU_3gi3.cjs +0 -2
  477. package/dist/messages-DKT0SRM0.cjs.map +0 -1
  478. package/dist/messages-ogohLC5P.js.map +0 -1
@@ -1,119 +1,119 @@
1
1
  import { jsxs as b, jsx as r, Fragment as H } from "react/jsx-runtime";
2
- import { forwardRef as tt, useCallback as y, useState as nt, useRef as p, useEffect as I } from "react";
3
- import { clsx as L } from "clsx";
2
+ import { forwardRef as tt, useCallback as I, useState as nt, useRef as w, useEffect as L } from "react";
3
+ import { clsx as x } from "clsx";
4
4
  import { a as et } from "./names-r21QPjcU.js";
5
5
  import { I as O } from "./Icon-DaTvzLBu.js";
6
- import { j as ot } from "./ConfigProvider-DR9YMy9U.js";
7
- const rt = "_root_1xfvk_2", ct = "_list_1xfvk_5", lt = "_horizontal_1xfvk_11", st = "_vertical_1xfvk_24", at = "_sm_1xfvk_29", it = "_md_1xfvk_34", dt = "_lg_1xfvk_39", ft = "_step_1xfvk_47", ut = "_disabled_1xfvk_64", _t = "_main_1xfvk_69", mt = "_indicator_1xfvk_99", vt = "_number_1xfvk_125", ht = "_completed_1xfvk_130", bt = "_active_1xfvk_136", pt = "_error_1xfvk_144", xt = "_text_1xfvk_151", wt = "_label_1xfvk_167", kt = "_description_1xfvk_181", Nt = "_optional_1xfvk_186", gt = "_connector_1xfvk_193", yt = "_done_1xfvk_198", It = "_panel_1xfvk_224", Lt = "_stepContent_1xfvk_228", e = {
6
+ import { j as ot } from "./ConfigProvider-DL9fylMo.js";
7
+ const rt = "_root_p6koa_2", ct = "_list_p6koa_5", at = "_horizontal_p6koa_11", lt = "_vertical_p6koa_24", st = "_sm_p6koa_29", it = "_md_p6koa_34", dt = "_lg_p6koa_39", ut = "_step_p6koa_47", _t = "_disabled_p6koa_64", mt = "_main_p6koa_69", pt = "_indicator_p6koa_99", ft = "_number_p6koa_125", ht = "_completed_p6koa_130", bt = "_active_p6koa_136", wt = "_error_p6koa_144", vt = "_text_p6koa_151", kt = "_label_p6koa_167", Nt = "_description_p6koa_181", gt = "_optional_p6koa_186", yt = "_connector_p6koa_193", It = "_done_p6koa_198", Lt = "_panel_p6koa_224", xt = "_stepContent_p6koa_228", e = {
8
8
  root: rt,
9
9
  list: ct,
10
- horizontal: lt,
11
- vertical: st,
12
- sm: at,
10
+ horizontal: at,
11
+ vertical: lt,
12
+ sm: st,
13
13
  md: it,
14
14
  lg: dt,
15
- step: ft,
16
- disabled: ut,
17
- main: _t,
18
- indicator: mt,
19
- number: vt,
15
+ step: ut,
16
+ disabled: _t,
17
+ main: mt,
18
+ indicator: pt,
19
+ number: ft,
20
20
  completed: ht,
21
21
  active: bt,
22
- error: pt,
23
- text: xt,
24
- label: wt,
25
- description: kt,
26
- optional: Nt,
27
- connector: gt,
28
- done: yt,
29
- panel: It,
30
- stepContent: Lt
22
+ error: wt,
23
+ text: vt,
24
+ label: kt,
25
+ description: Nt,
26
+ optional: gt,
27
+ connector: yt,
28
+ done: It,
29
+ panel: Lt,
30
+ stepContent: xt
31
31
  }, Rt = new Set(et), Pt = tt(function({
32
- steps: a,
33
- activeStep: f,
32
+ steps: s,
33
+ activeStep: u,
34
34
  defaultStep: R,
35
35
  onStepChange: d,
36
36
  queryKey: E,
37
37
  pushHistory: z = !1,
38
- orientation: u = "horizontal",
39
- size: x = "md",
38
+ orientation: _ = "horizontal",
39
+ size: v = "md",
40
40
  color: $ = "primary",
41
- onStepClick: _,
41
+ onStepClick: m,
42
42
  "aria-label": T,
43
43
  className: U,
44
44
  style: W
45
45
  }, q) {
46
46
  var C;
47
- const Q = u === "vertical", F = _ != null, D = ot(), l = E === !0 ? D : E || void 0, m = y(
48
- (t) => t != null && Number.isInteger(t) && t >= 0 && t < a.length && !a[t].disabled,
49
- [a]
50
- ), w = y(() => {
51
- if (!l || typeof window > "u") return null;
52
- const t = new URLSearchParams(window.location.search).get(l);
47
+ const Q = _ === "vertical", F = m != null, D = ot(), a = E === !0 ? D : E || void 0, p = I(
48
+ (t) => t != null && Number.isInteger(t) && t >= 0 && t < s.length && !s[t].disabled,
49
+ [s]
50
+ ), k = I(() => {
51
+ if (!a || typeof window > "u") return null;
52
+ const t = new URLSearchParams(window.location.search).get(a);
53
53
  return t != null && /^\d+$/.test(t) ? Number(t) - 1 : null;
54
- }, [l]), G = Math.max(
55
- a.findIndex((t) => !t.disabled),
54
+ }, [a]), G = Math.max(
55
+ s.findIndex((t) => !t.disabled),
56
56
  0
57
57
  ), [J, j] = nt(() => {
58
- const t = w();
59
- return m(t) ? t : m(R) ? R : G;
60
- }), A = f !== void 0, o = A ? f : J, k = p(o);
61
- k.current = o;
62
- const v = p(d);
63
- v.current = d;
64
- const N = p(!1), M = y(
58
+ const t = k();
59
+ return p(t) ? t : p(R) ? R : G;
60
+ }), A = u !== void 0, o = A ? u : J, N = w(o);
61
+ N.current = o;
62
+ const f = w(d);
63
+ f.current = d;
64
+ const g = w(!1), M = I(
65
65
  (t, n) => {
66
- if (!l || typeof window > "u") return;
67
- const c = new URLSearchParams(window.location.search), s = String(t + 1);
68
- if (c.get(l) === s) return;
69
- c.set(l, s);
66
+ if (!a || typeof window > "u") return;
67
+ const c = new URLSearchParams(window.location.search), l = String(t + 1);
68
+ if (c.get(a) === l) return;
69
+ c.set(a, l);
70
70
  const i = `${window.location.pathname}?${c.toString()}${window.location.hash}`;
71
71
  window.history[n ? "pushState" : "replaceState"](window.history.state, "", i);
72
72
  },
73
- [l]
73
+ [a]
74
74
  ), S = (t) => {
75
- t !== k.current && (N.current = !0, A || j(t), d == null || d(t));
75
+ t !== N.current && (g.current = !0, A || j(t), d == null || d(t));
76
76
  };
77
- I(() => {
78
- if (!l || typeof window > "u" || !Number.isInteger(o) || o < 0 || o >= a.length) return;
79
- const t = N.current && z;
80
- N.current = !1, M(o, t);
81
- }, [l, o, z, M, a.length]), I(() => {
82
- if (!l || typeof window > "u") return;
77
+ L(() => {
78
+ if (!a || typeof window > "u" || !Number.isInteger(o) || o < 0 || o >= s.length) return;
79
+ const t = g.current && z;
80
+ g.current = !1, M(o, t);
81
+ }, [a, o, z, M, s.length]), L(() => {
82
+ if (!a || typeof window > "u") return;
83
83
  const t = () => {
84
84
  var c;
85
- const n = w();
86
- m(n) && n !== k.current && (f === void 0 && j(n), (c = v.current) == null || c.call(v, n));
85
+ const n = k();
86
+ p(n) && n !== N.current && (u === void 0 && j(n), (c = f.current) == null || c.call(f, n));
87
87
  };
88
88
  return window.addEventListener("popstate", t), () => window.removeEventListener("popstate", t);
89
- }, [l, w, m, f]);
90
- const P = (C = a[o]) == null ? void 0 : C.content, B = p(null);
91
- I(() => {
92
- if (u === "vertical") return;
89
+ }, [a, k, p, u]);
90
+ const P = (C = s[o]) == null ? void 0 : C.content, B = w(null);
91
+ L(() => {
92
+ if (_ === "vertical") return;
93
93
  const t = B.current, n = t == null ? void 0 : t.children[o];
94
94
  if (!t || !n) return;
95
- const c = t.getBoundingClientRect(), s = n.getBoundingClientRect(), i = s.left - c.left + t.scrollLeft, h = i + s.width;
95
+ const c = t.getBoundingClientRect(), l = n.getBoundingClientRect(), i = l.left - c.left + t.scrollLeft, h = i + l.width;
96
96
  i < t.scrollLeft ? t.scrollLeft = i : h > t.scrollLeft + t.clientWidth && (t.scrollLeft = h - t.clientWidth);
97
- }, [o, u]);
98
- const V = (t) => typeof t == "string" && Rt.has(t) ? /* @__PURE__ */ r(O, { name: t, size: x }) : t;
97
+ }, [o, _]);
98
+ const V = (t) => typeof t == "string" && Rt.has(t) ? /* @__PURE__ */ r(O, { name: t, size: v }) : t;
99
99
  return /* @__PURE__ */ b(
100
100
  "div",
101
101
  {
102
102
  ref: q,
103
- className: L(e.root, e[u], e[x], U),
103
+ className: x(e.root, e[_], e[v], U),
104
104
  style: {
105
105
  "--tz-btn-rgb": `var(--tz-color-${$}-rgb)`,
106
106
  "--tz-btn-on": `var(--tz-color-${$}-contrast, #fff)`,
107
107
  ...W
108
108
  },
109
109
  children: [
110
- /* @__PURE__ */ r("ol", { ref: B, "aria-label": T, className: e.list, children: a.map((t, n) => {
111
- const c = !!t.error, s = !c && (t.completed || n < o), i = !c && !s && n === o, h = c ? "error" : s ? "completed" : i ? "active" : "upcoming", X = n === a.length - 1, g = V(t.icon), Y = g ?? (s ? /* @__PURE__ */ r(O, { name: "Check", size: x }) : /* @__PURE__ */ r("span", { className: e.number, children: n + 1 })), Z = t.label != null || t.description != null || t.optional != null, K = /* @__PURE__ */ b(H, { children: [
110
+ /* @__PURE__ */ r("ol", { ref: B, "aria-label": T, className: e.list, children: s.map((t, n) => {
111
+ const c = !!t.error, l = !c && (t.completed || n < o), i = !c && !l && n === o, h = c ? "error" : l ? "completed" : i ? "active" : "upcoming", X = n === s.length - 1, y = V(t.icon), Y = y ?? (l ? /* @__PURE__ */ r(O, { name: "Check", size: v }) : /* @__PURE__ */ r("span", { className: e.number, children: n + 1 })), Z = t.label != null || t.description != null || t.optional != null, K = /* @__PURE__ */ b(H, { children: [
112
112
  /* @__PURE__ */ r(
113
113
  "span",
114
114
  {
115
115
  className: e.indicator,
116
- "aria-hidden": g == null && !s ? void 0 : !0,
116
+ "aria-hidden": y == null && !l ? void 0 : !0,
117
117
  children: Y
118
118
  }
119
119
  ),
@@ -126,7 +126,7 @@ const rt = "_root_1xfvk_2", ct = "_list_1xfvk_5", lt = "_horizontal_1xfvk_11", s
126
126
  return /* @__PURE__ */ b(
127
127
  "li",
128
128
  {
129
- className: L(e.step, e[h], t.disabled && e.disabled),
129
+ className: x(e.step, e[h], t.disabled && e.disabled),
130
130
  children: [
131
131
  F ? /* @__PURE__ */ r(
132
132
  "button",
@@ -136,7 +136,7 @@ const rt = "_root_1xfvk_2", ct = "_list_1xfvk_5", lt = "_horizontal_1xfvk_11", s
136
136
  disabled: t.disabled,
137
137
  "aria-current": i ? "step" : void 0,
138
138
  onClick: () => {
139
- _ == null || _(n), S(n);
139
+ m == null || m(n), S(n);
140
140
  },
141
141
  children: K
142
142
  }
@@ -144,7 +144,7 @@ const rt = "_root_1xfvk_2", ct = "_list_1xfvk_5", lt = "_horizontal_1xfvk_11", s
144
144
  !X && /* @__PURE__ */ r(
145
145
  "span",
146
146
  {
147
- className: L(e.connector, n < o && e.done),
147
+ className: x(e.connector, n < o && e.done),
148
148
  "aria-hidden": "true"
149
149
  }
150
150
  ),
@@ -162,4 +162,4 @@ const rt = "_root_1xfvk_2", ct = "_list_1xfvk_5", lt = "_horizontal_1xfvk_11", s
162
162
  export {
163
163
  Pt as S
164
164
  };
165
- //# sourceMappingURL=Stepper-CuqFpamY.js.map
165
+ //# sourceMappingURL=Stepper-B_e_PGZE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper-CuqFpamY.js","sources":["../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useStepQueryKey, type ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Icon } from '../Icon'\nimport styles from './Stepper.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type StepperOrientation = 'horizontal' | 'vertical'\nexport type StepperSize = 'sm' | 'md' | 'lg'\n\nexport interface StepItem {\n /** Step label. */\n label?: ReactNode\n /** Muted secondary line under the label. */\n description?: ReactNode\n /** Muted caption under the label (e.g. `\"Optional\"`). */\n optional?: ReactNode\n /** Override the step's number indicator with an icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Force the **completed** look regardless of the active step (e.g. an already-saved step). */\n completed?: boolean\n /** Marks the step **invalid** — a red indicator + label (e.g. its form section failed validation). */\n error?: boolean\n /** Disables the step — dimmed, (when clickable) not selectable, and skipped by the URL restore. */\n disabled?: boolean\n /**\n * Panel content rendered while this step is active — **below the strip** in horizontal mode, and\n * **inline under the step** (indented beside the rail) in vertical mode. Optional.\n */\n content?: ReactNode\n}\n\nexport interface StepperProps {\n /** The steps, in order. */\n steps: StepItem[]\n /**\n * Controlled current step index (**0-based**). Steps before it read **completed**, the one at it is\n * **active**, and those after it are **upcoming**. Omit for uncontrolled (see `defaultStep`).\n */\n activeStep?: number\n /**\n * Initial step index (uncontrolled). Falls back to the URL query (when URL sync is active and the\n * param is present) and otherwise the first enabled step.\n */\n defaultStep?: number\n /**\n * Fires with the next step index whenever the stepper itself changes the step — a clicked step head,\n * or a Back/Forward `popstate` restore. In controlled mode apply it to your `activeStep` state.\n */\n onStepChange?: (index: number) => void\n /**\n * **Opt-in** URL sync — **off by default** (the URL is never touched when omitted). Pass the bare\n * prop (**`queryKey`** / `true`) to sync the active step under the configured `keys.stepQueryKey`\n * (else `'step'`), or a **string** for a custom param name. The URL value is **1-based**\n * (`?step=2` = index 1) and a page refresh restores it. Two synced steppers on one page need\n * distinct keys.\n */\n queryKey?: boolean | string\n /**\n * Push a history entry on each step change, so the browser **Back** button returns to the previous\n * step. Defaults to `false` — step changes **replace** the URL, so Back leaves the page instead of\n * stepping back through the wizard (and `popstate` still restores a step when one is in the query).\n */\n pushHistory?: boolean\n /**\n * Layout direction. `horizontal` (default) centers each label **under** its circle and **scrolls\n * sideways** when the steps don't fit (so it fits a phone as-is); `vertical` stacks the steps along\n * a rail connector.\n */\n orientation?: StepperOrientation\n /** Preset size. Defaults to `'md'`. */\n size?: StepperSize\n /** Theme palette token tinting the active / completed steps. Defaults to `'primary'`. */\n color?: ThemeColor\n /**\n * Makes steps **clickable** — each step head becomes a `<button>` that fires this with the step index\n * (a `disabled` step never fires); an uncontrolled stepper also selects the clicked step itself. Omit\n * for a display-only progress indicator.\n */\n onStepClick?: (index: number) => void\n /** Accessible label for the stepper list. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A step progress indicator. Data-driven via `steps` (each: `label`, `description`, `optional`, `icon`,\n * `completed`, `error`, `disabled`, `content`) — controlled (`activeStep`, 0-based) or uncontrolled\n * (`defaultStep`). **Opt-in URL sync:** pass **`queryKey`** (bare/`true` = the configured\n * `keys.stepQueryKey`, else `'step'`; or a custom string) and the active step syncs to that query param\n * (**1-based** — `?step=2`) so a refresh restores it; with no `queryKey` the URL is never touched.\n * Synced step changes **replace** the URL (Back doesn't walk the wizard); pass **`pushHistory`** to\n * step back with Back.\n * Horizontal (labels centered under the circles) or `vertical` (a rail); when the horizontal steps\n * don't fit, the strip **scrolls sideways** (scrollbar hidden, the active step kept in view) — so it\n * fits a phone as-is. The active step's **`content`** renders below the strip (horizontal) or inline\n * under the step (vertical). Pass **`onStepClick`** to make the steps navigable. Tinted by `color` via\n * the shared `--tz-btn-rgb` pattern; the list is an `<ol>` with `aria-current=\"step\"` on the active step.\n */\nexport const Stepper = forwardRef<HTMLDivElement, StepperProps>(function Stepper(\n {\n steps,\n activeStep,\n defaultStep,\n onStepChange,\n queryKey,\n pushHistory = false,\n orientation = 'horizontal',\n size = 'md',\n color = 'primary',\n onStepClick,\n 'aria-label': ariaLabel,\n className,\n style,\n },\n ref,\n) {\n const vertical = orientation === 'vertical'\n const clickable = onStepClick != null\n\n // resolve the URL-sync key — OPT-IN: omitted/false = no sync (URL untouched); the bare/`true` form\n // uses the configured default (`keys.stepQueryKey`, else 'step'); a string is a custom param name\n const stepQueryKey = useStepQueryKey()\n const syncKey = queryKey === true ? stepQueryKey : queryKey || undefined\n\n const isSelectable = useCallback(\n (i: number | null | undefined): i is number =>\n i != null && Number.isInteger(i) && i >= 0 && i < steps.length && !steps[i].disabled,\n [steps],\n )\n\n // the URL carries the step 1-based (`?step=2` = index 1) — human-friendly, like Table's page param\n const readQuery = useCallback((): number | null => {\n if (!syncKey || typeof window === 'undefined') return null\n const raw = new URLSearchParams(window.location.search).get(syncKey)\n return raw != null && /^\\d+$/.test(raw) ? Number(raw) - 1 : null\n }, [syncKey])\n\n const firstEnabled = Math.max(\n steps.findIndex((s) => !s.disabled),\n 0,\n )\n\n const [internal, setInternal] = useState<number>(() => {\n const q = readQuery()\n if (isSelectable(q)) return q\n return isSelectable(defaultStep) ? defaultStep : firstEnabled\n })\n const isControlled = activeStep !== undefined\n // controlled mode renders the given index verbatim (even past the last step — the \"all completed\"\n // pattern); only the URL/popstate restores are gated by `isSelectable`\n const active = isControlled ? activeStep : internal\n\n // keep the latest active / onStepChange / push-intent for the stable effects + popstate listener\n const activeRef = useRef(active)\n activeRef.current = active\n const onStepChangeRef = useRef(onStepChange)\n onStepChangeRef.current = onStepChange\n const pushIntent = useRef(false)\n\n const writeQuery = useCallback(\n (next: number, push: boolean) => {\n if (!syncKey || typeof window === 'undefined') return\n const params = new URLSearchParams(window.location.search)\n const value = String(next + 1)\n if (params.get(syncKey) === value) return\n params.set(syncKey, value)\n const url = `${window.location.pathname}?${params.toString()}${window.location.hash}`\n window.history[push ? 'pushState' : 'replaceState'](window.history.state, '', url)\n },\n [syncKey],\n )\n\n const select = (next: number) => {\n if (next === activeRef.current) return\n pushIntent.current = true\n if (!isControlled) setInternal(next)\n onStepChange?.(next)\n }\n\n // mirror the active step into the URL whenever it changes (and on mount = canonicalize). A\n // user-driven change `push`es when `pushHistory`; programmatic / popstate changes just `replace`.\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n // an out-of-range active (e.g. `steps.length` = \"all done\") isn't a step — leave the URL alone\n if (!Number.isInteger(active) || active < 0 || active >= steps.length) return\n const push = pushIntent.current && pushHistory\n pushIntent.current = false\n writeQuery(active, push)\n }, [syncKey, active, pushHistory, writeQuery, steps.length])\n\n // Back/Forward → restore the step from the query\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n const onPopState = () => {\n const q = readQuery()\n if (isSelectable(q) && q !== activeRef.current) {\n if (activeStep === undefined) setInternal(q)\n onStepChangeRef.current?.(q)\n }\n }\n window.addEventListener('popstate', onPopState)\n return () => window.removeEventListener('popstate', onPopState)\n }, [syncKey, readQuery, isSelectable, activeStep])\n\n const activeContent = steps[active]?.content\n\n // when the horizontal strip overflows (scrolls sideways), keep the active step in view — by moving\n // the strip's own scrollLeft only. (scrollIntoView would also scroll every scrollable ancestor —\n // i.e. the page itself — yanking the viewport down to the stepper on mount.)\n const listRef = useRef<HTMLOListElement | null>(null)\n useEffect(() => {\n if (orientation === 'vertical') return // the vertical rail never scrolls sideways\n const list = listRef.current\n const el = list?.children[active] as HTMLElement | undefined\n if (!list || !el) return\n const listRect = list.getBoundingClientRect()\n const elRect = el.getBoundingClientRect()\n const left = elRect.left - listRect.left + list.scrollLeft\n const right = left + elRect.width\n if (left < list.scrollLeft) list.scrollLeft = left\n else if (right > list.scrollLeft + list.clientWidth) list.scrollLeft = right - list.clientWidth\n }, [active, orientation])\n\n const renderIcon = (icon: StepItem['icon']) =>\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={size} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles[orientation], styles[size], className)}\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 >\n <ol ref={listRef} aria-label={ariaLabel} className={styles.list}>\n {steps.map((step, i) => {\n const isError = !!step.error\n const isCompleted = !isError && (step.completed || i < active)\n const isActive = !isError && !isCompleted && i === active\n const state = isError\n ? 'error'\n : isCompleted\n ? 'completed'\n : isActive\n ? 'active'\n : 'upcoming'\n const isLast = i === steps.length - 1\n\n const icon = renderIcon(step.icon)\n const indicator =\n icon != null ? (\n icon\n ) : isCompleted ? (\n <Icon name=\"Check\" size={size} />\n ) : (\n <span className={styles.number}>{i + 1}</span>\n )\n\n const hasText = step.label != null || step.description != null || step.optional != null\n const head = (\n <>\n <span\n className={styles.indicator}\n aria-hidden={icon == null && !isCompleted ? undefined : true}\n >\n {indicator}\n </span>\n {hasText && (\n <span className={styles.text}>\n {step.label != null && <span className={styles.label}>{step.label}</span>}\n {step.description != null && (\n <span className={styles.description}>{step.description}</span>\n )}\n {step.optional != null && (\n <span className={styles.optional}>{step.optional}</span>\n )}\n </span>\n )}\n </>\n )\n\n return (\n <li\n key={i}\n className={clsx(styles.step, styles[state], step.disabled && styles.disabled)}\n >\n {clickable ? (\n <button\n type=\"button\"\n className={styles.main}\n disabled={step.disabled}\n aria-current={isActive ? 'step' : undefined}\n onClick={() => {\n onStepClick?.(i)\n select(i)\n }}\n >\n {head}\n </button>\n ) : (\n <div className={styles.main} aria-current={isActive ? 'step' : undefined}>\n {head}\n </div>\n )}\n {!isLast && (\n <span\n className={clsx(styles.connector, i < active && styles.done)}\n aria-hidden=\"true\"\n />\n )}\n {/* vertical: the active step's content sits inline, indented beside the rail */}\n {vertical && i === active && step.content != null && (\n <div className={styles.stepContent}>{step.content}</div>\n )}\n </li>\n )\n })}\n </ol>\n {/* horizontal: the active step's content renders as a panel below the strip */}\n {!vertical && activeContent != null && <div className={styles.panel}>{activeContent}</div>}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Stepper","forwardRef","steps","activeStep","defaultStep","onStepChange","queryKey","pushHistory","orientation","size","color","onStepClick","ariaLabel","className","style","ref","vertical","clickable","stepQueryKey","useStepQueryKey","syncKey","isSelectable","useCallback","i","readQuery","raw","firstEnabled","s","internal","setInternal","useState","q","isControlled","active","activeRef","useRef","onStepChangeRef","pushIntent","writeQuery","next","push","params","value","url","select","useEffect","onPopState","_a","activeContent","listRef","list","el","listRect","elRect","left","right","renderIcon","icon","jsx","Icon","jsxs","clsx","styles","step","isError","isCompleted","isActive","state","isLast","indicator","hasText","head","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAeMA,KAAgB,IAAI,IAAYC,EAAU,GA+FnCC,KAAUC,GAAyC,SAC9D;AAAA,EACE,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC,IAAc;AAAA,EACd,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,aAAAC;AAAA,EACA,cAAcC;AAAA,EACd,WAAAC;AAAA,EACA,OAAAC;AACF,GACAC,GACA;;AACA,QAAMC,IAAWR,MAAgB,YAC3BS,IAAYN,KAAe,MAI3BO,IAAeC,GAAA,GACfC,IAAUd,MAAa,KAAOY,IAAeZ,KAAY,QAEzDe,IAAeC;AAAA,IACnB,CAACC,MACCA,KAAK,QAAQ,OAAO,UAAUA,CAAC,KAAKA,KAAK,KAAKA,IAAIrB,EAAM,UAAU,CAACA,EAAMqB,CAAC,EAAE;AAAA,IAC9E,CAACrB,CAAK;AAAA,EAAA,GAIFsB,IAAYF,EAAY,MAAqB;AACjD,QAAI,CAACF,KAAW,OAAO,SAAW,IAAa,QAAO;AACtD,UAAMK,IAAM,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAIL,CAAO;AACnE,WAAOK,KAAO,QAAQ,QAAQ,KAAKA,CAAG,IAAI,OAAOA,CAAG,IAAI,IAAI;AAAA,EAC9D,GAAG,CAACL,CAAO,CAAC,GAENM,IAAe,KAAK;AAAA,IACxBxB,EAAM,UAAU,CAACyB,MAAM,CAACA,EAAE,QAAQ;AAAA,IACl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,EAAO,OAAQ,UAAAd,EAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1F,CAAC;"}
1
+ {"version":3,"file":"Stepper-B_e_PGZE.js","sources":["../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useStepQueryKey, type ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Icon } from '../Icon'\nimport styles from './Stepper.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type StepperOrientation = 'horizontal' | 'vertical'\nexport type StepperSize = 'sm' | 'md' | 'lg'\n\nexport interface StepItem {\n /** Step label. */\n label?: ReactNode\n /** Muted secondary line under the label. */\n description?: ReactNode\n /** Muted caption under the label (e.g. `\"Optional\"`). */\n optional?: ReactNode\n /** Override the step's number indicator with an icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Force the **completed** look regardless of the active step (e.g. an already-saved step). */\n completed?: boolean\n /** Marks the step **invalid** — a red indicator + label (e.g. its form section failed validation). */\n error?: boolean\n /** Disables the step — dimmed, (when clickable) not selectable, and skipped by the URL restore. */\n disabled?: boolean\n /**\n * Panel content rendered while this step is active — **below the strip** in horizontal mode, and\n * **inline under the step** (indented beside the rail) in vertical mode. Optional.\n */\n content?: ReactNode\n}\n\nexport interface StepperProps {\n /** The steps, in order. */\n steps: StepItem[]\n /**\n * Controlled current step index (**0-based**). Steps before it read **completed**, the one at it is\n * **active**, and those after it are **upcoming**. Omit for uncontrolled (see `defaultStep`).\n */\n activeStep?: number\n /**\n * Initial step index (uncontrolled). Falls back to the URL query (when URL sync is active and the\n * param is present) and otherwise the first enabled step.\n */\n defaultStep?: number\n /**\n * Fires with the next step index whenever the stepper itself changes the step — a clicked step head,\n * or a Back/Forward `popstate` restore. In controlled mode apply it to your `activeStep` state.\n */\n onStepChange?: (index: number) => void\n /**\n * **Opt-in** URL sync — **off by default** (the URL is never touched when omitted). Pass the bare\n * prop (**`queryKey`** / `true`) to sync the active step under the configured `keys.stepQueryKey`\n * (else `'step'`), or a **string** for a custom param name. The URL value is **1-based**\n * (`?step=2` = index 1) and a page refresh restores it. Two synced steppers on one page need\n * distinct keys.\n */\n queryKey?: boolean | string\n /**\n * Push a history entry on each step change, so the browser **Back** button returns to the previous\n * step. Defaults to `false` — step changes **replace** the URL, so Back leaves the page instead of\n * stepping back through the wizard (and `popstate` still restores a step when one is in the query).\n */\n pushHistory?: boolean\n /**\n * Layout direction. `horizontal` (default) centers each label **under** its circle and **scrolls\n * sideways** when the steps don't fit (so it fits a phone as-is); `vertical` stacks the steps along\n * a rail connector.\n */\n orientation?: StepperOrientation\n /** Preset size. Defaults to `'md'`. */\n size?: StepperSize\n /** Theme palette token tinting the active / completed steps. Defaults to `'primary'`. */\n color?: ThemeColor\n /**\n * Makes steps **clickable** — each step head becomes a `<button>` that fires this with the step index\n * (a `disabled` step never fires); an uncontrolled stepper also selects the clicked step itself. Omit\n * for a display-only progress indicator.\n */\n onStepClick?: (index: number) => void\n /** Accessible label for the stepper list. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A step progress indicator. Data-driven via `steps` (each: `label`, `description`, `optional`, `icon`,\n * `completed`, `error`, `disabled`, `content`) — controlled (`activeStep`, 0-based) or uncontrolled\n * (`defaultStep`). **Opt-in URL sync:** pass **`queryKey`** (bare/`true` = the configured\n * `keys.stepQueryKey`, else `'step'`; or a custom string) and the active step syncs to that query param\n * (**1-based** — `?step=2`) so a refresh restores it; with no `queryKey` the URL is never touched.\n * Synced step changes **replace** the URL (Back doesn't walk the wizard); pass **`pushHistory`** to\n * step back with Back.\n * Horizontal (labels centered under the circles) or `vertical` (a rail); when the horizontal steps\n * don't fit, the strip **scrolls sideways** (scrollbar hidden, the active step kept in view) — so it\n * fits a phone as-is. The active step's **`content`** renders below the strip (horizontal) or inline\n * under the step (vertical). Pass **`onStepClick`** to make the steps navigable. Tinted by `color` via\n * the shared `--tz-btn-rgb` pattern; the list is an `<ol>` with `aria-current=\"step\"` on the active step.\n */\nexport const Stepper = forwardRef<HTMLDivElement, StepperProps>(function Stepper(\n {\n steps,\n activeStep,\n defaultStep,\n onStepChange,\n queryKey,\n pushHistory = false,\n orientation = 'horizontal',\n size = 'md',\n color = 'primary',\n onStepClick,\n 'aria-label': ariaLabel,\n className,\n style,\n },\n ref,\n) {\n const vertical = orientation === 'vertical'\n const clickable = onStepClick != null\n\n // resolve the URL-sync key — OPT-IN: omitted/false = no sync (URL untouched); the bare/`true` form\n // uses the configured default (`keys.stepQueryKey`, else 'step'); a string is a custom param name\n const stepQueryKey = useStepQueryKey()\n const syncKey = queryKey === true ? stepQueryKey : queryKey || undefined\n\n const isSelectable = useCallback(\n (i: number | null | undefined): i is number =>\n i != null && Number.isInteger(i) && i >= 0 && i < steps.length && !steps[i].disabled,\n [steps],\n )\n\n // the URL carries the step 1-based (`?step=2` = index 1) — human-friendly, like Table's page param\n const readQuery = useCallback((): number | null => {\n if (!syncKey || typeof window === 'undefined') return null\n const raw = new URLSearchParams(window.location.search).get(syncKey)\n return raw != null && /^\\d+$/.test(raw) ? Number(raw) - 1 : null\n }, [syncKey])\n\n const firstEnabled = Math.max(\n steps.findIndex((s) => !s.disabled),\n 0,\n )\n\n const [internal, setInternal] = useState<number>(() => {\n const q = readQuery()\n if (isSelectable(q)) return q\n return isSelectable(defaultStep) ? defaultStep : firstEnabled\n })\n const isControlled = activeStep !== undefined\n // controlled mode renders the given index verbatim (even past the last step — the \"all completed\"\n // pattern); only the URL/popstate restores are gated by `isSelectable`\n const active = isControlled ? activeStep : internal\n\n // keep the latest active / onStepChange / push-intent for the stable effects + popstate listener\n const activeRef = useRef(active)\n activeRef.current = active\n const onStepChangeRef = useRef(onStepChange)\n onStepChangeRef.current = onStepChange\n const pushIntent = useRef(false)\n\n const writeQuery = useCallback(\n (next: number, push: boolean) => {\n if (!syncKey || typeof window === 'undefined') return\n const params = new URLSearchParams(window.location.search)\n const value = String(next + 1)\n if (params.get(syncKey) === value) return\n params.set(syncKey, value)\n const url = `${window.location.pathname}?${params.toString()}${window.location.hash}`\n window.history[push ? 'pushState' : 'replaceState'](window.history.state, '', url)\n },\n [syncKey],\n )\n\n const select = (next: number) => {\n if (next === activeRef.current) return\n pushIntent.current = true\n if (!isControlled) setInternal(next)\n onStepChange?.(next)\n }\n\n // mirror the active step into the URL whenever it changes (and on mount = canonicalize). A\n // user-driven change `push`es when `pushHistory`; programmatic / popstate changes just `replace`.\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n // an out-of-range active (e.g. `steps.length` = \"all done\") isn't a step — leave the URL alone\n if (!Number.isInteger(active) || active < 0 || active >= steps.length) return\n const push = pushIntent.current && pushHistory\n pushIntent.current = false\n writeQuery(active, push)\n }, [syncKey, active, pushHistory, writeQuery, steps.length])\n\n // Back/Forward → restore the step from the query\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n const onPopState = () => {\n const q = readQuery()\n if (isSelectable(q) && q !== activeRef.current) {\n if (activeStep === undefined) setInternal(q)\n onStepChangeRef.current?.(q)\n }\n }\n window.addEventListener('popstate', onPopState)\n return () => window.removeEventListener('popstate', onPopState)\n }, [syncKey, readQuery, isSelectable, activeStep])\n\n const activeContent = steps[active]?.content\n\n // when the horizontal strip overflows (scrolls sideways), keep the active step in view — by moving\n // the strip's own scrollLeft only. (scrollIntoView would also scroll every scrollable ancestor —\n // i.e. the page itself — yanking the viewport down to the stepper on mount.)\n const listRef = useRef<HTMLOListElement | null>(null)\n useEffect(() => {\n if (orientation === 'vertical') return // the vertical rail never scrolls sideways\n const list = listRef.current\n const el = list?.children[active] as HTMLElement | undefined\n if (!list || !el) return\n const listRect = list.getBoundingClientRect()\n const elRect = el.getBoundingClientRect()\n const left = elRect.left - listRect.left + list.scrollLeft\n const right = left + elRect.width\n if (left < list.scrollLeft) list.scrollLeft = left\n else if (right > list.scrollLeft + list.clientWidth) list.scrollLeft = right - list.clientWidth\n }, [active, orientation])\n\n const renderIcon = (icon: StepItem['icon']) =>\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={size} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles[orientation], styles[size], className)}\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 >\n <ol ref={listRef} aria-label={ariaLabel} className={styles.list}>\n {steps.map((step, i) => {\n const isError = !!step.error\n const isCompleted = !isError && (step.completed || i < active)\n const isActive = !isError && !isCompleted && i === active\n const state = isError\n ? 'error'\n : isCompleted\n ? 'completed'\n : isActive\n ? 'active'\n : 'upcoming'\n const isLast = i === steps.length - 1\n\n const icon = renderIcon(step.icon)\n const indicator =\n icon != null ? (\n icon\n ) : isCompleted ? (\n <Icon name=\"Check\" size={size} />\n ) : (\n <span className={styles.number}>{i + 1}</span>\n )\n\n const hasText = step.label != null || step.description != null || step.optional != null\n const head = (\n <>\n <span\n className={styles.indicator}\n aria-hidden={icon == null && !isCompleted ? undefined : true}\n >\n {indicator}\n </span>\n {hasText && (\n <span className={styles.text}>\n {step.label != null && <span className={styles.label}>{step.label}</span>}\n {step.description != null && (\n <span className={styles.description}>{step.description}</span>\n )}\n {step.optional != null && (\n <span className={styles.optional}>{step.optional}</span>\n )}\n </span>\n )}\n </>\n )\n\n return (\n <li\n key={i}\n className={clsx(styles.step, styles[state], step.disabled && styles.disabled)}\n >\n {clickable ? (\n <button\n type=\"button\"\n className={styles.main}\n disabled={step.disabled}\n aria-current={isActive ? 'step' : undefined}\n onClick={() => {\n onStepClick?.(i)\n select(i)\n }}\n >\n {head}\n </button>\n ) : (\n <div className={styles.main} aria-current={isActive ? 'step' : undefined}>\n {head}\n </div>\n )}\n {!isLast && (\n <span\n className={clsx(styles.connector, i < active && styles.done)}\n aria-hidden=\"true\"\n />\n )}\n {/* vertical: the active step's content sits inline, indented beside the rail */}\n {vertical && i === active && step.content != null && (\n <div className={styles.stepContent}>{step.content}</div>\n )}\n </li>\n )\n })}\n </ol>\n {/* horizontal: the active step's content renders as a panel below the strip */}\n {!vertical && activeContent != null && <div className={styles.panel}>{activeContent}</div>}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Stepper","forwardRef","steps","activeStep","defaultStep","onStepChange","queryKey","pushHistory","orientation","size","color","onStepClick","ariaLabel","className","style","ref","vertical","clickable","stepQueryKey","useStepQueryKey","syncKey","isSelectable","useCallback","i","readQuery","raw","firstEnabled","s","internal","setInternal","useState","q","isControlled","active","activeRef","useRef","onStepChangeRef","pushIntent","writeQuery","next","push","params","value","url","select","useEffect","onPopState","_a","activeContent","listRef","list","el","listRect","elRect","left","right","renderIcon","icon","jsx","Icon","jsxs","clsx","styles","step","isError","isCompleted","isActive","state","isLast","indicator","hasText","head","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAeMA,KAAgB,IAAI,IAAYC,EAAU,GA+FnCC,KAAUC,GAAyC,SAC9D;AAAA,EACE,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC,IAAc;AAAA,EACd,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,aAAAC;AAAA,EACA,cAAcC;AAAA,EACd,WAAAC;AAAA,EACA,OAAAC;AACF,GACAC,GACA;;AACA,QAAMC,IAAWR,MAAgB,YAC3BS,IAAYN,KAAe,MAI3BO,IAAeC,GAAA,GACfC,IAAUd,MAAa,KAAOY,IAAeZ,KAAY,QAEzDe,IAAeC;AAAA,IACnB,CAACC,MACCA,KAAK,QAAQ,OAAO,UAAUA,CAAC,KAAKA,KAAK,KAAKA,IAAIrB,E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ACA,gBAAAV;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAWG,EAAKC,EAAO,WAAWvC,IAAIU,KAAU6B,EAAO,IAAI;AAAA,oBAC3D,eAAY;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAIf9C,KAAYO,MAAMU,KAAU8B,EAAK,WAAW,QAC3C,gBAAAL,EAAC,OAAA,EAAI,WAAWI,EAAO,aAAc,UAAAC,EAAK,QAAA,CAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,YA7B/CxC;AAAA,UAAA;AAAA,QAiCX,CAAC,EAAA,CACH;AAAA,QAEC,CAACP,KAAYgC,KAAiB,0BAAS,OAAA,EAAI,WAAWc,EAAO,OAAQ,UAAAd,EAAA,CAAc;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1F,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const o=require("react/jsx-runtime"),c=require("react"),j=require("clsx"),X=require("./names-BJnFU_5m.cjs"),A=require("./Icon-BVULqOJD.cjs"),Y=require("./ConfigProvider-BicoaBLj.cjs"),Z="_root_p6koa_2",H="_list_p6koa_5",ee="_horizontal_p6koa_11",ne="_vertical_p6koa_24",te="_sm_p6koa_29",oe="_md_p6koa_34",se="_lg_p6koa_39",re="_step_p6koa_47",ce="_disabled_p6koa_64",le="_main_p6koa_69",ae="_indicator_p6koa_99",ie="_number_p6koa_125",de="_completed_p6koa_130",ue="_active_p6koa_136",_e="_error_p6koa_144",fe="_text_p6koa_151",me="_label_p6koa_167",pe="_description_p6koa_181",he="_optional_p6koa_186",be="_connector_p6koa_193",we="_done_p6koa_198",ve="_panel_p6koa_224",xe="_stepContent_p6koa_228",t={root:Z,list:H,horizontal:ee,vertical:ne,sm:te,md:oe,lg:se,step:re,disabled:ce,main:le,indicator:ae,number:ie,completed:de,active:ue,error:_e,text:fe,label:me,description:pe,optional:he,connector:be,done:we,panel:ve,stepContent:xe},ke=new Set(X.ICON_NAMES),Ne=c.forwardRef(function({steps:i,activeStep:_,defaultStep:g,onStepChange:u,queryKey:y,pushHistory:R=!1,orientation:f="horizontal",size:w="md",color:I="primary",onStepClick:m,"aria-label":M,className:B,style:K},O){var P;const E=f==="vertical",T=m!=null,U=Y.useStepQueryKey(),l=y===!0?U:y||void 0,p=c.useCallback(e=>e!=null&&Number.isInteger(e)&&e>=0&&e<i.length&&!i[e].disabled,[i]),v=c.useCallback(()=>{if(!l||typeof window>"u")return null;const e=new URLSearchParams(window.location.search).get(l);return e!=null&&/^\d+$/.test(e)?Number(e)-1:null},[l]),W=Math.max(i.findIndex(e=>!e.disabled),0),[F,L]=c.useState(()=>{const e=v();return p(e)?e:p(g)?g:W}),q=_!==void 0,s=q?_:F,x=c.useRef(s);x.current=s;const h=c.useRef(u);h.current=u;const k=c.useRef(!1),z=c.useCallback((e,n)=>{if(!l||typeof window>"u")return;const r=new URLSearchParams(window.location.search),a=String(e+1);if(r.get(l)===a)return;r.set(l,a);const d=`${window.location.pathname}?${r.toString()}${window.location.hash}`;window.history[n?"pushState":"replaceState"](window.history.state,"",d)},[l]),D=e=>{e!==x.current&&(k.current=!0,q||L(e),u==null||u(e))};c.useEffect(()=>{if(!l||typeof window>"u"||!Number.isInteger(s)||s<0||s>=i.length)return;const e=k.current&&R;k.current=!1,z(s,e)},[l,s,R,z,i.length]),c.useEffect(()=>{if(!l||typeof window>"u")return;const e=()=>{var r;const n=v();p(n)&&n!==x.current&&(_===void 0&&L(n),(r=h.current)==null||r.call(h,n))};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[l,v,p,_]);const $=(P=i[s])==null?void 0:P.content,C=c.useRef(null);c.useEffect(()=>{if(f==="vertical")return;const e=C.current,n=e==null?void 0:e.children[s];if(!e||!n)return;const r=e.getBoundingClientRect(),a=n.getBoundingClientRect(),d=a.left-r.left+e.scrollLeft,b=d+a.width;d<e.scrollLeft?e.scrollLeft=d:b>e.scrollLeft+e.clientWidth&&(e.scrollLeft=b-e.clientWidth)},[s,f]);const G=e=>typeof e=="string"&&ke.has(e)?o.jsx(A.Icon,{name:e,size:w}):e;return o.jsxs("div",{ref:O,className:j.clsx(t.root,t[f],t[w],B),style:{"--tz-btn-rgb":`var(--tz-color-${I}-rgb)`,"--tz-btn-on":`var(--tz-color-${I}-contrast, #fff)`,...K},children:[o.jsx("ol",{ref:C,"aria-label":M,className:t.list,children:i.map((e,n)=>{const r=!!e.error,a=!r&&(e.completed||n<s),d=!r&&!a&&n===s,b=r?"error":a?"completed":d?"active":"upcoming",J=n===i.length-1,N=G(e.icon),S=N??(a?o.jsx(A.Icon,{name:"Check",size:w}):o.jsx("span",{className:t.number,children:n+1})),V=e.label!=null||e.description!=null||e.optional!=null,Q=o.jsxs(o.Fragment,{children:[o.jsx("span",{className:t.indicator,"aria-hidden":N==null&&!a?void 0:!0,children:S}),V&&o.jsxs("span",{className:t.text,children:[e.label!=null&&o.jsx("span",{className:t.label,children:e.label}),e.description!=null&&o.jsx("span",{className:t.description,children:e.description}),e.optional!=null&&o.jsx("span",{className:t.optional,children:e.optional})]})]});return o.jsxs("li",{className:j.clsx(t.step,t[b],e.disabled&&t.disabled),children:[T?o.jsx("button",{type:"button",className:t.main,disabled:e.disabled,"aria-current":d?"step":void 0,onClick:()=>{m==null||m(n),D(n)},children:Q}):o.jsx("div",{className:t.main,"aria-current":d?"step":void 0,children:Q}),!J&&o.jsx("span",{className:j.clsx(t.connector,n<s&&t.done),"aria-hidden":"true"}),E&&n===s&&e.content!=null&&o.jsx("div",{className:t.stepContent,children:e.content})]},n)})}),!E&&$!=null&&o.jsx("div",{className:t.panel,children:$})]})});exports.Stepper=Ne;
2
+ //# sourceMappingURL=Stepper-BjkkWawQ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper-B1z_u650.cjs","sources":["../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useStepQueryKey, type ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Icon } from '../Icon'\nimport styles from './Stepper.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type StepperOrientation = 'horizontal' | 'vertical'\nexport type StepperSize = 'sm' | 'md' | 'lg'\n\nexport interface StepItem {\n /** Step label. */\n label?: ReactNode\n /** Muted secondary line under the label. */\n description?: ReactNode\n /** Muted caption under the label (e.g. `\"Optional\"`). */\n optional?: ReactNode\n /** Override the step's number indicator with an icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Force the **completed** look regardless of the active step (e.g. an already-saved step). */\n completed?: boolean\n /** Marks the step **invalid** — a red indicator + label (e.g. its form section failed validation). */\n error?: boolean\n /** Disables the step — dimmed, (when clickable) not selectable, and skipped by the URL restore. */\n disabled?: boolean\n /**\n * Panel content rendered while this step is active — **below the strip** in horizontal mode, and\n * **inline under the step** (indented beside the rail) in vertical mode. Optional.\n */\n content?: ReactNode\n}\n\nexport interface StepperProps {\n /** The steps, in order. */\n steps: StepItem[]\n /**\n * Controlled current step index (**0-based**). Steps before it read **completed**, the one at it is\n * **active**, and those after it are **upcoming**. Omit for uncontrolled (see `defaultStep`).\n */\n activeStep?: number\n /**\n * Initial step index (uncontrolled). Falls back to the URL query (when URL sync is active and the\n * param is present) and otherwise the first enabled step.\n */\n defaultStep?: number\n /**\n * Fires with the next step index whenever the stepper itself changes the step — a clicked step head,\n * or a Back/Forward `popstate` restore. In controlled mode apply it to your `activeStep` state.\n */\n onStepChange?: (index: number) => void\n /**\n * **Opt-in** URL sync — **off by default** (the URL is never touched when omitted). Pass the bare\n * prop (**`queryKey`** / `true`) to sync the active step under the configured `keys.stepQueryKey`\n * (else `'step'`), or a **string** for a custom param name. The URL value is **1-based**\n * (`?step=2` = index 1) and a page refresh restores it. Two synced steppers on one page need\n * distinct keys.\n */\n queryKey?: boolean | string\n /**\n * Push a history entry on each step change, so the browser **Back** button returns to the previous\n * step. Defaults to `false` — step changes **replace** the URL, so Back leaves the page instead of\n * stepping back through the wizard (and `popstate` still restores a step when one is in the query).\n */\n pushHistory?: boolean\n /**\n * Layout direction. `horizontal` (default) centers each label **under** its circle and **scrolls\n * sideways** when the steps don't fit (so it fits a phone as-is); `vertical` stacks the steps along\n * a rail connector.\n */\n orientation?: StepperOrientation\n /** Preset size. Defaults to `'md'`. */\n size?: StepperSize\n /** Theme palette token tinting the active / completed steps. Defaults to `'primary'`. */\n color?: ThemeColor\n /**\n * Makes steps **clickable** — each step head becomes a `<button>` that fires this with the step index\n * (a `disabled` step never fires); an uncontrolled stepper also selects the clicked step itself. Omit\n * for a display-only progress indicator.\n */\n onStepClick?: (index: number) => void\n /** Accessible label for the stepper list. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A step progress indicator. Data-driven via `steps` (each: `label`, `description`, `optional`, `icon`,\n * `completed`, `error`, `disabled`, `content`) — controlled (`activeStep`, 0-based) or uncontrolled\n * (`defaultStep`). **Opt-in URL sync:** pass **`queryKey`** (bare/`true` = the configured\n * `keys.stepQueryKey`, else `'step'`; or a custom string) and the active step syncs to that query param\n * (**1-based** — `?step=2`) so a refresh restores it; with no `queryKey` the URL is never touched.\n * Synced step changes **replace** the URL (Back doesn't walk the wizard); pass **`pushHistory`** to\n * step back with Back.\n * Horizontal (labels centered under the circles) or `vertical` (a rail); when the horizontal steps\n * don't fit, the strip **scrolls sideways** (scrollbar hidden, the active step kept in view) — so it\n * fits a phone as-is. The active step's **`content`** renders below the strip (horizontal) or inline\n * under the step (vertical). Pass **`onStepClick`** to make the steps navigable. Tinted by `color` via\n * the shared `--tz-btn-rgb` pattern; the list is an `<ol>` with `aria-current=\"step\"` on the active step.\n */\nexport const Stepper = forwardRef<HTMLDivElement, StepperProps>(function Stepper(\n {\n steps,\n activeStep,\n defaultStep,\n onStepChange,\n queryKey,\n pushHistory = false,\n orientation = 'horizontal',\n size = 'md',\n color = 'primary',\n onStepClick,\n 'aria-label': ariaLabel,\n className,\n style,\n },\n ref,\n) {\n const vertical = orientation === 'vertical'\n const clickable = onStepClick != null\n\n // resolve the URL-sync key — OPT-IN: omitted/false = no sync (URL untouched); the bare/`true` form\n // uses the configured default (`keys.stepQueryKey`, else 'step'); a string is a custom param name\n const stepQueryKey = useStepQueryKey()\n const syncKey = queryKey === true ? stepQueryKey : queryKey || undefined\n\n const isSelectable = useCallback(\n (i: number | null | undefined): i is number =>\n i != null && Number.isInteger(i) && i >= 0 && i < steps.length && !steps[i].disabled,\n [steps],\n )\n\n // the URL carries the step 1-based (`?step=2` = index 1) — human-friendly, like Table's page param\n const readQuery = useCallback((): number | null => {\n if (!syncKey || typeof window === 'undefined') return null\n const raw = new URLSearchParams(window.location.search).get(syncKey)\n return raw != null && /^\\d+$/.test(raw) ? Number(raw) - 1 : null\n }, [syncKey])\n\n const firstEnabled = Math.max(\n steps.findIndex((s) => !s.disabled),\n 0,\n )\n\n const [internal, setInternal] = useState<number>(() => {\n const q = readQuery()\n if (isSelectable(q)) return q\n return isSelectable(defaultStep) ? defaultStep : firstEnabled\n })\n const isControlled = activeStep !== undefined\n // controlled mode renders the given index verbatim (even past the last step — the \"all completed\"\n // pattern); only the URL/popstate restores are gated by `isSelectable`\n const active = isControlled ? activeStep : internal\n\n // keep the latest active / onStepChange / push-intent for the stable effects + popstate listener\n const activeRef = useRef(active)\n activeRef.current = active\n const onStepChangeRef = useRef(onStepChange)\n onStepChangeRef.current = onStepChange\n const pushIntent = useRef(false)\n\n const writeQuery = useCallback(\n (next: number, push: boolean) => {\n if (!syncKey || typeof window === 'undefined') return\n const params = new URLSearchParams(window.location.search)\n const value = String(next + 1)\n if (params.get(syncKey) === value) return\n params.set(syncKey, value)\n const url = `${window.location.pathname}?${params.toString()}${window.location.hash}`\n window.history[push ? 'pushState' : 'replaceState'](window.history.state, '', url)\n },\n [syncKey],\n )\n\n const select = (next: number) => {\n if (next === activeRef.current) return\n pushIntent.current = true\n if (!isControlled) setInternal(next)\n onStepChange?.(next)\n }\n\n // mirror the active step into the URL whenever it changes (and on mount = canonicalize). A\n // user-driven change `push`es when `pushHistory`; programmatic / popstate changes just `replace`.\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n // an out-of-range active (e.g. `steps.length` = \"all done\") isn't a step — leave the URL alone\n if (!Number.isInteger(active) || active < 0 || active >= steps.length) return\n const push = pushIntent.current && pushHistory\n pushIntent.current = false\n writeQuery(active, push)\n }, [syncKey, active, pushHistory, writeQuery, steps.length])\n\n // Back/Forward → restore the step from the query\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n const onPopState = () => {\n const q = readQuery()\n if (isSelectable(q) && q !== activeRef.current) {\n if (activeStep === undefined) setInternal(q)\n onStepChangeRef.current?.(q)\n }\n }\n window.addEventListener('popstate', onPopState)\n return () => window.removeEventListener('popstate', onPopState)\n }, [syncKey, readQuery, isSelectable, activeStep])\n\n const activeContent = steps[active]?.content\n\n // when the horizontal strip overflows (scrolls sideways), keep the active step in view — by moving\n // the strip's own scrollLeft only. (scrollIntoView would also scroll every scrollable ancestor —\n // i.e. the page itself — yanking the viewport down to the stepper on mount.)\n const listRef = useRef<HTMLOListElement | null>(null)\n useEffect(() => {\n if (orientation === 'vertical') return // the vertical rail never scrolls sideways\n const list = listRef.current\n const el = list?.children[active] as HTMLElement | undefined\n if (!list || !el) return\n const listRect = list.getBoundingClientRect()\n const elRect = el.getBoundingClientRect()\n const left = elRect.left - listRect.left + list.scrollLeft\n const right = left + elRect.width\n if (left < list.scrollLeft) list.scrollLeft = left\n else if (right > list.scrollLeft + list.clientWidth) list.scrollLeft = right - list.clientWidth\n }, [active, orientation])\n\n const renderIcon = (icon: StepItem['icon']) =>\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={size} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles[orientation], styles[size], className)}\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 >\n <ol ref={listRef} aria-label={ariaLabel} className={styles.list}>\n {steps.map((step, i) => {\n const isError = !!step.error\n const isCompleted = !isError && (step.completed || i < active)\n const isActive = !isError && !isCompleted && i === active\n const state = isError\n ? 'error'\n : isCompleted\n ? 'completed'\n : isActive\n ? 'active'\n : 'upcoming'\n const isLast = i === steps.length - 1\n\n const icon = renderIcon(step.icon)\n const indicator =\n icon != null ? (\n icon\n ) : isCompleted ? (\n <Icon name=\"Check\" size={size} />\n ) : (\n <span className={styles.number}>{i + 1}</span>\n )\n\n const hasText = step.label != null || step.description != null || step.optional != null\n const head = (\n <>\n <span\n className={styles.indicator}\n aria-hidden={icon == null && !isCompleted ? undefined : true}\n >\n {indicator}\n </span>\n {hasText && (\n <span className={styles.text}>\n {step.label != null && <span className={styles.label}>{step.label}</span>}\n {step.description != null && (\n <span className={styles.description}>{step.description}</span>\n )}\n {step.optional != null && (\n <span className={styles.optional}>{step.optional}</span>\n )}\n </span>\n )}\n </>\n )\n\n return (\n <li\n key={i}\n className={clsx(styles.step, styles[state], step.disabled && styles.disabled)}\n >\n {clickable ? (\n <button\n type=\"button\"\n className={styles.main}\n disabled={step.disabled}\n aria-current={isActive ? 'step' : undefined}\n onClick={() => {\n onStepClick?.(i)\n select(i)\n }}\n >\n {head}\n </button>\n ) : (\n <div className={styles.main} aria-current={isActive ? 'step' : undefined}>\n {head}\n </div>\n )}\n {!isLast && (\n <span\n className={clsx(styles.connector, i < active && styles.done)}\n aria-hidden=\"true\"\n />\n )}\n {/* vertical: the active step's content sits inline, indented beside the rail */}\n {vertical && i === active && step.content != null && (\n <div className={styles.stepContent}>{step.content}</div>\n )}\n </li>\n )\n })}\n </ol>\n {/* horizontal: the active step's content renders as a panel below the strip */}\n {!vertical && activeContent != null && <div className={styles.panel}>{activeContent}</div>}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Stepper","forwardRef","steps","activeStep","defaultStep","onStepChange","queryKey","pushHistory","orientation","size","color","onStepClick","ariaLabel","className","style","ref","vertical","clickable","stepQueryKey","useStepQueryKey","syncKey","isSelectable","useCallback","i","readQuery","raw","firstEnabled","s","internal","setInternal","useState","q","isControlled","active","activeRef","useRef","onStepChangeRef","pushIntent","writeQuery","next","push","params","value","url","select","useEffect","onPopState","_a","activeContent","listRef","list","el","listRect","elRect","left","right","renderIcon","icon","jsx","Icon","jsxs","clsx","styles","step","isError","isCompleted","isActive","state","isLast","indicator","hasText","head","Fragment"],"mappings":"m7BAeMA,GAAgB,IAAI,IAAYC,YAAU,EA+FnCC,GAAUC,EAAAA,WAAyC,SAC9D,CACE,MAAAC,EACA,WAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,GACd,YAAAC,EAAc,aACd,KAAAC,EAAO,KACP,MAAAC,EAAQ,UACR,YAAAC,EACA,aAAcC,EACd,UAAAC,EACA,MAAAC,CACF,EACAC,EACA,OACA,MAAMC,EAAWR,IAAgB,WAC3BS,EAAYN,GAAe,KAI3BO,EAAeC,EAAAA,gBAAA,EACfC,EAAUd,IAAa,GAAOY,EAAeZ,GAAY,OAEzDe,EAAeC,EAAAA,YAClBC,GACCA,GAAK,MAAQ,OAAO,UAAUA,CAAC,GAAKA,GAAK,GAAKA,EAAIrB,EAAM,QAAU,CAACA,EAAMqB,CAAC,EAAE,SAC9E,CAACrB,CAAK,CAAA,EAIFsB,EAAYF,EAAAA,YAAY,IAAqB,CACjD,GAAI,CAACF,GAAW,OAAO,OAAW,IAAa,OAAO,KACtD,MAAMK,EAAM,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAIL,CAAO,EACnE,OAAOK,GAAO,MAAQ,QAAQ,KAAKA,CAAG,EAAI,OAAOA,CAAG,EAAI,EAAI,IAC9D,EAAG,CAACL,CAAO,CAAC,EAENM,EAAe,KAAK,IACxBxB,EAAM,UAA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EAAO,SAAW,SAAAC,EAAK,QAAA,CAAS,CAAA,CAAA,CAErD,CAAA,EAEJ,EAGF,OACEH,EAAAA,KAAC,KAAA,CAEC,UAAWC,EAAAA,KAAKC,EAAO,KAAMA,EAAOK,CAAK,EAAGJ,EAAK,UAAYD,EAAO,QAAQ,EAE3E,SAAA,CAAA7C,EACCyC,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWI,EAAO,KAClB,SAAUC,EAAK,SACf,eAAcG,EAAW,OAAS,OAClC,QAAS,IAAM,CACbvD,GAAA,MAAAA,EAAcY,GACdqB,EAAOrB,CAAC,CACV,EAEC,SAAAgD,CAAA,CAAA,EAGHb,EAAAA,IAAC,MAAA,CAAI,UAAWI,EAAO,KAAM,eAAcI,EAAW,OAAS,OAC5D,SAAAK,CAAA,CACH,EAED,CAACH,GACAV,EAAAA,IAAC,OAAA,CACC,UAAWG,EAAAA,KAAKC,EAAO,UAAWvC,EAAIU,GAAU6B,EAAO,IAAI,EAC3D,cAAY,MAAA,CAAA,EAIf9C,GAAYO,IAAMU,GAAU8B,EAAK,SAAW,MAC3CL,EAAAA,IAAC,MAAA,CAAI,UAAWI,EAAO,YAAc,SAAAC,EAAK,OAAA,CAAQ,CAAA,CAAA,EA7B/CxC,CAAA,CAiCX,CAAC,CAAA,CACH,EAEC,CAACP,GAAYgC,GAAiB,YAAS,MAAA,CAAI,UAAWc,EAAO,MAAQ,SAAAd,CAAA,CAAc,CAAA,CAAA,CAAA,CAG1F,CAAC"}
1
+ {"version":3,"file":"Stepper-BjkkWawQ.cjs","sources":["../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useStepQueryKey, type ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Icon } from '../Icon'\nimport styles from './Stepper.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type StepperOrientation = 'horizontal' | 'vertical'\nexport type StepperSize = 'sm' | 'md' | 'lg'\n\nexport interface StepItem {\n /** Step label. */\n label?: ReactNode\n /** Muted secondary line under the label. */\n description?: ReactNode\n /** Muted caption under the label (e.g. `\"Optional\"`). */\n optional?: ReactNode\n /** Override the step's number indicator with an icon — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Force the **completed** look regardless of the active step (e.g. an already-saved step). */\n completed?: boolean\n /** Marks the step **invalid** — a red indicator + label (e.g. its form section failed validation). */\n error?: boolean\n /** Disables the step — dimmed, (when clickable) not selectable, and skipped by the URL restore. */\n disabled?: boolean\n /**\n * Panel content rendered while this step is active — **below the strip** in horizontal mode, and\n * **inline under the step** (indented beside the rail) in vertical mode. Optional.\n */\n content?: ReactNode\n}\n\nexport interface StepperProps {\n /** The steps, in order. */\n steps: StepItem[]\n /**\n * Controlled current step index (**0-based**). Steps before it read **completed**, the one at it is\n * **active**, and those after it are **upcoming**. Omit for uncontrolled (see `defaultStep`).\n */\n activeStep?: number\n /**\n * Initial step index (uncontrolled). Falls back to the URL query (when URL sync is active and the\n * param is present) and otherwise the first enabled step.\n */\n defaultStep?: number\n /**\n * Fires with the next step index whenever the stepper itself changes the step — a clicked step head,\n * or a Back/Forward `popstate` restore. In controlled mode apply it to your `activeStep` state.\n */\n onStepChange?: (index: number) => void\n /**\n * **Opt-in** URL sync — **off by default** (the URL is never touched when omitted). Pass the bare\n * prop (**`queryKey`** / `true`) to sync the active step under the configured `keys.stepQueryKey`\n * (else `'step'`), or a **string** for a custom param name. The URL value is **1-based**\n * (`?step=2` = index 1) and a page refresh restores it. Two synced steppers on one page need\n * distinct keys.\n */\n queryKey?: boolean | string\n /**\n * Push a history entry on each step change, so the browser **Back** button returns to the previous\n * step. Defaults to `false` — step changes **replace** the URL, so Back leaves the page instead of\n * stepping back through the wizard (and `popstate` still restores a step when one is in the query).\n */\n pushHistory?: boolean\n /**\n * Layout direction. `horizontal` (default) centers each label **under** its circle and **scrolls\n * sideways** when the steps don't fit (so it fits a phone as-is); `vertical` stacks the steps along\n * a rail connector.\n */\n orientation?: StepperOrientation\n /** Preset size. Defaults to `'md'`. */\n size?: StepperSize\n /** Theme palette token tinting the active / completed steps. Defaults to `'primary'`. */\n color?: ThemeColor\n /**\n * Makes steps **clickable** — each step head becomes a `<button>` that fires this with the step index\n * (a `disabled` step never fires); an uncontrolled stepper also selects the clicked step itself. Omit\n * for a display-only progress indicator.\n */\n onStepClick?: (index: number) => void\n /** Accessible label for the stepper list. */\n 'aria-label'?: string\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A step progress indicator. Data-driven via `steps` (each: `label`, `description`, `optional`, `icon`,\n * `completed`, `error`, `disabled`, `content`) — controlled (`activeStep`, 0-based) or uncontrolled\n * (`defaultStep`). **Opt-in URL sync:** pass **`queryKey`** (bare/`true` = the configured\n * `keys.stepQueryKey`, else `'step'`; or a custom string) and the active step syncs to that query param\n * (**1-based** — `?step=2`) so a refresh restores it; with no `queryKey` the URL is never touched.\n * Synced step changes **replace** the URL (Back doesn't walk the wizard); pass **`pushHistory`** to\n * step back with Back.\n * Horizontal (labels centered under the circles) or `vertical` (a rail); when the horizontal steps\n * don't fit, the strip **scrolls sideways** (scrollbar hidden, the active step kept in view) — so it\n * fits a phone as-is. The active step's **`content`** renders below the strip (horizontal) or inline\n * under the step (vertical). Pass **`onStepClick`** to make the steps navigable. Tinted by `color` via\n * the shared `--tz-btn-rgb` pattern; the list is an `<ol>` with `aria-current=\"step\"` on the active step.\n */\nexport const Stepper = forwardRef<HTMLDivElement, StepperProps>(function Stepper(\n {\n steps,\n activeStep,\n defaultStep,\n onStepChange,\n queryKey,\n pushHistory = false,\n orientation = 'horizontal',\n size = 'md',\n color = 'primary',\n onStepClick,\n 'aria-label': ariaLabel,\n className,\n style,\n },\n ref,\n) {\n const vertical = orientation === 'vertical'\n const clickable = onStepClick != null\n\n // resolve the URL-sync key — OPT-IN: omitted/false = no sync (URL untouched); the bare/`true` form\n // uses the configured default (`keys.stepQueryKey`, else 'step'); a string is a custom param name\n const stepQueryKey = useStepQueryKey()\n const syncKey = queryKey === true ? stepQueryKey : queryKey || undefined\n\n const isSelectable = useCallback(\n (i: number | null | undefined): i is number =>\n i != null && Number.isInteger(i) && i >= 0 && i < steps.length && !steps[i].disabled,\n [steps],\n )\n\n // the URL carries the step 1-based (`?step=2` = index 1) — human-friendly, like Table's page param\n const readQuery = useCallback((): number | null => {\n if (!syncKey || typeof window === 'undefined') return null\n const raw = new URLSearchParams(window.location.search).get(syncKey)\n return raw != null && /^\\d+$/.test(raw) ? Number(raw) - 1 : null\n }, [syncKey])\n\n const firstEnabled = Math.max(\n steps.findIndex((s) => !s.disabled),\n 0,\n )\n\n const [internal, setInternal] = useState<number>(() => {\n const q = readQuery()\n if (isSelectable(q)) return q\n return isSelectable(defaultStep) ? defaultStep : firstEnabled\n })\n const isControlled = activeStep !== undefined\n // controlled mode renders the given index verbatim (even past the last step — the \"all completed\"\n // pattern); only the URL/popstate restores are gated by `isSelectable`\n const active = isControlled ? activeStep : internal\n\n // keep the latest active / onStepChange / push-intent for the stable effects + popstate listener\n const activeRef = useRef(active)\n activeRef.current = active\n const onStepChangeRef = useRef(onStepChange)\n onStepChangeRef.current = onStepChange\n const pushIntent = useRef(false)\n\n const writeQuery = useCallback(\n (next: number, push: boolean) => {\n if (!syncKey || typeof window === 'undefined') return\n const params = new URLSearchParams(window.location.search)\n const value = String(next + 1)\n if (params.get(syncKey) === value) return\n params.set(syncKey, value)\n const url = `${window.location.pathname}?${params.toString()}${window.location.hash}`\n window.history[push ? 'pushState' : 'replaceState'](window.history.state, '', url)\n },\n [syncKey],\n )\n\n const select = (next: number) => {\n if (next === activeRef.current) return\n pushIntent.current = true\n if (!isControlled) setInternal(next)\n onStepChange?.(next)\n }\n\n // mirror the active step into the URL whenever it changes (and on mount = canonicalize). A\n // user-driven change `push`es when `pushHistory`; programmatic / popstate changes just `replace`.\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n // an out-of-range active (e.g. `steps.length` = \"all done\") isn't a step — leave the URL alone\n if (!Number.isInteger(active) || active < 0 || active >= steps.length) return\n const push = pushIntent.current && pushHistory\n pushIntent.current = false\n writeQuery(active, push)\n }, [syncKey, active, pushHistory, writeQuery, steps.length])\n\n // Back/Forward → restore the step from the query\n useEffect(() => {\n if (!syncKey || typeof window === 'undefined') return\n const onPopState = () => {\n const q = readQuery()\n if (isSelectable(q) && q !== activeRef.current) {\n if (activeStep === undefined) setInternal(q)\n onStepChangeRef.current?.(q)\n }\n }\n window.addEventListener('popstate', onPopState)\n return () => window.removeEventListener('popstate', onPopState)\n }, [syncKey, readQuery, isSelectable, activeStep])\n\n const activeContent = steps[active]?.content\n\n // when the horizontal strip overflows (scrolls sideways), keep the active step in view — by moving\n // the strip's own scrollLeft only. (scrollIntoView would also scroll every scrollable ancestor —\n // i.e. the page itself — yanking the viewport down to the stepper on mount.)\n const listRef = useRef<HTMLOListElement | null>(null)\n useEffect(() => {\n if (orientation === 'vertical') return // the vertical rail never scrolls sideways\n const list = listRef.current\n const el = list?.children[active] as HTMLElement | undefined\n if (!list || !el) return\n const listRect = list.getBoundingClientRect()\n const elRect = el.getBoundingClientRect()\n const left = elRect.left - listRect.left + list.scrollLeft\n const right = left + elRect.width\n if (left < list.scrollLeft) list.scrollLeft = left\n else if (right > list.scrollLeft + list.clientWidth) list.scrollLeft = right - list.clientWidth\n }, [active, orientation])\n\n const renderIcon = (icon: StepItem['icon']) =>\n typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={size} />\n ) : (\n icon\n )\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles[orientation], styles[size], className)}\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 >\n <ol ref={listRef} aria-label={ariaLabel} className={styles.list}>\n {steps.map((step, i) => {\n const isError = !!step.error\n const isCompleted = !isError && (step.completed || i < active)\n const isActive = !isError && !isCompleted && i === active\n const state = isError\n ? 'error'\n : isCompleted\n ? 'completed'\n : isActive\n ? 'active'\n : 'upcoming'\n const isLast = i === steps.length - 1\n\n const icon = renderIcon(step.icon)\n const indicator =\n icon != null ? (\n icon\n ) : isCompleted ? (\n <Icon name=\"Check\" size={size} />\n ) : (\n <span className={styles.number}>{i + 1}</span>\n )\n\n const hasText = step.label != null || step.description != null || step.optional != null\n const head = (\n <>\n <span\n className={styles.indicator}\n aria-hidden={icon == null && !isCompleted ? undefined : true}\n >\n {indicator}\n </span>\n {hasText && (\n <span className={styles.text}>\n {step.label != null && <span className={styles.label}>{step.label}</span>}\n {step.description != null && (\n <span className={styles.description}>{step.description}</span>\n )}\n {step.optional != null && (\n <span className={styles.optional}>{step.optional}</span>\n )}\n </span>\n )}\n </>\n )\n\n return (\n <li\n key={i}\n className={clsx(styles.step, styles[state], step.disabled && styles.disabled)}\n >\n {clickable ? (\n <button\n type=\"button\"\n className={styles.main}\n disabled={step.disabled}\n aria-current={isActive ? 'step' : undefined}\n onClick={() => {\n onStepClick?.(i)\n select(i)\n }}\n >\n {head}\n </button>\n ) : (\n <div className={styles.main} aria-current={isActive ? 'step' : undefined}>\n {head}\n </div>\n )}\n {!isLast && (\n <span\n className={clsx(styles.connector, i < active && styles.done)}\n aria-hidden=\"true\"\n />\n )}\n {/* vertical: the active step's content sits inline, indented beside the rail */}\n {vertical && i === active && step.content != null && (\n <div className={styles.stepContent}>{step.content}</div>\n )}\n </li>\n )\n })}\n </ol>\n {/* horizontal: the active step's content renders as a panel below the strip */}\n {!vertical && activeContent != null && <div className={styles.panel}>{activeContent}</div>}\n </div>\n )\n})\n"],"names":["ICON_NAME_SET","ICON_NAMES","Stepper","forwardRef","steps","activeStep","defaultStep","onStepChange","queryKey","pushHistory","orientation","size","color","onStepClick","ariaLabel","className","style","ref","vertical","clickable","stepQueryKey","useStepQueryKey","syncKey","isSelectable","useCallback","i","readQuery","raw","firstEnabled","s","internal","setInternal","useState","q","isControlled","active","activeRef","useRef","onStepChangeRef","pushIntent","writeQuery","next","push","params","value","url","select","useEffect","onPopState","_a","activeContent","listRef","list","el","listRect","elRect","left","right","renderIcon","icon","jsx","Icon","jsxs","clsx","styles","step","isError","isCompleted","isActive","state","isLast","indicator","hasText","head","Fragment"],"mappings":"m7BAeMA,GAAgB,IAAI,IAAYC,YAAU,EA+FnCC,GAAUC,EAAAA,WAAyC,SAC9D,CACE,MAAAC,EACA,WAAAC,EACA,YAAAC,EACA,aAAAC,EACA,SAAAC,EACA,YAAAC,EAAc,GACd,YAAAC,EAAc,aACd,KAAAC,EAAO,KACP,MAAAC,EAAQ,UACR,YAAAC,EACA,aAAcC,EACd,UAAAC,EACA,MAAAC,CACF,EACAC,EACA,OACA,MAAMC,EAAWR,IAAgB,WAC3BS,EAAYN,GAAe,KAI3BO,EAAeC,EAAAA,gBAAA,EACfC,EAAUd,IAAa,GAAOY,EAAeZ,GAAY,OAEzDe,EAAeC,EAAAA,YAClBC,GACCA,GAAK,MAAQ,OAAO,UAAUA,CAAC,GAAKA,GAAK,GAAKA,EAAIrB,EAAM,QAAU,CAACA,EAAMqB,CAAC,EAAE,SAC9E,CAACrB,CAAK,CAAA,EAIFsB,EAAYF,EAAAA,YAAY,IAAqB,CACjD,GAAI,CAACF,GAAW,OAAO,OAAW,IAAa,OAAO,KACtD,MAAMK,EAAM,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAIL,CAAO,EACnE,OAAOK,GAAO,MAAQ,QAAQ,KAAKA,CAAG,EAAI,OAAOA,CAAG,EAAI,EAAI,IAC9D,EAAG,CAACL,CAAO,CAAC,EAENM,EAAe,KAAK,IACxBxB,EAAM,UAAWyB,GAAM,CAACA,EAAE,QAAQ,EAClC,CAAA,EAGI,CAACC,EAAUC,CAAW,EAAIC,EAAAA,SAAiB,IAAM,CACrD,MAAMC,EAAIP,EAAA,E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AKC,EAAO,KAAMA,EAAOK,CAAK,EAAGJ,EAAK,UAAYD,EAAO,QAAQ,EAE3E,SAAA,CAAA7C,EACCyC,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWI,EAAO,KAClB,SAAUC,EAAK,SACf,eAAcG,EAAW,OAAS,OAClC,QAAS,IAAM,CACbvD,GAAA,MAAAA,EAAcY,GACdqB,EAAOrB,CAAC,CACV,EAEC,SAAAgD,CAAA,CAAA,EAGHb,EAAAA,IAAC,MAAA,CAAI,UAAWI,EAAO,KAAM,eAAcI,EAAW,OAAS,OAC5D,SAAAK,CAAA,CACH,EAED,CAACH,GACAV,EAAAA,IAAC,OAAA,CACC,UAAWG,EAAAA,KAAKC,EAAO,UAAWvC,EAAIU,GAAU6B,EAAO,IAAI,EAC3D,cAAY,MAAA,CAAA,EAIf9C,GAAYO,IAAMU,GAAU8B,EAAK,SAAW,MAC3CL,EAAAA,IAAC,MAAA,CAAI,UAAWI,EAAO,YAAc,SAAAC,EAAK,OAAA,CAAQ,CAAA,CAAA,EA7B/CxC,CAAA,CAiCX,CAAC,CAAA,CACH,EAEC,CAACP,GAAYgC,GAAiB,YAAS,MAAA,CAAI,UAAWc,EAAO,MAAQ,SAAAd,CAAA,CAAc,CAAA,CAAA,CAAA,CAG1F,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const t=require("react/jsx-runtime"),u=require("react"),N=require("clsx"),U=require("./formContext-bTWrqdEV.cjs"),G=require("./Icon-BVULqOJD.cjs"),R=require("./Typography-BFatE1_A.cjs"),i=require("./TextField.module-m-UllwzG.cjs"),J="_swatches_1kbcs_3",M="_sm_1kbcs_13",O="_md_1kbcs_18",Q="_lg_1kbcs_23",W="_swatch_1kbcs_3",m={swatches:J,sm:M,md:O,lg:Q,swatch:W},X=u.forwardRef(function({colors:r,value:p,defaultValue:A=null,onChange:h,size:b="md",labels:w,label:d,error:C,helperText:L,required:D=!1,name:c,className:F,"aria-label":P,...B},E){const x=u.useId(),v=`${x}-label`,k=`${x}-helper`,o=U.useFormContext(),_=!!(o&&c),l=o&&c?o.field(c):void 0,S=p!==void 0?p:_?o.values[c]??null:void 0,I=S!==void 0,[H,K]=u.useState(A),g=((I?S:H)??"").toLowerCase(),f=C??(l==null?void 0:l.error)??!1,y=L??(l==null?void 0:l.helperText),j=e=>{I||K(e),_&&o.setValue(c,e),h==null||h(e)},q=u.useRef([]),T=r.findIndex(e=>e.toLowerCase()===g),V=T>=0?T:0,$=(e,a)=>{var n;let s=a;switch(e.key){case"ArrowRight":case"ArrowDown":s=(a+1)%r.length;break;case"ArrowLeft":case"ArrowUp":s=(a-1+r.length)%r.length;break;case"Home":s=0;break;case"End":s=r.length-1;break;default:return}e.preventDefault(),j(r[s]),(n=q.current[s])==null||n.focus()};return t.jsxs("div",{ref:E,className:N.clsx(i.fieldStyles.field,i.fieldStyles[b],f&&i.fieldStyles.error,F),...B,children:[d!=null&&t.jsxs("label",{id:v,className:i.fieldStyles.label,children:[t.jsx(R.Typography,{as:"span",variant:"bodySmall",color:"muted",children:d}),D&&t.jsx("span",{className:i.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),t.jsx("div",{role:"radiogroup","aria-labelledby":d!=null?v:void 0,"aria-label":d==null?P:void 0,"aria-invalid":f||void 0,"aria-describedby":y!=null?k:void 0,className:N.clsx(m.swatches,m[b]),...c?{name:c,tabIndex:-1}:{},children:r.map((e,a)=>{const s=e.toLowerCase()===g;return t.jsx("button",{ref:n=>{q.current[a]=n},type:"button",role:"radio","aria-checked":s,"aria-label":(w==null?void 0:w[e])??e,tabIndex:a===V?0:-1,className:m.swatch,style:{"--sw":e},onClick:()=>j(e),onKeyDown:n=>$(n,a),children:s?t.jsx(G.Icon,{name:"TickCircle",style:{width:"var(--sw-icon)",height:"var(--sw-icon)"}}):null},e)})}),y!=null&&t.jsx(R.Typography,{as:"span",id:k,variant:"bodySmall",color:f?"error":"muted",className:i.fieldStyles.helper,children:y})]})});exports.SwatchPicker=X;
2
- //# sourceMappingURL=SwatchPicker-CCJltwHI.cjs.map
1
+ "use strict";const t=require("react/jsx-runtime"),u=require("react"),N=require("clsx"),U=require("./formContext-bTWrqdEV.cjs"),G=require("./Icon-BVULqOJD.cjs"),R=require("./Typography-BFatE1_A.cjs"),i=require("./TextField.module-DsNCo8vN.cjs"),J="_swatches_1kbcs_3",M="_sm_1kbcs_13",O="_md_1kbcs_18",Q="_lg_1kbcs_23",W="_swatch_1kbcs_3",m={swatches:J,sm:M,md:O,lg:Q,swatch:W},X=u.forwardRef(function({colors:r,value:p,defaultValue:A=null,onChange:h,size:b="md",labels:w,label:d,error:C,helperText:L,required:D=!1,name:c,className:F,"aria-label":P,...B},E){const x=u.useId(),v=`${x}-label`,k=`${x}-helper`,o=U.useFormContext(),_=!!(o&&c),l=o&&c?o.field(c):void 0,S=p!==void 0?p:_?o.values[c]??null:void 0,I=S!==void 0,[H,K]=u.useState(A),g=((I?S:H)??"").toLowerCase(),f=C??(l==null?void 0:l.error)??!1,y=L??(l==null?void 0:l.helperText),j=e=>{I||K(e),_&&o.setValue(c,e),h==null||h(e)},q=u.useRef([]),T=r.findIndex(e=>e.toLowerCase()===g),V=T>=0?T:0,$=(e,a)=>{var n;let s=a;switch(e.key){case"ArrowRight":case"ArrowDown":s=(a+1)%r.length;break;case"ArrowLeft":case"ArrowUp":s=(a-1+r.length)%r.length;break;case"Home":s=0;break;case"End":s=r.length-1;break;default:return}e.preventDefault(),j(r[s]),(n=q.current[s])==null||n.focus()};return t.jsxs("div",{ref:E,className:N.clsx(i.fieldStyles.field,i.fieldStyles[b],f&&i.fieldStyles.error,F),...B,children:[d!=null&&t.jsxs("label",{id:v,className:i.fieldStyles.label,children:[t.jsx(R.Typography,{as:"span",variant:"bodySmall",color:"muted",children:d}),D&&t.jsx("span",{className:i.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),t.jsx("div",{role:"radiogroup","aria-labelledby":d!=null?v:void 0,"aria-label":d==null?P:void 0,"aria-invalid":f||void 0,"aria-describedby":y!=null?k:void 0,className:N.clsx(m.swatches,m[b]),...c?{name:c,tabIndex:-1}:{},children:r.map((e,a)=>{const s=e.toLowerCase()===g;return t.jsx("button",{ref:n=>{q.current[a]=n},type:"button",role:"radio","aria-checked":s,"aria-label":(w==null?void 0:w[e])??e,tabIndex:a===V?0:-1,className:m.swatch,style:{"--sw":e},onClick:()=>j(e),onKeyDown:n=>$(n,a),children:s?t.jsx(G.Icon,{name:"TickCircle",style:{width:"var(--sw-icon)",height:"var(--sw-icon)"}}):null},e)})}),y!=null&&t.jsx(R.Typography,{as:"span",id:k,variant:"bodySmall",color:f?"error":"muted",className:i.fieldStyles.helper,children:y})]})});exports.SwatchPicker=X;
2
+ //# sourceMappingURL=SwatchPicker-C8amdDnA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwatchPicker-CCJltwHI.cjs","sources":["../src/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n// shared field chrome (wrapper / label / helper / required / error / sizes)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './SwatchPicker.module.css'\n\nexport type SwatchPickerSize = 'sm' | 'md' | 'lg'\n\nexport interface SwatchPickerProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** The color values to render as selectable swatches (any CSS color — hex / `rgb()` / …). */\n colors: string[]\n /** The selected color (controlled) — matched case-insensitively against `colors`; `null` = none. */\n value?: string | null\n /** Initial selected color (uncontrolled). */\n defaultValue?: string | null\n /** Fires with the clicked color. */\n onChange?: (color: string) => void\n /**\n * Swatch size — `sm` 30 / `md` 36 / `lg` 42 px, each with its own corner radius and tick size\n * (12/16/20). Defaults to `md`. All three are per-size CSS vars in the module.\n */\n size?: SwatchPickerSize\n /** Per-color accessible labels (falls back to the color value itself). */\n labels?: Record<string, string>\n /** Label rendered above the swatches. */\n label?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the swatches. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Form field name — auto-binds to a surrounding `<Form>` (the form value is the color string). */\n name?: string\n}\n\n/**\n * A grid of selectable color **swatches** (rounded tiles) — pick one from a fixed palette. The selected\n * swatch shows a centered white **`TickCircle`** icon. Unlike `ColorPicker` (a field + full popover\n * picker), this is a lightweight primitive for a **preset** set of colors — e.g. an accent-color chooser.\n * Controlled (`value` + `onChange`) or uncontrolled (`defaultValue`); binds to a surrounding `<Form>` by\n * `name` (the form value is the color string — validate with e.g. `z.string().min(1, 'Pick a color')`),\n * and shares the field family's `label` / `error` + `helperText` / `required` chrome.\n *\n * Swatch fills are arbitrary CSS colors (fed via an inline `--sw` var), not `--tz-*` tokens — a\n * deliberate exception, like `ColorPicker`'s spectrum. a11y: `role=\"radiogroup\"` (labelled by `label`\n * or `aria-label`) with `role=\"radio\"` + `aria-checked` swatches; the group carries `name` for the\n * form's scroll-to-error.\n */\nexport const SwatchPicker = forwardRef<HTMLDivElement, SwatchPickerProps>(function SwatchPicker(\n {\n colors,\n value,\n defaultValue = null,\n onChange,\n size = 'md',\n labels,\n label,\n error,\n helperText,\n required = false,\n name,\n className,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the color 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 | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string | null>(defaultValue)\n const selected = isControlled ? externalValue! : internal\n const active = (selected ?? '').toLowerCase()\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const pick = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // roving tabindex (ARIA radiogroup): only the selected swatch — or the first, if none — is tabbable;\n // arrows move selection between swatches (wrapping), Home/End jump to the ends\n const swatchRefs = useRef<(HTMLButtonElement | null)[]>([])\n const selectedIndex = colors.findIndex((c) => c.toLowerCase() === active)\n const tabbableIndex = selectedIndex >= 0 ? selectedIndex : 0\n const onSwatchKey = (event: ReactKeyboardEvent<HTMLButtonElement>, index: number) => {\n let target = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n target = (index + 1) % colors.length\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n target = (index - 1 + colors.length) % colors.length\n break\n case 'Home':\n target = 0\n break\n case 'End':\n target = colors.length - 1\n break\n default:\n return\n }\n event.preventDefault()\n pick(colors[target])\n swatchRefs.current[target]?.focus()\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n resolvedError && fieldStyles.error,\n className,\n )}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <div\n role=\"radiogroup\"\n aria-labelledby={label != null ? labelId : undefined}\n aria-label={label == null ? ariaLabel : undefined}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n className={clsx(styles.swatches, styles[size])}\n // name + tabIndex are load-bearing for the form's scroll-to-error\n {...(name ? { name, tabIndex: -1 } : {})}\n >\n {colors.map((color, index) => {\n const isSelected = color.toLowerCase() === active\n return (\n <button\n key={color}\n ref={(el) => {\n swatchRefs.current[index] = el\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={labels?.[color] ?? color}\n tabIndex={index === tabbableIndex ? 0 : -1}\n className={styles.swatch}\n style={{ '--sw': color } as CSSProperties}\n onClick={() => pick(color)}\n onKeyDown={(e) => onSwatchKey(e, index)}\n >\n {isSelected ? (\n <Icon\n name=\"TickCircle\"\n style={{ width: 'var(--sw-icon)', height: 'var(--sw-icon)' }}\n />\n ) : null}\n </button>\n )\n })}\n </div>\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["SwatchPicker","forwardRef","colors","value","defaultValue","onChange","size","labels","label","error","helperText","required","name","className","ariaLabel","props","ref","id","useId","labelId","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","active","resolvedError","resolvedHelperText","pick","color","swatchRefs","useRef","selectedIndex","c","tabbableIndex","onSwatchKey","event","index","target","_a","jsxs","clsx","fieldStyles","jsx","Typography","styles","isSelected","el","e","Icon"],"mappings":"wXAgEaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,OAAAC,EACA,MAAAC,EACA,aAAAC,EAAe,KACf,SAAAC,EACA,KAAAC,EAAO,KACP,OAAAC,EACA,MAAAC,EACA,MAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,KAAAC,EACA,UAAAC,EACA,aAAcC,EACd,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAKC,EAAAA,MAAA,EACLC,EAAU,GAAGF,CAAE,SACfG,EAAW,GAAGH,CAAE,UAGhBI,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQT,GAC9BY,EAAQH,GAAQT,EAAOS,EAAK,MAAMT,CAAI,EAAI,OAE1Ca,EACJtB,IAAU,OACNA,E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H,CAAA,CAAA,CAIR,CAAC"}
1
+ {"version":3,"file":"SwatchPicker-C8amdDnA.cjs","sources":["../src/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n// shared field chrome (wrapper / label / helper / required / error / sizes)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './SwatchPicker.module.css'\n\nexport type SwatchPickerSize = 'sm' | 'md' | 'lg'\n\nexport interface SwatchPickerProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** The color values to render as selectable swatches (any CSS color — hex / `rgb()` / …). */\n colors: string[]\n /** The selected color (controlled) — matched case-insensitively against `colors`; `null` = none. */\n value?: string | null\n /** Initial selected color (uncontrolled). */\n defaultValue?: string | null\n /** Fires with the clicked color. */\n onChange?: (color: string) => void\n /**\n * Swatch size — `sm` 30 / `md` 36 / `lg` 42 px, each with its own corner radius and tick size\n * (12/16/20). Defaults to `md`. All three are per-size CSS vars in the module.\n */\n size?: SwatchPickerSize\n /** Per-color accessible labels (falls back to the color value itself). */\n labels?: Record<string, string>\n /** Label rendered above the swatches. */\n label?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the swatches. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Form field name — auto-binds to a surrounding `<Form>` (the form value is the color string). */\n name?: string\n}\n\n/**\n * A grid of selectable color **swatches** (rounded tiles) — pick one from a fixed palette. The selected\n * swatch shows a centered white **`TickCircle`** icon. Unlike `ColorPicker` (a field + full popover\n * picker), this is a lightweight primitive for a **preset** set of colors — e.g. an accent-color chooser.\n * Controlled (`value` + `onChange`) or uncontrolled (`defaultValue`); binds to a surrounding `<Form>` by\n * `name` (the form value is the color string — validate with e.g. `z.string().min(1, 'Pick a color')`),\n * and shares the field family's `label` / `error` + `helperText` / `required` chrome.\n *\n * Swatch fills are arbitrary CSS colors (fed via an inline `--sw` var), not `--tz-*` tokens — a\n * deliberate exception, like `ColorPicker`'s spectrum. a11y: `role=\"radiogroup\"` (labelled by `label`\n * or `aria-label`) with `role=\"radio\"` + `aria-checked` swatches; the group carries `name` for the\n * form's scroll-to-error.\n */\nexport const SwatchPicker = forwardRef<HTMLDivElement, SwatchPickerProps>(function SwatchPicker(\n {\n colors,\n value,\n defaultValue = null,\n onChange,\n size = 'md',\n labels,\n label,\n error,\n helperText,\n required = false,\n name,\n className,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the color 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 | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string | null>(defaultValue)\n const selected = isControlled ? externalValue! : internal\n const active = (selected ?? '').toLowerCase()\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const pick = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // roving tabindex (ARIA radiogroup): only the selected swatch — or the first, if none — is tabbable;\n // arrows move selection between swatches (wrapping), Home/End jump to the ends\n const swatchRefs = useRef<(HTMLButtonElement | null)[]>([])\n const selectedIndex = colors.findIndex((c) => c.toLowerCase() === active)\n const tabbableIndex = selectedIndex >= 0 ? selectedIndex : 0\n const onSwatchKey = (event: ReactKeyboardEvent<HTMLButtonElement>, index: number) => {\n let target = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n target = (index + 1) % colors.length\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n target = (index - 1 + colors.length) % colors.length\n break\n case 'Home':\n target = 0\n break\n case 'End':\n target = colors.length - 1\n break\n default:\n return\n }\n event.preventDefault()\n pick(colors[target])\n swatchRefs.current[target]?.focus()\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n resolvedError && fieldStyles.error,\n className,\n )}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <div\n role=\"radiogroup\"\n aria-labelledby={label != null ? labelId : undefined}\n aria-label={label == null ? ariaLabel : undefined}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n className={clsx(styles.swatches, styles[size])}\n // name + tabIndex are load-bearing for the form's scroll-to-error\n {...(name ? { name, tabIndex: -1 } : {})}\n >\n {colors.map((color, index) => {\n const isSelected = color.toLowerCase() === active\n return (\n <button\n key={color}\n ref={(el) => {\n swatchRefs.current[index] = el\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={labels?.[color] ?? color}\n tabIndex={index === tabbableIndex ? 0 : -1}\n className={styles.swatch}\n style={{ '--sw': color } as CSSProperties}\n onClick={() => pick(color)}\n onKeyDown={(e) => onSwatchKey(e, index)}\n >\n {isSelected ? (\n <Icon\n name=\"TickCircle\"\n style={{ width: 'var(--sw-icon)', height: 'var(--sw-icon)' }}\n />\n ) : null}\n </button>\n )\n })}\n </div>\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["SwatchPicker","forwardRef","colors","value","defaultValue","onChange","size","labels","label","error","helperText","required","name","className","ariaLabel","props","ref","id","useId","labelId","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","active","resolvedError","resolvedHelperText","pick","color","swatchRefs","useRef","selectedIndex","c","tabbableIndex","onSwatchKey","event","index","target","_a","jsxs","clsx","fieldStyles","jsx","Typography","styles","isSelected","el","e","Icon"],"mappings":"wXAgEaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,OAAAC,EACA,MAAAC,EACA,aAAAC,EAAe,KACf,SAAAC,EACA,KAAAC,EAAO,KACP,OAAAC,EACA,MAAAC,EACA,MAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,KAAAC,EACA,UAAAC,EACA,aAAcC,EACd,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAKC,EAAAA,MAAA,EACLC,EAAU,GAAGF,CAAE,SACfG,EAAW,GAAGH,CAAE,UAGhBI,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQT,GAC9BY,EAAQH,GAAQT,EAAOS,EAAK,MAAMT,CAAI,EAAI,OAE1Ca,EACJtB,IAAU,OACNA,EACAoB,EACIF,EAAM,OAAOT,CAAK,GAAmC,KACvD,OACFc,EAAeD,IAAkB,OACjC,CAACE,EAAUC,CAAW,EAAIC,EAAAA,SAAwBzB,CAAY,EAE9D0B,IADWJ,EAAeD,EAAiBE,IACrB,IAAI,YAAA,EAE1BI,EAAgBtB,IAASe,GAAA,YAAAA,EAAO,QAAS,GACzCQ,EAAqBtB,IAAcc,GAAA,YAAAA,EAAO,YAE1CS,EAAQC,GAAkB,CACzBR,GAAcE,EAAYM,CAAK,EAChCX,GAAaF,EAAM,SAAST,EAAOsB,CAAK,EAC5C7B,GAAA,MAAAA,EAAW6B,EACb,EAIMC,EAAaC,EAAAA,OAAqC,EAAE,EACpDC,EAAgBnC,EAAO,UAAW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AA,EAAO,CAAA,EAEpC,SAAAV,EAAO,IAAI,CAACgC,EAAOQ,IAAU,CAC5B,MAAMS,EAAajB,EAAM,YAAA,IAAkBJ,EAC3C,OACEkB,EAAAA,IAAC,SAAA,CAEC,IAAMI,GAAO,CACXjB,EAAW,QAAQO,CAAK,EAAIU,CAC9B,EACA,KAAK,SACL,KAAK,QACL,eAAcD,EACd,cAAY5C,GAAA,YAAAA,EAAS2B,KAAUA,EAC/B,SAAUQ,IAAUH,EAAgB,EAAI,GACxC,UAAWW,EAAO,OAClB,MAAO,CAAE,OAAQhB,CAAA,EACjB,QAAS,IAAMD,EAAKC,CAAK,EACzB,UAAYmB,GAAMb,EAAYa,EAAGX,CAAK,EAErC,SAAAS,EACCH,EAAAA,IAACM,EAAAA,KAAA,CACC,KAAK,aACL,MAAO,CAAE,MAAO,iBAAkB,OAAQ,gBAAA,CAAiB,CAAA,EAE3D,IAAA,EAnBCpB,CAAA,CAsBX,CAAC,CAAA,CAAA,EAEFF,GAAsB,MACrBgB,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAG,OACH,GAAI7B,EACJ,QAAQ,YACR,MAAOW,EAAgB,QAAU,QACjC,UAAWgB,EAAAA,YAAY,OAEtB,SAAAf,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
@@ -4,7 +4,7 @@ import { clsx as L } from "clsx";
4
4
  import { u as O } from "./formContext-B7ln1Miy.js";
5
5
  import { I as Q } from "./Icon-DaTvzLBu.js";
6
6
  import { T as R } from "./Typography-Cta6Rg4L.js";
7
- import { f as n } from "./TextField.module-QePvGeJ3.js";
7
+ import { f as n } from "./TextField.module-6gYcR9TL.js";
8
8
  const W = "_swatches_1kbcs_3", X = "_sm_1kbcs_13", Y = "_md_1kbcs_18", Z = "_lg_1kbcs_23", z = "_swatch_1kbcs_3", w = {
9
9
  swatches: W,
10
10
  sm: X,
@@ -126,4 +126,4 @@ const W = "_swatches_1kbcs_3", X = "_sm_1kbcs_13", Y = "_md_1kbcs_18", Z = "_lg_
126
126
  export {
127
127
  ie as S
128
128
  };
129
- //# sourceMappingURL=SwatchPicker-CqyWngFJ.js.map
129
+ //# sourceMappingURL=SwatchPicker-DXEE9xqY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwatchPicker-CqyWngFJ.js","sources":["../src/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n// shared field chrome (wrapper / label / helper / required / error / sizes)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './SwatchPicker.module.css'\n\nexport type SwatchPickerSize = 'sm' | 'md' | 'lg'\n\nexport interface SwatchPickerProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** The color values to render as selectable swatches (any CSS color — hex / `rgb()` / …). */\n colors: string[]\n /** The selected color (controlled) — matched case-insensitively against `colors`; `null` = none. */\n value?: string | null\n /** Initial selected color (uncontrolled). */\n defaultValue?: string | null\n /** Fires with the clicked color. */\n onChange?: (color: string) => void\n /**\n * Swatch size — `sm` 30 / `md` 36 / `lg` 42 px, each with its own corner radius and tick size\n * (12/16/20). Defaults to `md`. All three are per-size CSS vars in the module.\n */\n size?: SwatchPickerSize\n /** Per-color accessible labels (falls back to the color value itself). */\n labels?: Record<string, string>\n /** Label rendered above the swatches. */\n label?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the swatches. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Form field name — auto-binds to a surrounding `<Form>` (the form value is the color string). */\n name?: string\n}\n\n/**\n * A grid of selectable color **swatches** (rounded tiles) — pick one from a fixed palette. The selected\n * swatch shows a centered white **`TickCircle`** icon. Unlike `ColorPicker` (a field + full popover\n * picker), this is a lightweight primitive for a **preset** set of colors — e.g. an accent-color chooser.\n * Controlled (`value` + `onChange`) or uncontrolled (`defaultValue`); binds to a surrounding `<Form>` by\n * `name` (the form value is the color string — validate with e.g. `z.string().min(1, 'Pick a color')`),\n * and shares the field family's `label` / `error` + `helperText` / `required` chrome.\n *\n * Swatch fills are arbitrary CSS colors (fed via an inline `--sw` var), not `--tz-*` tokens — a\n * deliberate exception, like `ColorPicker`'s spectrum. a11y: `role=\"radiogroup\"` (labelled by `label`\n * or `aria-label`) with `role=\"radio\"` + `aria-checked` swatches; the group carries `name` for the\n * form's scroll-to-error.\n */\nexport const SwatchPicker = forwardRef<HTMLDivElement, SwatchPickerProps>(function SwatchPicker(\n {\n colors,\n value,\n defaultValue = null,\n onChange,\n size = 'md',\n labels,\n label,\n error,\n helperText,\n required = false,\n name,\n className,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the color 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 | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string | null>(defaultValue)\n const selected = isControlled ? externalValue! : internal\n const active = (selected ?? '').toLowerCase()\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const pick = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // roving tabindex (ARIA radiogroup): only the selected swatch — or the first, if none — is tabbable;\n // arrows move selection between swatches (wrapping), Home/End jump to the ends\n const swatchRefs = useRef<(HTMLButtonElement | null)[]>([])\n const selectedIndex = colors.findIndex((c) => c.toLowerCase() === active)\n const tabbableIndex = selectedIndex >= 0 ? selectedIndex : 0\n const onSwatchKey = (event: ReactKeyboardEvent<HTMLButtonElement>, index: number) => {\n let target = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n target = (index + 1) % colors.length\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n target = (index - 1 + colors.length) % colors.length\n break\n case 'Home':\n target = 0\n break\n case 'End':\n target = colors.length - 1\n break\n default:\n return\n }\n event.preventDefault()\n pick(colors[target])\n swatchRefs.current[target]?.focus()\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n resolvedError && fieldStyles.error,\n className,\n )}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <div\n role=\"radiogroup\"\n aria-labelledby={label != null ? labelId : undefined}\n aria-label={label == null ? ariaLabel : undefined}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n className={clsx(styles.swatches, styles[size])}\n // name + tabIndex are load-bearing for the form's scroll-to-error\n {...(name ? { name, tabIndex: -1 } : {})}\n >\n {colors.map((color, index) => {\n const isSelected = color.toLowerCase() === active\n return (\n <button\n key={color}\n ref={(el) => {\n swatchRefs.current[index] = el\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={labels?.[color] ?? color}\n tabIndex={index === tabbableIndex ? 0 : -1}\n className={styles.swatch}\n style={{ '--sw': color } as CSSProperties}\n onClick={() => pick(color)}\n onKeyDown={(e) => onSwatchKey(e, index)}\n >\n {isSelected ? (\n <Icon\n name=\"TickCircle\"\n style={{ width: 'var(--sw-icon)', height: 'var(--sw-icon)' }}\n />\n ) : null}\n </button>\n )\n })}\n </div>\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["SwatchPicker","forwardRef","colors","value","defaultValue","onChange","size","labels","label","error","helperText","required","name","className","ariaLabel","props","ref","id","useId","labelId","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","active","resolvedError","resolvedHelperText","pick","color","swatchRefs","useRef","selectedIndex","c","tabbableIndex","onSwatchKey","event","index","target","_a","jsxs","clsx","fieldStyles","jsx","Typography","styles","isSelected","el","e","Icon"],"mappings":";;;;;;;;;;;;;GAgEaA,KAAeC,EAA8C,SACxE;AAAA,EACE,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAcC;AAAA,EACd,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAKC,EAAA,GACLC,IAAU,GAAGF,CAAE,UACfG,IAAW,GAAGH,CAAE,WAGhBI,IAAOC,EAAA,GACPC,IAAc,GAAQF,KAAQT,IAC9BY,IAAQH,KAAQT,IAAOS,EAAK,MAAMT,CAAI,IAAI,QAE1Ca,IACJtB,MAAU,SACNA,IACAoB,IACIF,EAAM,OAAOT,CAAK,KAAmC,OACvD,QACFc,IAAeD,MAAkB,QACjC,CAACE,GAAUC,CAAW,IAAIC,EAAwBzB,CAAY,GAE9D0B,MADWJ,IAAeD,IAAiBE,MACrB,IAAI,YAAA,GAE1BI,IAAgBtB,MAASe,KAAA,gBAAAA,EAAO,UAAS,IACzCQ,IAAqBtB,MAAcc,KAAA,gBAAAA,EAAO,aAE1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AAgB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAI7B;AAAA,YACJ,SAAQ;AAAA,YACR,OAAOW,IAAgB,UAAU;AAAA,YACjC,WAAWgB,EAAY;AAAA,YAEtB,UAAAf;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"SwatchPicker-DXEE9xqY.js","sources":["../src/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["import {\n forwardRef,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n// shared field chrome (wrapper / label / helper / required / error / sizes)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './SwatchPicker.module.css'\n\nexport type SwatchPickerSize = 'sm' | 'md' | 'lg'\n\nexport interface SwatchPickerProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** The color values to render as selectable swatches (any CSS color — hex / `rgb()` / …). */\n colors: string[]\n /** The selected color (controlled) — matched case-insensitively against `colors`; `null` = none. */\n value?: string | null\n /** Initial selected color (uncontrolled). */\n defaultValue?: string | null\n /** Fires with the clicked color. */\n onChange?: (color: string) => void\n /**\n * Swatch size — `sm` 30 / `md` 36 / `lg` 42 px, each with its own corner radius and tick size\n * (12/16/20). Defaults to `md`. All three are per-size CSS vars in the module.\n */\n size?: SwatchPickerSize\n /** Per-color accessible labels (falls back to the color value itself). */\n labels?: Record<string, string>\n /** Label rendered above the swatches. */\n label?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the swatches. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Form field name — auto-binds to a surrounding `<Form>` (the form value is the color string). */\n name?: string\n}\n\n/**\n * A grid of selectable color **swatches** (rounded tiles) — pick one from a fixed palette. The selected\n * swatch shows a centered white **`TickCircle`** icon. Unlike `ColorPicker` (a field + full popover\n * picker), this is a lightweight primitive for a **preset** set of colors — e.g. an accent-color chooser.\n * Controlled (`value` + `onChange`) or uncontrolled (`defaultValue`); binds to a surrounding `<Form>` by\n * `name` (the form value is the color string — validate with e.g. `z.string().min(1, 'Pick a color')`),\n * and shares the field family's `label` / `error` + `helperText` / `required` chrome.\n *\n * Swatch fills are arbitrary CSS colors (fed via an inline `--sw` var), not `--tz-*` tokens — a\n * deliberate exception, like `ColorPicker`'s spectrum. a11y: `role=\"radiogroup\"` (labelled by `label`\n * or `aria-label`) with `role=\"radio\"` + `aria-checked` swatches; the group carries `name` for the\n * form's scroll-to-error.\n */\nexport const SwatchPicker = forwardRef<HTMLDivElement, SwatchPickerProps>(function SwatchPicker(\n {\n colors,\n value,\n defaultValue = null,\n onChange,\n size = 'md',\n labels,\n label,\n error,\n helperText,\n required = false,\n name,\n className,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name` — the form value is the color 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 | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<string | null>(defaultValue)\n const selected = isControlled ? externalValue! : internal\n const active = (selected ?? '').toLowerCase()\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const pick = (color: string) => {\n if (!isControlled) setInternal(color)\n if (isFormBound) form!.setValue(name!, color)\n onChange?.(color)\n }\n\n // roving tabindex (ARIA radiogroup): only the selected swatch — or the first, if none — is tabbable;\n // arrows move selection between swatches (wrapping), Home/End jump to the ends\n const swatchRefs = useRef<(HTMLButtonElement | null)[]>([])\n const selectedIndex = colors.findIndex((c) => c.toLowerCase() === active)\n const tabbableIndex = selectedIndex >= 0 ? selectedIndex : 0\n const onSwatchKey = (event: ReactKeyboardEvent<HTMLButtonElement>, index: number) => {\n let target = index\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n target = (index + 1) % colors.length\n break\n case 'ArrowLeft':\n case 'ArrowUp':\n target = (index - 1 + colors.length) % colors.length\n break\n case 'Home':\n target = 0\n break\n case 'End':\n target = colors.length - 1\n break\n default:\n return\n }\n event.preventDefault()\n pick(colors[target])\n swatchRefs.current[target]?.focus()\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n resolvedError && fieldStyles.error,\n className,\n )}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <div\n role=\"radiogroup\"\n aria-labelledby={label != null ? labelId : undefined}\n aria-label={label == null ? ariaLabel : undefined}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n className={clsx(styles.swatches, styles[size])}\n // name + tabIndex are load-bearing for the form's scroll-to-error\n {...(name ? { name, tabIndex: -1 } : {})}\n >\n {colors.map((color, index) => {\n const isSelected = color.toLowerCase() === active\n return (\n <button\n key={color}\n ref={(el) => {\n swatchRefs.current[index] = el\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={labels?.[color] ?? color}\n tabIndex={index === tabbableIndex ? 0 : -1}\n className={styles.swatch}\n style={{ '--sw': color } as CSSProperties}\n onClick={() => pick(color)}\n onKeyDown={(e) => onSwatchKey(e, index)}\n >\n {isSelected ? (\n <Icon\n name=\"TickCircle\"\n style={{ width: 'var(--sw-icon)', height: 'var(--sw-icon)' }}\n />\n ) : null}\n </button>\n )\n })}\n </div>\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["SwatchPicker","forwardRef","colors","value","defaultValue","onChange","size","labels","label","error","helperText","required","name","className","ariaLabel","props","ref","id","useId","labelId","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","active","resolvedError","resolvedHelperText","pick","color","swatchRefs","useRef","selectedIndex","c","tabbableIndex","onSwatchKey","event","index","target","_a","jsxs","clsx","fieldStyles","jsx","Typography","styles","isSelected","el","e","Icon"],"mappings":";;;;;;;;;;;;;GAgEaA,KAAeC,EAA8C,SACxE;AAAA,EACE,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAcC;AAAA,EACd,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAKC,EAAA,GACLC,IAAU,GAAGF,CAAE,UACfG,IAAW,GAAGH,CAAE,WAGhBI,IAAOC,EAAA,GACPC,IAAc,GAAQF,KAAQT,IAC9BY,IAAQH,KAAQT,IAAOS,EAAK,MAAMT,CAAI,IAAI,QAE1Ca,IACJtB,MAAU,SACNA,IACAoB,IACIF,EAAM,OAAOT,CAAK,KAAmC,OACvD,QACFc,IAAeD,MAAkB,QACjC,CAACE,GAAUC,CAAW,IAAIC,EAAwBzB,CAAY,GAE9D0B,MADWJ,IAAeD,IAAiBE,MACrB,IAAI,YAAA,GAE1BI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