maz-ui 4.0.0-beta.8 → 4.0.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 (384) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/{MazAnimatedCounter.DkZNPRLp.css → MazAnimatedCounter.LK7oyUrl.css} +1 -1
  3. package/dist/assets/MazAnimatedText.CHvAudRU.css +1 -0
  4. package/dist/assets/MazBackdrop.09bziTPM.css +1 -0
  5. package/dist/assets/{MazBadge.DN8tdE8_.css → MazBadge.ChI2DaTU.css} +1 -1
  6. package/dist/assets/MazBtn.BvC8ftmc.css +1 -0
  7. package/dist/assets/MazCard.Dv02b2P6.css +1 -0
  8. package/dist/assets/MazCardSpotlight.B7lFD7Pi.css +1 -0
  9. package/dist/assets/MazCarousel.BLHpZIu5.css +1 -0
  10. package/dist/assets/MazCheckbox.Di88TJ3e.css +1 -0
  11. package/dist/assets/MazChecklist.Bu8wERn6.css +1 -0
  12. package/dist/assets/MazDatePicker.G6V7jjin.css +1 -0
  13. package/dist/assets/{MazDialog.DEmRfAv7.css → MazDialog.TS06kRcu.css} +1 -1
  14. package/dist/assets/MazDropdown.D90GEKDB.css +1 -0
  15. package/dist/assets/MazDropzone._2HwHowu.css +1 -0
  16. package/dist/assets/MazGallery.BTNB3D6k.css +1 -0
  17. package/dist/assets/MazInput.BvuxfP9k.css +1 -0
  18. package/dist/assets/MazInputCode.BYi64Mof.css +1 -0
  19. package/dist/assets/MazInputPhoneNumber.Baeyskod.css +1 -0
  20. package/dist/assets/MazInputTags.is2jSJk-.css +1 -0
  21. package/dist/assets/MazLazyImg.DO7a4PDm.css +1 -0
  22. package/dist/assets/MazLink.CFscNMFr.css +1 -0
  23. package/dist/assets/{MazPagination.C6cUh-p4.css → MazPagination.BUhf2Qr7.css} +1 -1
  24. package/dist/assets/MazPickerCalendar.e-eF8E7m.css +1 -0
  25. package/dist/assets/MazPickerCalendarMonth.DpijYq-O.css +1 -0
  26. package/dist/assets/{MazPickerCalendarSwitcher.uni8vJJv.css → MazPickerCalendarSwitcher.ByAVjy00.css} +1 -1
  27. package/dist/assets/{MazPickerContainer.k3DGjyHC.css → MazPickerContainer.DmHuaFqE.css} +1 -1
  28. package/dist/assets/{MazPickerHeader.ZYCJY5bX.css → MazPickerHeader.D7JXgA3q.css} +1 -1
  29. package/dist/assets/MazPickerMonthSwitcher.BJGGy53r.css +1 -0
  30. package/dist/assets/{MazPickerYearSwitcher.Cn-nS-Vv.css → MazPickerYearSwitcher.DPD1_dfz.css} +1 -1
  31. package/dist/assets/MazPopover.DIE65uVT.css +1 -0
  32. package/dist/assets/MazPullToRefresh.C0HGlupm.css +1 -0
  33. package/dist/assets/MazRadio.B0B3P1QS.css +1 -0
  34. package/dist/assets/MazRadioButtons.CfiHq8H9.css +1 -0
  35. package/dist/assets/MazReadingProgressBar.dzfwQFNg.css +1 -0
  36. package/dist/assets/MazSelect.DIwjMD31.css +1 -0
  37. package/dist/assets/{MazSelectCountry.CdNTQPhr.css → MazSelectCountry.B0tlbfgr.css} +1 -1
  38. package/dist/assets/MazSlider.WcnBC9zc.css +1 -0
  39. package/dist/assets/MazSpinner.CsiFJ1DS.css +1 -0
  40. package/dist/assets/MazStepper.C9R7g43I.css +1 -0
  41. package/dist/assets/MazSwitch.LCcK91L7.css +1 -0
  42. package/dist/assets/MazTable.Cq7FEz09.css +1 -0
  43. package/dist/assets/MazTableRow.C0Ko4yDk.css +1 -0
  44. package/dist/assets/{MazTabsBar.gcS2Fc-B.css → MazTabsBar.BRr1XiYu.css} +1 -1
  45. package/dist/assets/{MazTabsContentItem.CHfy19ZF.css → MazTabsContentItem.C84SDmj0.css} +1 -1
  46. package/dist/assets/MazTextarea.C9sZpRDZ.css +1 -0
  47. package/dist/assets/{PhoneInput.DBLH22G1.css → PhoneInput.DkOXlrI9.css} +1 -1
  48. package/dist/assets/{fullscreen-img.Bkuz1GOX.css → fullscreen-img.Br983fLC.css} +1 -1
  49. package/dist/assets/{toast.CC2VQab8.css → toast.BDNNJSjj.css} +1 -1
  50. package/dist/chunks/{MazDatePicker.De3Ltb2F.js → MazDatePicker.B1B6gUrC.js} +49 -37
  51. package/dist/chunks/{MazDialogConfirm.vue_vue_type_script_setup_true_lang.-K3NpiFL.js → MazDialogConfirm.vue_vue_type_script_setup_true_lang.DuEcluOw.js} +23 -13
  52. package/dist/chunks/{MazDropdown.vue_vue_type_style_index_0_lang.BES3jpuw.js → MazDropdown.vue_vue_type_style_index_0_lang.DULnKQ2W.js} +16 -10
  53. package/dist/chunks/{MazInputNumber.vue_vue_type_style_index_0_lang.B6DYpHfi.js → MazInputNumber.vue_vue_type_style_index_0_lang.B0D4Zzds.js} +2 -2
  54. package/dist/chunks/{MazInputPhoneNumber.DBncAmC5.js → MazInputPhoneNumber.CDy6n_Qj.js} +25 -17
  55. package/dist/chunks/{MazInputPrice.vue_vue_type_script_setup_true_lang.BA6TDX-T.js → MazInputPrice.vue_vue_type_script_setup_true_lang.3pKYuG8H.js} +18 -18
  56. package/dist/chunks/{MazPickerCalendar.DKXNI8O4.js → MazPickerCalendar.BSBQciuG.js} +8 -8
  57. package/dist/chunks/{MazPickerCalendarMonth.DKBqgrNp.js → MazPickerCalendarMonth.CFJHTFp5.js} +14 -14
  58. package/dist/chunks/{MazPickerCalendarSwitcher.CzIZol3Z.js → MazPickerCalendarSwitcher.DC21FpTy.js} +10 -10
  59. package/dist/chunks/{MazPickerContainer.Mrh-Q52I.js → MazPickerContainer.CRPzAbRt.js} +4 -6
  60. package/dist/chunks/{MazPickerHeader.Bm9vIrtB.js → MazPickerHeader.D7Tbm-yH.js} +14 -14
  61. package/dist/chunks/{MazPickerMonthSwitcher.BSD2GtY6.js → MazPickerMonthSwitcher.DzHOKbe4.js} +10 -10
  62. package/dist/chunks/{MazPickerTime.D0hilq5b.js → MazPickerTime.EZK1foEx.js} +1 -1
  63. package/dist/chunks/{MazPickerYearSwitcher.BIUYJMvj.js → MazPickerYearSwitcher.BcT8GENl.js} +4 -4
  64. package/dist/chunks/{MazSwitch.vue_vue_type_style_index_0_lang.CU43Y1ky.js → MazSwitch.vue_vue_type_style_index_0_lang.Dz7-dIc9.js} +1 -1
  65. package/dist/chunks/{MazTable.vue_vue_type_script_setup_true_lang.BcTw9Tyh.js → MazTable.vue_vue_type_script_setup_true_lang.Ct1Gtp2Q.js} +5 -5
  66. package/dist/chunks/{MazTabsContent.vue_vue_type_script_setup_true_lang.arGqYTL5.js → MazTabsContent.vue_vue_type_script_setup_true_lang.hIwO-24k.js} +2 -2
  67. package/dist/chunks/{PhoneInput.iFkRoIFk.js → PhoneInput.DukRZp5u.js} +20 -27
  68. package/dist/chunks/capitalize.CVQ1jDrh.js +6 -0
  69. package/dist/chunks/checkAvailability.UFZSC8-1.js +16 -0
  70. package/dist/chunks/debounce.DhXdop6X.js +11 -0
  71. package/dist/chunks/{dom-events.Bbe7wDQl.js → dom-events.H9KIOv83.js} +52 -52
  72. package/dist/chunks/{fullscreen-img.directive.Be383en8.js → fullscreen-img.directive.D9oQ3Gni.js} +4 -4
  73. package/dist/chunks/{isClient.WI4oSt66.js → isClient.8V3qjGdO.js} +2 -2
  74. package/dist/chunks/{mazUi.D6UdqpTO.js → mazUi.0b7z2u9g.js} +2 -2
  75. package/dist/chunks/{obsidian.Cy0R8RHy.js → obsidian.C6upWOVF.js} +2 -2
  76. package/dist/chunks/{ocean.pHrY5H_S.js → ocean.ehMlC0HV.js} +2 -2
  77. package/dist/chunks/pascalCase.BKTE3qqE.js +19 -0
  78. package/dist/chunks/{pristine.ylgbwjxO.js → pristine.DMG3eBuN.js} +6 -6
  79. package/dist/chunks/sleep.Ci7GE4BQ.js +6 -0
  80. package/dist/chunks/truthyFilter.DZvXmxeK.js +6 -0
  81. package/dist/chunks/types.D0Bp_UhS.js +6 -0
  82. package/dist/chunks/{useStringMatching.D5UvsCUS.js → useStringMatching.DzSigyZ7.js} +40 -14
  83. package/dist/chunks/{vClickOutside.DIOiluy0.js → vClickOutside.CJBKY5no.js} +6 -6
  84. package/dist/components/MazAccordion.vue.d.ts +36 -0
  85. package/dist/components/MazAnimatedCounter.js +5 -5
  86. package/dist/components/MazAnimatedCounter.vue.d.ts +59 -0
  87. package/dist/components/MazAnimatedElement.vue.d.ts +44 -0
  88. package/dist/components/MazAnimatedText.js +4 -4
  89. package/dist/components/MazAnimatedText.vue.d.ts +57 -0
  90. package/dist/components/MazAvatar.vue.d.ts +99 -0
  91. package/dist/components/MazBackdrop.js +70 -31
  92. package/dist/components/MazBackdrop.vue.d.ts +91 -0
  93. package/dist/components/MazBadge.js +5 -4
  94. package/dist/components/MazBadge.vue.d.ts +61 -0
  95. package/dist/components/MazBottomSheet.vue.d.ts +35 -0
  96. package/dist/components/MazBtn.js +6 -5
  97. package/dist/components/MazBtn.vue.d.ts +105 -0
  98. package/dist/components/MazCard.js +3 -3
  99. package/dist/components/MazCard.vue.d.ts +77 -0
  100. package/dist/components/MazCardSpotlight.js +2 -2
  101. package/dist/components/MazCardSpotlight.vue.d.ts +57 -0
  102. package/dist/components/MazCarousel.js +12 -9
  103. package/dist/components/MazCarousel.vue.d.ts +48 -0
  104. package/dist/components/MazChart.vue.d.ts +53 -0
  105. package/dist/components/MazCheckbox.js +2 -2
  106. package/dist/components/MazCheckbox.vue.d.ts +55 -0
  107. package/dist/components/MazChecklist.js +7 -7
  108. package/dist/components/MazChecklist.vue.d.ts +87 -0
  109. package/dist/components/MazCircularProgressBar.vue.d.ts +106 -0
  110. package/dist/components/MazDatePicker/MazPickerCalendar.vue.d.ts +27 -0
  111. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.vue.d.ts +20 -0
  112. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.vue.d.ts +125 -0
  113. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.vue.d.ts +134 -0
  114. package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.vue.d.ts +42 -0
  115. package/dist/components/MazDatePicker/MazPickerContainer.vue.d.ts +38 -0
  116. package/dist/components/MazDatePicker/MazPickerHeader.vue.d.ts +15 -0
  117. package/dist/components/MazDatePicker/MazPickerMonthSwitcher.vue.d.ts +44 -0
  118. package/dist/components/MazDatePicker/MazPickerShortcuts.vue.d.ts +16 -0
  119. package/dist/components/MazDatePicker/MazPickerTime.vue.d.ts +107 -0
  120. package/dist/components/MazDatePicker/MazPickerYearSwitcher.vue.d.ts +36 -0
  121. package/dist/components/MazDatePicker/types.d.ts +14 -0
  122. package/dist/components/MazDatePicker/utils.d.ts +61 -0
  123. package/dist/components/MazDatePicker.js +1 -1
  124. package/dist/components/MazDatePicker.vue.d.ts +547 -0
  125. package/dist/components/MazDialog.js +9 -16
  126. package/dist/components/MazDialog.vue.d.ts +247 -0
  127. package/dist/components/MazDialogConfirm/useMazDialogConfirm.d.ts +47 -0
  128. package/dist/components/MazDialogConfirm.js +2 -2
  129. package/dist/components/MazDialogConfirm.vue.d.ts +270 -0
  130. package/dist/components/MazDrawer.vue.d.ts +52 -0
  131. package/dist/components/MazDropdown.js +1 -1
  132. package/dist/components/MazDropdown.vue.d.ts +249 -0
  133. package/dist/components/MazDropzone.js +6 -6
  134. package/dist/components/MazDropzone.vue.d.ts +305 -0
  135. package/dist/components/MazExpandAnimation.vue.d.ts +44 -0
  136. package/dist/components/MazFullscreenLoader.vue.d.ts +26 -0
  137. package/dist/components/MazGallery.js +4 -4
  138. package/dist/components/MazGallery.vue.d.ts +85 -0
  139. package/dist/components/MazIcon.vue.d.ts +26 -0
  140. package/dist/components/MazInput.js +4 -4
  141. package/dist/components/MazInput.vue.d.ts +225 -0
  142. package/dist/components/MazInputCode.js +2 -2
  143. package/dist/components/MazInputCode.vue.d.ts +49 -0
  144. package/dist/components/MazInputNumber.js +1 -1
  145. package/dist/components/MazInputNumber.vue.d.ts +125 -0
  146. package/dist/components/MazInputPhoneNumber/PhoneInput.vue.d.ts +29 -0
  147. package/dist/components/MazInputPhoneNumber/useLibphonenumber.d.ts +26 -0
  148. package/dist/components/MazInputPhoneNumber/useMazInputPhoneNumber.d.ts +26 -0
  149. package/dist/components/MazInputPhoneNumber.js +1 -1
  150. package/dist/components/MazInputPhoneNumber.vue.d.ts +421 -0
  151. package/dist/components/MazInputPrice.js +1 -1
  152. package/dist/components/MazInputPrice.vue.d.ts +48 -0
  153. package/dist/components/MazInputTags.js +6 -6
  154. package/dist/components/MazInputTags.vue.d.ts +51 -0
  155. package/dist/components/MazLazyImg.js +2 -2
  156. package/dist/components/MazLazyImg.vue.d.ts +78 -0
  157. package/dist/components/MazLink.js +2 -2
  158. package/dist/components/MazLink.vue.d.ts +115 -0
  159. package/dist/components/MazLoadingBar.vue.d.ts +12 -0
  160. package/dist/components/MazPagination.js +3 -3
  161. package/dist/components/MazPagination.vue.d.ts +83 -0
  162. package/dist/components/MazPopover.js +98 -222
  163. package/dist/components/MazPopover.vue.d.ts +256 -0
  164. package/dist/components/MazPullToRefresh.js +7 -7
  165. package/dist/components/MazPullToRefresh.vue.d.ts +52 -0
  166. package/dist/components/MazRadio.js +2 -2
  167. package/dist/components/MazRadio.vue.d.ts +55 -0
  168. package/dist/components/MazRadioButtons.js +8 -7
  169. package/dist/components/MazRadioButtons.vue.d.ts +69 -0
  170. package/dist/components/MazReadingProgressBar.js +8 -8
  171. package/dist/components/MazReadingProgressBar.vue.d.ts +55 -0
  172. package/dist/components/MazSelect.js +17 -14
  173. package/dist/components/MazSelect.vue.d.ts +178 -0
  174. package/dist/components/MazSelectCountry.js +19 -18
  175. package/dist/components/MazSelectCountry.vue.d.ts +171 -0
  176. package/dist/components/MazSlider/utils.d.ts +15 -0
  177. package/dist/components/MazSlider.js +36 -36
  178. package/dist/components/MazSlider.vue.d.ts +31 -0
  179. package/dist/components/MazSpinner.js +3 -4
  180. package/dist/components/MazSpinner.vue.d.ts +15 -0
  181. package/dist/components/MazStepper.js +2 -2
  182. package/dist/components/MazStepper.vue.d.ts +60 -0
  183. package/dist/components/MazSwitch.js +1 -1
  184. package/dist/components/MazSwitch.vue.d.ts +69 -0
  185. package/dist/components/MazTable.js +3 -3
  186. package/dist/components/MazTable.vue.d.ts +324 -0
  187. package/dist/components/MazTableCell.js +1 -1
  188. package/dist/components/MazTableCell.vue.d.ts +17 -0
  189. package/dist/components/MazTableRow.js +6 -5
  190. package/dist/components/MazTableRow.vue.d.ts +23 -0
  191. package/dist/components/MazTableTitle.js +1 -1
  192. package/dist/components/MazTableTitle.vue.d.ts +17 -0
  193. package/dist/components/MazTabs.vue.d.ts +30 -0
  194. package/dist/components/MazTabsBar.js +4 -4
  195. package/dist/components/MazTabsBar.vue.d.ts +96 -0
  196. package/dist/components/MazTabsContent.js +1 -1
  197. package/dist/components/MazTabsContent.vue.d.ts +17 -0
  198. package/dist/components/MazTabsContentItem.js +6 -7
  199. package/dist/components/MazTabsContentItem.vue.d.ts +31 -0
  200. package/dist/components/MazTextarea.js +6 -6
  201. package/dist/components/MazTextarea.vue.d.ts +88 -0
  202. package/dist/components/constantes.d.ts +2 -0
  203. package/dist/components/index.d.ts +109 -0
  204. package/dist/components/index.js +8 -8
  205. package/dist/components/types.d.ts +4 -0
  206. package/dist/composables/index.d.ts +21 -0
  207. package/dist/composables/index.js +3 -1
  208. package/dist/composables/useAos.d.ts +2 -0
  209. package/dist/composables/useBreakpoints.d.ts +38 -0
  210. package/dist/composables/useDialog.d.ts +2 -0
  211. package/dist/composables/useDisplayNames.d.ts +101 -0
  212. package/dist/composables/useDisplayNames.js +20 -28
  213. package/dist/composables/useDropzone.d.ts +27 -0
  214. package/dist/composables/useDropzone.js +6 -6
  215. package/dist/composables/useFormField.d.ts +16 -0
  216. package/dist/composables/useFormField.js +3 -3
  217. package/dist/composables/useFormValidator/config.d.ts +7 -0
  218. package/dist/composables/useFormValidator/dom-events.d.ts +19 -0
  219. package/dist/composables/useFormValidator/state-management.d.ts +72 -0
  220. package/dist/composables/useFormValidator/types.d.ts +98 -0
  221. package/dist/composables/useFormValidator/validation.d.ts +37 -0
  222. package/dist/composables/useFormValidator.d.ts +23 -0
  223. package/dist/composables/useFormValidator.js +19 -3
  224. package/dist/composables/useFreezeValue.d.ts +5 -0
  225. package/dist/composables/useIdleTimeout.d.ts +5 -0
  226. package/dist/composables/useIdleTimeout.js +27 -27
  227. package/dist/composables/useInjectStrict.d.ts +2 -0
  228. package/dist/composables/useInstanceUniqId.d.ts +4 -0
  229. package/dist/composables/useInstanceUniqId.js +3 -2
  230. package/dist/composables/useMountComponent.d.ts +14 -0
  231. package/dist/composables/useReadingTime.d.ts +25 -0
  232. package/dist/composables/useStringMatching.d.ts +5 -0
  233. package/dist/composables/useStringMatching.js +1 -1
  234. package/dist/composables/useSwipe.d.ts +14 -0
  235. package/dist/composables/useSwipe.js +22 -22
  236. package/dist/composables/useTimer.d.ts +30 -0
  237. package/dist/composables/useToast.d.ts +22 -0
  238. package/dist/composables/useUserVisibility.d.ts +5 -0
  239. package/dist/composables/useUserVisibility.js +8 -8
  240. package/dist/composables/useWait.d.ts +2 -0
  241. package/dist/composables/useWindowSize.d.ts +32 -0
  242. package/dist/composables/useWindowSize.js +2 -2
  243. package/dist/css/main.css +1 -1
  244. package/dist/directives/index.d.ts +5 -0
  245. package/dist/directives/index.js +2 -2
  246. package/dist/directives/vClickOutside.d.ts +36 -0
  247. package/dist/directives/vClickOutside.js +1 -1
  248. package/dist/directives/vFullscreenImg/MazFullscreenImg.vue.d.ts +50 -0
  249. package/dist/directives/vFullscreenImg/fullscreen-img.directive.d.ts +5 -0
  250. package/dist/directives/vFullscreenImg/fullscreen-img.handler.d.ts +36 -0
  251. package/dist/directives/vFullscreenImg.d.ts +11 -0
  252. package/dist/directives/vFullscreenImg.js +1 -1
  253. package/dist/directives/vLazyImg/lazy-img.directive.d.ts +5 -0
  254. package/dist/directives/vLazyImg/lazy-img.handler.d.ts +38 -0
  255. package/dist/directives/vLazyImg/types.d.ts +29 -0
  256. package/dist/directives/vLazyImg.d.ts +12 -0
  257. package/dist/directives/vTooltip.d.ts +54 -0
  258. package/dist/directives/vTooltip.js +15 -23
  259. package/dist/directives/vZoomImg/style.d.ts +1 -0
  260. package/dist/directives/vZoomImg/svgs.d.ts +3 -0
  261. package/dist/directives/vZoomImg/zoom-img.directive.d.ts +8 -0
  262. package/dist/directives/vZoomImg/zoom-img.handler.d.ts +46 -0
  263. package/dist/directives/vZoomImg.d.ts +10 -0
  264. package/dist/index.d.ts +1 -0
  265. package/dist/plugins/aos.d.ts +81 -0
  266. package/dist/plugins/aos.js +5 -5
  267. package/dist/plugins/dialog/DialogHandler.d.ts +16 -0
  268. package/dist/plugins/dialog.d.ts +26 -0
  269. package/dist/plugins/dialog.js +1 -1
  270. package/dist/plugins/index.d.ts +5 -0
  271. package/dist/plugins/maz-ui.d.ts +43 -0
  272. package/dist/plugins/maz-ui.js +245 -371
  273. package/dist/plugins/toast/MazToast.vue.d.ts +34 -0
  274. package/dist/plugins/toast/ToastHandler.d.ts +29 -0
  275. package/dist/plugins/toast/types.d.ts +104 -0
  276. package/dist/plugins/toast.d.ts +25 -0
  277. package/dist/plugins/toast.js +8 -6
  278. package/dist/plugins/wait.d.ts +33 -0
  279. package/dist/resolvers/MazComponentsResolver.d.ts +10 -0
  280. package/dist/resolvers/MazComponentsResolver.js +516 -10
  281. package/dist/resolvers/MazDirectivesResolver.d.ts +11 -0
  282. package/dist/resolvers/MazDirectivesResolver.js +2 -2
  283. package/dist/resolvers/MazModulesResolver.d.ts +11 -0
  284. package/dist/resolvers/MazModulesResolver.js +8 -5
  285. package/dist/resolvers/index.d.ts +3 -0
  286. package/dist/tailwindcss/index.d.ts +6 -0
  287. package/dist/tailwindcss/tailwind.config.d.ts +89 -0
  288. package/dist/tailwindcss/utils/colors.d.ts +7 -0
  289. package/dist/tailwindcss/variables/breakpoints.d.ts +15 -0
  290. package/dist/tailwindcss/variables/colors.d.ts +20 -0
  291. package/dist/tailwindcss/variables/design-tokens.d.ts +35 -0
  292. package/dist/tailwindcss/variables/utilities.d.ts +17 -0
  293. package/dist/tailwindcss/variables/z-indexes.d.ts +14 -0
  294. package/dist/types/components/MazAnimatedCounter.vue.d.ts +1 -1
  295. package/dist/types/components/MazBackdrop.vue.d.ts +26 -6
  296. package/dist/types/components/MazCard.vue.d.ts +1 -1
  297. package/dist/types/components/MazCarousel.vue.d.ts +8 -5
  298. package/dist/types/components/MazChecklist.vue.d.ts +5 -5
  299. package/dist/types/components/MazDatePicker/utils.d.ts +7 -6
  300. package/dist/types/components/MazDatePicker.vue.d.ts +37 -33
  301. package/dist/types/components/MazDialog.vue.d.ts +10 -19
  302. package/dist/types/components/MazDialogConfirm/useMazDialogConfirm.d.ts +8 -6
  303. package/dist/types/components/MazDialogConfirm.vue.d.ts +18 -12
  304. package/dist/types/components/MazDropdown.vue.d.ts +10 -3
  305. package/dist/types/components/MazInputNumber.vue.d.ts +4 -4
  306. package/dist/types/components/MazInputPhoneNumber/PhoneInput.vue.d.ts +1 -1
  307. package/dist/types/components/MazInputPhoneNumber/useLibphonenumber.d.ts +1 -1
  308. package/dist/types/components/MazInputPhoneNumber/useMazInputPhoneNumber.d.ts +2 -0
  309. package/dist/types/components/MazInputPhoneNumber.vue.d.ts +11 -12
  310. package/dist/types/components/MazInputPrice.vue.d.ts +3 -3
  311. package/dist/types/components/MazInputTags.vue.d.ts +1 -1
  312. package/dist/types/components/MazLink.vue.d.ts +1 -1
  313. package/dist/types/components/MazPopover.vue.d.ts +13 -8
  314. package/dist/types/components/MazRadioButtons.vue.d.ts +9 -9
  315. package/dist/types/components/MazReadingProgressBar.vue.d.ts +1 -1
  316. package/dist/types/components/MazSelect.vue.d.ts +13 -6
  317. package/dist/types/components/MazSelectCountry.vue.d.ts +9 -9
  318. package/dist/types/components/MazTable.vue.d.ts +5 -5
  319. package/dist/types/components/MazTableRow.vue.d.ts +2 -0
  320. package/dist/types/components/types.d.ts +1 -0
  321. package/dist/types/composables/index.d.ts +1 -0
  322. package/dist/types/composables/useDisplayNames.d.ts +60 -6
  323. package/dist/types/composables/useFormField.d.ts +16 -18
  324. package/dist/types/composables/useFormValidator/config.d.ts +2 -2
  325. package/dist/types/composables/useFormValidator/dom-events.d.ts +4 -4
  326. package/dist/types/composables/useFormValidator/state-management.d.ts +40 -22
  327. package/dist/types/composables/useFormValidator/types.d.ts +15 -15
  328. package/dist/types/composables/useFormValidator/validation.d.ts +10 -16
  329. package/dist/types/composables/useFormValidator.d.ts +2 -2
  330. package/dist/types/composables/useIdleTimeout.d.ts +1 -1
  331. package/dist/types/composables/useSwipe.d.ts +1 -1
  332. package/dist/types/composables/useUserVisibility.d.ts +1 -1
  333. package/dist/types/directives/vFullscreenImg/MazFullscreenImg.vue.d.ts +2 -2
  334. package/dist/types/directives/vZoomImg.d.ts +1 -1
  335. package/dist/types/plugins/maz-ui.d.ts +5 -5
  336. package/package.json +46 -36
  337. package/dist/assets/MazAnimatedText.DDqCxrFX.css +0 -1
  338. package/dist/assets/MazBackdrop.BnhcmjbP.css +0 -1
  339. package/dist/assets/MazBtn.DUBbj2mt.css +0 -1
  340. package/dist/assets/MazCard.C6nDaeIC.css +0 -1
  341. package/dist/assets/MazCardSpotlight.IbPp_y0j.css +0 -1
  342. package/dist/assets/MazCarousel.BaqN4hLP.css +0 -1
  343. package/dist/assets/MazCheckbox.CFqw9ybT.css +0 -1
  344. package/dist/assets/MazChecklist.BzF5KtZ3.css +0 -1
  345. package/dist/assets/MazDatePicker.8GyrtM-j.css +0 -1
  346. package/dist/assets/MazDropdown.C6vjLIeN.css +0 -1
  347. package/dist/assets/MazDropzone.-8lzCrxJ.css +0 -1
  348. package/dist/assets/MazGallery.DZ3TyggM.css +0 -1
  349. package/dist/assets/MazInput.BcUsJg7p.css +0 -1
  350. package/dist/assets/MazInputCode.CG6EJBEk.css +0 -1
  351. package/dist/assets/MazInputPhoneNumber.CrXS7DOY.css +0 -1
  352. package/dist/assets/MazInputTags.DzTGy9z3.css +0 -1
  353. package/dist/assets/MazLazyImg.NlPRN3Nk.css +0 -1
  354. package/dist/assets/MazLink.wJoKRsCP.css +0 -1
  355. package/dist/assets/MazPickerCalendar.CHpWIzhL.css +0 -1
  356. package/dist/assets/MazPickerCalendarMonth.Boe_8k4x.css +0 -1
  357. package/dist/assets/MazPickerMonthSwitcher.CszcpCcY.css +0 -1
  358. package/dist/assets/MazPopover.DzCAfuWw.css +0 -1
  359. package/dist/assets/MazPullToRefresh.BQ64UvzA.css +0 -1
  360. package/dist/assets/MazRadio.XGYnbTuB.css +0 -1
  361. package/dist/assets/MazRadioButtons.BA4rjgK9.css +0 -1
  362. package/dist/assets/MazReadingProgressBar.CwBVXE3g.css +0 -1
  363. package/dist/assets/MazSelect.Cljh3PVV.css +0 -1
  364. package/dist/assets/MazSlider.y4qpnD0N.css +0 -1
  365. package/dist/assets/MazSpinner.CP85N7RJ.css +0 -1
  366. package/dist/assets/MazStepper.DtWZmm-f.css +0 -1
  367. package/dist/assets/MazSwitch.Bxmh2iFj.css +0 -1
  368. package/dist/assets/MazTable.DMlQdImb.css +0 -1
  369. package/dist/assets/MazTableRow.B78Bd4Kv.css +0 -1
  370. package/dist/assets/MazTextarea.DME7BHS5.css +0 -1
  371. package/dist/chunks/capitalize.BF6CDS_4.js +0 -6
  372. package/dist/chunks/checkAvailability.aTpZidex.js +0 -16
  373. package/dist/chunks/de.B15Maq8Z.js +0 -82
  374. package/dist/chunks/debounce.Brzkn9pm.js +0 -11
  375. package/dist/chunks/en.Q_4-KljL.js +0 -157
  376. package/dist/chunks/es.BV1TlfTw.js +0 -82
  377. package/dist/chunks/fr.BVPG-7Dk.js +0 -82
  378. package/dist/chunks/it.Be9xhI4P.js +0 -82
  379. package/dist/chunks/ja.CWU7KYEA.js +0 -82
  380. package/dist/chunks/pt.CfaFSxVt.js +0 -82
  381. package/dist/chunks/sleep.BLRH1qZG.js +0 -6
  382. package/dist/chunks/truthyFilter.C2WOKUCG.js +0 -6
  383. package/dist/chunks/useTranslations.D5aoYwD7.js +0 -10
  384. package/dist/chunks/zh-CN.CCkuvk-E.js +0 -82
@@ -1,73 +1,59 @@
1
- import { reactive, ref } from "vue";
2
- function parseHSL(hsl) {
3
- const match = hsl.match(/^(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%$/);
4
- if (!match)
5
- throw new Error(`Invalid HSL format: ${hsl}`);
1
+ import { reactive } from "vue";
2
+ import { MazUiTranslations } from "@maz-ui/translations";
3
+ function l(n2) {
4
+ const t2 = n2.match(/^(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%$/);
5
+ if (!t2)
6
+ throw new Error(`Invalid HSL format: ${n2}`);
6
7
  return {
7
- h: Number.parseFloat(match[1]),
8
- s: Number.parseFloat(match[2]),
9
- l: Number.parseFloat(match[3])
8
+ h: Number.parseFloat(t2[1]),
9
+ s: Number.parseFloat(t2[2]),
10
+ l: Number.parseFloat(t2[3])
10
11
  };
11
12
  }
12
- function formatHSL(h, s, l) {
13
- const roundedH = Math.round(h * 10) / 10, roundedS = Math.round(s * 10) / 10, roundedL = Math.round(l * 10) / 10;
14
- return `${roundedH} ${roundedS}% ${roundedL}%`;
13
+ function i(n2, t2, r) {
14
+ const o2 = Math.round(n2 * 10) / 10, s = Math.round(t2 * 10) / 10, e = Math.round(r * 10) / 10;
15
+ return `${o2} ${s}% ${e}%`;
15
16
  }
16
- const LUMINOSITY_OFFSETS = {
17
- 50: 45,
18
- // Base + 45% = very light
19
- 100: 40,
20
- // Base + 40% = light
21
- 200: 30,
22
- // Base + 30% = moderately light
23
- 300: 20,
24
- // Base + 20% = light-medium
25
- 400: 10,
26
- // Base + 10% = slightly lighter
17
+ const d = {
18
+ 50: 37.5,
19
+ 100: 30,
20
+ 200: 22.5,
21
+ 300: 15,
22
+ 400: 7.5,
27
23
  500: 0,
28
- // Base (original color)
29
- 600: -10,
30
- // Base - 10% = slightly darker
31
- 700: -20,
32
- // Base - 20% = dark
33
- 800: -30,
34
- // Base - 30% = very dark
35
- 900: -40
36
- // Base - 40% = extremely dark
24
+ 600: -7.5,
25
+ 700: -15,
26
+ 800: -22.5,
27
+ 900: -30,
28
+ 950: -37.5
37
29
  };
38
- function calculateSaturationMultiplier(baseVariant, targetVariant, baseSaturation) {
39
- if (targetVariant === baseVariant)
30
+ function p$1(n2, t2, r) {
31
+ if (t2 === n2)
40
32
  return 1;
41
- const saturationFactor = Math.min(baseSaturation / 100, 1), variantDiff = Math.abs(targetVariant - baseVariant);
42
- if (targetVariant < baseVariant) {
43
- const reduction = variantDiff / 500 * 0.25 * saturationFactor;
44
- return Math.max(0.3, 1 - reduction);
33
+ const o2 = Math.min(r / 100, 1), s = Math.abs(t2 - n2);
34
+ if (t2 < n2) {
35
+ const e = s / 500 * 0.25 * o2;
36
+ return Math.max(0.3, 1 - e);
45
37
  } else {
46
- const increase = variantDiff / 400 * 0.15 * saturationFactor;
47
- return Math.min(1.3, 1 + increase);
38
+ const e = s / 400 * 0.15 * o2;
39
+ return Math.min(1.3, 1 + e);
48
40
  }
49
41
  }
50
- function generateColorScale(baseColor) {
51
- const { h, s, l } = parseHSL(baseColor), baseVariant = 500, baseLuminosity = l, variants = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900], scale = {};
52
- return variants.forEach((variant) => {
53
- if (variant === baseVariant)
54
- scale[variant.toString()] = formatHSL(h, s, l);
42
+ function b(n2) {
43
+ const { h: t2, s: r, l: o2 } = l(n2), s = 500, e = o2, m2 = Object.keys(d).map(Number), u2 = {};
44
+ return m2.forEach((c2) => {
45
+ if (c2 === s)
46
+ u2[c2] = i(t2, r, o2);
55
47
  else {
56
- const luminosityOffset = LUMINOSITY_OFFSETS[variant];
57
- let targetLuminosity = baseLuminosity + luminosityOffset;
58
- targetLuminosity = Math.min(95, Math.max(5, targetLuminosity));
59
- const saturationMultiplier = calculateSaturationMultiplier(baseVariant, variant, s), adjustedSaturation = Math.min(100, Math.max(5, s * saturationMultiplier));
60
- scale[variant.toString()] = formatHSL(h, adjustedSaturation, targetLuminosity);
48
+ const h2 = c2 < s, f2 = c2 > s, M2 = d[c2];
49
+ let a;
50
+ h2 && o2 >= 100 ? a = e : a = e + M2, f2 && o2 <= 0 && (a = 0), a = Math.min(100, Math.max(0, a));
51
+ const S2 = p$1(s, c2, r), L = Math.min(100, Math.max(5, r * S2));
52
+ u2[c2] = i(t2, L, a);
61
53
  }
62
- }), scale;
54
+ }), u2;
63
55
  }
64
- function getCookie(key) {
65
- if (typeof document > "u")
66
- return null;
67
- const cookie = document.cookie.split(";").find((c) => c.trim().startsWith(`${key}=`));
68
- return cookie ? decodeURIComponent(cookie.split("=")[1]) : null;
69
- }
70
- const DEFAULT_CRITICAL_COLORS = [
56
+ const h = [
71
57
  "background",
72
58
  "foreground",
73
59
  "primary",
@@ -89,382 +75,270 @@ const DEFAULT_CRITICAL_COLORS = [
89
75
  "muted",
90
76
  "shadow",
91
77
  "border"
92
- ], DEFAULT_CRITICAL_FOUNDATION = [
78
+ ], C = [
93
79
  "radius",
94
80
  "font-family",
95
81
  "base-font-size",
96
82
  "border-width"
97
- ], scaleColors = ["primary", "secondary", "accent", "destructive", "success", "warning", "info", "contrast", "background", "foreground", "border", "muted", "overlay", "shadow"];
98
- function generateCriticalCSS(preset, options = {}) {
83
+ ], S = ["primary", "secondary", "accent", "destructive", "success", "warning", "info", "contrast", "background", "foreground", "border", "muted", "overlay", "shadow"];
84
+ function j(e, o2 = {
85
+ mode: "both",
86
+ darkSelectorStrategy: "class"
87
+ }) {
99
88
  const {
100
- criticalColors = DEFAULT_CRITICAL_COLORS,
101
- criticalFoundation = DEFAULT_CRITICAL_FOUNDATION,
102
- mode = "both",
103
- darkSelectorStrategy = "class",
104
- prefix = "maz"
105
- } = options, lightCritical = extractCriticalVariables(preset.colors.light, criticalColors), darkCritical = extractCriticalVariables(preset.colors.dark, criticalColors), foundationCritical = extractCriticalFoundation(preset.foundation, criticalFoundation);
106
- let css = `@layer maz-ui-theme {
89
+ criticalColors: r = h,
90
+ criticalFoundation: c2 = C,
91
+ mode: t2,
92
+ darkSelectorStrategy: s,
93
+ prefix: i2 = "maz"
94
+ } = o2, l2 = y(e.foundation, c2);
95
+ let n2 = `@layer maz-ui-theme {
107
96
  `;
108
- return (mode === "light" || mode === "both") && (css += generateVariablesBlock({
109
- selector: ":root",
110
- colors: lightCritical,
111
- foundation: foundationCritical,
112
- prefix
113
- })), (mode === "dark" || mode === "both") && (css += generateVariablesBlock({
114
- selector: darkSelectorStrategy === "media" ? ":root" : ".dark",
115
- mediaQuery: darkSelectorStrategy === "media" ? "@media (prefers-color-scheme: dark)" : void 0,
116
- colors: darkCritical,
117
- foundation: foundationCritical,
118
- prefix
119
- })), css += `}
120
- `, css;
97
+ if (t2 === "light" || t2 === "both") {
98
+ const a = m(e.colors.light, r);
99
+ n2 += f$1({
100
+ selector: ":root",
101
+ colors: a,
102
+ foundation: l2,
103
+ prefix: i2
104
+ });
105
+ }
106
+ if (t2 === "dark" || t2 === "both") {
107
+ const a = m(e.colors.dark, r);
108
+ n2 += f$1({
109
+ selector: s === "media" ? ":root" : ".dark",
110
+ mediaQuery: s === "media" ? "@media (prefers-color-scheme: dark)" : void 0,
111
+ colors: a,
112
+ foundation: l2,
113
+ prefix: i2
114
+ });
115
+ }
116
+ return n2 += `}
117
+ `, n2;
121
118
  }
122
- function generateFullCSS(preset, options = {}) {
119
+ function p(e, o2 = {
120
+ mode: "both",
121
+ darkSelectorStrategy: "class"
122
+ }) {
123
123
  const {
124
- excludeCritical = DEFAULT_CRITICAL_COLORS,
125
- mode = "both",
126
- darkSelectorStrategy = "class",
127
- prefix = "maz",
128
- includeColorScales = !0
129
- } = options, lightColors = excludeVariables(preset.colors.light, excludeCritical), darkColors = excludeVariables(preset.colors.dark, excludeCritical), foundation = excludeFoundationVariables(preset.foundation, DEFAULT_CRITICAL_FOUNDATION);
130
- let css = `@layer maz-ui-theme {
124
+ excludeCritical: r = h,
125
+ mode: c2,
126
+ darkSelectorStrategy: t2,
127
+ prefix: s = "maz",
128
+ includeColorScales: i2 = !0
129
+ } = o2, l2 = k$1(e.foundation, C);
130
+ let n2 = `@layer maz-ui-theme {
131
131
  `;
132
- return (mode === "light" || mode === "both") && (css += generateVariablesBlock({
133
- selector: ":root",
134
- colors: lightColors,
135
- foundation,
136
- prefix,
137
- includeScales: includeColorScales,
138
- preset
139
- })), (mode === "dark" || mode === "both") && (css += generateVariablesBlock({
140
- selector: darkSelectorStrategy === "media" ? ":root" : ".dark",
141
- mediaQuery: darkSelectorStrategy === "media" ? "@media (prefers-color-scheme: dark)" : void 0,
142
- colors: darkColors,
143
- foundation: mode === "dark" ? foundation : void 0,
144
- // Appearance only if dark mode only
145
- prefix,
146
- includeScales: includeColorScales,
147
- preset,
148
- isDark: !0
149
- })), css += `}
150
- `, css;
132
+ if (c2 === "light" || c2 === "both") {
133
+ const a = g$1(e.colors.light, r);
134
+ n2 += f$1({
135
+ selector: ":root",
136
+ colors: a,
137
+ foundation: l2,
138
+ prefix: s,
139
+ includeScales: i2,
140
+ preset: e
141
+ });
142
+ }
143
+ if (c2 === "dark" || c2 === "both") {
144
+ const a = g$1(e.colors.dark, r);
145
+ n2 += f$1({
146
+ selector: t2 === "media" ? ":root" : ".dark",
147
+ mediaQuery: t2 === "media" ? "@media (prefers-color-scheme: dark)" : void 0,
148
+ colors: a,
149
+ foundation: c2 === "dark" ? l2 : void 0,
150
+ // Appearance only if dark mode only
151
+ prefix: s,
152
+ includeScales: i2,
153
+ preset: e,
154
+ isDark: !0
155
+ });
156
+ }
157
+ return n2 += `}
158
+ `, n2;
151
159
  }
152
- function extractCriticalVariables(colors, criticalKeys) {
160
+ function m(e, o2) {
153
161
  return Object.fromEntries(
154
- criticalKeys.filter((key) => colors[key]).map((key) => [key, colors[key]])
162
+ o2.filter((r) => e[r]).map((r) => [r, e[r]])
155
163
  );
156
164
  }
157
- function extractCriticalFoundation(foundation, criticalKeys) {
158
- return foundation ? Object.fromEntries(
159
- criticalKeys.filter((key) => foundation[key]).map((key) => [key, foundation[key]])
165
+ function y(e, o2) {
166
+ return e ? Object.fromEntries(
167
+ o2.filter((r) => e[r]).map((r) => [r, e[r]])
160
168
  ) : {};
161
169
  }
162
- function excludeVariables(colors, excludeKeys) {
170
+ function g$1(e, o2) {
163
171
  return Object.fromEntries(
164
- Object.entries(colors).filter(([key]) => !excludeKeys.includes(key))
172
+ Object.entries(e).filter(([r]) => !o2.includes(r))
165
173
  );
166
174
  }
167
- function excludeFoundationVariables(foundation, excludeKeys) {
168
- return foundation ? Object.fromEntries(
169
- Object.entries(foundation).filter(([key]) => !excludeKeys.includes(key))
175
+ function k$1(e, o2) {
176
+ return e ? Object.fromEntries(
177
+ Object.entries(e).filter(([r]) => !o2.includes(r))
170
178
  ) : {};
171
179
  }
172
- function generateVariablesBlock({
173
- selector,
174
- mediaQuery,
175
- colors,
176
- foundation,
177
- prefix,
178
- includeScales = !1,
179
- preset,
180
- isDark = !1
180
+ function f$1({
181
+ selector: e,
182
+ mediaQuery: o2,
183
+ colors: r,
184
+ foundation: c2,
185
+ prefix: t2,
186
+ includeScales: s = !1,
187
+ preset: i2,
188
+ isDark: l2 = !1
181
189
  }) {
182
- const variables = [];
183
- if (colors && Object.entries(colors).forEach(([key, value]) => {
184
- value && variables.push(` --${prefix}-${key}: ${value};`);
185
- }), foundation && Object.entries(foundation).forEach(([key, value]) => {
186
- value && variables.push(` --${prefix}-${key}: ${value};`);
187
- }), includeScales && preset) {
188
- const sourceColors = isDark ? preset.colors.dark : preset.colors.light, colorScales = generateAllColorScales(sourceColors, prefix);
189
- variables.push(...colorScales);
190
+ const n2 = [];
191
+ if (r && Object.entries(r).forEach(([u2, d2]) => {
192
+ d2 && n2.push(` --${t2}-${u2}: ${d2};`);
193
+ }), c2 && Object.entries(c2).forEach(([u2, d2]) => {
194
+ d2 && n2.push(` --${t2}-${u2}: ${d2};`);
195
+ }), s && i2) {
196
+ const u2 = l2 ? i2.colors.dark : i2.colors.light, d2 = E(u2, t2);
197
+ n2.push(...d2);
190
198
  }
191
- const content = variables.join(`
199
+ const a = n2.join(`
192
200
  `);
193
- return mediaQuery ? `
194
- ${mediaQuery} {
195
- ${selector} {
196
- ${content.replace(/^/gm, " ")}
201
+ return o2 ? `
202
+ ${o2} {
203
+ ${e} {
204
+ ${a.replace(/^/gm, " ")}
197
205
  }
198
206
  }
199
207
  ` : `
200
- ${selector} {
201
- ${content}
208
+ ${e} {
209
+ ${a}
202
210
  }
203
211
  `;
204
212
  }
205
- function generateAllColorScales(colors, prefix) {
206
- const colorScales = [];
207
- return scaleColors.forEach((colorName) => {
208
- const baseColor = colors[colorName];
209
- if (baseColor) {
210
- const scale = generateColorScale(baseColor);
211
- Object.entries(scale).forEach(([scaleKey, scaleValue]) => {
212
- colorScales.push(` --${prefix}-${colorName}-${scaleKey}: ${scaleValue};`);
213
+ function E(e, o2) {
214
+ const r = [];
215
+ return S.forEach((c2) => {
216
+ const t2 = e[c2];
217
+ if (t2) {
218
+ const s = b(t2);
219
+ Object.entries(s).forEach(([i2, l2]) => {
220
+ r.push(` --${o2}-${c2}-${i2}: ${l2};`);
213
221
  });
214
222
  }
215
- }), colorScales;
223
+ }), r;
216
224
  }
217
- function injectCSS(css, id = "maz-theme-vars") {
225
+ var $ = /* @__PURE__ */ ((e) => (e.FULL = "maz-theme-full", e.CRITICAL = "maz-theme-critical", e))($ || {});
226
+ function v$1(e, o2) {
218
227
  if (typeof document > "u")
219
228
  return;
220
- let styleElement = document.getElementById(id);
221
- styleElement || (styleElement = document.createElement("style"), styleElement.id = id, document.head.appendChild(styleElement)), styleElement.textContent = css;
229
+ let r = document.getElementById(e);
230
+ r || (r = document.createElement("style"), r.id = e, document.head.appendChild(r)), r.textContent = o2;
231
+ }
232
+ function c(e) {
233
+ if (typeof document > "u")
234
+ return null;
235
+ const t2 = document.cookie.split(";").find((n2) => n2.trim().startsWith(`${e}=`));
236
+ return t2 ? decodeURIComponent(t2.split("=")[1]) : null;
237
+ }
238
+ function o$1(e) {
239
+ if (e && ["light", "dark"].includes(e))
240
+ return e;
241
+ const t2 = c("maz-color-mode");
242
+ return t2 && ["light", "dark"].includes(t2) ? t2 : "auto";
243
+ }
244
+ function n() {
245
+ return typeof globalThis.window < "u" && typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches;
222
246
  }
223
- function isPresetObject(preset) {
224
- return typeof preset == "object" && preset !== null && !!preset.name;
247
+ function t(i2) {
248
+ return typeof i2 == "object" && i2 !== null && !!i2.name;
225
249
  }
226
- async function getPreset(preset) {
227
- if (isPresetObject(preset))
228
- return preset;
229
- if (preset === "mazUi" || !preset || preset === "maz-ui") {
230
- const { mazUi } = await import("../chunks/mazUi.D6UdqpTO.js");
231
- return mazUi;
250
+ async function o(i2) {
251
+ if (t(i2))
252
+ return i2;
253
+ if (i2 === "mazUi" || !i2 || i2 === "maz-ui") {
254
+ const { mazUi: n2 } = await import("../chunks/mazUi.0b7z2u9g.js");
255
+ return n2;
232
256
  }
233
- if (preset === "ocean") {
234
- const { ocean } = await import("../chunks/ocean.pHrY5H_S.js");
235
- return ocean;
257
+ if (i2 === "ocean") {
258
+ const { ocean: n2 } = await import("../chunks/ocean.ehMlC0HV.js");
259
+ return n2;
236
260
  }
237
- if (preset === "pristine") {
238
- const { pristine } = await import("../chunks/pristine.ylgbwjxO.js");
239
- return pristine;
261
+ if (i2 === "pristine") {
262
+ const { pristine: n2 } = await import("../chunks/pristine.DMG3eBuN.js");
263
+ return n2;
240
264
  }
241
- if (preset === "obsidian") {
242
- const { obsidian } = await import("../chunks/obsidian.Cy0R8RHy.js");
243
- return obsidian;
265
+ if (i2 === "obsidian") {
266
+ const { obsidian: n2 } = await import("../chunks/obsidian.C6upWOVF.js");
267
+ return n2;
244
268
  }
245
- throw new TypeError(`[@maz-ui/themes] Preset ${preset} not found`);
269
+ throw new TypeError(`[@maz-ui/themes] Preset ${i2} not found`);
246
270
  }
247
- function getColorMode(colorMode) {
248
- if (colorMode && ["light", "dark"].includes(colorMode))
249
- return colorMode;
250
- const savedMode = getCookie("maz-color-mode");
251
- return savedMode && ["light", "dark"].includes(savedMode) ? savedMode : getSystemPrefersDark();
271
+ function f(n2, o2) {
272
+ return {
273
+ name: o2.name || n2.name,
274
+ foundation: {
275
+ ...n2.foundation,
276
+ ...o2.foundation
277
+ },
278
+ colors: {
279
+ light: u(n2.colors.light, o2.colors?.light),
280
+ dark: u(n2.colors.dark, o2.colors?.dark)
281
+ }
282
+ };
252
283
  }
253
- function getSystemPrefersDark() {
254
- return typeof globalThis.window < "u" && typeof globalThis.matchMedia == "function" && globalThis.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
284
+ function u(n2, o2) {
285
+ return o2 ? {
286
+ ...n2,
287
+ ...o2
288
+ } : n2;
255
289
  }
256
- function applyDarkMode(darkModeStrategy, isDark) {
257
- typeof document > "u" || darkModeStrategy !== "class" || (isDark ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"));
290
+ function g(r, t2) {
291
+ typeof document > "u" || r !== "class" || (t2 ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"));
258
292
  }
259
- function injectThemeCSS(finalPreset, config) {
293
+ function k(r, t2) {
260
294
  if (typeof document > "u")
261
295
  return;
262
- const cssOptions = {
263
- mode: config.colorMode === "auto" ? "both" : config.colorMode
296
+ const e = {
297
+ mode: t2.mode,
298
+ darkSelectorStrategy: t2.darkModeStrategy
264
299
  };
265
- if (config.injectCriticalCSS) {
266
- const criticalCSS = generateCriticalCSS(finalPreset, cssOptions);
267
- injectCSS(criticalCSS, "maz-theme-critical");
300
+ if (t2.injectCriticalCSS) {
301
+ const a = j(r, e);
302
+ v$1($.CRITICAL, a);
268
303
  }
269
- if (!config.injectFullCSS)
304
+ if (!t2.injectFullCSS)
270
305
  return;
271
- const fullCSS = generateFullCSS(finalPreset, cssOptions);
272
- config.strategy === "runtime" ? injectCSS(fullCSS, "maz-theme-full") : config.strategy === "hybrid" && requestIdleCallback(() => {
273
- injectCSS(fullCSS, "maz-theme-full");
306
+ const o2 = p(r, e);
307
+ t2.strategy === "runtime" ? v$1($.FULL, o2) : t2.strategy === "hybrid" && requestIdleCallback(() => {
308
+ v$1($.FULL, o2);
274
309
  }, { timeout: 100 });
275
310
  }
276
- function injectThemeState(app, themeState) {
277
- app.provide("mazThemeState", themeState), app.config.globalProperties.$mazThemeState = themeState;
311
+ function M(r, t2) {
312
+ r.provide("mazThemeState", t2), r.config.globalProperties.$mazThemeState = t2;
278
313
  }
279
- const MazUiTheme = {
280
- async install(app, options = {}) {
281
- const config = {
282
- preset: "maz-ui",
314
+ const v = {
315
+ async install(r, t2) {
316
+ const e = {
283
317
  strategy: "runtime",
318
+ overrides: {},
284
319
  darkModeStrategy: "class",
285
- colorMode: "auto",
320
+ colorMode: (t2?.mode !== "both" ? t2?.mode : t2?.colorMode) ?? "auto",
286
321
  injectCriticalCSS: !0,
287
322
  injectFullCSS: !0,
288
- ...options
289
- }, colorMode = getColorMode(config.colorMode), isDark = colorMode === "auto" ? getSystemPrefersDark() === "dark" : colorMode === "dark", themeState = reactive({
323
+ mode: "both",
324
+ ...t2
325
+ }, o$2 = e.mode !== "both" ? e.mode : o$1(e.colorMode), a = o$2 === "auto" && e.mode === "both" ? n() : o$2 === "dark" || e.mode === "dark", s = reactive({
290
326
  // @ts-expect-error - empty currentPreset to avoid error
291
327
  currentPreset: {},
292
- colorMode,
293
- isDark,
294
- strategy: config.strategy,
295
- darkModeStrategy: config.darkModeStrategy
328
+ mode: e.mode,
329
+ colorMode: o$2,
330
+ isDark: a,
331
+ strategy: e.strategy,
332
+ darkModeStrategy: e.darkModeStrategy
296
333
  });
297
- applyDarkMode(config.darkModeStrategy, themeState.isDark), injectThemeState(app, themeState);
298
- const preset = await getPreset(config.preset), finalPreset = config.overrides ? {
299
- ...preset,
300
- foundation: {
301
- ...preset.foundation,
302
- ...config.overrides.foundation
303
- },
304
- colors: {
305
- light: { ...preset.colors.light, ...config.overrides.colors?.light },
306
- dark: { ...preset.colors.dark, ...config.overrides.colors?.dark }
307
- }
308
- } : preset;
309
- themeState.currentPreset = finalPreset, config.strategy !== "buildtime" && injectThemeCSS(finalPreset, config);
310
- }
311
- }, defaultLocalesLoaders = {
312
- "./locales/de.ts": () => import("../chunks/de.B15Maq8Z.js").then((m) => ({ default: m.default })),
313
- "./locales/en.ts": () => import("../chunks/en.Q_4-KljL.js").then((m) => ({ default: m.default })),
314
- "./locales/es.ts": () => import("../chunks/es.BV1TlfTw.js").then((m) => ({ default: m.default })),
315
- "./locales/fr.ts": () => import("../chunks/fr.BVPG-7Dk.js").then((m) => ({ default: m.default })),
316
- "./locales/it.ts": () => import("../chunks/it.Be9xhI4P.js").then((m) => ({ default: m.default })),
317
- "./locales/ja.ts": () => import("../chunks/ja.CWU7KYEA.js").then((m) => ({ default: m.default })),
318
- "./locales/pt.ts": () => import("../chunks/pt.CfaFSxVt.js").then((m) => ({ default: m.default })),
319
- "./locales/zh-CN.ts": () => import("../chunks/zh-CN.CCkuvk-E.js").then((m) => ({ default: m.default }))
320
- }, defaultMessagesCache = /* @__PURE__ */ new Map(), globalState = reactive({
321
- loadedLocales: /* @__PURE__ */ new Set(),
322
- messages: {},
323
- userMessages: {},
324
- loadingPromises: /* @__PURE__ */ new Map()
325
- });
326
- function getMessage(obj, path) {
327
- return path.split(".").reduce((current, key) => current?.[key], obj);
328
- }
329
- function setMessage(obj, path, value) {
330
- const keys = path.split("."), lastKey = keys.pop(), target = keys.reduce((current, key) => ((!current[key] || typeof current[key] != "object") && (current[key] = {}), current[key]), obj);
331
- target[lastKey] = value;
332
- }
333
- function isFlattenedObject(obj) {
334
- return !obj || typeof obj != "object" ? !1 : Object.keys(obj).some((key) => key.includes("."));
335
- }
336
- function flattenToNested(flatObj) {
337
- if (!isFlattenedObject(flatObj))
338
- return flatObj;
339
- const nested = {};
340
- for (const [key, value] of Object.entries(flatObj))
341
- key.includes(".") ? setMessage(nested, key, value) : nested[key] = value;
342
- return nested;
343
- }
344
- function mergeMessages(target, source) {
345
- const normalizedSource = flattenToNested(source), result = { ...flattenToNested(target) };
346
- for (const key in normalizedSource)
347
- normalizedSource[key] && typeof normalizedSource[key] == "object" ? result[key] = mergeMessages(result[key] || {}, normalizedSource[key]) : result[key] = normalizedSource[key];
348
- return result;
349
- }
350
- function interpolate(message, variables) {
351
- return variables ? message.replace(/\{(\w+)\}/g, (match, key) => variables[key] !== void 0 ? String(variables[key]) : match) : message;
352
- }
353
- async function loadDefaultMessages(locale) {
354
- if (defaultMessagesCache.has(locale))
355
- return defaultMessagesCache.get(locale);
356
- const loaderPath = `./locales/${locale}.ts`, loader = defaultLocalesLoaders[loaderPath];
357
- if (!loader)
358
- return {};
359
- try {
360
- const messages = (await loader()).default;
361
- return defaultMessagesCache.set(locale, messages), messages;
362
- } catch (error) {
363
- return console.error(`Failed to load default messages for locale "${locale}":`, error), {};
364
- }
365
- }
366
- function loadLocale(targetLocale) {
367
- if (globalState.loadedLocales.has(targetLocale))
368
- return Promise.resolve();
369
- if (globalState.loadingPromises.has(targetLocale))
370
- return globalState.loadingPromises.get(targetLocale);
371
- const loadingPromise = (async () => {
372
- try {
373
- const localeDefaultMessages = await loadDefaultMessages(targetLocale);
374
- let localeUserMessages = {};
375
- const userLoader = globalState.userMessages[targetLocale];
376
- if (userLoader)
377
- if (typeof userLoader == "function")
378
- try {
379
- const userMessages = await userLoader();
380
- localeUserMessages = "default" in userMessages ? userMessages.default : userMessages;
381
- } catch (error) {
382
- console.error(`Failed to load user translations for locale "${targetLocale}":`, error), localeUserMessages = {};
383
- }
384
- else
385
- localeUserMessages = userLoader;
386
- globalState.messages[targetLocale] = mergeMessages(localeDefaultMessages, localeUserMessages), globalState.loadedLocales.add(targetLocale);
387
- } catch (error) {
388
- console.error(`Failed to load translations for locale "${targetLocale}":`, error), globalState.messages[targetLocale] = {}, globalState.loadedLocales.add(targetLocale);
389
- } finally {
390
- globalState.loadingPromises.delete(targetLocale);
391
- }
392
- })();
393
- return globalState.loadingPromises.set(targetLocale, loadingPromise), loadingPromise;
394
- }
395
- function createMazTranslations(options = {}) {
396
- const {
397
- locale: initialLocale = "en",
398
- fallbackLocale = "en",
399
- preloadFallback = !0,
400
- messages = {}
401
- } = options, locale = ref(initialLocale);
402
- for (const [loc, msgs] of Object.entries(messages))
403
- globalState.userMessages[loc] = msgs, msgs && typeof msgs == "object" && (globalState.messages[loc] = { ...globalState.messages[loc], ...msgs });
404
- setTimeout(() => {
405
- loadLocale(initialLocale).catch(console.error), preloadFallback && fallbackLocale !== initialLocale && loadLocale(fallbackLocale).catch(console.error);
406
- }, 0);
407
- function t(key, variables) {
408
- let message = getMessage(globalState.messages[locale.value], key);
409
- if (!message && fallbackLocale && locale.value !== fallbackLocale) {
410
- if (!globalState.loadedLocales.has(fallbackLocale))
411
- return loadLocale(fallbackLocale).catch(console.error), key;
412
- message = getMessage(globalState.messages[fallbackLocale], key);
413
- }
414
- if (!message && fallbackLocale !== "en" && locale.value !== "en") {
415
- if (!globalState.loadedLocales.has("en"))
416
- return loadLocale("en").catch(console.error), key;
417
- message = getMessage(globalState.messages.en, key);
418
- }
419
- return message ? interpolate(String(message), variables) : (console.warn(`[@maz-ui/translations] Translation not found for key: ${key}`), key);
420
- }
421
- async function setLocale(newLocale) {
422
- globalState.loadedLocales.has(newLocale) || await loadLocale(newLocale), locale.value = newLocale;
423
- }
424
- function isLocaleLoaded(localeToCheck) {
425
- return globalState.loadedLocales.has(localeToCheck);
426
- }
427
- function isLocaleLoading(localeToCheck) {
428
- return globalState.loadingPromises.has(localeToCheck);
429
- }
430
- function getAvailableLocales() {
431
- const locales = /* @__PURE__ */ new Set();
432
- for (const [path, loader] of Object.entries(defaultLocalesLoaders))
433
- loader && typeof loader == "function" && locales.add(path.replace("./locales/", "").replace(".ts", ""));
434
- for (const path of Object.keys(globalState.userMessages))
435
- locales.add(path);
436
- return Array.from(locales);
437
- }
438
- function getMessages() {
439
- return globalState.messages;
440
- }
441
- function getLoadedLocales() {
442
- return Object.keys(globalState.messages);
443
- }
444
- function setLocaleMessage(targetLocale, messages2) {
445
- globalState.messages[targetLocale] || (globalState.messages[targetLocale] = {}), globalState.messages[targetLocale] = mergeMessages(globalState.messages[targetLocale], messages2), globalState.loadedLocales.add(targetLocale);
446
- }
447
- return {
448
- locale,
449
- t,
450
- setLocale,
451
- isLocaleLoaded,
452
- isLocaleLoading,
453
- getAvailableLocales,
454
- setLocaleMessage,
455
- getMessages,
456
- getLoadedLocales
457
- };
458
- }
459
- const MazTranslations = {
460
- install(app, options = {}) {
461
- const i18n = createMazTranslations(options);
462
- return app.config.globalProperties.$mazTranslations = i18n, app.provide("mazTranslations", i18n), i18n;
334
+ g(e.darkModeStrategy, a), M(r, s);
335
+ const c2 = await o(e.preset), m2 = Object.keys(e.overrides).length > 0 ? f(c2, e.overrides) : c2;
336
+ s.currentPreset = m2, e.strategy !== "buildtime" && k(m2, e);
463
337
  }
464
338
  }, MazUi = {
465
- install(app, options = {}) {
339
+ install(app, options) {
466
340
  const { theme, translations } = options;
467
- app.use(MazUiTheme, theme), app.use(MazTranslations, translations);
341
+ app.use(v, theme), app.use(MazUiTranslations, translations);
468
342
  }
469
343
  };
470
344
  export {