@techzyapp/ui-library 1.0.49 → 1.0.50

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 (468) hide show
  1. package/dist/{Accordion-DOrTQJB9.js → Accordion-C6vW_OMd.js} +2 -2
  2. package/dist/{Accordion-DOrTQJB9.js.map → Accordion-C6vW_OMd.js.map} +1 -1
  3. package/dist/{Accordion-CFyeLfPT.cjs → Accordion-Icvl9S8c.cjs} +2 -2
  4. package/dist/{Accordion-CFyeLfPT.cjs.map → Accordion-Icvl9S8c.cjs.map} +1 -1
  5. package/dist/{AdminRoot-DYM9r25r.js → AdminRoot-C5l8PIyi.js} +9 -9
  6. package/dist/{AdminRoot-DYM9r25r.js.map → AdminRoot-C5l8PIyi.js.map} +1 -1
  7. package/dist/{AdminRoot-CGf-Q8Hs.cjs → AdminRoot-MEfy9xtz.cjs} +2 -2
  8. package/dist/{AdminRoot-CGf-Q8Hs.cjs.map → AdminRoot-MEfy9xtz.cjs.map} +1 -1
  9. package/dist/{Alert-QvfNBhlU.cjs → Alert--ZnlCjaL.cjs} +2 -2
  10. package/dist/{Alert-QvfNBhlU.cjs.map → Alert--ZnlCjaL.cjs.map} +1 -1
  11. package/dist/{Alert-Bo_XgY-A.js → Alert-BVs-GcZQ.js} +4 -4
  12. package/dist/{Alert-Bo_XgY-A.js.map → Alert-BVs-GcZQ.js.map} +1 -1
  13. package/dist/{AuthGuard-C2eA3mJA.cjs → AuthGuard-Cm-tqCto.cjs} +2 -2
  14. package/dist/{AuthGuard-C2eA3mJA.cjs.map → AuthGuard-Cm-tqCto.cjs.map} +1 -1
  15. package/dist/{AuthGuard-Ck31lvBA.js → AuthGuard-DJ_mMwfg.js} +2 -2
  16. package/dist/{AuthGuard-Ck31lvBA.js.map → AuthGuard-DJ_mMwfg.js.map} +1 -1
  17. package/dist/{AuthLayout-BI1wLuDl.js → AuthLayout-BDRJFSpi.js} +2 -2
  18. package/dist/{AuthLayout-BI1wLuDl.js.map → AuthLayout-BDRJFSpi.js.map} +1 -1
  19. package/dist/{AuthLayout-Bzlsvicf.cjs → AuthLayout-D7mSMdM4.cjs} +2 -2
  20. package/dist/{AuthLayout-Bzlsvicf.cjs.map → AuthLayout-D7mSMdM4.cjs.map} +1 -1
  21. package/dist/{Avatar-BBqX1732.cjs → Avatar-BwGJl-ru.cjs} +2 -2
  22. package/dist/{Avatar-BBqX1732.cjs.map → Avatar-BwGJl-ru.cjs.map} +1 -1
  23. package/dist/{Avatar-CaYyv5wk.js → Avatar-C4qgzth2.js} +2 -2
  24. package/dist/{Avatar-CaYyv5wk.js.map → Avatar-C4qgzth2.js.map} +1 -1
  25. package/dist/{AvatarGroup-DrkzAt1-.cjs → AvatarGroup-B8u8ONs5.cjs} +2 -2
  26. package/dist/{AvatarGroup-DrkzAt1-.cjs.map → AvatarGroup-B8u8ONs5.cjs.map} +1 -1
  27. package/dist/{AvatarGroup-6fhm-van.js → AvatarGroup-BqxTFzRc.js} +2 -2
  28. package/dist/{AvatarGroup-6fhm-van.js.map → AvatarGroup-BqxTFzRc.js.map} +1 -1
  29. package/dist/{Breadcrumbs-CqGS32x5.cjs → Breadcrumbs-D4wv2-T7.cjs} +2 -2
  30. package/dist/{Breadcrumbs-CqGS32x5.cjs.map → Breadcrumbs-D4wv2-T7.cjs.map} +1 -1
  31. package/dist/{Breadcrumbs-BEv57tuJ.js → Breadcrumbs-HGk4DKrc.js} +4 -4
  32. package/dist/{Breadcrumbs-BEv57tuJ.js.map → Breadcrumbs-HGk4DKrc.js.map} +1 -1
  33. package/dist/{Button-DZWYeAno.js → Button-7mgXcRdw.js} +2 -2
  34. package/dist/{Button-DZWYeAno.js.map → Button-7mgXcRdw.js.map} +1 -1
  35. package/dist/{Button-BtiFpRie.cjs → Button-DAvQCGIw.cjs} +2 -2
  36. package/dist/{Button-BtiFpRie.cjs.map → Button-DAvQCGIw.cjs.map} +1 -1
  37. package/dist/{Calendar-7W9xNVBZ.js → Calendar-B1ZJHqjB.js} +4 -4
  38. package/dist/{Calendar-7W9xNVBZ.js.map → Calendar-B1ZJHqjB.js.map} +1 -1
  39. package/dist/{Calendar-Bgh_3Vk2.cjs → Calendar-BPYjqBy9.cjs} +2 -2
  40. package/dist/{Calendar-Bgh_3Vk2.cjs.map → Calendar-BPYjqBy9.cjs.map} +1 -1
  41. package/dist/{Card-KfmWG9Uz.cjs → Card-B-Qso__1.cjs} +2 -2
  42. package/dist/{Card-KfmWG9Uz.cjs.map → Card-B-Qso__1.cjs.map} +1 -1
  43. package/dist/{Card-ckOd617g.js → Card-vFsIhkyR.js} +4 -4
  44. package/dist/{Card-ckOd617g.js.map → Card-vFsIhkyR.js.map} +1 -1
  45. package/dist/{Chip-Crzm7Eux.js → Chip-CU0J7HJa.js} +3 -3
  46. package/dist/{Chip-Crzm7Eux.js.map → Chip-CU0J7HJa.js.map} +1 -1
  47. package/dist/{Chip-BDUsue_R.cjs → Chip-CovsonP1.cjs} +2 -2
  48. package/dist/{Chip-BDUsue_R.cjs.map → Chip-CovsonP1.cjs.map} +1 -1
  49. package/dist/{ChoiceCardGroup-D37XREKV.js → ChoiceCardGroup-BBqUbFLS.js} +2 -2
  50. package/dist/{ChoiceCardGroup-D37XREKV.js.map → ChoiceCardGroup-BBqUbFLS.js.map} +1 -1
  51. package/dist/{ChoiceCardGroup-Cj_YFj6C.cjs → ChoiceCardGroup-bnKFPDYz.cjs} +2 -2
  52. package/dist/{ChoiceCardGroup-Cj_YFj6C.cjs.map → ChoiceCardGroup-bnKFPDYz.cjs.map} +1 -1
  53. package/dist/{CodeBlock-rnGAu2DQ.cjs → CodeBlock-B404V_cc.cjs} +2 -2
  54. package/dist/{CodeBlock-rnGAu2DQ.cjs.map → CodeBlock-B404V_cc.cjs.map} +1 -1
  55. package/dist/{CodeBlock-CX8_dMPD.js → CodeBlock-DvJ45qEp.js} +4 -4
  56. package/dist/{CodeBlock-CX8_dMPD.js.map → CodeBlock-DvJ45qEp.js.map} +1 -1
  57. package/dist/{ColorPicker-CwLivdAt.js → ColorPicker-C4slmEZC.js} +3 -3
  58. package/dist/{ColorPicker-CwLivdAt.js.map → ColorPicker-C4slmEZC.js.map} +1 -1
  59. package/dist/{ColorPicker-BaAdcqR9.cjs → ColorPicker-_RBW51XB.cjs} +2 -2
  60. package/dist/{ColorPicker-BaAdcqR9.cjs.map → ColorPicker-_RBW51XB.cjs.map} +1 -1
  61. package/dist/{ColorPickerPanel-IOhJJF1R.cjs → ColorPickerPanel-CNspBZre.cjs} +2 -2
  62. package/dist/{ColorPickerPanel-IOhJJF1R.cjs.map → ColorPickerPanel-CNspBZre.cjs.map} +1 -1
  63. package/dist/{ColorPickerPanel-CkrSIf35.js → ColorPickerPanel-CQNfIbgc.js} +3 -3
  64. package/dist/{ColorPickerPanel-CkrSIf35.js.map → ColorPickerPanel-CQNfIbgc.js.map} +1 -1
  65. package/dist/{ColorRamp-DbFOsspz.js → ColorRamp-DQZZiE5I.js} +2 -2
  66. package/dist/{ColorRamp-DbFOsspz.js.map → ColorRamp-DQZZiE5I.js.map} +1 -1
  67. package/dist/{ColorRamp-BCy8a7ks.cjs → ColorRamp-DuO7gkru.cjs} +2 -2
  68. package/dist/{ColorRamp-BCy8a7ks.cjs.map → ColorRamp-DuO7gkru.cjs.map} +1 -1
  69. package/dist/{ConfigProvider-CYSpuSMJ.cjs → ConfigProvider-BFhkb0BV.cjs} +2 -2
  70. package/dist/{ConfigProvider-CYSpuSMJ.cjs.map → ConfigProvider-BFhkb0BV.cjs.map} +1 -1
  71. package/dist/{ConfigProvider-DtyUlWk6.js → ConfigProvider-bXX8dnhY.js} +2 -2
  72. package/dist/{ConfigProvider-DtyUlWk6.js.map → ConfigProvider-bXX8dnhY.js.map} +1 -1
  73. package/dist/{CopyButton-DUG5s3TM.cjs → CopyButton-B2V6guZ0.cjs} +2 -2
  74. package/dist/{CopyButton-DUG5s3TM.cjs.map → CopyButton-B2V6guZ0.cjs.map} +1 -1
  75. package/dist/{CopyButton-LURMuaYw.js → CopyButton-DfYAslz-.js} +4 -4
  76. package/dist/{CopyButton-LURMuaYw.js.map → CopyButton-DfYAslz-.js.map} +1 -1
  77. package/dist/{DashedButton-BX8hfY1x.cjs → DashedButton-CZ2hjLxT.cjs} +2 -2
  78. package/dist/{DashedButton-BX8hfY1x.cjs.map → DashedButton-CZ2hjLxT.cjs.map} +1 -1
  79. package/dist/{DashedButton-wcmXTYBw.js → DashedButton-meJSIY61.js} +2 -2
  80. package/dist/{DashedButton-wcmXTYBw.js.map → DashedButton-meJSIY61.js.map} +1 -1
  81. package/dist/{DatePicker-CSIBYSZt.js → DatePicker-CNUDjOxA.js} +5 -5
  82. package/dist/{DatePicker-CSIBYSZt.js.map → DatePicker-CNUDjOxA.js.map} +1 -1
  83. package/dist/{DatePicker-Bw9gLB8o.cjs → DatePicker-DrIHa1j1.cjs} +2 -2
  84. package/dist/{DatePicker-Bw9gLB8o.cjs.map → DatePicker-DrIHa1j1.cjs.map} +1 -1
  85. package/dist/{DateTimePicker-kikKdt0F.cjs → DateTimePicker-BzwxaOPb.cjs} +2 -2
  86. package/dist/{DateTimePicker-kikKdt0F.cjs.map → DateTimePicker-BzwxaOPb.cjs.map} +1 -1
  87. package/dist/{DateTimePicker-C9F2yJMf.js → DateTimePicker-CvWNDbib.js} +8 -8
  88. package/dist/{DateTimePicker-C9F2yJMf.js.map → DateTimePicker-CvWNDbib.js.map} +1 -1
  89. package/dist/{DescriptionList-DnGkHdzT.cjs → DescriptionList-Bed1MHU8.cjs} +2 -2
  90. package/dist/{DescriptionList-DnGkHdzT.cjs.map → DescriptionList-Bed1MHU8.cjs.map} +1 -1
  91. package/dist/{DescriptionList-kfNXbf_D.js → DescriptionList-BgMNjHJQ.js} +5 -5
  92. package/dist/{DescriptionList-kfNXbf_D.js.map → DescriptionList-BgMNjHJQ.js.map} +1 -1
  93. package/dist/{Dropdown-C_y9_dVn.cjs → Dropdown-DNL7RWdL.cjs} +2 -2
  94. package/dist/{Dropdown-C_y9_dVn.cjs.map → Dropdown-DNL7RWdL.cjs.map} +1 -1
  95. package/dist/{Dropdown-D-D_Z1Jo.js → Dropdown-iWbHokT7.js} +2 -2
  96. package/dist/{Dropdown-D-D_Z1Jo.js.map → Dropdown-iWbHokT7.js.map} +1 -1
  97. package/dist/{EmptyState-BM5LrRLq.cjs → EmptyState-BzwrOICc.cjs} +2 -2
  98. package/dist/{EmptyState-BM5LrRLq.cjs.map → EmptyState-BzwrOICc.cjs.map} +1 -1
  99. package/dist/{EmptyState-DrSj2XV_.js → EmptyState-CmcjJl_K.js} +3 -3
  100. package/dist/{EmptyState-DrSj2XV_.js.map → EmptyState-CmcjJl_K.js.map} +1 -1
  101. package/dist/{ErrorBoundary-yz669VEu.cjs → ErrorBoundary-BcZgeSsu.cjs} +2 -2
  102. package/dist/{ErrorBoundary-yz669VEu.cjs.map → ErrorBoundary-BcZgeSsu.cjs.map} +1 -1
  103. package/dist/{ErrorBoundary-DsP4hO_V.js → ErrorBoundary-TfeJetWc.js} +3 -3
  104. package/dist/{ErrorBoundary-DsP4hO_V.js.map → ErrorBoundary-TfeJetWc.js.map} +1 -1
  105. package/dist/{ErrorState-BThPIYaM.cjs → ErrorState-CzWz5UcX.cjs} +2 -2
  106. package/dist/{ErrorState-BThPIYaM.cjs.map → ErrorState-CzWz5UcX.cjs.map} +1 -1
  107. package/dist/{ErrorState-DEngucdq.js → ErrorState-EjIhdq7S.js} +8 -8
  108. package/dist/{ErrorState-DEngucdq.js.map → ErrorState-EjIhdq7S.js.map} +1 -1
  109. package/dist/{FileCard-CmCESTQd.js → FileCard-CmMxVyk3.js} +5 -5
  110. package/dist/{FileCard-CmCESTQd.js.map → FileCard-CmMxVyk3.js.map} +1 -1
  111. package/dist/{FileCard-wxDT2rj9.cjs → FileCard-Cxr1_eF2.cjs} +2 -2
  112. package/dist/{FileCard-wxDT2rj9.cjs.map → FileCard-Cxr1_eF2.cjs.map} +1 -1
  113. package/dist/{FileUploader-Dp1r4Sxc.js → FileUploader-2cXBI4Nh.js} +7 -7
  114. package/dist/{FileUploader-Dp1r4Sxc.js.map → FileUploader-2cXBI4Nh.js.map} +1 -1
  115. package/dist/{FileUploader-DBNRp5eT.cjs → FileUploader-BkM1t2aE.cjs} +2 -2
  116. package/dist/{FileUploader-DBNRp5eT.cjs.map → FileUploader-BkM1t2aE.cjs.map} +1 -1
  117. package/dist/{Flag-B6OhgwZr.cjs → Flag-CWp81_zX.cjs} +2 -2
  118. package/dist/{Flag-B6OhgwZr.cjs.map → Flag-CWp81_zX.cjs.map} +1 -1
  119. package/dist/{Flag-Q3vI7cgt.js → Flag-IQolG3j6.js} +2 -2
  120. package/dist/{Flag-Q3vI7cgt.js.map → Flag-IQolG3j6.js.map} +1 -1
  121. package/dist/{FullscreenToggle-WGsbE3Op.js → FullscreenToggle-B1DH_-k3.js} +4 -4
  122. package/dist/{FullscreenToggle-WGsbE3Op.js.map → FullscreenToggle-B1DH_-k3.js.map} +1 -1
  123. package/dist/{FullscreenToggle-DVdQriWB.cjs → FullscreenToggle-DXVAeN3M.cjs} +2 -2
  124. package/dist/{FullscreenToggle-DVdQriWB.cjs.map → FullscreenToggle-DXVAeN3M.cjs.map} +1 -1
  125. package/dist/Icon-BoQmbW7j.cjs +2 -0
  126. package/dist/Icon-BoQmbW7j.cjs.map +1 -0
  127. package/dist/{Icon-B7DJn8Tw.js → Icon-DMMO32p6.js} +72 -71
  128. package/dist/Icon-DMMO32p6.js.map +1 -0
  129. package/dist/{IconButton-DSPdv-oI.cjs → IconButton-ChhZqleN.cjs} +2 -2
  130. package/dist/{IconButton-DSPdv-oI.cjs.map → IconButton-ChhZqleN.cjs.map} +1 -1
  131. package/dist/{IconButton-iWbUJAz7.js → IconButton-s5hohjxu.js} +2 -2
  132. package/dist/{IconButton-iWbUJAz7.js.map → IconButton-s5hohjxu.js.map} +1 -1
  133. package/dist/{ImageEditor-C40dp2-V.cjs → ImageEditor-C8tFTX4e.cjs} +2 -2
  134. package/dist/{ImageEditor-C40dp2-V.cjs.map → ImageEditor-C8tFTX4e.cjs.map} +1 -1
  135. package/dist/{ImageEditor-BDNys8pq.js → ImageEditor-DWbWjGQ8.js} +8 -8
  136. package/dist/{ImageEditor-BDNys8pq.js.map → ImageEditor-DWbWjGQ8.js.map} +1 -1
  137. package/dist/{List-DS91CZUt.js → List-DQlEG_S5.js} +2 -2
  138. package/dist/{List-DS91CZUt.js.map → List-DQlEG_S5.js.map} +1 -1
  139. package/dist/{List-CLUXeaXS.cjs → List-Dfa7mlSZ.cjs} +2 -2
  140. package/dist/{List-CLUXeaXS.cjs.map → List-Dfa7mlSZ.cjs.map} +1 -1
  141. package/dist/{ListItem-Ezmdk7q-.js → ListItem-CLmg9xKQ.js} +2 -2
  142. package/dist/{ListItem-Ezmdk7q-.js.map → ListItem-CLmg9xKQ.js.map} +1 -1
  143. package/dist/{ListItem-CguNjf-u.cjs → ListItem-CWM2fUS2.cjs} +2 -2
  144. package/dist/{ListItem-CguNjf-u.cjs.map → ListItem-CWM2fUS2.cjs.map} +1 -1
  145. package/dist/{Loader-RyFTP2X5.cjs → Loader-BCrMy9NU.cjs} +2 -2
  146. package/dist/{Loader-RyFTP2X5.cjs.map → Loader-BCrMy9NU.cjs.map} +1 -1
  147. package/dist/{Loader-DD1vfqmN.js → Loader-CShIWNfG.js} +2 -2
  148. package/dist/{Loader-DD1vfqmN.js.map → Loader-CShIWNfG.js.map} +1 -1
  149. package/dist/{LocationPicker-B594f0bz.cjs → LocationPicker-8Tt0zJU4.cjs} +2 -2
  150. package/dist/{LocationPicker-B594f0bz.cjs.map → LocationPicker-8Tt0zJU4.cjs.map} +1 -1
  151. package/dist/{LocationPicker-DpmYaYyd.js → LocationPicker-DsV_s2Ur.js} +8 -8
  152. package/dist/{LocationPicker-DpmYaYyd.js.map → LocationPicker-DsV_s2Ur.js.map} +1 -1
  153. package/dist/{Modal-DVGTD2Ck.js → Modal-BO7fHn0r.js} +4 -4
  154. package/dist/{Modal-DVGTD2Ck.js.map → Modal-BO7fHn0r.js.map} +1 -1
  155. package/dist/{Modal-7cCok6fV.cjs → Modal-yj92WLay.cjs} +2 -2
  156. package/dist/{Modal-7cCok6fV.cjs.map → Modal-yj92WLay.cjs.map} +1 -1
  157. package/dist/{MultiSelect-DTKNjUDH.cjs → MultiSelect-B6JZb_5N.cjs} +2 -2
  158. package/dist/{MultiSelect-DTKNjUDH.cjs.map → MultiSelect-B6JZb_5N.cjs.map} +1 -1
  159. package/dist/{MultiSelect-D-X833xt.js → MultiSelect-D-QWlfwD.js} +5 -5
  160. package/dist/{MultiSelect-D-X833xt.js.map → MultiSelect-D-QWlfwD.js.map} +1 -1
  161. package/dist/{NumberField-Xz4yQMlm.cjs → NumberField-CS5VMnk4.cjs} +2 -2
  162. package/dist/{NumberField-Xz4yQMlm.cjs.map → NumberField-CS5VMnk4.cjs.map} +1 -1
  163. package/dist/{NumberField-OPOl0Yph.js → NumberField-D_UxKjVN.js} +4 -4
  164. package/dist/{NumberField-OPOl0Yph.js.map → NumberField-D_UxKjVN.js.map} +1 -1
  165. package/dist/{OtpField-kd0YghZq.cjs → OtpField-BuS_8j9L.cjs} +2 -2
  166. package/dist/{OtpField-kd0YghZq.cjs.map → OtpField-BuS_8j9L.cjs.map} +1 -1
  167. package/dist/{OtpField-CLrDMNtS.js → OtpField-CpjDid5_.js} +2 -2
  168. package/dist/{OtpField-CLrDMNtS.js.map → OtpField-CpjDid5_.js.map} +1 -1
  169. package/dist/{PageError-v6MAH_OL.cjs → PageError-CTEOASeb.cjs} +2 -2
  170. package/dist/{PageError-v6MAH_OL.cjs.map → PageError-CTEOASeb.cjs.map} +1 -1
  171. package/dist/{PageError-BIiZDzey.js → PageError-DjyJrGmR.js} +5 -5
  172. package/dist/{PageError-BIiZDzey.js.map → PageError-DjyJrGmR.js.map} +1 -1
  173. package/dist/{PageLayout-DH3jochw.cjs → PageLayout-BYKRmCAL.cjs} +2 -2
  174. package/dist/{PageLayout-DH3jochw.cjs.map → PageLayout-BYKRmCAL.cjs.map} +1 -1
  175. package/dist/{PageLayout-BjaPfXvb.js → PageLayout-Cz1OhQZ7.js} +5 -5
  176. package/dist/{PageLayout-BjaPfXvb.js.map → PageLayout-Cz1OhQZ7.js.map} +1 -1
  177. package/dist/{PageNotFound-C1oSsMG-.js → PageNotFound-CwBtrllo.js} +5 -5
  178. package/dist/{PageNotFound-C1oSsMG-.js.map → PageNotFound-CwBtrllo.js.map} +1 -1
  179. package/dist/{PageNotFound-Cse4bROv.cjs → PageNotFound-u9Q4KG6B.cjs} +2 -2
  180. package/dist/{PageNotFound-Cse4bROv.cjs.map → PageNotFound-u9Q4KG6B.cjs.map} +1 -1
  181. package/dist/{Pagination-BNJdqcu4.js → Pagination-CLjNwqie.js} +3 -3
  182. package/dist/{Pagination-BNJdqcu4.js.map → Pagination-CLjNwqie.js.map} +1 -1
  183. package/dist/{Pagination-DkmfEmgK.cjs → Pagination-HtS5gPnd.cjs} +2 -2
  184. package/dist/{Pagination-DkmfEmgK.cjs.map → Pagination-HtS5gPnd.cjs.map} +1 -1
  185. package/dist/{PaletteField-DqZl1mK0.cjs → PaletteField-BSgx5pxh.cjs} +2 -2
  186. package/dist/{PaletteField-DqZl1mK0.cjs.map → PaletteField-BSgx5pxh.cjs.map} +1 -1
  187. package/dist/{PaletteField-Cdky6Zka.js → PaletteField-Bk7cnSla.js} +3 -3
  188. package/dist/{PaletteField-Cdky6Zka.js.map → PaletteField-Bk7cnSla.js.map} +1 -1
  189. package/dist/{PhoneField-jq-3_i_b.cjs → PhoneField-CzFv2Vci.cjs} +2 -2
  190. package/dist/{PhoneField-jq-3_i_b.cjs.map → PhoneField-CzFv2Vci.cjs.map} +1 -1
  191. package/dist/{PhoneField-DmFaJJEa.js → PhoneField-DhoumZNG.js} +5 -5
  192. package/dist/{PhoneField-DmFaJJEa.js.map → PhoneField-DhoumZNG.js.map} +1 -1
  193. package/dist/{Popconfirm-KOE9gGi6.cjs → Popconfirm-Cb9LlmZb.cjs} +2 -2
  194. package/dist/{Popconfirm-KOE9gGi6.cjs.map → Popconfirm-Cb9LlmZb.cjs.map} +1 -1
  195. package/dist/{Popconfirm-D-8ZG2WR.js → Popconfirm-D7J5JbF-.js} +4 -4
  196. package/dist/{Popconfirm-D-8ZG2WR.js.map → Popconfirm-D7J5JbF-.js.map} +1 -1
  197. package/dist/{Progress-CdX666FP.js → Progress-Bt2LDqbD.js} +2 -2
  198. package/dist/{Progress-CdX666FP.js.map → Progress-Bt2LDqbD.js.map} +1 -1
  199. package/dist/{Progress-7EyhPtnu.cjs → Progress-dAtQ2BN-.cjs} +2 -2
  200. package/dist/{Progress-7EyhPtnu.cjs.map → Progress-dAtQ2BN-.cjs.map} +1 -1
  201. package/dist/{QrCode-ClIJjjvF.cjs → QrCode-FHUAxI8u.cjs} +2 -2
  202. package/dist/{QrCode-ClIJjjvF.cjs.map → QrCode-FHUAxI8u.cjs.map} +1 -1
  203. package/dist/{QrCode-D7ocSDi7.js → QrCode-jaDZxZkv.js} +2 -2
  204. package/dist/{QrCode-D7ocSDi7.js.map → QrCode-jaDZxZkv.js.map} +1 -1
  205. package/dist/{RemoveDialog-DTzRPLaT.js → RemoveDialog-DdO5E3Wl.js} +6 -6
  206. package/dist/{RemoveDialog-DTzRPLaT.js.map → RemoveDialog-DdO5E3Wl.js.map} +1 -1
  207. package/dist/{RemoveDialog-UsSX5z8Y.cjs → RemoveDialog-eGNxdyoO.cjs} +2 -2
  208. package/dist/{RemoveDialog-UsSX5z8Y.cjs.map → RemoveDialog-eGNxdyoO.cjs.map} +1 -1
  209. package/dist/{RichTextEditor-Bh0Q3dIW.cjs → RichTextEditor-CoYuQurR.cjs} +2 -2
  210. package/dist/{RichTextEditor-Bh0Q3dIW.cjs.map → RichTextEditor-CoYuQurR.cjs.map} +1 -1
  211. package/dist/{RichTextEditor-BMctlkVC.js → RichTextEditor-DHRiJchI.js} +10 -10
  212. package/dist/{RichTextEditor-BMctlkVC.js.map → RichTextEditor-DHRiJchI.js.map} +1 -1
  213. package/dist/{RootLayout-BztZetpk.cjs → RootLayout-CEplIlVR.cjs} +2 -2
  214. package/dist/{RootLayout-BztZetpk.cjs.map → RootLayout-CEplIlVR.cjs.map} +1 -1
  215. package/dist/{RootLayout-CTkv4iQJ.js → RootLayout-pd66MZtI.js} +21 -21
  216. package/dist/{RootLayout-CTkv4iQJ.js.map → RootLayout-pd66MZtI.js.map} +1 -1
  217. package/dist/{Select-CmonDIIU.js → Select-C2iiQLMh.js} +4 -4
  218. package/dist/{Select-CmonDIIU.js.map → Select-C2iiQLMh.js.map} +1 -1
  219. package/dist/{Select-BzVyK6Ne.cjs → Select-CvW_T9R-.cjs} +2 -2
  220. package/dist/{Select-BzVyK6Ne.cjs.map → Select-CvW_T9R-.cjs.map} +1 -1
  221. package/dist/Sidebar-CqGCazeA.cjs +2 -0
  222. package/dist/Sidebar-CqGCazeA.cjs.map +1 -0
  223. package/dist/Sidebar-DuUhzQBi.js +543 -0
  224. package/dist/Sidebar-DuUhzQBi.js.map +1 -0
  225. package/dist/{Slider-Oe9VSAdy.cjs → Slider-DlPMPdHA.cjs} +2 -2
  226. package/dist/{Slider-Oe9VSAdy.cjs.map → Slider-DlPMPdHA.cjs.map} +1 -1
  227. package/dist/{Slider-C7Wb3q_F.js → Slider-UY29adRu.js} +2 -2
  228. package/dist/{Slider-C7Wb3q_F.js.map → Slider-UY29adRu.js.map} +1 -1
  229. package/dist/{SpeedDial-DpIXoYHB.cjs → SpeedDial-Cms5pJ9t.cjs} +2 -2
  230. package/dist/{SpeedDial-DpIXoYHB.cjs.map → SpeedDial-Cms5pJ9t.cjs.map} +1 -1
  231. package/dist/{SpeedDial-CCGQlwn2.js → SpeedDial-DOWefQgo.js} +3 -3
  232. package/dist/{SpeedDial-CCGQlwn2.js.map → SpeedDial-DOWefQgo.js.map} +1 -1
  233. package/dist/{Stepper-PBDU60G_.cjs → Stepper-4wCyTnwi.cjs} +2 -2
  234. package/dist/{Stepper-PBDU60G_.cjs.map → Stepper-4wCyTnwi.cjs.map} +1 -1
  235. package/dist/{Stepper-D_WKS1RG.js → Stepper-yQEJkbUJ.js} +3 -3
  236. package/dist/{Stepper-D_WKS1RG.js.map → Stepper-yQEJkbUJ.js.map} +1 -1
  237. package/dist/{SwatchPicker-DS4WY2eM.js → SwatchPicker-BI0XHphv.js} +2 -2
  238. package/dist/{SwatchPicker-DS4WY2eM.js.map → SwatchPicker-BI0XHphv.js.map} +1 -1
  239. package/dist/{SwatchPicker-DCjE0T80.cjs → SwatchPicker-QYtqEUxX.cjs} +2 -2
  240. package/dist/{SwatchPicker-DCjE0T80.cjs.map → SwatchPicker-QYtqEUxX.cjs.map} +1 -1
  241. package/dist/{Table-DZQVa_PE.js → Table-CNrt1EWm.js} +19 -19
  242. package/dist/{Table-DZQVa_PE.js.map → Table-CNrt1EWm.js.map} +1 -1
  243. package/dist/{Table-CZ4n4-TN.cjs → Table-D4pqLNtE.cjs} +2 -2
  244. package/dist/{Table-CZ4n4-TN.cjs.map → Table-D4pqLNtE.cjs.map} +1 -1
  245. package/dist/{Tabs-Byhqm-TE.cjs → Tabs-D6qrgZTM.cjs} +2 -2
  246. package/dist/{Tabs-Byhqm-TE.cjs.map → Tabs-D6qrgZTM.cjs.map} +1 -1
  247. package/dist/{Tabs-B063mP-v.js → Tabs-lezN63jW.js} +3 -3
  248. package/dist/{Tabs-B063mP-v.js.map → Tabs-lezN63jW.js.map} +1 -1
  249. package/dist/{TagsField-g_LtwYgz.cjs → TagsField-BIJEDyfz.cjs} +2 -2
  250. package/dist/{TagsField-g_LtwYgz.cjs.map → TagsField-BIJEDyfz.cjs.map} +1 -1
  251. package/dist/{TagsField-hQFYyNcM.js → TagsField-D_a2I8eU.js} +5 -5
  252. package/dist/{TagsField-hQFYyNcM.js.map → TagsField-D_a2I8eU.js.map} +1 -1
  253. package/dist/{TextField-Dfpk0jOg.js → TextField-BsC2zoHI.js} +4 -4
  254. package/dist/{TextField-Dfpk0jOg.js.map → TextField-BsC2zoHI.js.map} +1 -1
  255. package/dist/{TextField-D4s2hGSd.cjs → TextField-CXDBlP-8.cjs} +2 -2
  256. package/dist/{TextField-D4s2hGSd.cjs.map → TextField-CXDBlP-8.cjs.map} +1 -1
  257. package/dist/{ThemeToggle-BQQ3eswr.js → ThemeToggle-Dh6XxqM7.js} +4 -4
  258. package/dist/{ThemeToggle-BQQ3eswr.js.map → ThemeToggle-Dh6XxqM7.js.map} +1 -1
  259. package/dist/{ThemeToggle-BTTI7Jz0.cjs → ThemeToggle-zbKf4ph5.cjs} +2 -2
  260. package/dist/{ThemeToggle-BTTI7Jz0.cjs.map → ThemeToggle-zbKf4ph5.cjs.map} +1 -1
  261. package/dist/{TimeColumns-BpjhrNCq.js → TimeColumns-CR__2LXh.js} +2 -2
  262. package/dist/{TimeColumns-BpjhrNCq.js.map → TimeColumns-CR__2LXh.js.map} +1 -1
  263. package/dist/{TimeColumns-DZYGWWG_.cjs → TimeColumns-CjBeUPtV.cjs} +2 -2
  264. package/dist/{TimeColumns-DZYGWWG_.cjs.map → TimeColumns-CjBeUPtV.cjs.map} +1 -1
  265. package/dist/{TimePicker-mzoMIlpq.js → TimePicker-BakQ-wPd.js} +6 -6
  266. package/dist/{TimePicker-mzoMIlpq.js.map → TimePicker-BakQ-wPd.js.map} +1 -1
  267. package/dist/{TimePicker-DChtZgBs.cjs → TimePicker-DtqmD2bH.cjs} +2 -2
  268. package/dist/{TimePicker-DChtZgBs.cjs.map → TimePicker-DtqmD2bH.cjs.map} +1 -1
  269. package/dist/{Timeline-DOojNvLG.cjs → Timeline-CFKbPpAV.cjs} +2 -2
  270. package/dist/{Timeline-DOojNvLG.cjs.map → Timeline-CFKbPpAV.cjs.map} +1 -1
  271. package/dist/{Timeline-Dg03dwTN.js → Timeline-zCHcq7Ra.js} +2 -2
  272. package/dist/{Timeline-Dg03dwTN.js.map → Timeline-zCHcq7Ra.js.map} +1 -1
  273. package/dist/{Toaster-lonArt-H.cjs → Toaster-BpXPWJ_n.cjs} +2 -2
  274. package/dist/{Toaster-lonArt-H.cjs.map → Toaster-BpXPWJ_n.cjs.map} +1 -1
  275. package/dist/{Toaster-79DvOW80.js → Toaster-C5jWNL-o.js} +3 -3
  276. package/dist/{Toaster-79DvOW80.js.map → Toaster-C5jWNL-o.js.map} +1 -1
  277. package/dist/{ToggleButtonGroup-CGNRLxjg.cjs → ToggleButtonGroup-CbKtjm8O.cjs} +2 -2
  278. package/dist/{ToggleButtonGroup-CGNRLxjg.cjs.map → ToggleButtonGroup-CbKtjm8O.cjs.map} +1 -1
  279. package/dist/{ToggleButtonGroup-K6ZcrTZT.js → ToggleButtonGroup-D3Jltv0z.js} +2 -2
  280. package/dist/{ToggleButtonGroup-K6ZcrTZT.js.map → ToggleButtonGroup-D3Jltv0z.js.map} +1 -1
  281. package/dist/{TranslatedFields-CHHtXO_n.js → TranslatedFields-C8oxlGIQ.js} +5 -5
  282. package/dist/{TranslatedFields-CHHtXO_n.js.map → TranslatedFields-C8oxlGIQ.js.map} +1 -1
  283. package/dist/{TranslatedFields-BYpMrYaw.cjs → TranslatedFields-Che_ZPHk.cjs} +2 -2
  284. package/dist/{TranslatedFields-BYpMrYaw.cjs.map → TranslatedFields-Che_ZPHk.cjs.map} +1 -1
  285. package/dist/{UserCard-SlkCgZS9.cjs → UserCard-DlrdIJHW.cjs} +2 -2
  286. package/dist/{UserCard-SlkCgZS9.cjs.map → UserCard-DlrdIJHW.cjs.map} +1 -1
  287. package/dist/{UserCard-BJFNP_nl.js → UserCard-Dr1A_bdA.js} +5 -5
  288. package/dist/{UserCard-BJFNP_nl.js.map → UserCard-Dr1A_bdA.js.map} +1 -1
  289. package/dist/{authLayoutRoute-CgSQIDD5.cjs → authLayoutRoute-CPLqQVvx.cjs} +2 -2
  290. package/dist/{authLayoutRoute-CgSQIDD5.cjs.map → authLayoutRoute-CPLqQVvx.cjs.map} +1 -1
  291. package/dist/{authLayoutRoute-CEFmEYy7.js → authLayoutRoute-nSZq8JYA.js} +2 -2
  292. package/dist/{authLayoutRoute-CEFmEYy7.js.map → authLayoutRoute-nSZq8JYA.js.map} +1 -1
  293. package/dist/chunks/icons/{62-Bfupp-0A.js → 62-9nuZO-ct.js} +9 -10
  294. package/dist/chunks/icons/{62-CZZzM1ev.cjs → 62-DQQ1U3IB.cjs} +1 -1
  295. package/dist/components/Accordion/index.cjs +1 -1
  296. package/dist/components/Accordion/index.js +1 -1
  297. package/dist/components/Alert/index.cjs +1 -1
  298. package/dist/components/Alert/index.js +1 -1
  299. package/dist/components/AuthLayout/index.cjs +1 -1
  300. package/dist/components/AuthLayout/index.js +1 -1
  301. package/dist/components/Avatar/index.cjs +1 -1
  302. package/dist/components/Avatar/index.js +2 -2
  303. package/dist/components/Breadcrumbs/index.cjs +1 -1
  304. package/dist/components/Breadcrumbs/index.js +1 -1
  305. package/dist/components/Button/index.cjs +1 -1
  306. package/dist/components/Button/index.js +1 -1
  307. package/dist/components/Card/index.cjs +1 -1
  308. package/dist/components/Card/index.js +1 -1
  309. package/dist/components/Chip/index.cjs +1 -1
  310. package/dist/components/Chip/index.js +1 -1
  311. package/dist/components/ChoiceCard/index.cjs +1 -1
  312. package/dist/components/ChoiceCard/index.js +1 -1
  313. package/dist/components/CodeBlock/index.cjs +1 -1
  314. package/dist/components/CodeBlock/index.js +1 -1
  315. package/dist/components/ColorPicker/index.cjs +1 -1
  316. package/dist/components/ColorPicker/index.js +1 -1
  317. package/dist/components/ColorRamp/index.cjs +1 -1
  318. package/dist/components/ColorRamp/index.js +1 -1
  319. package/dist/components/CopyButton/index.cjs +1 -1
  320. package/dist/components/CopyButton/index.js +1 -1
  321. package/dist/components/DashedButton/index.cjs +1 -1
  322. package/dist/components/DashedButton/index.js +1 -1
  323. package/dist/components/DatePicker/index.cjs +1 -1
  324. package/dist/components/DatePicker/index.js +1 -1
  325. package/dist/components/DateTimePicker/index.cjs +1 -1
  326. package/dist/components/DateTimePicker/index.js +1 -1
  327. package/dist/components/DescriptionList/index.cjs +1 -1
  328. package/dist/components/DescriptionList/index.js +1 -1
  329. package/dist/components/Dropdown/index.cjs +1 -1
  330. package/dist/components/Dropdown/index.js +1 -1
  331. package/dist/components/EmptyState/index.cjs +1 -1
  332. package/dist/components/EmptyState/index.js +1 -1
  333. package/dist/components/ErrorState/index.cjs +1 -1
  334. package/dist/components/ErrorState/index.js +2 -2
  335. package/dist/components/FileCard/index.cjs +1 -1
  336. package/dist/components/FileCard/index.js +1 -1
  337. package/dist/components/FileUploader/index.cjs +1 -1
  338. package/dist/components/FileUploader/index.js +1 -1
  339. package/dist/components/Flag/index.cjs +1 -1
  340. package/dist/components/Flag/index.js +1 -1
  341. package/dist/components/FullscreenToggle/index.cjs +1 -1
  342. package/dist/components/FullscreenToggle/index.js +1 -1
  343. package/dist/components/Icon/index.cjs +1 -1
  344. package/dist/components/Icon/index.js +1 -1
  345. package/dist/components/IconButton/index.cjs +1 -1
  346. package/dist/components/IconButton/index.js +1 -1
  347. package/dist/components/ImageEditor/index.cjs +1 -1
  348. package/dist/components/ImageEditor/index.js +1 -1
  349. package/dist/components/List/index.cjs +1 -1
  350. package/dist/components/List/index.js +2 -2
  351. package/dist/components/Loader/index.cjs +1 -1
  352. package/dist/components/Loader/index.js +1 -1
  353. package/dist/components/LocationPicker/index.cjs +1 -1
  354. package/dist/components/LocationPicker/index.js +1 -1
  355. package/dist/components/Modal/index.cjs +1 -1
  356. package/dist/components/Modal/index.js +1 -1
  357. package/dist/components/MultiSelect/index.cjs +1 -1
  358. package/dist/components/MultiSelect/index.js +1 -1
  359. package/dist/components/NumberField/index.cjs +1 -1
  360. package/dist/components/NumberField/index.js +1 -1
  361. package/dist/components/OtpField/index.cjs +1 -1
  362. package/dist/components/OtpField/index.js +1 -1
  363. package/dist/components/PageError/index.cjs +1 -1
  364. package/dist/components/PageError/index.js +1 -1
  365. package/dist/components/PageLayout/index.cjs +1 -1
  366. package/dist/components/PageLayout/index.js +1 -1
  367. package/dist/components/PageNotFound/index.cjs +1 -1
  368. package/dist/components/PageNotFound/index.js +1 -1
  369. package/dist/components/Pagination/index.cjs +1 -1
  370. package/dist/components/Pagination/index.js +1 -1
  371. package/dist/components/PaletteField/index.cjs +1 -1
  372. package/dist/components/PaletteField/index.js +1 -1
  373. package/dist/components/PhoneField/index.cjs +1 -1
  374. package/dist/components/PhoneField/index.js +1 -1
  375. package/dist/components/Popconfirm/index.cjs +1 -1
  376. package/dist/components/Popconfirm/index.js +1 -1
  377. package/dist/components/Progress/index.cjs +1 -1
  378. package/dist/components/Progress/index.js +1 -1
  379. package/dist/components/QrCode/index.cjs +1 -1
  380. package/dist/components/QrCode/index.js +1 -1
  381. package/dist/components/RemoveDialog/index.cjs +1 -1
  382. package/dist/components/RemoveDialog/index.js +1 -1
  383. package/dist/components/RichTextEditor/index.cjs +1 -1
  384. package/dist/components/RichTextEditor/index.js +1 -1
  385. package/dist/components/RootLayout/index.cjs +1 -1
  386. package/dist/components/RootLayout/index.js +1 -1
  387. package/dist/components/Select/index.cjs +1 -1
  388. package/dist/components/Select/index.js +1 -1
  389. package/dist/components/Sidebar/Sidebar.d.cts +40 -4
  390. package/dist/components/Sidebar/Sidebar.d.ts +40 -4
  391. package/dist/components/Sidebar/index.cjs +1 -1
  392. package/dist/components/Sidebar/index.d.cts +2 -1
  393. package/dist/components/Sidebar/index.d.ts +2 -1
  394. package/dist/components/Sidebar/index.js +5 -4
  395. package/dist/components/Slider/index.cjs +1 -1
  396. package/dist/components/Slider/index.js +1 -1
  397. package/dist/components/SpeedDial/index.cjs +1 -1
  398. package/dist/components/SpeedDial/index.js +1 -1
  399. package/dist/components/Stepper/index.cjs +1 -1
  400. package/dist/components/Stepper/index.js +1 -1
  401. package/dist/components/SwatchPicker/index.cjs +1 -1
  402. package/dist/components/SwatchPicker/index.js +1 -1
  403. package/dist/components/Table/index.cjs +1 -1
  404. package/dist/components/Table/index.js +1 -1
  405. package/dist/components/Tabs/index.cjs +1 -1
  406. package/dist/components/Tabs/index.js +1 -1
  407. package/dist/components/TagsField/index.cjs +1 -1
  408. package/dist/components/TagsField/index.js +1 -1
  409. package/dist/components/TextField/index.cjs +1 -1
  410. package/dist/components/TextField/index.js +1 -1
  411. package/dist/components/ThemeToggle/index.cjs +1 -1
  412. package/dist/components/ThemeToggle/index.js +1 -1
  413. package/dist/components/TimePicker/index.cjs +1 -1
  414. package/dist/components/TimePicker/index.js +1 -1
  415. package/dist/components/Timeline/index.cjs +1 -1
  416. package/dist/components/Timeline/index.js +1 -1
  417. package/dist/components/Toast/index.cjs +1 -1
  418. package/dist/components/Toast/index.js +1 -1
  419. package/dist/components/ToggleButton/index.cjs +1 -1
  420. package/dist/components/ToggleButton/index.js +1 -1
  421. package/dist/components/TranslatedFields/index.cjs +1 -1
  422. package/dist/components/TranslatedFields/index.js +1 -1
  423. package/dist/components/UserCard/index.cjs +1 -1
  424. package/dist/components/UserCard/index.js +1 -1
  425. package/dist/entries/app.cjs +1 -1
  426. package/dist/entries/app.js +1 -1
  427. package/dist/entries/auth.cjs +1 -1
  428. package/dist/entries/auth.js +2 -2
  429. package/dist/entries/components.cjs +1 -1
  430. package/dist/entries/components.js +157 -156
  431. package/dist/entries/i18n.cjs +1 -1
  432. package/dist/entries/i18n.js +2 -2
  433. package/dist/entries/icons.cjs +1 -1
  434. package/dist/entries/icons.js +1 -1
  435. package/dist/entries/theme.cjs +1 -1
  436. package/dist/entries/theme.js +1 -1
  437. package/dist/i18n/messages.d.cts +4 -0
  438. package/dist/i18n/messages.d.ts +4 -0
  439. package/dist/index.cjs +1 -1
  440. package/dist/index.css +1 -1
  441. package/dist/index.js +173 -172
  442. package/dist/{messages-DeQuvGln.js → messages-CZbb1xNN.js} +29 -15
  443. package/dist/messages-CZbb1xNN.js.map +1 -0
  444. package/dist/messages-D4ooXnUr.cjs +36 -0
  445. package/dist/messages-D4ooXnUr.cjs.map +1 -0
  446. package/dist/useHomeTo---51HTJ0.cjs +2 -0
  447. package/dist/useHomeTo---51HTJ0.cjs.map +1 -0
  448. package/dist/useHomeTo-CJj94TdV.js +10 -0
  449. package/dist/useHomeTo-CJj94TdV.js.map +1 -0
  450. package/dist/{useOptionMenu-6ZffgbYG.cjs → useOptionMenu-DS___46k.cjs} +2 -2
  451. package/dist/{useOptionMenu-6ZffgbYG.cjs.map → useOptionMenu-DS___46k.cjs.map} +1 -1
  452. package/dist/{useOptionMenu-CxM6FHXL.js → useOptionMenu-Sp2d3Bzi.js} +6 -6
  453. package/dist/{useOptionMenu-CxM6FHXL.js.map → useOptionMenu-Sp2d3Bzi.js.map} +1 -1
  454. package/package.json +1 -1
  455. package/dist/Icon-B7DJn8Tw.js.map +0 -1
  456. package/dist/Icon-CBg21lKA.cjs +0 -2
  457. package/dist/Icon-CBg21lKA.cjs.map +0 -1
  458. package/dist/Sidebar-CLr-DyQ_.js +0 -522
  459. package/dist/Sidebar-CLr-DyQ_.js.map +0 -1
  460. package/dist/Sidebar-CM-jZfj5.cjs +0 -2
  461. package/dist/Sidebar-CM-jZfj5.cjs.map +0 -1
  462. package/dist/messages-DeQuvGln.js.map +0 -1
  463. package/dist/messages-dL9MkVze.cjs +0 -36
  464. package/dist/messages-dL9MkVze.cjs.map +0 -1
  465. package/dist/useHomeTo-BLSvhJd5.js +0 -25
  466. package/dist/useHomeTo-BLSvhJd5.js.map +0 -1
  467. package/dist/useHomeTo-cXCg1tf0.cjs +0 -2
  468. package/dist/useHomeTo-cXCg1tf0.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),g=require("react"),q=require("./EmptyState-BM5LrRLq.cjs"),N=require("./Button-BtiFpRie.cjs"),v=require("./useHomeTo-cXCg1tf0.cjs"),T=require("./ConfigProvider-CYSpuSMJ.cjs"),f=g.forwardRef(function({icon:r="SearchStatus",title:u,description:i,actionLabel:s,to:c,showAction:a=!0,data:P,isNotFound:S,routeId:h,...d},F){const t=T.useT(),{router:o,homeTo:e}=v.useHomeTo(c),l=!!o&&e!=null,m=a&&l?n.jsx(N.Button,{size:"sm",onClick:()=>o.navigate({to:e}),children:s??t("notFound.action")}):void 0;return n.jsx(q.EmptyState,{ref:F,icon:r,title:u??t("notFound.title"),description:i??t("notFound.description"),action:m,...d})});exports.PageNotFound=f;
2
- //# sourceMappingURL=PageNotFound-Cse4bROv.cjs.map
1
+ "use strict";const n=require("react/jsx-runtime"),g=require("react"),q=require("./EmptyState-BzwrOICc.cjs"),N=require("./Button-DAvQCGIw.cjs"),v=require("./useHomeTo---51HTJ0.cjs"),T=require("./ConfigProvider-BFhkb0BV.cjs"),f=g.forwardRef(function({icon:r="SearchStatus",title:u,description:i,actionLabel:s,to:c,showAction:a=!0,data:P,isNotFound:S,routeId:h,...d},F){const t=T.useT(),{router:o,homeTo:e}=v.useHomeTo(c),l=!!o&&e!=null,m=a&&l?n.jsx(N.Button,{size:"sm",onClick:()=>o.navigate({to:e}),children:s??t("notFound.action")}):void 0;return n.jsx(q.EmptyState,{ref:F,icon:r,title:u??t("notFound.title"),description:i??t("notFound.description"),action:m,...d})});exports.PageNotFound=f;
2
+ //# sourceMappingURL=PageNotFound-u9Q4KG6B.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageNotFound-Cse4bROv.cjs","sources":["../src/components/PageNotFound/PageNotFound.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { EmptyState, type EmptyStateSize } from '../EmptyState'\nimport { Button } from '../Button'\nimport type { IconName } from '../../icons/names'\nimport { useHomeTo } from './useHomeTo'\n\nexport interface PageNotFoundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Hero glyph — an `IconName`, any node, or `false` to hide it. Defaults to `SearchStatus`. */\n icon?: IconName | ReactNode | false\n /** Heading. Defaults to the localized `notFound.title`. */\n title?: ReactNode\n /** Muted description. Defaults to the localized `notFound.description`. */\n description?: ReactNode\n /** Action button label. Defaults to the localized `notFound.action`. */\n actionLabel?: ReactNode\n /** Where the action navigates. Defaults to the first allowed menu page (RBAC-aware), else `/`. */\n to?: string\n /** Show the \"back home\" action button. Defaults to `true` (hidden anyway when there's no router). */\n showAction?: boolean\n /** Faded-grid hero backdrop — passed to `EmptyState`. Defaults to `true` (its default). */\n pattern?: boolean\n /** Size — passed to `EmptyState`. Defaults to `md`. */\n size?: EmptyStateSize\n /*\n * The router's `NotFoundRouteProps`, declared so `defaultNotFoundComponent: PageNotFound` type-checks (an\n * all-optional props type that shares no field with the router's props fails TypeScript's weak-type check —\n * `data` / `isNotFound` alone satisfy it), and destructured away so they never reach the DOM.\n * `routeId` is `unknown` ON PURPOSE: the router types it `RouteIds<RegisteredRouter['routeTree']>`, and any\n * narrower type here (1.0.36 had `string`) makes the assignability check resolve that — i.e. `typeof router`\n * through the app's `Register` block — while `createRouter` is still inferring `router`: a cycle (TS7022 /\n * TS2502). `unknown` accepts it without looking. Guarded by `routerDefaults.registered.test-d.ts`.\n */\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n data?: unknown\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n isNotFound?: boolean\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored (`unknown` — see above). */\n routeId?: unknown\n}\n\n/**\n * The shared **404** page. Drop it straight into TanStack Router as the\n * `defaultNotFoundComponent` — zero props needed: the title/description/action strings come from the\n * built-in i18n (`useT`), so they translate with the panel language, and the action navigates to the\n * **first allowed menu page** (the same RBAC-aware target as `FirstRouteRedirect`), falling back to\n * `/`. Built on `EmptyState` (hero glyph + title + description + action, `pattern` on by default), so\n * it renders inside the `RootLayout` content area with the shell/sidebar intact. Lenient: with no\n * router context the `EmptyState` still renders, just without the action button. Token-only styling.\n *\n * @example\n * const router = createRouter({\n * routeTree,\n * defaultNotFoundComponent: PageNotFound,\n * defaultErrorComponent: PageError,\n * })\n */\nexport const PageNotFound = forwardRef<HTMLDivElement, PageNotFoundProps>(function PageNotFound(\n {\n icon = 'SearchStatus',\n title,\n description,\n actionLabel,\n to,\n showAction = true,\n // the router's props — kept off the DOM\n data: _data,\n isNotFound: _isNotFound,\n routeId: _routeId,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the first allowed menu page (RBAC-aware, `/` fallback); router is undefined outside a <RouterProvider>\n const { router, homeTo: resolvedTo } = useHomeTo(to)\n\n const canNavigate = !!router && resolvedTo != null\n const action =\n showAction && canNavigate ? (\n <Button size=\"sm\" onClick={() => router.navigate({ to: resolvedTo as LinkProps['to'] })}>\n {actionLabel ?? t('notFound.action')}\n </Button>\n ) : undefined\n\n return (\n <EmptyState\n ref={ref}\n icon={icon}\n title={title ?? t('notFound.title')}\n description={description ?? t('notFound.description')}\n action={action}\n {...props}\n />\n )\n})\n"],"names":["PageNotFound","forwardRef","icon","title","description","actionLabel","to","showAction","_data","_isNotFound","_routeId","props","ref","useT","router","resolvedTo","useHomeTo","canNavigate","action","jsx","Button","EmptyState"],"mappings":"gOA0DaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,KAAAC,EAAO,eACP,MAAAC,EACA,YAAAC,EACA,YAAAC,EACA,GAAAC,EACA,WAAAC,EAAa,GAEb,KAAMC,EACN,WAAYC,EACZ,QAASC,EACT,GAAGC,CACL,EACAC,EACA,CACA,MAAM,EAAIC,EAAAA,KAAA,EAEJ,CAAE,OAAAC,EAAQ,OAAQC,CAAA,EAAeC,EAAAA,UAAUV,CAAE,EAE7CW,EAAc,CAAC,CAACH,GAAUC,GAAc,KACxCG,EACJX,GAAcU,EACZE,EAAAA,IAACC,EAAAA,QAAO,KAAK,KAAK,QAAS,IAAMN,EAAO,SAAS,CAAE,GAAIC,EAA+B,EACnF,YAAe,EAAE,iBAAiB,EACrC,EACE,OAEN,OACEI,EAAAA,IAACE,EAAAA,WAAA,CACC,IAAAT,EACA,KAAAV,EACA,MAAOC,GAAS,EAAE,gBAAgB,EAClC,YAAaC,GAAe,EAAE,sBAAsB,EACpD,OAAAc,EACC,GAAGP,CAAA,CAAA,CAGV,CAAC"}
1
+ {"version":3,"file":"PageNotFound-u9Q4KG6B.cjs","sources":["../src/components/PageNotFound/PageNotFound.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { EmptyState, type EmptyStateSize } from '../EmptyState'\nimport { Button } from '../Button'\nimport type { IconName } from '../../icons/names'\nimport { useHomeTo } from './useHomeTo'\n\nexport interface PageNotFoundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Hero glyph — an `IconName`, any node, or `false` to hide it. Defaults to `SearchStatus`. */\n icon?: IconName | ReactNode | false\n /** Heading. Defaults to the localized `notFound.title`. */\n title?: ReactNode\n /** Muted description. Defaults to the localized `notFound.description`. */\n description?: ReactNode\n /** Action button label. Defaults to the localized `notFound.action`. */\n actionLabel?: ReactNode\n /** Where the action navigates. Defaults to the first allowed menu page (RBAC-aware), else `/`. */\n to?: string\n /** Show the \"back home\" action button. Defaults to `true` (hidden anyway when there's no router). */\n showAction?: boolean\n /** Faded-grid hero backdrop — passed to `EmptyState`. Defaults to `true` (its default). */\n pattern?: boolean\n /** Size — passed to `EmptyState`. Defaults to `md`. */\n size?: EmptyStateSize\n /*\n * The router's `NotFoundRouteProps`, declared so `defaultNotFoundComponent: PageNotFound` type-checks (an\n * all-optional props type that shares no field with the router's props fails TypeScript's weak-type check —\n * `data` / `isNotFound` alone satisfy it), and destructured away so they never reach the DOM.\n * `routeId` is `unknown` ON PURPOSE: the router types it `RouteIds<RegisteredRouter['routeTree']>`, and any\n * narrower type here (1.0.36 had `string`) makes the assignability check resolve that — i.e. `typeof router`\n * through the app's `Register` block — while `createRouter` is still inferring `router`: a cycle (TS7022 /\n * TS2502). `unknown` accepts it without looking. Guarded by `routerDefaults.registered.test-d.ts`.\n */\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n data?: unknown\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n isNotFound?: boolean\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored (`unknown` — see above). */\n routeId?: unknown\n}\n\n/**\n * The shared **404** page. Drop it straight into TanStack Router as the\n * `defaultNotFoundComponent` — zero props needed: the title/description/action strings come from the\n * built-in i18n (`useT`), so they translate with the panel language, and the action navigates to the\n * **first allowed menu page** (the same RBAC-aware target as `FirstRouteRedirect`), falling back to\n * `/`. Built on `EmptyState` (hero glyph + title + description + action, `pattern` on by default), so\n * it renders inside the `RootLayout` content area with the shell/sidebar intact. Lenient: with no\n * router context the `EmptyState` still renders, just without the action button. Token-only styling.\n *\n * @example\n * const router = createRouter({\n * routeTree,\n * defaultNotFoundComponent: PageNotFound,\n * defaultErrorComponent: PageError,\n * })\n */\nexport const PageNotFound = forwardRef<HTMLDivElement, PageNotFoundProps>(function PageNotFound(\n {\n icon = 'SearchStatus',\n title,\n description,\n actionLabel,\n to,\n showAction = true,\n // the router's props — kept off the DOM\n data: _data,\n isNotFound: _isNotFound,\n routeId: _routeId,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the first allowed menu page (RBAC-aware, `/` fallback); router is undefined outside a <RouterProvider>\n const { router, homeTo: resolvedTo } = useHomeTo(to)\n\n const canNavigate = !!router && resolvedTo != null\n const action =\n showAction && canNavigate ? (\n <Button size=\"sm\" onClick={() => router.navigate({ to: resolvedTo as LinkProps['to'] })}>\n {actionLabel ?? t('notFound.action')}\n </Button>\n ) : undefined\n\n return (\n <EmptyState\n ref={ref}\n icon={icon}\n title={title ?? t('notFound.title')}\n description={description ?? t('notFound.description')}\n action={action}\n {...props}\n />\n )\n})\n"],"names":["PageNotFound","forwardRef","icon","title","description","actionLabel","to","showAction","_data","_isNotFound","_routeId","props","ref","useT","router","resolvedTo","useHomeTo","canNavigate","action","jsx","Button","EmptyState"],"mappings":"gOA0DaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,KAAAC,EAAO,eACP,MAAAC,EACA,YAAAC,EACA,YAAAC,EACA,GAAAC,EACA,WAAAC,EAAa,GAEb,KAAMC,EACN,WAAYC,EACZ,QAASC,EACT,GAAGC,CACL,EACAC,EACA,CACA,MAAM,EAAIC,EAAAA,KAAA,EAEJ,CAAE,OAAAC,EAAQ,OAAQC,CAAA,EAAeC,EAAAA,UAAUV,CAAE,EAE7CW,EAAc,CAAC,CAACH,GAAUC,GAAc,KACxCG,EACJX,GAAcU,EACZE,EAAAA,IAACC,EAAAA,QAAO,KAAK,KAAK,QAAS,IAAMN,EAAO,SAAS,CAAE,GAAIC,EAA+B,EACnF,YAAe,EAAE,iBAAiB,EACrC,EACE,OAEN,OACEI,EAAAA,IAACE,EAAAA,WAAA,CACC,IAAAT,EACA,KAAAV,EACA,MAAOC,GAAS,EAAE,gBAAgB,EAClC,YAAaC,GAAe,EAAE,sBAAsB,EACpD,OAAAc,EACC,GAAGP,CAAA,CAAA,CAGV,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as Q } from "react/jsx-runtime";
2
2
  import { forwardRef as U, useState as V } from "react";
3
3
  import { clsx as d } from "clsx";
4
- import { b as W } from "./Icon-B7DJn8Tw.js";
5
- import { a as X } from "./ConfigProvider-DtyUlWk6.js";
4
+ import { b as W } from "./Icon-DMMO32p6.js";
5
+ import { a as X } from "./ConfigProvider-bXX8dnhY.js";
6
6
  const w = (s, t) => Array.from({ length: Math.max(t - s + 1, 0) }, (l, a) => s + a);
7
7
  function Y({
8
8
  count: s,
@@ -136,4 +136,4 @@ const Z = "_pagination_889w0_3", y = "_list_889w0_8", u = "_item_889w0_18", C =
136
136
  export {
137
137
  ga as P
138
138
  };
139
- //# sourceMappingURL=Pagination-BNJdqcu4.js.map
139
+ //# sourceMappingURL=Pagination-CLjNwqie.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination-BNJdqcu4.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAg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,QAGH8C;AAAA,UACC;AAAA,UACA;AAAA,UACAL,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC2B,EAAQ,QAAQ,QAAQL,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
1
+ {"version":3,"file":"Pagination-CLjNwqie.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAClB,GAA6C;AAC3C,MAAIH,KAAS,EAAG,QAAO,CAAA;AAGvB,QAAMI,IAAaV,EAAM,GAAG,KAAK,IAAIS,GAAeH,CAAK,CAAC,GACpDK,IAAWX,EAAM,KAAK,IAAIM,IAAQG,IAAgB,GAAGA,IAAgB,CAAC,GAAGH,CAAK,GAG9EM,IAAgB,KAAK;AAAA,IACzB,KAAK,IAAIL,IAAOC,GAAcF,IAAQG,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAC1EC,IAAgB;AAAA,EAAA,GAEZI,IAAc,KAAK;AAAA,IACvB,KAAK,IAAIN,IAAOC,GAAcC,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAClEG,EAAS,SAAS,IAAIA,EAAS,CAAC,IAAI,IAAIL,IAAQ;AAAA,EAAA;AAGlD,SAAO;AAAA,IACL,GAAGI;AAAA;AAAA,IAEH,GAAIE,IAAgBH,IAAgB,IAC/B,CAAC,gBAAgB,IAClBA,IAAgB,IAAIH,IAAQG,IAC1B,CAACA,IAAgB,CAAC,IAClB,CAAA;AAAA,IACN,GAAGT,EAAMY,GAAeC,CAAW;AAAA;AAAA,IAEnC,GAAIA,IAAcP,IAAQG,IAAgB,IACrC,CAAC,cAAc,IAChBH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ACC,MAAK;AAAA,cACL,WAAWE,EAAKD,EAAO,MAAMI,MAASrB,KAAWiB,EAAO,QAAQ;AAAA,cAChE,cAAYb,EAAE,mBAAmB,EAAE,MAAMiB,GAAM;AAAA,cAC/C,gBAAcA,MAASrB,IAAU,SAAS;AAAA,cAC1C,UAAAX;AAAA,cACA,SAAS,MAAMY,EAAGoB,CAAI;AAAA,cAErB,UAAAA;AAAA,YAAA;AAAA,UAAA,EACH,GAVOA,CAWT,IAEA,gBAAAL,EAAC,QAAwB,WAAWC,EAAO,MAAM,eAAW,IAC1D,4BAAC,QAAA,EAAK,WAAWA,EAAO,UAAU,UAAA,IAAA,CAAC,KAD5B,GAAGI,CAAI,IAAI1D,CAAC,EAErB;AAAA,QAAA;AAAA,QAGH8C;AAAA,UACC;AAAA,UACA;AAAA,UACAL,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC2B,EAAQ,QAAQ,QAAQL,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),P=require("react"),d=require("clsx"),U=require("./Icon-CBg21lKA.cjs"),V=require("./ConfigProvider-CYSpuSMJ.cjs"),x=(e,t)=>Array.from({length:Math.max(t-e+1,0)},(l,s)=>e+s);function W({count:e,page:t,siblingCount:l=1,boundaryCount:s=1}){if(e<=0)return[];const _=x(1,Math.min(s,e)),p=x(Math.max(e-s+1,s+1),e),m=Math.max(Math.min(t-l,e-s-l*2-1),s+2),g=Math.min(Math.max(t+l,s+l*2+2),p.length>0?p[0]-2:e-1);return[..._,...m>s+2?["start-ellipsis"]:s+1<e-s?[s+1]:[],...x(m,g),...g<e-s-1?["end-ellipsis"]:e-s>s?[e-s]:[],...p]}const X="_pagination_889w0_3",Y="_list_889w0_8",Z="_item_889w0_18",u="_sm_889w0_28",y="_md_889w0_33",C="_lg_889w0_38",ss="_page_889w0_45",es="_selected_889w0_65",as="_outlined_889w0_82",ts="_rounded_889w0_98",is="_arrow_889w0_26",ls="_flip_889w0_109",ns="_ellipsis_889w0_114",a={pagination:X,list:Y,item:Z,sm:u,md:y,lg:C,page:ss,selected:es,outlined:as,rounded:ts,arrow:is,flip:ls,ellipsis:ns},q=(e,t,l)=>Math.min(Math.max(e,t),l),rs=P.forwardRef(function({count:t,page:l,defaultPage:s=1,onChange:_,siblingCount:p=1,boundaryCount:m=1,showFirstButton:g=!1,showLastButton:$=!1,hidePrevButton:z=!1,hideNextButton:A=!1,variant:I="outlined",size:w="md",color:h="accent",rounded:L=!1,disabled:j=!1,className:R,style:S,"aria-label":k,...b},E){const v=l!==void 0,[T,B]=P.useState(s),M=Math.max(t,1),n=q(v?l:T,1,M),N=i=>{const c=q(i,1,M);c!==n&&(v||B(c),_==null||_(c))},o=V.useT(),D=k??o("pagination.label"),F=W({count:t,page:n,siblingCount:p,boundaryCount:m}),G={"--tz-btn-rgb":`var(--tz-color-${h}-rgb)`,"--tz-btn-on":`var(--tz-color-${h}-contrast, #fff)`,...S},f=(i,c,H,J,K,O,Q=!1)=>K?null:r.jsx("li",{className:a.item,children:r.jsx("button",{type:"button",className:d.clsx(a.page,a.arrow),"aria-label":H,disabled:j||O,onClick:()=>N(J),children:r.jsx(U.Icon,{name:c,size:w,className:Q?a.flip:void 0})})},i);return r.jsx("nav",{ref:E,"aria-label":D,className:d.clsx(a.pagination,a[I],a[w],L&&a.rounded,R),style:G,...b,children:r.jsxs("ul",{className:a.list,children:[g&&f("first","Previous",o("pagination.first"),1,!1,n<=1),f("prev","ArrowLeft",o("pagination.previous"),n-1,z,n<=1),F.map((i,c)=>typeof i=="number"?r.jsx("li",{className:a.item,children:r.jsx("button",{type:"button",className:d.clsx(a.page,i===n&&a.selected),"aria-label":o("pagination.page",{page:i}),"aria-current":i===n?"page":void 0,disabled:j,onClick:()=>N(i),children:i})},i):r.jsx("li",{className:a.item,"aria-hidden":!0,children:r.jsx("span",{className:a.ellipsis,children:"…"})},`${i}-${c}`)),f("next","ArrowLeft",o("pagination.next"),n+1,A,n>=t,!0),$&&f("last","Next",o("pagination.last"),t,!1,n>=t)]})})});exports.Pagination=rs;
2
- //# sourceMappingURL=Pagination-DkmfEmgK.cjs.map
1
+ "use strict";const r=require("react/jsx-runtime"),P=require("react"),d=require("clsx"),U=require("./Icon-BoQmbW7j.cjs"),V=require("./ConfigProvider-BFhkb0BV.cjs"),x=(e,t)=>Array.from({length:Math.max(t-e+1,0)},(l,s)=>e+s);function W({count:e,page:t,siblingCount:l=1,boundaryCount:s=1}){if(e<=0)return[];const _=x(1,Math.min(s,e)),p=x(Math.max(e-s+1,s+1),e),m=Math.max(Math.min(t-l,e-s-l*2-1),s+2),g=Math.min(Math.max(t+l,s+l*2+2),p.length>0?p[0]-2:e-1);return[..._,...m>s+2?["start-ellipsis"]:s+1<e-s?[s+1]:[],...x(m,g),...g<e-s-1?["end-ellipsis"]:e-s>s?[e-s]:[],...p]}const X="_pagination_889w0_3",Y="_list_889w0_8",Z="_item_889w0_18",u="_sm_889w0_28",y="_md_889w0_33",C="_lg_889w0_38",ss="_page_889w0_45",es="_selected_889w0_65",as="_outlined_889w0_82",ts="_rounded_889w0_98",is="_arrow_889w0_26",ls="_flip_889w0_109",ns="_ellipsis_889w0_114",a={pagination:X,list:Y,item:Z,sm:u,md:y,lg:C,page:ss,selected:es,outlined:as,rounded:ts,arrow:is,flip:ls,ellipsis:ns},q=(e,t,l)=>Math.min(Math.max(e,t),l),rs=P.forwardRef(function({count:t,page:l,defaultPage:s=1,onChange:_,siblingCount:p=1,boundaryCount:m=1,showFirstButton:g=!1,showLastButton:$=!1,hidePrevButton:z=!1,hideNextButton:A=!1,variant:I="outlined",size:w="md",color:h="accent",rounded:L=!1,disabled:j=!1,className:R,style:S,"aria-label":k,...b},E){const v=l!==void 0,[T,B]=P.useState(s),M=Math.max(t,1),n=q(v?l:T,1,M),N=i=>{const c=q(i,1,M);c!==n&&(v||B(c),_==null||_(c))},o=V.useT(),D=k??o("pagination.label"),F=W({count:t,page:n,siblingCount:p,boundaryCount:m}),G={"--tz-btn-rgb":`var(--tz-color-${h}-rgb)`,"--tz-btn-on":`var(--tz-color-${h}-contrast, #fff)`,...S},f=(i,c,H,J,K,O,Q=!1)=>K?null:r.jsx("li",{className:a.item,children:r.jsx("button",{type:"button",className:d.clsx(a.page,a.arrow),"aria-label":H,disabled:j||O,onClick:()=>N(J),children:r.jsx(U.Icon,{name:c,size:w,className:Q?a.flip:void 0})})},i);return r.jsx("nav",{ref:E,"aria-label":D,className:d.clsx(a.pagination,a[I],a[w],L&&a.rounded,R),style:G,...b,children:r.jsxs("ul",{className:a.list,children:[g&&f("first","Previous",o("pagination.first"),1,!1,n<=1),f("prev","ArrowLeft",o("pagination.previous"),n-1,z,n<=1),F.map((i,c)=>typeof i=="number"?r.jsx("li",{className:a.item,children:r.jsx("button",{type:"button",className:d.clsx(a.page,i===n&&a.selected),"aria-label":o("pagination.page",{page:i}),"aria-current":i===n?"page":void 0,disabled:j,onClick:()=>N(i),children:i})},i):r.jsx("li",{className:a.item,"aria-hidden":!0,children:r.jsx("span",{className:a.ellipsis,children:"…"})},`${i}-${c}`)),f("next","ArrowLeft",o("pagination.next"),n+1,A,n>=t,!0),$&&f("last","Next",o("pagination.last"),t,!1,n>=t)]})})});exports.Pagination=rs;
2
+ //# sourceMappingURL=Pagination-HtS5gPnd.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination-DkmfEmgK.cjs","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":"mKAmBMA,EAAQ,CAACC,EAAeC,IAC5B,MAAM,KAAK,CAAE,OAAQ,KAAK,IAAIA,EAAMD,EAAQ,EAAG,CAAC,CAAA,EAAK,CAACE,EAAGC,IAAMH,EAAQG,CAAC,EAOnE,SAASC,EAAgB,CAC9B,MAAAC,EACA,KAAAC,EACA,aAAAC,EAAe,EACf,cAAAC,EAAgB,CAClB,EAA6C,CAC3C,GAAIH,GAAS,EAAG,MAAO,CAAA,EAGvB,MAAMI,EAAaV,EAAM,EAAG,KAAK,IAAIS,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,EAC3ES,EACC,OACA,YACAL,EAAE,qBAAqB,EACvBJ,EAAU,EACVjB,EACAiB,GAAW,CAAA,EAEZO,EAAM,IAAI,CAACc,EAAM1D,IAChB,OAAO0D,GAAS,SACdL,EAAAA,IAAC,KAAA,CAAc,UAAWC,EAAO,KAC/B,SAAAD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWE,EAAAA,KAAKD,EAAO,KAAMI,IAASrB,GAAWiB,EAAO,QAAQ,EAChE,aAAYb,EAAE,kBAAmB,CAAE,KAAMiB,EAAM,EAC/C,eAAcA,IAASrB,EAAU,OAAS,OAC1C,SAAAX,EACA,QAAS,IAAMY,EAAGoB,CAAI,EAErB,SAAAA,CAAA,CAAA,CACH,EAVOA,CAWT,EAEAL,EAAAA,IAAC,MAAwB,UAAWC,EAAO,KAAM,cAAW,GAC1D,eAAC,OAAA,CAAK,UAAWA,EAAO,SAAU,SAAA,GAAA,CAAC,GAD5B,GAAGI,CAAI,IAAI1D,CAAC,EAErB,CAAA,EAGH8C,EACC,OACA,YACAL,EAAE,iBAAiB,EACnBJ,EAAU,EACVhB,EACAgB,GAAWnC,EACX,EAAA,EAEDiB,GACC2B,EAAQ,OAAQ,OAAQL,EAAE,iBAAiB,EAAGvC,EAAO,GAAOmC,GAAWnC,CAAK,CAAA,CAAA,CAChF,CAAA,CAAA,CAGN,CAAC"}
1
+ {"version":3,"file":"Pagination-HtS5gPnd.cjs","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":"mKAmBMA,EAAQ,CAACC,EAAeC,IAC5B,MAAM,KAAK,CAAE,OAAQ,KAAK,IAAIA,EAAMD,EAAQ,EAAG,CAAC,CAAA,EAAK,CAACE,EAAGC,IAAMH,EAAQG,CAAC,EAOnE,SAASC,EAAgB,CAC9B,MAAAC,EACA,KAAAC,EACA,aAAAC,EAAe,EACf,cAAAC,EAAgB,CAClB,EAA6C,CAC3C,GAAIH,GAAS,EAAG,MAAO,CAAA,EAGvB,MAAMI,EAAaV,EAAM,EAAG,KAAK,IAAIS,EAAeH,CAAK,CAAC,EACpDK,EAAWX,EAAM,KAAK,IAAIM,EAAQG,EAAgB,EAAGA,EAAgB,CAAC,EAAGH,CAAK,EAG9EM,EAAgB,KAAK,IACzB,KAAK,IAAIL,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AAAA,IAAC,KAAA,CAAc,UAAWC,EAAO,KAC/B,SAAAD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWE,EAAAA,KAAKD,EAAO,KAAMI,IAASrB,GAAWiB,EAAO,QAAQ,EAChE,aAAYb,EAAE,kBAAmB,CAAE,KAAMiB,EAAM,EAC/C,eAAcA,IAASrB,EAAU,OAAS,OAC1C,SAAAX,EACA,QAAS,IAAMY,EAAGoB,CAAI,EAErB,SAAAA,CAAA,CAAA,CACH,EAVOA,CAWT,EAEAL,EAAAA,IAAC,MAAwB,UAAWC,EAAO,KAAM,cAAW,GAC1D,eAAC,OAAA,CAAK,UAAWA,EAAO,SAAU,SAAA,GAAA,CAAC,GAD5B,GAAGI,CAAI,IAAI1D,CAAC,EAErB,CAAA,EAGH8C,EACC,OACA,YACAL,EAAE,iBAAiB,EACnBJ,EAAU,EACVhB,EACAgB,GAAWnC,EACX,EAAA,EAEDiB,GACC2B,EAAQ,OAAQ,OAAQL,EAAE,iBAAiB,EAAGvC,EAAO,GAAOmC,GAAWnC,CAAK,CAAA,CAAA,CAChF,CAAA,CAAA,CAGN,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),y=require("clsx"),_=require("./formContext-bTWrqdEV.cjs"),z=require("./ColorPicker-BaAdcqR9.cjs"),B=require("./ColorRamp-BCy8a7ks.cjs"),h="_root_bbykz_3",v={root:h},w=l.forwardRef(function({rampName:u,paletteOptions:a,rampSize:d="md",hideRamp:x=!1,showBounds:m=!0,opaque:f=!0,onCopyStep:q,value:o,defaultValue:s,onChange:r,name:t,className:C,style:p,...F},P){const c=_.useFormContext(),n=!!(c&&t),[j,R]=l.useState(s??""),b=o!==void 0?o:n?c.values[t]??"":j,k=i=>{o===void 0&&!n&&R(i),r==null||r(i)};return e.jsxs("div",{ref:P,className:y.clsx(v.root,C),style:p,children:[e.jsx(z.ColorPicker,{...F,name:t,value:o,defaultValue:s,onChange:k,alpha:!f}),!x&&e.jsx(B.ColorRamp,{baseColor:b,name:u??t??"color",options:a,size:d,showBounds:m,onCopy:q})]})});exports.PaletteField=w;
2
- //# sourceMappingURL=PaletteField-DqZl1mK0.cjs.map
1
+ "use strict";const e=require("react/jsx-runtime"),l=require("react"),y=require("clsx"),_=require("./formContext-bTWrqdEV.cjs"),z=require("./ColorPicker-_RBW51XB.cjs"),B=require("./ColorRamp-DuO7gkru.cjs"),h="_root_bbykz_3",v={root:h},w=l.forwardRef(function({rampName:u,paletteOptions:a,rampSize:d="md",hideRamp:x=!1,showBounds:m=!0,opaque:f=!0,onCopyStep:q,value:o,defaultValue:s,onChange:r,name:t,className:C,style:p,...F},P){const c=_.useFormContext(),n=!!(c&&t),[j,R]=l.useState(s??""),b=o!==void 0?o:n?c.values[t]??"":j,k=i=>{o===void 0&&!n&&R(i),r==null||r(i)};return e.jsxs("div",{ref:P,className:y.clsx(v.root,C),style:p,children:[e.jsx(z.ColorPicker,{...F,name:t,value:o,defaultValue:s,onChange:k,alpha:!f}),!x&&e.jsx(B.ColorRamp,{baseColor:b,name:u??t??"color",options:a,size:d,showBounds:m,onCopy:q})]})});exports.PaletteField=w;
2
+ //# sourceMappingURL=PaletteField-BSgx5pxh.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaletteField-DqZl1mK0.cjs","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /**\n * Show the ramp's \"Lightest … Darkest\" row (see `ColorRamp.showBounds`). Default `true`. Ignored\n * with `hideRamp`.\n */\n showBounds?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays unless\n * `showBounds={false}`). `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha\n * slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n showBounds = true,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n showBounds={showBounds}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","showBounds","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":"0OAwCaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,SAAAC,EACA,eAAAC,EACA,SAAAC,EAAW,KACX,SAAAC,EAAW,GACX,WAAAC,EAAa,GACb,OAAAC,EAAS,GACT,WAAAC,EACA,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,KAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQL,GAC9B,CAACQ,EAAUC,CAAW,EAAIC,EAAAA,SAAiBZ,GAAgB,EAAE,EAC7Da,EACJd,IAAU,OACNA,EACAU,EACIF,EAAM,OAAOL,CAAK,GAA4B,GAChDQ,EAEFI,EAAgBC,GAAkB,CAElChB,IAAU,QAAa,CAACU,KAAyBM,CAAK,EAC1Dd,GAAA,MAAAA,EAAWc,EACb,EAEA,OACEC,OAAC,OAAI,IAAAV,EAAU,UAAWW,EAAAA,KAAKC,EAAO,KAAMf,CAAS,EAAG,MAAAC,EACtD,SAAA,CAAAe,EAAAA,IAACC,EAAAA,YAAA,CACE,GAAGf,EACJ,KAAAH,EACA,MAAAH,EACA,aAAAC,EACA,SAAUc,EACV,MAAO,CAACjB,CAAA,CAAA,EAET,CAACF,GACAwB,EAAAA,IAACE,EAAAA,UAAA,CACC,UAAWR,EACX,KAAMrB,GAAYU,GAAQ,QAC1B,QAAST,EACT,KAAMC,EACN,WAAAE,EACA,OAAQE,CAAA,CAAA,CACV,EAEJ,CAEJ,CAAC"}
1
+ {"version":3,"file":"PaletteField-BSgx5pxh.cjs","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /**\n * Show the ramp's \"Lightest … Darkest\" row (see `ColorRamp.showBounds`). Default `true`. Ignored\n * with `hideRamp`.\n */\n showBounds?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays unless\n * `showBounds={false}`). `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha\n * slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n showBounds = true,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n showBounds={showBounds}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","showBounds","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":"0OAwCaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,SAAAC,EACA,eAAAC,EACA,SAAAC,EAAW,KACX,SAAAC,EAAW,GACX,WAAAC,EAAa,GACb,OAAAC,EAAS,GACT,WAAAC,EACA,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,KAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQL,GAC9B,CAACQ,EAAUC,CAAW,EAAIC,EAAAA,SAAiBZ,GAAgB,EAAE,EAC7Da,EACJd,IAAU,OACNA,EACAU,EACIF,EAAM,OAAOL,CAAK,GAA4B,GAChDQ,EAEFI,EAAgBC,GAAkB,CAElChB,IAAU,QAAa,CAACU,KAAyBM,CAAK,EAC1Dd,GAAA,MAAAA,EAAWc,EACb,EAEA,OACEC,OAAC,OAAI,IAAAV,EAAU,UAAWW,EAAAA,KAAKC,EAAO,KAAMf,CAAS,EAAG,MAAAC,EACtD,SAAA,CAAAe,EAAAA,IAACC,EAAAA,YAAA,CACE,GAAGf,EACJ,KAAAH,EACA,MAAAH,EACA,aAAAC,EACA,SAAUc,EACV,MAAO,CAACjB,CAAA,CAAA,EAET,CAACF,GACAwB,EAAAA,IAACE,EAAAA,UAAA,CACC,UAAWR,EACX,KAAMrB,GAAYU,GAAQ,QAC1B,QAAST,EACT,KAAMC,EACN,WAAAE,EACA,OAAQE,CAAA,CAAA,CACV,EAEJ,CAEJ,CAAC"}
@@ -2,8 +2,8 @@ import { jsxs as k, jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as z, useState as B } from "react";
3
3
  import { clsx as R } from "clsx";
4
4
  import { u as h } from "./formContext-B7ln1Miy.js";
5
- import { C as v } from "./ColorPicker-CwLivdAt.js";
6
- import { C as w } from "./ColorRamp-DbFOsspz.js";
5
+ import { C as v } from "./ColorPicker-C4slmEZC.js";
6
+ import { C as w } from "./ColorRamp-DQZZiE5I.js";
7
7
  const I = "_root_bbykz_3", N = {
8
8
  root: I
9
9
  }, J = z(function({
@@ -53,4 +53,4 @@ const I = "_root_bbykz_3", N = {
53
53
  export {
54
54
  J as P
55
55
  };
56
- //# sourceMappingURL=PaletteField-Cdky6Zka.js.map
56
+ //# sourceMappingURL=PaletteField-Bk7cnSla.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaletteField-Cdky6Zka.js","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /**\n * Show the ramp's \"Lightest … Darkest\" row (see `ColorRamp.showBounds`). Default `true`. Ignored\n * with `hideRamp`.\n */\n showBounds?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays unless\n * `showBounds={false}`). `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha\n * slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n showBounds = true,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n showBounds={showBounds}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","showBounds","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":";;;;;;;;GAwCaA,IAAeC,EAA8C,SACxE;AAAA,EACE,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,QAAAC,IAAS;AAAA,EACT,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IAAOC,EAAA,GACPC,IAAc,GAAQF,KAAQL,IAC9B,CAACQ,GAAUC,CAAW,IAAIC,EAAiBZ,KAAgB,EAAE,GAC7Da,IACJd,MAAU,SACNA,IACAU,IACIF,EAAM,OAAOL,CAAK,KAA4B,KAChDQ,GAEFI,IAAe,CAACC,MAAkB;AAEtC,IAAIhB,MAAU,UAAa,CAACU,OAAyBM,CAAK,GAC1Dd,KAAA,QAAAA,EAAWc;AAAA,EACb;AAEA,SACE,gBAAAC,EAAC,SAAI,KAAAV,GAAU,WAAWW,EAAKC,EAAO,MAAMf,CAAS,GAAG,OAAAC,GACtD,UAAA;AAAA,IAAA,gBAAAe;AAAA,MAACC;AAAA,MAAA;AAAA,QACE,GAAGf;AAAA,QACJ,MAAAH;AAAA,QACA,OAAAH;AAAA,QACA,cAAAC;AAAA,QACA,UAAUc;AAAA,QACV,OAAO,CAACjB;AAAA,MAAA;AAAA,IAAA;AAAA,IAET,CAACF,KACA,gBAAAwB;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWR;AAAA,QACX,MAAMrB,KAAYU,KAAQ;AAAA,QAC1B,SAAST;AAAA,QACT,MAAMC;AAAA,QACN,YAAAE;AAAA,QACA,QAAQE;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GAEJ;AAEJ,CAAC;"}
1
+ {"version":3,"file":"PaletteField-Bk7cnSla.js","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /**\n * Show the ramp's \"Lightest … Darkest\" row (see `ColorRamp.showBounds`). Default `true`. Ignored\n * with `hideRamp`.\n */\n showBounds?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays unless\n * `showBounds={false}`). `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha\n * slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n showBounds = true,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n showBounds={showBounds}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","showBounds","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":";;;;;;;;GAwCaA,IAAeC,EAA8C,SACxE;AAAA,EACE,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,QAAAC,IAAS;AAAA,EACT,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IAAOC,EAAA,GACPC,IAAc,GAAQF,KAAQL,IAC9B,CAACQ,GAAUC,CAAW,IAAIC,EAAiBZ,KAAgB,EAAE,GAC7Da,IACJd,MAAU,SACNA,IACAU,IACIF,EAAM,OAAOL,CAAK,KAA4B,KAChDQ,GAEFI,IAAe,CAACC,MAAkB;AAEtC,IAAIhB,MAAU,UAAa,CAACU,OAAyBM,CAAK,GAC1Dd,KAAA,QAAAA,EAAWc;AAAA,EACb;AAEA,SACE,gBAAAC,EAAC,SAAI,KAAAV,GAAU,WAAWW,EAAKC,EAAO,MAAMf,CAAS,GAAG,OAAAC,GACtD,UAAA;AAAA,IAAA,gBAAAe;AAAA,MAACC;AAAA,MAAA;AAAA,QACE,GAAGf;AAAA,QACJ,MAAAH;AAAA,QACA,OAAAH;AAAA,QACA,cAAAC;AAAA,QACA,UAAUc;AAAA,QACV,OAAO,CAACjB;AAAA,MAAA;AAAA,IAAA;AAAA,IAET,CAACF,KACA,gBAAAwB;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWR;AAAA,QACX,MAAMrB,KAAYU,KAAQ;AAAA,QAC1B,SAAST;AAAA,QACT,MAAMC;AAAA,QACN,YAAAE;AAAA,QACA,QAAQE;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GAEJ;AAEJ,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";var we=Object.create;var ae=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ue=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!$e.call(t,r)&&r!==o&&ae(t,r,{get:()=>e[r],enumerable:!(s=Ae(e,r))||s.enumerable});return t};var Me=(t,e,o)=>(o=t!=null?we(qe(t)):{},Ue(e||!t||!t.__esModule?ae(o,"default",{value:t,enumerable:!0}):o,t));const c=require("react/jsx-runtime"),u=require("react"),z=require("clsx"),fe=require("./useOptionalPeer-9Fkx5Leb.cjs"),ke=require("./formContext-bTWrqdEV.cjs"),Ee=require("./Icon-CBg21lKA.cjs"),Ve=require("./TextField-D4s2hGSd.cjs"),ce=require("./useOptionMenu-6ZffgbYG.cjs"),ue=require("./Typography-d97DdbNd.cjs"),v=require("./TextField.module-DsNCo8vN.cjs"),de=require("./ConfigProvider-CYSpuSMJ.cjs"),G=fe.optionalPeer("libphonenumber-js","PhoneField",()=>import("libphonenumber-js")),g=()=>G.get();let We;function Be(){return We??(We=g().getCountries())}const D=t=>g().getCountryCallingCode(t);function Ge(t){const e=G.get();return e?typeof t=="string"&&t.trim()!==""&&e.isValidPhoneNumber(t):(G.load(),!1)}function pe(t){return String.fromCodePoint(...[...t.toUpperCase()].map(e=>127462+e.charCodeAt(0)-65))}const W=new Map;function he(t,e){var o;if(!W.has(e))try{W.set(e,new Intl.DisplayNames([e],{type:"region"}))}catch{W.set(e,null)}try{return((o=W.get(e))==null?void 0:o.of(t))??t}catch{return t}}const Le={1:"US",7:"RU",39:"IT",44:"GB",47:"NO",61:"AU",212:"MA",262:"RE",290:"SH",358:"FI",590:"GP",599:"CW"},Ye={ka:"GE",en:"US",es:"ES",de:"DE",it:"IT",fr:"FR",ru:"RU"};function He(t,e){var d,a;const[o,s]=t.split("-"),r=typeof navigator<"u"?(a=(d=navigator.language)==null?void 0:d.split("-")[1])==null?void 0:a.toUpperCase():void 0;return[s==null?void 0:s.toUpperCase(),Ye[o==null?void 0:o.toLowerCase()],r,"US"].find(h=>h&&e.includes(h))??e[0]}const Ke=t=>t.replace(/\D/g,"");function ye(t,e,o,s){return D(e)===t?e:[o,Le[t],...s.filter(i=>D(i)===t)].find(i=>i&&s.includes(i))??e}function B(t,e,o,s){const r=t.trimStart(),i=Ke(r);if(!i)return{e164:"",country:e,national:"",valid:!1,display:r.startsWith("+")?"+":""};if(r.startsWith("+")){const _=new(g()).AsYouType,N=_.input(`+${i}`),b=_.getCallingCode(),x=g().parsePhoneNumberFromString(`+${i}`),R=b?ye(b,e,(x==null?void 0:x.country)??_.getCountry(),s):e,q=`+${i}`;return{e164:q,country:R,national:b?i.slice(b.length):"",valid:g().isValidPhoneNumber(q),display:N}}const d=D(e),a=g().parsePhoneNumberFromString(i,e),h=(a==null?void 0:a.nationalNumber)??i.replace(/^0+/,""),P=h?`+${d}${h}`:"",w=o==="international"?new(g()).AsYouType(e).input(`+${d}${h}`):new(g()).AsYouType(e).input(i);return{e164:P,country:e,national:h,valid:P!==""&&g().isValidPhoneNumber(P),display:w}}function ee(t,e,o,s){if(!t)return{country:e,display:""};const r=g().parsePhoneNumberFromString(t);if(r)return{country:ye(r.countryCallingCode,e,r.country,s),display:o==="national"?r.formatNational():r.formatInternational()};const i=B(t,e,"international",s),d=o==="national"&&i.national?new(g()).AsYouType(i.country).input(i.national):i.display;return{country:i.country,display:d}}function Je(t,e){if(e<=0)return t.startsWith("+")?1:0;let o=0;for(let s=0;s<t.length;s++)if(/\d/.test(t[s])&&o++,o===e)return s+1;return t.length}const Qe="_phoneField_1eja1_4",Xe="_country_1eja1_9",Ze="_flag_1eja1_37",ze="_code_1eja1_42",et="_chevron_1eja1_46",tt="_chevronOpen_1eja1_50",nt="_dial_1eja1_55",F={phoneField:Qe,country:Xe,flag:Ze,code:ze,chevron:et,chevronOpen:tt,dial:nt},ot=u.forwardRef(function({value:e,defaultValue:o,onChange:s,defaultCountry:r,countries:i,preferredCountries:d=[],format:a="national",label:h,helperText:P,error:w,required:_,size:N="md",fullWidth:b=!0,name:x,disabled:R=!1,id:q,className:ge,style:me,onBlur:L,placeholder:ve,...xe},A){const O=de.useT(),{language:I}=de.useLanguage(),f=i??Be(),Ce=u.useId(),$=q??Ce,te=`${$}-helper`,U=ke.useFormContext(),M=!!(U&&x),C=M?U.field(x):void 0,[Fe,Ne]=u.useState(o??""),T=e!==void 0?e:M?U.values[x]??"":Fe,Y=w??(C==null?void 0:C.error)??!1,H=P??(C==null?void 0:C.helperText),ne=u.useMemo(()=>r&&f.includes(r)?r:He(I,f),[r,I,f.join()]),[S,K]=u.useState(()=>ee(T,ne,a,f).country),[k,oe]=u.useState(()=>ee(T,ne,a,f).display),J=u.useRef(T);if(J.current!==T){J.current=T;const n=ee(T,S,a,f);K(n.country),oe(n.display)}const Q=u.useRef(null),Se=u.useCallback(n=>{Q.current=n,typeof A=="function"?A(n):A&&(A.current=n)},[A]),X=u.useRef(null);u.useLayoutEffect(()=>{var y;const n=X.current;n!=null&&(X.current=null,(y=Q.current)==null||y.setSelectionRange(n,n))});const se=n=>{J.current=n.e164,oe(n.display),n.country!==S&&K(n.country),e===void 0&&!M&&Ne(n.e164),M&&U.setValue(x,n.e164),s==null||s(n.e164,{country:n.country,national:n.national,valid:n.valid})},je=n=>{const y=n.target;let p=y.value;const l=y.selectionStart??p.length;let m=p.slice(0,l).replace(/\D/g,"").length;const Ie=k.replace(/\D/g,"");if(p.length<k.length&&p.replace(/\D/g,"")===Ie&&m>0){let Te=0,E=-1;for(let V=0;V<p.length;V++)if(/\d/.test(p[V])&&++Te===m){E=V;break}E>=0&&(p=p.slice(0,E)+p.slice(E+1)),m-=1}const Z=B(p,S,a,f);X.current=l>=y.value.length?Z.display.length:Je(Z.display,m),se(Z)},re=u.useRef(null),Pe=u.useMemo(()=>{const n=l=>{const m=D(l);return{value:l,label:he(l,I),icon:c.jsx("span",{className:F.flag,"aria-hidden":"true",children:pe(l)}),keywords:[l,m,`+${m}`],trailing:c.jsxs("span",{className:F.dial,children:["+",m]})}},y=d.filter(l=>f.includes(l)).map(n),p=f.filter(l=>!d.includes(l)).map(n).sort((l,m)=>l.label.localeCompare(m.label,I));return y.length===0?p:[...y.map(l=>({...l,group:O("phoneField.suggested")})),...p.map(l=>({...l,group:O("phoneField.allCountries")}))]},[f,d,I,O]),_e=n=>{const y=B(k,S,a,f).national;K(n),se({...B(y,n,a,f),country:n})},j=ce.useOptionMenu({idBase:`${$}-country`,options:Pe,isSelected:n=>n.value===S,onPick:n=>_e(n.value),searchable:!0,disabled:R,focusRef:Q}),be=n=>{C==null||C.onBlur(n),L==null||L(n)},Re=H!=null?te:void 0,ie=N==="sm"?16:N==="md"?14:12,le=D(S),Oe=he(S,I);return c.jsxs("div",{className:z.clsx(v.fieldStyles.field,v.fieldStyles[N],b&&v.fieldStyles.fullWidth,Y&&v.fieldStyles.error,R&&v.fieldStyles.disabled,F.phoneField,ge),style:me,children:[h!=null&&c.jsxs("label",{htmlFor:$,className:v.fieldStyles.label,children:[c.jsx(ue.Typography,{as:"span",variant:"bodySmall",color:"muted",children:h}),_&&c.jsx("span",{className:v.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),c.jsxs("div",{ref:re,className:z.clsx(v.fieldStyles.control,F.control),children:[c.jsxs("button",{type:"button",className:F.country,"aria-haspopup":"listbox","aria-expanded":j.open,"aria-controls":j.open?j.listboxId:void 0,"aria-label":`${O("phoneField.country")}: ${Oe} (+${le})`,disabled:R,onClick:j.toggleMenu,onKeyDown:n=>{(n.key==="ArrowDown"||n.key==="ArrowUp")&&!j.open&&(n.preventDefault(),j.openMenu())},children:[c.jsx("span",{className:F.flag,"aria-hidden":"true",children:pe(S)}),a==="national"&&c.jsxs("span",{className:F.code,children:["+",le]}),c.jsx(Ee.Icon,{name:"ArrowDown4",className:z.clsx(F.chevron,j.open&&F.chevronOpen),style:{width:ie,height:ie},"aria-hidden":"true"})]}),c.jsx("input",{ref:Se,id:$,name:x,type:"tel",inputMode:"tel",autoComplete:"tel",className:v.fieldStyles.input,value:k,placeholder:ve,onChange:je,onBlur:be,disabled:R,"aria-invalid":Y||void 0,"aria-describedby":Re,...xe})]}),c.jsx(ce.OptionMenu,{menu:j,anchorRef:re,size:N,searchPlaceholder:O("phoneField.search"),ariaLabel:O("phoneField.country")}),H!=null&&c.jsx(ue.Typography,{as:"span",id:te,variant:"bodySmall",color:Y?"error":"muted",className:v.fieldStyles.helper,children:H})]})}),st=u.forwardRef(function(e,o){const{module:s}=fe.useOptionalPeer(G);if(s)return c.jsx(ot,{ref:o,...e});const{label:r,helperText:i,error:d,required:a,size:h,fullWidth:P=!0,className:w,style:_,placeholder:N}=e;return c.jsx(Ve.TextField,{ref:o,type:"tel",label:r,helperText:i,error:d,required:a,size:h,fullWidth:P,className:w,style:_,placeholder:N,value:e.value??e.defaultValue??"",readOnly:!0,disabled:!0})});exports.PhoneField=st;exports.isValidPhone=Ge;
2
- //# sourceMappingURL=PhoneField-jq-3_i_b.cjs.map
1
+ "use strict";var we=Object.create;var ae=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ue=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!$e.call(t,r)&&r!==o&&ae(t,r,{get:()=>e[r],enumerable:!(s=Ae(e,r))||s.enumerable});return t};var Me=(t,e,o)=>(o=t!=null?we(qe(t)):{},Ue(e||!t||!t.__esModule?ae(o,"default",{value:t,enumerable:!0}):o,t));const c=require("react/jsx-runtime"),u=require("react"),z=require("clsx"),fe=require("./useOptionalPeer-9Fkx5Leb.cjs"),ke=require("./formContext-bTWrqdEV.cjs"),Ee=require("./Icon-BoQmbW7j.cjs"),Ve=require("./TextField-CXDBlP-8.cjs"),ce=require("./useOptionMenu-DS___46k.cjs"),ue=require("./Typography-d97DdbNd.cjs"),v=require("./TextField.module-DsNCo8vN.cjs"),de=require("./ConfigProvider-BFhkb0BV.cjs"),G=fe.optionalPeer("libphonenumber-js","PhoneField",()=>import("libphonenumber-js")),g=()=>G.get();let We;function Be(){return We??(We=g().getCountries())}const D=t=>g().getCountryCallingCode(t);function Ge(t){const e=G.get();return e?typeof t=="string"&&t.trim()!==""&&e.isValidPhoneNumber(t):(G.load(),!1)}function pe(t){return String.fromCodePoint(...[...t.toUpperCase()].map(e=>127462+e.charCodeAt(0)-65))}const W=new Map;function he(t,e){var o;if(!W.has(e))try{W.set(e,new Intl.DisplayNames([e],{type:"region"}))}catch{W.set(e,null)}try{return((o=W.get(e))==null?void 0:o.of(t))??t}catch{return t}}const Le={1:"US",7:"RU",39:"IT",44:"GB",47:"NO",61:"AU",212:"MA",262:"RE",290:"SH",358:"FI",590:"GP",599:"CW"},Ye={ka:"GE",en:"US",es:"ES",de:"DE",it:"IT",fr:"FR",ru:"RU"};function He(t,e){var d,a;const[o,s]=t.split("-"),r=typeof navigator<"u"?(a=(d=navigator.language)==null?void 0:d.split("-")[1])==null?void 0:a.toUpperCase():void 0;return[s==null?void 0:s.toUpperCase(),Ye[o==null?void 0:o.toLowerCase()],r,"US"].find(h=>h&&e.includes(h))??e[0]}const Ke=t=>t.replace(/\D/g,"");function ye(t,e,o,s){return D(e)===t?e:[o,Le[t],...s.filter(i=>D(i)===t)].find(i=>i&&s.includes(i))??e}function B(t,e,o,s){const r=t.trimStart(),i=Ke(r);if(!i)return{e164:"",country:e,national:"",valid:!1,display:r.startsWith("+")?"+":""};if(r.startsWith("+")){const _=new(g()).AsYouType,N=_.input(`+${i}`),b=_.getCallingCode(),x=g().parsePhoneNumberFromString(`+${i}`),R=b?ye(b,e,(x==null?void 0:x.country)??_.getCountry(),s):e,q=`+${i}`;return{e164:q,country:R,national:b?i.slice(b.length):"",valid:g().isValidPhoneNumber(q),display:N}}const d=D(e),a=g().parsePhoneNumberFromString(i,e),h=(a==null?void 0:a.nationalNumber)??i.replace(/^0+/,""),P=h?`+${d}${h}`:"",w=o==="international"?new(g()).AsYouType(e).input(`+${d}${h}`):new(g()).AsYouType(e).input(i);return{e164:P,country:e,national:h,valid:P!==""&&g().isValidPhoneNumber(P),display:w}}function ee(t,e,o,s){if(!t)return{country:e,display:""};const r=g().parsePhoneNumberFromString(t);if(r)return{country:ye(r.countryCallingCode,e,r.country,s),display:o==="national"?r.formatNational():r.formatInternational()};const i=B(t,e,"international",s),d=o==="national"&&i.national?new(g()).AsYouType(i.country).input(i.national):i.display;return{country:i.country,display:d}}function Je(t,e){if(e<=0)return t.startsWith("+")?1:0;let o=0;for(let s=0;s<t.length;s++)if(/\d/.test(t[s])&&o++,o===e)return s+1;return t.length}const Qe="_phoneField_1eja1_4",Xe="_country_1eja1_9",Ze="_flag_1eja1_37",ze="_code_1eja1_42",et="_chevron_1eja1_46",tt="_chevronOpen_1eja1_50",nt="_dial_1eja1_55",F={phoneField:Qe,country:Xe,flag:Ze,code:ze,chevron:et,chevronOpen:tt,dial:nt},ot=u.forwardRef(function({value:e,defaultValue:o,onChange:s,defaultCountry:r,countries:i,preferredCountries:d=[],format:a="national",label:h,helperText:P,error:w,required:_,size:N="md",fullWidth:b=!0,name:x,disabled:R=!1,id:q,className:ge,style:me,onBlur:L,placeholder:ve,...xe},A){const O=de.useT(),{language:I}=de.useLanguage(),f=i??Be(),Ce=u.useId(),$=q??Ce,te=`${$}-helper`,U=ke.useFormContext(),M=!!(U&&x),C=M?U.field(x):void 0,[Fe,Ne]=u.useState(o??""),T=e!==void 0?e:M?U.values[x]??"":Fe,Y=w??(C==null?void 0:C.error)??!1,H=P??(C==null?void 0:C.helperText),ne=u.useMemo(()=>r&&f.includes(r)?r:He(I,f),[r,I,f.join()]),[S,K]=u.useState(()=>ee(T,ne,a,f).country),[k,oe]=u.useState(()=>ee(T,ne,a,f).display),J=u.useRef(T);if(J.current!==T){J.current=T;const n=ee(T,S,a,f);K(n.country),oe(n.display)}const Q=u.useRef(null),Se=u.useCallback(n=>{Q.current=n,typeof A=="function"?A(n):A&&(A.current=n)},[A]),X=u.useRef(null);u.useLayoutEffect(()=>{var y;const n=X.current;n!=null&&(X.current=null,(y=Q.current)==null||y.setSelectionRange(n,n))});const se=n=>{J.current=n.e164,oe(n.display),n.country!==S&&K(n.country),e===void 0&&!M&&Ne(n.e164),M&&U.setValue(x,n.e164),s==null||s(n.e164,{country:n.country,national:n.national,valid:n.valid})},je=n=>{const y=n.target;let p=y.value;const l=y.selectionStart??p.length;let m=p.slice(0,l).replace(/\D/g,"").length;const Ie=k.replace(/\D/g,"");if(p.length<k.length&&p.replace(/\D/g,"")===Ie&&m>0){let Te=0,E=-1;for(let V=0;V<p.length;V++)if(/\d/.test(p[V])&&++Te===m){E=V;break}E>=0&&(p=p.slice(0,E)+p.slice(E+1)),m-=1}const Z=B(p,S,a,f);X.current=l>=y.value.length?Z.display.length:Je(Z.display,m),se(Z)},re=u.useRef(null),Pe=u.useMemo(()=>{const n=l=>{const m=D(l);return{value:l,label:he(l,I),icon:c.jsx("span",{className:F.flag,"aria-hidden":"true",children:pe(l)}),keywords:[l,m,`+${m}`],trailing:c.jsxs("span",{className:F.dial,children:["+",m]})}},y=d.filter(l=>f.includes(l)).map(n),p=f.filter(l=>!d.includes(l)).map(n).sort((l,m)=>l.label.localeCompare(m.label,I));return y.length===0?p:[...y.map(l=>({...l,group:O("phoneField.suggested")})),...p.map(l=>({...l,group:O("phoneField.allCountries")}))]},[f,d,I,O]),_e=n=>{const y=B(k,S,a,f).national;K(n),se({...B(y,n,a,f),country:n})},j=ce.useOptionMenu({idBase:`${$}-country`,options:Pe,isSelected:n=>n.value===S,onPick:n=>_e(n.value),searchable:!0,disabled:R,focusRef:Q}),be=n=>{C==null||C.onBlur(n),L==null||L(n)},Re=H!=null?te:void 0,ie=N==="sm"?16:N==="md"?14:12,le=D(S),Oe=he(S,I);return c.jsxs("div",{className:z.clsx(v.fieldStyles.field,v.fieldStyles[N],b&&v.fieldStyles.fullWidth,Y&&v.fieldStyles.error,R&&v.fieldStyles.disabled,F.phoneField,ge),style:me,children:[h!=null&&c.jsxs("label",{htmlFor:$,className:v.fieldStyles.label,children:[c.jsx(ue.Typography,{as:"span",variant:"bodySmall",color:"muted",children:h}),_&&c.jsx("span",{className:v.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),c.jsxs("div",{ref:re,className:z.clsx(v.fieldStyles.control,F.control),children:[c.jsxs("button",{type:"button",className:F.country,"aria-haspopup":"listbox","aria-expanded":j.open,"aria-controls":j.open?j.listboxId:void 0,"aria-label":`${O("phoneField.country")}: ${Oe} (+${le})`,disabled:R,onClick:j.toggleMenu,onKeyDown:n=>{(n.key==="ArrowDown"||n.key==="ArrowUp")&&!j.open&&(n.preventDefault(),j.openMenu())},children:[c.jsx("span",{className:F.flag,"aria-hidden":"true",children:pe(S)}),a==="national"&&c.jsxs("span",{className:F.code,children:["+",le]}),c.jsx(Ee.Icon,{name:"ArrowDown4",className:z.clsx(F.chevron,j.open&&F.chevronOpen),style:{width:ie,height:ie},"aria-hidden":"true"})]}),c.jsx("input",{ref:Se,id:$,name:x,type:"tel",inputMode:"tel",autoComplete:"tel",className:v.fieldStyles.input,value:k,placeholder:ve,onChange:je,onBlur:be,disabled:R,"aria-invalid":Y||void 0,"aria-describedby":Re,...xe})]}),c.jsx(ce.OptionMenu,{menu:j,anchorRef:re,size:N,searchPlaceholder:O("phoneField.search"),ariaLabel:O("phoneField.country")}),H!=null&&c.jsx(ue.Typography,{as:"span",id:te,variant:"bodySmall",color:Y?"error":"muted",className:v.fieldStyles.helper,children:H})]})}),st=u.forwardRef(function(e,o){const{module:s}=fe.useOptionalPeer(G);if(s)return c.jsx(ot,{ref:o,...e});const{label:r,helperText:i,error:d,required:a,size:h,fullWidth:P=!0,className:w,style:_,placeholder:N}=e;return c.jsx(Ve.TextField,{ref:o,type:"tel",label:r,helperText:i,error:d,required:a,size:h,fullWidth:P,className:w,style:_,placeholder:N,value:e.value??e.defaultValue??"",readOnly:!0,disabled:!0})});exports.PhoneField=st;exports.isValidPhone=Ge;
2
+ //# sourceMappingURL=PhoneField-CzFv2Vci.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneField-jq-3_i_b.cjs","sources":["../src/components/PhoneField/phone.ts","../src/components/PhoneField/PhoneField.tsx"],"sourcesContent":["import type * as PhoneLibModule from 'libphonenumber-js'\nimport type { CountryCode } from 'libphonenumber-js'\nimport { optionalPeer } from '../../hooks/useOptionalPeer'\n\n/**\n * `libphonenumber-js` is an optional peer, loaded **lazily** (see `optionalPeer`) — never imported\n * statically, so apps that don't install it still build + run when they import the barrel. PhoneField\n * waits for it on mount; the helpers below run only once it's loaded (`lib()`).\n */\nexport const phonePeer = optionalPeer<typeof PhoneLibModule>(\n 'libphonenumber-js',\n 'PhoneField',\n () => import('libphonenumber-js'),\n)\nconst lib = () => phonePeer.get()!\n\n/** An ISO-3166 alpha-2 country code, as `libphonenumber-js` knows it (`'GE'`, `'US'`, …). */\nexport type PhoneCountry = CountryCode\n/** How the number is shown in the input while typing (the value is always E.164). */\nexport type PhoneFormat = 'national' | 'international'\n\nlet allCountries: readonly PhoneCountry[] | undefined\n/** Every country `libphonenumber-js` has metadata for (once loaded). */\nexport function getPhoneCountries(): readonly PhoneCountry[] {\n return (allCountries ??= lib().getCountries())\n}\n\n/** The country's calling code without the `+` — `'GE'` → `'995'`. */\nexport const callingCodeOf = (country: PhoneCountry): string => lib().getCountryCallingCode(country)\n\n/**\n * `true` for a complete, valid number (E.164 or any parseable international form). Use it in a schema:\n * `phone: z.string().refine(isValidPhone, 'Enter a valid phone number')`. Needs `libphonenumber-js`\n * loaded — it is once any PhoneField has mounted; before that it starts the load and returns `false`.\n */\nexport function isValidPhone(value: unknown): boolean {\n const loaded = phonePeer.get()\n // not loaded yet (no PhoneField mounted so far) → start loading and report \"not valid\" for now\n if (!loaded) {\n void phonePeer.load()\n return false\n }\n return typeof value === 'string' && value.trim() !== '' && loaded.isValidPhoneNumber(value)\n}\n\n/** A flag emoji from the two regional-indicator letters — no image assets (Windows shows the letters). */\nexport function flagEmoji(country: string): string {\n return String.fromCodePoint(\n ...[...country.toUpperCase()].map((c) => 0x1f1e6 + c.charCodeAt(0) - 65),\n )\n}\n\nconst displayNamesCache = new Map<string, Intl.DisplayNames | null>()\n/** The country's name in `locale` via `Intl.DisplayNames` (no catalog to ship); falls back to the code. */\nexport function countryName(country: string, locale: string): string {\n if (!displayNamesCache.has(locale)) {\n try {\n displayNamesCache.set(locale, new Intl.DisplayNames([locale], { type: 'region' }))\n } catch {\n displayNamesCache.set(locale, null)\n }\n }\n try {\n return displayNamesCache.get(locale)?.of(country) ?? country\n } catch {\n return country\n }\n}\n\n// the main country for a calling code shared by several (a partial \"+44…\" parses as Guernsey otherwise)\nconst MAIN_FOR_CODE: Record<string, PhoneCountry> = {\n '1': 'US',\n '7': 'RU',\n '39': 'IT',\n '44': 'GB',\n '47': 'NO',\n '61': 'AU',\n '212': 'MA',\n '262': 'RE',\n '290': 'SH',\n '358': 'FI',\n '590': 'GP',\n '599': 'CW',\n}\n// base UI language → its usual country, for the default when the locale carries no region\nconst LANGUAGE_COUNTRY: Record<string, PhoneCountry> = {\n ka: 'GE',\n en: 'US',\n es: 'ES',\n de: 'DE',\n it: 'IT',\n fr: 'FR',\n ru: 'RU',\n}\n\n/** The default country: the locale's region → its language's usual country → the browser's region → US. */\nexport function detectCountry(locale: string, allowed: readonly PhoneCountry[]): PhoneCountry {\n const [base, region] = locale.split('-')\n const browser =\n typeof navigator !== 'undefined' ? navigator.language?.split('-')[1]?.toUpperCase() : undefined\n const candidates = [region?.toUpperCase(), LANGUAGE_COUNTRY[base?.toLowerCase()], browser, 'US']\n return (candidates.find((c) => c && allowed.includes(c as PhoneCountry)) ??\n allowed[0]) as PhoneCountry\n}\n\n/** The result of reading what's in the input. */\nexport interface PhoneReading {\n /** The canonical value — `'+995555123456'`, or `''` when empty. */\n e164: string\n /** The country the number belongs to (may switch when a `+code` is typed). */\n country: PhoneCountry\n /** The national significant number — digits only, no trunk `0`. */\n national: string\n /** A complete, valid number. */\n valid: boolean\n /** What the input should show (formatted as you type). */\n display: string\n}\n\nconst digitsOf = (s: string) => s.replace(/\\D/g, '')\n\n/** Which allowed country a `+code…` number belongs to — keep the current one when it shares the code. */\nfunction countryForCode(\n code: string,\n current: PhoneCountry,\n detected: PhoneCountry | undefined,\n allowed: readonly PhoneCountry[],\n): PhoneCountry {\n if (callingCodeOf(current) === code) return current\n const pick = [detected, MAIN_FOR_CODE[code], ...allowed.filter((c) => callingCodeOf(c) === code)]\n return (pick.find((c) => c && allowed.includes(c)) as PhoneCountry | undefined) ?? current\n}\n\n/** Read raw input text → the canonical value + the formatted display, as the user types. */\nexport function readPhoneInput(\n raw: string,\n country: PhoneCountry,\n format: PhoneFormat,\n allowed: readonly PhoneCountry[],\n): PhoneReading {\n const text = raw.trimStart()\n const digits = digitsOf(text)\n if (!digits) {\n return {\n e164: '',\n country,\n national: '',\n valid: false,\n display: text.startsWith('+') ? '+' : '',\n }\n }\n\n // an explicit \"+code…\" (typed or pasted) — the calling code decides the country\n if (text.startsWith('+')) {\n const typer = new (lib().AsYouType)()\n const display = typer.input(`+${digits}`)\n const code = typer.getCallingCode()\n const parsed = lib().parsePhoneNumberFromString(`+${digits}`)\n const next = code\n ? countryForCode(code, country, parsed?.country ?? typer.getCountry(), allowed)\n : country\n const e164 = `+${digits}`\n return {\n e164,\n country: next,\n national: code ? digits.slice(code.length) : '',\n valid: lib().isValidPhoneNumber(e164),\n display,\n }\n }\n\n // national digits under the selected country (a leading trunk \"0\" is dropped from the value)\n const code = callingCodeOf(country)\n const parsed = lib().parsePhoneNumberFromString(digits, country)\n const national = parsed?.nationalNumber ?? digits.replace(/^0+/, '')\n const e164 = national ? `+${code}${national}` : ''\n const display =\n format === 'international'\n ? new (lib().AsYouType)(country).input(`+${code}${national}`)\n : new (lib().AsYouType)(country).input(digits)\n return {\n e164,\n country,\n national,\n valid: e164 !== '' && lib().isValidPhoneNumber(e164),\n display,\n }\n}\n\n/** Derive the country + display from an E.164 value (initial / external value changes). */\nexport function phoneFromValue(\n value: string,\n fallback: PhoneCountry,\n format: PhoneFormat,\n allowed: readonly PhoneCountry[],\n): { country: PhoneCountry; display: string } {\n if (!value) return { country: fallback, display: '' }\n const parsed = lib().parsePhoneNumberFromString(value)\n if (parsed) {\n const country = countryForCode(parsed.countryCallingCode, fallback, parsed.country, allowed)\n return {\n country,\n display: format === 'national' ? parsed.formatNational() : parsed.formatInternational(),\n }\n }\n const reading = readPhoneInput(value, fallback, 'international', allowed)\n const display =\n format === 'national' && reading.national\n ? new (lib().AsYouType)(reading.country).input(reading.national)\n : reading.display\n return { country: reading.country, display }\n}\n\n/** Caret index in `display` right after its `n`-th digit — keeps the caret put while reformatting. */\nexport function caretAfterDigits(display: string, n: number): number {\n if (n <= 0) return display.startsWith('+') ? 1 : 0\n let seen = 0\n for (let i = 0; i < display.length; i++) {\n if (/\\d/.test(display[i])) seen++\n if (seen === n) return i + 1\n }\n return display.length\n}\n","import {\n forwardRef,\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useLanguage, useT } from '../../theme'\nimport { useOptionalPeer } from '../../hooks/useOptionalPeer'\nimport { useFormContext } from '../../form/formContext'\nimport { Icon } from '../Icon'\nimport { TextField } from '../TextField'\nimport { OptionMenu } from '../OptionMenu/OptionMenu'\nimport { useOptionMenu, type SelectOption } from '../OptionMenu/useOptionMenu'\nimport { Typography } from '../Typography'\nimport fieldStyles from '../TextField/TextField.module.css'\nimport {\n callingCodeOf,\n getPhoneCountries,\n caretAfterDigits,\n countryName,\n detectCountry,\n flagEmoji,\n phoneFromValue,\n phonePeer,\n readPhoneInput,\n type PhoneCountry,\n type PhoneFormat,\n} from './phone'\nimport styles from './PhoneField.module.css'\n\nexport type PhoneFieldSize = 'sm' | 'md' | 'lg'\n\n/** Extra details handed to `onChange` alongside the E.164 value. */\nexport interface PhoneFieldChangeMeta {\n /** The number's country (ISO alpha-2). */\n country: PhoneCountry\n /** The national significant number — digits only, no trunk `0`. */\n national: string\n /** A complete, valid number for that country. */\n valid: boolean\n}\n\nexport interface PhoneFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'value' | 'defaultValue' | 'onChange' | 'type' | 'size' | 'color'\n> {\n /** The number in **E.164** (`'+995555123456'`) — the only form the field emits. `''` when empty. */\n value?: string\n /** Initial E.164 value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the E.164 value (`''` when cleared) and `{ country, national, valid }`. */\n onChange?: (value: string, meta: PhoneFieldChangeMeta) => void\n /** The country to start with. Defaults to one derived from the UI language / browser locale. */\n defaultCountry?: PhoneCountry\n /** Restrict the selectable countries (e.g. only where you operate). Defaults to all. */\n countries?: readonly PhoneCountry[]\n /** Countries pinned to the top of the list, in this order. */\n preferredCountries?: readonly PhoneCountry[]\n /**\n * How the number reads while typing — `national` (default: `555 12 34 56`, the calling code lives in\n * the country button) or `international` (`+995 555 12 34 56`). The value is E.164 either way.\n */\n format?: PhoneFormat\n /** Field label. */\n label?: ReactNode\n /** Helper / validation text under the field. */\n helperText?: ReactNode\n /** Error state (red border + helper). */\n error?: boolean\n /** Shows a required asterisk. */\n required?: boolean\n /** `sm` / `md` / `lg` — control height + type. Defaults to `md`. */\n size?: PhoneFieldSize\n /** Stretch to the container. Defaults to `true`. */\n fullWidth?: boolean\n}\n\n/** The field itself — rendered once `libphonenumber-js` has loaded. */\nconst PhoneFieldInner = forwardRef<HTMLInputElement, PhoneFieldProps>(function PhoneFieldInner(\n {\n value,\n defaultValue,\n onChange,\n defaultCountry,\n countries: countriesProp,\n preferredCountries = [],\n format = 'national',\n label,\n helperText,\n error,\n required,\n size = 'md',\n fullWidth = true,\n name,\n disabled = false,\n id: idProp,\n className,\n style,\n onBlur,\n placeholder,\n ...props\n },\n ref,\n) {\n const t = useT()\n const { language } = useLanguage()\n const countries = countriesProp ?? getPhoneCountries()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // ── value: controlled / form-bound / uncontrolled — always E.164 ──\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = isFormBound ? form!.field(name!) : undefined\n const [internal, setInternal] = useState(defaultValue ?? '')\n const currentValue =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const fallbackCountry = useMemo<PhoneCountry>(\n () =>\n defaultCountry && countries.includes(defaultCountry)\n ? defaultCountry\n : detectCountry(language, countries),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [defaultCountry, language, countries.join()],\n )\n\n const [country, setCountry] = useState<PhoneCountry>(\n () => phoneFromValue(currentValue, fallbackCountry, format, countries).country,\n )\n const [display, setDisplay] = useState(\n () => phoneFromValue(currentValue, fallbackCountry, format, countries).display,\n )\n\n // re-derive the display when the value changes from OUTSIDE (a reset / a controlled update) — the\n // values we emit ourselves are skipped, so formatting never fights the user mid-typing\n const lastEmitted = useRef(currentValue)\n if (lastEmitted.current !== currentValue) {\n lastEmitted.current = currentValue\n const next = phoneFromValue(currentValue, country, format, countries)\n setCountry(next.country)\n setDisplay(next.display)\n }\n\n // caret restore after reformatting\n const innerRef = useRef<HTMLInputElement | null>(null)\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLInputElement | null }).current = node\n },\n [ref],\n )\n const pendingCaret = useRef<number | null>(null)\n useLayoutEffect(() => {\n const pos = pendingCaret.current\n if (pos == null) return\n pendingCaret.current = null\n innerRef.current?.setSelectionRange(pos, pos)\n })\n\n const emit = (reading: ReturnType<typeof readPhoneInput>) => {\n lastEmitted.current = reading.e164\n setDisplay(reading.display)\n if (reading.country !== country) setCountry(reading.country)\n if (value === undefined && !isFormBound) setInternal(reading.e164)\n if (isFormBound) form!.setValue(name!, reading.e164)\n onChange?.(reading.e164, {\n country: reading.country,\n national: reading.national,\n valid: reading.valid,\n })\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const el = event.target\n let raw = el.value\n const caret = el.selectionStart ?? raw.length\n let digitsBefore = raw.slice(0, caret).replace(/\\D/g, '').length\n // backspace over a formatting char (space / paren / dash) would be re-added by the formatter —\n // treat it as deleting the digit before it instead\n const prevDigits = display.replace(/\\D/g, '')\n if (raw.length < display.length && raw.replace(/\\D/g, '') === prevDigits && digitsBefore > 0) {\n let seen = 0\n let cut = -1\n for (let i = 0; i < raw.length; i++) {\n if (/\\d/.test(raw[i]) && ++seen === digitsBefore) {\n cut = i\n break\n }\n }\n if (cut >= 0) raw = raw.slice(0, cut) + raw.slice(cut + 1)\n digitsBefore -= 1\n }\n const reading = readPhoneInput(raw, country, format, countries)\n pendingCaret.current =\n caret >= el.value.length\n ? reading.display.length\n : caretAfterDigits(reading.display, digitsBefore)\n emit(reading)\n }\n\n // ── country picker — the shared option menu (search matches name, ISO code, calling code) ──\n const controlRef = useRef<HTMLDivElement | null>(null)\n const countryOptions = useMemo<SelectOption[]>(() => {\n const toOption = (c: PhoneCountry): SelectOption => {\n const dial = callingCodeOf(c)\n return {\n value: c,\n label: countryName(c, language),\n icon: (\n <span className={styles.flag} aria-hidden=\"true\">\n {flagEmoji(c)}\n </span>\n ),\n keywords: [c, dial, `+${dial}`],\n trailing: <span className={styles.dial}>+{dial}</span>,\n }\n }\n // preferred countries first (in the given order), then the rest A→Z by their localized name —\n // as two groups (\"Suggested\" / \"All Countries\") when there are preferred ones\n const pinned = preferredCountries.filter((c) => countries.includes(c)).map(toOption)\n const rest = countries\n .filter((c) => !preferredCountries.includes(c))\n .map(toOption)\n .sort((a, b) => a.label.localeCompare(b.label, language))\n if (pinned.length === 0) return rest\n return [\n ...pinned.map((o) => ({ ...o, group: t('phoneField.suggested') })),\n ...rest.map((o) => ({ ...o, group: t('phoneField.allCountries') })),\n ]\n }, [countries, preferredCountries, language, t])\n\n const pickCountry = (next: PhoneCountry) => {\n // keep the typed national digits, re-read under the new calling code\n const national = readPhoneInput(display, country, format, countries).national\n setCountry(next)\n emit({ ...readPhoneInput(national, next, format, countries), country: next })\n }\n\n const menu = useOptionMenu({\n idBase: `${id}-country`,\n options: countryOptions,\n isSelected: (o) => o.value === country,\n onPick: (o) => pickCountry(o.value as PhoneCountry),\n searchable: true,\n disabled,\n // after a pick / Esc, typing continues in the number\n focusRef: innerRef,\n })\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n bound?.onBlur(event)\n onBlur?.(event)\n }\n\n const describedBy = resolvedHelperText != null ? helperId : undefined\n const chevronPx = size === 'sm' ? 16 : size === 'md' ? 14 : 12\n const code = callingCodeOf(country)\n const name_ = countryName(country, language)\n\n return (\n <div\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n fullWidth && fieldStyles.fullWidth,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n styles.phoneField,\n className,\n )}\n style={style as CSSProperties}\n >\n {label != null && (\n <label htmlFor={id} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div ref={controlRef} className={clsx(fieldStyles.control, styles.control)}>\n <button\n type=\"button\"\n className={styles.country}\n aria-haspopup=\"listbox\"\n aria-expanded={menu.open}\n aria-controls={menu.open ? menu.listboxId : undefined}\n aria-label={`${t('phoneField.country')}: ${name_} (+${code})`}\n disabled={disabled}\n onClick={menu.toggleMenu}\n onKeyDown={(e) => {\n // ↓ / ↑ open the list (Enter / Space already click the button)\n if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && !menu.open) {\n e.preventDefault()\n menu.openMenu()\n }\n }}\n >\n <span className={styles.flag} aria-hidden=\"true\">\n {flagEmoji(country)}\n </span>\n {format === 'national' && <span className={styles.code}>+{code}</span>}\n {/* the same chevron as Select / MultiSelect (ArrowDown4, sized per field size: sm 16 · md 14 · lg 12) */}\n <Icon\n name=\"ArrowDown4\"\n className={clsx(styles.chevron, menu.open && styles.chevronOpen)}\n style={{ width: chevronPx, height: chevronPx }}\n aria-hidden=\"true\"\n />\n </button>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel\"\n className={fieldStyles.input}\n value={display}\n placeholder={placeholder}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n aria-invalid={resolvedError || undefined}\n aria-describedby={describedBy}\n {...props}\n />\n </div>\n\n <OptionMenu\n menu={menu}\n anchorRef={controlRef}\n size={size}\n searchPlaceholder={t('phoneField.search')}\n ariaLabel={t('phoneField.country')}\n />\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n\n/**\n * A phone-number field: a **country button** (flag + `+code`, opening a searchable, localized country\n * list) inside the input frame, and the number **formatted as you type** for that country. The value is\n * always **E.164** (`'+995555123456'`) — one canonical form for the backend. Typing or pasting `+44…`\n * switches the country by its calling code. `onChange(value, { country, national, valid })`; binds to a\n * `<Form>` by `name` (the form value is the E.164 string — validate with `isValidPhone`). Country names\n * come from `Intl.DisplayNames` in the active UI language; flags are emoji. Needs the optional peer\n * **`libphonenumber-js`** (formatting, parsing, validation metadata), loaded lazily on first mount — until\n * it's ready (or if it isn't installed) a disabled look-alike field renders. Reuses the `TextField` look.\n */\nexport const PhoneField = forwardRef<HTMLInputElement, PhoneFieldProps>(\n function PhoneField(props, ref) {\n const { module } = useOptionalPeer(phonePeer)\n if (module) return <PhoneFieldInner ref={ref} {...props} />\n // loading (a tick, first mount only) or the peer is missing: the same frame, disabled — never bound\n // to a <Form> (no `name`) so it can't write a value\n const {\n label,\n helperText,\n error,\n required,\n size,\n fullWidth = true,\n className,\n style,\n placeholder,\n } = props\n return (\n <TextField\n ref={ref}\n type=\"tel\"\n label={label}\n helperText={helperText}\n error={error}\n required={required}\n size={size}\n fullWidth={fullWidth}\n className={className}\n style={style}\n placeholder={placeholder}\n value={props.value ?? props.defaultValue ?? ''}\n readOnly\n disabled\n />\n )\n },\n)\n"],"names":["phonePeer","optionalPeer","lib","allCountries","getPhoneCountries","callingCodeOf","country","isValidPhone","value","loaded","flagEmoji","c","displayNamesCache","countryName","locale","_a","MAIN_FOR_CODE","LANGUAGE_COUNTRY","detectCountry","allowed","base","region","browser","_b","digitsOf","s","countryForCode","code","current","detected","readPhoneInput","raw","format","text","digits","typer","display","parsed","next","e164","national","phoneFromValue","fallback","reading","caretAfterDigits","n","seen","i","PhoneFieldInner","forwardRef","defaultValue","onChange","defaultCountry","countriesProp","preferredCountries","label","helperText","error","required","size","fullWidth","name","disabled","idProp","className","style","onBlur","placeholder","props","ref","t","useT","language","useLanguage","countries","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","internal","setInternal","useState","currentValue","resolvedError","resolvedHelperText","fallbackCountry","useMemo","setCountry","setDisplay","lastEmitted","useRef","innerRef","setInputRef","useCallback","node","pendingCaret","useLayoutEffect","pos","emit","handleChange","event","el","caret","digitsBefore","prevDigits","cut","controlRef","countryOptions","toOption","dial","jsx","styles","jsxs","pinned","rest","a","b","o","pickCountry","menu","useOptionMenu","handleBlur","describedBy","chevronPx","name_","clsx","fieldStyles","Typography","e","Icon","OptionMenu","PhoneField","module","useOptionalPeer","TextField"],"mappings":"63BASaA,EAAYC,GAAAA,aACvB,oBACA,aACA,IAAM,OAAO,mBAAmB,CAClC,EACMC,EAAM,IAAMF,EAAU,IA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AASA,EAAM,cAAgB,GAC5C,SAAQ,GACR,SAAQ,EAAA,CAAA,CAGd,CACF"}
1
+ {"version":3,"file":"PhoneField-CzFv2Vci.cjs","sources":["../src/components/PhoneField/phone.ts","../src/components/PhoneField/PhoneField.tsx"],"sourcesContent":["import type * as PhoneLibModule from 'libphonenumber-js'\nimport type { CountryCode } from 'libphonenumber-js'\nimport { optionalPeer } from '../../hooks/useOptionalPeer'\n\n/**\n * `libphonenumber-js` is an optional peer, loaded **lazily** (see `optionalPeer`) — never imported\n * statically, so apps that don't install it still build + run when they import the barrel. PhoneField\n * waits for it on mount; the helpers below run only once it's loaded (`lib()`).\n */\nexport const phonePeer = optionalPeer<typeof PhoneLibModule>(\n 'libphonenumber-js',\n 'PhoneField',\n () => import('libphonenumber-js'),\n)\nconst lib = () => phonePeer.get()!\n\n/** An ISO-3166 alpha-2 country code, as `libphonenumber-js` knows it (`'GE'`, `'US'`, …). */\nexport type PhoneCountry = CountryCode\n/** How the number is shown in the input while typing (the value is always E.164). */\nexport type PhoneFormat = 'national' | 'international'\n\nlet allCountries: readonly PhoneCountry[] | undefined\n/** Every country `libphonenumber-js` has metadata for (once loaded). */\nexport function getPhoneCountries(): readonly PhoneCountry[] {\n return (allCountries ??= lib().getCountries())\n}\n\n/** The country's calling code without the `+` — `'GE'` → `'995'`. */\nexport const callingCodeOf = (country: PhoneCountry): string => lib().getCountryCallingCode(country)\n\n/**\n * `true` for a complete, valid number (E.164 or any parseable international form). Use it in a schema:\n * `phone: z.string().refine(isValidPhone, 'Enter a valid phone number')`. Needs `libphonenumber-js`\n * loaded — it is once any PhoneField has mounted; before that it starts the load and returns `false`.\n */\nexport function isValidPhone(value: unknown): boolean {\n const loaded = phonePeer.get()\n // not loaded yet (no PhoneField mounted so far) → start loading and report \"not valid\" for now\n if (!loaded) {\n void phonePeer.load()\n return false\n }\n return typeof value === 'string' && value.trim() !== '' && loaded.isValidPhoneNumber(value)\n}\n\n/** A flag emoji from the two regional-indicator letters — no image assets (Windows shows the letters). */\nexport function flagEmoji(country: string): string {\n return String.fromCodePoint(\n ...[...country.toUpperCase()].map((c) => 0x1f1e6 + c.charCodeAt(0) - 65),\n )\n}\n\nconst displayNamesCache = new Map<string, Intl.DisplayNames | null>()\n/** The country's name in `locale` via `Intl.DisplayNames` (no catalog to ship); falls back to the code. */\nexport function countryName(country: string, locale: string): string {\n if (!displayNamesCache.has(locale)) {\n try {\n displayNamesCache.set(locale, new Intl.DisplayNames([locale], { type: 'region' }))\n } catch {\n displayNamesCache.set(locale, null)\n }\n }\n try {\n return displayNamesCache.get(locale)?.of(country) ?? country\n } catch {\n return country\n }\n}\n\n// the main country for a calling code shared by several (a partial \"+44…\" parses as Guernsey otherwise)\nconst MAIN_FOR_CODE: Record<string, PhoneCountry> = {\n '1': 'US',\n '7': 'RU',\n '39': 'IT',\n '44': 'GB',\n '47': 'NO',\n '61': 'AU',\n '212': 'MA',\n '262': 'RE',\n '290': 'SH',\n '358': 'FI',\n '590': 'GP',\n '599': 'CW',\n}\n// base UI language → its usual country, for the default when the locale carries no region\nconst LANGUAGE_COUNTRY: Record<string, PhoneCountry> = {\n ka: 'GE',\n en: 'US',\n es: 'ES',\n de: 'DE',\n it: 'IT',\n fr: 'FR',\n ru: 'RU',\n}\n\n/** The default country: the locale's region → its language's usual country → the browser's region → US. */\nexport function detectCountry(locale: string, allowed: readonly PhoneCountry[]): PhoneCountry {\n const [base, region] = locale.split('-')\n const browser =\n typeof navigator !== 'undefined' ? navigator.language?.split('-')[1]?.toUpperCase() : undefined\n const candidates = [region?.toUpperCase(), LANGUAGE_COUNTRY[base?.toLowerCase()], browser, 'US']\n return (candidates.find((c) => c && allowed.includes(c as PhoneCountry)) ??\n allowed[0]) as PhoneCountry\n}\n\n/** The result of reading what's in the input. */\nexport interface PhoneReading {\n /** The canonical value — `'+995555123456'`, or `''` when empty. */\n e164: string\n /** The country the number belongs to (may switch when a `+code` is typed). */\n country: PhoneCountry\n /** The national significant number — digits only, no trunk `0`. */\n national: string\n /** A complete, valid number. */\n valid: boolean\n /** What the input should show (formatted as you type). */\n display: string\n}\n\nconst digitsOf = (s: string) => s.replace(/\\D/g, '')\n\n/** Which allowed country a `+code…` number belongs to — keep the current one when it shares the code. */\nfunction countryForCode(\n code: string,\n current: PhoneCountry,\n detected: PhoneCountry | undefined,\n allowed: readonly PhoneCountry[],\n): PhoneCountry {\n if (callingCodeOf(current) === code) return current\n const pick = [detected, MAIN_FOR_CODE[code], ...allowed.filter((c) => callingCodeOf(c) === code)]\n return (pick.find((c) => c && allowed.includes(c)) as PhoneCountry | undefined) ?? current\n}\n\n/** Read raw input text → the canonical value + the formatted display, as the user types. */\nexport function readPhoneInput(\n raw: string,\n country: PhoneCountry,\n format: PhoneFormat,\n allowed: readonly PhoneCountry[],\n): PhoneReading {\n const text = raw.trimStart()\n const digits = digitsOf(text)\n if (!digits) {\n return {\n e164: '',\n country,\n national: '',\n valid: false,\n display: text.startsWith('+') ? '+' : '',\n }\n }\n\n // an explicit \"+code…\" (typed or pasted) — the calling code decides the country\n if (text.startsWith('+')) {\n const typer = new (lib().AsYouType)()\n const display = typer.input(`+${digits}`)\n const code = typer.getCallingCode()\n const parsed = lib().parsePhoneNumberFromString(`+${digits}`)\n const next = code\n ? countryForCode(code, country, parsed?.country ?? typer.getCountry(), allowed)\n : country\n const e164 = `+${digits}`\n return {\n e164,\n country: next,\n national: code ? digits.slice(code.length) : '',\n valid: lib().isValidPhoneNumber(e164),\n display,\n }\n }\n\n // national digits under the selected country (a leading trunk \"0\" is dropped from the value)\n const code = callingCodeOf(country)\n const parsed = lib().parsePhoneNumberFromString(digits, country)\n const national = parsed?.nationalNumber ?? digits.replace(/^0+/, '')\n const e164 = national ? `+${code}${national}` : ''\n const display =\n format === 'international'\n ? new (lib().AsYouType)(country).input(`+${code}${national}`)\n : new (lib().AsYouType)(country).input(digits)\n return {\n e164,\n country,\n national,\n valid: e164 !== '' && lib().isValidPhoneNumber(e164),\n display,\n }\n}\n\n/** Derive the country + display from an E.164 value (initial / external value changes). */\nexport function phoneFromValue(\n value: string,\n fallback: PhoneCountry,\n format: PhoneFormat,\n allowed: readonly PhoneCountry[],\n): { country: PhoneCountry; display: string } {\n if (!value) return { country: fallback, display: '' }\n const parsed = lib().parsePhoneNumberFromString(value)\n if (parsed) {\n const country = countryForCode(parsed.countryCallingCode, fallback, parsed.country, allowed)\n return {\n country,\n display: format === 'national' ? parsed.formatNational() : parsed.formatInternational(),\n }\n }\n const reading = readPhoneInput(value, fallback, 'international', allowed)\n const display =\n format === 'national' && reading.national\n ? new (lib().AsYouType)(reading.country).input(reading.national)\n : reading.display\n return { country: reading.country, display }\n}\n\n/** Caret index in `display` right after its `n`-th digit — keeps the caret put while reformatting. */\nexport function caretAfterDigits(display: string, n: number): number {\n if (n <= 0) return display.startsWith('+') ? 1 : 0\n let seen = 0\n for (let i = 0; i < display.length; i++) {\n if (/\\d/.test(display[i])) seen++\n if (seen === n) return i + 1\n }\n return display.length\n}\n","import {\n forwardRef,\n useCallback,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useLanguage, useT } from '../../theme'\nimport { useOptionalPeer } from '../../hooks/useOptionalPeer'\nimport { useFormContext } from '../../form/formContext'\nimport { Icon } from '../Icon'\nimport { TextField } from '../TextField'\nimport { OptionMenu } from '../OptionMenu/OptionMenu'\nimport { useOptionMenu, type SelectOption } from '../OptionMenu/useOptionMenu'\nimport { Typography } from '../Typography'\nimport fieldStyles from '../TextField/TextField.module.css'\nimport {\n callingCodeOf,\n getPhoneCountries,\n caretAfterDigits,\n countryName,\n detectCountry,\n flagEmoji,\n phoneFromValue,\n phonePeer,\n readPhoneInput,\n type PhoneCountry,\n type PhoneFormat,\n} from './phone'\nimport styles from './PhoneField.module.css'\n\nexport type PhoneFieldSize = 'sm' | 'md' | 'lg'\n\n/** Extra details handed to `onChange` alongside the E.164 value. */\nexport interface PhoneFieldChangeMeta {\n /** The number's country (ISO alpha-2). */\n country: PhoneCountry\n /** The national significant number — digits only, no trunk `0`. */\n national: string\n /** A complete, valid number for that country. */\n valid: boolean\n}\n\nexport interface PhoneFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'value' | 'defaultValue' | 'onChange' | 'type' | 'size' | 'color'\n> {\n /** The number in **E.164** (`'+995555123456'`) — the only form the field emits. `''` when empty. */\n value?: string\n /** Initial E.164 value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the E.164 value (`''` when cleared) and `{ country, national, valid }`. */\n onChange?: (value: string, meta: PhoneFieldChangeMeta) => void\n /** The country to start with. Defaults to one derived from the UI language / browser locale. */\n defaultCountry?: PhoneCountry\n /** Restrict the selectable countries (e.g. only where you operate). Defaults to all. */\n countries?: readonly PhoneCountry[]\n /** Countries pinned to the top of the list, in this order. */\n preferredCountries?: readonly PhoneCountry[]\n /**\n * How the number reads while typing — `national` (default: `555 12 34 56`, the calling code lives in\n * the country button) or `international` (`+995 555 12 34 56`). The value is E.164 either way.\n */\n format?: PhoneFormat\n /** Field label. */\n label?: ReactNode\n /** Helper / validation text under the field. */\n helperText?: ReactNode\n /** Error state (red border + helper). */\n error?: boolean\n /** Shows a required asterisk. */\n required?: boolean\n /** `sm` / `md` / `lg` — control height + type. Defaults to `md`. */\n size?: PhoneFieldSize\n /** Stretch to the container. Defaults to `true`. */\n fullWidth?: boolean\n}\n\n/** The field itself — rendered once `libphonenumber-js` has loaded. */\nconst PhoneFieldInner = forwardRef<HTMLInputElement, PhoneFieldProps>(function PhoneFieldInner(\n {\n value,\n defaultValue,\n onChange,\n defaultCountry,\n countries: countriesProp,\n preferredCountries = [],\n format = 'national',\n label,\n helperText,\n error,\n required,\n size = 'md',\n fullWidth = true,\n name,\n disabled = false,\n id: idProp,\n className,\n style,\n onBlur,\n placeholder,\n ...props\n },\n ref,\n) {\n const t = useT()\n const { language } = useLanguage()\n const countries = countriesProp ?? getPhoneCountries()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // ── value: controlled / form-bound / uncontrolled — always E.164 ──\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = isFormBound ? form!.field(name!) : undefined\n const [internal, setInternal] = useState(defaultValue ?? '')\n const currentValue =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const fallbackCountry = useMemo<PhoneCountry>(\n () =>\n defaultCountry && countries.includes(defaultCountry)\n ? defaultCountry\n : detectCountry(language, countries),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [defaultCountry, language, countries.join()],\n )\n\n const [country, setCountry] = useState<PhoneCountry>(\n () => phoneFromValue(currentValue, fallbackCountry, format, countries).country,\n )\n const [display, setDisplay] = useState(\n () => phoneFromValue(currentValue, fallbackCountry, format, countries).display,\n )\n\n // re-derive the display when the value changes from OUTSIDE (a reset / a controlled update) — the\n // values we emit ourselves are skipped, so formatting never fights the user mid-typing\n const lastEmitted = useRef(currentValue)\n if (lastEmitted.current !== currentValue) {\n lastEmitted.current = currentValue\n const next = phoneFromValue(currentValue, country, format, countries)\n setCountry(next.country)\n setDisplay(next.display)\n }\n\n // caret restore after reformatting\n const innerRef = useRef<HTMLInputElement | null>(null)\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as { current: HTMLInputElement | null }).current = node\n },\n [ref],\n )\n const pendingCaret = useRef<number | null>(null)\n useLayoutEffect(() => {\n const pos = pendingCaret.current\n if (pos == null) return\n pendingCaret.current = null\n innerRef.current?.setSelectionRange(pos, pos)\n })\n\n const emit = (reading: ReturnType<typeof readPhoneInput>) => {\n lastEmitted.current = reading.e164\n setDisplay(reading.display)\n if (reading.country !== country) setCountry(reading.country)\n if (value === undefined && !isFormBound) setInternal(reading.e164)\n if (isFormBound) form!.setValue(name!, reading.e164)\n onChange?.(reading.e164, {\n country: reading.country,\n national: reading.national,\n valid: reading.valid,\n })\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const el = event.target\n let raw = el.value\n const caret = el.selectionStart ?? raw.length\n let digitsBefore = raw.slice(0, caret).replace(/\\D/g, '').length\n // backspace over a formatting char (space / paren / dash) would be re-added by the formatter —\n // treat it as deleting the digit before it instead\n const prevDigits = display.replace(/\\D/g, '')\n if (raw.length < display.length && raw.replace(/\\D/g, '') === prevDigits && digitsBefore > 0) {\n let seen = 0\n let cut = -1\n for (let i = 0; i < raw.length; i++) {\n if (/\\d/.test(raw[i]) && ++seen === digitsBefore) {\n cut = i\n break\n }\n }\n if (cut >= 0) raw = raw.slice(0, cut) + raw.slice(cut + 1)\n digitsBefore -= 1\n }\n const reading = readPhoneInput(raw, country, format, countries)\n pendingCaret.current =\n caret >= el.value.length\n ? reading.display.length\n : caretAfterDigits(reading.display, digitsBefore)\n emit(reading)\n }\n\n // ── country picker — the shared option menu (search matches name, ISO code, calling code) ──\n const controlRef = useRef<HTMLDivElement | null>(null)\n const countryOptions = useMemo<SelectOption[]>(() => {\n const toOption = (c: PhoneCountry): SelectOption => {\n const dial = callingCodeOf(c)\n return {\n value: c,\n label: countryName(c, language),\n icon: (\n <span className={styles.flag} aria-hidden=\"true\">\n {flagEmoji(c)}\n </span>\n ),\n keywords: [c, dial, `+${dial}`],\n trailing: <span className={styles.dial}>+{dial}</span>,\n }\n }\n // preferred countries first (in the given order), then the rest A→Z by their localized name —\n // as two groups (\"Suggested\" / \"All Countries\") when there are preferred ones\n const pinned = preferredCountries.filter((c) => countries.includes(c)).map(toOption)\n const rest = countries\n .filter((c) => !preferredCountries.includes(c))\n .map(toOption)\n .sort((a, b) => a.label.localeCompare(b.label, language))\n if (pinned.length === 0) return rest\n return [\n ...pinned.map((o) => ({ ...o, group: t('phoneField.suggested') })),\n ...rest.map((o) => ({ ...o, group: t('phoneField.allCountries') })),\n ]\n }, [countries, preferredCountries, language, t])\n\n const pickCountry = (next: PhoneCountry) => {\n // keep the typed national digits, re-read under the new calling code\n const national = readPhoneInput(display, country, format, countries).national\n setCountry(next)\n emit({ ...readPhoneInput(national, next, format, countries), country: next })\n }\n\n const menu = useOptionMenu({\n idBase: `${id}-country`,\n options: countryOptions,\n isSelected: (o) => o.value === country,\n onPick: (o) => pickCountry(o.value as PhoneCountry),\n searchable: true,\n disabled,\n // after a pick / Esc, typing continues in the number\n focusRef: innerRef,\n })\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n bound?.onBlur(event)\n onBlur?.(event)\n }\n\n const describedBy = resolvedHelperText != null ? helperId : undefined\n const chevronPx = size === 'sm' ? 16 : size === 'md' ? 14 : 12\n const code = callingCodeOf(country)\n const name_ = countryName(country, language)\n\n return (\n <div\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n fullWidth && fieldStyles.fullWidth,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n styles.phoneField,\n className,\n )}\n style={style as CSSProperties}\n >\n {label != null && (\n <label htmlFor={id} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div ref={controlRef} className={clsx(fieldStyles.control, styles.control)}>\n <button\n type=\"button\"\n className={styles.country}\n aria-haspopup=\"listbox\"\n aria-expanded={menu.open}\n aria-controls={menu.open ? menu.listboxId : undefined}\n aria-label={`${t('phoneField.country')}: ${name_} (+${code})`}\n disabled={disabled}\n onClick={menu.toggleMenu}\n onKeyDown={(e) => {\n // ↓ / ↑ open the list (Enter / Space already click the button)\n if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && !menu.open) {\n e.preventDefault()\n menu.openMenu()\n }\n }}\n >\n <span className={styles.flag} aria-hidden=\"true\">\n {flagEmoji(country)}\n </span>\n {format === 'national' && <span className={styles.code}>+{code}</span>}\n {/* the same chevron as Select / MultiSelect (ArrowDown4, sized per field size: sm 16 · md 14 · lg 12) */}\n <Icon\n name=\"ArrowDown4\"\n className={clsx(styles.chevron, menu.open && styles.chevronOpen)}\n style={{ width: chevronPx, height: chevronPx }}\n aria-hidden=\"true\"\n />\n </button>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel\"\n className={fieldStyles.input}\n value={display}\n placeholder={placeholder}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n aria-invalid={resolvedError || undefined}\n aria-describedby={describedBy}\n {...props}\n />\n </div>\n\n <OptionMenu\n menu={menu}\n anchorRef={controlRef}\n size={size}\n searchPlaceholder={t('phoneField.search')}\n ariaLabel={t('phoneField.country')}\n />\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n\n/**\n * A phone-number field: a **country button** (flag + `+code`, opening a searchable, localized country\n * list) inside the input frame, and the number **formatted as you type** for that country. The value is\n * always **E.164** (`'+995555123456'`) — one canonical form for the backend. Typing or pasting `+44…`\n * switches the country by its calling code. `onChange(value, { country, national, valid })`; binds to a\n * `<Form>` by `name` (the form value is the E.164 string — validate with `isValidPhone`). Country names\n * come from `Intl.DisplayNames` in the active UI language; flags are emoji. Needs the optional peer\n * **`libphonenumber-js`** (formatting, parsing, validation metadata), loaded lazily on first mount — until\n * it's ready (or if it isn't installed) a disabled look-alike field renders. Reuses the `TextField` look.\n */\nexport const PhoneField = forwardRef<HTMLInputElement, PhoneFieldProps>(\n function PhoneField(props, ref) {\n const { module } = useOptionalPeer(phonePeer)\n if (module) return <PhoneFieldInner ref={ref} {...props} />\n // loading (a tick, first mount only) or the peer is missing: the same frame, disabled — never bound\n // to a <Form> (no `name`) so it can't write a value\n const {\n label,\n helperText,\n error,\n required,\n size,\n fullWidth = true,\n className,\n style,\n placeholder,\n } = props\n return (\n <TextField\n ref={ref}\n type=\"tel\"\n label={label}\n helperText={helperText}\n error={error}\n required={required}\n size={size}\n fullWidth={fullWidth}\n className={className}\n style={style}\n placeholder={placeholder}\n value={props.value ?? props.defaultValue ?? ''}\n readOnly\n disabled\n />\n )\n },\n)\n"],"names":["phonePeer","optionalPeer","lib","allCountries","getPhoneCountries","callingCodeOf","country","isValidPhone","value","loaded","flagEmoji","c","displayNamesCache","countryName","locale","_a","MAIN_FOR_CODE","LANGUAGE_COUNTRY","detectCountry","allowed","base","region","browser","_b","digitsOf","s","countryForCode","code","current","detected","readPhoneInput","raw","format","text","digits","typer","display","parsed","next","e164","national","phoneFromValue","fallback","reading","caretAfterDigits","n","seen","i","PhoneFieldInner","forwardRef","defaultValue","onChange","defaultCountry","countriesProp","preferredCountries","label","helperText","error","required","size","fullWidth","name","disabled","idProp","className","style","onBlur","placeholder","props","ref","t","useT","language","useLanguage","countries","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","internal","setInternal","useState","currentValue","resolvedError","resolvedHelperText","fallbackCountry","useMemo","setCountry","setDisplay","lastEmitted","useRef","innerRef","setInputRef","useCallback","node","pendingCaret","useLayoutEffect","pos","emit","handleChange","event","el","caret","digitsBefore","prevDigits","cut","controlRef","countryOptions","toOption","dial","jsx","styles","jsxs","pinned","rest","a","b","o","pickCountry","menu","useOptionMenu","handleBlur","describedBy","chevronPx","name_","clsx","fieldStyles","Typography","e","Icon","OptionMenu","PhoneField","module","useOptionalPeer","TextField"],"mappings":"63BASaA,EAAYC,GAAAA,aACvB,oBACA,aACA,IAAM,OAAO,mBAAmB,CAClC,EACMC,EAAM,IAAMF,EAAU,IAAA,EAO5B,IAAIG,GAEG,SAASC,IAA6C,CAC3D,OAAQD,QAAiBD,EAAA,EAAM,aAAA,EACjC,CAGO,MAAMG,EAAiBC,GAAkCJ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, useMemo as ue, useRef as
3
3
  import { clsx as ne } from "clsx";
4
4
  import { o as je, u as Ue } from "./useOptionalPeer-49f3XcO5.js";
5
5
  import { u as ke } from "./formContext-B7ln1Miy.js";
6
- import { b as Ee } from "./Icon-B7DJn8Tw.js";
7
- import { T as Me } from "./TextField-Dfpk0jOg.js";
8
- import { u as Ve, O as We } from "./useOptionMenu-CxM6FHXL.js";
6
+ import { b as Ee } from "./Icon-DMMO32p6.js";
7
+ import { T as Me } from "./TextField-BsC2zoHI.js";
8
+ import { u as Ve, O as We } from "./useOptionMenu-Sp2d3Bzi.js";
9
9
  import { T as de } from "./Typography-ChSuxgkc.js";
10
10
  import { f as y } from "./TextField.module-6gYcR9TL.js";
11
- import { a as Be, u as Ge } from "./ConfigProvider-DtyUlWk6.js";
11
+ import { a as Be, u as Ge } from "./ConfigProvider-bXX8dnhY.js";
12
12
  const Y = je(
13
13
  "libphonenumber-js",
14
14
  "PhoneField",
@@ -369,4 +369,4 @@ export {
369
369
  vn as P,
370
370
  gn as i
371
371
  };
372
- //# sourceMappingURL=PhoneField-DmFaJJEa.js.map
372
+ //# sourceMappingURL=PhoneField-DhoumZNG.js.map