@banzamel/mineralui 1.1.0 → 1.2.0

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 (424) hide show
  1. package/README.md +1 -1
  2. package/dist/{MAvatar-BDfA-fQT.js → MAvatar-BoO51a6m.js} +4 -4
  3. package/dist/{MAvatar-BDfA-fQT.js.map → MAvatar-BoO51a6m.js.map} +1 -1
  4. package/dist/{MAvatar-C8tWuy5K.cjs → MAvatar-DJKtca9j.cjs} +2 -2
  5. package/dist/{MAvatar-C8tWuy5K.cjs.map → MAvatar-DJKtca9j.cjs.map} +1 -1
  6. package/dist/{MBadge-Babyr1R9.cjs → MBadge-CexVV675.cjs} +2 -2
  7. package/dist/MBadge-CexVV675.cjs.map +1 -0
  8. package/dist/{MBadge-BjZX0MIC.js → MBadge-Y1JnZiIC.js} +2 -2
  9. package/dist/MBadge-Y1JnZiIC.js.map +1 -0
  10. package/dist/{MButton-C_WTyNvw.cjs → MButton-B8rXmFX9.cjs} +2 -2
  11. package/dist/{MButton-C_WTyNvw.cjs.map → MButton-B8rXmFX9.cjs.map} +1 -1
  12. package/dist/{MButton-33EzpGvQ.js → MButton-BmTDe5Oa.js} +3 -3
  13. package/dist/{MButton-33EzpGvQ.js.map → MButton-BmTDe5Oa.js.map} +1 -1
  14. package/dist/{MCheckbox-DW-liYve.js → MCheckbox-B7SpcD4H.js} +3 -3
  15. package/dist/{MCheckbox-DW-liYve.js.map → MCheckbox-B7SpcD4H.js.map} +1 -1
  16. package/dist/{MCheckbox-9WMKKIUO.cjs → MCheckbox-Bea3orrs.cjs} +2 -2
  17. package/dist/{MCheckbox-9WMKKIUO.cjs.map → MCheckbox-Bea3orrs.cjs.map} +1 -1
  18. package/dist/{MCookieBootstrap-v2JRvgUH.js → MCookieBootstrap-CNYLvKjW.js} +1 -1
  19. package/dist/{MCookieBootstrap-v2JRvgUH.js.map → MCookieBootstrap-CNYLvKjW.js.map} +1 -1
  20. package/dist/{MCookieBootstrap-I7jiqvBM.cjs → MCookieBootstrap-DSOT4FQo.cjs} +1 -1
  21. package/dist/{MCookieBootstrap-I7jiqvBM.cjs.map → MCookieBootstrap-DSOT4FQo.cjs.map} +1 -1
  22. package/dist/MDataTable-BI7wFZYN.cjs +2 -0
  23. package/dist/{MDataTable-B0QbAjVI.cjs.map → MDataTable-BI7wFZYN.cjs.map} +1 -1
  24. package/dist/{MDataTable-C-CRvZ45.js → MDataTable-Cqwkiq7A.js} +13 -15
  25. package/dist/{MDataTable-C-CRvZ45.js.map → MDataTable-Cqwkiq7A.js.map} +1 -1
  26. package/dist/MDrawer-CSvjLrhB.cjs +2 -0
  27. package/dist/{MDrawer-_Bao-x1w.cjs.map → MDrawer-CSvjLrhB.cjs.map} +1 -1
  28. package/dist/{MDrawer-CHbmY08J.js → MDrawer-DXHtAckQ.js} +5 -5
  29. package/dist/{MDrawer-CHbmY08J.js.map → MDrawer-DXHtAckQ.js.map} +1 -1
  30. package/dist/{MDropdownMenu-D3O3-l8O.js → MDropdownMenu-CxBhYxQb.js} +4 -4
  31. package/dist/{MDropdownMenu-D3O3-l8O.js.map → MDropdownMenu-CxBhYxQb.js.map} +1 -1
  32. package/dist/{MDropdownMenu-Bd6MfUmF.cjs → MDropdownMenu-X7ywPqth.cjs} +2 -2
  33. package/dist/{MDropdownMenu-Bd6MfUmF.cjs.map → MDropdownMenu-X7ywPqth.cjs.map} +1 -1
  34. package/dist/{illustrations.entry-DtMxssXq.cjs → MGalleryIllustration-CeOMHzpt.cjs} +2 -2
  35. package/dist/MGalleryIllustration-CeOMHzpt.cjs.map +1 -0
  36. package/dist/{illustrations.entry-C0rSNpF1.js → MGalleryIllustration-D7CVMSwO.js} +2 -2
  37. package/dist/{illustrations.entry-DtMxssXq.cjs.map → MGalleryIllustration-D7CVMSwO.js.map} +1 -1
  38. package/dist/{MHeading-BlDlbYcY.js → MHeading-C3IgV22T.js} +3 -3
  39. package/dist/{MHeading-BlDlbYcY.js.map → MHeading-C3IgV22T.js.map} +1 -1
  40. package/dist/{MHeading-7-5TESyc.cjs → MHeading-DqvWKia1.cjs} +2 -2
  41. package/dist/{MHeading-7-5TESyc.cjs.map → MHeading-DqvWKia1.cjs.map} +1 -1
  42. package/dist/{MImage-C99xrQQ9.js → MImage-BDcrV6IC.js} +4 -4
  43. package/dist/MImage-BDcrV6IC.js.map +1 -0
  44. package/dist/{MImage-DbianX0t.cjs → MImage-BsQJ_eYf.cjs} +2 -2
  45. package/dist/MImage-BsQJ_eYf.cjs.map +1 -0
  46. package/dist/{MInline-Bvfuvqsf.cjs → MInline-BAhu2zT-.cjs} +2 -2
  47. package/dist/{MInline-Bvfuvqsf.cjs.map → MInline-BAhu2zT-.cjs.map} +1 -1
  48. package/dist/{MInline-NJeL5tcC.js → MInline-Dfy3Lrjs.js} +4 -4
  49. package/dist/{MInline-NJeL5tcC.js.map → MInline-Dfy3Lrjs.js.map} +1 -1
  50. package/dist/{MInput-OmuQ2Tds.js → MInput-BSaKw0Uc.js} +6 -6
  51. package/dist/{MInput-OmuQ2Tds.js.map → MInput-BSaKw0Uc.js.map} +1 -1
  52. package/dist/MInput-W7DJQ_ng.cjs +2 -0
  53. package/dist/{MInput-Bpkn3gOQ.cjs.map → MInput-W7DJQ_ng.cjs.map} +1 -1
  54. package/dist/MInputCVC-DH_bjV5R.cjs +2 -0
  55. package/dist/MInputCVC-DH_bjV5R.cjs.map +1 -0
  56. package/dist/{MInputCVC-CcG_KJvq.js → MInputCVC-Dqbl1zG9.js} +21 -23
  57. package/dist/MInputCVC-Dqbl1zG9.js.map +1 -0
  58. package/dist/MInputSearch-C7betxTa.cjs +2 -0
  59. package/dist/{MInputSearch-APMIHkYb.cjs.map → MInputSearch-C7betxTa.cjs.map} +1 -1
  60. package/dist/{MInputSearch-k2ESY4ZG.js → MInputSearch-CH5ZcjLq.js} +4 -4
  61. package/dist/{MInputSearch-k2ESY4ZG.js.map → MInputSearch-CH5ZcjLq.js.map} +1 -1
  62. package/dist/{MLink-B4JrRZ29.cjs → MLink-DHryXq_D.cjs} +2 -2
  63. package/dist/{MLink-B4JrRZ29.cjs.map → MLink-DHryXq_D.cjs.map} +1 -1
  64. package/dist/{MLink-_WcD95E0.js → MLink-ODytrwne.js} +2 -2
  65. package/dist/{MLink-_WcD95E0.js.map → MLink-ODytrwne.js.map} +1 -1
  66. package/dist/{MModal-Dni2MR1n.js → MModal-DShADuLw.js} +4 -4
  67. package/dist/{MModal-Dni2MR1n.js.map → MModal-DShADuLw.js.map} +1 -1
  68. package/dist/{MModal-D-3jQ-c5.cjs → MModal-pMcPs3pw.cjs} +2 -2
  69. package/dist/{MModal-D-3jQ-c5.cjs.map → MModal-pMcPs3pw.cjs.map} +1 -1
  70. package/dist/{MPagination-DCeU7MHM.js → MPagination-B7aho7rQ.js} +8 -8
  71. package/dist/{MPagination-DCeU7MHM.js.map → MPagination-B7aho7rQ.js.map} +1 -1
  72. package/dist/MPagination-BWHAVgWN.cjs +2 -0
  73. package/dist/{MPagination-3fsF3pCM.cjs.map → MPagination-BWHAVgWN.cjs.map} +1 -1
  74. package/dist/{MPopover-DKBdLfrw.js → MPopover-BC9C5967.js} +3 -3
  75. package/dist/{MPopover-DKBdLfrw.js.map → MPopover-BC9C5967.js.map} +1 -1
  76. package/dist/{MPopover-BXPkE575.cjs → MPopover-C3-fGAke.cjs} +2 -2
  77. package/dist/{MPopover-BXPkE575.cjs.map → MPopover-C3-fGAke.cjs.map} +1 -1
  78. package/dist/{MPortal-CbpNkzfC.js → MPortal-Dqlkh3hw.js} +1 -1
  79. package/dist/{MPortal-CbpNkzfC.js.map → MPortal-Dqlkh3hw.js.map} +1 -1
  80. package/dist/{MPortal-BysJLuEi.cjs → MPortal-PyRKsZxc.cjs} +1 -1
  81. package/dist/{MPortal-BysJLuEi.cjs.map → MPortal-PyRKsZxc.cjs.map} +1 -1
  82. package/dist/{MQrCode-DGq8ktvf.js → MQrCode-6Cz9B7Qy.js} +15 -16
  83. package/dist/{MQrCode-DGq8ktvf.js.map → MQrCode-6Cz9B7Qy.js.map} +1 -1
  84. package/dist/MQrCode-Bp2CWpmX.cjs +2 -0
  85. package/dist/{MQrCode-ClP7YJFt.cjs.map → MQrCode-Bp2CWpmX.cjs.map} +1 -1
  86. package/dist/{MSkeleton-CRgCZZqm.cjs → MSkeleton-BfRBJ6ku.cjs} +2 -2
  87. package/dist/{MSkeleton-CRgCZZqm.cjs.map → MSkeleton-BfRBJ6ku.cjs.map} +1 -1
  88. package/dist/{MSkeleton-QQ8Lk3Cr.js → MSkeleton-CauCfkzj.js} +4 -4
  89. package/dist/{MSkeleton-QQ8Lk3Cr.js.map → MSkeleton-CauCfkzj.js.map} +1 -1
  90. package/dist/{MSlider-DNAOirz9.cjs → MSlider-BCMJkvcA.cjs} +2 -2
  91. package/dist/{MSlider-DNAOirz9.cjs.map → MSlider-BCMJkvcA.cjs.map} +1 -1
  92. package/dist/{MSlider-C65mv2h1.js → MSlider-CqrusKJQ.js} +2 -2
  93. package/dist/{MSlider-C65mv2h1.js.map → MSlider-CqrusKJQ.js.map} +1 -1
  94. package/dist/{MSparkline-lRq3gAYU.cjs → MSparkline-BOaNmbeB.cjs} +2 -2
  95. package/dist/MSparkline-BOaNmbeB.cjs.map +1 -0
  96. package/dist/{MSparkline-LfEfA310.js → MSparkline-Cb_EwR-E.js} +2 -2
  97. package/dist/MSparkline-Cb_EwR-E.js.map +1 -0
  98. package/dist/{MStack-CuUE9u4h.js → MStack-Cifiqeb2.js} +4 -4
  99. package/dist/{MStack-CuUE9u4h.js.map → MStack-Cifiqeb2.js.map} +1 -1
  100. package/dist/{MStack-CFZf6I8F.cjs → MStack-lrvy7l3w.cjs} +2 -2
  101. package/dist/{MStack-CFZf6I8F.cjs.map → MStack-lrvy7l3w.cjs.map} +1 -1
  102. package/dist/{MSubText-Dr0rAnX7.cjs → MSubText-78oYdJQy.cjs} +2 -2
  103. package/dist/{MSubText-Dr0rAnX7.cjs.map → MSubText-78oYdJQy.cjs.map} +1 -1
  104. package/dist/{MSubText-BxDWVjjs.js → MSubText-C2oxXwKT.js} +3 -3
  105. package/dist/{MSubText-BxDWVjjs.js.map → MSubText-C2oxXwKT.js.map} +1 -1
  106. package/dist/{MSurface-BiusHYSB.js → MSurface-B1LXFczo.js} +4 -4
  107. package/dist/{MSurface-BiusHYSB.js.map → MSurface-B1LXFczo.js.map} +1 -1
  108. package/dist/{MSurface-BlCLcifq.cjs → MSurface-BgZ86iYn.cjs} +2 -2
  109. package/dist/{MSurface-BlCLcifq.cjs.map → MSurface-BgZ86iYn.cjs.map} +1 -1
  110. package/dist/MTag-C4_rBj4b.cjs +2 -0
  111. package/dist/{MTag-BMi1GS7v.cjs.map → MTag-C4_rBj4b.cjs.map} +1 -1
  112. package/dist/{MTag-Cor8ZIW3.js → MTag-DOcKm3c2.js} +4 -4
  113. package/dist/{MTag-Cor8ZIW3.js.map → MTag-DOcKm3c2.js.map} +1 -1
  114. package/dist/{MText-DEKnLtLk.cjs → MText-CxSZ2md0.cjs} +2 -2
  115. package/dist/{MText-DEKnLtLk.cjs.map → MText-CxSZ2md0.cjs.map} +1 -1
  116. package/dist/{MText-lZjEtV_i.js → MText-DX9O7gh7.js} +3 -3
  117. package/dist/{MText-lZjEtV_i.js.map → MText-DX9O7gh7.js.map} +1 -1
  118. package/dist/{MTimeAgo-Ci8UkEEk.cjs → MTimeAgo-91_ndjxU.cjs} +2 -2
  119. package/dist/{MTimeAgo-Ci8UkEEk.cjs.map → MTimeAgo-91_ndjxU.cjs.map} +1 -1
  120. package/dist/{MTimeAgo-4pfAn0iE.js → MTimeAgo-xxl53mct.js} +4 -4
  121. package/dist/{MTimeAgo-4pfAn0iE.js.map → MTimeAgo-xxl53mct.js.map} +1 -1
  122. package/dist/{MToggle-CndejlPX.js → MToggle-B6emKoKq.js} +3 -3
  123. package/dist/{MToggle-CndejlPX.js.map → MToggle-B6emKoKq.js.map} +1 -1
  124. package/dist/{MToggle-Dom6azGw.cjs → MToggle-CsGS_W3X.cjs} +2 -2
  125. package/dist/{MToggle-Dom6azGw.cjs.map → MToggle-CsGS_W3X.cjs.map} +1 -1
  126. package/dist/{MTooltip-CsJogGMW.cjs → MTooltip-CNXoyQEN.cjs} +2 -2
  127. package/dist/{MTooltip-CsJogGMW.cjs.map → MTooltip-CNXoyQEN.cjs.map} +1 -1
  128. package/dist/{MTooltip-DIqh59S2.js → MTooltip-UYOjDBOu.js} +3 -3
  129. package/dist/{MTooltip-DIqh59S2.js.map → MTooltip-UYOjDBOu.js.map} +1 -1
  130. package/dist/{cards-CuxycY_U.js → cards-BE77zKTI.js} +299 -304
  131. package/dist/cards-BE77zKTI.js.map +1 -0
  132. package/dist/cards-BINs-dmS.cjs +2 -0
  133. package/dist/cards-BINs-dmS.cjs.map +1 -0
  134. package/dist/cards.cjs +1 -1
  135. package/dist/cards.js +2 -2
  136. package/dist/{cn-SOcVdnX6.cjs → cn-CU5TNITO.cjs} +1 -1
  137. package/dist/{cn-SOcVdnX6.cjs.map → cn-CU5TNITO.cjs.map} +1 -1
  138. package/dist/{cn-DZLxql0l.js → cn-YER3QsV1.js} +1 -1
  139. package/dist/{cn-DZLxql0l.js.map → cn-YER3QsV1.js.map} +1 -1
  140. package/dist/components/data/index.d.ts +1 -1
  141. package/dist/components/feedback/MCookie/MCookieBootstrap/MCookieBootstrap.script.d.ts +4 -0
  142. package/dist/components/feedback/MCookie/MCookieConsent/index.d.ts +1 -1
  143. package/dist/components/layout/MNavbar/MNavbar.d.ts +1 -1
  144. package/dist/components/layout/MNavbar/MNavbar.types.d.ts +4 -0
  145. package/dist/components/layout/MNavbar/index.d.ts +1 -1
  146. package/dist/components/layout/MNavs/MNavs.types.d.ts +12 -2
  147. package/dist/components/layout/MNavs/index.d.ts +1 -1
  148. package/dist/{controls-CO70zfcl.js → controls-BMwQ3C1R.js} +5 -5
  149. package/dist/controls-BMwQ3C1R.js.map +1 -0
  150. package/dist/controls-DwL1-nVC.cjs +2 -0
  151. package/dist/controls-DwL1-nVC.cjs.map +1 -0
  152. package/dist/controls.cjs +1 -1
  153. package/dist/controls.js +6 -6
  154. package/dist/cookie-consent-bootstrap.cjs +1 -1
  155. package/dist/cookie-consent-bootstrap.cjs.map +1 -1
  156. package/dist/cookie-consent-bootstrap.js +45 -32
  157. package/dist/cookie-consent-bootstrap.js.map +1 -1
  158. package/dist/{creditCards-CoZpbB1e.js → creditCards-CCysEwry.js} +1 -1
  159. package/dist/{creditCards-CoZpbB1e.js.map → creditCards-CCysEwry.js.map} +1 -1
  160. package/dist/{creditCards-BjHGqAFx.cjs → creditCards-ljs044xt.cjs} +1 -1
  161. package/dist/{creditCards-BjHGqAFx.cjs.map → creditCards-ljs044xt.cjs.map} +1 -1
  162. package/dist/data-BESfox0z.cjs +2 -0
  163. package/dist/data-BESfox0z.cjs.map +1 -0
  164. package/dist/{data-CaRwdLlD.js → data-s8Hkht1B.js} +714 -718
  165. package/dist/data-s8Hkht1B.js.map +1 -0
  166. package/dist/data.cjs +1 -1
  167. package/dist/data.js +3 -3
  168. package/dist/{dateUtils-BOsYyWde.js → dateUtils-CUY6CRCf.js} +1 -1
  169. package/dist/{dateUtils-BOsYyWde.js.map → dateUtils-CUY6CRCf.js.map} +1 -1
  170. package/dist/{dateUtils-xSfrXjbY.cjs → dateUtils-Dq1vaA-D.cjs} +1 -1
  171. package/dist/{dateUtils-xSfrXjbY.cjs.map → dateUtils-Dq1vaA-D.cjs.map} +1 -1
  172. package/dist/display-B0lpgApV.cjs +2 -0
  173. package/dist/{display-DHpFRcAP.cjs.map → display-B0lpgApV.cjs.map} +1 -1
  174. package/dist/{display-CkzrTEdb.js → display-DuBRiEKr.js} +5 -6
  175. package/dist/{display-CkzrTEdb.js.map → display-DuBRiEKr.js.map} +1 -1
  176. package/dist/display.cjs +1 -1
  177. package/dist/display.js +3 -3
  178. package/dist/{dropdowns-BPRJL_2d.js → dropdowns-BcVrUMPE.js} +106 -110
  179. package/dist/dropdowns-BcVrUMPE.js.map +1 -0
  180. package/dist/dropdowns-CK-oxd62.cjs +2 -0
  181. package/dist/dropdowns-CK-oxd62.cjs.map +1 -0
  182. package/dist/dropdowns.cjs +1 -1
  183. package/dist/dropdowns.js +1 -1
  184. package/dist/{feedback-Cgu8ez5M.js → feedback-D3LLKNlY.js} +238 -240
  185. package/dist/{feedback-Cgu8ez5M.js.map → feedback-D3LLKNlY.js.map} +1 -1
  186. package/dist/feedback-DYjg0Dbp.cjs +2 -0
  187. package/dist/{feedback-DBhETzTM.cjs.map → feedback-DYjg0Dbp.cjs.map} +1 -1
  188. package/dist/feedback.cjs +1 -1
  189. package/dist/feedback.js +6 -6
  190. package/dist/{form-rDra9x3X.cjs → form-6JwrowsS.cjs} +2 -2
  191. package/dist/{form-rDra9x3X.cjs.map → form-6JwrowsS.cjs.map} +1 -1
  192. package/dist/{form-XhjrsBOv.js → form-CFWADsyf.js} +2 -2
  193. package/dist/{form-XhjrsBOv.js.map → form-CFWADsyf.js.map} +1 -1
  194. package/dist/form.cjs +1 -1
  195. package/dist/form.js +1 -1
  196. package/dist/{formatters-BIijIfCB.cjs → formatters-CNjg_h7-.cjs} +1 -1
  197. package/dist/{formatters-BIijIfCB.cjs.map → formatters-CNjg_h7-.cjs.map} +1 -1
  198. package/dist/{formatters-DMI5QqhS.js → formatters-T0vvjMtB.js} +1 -1
  199. package/dist/{formatters-DMI5QqhS.js.map → formatters-T0vvjMtB.js.map} +1 -1
  200. package/dist/{frameworkTexts-DH2N7l8F.js → frameworkTexts-B6oE8pMk.js} +1 -1
  201. package/dist/{frameworkTexts-DH2N7l8F.js.map → frameworkTexts-B6oE8pMk.js.map} +1 -1
  202. package/dist/{frameworkTexts-Ds2orE1v.cjs → frameworkTexts-C_9KZK_A.cjs} +1 -1
  203. package/dist/{frameworkTexts-Ds2orE1v.cjs.map → frameworkTexts-C_9KZK_A.cjs.map} +1 -1
  204. package/dist/i18n.d.ts +1 -1
  205. package/dist/icons-D5DK-J2C.js +4855 -0
  206. package/dist/icons-D5DK-J2C.js.map +1 -0
  207. package/dist/icons-Dv1T-cF4.cjs +2 -0
  208. package/dist/icons-Dv1T-cF4.cjs.map +1 -0
  209. package/dist/icons.cjs +1 -1
  210. package/dist/icons.d.ts +1 -1
  211. package/dist/icons.js +2 -23
  212. package/dist/illustrations.cjs +1 -1
  213. package/dist/illustrations.d.ts +1 -1
  214. package/dist/illustrations.js +1 -1
  215. package/dist/index.cjs +1 -1
  216. package/dist/index.js +59 -79
  217. package/dist/inputs-Dcj6C_Fn.cjs +2 -0
  218. package/dist/{inputs-DPhzLJZH.cjs.map → inputs-Dcj6C_Fn.cjs.map} +1 -1
  219. package/dist/{inputs-BBJgVLXO.js → inputs-bCxSLz-U.js} +424 -430
  220. package/dist/{inputs-BBJgVLXO.js.map → inputs-bCxSLz-U.js.map} +1 -1
  221. package/dist/inputs.cjs +1 -1
  222. package/dist/inputs.js +4 -4
  223. package/dist/{layout-CdAUOdYv.js → layout-Cb94o3oU.js} +291 -219
  224. package/dist/layout-Cb94o3oU.js.map +1 -0
  225. package/dist/layout-DgfsQ-Tn.cjs +2 -0
  226. package/dist/layout-DgfsQ-Tn.cjs.map +1 -0
  227. package/dist/layout.cjs +1 -1
  228. package/dist/layout.js +6 -6
  229. package/dist/{layoutProps-CZ-XhpIX.cjs → layoutProps-Ck4VtGm9.cjs} +1 -1
  230. package/dist/{layoutProps-CZ-XhpIX.cjs.map → layoutProps-Ck4VtGm9.cjs.map} +1 -1
  231. package/dist/{layoutProps-DUPQsWy9.js → layoutProps-Cl6d1KmH.js} +1 -1
  232. package/dist/{layoutProps-DUPQsWy9.js.map → layoutProps-Cl6d1KmH.js.map} +1 -1
  233. package/dist/{licensing-CMLexRJk.cjs → licensing-BXFauUj_.cjs} +1 -1
  234. package/dist/{licensing-CMLexRJk.cjs.map → licensing-BXFauUj_.cjs.map} +1 -1
  235. package/dist/{licensing-SQAMYrOI.js → licensing-CwzqhHH9.js} +1 -1
  236. package/dist/{licensing-SQAMYrOI.js.map → licensing-CwzqhHH9.js.map} +1 -1
  237. package/dist/{locale-DPqdZjGC.js → locale-BNyzqXAU.js} +1 -1
  238. package/dist/{locale-DPqdZjGC.js.map → locale-BNyzqXAU.js.map} +1 -1
  239. package/dist/{locale-BG4Q6P_O.cjs → locale-BltrWJtd.cjs} +1 -1
  240. package/dist/{locale-BG4Q6P_O.cjs.map → locale-BltrWJtd.cjs.map} +1 -1
  241. package/dist/{media-Yp4PedIi.js → media-8aMOtckF.js} +12 -12
  242. package/dist/{media-Yp4PedIi.js.map → media-8aMOtckF.js.map} +1 -1
  243. package/dist/media-D5YGOTm7.cjs +2 -0
  244. package/dist/{media-Cc2wBvkb.cjs.map → media-D5YGOTm7.cjs.map} +1 -1
  245. package/dist/media.cjs +1 -1
  246. package/dist/media.js +3 -3
  247. package/dist/overlays-DCj-oV2H.cjs +2 -0
  248. package/dist/{overlays-CmF2tV32.cjs.map → overlays-DCj-oV2H.cjs.map} +1 -1
  249. package/dist/{overlays-BBlMSWS8.js → overlays-gjg00CAf.js} +7 -7
  250. package/dist/{overlays-BBlMSWS8.js.map → overlays-gjg00CAf.js.map} +1 -1
  251. package/dist/overlays.cjs +1 -1
  252. package/dist/overlays.js +5 -5
  253. package/dist/primitives.cjs +1 -1
  254. package/dist/primitives.js +2 -2
  255. package/dist/{relativeTime-3dGgniAK.js → relativeTime-Cr-NVzij.js} +1 -1
  256. package/dist/{relativeTime-3dGgniAK.js.map → relativeTime-Cr-NVzij.js.map} +1 -1
  257. package/dist/{relativeTime-D5qYOJVu.cjs → relativeTime-DgYBUaVm.cjs} +1 -1
  258. package/dist/{relativeTime-D5qYOJVu.cjs.map → relativeTime-DgYBUaVm.cjs.map} +1 -1
  259. package/dist/style-runtime.cjs +1 -1
  260. package/dist/style-runtime.js +1 -1
  261. package/dist/styles.css +1 -1
  262. package/dist/{MThemeProvider-DUuTvWdm.js → theme-BV4qkzZU.js} +1 -1
  263. package/dist/theme-BV4qkzZU.js.map +1 -0
  264. package/dist/{MThemeProvider-9JHArSd7.cjs → theme-DLorpkJc.cjs} +1 -1
  265. package/dist/theme-DLorpkJc.cjs.map +1 -0
  266. package/dist/theme.cjs +1 -1
  267. package/dist/theme.d.ts +1 -1
  268. package/dist/theme.js +1 -1
  269. package/dist/{typography-DZx1M8Wc.js → typography-DKdr1Tds.js} +3 -3
  270. package/dist/{typography-DZx1M8Wc.js.map → typography-DKdr1Tds.js.map} +1 -1
  271. package/dist/{typography-B9-sCjsR.cjs → typography-qbFGv1gA.cjs} +2 -2
  272. package/dist/{typography-B9-sCjsR.cjs.map → typography-qbFGv1gA.cjs.map} +1 -1
  273. package/dist/typography.cjs +1 -1
  274. package/dist/typography.js +5 -5
  275. package/dist/{useGhostText-Zq3iktss.js → useGhostText-DG0bzcao.js} +1 -1
  276. package/dist/{useGhostText-Zq3iktss.js.map → useGhostText-DG0bzcao.js.map} +1 -1
  277. package/dist/{useGhostText-CL1kSB_V.cjs → useGhostText-QMdO_HK6.cjs} +1 -1
  278. package/dist/{useGhostText-CL1kSB_V.cjs.map → useGhostText-QMdO_HK6.cjs.map} +1 -1
  279. package/dist/{useInteractionEffect-BLehDk91.cjs → useInteractionEffect-DnEfbCrX.cjs} +1 -1
  280. package/dist/{useInteractionEffect-BLehDk91.cjs.map → useInteractionEffect-DnEfbCrX.cjs.map} +1 -1
  281. package/dist/{useInteractionEffect-Dfqq8lGO.js → useInteractionEffect-DtpbVd77.js} +1 -1
  282. package/dist/{useInteractionEffect-Dfqq8lGO.js.map → useInteractionEffect-DtpbVd77.js.map} +1 -1
  283. package/dist/{useKeyboardNav-DBeCcTmg.cjs → useKeyboardNav-BrODLJaL.cjs} +1 -1
  284. package/dist/{useKeyboardNav-DBeCcTmg.cjs.map → useKeyboardNav-BrODLJaL.cjs.map} +1 -1
  285. package/dist/{useKeyboardNav-DXvrPrx9.js → useKeyboardNav-iEXOdEMB.js} +1 -1
  286. package/dist/{useKeyboardNav-DXvrPrx9.js.map → useKeyboardNav-iEXOdEMB.js.map} +1 -1
  287. package/dist/{useReveal-DzskFHKb.js → useReveal-BJ59usiL.js} +1 -1
  288. package/dist/{useReveal-DzskFHKb.js.map → useReveal-BJ59usiL.js.map} +1 -1
  289. package/dist/{useReveal-CdIoh0Rk.cjs → useReveal-B_17PI89.cjs} +1 -1
  290. package/dist/{useReveal-CdIoh0Rk.cjs.map → useReveal-B_17PI89.cjs.map} +1 -1
  291. package/dist/utils.cjs +1 -1
  292. package/dist/utils.js +11 -11
  293. package/dist/{validators-CyDTl6cC.cjs → validators-BeNTD8mf.cjs} +1 -1
  294. package/dist/{validators-CyDTl6cC.cjs.map → validators-BeNTD8mf.cjs.map} +1 -1
  295. package/dist/{validators-ljBWrIca.js → validators-H8tNxb8O.js} +1 -1
  296. package/dist/{validators-ljBWrIca.js.map → validators-H8tNxb8O.js.map} +1 -1
  297. package/package.json +1 -1
  298. package/dist/MArrowDownIcon-BcKSgdTY.js +0 -15
  299. package/dist/MArrowDownIcon-BcKSgdTY.js.map +0 -1
  300. package/dist/MArrowDownIcon-C8EAODgv.cjs +0 -2
  301. package/dist/MArrowDownIcon-C8EAODgv.cjs.map +0 -1
  302. package/dist/MArrowUpDownIcon-CW_PWr7Q.cjs +0 -2
  303. package/dist/MArrowUpDownIcon-CW_PWr7Q.cjs.map +0 -1
  304. package/dist/MArrowUpDownIcon-DukXemVA.js +0 -19
  305. package/dist/MArrowUpDownIcon-DukXemVA.js.map +0 -1
  306. package/dist/MArrowUpIcon-DWV_HYrz.cjs +0 -2
  307. package/dist/MArrowUpIcon-DWV_HYrz.cjs.map +0 -1
  308. package/dist/MArrowUpIcon-Dan-4hs8.js +0 -15
  309. package/dist/MArrowUpIcon-Dan-4hs8.js.map +0 -1
  310. package/dist/MBadge-Babyr1R9.cjs.map +0 -1
  311. package/dist/MBadge-BjZX0MIC.js.map +0 -1
  312. package/dist/MBrandMoreIcons-IQoXQOXv.js +0 -873
  313. package/dist/MBrandMoreIcons-IQoXQOXv.js.map +0 -1
  314. package/dist/MBrandMoreIcons-aks8CSrY.cjs +0 -2
  315. package/dist/MBrandMoreIcons-aks8CSrY.cjs.map +0 -1
  316. package/dist/MCalendarIcon-DXTVH31q.js +0 -29
  317. package/dist/MCalendarIcon-DXTVH31q.js.map +0 -1
  318. package/dist/MCalendarIcon-S4GQsUlu.cjs +0 -2
  319. package/dist/MCalendarIcon-S4GQsUlu.cjs.map +0 -1
  320. package/dist/MChatIcon-Bb3DbYgB.js +0 -96
  321. package/dist/MChatIcon-Bb3DbYgB.js.map +0 -1
  322. package/dist/MChatIcon-C-5VN1TR.cjs +0 -2
  323. package/dist/MChatIcon-C-5VN1TR.cjs.map +0 -1
  324. package/dist/MCheckIcon-DQumT4HX.js +0 -15
  325. package/dist/MCheckIcon-DQumT4HX.js.map +0 -1
  326. package/dist/MCheckIcon-ck_21ybZ.cjs +0 -2
  327. package/dist/MCheckIcon-ck_21ybZ.cjs.map +0 -1
  328. package/dist/MChevronDownIcon-D3yTpzni.js +0 -15
  329. package/dist/MChevronDownIcon-D3yTpzni.js.map +0 -1
  330. package/dist/MChevronDownIcon-DCMmxkRt.cjs +0 -2
  331. package/dist/MChevronDownIcon-DCMmxkRt.cjs.map +0 -1
  332. package/dist/MChevronRightIcon-BC08M6g8.cjs +0 -2
  333. package/dist/MChevronRightIcon-BC08M6g8.cjs.map +0 -1
  334. package/dist/MChevronRightIcon-CXs8IHiV.js +0 -21
  335. package/dist/MChevronRightIcon-CXs8IHiV.js.map +0 -1
  336. package/dist/MClockIcon-DTevPaRf.js +0 -19
  337. package/dist/MClockIcon-DTevPaRf.js.map +0 -1
  338. package/dist/MClockIcon-DoskImOg.cjs +0 -2
  339. package/dist/MClockIcon-DoskImOg.cjs.map +0 -1
  340. package/dist/MCloseIcon-6cfw9trj.cjs +0 -2
  341. package/dist/MCloseIcon-6cfw9trj.cjs.map +0 -1
  342. package/dist/MCloseIcon-lDH3Vc10.js +0 -15
  343. package/dist/MCloseIcon-lDH3Vc10.js.map +0 -1
  344. package/dist/MDataTable-B0QbAjVI.cjs +0 -2
  345. package/dist/MDrawer-_Bao-x1w.cjs +0 -2
  346. package/dist/MEllipsisVerticalIcon-CXmu-bHJ.js +0 -43
  347. package/dist/MEllipsisVerticalIcon-CXmu-bHJ.js.map +0 -1
  348. package/dist/MEllipsisVerticalIcon-CufhU4cO.cjs +0 -2
  349. package/dist/MEllipsisVerticalIcon-CufhU4cO.cjs.map +0 -1
  350. package/dist/MFileExtIcons-CPsgV8eQ.cjs +0 -2
  351. package/dist/MFileExtIcons-CPsgV8eQ.cjs.map +0 -1
  352. package/dist/MFileExtIcons-Cxbgd5Fz.js +0 -145
  353. package/dist/MFileExtIcons-Cxbgd5Fz.js.map +0 -1
  354. package/dist/MIcon-BPr09_p4.js +0 -49
  355. package/dist/MIcon-BPr09_p4.js.map +0 -1
  356. package/dist/MIcon-CX5beo32.cjs +0 -2
  357. package/dist/MIcon-CX5beo32.cjs.map +0 -1
  358. package/dist/MImage-C99xrQQ9.js.map +0 -1
  359. package/dist/MImage-DbianX0t.cjs.map +0 -1
  360. package/dist/MInput-Bpkn3gOQ.cjs +0 -2
  361. package/dist/MInputCVC-Bl8i97Y0.cjs +0 -2
  362. package/dist/MInputCVC-Bl8i97Y0.cjs.map +0 -1
  363. package/dist/MInputCVC-CcG_KJvq.js.map +0 -1
  364. package/dist/MInputSearch-APMIHkYb.cjs +0 -2
  365. package/dist/MMenuIcon-A_eXBpM8.cjs +0 -2
  366. package/dist/MMenuIcon-A_eXBpM8.cjs.map +0 -1
  367. package/dist/MMenuIcon-CbBHfxVa.js +0 -20
  368. package/dist/MMenuIcon-CbBHfxVa.js.map +0 -1
  369. package/dist/MPagination-3fsF3pCM.cjs +0 -2
  370. package/dist/MPhoneIcon-D5JEg8LZ.js +0 -38
  371. package/dist/MPhoneIcon-D5JEg8LZ.js.map +0 -1
  372. package/dist/MPhoneIcon-D5unTWyf.cjs +0 -2
  373. package/dist/MPhoneIcon-D5unTWyf.cjs.map +0 -1
  374. package/dist/MProtectIcon-B_m67eu1.cjs +0 -2
  375. package/dist/MProtectIcon-B_m67eu1.cjs.map +0 -1
  376. package/dist/MProtectIcon-s_IpKWPz.js +0 -80
  377. package/dist/MProtectIcon-s_IpKWPz.js.map +0 -1
  378. package/dist/MQrCode-ClP7YJFt.cjs +0 -2
  379. package/dist/MSearchIcon-BakfEJQd.cjs +0 -2
  380. package/dist/MSearchIcon-BakfEJQd.cjs.map +0 -1
  381. package/dist/MSearchIcon-Dlg4Og8t.js +0 -24
  382. package/dist/MSearchIcon-Dlg4Og8t.js.map +0 -1
  383. package/dist/MSparkline-LfEfA310.js.map +0 -1
  384. package/dist/MSparkline-lRq3gAYU.cjs.map +0 -1
  385. package/dist/MStarFillIcon-BxKSY0VO.js +0 -25
  386. package/dist/MStarFillIcon-BxKSY0VO.js.map +0 -1
  387. package/dist/MStarFillIcon-CnINKvE4.cjs +0 -2
  388. package/dist/MStarFillIcon-CnINKvE4.cjs.map +0 -1
  389. package/dist/MSuccessIcon-Cvs8ER4y.cjs +0 -2
  390. package/dist/MSuccessIcon-Cvs8ER4y.cjs.map +0 -1
  391. package/dist/MSuccessIcon-DH5Z83mM.js +0 -33
  392. package/dist/MSuccessIcon-DH5Z83mM.js.map +0 -1
  393. package/dist/MTag-BMi1GS7v.cjs +0 -2
  394. package/dist/MThemeProvider-9JHArSd7.cjs.map +0 -1
  395. package/dist/MThemeProvider-DUuTvWdm.js.map +0 -1
  396. package/dist/MZoomInIcon-BEdmglk6.js +0 -134
  397. package/dist/MZoomInIcon-BEdmglk6.js.map +0 -1
  398. package/dist/MZoomInIcon-dhRm7zT6.cjs +0 -2
  399. package/dist/MZoomInIcon-dhRm7zT6.cjs.map +0 -1
  400. package/dist/cards-Bp7jOY3_.cjs +0 -2
  401. package/dist/cards-Bp7jOY3_.cjs.map +0 -1
  402. package/dist/cards-CuxycY_U.js.map +0 -1
  403. package/dist/controls-BJe59nXf.cjs +0 -2
  404. package/dist/controls-BJe59nXf.cjs.map +0 -1
  405. package/dist/controls-CO70zfcl.js.map +0 -1
  406. package/dist/data-CaRwdLlD.js.map +0 -1
  407. package/dist/data-r5uYgiWq.cjs +0 -2
  408. package/dist/data-r5uYgiWq.cjs.map +0 -1
  409. package/dist/display-DHpFRcAP.cjs +0 -2
  410. package/dist/dropdowns-BPRJL_2d.js.map +0 -1
  411. package/dist/dropdowns-BTbAnQxt.cjs +0 -2
  412. package/dist/dropdowns-BTbAnQxt.cjs.map +0 -1
  413. package/dist/feedback-DBhETzTM.cjs +0 -2
  414. package/dist/icons.entry-LwjwnjE2.cjs +0 -2
  415. package/dist/icons.entry-LwjwnjE2.cjs.map +0 -1
  416. package/dist/icons.entry-txsQqMvb.js +0 -3318
  417. package/dist/icons.entry-txsQqMvb.js.map +0 -1
  418. package/dist/illustrations.entry-C0rSNpF1.js.map +0 -1
  419. package/dist/inputs-DPhzLJZH.cjs +0 -2
  420. package/dist/layout-CdAUOdYv.js.map +0 -1
  421. package/dist/layout-DsY7-y6U.cjs +0 -2
  422. package/dist/layout-DsY7-y6U.cjs.map +0 -1
  423. package/dist/media-Cc2wBvkb.cjs +0 -2
  424. package/dist/overlays-CmF2tV32.cjs +0 -2
@@ -129,4 +129,4 @@ function m() {
129
129
  //#endregion
130
130
  export { m as n, p as t };
131
131
 
132
- //# sourceMappingURL=MThemeProvider-DUuTvWdm.js.map
132
+ //# sourceMappingURL=theme-BV4qkzZU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-BV4qkzZU.js","names":[],"sources":["../src/theme/MThemeProvider.tsx"],"sourcesContent":["import {createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type ReactNode} from 'react'\nimport type {MTheme, MMode, MModePreference} from './MTheme.types'\n\nconst STORAGE_KEY = 'mineralui-theme'\n\n// Resolve the final mode once 'system' is allowed.\nfunction resolveMode(pref: MModePreference): MMode {\n if (pref !== 'system') return pref\n if (typeof window === 'undefined') return 'dark'\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n}\n\n// Read a persisted mode safely when storage is available.\nfunction readStored(): MModePreference | null {\n try {\n const v = localStorage.getItem(STORAGE_KEY)\n if (v === 'dark' || v === 'light' || v === 'system') return v\n } catch {\n /* SSR / blocked storage */\n }\n return null\n}\n\nexport interface MThemeContextValue {\n theme: MTheme\n mode: MModePreference\n resolvedMode: MMode\n setMode: (next: MModePreference) => void\n toggleMode: () => void\n}\n\nconst ThemeContext = createContext<MThemeContextValue>({\n theme: {},\n mode: 'dark',\n resolvedMode: 'dark',\n setMode: () => {},\n toggleMode: () => {},\n})\n\n// Map JS theme keys to CSS custom properties.\nconst varMap: Record<keyof MTheme, string> = {\n primaryRgb: '--mineral-primary-rgb',\n primary: '--mineral-primary',\n primaryDark: '--mineral-primary-dark',\n primaryLight: '--mineral-primary-light',\n neutralRgb: '--mineral-neutral-rgb',\n neutral: '--mineral-neutral',\n dark: '--mineral-dark',\n darkLight: '--mineral-dark-light',\n surface: '--mineral-surface',\n surfaceContrast: '--mineral-surface-contrast',\n pageBg: '--mineral-page-bg',\n pageText: '--mineral-page-text',\n text: '--mineral-text',\n textSecondary: '--mineral-text-secondary',\n textHeading: '--mineral-text-heading',\n border: '--mineral-border',\n borderHover: '--mineral-border-hover',\n borderFocus: '--mineral-border-focus',\n successRgb: '--mineral-success-rgb',\n success: '--mineral-success',\n errorRgb: '--mineral-error-rgb',\n error: '--mineral-error',\n warningRgb: '--mineral-warning-rgb',\n warning: '--mineral-warning',\n infoRgb: '--mineral-info-rgb',\n info: '--mineral-info',\n fontFamily: '--mineral-font-family-sans',\n fontFamilySans: '--mineral-font-family-sans',\n fontFamilyMono: '--mineral-font-family-mono',\n fontFamilyHeading: '--mineral-font-family-heading',\n fontColorDefault: '--mineral-fcolor-default',\n fontColorMuted: '--mineral-fcolor-muted',\n fontColorHeading: '--mineral-fcolor-heading',\n fontColorInverted: '--mineral-fcolor-inverted',\n fontColorPrimary: '--mineral-fcolor-primary',\n fontColorNeutral: '--mineral-fcolor-neutral',\n fontColorSuccess: '--mineral-fcolor-success',\n fontColorError: '--mineral-fcolor-error',\n fontColorWarning: '--mineral-fcolor-warning',\n fontColorInfo: '--mineral-fcolor-info',\n radiusSm: '--mineral-radius-sm',\n radiusMd: '--mineral-radius-md',\n radiusLg: '--mineral-radius-lg',\n}\n\nexport type MThemeScope = 'body' | 'wrapper'\n\nexport interface MThemeProviderProps {\n theme?: MTheme\n mode?: MModePreference\n persist?: boolean\n scope?: MThemeScope\n children: ReactNode\n}\n\n// Sync theme tokens and mode classes with either the body or a local wrapper.\nexport function MThemeProvider({\n theme,\n mode: modeProp = 'dark',\n persist = true,\n scope = 'body',\n children,\n}: MThemeProviderProps) {\n const ref = useRef<HTMLDivElement>(null)\n const safeTheme = useMemo(() => theme ?? {}, [theme])\n\n const [mode, setModeState] = useState<MModePreference>(() => {\n if (persist) {\n const stored = readStored()\n if (stored) return stored\n }\n return modeProp\n })\n\n const resolved = resolveMode(mode)\n\n const setMode = useCallback(\n (next: MModePreference) => {\n setModeState(next)\n if (persist) {\n try {\n localStorage.setItem(STORAGE_KEY, next)\n } catch {\n /* noop */\n }\n }\n },\n [persist]\n )\n\n const toggleMode = useCallback(() => {\n setMode(resolved === 'dark' ? 'light' : 'dark')\n }, [resolved, setMode])\n\n // Listen for system theme changes when mode is 'system'.\n useEffect(() => {\n if (mode !== 'system') return\n const mq = window.matchMedia('(prefers-color-scheme: dark)')\n const handler = () => setModeState('system')\n mq.addEventListener('change', handler)\n return () => mq.removeEventListener('change', handler)\n }, [mode])\n\n // Apply token overrides and light/dark class.\n useEffect(() => {\n const target = scope === 'body' ? document.body : ref.current\n if (!target) return\n\n for (const [key, value] of Object.entries(safeTheme)) {\n const cssVar = varMap[key as keyof MTheme]\n if (cssVar && value) {\n target.style.setProperty(cssVar, value)\n if (cssVar === '--mineral-font-family-sans') {\n target.style.setProperty('--mineral-font-family', value)\n }\n }\n }\n\n target.classList.toggle('theme-light', resolved === 'light')\n\n return () => {\n for (const key of Object.keys(safeTheme)) {\n const cssVar = varMap[key as keyof MTheme]\n if (cssVar) {\n target.style.removeProperty(cssVar)\n if (cssVar === '--mineral-font-family-sans') {\n target.style.removeProperty('--mineral-font-family')\n }\n }\n }\n target.classList.remove('theme-light')\n }\n }, [resolved, safeTheme, scope])\n\n const ctx = useMemo<MThemeContextValue>(\n () => ({\n theme: safeTheme,\n mode,\n resolvedMode: resolved,\n setMode,\n toggleMode,\n }),\n [safeTheme, mode, resolved, setMode, toggleMode]\n )\n\n return (\n <ThemeContext.Provider value={ctx}>\n {scope === 'wrapper' ? (\n <div ref={ref} className={resolved === 'light' ? 'theme-light' : undefined}>\n {children}\n </div>\n ) : (\n children\n )}\n </ThemeContext.Provider>\n )\n}\n\nexport function useMTheme(): MThemeContextValue {\n return useContext(ThemeContext)\n}\n"],"mappings":";;;AAGA,IAAM,IAAc;AAGpB,SAAS,EAAY,GAA8B;AAG/C,QAFI,MAAS,WACT,OAAO,SAAW,OACf,OAAO,WAAW,+BAA+B,CAAC,UADf,SACkC,UAF9C;;AAMlC,SAAS,IAAqC;AAC1C,KAAI;EACA,IAAM,IAAI,aAAa,QAAQ,EAAY;AAC3C,MAAI,MAAM,UAAU,MAAM,WAAW,MAAM,SAAU,QAAO;SACxD;AAGR,QAAO;;AAWX,IAAM,IAAe,EAAkC;CACnD,OAAO,EAAE;CACT,MAAM;CACN,cAAc;CACd,eAAe;CACf,kBAAkB;CACrB,CAAC,EAGI,IAAuC;CACzC,YAAY;CACZ,SAAS;CACT,aAAa;CACb,cAAc;CACd,YAAY;CACZ,SAAS;CACT,MAAM;CACN,WAAW;CACX,SAAS;CACT,iBAAiB;CACjB,QAAQ;CACR,UAAU;CACV,MAAM;CACN,eAAe;CACf,aAAa;CACb,QAAQ;CACR,aAAa;CACb,aAAa;CACb,YAAY;CACZ,SAAS;CACT,UAAU;CACV,OAAO;CACP,YAAY;CACZ,SAAS;CACT,SAAS;CACT,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,gBAAgB;CAChB,mBAAmB;CACnB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,kBAAkB;CAClB,kBAAkB;CAClB,gBAAgB;CAChB,kBAAkB;CAClB,eAAe;CACf,UAAU;CACV,UAAU;CACV,UAAU;CACb;AAaD,SAAgB,EAAe,EAC3B,UACA,MAAM,IAAW,QACjB,aAAU,IACV,WAAQ,QACR,eACoB;CACpB,IAAM,IAAM,EAAuB,KAAK,EAClC,IAAY,QAAc,KAAS,EAAE,EAAE,CAAC,EAAM,CAAC,EAE/C,CAAC,GAAM,KAAgB,QAAgC;AACzD,MAAI,GAAS;GACT,IAAM,IAAS,GAAY;AAC3B,OAAI,EAAQ,QAAO;;AAEvB,SAAO;GACT,EAEI,IAAW,EAAY,EAAK,EAE5B,IAAU,GACX,MAA0B;AAEvB,MADA,EAAa,EAAK,EACd,EACA,KAAI;AACA,gBAAa,QAAQ,GAAa,EAAK;UACnC;IAKhB,CAAC,EAAQ,CACZ,EAEK,IAAa,QAAkB;AACjC,IAAQ,MAAa,SAAS,UAAU,OAAO;IAChD,CAAC,GAAU,EAAQ,CAAC;AAYvB,CATA,QAAgB;AACZ,MAAI,MAAS,SAAU;EACvB,IAAM,IAAK,OAAO,WAAW,+BAA+B,EACtD,UAAgB,EAAa,SAAS;AAE5C,SADA,EAAG,iBAAiB,UAAU,EAAQ,QACzB,EAAG,oBAAoB,UAAU,EAAQ;IACvD,CAAC,EAAK,CAAC,EAGV,QAAgB;EACZ,IAAM,IAAS,MAAU,SAAS,SAAS,OAAO,EAAI;AACjD,SAEL;QAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAU,EAAE;IAClD,IAAM,IAAS,EAAO;AACtB,IAAI,KAAU,MACV,EAAO,MAAM,YAAY,GAAQ,EAAM,EACnC,MAAW,gCACX,EAAO,MAAM,YAAY,yBAAyB,EAAM;;AAOpE,UAFA,EAAO,UAAU,OAAO,eAAe,MAAa,QAAQ,QAE/C;AACT,SAAK,IAAM,KAAO,OAAO,KAAK,EAAU,EAAE;KACtC,IAAM,IAAS,EAAO;AACtB,KAAI,MACA,EAAO,MAAM,eAAe,EAAO,EAC/B,MAAW,gCACX,EAAO,MAAM,eAAe,wBAAwB;;AAIhE,MAAO,UAAU,OAAO,cAAc;;;IAE3C;EAAC;EAAU;EAAW;EAAM,CAAC;CAEhC,IAAM,IAAM,SACD;EACH,OAAO;EACP;EACA,cAAc;EACd;EACA;EACH,GACD;EAAC;EAAW;EAAM;EAAU;EAAS;EAAW,CACnD;AAED,QACI,kBAAC,EAAa,UAAd;EAAuB,OAAO;YACzB,MAAU,YACP,kBAAC,OAAD;GAAU;GAAK,WAAW,MAAa,UAAU,gBAAgB,KAAA;GAC5D;GACC,CAAA,GAEN;EAEgB,CAAA;;AAIhC,SAAgB,IAAgC;AAC5C,QAAO,EAAW,EAAa"}
@@ -1,2 +1,2 @@
1
1
  let e=require(`react`),t=require(`react/jsx-runtime`);var n=`mineralui-theme`;function r(e){return e===`system`?typeof window>`u`||window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e}function i(){try{let e=localStorage.getItem(n);if(e===`dark`||e===`light`||e===`system`)return e}catch{}return null}var a=(0,e.createContext)({theme:{},mode:`dark`,resolvedMode:`dark`,setMode:()=>{},toggleMode:()=>{}}),o={primaryRgb:`--mineral-primary-rgb`,primary:`--mineral-primary`,primaryDark:`--mineral-primary-dark`,primaryLight:`--mineral-primary-light`,neutralRgb:`--mineral-neutral-rgb`,neutral:`--mineral-neutral`,dark:`--mineral-dark`,darkLight:`--mineral-dark-light`,surface:`--mineral-surface`,surfaceContrast:`--mineral-surface-contrast`,pageBg:`--mineral-page-bg`,pageText:`--mineral-page-text`,text:`--mineral-text`,textSecondary:`--mineral-text-secondary`,textHeading:`--mineral-text-heading`,border:`--mineral-border`,borderHover:`--mineral-border-hover`,borderFocus:`--mineral-border-focus`,successRgb:`--mineral-success-rgb`,success:`--mineral-success`,errorRgb:`--mineral-error-rgb`,error:`--mineral-error`,warningRgb:`--mineral-warning-rgb`,warning:`--mineral-warning`,infoRgb:`--mineral-info-rgb`,info:`--mineral-info`,fontFamily:`--mineral-font-family-sans`,fontFamilySans:`--mineral-font-family-sans`,fontFamilyMono:`--mineral-font-family-mono`,fontFamilyHeading:`--mineral-font-family-heading`,fontColorDefault:`--mineral-fcolor-default`,fontColorMuted:`--mineral-fcolor-muted`,fontColorHeading:`--mineral-fcolor-heading`,fontColorInverted:`--mineral-fcolor-inverted`,fontColorPrimary:`--mineral-fcolor-primary`,fontColorNeutral:`--mineral-fcolor-neutral`,fontColorSuccess:`--mineral-fcolor-success`,fontColorError:`--mineral-fcolor-error`,fontColorWarning:`--mineral-fcolor-warning`,fontColorInfo:`--mineral-fcolor-info`,radiusSm:`--mineral-radius-sm`,radiusMd:`--mineral-radius-md`,radiusLg:`--mineral-radius-lg`};function s({theme:s,mode:c=`dark`,persist:l=!0,scope:u=`body`,children:d}){let f=(0,e.useRef)(null),p=(0,e.useMemo)(()=>s??{},[s]),[m,h]=(0,e.useState)(()=>{if(l){let e=i();if(e)return e}return c}),g=r(m),_=(0,e.useCallback)(e=>{if(h(e),l)try{localStorage.setItem(n,e)}catch{}},[l]),v=(0,e.useCallback)(()=>{_(g===`dark`?`light`:`dark`)},[g,_]);(0,e.useEffect)(()=>{if(m!==`system`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>h(`system`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[m]),(0,e.useEffect)(()=>{let e=u===`body`?document.body:f.current;if(e){for(let[t,n]of Object.entries(p)){let r=o[t];r&&n&&(e.style.setProperty(r,n),r===`--mineral-font-family-sans`&&e.style.setProperty(`--mineral-font-family`,n))}return e.classList.toggle(`theme-light`,g===`light`),()=>{for(let t of Object.keys(p)){let n=o[t];n&&(e.style.removeProperty(n),n===`--mineral-font-family-sans`&&e.style.removeProperty(`--mineral-font-family`))}e.classList.remove(`theme-light`)}}},[g,p,u]);let y=(0,e.useMemo)(()=>({theme:p,mode:m,resolvedMode:g,setMode:_,toggleMode:v}),[p,m,g,_,v]);return(0,t.jsx)(a.Provider,{value:y,children:u===`wrapper`?(0,t.jsx)(`div`,{ref:f,className:g===`light`?`theme-light`:void 0,children:d}):d})}function c(){return(0,e.useContext)(a)}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
2
- //# sourceMappingURL=MThemeProvider-9JHArSd7.cjs.map
2
+ //# sourceMappingURL=theme-DLorpkJc.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-DLorpkJc.cjs","names":[],"sources":["../src/theme/MThemeProvider.tsx"],"sourcesContent":["import {createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type ReactNode} from 'react'\nimport type {MTheme, MMode, MModePreference} from './MTheme.types'\n\nconst STORAGE_KEY = 'mineralui-theme'\n\n// Resolve the final mode once 'system' is allowed.\nfunction resolveMode(pref: MModePreference): MMode {\n if (pref !== 'system') return pref\n if (typeof window === 'undefined') return 'dark'\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n}\n\n// Read a persisted mode safely when storage is available.\nfunction readStored(): MModePreference | null {\n try {\n const v = localStorage.getItem(STORAGE_KEY)\n if (v === 'dark' || v === 'light' || v === 'system') return v\n } catch {\n /* SSR / blocked storage */\n }\n return null\n}\n\nexport interface MThemeContextValue {\n theme: MTheme\n mode: MModePreference\n resolvedMode: MMode\n setMode: (next: MModePreference) => void\n toggleMode: () => void\n}\n\nconst ThemeContext = createContext<MThemeContextValue>({\n theme: {},\n mode: 'dark',\n resolvedMode: 'dark',\n setMode: () => {},\n toggleMode: () => {},\n})\n\n// Map JS theme keys to CSS custom properties.\nconst varMap: Record<keyof MTheme, string> = {\n primaryRgb: '--mineral-primary-rgb',\n primary: '--mineral-primary',\n primaryDark: '--mineral-primary-dark',\n primaryLight: '--mineral-primary-light',\n neutralRgb: '--mineral-neutral-rgb',\n neutral: '--mineral-neutral',\n dark: '--mineral-dark',\n darkLight: '--mineral-dark-light',\n surface: '--mineral-surface',\n surfaceContrast: '--mineral-surface-contrast',\n pageBg: '--mineral-page-bg',\n pageText: '--mineral-page-text',\n text: '--mineral-text',\n textSecondary: '--mineral-text-secondary',\n textHeading: '--mineral-text-heading',\n border: '--mineral-border',\n borderHover: '--mineral-border-hover',\n borderFocus: '--mineral-border-focus',\n successRgb: '--mineral-success-rgb',\n success: '--mineral-success',\n errorRgb: '--mineral-error-rgb',\n error: '--mineral-error',\n warningRgb: '--mineral-warning-rgb',\n warning: '--mineral-warning',\n infoRgb: '--mineral-info-rgb',\n info: '--mineral-info',\n fontFamily: '--mineral-font-family-sans',\n fontFamilySans: '--mineral-font-family-sans',\n fontFamilyMono: '--mineral-font-family-mono',\n fontFamilyHeading: '--mineral-font-family-heading',\n fontColorDefault: '--mineral-fcolor-default',\n fontColorMuted: '--mineral-fcolor-muted',\n fontColorHeading: '--mineral-fcolor-heading',\n fontColorInverted: '--mineral-fcolor-inverted',\n fontColorPrimary: '--mineral-fcolor-primary',\n fontColorNeutral: '--mineral-fcolor-neutral',\n fontColorSuccess: '--mineral-fcolor-success',\n fontColorError: '--mineral-fcolor-error',\n fontColorWarning: '--mineral-fcolor-warning',\n fontColorInfo: '--mineral-fcolor-info',\n radiusSm: '--mineral-radius-sm',\n radiusMd: '--mineral-radius-md',\n radiusLg: '--mineral-radius-lg',\n}\n\nexport type MThemeScope = 'body' | 'wrapper'\n\nexport interface MThemeProviderProps {\n theme?: MTheme\n mode?: MModePreference\n persist?: boolean\n scope?: MThemeScope\n children: ReactNode\n}\n\n// Sync theme tokens and mode classes with either the body or a local wrapper.\nexport function MThemeProvider({\n theme,\n mode: modeProp = 'dark',\n persist = true,\n scope = 'body',\n children,\n}: MThemeProviderProps) {\n const ref = useRef<HTMLDivElement>(null)\n const safeTheme = useMemo(() => theme ?? {}, [theme])\n\n const [mode, setModeState] = useState<MModePreference>(() => {\n if (persist) {\n const stored = readStored()\n if (stored) return stored\n }\n return modeProp\n })\n\n const resolved = resolveMode(mode)\n\n const setMode = useCallback(\n (next: MModePreference) => {\n setModeState(next)\n if (persist) {\n try {\n localStorage.setItem(STORAGE_KEY, next)\n } catch {\n /* noop */\n }\n }\n },\n [persist]\n )\n\n const toggleMode = useCallback(() => {\n setMode(resolved === 'dark' ? 'light' : 'dark')\n }, [resolved, setMode])\n\n // Listen for system theme changes when mode is 'system'.\n useEffect(() => {\n if (mode !== 'system') return\n const mq = window.matchMedia('(prefers-color-scheme: dark)')\n const handler = () => setModeState('system')\n mq.addEventListener('change', handler)\n return () => mq.removeEventListener('change', handler)\n }, [mode])\n\n // Apply token overrides and light/dark class.\n useEffect(() => {\n const target = scope === 'body' ? document.body : ref.current\n if (!target) return\n\n for (const [key, value] of Object.entries(safeTheme)) {\n const cssVar = varMap[key as keyof MTheme]\n if (cssVar && value) {\n target.style.setProperty(cssVar, value)\n if (cssVar === '--mineral-font-family-sans') {\n target.style.setProperty('--mineral-font-family', value)\n }\n }\n }\n\n target.classList.toggle('theme-light', resolved === 'light')\n\n return () => {\n for (const key of Object.keys(safeTheme)) {\n const cssVar = varMap[key as keyof MTheme]\n if (cssVar) {\n target.style.removeProperty(cssVar)\n if (cssVar === '--mineral-font-family-sans') {\n target.style.removeProperty('--mineral-font-family')\n }\n }\n }\n target.classList.remove('theme-light')\n }\n }, [resolved, safeTheme, scope])\n\n const ctx = useMemo<MThemeContextValue>(\n () => ({\n theme: safeTheme,\n mode,\n resolvedMode: resolved,\n setMode,\n toggleMode,\n }),\n [safeTheme, mode, resolved, setMode, toggleMode]\n )\n\n return (\n <ThemeContext.Provider value={ctx}>\n {scope === 'wrapper' ? (\n <div ref={ref} className={resolved === 'light' ? 'theme-light' : undefined}>\n {children}\n </div>\n ) : (\n children\n )}\n </ThemeContext.Provider>\n )\n}\n\nexport function useMTheme(): MThemeContextValue {\n return useContext(ThemeContext)\n}\n"],"mappings":"sDAGA,IAAM,EAAc,kBAGpB,SAAS,EAAY,EAA8B,CAG/C,OAFI,IAAS,SACT,OAAO,OAAW,KACf,OAAO,WAAW,+BAA+B,CAAC,QADf,OACkC,QAF9C,EAMlC,SAAS,GAAqC,CAC1C,GAAI,CACA,IAAM,EAAI,aAAa,QAAQ,EAAY,CAC3C,GAAI,IAAM,QAAU,IAAM,SAAW,IAAM,SAAU,OAAO,OACxD,EAGR,OAAO,KAWX,IAAM,GAAA,EAAA,EAAA,eAAiD,CACnD,MAAO,EAAE,CACT,KAAM,OACN,aAAc,OACd,YAAe,GACf,eAAkB,GACrB,CAAC,CAGI,EAAuC,CACzC,WAAY,wBACZ,QAAS,oBACT,YAAa,yBACb,aAAc,0BACd,WAAY,wBACZ,QAAS,oBACT,KAAM,iBACN,UAAW,uBACX,QAAS,oBACT,gBAAiB,6BACjB,OAAQ,oBACR,SAAU,sBACV,KAAM,iBACN,cAAe,2BACf,YAAa,yBACb,OAAQ,mBACR,YAAa,yBACb,YAAa,yBACb,WAAY,wBACZ,QAAS,oBACT,SAAU,sBACV,MAAO,kBACP,WAAY,wBACZ,QAAS,oBACT,QAAS,qBACT,KAAM,iBACN,WAAY,6BACZ,eAAgB,6BAChB,eAAgB,6BAChB,kBAAmB,gCACnB,iBAAkB,2BAClB,eAAgB,yBAChB,iBAAkB,2BAClB,kBAAmB,4BACnB,iBAAkB,2BAClB,iBAAkB,2BAClB,iBAAkB,2BAClB,eAAgB,yBAChB,iBAAkB,2BAClB,cAAe,wBACf,SAAU,sBACV,SAAU,sBACV,SAAU,sBACb,CAaD,SAAgB,EAAe,CAC3B,QACA,KAAM,EAAW,OACjB,UAAU,GACV,QAAQ,OACR,YACoB,CACpB,IAAM,GAAA,EAAA,EAAA,QAA6B,KAAK,CAClC,GAAA,EAAA,EAAA,aAA0B,GAAS,EAAE,CAAE,CAAC,EAAM,CAAC,CAE/C,CAAC,EAAM,IAAA,EAAA,EAAA,cAAgD,CACzD,GAAI,EAAS,CACT,IAAM,EAAS,GAAY,CAC3B,GAAI,EAAQ,OAAO,EAEvB,OAAO,GACT,CAEI,EAAW,EAAY,EAAK,CAE5B,GAAA,EAAA,EAAA,aACD,GAA0B,CAEvB,GADA,EAAa,EAAK,CACd,EACA,GAAI,CACA,aAAa,QAAQ,EAAa,EAAK,MACnC,IAKhB,CAAC,EAAQ,CACZ,CAEK,GAAA,EAAA,EAAA,iBAA+B,CACjC,EAAQ,IAAa,OAAS,QAAU,OAAO,EAChD,CAAC,EAAU,EAAQ,CAAC,EAGvB,EAAA,EAAA,eAAgB,CACZ,GAAI,IAAS,SAAU,OACvB,IAAM,EAAK,OAAO,WAAW,+BAA+B,CACtD,MAAgB,EAAa,SAAS,CAE5C,OADA,EAAG,iBAAiB,SAAU,EAAQ,KACzB,EAAG,oBAAoB,SAAU,EAAQ,EACvD,CAAC,EAAK,CAAC,EAGV,EAAA,EAAA,eAAgB,CACZ,IAAM,EAAS,IAAU,OAAS,SAAS,KAAO,EAAI,QACjD,KAEL,KAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,EAAU,CAAE,CAClD,IAAM,EAAS,EAAO,GAClB,GAAU,IACV,EAAO,MAAM,YAAY,EAAQ,EAAM,CACnC,IAAW,8BACX,EAAO,MAAM,YAAY,wBAAyB,EAAM,EAOpE,OAFA,EAAO,UAAU,OAAO,cAAe,IAAa,QAAQ,KAE/C,CACT,IAAK,IAAM,KAAO,OAAO,KAAK,EAAU,CAAE,CACtC,IAAM,EAAS,EAAO,GAClB,IACA,EAAO,MAAM,eAAe,EAAO,CAC/B,IAAW,8BACX,EAAO,MAAM,eAAe,wBAAwB,EAIhE,EAAO,UAAU,OAAO,cAAc,IAE3C,CAAC,EAAU,EAAW,EAAM,CAAC,CAEhC,IAAM,GAAA,EAAA,EAAA,cACK,CACH,MAAO,EACP,OACA,aAAc,EACd,UACA,aACH,EACD,CAAC,EAAW,EAAM,EAAU,EAAS,EAAW,CACnD,CAED,OACI,EAAA,EAAA,KAAC,EAAa,SAAd,CAAuB,MAAO,WACzB,IAAU,WACP,EAAA,EAAA,KAAC,MAAD,CAAU,MAAK,UAAW,IAAa,QAAU,cAAgB,IAAA,GAC5D,WACC,CAAA,CAEN,EAEgB,CAAA,CAIhC,SAAgB,GAAgC,CAC5C,OAAA,EAAA,EAAA,YAAkB,EAAa"}
package/dist/theme.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  const {ensureStyles}=require('./style-runtime.cjs')
2
2
  ensureStyles()
3
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./MThemeProvider-9JHArSd7.cjs`);exports.MThemeProvider=e.t,exports.useMTheme=e.n;
3
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./theme-DLorpkJc.cjs`);exports.MThemeProvider=e.t,exports.useMTheme=e.n;
package/dist/theme.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './theme.entry'
1
+ export * from './theme/index'
2
2
  export {}
package/dist/theme.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import {ensureStyles} from './style-runtime.js'
2
2
  ensureStyles()
3
- import { n as e, t } from "./MThemeProvider-DUuTvWdm.js";
3
+ import { n as e, t } from "./theme-BV4qkzZU.js";
4
4
  export { t as MThemeProvider, e as useMTheme };
@@ -1,5 +1,5 @@
1
- import { t as e } from "./cn-DZLxql0l.js";
2
- import { n as t } from "./MText-lZjEtV_i.js";
1
+ import { t as e } from "./cn-YER3QsV1.js";
2
+ import { n as t } from "./MText-DX9O7gh7.js";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/typography/MCode/MCode.tsx
5
5
  function r({ color: r, className: i, children: a, ...o }) {
@@ -37,4 +37,4 @@ function o({ size: t = "md", className: r, children: i, ...a }) {
37
37
  //#endregion
38
38
  export { r as i, i as n, a as r, o as t };
39
39
 
40
- //# sourceMappingURL=typography-DZx1M8Wc.js.map
40
+ //# sourceMappingURL=typography-DKdr1Tds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typography-DZx1M8Wc.js","names":[],"sources":["../src/components/typography/MCode/MCode.tsx","../src/components/typography/MList/MList.tsx","../src/components/typography/MKbd/MKbd.tsx"],"sourcesContent":["import type {MCodeProps} from './MCode.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MCode.css'\n\n// Render inline code tokens with semantic color support.\nexport function MCode({color, className, children, ...rest}: MCodeProps) {\n return (\n <code className={cn('code', ...getAppearanceClassNames({color}), className)} {...rest}>\n {children}\n </code>\n )\n}\n","import type {HTMLAttributes} from 'react'\nimport type {MListProps} from './MList.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MList.css'\n\n// Render ordered or unordered lists with shared typography tokens.\nexport function MList({ordered = false, color, className, children, ...rest}: MListProps) {\n const Component = ordered ? 'ol' : 'ul'\n\n return (\n <Component\n className={cn('list', ordered && 'ordered', ...getAppearanceClassNames({color}), className)}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\n// Render a list item that inherits the parent list styling.\nexport function MListItem({className, children, ...rest}: HTMLAttributes<HTMLLIElement>) {\n return (\n <li className={cn('item', className)} {...rest}>\n {children}\n </li>\n )\n}\n","import type {MKbdProps} from './MKbd.types'\nimport {cn} from '../../../utils/cn'\nimport './MKbd.css'\n\nexport function MKbd({size = 'md', className, children, ...rest}: MKbdProps) {\n return (\n <kbd className={cn('kbd', size, className)} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"mappings":";;;;AAMA,SAAgB,EAAM,EAAC,UAAO,cAAW,aAAU,GAAG,KAAmB;AACrE,QACI,kBAAC,QAAD;EAAM,WAAW,EAAG,QAAQ,GAAG,EAAwB,EAAC,UAAM,CAAC,EAAE,EAAU;EAAE,GAAI;EAC5E;EACE,CAAA;;;;ACHf,SAAgB,EAAM,EAAC,aAAU,IAAO,UAAO,cAAW,aAAU,GAAG,KAAmB;AAGtF,QACI,kBAHc,IAAU,OAAO,MAG/B;EACI,WAAW,EAAG,QAAQ,KAAW,WAAW,GAAG,EAAwB,EAAC,UAAM,CAAC,EAAE,EAAU;EAC3F,GAAI;EAEH;EACO,CAAA;;AAKpB,SAAgB,EAAU,EAAC,cAAW,aAAU,GAAG,KAAsC;AACrF,QACI,kBAAC,MAAD;EAAI,WAAW,EAAG,QAAQ,EAAU;EAAE,GAAI;EACrC;EACA,CAAA;;;;ACrBb,SAAgB,EAAK,EAAC,UAAO,MAAM,cAAW,aAAU,GAAG,KAAkB;AACzE,QACI,kBAAC,OAAD;EAAK,WAAW,EAAG,OAAO,GAAM,EAAU;EAAE,GAAI;EAC3C;EACC,CAAA"}
1
+ {"version":3,"file":"typography-DKdr1Tds.js","names":[],"sources":["../src/components/typography/MCode/MCode.tsx","../src/components/typography/MList/MList.tsx","../src/components/typography/MKbd/MKbd.tsx"],"sourcesContent":["import type {MCodeProps} from './MCode.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MCode.css'\n\n// Render inline code tokens with semantic color support.\nexport function MCode({color, className, children, ...rest}: MCodeProps) {\n return (\n <code className={cn('code', ...getAppearanceClassNames({color}), className)} {...rest}>\n {children}\n </code>\n )\n}\n","import type {HTMLAttributes} from 'react'\nimport type {MListProps} from './MList.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MList.css'\n\n// Render ordered or unordered lists with shared typography tokens.\nexport function MList({ordered = false, color, className, children, ...rest}: MListProps) {\n const Component = ordered ? 'ol' : 'ul'\n\n return (\n <Component\n className={cn('list', ordered && 'ordered', ...getAppearanceClassNames({color}), className)}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\n// Render a list item that inherits the parent list styling.\nexport function MListItem({className, children, ...rest}: HTMLAttributes<HTMLLIElement>) {\n return (\n <li className={cn('item', className)} {...rest}>\n {children}\n </li>\n )\n}\n","import type {MKbdProps} from './MKbd.types'\nimport {cn} from '../../../utils/cn'\nimport './MKbd.css'\n\nexport function MKbd({size = 'md', className, children, ...rest}: MKbdProps) {\n return (\n <kbd className={cn('kbd', size, className)} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"mappings":";;;;AAMA,SAAgB,EAAM,EAAC,UAAO,cAAW,aAAU,GAAG,KAAmB;AACrE,QACI,kBAAC,QAAD;EAAM,WAAW,EAAG,QAAQ,GAAG,EAAwB,EAAC,UAAM,CAAC,EAAE,EAAU;EAAE,GAAI;EAC5E;EACE,CAAA;;;;ACHf,SAAgB,EAAM,EAAC,aAAU,IAAO,UAAO,cAAW,aAAU,GAAG,KAAmB;AAGtF,QACI,kBAHc,IAAU,OAAO,MAG/B;EACI,WAAW,EAAG,QAAQ,KAAW,WAAW,GAAG,EAAwB,EAAC,UAAM,CAAC,EAAE,EAAU;EAC3F,GAAI;EAEH;EACO,CAAA;;AAKpB,SAAgB,EAAU,EAAC,cAAW,aAAU,GAAG,KAAsC;AACrF,QACI,kBAAC,MAAD;EAAI,WAAW,EAAG,QAAQ,EAAU;EAAE,GAAI;EACrC;EACA,CAAA;;;;ACrBb,SAAgB,EAAK,EAAC,UAAO,MAAM,cAAW,aAAU,GAAG,KAAkB;AACzE,QACI,kBAAC,OAAD;EAAK,WAAW,EAAG,OAAO,GAAM,EAAU;EAAE,GAAI;EAC3C;EACC,CAAA"}
@@ -1,2 +1,2 @@
1
- const e=require(`./cn-SOcVdnX6.cjs`),t=require(`./MText-DEKnLtLk.cjs`);let n=require(`react/jsx-runtime`);function r({color:r,className:i,children:a,...o}){return(0,n.jsx)(`code`,{className:e.t(`code`,...t.n({color:r}),i),...o,children:a})}function i({ordered:r=!1,color:i,className:a,children:o,...s}){return(0,n.jsx)(r?`ol`:`ul`,{className:e.t(`list`,r&&`ordered`,...t.n({color:i}),a),...s,children:o})}function a({className:t,children:r,...i}){return(0,n.jsx)(`li`,{className:e.t(`item`,t),...i,children:r})}function o({size:t=`md`,className:r,children:i,...a}){return(0,n.jsx)(`kbd`,{className:e.t(`kbd`,t,r),...a,children:i})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
2
- //# sourceMappingURL=typography-B9-sCjsR.cjs.map
1
+ const e=require(`./cn-CU5TNITO.cjs`),t=require(`./MText-CxSZ2md0.cjs`);let n=require(`react/jsx-runtime`);function r({color:r,className:i,children:a,...o}){return(0,n.jsx)(`code`,{className:e.t(`code`,...t.n({color:r}),i),...o,children:a})}function i({ordered:r=!1,color:i,className:a,children:o,...s}){return(0,n.jsx)(r?`ol`:`ul`,{className:e.t(`list`,r&&`ordered`,...t.n({color:i}),a),...s,children:o})}function a({className:t,children:r,...i}){return(0,n.jsx)(`li`,{className:e.t(`item`,t),...i,children:r})}function o({size:t=`md`,className:r,children:i,...a}){return(0,n.jsx)(`kbd`,{className:e.t(`kbd`,t,r),...a,children:i})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
2
+ //# sourceMappingURL=typography-qbFGv1gA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"typography-B9-sCjsR.cjs","names":[],"sources":["../src/components/typography/MCode/MCode.tsx","../src/components/typography/MList/MList.tsx","../src/components/typography/MKbd/MKbd.tsx"],"sourcesContent":["import type {MCodeProps} from './MCode.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MCode.css'\n\n// Render inline code tokens with semantic color support.\nexport function MCode({color, className, children, ...rest}: MCodeProps) {\n return (\n <code className={cn('code', ...getAppearanceClassNames({color}), className)} {...rest}>\n {children}\n </code>\n )\n}\n","import type {HTMLAttributes} from 'react'\nimport type {MListProps} from './MList.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MList.css'\n\n// Render ordered or unordered lists with shared typography tokens.\nexport function MList({ordered = false, color, className, children, ...rest}: MListProps) {\n const Component = ordered ? 'ol' : 'ul'\n\n return (\n <Component\n className={cn('list', ordered && 'ordered', ...getAppearanceClassNames({color}), className)}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\n// Render a list item that inherits the parent list styling.\nexport function MListItem({className, children, ...rest}: HTMLAttributes<HTMLLIElement>) {\n return (\n <li className={cn('item', className)} {...rest}>\n {children}\n </li>\n )\n}\n","import type {MKbdProps} from './MKbd.types'\nimport {cn} from '../../../utils/cn'\nimport './MKbd.css'\n\nexport function MKbd({size = 'md', className, children, ...rest}: MKbdProps) {\n return (\n <kbd className={cn('kbd', size, className)} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"mappings":"0GAMA,SAAgB,EAAM,CAAC,QAAO,YAAW,WAAU,GAAG,GAAmB,CACrE,OACI,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,EAAG,OAAQ,GAAG,EAAA,EAAwB,CAAC,QAAM,CAAC,CAAE,EAAU,CAAE,GAAI,EAC5E,WACE,CAAA,CCHf,SAAgB,EAAM,CAAC,UAAU,GAAO,QAAO,YAAW,WAAU,GAAG,GAAmB,CAGtF,OACI,EAAA,EAAA,KAHc,EAAU,KAAO,KAG/B,CACI,UAAW,EAAA,EAAG,OAAQ,GAAW,UAAW,GAAG,EAAA,EAAwB,CAAC,QAAM,CAAC,CAAE,EAAU,CAC3F,GAAI,EAEH,WACO,CAAA,CAKpB,SAAgB,EAAU,CAAC,YAAW,WAAU,GAAG,GAAsC,CACrF,OACI,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAA,EAAG,OAAQ,EAAU,CAAE,GAAI,EACrC,WACA,CAAA,CCrBb,SAAgB,EAAK,CAAC,OAAO,KAAM,YAAW,WAAU,GAAG,GAAkB,CACzE,OACI,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,EAAG,MAAO,EAAM,EAAU,CAAE,GAAI,EAC3C,WACC,CAAA"}
1
+ {"version":3,"file":"typography-qbFGv1gA.cjs","names":[],"sources":["../src/components/typography/MCode/MCode.tsx","../src/components/typography/MList/MList.tsx","../src/components/typography/MKbd/MKbd.tsx"],"sourcesContent":["import type {MCodeProps} from './MCode.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MCode.css'\n\n// Render inline code tokens with semantic color support.\nexport function MCode({color, className, children, ...rest}: MCodeProps) {\n return (\n <code className={cn('code', ...getAppearanceClassNames({color}), className)} {...rest}>\n {children}\n </code>\n )\n}\n","import type {HTMLAttributes} from 'react'\nimport type {MListProps} from './MList.types'\nimport {cn} from '../../../utils/cn'\nimport {getAppearanceClassNames} from '../../../utils/appearanceProps'\nimport './MList.css'\n\n// Render ordered or unordered lists with shared typography tokens.\nexport function MList({ordered = false, color, className, children, ...rest}: MListProps) {\n const Component = ordered ? 'ol' : 'ul'\n\n return (\n <Component\n className={cn('list', ordered && 'ordered', ...getAppearanceClassNames({color}), className)}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\n// Render a list item that inherits the parent list styling.\nexport function MListItem({className, children, ...rest}: HTMLAttributes<HTMLLIElement>) {\n return (\n <li className={cn('item', className)} {...rest}>\n {children}\n </li>\n )\n}\n","import type {MKbdProps} from './MKbd.types'\nimport {cn} from '../../../utils/cn'\nimport './MKbd.css'\n\nexport function MKbd({size = 'md', className, children, ...rest}: MKbdProps) {\n return (\n <kbd className={cn('kbd', size, className)} {...rest}>\n {children}\n </kbd>\n )\n}\n"],"mappings":"0GAMA,SAAgB,EAAM,CAAC,QAAO,YAAW,WAAU,GAAG,GAAmB,CACrE,OACI,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,EAAA,EAAG,OAAQ,GAAG,EAAA,EAAwB,CAAC,QAAM,CAAC,CAAE,EAAU,CAAE,GAAI,EAC5E,WACE,CAAA,CCHf,SAAgB,EAAM,CAAC,UAAU,GAAO,QAAO,YAAW,WAAU,GAAG,GAAmB,CAGtF,OACI,EAAA,EAAA,KAHc,EAAU,KAAO,KAG/B,CACI,UAAW,EAAA,EAAG,OAAQ,GAAW,UAAW,GAAG,EAAA,EAAwB,CAAC,QAAM,CAAC,CAAE,EAAU,CAC3F,GAAI,EAEH,WACO,CAAA,CAKpB,SAAgB,EAAU,CAAC,YAAW,WAAU,GAAG,GAAsC,CACrF,OACI,EAAA,EAAA,KAAC,KAAD,CAAI,UAAW,EAAA,EAAG,OAAQ,EAAU,CAAE,GAAI,EACrC,WACA,CAAA,CCrBb,SAAgB,EAAK,CAAC,OAAO,KAAM,YAAW,WAAU,GAAG,GAAkB,CACzE,OACI,EAAA,EAAA,KAAC,MAAD,CAAK,UAAW,EAAA,EAAG,MAAO,EAAM,EAAU,CAAE,GAAI,EAC3C,WACC,CAAA"}
@@ -1,3 +1,3 @@
1
1
  const {ensureStyles}=require('./style-runtime.cjs')
2
2
  ensureStyles()
3
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./MText-DEKnLtLk.cjs`),t=require(`./MHeading-7-5TESyc.cjs`),n=require(`./MLink-B4JrRZ29.cjs`),r=require(`./typography-B9-sCjsR.cjs`),i=require(`./MSubText-Dr0rAnX7.cjs`);exports.MCode=r.i,exports.MHeading=t.t,exports.MKbd=r.t,exports.MLink=n.t,exports.MList=r.n,exports.MListItem=r.r,exports.MSubText=i.t,exports.MText=e.t;
3
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./MText-CxSZ2md0.cjs`),t=require(`./MHeading-DqvWKia1.cjs`),n=require(`./MLink-DHryXq_D.cjs`),r=require(`./typography-qbFGv1gA.cjs`),i=require(`./MSubText-78oYdJQy.cjs`);exports.MCode=r.i,exports.MHeading=t.t,exports.MKbd=r.t,exports.MLink=n.t,exports.MList=r.n,exports.MListItem=r.r,exports.MSubText=i.t,exports.MText=e.t;
@@ -1,8 +1,8 @@
1
1
  import {ensureStyles} from './style-runtime.js'
2
2
  ensureStyles()
3
- import { t as e } from "./MText-lZjEtV_i.js";
4
- import { t } from "./MHeading-BlDlbYcY.js";
5
- import { t as n } from "./MLink-_WcD95E0.js";
6
- import { i as r, n as i, r as a, t as o } from "./typography-DZx1M8Wc.js";
7
- import { t as s } from "./MSubText-BxDWVjjs.js";
3
+ import { t as e } from "./MText-DX9O7gh7.js";
4
+ import { t } from "./MHeading-C3IgV22T.js";
5
+ import { t as n } from "./MLink-ODytrwne.js";
6
+ import { i as r, n as i, r as a, t as o } from "./typography-DKdr1Tds.js";
7
+ import { t as s } from "./MSubText-C2oxXwKT.js";
8
8
  export { r as MCode, t as MHeading, o as MKbd, n as MLink, i as MList, a as MListItem, s as MSubText, e as MText };
@@ -65,4 +65,4 @@ function l({ options: t, value: r, minChars: a = 2, getLabel: o = s, filter: l }
65
65
  //#endregion
66
66
  export { a as n, o as r, l as t };
67
67
 
68
- //# sourceMappingURL=useGhostText-Zq3iktss.js.map
68
+ //# sourceMappingURL=useGhostText-DG0bzcao.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGhostText-Zq3iktss.js","names":[],"sources":["../src/utils/useDebounce.ts","../src/utils/useGhostText.ts"],"sourcesContent":["import {useState, useEffect, useRef, useCallback} from 'react'\n\n// Expose a value only after it stays stable for the given delay.\nexport function useDebounce<T>(value: T, delay: number): T {\n const [debounced, setDebounced] = useState(value)\n\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), delay)\n return () => clearTimeout(timer)\n }, [value, delay])\n\n return debounced\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n// Wrap a callback so repeated calls collapse into the latest invocation.\nexport function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, delay: number): T {\n const callbackRef = useRef(callback)\n callbackRef.current = callback\n const timerRef = useRef<ReturnType<typeof setTimeout>>(null)\n\n return useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((...args: any[]) => {\n if (timerRef.current) clearTimeout(timerRef.current)\n timerRef.current = setTimeout(() => callbackRef.current(...args), delay)\n }) as T,\n [delay]\n )\n}\n","import {useState, useCallback, useMemo} from 'react'\nimport type * as React from 'react'\n\nexport interface GhostTextOptions<T = string> {\n options: T[]\n value: string\n minChars?: number\n getLabel?: (option: T) => string\n filter?: (options: T[], input: string) => T[]\n}\n\nexport interface GhostTextReturn<T = string> {\n /** The ghost suffix to render after the typed text. */\n hint: string\n /** Accept the current hint and return the full value. */\n accept: () => {value: string; option: T | null}\n /** Cycle to the next matching option. */\n next: () => void\n /** Cycle to the previous matching option. */\n prev: () => void\n /** Reset the hint index (call on value change). */\n reset: () => void\n /** Number of matching options. */\n matchCount: number\n /** Handle keyboard events — Tab/Enter accept, arrows cycle, Escape resets. */\n onKeyDown: (e: React.KeyboardEvent) => boolean\n}\n\nfunction defaultGetLabel<T>(option: T): string {\n return typeof option === 'string' ? option : String(option)\n}\n\nfunction defaultFilter<T>(options: T[], input: string, getLabel: (o: T) => string): T[] {\n if (!input) return []\n const lower = input.toLowerCase()\n return options.filter((o) => getLabel(o).toLowerCase().startsWith(lower))\n}\n\n// Manage inline ghost-text suggestions for any text input.\nexport function useGhostText<T = string>({\n options,\n value,\n minChars = 2,\n getLabel = defaultGetLabel,\n filter,\n}: GhostTextOptions<T>): GhostTextReturn<T> {\n const [hintIndex, setHintIndex] = useState(0)\n\n const filtered = useMemo(() => {\n if (value.length < minChars) return []\n if (filter) return filter(options, value)\n return defaultFilter(options, value, getLabel)\n }, [options, value, minChars, filter, getLabel])\n\n const current = filtered.length > 0 ? filtered[hintIndex % filtered.length] : null\n const fullLabel = current ? getLabel(current) : ''\n const hint =\n fullLabel && fullLabel.toLowerCase().startsWith(value.toLowerCase()) ? fullLabel.slice(value.length) : ''\n\n const accept = useCallback(() => {\n if (!hint || !current) return {value, option: null}\n return {value: value + hint, option: current}\n }, [hint, current, value])\n\n const next = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i + 1) % filtered.length)\n }, [filtered.length])\n\n const prev = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i - 1 + filtered.length) % filtered.length)\n }, [filtered.length])\n\n const reset = useCallback(() => setHintIndex(0), [])\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent): boolean => {\n if ((e.key === 'Tab' || e.key === 'Enter') && hint) {\n e.preventDefault()\n return true // signal: caller should accept\n }\n if (e.key === 'ArrowDown' && filtered.length > 1) {\n e.preventDefault()\n next()\n return false\n }\n if (e.key === 'ArrowUp' && filtered.length > 1) {\n e.preventDefault()\n prev()\n return false\n }\n return false\n },\n [hint, filtered.length, next, prev]\n )\n\n return {hint, accept, next, prev, reset, matchCount: filtered.length, onKeyDown}\n}\n"],"mappings":";;AAGA,SAAgB,EAAe,GAAU,GAAkB;CACvD,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAM;AAOjD,QALA,QAAgB;EACZ,IAAM,IAAQ,iBAAiB,EAAa,EAAM,EAAE,EAAM;AAC1D,eAAa,aAAa,EAAM;IACjC,CAAC,GAAO,EAAM,CAAC,EAEX;;AAKX,SAAgB,EAAyD,GAAa,GAAkB;CACpG,IAAM,IAAc,EAAO,EAAS;AACpC,GAAY,UAAU;CACtB,IAAM,IAAW,EAAsC,KAAK;AAE5D,QAAO,IAED,GAAG,MAAgB;AAEjB,EADI,EAAS,WAAS,aAAa,EAAS,QAAQ,EACpD,EAAS,UAAU,iBAAiB,EAAY,QAAQ,GAAG,EAAK,EAAE,EAAM;KAE5E,CAAC,EAAM,CACV;;;;ACAL,SAAS,EAAmB,GAAmB;AAC3C,QAAO,OAAO,KAAW,WAAW,IAAS,OAAO,EAAO;;AAG/D,SAAS,EAAiB,GAAc,GAAe,GAAiC;AACpF,KAAI,CAAC,EAAO,QAAO,EAAE;CACrB,IAAM,IAAQ,EAAM,aAAa;AACjC,QAAO,EAAQ,QAAQ,MAAM,EAAS,EAAE,CAAC,aAAa,CAAC,WAAW,EAAM,CAAC;;AAI7E,SAAgB,EAAyB,EACrC,YACA,UACA,cAAW,GACX,cAAW,GACX,aACwC;CACxC,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAE,EAEvC,IAAW,QACT,EAAM,SAAS,IAAiB,EAAE,GAClC,IAAe,EAAO,GAAS,EAAM,GAClC,EAAc,GAAS,GAAO,EAAS,EAC/C;EAAC;EAAS;EAAO;EAAU;EAAQ;EAAS,CAAC,EAE1C,IAAU,EAAS,SAAS,IAAI,EAAS,IAAY,EAAS,UAAU,MACxE,IAAY,IAAU,EAAS,EAAQ,GAAG,IAC1C,IACF,KAAa,EAAU,aAAa,CAAC,WAAW,EAAM,aAAa,CAAC,GAAG,EAAU,MAAM,EAAM,OAAO,GAAG,IAErG,IAAS,QACP,CAAC,KAAQ,CAAC,IAAgB;EAAC;EAAO,QAAQ;EAAK,GAC5C;EAAC,OAAO,IAAQ;EAAM,QAAQ;EAAQ,EAC9C;EAAC;EAAM;EAAS;EAAM,CAAC,EAEpB,IAAO,QAAkB;AAC3B,EAAI,EAAS,SAAS,KAAG,GAAc,OAAO,IAAI,KAAK,EAAS,OAAO;IACxE,CAAC,EAAS,OAAO,CAAC,EAEf,IAAO,QAAkB;AAC3B,EAAI,EAAS,SAAS,KAAG,GAAc,OAAO,IAAI,IAAI,EAAS,UAAU,EAAS,OAAO;IAC1F,CAAC,EAAS,OAAO,CAAC,EAEf,IAAQ,QAAkB,EAAa,EAAE,EAAE,EAAE,CAAC,EAE9C,IAAY,GACb,OACQ,EAAE,QAAQ,SAAS,EAAE,QAAQ,YAAY,KAC1C,EAAE,gBAAgB,EACX,MAEP,EAAE,QAAQ,eAAe,EAAS,SAAS,KAC3C,EAAE,gBAAgB,EAClB,GAAM,EACC,MAEP,EAAE,QAAQ,aAAa,EAAS,SAAS,KACzC,EAAE,gBAAgB,EAClB,GAAM,EACC,MAEJ,IAEX;EAAC;EAAM,EAAS;EAAQ;EAAM;EAAK,CACtC;AAED,QAAO;EAAC;EAAM;EAAQ;EAAM;EAAM;EAAO,YAAY,EAAS;EAAQ;EAAU"}
1
+ {"version":3,"file":"useGhostText-DG0bzcao.js","names":[],"sources":["../src/utils/useDebounce.ts","../src/utils/useGhostText.ts"],"sourcesContent":["import {useState, useEffect, useRef, useCallback} from 'react'\n\n// Expose a value only after it stays stable for the given delay.\nexport function useDebounce<T>(value: T, delay: number): T {\n const [debounced, setDebounced] = useState(value)\n\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), delay)\n return () => clearTimeout(timer)\n }, [value, delay])\n\n return debounced\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n// Wrap a callback so repeated calls collapse into the latest invocation.\nexport function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, delay: number): T {\n const callbackRef = useRef(callback)\n callbackRef.current = callback\n const timerRef = useRef<ReturnType<typeof setTimeout>>(null)\n\n return useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((...args: any[]) => {\n if (timerRef.current) clearTimeout(timerRef.current)\n timerRef.current = setTimeout(() => callbackRef.current(...args), delay)\n }) as T,\n [delay]\n )\n}\n","import {useState, useCallback, useMemo} from 'react'\nimport type * as React from 'react'\n\nexport interface GhostTextOptions<T = string> {\n options: T[]\n value: string\n minChars?: number\n getLabel?: (option: T) => string\n filter?: (options: T[], input: string) => T[]\n}\n\nexport interface GhostTextReturn<T = string> {\n /** The ghost suffix to render after the typed text. */\n hint: string\n /** Accept the current hint and return the full value. */\n accept: () => {value: string; option: T | null}\n /** Cycle to the next matching option. */\n next: () => void\n /** Cycle to the previous matching option. */\n prev: () => void\n /** Reset the hint index (call on value change). */\n reset: () => void\n /** Number of matching options. */\n matchCount: number\n /** Handle keyboard events — Tab/Enter accept, arrows cycle, Escape resets. */\n onKeyDown: (e: React.KeyboardEvent) => boolean\n}\n\nfunction defaultGetLabel<T>(option: T): string {\n return typeof option === 'string' ? option : String(option)\n}\n\nfunction defaultFilter<T>(options: T[], input: string, getLabel: (o: T) => string): T[] {\n if (!input) return []\n const lower = input.toLowerCase()\n return options.filter((o) => getLabel(o).toLowerCase().startsWith(lower))\n}\n\n// Manage inline ghost-text suggestions for any text input.\nexport function useGhostText<T = string>({\n options,\n value,\n minChars = 2,\n getLabel = defaultGetLabel,\n filter,\n}: GhostTextOptions<T>): GhostTextReturn<T> {\n const [hintIndex, setHintIndex] = useState(0)\n\n const filtered = useMemo(() => {\n if (value.length < minChars) return []\n if (filter) return filter(options, value)\n return defaultFilter(options, value, getLabel)\n }, [options, value, minChars, filter, getLabel])\n\n const current = filtered.length > 0 ? filtered[hintIndex % filtered.length] : null\n const fullLabel = current ? getLabel(current) : ''\n const hint =\n fullLabel && fullLabel.toLowerCase().startsWith(value.toLowerCase()) ? fullLabel.slice(value.length) : ''\n\n const accept = useCallback(() => {\n if (!hint || !current) return {value, option: null}\n return {value: value + hint, option: current}\n }, [hint, current, value])\n\n const next = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i + 1) % filtered.length)\n }, [filtered.length])\n\n const prev = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i - 1 + filtered.length) % filtered.length)\n }, [filtered.length])\n\n const reset = useCallback(() => setHintIndex(0), [])\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent): boolean => {\n if ((e.key === 'Tab' || e.key === 'Enter') && hint) {\n e.preventDefault()\n return true // signal: caller should accept\n }\n if (e.key === 'ArrowDown' && filtered.length > 1) {\n e.preventDefault()\n next()\n return false\n }\n if (e.key === 'ArrowUp' && filtered.length > 1) {\n e.preventDefault()\n prev()\n return false\n }\n return false\n },\n [hint, filtered.length, next, prev]\n )\n\n return {hint, accept, next, prev, reset, matchCount: filtered.length, onKeyDown}\n}\n"],"mappings":";;AAGA,SAAgB,EAAe,GAAU,GAAkB;CACvD,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAM;AAOjD,QALA,QAAgB;EACZ,IAAM,IAAQ,iBAAiB,EAAa,EAAM,EAAE,EAAM;AAC1D,eAAa,aAAa,EAAM;IACjC,CAAC,GAAO,EAAM,CAAC,EAEX;;AAKX,SAAgB,EAAyD,GAAa,GAAkB;CACpG,IAAM,IAAc,EAAO,EAAS;AACpC,GAAY,UAAU;CACtB,IAAM,IAAW,EAAsC,KAAK;AAE5D,QAAO,IAED,GAAG,MAAgB;AAEjB,EADI,EAAS,WAAS,aAAa,EAAS,QAAQ,EACpD,EAAS,UAAU,iBAAiB,EAAY,QAAQ,GAAG,EAAK,EAAE,EAAM;KAE5E,CAAC,EAAM,CACV;;;;ACAL,SAAS,EAAmB,GAAmB;AAC3C,QAAO,OAAO,KAAW,WAAW,IAAS,OAAO,EAAO;;AAG/D,SAAS,EAAiB,GAAc,GAAe,GAAiC;AACpF,KAAI,CAAC,EAAO,QAAO,EAAE;CACrB,IAAM,IAAQ,EAAM,aAAa;AACjC,QAAO,EAAQ,QAAQ,MAAM,EAAS,EAAE,CAAC,aAAa,CAAC,WAAW,EAAM,CAAC;;AAI7E,SAAgB,EAAyB,EACrC,YACA,UACA,cAAW,GACX,cAAW,GACX,aACwC;CACxC,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAE,EAEvC,IAAW,QACT,EAAM,SAAS,IAAiB,EAAE,GAClC,IAAe,EAAO,GAAS,EAAM,GAClC,EAAc,GAAS,GAAO,EAAS,EAC/C;EAAC;EAAS;EAAO;EAAU;EAAQ;EAAS,CAAC,EAE1C,IAAU,EAAS,SAAS,IAAI,EAAS,IAAY,EAAS,UAAU,MACxE,IAAY,IAAU,EAAS,EAAQ,GAAG,IAC1C,IACF,KAAa,EAAU,aAAa,CAAC,WAAW,EAAM,aAAa,CAAC,GAAG,EAAU,MAAM,EAAM,OAAO,GAAG,IAErG,IAAS,QACP,CAAC,KAAQ,CAAC,IAAgB;EAAC;EAAO,QAAQ;EAAK,GAC5C;EAAC,OAAO,IAAQ;EAAM,QAAQ;EAAQ,EAC9C;EAAC;EAAM;EAAS;EAAM,CAAC,EAEpB,IAAO,QAAkB;AAC3B,EAAI,EAAS,SAAS,KAAG,GAAc,OAAO,IAAI,KAAK,EAAS,OAAO;IACxE,CAAC,EAAS,OAAO,CAAC,EAEf,IAAO,QAAkB;AAC3B,EAAI,EAAS,SAAS,KAAG,GAAc,OAAO,IAAI,IAAI,EAAS,UAAU,EAAS,OAAO;IAC1F,CAAC,EAAS,OAAO,CAAC,EAEf,IAAQ,QAAkB,EAAa,EAAE,EAAE,EAAE,CAAC,EAE9C,IAAY,GACb,OACQ,EAAE,QAAQ,SAAS,EAAE,QAAQ,YAAY,KAC1C,EAAE,gBAAgB,EACX,MAEP,EAAE,QAAQ,eAAe,EAAS,SAAS,KAC3C,EAAE,gBAAgB,EAClB,GAAM,EACC,MAEP,EAAE,QAAQ,aAAa,EAAS,SAAS,KACzC,EAAE,gBAAgB,EAClB,GAAM,EACC,MAEJ,IAEX;EAAC;EAAM,EAAS;EAAQ;EAAM;EAAK,CACtC;AAED,QAAO;EAAC;EAAM;EAAQ;EAAM;EAAM;EAAO,YAAY,EAAS;EAAQ;EAAU"}
@@ -1,2 +1,2 @@
1
1
  let e=require(`react`);function t(t,n){let[r,i]=(0,e.useState)(t);return(0,e.useEffect)(()=>{let e=setTimeout(()=>i(t),n);return()=>clearTimeout(e)},[t,n]),r}function n(t,n){let r=(0,e.useRef)(t);r.current=t;let i=(0,e.useRef)(null);return(0,e.useCallback)(((...e)=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>r.current(...e),n)}),[n])}function r(e){return typeof e==`string`?e:String(e)}function i(e,t,n){if(!t)return[];let r=t.toLowerCase();return e.filter(e=>n(e).toLowerCase().startsWith(r))}function a({options:t,value:n,minChars:a=2,getLabel:o=r,filter:s}){let[c,l]=(0,e.useState)(0),u=(0,e.useMemo)(()=>n.length<a?[]:s?s(t,n):i(t,n,o),[t,n,a,s,o]),d=u.length>0?u[c%u.length]:null,f=d?o(d):``,p=f&&f.toLowerCase().startsWith(n.toLowerCase())?f.slice(n.length):``,m=(0,e.useCallback)(()=>!p||!d?{value:n,option:null}:{value:n+p,option:d},[p,d,n]),h=(0,e.useCallback)(()=>{u.length>1&&l(e=>(e+1)%u.length)},[u.length]),g=(0,e.useCallback)(()=>{u.length>1&&l(e=>(e-1+u.length)%u.length)},[u.length]),_=(0,e.useCallback)(()=>l(0),[]),v=(0,e.useCallback)(e=>(e.key===`Tab`||e.key===`Enter`)&&p?(e.preventDefault(),!0):e.key===`ArrowDown`&&u.length>1?(e.preventDefault(),h(),!1):e.key===`ArrowUp`&&u.length>1?(e.preventDefault(),g(),!1):!1,[p,u.length,h,g]);return{hint:p,accept:m,next:h,prev:g,reset:_,matchCount:u.length,onKeyDown:v}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
2
- //# sourceMappingURL=useGhostText-CL1kSB_V.cjs.map
2
+ //# sourceMappingURL=useGhostText-QMdO_HK6.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGhostText-CL1kSB_V.cjs","names":[],"sources":["../src/utils/useDebounce.ts","../src/utils/useGhostText.ts"],"sourcesContent":["import {useState, useEffect, useRef, useCallback} from 'react'\n\n// Expose a value only after it stays stable for the given delay.\nexport function useDebounce<T>(value: T, delay: number): T {\n const [debounced, setDebounced] = useState(value)\n\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), delay)\n return () => clearTimeout(timer)\n }, [value, delay])\n\n return debounced\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n// Wrap a callback so repeated calls collapse into the latest invocation.\nexport function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, delay: number): T {\n const callbackRef = useRef(callback)\n callbackRef.current = callback\n const timerRef = useRef<ReturnType<typeof setTimeout>>(null)\n\n return useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((...args: any[]) => {\n if (timerRef.current) clearTimeout(timerRef.current)\n timerRef.current = setTimeout(() => callbackRef.current(...args), delay)\n }) as T,\n [delay]\n )\n}\n","import {useState, useCallback, useMemo} from 'react'\nimport type * as React from 'react'\n\nexport interface GhostTextOptions<T = string> {\n options: T[]\n value: string\n minChars?: number\n getLabel?: (option: T) => string\n filter?: (options: T[], input: string) => T[]\n}\n\nexport interface GhostTextReturn<T = string> {\n /** The ghost suffix to render after the typed text. */\n hint: string\n /** Accept the current hint and return the full value. */\n accept: () => {value: string; option: T | null}\n /** Cycle to the next matching option. */\n next: () => void\n /** Cycle to the previous matching option. */\n prev: () => void\n /** Reset the hint index (call on value change). */\n reset: () => void\n /** Number of matching options. */\n matchCount: number\n /** Handle keyboard events — Tab/Enter accept, arrows cycle, Escape resets. */\n onKeyDown: (e: React.KeyboardEvent) => boolean\n}\n\nfunction defaultGetLabel<T>(option: T): string {\n return typeof option === 'string' ? option : String(option)\n}\n\nfunction defaultFilter<T>(options: T[], input: string, getLabel: (o: T) => string): T[] {\n if (!input) return []\n const lower = input.toLowerCase()\n return options.filter((o) => getLabel(o).toLowerCase().startsWith(lower))\n}\n\n// Manage inline ghost-text suggestions for any text input.\nexport function useGhostText<T = string>({\n options,\n value,\n minChars = 2,\n getLabel = defaultGetLabel,\n filter,\n}: GhostTextOptions<T>): GhostTextReturn<T> {\n const [hintIndex, setHintIndex] = useState(0)\n\n const filtered = useMemo(() => {\n if (value.length < minChars) return []\n if (filter) return filter(options, value)\n return defaultFilter(options, value, getLabel)\n }, [options, value, minChars, filter, getLabel])\n\n const current = filtered.length > 0 ? filtered[hintIndex % filtered.length] : null\n const fullLabel = current ? getLabel(current) : ''\n const hint =\n fullLabel && fullLabel.toLowerCase().startsWith(value.toLowerCase()) ? fullLabel.slice(value.length) : ''\n\n const accept = useCallback(() => {\n if (!hint || !current) return {value, option: null}\n return {value: value + hint, option: current}\n }, [hint, current, value])\n\n const next = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i + 1) % filtered.length)\n }, [filtered.length])\n\n const prev = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i - 1 + filtered.length) % filtered.length)\n }, [filtered.length])\n\n const reset = useCallback(() => setHintIndex(0), [])\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent): boolean => {\n if ((e.key === 'Tab' || e.key === 'Enter') && hint) {\n e.preventDefault()\n return true // signal: caller should accept\n }\n if (e.key === 'ArrowDown' && filtered.length > 1) {\n e.preventDefault()\n next()\n return false\n }\n if (e.key === 'ArrowUp' && filtered.length > 1) {\n e.preventDefault()\n prev()\n return false\n }\n return false\n },\n [hint, filtered.length, next, prev]\n )\n\n return {hint, accept, next, prev, reset, matchCount: filtered.length, onKeyDown}\n}\n"],"mappings":"uBAGA,SAAgB,EAAe,EAAU,EAAkB,CACvD,GAAM,CAAC,EAAW,IAAA,EAAA,EAAA,UAAyB,EAAM,CAOjD,OALA,EAAA,EAAA,eAAgB,CACZ,IAAM,EAAQ,eAAiB,EAAa,EAAM,CAAE,EAAM,CAC1D,UAAa,aAAa,EAAM,EACjC,CAAC,EAAO,EAAM,CAAC,CAEX,EAKX,SAAgB,EAAyD,EAAa,EAAkB,CACpG,IAAM,GAAA,EAAA,EAAA,QAAqB,EAAS,CACpC,EAAY,QAAU,EACtB,IAAM,GAAA,EAAA,EAAA,QAAiD,KAAK,CAE5D,OAAA,EAAA,EAAA,eAEM,GAAG,IAAgB,CACb,EAAS,SAAS,aAAa,EAAS,QAAQ,CACpD,EAAS,QAAU,eAAiB,EAAY,QAAQ,GAAG,EAAK,CAAE,EAAM,GAE5E,CAAC,EAAM,CACV,CCAL,SAAS,EAAmB,EAAmB,CAC3C,OAAO,OAAO,GAAW,SAAW,EAAS,OAAO,EAAO,CAG/D,SAAS,EAAiB,EAAc,EAAe,EAAiC,CACpF,GAAI,CAAC,EAAO,MAAO,EAAE,CACrB,IAAM,EAAQ,EAAM,aAAa,CACjC,OAAO,EAAQ,OAAQ,GAAM,EAAS,EAAE,CAAC,aAAa,CAAC,WAAW,EAAM,CAAC,CAI7E,SAAgB,EAAyB,CACrC,UACA,QACA,WAAW,EACX,WAAW,EACX,UACwC,CACxC,GAAM,CAAC,EAAW,IAAA,EAAA,EAAA,UAAyB,EAAE,CAEvC,GAAA,EAAA,EAAA,aACE,EAAM,OAAS,EAAiB,EAAE,CAClC,EAAe,EAAO,EAAS,EAAM,CAClC,EAAc,EAAS,EAAO,EAAS,CAC/C,CAAC,EAAS,EAAO,EAAU,EAAQ,EAAS,CAAC,CAE1C,EAAU,EAAS,OAAS,EAAI,EAAS,EAAY,EAAS,QAAU,KACxE,EAAY,EAAU,EAAS,EAAQ,CAAG,GAC1C,EACF,GAAa,EAAU,aAAa,CAAC,WAAW,EAAM,aAAa,CAAC,CAAG,EAAU,MAAM,EAAM,OAAO,CAAG,GAErG,GAAA,EAAA,EAAA,iBACE,CAAC,GAAQ,CAAC,EAAgB,CAAC,QAAO,OAAQ,KAAK,CAC5C,CAAC,MAAO,EAAQ,EAAM,OAAQ,EAAQ,CAC9C,CAAC,EAAM,EAAS,EAAM,CAAC,CAEpB,GAAA,EAAA,EAAA,iBAAyB,CACvB,EAAS,OAAS,GAAG,EAAc,IAAO,EAAI,GAAK,EAAS,OAAO,EACxE,CAAC,EAAS,OAAO,CAAC,CAEf,GAAA,EAAA,EAAA,iBAAyB,CACvB,EAAS,OAAS,GAAG,EAAc,IAAO,EAAI,EAAI,EAAS,QAAU,EAAS,OAAO,EAC1F,CAAC,EAAS,OAAO,CAAC,CAEf,GAAA,EAAA,EAAA,iBAA0B,EAAa,EAAE,CAAE,EAAE,CAAC,CAE9C,GAAA,EAAA,EAAA,aACD,IACQ,EAAE,MAAQ,OAAS,EAAE,MAAQ,UAAY,GAC1C,EAAE,gBAAgB,CACX,IAEP,EAAE,MAAQ,aAAe,EAAS,OAAS,GAC3C,EAAE,gBAAgB,CAClB,GAAM,CACC,IAEP,EAAE,MAAQ,WAAa,EAAS,OAAS,GACzC,EAAE,gBAAgB,CAClB,GAAM,CACC,IAEJ,GAEX,CAAC,EAAM,EAAS,OAAQ,EAAM,EAAK,CACtC,CAED,MAAO,CAAC,OAAM,SAAQ,OAAM,OAAM,QAAO,WAAY,EAAS,OAAQ,YAAU"}
1
+ {"version":3,"file":"useGhostText-QMdO_HK6.cjs","names":[],"sources":["../src/utils/useDebounce.ts","../src/utils/useGhostText.ts"],"sourcesContent":["import {useState, useEffect, useRef, useCallback} from 'react'\n\n// Expose a value only after it stays stable for the given delay.\nexport function useDebounce<T>(value: T, delay: number): T {\n const [debounced, setDebounced] = useState(value)\n\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), delay)\n return () => clearTimeout(timer)\n }, [value, delay])\n\n return debounced\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n// Wrap a callback so repeated calls collapse into the latest invocation.\nexport function useDebouncedCallback<T extends (...args: any[]) => void>(callback: T, delay: number): T {\n const callbackRef = useRef(callback)\n callbackRef.current = callback\n const timerRef = useRef<ReturnType<typeof setTimeout>>(null)\n\n return useCallback(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ((...args: any[]) => {\n if (timerRef.current) clearTimeout(timerRef.current)\n timerRef.current = setTimeout(() => callbackRef.current(...args), delay)\n }) as T,\n [delay]\n )\n}\n","import {useState, useCallback, useMemo} from 'react'\nimport type * as React from 'react'\n\nexport interface GhostTextOptions<T = string> {\n options: T[]\n value: string\n minChars?: number\n getLabel?: (option: T) => string\n filter?: (options: T[], input: string) => T[]\n}\n\nexport interface GhostTextReturn<T = string> {\n /** The ghost suffix to render after the typed text. */\n hint: string\n /** Accept the current hint and return the full value. */\n accept: () => {value: string; option: T | null}\n /** Cycle to the next matching option. */\n next: () => void\n /** Cycle to the previous matching option. */\n prev: () => void\n /** Reset the hint index (call on value change). */\n reset: () => void\n /** Number of matching options. */\n matchCount: number\n /** Handle keyboard events — Tab/Enter accept, arrows cycle, Escape resets. */\n onKeyDown: (e: React.KeyboardEvent) => boolean\n}\n\nfunction defaultGetLabel<T>(option: T): string {\n return typeof option === 'string' ? option : String(option)\n}\n\nfunction defaultFilter<T>(options: T[], input: string, getLabel: (o: T) => string): T[] {\n if (!input) return []\n const lower = input.toLowerCase()\n return options.filter((o) => getLabel(o).toLowerCase().startsWith(lower))\n}\n\n// Manage inline ghost-text suggestions for any text input.\nexport function useGhostText<T = string>({\n options,\n value,\n minChars = 2,\n getLabel = defaultGetLabel,\n filter,\n}: GhostTextOptions<T>): GhostTextReturn<T> {\n const [hintIndex, setHintIndex] = useState(0)\n\n const filtered = useMemo(() => {\n if (value.length < minChars) return []\n if (filter) return filter(options, value)\n return defaultFilter(options, value, getLabel)\n }, [options, value, minChars, filter, getLabel])\n\n const current = filtered.length > 0 ? filtered[hintIndex % filtered.length] : null\n const fullLabel = current ? getLabel(current) : ''\n const hint =\n fullLabel && fullLabel.toLowerCase().startsWith(value.toLowerCase()) ? fullLabel.slice(value.length) : ''\n\n const accept = useCallback(() => {\n if (!hint || !current) return {value, option: null}\n return {value: value + hint, option: current}\n }, [hint, current, value])\n\n const next = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i + 1) % filtered.length)\n }, [filtered.length])\n\n const prev = useCallback(() => {\n if (filtered.length > 1) setHintIndex((i) => (i - 1 + filtered.length) % filtered.length)\n }, [filtered.length])\n\n const reset = useCallback(() => setHintIndex(0), [])\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent): boolean => {\n if ((e.key === 'Tab' || e.key === 'Enter') && hint) {\n e.preventDefault()\n return true // signal: caller should accept\n }\n if (e.key === 'ArrowDown' && filtered.length > 1) {\n e.preventDefault()\n next()\n return false\n }\n if (e.key === 'ArrowUp' && filtered.length > 1) {\n e.preventDefault()\n prev()\n return false\n }\n return false\n },\n [hint, filtered.length, next, prev]\n )\n\n return {hint, accept, next, prev, reset, matchCount: filtered.length, onKeyDown}\n}\n"],"mappings":"uBAGA,SAAgB,EAAe,EAAU,EAAkB,CACvD,GAAM,CAAC,EAAW,IAAA,EAAA,EAAA,UAAyB,EAAM,CAOjD,OALA,EAAA,EAAA,eAAgB,CACZ,IAAM,EAAQ,eAAiB,EAAa,EAAM,CAAE,EAAM,CAC1D,UAAa,aAAa,EAAM,EACjC,CAAC,EAAO,EAAM,CAAC,CAEX,EAKX,SAAgB,EAAyD,EAAa,EAAkB,CACpG,IAAM,GAAA,EAAA,EAAA,QAAqB,EAAS,CACpC,EAAY,QAAU,EACtB,IAAM,GAAA,EAAA,EAAA,QAAiD,KAAK,CAE5D,OAAA,EAAA,EAAA,eAEM,GAAG,IAAgB,CACb,EAAS,SAAS,aAAa,EAAS,QAAQ,CACpD,EAAS,QAAU,eAAiB,EAAY,QAAQ,GAAG,EAAK,CAAE,EAAM,GAE5E,CAAC,EAAM,CACV,CCAL,SAAS,EAAmB,EAAmB,CAC3C,OAAO,OAAO,GAAW,SAAW,EAAS,OAAO,EAAO,CAG/D,SAAS,EAAiB,EAAc,EAAe,EAAiC,CACpF,GAAI,CAAC,EAAO,MAAO,EAAE,CACrB,IAAM,EAAQ,EAAM,aAAa,CACjC,OAAO,EAAQ,OAAQ,GAAM,EAAS,EAAE,CAAC,aAAa,CAAC,WAAW,EAAM,CAAC,CAI7E,SAAgB,EAAyB,CACrC,UACA,QACA,WAAW,EACX,WAAW,EACX,UACwC,CACxC,GAAM,CAAC,EAAW,IAAA,EAAA,EAAA,UAAyB,EAAE,CAEvC,GAAA,EAAA,EAAA,aACE,EAAM,OAAS,EAAiB,EAAE,CAClC,EAAe,EAAO,EAAS,EAAM,CAClC,EAAc,EAAS,EAAO,EAAS,CAC/C,CAAC,EAAS,EAAO,EAAU,EAAQ,EAAS,CAAC,CAE1C,EAAU,EAAS,OAAS,EAAI,EAAS,EAAY,EAAS,QAAU,KACxE,EAAY,EAAU,EAAS,EAAQ,CAAG,GAC1C,EACF,GAAa,EAAU,aAAa,CAAC,WAAW,EAAM,aAAa,CAAC,CAAG,EAAU,MAAM,EAAM,OAAO,CAAG,GAErG,GAAA,EAAA,EAAA,iBACE,CAAC,GAAQ,CAAC,EAAgB,CAAC,QAAO,OAAQ,KAAK,CAC5C,CAAC,MAAO,EAAQ,EAAM,OAAQ,EAAQ,CAC9C,CAAC,EAAM,EAAS,EAAM,CAAC,CAEpB,GAAA,EAAA,EAAA,iBAAyB,CACvB,EAAS,OAAS,GAAG,EAAc,IAAO,EAAI,GAAK,EAAS,OAAO,EACxE,CAAC,EAAS,OAAO,CAAC,CAEf,GAAA,EAAA,EAAA,iBAAyB,CACvB,EAAS,OAAS,GAAG,EAAc,IAAO,EAAI,EAAI,EAAS,QAAU,EAAS,OAAO,EAC1F,CAAC,EAAS,OAAO,CAAC,CAEf,GAAA,EAAA,EAAA,iBAA0B,EAAa,EAAE,CAAE,EAAE,CAAC,CAE9C,GAAA,EAAA,EAAA,aACD,IACQ,EAAE,MAAQ,OAAS,EAAE,MAAQ,UAAY,GAC1C,EAAE,gBAAgB,CACX,IAEP,EAAE,MAAQ,aAAe,EAAS,OAAS,GAC3C,EAAE,gBAAgB,CAClB,GAAM,CACC,IAEP,EAAE,MAAQ,WAAa,EAAS,OAAS,GACzC,EAAE,gBAAgB,CAClB,GAAM,CACC,IAEJ,GAEX,CAAC,EAAM,EAAS,OAAQ,EAAM,EAAK,CACtC,CAED,MAAO,CAAC,OAAM,SAAQ,OAAM,OAAM,QAAO,WAAY,EAAS,OAAQ,YAAU"}
@@ -1,2 +1,2 @@
1
1
  let e=require(`react`),t=require(`react/jsx-runtime`);function n(e,t,n){let r=t.getBoundingClientRect(),i=Math.max(r.width,r.height)*1.75,a=i/2,o=document.createElement(`span`),s=n.centered||n.clientX===void 0?r.width/2-a:n.clientX-r.left-a,c=n.centered||n.clientY===void 0?r.height/2-a:n.clientY-r.top-a;o.className=`click-effect-wave`,o.style.width=`${i}px`,o.style.height=`${i}px`,o.style.left=`${s}px`,o.style.top=`${c}px`,n.color&&o.style.setProperty(`--click-effect-color`,n.color),e.appendChild(o),o.addEventListener(`animationend`,()=>o.remove(),{once:!0})}function r({effect:r=`ripple`,disabled:i=!1,centered:a=!1,color:o}={}){let s=(0,e.useRef)(null),c=r===`ripple`&&!i,l=(0,e.useCallback)(e=>{!c||!e||!s.current||n(s.current,e,{centered:!0,color:o})},[o,c]),u=(0,e.useCallback)(e=>{!c||!s.current||e.pointerType===`mouse`&&e.button!==0||n(s.current,e.currentTarget,{centered:a,color:o,clientX:e.clientX,clientY:e.clientY})},[a,o,c]);return{effectClassName:c?`click-effect-root`:void 0,effectLayer:c?(0,t.jsx)(`span`,{ref:s,className:`click-effect-layer`,"aria-hidden":`true`}):null,handlePointerDown:u,triggerEffect:l}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
2
- //# sourceMappingURL=useInteractionEffect-BLehDk91.cjs.map
2
+ //# sourceMappingURL=useInteractionEffect-DnEfbCrX.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInteractionEffect-BLehDk91.cjs","names":[],"sources":["../src/utils/useInteractionEffect.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react'\nimport type {PointerEvent, ReactElement} from 'react'\n\nexport type MClickEffect = 'none' | 'ripple'\n\nexport interface UseInteractionEffectOptions {\n effect?: MClickEffect\n disabled?: boolean\n centered?: boolean\n color?: string\n}\n\nexport interface UseInteractionEffectResult<T extends HTMLElement> {\n effectClassName?: string\n effectLayer: ReactElement | null\n handlePointerDown: (event: PointerEvent<T>) => void\n triggerEffect: (target: T | null) => void\n}\n\ninterface RippleOptions {\n centered: boolean\n color?: string\n clientX?: number\n clientY?: number\n}\n\n// Render and position a ripple wave inside the dedicated effect layer.\nfunction appendRipple(layer: HTMLSpanElement, host: HTMLElement, options: RippleOptions) {\n const rect = host.getBoundingClientRect()\n const size = Math.max(rect.width, rect.height) * 1.75\n const radius = size / 2\n const wave = document.createElement('span')\n const x =\n options.centered || options.clientX === undefined\n ? rect.width / 2 - radius\n : options.clientX - rect.left - radius\n const y =\n options.centered || options.clientY === undefined\n ? rect.height / 2 - radius\n : options.clientY - rect.top - radius\n\n wave.className = 'click-effect-wave'\n wave.style.width = `${size}px`\n wave.style.height = `${size}px`\n wave.style.left = `${x}px`\n wave.style.top = `${y}px`\n\n if (options.color) {\n wave.style.setProperty('--click-effect-color', options.color)\n }\n\n layer.appendChild(wave)\n wave.addEventListener('animationend', () => wave.remove(), {once: true})\n}\n\n// Attach a lightweight click feedback effect without coupling it to a specific component.\nexport function useInteractionEffect<T extends HTMLElement = HTMLElement>({\n effect = 'ripple',\n disabled = false,\n centered = false,\n color,\n}: UseInteractionEffectOptions = {}): UseInteractionEffectResult<T> {\n const layerRef = useRef<HTMLSpanElement>(null)\n const enabled = effect === 'ripple' && !disabled\n\n // Trigger a centered ripple for keyboard-driven or programmatic actions.\n const triggerEffect = useCallback(\n (target: T | null) => {\n if (!enabled || !target || !layerRef.current) {\n return\n }\n\n appendRipple(layerRef.current, target, {centered: true, color})\n },\n [color, enabled]\n )\n\n // Start the ripple from the actual pointer position when possible.\n const handlePointerDown = useCallback(\n (event: PointerEvent<T>) => {\n if (!enabled || !layerRef.current) {\n return\n }\n\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return\n }\n\n appendRipple(layerRef.current, event.currentTarget, {\n centered,\n color,\n clientX: event.clientX,\n clientY: event.clientY,\n })\n },\n [centered, color, enabled]\n )\n\n return {\n effectClassName: enabled ? 'click-effect-root' : undefined,\n effectLayer: enabled ? <span ref={layerRef} className=\"click-effect-layer\" aria-hidden=\"true\" /> : null,\n handlePointerDown,\n triggerEffect,\n }\n}\n"],"mappings":"sDA2BA,SAAS,EAAa,EAAwB,EAAmB,EAAwB,CACrF,IAAM,EAAO,EAAK,uBAAuB,CACnC,EAAO,KAAK,IAAI,EAAK,MAAO,EAAK,OAAO,CAAG,KAC3C,EAAS,EAAO,EAChB,EAAO,SAAS,cAAc,OAAO,CACrC,EACF,EAAQ,UAAY,EAAQ,UAAY,IAAA,GAClC,EAAK,MAAQ,EAAI,EACjB,EAAQ,QAAU,EAAK,KAAO,EAClC,EACF,EAAQ,UAAY,EAAQ,UAAY,IAAA,GAClC,EAAK,OAAS,EAAI,EAClB,EAAQ,QAAU,EAAK,IAAM,EAEvC,EAAK,UAAY,oBACjB,EAAK,MAAM,MAAQ,GAAG,EAAK,IAC3B,EAAK,MAAM,OAAS,GAAG,EAAK,IAC5B,EAAK,MAAM,KAAO,GAAG,EAAE,IACvB,EAAK,MAAM,IAAM,GAAG,EAAE,IAElB,EAAQ,OACR,EAAK,MAAM,YAAY,uBAAwB,EAAQ,MAAM,CAGjE,EAAM,YAAY,EAAK,CACvB,EAAK,iBAAiB,mBAAsB,EAAK,QAAQ,CAAE,CAAC,KAAM,GAAK,CAAC,CAI5E,SAAgB,EAA0D,CACtE,SAAS,SACT,WAAW,GACX,WAAW,GACX,SAC6B,EAAE,CAAiC,CAChE,IAAM,GAAA,EAAA,EAAA,QAAmC,KAAK,CACxC,EAAU,IAAW,UAAY,CAAC,EAGlC,GAAA,EAAA,EAAA,aACD,GAAqB,CACd,CAAC,GAAW,CAAC,GAAU,CAAC,EAAS,SAIrC,EAAa,EAAS,QAAS,EAAQ,CAAC,SAAU,GAAM,QAAM,CAAC,EAEnE,CAAC,EAAO,EAAQ,CACnB,CAGK,GAAA,EAAA,EAAA,aACD,GAA2B,CACpB,CAAC,GAAW,CAAC,EAAS,SAItB,EAAM,cAAgB,SAAW,EAAM,SAAW,GAItD,EAAa,EAAS,QAAS,EAAM,cAAe,CAChD,WACA,QACA,QAAS,EAAM,QACf,QAAS,EAAM,QAClB,CAAC,EAEN,CAAC,EAAU,EAAO,EAAQ,CAC7B,CAED,MAAO,CACH,gBAAiB,EAAU,oBAAsB,IAAA,GACjD,YAAa,GAAU,EAAA,EAAA,KAAC,OAAD,CAAM,IAAK,EAAU,UAAU,qBAAqB,cAAY,OAAS,CAAA,CAAG,KACnG,oBACA,gBACH"}
1
+ {"version":3,"file":"useInteractionEffect-DnEfbCrX.cjs","names":[],"sources":["../src/utils/useInteractionEffect.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react'\nimport type {PointerEvent, ReactElement} from 'react'\n\nexport type MClickEffect = 'none' | 'ripple'\n\nexport interface UseInteractionEffectOptions {\n effect?: MClickEffect\n disabled?: boolean\n centered?: boolean\n color?: string\n}\n\nexport interface UseInteractionEffectResult<T extends HTMLElement> {\n effectClassName?: string\n effectLayer: ReactElement | null\n handlePointerDown: (event: PointerEvent<T>) => void\n triggerEffect: (target: T | null) => void\n}\n\ninterface RippleOptions {\n centered: boolean\n color?: string\n clientX?: number\n clientY?: number\n}\n\n// Render and position a ripple wave inside the dedicated effect layer.\nfunction appendRipple(layer: HTMLSpanElement, host: HTMLElement, options: RippleOptions) {\n const rect = host.getBoundingClientRect()\n const size = Math.max(rect.width, rect.height) * 1.75\n const radius = size / 2\n const wave = document.createElement('span')\n const x =\n options.centered || options.clientX === undefined\n ? rect.width / 2 - radius\n : options.clientX - rect.left - radius\n const y =\n options.centered || options.clientY === undefined\n ? rect.height / 2 - radius\n : options.clientY - rect.top - radius\n\n wave.className = 'click-effect-wave'\n wave.style.width = `${size}px`\n wave.style.height = `${size}px`\n wave.style.left = `${x}px`\n wave.style.top = `${y}px`\n\n if (options.color) {\n wave.style.setProperty('--click-effect-color', options.color)\n }\n\n layer.appendChild(wave)\n wave.addEventListener('animationend', () => wave.remove(), {once: true})\n}\n\n// Attach a lightweight click feedback effect without coupling it to a specific component.\nexport function useInteractionEffect<T extends HTMLElement = HTMLElement>({\n effect = 'ripple',\n disabled = false,\n centered = false,\n color,\n}: UseInteractionEffectOptions = {}): UseInteractionEffectResult<T> {\n const layerRef = useRef<HTMLSpanElement>(null)\n const enabled = effect === 'ripple' && !disabled\n\n // Trigger a centered ripple for keyboard-driven or programmatic actions.\n const triggerEffect = useCallback(\n (target: T | null) => {\n if (!enabled || !target || !layerRef.current) {\n return\n }\n\n appendRipple(layerRef.current, target, {centered: true, color})\n },\n [color, enabled]\n )\n\n // Start the ripple from the actual pointer position when possible.\n const handlePointerDown = useCallback(\n (event: PointerEvent<T>) => {\n if (!enabled || !layerRef.current) {\n return\n }\n\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return\n }\n\n appendRipple(layerRef.current, event.currentTarget, {\n centered,\n color,\n clientX: event.clientX,\n clientY: event.clientY,\n })\n },\n [centered, color, enabled]\n )\n\n return {\n effectClassName: enabled ? 'click-effect-root' : undefined,\n effectLayer: enabled ? <span ref={layerRef} className=\"click-effect-layer\" aria-hidden=\"true\" /> : null,\n handlePointerDown,\n triggerEffect,\n }\n}\n"],"mappings":"sDA2BA,SAAS,EAAa,EAAwB,EAAmB,EAAwB,CACrF,IAAM,EAAO,EAAK,uBAAuB,CACnC,EAAO,KAAK,IAAI,EAAK,MAAO,EAAK,OAAO,CAAG,KAC3C,EAAS,EAAO,EAChB,EAAO,SAAS,cAAc,OAAO,CACrC,EACF,EAAQ,UAAY,EAAQ,UAAY,IAAA,GAClC,EAAK,MAAQ,EAAI,EACjB,EAAQ,QAAU,EAAK,KAAO,EAClC,EACF,EAAQ,UAAY,EAAQ,UAAY,IAAA,GAClC,EAAK,OAAS,EAAI,EAClB,EAAQ,QAAU,EAAK,IAAM,EAEvC,EAAK,UAAY,oBACjB,EAAK,MAAM,MAAQ,GAAG,EAAK,IAC3B,EAAK,MAAM,OAAS,GAAG,EAAK,IAC5B,EAAK,MAAM,KAAO,GAAG,EAAE,IACvB,EAAK,MAAM,IAAM,GAAG,EAAE,IAElB,EAAQ,OACR,EAAK,MAAM,YAAY,uBAAwB,EAAQ,MAAM,CAGjE,EAAM,YAAY,EAAK,CACvB,EAAK,iBAAiB,mBAAsB,EAAK,QAAQ,CAAE,CAAC,KAAM,GAAK,CAAC,CAI5E,SAAgB,EAA0D,CACtE,SAAS,SACT,WAAW,GACX,WAAW,GACX,SAC6B,EAAE,CAAiC,CAChE,IAAM,GAAA,EAAA,EAAA,QAAmC,KAAK,CACxC,EAAU,IAAW,UAAY,CAAC,EAGlC,GAAA,EAAA,EAAA,aACD,GAAqB,CACd,CAAC,GAAW,CAAC,GAAU,CAAC,EAAS,SAIrC,EAAa,EAAS,QAAS,EAAQ,CAAC,SAAU,GAAM,QAAM,CAAC,EAEnE,CAAC,EAAO,EAAQ,CACnB,CAGK,GAAA,EAAA,EAAA,aACD,GAA2B,CACpB,CAAC,GAAW,CAAC,EAAS,SAItB,EAAM,cAAgB,SAAW,EAAM,SAAW,GAItD,EAAa,EAAS,QAAS,EAAM,cAAe,CAChD,WACA,QACA,QAAS,EAAM,QACf,QAAS,EAAM,QAClB,CAAC,EAEN,CAAC,EAAU,EAAO,EAAQ,CAC7B,CAED,MAAO,CACH,gBAAiB,EAAU,oBAAsB,IAAA,GACjD,YAAa,GAAU,EAAA,EAAA,KAAC,OAAD,CAAM,IAAK,EAAU,UAAU,qBAAqB,cAAY,OAAS,CAAA,CAAG,KACnG,oBACA,gBACH"}
@@ -37,4 +37,4 @@ function i({ effect: i = "ripple", disabled: a = !1, centered: o = !1, color: s
37
37
  //#endregion
38
38
  export { i as t };
39
39
 
40
- //# sourceMappingURL=useInteractionEffect-Dfqq8lGO.js.map
40
+ //# sourceMappingURL=useInteractionEffect-DtpbVd77.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useInteractionEffect-Dfqq8lGO.js","names":[],"sources":["../src/utils/useInteractionEffect.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react'\nimport type {PointerEvent, ReactElement} from 'react'\n\nexport type MClickEffect = 'none' | 'ripple'\n\nexport interface UseInteractionEffectOptions {\n effect?: MClickEffect\n disabled?: boolean\n centered?: boolean\n color?: string\n}\n\nexport interface UseInteractionEffectResult<T extends HTMLElement> {\n effectClassName?: string\n effectLayer: ReactElement | null\n handlePointerDown: (event: PointerEvent<T>) => void\n triggerEffect: (target: T | null) => void\n}\n\ninterface RippleOptions {\n centered: boolean\n color?: string\n clientX?: number\n clientY?: number\n}\n\n// Render and position a ripple wave inside the dedicated effect layer.\nfunction appendRipple(layer: HTMLSpanElement, host: HTMLElement, options: RippleOptions) {\n const rect = host.getBoundingClientRect()\n const size = Math.max(rect.width, rect.height) * 1.75\n const radius = size / 2\n const wave = document.createElement('span')\n const x =\n options.centered || options.clientX === undefined\n ? rect.width / 2 - radius\n : options.clientX - rect.left - radius\n const y =\n options.centered || options.clientY === undefined\n ? rect.height / 2 - radius\n : options.clientY - rect.top - radius\n\n wave.className = 'click-effect-wave'\n wave.style.width = `${size}px`\n wave.style.height = `${size}px`\n wave.style.left = `${x}px`\n wave.style.top = `${y}px`\n\n if (options.color) {\n wave.style.setProperty('--click-effect-color', options.color)\n }\n\n layer.appendChild(wave)\n wave.addEventListener('animationend', () => wave.remove(), {once: true})\n}\n\n// Attach a lightweight click feedback effect without coupling it to a specific component.\nexport function useInteractionEffect<T extends HTMLElement = HTMLElement>({\n effect = 'ripple',\n disabled = false,\n centered = false,\n color,\n}: UseInteractionEffectOptions = {}): UseInteractionEffectResult<T> {\n const layerRef = useRef<HTMLSpanElement>(null)\n const enabled = effect === 'ripple' && !disabled\n\n // Trigger a centered ripple for keyboard-driven or programmatic actions.\n const triggerEffect = useCallback(\n (target: T | null) => {\n if (!enabled || !target || !layerRef.current) {\n return\n }\n\n appendRipple(layerRef.current, target, {centered: true, color})\n },\n [color, enabled]\n )\n\n // Start the ripple from the actual pointer position when possible.\n const handlePointerDown = useCallback(\n (event: PointerEvent<T>) => {\n if (!enabled || !layerRef.current) {\n return\n }\n\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return\n }\n\n appendRipple(layerRef.current, event.currentTarget, {\n centered,\n color,\n clientX: event.clientX,\n clientY: event.clientY,\n })\n },\n [centered, color, enabled]\n )\n\n return {\n effectClassName: enabled ? 'click-effect-root' : undefined,\n effectLayer: enabled ? <span ref={layerRef} className=\"click-effect-layer\" aria-hidden=\"true\" /> : null,\n handlePointerDown,\n triggerEffect,\n }\n}\n"],"mappings":";;;AA2BA,SAAS,EAAa,GAAwB,GAAmB,GAAwB;CACrF,IAAM,IAAO,EAAK,uBAAuB,EACnC,IAAO,KAAK,IAAI,EAAK,OAAO,EAAK,OAAO,GAAG,MAC3C,IAAS,IAAO,GAChB,IAAO,SAAS,cAAc,OAAO,EACrC,IACF,EAAQ,YAAY,EAAQ,YAAY,KAAA,IAClC,EAAK,QAAQ,IAAI,IACjB,EAAQ,UAAU,EAAK,OAAO,GAClC,IACF,EAAQ,YAAY,EAAQ,YAAY,KAAA,IAClC,EAAK,SAAS,IAAI,IAClB,EAAQ,UAAU,EAAK,MAAM;AAavC,CAXA,EAAK,YAAY,qBACjB,EAAK,MAAM,QAAQ,GAAG,EAAK,KAC3B,EAAK,MAAM,SAAS,GAAG,EAAK,KAC5B,EAAK,MAAM,OAAO,GAAG,EAAE,KACvB,EAAK,MAAM,MAAM,GAAG,EAAE,KAElB,EAAQ,SACR,EAAK,MAAM,YAAY,wBAAwB,EAAQ,MAAM,EAGjE,EAAM,YAAY,EAAK,EACvB,EAAK,iBAAiB,sBAAsB,EAAK,QAAQ,EAAE,EAAC,MAAM,IAAK,CAAC;;AAI5E,SAAgB,EAA0D,EACtE,YAAS,UACT,cAAW,IACX,cAAW,IACX,aAC6B,EAAE,EAAiC;CAChE,IAAM,IAAW,EAAwB,KAAK,EACxC,IAAU,MAAW,YAAY,CAAC,GAGlC,IAAgB,GACjB,MAAqB;AACd,GAAC,KAAW,CAAC,KAAU,CAAC,EAAS,WAIrC,EAAa,EAAS,SAAS,GAAQ;GAAC,UAAU;GAAM;GAAM,CAAC;IAEnE,CAAC,GAAO,EAAQ,CACnB,EAGK,IAAoB,GACrB,MAA2B;AACpB,GAAC,KAAW,CAAC,EAAS,WAItB,EAAM,gBAAgB,WAAW,EAAM,WAAW,KAItD,EAAa,EAAS,SAAS,EAAM,eAAe;GAChD;GACA;GACA,SAAS,EAAM;GACf,SAAS,EAAM;GAClB,CAAC;IAEN;EAAC;EAAU;EAAO;EAAQ,CAC7B;AAED,QAAO;EACH,iBAAiB,IAAU,sBAAsB,KAAA;EACjD,aAAa,IAAU,kBAAC,QAAD;GAAM,KAAK;GAAU,WAAU;GAAqB,eAAY;GAAS,CAAA,GAAG;EACnG;EACA;EACH"}
1
+ {"version":3,"file":"useInteractionEffect-DtpbVd77.js","names":[],"sources":["../src/utils/useInteractionEffect.tsx"],"sourcesContent":["import {useCallback, useRef} from 'react'\nimport type {PointerEvent, ReactElement} from 'react'\n\nexport type MClickEffect = 'none' | 'ripple'\n\nexport interface UseInteractionEffectOptions {\n effect?: MClickEffect\n disabled?: boolean\n centered?: boolean\n color?: string\n}\n\nexport interface UseInteractionEffectResult<T extends HTMLElement> {\n effectClassName?: string\n effectLayer: ReactElement | null\n handlePointerDown: (event: PointerEvent<T>) => void\n triggerEffect: (target: T | null) => void\n}\n\ninterface RippleOptions {\n centered: boolean\n color?: string\n clientX?: number\n clientY?: number\n}\n\n// Render and position a ripple wave inside the dedicated effect layer.\nfunction appendRipple(layer: HTMLSpanElement, host: HTMLElement, options: RippleOptions) {\n const rect = host.getBoundingClientRect()\n const size = Math.max(rect.width, rect.height) * 1.75\n const radius = size / 2\n const wave = document.createElement('span')\n const x =\n options.centered || options.clientX === undefined\n ? rect.width / 2 - radius\n : options.clientX - rect.left - radius\n const y =\n options.centered || options.clientY === undefined\n ? rect.height / 2 - radius\n : options.clientY - rect.top - radius\n\n wave.className = 'click-effect-wave'\n wave.style.width = `${size}px`\n wave.style.height = `${size}px`\n wave.style.left = `${x}px`\n wave.style.top = `${y}px`\n\n if (options.color) {\n wave.style.setProperty('--click-effect-color', options.color)\n }\n\n layer.appendChild(wave)\n wave.addEventListener('animationend', () => wave.remove(), {once: true})\n}\n\n// Attach a lightweight click feedback effect without coupling it to a specific component.\nexport function useInteractionEffect<T extends HTMLElement = HTMLElement>({\n effect = 'ripple',\n disabled = false,\n centered = false,\n color,\n}: UseInteractionEffectOptions = {}): UseInteractionEffectResult<T> {\n const layerRef = useRef<HTMLSpanElement>(null)\n const enabled = effect === 'ripple' && !disabled\n\n // Trigger a centered ripple for keyboard-driven or programmatic actions.\n const triggerEffect = useCallback(\n (target: T | null) => {\n if (!enabled || !target || !layerRef.current) {\n return\n }\n\n appendRipple(layerRef.current, target, {centered: true, color})\n },\n [color, enabled]\n )\n\n // Start the ripple from the actual pointer position when possible.\n const handlePointerDown = useCallback(\n (event: PointerEvent<T>) => {\n if (!enabled || !layerRef.current) {\n return\n }\n\n if (event.pointerType === 'mouse' && event.button !== 0) {\n return\n }\n\n appendRipple(layerRef.current, event.currentTarget, {\n centered,\n color,\n clientX: event.clientX,\n clientY: event.clientY,\n })\n },\n [centered, color, enabled]\n )\n\n return {\n effectClassName: enabled ? 'click-effect-root' : undefined,\n effectLayer: enabled ? <span ref={layerRef} className=\"click-effect-layer\" aria-hidden=\"true\" /> : null,\n handlePointerDown,\n triggerEffect,\n }\n}\n"],"mappings":";;;AA2BA,SAAS,EAAa,GAAwB,GAAmB,GAAwB;CACrF,IAAM,IAAO,EAAK,uBAAuB,EACnC,IAAO,KAAK,IAAI,EAAK,OAAO,EAAK,OAAO,GAAG,MAC3C,IAAS,IAAO,GAChB,IAAO,SAAS,cAAc,OAAO,EACrC,IACF,EAAQ,YAAY,EAAQ,YAAY,KAAA,IAClC,EAAK,QAAQ,IAAI,IACjB,EAAQ,UAAU,EAAK,OAAO,GAClC,IACF,EAAQ,YAAY,EAAQ,YAAY,KAAA,IAClC,EAAK,SAAS,IAAI,IAClB,EAAQ,UAAU,EAAK,MAAM;AAavC,CAXA,EAAK,YAAY,qBACjB,EAAK,MAAM,QAAQ,GAAG,EAAK,KAC3B,EAAK,MAAM,SAAS,GAAG,EAAK,KAC5B,EAAK,MAAM,OAAO,GAAG,EAAE,KACvB,EAAK,MAAM,MAAM,GAAG,EAAE,KAElB,EAAQ,SACR,EAAK,MAAM,YAAY,wBAAwB,EAAQ,MAAM,EAGjE,EAAM,YAAY,EAAK,EACvB,EAAK,iBAAiB,sBAAsB,EAAK,QAAQ,EAAE,EAAC,MAAM,IAAK,CAAC;;AAI5E,SAAgB,EAA0D,EACtE,YAAS,UACT,cAAW,IACX,cAAW,IACX,aAC6B,EAAE,EAAiC;CAChE,IAAM,IAAW,EAAwB,KAAK,EACxC,IAAU,MAAW,YAAY,CAAC,GAGlC,IAAgB,GACjB,MAAqB;AACd,GAAC,KAAW,CAAC,KAAU,CAAC,EAAS,WAIrC,EAAa,EAAS,SAAS,GAAQ;GAAC,UAAU;GAAM;GAAM,CAAC;IAEnE,CAAC,GAAO,EAAQ,CACnB,EAGK,IAAoB,GACrB,MAA2B;AACpB,GAAC,KAAW,CAAC,EAAS,WAItB,EAAM,gBAAgB,WAAW,EAAM,WAAW,KAItD,EAAa,EAAS,SAAS,EAAM,eAAe;GAChD;GACA;GACA,SAAS,EAAM;GACf,SAAS,EAAM;GAClB,CAAC;IAEN;EAAC;EAAU;EAAO;EAAQ,CAC7B;AAED,QAAO;EACH,iBAAiB,IAAU,sBAAsB,KAAA;EACjD,aAAa,IAAU,kBAAC,QAAD;GAAM,KAAK;GAAU,WAAU;GAAqB,eAAY;GAAS,CAAA,GAAG;EACnG;EACA;EACH"}
@@ -1,2 +1,2 @@
1
1
  let e=require(`react`);function t({itemCount:t,onSelect:n,onClose:r,isOpen:i,loop:a=!0}){let[o,s]=(0,e.useState)(-1);return{activeIndex:o,setActiveIndex:s,resetIndex:(0,e.useCallback)(()=>s(-1),[]),onKeyDown:(0,e.useCallback)(e=>{if(!(!i||t===0))switch(e.key){case`ArrowDown`:e.preventDefault(),s(e=>e>=t-1?a?0:e:e+1);break;case`ArrowUp`:e.preventDefault(),s(e=>e<=0?a?t-1:0:e-1);break;case`Enter`:e.preventDefault(),o>=0&&o<t&&n(o);break;case`Escape`:e.preventDefault(),r();break;case`Home`:e.preventDefault(),s(0);break;case`End`:e.preventDefault(),s(t-1);break}},[i,t,o,n,r,a])}}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
2
- //# sourceMappingURL=useKeyboardNav-DBeCcTmg.cjs.map
2
+ //# sourceMappingURL=useKeyboardNav-BrODLJaL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardNav-DBeCcTmg.cjs","names":[],"sources":["../src/utils/useKeyboardNav.ts"],"sourcesContent":["import {useState, useCallback, type KeyboardEvent} from 'react'\n\nexport interface UseKeyboardNavOptions {\n itemCount: number\n onSelect: (index: number) => void\n onClose: () => void\n isOpen: boolean\n loop?: boolean\n}\n\n// Provide arrow-key navigation and selection state for list-like widgets.\nexport function useKeyboardNav({itemCount, onSelect, onClose, isOpen, loop = true}: UseKeyboardNavOptions) {\n const [activeIndex, setActiveIndex] = useState(-1)\n\n // Reset highlight state when the owning widget closes or clears results.\n const resetIndex = useCallback(() => setActiveIndex(-1), [])\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (!isOpen || itemCount === 0) return\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev >= itemCount - 1) return loop ? 0 : prev\n return prev + 1\n })\n break\n }\n case 'ArrowUp': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev <= 0) return loop ? itemCount - 1 : 0\n return prev - 1\n })\n break\n }\n case 'Enter': {\n e.preventDefault()\n if (activeIndex >= 0 && activeIndex < itemCount) {\n onSelect(activeIndex)\n }\n break\n }\n case 'Escape': {\n e.preventDefault()\n onClose()\n break\n }\n case 'Home': {\n e.preventDefault()\n setActiveIndex(0)\n break\n }\n case 'End': {\n e.preventDefault()\n setActiveIndex(itemCount - 1)\n break\n }\n }\n },\n [isOpen, itemCount, activeIndex, onSelect, onClose, loop]\n )\n\n return {activeIndex, setActiveIndex, resetIndex, onKeyDown}\n}\n"],"mappings":"uBAWA,SAAgB,EAAe,CAAC,YAAW,WAAU,UAAS,SAAQ,OAAO,IAA8B,CACvG,GAAM,CAAC,EAAa,IAAA,EAAA,EAAA,UAA2B,GAAG,CAqDlD,MAAO,CAAC,cAAa,iBAAgB,YAAA,EAAA,EAAA,iBAlDA,EAAe,GAAG,CAAE,EAAE,CAAC,CAkDX,WAAA,EAAA,EAAA,aA/C5C,GAAqB,CACd,MAAC,GAAU,IAAc,GAE7B,OAAQ,EAAE,IAAV,CACI,IAAK,YACD,EAAE,gBAAgB,CAClB,EAAgB,GACR,GAAQ,EAAY,EAAU,EAAO,EAAI,EACtC,EAAO,EAChB,CACF,MAEJ,IAAK,UACD,EAAE,gBAAgB,CAClB,EAAgB,GACR,GAAQ,EAAU,EAAO,EAAY,EAAI,EACtC,EAAO,EAChB,CACF,MAEJ,IAAK,QACD,EAAE,gBAAgB,CACd,GAAe,GAAK,EAAc,GAClC,EAAS,EAAY,CAEzB,MAEJ,IAAK,SACD,EAAE,gBAAgB,CAClB,GAAS,CACT,MAEJ,IAAK,OACD,EAAE,gBAAgB,CAClB,EAAe,EAAE,CACjB,MAEJ,IAAK,MACD,EAAE,gBAAgB,CAClB,EAAe,EAAY,EAAE,CAC7B,QAIZ,CAAC,EAAQ,EAAW,EAAa,EAAU,EAAS,EAAK,CAC5D,CAE0D"}
1
+ {"version":3,"file":"useKeyboardNav-BrODLJaL.cjs","names":[],"sources":["../src/utils/useKeyboardNav.ts"],"sourcesContent":["import {useState, useCallback, type KeyboardEvent} from 'react'\n\nexport interface UseKeyboardNavOptions {\n itemCount: number\n onSelect: (index: number) => void\n onClose: () => void\n isOpen: boolean\n loop?: boolean\n}\n\n// Provide arrow-key navigation and selection state for list-like widgets.\nexport function useKeyboardNav({itemCount, onSelect, onClose, isOpen, loop = true}: UseKeyboardNavOptions) {\n const [activeIndex, setActiveIndex] = useState(-1)\n\n // Reset highlight state when the owning widget closes or clears results.\n const resetIndex = useCallback(() => setActiveIndex(-1), [])\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (!isOpen || itemCount === 0) return\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev >= itemCount - 1) return loop ? 0 : prev\n return prev + 1\n })\n break\n }\n case 'ArrowUp': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev <= 0) return loop ? itemCount - 1 : 0\n return prev - 1\n })\n break\n }\n case 'Enter': {\n e.preventDefault()\n if (activeIndex >= 0 && activeIndex < itemCount) {\n onSelect(activeIndex)\n }\n break\n }\n case 'Escape': {\n e.preventDefault()\n onClose()\n break\n }\n case 'Home': {\n e.preventDefault()\n setActiveIndex(0)\n break\n }\n case 'End': {\n e.preventDefault()\n setActiveIndex(itemCount - 1)\n break\n }\n }\n },\n [isOpen, itemCount, activeIndex, onSelect, onClose, loop]\n )\n\n return {activeIndex, setActiveIndex, resetIndex, onKeyDown}\n}\n"],"mappings":"uBAWA,SAAgB,EAAe,CAAC,YAAW,WAAU,UAAS,SAAQ,OAAO,IAA8B,CACvG,GAAM,CAAC,EAAa,IAAA,EAAA,EAAA,UAA2B,GAAG,CAqDlD,MAAO,CAAC,cAAa,iBAAgB,YAAA,EAAA,EAAA,iBAlDA,EAAe,GAAG,CAAE,EAAE,CAAC,CAkDX,WAAA,EAAA,EAAA,aA/C5C,GAAqB,CACd,MAAC,GAAU,IAAc,GAE7B,OAAQ,EAAE,IAAV,CACI,IAAK,YACD,EAAE,gBAAgB,CAClB,EAAgB,GACR,GAAQ,EAAY,EAAU,EAAO,EAAI,EACtC,EAAO,EAChB,CACF,MAEJ,IAAK,UACD,EAAE,gBAAgB,CAClB,EAAgB,GACR,GAAQ,EAAU,EAAO,EAAY,EAAI,EACtC,EAAO,EAChB,CACF,MAEJ,IAAK,QACD,EAAE,gBAAgB,CACd,GAAe,GAAK,EAAc,GAClC,EAAS,EAAY,CAEzB,MAEJ,IAAK,SACD,EAAE,gBAAgB,CAClB,GAAS,CACT,MAEJ,IAAK,OACD,EAAE,gBAAgB,CAClB,EAAe,EAAE,CACjB,MAEJ,IAAK,MACD,EAAE,gBAAgB,CAClB,EAAe,EAAY,EAAE,CAC7B,QAIZ,CAAC,EAAQ,EAAW,EAAa,EAAU,EAAS,EAAK,CAC5D,CAE0D"}
@@ -40,4 +40,4 @@ function n({ itemCount: n, onSelect: r, onClose: i, isOpen: a, loop: o = !0 }) {
40
40
  //#endregion
41
41
  export { n as t };
42
42
 
43
- //# sourceMappingURL=useKeyboardNav-DXvrPrx9.js.map
43
+ //# sourceMappingURL=useKeyboardNav-iEXOdEMB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardNav-DXvrPrx9.js","names":[],"sources":["../src/utils/useKeyboardNav.ts"],"sourcesContent":["import {useState, useCallback, type KeyboardEvent} from 'react'\n\nexport interface UseKeyboardNavOptions {\n itemCount: number\n onSelect: (index: number) => void\n onClose: () => void\n isOpen: boolean\n loop?: boolean\n}\n\n// Provide arrow-key navigation and selection state for list-like widgets.\nexport function useKeyboardNav({itemCount, onSelect, onClose, isOpen, loop = true}: UseKeyboardNavOptions) {\n const [activeIndex, setActiveIndex] = useState(-1)\n\n // Reset highlight state when the owning widget closes or clears results.\n const resetIndex = useCallback(() => setActiveIndex(-1), [])\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (!isOpen || itemCount === 0) return\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev >= itemCount - 1) return loop ? 0 : prev\n return prev + 1\n })\n break\n }\n case 'ArrowUp': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev <= 0) return loop ? itemCount - 1 : 0\n return prev - 1\n })\n break\n }\n case 'Enter': {\n e.preventDefault()\n if (activeIndex >= 0 && activeIndex < itemCount) {\n onSelect(activeIndex)\n }\n break\n }\n case 'Escape': {\n e.preventDefault()\n onClose()\n break\n }\n case 'Home': {\n e.preventDefault()\n setActiveIndex(0)\n break\n }\n case 'End': {\n e.preventDefault()\n setActiveIndex(itemCount - 1)\n break\n }\n }\n },\n [isOpen, itemCount, activeIndex, onSelect, onClose, loop]\n )\n\n return {activeIndex, setActiveIndex, resetIndex, onKeyDown}\n}\n"],"mappings":";;AAWA,SAAgB,EAAe,EAAC,cAAW,aAAU,YAAS,WAAQ,UAAO,MAA8B;CACvG,IAAM,CAAC,GAAa,KAAkB,EAAS,GAAG;AAqDlD,QAAO;EAAC;EAAa;EAAgB,YAlDlB,QAAkB,EAAe,GAAG,EAAE,EAAE,CAAC;EAkDX,WAhD/B,GACb,MAAqB;AACd,UAAC,KAAU,MAAc,GAE7B,SAAQ,EAAE,KAAV;IACI,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,GAAgB,MACR,KAAQ,IAAY,IAAU,IAAO,IAAI,IACtC,IAAO,EAChB;AACF;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,GAAgB,MACR,KAAQ,IAAU,IAAO,IAAY,IAAI,IACtC,IAAO,EAChB;AACF;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EACd,KAAe,KAAK,IAAc,KAClC,EAAS,EAAY;AAEzB;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,GAAS;AACT;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,EAAe,EAAE;AACjB;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,EAAe,IAAY,EAAE;AAC7B;;KAIZ;GAAC;GAAQ;GAAW;GAAa;GAAU;GAAS;GAAK,CAC5D;EAE0D"}
1
+ {"version":3,"file":"useKeyboardNav-iEXOdEMB.js","names":[],"sources":["../src/utils/useKeyboardNav.ts"],"sourcesContent":["import {useState, useCallback, type KeyboardEvent} from 'react'\n\nexport interface UseKeyboardNavOptions {\n itemCount: number\n onSelect: (index: number) => void\n onClose: () => void\n isOpen: boolean\n loop?: boolean\n}\n\n// Provide arrow-key navigation and selection state for list-like widgets.\nexport function useKeyboardNav({itemCount, onSelect, onClose, isOpen, loop = true}: UseKeyboardNavOptions) {\n const [activeIndex, setActiveIndex] = useState(-1)\n\n // Reset highlight state when the owning widget closes or clears results.\n const resetIndex = useCallback(() => setActiveIndex(-1), [])\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (!isOpen || itemCount === 0) return\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev >= itemCount - 1) return loop ? 0 : prev\n return prev + 1\n })\n break\n }\n case 'ArrowUp': {\n e.preventDefault()\n setActiveIndex((prev) => {\n if (prev <= 0) return loop ? itemCount - 1 : 0\n return prev - 1\n })\n break\n }\n case 'Enter': {\n e.preventDefault()\n if (activeIndex >= 0 && activeIndex < itemCount) {\n onSelect(activeIndex)\n }\n break\n }\n case 'Escape': {\n e.preventDefault()\n onClose()\n break\n }\n case 'Home': {\n e.preventDefault()\n setActiveIndex(0)\n break\n }\n case 'End': {\n e.preventDefault()\n setActiveIndex(itemCount - 1)\n break\n }\n }\n },\n [isOpen, itemCount, activeIndex, onSelect, onClose, loop]\n )\n\n return {activeIndex, setActiveIndex, resetIndex, onKeyDown}\n}\n"],"mappings":";;AAWA,SAAgB,EAAe,EAAC,cAAW,aAAU,YAAS,WAAQ,UAAO,MAA8B;CACvG,IAAM,CAAC,GAAa,KAAkB,EAAS,GAAG;AAqDlD,QAAO;EAAC;EAAa;EAAgB,YAlDlB,QAAkB,EAAe,GAAG,EAAE,EAAE,CAAC;EAkDX,WAhD/B,GACb,MAAqB;AACd,UAAC,KAAU,MAAc,GAE7B,SAAQ,EAAE,KAAV;IACI,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,GAAgB,MACR,KAAQ,IAAY,IAAU,IAAO,IAAI,IACtC,IAAO,EAChB;AACF;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,GAAgB,MACR,KAAQ,IAAU,IAAO,IAAY,IAAI,IACtC,IAAO,EAChB;AACF;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EACd,KAAe,KAAK,IAAc,KAClC,EAAS,EAAY;AAEzB;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,GAAS;AACT;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,EAAe,EAAE;AACjB;IAEJ,KAAK;AAED,KADA,EAAE,gBAAgB,EAClB,EAAe,IAAY,EAAE;AAC7B;;KAIZ;GAAC;GAAQ;GAAW;GAAa;GAAU;GAAS;GAAK,CAC5D;EAE0D"}
@@ -20,4 +20,4 @@ function n(n) {
20
20
  //#endregion
21
21
  export { n as t };
22
22
 
23
- //# sourceMappingURL=useReveal-DzskFHKb.js.map
23
+ //# sourceMappingURL=useReveal-BJ59usiL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReveal-DzskFHKb.js","names":[],"sources":["../src/utils/useReveal.ts"],"sourcesContent":["import {useEffect, useRef} from 'react'\n\nexport type RevealProp = boolean | number\n\n// Observe an element and trigger a CSS reveal animation when it enters the viewport.\nexport function useReveal<T extends HTMLElement = HTMLElement>(reveal: RevealProp | undefined) {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (reveal === false || reveal === undefined) return\n\n const node = ref.current\n if (!node) return\n\n const delay = typeof reveal === 'number' ? reveal : 0\n if (delay > 0) {\n node.style.setProperty('--reveal-delay', `${delay}s`)\n }\n\n const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n if (prefersReduced) {\n node.classList.remove('reveal')\n node.classList.add('revealed')\n return\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n node.classList.add('revealed')\n observer.disconnect()\n }\n }\n },\n {threshold: 0.2}\n )\n\n observer.observe(node)\n return () => observer.disconnect()\n }, [reveal])\n\n return ref\n}\n"],"mappings":";;AAKA,SAAgB,EAA+C,GAAgC;CAC3F,IAAM,IAAM,EAAU,KAAK;AAoC3B,QAlCA,QAAgB;AACZ,MAAI,MAAW,MAAS,MAAW,KAAA,EAAW;EAE9C,IAAM,IAAO,EAAI;AACjB,MAAI,CAAC,EAAM;EAEX,IAAM,IAAQ,OAAO,KAAW,WAAW,IAAS;AAMpD,MALI,IAAQ,KACR,EAAK,MAAM,YAAY,kBAAkB,GAAG,EAAM,GAAG,EAGlC,OAAO,WAAW,mCAAmC,CAAC,SACzD;AAEhB,GADA,EAAK,UAAU,OAAO,SAAS,EAC/B,EAAK,UAAU,IAAI,WAAW;AAC9B;;EAGJ,IAAM,IAAW,IAAI,sBAChB,MAAY;AACT,QAAK,IAAM,KAAS,EAChB,CAAI,EAAM,mBACN,EAAK,UAAU,IAAI,WAAW,EAC9B,EAAS,YAAY;KAIjC,EAAC,WAAW,IAAI,CACnB;AAGD,SADA,EAAS,QAAQ,EAAK,QACT,EAAS,YAAY;IACnC,CAAC,EAAO,CAAC,EAEL"}
1
+ {"version":3,"file":"useReveal-BJ59usiL.js","names":[],"sources":["../src/utils/useReveal.ts"],"sourcesContent":["import {useEffect, useRef} from 'react'\n\nexport type RevealProp = boolean | number\n\n// Observe an element and trigger a CSS reveal animation when it enters the viewport.\nexport function useReveal<T extends HTMLElement = HTMLElement>(reveal: RevealProp | undefined) {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (reveal === false || reveal === undefined) return\n\n const node = ref.current\n if (!node) return\n\n const delay = typeof reveal === 'number' ? reveal : 0\n if (delay > 0) {\n node.style.setProperty('--reveal-delay', `${delay}s`)\n }\n\n const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n if (prefersReduced) {\n node.classList.remove('reveal')\n node.classList.add('revealed')\n return\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n node.classList.add('revealed')\n observer.disconnect()\n }\n }\n },\n {threshold: 0.2}\n )\n\n observer.observe(node)\n return () => observer.disconnect()\n }, [reveal])\n\n return ref\n}\n"],"mappings":";;AAKA,SAAgB,EAA+C,GAAgC;CAC3F,IAAM,IAAM,EAAU,KAAK;AAoC3B,QAlCA,QAAgB;AACZ,MAAI,MAAW,MAAS,MAAW,KAAA,EAAW;EAE9C,IAAM,IAAO,EAAI;AACjB,MAAI,CAAC,EAAM;EAEX,IAAM,IAAQ,OAAO,KAAW,WAAW,IAAS;AAMpD,MALI,IAAQ,KACR,EAAK,MAAM,YAAY,kBAAkB,GAAG,EAAM,GAAG,EAGlC,OAAO,WAAW,mCAAmC,CAAC,SACzD;AAEhB,GADA,EAAK,UAAU,OAAO,SAAS,EAC/B,EAAK,UAAU,IAAI,WAAW;AAC9B;;EAGJ,IAAM,IAAW,IAAI,sBAChB,MAAY;AACT,QAAK,IAAM,KAAS,EAChB,CAAI,EAAM,mBACN,EAAK,UAAU,IAAI,WAAW,EAC9B,EAAS,YAAY;KAIjC,EAAC,WAAW,IAAI,CACnB;AAGD,SADA,EAAS,QAAQ,EAAK,QACT,EAAS,YAAY;IACnC,CAAC,EAAO,CAAC,EAEL"}
@@ -1,2 +1,2 @@
1
1
  let e=require(`react`);function t(t){let n=(0,e.useRef)(null);return(0,e.useEffect)(()=>{if(t===!1||t===void 0)return;let e=n.current;if(!e)return;let r=typeof t==`number`?t:0;if(r>0&&e.style.setProperty(`--reveal-delay`,`${r}s`),window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){e.classList.remove(`reveal`),e.classList.add(`revealed`);return}let i=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.classList.add(`revealed`),i.disconnect())},{threshold:.2});return i.observe(e),()=>i.disconnect()},[t]),n}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
2
- //# sourceMappingURL=useReveal-CdIoh0Rk.cjs.map
2
+ //# sourceMappingURL=useReveal-B_17PI89.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReveal-CdIoh0Rk.cjs","names":[],"sources":["../src/utils/useReveal.ts"],"sourcesContent":["import {useEffect, useRef} from 'react'\n\nexport type RevealProp = boolean | number\n\n// Observe an element and trigger a CSS reveal animation when it enters the viewport.\nexport function useReveal<T extends HTMLElement = HTMLElement>(reveal: RevealProp | undefined) {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (reveal === false || reveal === undefined) return\n\n const node = ref.current\n if (!node) return\n\n const delay = typeof reveal === 'number' ? reveal : 0\n if (delay > 0) {\n node.style.setProperty('--reveal-delay', `${delay}s`)\n }\n\n const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n if (prefersReduced) {\n node.classList.remove('reveal')\n node.classList.add('revealed')\n return\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n node.classList.add('revealed')\n observer.disconnect()\n }\n }\n },\n {threshold: 0.2}\n )\n\n observer.observe(node)\n return () => observer.disconnect()\n }, [reveal])\n\n return ref\n}\n"],"mappings":"uBAKA,SAAgB,EAA+C,EAAgC,CAC3F,IAAM,GAAA,EAAA,EAAA,QAAgB,KAAK,CAoC3B,OAlCA,EAAA,EAAA,eAAgB,CACZ,GAAI,IAAW,IAAS,IAAW,IAAA,GAAW,OAE9C,IAAM,EAAO,EAAI,QACjB,GAAI,CAAC,EAAM,OAEX,IAAM,EAAQ,OAAO,GAAW,SAAW,EAAS,EAMpD,GALI,EAAQ,GACR,EAAK,MAAM,YAAY,iBAAkB,GAAG,EAAM,GAAG,CAGlC,OAAO,WAAW,mCAAmC,CAAC,QACzD,CAChB,EAAK,UAAU,OAAO,SAAS,CAC/B,EAAK,UAAU,IAAI,WAAW,CAC9B,OAGJ,IAAM,EAAW,IAAI,qBAChB,GAAY,CACT,IAAK,IAAM,KAAS,EACZ,EAAM,iBACN,EAAK,UAAU,IAAI,WAAW,CAC9B,EAAS,YAAY,GAIjC,CAAC,UAAW,GAAI,CACnB,CAGD,OADA,EAAS,QAAQ,EAAK,KACT,EAAS,YAAY,EACnC,CAAC,EAAO,CAAC,CAEL"}
1
+ {"version":3,"file":"useReveal-B_17PI89.cjs","names":[],"sources":["../src/utils/useReveal.ts"],"sourcesContent":["import {useEffect, useRef} from 'react'\n\nexport type RevealProp = boolean | number\n\n// Observe an element and trigger a CSS reveal animation when it enters the viewport.\nexport function useReveal<T extends HTMLElement = HTMLElement>(reveal: RevealProp | undefined) {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (reveal === false || reveal === undefined) return\n\n const node = ref.current\n if (!node) return\n\n const delay = typeof reveal === 'number' ? reveal : 0\n if (delay > 0) {\n node.style.setProperty('--reveal-delay', `${delay}s`)\n }\n\n const prefersReduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches\n if (prefersReduced) {\n node.classList.remove('reveal')\n node.classList.add('revealed')\n return\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n node.classList.add('revealed')\n observer.disconnect()\n }\n }\n },\n {threshold: 0.2}\n )\n\n observer.observe(node)\n return () => observer.disconnect()\n }, [reveal])\n\n return ref\n}\n"],"mappings":"uBAKA,SAAgB,EAA+C,EAAgC,CAC3F,IAAM,GAAA,EAAA,EAAA,QAAgB,KAAK,CAoC3B,OAlCA,EAAA,EAAA,eAAgB,CACZ,GAAI,IAAW,IAAS,IAAW,IAAA,GAAW,OAE9C,IAAM,EAAO,EAAI,QACjB,GAAI,CAAC,EAAM,OAEX,IAAM,EAAQ,OAAO,GAAW,SAAW,EAAS,EAMpD,GALI,EAAQ,GACR,EAAK,MAAM,YAAY,iBAAkB,GAAG,EAAM,GAAG,CAGlC,OAAO,WAAW,mCAAmC,CAAC,QACzD,CAChB,EAAK,UAAU,OAAO,SAAS,CAC/B,EAAK,UAAU,IAAI,WAAW,CAC9B,OAGJ,IAAM,EAAW,IAAI,qBAChB,GAAY,CACT,IAAK,IAAM,KAAS,EACZ,EAAM,iBACN,EAAK,UAAU,IAAI,WAAW,CAC9B,EAAS,YAAY,GAIjC,CAAC,UAAW,GAAI,CACnB,CAGD,OADA,EAAS,QAAQ,EAAK,KACT,EAAS,YAAY,EACnC,CAAC,EAAO,CAAC,CAEL"}
package/dist/utils.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  const {ensureStyles}=require('./style-runtime.cjs')
2
2
  ensureStyles()
3
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./cn-SOcVdnX6.cjs`),t=require(`./validators-CyDTl6cC.cjs`),n=require(`./creditCards-BjHGqAFx.cjs`),r=require(`./formatters-BIijIfCB.cjs`),i=require(`./dateUtils-xSfrXjbY.cjs`),a=require(`./relativeTime-D5qYOJVu.cjs`),o=require(`./useGhostText-CL1kSB_V.cjs`),s=require(`./licensing-CMLexRJk.cjs`),c=require(`./useKeyboardNav-DBeCcTmg.cjs`),l=require(`./useInteractionEffect-BLehDk91.cjs`),u=require(`./useReveal-CdIoh0Rk.cjs`);exports.addMonths=i.t,exports.addYears=i.n,exports.adjustCursorAfterFormat=r.t,exports.capitalizeWords=r.n,exports.cn=e.t,exports.composeValidators=t.t,exports.creditCardBrands=n.t,exports.daysInMonth=i.i,exports.detectCardBrand=n.n,exports.firstDayOfMonth=i.a,exports.formatAbsoluteTime=a.t,exports.formatCardNumber=n.r,exports.formatCurrency=r.r,exports.formatDate=i.o,exports.formatIBAN=r.a,exports.formatNIP=r.o,exports.formatPhone=r.s,exports.formatPostCode=t.h,exports.formatRelativeTime=a.n,exports.formatTime=i.c,exports.getAutoUpdateInterval=a.r,exports.getDayNames=i.u,exports.getMineralComponentLicense=s.t,exports.getMineralComponentPlan=s.n,exports.getMonthNames=i.d,exports.getPostCodeRule=t.g,exports.getRelativeTimeValue=a.i,exports.isDateInRange=i.f,exports.isMineralProComponent=s.r,exports.isSameDay=i.p,exports.mineralComponentLicenses=s.i,exports.mineralProComponents=s.a,exports.parseCurrencyToNumber=r.c,exports.parseDate=i.m,exports.parseRelativeThreshold=a.a,exports.parseTime=i.h,exports.postCodeCountries=t._,exports.postCodeRules=t.v,exports.stripCardNumber=n.i,exports.stripNonAlphanumeric=r.l,exports.stripNonDigits=r.u,exports.stripTime=i._,exports.toDate=a.o,exports.unformatIBAN=r.d,exports.useClickOutside=s.o,exports.useDebounce=o.n,exports.useDebouncedCallback=o.r,exports.useGhostText=o.t,exports.useInteractionEffect=l.t,exports.useKeyboardNav=c.t,exports.useReveal=u.t,exports.validateCardNumber=n.a,exports.validateEmail=t.i,exports.validateIBAN=t.a,exports.validateMaxLength=t.o,exports.validateMinLength=t.s,exports.validateNIP=t.c,exports.validatePESEL=t.l,exports.validatePattern=t.u,exports.validatePhone=t.d,exports.validatePostCode=t.y,exports.validateREGON=t.f,exports.validateRange=t.p,exports.validateRequired=t.m;
3
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./cn-CU5TNITO.cjs`),t=require(`./validators-BeNTD8mf.cjs`),n=require(`./creditCards-ljs044xt.cjs`),r=require(`./formatters-CNjg_h7-.cjs`),i=require(`./dateUtils-Dq1vaA-D.cjs`),a=require(`./relativeTime-DgYBUaVm.cjs`),o=require(`./useGhostText-QMdO_HK6.cjs`),s=require(`./licensing-BXFauUj_.cjs`),c=require(`./useKeyboardNav-BrODLJaL.cjs`),l=require(`./useInteractionEffect-DnEfbCrX.cjs`),u=require(`./useReveal-B_17PI89.cjs`);exports.addMonths=i.t,exports.addYears=i.n,exports.adjustCursorAfterFormat=r.t,exports.capitalizeWords=r.n,exports.cn=e.t,exports.composeValidators=t.t,exports.creditCardBrands=n.t,exports.daysInMonth=i.i,exports.detectCardBrand=n.n,exports.firstDayOfMonth=i.a,exports.formatAbsoluteTime=a.t,exports.formatCardNumber=n.r,exports.formatCurrency=r.r,exports.formatDate=i.o,exports.formatIBAN=r.a,exports.formatNIP=r.o,exports.formatPhone=r.s,exports.formatPostCode=t.h,exports.formatRelativeTime=a.n,exports.formatTime=i.c,exports.getAutoUpdateInterval=a.r,exports.getDayNames=i.u,exports.getMineralComponentLicense=s.t,exports.getMineralComponentPlan=s.n,exports.getMonthNames=i.d,exports.getPostCodeRule=t.g,exports.getRelativeTimeValue=a.i,exports.isDateInRange=i.f,exports.isMineralProComponent=s.r,exports.isSameDay=i.p,exports.mineralComponentLicenses=s.i,exports.mineralProComponents=s.a,exports.parseCurrencyToNumber=r.c,exports.parseDate=i.m,exports.parseRelativeThreshold=a.a,exports.parseTime=i.h,exports.postCodeCountries=t._,exports.postCodeRules=t.v,exports.stripCardNumber=n.i,exports.stripNonAlphanumeric=r.l,exports.stripNonDigits=r.u,exports.stripTime=i._,exports.toDate=a.o,exports.unformatIBAN=r.d,exports.useClickOutside=s.o,exports.useDebounce=o.n,exports.useDebouncedCallback=o.r,exports.useGhostText=o.t,exports.useInteractionEffect=l.t,exports.useKeyboardNav=c.t,exports.useReveal=u.t,exports.validateCardNumber=n.a,exports.validateEmail=t.i,exports.validateIBAN=t.a,exports.validateMaxLength=t.o,exports.validateMinLength=t.s,exports.validateNIP=t.c,exports.validatePESEL=t.l,exports.validatePattern=t.u,exports.validatePhone=t.d,exports.validatePostCode=t.y,exports.validateREGON=t.f,exports.validateRange=t.p,exports.validateRequired=t.m;
package/dist/utils.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {ensureStyles} from './style-runtime.js'
2
2
  ensureStyles()
3
- import { t as e } from "./cn-DZLxql0l.js";
4
- import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, o as d, p as f, s as p, t as m, u as h, v as g, y as _ } from "./validators-ljBWrIca.js";
5
- import { a as v, i as y, n as b, r as x, t as S } from "./creditCards-CoZpbB1e.js";
6
- import { a as C, c as w, d as T, l as E, n as D, o as O, r as k, s as A, t as j, u as M } from "./formatters-DMI5QqhS.js";
7
- import { _ as N, a as P, c as F, d as I, f as L, h as R, i as z, m as B, n as V, o as H, p as U, t as W, u as G } from "./dateUtils-BOsYyWde.js";
8
- import { a as K, i as q, n as J, o as Y, r as X, t as Z } from "./relativeTime-3dGgniAK.js";
9
- import { n as Q, r as $, t as ee } from "./useGhostText-Zq3iktss.js";
10
- import { a as te, i as ne, n as re, o as ie, r as ae, t as oe } from "./licensing-SQAMYrOI.js";
11
- import { t as se } from "./useKeyboardNav-DXvrPrx9.js";
12
- import { t as ce } from "./useInteractionEffect-Dfqq8lGO.js";
13
- import { t as le } from "./useReveal-DzskFHKb.js";
3
+ import { t as e } from "./cn-YER3QsV1.js";
4
+ import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, o as d, p as f, s as p, t as m, u as h, v as g, y as _ } from "./validators-H8tNxb8O.js";
5
+ import { a as v, i as y, n as b, r as x, t as S } from "./creditCards-CCysEwry.js";
6
+ import { a as C, c as w, d as T, l as E, n as D, o as O, r as k, s as A, t as j, u as M } from "./formatters-T0vvjMtB.js";
7
+ import { _ as N, a as P, c as F, d as I, f as L, h as R, i as z, m as B, n as V, o as H, p as U, t as W, u as G } from "./dateUtils-CUY6CRCf.js";
8
+ import { a as K, i as q, n as J, o as Y, r as X, t as Z } from "./relativeTime-Cr-NVzij.js";
9
+ import { n as Q, r as $, t as ee } from "./useGhostText-DG0bzcao.js";
10
+ import { a as te, i as ne, n as re, o as ie, r as ae, t as oe } from "./licensing-CwzqhHH9.js";
11
+ import { t as se } from "./useKeyboardNav-iEXOdEMB.js";
12
+ import { t as ce } from "./useInteractionEffect-DtpbVd77.js";
13
+ import { t as le } from "./useReveal-BJ59usiL.js";
14
14
  export { W as addMonths, V as addYears, j as adjustCursorAfterFormat, D as capitalizeWords, e as cn, m as composeValidators, S as creditCardBrands, z as daysInMonth, b as detectCardBrand, P as firstDayOfMonth, Z as formatAbsoluteTime, x as formatCardNumber, k as formatCurrency, H as formatDate, C as formatIBAN, O as formatNIP, A as formatPhone, s as formatPostCode, J as formatRelativeTime, F as formatTime, X as getAutoUpdateInterval, G as getDayNames, oe as getMineralComponentLicense, re as getMineralComponentPlan, I as getMonthNames, o as getPostCodeRule, q as getRelativeTimeValue, L as isDateInRange, ae as isMineralProComponent, U as isSameDay, ne as mineralComponentLicenses, te as mineralProComponents, w as parseCurrencyToNumber, B as parseDate, K as parseRelativeThreshold, R as parseTime, t as postCodeCountries, g as postCodeRules, y as stripCardNumber, E as stripNonAlphanumeric, M as stripNonDigits, N as stripTime, Y as toDate, T as unformatIBAN, ie as useClickOutside, Q as useDebounce, $ as useDebouncedCallback, ee as useGhostText, ce as useInteractionEffect, se as useKeyboardNav, le as useReveal, v as validateCardNumber, c as validateEmail, n as validateIBAN, d as validateMaxLength, p as validateMinLength, r as validateNIP, l as validatePESEL, h as validatePattern, i as validatePhone, _ as validatePostCode, a as validateREGON, f as validateRange, u as validateRequired };
@@ -1,2 +1,2 @@
1
1
  var e={valid:!0};function t(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,``)}function n(e){let t=e.replace(/\D/g,``).slice(0,5);return t.length<=2?t:`${t.slice(0,2)}-${t.slice(2)}`}function r(e){let t=e.replace(/\D/g,``).slice(0,9);return t.length<=5?t:`${t.slice(0,5)}-${t.slice(5)}`}function i(e,t){return e.replace(/\D/g,``).slice(0,t)}function a(e){return t(e).slice(0,6).split(``).map((e,t)=>t===3?` ${e}`:e).join(``)}function o(e){let n=t(e).slice(0,7);return n.length<=3?n:`${n.slice(0,n.length-3)} ${n.slice(-3)}`}function s(e){let n=t(e).slice(0,6);return n.length<=4?n:`${n.slice(0,4)} ${n.slice(4)}`}var c={PL:{countryCode:`PL`,label:`Poland`,placeholder:`12-345`,example:`00-001`,inputMode:`numeric`,maxLength:6,regex:/^\d{2}-\d{3}$/,sanitize:e=>e.replace(/\D/g,``).slice(0,5),format:n,message:`Use the Polish format XX-XXX`},DE:{countryCode:`DE`,label:`Germany`,placeholder:`12345`,example:`10115`,inputMode:`numeric`,maxLength:5,regex:/^\d{5}$/,sanitize:e=>e.replace(/\D/g,``).slice(0,5),format:e=>i(e,5),message:`Use a 5-digit German postal code`},FR:{countryCode:`FR`,label:`France`,placeholder:`75001`,example:`75001`,inputMode:`numeric`,maxLength:5,regex:/^\d{5}$/,sanitize:e=>e.replace(/\D/g,``).slice(0,5),format:e=>i(e,5),message:`Use a 5-digit French postal code`},ES:{countryCode:`ES`,label:`Spain`,placeholder:`28013`,example:`28013`,inputMode:`numeric`,maxLength:5,regex:/^\d{5}$/,sanitize:e=>e.replace(/\D/g,``).slice(0,5),format:e=>i(e,5),message:`Use a 5-digit Spanish postal code`},IT:{countryCode:`IT`,label:`Italy`,placeholder:`00184`,example:`00184`,inputMode:`numeric`,maxLength:5,regex:/^\d{5}$/,sanitize:e=>e.replace(/\D/g,``).slice(0,5),format:e=>i(e,5),message:`Use a 5-digit Italian postal code`},US:{countryCode:`US`,label:`United States`,placeholder:`12345 or 12345-6789`,example:`10001`,inputMode:`numeric`,maxLength:10,regex:/^\d{5}(?:-\d{4})?$/,sanitize:e=>e.replace(/\D/g,``).slice(0,9),format:r,message:`Use ZIP or ZIP+4 format`},CA:{countryCode:`CA`,label:`Canada`,placeholder:`A1A 1A1`,example:`M5V 3L9`,inputMode:`text`,maxLength:7,regex:/^[A-Z]\d[A-Z] \d[A-Z]\d$/,sanitize:e=>t(e).slice(0,6),format:a,message:`Use the Canadian format A1A 1A1`},GB:{countryCode:`GB`,label:`United Kingdom`,placeholder:`SW1A 1AA`,example:`SW1A 1AA`,inputMode:`text`,maxLength:8,regex:/^[A-Z]{1,2}\d[A-Z\d]? \d[A-Z]{2}$/,sanitize:e=>t(e).slice(0,7),format:o,message:`Use a valid UK postcode`},NL:{countryCode:`NL`,label:`Netherlands`,placeholder:`1234 AB`,example:`1012 AB`,inputMode:`text`,maxLength:7,regex:/^\d{4} [A-Z]{2}$/,sanitize:e=>t(e).slice(0,6),format:s,message:`Use the Dutch format 1234 AB`}},l=Object.values(c).map(({countryCode:e,label:t})=>({value:e,label:t}));function u(e=`PL`){return c[e.toUpperCase()]??c.PL}function d(e,t=`PL`){let n=u(t);return n.format(n.sanitize(e))}function f(t,n=`PL`){if(!t)return e;let r=u(n),i=r.format(r.sanitize(t));return r.regex.test(i)?e:{valid:!1,error:r.message}}var p={valid:!0},m=e=>({valid:!1,error:e});function h(e){return e.trim().length>0?p:m(`This field is required`)}function g(e){return t=>t.length>=e?p:m(`Minimum ${e} characters`)}function _(e){return t=>t.length<=e?p:m(`Maximum ${e} characters`)}function v(e,t){return n=>e.test(n)?p:m(t??`Invalid format`)}function y(e,t){return n=>{let r=parseFloat(n);return isNaN(r)?m(`Must be a number`):e!==void 0&&r<e?m(`Minimum value is ${e}`):t!==void 0&&r>t?m(`Maximum value is ${t}`):p}}var b=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function x(e){return e?b.test(e)?p:m(`Invalid email address`):p}var S={PL:9,DE:10,US:10,GB:10,FR:9,CZ:9,SK:9};function C(e,t){if(!e)return p;let n=e.replace(/\D/g,``);if(n.length<7)return m(`Phone number too short`);if(n.length>15)return m(`Phone number too long`);if(t){let e=S[t.toUpperCase()];if(e&&n.length!==e)return m(`Phone number should have ${e} digits`)}return p}var w={AL:28,AD:24,AT:20,AZ:28,BH:22,BY:28,BE:16,BA:20,BR:29,BG:22,CR:22,HR:21,CY:28,CZ:24,DK:18,DO:28,EG:29,SV:28,EE:20,FO:18,FI:18,FR:27,GE:22,DE:22,GI:23,GR:27,GL:18,GT:28,HU:28,IS:26,IQ:23,IE:22,IL:23,IT:27,JO:30,KZ:20,XK:20,KW:30,LV:21,LB:28,LI:21,LT:20,LU:20,MT:31,MR:27,MU:30,MD:24,MC:27,ME:22,NL:18,MK:19,NO:15,PK:24,PS:29,PL:28,PT:25,QA:29,RO:24,LC:32,SM:27,SA:24,RS:22,SC:31,SK:24,SI:19,ES:24,SE:24,CH:21,TL:23,TN:24,TR:26,UA:29,AE:23,GB:22,VA:22,VG:24};function T(e){let t=0;for(let n=0;n<e.length;n++)t=(t*10+parseInt(e[n],10))%97;return t}function E(e){if(!e)return p;let t=e.replace(/\s/g,``).toUpperCase();if(t.length<2)return m(`IBAN too short`);let n=t.slice(0,2),r=w[n];return r?t.length===r?T((t.slice(4)+t.slice(0,4)).replace(/[A-Z]/g,e=>String(e.charCodeAt(0)-55)))===1?p:m(`Invalid IBAN checksum`):m(`IBAN for ${n} should have ${r} characters`):m(`Unknown IBAN country code`)}var D=[6,5,7,2,3,4,5,6,7];function O(e){if(!e)return p;let t=e.replace(/\D/g,``);if(t.length!==10)return m(`NIP must have 10 digits`);let n=0;for(let e=0;e<9;e++)n+=parseInt(t[e],10)*D[e];let r=n%11;return r===10?m(`Invalid NIP`):r===parseInt(t[9],10)?p:m(`Invalid NIP checksum`)}var k=[1,3,7,9,1,3,7,9,1,3];function A(e){if(!e)return p;let t=e.replace(/\D/g,``);if(t.length!==11)return m(`PESEL must have 11 digits`);let n=0;for(let e=0;e<10;e++)n+=parseInt(t[e],10)*k[e];return(10-n%10)%10===parseInt(t[10],10)?p:m(`Invalid PESEL checksum`)}var j=[8,9,2,3,4,5,6,7],M=[2,4,8,5,0,9,7,3,6,1,2,4,8];function N(e){if(!e)return p;let t=e.replace(/\D/g,``);if(t.length!==9&&t.length!==14)return m(`REGON must have 9 or 14 digits`);let n=t.length===9?j:M,r=0;for(let e=0;e<n.length;e++)r+=parseInt(t[e],10)*n[e];return(r%11==10?0:r%11)===parseInt(t[t.length-1],10)?p:m(`Invalid REGON checksum`)}function P(...e){return t=>{for(let n of e){let e=n(t);if(!e.valid)return e}return p}}function F(e,t=`DD/MM/YYYY`){let n=e.replace(/\D/g,``);if(n.length!==8)return null;let r,i,a;if(t===`DD/MM/YYYY`?(r=parseInt(n.slice(0,2),10),i=parseInt(n.slice(2,4),10),a=parseInt(n.slice(4,8),10)):t===`MM/DD/YYYY`?(i=parseInt(n.slice(0,2),10),r=parseInt(n.slice(2,4),10),a=parseInt(n.slice(4,8),10)):(a=parseInt(n.slice(0,4),10),i=parseInt(n.slice(4,6),10),r=parseInt(n.slice(6,8),10)),i<1||i>12||r<1||r>31||a<1)return null;let o=new Date(a,i-1,r);return o.getFullYear()!==a||o.getMonth()!==i-1||o.getDate()!==r?null:o}function I(e,t={}){if(!e)return p;let{format:n=`DD/MM/YYYY`,minDate:r,maxDate:i}=t;if(e.replace(/\D/g,``).length!==8)return m(`Incomplete date`);let a=F(e,n);return a?r&&a<new Date(r.getFullYear(),r.getMonth(),r.getDate())?m(`Date is too early`):i&&a>new Date(i.getFullYear(),i.getMonth(),i.getDate())?m(`Date is too far in the future`):p:m(`Invalid date`)}Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return f}});
2
- //# sourceMappingURL=validators-CyDTl6cC.cjs.map
2
+ //# sourceMappingURL=validators-BeNTD8mf.cjs.map