@techzyapp/ui-library 1.0.33 → 1.0.35

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 (430) hide show
  1. package/dist/{AdminRoot-CwUHa2us.js → AdminRoot-C_SNXQkB.js} +9 -9
  2. package/dist/{AdminRoot-CwUHa2us.js.map → AdminRoot-C_SNXQkB.js.map} +1 -1
  3. package/dist/{AdminRoot-cjP_Ad4r.cjs → AdminRoot-D97qDVTM.cjs} +2 -2
  4. package/dist/{AdminRoot-cjP_Ad4r.cjs.map → AdminRoot-D97qDVTM.cjs.map} +1 -1
  5. package/dist/{Alert-LJDrtkJy.js → Alert-BXtQFAVl.js} +3 -3
  6. package/dist/{Alert-LJDrtkJy.js.map → Alert-BXtQFAVl.js.map} +1 -1
  7. package/dist/{Alert-CfjDmLR8.cjs → Alert-CggrNMn5.cjs} +2 -2
  8. package/dist/{Alert-CfjDmLR8.cjs.map → Alert-CggrNMn5.cjs.map} +1 -1
  9. package/dist/{AuthLayout-m1BQ6Ixx.js → AuthLayout-C47vXKYp.js} +2 -2
  10. package/dist/{AuthLayout-m1BQ6Ixx.js.map → AuthLayout-C47vXKYp.js.map} +1 -1
  11. package/dist/{AuthLayout-DIcR__vo.cjs → AuthLayout-Cl3tb4-E.cjs} +2 -2
  12. package/dist/{AuthLayout-DIcR__vo.cjs.map → AuthLayout-Cl3tb4-E.cjs.map} +1 -1
  13. package/dist/{Breadcrumbs-COb2zmDk.cjs → Breadcrumbs-Cpa_LSY2.cjs} +2 -2
  14. package/dist/{Breadcrumbs-COb2zmDk.cjs.map → Breadcrumbs-Cpa_LSY2.cjs.map} +1 -1
  15. package/dist/{Breadcrumbs-DYeVrOns.js → Breadcrumbs-D_QnKw8q.js} +3 -3
  16. package/dist/{Breadcrumbs-DYeVrOns.js.map → Breadcrumbs-D_QnKw8q.js.map} +1 -1
  17. package/dist/{Button-PBZnkRNn.js → Button-BQ7jsm5P.js} +2 -2
  18. package/dist/{Button-PBZnkRNn.js.map → Button-BQ7jsm5P.js.map} +1 -1
  19. package/dist/{Button-BD5wpg-t.cjs → Button-Cm64ROip.cjs} +2 -2
  20. package/dist/{Button-BD5wpg-t.cjs.map → Button-Cm64ROip.cjs.map} +1 -1
  21. package/dist/{Calendar-Bb5Ekbpr.js → Calendar-BrpJOBTt.js} +3 -3
  22. package/dist/{Calendar-Bb5Ekbpr.js.map → Calendar-BrpJOBTt.js.map} +1 -1
  23. package/dist/{Calendar-842vjtdN.cjs → Calendar-C2x9ZtPV.cjs} +2 -2
  24. package/dist/{Calendar-842vjtdN.cjs.map → Calendar-C2x9ZtPV.cjs.map} +1 -1
  25. package/dist/{Card-CV_rHego.js → Card-kizK1B7N.js} +2 -2
  26. package/dist/{Card-CV_rHego.js.map → Card-kizK1B7N.js.map} +1 -1
  27. package/dist/{Card-DL7XnkOA.cjs → Card-yhly3Xdp.cjs} +2 -2
  28. package/dist/{Card-DL7XnkOA.cjs.map → Card-yhly3Xdp.cjs.map} +1 -1
  29. package/dist/{Chip-CLPIPC9a.cjs → Chip-BPcnO5WI.cjs} +2 -2
  30. package/dist/{Chip-CLPIPC9a.cjs.map → Chip-BPcnO5WI.cjs.map} +1 -1
  31. package/dist/{Chip-DdOUVF0Z.js → Chip-BzyzLEeX.js} +2 -2
  32. package/dist/{Chip-DdOUVF0Z.js.map → Chip-BzyzLEeX.js.map} +1 -1
  33. package/dist/{ChoiceCardGroup-BTbKjJdp.js → ChoiceCardGroup-BBD8ai4s.js} +2 -2
  34. package/dist/{ChoiceCardGroup-BTbKjJdp.js.map → ChoiceCardGroup-BBD8ai4s.js.map} +1 -1
  35. package/dist/{ChoiceCardGroup-Bg2jtFpe.cjs → ChoiceCardGroup-BWsG_Vh5.cjs} +2 -2
  36. package/dist/{ChoiceCardGroup-Bg2jtFpe.cjs.map → ChoiceCardGroup-BWsG_Vh5.cjs.map} +1 -1
  37. package/dist/{CodeBlock-B35NXZzd.js → CodeBlock-BTt40oh5.js} +3 -3
  38. package/dist/{CodeBlock-B35NXZzd.js.map → CodeBlock-BTt40oh5.js.map} +1 -1
  39. package/dist/{CodeBlock-C0dbyxcl.cjs → CodeBlock-BgSum_bB.cjs} +2 -2
  40. package/dist/{CodeBlock-C0dbyxcl.cjs.map → CodeBlock-BgSum_bB.cjs.map} +1 -1
  41. package/dist/{ColorPicker-6UraVYFy.js → ColorPicker-BNM75F5E.js} +4 -4
  42. package/dist/{ColorPicker-6UraVYFy.js.map → ColorPicker-BNM75F5E.js.map} +1 -1
  43. package/dist/{ColorPicker-DmLGKaYF.cjs → ColorPicker-C33dlkhN.cjs} +2 -2
  44. package/dist/{ColorPicker-DmLGKaYF.cjs.map → ColorPicker-C33dlkhN.cjs.map} +1 -1
  45. package/dist/{ColorPickerPanel-WuxwwfCI.cjs → ColorPickerPanel-BZ_ZNu2B.cjs} +2 -2
  46. package/dist/{ColorPickerPanel-WuxwwfCI.cjs.map → ColorPickerPanel-BZ_ZNu2B.cjs.map} +1 -1
  47. package/dist/{ColorPickerPanel-DZ-W_wOI.js → ColorPickerPanel-Bh1K0YS8.js} +2 -2
  48. package/dist/{ColorPickerPanel-DZ-W_wOI.js.map → ColorPickerPanel-Bh1K0YS8.js.map} +1 -1
  49. package/dist/{ColorRamp-D_9gsqJl.cjs → ColorRamp-BJWNKzoX.cjs} +2 -2
  50. package/dist/{ColorRamp-D_9gsqJl.cjs.map → ColorRamp-BJWNKzoX.cjs.map} +1 -1
  51. package/dist/{ColorRamp-CSqzzHZx.js → ColorRamp-BnuXrSxa.js} +3 -3
  52. package/dist/{ColorRamp-CSqzzHZx.js.map → ColorRamp-BnuXrSxa.js.map} +1 -1
  53. package/dist/{ConfigProvider-tvLbKiqu.js → ConfigProvider-DZMtq2Fz.js} +2 -2
  54. package/dist/ConfigProvider-DZMtq2Fz.js.map +1 -0
  55. package/dist/{ConfigProvider-CVLHPXQm.cjs → ConfigProvider-th4GYhcU.cjs} +2 -2
  56. package/dist/ConfigProvider-th4GYhcU.cjs.map +1 -0
  57. package/dist/{CopyButton-0w4OToIy.cjs → CopyButton-C9oHGs6W.cjs} +2 -2
  58. package/dist/{CopyButton-0w4OToIy.cjs.map → CopyButton-C9oHGs6W.cjs.map} +1 -1
  59. package/dist/{CopyButton-B_mYxcXV.js → CopyButton-hZqLdXJq.js} +3 -3
  60. package/dist/{CopyButton-B_mYxcXV.js.map → CopyButton-hZqLdXJq.js.map} +1 -1
  61. package/dist/{DatePicker-Bt-M87zX.js → DatePicker-B6ZL_T-E.js} +5 -5
  62. package/dist/{DatePicker-Bt-M87zX.js.map → DatePicker-B6ZL_T-E.js.map} +1 -1
  63. package/dist/{DatePicker-D1uFIm3M.cjs → DatePicker-DXwJB4MH.cjs} +2 -2
  64. package/dist/{DatePicker-D1uFIm3M.cjs.map → DatePicker-DXwJB4MH.cjs.map} +1 -1
  65. package/dist/{DateTimePicker-zJUc9crs.js → DateTimePicker-BynW1Eeg.js} +8 -8
  66. package/dist/{DateTimePicker-zJUc9crs.js.map → DateTimePicker-BynW1Eeg.js.map} +1 -1
  67. package/dist/{DateTimePicker-DPt-LDVJ.cjs → DateTimePicker-CHi1H2k1.cjs} +2 -2
  68. package/dist/{DateTimePicker-DPt-LDVJ.cjs.map → DateTimePicker-CHi1H2k1.cjs.map} +1 -1
  69. package/dist/{DescriptionList-CPCbzU9b.cjs → DescriptionList-BqYwp08t.cjs} +2 -2
  70. package/dist/{DescriptionList-CPCbzU9b.cjs.map → DescriptionList-BqYwp08t.cjs.map} +1 -1
  71. package/dist/{DescriptionList-BLx9NfAW.js → DescriptionList-C6Gfk6I_.js} +5 -5
  72. package/dist/{DescriptionList-BLx9NfAW.js.map → DescriptionList-C6Gfk6I_.js.map} +1 -1
  73. package/dist/{EmptyState-BEVEGcLx.js → EmptyState-BvAA5mYO.js} +2 -2
  74. package/dist/{EmptyState-BEVEGcLx.js.map → EmptyState-BvAA5mYO.js.map} +1 -1
  75. package/dist/{EmptyState-C54C0Qwc.cjs → EmptyState-CZ6X5-Zy.cjs} +2 -2
  76. package/dist/{EmptyState-C54C0Qwc.cjs.map → EmptyState-CZ6X5-Zy.cjs.map} +1 -1
  77. package/dist/{ErrorBoundary-BSJL381Y.js → ErrorBoundary-BS0x9RVO.js} +14 -6
  78. package/dist/ErrorBoundary-BS0x9RVO.js.map +1 -0
  79. package/dist/ErrorBoundary-WwmJrL6o.cjs +2 -0
  80. package/dist/ErrorBoundary-WwmJrL6o.cjs.map +1 -0
  81. package/dist/ErrorState-BTSGKrJq.js +178 -0
  82. package/dist/ErrorState-BTSGKrJq.js.map +1 -0
  83. package/dist/ErrorState-DRXuV6na.cjs +4 -0
  84. package/dist/ErrorState-DRXuV6na.cjs.map +1 -0
  85. package/dist/{FileCard-R_sB8Qbx.js → FileCard-CxZ3o4BO.js} +4 -4
  86. package/dist/{FileCard-R_sB8Qbx.js.map → FileCard-CxZ3o4BO.js.map} +1 -1
  87. package/dist/{FileCard-B3dfdTVN.cjs → FileCard-ZZNd_tUN.cjs} +2 -2
  88. package/dist/{FileCard-B3dfdTVN.cjs.map → FileCard-ZZNd_tUN.cjs.map} +1 -1
  89. package/dist/{FileUploader-4UMy0urx.cjs → FileUploader-B--hPV3b.cjs} +2 -2
  90. package/dist/{FileUploader-4UMy0urx.cjs.map → FileUploader-B--hPV3b.cjs.map} +1 -1
  91. package/dist/{FileUploader-B55atuxq.js → FileUploader-CPah0hUe.js} +6 -6
  92. package/dist/{FileUploader-B55atuxq.js.map → FileUploader-CPah0hUe.js.map} +1 -1
  93. package/dist/{Flag-CFvJHC0u.cjs → Flag-C4La35rA.cjs} +2 -2
  94. package/dist/{Flag-CFvJHC0u.cjs.map → Flag-C4La35rA.cjs.map} +1 -1
  95. package/dist/{Flag-D7fmMqqy.js → Flag-DikEV1jI.js} +2 -2
  96. package/dist/{Flag-D7fmMqqy.js.map → Flag-DikEV1jI.js.map} +1 -1
  97. package/dist/{FullscreenToggle-CXmPqxJv.js → FullscreenToggle-CTt7_Kv_.js} +3 -3
  98. package/dist/{FullscreenToggle-CXmPqxJv.js.map → FullscreenToggle-CTt7_Kv_.js.map} +1 -1
  99. package/dist/{FullscreenToggle-D7tUPCNI.cjs → FullscreenToggle-ejjFFd9a.cjs} +2 -2
  100. package/dist/{FullscreenToggle-D7tUPCNI.cjs.map → FullscreenToggle-ejjFFd9a.cjs.map} +1 -1
  101. package/dist/{IconButton-sC_E_TXd.js → IconButton-BUmXN_lD.js} +2 -2
  102. package/dist/{IconButton-sC_E_TXd.js.map → IconButton-BUmXN_lD.js.map} +1 -1
  103. package/dist/{IconButton-BVrO9TBP.cjs → IconButton-CYMvszcM.cjs} +2 -2
  104. package/dist/{IconButton-BVrO9TBP.cjs.map → IconButton-CYMvszcM.cjs.map} +1 -1
  105. package/dist/{Loader-DNCEHqZb.cjs → Loader-DkwiCGbB.cjs} +2 -2
  106. package/dist/{Loader-DNCEHqZb.cjs.map → Loader-DkwiCGbB.cjs.map} +1 -1
  107. package/dist/{Loader-ChrouvaR.js → Loader-jh7XMRhy.js} +2 -2
  108. package/dist/{Loader-ChrouvaR.js.map → Loader-jh7XMRhy.js.map} +1 -1
  109. package/dist/{LocationPicker-DxiQ27k6.js → LocationPicker-Cdm7BCX5.js} +7 -7
  110. package/dist/{LocationPicker-DxiQ27k6.js.map → LocationPicker-Cdm7BCX5.js.map} +1 -1
  111. package/dist/{LocationPicker-CJ6bCJC4.cjs → LocationPicker-D-9mrCVD.cjs} +2 -2
  112. package/dist/{LocationPicker-CJ6bCJC4.cjs.map → LocationPicker-D-9mrCVD.cjs.map} +1 -1
  113. package/dist/{Modal-Do8pzyMl.js → Modal-CrvOHbNy.js} +3 -3
  114. package/dist/{Modal-Do8pzyMl.js.map → Modal-CrvOHbNy.js.map} +1 -1
  115. package/dist/{Modal-BL_XihC8.cjs → Modal-eI6QL-LM.cjs} +2 -2
  116. package/dist/{Modal-BL_XihC8.cjs.map → Modal-eI6QL-LM.cjs.map} +1 -1
  117. package/dist/{MultiSelect-BfsEdXNa.js → MultiSelect-BTilYrXp.js} +5 -5
  118. package/dist/{MultiSelect-BfsEdXNa.js.map → MultiSelect-BTilYrXp.js.map} +1 -1
  119. package/dist/{MultiSelect-WS5YNGRD.cjs → MultiSelect-B_Jenpgv.cjs} +2 -2
  120. package/dist/{MultiSelect-WS5YNGRD.cjs.map → MultiSelect-B_Jenpgv.cjs.map} +1 -1
  121. package/dist/{MultilineTextField-BgfBFeeF.js → MultilineTextField-DJ26nTdF.js} +2 -2
  122. package/dist/{MultilineTextField-BgfBFeeF.js.map → MultilineTextField-DJ26nTdF.js.map} +1 -1
  123. package/dist/{MultilineTextField-B6EYAdik.cjs → MultilineTextField-ihcPDX3D.cjs} +2 -2
  124. package/dist/{MultilineTextField-B6EYAdik.cjs.map → MultilineTextField-ihcPDX3D.cjs.map} +1 -1
  125. package/dist/{NumberField-P68n6q5m.js → NumberField-DEoaxFJj.js} +4 -4
  126. package/dist/{NumberField-P68n6q5m.js.map → NumberField-DEoaxFJj.js.map} +1 -1
  127. package/dist/{NumberField-CxiEfRAi.cjs → NumberField-czWHuAyt.cjs} +2 -2
  128. package/dist/{NumberField-CxiEfRAi.cjs.map → NumberField-czWHuAyt.cjs.map} +1 -1
  129. package/dist/{OtpField-XieJfl1y.cjs → OtpField-DK5KikOt.cjs} +2 -2
  130. package/dist/{OtpField-XieJfl1y.cjs.map → OtpField-DK5KikOt.cjs.map} +1 -1
  131. package/dist/{OtpField-DjTJH4Kh.js → OtpField-v2RuXdsE.js} +3 -3
  132. package/dist/{OtpField-DjTJH4Kh.js.map → OtpField-v2RuXdsE.js.map} +1 -1
  133. package/dist/PageError-CIVYNLTW.cjs +2 -0
  134. package/dist/{PageError-D7_Q8wz8.cjs.map → PageError-CIVYNLTW.cjs.map} +1 -1
  135. package/dist/PageError-CyMdVrxL.js +70 -0
  136. package/dist/{PageError-ClR7k0Zb.js.map → PageError-CyMdVrxL.js.map} +1 -1
  137. package/dist/{PageLayout-XQ_aQTf5.js → PageLayout-BtukUUfe.js} +2 -2
  138. package/dist/{PageLayout-XQ_aQTf5.js.map → PageLayout-BtukUUfe.js.map} +1 -1
  139. package/dist/{PageLayout-DTG83hLL.cjs → PageLayout-C_daDKkg.cjs} +2 -2
  140. package/dist/{PageLayout-DTG83hLL.cjs.map → PageLayout-C_daDKkg.cjs.map} +1 -1
  141. package/dist/{PageNotFound-D3wJ4Job.cjs → PageNotFound-CHb8DlqC.cjs} +2 -2
  142. package/dist/{PageNotFound-D3wJ4Job.cjs.map → PageNotFound-CHb8DlqC.cjs.map} +1 -1
  143. package/dist/{PageNotFound-CpwHMTxG.js → PageNotFound-DQ-OvU_O.js} +5 -5
  144. package/dist/{PageNotFound-CpwHMTxG.js.map → PageNotFound-DQ-OvU_O.js.map} +1 -1
  145. package/dist/{Pagination-Df-F9i2o.js → Pagination-BjufY1mt.js} +2 -2
  146. package/dist/{Pagination-Df-F9i2o.js.map → Pagination-BjufY1mt.js.map} +1 -1
  147. package/dist/{Pagination-BF8cmQMi.cjs → Pagination-jLyJa8iL.cjs} +2 -2
  148. package/dist/{Pagination-BF8cmQMi.cjs.map → Pagination-jLyJa8iL.cjs.map} +1 -1
  149. package/dist/{PaletteField-BFRPv7AC.cjs → PaletteField-DGaV7VJ9.cjs} +2 -2
  150. package/dist/{PaletteField-BFRPv7AC.cjs.map → PaletteField-DGaV7VJ9.cjs.map} +1 -1
  151. package/dist/{PaletteField-DUu4jz1c.js → PaletteField-DTfV8Lny.js} +3 -3
  152. package/dist/{PaletteField-DUu4jz1c.js.map → PaletteField-DTfV8Lny.js.map} +1 -1
  153. package/dist/{PhoneField-CXIQX_hR.js → PhoneField-BSIhBMW2.js} +5 -5
  154. package/dist/{PhoneField-CXIQX_hR.js.map → PhoneField-BSIhBMW2.js.map} +1 -1
  155. package/dist/{PhoneField-O5syyH7u.cjs → PhoneField-DchrnSiE.cjs} +2 -2
  156. package/dist/{PhoneField-O5syyH7u.cjs.map → PhoneField-DchrnSiE.cjs.map} +1 -1
  157. package/dist/{Popconfirm-bEoOPmZY.cjs → Popconfirm-l9au66oY.cjs} +2 -2
  158. package/dist/{Popconfirm-bEoOPmZY.cjs.map → Popconfirm-l9au66oY.cjs.map} +1 -1
  159. package/dist/{Popconfirm-D4J7tlk_.js → Popconfirm-p2O8Vmz0.js} +3 -3
  160. package/dist/{Popconfirm-D4J7tlk_.js.map → Popconfirm-p2O8Vmz0.js.map} +1 -1
  161. package/dist/{Progress-BxvqmmGS.js → Progress-C-VGs3yJ.js} +2 -2
  162. package/dist/{Progress-BxvqmmGS.js.map → Progress-C-VGs3yJ.js.map} +1 -1
  163. package/dist/{Progress-CqXX0rRp.cjs → Progress-Cqr2_BF1.cjs} +2 -2
  164. package/dist/{Progress-CqXX0rRp.cjs.map → Progress-Cqr2_BF1.cjs.map} +1 -1
  165. package/dist/{QrCode-osD23Vkt.js → QrCode-B9YbQNVc.js} +2 -2
  166. package/dist/{QrCode-osD23Vkt.js.map → QrCode-B9YbQNVc.js.map} +1 -1
  167. package/dist/{QrCode-BQ1eUiAJ.cjs → QrCode-CNVYpz9j.cjs} +2 -2
  168. package/dist/{QrCode-BQ1eUiAJ.cjs.map → QrCode-CNVYpz9j.cjs.map} +1 -1
  169. package/dist/{RadioGroup-CvC2yc4p.cjs → RadioGroup-687BVZ7k.cjs} +2 -2
  170. package/dist/{RadioGroup-CvC2yc4p.cjs.map → RadioGroup-687BVZ7k.cjs.map} +1 -1
  171. package/dist/{RadioGroup-CTAayuMv.js → RadioGroup-CD209tlb.js} +2 -2
  172. package/dist/{RadioGroup-CTAayuMv.js.map → RadioGroup-CD209tlb.js.map} +1 -1
  173. package/dist/{RemoveDialog-DH3eNUxC.js → RemoveDialog-BKgWohkG.js} +6 -6
  174. package/dist/{RemoveDialog-DH3eNUxC.js.map → RemoveDialog-BKgWohkG.js.map} +1 -1
  175. package/dist/{RemoveDialog-FrieNcjL.cjs → RemoveDialog-eGCbOuuM.cjs} +2 -2
  176. package/dist/{RemoveDialog-FrieNcjL.cjs.map → RemoveDialog-eGCbOuuM.cjs.map} +1 -1
  177. package/dist/{RichTextEditor-B-C4NPDk.cjs → RichTextEditor-BPAD4ISz.cjs} +2 -2
  178. package/dist/{RichTextEditor-B-C4NPDk.cjs.map → RichTextEditor-BPAD4ISz.cjs.map} +1 -1
  179. package/dist/{RichTextEditor-6frB2C5G.js → RichTextEditor-C24uBIWh.js} +8 -8
  180. package/dist/{RichTextEditor-6frB2C5G.js.map → RichTextEditor-C24uBIWh.js.map} +1 -1
  181. package/dist/RootLayout-BY_BxQ0C.cjs +2 -0
  182. package/dist/RootLayout-BY_BxQ0C.cjs.map +1 -0
  183. package/dist/RootLayout-CicjlAUF.js +641 -0
  184. package/dist/RootLayout-CicjlAUF.js.map +1 -0
  185. package/dist/{Select-Bjq_p8_e.cjs → Select-BbgueWwN.cjs} +2 -2
  186. package/dist/{Select-Bjq_p8_e.cjs.map → Select-BbgueWwN.cjs.map} +1 -1
  187. package/dist/{Select-DO3zDQYV.js → Select-DEi_ZUHR.js} +4 -4
  188. package/dist/{Select-DO3zDQYV.js.map → Select-DEi_ZUHR.js.map} +1 -1
  189. package/dist/{Sidebar-2oH285Xs.cjs → Sidebar-D-nR8Cu6.cjs} +2 -2
  190. package/dist/{Sidebar-2oH285Xs.cjs.map → Sidebar-D-nR8Cu6.cjs.map} +1 -1
  191. package/dist/{Sidebar-CKbSWc5q.js → Sidebar-nORfjIg8.js} +4 -4
  192. package/dist/{Sidebar-CKbSWc5q.js.map → Sidebar-nORfjIg8.js.map} +1 -1
  193. package/dist/{Slider-Cu1FhxR2.cjs → Slider-0joKXhPo.cjs} +2 -2
  194. package/dist/{Slider-Cu1FhxR2.cjs.map → Slider-0joKXhPo.cjs.map} +1 -1
  195. package/dist/{Slider-DoQJWgGU.js → Slider-CwZYxDO0.js} +2 -2
  196. package/dist/{Slider-DoQJWgGU.js.map → Slider-CwZYxDO0.js.map} +1 -1
  197. package/dist/{SpeedDial-BZK-z_r9.js → SpeedDial-BMpJtYP6.js} +2 -2
  198. package/dist/{SpeedDial-BZK-z_r9.js.map → SpeedDial-BMpJtYP6.js.map} +1 -1
  199. package/dist/{SpeedDial-KGf8b4Gq.cjs → SpeedDial-D5uk_E5v.cjs} +2 -2
  200. package/dist/{SpeedDial-KGf8b4Gq.cjs.map → SpeedDial-D5uk_E5v.cjs.map} +1 -1
  201. package/dist/{Stepper-s9Vah5R2.cjs → Stepper-BRksGDK1.cjs} +2 -2
  202. package/dist/{Stepper-s9Vah5R2.cjs.map → Stepper-BRksGDK1.cjs.map} +1 -1
  203. package/dist/{Stepper-BI3pjWf_.js → Stepper-D8bRyyhl.js} +2 -2
  204. package/dist/{Stepper-BI3pjWf_.js.map → Stepper-D8bRyyhl.js.map} +1 -1
  205. package/dist/{SwatchPicker-CpwVq0xp.cjs → SwatchPicker-BVW_yhRU.cjs} +2 -2
  206. package/dist/{SwatchPicker-CpwVq0xp.cjs.map → SwatchPicker-BVW_yhRU.cjs.map} +1 -1
  207. package/dist/{SwatchPicker-BAKslSY4.js → SwatchPicker-C-_wLaf6.js} +2 -2
  208. package/dist/{SwatchPicker-BAKslSY4.js.map → SwatchPicker-C-_wLaf6.js.map} +1 -1
  209. package/dist/{Table-PsNnKn_j.js → Table-C0RDylA0.js} +18 -18
  210. package/dist/{Table-PsNnKn_j.js.map → Table-C0RDylA0.js.map} +1 -1
  211. package/dist/{Table-CLjLsYYS.cjs → Table-CGIip6UL.cjs} +2 -2
  212. package/dist/{Table-CLjLsYYS.cjs.map → Table-CGIip6UL.cjs.map} +1 -1
  213. package/dist/{Tabs-DQoNP0QT.cjs → Tabs-BzbSNmBj.cjs} +2 -2
  214. package/dist/{Tabs-DQoNP0QT.cjs.map → Tabs-BzbSNmBj.cjs.map} +1 -1
  215. package/dist/{Tabs-B2WzlRXI.js → Tabs-CQvfqazt.js} +2 -2
  216. package/dist/{Tabs-B2WzlRXI.js.map → Tabs-CQvfqazt.js.map} +1 -1
  217. package/dist/{TagsField-pdvQU4zh.js → TagsField-BdM-xre0.js} +5 -5
  218. package/dist/{TagsField-pdvQU4zh.js.map → TagsField-BdM-xre0.js.map} +1 -1
  219. package/dist/{TagsField-CLfAAz4N.cjs → TagsField-CGL1oI7b.cjs} +2 -2
  220. package/dist/{TagsField-CLfAAz4N.cjs.map → TagsField-CGL1oI7b.cjs.map} +1 -1
  221. package/dist/{TextField-CgPfN-4d.cjs → TextField-D49Lpbjt.cjs} +2 -2
  222. package/dist/{TextField-CgPfN-4d.cjs.map → TextField-D49Lpbjt.cjs.map} +1 -1
  223. package/dist/{TextField-LONfx4jy.js → TextField-otYGVuwF.js} +4 -4
  224. package/dist/{TextField-LONfx4jy.js.map → TextField-otYGVuwF.js.map} +1 -1
  225. package/dist/{ThemeToggle-9RBaRALj.cjs → ThemeToggle-B8rkRTis.cjs} +2 -2
  226. package/dist/{ThemeToggle-9RBaRALj.cjs.map → ThemeToggle-B8rkRTis.cjs.map} +1 -1
  227. package/dist/{ThemeToggle-DTkFppOd.js → ThemeToggle-D33Tqv2F.js} +3 -3
  228. package/dist/{ThemeToggle-DTkFppOd.js.map → ThemeToggle-D33Tqv2F.js.map} +1 -1
  229. package/dist/{TimeColumns-B7af5Cbj.js → TimeColumns-DyjTpZbD.js} +2 -2
  230. package/dist/{TimeColumns-B7af5Cbj.js.map → TimeColumns-DyjTpZbD.js.map} +1 -1
  231. package/dist/{TimeColumns-CJ13uf3K.cjs → TimeColumns-qEHHZC1N.cjs} +2 -2
  232. package/dist/{TimeColumns-CJ13uf3K.cjs.map → TimeColumns-qEHHZC1N.cjs.map} +1 -1
  233. package/dist/{TimePicker-Dshko7IJ.cjs → TimePicker-DJrNO01U.cjs} +2 -2
  234. package/dist/{TimePicker-Dshko7IJ.cjs.map → TimePicker-DJrNO01U.cjs.map} +1 -1
  235. package/dist/{TimePicker-BitZ7wv-.js → TimePicker-yfYqLbj3.js} +6 -6
  236. package/dist/{TimePicker-BitZ7wv-.js.map → TimePicker-yfYqLbj3.js.map} +1 -1
  237. package/dist/{Toaster-8ynQTcc0.cjs → Toaster-B7Xd2IaM.cjs} +2 -2
  238. package/dist/{Toaster-8ynQTcc0.cjs.map → Toaster-B7Xd2IaM.cjs.map} +1 -1
  239. package/dist/{Toaster-CYVETXVZ.js → Toaster-D8cxkhwr.js} +2 -2
  240. package/dist/{Toaster-CYVETXVZ.js.map → Toaster-D8cxkhwr.js.map} +1 -1
  241. package/dist/{TranslatedFields-BKI3jrNd.cjs → TranslatedFields-BvqqdNWz.cjs} +2 -2
  242. package/dist/{TranslatedFields-BKI3jrNd.cjs.map → TranslatedFields-BvqqdNWz.cjs.map} +1 -1
  243. package/dist/{TranslatedFields-dmb-0Yn7.js → TranslatedFields-CsSsTrnF.js} +5 -5
  244. package/dist/{TranslatedFields-dmb-0Yn7.js.map → TranslatedFields-CsSsTrnF.js.map} +1 -1
  245. package/dist/Typography-ChSuxgkc.js +74 -0
  246. package/dist/Typography-ChSuxgkc.js.map +1 -0
  247. package/dist/Typography-d97DdbNd.cjs +2 -0
  248. package/dist/Typography-d97DdbNd.cjs.map +1 -0
  249. package/dist/{UserCard-pEJZqiDF.js → UserCard-CsZ4Ogac.js} +4 -4
  250. package/dist/{UserCard-pEJZqiDF.js.map → UserCard-CsZ4Ogac.js.map} +1 -1
  251. package/dist/{UserCard-ah6K1y0H.cjs → UserCard-Die7JV4z.cjs} +2 -2
  252. package/dist/{UserCard-ah6K1y0H.cjs.map → UserCard-Die7JV4z.cjs.map} +1 -1
  253. package/dist/components/Alert/index.cjs +1 -1
  254. package/dist/components/Alert/index.js +1 -1
  255. package/dist/components/AuthLayout/index.cjs +1 -1
  256. package/dist/components/AuthLayout/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/index.cjs +1 -1
  270. package/dist/components/ColorPicker/index.js +1 -1
  271. package/dist/components/ColorRamp/index.cjs +1 -1
  272. package/dist/components/ColorRamp/index.js +1 -1
  273. package/dist/components/CopyButton/index.cjs +1 -1
  274. package/dist/components/CopyButton/index.js +1 -1
  275. package/dist/components/DatePicker/index.cjs +1 -1
  276. package/dist/components/DatePicker/index.js +1 -1
  277. package/dist/components/DateTimePicker/index.cjs +1 -1
  278. package/dist/components/DateTimePicker/index.js +1 -1
  279. package/dist/components/DescriptionList/index.cjs +1 -1
  280. package/dist/components/DescriptionList/index.js +1 -1
  281. package/dist/components/EmptyState/index.cjs +1 -1
  282. package/dist/components/EmptyState/index.js +1 -1
  283. package/dist/components/ErrorState/ErrorDetailsModal.d.cts +12 -0
  284. package/dist/components/ErrorState/ErrorDetailsModal.d.ts +12 -0
  285. package/dist/components/ErrorState/ErrorState.d.cts +23 -24
  286. package/dist/components/ErrorState/ErrorState.d.ts +23 -24
  287. package/dist/components/ErrorState/QueryError.d.cts +3 -3
  288. package/dist/components/ErrorState/QueryError.d.ts +3 -3
  289. package/dist/components/ErrorState/index.cjs +1 -1
  290. package/dist/components/ErrorState/index.js +2 -2
  291. package/dist/components/FileCard/index.cjs +1 -1
  292. package/dist/components/FileCard/index.js +1 -1
  293. package/dist/components/FileUploader/index.cjs +1 -1
  294. package/dist/components/FileUploader/index.js +1 -1
  295. package/dist/components/Flag/index.cjs +1 -1
  296. package/dist/components/Flag/index.js +1 -1
  297. package/dist/components/FullscreenToggle/index.cjs +1 -1
  298. package/dist/components/FullscreenToggle/index.js +1 -1
  299. package/dist/components/IconButton/index.cjs +1 -1
  300. package/dist/components/IconButton/index.js +1 -1
  301. package/dist/components/Loader/index.cjs +1 -1
  302. package/dist/components/Loader/index.js +1 -1
  303. package/dist/components/LocationPicker/index.cjs +1 -1
  304. package/dist/components/LocationPicker/index.js +1 -1
  305. package/dist/components/Modal/index.cjs +1 -1
  306. package/dist/components/Modal/index.js +1 -1
  307. package/dist/components/MultiSelect/index.cjs +1 -1
  308. package/dist/components/MultiSelect/index.js +1 -1
  309. package/dist/components/MultilineTextField/index.cjs +1 -1
  310. package/dist/components/MultilineTextField/index.js +1 -1
  311. package/dist/components/NumberField/index.cjs +1 -1
  312. package/dist/components/NumberField/index.js +1 -1
  313. package/dist/components/OtpField/index.cjs +1 -1
  314. package/dist/components/OtpField/index.js +1 -1
  315. package/dist/components/PageError/index.cjs +1 -1
  316. package/dist/components/PageError/index.js +1 -1
  317. package/dist/components/PageLayout/index.cjs +1 -1
  318. package/dist/components/PageLayout/index.js +1 -1
  319. package/dist/components/PageNotFound/index.cjs +1 -1
  320. package/dist/components/PageNotFound/index.js +1 -1
  321. package/dist/components/Pagination/index.cjs +1 -1
  322. package/dist/components/Pagination/index.js +1 -1
  323. package/dist/components/PaletteField/index.cjs +1 -1
  324. package/dist/components/PaletteField/index.js +1 -1
  325. package/dist/components/PhoneField/index.cjs +1 -1
  326. package/dist/components/PhoneField/index.js +1 -1
  327. package/dist/components/Popconfirm/index.cjs +1 -1
  328. package/dist/components/Popconfirm/index.js +1 -1
  329. package/dist/components/Progress/index.cjs +1 -1
  330. package/dist/components/Progress/index.js +1 -1
  331. package/dist/components/QrCode/index.cjs +1 -1
  332. package/dist/components/QrCode/index.js +1 -1
  333. package/dist/components/Radio/index.cjs +1 -1
  334. package/dist/components/Radio/index.js +1 -1
  335. package/dist/components/RemoveDialog/index.cjs +1 -1
  336. package/dist/components/RemoveDialog/index.js +1 -1
  337. package/dist/components/RichTextEditor/index.cjs +1 -1
  338. package/dist/components/RichTextEditor/index.js +1 -1
  339. package/dist/components/RootLayout/RootLayout.d.cts +6 -1
  340. package/dist/components/RootLayout/RootLayout.d.ts +6 -1
  341. package/dist/components/RootLayout/index.cjs +1 -1
  342. package/dist/components/RootLayout/index.js +1 -1
  343. package/dist/components/Select/index.cjs +1 -1
  344. package/dist/components/Select/index.js +1 -1
  345. package/dist/components/Sidebar/index.cjs +1 -1
  346. package/dist/components/Sidebar/index.js +1 -1
  347. package/dist/components/Slider/index.cjs +1 -1
  348. package/dist/components/Slider/index.js +1 -1
  349. package/dist/components/SpeedDial/index.cjs +1 -1
  350. package/dist/components/SpeedDial/index.js +1 -1
  351. package/dist/components/Stepper/index.cjs +1 -1
  352. package/dist/components/Stepper/index.js +1 -1
  353. package/dist/components/SwatchPicker/index.cjs +1 -1
  354. package/dist/components/SwatchPicker/index.js +1 -1
  355. package/dist/components/Table/index.cjs +1 -1
  356. package/dist/components/Table/index.js +1 -1
  357. package/dist/components/Tabs/index.cjs +1 -1
  358. package/dist/components/Tabs/index.js +1 -1
  359. package/dist/components/TagsField/index.cjs +1 -1
  360. package/dist/components/TagsField/index.js +1 -1
  361. package/dist/components/TextField/index.cjs +1 -1
  362. package/dist/components/TextField/index.js +1 -1
  363. package/dist/components/ThemeToggle/index.cjs +1 -1
  364. package/dist/components/ThemeToggle/index.js +1 -1
  365. package/dist/components/TimePicker/index.cjs +1 -1
  366. package/dist/components/TimePicker/index.js +1 -1
  367. package/dist/components/Toast/index.cjs +1 -1
  368. package/dist/components/Toast/index.js +1 -1
  369. package/dist/components/TranslatedFields/index.cjs +1 -1
  370. package/dist/components/TranslatedFields/index.js +1 -1
  371. package/dist/components/Typography/Typography.d.cts +7 -1
  372. package/dist/components/Typography/Typography.d.ts +7 -1
  373. package/dist/components/Typography/index.cjs +1 -1
  374. package/dist/components/Typography/index.js +1 -1
  375. package/dist/components/UserCard/index.cjs +1 -1
  376. package/dist/components/UserCard/index.js +1 -1
  377. package/dist/entries/app.cjs +1 -1
  378. package/dist/entries/app.js +1 -1
  379. package/dist/entries/components.cjs +1 -1
  380. package/dist/entries/components.js +58 -58
  381. package/dist/entries/i18n.cjs +1 -1
  382. package/dist/entries/i18n.js +2 -2
  383. package/dist/entries/theme.cjs +1 -1
  384. package/dist/entries/theme.d.cts +1 -1
  385. package/dist/entries/theme.d.ts +1 -1
  386. package/dist/entries/theme.js +1 -1
  387. package/dist/i18n/messages.d.cts +6 -0
  388. package/dist/i18n/messages.d.ts +6 -0
  389. package/dist/index.cjs +1 -1
  390. package/dist/index.css +1 -1
  391. package/dist/index.js +61 -61
  392. package/dist/messages-DYXyWU3X.cjs +36 -0
  393. package/dist/messages-DYXyWU3X.cjs.map +1 -0
  394. package/dist/{messages-C1eTrGJy.js → messages-zarEtcsN.js} +25 -4
  395. package/dist/messages-zarEtcsN.js.map +1 -0
  396. package/dist/theme/ConfigProvider.d.cts +21 -2
  397. package/dist/theme/ConfigProvider.d.ts +21 -2
  398. package/dist/theme/index.d.cts +1 -1
  399. package/dist/theme/index.d.ts +1 -1
  400. package/dist/{useHomeTo-yTXajO22.js → useHomeTo-DVMyLZbb.js} +2 -2
  401. package/dist/{useHomeTo-yTXajO22.js.map → useHomeTo-DVMyLZbb.js.map} +1 -1
  402. package/dist/{useHomeTo-Cr6Usr_D.cjs → useHomeTo-Dnu6VAvU.cjs} +2 -2
  403. package/dist/{useHomeTo-Cr6Usr_D.cjs.map → useHomeTo-Dnu6VAvU.cjs.map} +1 -1
  404. package/dist/{useOptionMenu-DK0ixg-p.js → useOptionMenu-DNYlfNO_.js} +4 -4
  405. package/dist/{useOptionMenu-DK0ixg-p.js.map → useOptionMenu-DNYlfNO_.js.map} +1 -1
  406. package/dist/{useOptionMenu-DHGSbQmS.cjs → useOptionMenu-OAYGUWP_.cjs} +2 -2
  407. package/dist/{useOptionMenu-DHGSbQmS.cjs.map → useOptionMenu-OAYGUWP_.cjs.map} +1 -1
  408. package/package.json +1 -1
  409. package/dist/ConfigProvider-CVLHPXQm.cjs.map +0 -1
  410. package/dist/ConfigProvider-tvLbKiqu.js.map +0 -1
  411. package/dist/ErrorBoundary-8iu-mR5Y.cjs +0 -2
  412. package/dist/ErrorBoundary-8iu-mR5Y.cjs.map +0 -1
  413. package/dist/ErrorBoundary-BSJL381Y.js.map +0 -1
  414. package/dist/ErrorState-BXMjBWav.cjs +0 -4
  415. package/dist/ErrorState-BXMjBWav.cjs.map +0 -1
  416. package/dist/ErrorState-DKhZ4aJh.js +0 -142
  417. package/dist/ErrorState-DKhZ4aJh.js.map +0 -1
  418. package/dist/PageError-ClR7k0Zb.js +0 -69
  419. package/dist/PageError-D7_Q8wz8.cjs +0 -2
  420. package/dist/RootLayout-C7n79JjM.js +0 -621
  421. package/dist/RootLayout-C7n79JjM.js.map +0 -1
  422. package/dist/RootLayout-CtkpgPGV.cjs +0 -2
  423. package/dist/RootLayout-CtkpgPGV.cjs.map +0 -1
  424. package/dist/Typography-B6ASPrzT.cjs +0 -2
  425. package/dist/Typography-B6ASPrzT.cjs.map +0 -1
  426. package/dist/Typography-CJv5AnRP.js +0 -70
  427. package/dist/Typography-CJv5AnRP.js.map +0 -1
  428. package/dist/messages-C1eTrGJy.js.map +0 -1
  429. package/dist/messages-DCr7iFmv.cjs +0 -36
  430. package/dist/messages-DCr7iFmv.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as I, useId as L } from "react";
3
3
  import { clsx as l } from "clsx";
4
- import { a as B } from "./ConfigProvider-tvLbKiqu.js";
4
+ import { a as B } from "./ConfigProvider-DZMtq2Fz.js";
5
5
  const C = "_root_1uzzo_4", D = "_caption_1uzzo_11", R = "_value_1uzzo_16", S = "_linear_1uzzo_23", q = "_sm_1uzzo_28", A = "_md_1uzzo_31", E = "_lg_1uzzo_34", G = "_header_1uzzo_38", H = "_track_1uzzo_45", J = "_buffer_1uzzo_52", K = "_fill_1uzzo_53", O = "_striped_1uzzo_69", Q = "_animated_1uzzo_82", U = "_indeterminate_1uzzo_95", W = "_circular_1uzzo_109", X = "_ring_1uzzo_128", Y = "_svg_1uzzo_136", Z = "_ringTrack_1uzzo_144", nn = "_ringFill_1uzzo_145", rn = "_ringValue_1uzzo_159", an = "_spinning_1uzzo_165", n = {
6
6
  root: C,
7
7
  caption: D,
@@ -116,4 +116,4 @@ const C = "_root_1uzzo_4", D = "_caption_1uzzo_11", R = "_value_1uzzo_16", S = "
116
116
  export {
117
117
  sn as P
118
118
  };
119
- //# sourceMappingURL=Progress-BxvqmmGS.js.map
119
+ //# sourceMappingURL=Progress-C-VGs3yJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Progress-BxvqmmGS.js","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CMA,IAAQ,CAACC,GAAWC,GAAYC,MAAe,KAAK,IAAIA,GAAI,KAAK,IAAID,GAAID,CAAC,CAAC,GAapEG,KAAWC,EAA0C,SAChE;AAAA,EACE,OAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAUC,EAAA,GACVC,IAAgBnB,KAAS,MACzBoB,IAAUnB,IAAM,IAAIA,IAAM,KAC1BoB,IAAUF,IAAgB,IAAIzB,EAAMM,GAAO,GAAGoB,CAAO,GACrDE,IAAOD,IAAUD,IAAW,KAC5BG,IAAYhB,KAAU,OAAO,SAAab,EAAMa,GAAQ,GAAGa,CAAO,IAAIA,IAAW,KAGjFI,IACJ,CAACL,MAAiBT,KAAA,gBAAAA,EAAY,UAAS,QAAQY,KAAOZ,EAAW,QAC7D,UACA,CAACS,MAAiBT,KAAA,gBAAAA,EAAY,YAAW,QAAQY,KAAOZ,EAAW,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asB,EAAO;AAAA,gBAChCtB,KAAYsB,EAAO;AAAA,cAAA;AAAA,cAErB,OAAOZ,IAAgB,SAAY,EAAE,OAAO,GAAGG,CAAG,IAAA;AAAA,YAAI;AAAA,UAAA;AAAA,QACxD,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"Progress-C-VGs3yJ.js","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CMA,IAAQ,CAACC,GAAWC,GAAYC,MAAe,KAAK,IAAIA,GAAI,KAAK,IAAID,GAAID,CAAC,CAAC,GAapEG,KAAWC,EAA0C,SAChE;AAAA,EACE,OAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAUC,EAAA,GACVC,IAAgBnB,KAAS,MACzBoB,IAAUnB,IAAM,IAAIA,IAAM,KAC1BoB,IAAUF,IAAgB,IAAIzB,EAAMM,GAAO,GAAGoB,CAAO,GACrDE,IAAOD,IAAUD,IAAW,KAC5BG,IAAYhB,KAAU,OAAO,SAAab,EAAMa,GAAQ,GAAGa,CAAO,IAAIA,IAAW,KAGjFI,IACJ,CAACL,MAAiBT,KAAA,gBAAAA,EAAY,UAAS,QAAQY,KAAOZ,EAAW,QAC7D,UACA,CAACS,MAAiBT,KAAA,gBAAAA,EAAY,YAAW,QAAQY,KAAOZ,EAAW,UACjE,YACAN,GAEFqB,IAAYN,IACd,SACA,OAAOb,KAAc,aACnBA,EAAUe,GAASD,CAAO,IAC1Bd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EAAE,OAAO,GAAGG,CAAG,IAAA;AAAA,YAAI;AAAA,UAAA;AAAA,QACxD,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),w=require("react"),o=require("clsx"),h=require("./ConfigProvider-CVLHPXQm.cjs"),C="_root_1uzzo_4",I="_caption_1uzzo_11",L="_value_1uzzo_16",R="_linear_1uzzo_23",B="_sm_1uzzo_28",D="_md_1uzzo_31",S="_lg_1uzzo_34",A="_header_1uzzo_38",E="_track_1uzzo_45",G="_buffer_1uzzo_52",H="_fill_1uzzo_53",J="_striped_1uzzo_69",K="_animated_1uzzo_82",O="_indeterminate_1uzzo_95",Q="_circular_1uzzo_109",U="_ring_1uzzo_128",W="_svg_1uzzo_136",X="_ringTrack_1uzzo_144",Y="_ringFill_1uzzo_145",Z="_ringValue_1uzzo_159",nn="_spinning_1uzzo_165",n={root:C,caption:I,value:L,linear:R,sm:B,md:D,lg:S,header:A,track:E,buffer:G,fill:H,striped:J,animated:K,"pg-stripes":"_pg-stripes_1uzzo_1",indeterminate:O,"pg-sweep":"_pg-sweep_1uzzo_1",circular:Q,ring:U,svg:W,ringTrack:X,ringFill:Y,ringValue:Z,spinning:nn,"pg-spin":"_pg-spin_1uzzo_1"},T=(d,l,u)=>Math.min(u,Math.max(l,d)),rn=w.forwardRef(function({value:l,max:u=100,variant:$="linear",size:p="md",color:M="accent",label:c,showValue:_=!1,buffer:m,striped:P=!1,animated:v=!1,thresholds:i,className:x,style:q,...f},j){const y=h.useT(),g=w.useId(),s=l==null,t=u>0?u:100,z=s?0:T(l,0,t),a=z/t*100,N=m==null?void 0:T(m,0,t)/t*100,F=!s&&(i==null?void 0:i.error)!=null&&a>=i.error?"error":!s&&(i==null?void 0:i.warning)!=null&&a>=i.warning?"warning":M,e=s?void 0:typeof _=="function"?_(z,t):_?`${Math.round(a)}%`:void 0,V=s?y("common.loading"):typeof e=="string"?e:`${Math.round(a)}%`,b={role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:z,"aria-valuetext":V,"aria-busy":s||void 0,...c!=null?{"aria-labelledby":g}:{"aria-label":y("progress.label")}},k={"--tz-btn-rgb":`var(--tz-color-${F}-rgb)`,...q};return $==="circular"?r.jsxs("div",{ref:j,className:o.clsx(n.root,n.circular,n[p],x),style:k,...f,children:[r.jsxs("div",{className:o.clsx(n.ring,s&&n.spinning),...b,children:[r.jsxs("svg",{viewBox:"0 0 36 36",className:n.svg,"aria-hidden":"true",children:[r.jsx("circle",{className:n.ringTrack,cx:"18",cy:"18",r:"15.5",pathLength:100}),r.jsx("circle",{className:n.ringFill,cx:"18",cy:"18",r:"15.5",pathLength:100,strokeDasharray:s?"28 72":`${a} ${100-a}`})]}),e!=null&&r.jsx("span",{className:n.ringValue,children:e})]}),c!=null&&r.jsx("span",{id:g,className:n.caption,children:c})]}):r.jsxs("div",{ref:j,className:o.clsx(n.root,n.linear,n[p],x),style:k,...f,children:[(c!=null||e!=null)&&r.jsxs("div",{className:n.header,children:[c!=null?r.jsx("span",{id:g,className:n.caption,children:c}):r.jsx("span",{}),e!=null&&r.jsx("span",{className:n.value,children:e})]}),r.jsxs("div",{className:o.clsx(n.track,s&&n.indeterminate),...b,children:[N!=null&&!s&&r.jsx("div",{className:n.buffer,style:{width:`${N}%`}}),r.jsx("div",{className:o.clsx(n.fill,(P||v)&&n.striped,v&&n.animated),style:s?void 0:{width:`${a}%`}})]})]})});exports.Progress=rn;
2
- //# sourceMappingURL=Progress-CqXX0rRp.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),w=require("react"),o=require("clsx"),h=require("./ConfigProvider-th4GYhcU.cjs"),C="_root_1uzzo_4",I="_caption_1uzzo_11",L="_value_1uzzo_16",R="_linear_1uzzo_23",B="_sm_1uzzo_28",D="_md_1uzzo_31",S="_lg_1uzzo_34",A="_header_1uzzo_38",E="_track_1uzzo_45",G="_buffer_1uzzo_52",H="_fill_1uzzo_53",J="_striped_1uzzo_69",K="_animated_1uzzo_82",O="_indeterminate_1uzzo_95",Q="_circular_1uzzo_109",U="_ring_1uzzo_128",W="_svg_1uzzo_136",X="_ringTrack_1uzzo_144",Y="_ringFill_1uzzo_145",Z="_ringValue_1uzzo_159",nn="_spinning_1uzzo_165",n={root:C,caption:I,value:L,linear:R,sm:B,md:D,lg:S,header:A,track:E,buffer:G,fill:H,striped:J,animated:K,"pg-stripes":"_pg-stripes_1uzzo_1",indeterminate:O,"pg-sweep":"_pg-sweep_1uzzo_1",circular:Q,ring:U,svg:W,ringTrack:X,ringFill:Y,ringValue:Z,spinning:nn,"pg-spin":"_pg-spin_1uzzo_1"},T=(d,l,u)=>Math.min(u,Math.max(l,d)),rn=w.forwardRef(function({value:l,max:u=100,variant:$="linear",size:p="md",color:M="accent",label:c,showValue:_=!1,buffer:m,striped:P=!1,animated:v=!1,thresholds:i,className:x,style:q,...f},j){const y=h.useT(),g=w.useId(),s=l==null,t=u>0?u:100,z=s?0:T(l,0,t),a=z/t*100,N=m==null?void 0:T(m,0,t)/t*100,F=!s&&(i==null?void 0:i.error)!=null&&a>=i.error?"error":!s&&(i==null?void 0:i.warning)!=null&&a>=i.warning?"warning":M,e=s?void 0:typeof _=="function"?_(z,t):_?`${Math.round(a)}%`:void 0,V=s?y("common.loading"):typeof e=="string"?e:`${Math.round(a)}%`,b={role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:z,"aria-valuetext":V,"aria-busy":s||void 0,...c!=null?{"aria-labelledby":g}:{"aria-label":y("progress.label")}},k={"--tz-btn-rgb":`var(--tz-color-${F}-rgb)`,...q};return $==="circular"?r.jsxs("div",{ref:j,className:o.clsx(n.root,n.circular,n[p],x),style:k,...f,children:[r.jsxs("div",{className:o.clsx(n.ring,s&&n.spinning),...b,children:[r.jsxs("svg",{viewBox:"0 0 36 36",className:n.svg,"aria-hidden":"true",children:[r.jsx("circle",{className:n.ringTrack,cx:"18",cy:"18",r:"15.5",pathLength:100}),r.jsx("circle",{className:n.ringFill,cx:"18",cy:"18",r:"15.5",pathLength:100,strokeDasharray:s?"28 72":`${a} ${100-a}`})]}),e!=null&&r.jsx("span",{className:n.ringValue,children:e})]}),c!=null&&r.jsx("span",{id:g,className:n.caption,children:c})]}):r.jsxs("div",{ref:j,className:o.clsx(n.root,n.linear,n[p],x),style:k,...f,children:[(c!=null||e!=null)&&r.jsxs("div",{className:n.header,children:[c!=null?r.jsx("span",{id:g,className:n.caption,children:c}):r.jsx("span",{}),e!=null&&r.jsx("span",{className:n.value,children:e})]}),r.jsxs("div",{className:o.clsx(n.track,s&&n.indeterminate),...b,children:[N!=null&&!s&&r.jsx("div",{className:n.buffer,style:{width:`${N}%`}}),r.jsx("div",{className:o.clsx(n.fill,(P||v)&&n.striped,v&&n.animated),style:s?void 0:{width:`${a}%`}})]})]})});exports.Progress=rn;
2
+ //# sourceMappingURL=Progress-Cqr2_BF1.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Progress-CqXX0rRp.cjs","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":"m2BA4CMA,EAAQ,CAACC,EAAWC,EAAYC,IAAe,KAAK,IAAIA,EAAI,KAAK,IAAID,EAAID,CAAC,CAAC,EAapEG,GAAWC,EAAAA,WAA0C,SAChE,CACE,MAAAC,EACA,IAAAC,EAAM,IACN,QAAAC,EAAU,SACV,KAAAC,EAAO,KACP,MAAAC,EAAQ,SACR,MAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,WAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAUC,EAAAA,MAAA,EACVC,EAAgBnB,GAAS,KACzBoB,EAAUnB,EAAM,EAAIA,EAAM,IAC1BoB,EAAUF,EAAgB,EAAIzB,EAAMM,EAAO,EAAGoB,CAAO,EACrDE,EAAOD,EAAUD,EAAW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CACxD,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC"}
1
+ {"version":3,"file":"Progress-Cqr2_BF1.cjs","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":"m2BA4CMA,EAAQ,CAACC,EAAWC,EAAYC,IAAe,KAAK,IAAIA,EAAI,KAAK,IAAID,EAAID,CAAC,CAAC,EAapEG,GAAWC,EAAAA,WAA0C,SAChE,CACE,MAAAC,EACA,IAAAC,EAAM,IACN,QAAAC,EAAU,SACV,KAAAC,EAAO,KACP,MAAAC,EAAQ,SACR,MAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,WAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAUC,EAAAA,MAAA,EACVC,EAAgBnB,GAAS,KACzBoB,EAAUnB,EAAM,EAAIA,EAAM,IAC1BoB,EAAUF,EAAgB,EAAIzB,EAAMM,EAAO,EAAGoB,CAAO,EACrDE,EAAOD,EAAUD,EAAW,IAC5BG,EAAYhB,GAAU,KAAO,OAAab,EAAMa,EAAQ,EAAGa,CAAO,EAAIA,EAAW,IAGjFI,EACJ,CAACL,IAAiBT,GAAA,YAAAA,EAAY,QAAS,MAAQY,GAAOZ,EAAW,MAC7D,QACA,CAACS,IAAiBT,GAAA,YAAAA,EAAY,UAAW,MAAQY,GAAOZ,EAAW,QACjE,UACAN,EAEFqB,EAAYN,EACd,OACA,OAAOb,GAAc,WACnBA,EAAUe,EAASD,CAAO,EAC1Bd,EACE,GAAG,KAAK,MAAMgB,CAAG,CAAC,IAClB,OACFI,EAAgBP,EAClBJ,EAAE,gBAAgB,EAClB,OAAOU,GAAc,SACnBA,EACA,GAAG,KAAK,MAAMH,CAAG,CAAC,IAElBK,EAAO,CACX,KAAM,cACN,gBAAiB,EACjB,gBAAiBP,EACjB,gBAAiBD,EAAgB,OAAYE,EAC7C,iBAAkBK,EAClB,YAAaP,GA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WM,EAAO,OACpB,SAAA,CAAA1B,GAAS,KACR2B,EAAAA,IAAC,OAAA,CAAK,GAAIf,EAAS,UAAWc,EAAO,QAClC,SAAA1B,CAAA,CACH,EAEA2B,EAAAA,IAAC,OAAA,EAAK,EAEPP,GAAa,MAAQO,EAAAA,IAAC,QAAK,UAAWD,EAAO,MAAQ,SAAAN,CAAA,CAAU,CAAA,EAClE,EAEFI,EAAAA,KAAC,MAAA,CAAI,UAAWC,EAAAA,KAAKC,EAAO,MAAOZ,GAAiBY,EAAO,aAAa,EAAI,GAAGJ,EAC5E,SAAA,CAAAJ,GAAa,MAAQ,CAACJ,GACrBa,EAAAA,IAAC,OAAI,UAAWD,EAAO,OAAQ,MAAO,CAAE,MAAO,GAAGR,CAAS,KAAO,EAEpES,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,KACTC,EAAO,MACNvB,GAAWC,IAAasB,EAAO,QAChCtB,GAAYsB,EAAO,QAAA,EAErB,MAAOZ,EAAgB,OAAY,CAAE,MAAO,GAAGG,CAAG,GAAA,CAAI,CAAA,CACxD,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC"}
@@ -3,7 +3,7 @@ import { forwardRef as y } from "react";
3
3
  import { clsx as q } from "clsx";
4
4
  import { u as w, o as N } from "./useOptionalPeer-49f3XcO5.js";
5
5
  import { S as R } from "./Skeleton-_-uGax2j.js";
6
- import { T as P } from "./Typography-CJv5AnRP.js";
6
+ import { T as P } from "./Typography-ChSuxgkc.js";
7
7
  const V = "_root_15ibt_1", j = "_framed_15ibt_12", z = "_code_15ibt_30", G = "_caption_15ibt_35", t = {
8
8
  root: V,
9
9
  framed: j,
@@ -77,4 +77,4 @@ const V = "_root_15ibt_1", j = "_framed_15ibt_12", z = "_code_15ibt_30", G = "_c
77
77
  export {
78
78
  D as Q
79
79
  };
80
- //# sourceMappingURL=QrCode-osD23Vkt.js.map
80
+ //# sourceMappingURL=QrCode-B9YbQNVc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QrCode-osD23Vkt.js","sources":["../src/components/QrCode/QrCode.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport type * as QrLibModule from 'qrcode.react'\nimport { optionalPeer, useOptionalPeer } from '../../hooks/useOptionalPeer'\nimport { Skeleton } from '../Skeleton'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport styles from './QrCode.module.css'\n\nexport type QrCodeLevel = 'L' | 'M' | 'Q' | 'H'\n\nexport interface QrCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** The encoded text (URL, `otpauth://…` URI, plain string). Required. */\n value: string\n /** Rendered edge length in px. Default `180`. */\n size?: number\n /** Error-correction level. Default `'M'` (`'H'` when `image` is set, so the logo can cover the middle). */\n level?: QrCodeLevel\n /** Module (foreground) tint — a theme token. Default `'text'` (so it follows light/dark). */\n color?: ThemeColor | 'text'\n /** Quiet zone in modules. Default `2`. */\n margin?: number\n /**\n * Optional centre image (a brand mark), as a URL or `{ src, width?, height?, excavate? }`.\n * `excavate` clears the modules under it (default `true`). Sizes default to ~22% of `size`.\n */\n image?: string | { src: string; width?: number; height?: number; excavate?: boolean }\n /** Caption rendered under the code (muted, centred) — e.g. \"Scan with your authenticator app\". */\n caption?: ReactNode\n /**\n * Wrap the code in a soft `surface` frame with padding and radius, so it sits cleanly on the\n * page `background`. Default `true`. Pass `false` for a bare SVG.\n */\n framed?: boolean\n /** Accessible name. Default `\"QR code\"`. The `value` is never exposed as text by this component. */\n 'aria-label'?: string\n}\n\n/**\n * A QR code, rendered as a crisp **SVG** — wraps the optional peer **`qrcode.react`** (`npm i\n * qrcode.react`) so apps don't pull in their own encoder. The modules take a theme `color` token\n * (default `text`) via the `--tz-qr-fg` var; `framed` (default) wraps the code in a soft, elevated card.\n *\n * **Scannability:** a framed code always sits on a **white** card in both light and dark mode, and its\n * default modules stay **dark** in both — a QR must be dark-on-light to read reliably, so the frame is\n * kept white even in dark mode (a deliberate literal-color exception, like `CodeBlock`'s dark surface).\n * A custom `color` is honored as-is (pick one dark enough to scan). The wrapper is `role=\"img\"` with an\n * `aria-label`; the SVG itself is `aria-hidden`, so the encoded `value` is never read out as text.\n */\n/** @internal — exported for tests */\nexport const qrPeer = optionalPeer<typeof QrLibModule>(\n 'qrcode.react',\n 'QrCode',\n () => import('qrcode.react'),\n)\n\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(function QrCode(\n {\n value,\n size = 180,\n level,\n color = 'text',\n margin = 2,\n image,\n caption,\n framed = true,\n className,\n style,\n 'aria-label': ariaLabel = 'QR code',\n ...props\n },\n ref,\n) {\n // `qrcode.react` is an optional peer, loaded lazily (never imported statically — apps without it must\n // still build + run from the barrel). Until it's ready a same-size skeleton holds the spot; if it isn't\n // installed the spot stays empty and an install hint is logged.\n const { module: qrLib, failed } = useOptionalPeer(qrPeer)\n const QRCodeSVG = qrLib?.QRCodeSVG\n\n // 'H' error correction by default when a centre image is present, so the logo can cover the middle\n // without breaking the code; otherwise 'M'. An explicit `level` always wins.\n const resolvedLevel: QrCodeLevel = level ?? (image ? 'H' : 'M')\n\n const imageSettings =\n image != null\n ? (() => {\n const img = typeof image === 'string' ? { src: image } : image\n const dim = Math.round(size * 0.22)\n return {\n src: img.src,\n width: img.width ?? dim,\n height: img.height ?? dim,\n excavate: img.excavate ?? true,\n }\n })()\n : undefined\n\n // The foreground (modules) follows the `color` token via `--tz-qr-fg`. The default `text` is left to\n // CSS (so `.framed` can force dark modules on the white card in dark mode); a custom token is pinned\n // inline, so it wins over that CSS fallback and is rendered exactly as asked.\n const fgVar = color === 'text' ? undefined : { '--tz-qr-fg': `var(--tz-color-${color})` }\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n className={clsx(styles.root, framed && styles.framed, className)}\n style={{ ...fgVar, ...style } as CSSProperties}\n {...props}\n >\n {QRCodeSVG ? (\n <QRCodeSVG\n className={styles.code}\n value={value}\n size={size}\n level={resolvedLevel}\n marginSize={margin}\n // colors flow through CSS vars so `.framed` can guarantee contrast per theme (see the module)\n fgColor=\"var(--tz-qr-fg)\"\n bgColor=\"var(--tz-qr-bg)\"\n imageSettings={imageSettings}\n aria-hidden\n />\n ) : (\n <Skeleton\n variant=\"rect\"\n width={size}\n height={size}\n animation={failed ? false : 'shimmer'}\n className={styles.code}\n />\n )}\n {caption != null && (\n <Typography variant=\"caption\" color=\"muted\" className={styles.caption}>\n {caption}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["qrPeer","optionalPeer","QrCode","forwardRef","value","size","level","color","margin","image","caption","framed","className","style","ariaLabel","props","ref","qrLib","failed","useOptionalPeer","QRCodeSVG","resolvedLevel","imageSettings","img","dim","fgVar","jsxs","clsx","styles","jsx","Skeleton","Typography"],"mappings":";;;;;;;;;;;GAkDaA,IAASC;AAAA,EACpB;AAAA,EACA;AAAA,EACA,MAAM,OAAO,cAAc;AAC7B,GAEaC,IAASC,EAAwC,SAC5D;AAAA,EACE,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAcC,IAAY;AAAA,EAC1B,GAAGC;AACL,GACAC,GACA;AAIA,QAAM,EAAE,QAAQC,GAAO,QAAAC,EAAA,IAAWC,EAAgBnB,CAAM,GAClDoB,IAAYH,KAAA,gBAAAA,EAAO,WAInBI,IAA6Bf,MAAUG,IAAQ,MAAM,MAErDa,IACJb,KAAS,QACJ,MAAM;AACL,UAAMc,IAAM,OAAOd,KAAU,WAAW,EAAE,KAAKA,MAAUA,GACnDe,IAAM,KAAK,MAAMnB,IAAO,IAAI;AAClC,WAAO;AAAA,MACL,KAAKkB,EAAI;AAAA,MACT,OAAOA,EAAI,SAASC;AAAA,MACpB,QAAQD,EAAI,UAAUC;AAAA,MACtB,UAAUD,EAAI,YAAY;AAAA,IAAA;AAAA,EAE9B,OACA,QAKAE,IAAQlB,MAAU,SAAS,SAAY,EAAE,cAAc,kBAAkBA,CAAK,IAAA;AAEpF,SACE,gBAAAmB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACA,MAAK;AAAA,MACL,cAAYF;AAAA,MACZ,WAAWa,EAAKC,EAAO,MAAMjB,KAAUiB,EAAO,QAAQhB,CAAS;AAAA,MAC/D,OAAO,EAAE,GAAGa,GAAO,GAAGZ,EAAA;AAAA,MACrB,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAK,IACC,gBAAAS;AAAA,UAACT;AAAA,UAAA;AAAA,YACC,WAAWQ,EAAO;AAAA,YAClB,OAAAxB;AAAA,YACA,MAAAC;AAAA,YACA,OAAOgB;AAAA,YACP,YAAYb;AAAA,YAEZ,SAAQ;AAAA,YACR,SAAQ;AAAA,YACR,eAAAc;AAAA,YACA,eAAW;AAAA,UAAA;AAAA,QAAA,IAGb,gBAAAO;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAOzB;AAAA,YACP,QAAQA;AAAA,YACR,WAAWa,IAAS,KAAQ;AAAA,YAC5B,WAAWU,EAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGrBlB,KAAW,QACV,gBAAAmB,EAACE,GAAA,EAAW,SAAQ,WAAU,OAAM,SAAQ,WAAWH,EAAO,SAC3D,UAAAlB,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"QrCode-B9YbQNVc.js","sources":["../src/components/QrCode/QrCode.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport type * as QrLibModule from 'qrcode.react'\nimport { optionalPeer, useOptionalPeer } from '../../hooks/useOptionalPeer'\nimport { Skeleton } from '../Skeleton'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport styles from './QrCode.module.css'\n\nexport type QrCodeLevel = 'L' | 'M' | 'Q' | 'H'\n\nexport interface QrCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** The encoded text (URL, `otpauth://…` URI, plain string). Required. */\n value: string\n /** Rendered edge length in px. Default `180`. */\n size?: number\n /** Error-correction level. Default `'M'` (`'H'` when `image` is set, so the logo can cover the middle). */\n level?: QrCodeLevel\n /** Module (foreground) tint — a theme token. Default `'text'` (so it follows light/dark). */\n color?: ThemeColor | 'text'\n /** Quiet zone in modules. Default `2`. */\n margin?: number\n /**\n * Optional centre image (a brand mark), as a URL or `{ src, width?, height?, excavate? }`.\n * `excavate` clears the modules under it (default `true`). Sizes default to ~22% of `size`.\n */\n image?: string | { src: string; width?: number; height?: number; excavate?: boolean }\n /** Caption rendered under the code (muted, centred) — e.g. \"Scan with your authenticator app\". */\n caption?: ReactNode\n /**\n * Wrap the code in a soft `surface` frame with padding and radius, so it sits cleanly on the\n * page `background`. Default `true`. Pass `false` for a bare SVG.\n */\n framed?: boolean\n /** Accessible name. Default `\"QR code\"`. The `value` is never exposed as text by this component. */\n 'aria-label'?: string\n}\n\n/**\n * A QR code, rendered as a crisp **SVG** — wraps the optional peer **`qrcode.react`** (`npm i\n * qrcode.react`) so apps don't pull in their own encoder. The modules take a theme `color` token\n * (default `text`) via the `--tz-qr-fg` var; `framed` (default) wraps the code in a soft, elevated card.\n *\n * **Scannability:** a framed code always sits on a **white** card in both light and dark mode, and its\n * default modules stay **dark** in both — a QR must be dark-on-light to read reliably, so the frame is\n * kept white even in dark mode (a deliberate literal-color exception, like `CodeBlock`'s dark surface).\n * A custom `color` is honored as-is (pick one dark enough to scan). The wrapper is `role=\"img\"` with an\n * `aria-label`; the SVG itself is `aria-hidden`, so the encoded `value` is never read out as text.\n */\n/** @internal — exported for tests */\nexport const qrPeer = optionalPeer<typeof QrLibModule>(\n 'qrcode.react',\n 'QrCode',\n () => import('qrcode.react'),\n)\n\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(function QrCode(\n {\n value,\n size = 180,\n level,\n color = 'text',\n margin = 2,\n image,\n caption,\n framed = true,\n className,\n style,\n 'aria-label': ariaLabel = 'QR code',\n ...props\n },\n ref,\n) {\n // `qrcode.react` is an optional peer, loaded lazily (never imported statically — apps without it must\n // still build + run from the barrel). Until it's ready a same-size skeleton holds the spot; if it isn't\n // installed the spot stays empty and an install hint is logged.\n const { module: qrLib, failed } = useOptionalPeer(qrPeer)\n const QRCodeSVG = qrLib?.QRCodeSVG\n\n // 'H' error correction by default when a centre image is present, so the logo can cover the middle\n // without breaking the code; otherwise 'M'. An explicit `level` always wins.\n const resolvedLevel: QrCodeLevel = level ?? (image ? 'H' : 'M')\n\n const imageSettings =\n image != null\n ? (() => {\n const img = typeof image === 'string' ? { src: image } : image\n const dim = Math.round(size * 0.22)\n return {\n src: img.src,\n width: img.width ?? dim,\n height: img.height ?? dim,\n excavate: img.excavate ?? true,\n }\n })()\n : undefined\n\n // The foreground (modules) follows the `color` token via `--tz-qr-fg`. The default `text` is left to\n // CSS (so `.framed` can force dark modules on the white card in dark mode); a custom token is pinned\n // inline, so it wins over that CSS fallback and is rendered exactly as asked.\n const fgVar = color === 'text' ? undefined : { '--tz-qr-fg': `var(--tz-color-${color})` }\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n className={clsx(styles.root, framed && styles.framed, className)}\n style={{ ...fgVar, ...style } as CSSProperties}\n {...props}\n >\n {QRCodeSVG ? (\n <QRCodeSVG\n className={styles.code}\n value={value}\n size={size}\n level={resolvedLevel}\n marginSize={margin}\n // colors flow through CSS vars so `.framed` can guarantee contrast per theme (see the module)\n fgColor=\"var(--tz-qr-fg)\"\n bgColor=\"var(--tz-qr-bg)\"\n imageSettings={imageSettings}\n aria-hidden\n />\n ) : (\n <Skeleton\n variant=\"rect\"\n width={size}\n height={size}\n animation={failed ? false : 'shimmer'}\n className={styles.code}\n />\n )}\n {caption != null && (\n <Typography variant=\"caption\" color=\"muted\" className={styles.caption}>\n {caption}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["qrPeer","optionalPeer","QrCode","forwardRef","value","size","level","color","margin","image","caption","framed","className","style","ariaLabel","props","ref","qrLib","failed","useOptionalPeer","QRCodeSVG","resolvedLevel","imageSettings","img","dim","fgVar","jsxs","clsx","styles","jsx","Skeleton","Typography"],"mappings":";;;;;;;;;;;GAkDaA,IAASC;AAAA,EACpB;AAAA,EACA;AAAA,EACA,MAAM,OAAO,cAAc;AAC7B,GAEaC,IAASC,EAAwC,SAC5D;AAAA,EACE,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAcC,IAAY;AAAA,EAC1B,GAAGC;AACL,GACAC,GACA;AAIA,QAAM,EAAE,QAAQC,GAAO,QAAAC,EAAA,IAAWC,EAAgBnB,CAAM,GAClDoB,IAAYH,KAAA,gBAAAA,EAAO,WAInBI,IAA6Bf,MAAUG,IAAQ,MAAM,MAErDa,IACJb,KAAS,QACJ,MAAM;AACL,UAAMc,IAAM,OAAOd,KAAU,WAAW,EAAE,KAAKA,MAAUA,GACnDe,IAAM,KAAK,MAAMnB,IAAO,IAAI;AAClC,WAAO;AAAA,MACL,KAAKkB,EAAI;AAAA,MACT,OAAOA,EAAI,SAASC;AAAA,MACpB,QAAQD,EAAI,UAAUC;AAAA,MACtB,UAAUD,EAAI,YAAY;AAAA,IAAA;AAAA,EAE9B,OACA,QAKAE,IAAQlB,MAAU,SAAS,SAAY,EAAE,cAAc,kBAAkBA,CAAK,IAAA;AAEpF,SACE,gBAAAmB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACA,MAAK;AAAA,MACL,cAAYF;AAAA,MACZ,WAAWa,EAAKC,EAAO,MAAMjB,KAAUiB,EAAO,QAAQhB,CAAS;AAAA,MAC/D,OAAO,EAAE,GAAGa,GAAO,GAAGZ,EAAA;AAAA,MACrB,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAK,IACC,gBAAAS;AAAA,UAACT;AAAA,UAAA;AAAA,YACC,WAAWQ,EAAO;AAAA,YAClB,OAAAxB;AAAA,YACA,MAAAC;AAAA,YACA,OAAOgB;AAAA,YACP,YAAYb;AAAA,YAEZ,SAAQ;AAAA,YACR,SAAQ;AAAA,YACR,eAAAc;AAAA,YACA,eAAW;AAAA,UAAA;AAAA,QAAA,IAGb,gBAAAO;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,OAAOzB;AAAA,YACP,QAAQA;AAAA,YACR,WAAWa,IAAS,KAAQ;AAAA,YAC5B,WAAWU,EAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGrBlB,KAAW,QACV,gBAAAmB,EAACE,GAAA,EAAW,SAAQ,WAAU,OAAM,SAAQ,WAAWH,EAAO,SAC3D,UAAAlB,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";var j=Object.create;var m=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var V=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!P.call(e,o)&&o!==r&&m(e,o,{get:()=>t[o],enumerable:!(a=R(t,o))||a.enumerable});return e};var k=(e,t,r)=>(r=e!=null?j(N(e)):{},V(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e));const i=require("react/jsx-runtime"),z=require("react"),G=require("clsx"),f=require("./useOptionalPeer-9Fkx5Leb.cjs"),M=require("./Skeleton-DK0lAjS9.cjs"),O=require("./Typography-B6ASPrzT.cjs"),T="_root_15ibt_1",H="_framed_15ibt_12",$="_code_15ibt_30",A="_caption_15ibt_35",s={root:T,framed:H,code:$,caption:A},B=f.optionalPeer("qrcode.react","QrCode",()=>import("qrcode.react")),D=z.forwardRef(function({value:t,size:r=180,level:a,color:o="text",margin:g=2,image:c,caption:l,framed:p=!0,className:v,style:_,"aria-label":x="QR code",...q},C){const{module:d,failed:b}=f.useOptionalPeer(B),u=d==null?void 0:d.QRCodeSVG,y=a??(c?"H":"M"),Q=c!=null?(()=>{const n=typeof c=="string"?{src:c}:c,h=Math.round(r*.22);return{src:n.src,width:n.width??h,height:n.height??h,excavate:n.excavate??!0}})():void 0,S=o==="text"?void 0:{"--tz-qr-fg":`var(--tz-color-${o})`};return i.jsxs("div",{ref:C,role:"img","aria-label":x,className:G.clsx(s.root,p&&s.framed,v),style:{...S,..._},...q,children:[u?i.jsx(u,{className:s.code,value:t,size:r,level:y,marginSize:g,fgColor:"var(--tz-qr-fg)",bgColor:"var(--tz-qr-bg)",imageSettings:Q,"aria-hidden":!0}):i.jsx(M.Skeleton,{variant:"rect",width:r,height:r,animation:b?!1:"shimmer",className:s.code}),l!=null&&i.jsx(O.Typography,{variant:"caption",color:"muted",className:s.caption,children:l})]})});exports.QrCode=D;
2
- //# sourceMappingURL=QrCode-BQ1eUiAJ.cjs.map
1
+ "use strict";var j=Object.create;var m=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var V=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!P.call(e,o)&&o!==r&&m(e,o,{get:()=>t[o],enumerable:!(a=R(t,o))||a.enumerable});return e};var k=(e,t,r)=>(r=e!=null?j(N(e)):{},V(t||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e));const i=require("react/jsx-runtime"),z=require("react"),G=require("clsx"),f=require("./useOptionalPeer-9Fkx5Leb.cjs"),M=require("./Skeleton-DK0lAjS9.cjs"),O=require("./Typography-d97DdbNd.cjs"),T="_root_15ibt_1",H="_framed_15ibt_12",$="_code_15ibt_30",A="_caption_15ibt_35",s={root:T,framed:H,code:$,caption:A},B=f.optionalPeer("qrcode.react","QrCode",()=>import("qrcode.react")),D=z.forwardRef(function({value:t,size:r=180,level:a,color:o="text",margin:g=2,image:c,caption:l,framed:p=!0,className:v,style:_,"aria-label":x="QR code",...q},C){const{module:d,failed:b}=f.useOptionalPeer(B),u=d==null?void 0:d.QRCodeSVG,y=a??(c?"H":"M"),Q=c!=null?(()=>{const n=typeof c=="string"?{src:c}:c,h=Math.round(r*.22);return{src:n.src,width:n.width??h,height:n.height??h,excavate:n.excavate??!0}})():void 0,S=o==="text"?void 0:{"--tz-qr-fg":`var(--tz-color-${o})`};return i.jsxs("div",{ref:C,role:"img","aria-label":x,className:G.clsx(s.root,p&&s.framed,v),style:{...S,..._},...q,children:[u?i.jsx(u,{className:s.code,value:t,size:r,level:y,marginSize:g,fgColor:"var(--tz-qr-fg)",bgColor:"var(--tz-qr-bg)",imageSettings:Q,"aria-hidden":!0}):i.jsx(M.Skeleton,{variant:"rect",width:r,height:r,animation:b?!1:"shimmer",className:s.code}),l!=null&&i.jsx(O.Typography,{variant:"caption",color:"muted",className:s.caption,children:l})]})});exports.QrCode=D;
2
+ //# sourceMappingURL=QrCode-CNVYpz9j.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"QrCode-BQ1eUiAJ.cjs","sources":["../src/components/QrCode/QrCode.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport type * as QrLibModule from 'qrcode.react'\nimport { optionalPeer, useOptionalPeer } from '../../hooks/useOptionalPeer'\nimport { Skeleton } from '../Skeleton'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport styles from './QrCode.module.css'\n\nexport type QrCodeLevel = 'L' | 'M' | 'Q' | 'H'\n\nexport interface QrCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** The encoded text (URL, `otpauth://…` URI, plain string). Required. */\n value: string\n /** Rendered edge length in px. Default `180`. */\n size?: number\n /** Error-correction level. Default `'M'` (`'H'` when `image` is set, so the logo can cover the middle). */\n level?: QrCodeLevel\n /** Module (foreground) tint — a theme token. Default `'text'` (so it follows light/dark). */\n color?: ThemeColor | 'text'\n /** Quiet zone in modules. Default `2`. */\n margin?: number\n /**\n * Optional centre image (a brand mark), as a URL or `{ src, width?, height?, excavate? }`.\n * `excavate` clears the modules under it (default `true`). Sizes default to ~22% of `size`.\n */\n image?: string | { src: string; width?: number; height?: number; excavate?: boolean }\n /** Caption rendered under the code (muted, centred) — e.g. \"Scan with your authenticator app\". */\n caption?: ReactNode\n /**\n * Wrap the code in a soft `surface` frame with padding and radius, so it sits cleanly on the\n * page `background`. Default `true`. Pass `false` for a bare SVG.\n */\n framed?: boolean\n /** Accessible name. Default `\"QR code\"`. The `value` is never exposed as text by this component. */\n 'aria-label'?: string\n}\n\n/**\n * A QR code, rendered as a crisp **SVG** — wraps the optional peer **`qrcode.react`** (`npm i\n * qrcode.react`) so apps don't pull in their own encoder. The modules take a theme `color` token\n * (default `text`) via the `--tz-qr-fg` var; `framed` (default) wraps the code in a soft, elevated card.\n *\n * **Scannability:** a framed code always sits on a **white** card in both light and dark mode, and its\n * default modules stay **dark** in both — a QR must be dark-on-light to read reliably, so the frame is\n * kept white even in dark mode (a deliberate literal-color exception, like `CodeBlock`'s dark surface).\n * A custom `color` is honored as-is (pick one dark enough to scan). The wrapper is `role=\"img\"` with an\n * `aria-label`; the SVG itself is `aria-hidden`, so the encoded `value` is never read out as text.\n */\n/** @internal — exported for tests */\nexport const qrPeer = optionalPeer<typeof QrLibModule>(\n 'qrcode.react',\n 'QrCode',\n () => import('qrcode.react'),\n)\n\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(function QrCode(\n {\n value,\n size = 180,\n level,\n color = 'text',\n margin = 2,\n image,\n caption,\n framed = true,\n className,\n style,\n 'aria-label': ariaLabel = 'QR code',\n ...props\n },\n ref,\n) {\n // `qrcode.react` is an optional peer, loaded lazily (never imported statically — apps without it must\n // still build + run from the barrel). Until it's ready a same-size skeleton holds the spot; if it isn't\n // installed the spot stays empty and an install hint is logged.\n const { module: qrLib, failed } = useOptionalPeer(qrPeer)\n const QRCodeSVG = qrLib?.QRCodeSVG\n\n // 'H' error correction by default when a centre image is present, so the logo can cover the middle\n // without breaking the code; otherwise 'M'. An explicit `level` always wins.\n const resolvedLevel: QrCodeLevel = level ?? (image ? 'H' : 'M')\n\n const imageSettings =\n image != null\n ? (() => {\n const img = typeof image === 'string' ? { src: image } : image\n const dim = Math.round(size * 0.22)\n return {\n src: img.src,\n width: img.width ?? dim,\n height: img.height ?? dim,\n excavate: img.excavate ?? true,\n }\n })()\n : undefined\n\n // The foreground (modules) follows the `color` token via `--tz-qr-fg`. The default `text` is left to\n // CSS (so `.framed` can force dark modules on the white card in dark mode); a custom token is pinned\n // inline, so it wins over that CSS fallback and is rendered exactly as asked.\n const fgVar = color === 'text' ? undefined : { '--tz-qr-fg': `var(--tz-color-${color})` }\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n className={clsx(styles.root, framed && styles.framed, className)}\n style={{ ...fgVar, ...style } as CSSProperties}\n {...props}\n >\n {QRCodeSVG ? (\n <QRCodeSVG\n className={styles.code}\n value={value}\n size={size}\n level={resolvedLevel}\n marginSize={margin}\n // colors flow through CSS vars so `.framed` can guarantee contrast per theme (see the module)\n fgColor=\"var(--tz-qr-fg)\"\n bgColor=\"var(--tz-qr-bg)\"\n imageSettings={imageSettings}\n aria-hidden\n />\n ) : (\n <Skeleton\n variant=\"rect\"\n width={size}\n height={size}\n animation={failed ? false : 'shimmer'}\n className={styles.code}\n />\n )}\n {caption != null && (\n <Typography variant=\"caption\" color=\"muted\" className={styles.caption}>\n {caption}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["qrPeer","optionalPeer","QrCode","forwardRef","value","size","level","color","margin","image","caption","framed","className","style","ariaLabel","props","ref","qrLib","failed","useOptionalPeer","QRCodeSVG","resolvedLevel","imageSettings","img","dim","fgVar","jsxs","clsx","styles","jsx","Skeleton","Typography"],"mappings":"+wBAkDaA,EAASC,EAAAA,aACpB,eACA,SACA,IAAM,OAAO,cAAc,CAC7B,EAEaC,EAASC,EAAAA,WAAwC,SAC5D,CACE,MAAAC,EACA,KAAAC,EAAO,IACP,MAAAC,EACA,MAAAC,EAAQ,OACR,OAAAC,EAAS,EACT,MAAAC,EACA,QAAAC,EACA,OAAAC,EAAS,GACT,UAAAC,EACA,MAAAC,EACA,aAAcC,EAAY,UAC1B,GAAGC,CACL,EACAC,EACA,CAIA,KAAM,CAAE,OAAQC,EAAO,OAAAC,CAAA,EAAWC,EAAAA,gBAAgBnB,CAAM,EAClDoB,EAAYH,GAAA,YAAAA,EAAO,UAInBI,EAA6Bf,IAAUG,EAAQ,IAAM,KAErDa,EACJb,GAAS,MACJ,IAAM,CACL,MAAMc,EAAM,OAAOd,GAAU,SAAW,CAAE,IAAKA,GAAUA,EACnDe,EAAM,KAAK,MAAMnB,EAAO,GAAI,EAClC,MAAO,CACL,IAAKkB,EAAI,IACT,MAAOA,EAAI,OAASC,EACpB,OAAQD,EAAI,QAAUC,EACtB,SAAUD,EAAI,UAAY,EAAA,CAE9B,KACA,OAKAE,EAAQlB,IAAU,OAAS,OAAY,CAAE,aAAc,kBAAkBA,CAAK,GAAA,EAEpF,OACEmB,EAAAA,KAAC,MAAA,CACC,IAAAV,EACA,KAAK,MACL,aAAYF,EACZ,UAAWa,EAAAA,KAAKC,EAAO,KAAMjB,GAAUiB,EAAO,OAAQhB,CAAS,EAC/D,MAAO,CAAE,GAAGa,EAAO,GAAGZ,CAAA,EACrB,GAAGE,EAEH,SAAA,CAAAK,EACCS,EAAAA,IAACT,EAAA,CACC,UAAWQ,EAAO,KAClB,MAAAxB,EACA,KAAAC,EACA,MAAOgB,EACP,WAAYb,EAEZ,QAAQ,kBACR,QAAQ,kBACR,cAAAc,EACA,cAAW,EAAA,CAAA,EAGbO,EAAAA,IAACC,EAAAA,SAAA,CACC,QAAQ,OACR,MAAOzB,EACP,OAAQA,EACR,UAAWa,EAAS,GAAQ,UAC5B,UAAWU,EAAO,IAAA,CAAA,EAGrBlB,GAAW,MACVmB,EAAAA,IAACE,EAAAA,WAAA,CAAW,QAAQ,UAAU,MAAM,QAAQ,UAAWH,EAAO,QAC3D,SAAAlB,CAAA,CACH,CAAA,CAAA,CAAA,CAIR,CAAC"}
1
+ {"version":3,"file":"QrCode-CNVYpz9j.cjs","sources":["../src/components/QrCode/QrCode.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport type * as QrLibModule from 'qrcode.react'\nimport { optionalPeer, useOptionalPeer } from '../../hooks/useOptionalPeer'\nimport { Skeleton } from '../Skeleton'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport styles from './QrCode.module.css'\n\nexport type QrCodeLevel = 'L' | 'M' | 'Q' | 'H'\n\nexport interface QrCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** The encoded text (URL, `otpauth://…` URI, plain string). Required. */\n value: string\n /** Rendered edge length in px. Default `180`. */\n size?: number\n /** Error-correction level. Default `'M'` (`'H'` when `image` is set, so the logo can cover the middle). */\n level?: QrCodeLevel\n /** Module (foreground) tint — a theme token. Default `'text'` (so it follows light/dark). */\n color?: ThemeColor | 'text'\n /** Quiet zone in modules. Default `2`. */\n margin?: number\n /**\n * Optional centre image (a brand mark), as a URL or `{ src, width?, height?, excavate? }`.\n * `excavate` clears the modules under it (default `true`). Sizes default to ~22% of `size`.\n */\n image?: string | { src: string; width?: number; height?: number; excavate?: boolean }\n /** Caption rendered under the code (muted, centred) — e.g. \"Scan with your authenticator app\". */\n caption?: ReactNode\n /**\n * Wrap the code in a soft `surface` frame with padding and radius, so it sits cleanly on the\n * page `background`. Default `true`. Pass `false` for a bare SVG.\n */\n framed?: boolean\n /** Accessible name. Default `\"QR code\"`. The `value` is never exposed as text by this component. */\n 'aria-label'?: string\n}\n\n/**\n * A QR code, rendered as a crisp **SVG** — wraps the optional peer **`qrcode.react`** (`npm i\n * qrcode.react`) so apps don't pull in their own encoder. The modules take a theme `color` token\n * (default `text`) via the `--tz-qr-fg` var; `framed` (default) wraps the code in a soft, elevated card.\n *\n * **Scannability:** a framed code always sits on a **white** card in both light and dark mode, and its\n * default modules stay **dark** in both — a QR must be dark-on-light to read reliably, so the frame is\n * kept white even in dark mode (a deliberate literal-color exception, like `CodeBlock`'s dark surface).\n * A custom `color` is honored as-is (pick one dark enough to scan). The wrapper is `role=\"img\"` with an\n * `aria-label`; the SVG itself is `aria-hidden`, so the encoded `value` is never read out as text.\n */\n/** @internal — exported for tests */\nexport const qrPeer = optionalPeer<typeof QrLibModule>(\n 'qrcode.react',\n 'QrCode',\n () => import('qrcode.react'),\n)\n\nexport const QrCode = forwardRef<HTMLDivElement, QrCodeProps>(function QrCode(\n {\n value,\n size = 180,\n level,\n color = 'text',\n margin = 2,\n image,\n caption,\n framed = true,\n className,\n style,\n 'aria-label': ariaLabel = 'QR code',\n ...props\n },\n ref,\n) {\n // `qrcode.react` is an optional peer, loaded lazily (never imported statically — apps without it must\n // still build + run from the barrel). Until it's ready a same-size skeleton holds the spot; if it isn't\n // installed the spot stays empty and an install hint is logged.\n const { module: qrLib, failed } = useOptionalPeer(qrPeer)\n const QRCodeSVG = qrLib?.QRCodeSVG\n\n // 'H' error correction by default when a centre image is present, so the logo can cover the middle\n // without breaking the code; otherwise 'M'. An explicit `level` always wins.\n const resolvedLevel: QrCodeLevel = level ?? (image ? 'H' : 'M')\n\n const imageSettings =\n image != null\n ? (() => {\n const img = typeof image === 'string' ? { src: image } : image\n const dim = Math.round(size * 0.22)\n return {\n src: img.src,\n width: img.width ?? dim,\n height: img.height ?? dim,\n excavate: img.excavate ?? true,\n }\n })()\n : undefined\n\n // The foreground (modules) follows the `color` token via `--tz-qr-fg`. The default `text` is left to\n // CSS (so `.framed` can force dark modules on the white card in dark mode); a custom token is pinned\n // inline, so it wins over that CSS fallback and is rendered exactly as asked.\n const fgVar = color === 'text' ? undefined : { '--tz-qr-fg': `var(--tz-color-${color})` }\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={ariaLabel}\n className={clsx(styles.root, framed && styles.framed, className)}\n style={{ ...fgVar, ...style } as CSSProperties}\n {...props}\n >\n {QRCodeSVG ? (\n <QRCodeSVG\n className={styles.code}\n value={value}\n size={size}\n level={resolvedLevel}\n marginSize={margin}\n // colors flow through CSS vars so `.framed` can guarantee contrast per theme (see the module)\n fgColor=\"var(--tz-qr-fg)\"\n bgColor=\"var(--tz-qr-bg)\"\n imageSettings={imageSettings}\n aria-hidden\n />\n ) : (\n <Skeleton\n variant=\"rect\"\n width={size}\n height={size}\n animation={failed ? false : 'shimmer'}\n className={styles.code}\n />\n )}\n {caption != null && (\n <Typography variant=\"caption\" color=\"muted\" className={styles.caption}>\n {caption}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["qrPeer","optionalPeer","QrCode","forwardRef","value","size","level","color","margin","image","caption","framed","className","style","ariaLabel","props","ref","qrLib","failed","useOptionalPeer","QRCodeSVG","resolvedLevel","imageSettings","img","dim","fgVar","jsxs","clsx","styles","jsx","Skeleton","Typography"],"mappings":"+wBAkDaA,EAASC,EAAAA,aACpB,eACA,SACA,IAAM,OAAO,cAAc,CAC7B,EAEaC,EAASC,EAAAA,WAAwC,SAC5D,CACE,MAAAC,EACA,KAAAC,EAAO,IACP,MAAAC,EACA,MAAAC,EAAQ,OACR,OAAAC,EAAS,EACT,MAAAC,EACA,QAAAC,EACA,OAAAC,EAAS,GACT,UAAAC,EACA,MAAAC,EACA,aAAcC,EAAY,UAC1B,GAAGC,CACL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cjs"),T=require("./Typography-B6ASPrzT.cjs"),k=o.createContext(null);function D(){return o.useContext(k)}const P="_field_iusre_2",$="_row_iusre_9",A="_disabled_iusre_21",H="_input_iusre_27",J="_circle_iusre_41",K="_dot_iusre_63",M="_error_iusre_77",O="_label_iusre_81",Q="_required_iusre_86",U="_sm_iusre_92",W="_md_iusre_96",X="_lg_iusre_100",Y="_group_iusre_116",Z="_groupLabel_iusre_123",ee="_options_iusre_128",se="_horizontal_iusre_134",s={field:P,row:$,disabled:A,input:H,circle:J,dot:K,error:M,label:O,required:Q,sm:U,md:W,lg:X,group:Y,groupLabel:Z,options:ee,horizontal:se},V=o.forwardRef(function({value:a,label:d,color:j,size:u,error:l,checked:n,onChange:_,name:N,disabled:R,id:q,className:y,style:z,...g},C){const I=o.useId(),m=q??I,e=D(),t=j??(e==null?void 0:e.color)??"accent",b=u??(e==null?void 0:e.size)??"md",c=l??(e==null?void 0:e.error)??!1,v=R??(e==null?void 0:e.disabled)??!1,f=N??(e==null?void 0:e.name),[x,w]=o.useState(!1),G=e?e.value===a:n!==void 0?n:x,L=h=>{if(e){e.onChange(a);return}n===void 0&&w(h.target.checked),_==null||_(h.target.checked)};return r.jsx("div",{className:p.clsx(s.field,c&&s.error,v&&s.disabled,y),style:{"--tz-btn-rgb":`var(--tz-color-${t}-rgb)`,...z},children:r.jsxs("label",{className:p.clsx(s.row,s[b]),children:[r.jsx("input",{ref:C,id:m,name:f,type:"radio",className:s.input,value:a,checked:G,onChange:L,disabled:v,"aria-invalid":c||void 0,...g}),r.jsx("span",{className:s.circle,"aria-hidden":"true",children:r.jsx("span",{className:s.dot})}),d!=null&&r.jsx("span",{className:s.label,children:d})]})})}),re=o.forwardRef(function({label:a,value:d,defaultValue:j,onChange:u,name:l,options:n,orientation:_="vertical",size:N="md",color:R="accent",error:q,required:y=!1,disabled:z=!1,children:g,className:C,style:I,...m},e){const t=F.useFormContext(),b=!!(t&&l),c=t&&l?t.field(l):void 0,v=d!==void 0?d:b?t.values[l]:void 0,f=v!==void 0,x=o.useId(),w=o.useId(),[G,L]=o.useState(j),h=f?v:G,S=q??(c==null?void 0:c.error)??!1,E={name:l??w,value:h,onChange:i=>{f||L(i),b&&t.setValue(l,i),u==null||u(i)},size:N,color:R,disabled:z,error:S};return r.jsxs("div",{ref:e,role:"radiogroup","aria-labelledby":a!=null&&m["aria-label"]==null?x:void 0,"aria-invalid":S||void 0,className:p.clsx(s.group,C),style:I,...m,children:[a!=null&&r.jsxs("span",{id:x,className:s.groupLabel,children:[r.jsx(T.Typography,{as:"span",variant:"bodySmall",color:"muted",children:a}),y&&r.jsx("span",{className:s.required,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:p.clsx(s.options,_==="horizontal"&&s.horizontal),children:r.jsx(k.Provider,{value:E,children:n?n.map(i=>r.jsx(V,{value:i.value,label:i.label,disabled:i.disabled},i.value)):g})})]})});exports.Radio=V;exports.RadioGroup=re;
2
- //# sourceMappingURL=RadioGroup-CvC2yc4p.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),o=require("react"),p=require("clsx"),F=require("./formContext-bTWrqdEV.cjs"),T=require("./Typography-d97DdbNd.cjs"),k=o.createContext(null);function D(){return o.useContext(k)}const P="_field_iusre_2",$="_row_iusre_9",A="_disabled_iusre_21",H="_input_iusre_27",J="_circle_iusre_41",K="_dot_iusre_63",M="_error_iusre_77",O="_label_iusre_81",Q="_required_iusre_86",U="_sm_iusre_92",W="_md_iusre_96",X="_lg_iusre_100",Y="_group_iusre_116",Z="_groupLabel_iusre_123",ee="_options_iusre_128",se="_horizontal_iusre_134",s={field:P,row:$,disabled:A,input:H,circle:J,dot:K,error:M,label:O,required:Q,sm:U,md:W,lg:X,group:Y,groupLabel:Z,options:ee,horizontal:se},V=o.forwardRef(function({value:a,label:d,color:j,size:u,error:l,checked:n,onChange:_,name:N,disabled:R,id:q,className:y,style:z,...g},C){const I=o.useId(),m=q??I,e=D(),t=j??(e==null?void 0:e.color)??"accent",b=u??(e==null?void 0:e.size)??"md",c=l??(e==null?void 0:e.error)??!1,v=R??(e==null?void 0:e.disabled)??!1,f=N??(e==null?void 0:e.name),[x,w]=o.useState(!1),G=e?e.value===a:n!==void 0?n:x,L=h=>{if(e){e.onChange(a);return}n===void 0&&w(h.target.checked),_==null||_(h.target.checked)};return r.jsx("div",{className:p.clsx(s.field,c&&s.error,v&&s.disabled,y),style:{"--tz-btn-rgb":`var(--tz-color-${t}-rgb)`,...z},children:r.jsxs("label",{className:p.clsx(s.row,s[b]),children:[r.jsx("input",{ref:C,id:m,name:f,type:"radio",className:s.input,value:a,checked:G,onChange:L,disabled:v,"aria-invalid":c||void 0,...g}),r.jsx("span",{className:s.circle,"aria-hidden":"true",children:r.jsx("span",{className:s.dot})}),d!=null&&r.jsx("span",{className:s.label,children:d})]})})}),re=o.forwardRef(function({label:a,value:d,defaultValue:j,onChange:u,name:l,options:n,orientation:_="vertical",size:N="md",color:R="accent",error:q,required:y=!1,disabled:z=!1,children:g,className:C,style:I,...m},e){const t=F.useFormContext(),b=!!(t&&l),c=t&&l?t.field(l):void 0,v=d!==void 0?d:b?t.values[l]:void 0,f=v!==void 0,x=o.useId(),w=o.useId(),[G,L]=o.useState(j),h=f?v:G,S=q??(c==null?void 0:c.error)??!1,E={name:l??w,value:h,onChange:i=>{f||L(i),b&&t.setValue(l,i),u==null||u(i)},size:N,color:R,disabled:z,error:S};return r.jsxs("div",{ref:e,role:"radiogroup","aria-labelledby":a!=null&&m["aria-label"]==null?x:void 0,"aria-invalid":S||void 0,className:p.clsx(s.group,C),style:I,...m,children:[a!=null&&r.jsxs("span",{id:x,className:s.groupLabel,children:[r.jsx(T.Typography,{as:"span",variant:"bodySmall",color:"muted",children:a}),y&&r.jsx("span",{className:s.required,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:p.clsx(s.options,_==="horizontal"&&s.horizontal),children:r.jsx(k.Provider,{value:E,children:n?n.map(i=>r.jsx(V,{value:i.value,label:i.label,disabled:i.disabled},i.value)):g})})]})});exports.Radio=V;exports.RadioGroup=re;
2
+ //# sourceMappingURL=RadioGroup-687BVZ7k.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup-CvC2yc4p.cjs","sources":["../src/components/Radio/radioContext.ts","../src/components/Radio/Radio.tsx","../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ThemeColor } from '../../theme'\nimport type { RadioSize } from './Radio'\n\n/** Shared state a `<RadioGroup>` hands down to its `<Radio>` children via context. */\nexport interface RadioGroupContextValue {\n /** Shared input `name` (the radios in a group must share one). */\n name?: string\n /** The group's currently-selected value. */\n value?: string\n /** Select a value — called by a child `<Radio>` on change. */\n onChange: (value: string) => void\n size?: RadioSize\n color?: ThemeColor\n disabled?: boolean\n error?: boolean\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n\n/** Read the surrounding `<RadioGroup>` so a `<Radio>` can wire itself in (or `null` when standalone). */\nexport function useRadioGroupContext(): RadioGroupContextValue | null {\n return useContext(RadioGroupContext)\n}\n","import {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { useRadioGroupContext } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioSize = 'sm' | 'md' | 'lg'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'color' | 'type' | 'onChange' | 'value'\n> {\n /** This option's value — selected when it matches the surrounding `RadioGroup`'s value. */\n value: string\n /** Text shown to the right of the control. */\n label?: ReactNode\n /** Theme palette token for the selected fill. Defaults to `accent` (inherits the group's `color`). */\n color?: ThemeColor\n /** Preset size — circle dimensions and label font. Inherits the group's `size` when omitted. */\n size?: RadioSize\n /** Marks the control invalid — reddens the ring. Inherits the group's `error`. */\n error?: boolean\n /** Controlled selected state for standalone use (inside a `RadioGroup` the group drives this). */\n checked?: boolean\n /** Fires with the next selected state (standalone use). */\n onChange?: (checked: boolean) => void\n}\n\n/**\n * A single radio button with a label. The native `<input type=\"radio\">` is visually hidden but fully\n * accessible; a styled circle shows the state, filling with `color` and an inner dot when selected.\n * Designed to live inside a `<RadioGroup>` (which supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` via context), but also works standalone (`checked` + `onChange`).\n * Styling uses `--tz-*` tokens only.\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n label,\n color,\n size,\n error,\n checked,\n onChange,\n name,\n disabled,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const reactId = useId()\n const id = idProp ?? reactId\n const group = useRadioGroupContext()\n\n const resolvedColor = color ?? group?.color ?? 'accent'\n const resolvedSize = size ?? group?.size ?? 'md'\n const resolvedError = error ?? group?.error ?? false\n const resolvedDisabled = disabled ?? group?.disabled ?? false\n const resolvedName = name ?? group?.name\n\n // In a group the selection comes from context; standalone it's controlled (`checked`) or local.\n const [internal, setInternal] = useState(false)\n const isChecked = group ? group.value === value : checked !== undefined ? checked : internal\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (group) {\n group.onChange(value)\n return\n }\n if (checked === undefined) setInternal(event.target.checked)\n onChange?.(event.target.checked)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n resolvedError && styles.error,\n resolvedDisabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`, ...style } as CSSProperties}\n >\n <label className={clsx(styles.row, styles[resolvedSize])}>\n <input\n ref={ref}\n id={id}\n name={resolvedName}\n type=\"radio\"\n className={styles.input}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n disabled={resolvedDisabled}\n aria-invalid={resolvedError || undefined}\n {...props}\n />\n <span className={styles.circle} aria-hidden=\"true\">\n <span className={styles.dot} />\n </span>\n {label != null && <span className={styles.label}>{label}</span>}\n </label>\n </div>\n )\n})\n","import {\n forwardRef,\n useId,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport { Radio, type RadioSize } from './Radio'\nimport { RadioGroupContext, type RadioGroupContextValue } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioOrientation = 'vertical' | 'horizontal'\n\n/** A single option for the data-driven `options` prop. */\nexport interface RadioOption {\n value: string\n label?: ReactNode\n disabled?: boolean\n}\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** Group label rendered above the options. */\n label?: ReactNode\n /** Controlled selected value. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the newly-selected value. */\n onChange?: (value: string) => void\n /** Shared input `name` for the radios (also the `<Form>` binding key). */\n name?: string\n /** Data-driven options — an alternative to passing `<Radio>` children. */\n options?: RadioOption[]\n /** Stack direction of the options. Defaults to `vertical`. */\n orientation?: RadioOrientation\n /** Preset size for every radio. Defaults to `md`. */\n size?: RadioSize\n /** Theme palette token for the selected fill. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the group invalid — reddens the radio rings (no message text, like `Checkbox`). */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every radio in the group. */\n disabled?: boolean\n /** `<Radio>` children (used when `options` is not given). */\n children?: ReactNode\n}\n\n/**\n * Groups radio buttons so exactly one is selected. Supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` to its `<Radio>` children via context — pass them as `children`\n * or, for the common case, via the data-driven `options` prop. Controlled (`value` + `onChange`) or\n * uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is a\n * `string`; validate with e.g. `z.string().min(1)`). `error` reddens the radio rings (no message text,\n * like `Checkbox`). `role=\"radiogroup\"`, named by its `label` (`aria-labelledby`); styling uses `--tz-*` tokens.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n label,\n value,\n defaultValue,\n onChange,\n name,\n options,\n orientation = 'vertical',\n size = 'md',\n color = 'accent',\n error,\n required = false,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n ref,\n) {\n // Auto-bind to a surrounding <Form> by `name` — the form value is the selected string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? (form!.values[name!] as string | undefined)\n : undefined\n const isControlled = externalValue !== undefined\n // the visible label names the group for assistive tech (an explicit aria-label/-labelledby wins)\n const labelId = useId()\n // without a `name` the inputs wouldn't form a native radio group (every option its own tab stop, no\n // arrow-key selection) — fall back to a generated one for the DOM only; `<Form>` binding still keys off `name`\n const fallbackName = useId()\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const currentValue = isControlled ? externalValue : internal\n\n const resolvedError = error ?? bound?.error ?? false\n\n const handleChange = (next: string) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const ctx: RadioGroupContextValue = {\n name: name ?? fallbackName,\n value: currentValue,\n onChange: handleChange,\n size,\n color,\n disabled,\n error: resolvedError,\n }\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label != null && props['aria-label'] == null ? labelId : undefined}\n aria-invalid={resolvedError || undefined}\n className={clsx(styles.group, className)}\n style={style as CSSProperties}\n {...props}\n >\n {label != null && (\n <span id={labelId} className={styles.groupLabel}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div className={clsx(styles.options, orientation === 'horizontal' && styles.horizontal)}>\n <RadioGroupContext.Provider value={ctx}>\n {options\n ? options.map((option) => (\n <Radio\n key={option.value}\n value={option.value}\n label={option.label}\n disabled={option.disabled}\n />\n ))\n : children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n )\n})\n"],"names":["RadioGroupContext","createContext","useRadioGroupContext","useContext","Radio","forwardRef","value","label","color","size","error","checked","onChange","name","disabled","idProp","className","style","props","ref","reactId","useId","id","group","resolvedColor","resolvedSize","resolvedError","resolvedDisabled","resolvedName","internal","setInternal","useState","isChecked","handleChange","event","jsx","clsx","styles","jsxs","RadioGroup","defaultValue","options","orientation","required","children","form","useFormContext","isFormBound","bound","externalValue","isControlled","labelId","fallbackName","currentValue","ctx","next","Typography","option"],"mappings":"sKAkBaA,EAAoBC,EAAAA,cAA6C,IAAI,EAG3E,SAASC,GAAsD,CACpE,OAAOC,EAAAA,WAAWH,CAAiB,CACrC,8dCoBaI,EAAQC,EAAAA,WAAyC,SAC5D,CACE,MAAAC,EACA,MAAAC,EACA,MAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,KAAAC,EACA,SAAAC,EACA,GAAIC,EACJ,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAUC,EAAAA,MAAA,EACVC,EAAKP,GAAUK,EACfG,EAAQrB,EAAA,EAERsB,EAAgBhB,IAASe,GAAA,YAAAA,EAAO,QAAS,SACzCE,EAAehB,IAAQc,GAAA,YAAAA,EAAO,OAAQ,KACtCG,EAAgBhB,IAASa,GAAA,YAAAA,EAAO,QAAS,GACzCI,EAAmBb,IAAYS,GAAA,YAAAA,EAAO,WAAY,GAClDK,EAAef,IAAQU,GAAA,YAAAA,EAAO,MAG9B,CAACM,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAK,EACxCC,EAAYT,EAAQA,EAAM,QAAUjB,EAAQK,IAAY,OAAYA,EAAUkB,EAE9EI,EAAgBC,GAAyC,CAC7D,GAAIX,EAAO,CACTA,EAAM,SAASjB,CAAK,EACpB,MACF,CACIK,IAAY,QAAWmB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,SAAUA,EAAO,QAAA,EAHZA,EAAO,KAAA,CAKf,EACDb,CAAA,CACN,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC"}
1
+ {"version":3,"file":"RadioGroup-687BVZ7k.cjs","sources":["../src/components/Radio/radioContext.ts","../src/components/Radio/Radio.tsx","../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ThemeColor } from '../../theme'\nimport type { RadioSize } from './Radio'\n\n/** Shared state a `<RadioGroup>` hands down to its `<Radio>` children via context. */\nexport interface RadioGroupContextValue {\n /** Shared input `name` (the radios in a group must share one). */\n name?: string\n /** The group's currently-selected value. */\n value?: string\n /** Select a value — called by a child `<Radio>` on change. */\n onChange: (value: string) => void\n size?: RadioSize\n color?: ThemeColor\n disabled?: boolean\n error?: boolean\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n\n/** Read the surrounding `<RadioGroup>` so a `<Radio>` can wire itself in (or `null` when standalone). */\nexport function useRadioGroupContext(): RadioGroupContextValue | null {\n return useContext(RadioGroupContext)\n}\n","import {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { useRadioGroupContext } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioSize = 'sm' | 'md' | 'lg'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'color' | 'type' | 'onChange' | 'value'\n> {\n /** This option's value — selected when it matches the surrounding `RadioGroup`'s value. */\n value: string\n /** Text shown to the right of the control. */\n label?: ReactNode\n /** Theme palette token for the selected fill. Defaults to `accent` (inherits the group's `color`). */\n color?: ThemeColor\n /** Preset size — circle dimensions and label font. Inherits the group's `size` when omitted. */\n size?: RadioSize\n /** Marks the control invalid — reddens the ring. Inherits the group's `error`. */\n error?: boolean\n /** Controlled selected state for standalone use (inside a `RadioGroup` the group drives this). */\n checked?: boolean\n /** Fires with the next selected state (standalone use). */\n onChange?: (checked: boolean) => void\n}\n\n/**\n * A single radio button with a label. The native `<input type=\"radio\">` is visually hidden but fully\n * accessible; a styled circle shows the state, filling with `color` and an inner dot when selected.\n * Designed to live inside a `<RadioGroup>` (which supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` via context), but also works standalone (`checked` + `onChange`).\n * Styling uses `--tz-*` tokens only.\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n label,\n color,\n size,\n error,\n checked,\n onChange,\n name,\n disabled,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const reactId = useId()\n const id = idProp ?? reactId\n const group = useRadioGroupContext()\n\n const resolvedColor = color ?? group?.color ?? 'accent'\n const resolvedSize = size ?? group?.size ?? 'md'\n const resolvedError = error ?? group?.error ?? false\n const resolvedDisabled = disabled ?? group?.disabled ?? false\n const resolvedName = name ?? group?.name\n\n // In a group the selection comes from context; standalone it's controlled (`checked`) or local.\n const [internal, setInternal] = useState(false)\n const isChecked = group ? group.value === value : checked !== undefined ? checked : internal\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (group) {\n group.onChange(value)\n return\n }\n if (checked === undefined) setInternal(event.target.checked)\n onChange?.(event.target.checked)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n resolvedError && styles.error,\n resolvedDisabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`, ...style } as CSSProperties}\n >\n <label className={clsx(styles.row, styles[resolvedSize])}>\n <input\n ref={ref}\n id={id}\n name={resolvedName}\n type=\"radio\"\n className={styles.input}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n disabled={resolvedDisabled}\n aria-invalid={resolvedError || undefined}\n {...props}\n />\n <span className={styles.circle} aria-hidden=\"true\">\n <span className={styles.dot} />\n </span>\n {label != null && <span className={styles.label}>{label}</span>}\n </label>\n </div>\n )\n})\n","import {\n forwardRef,\n useId,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport { Radio, type RadioSize } from './Radio'\nimport { RadioGroupContext, type RadioGroupContextValue } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioOrientation = 'vertical' | 'horizontal'\n\n/** A single option for the data-driven `options` prop. */\nexport interface RadioOption {\n value: string\n label?: ReactNode\n disabled?: boolean\n}\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** Group label rendered above the options. */\n label?: ReactNode\n /** Controlled selected value. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the newly-selected value. */\n onChange?: (value: string) => void\n /** Shared input `name` for the radios (also the `<Form>` binding key). */\n name?: string\n /** Data-driven options — an alternative to passing `<Radio>` children. */\n options?: RadioOption[]\n /** Stack direction of the options. Defaults to `vertical`. */\n orientation?: RadioOrientation\n /** Preset size for every radio. Defaults to `md`. */\n size?: RadioSize\n /** Theme palette token for the selected fill. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the group invalid — reddens the radio rings (no message text, like `Checkbox`). */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every radio in the group. */\n disabled?: boolean\n /** `<Radio>` children (used when `options` is not given). */\n children?: ReactNode\n}\n\n/**\n * Groups radio buttons so exactly one is selected. Supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` to its `<Radio>` children via context — pass them as `children`\n * or, for the common case, via the data-driven `options` prop. Controlled (`value` + `onChange`) or\n * uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is a\n * `string`; validate with e.g. `z.string().min(1)`). `error` reddens the radio rings (no message text,\n * like `Checkbox`). `role=\"radiogroup\"`, named by its `label` (`aria-labelledby`); styling uses `--tz-*` tokens.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n label,\n value,\n defaultValue,\n onChange,\n name,\n options,\n orientation = 'vertical',\n size = 'md',\n color = 'accent',\n error,\n required = false,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n ref,\n) {\n // Auto-bind to a surrounding <Form> by `name` — the form value is the selected string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? (form!.values[name!] as string | undefined)\n : undefined\n const isControlled = externalValue !== undefined\n // the visible label names the group for assistive tech (an explicit aria-label/-labelledby wins)\n const labelId = useId()\n // without a `name` the inputs wouldn't form a native radio group (every option its own tab stop, no\n // arrow-key selection) — fall back to a generated one for the DOM only; `<Form>` binding still keys off `name`\n const fallbackName = useId()\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const currentValue = isControlled ? externalValue : internal\n\n const resolvedError = error ?? bound?.error ?? false\n\n const handleChange = (next: string) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const ctx: RadioGroupContextValue = {\n name: name ?? fallbackName,\n value: currentValue,\n onChange: handleChange,\n size,\n color,\n disabled,\n error: resolvedError,\n }\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label != null && props['aria-label'] == null ? labelId : undefined}\n aria-invalid={resolvedError || undefined}\n className={clsx(styles.group, className)}\n style={style as CSSProperties}\n {...props}\n >\n {label != null && (\n <span id={labelId} className={styles.groupLabel}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div className={clsx(styles.options, orientation === 'horizontal' && styles.horizontal)}>\n <RadioGroupContext.Provider value={ctx}>\n {options\n ? options.map((option) => (\n <Radio\n key={option.value}\n value={option.value}\n label={option.label}\n disabled={option.disabled}\n />\n ))\n : children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n )\n})\n"],"names":["RadioGroupContext","createContext","useRadioGroupContext","useContext","Radio","forwardRef","value","label","color","size","error","checked","onChange","name","disabled","idProp","className","style","props","ref","reactId","useId","id","group","resolvedColor","resolvedSize","resolvedError","resolvedDisabled","resolvedName","internal","setInternal","useState","isChecked","handleChange","event","jsx","clsx","styles","jsxs","RadioGroup","defaultValue","options","orientation","required","children","form","useFormContext","isFormBound","bound","externalValue","isControlled","labelId","fallbackName","currentValue","ctx","next","Typography","option"],"mappings":"sKAkBaA,EAAoBC,EAAAA,cAA6C,IAAI,EAG3E,SAASC,GAAsD,CACpE,OAAOC,EAAAA,WAAWH,CAAiB,CACrC,8dCoBaI,EAAQC,EAAAA,WAAyC,SAC5D,CACE,MAAAC,EACA,MAAAC,EACA,MAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,KAAAC,EACA,SAAAC,EACA,GAAIC,EACJ,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAUC,EAAAA,MAAA,EACVC,EAAKP,GAAUK,EACfG,EAAQrB,EAAA,EAERsB,EAAgBhB,IAASe,GAAA,YAAAA,EAAO,QAAS,SACzCE,EAAehB,IAAQc,GAAA,YAAAA,EAAO,OAAQ,KACtCG,EAAgBhB,IAASa,GAAA,YAAAA,EAAO,QAAS,GACzCI,EAAmBb,IAAYS,GAAA,YAAAA,EAAO,WAAY,GAClDK,EAAef,IAAQU,GAAA,YAAAA,EAAO,MAG9B,CAACM,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAK,EACxCC,EAAYT,EAAQA,EAAM,QAAUjB,EAAQK,IAAY,OAAYA,EAAUkB,EAE9EI,EAAgBC,GAAyC,CAC7D,GAAIX,EAAO,CACTA,EAAM,SAASjB,CAAK,EACpB,MACF,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d,MAAOA,EAAO,MACd,SAAUA,EAAO,QAAA,EAHZA,EAAO,KAAA,CAKf,EACDb,CAAA,CACN,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as s, jsxs as k } from "react/jsx-runtime";
2
2
  import { useContext as D, createContext as P, forwardRef as j, useId as S, useState as B } from "react";
3
3
  import { clsx as h } from "clsx";
4
4
  import { u as $ } from "./formContext-B7ln1Miy.js";
5
- import { T as A } from "./Typography-CJv5AnRP.js";
5
+ import { T as A } from "./Typography-ChSuxgkc.js";
6
6
  const E = P(null);
7
7
  function H() {
8
8
  return D(E);
@@ -139,4 +139,4 @@ export {
139
139
  ie as R,
140
140
  me as a
141
141
  };
142
- //# sourceMappingURL=RadioGroup-CTAayuMv.js.map
142
+ //# sourceMappingURL=RadioGroup-CD209tlb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup-CTAayuMv.js","sources":["../src/components/Radio/radioContext.ts","../src/components/Radio/Radio.tsx","../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ThemeColor } from '../../theme'\nimport type { RadioSize } from './Radio'\n\n/** Shared state a `<RadioGroup>` hands down to its `<Radio>` children via context. */\nexport interface RadioGroupContextValue {\n /** Shared input `name` (the radios in a group must share one). */\n name?: string\n /** The group's currently-selected value. */\n value?: string\n /** Select a value — called by a child `<Radio>` on change. */\n onChange: (value: string) => void\n size?: RadioSize\n color?: ThemeColor\n disabled?: boolean\n error?: boolean\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n\n/** Read the surrounding `<RadioGroup>` so a `<Radio>` can wire itself in (or `null` when standalone). */\nexport function useRadioGroupContext(): RadioGroupContextValue | null {\n return useContext(RadioGroupContext)\n}\n","import {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { useRadioGroupContext } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioSize = 'sm' | 'md' | 'lg'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'color' | 'type' | 'onChange' | 'value'\n> {\n /** This option's value — selected when it matches the surrounding `RadioGroup`'s value. */\n value: string\n /** Text shown to the right of the control. */\n label?: ReactNode\n /** Theme palette token for the selected fill. Defaults to `accent` (inherits the group's `color`). */\n color?: ThemeColor\n /** Preset size — circle dimensions and label font. Inherits the group's `size` when omitted. */\n size?: RadioSize\n /** Marks the control invalid — reddens the ring. Inherits the group's `error`. */\n error?: boolean\n /** Controlled selected state for standalone use (inside a `RadioGroup` the group drives this). */\n checked?: boolean\n /** Fires with the next selected state (standalone use). */\n onChange?: (checked: boolean) => void\n}\n\n/**\n * A single radio button with a label. The native `<input type=\"radio\">` is visually hidden but fully\n * accessible; a styled circle shows the state, filling with `color` and an inner dot when selected.\n * Designed to live inside a `<RadioGroup>` (which supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` via context), but also works standalone (`checked` + `onChange`).\n * Styling uses `--tz-*` tokens only.\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n label,\n color,\n size,\n error,\n checked,\n onChange,\n name,\n disabled,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const reactId = useId()\n const id = idProp ?? reactId\n const group = useRadioGroupContext()\n\n const resolvedColor = color ?? group?.color ?? 'accent'\n const resolvedSize = size ?? group?.size ?? 'md'\n const resolvedError = error ?? group?.error ?? false\n const resolvedDisabled = disabled ?? group?.disabled ?? false\n const resolvedName = name ?? group?.name\n\n // In a group the selection comes from context; standalone it's controlled (`checked`) or local.\n const [internal, setInternal] = useState(false)\n const isChecked = group ? group.value === value : checked !== undefined ? checked : internal\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (group) {\n group.onChange(value)\n return\n }\n if (checked === undefined) setInternal(event.target.checked)\n onChange?.(event.target.checked)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n resolvedError && styles.error,\n resolvedDisabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`, ...style } as CSSProperties}\n >\n <label className={clsx(styles.row, styles[resolvedSize])}>\n <input\n ref={ref}\n id={id}\n name={resolvedName}\n type=\"radio\"\n className={styles.input}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n disabled={resolvedDisabled}\n aria-invalid={resolvedError || undefined}\n {...props}\n />\n <span className={styles.circle} aria-hidden=\"true\">\n <span className={styles.dot} />\n </span>\n {label != null && <span className={styles.label}>{label}</span>}\n </label>\n </div>\n )\n})\n","import {\n forwardRef,\n useId,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport { Radio, type RadioSize } from './Radio'\nimport { RadioGroupContext, type RadioGroupContextValue } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioOrientation = 'vertical' | 'horizontal'\n\n/** A single option for the data-driven `options` prop. */\nexport interface RadioOption {\n value: string\n label?: ReactNode\n disabled?: boolean\n}\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** Group label rendered above the options. */\n label?: ReactNode\n /** Controlled selected value. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the newly-selected value. */\n onChange?: (value: string) => void\n /** Shared input `name` for the radios (also the `<Form>` binding key). */\n name?: string\n /** Data-driven options — an alternative to passing `<Radio>` children. */\n options?: RadioOption[]\n /** Stack direction of the options. Defaults to `vertical`. */\n orientation?: RadioOrientation\n /** Preset size for every radio. Defaults to `md`. */\n size?: RadioSize\n /** Theme palette token for the selected fill. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the group invalid — reddens the radio rings (no message text, like `Checkbox`). */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every radio in the group. */\n disabled?: boolean\n /** `<Radio>` children (used when `options` is not given). */\n children?: ReactNode\n}\n\n/**\n * Groups radio buttons so exactly one is selected. Supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` to its `<Radio>` children via context — pass them as `children`\n * or, for the common case, via the data-driven `options` prop. Controlled (`value` + `onChange`) or\n * uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is a\n * `string`; validate with e.g. `z.string().min(1)`). `error` reddens the radio rings (no message text,\n * like `Checkbox`). `role=\"radiogroup\"`, named by its `label` (`aria-labelledby`); styling uses `--tz-*` tokens.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n label,\n value,\n defaultValue,\n onChange,\n name,\n options,\n orientation = 'vertical',\n size = 'md',\n color = 'accent',\n error,\n required = false,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n ref,\n) {\n // Auto-bind to a surrounding <Form> by `name` — the form value is the selected string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? (form!.values[name!] as string | undefined)\n : undefined\n const isControlled = externalValue !== undefined\n // the visible label names the group for assistive tech (an explicit aria-label/-labelledby wins)\n const labelId = useId()\n // without a `name` the inputs wouldn't form a native radio group (every option its own tab stop, no\n // arrow-key selection) — fall back to a generated one for the DOM only; `<Form>` binding still keys off `name`\n const fallbackName = useId()\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const currentValue = isControlled ? externalValue : internal\n\n const resolvedError = error ?? bound?.error ?? false\n\n const handleChange = (next: string) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const ctx: RadioGroupContextValue = {\n name: name ?? fallbackName,\n value: currentValue,\n onChange: handleChange,\n size,\n color,\n disabled,\n error: resolvedError,\n }\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label != null && props['aria-label'] == null ? labelId : undefined}\n aria-invalid={resolvedError || undefined}\n className={clsx(styles.group, className)}\n style={style as CSSProperties}\n {...props}\n >\n {label != null && (\n <span id={labelId} className={styles.groupLabel}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div className={clsx(styles.options, orientation === 'horizontal' && styles.horizontal)}>\n <RadioGroupContext.Provider value={ctx}>\n {options\n ? options.map((option) => (\n <Radio\n key={option.value}\n value={option.value}\n label={option.label}\n disabled={option.disabled}\n />\n ))\n : children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n )\n})\n"],"names":["RadioGroupContext","createContext","useRadioGroupContext","useContext","Radio","forwardRef","value","label","color","size","error","checked","onChange","name","disabled","idProp","className","style","props","ref","reactId","useId","id","group","resolvedColor","resolvedSize","resolvedError","resolvedDisabled","resolvedName","internal","setInternal","useState","isChecked","handleChange","event","jsx","clsx","styles","jsxs","RadioGroup","defaultValue","options","orientation","required","children","form","useFormContext","isFormBound","bound","externalValue","isControlled","labelId","fallbackName","currentValue","ctx","next","Typography","option"],"mappings":";;;;;AAkBO,MAAMA,IAAoBC,EAA6C,IAAI;AAG3E,SAASC,IAAsD;AACpE,SAAOC,EAAWH,CAAiB;AACrC;;;;;;;;;;;;;;;;;;GCoBaI,KAAQC,EAAyC,SAC5D;AAAA,EACE,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAIC;AAAA,EACJ,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GA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AO0C,CAAI,GAC3C3C,KAAA,QAAAA,EAAW2C;AAAA,IACb;AAAA,IAME,MAAA9C;AAAA,IACA,OAAAD;AAAA,IACA,UAAAM;AAAA,IACA,OAAOY;AAAA,EAAA;AAGT,SACE,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAnB;AAAA,MACA,MAAK;AAAA,MACL,mBAAiBZ,KAAS,QAAQW,EAAM,YAAY,KAAK,OAAOiC,IAAU;AAAA,MAC1E,gBAAczB,KAAiB;AAAA,MAC/B,WAAWU,EAAKC,EAAO,OAAOrB,CAAS;AAAA,MACvC,OAAAC;AAAA,MACC,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAX,KAAS,QACR,gBAAA+B,EAAC,QAAA,EAAK,IAAIa,GAAS,WAAWd,EAAO,YACnC,UAAA;AAAA,UAAA,gBAAAF,EAACqB,KAAW,IAAG,QAAO,SAAQ,aAAY,OAAM,SAC7C,UAAAjD,EAAA,CACH;AAAA,UACCoC,uBACE,QAAA,EAAK,WAAWN,EAAO,UAAU,eAAY,QAAO,UAAA,IAAA,CAErD;AAAA,QAAA,GAEJ;AAAA,QAGF,gBAAAF,EAAC,SAAI,WAAWC,EAAKC,EAAO,SAASK,MAAgB,gBAAgBL,EAAO,UAAU,GACpF,UAAA,gBAAAF,EAACnC,EAAkB,UAAlB,EAA2B,OAAOsD,GAChC,UAAAb,IACGA,EAAQ,IAAI,CAACgB,MACX,gBAAAtB;AAAA,UAAC/B;AAAA,UAAA;AAAA,YAEC,OAAOqD,EAAO;AAAA,YACd,OAAOA,EAAO;AAAA,YACd,UAAUA,EAAO;AAAA,UAAA;AAAA,UAHZA,EAAO;AAAA,QAAA,CAKf,IACDb,EAAA,CACN,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"RadioGroup-CD209tlb.js","sources":["../src/components/Radio/radioContext.ts","../src/components/Radio/Radio.tsx","../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ThemeColor } from '../../theme'\nimport type { RadioSize } from './Radio'\n\n/** Shared state a `<RadioGroup>` hands down to its `<Radio>` children via context. */\nexport interface RadioGroupContextValue {\n /** Shared input `name` (the radios in a group must share one). */\n name?: string\n /** The group's currently-selected value. */\n value?: string\n /** Select a value — called by a child `<Radio>` on change. */\n onChange: (value: string) => void\n size?: RadioSize\n color?: ThemeColor\n disabled?: boolean\n error?: boolean\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n\n/** Read the surrounding `<RadioGroup>` so a `<Radio>` can wire itself in (or `null` when standalone). */\nexport function useRadioGroupContext(): RadioGroupContextValue | null {\n return useContext(RadioGroupContext)\n}\n","import {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { useRadioGroupContext } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioSize = 'sm' | 'md' | 'lg'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'color' | 'type' | 'onChange' | 'value'\n> {\n /** This option's value — selected when it matches the surrounding `RadioGroup`'s value. */\n value: string\n /** Text shown to the right of the control. */\n label?: ReactNode\n /** Theme palette token for the selected fill. Defaults to `accent` (inherits the group's `color`). */\n color?: ThemeColor\n /** Preset size — circle dimensions and label font. Inherits the group's `size` when omitted. */\n size?: RadioSize\n /** Marks the control invalid — reddens the ring. Inherits the group's `error`. */\n error?: boolean\n /** Controlled selected state for standalone use (inside a `RadioGroup` the group drives this). */\n checked?: boolean\n /** Fires with the next selected state (standalone use). */\n onChange?: (checked: boolean) => void\n}\n\n/**\n * A single radio button with a label. The native `<input type=\"radio\">` is visually hidden but fully\n * accessible; a styled circle shows the state, filling with `color` and an inner dot when selected.\n * Designed to live inside a `<RadioGroup>` (which supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` via context), but also works standalone (`checked` + `onChange`).\n * Styling uses `--tz-*` tokens only.\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n label,\n color,\n size,\n error,\n checked,\n onChange,\n name,\n disabled,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const reactId = useId()\n const id = idProp ?? reactId\n const group = useRadioGroupContext()\n\n const resolvedColor = color ?? group?.color ?? 'accent'\n const resolvedSize = size ?? group?.size ?? 'md'\n const resolvedError = error ?? group?.error ?? false\n const resolvedDisabled = disabled ?? group?.disabled ?? false\n const resolvedName = name ?? group?.name\n\n // In a group the selection comes from context; standalone it's controlled (`checked`) or local.\n const [internal, setInternal] = useState(false)\n const isChecked = group ? group.value === value : checked !== undefined ? checked : internal\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (group) {\n group.onChange(value)\n return\n }\n if (checked === undefined) setInternal(event.target.checked)\n onChange?.(event.target.checked)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n resolvedError && styles.error,\n resolvedDisabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`, ...style } as CSSProperties}\n >\n <label className={clsx(styles.row, styles[resolvedSize])}>\n <input\n ref={ref}\n id={id}\n name={resolvedName}\n type=\"radio\"\n className={styles.input}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n disabled={resolvedDisabled}\n aria-invalid={resolvedError || undefined}\n {...props}\n />\n <span className={styles.circle} aria-hidden=\"true\">\n <span className={styles.dot} />\n </span>\n {label != null && <span className={styles.label}>{label}</span>}\n </label>\n </div>\n )\n})\n","import {\n forwardRef,\n useId,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport { Radio, type RadioSize } from './Radio'\nimport { RadioGroupContext, type RadioGroupContextValue } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioOrientation = 'vertical' | 'horizontal'\n\n/** A single option for the data-driven `options` prop. */\nexport interface RadioOption {\n value: string\n label?: ReactNode\n disabled?: boolean\n}\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** Group label rendered above the options. */\n label?: ReactNode\n /** Controlled selected value. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the newly-selected value. */\n onChange?: (value: string) => void\n /** Shared input `name` for the radios (also the `<Form>` binding key). */\n name?: string\n /** Data-driven options — an alternative to passing `<Radio>` children. */\n options?: RadioOption[]\n /** Stack direction of the options. Defaults to `vertical`. */\n orientation?: RadioOrientation\n /** Preset size for every radio. Defaults to `md`. */\n size?: RadioSize\n /** Theme palette token for the selected fill. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the group invalid — reddens the radio rings (no message text, like `Checkbox`). */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every radio in the group. */\n disabled?: boolean\n /** `<Radio>` children (used when `options` is not given). */\n children?: ReactNode\n}\n\n/**\n * Groups radio buttons so exactly one is selected. Supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` to its `<Radio>` children via context — pass them as `children`\n * or, for the common case, via the data-driven `options` prop. Controlled (`value` + `onChange`) or\n * uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is a\n * `string`; validate with e.g. `z.string().min(1)`). `error` reddens the radio rings (no message text,\n * like `Checkbox`). `role=\"radiogroup\"`, named by its `label` (`aria-labelledby`); styling uses `--tz-*` tokens.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n label,\n value,\n defaultValue,\n onChange,\n name,\n options,\n orientation = 'vertical',\n size = 'md',\n color = 'accent',\n error,\n required = false,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n ref,\n) {\n // Auto-bind to a surrounding <Form> by `name` — the form value is the selected string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? (form!.values[name!] as string | undefined)\n : undefined\n const isControlled = externalValue !== undefined\n // the visible label names the group for assistive tech (an explicit aria-label/-labelledby wins)\n const labelId = useId()\n // without a `name` the inputs wouldn't form a native radio group (every option its own tab stop, no\n // arrow-key selection) — fall back to a generated one for the DOM only; `<Form>` binding still keys off `name`\n const fallbackName = useId()\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const currentValue = isControlled ? externalValue : internal\n\n const resolvedError = error ?? bound?.error ?? false\n\n const handleChange = (next: string) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const ctx: RadioGroupContextValue = {\n name: name ?? fallbackName,\n value: currentValue,\n onChange: handleChange,\n size,\n color,\n disabled,\n error: resolvedError,\n }\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label != null && props['aria-label'] == null ? labelId : undefined}\n aria-invalid={resolvedError || undefined}\n className={clsx(styles.group, className)}\n style={style as CSSProperties}\n {...props}\n >\n {label != null && (\n <span id={labelId} className={styles.groupLabel}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div className={clsx(styles.options, orientation === 'horizontal' && styles.horizontal)}>\n <RadioGroupContext.Provider value={ctx}>\n {options\n ? options.map((option) => (\n <Radio\n key={option.value}\n value={option.value}\n label={option.label}\n disabled={option.disabled}\n />\n ))\n : children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n )\n})\n"],"names":["RadioGroupContext","createContext","useRadioGroupContext","useContext","Radio","forwardRef","value","label","color","size","error","checked","onChange","name","disabled","idProp","className","style","props","ref","reactId","useId","id","group","resolvedColor","resolvedSize","resolvedError","resolvedDisabled","resolvedName","internal","setInternal","useState","isChecked","handleChange","event","jsx","clsx","styles","jsxs","RadioGroup","defaultValue","options","orientation","required","children","form","useFormContext","isFormBound","bound","externalValue","isControlled","labelId","fallbackName","currentValue","ctx","next","Typography","option"],"mappings":";;;;;AAkBO,MAAMA,IAAoBC,EAA6C,IAAI;AAG3E,SAASC,IAAsD;AACpE,SAAOC,EAAWH,CAAiB;AACrC;;;;;;;;;;;;;;;;;;GCoBaI,KAAQC,EAAyC,SAC5D;AAAA,EACE,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAIC;AAAA,EACJ,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAUC,EAAA,GACVC,IAAKP,KAAUK,GACfG,IAAQrB,EAAA,GAERsB,IAAgBhB,MAASe,KAAA,gBAAAA,EAAO,UAAS,UACzCE,IAAehB,MAAQc,KAAA,gBAAAA,EAAO,SAAQ,MACtCG,IAAgBhB,MAASa,KAAA,gBAAAA,EAAO,UAAS,IACzCI,IAAmBb,MAAYS,KAAA,gBAAAA,EAAO,aAAY,IAClDK,IAAef,MAAQU,KAAA,gBAAAA,EAAO,OAG9B,CAACM,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxCC,IAAYT,IAAQA,EAAM,UAAUjB,IAAQK,MAAY,SAAYA,IAAUkB,GAE9EI,IAAe,CAACC,MAAyC;AAC7D,QAAIX,GAAO;AACT,MAAAA,EAAM,SAASjB,CAAK;AACpB;AAAA,IACF;AACA,IAAIK,MAAY,UAAWmB,EAAYI,EAAM,OAAO,OAAO,GAC3DtB,KAAA,QAAAA,EAAWsB,EAAM,OAAO;AAAA,EAC1B;AAEA,SACE,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eAAY,QAAO,UAAA,IAAA,CAErD;AAAA,QAAA,GAEJ;AAAA,QAGF,gBAAAF,EAAC,SAAI,WAAWC,EAAKC,EAAO,SAASK,MAAgB,gBAAgBL,EAAO,UAAU,GACpF,UAAA,gBAAAF,EAACnC,EAAkB,UAAlB,EAA2B,OAAOsD,GAChC,UAAAb,IACGA,EAAQ,IAAI,CAACgB,MACX,gBAAAtB;AAAA,UAAC/B;AAAA,UAAA;AAAA,YAEC,OAAOqD,EAAO;AAAA,YACd,OAAOA,EAAO;AAAA,YACd,UAAUA,EAAO;AAAA,UAAA;AAAA,UAHZA,EAAO;AAAA,QAAA,CAKf,IACDb,EAAA,CACN,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,13 +1,13 @@
1
1
  import { jsx as o, jsxs as l, Fragment as T } from "react/jsx-runtime";
2
2
  import { forwardRef as I, useState as _, useRef as R, useId as E } from "react";
3
3
  import { B as O } from "./Blockquote-Ma-2naET.js";
4
- import { B as v } from "./Button-PBZnkRNn.js";
4
+ import { B as v } from "./Button-BQ7jsm5P.js";
5
5
  import { C as S } from "./Code-DaEpXHfF.js";
6
6
  import { I as B } from "./Icon-CGQ5yGSZ.js";
7
- import { M as j } from "./Modal-Do8pzyMl.js";
8
- import { T as F } from "./TextField-LONfx4jy.js";
9
- import { T as L } from "./Typography-CJv5AnRP.js";
10
- import { a as k } from "./ConfigProvider-tvLbKiqu.js";
7
+ import { M as j } from "./Modal-CrvOHbNy.js";
8
+ import { T as F } from "./TextField-otYGVuwF.js";
9
+ import { T as L } from "./Typography-ChSuxgkc.js";
10
+ import { a as k } from "./ConfigProvider-DZMtq2Fz.js";
11
11
  const M = "_modalBody_1nqut_5", K = "_body_1nqut_4", P = "_iconBox_1nqut_20", A = "_confirm_1nqut_37", G = "_phrase_1nqut_45", a = {
12
12
  modalBody: M,
13
13
  body: K,
@@ -106,4 +106,4 @@ function H({ text: u }) {
106
106
  export {
107
107
  eo as R
108
108
  };
109
- //# sourceMappingURL=RemoveDialog-DH3eNUxC.js.map
109
+ //# sourceMappingURL=RemoveDialog-BKgWohkG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveDialog-DH3eNUxC.js","sources":["../src/components/RemoveDialog/RemoveDialog.tsx"],"sourcesContent":["import { forwardRef, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { Blockquote } from '../Blockquote'\nimport { Button } from '../Button'\nimport { Code } from '../Code'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport { TextField } from '../TextField'\nimport { Typography } from '../Typography'\nimport styles from './RemoveDialog.module.css'\n\nexport interface RemoveDialogProps {\n /** Whether the dialog is open. */\n open: boolean\n /** Called on Cancel, the × button, backdrop, or Escape (ignored while a confirm is in flight). */\n onClose: () => void\n /**\n * The destructive action. May be async — while its promise is pending the Delete button shows a\n * loader and the dialog locks (no dismiss); on success the dialog **auto-closes**, on rejection it\n * stays open so the user can retry (surface the error yourself, e.g. a toast).\n */\n onConfirm: () => void | Promise<void>\n /** Header title. Defaults to `\"Remove\"`. */\n title?: ReactNode\n /** Body prompt shown under the icon. Defaults to `\"Are you sure you want to delete?\"`. */\n message?: ReactNode\n /** Confirm (destructive) button label. Defaults to `\"Delete\"`. */\n confirmLabel?: string\n /** Cancel button label. Defaults to `\"Cancel\"`. */\n cancelLabel?: string\n /** External loading override — combined with the internal async-confirm state. */\n loading?: boolean\n /**\n * **Type-to-confirm** for high-risk deletes: the user must type this exact text (e.g. `\"remove user\"`)\n * into a field before Delete enables. Case-sensitive; surrounding whitespace is ignored. The field is\n * focused on open, cleared on every open, and Enter confirms once it matches.\n */\n confirmText?: string\n}\n\n/**\n * A ready-made delete confirmation — a thin convenience wrapper over `Modal` for the ubiquitous\n * \"Are you sure you want to delete?\" prompt. Hardcodes the destructive flavor (a `Trash` glyph in a\n * soft error circle + an `error` Delete button); just wire `open` / `onClose` / `onConfirm`. An async\n * `onConfirm` drives the button loader and locks dismissal, then auto-closes on success. `confirmText`\n * adds **type-to-confirm**: Delete stays disabled until the user types that exact text. Built on\n * `Modal`, so it inherits the portal, scroll-lock, focus-trap, and backdrop/Escape dismissal.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <RemoveDialog open={isOpen} onClose={close} onConfirm={() => deleteItem(id)} />\n */\nexport const RemoveDialog = forwardRef<HTMLDivElement, RemoveDialogProps>(function RemoveDialog(\n {\n open,\n onClose,\n onConfirm,\n title,\n message,\n confirmLabel,\n cancelLabel,\n loading = false,\n confirmText,\n },\n ref,\n) {\n const t = useT()\n const [submitting, setSubmitting] = useState(false)\n const busy = loading || submitting\n\n // type-to-confirm — cleared every time the dialog opens (\"adjust state on prop change\", no effect)\n const [typed, setTyped] = useState('')\n const wasOpen = useRef(open)\n if (wasOpen.current !== open) {\n wasOpen.current = open\n if (open) setTyped('')\n }\n const matches = confirmText == null || typed.trim() === confirmText.trim()\n const promptId = useId()\n\n // dismissal is blocked while the confirm is running (so the delete can't be abandoned mid-flight)\n const handleClose = () => {\n if (!busy) onClose()\n }\n\n const handleConfirm = async () => {\n if (!matches || busy) return\n try {\n setSubmitting(true)\n await onConfirm()\n onClose() // auto-close on success\n } catch {\n // keep the dialog open on failure so the user can retry; the consumer surfaces the error\n } finally {\n setSubmitting(false)\n }\n }\n\n return (\n <Modal\n ref={ref}\n open={open}\n onClose={handleClose}\n size=\"sm\"\n bodyClassName={styles.modalBody}\n title={title ?? t('removeDialog.title')}\n showCloseButton={!busy}\n closeOnBackdrop={!busy}\n closeOnEscape={!busy}\n footer={\n <>\n <Button variant=\"text\" size=\"sm\" onClick={handleClose} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button\n color=\"error\"\n variant=\"filled\"\n size=\"sm\"\n onClick={handleConfirm}\n loading={busy}\n disabled={!matches}\n >\n {confirmLabel ?? t('common.delete')}\n </Button>\n </>\n }\n >\n <div className={styles.body}>\n <div className={styles.iconBox} aria-hidden>\n <Icon name=\"Trash\" />\n </div>\n <Typography align=\"center\">{message ?? t('removeDialog.message')}</Typography>\n {confirmText != null && (\n <div className={styles.confirm}>\n {/* the instruction, as an error-tinted quote — it also names the field (aria-labelledby) */}\n <Blockquote id={promptId} size=\"sm\" color=\"error\">\n <TypeToConfirmLabel text={confirmText} />\n </Blockquote>\n <TextField\n aria-labelledby={promptId}\n placeholder={confirmText}\n value={typed}\n onChange={(event) => setTyped(event.target.value)}\n onKeyDown={(event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n void handleConfirm()\n }\n }}\n // a green tick once the phrase matches — the field confirms itself before Delete does\n adornment={typed && matches ? <Icon name=\"TickCircle\" color=\"success\" /> : undefined}\n adornmentPosition=\"right\"\n disabled={busy}\n size=\"sm\"\n autoComplete=\"off\"\n autoCapitalize=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n />\n </div>\n )}\n </div>\n </Modal>\n )\n})\n\n/** \"Type {text} to confirm\" with the text set as inline `Code`, so the exact phrase stands out. */\nfunction TypeToConfirmLabel({ text }: { text: string }) {\n const t = useT()\n // translate with a sentinel in place of {text}, then split around it to slot the Code element in\n const SENTINEL = '\\u0000'\n const [before, after = ''] = t('removeDialog.typeToConfirm', { text: SENTINEL }).split(SENTINEL)\n return (\n <>\n {before}\n <Code size=\"sm\" color=\"error\" className={styles.phrase}>\n {text}\n </Code>\n {after}\n </>\n )\n}\n"],"names":["RemoveDialog","forwardRef","open","onClose","onConfirm","title","message","confirmLabel","cancelLabel","loading","confirmText","ref","t","useT","submitting","setSubmitting","useState","busy","typed","setTyped","wasOpen","useRef","matches","promptId","useId","handleClose","handleConfirm","jsx","Modal","styles","jsxs","Fragment","Button","Icon","Typography","Blockquote","TypeToConfirmLabel","TextField","event","text","SENTINEL","before","after","Code"],"mappings":";;;;;;;;;;;;;;;;GAoDaA,KAAeC,EAA8C,SACxE;AAAA,EACE,MAAAC;AAAA,EACA,SAAAC;AAAA,EAC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AAC;AAGD,SAASmB,EAAmB,EAAE,MAAAG,KAA0B;AACtD,QAAM,IAAI1B,EAAA,GAEJ2B,IAAW,MACX,CAACC,GAAQC,IAAQ,EAAE,IAAI,EAAE,8BAA8B,EAAE,MAAMF,EAAA,CAAU,EAAE,MAAMA,CAAQ;AAC/F,SACE,gBAAAV,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAU;AAAA,IACD,gBAAAd,EAACgB,KAAK,MAAK,MAAK,OAAM,SAAQ,WAAWd,EAAO,QAC7C,UAAAU,EAAA,CACH;AAAA,IACCG;AAAA,EAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"RemoveDialog-BKgWohkG.js","sources":["../src/components/RemoveDialog/RemoveDialog.tsx"],"sourcesContent":["import { forwardRef, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'\nimport { useT } from '../../theme'\nimport { Blockquote } from '../Blockquote'\nimport { Button } from '../Button'\nimport { Code } from '../Code'\nimport { Icon } from '../Icon'\nimport { Modal } from '../Modal'\nimport { TextField } from '../TextField'\nimport { Typography } from '../Typography'\nimport styles from './RemoveDialog.module.css'\n\nexport interface RemoveDialogProps {\n /** Whether the dialog is open. */\n open: boolean\n /** Called on Cancel, the × button, backdrop, or Escape (ignored while a confirm is in flight). */\n onClose: () => void\n /**\n * The destructive action. May be async — while its promise is pending the Delete button shows a\n * loader and the dialog locks (no dismiss); on success the dialog **auto-closes**, on rejection it\n * stays open so the user can retry (surface the error yourself, e.g. a toast).\n */\n onConfirm: () => void | Promise<void>\n /** Header title. Defaults to `\"Remove\"`. */\n title?: ReactNode\n /** Body prompt shown under the icon. Defaults to `\"Are you sure you want to delete?\"`. */\n message?: ReactNode\n /** Confirm (destructive) button label. Defaults to `\"Delete\"`. */\n confirmLabel?: string\n /** Cancel button label. Defaults to `\"Cancel\"`. */\n cancelLabel?: string\n /** External loading override — combined with the internal async-confirm state. */\n loading?: boolean\n /**\n * **Type-to-confirm** for high-risk deletes: the user must type this exact text (e.g. `\"remove user\"`)\n * into a field before Delete enables. Case-sensitive; surrounding whitespace is ignored. The field is\n * focused on open, cleared on every open, and Enter confirms once it matches.\n */\n confirmText?: string\n}\n\n/**\n * A ready-made delete confirmation — a thin convenience wrapper over `Modal` for the ubiquitous\n * \"Are you sure you want to delete?\" prompt. Hardcodes the destructive flavor (a `Trash` glyph in a\n * soft error circle + an `error` Delete button); just wire `open` / `onClose` / `onConfirm`. An async\n * `onConfirm` drives the button loader and locks dismissal, then auto-closes on success. `confirmText`\n * adds **type-to-confirm**: Delete stays disabled until the user types that exact text. Built on\n * `Modal`, so it inherits the portal, scroll-lock, focus-trap, and backdrop/Escape dismissal.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <RemoveDialog open={isOpen} onClose={close} onConfirm={() => deleteItem(id)} />\n */\nexport const RemoveDialog = forwardRef<HTMLDivElement, RemoveDialogProps>(function RemoveDialog(\n {\n open,\n onClose,\n onConfirm,\n title,\n message,\n confirmLabel,\n cancelLabel,\n loading = false,\n confirmText,\n },\n ref,\n) {\n const t = useT()\n const [submitting, setSubmitting] = useState(false)\n const busy = loading || submitting\n\n // type-to-confirm — cleared every time the dialog opens (\"adjust state on prop change\", no effect)\n const [typed, setTyped] = useState('')\n const wasOpen = useRef(open)\n if (wasOpen.current !== open) {\n wasOpen.current = open\n if (open) setTyped('')\n }\n const matches = confirmText == null || typed.trim() === confirmText.trim()\n const promptId = useId()\n\n // dismissal is blocked while the confirm is running (so the delete can't be abandoned mid-flight)\n const handleClose = () => {\n if (!busy) onClose()\n }\n\n const handleConfirm = async () => {\n if (!matches || busy) return\n try {\n setSubmitting(true)\n await onConfirm()\n onClose() // auto-close on success\n } catch {\n // keep the dialog open on failure so the user can retry; the consumer surfaces the error\n } finally {\n setSubmitting(false)\n }\n }\n\n return (\n <Modal\n ref={ref}\n open={open}\n onClose={handleClose}\n size=\"sm\"\n bodyClassName={styles.modalBody}\n title={title ?? t('removeDialog.title')}\n showCloseButton={!busy}\n closeOnBackdrop={!busy}\n closeOnEscape={!busy}\n footer={\n <>\n <Button variant=\"text\" size=\"sm\" onClick={handleClose} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button\n color=\"error\"\n variant=\"filled\"\n size=\"sm\"\n onClick={handleConfirm}\n loading={busy}\n disabled={!matches}\n >\n {confirmLabel ?? t('common.delete')}\n </Button>\n </>\n }\n >\n <div className={styles.body}>\n <div className={styles.iconBox} aria-hidden>\n <Icon name=\"Trash\" />\n </div>\n <Typography align=\"center\">{message ?? t('removeDialog.message')}</Typography>\n {confirmText != null && (\n <div className={styles.confirm}>\n {/* the instruction, as an error-tinted quote — it also names the field (aria-labelledby) */}\n <Blockquote id={promptId} size=\"sm\" color=\"error\">\n <TypeToConfirmLabel text={confirmText} />\n </Blockquote>\n <TextField\n aria-labelledby={promptId}\n placeholder={confirmText}\n value={typed}\n onChange={(event) => setTyped(event.target.value)}\n onKeyDown={(event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n void handleConfirm()\n }\n }}\n // a green tick once the phrase matches — the field confirms itself before Delete does\n adornment={typed && matches ? <Icon name=\"TickCircle\" color=\"success\" /> : undefined}\n adornmentPosition=\"right\"\n disabled={busy}\n size=\"sm\"\n autoComplete=\"off\"\n autoCapitalize=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n />\n </div>\n )}\n </div>\n </Modal>\n )\n})\n\n/** \"Type {text} to confirm\" with the text set as inline `Code`, so the exact phrase stands out. */\nfunction TypeToConfirmLabel({ text }: { text: string }) {\n const t = useT()\n // translate with a sentinel in place of {text}, then split around it to slot the Code element in\n const SENTINEL = '\\u0000'\n const [before, after = ''] = t('removeDialog.typeToConfirm', { text: SENTINEL }).split(SENTINEL)\n return (\n <>\n {before}\n <Code size=\"sm\" color=\"error\" className={styles.phrase}>\n {text}\n </Code>\n {after}\n </>\n )\n}\n"],"names":["RemoveDialog","forwardRef","open","onClose","onConfirm","title","message","confirmLabel","cancelLabel","loading","confirmText","ref","t","useT","submitting","setSubmitting","useState","busy","typed","setTyped","wasOpen","useRef","matches","promptId","useId","handleClose","handleConfirm","jsx","Modal","styles","jsxs","Fragment","Button","Icon","Typography","Blockquote","TypeToConfirmLabel","TextField","event","text","SENTINEL","before","after","Code"],"mappings":";;;;;;;;;;;;;;;;GAoDaA,KAAeC,EAA8C,SACxE;AAAA,EACE,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,aAAAC;AACF,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJ,CAACC,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAC5CC,IAAOR,KAAWK,GAGlB,CAACI,GAAOC,CAAQ,IAAIH,EAAS,EAAE,GAC/BI,IAAUC,EAAOnB,CAAI;AAC3B,EAAIkB,EAAQ,YAAYlB,MACtBkB,EAAQ,UAAUlB,GACdA,OAAe,EAAE;AAEvB,QAAMoB,IAAUZ,KAAe,QAAQQ,EAAM,KAAA,MAAWR,EAAY,KAAA,GAC9Da,IAAWC,EAAA,GAGXC,IAAc,MAAM;AACxB,IAAKR,KAAMd,EAAA;AAAA,EACb,GAEMuB,IAAgB,YAAY;AAChC,QAAI,GAACJ,KAAWL;AAChB,UAAI;AACF,QAAAF,EAAc,EAAI,GAClB,MAAMX,EAAA,GACND,EAAA;AAAA,MACF,QAAQ;AAAA,MAER,UAAA;AACE,QAAAY,EAAc,EAAK;AAAA,MACrB;AAAA,EACF;AAEA,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAjB;AAAA,MACA,MAAAT;AAAA,MACA,SAASuB;AAAA,MACT,MAAK;AAAA,MACL,eAAeI,EAAO;AAAA,MACtB,OAAOxB,KAASO,EAAE,oBAAoB;AAAA,MACtC,iBAAiB,CAACK;AAAA,MAClB,iBAAiB,CAACA;AA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K,MAAK,cAAa,OAAM,UAAA,CAAU,IAAK;AAAA,cAC3E,mBAAkB;AAAA,cAClB,UAAUhB;AAAA,cACV,MAAK;AAAA,cACL,cAAa;AAAA,cACb,gBAAe;AAAA,cACf,aAAY;AAAA,cACZ,YAAY;AAAA,YAAA;AAAA,UAAA;AAAA,QACd,EAAA,CACF;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAGD,SAASmB,EAAmB,EAAE,MAAAG,KAA0B;AACtD,QAAM,IAAI1B,EAAA,GAEJ2B,IAAW,MACX,CAACC,GAAQC,IAAQ,EAAE,IAAI,EAAE,8BAA8B,EAAE,MAAMF,EAAA,CAAU,EAAE,MAAMA,CAAQ;AAC/F,SACE,gBAAAV,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAU;AAAA,IACD,gBAAAd,EAACgB,KAAK,MAAK,MAAK,OAAM,SAAQ,WAAWd,EAAO,QAC7C,UAAAU,EAAA,CACH;AAAA,IACCG;AAAA,EAAA,GACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),r=require("react"),z=require("./Blockquote-BWGxIL_V.cjs"),C=require("./Button-BD5wpg-t.cjs"),N=require("./Code-CUdpWlY5.cjs"),j=require("./Icon-BUP5_kRs.cjs"),I=require("./Modal-BL_XihC8.cjs"),R=require("./TextField-CgPfN-4d.cjs"),w=require("./Typography-B6ASPrzT.cjs"),v=require("./ConfigProvider-CVLHPXQm.cjs"),E="_modalBody_1nqut_5",F="_body_1nqut_4",S="_iconBox_1nqut_20",O="_confirm_1nqut_37",L="_phrase_1nqut_45",i={modalBody:E,body:F,iconBox:S,confirm:O,phrase:L},M=r.forwardRef(function({open:s,onClose:t,onConfirm:l,title:d,message:b,confirmLabel:B,cancelLabel:_,loading:T=!1,confirmText:n},k){const c=v.useT(),[D,h]=r.useState(!1),o=T||D,[u,y]=r.useState(""),x=r.useRef(s);x.current!==s&&(x.current=s,s&&y(""));const m=n==null||u.trim()===n.trim(),g=r.useId(),p=()=>{o||t()},q=async()=>{if(!(!m||o))try{h(!0),await l(),t()}catch{}finally{h(!1)}};return e.jsx(I.Modal,{ref:k,open:s,onClose:p,size:"sm",bodyClassName:i.modalBody,title:d??c("removeDialog.title"),showCloseButton:!o,closeOnBackdrop:!o,closeOnEscape:!o,footer:e.jsxs(e.Fragment,{children:[e.jsx(C.Button,{variant:"text",size:"sm",onClick:p,disabled:o,children:_??c("common.cancel")}),e.jsx(C.Button,{color:"error",variant:"filled",size:"sm",onClick:q,loading:o,disabled:!m,children:B??c("common.delete")})]}),children:e.jsxs("div",{className:i.body,children:[e.jsx("div",{className:i.iconBox,"aria-hidden":!0,children:e.jsx(j.Icon,{name:"Trash"})}),e.jsx(w.Typography,{align:"center",children:b??c("removeDialog.message")}),n!=null&&e.jsxs("div",{className:i.confirm,children:[e.jsx(z.Blockquote,{id:g,size:"sm",color:"error",children:e.jsx(P,{text:n})}),e.jsx(R.TextField,{"aria-labelledby":g,placeholder:n,value:u,onChange:a=>y(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),q())},adornment:u&&m?e.jsx(j.Icon,{name:"TickCircle",color:"success"}):void 0,adornmentPosition:"right",disabled:o,size:"sm",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1})]})]})})});function P({text:f}){const s=v.useT(),t="\0",[l,d=""]=s("removeDialog.typeToConfirm",{text:t}).split(t);return e.jsxs(e.Fragment,{children:[l,e.jsx(N.Code,{size:"sm",color:"error",className:i.phrase,children:f}),d]})}exports.RemoveDialog=M;
2
- //# sourceMappingURL=RemoveDialog-FrieNcjL.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),r=require("react"),z=require("./Blockquote-BWGxIL_V.cjs"),C=require("./Button-Cm64ROip.cjs"),N=require("./Code-CUdpWlY5.cjs"),j=require("./Icon-BUP5_kRs.cjs"),I=require("./Modal-eI6QL-LM.cjs"),R=require("./TextField-D49Lpbjt.cjs"),w=require("./Typography-d97DdbNd.cjs"),v=require("./ConfigProvider-th4GYhcU.cjs"),E="_modalBody_1nqut_5",F="_body_1nqut_4",S="_iconBox_1nqut_20",O="_confirm_1nqut_37",L="_phrase_1nqut_45",i={modalBody:E,body:F,iconBox:S,confirm:O,phrase:L},M=r.forwardRef(function({open:s,onClose:t,onConfirm:l,title:d,message:b,confirmLabel:B,cancelLabel:_,loading:T=!1,confirmText:n},k){const c=v.useT(),[D,h]=r.useState(!1),o=T||D,[u,y]=r.useState(""),x=r.useRef(s);x.current!==s&&(x.current=s,s&&y(""));const m=n==null||u.trim()===n.trim(),g=r.useId(),p=()=>{o||t()},q=async()=>{if(!(!m||o))try{h(!0),await l(),t()}catch{}finally{h(!1)}};return e.jsx(I.Modal,{ref:k,open:s,onClose:p,size:"sm",bodyClassName:i.modalBody,title:d??c("removeDialog.title"),showCloseButton:!o,closeOnBackdrop:!o,closeOnEscape:!o,footer:e.jsxs(e.Fragment,{children:[e.jsx(C.Button,{variant:"text",size:"sm",onClick:p,disabled:o,children:_??c("common.cancel")}),e.jsx(C.Button,{color:"error",variant:"filled",size:"sm",onClick:q,loading:o,disabled:!m,children:B??c("common.delete")})]}),children:e.jsxs("div",{className:i.body,children:[e.jsx("div",{className:i.iconBox,"aria-hidden":!0,children:e.jsx(j.Icon,{name:"Trash"})}),e.jsx(w.Typography,{align:"center",children:b??c("removeDialog.message")}),n!=null&&e.jsxs("div",{className:i.confirm,children:[e.jsx(z.Blockquote,{id:g,size:"sm",color:"error",children:e.jsx(P,{text:n})}),e.jsx(R.TextField,{"aria-labelledby":g,placeholder:n,value:u,onChange:a=>y(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),q())},adornment:u&&m?e.jsx(j.Icon,{name:"TickCircle",color:"success"}):void 0,adornmentPosition:"right",disabled:o,size:"sm",autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1})]})]})})});function P({text:f}){const s=v.useT(),t="\0",[l,d=""]=s("removeDialog.typeToConfirm",{text:t}).split(t);return e.jsxs(e.Fragment,{children:[l,e.jsx(N.Code,{size:"sm",color:"error",className:i.phrase,children:f}),d]})}exports.RemoveDialog=M;
2
+ //# sourceMappingURL=RemoveDialog-eGCbOuuM.cjs.map