@m3ui-vue/m3ui-vue 1.5.1 → 1.6.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 (270) hide show
  1. package/dist/API.md +43 -32
  2. package/dist/{MButton-D_uxtJa-.js → MButton-CPghlKb0.js} +8 -9
  3. package/dist/MButton-CPghlKb0.js.map +1 -0
  4. package/dist/{MDialog-DT4KAPmn.js → MDialog-X50At1Gk.js} +38 -44
  5. package/dist/MDialog-X50At1Gk.js.map +1 -0
  6. package/dist/{MIcon-Bxh9j135.js → MIcon-DpajuUTJ.js} +2 -3
  7. package/dist/MIcon-DpajuUTJ.js.map +1 -0
  8. package/dist/{MIconButton-DoNotQ9v.js → MIconButton-BBggVwBV.js} +5 -6
  9. package/dist/MIconButton-BBggVwBV.js.map +1 -0
  10. package/dist/{MListItem-CwYrxpPZ.js → MListItem-DVi1j1QI.js} +8 -14
  11. package/dist/MListItem-DVi1j1QI.js.map +1 -0
  12. package/dist/{MLoadingIndicator-DhzECYRI.js → MLoadingIndicator-vooA3110.js} +3 -4
  13. package/dist/MLoadingIndicator-vooA3110.js.map +1 -0
  14. package/dist/{MMenuItem-Bih0h4-n.js → MMenuItem-CRNZkVVr.js} +13 -25
  15. package/dist/MMenuItem-CRNZkVVr.js.map +1 -0
  16. package/dist/{MProgressBar-BCoruxA-.js → MProgressBar-BWly1UKN.js} +3 -8
  17. package/dist/MProgressBar-BWly1UKN.js.map +1 -0
  18. package/dist/{MSeekBar-DQPF5FTp.js → MSeekBar-BL2W5_rD.js} +4 -5
  19. package/dist/MSeekBar-BL2W5_rD.js.map +1 -0
  20. package/dist/{MSegmentedButton-DL9JtJFX.js → MSegmentedButton-BEB4gXLA.js} +3 -4
  21. package/dist/MSegmentedButton-BEB4gXLA.js.map +1 -0
  22. package/dist/{MSlider-BvoMZTy9.js → MSlider-B9NcKTmZ.js} +22 -23
  23. package/dist/MSlider-B9NcKTmZ.js.map +1 -0
  24. package/dist/{MSpinner-CgcCQhS9.js → MSpinner-_XpTRkAg.js} +3 -4
  25. package/dist/MSpinner-_XpTRkAg.js.map +1 -0
  26. package/dist/{MTextField-BRntFeNR.js → MTextField-DpcPmR5B.js} +12 -16
  27. package/dist/MTextField-DpcPmR5B.js.map +1 -0
  28. package/dist/{MTooltip-YyF1CO75.js → MTooltip-BL3jPYPT.js} +10 -12
  29. package/dist/MTooltip-BL3jPYPT.js.map +1 -0
  30. package/dist/THIRD_PARTY_LICENSES.md +2 -2
  31. package/dist/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
  32. package/dist/{_storageKeys-CYXsUBwK.js → _storageKeys-C4W_4xK4.js} +2 -3
  33. package/dist/_storageKeys-C4W_4xK4.js.map +1 -0
  34. package/dist/{_useEscapeStack-CjndQhqg.js → _useEscapeStack-C5-BYr8y.js} +2 -3
  35. package/dist/_useEscapeStack-C5-BYr8y.js.map +1 -0
  36. package/dist/api.json +1 -1
  37. package/dist/barcode.js +1 -2
  38. package/dist/barcode.js.map +1 -1
  39. package/dist/chart.js +2 -4
  40. package/dist/chart.js.map +1 -1
  41. package/dist/code-editor.js +22 -23
  42. package/dist/code-editor.js.map +1 -1
  43. package/dist/{common-0dgrgaPL.js → common-kIb6A2Qu.js} +8 -37
  44. package/dist/common-kIb6A2Qu.js.map +1 -0
  45. package/dist/components/MAbsolute.vue.d.ts +5 -3
  46. package/dist/components/MAlert.vue.d.ts +8 -6
  47. package/dist/components/MAppBar.vue.d.ts +9 -7
  48. package/dist/components/MAppBarWithSearch.vue.d.ts +15 -13
  49. package/dist/components/MAppLayout.vue.d.ts +13 -11
  50. package/dist/components/MAspectRatio.vue.d.ts +5 -3
  51. package/dist/components/MAudioPlayer.vue.d.ts +22 -20
  52. package/dist/components/MAutocomplete.vue.d.ts +1 -1
  53. package/dist/components/MAvailabilityCalendar.vue.d.ts +19 -17
  54. package/dist/components/MBadge.vue.d.ts +6 -4
  55. package/dist/components/MBar.vue.d.ts +14 -12
  56. package/dist/components/MBarcode.vue.d.ts +5 -3
  57. package/dist/components/MBeforeAfter.vue.d.ts +12 -10
  58. package/dist/components/MBodyMap.vue.d.ts +1 -1
  59. package/dist/components/MBottomAppBar.vue.d.ts +10 -8
  60. package/dist/components/MBottomSheet.vue.d.ts +8 -6
  61. package/dist/components/MBottomSheetScaffold.vue.d.ts +9 -7
  62. package/dist/components/MBox.vue.d.ts +6 -4
  63. package/dist/components/MButton.vue.d.ts +7 -5
  64. package/dist/components/MCard.vue.d.ts +12 -10
  65. package/dist/components/MCenter.vue.d.ts +5 -3
  66. package/dist/components/MChatBubble.vue.d.ts +6 -4
  67. package/dist/components/MCheckbox.vue.d.ts +5 -3
  68. package/dist/components/MChip.vue.d.ts +9 -7
  69. package/dist/components/MCircleProgressBar.vue.d.ts +6 -4
  70. package/dist/components/MCodeEditor.vue.d.ts +5 -3
  71. package/dist/components/MContainer.vue.d.ts +6 -4
  72. package/dist/components/MContextMenu.vue.d.ts +8 -6
  73. package/dist/components/MCopyButton.vue.d.ts +1 -1
  74. package/dist/components/MDataTable.vue.d.ts +21 -19
  75. package/dist/components/MDialog.vue.d.ts +21 -19
  76. package/dist/components/MDragHandle.vue.d.ts +1 -1
  77. package/dist/components/MDrawCanvas.vue.d.ts +5 -3
  78. package/dist/components/MDrawToolbar.vue.d.ts +7 -5
  79. package/dist/components/MEmptyState.vue.d.ts +5 -3
  80. package/dist/components/MExpansionPanel.vue.d.ts +6 -4
  81. package/dist/components/MExportButton.vue.d.ts +7 -5
  82. package/dist/components/MFab.vue.d.ts +11 -9
  83. package/dist/components/MFabMenu.vue.d.ts +3 -3
  84. package/dist/components/MFixed.vue.d.ts +5 -3
  85. package/dist/components/MFlex.vue.d.ts +7 -5
  86. package/dist/components/MFloorPlan.vue.d.ts +3 -3
  87. package/dist/components/MFloorPlanInspector.vue.d.ts +32 -30
  88. package/dist/components/MFloorPlanToolbar.vue.d.ts +2 -2
  89. package/dist/components/MFlow.vue.d.ts +4 -4
  90. package/dist/components/MFlowControls.vue.d.ts +6 -4
  91. package/dist/components/MFlowHandle.vue.d.ts +1 -1
  92. package/dist/components/MFlowNode.vue.d.ts +11 -9
  93. package/dist/components/MFooter.vue.d.ts +12 -10
  94. package/dist/components/MFullscreen.vue.d.ts +5 -3
  95. package/dist/components/MGantt.vue.d.ts +33 -31
  96. package/dist/components/MGanttControls.vue.d.ts +8 -6
  97. package/dist/components/MGrid.vue.d.ts +6 -4
  98. package/dist/components/MIcon.vue.d.ts +5 -0
  99. package/dist/components/MIconButton.vue.d.ts +1 -1
  100. package/dist/components/MImageCropper.vue.d.ts +14 -12
  101. package/dist/components/MInfiniteScroll.vue.d.ts +11 -9
  102. package/dist/components/MList.vue.d.ts +5 -3
  103. package/dist/components/MListGroup.vue.d.ts +7 -5
  104. package/dist/components/MListItem.vue.d.ts +21 -19
  105. package/dist/components/MListSubheader.vue.d.ts +5 -3
  106. package/dist/components/MLoadingOverlay.vue.d.ts +10 -8
  107. package/dist/components/MMap.vue.d.ts +14 -6
  108. package/dist/components/MMapControl.vue.d.ts +12 -10
  109. package/dist/components/MMapFeatureInfo.vue.d.ts +11 -9
  110. package/dist/components/MMapIdentify.vue.d.ts +9 -7
  111. package/dist/components/MMapLayers.vue.d.ts +13 -11
  112. package/dist/components/MMapMarker.vue.d.ts +7 -5
  113. package/dist/components/MMapPopup.vue.d.ts +5 -3
  114. package/dist/components/MMasonry.vue.d.ts +5 -3
  115. package/dist/components/MMenu.vue.d.ts +12 -10
  116. package/dist/components/MMenuItem.vue.d.ts +11 -9
  117. package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
  118. package/dist/components/MMultiSelect.vue.d.ts +6 -4
  119. package/dist/components/MNavigationDrawer.vue.d.ts +14 -12
  120. package/dist/components/MNavigationRail.vue.d.ts +7 -5
  121. package/dist/components/MOdontogram.vue.d.ts +1 -1
  122. package/dist/components/MOrderBook.vue.d.ts +1 -1
  123. package/dist/components/MOverlay.vue.d.ts +5 -3
  124. package/dist/components/MPdfViewer.vue.d.ts +4 -4
  125. package/dist/components/MPhoneInput.vue.d.ts +11 -9
  126. package/dist/components/MPosKeypad.vue.d.ts +18 -16
  127. package/dist/components/MProgressBar.vue.d.ts +1 -1
  128. package/dist/components/MPullToRefresh.vue.d.ts +5 -3
  129. package/dist/components/MQRCode.vue.d.ts +7 -5
  130. package/dist/components/MRadioGroup.vue.d.ts +1 -1
  131. package/dist/components/MReceipt.vue.d.ts +2 -2
  132. package/dist/components/MRelative.vue.d.ts +5 -3
  133. package/dist/components/MResourceTimeline.vue.d.ts +31 -29
  134. package/dist/components/MResponsive.vue.d.ts +5 -3
  135. package/dist/components/MResult.vue.d.ts +7 -5
  136. package/dist/components/MScrollable.vue.d.ts +7 -5
  137. package/dist/components/MSearchBar.vue.d.ts +13 -11
  138. package/dist/components/MSearchField.vue.d.ts +7 -5
  139. package/dist/components/MSection.vue.d.ts +11 -9
  140. package/dist/components/MSeekBar.vue.d.ts +3 -3
  141. package/dist/components/MSelect.vue.d.ts +1 -1
  142. package/dist/components/MShader.vue.d.ts +11 -9
  143. package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
  144. package/dist/components/MSideSheet.vue.d.ts +9 -7
  145. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  146. package/dist/components/MSkeleton.vue.d.ts +2 -2
  147. package/dist/components/MSlider.vue.d.ts +3 -3
  148. package/dist/components/MSparkline.vue.d.ts +1 -1
  149. package/dist/components/MSplitButton.vue.d.ts +7 -5
  150. package/dist/components/MSplitter.vue.d.ts +9 -7
  151. package/dist/components/MSpotlightSearch.vue.d.ts +1 -1
  152. package/dist/components/MStack.vue.d.ts +8 -6
  153. package/dist/components/MStatCard.vue.d.ts +5 -3
  154. package/dist/components/MStepper.vue.d.ts +5 -3
  155. package/dist/components/MSticky.vue.d.ts +5 -3
  156. package/dist/components/MSubtitle.vue.d.ts +6 -4
  157. package/dist/components/MSwipeToDismiss.vue.d.ts +11 -9
  158. package/dist/components/MTable.vue.d.ts +17 -15
  159. package/dist/components/MText.vue.d.ts +5 -3
  160. package/dist/components/MTextField.vue.d.ts +6 -4
  161. package/dist/components/MTimePickerModal.vue.d.ts +1 -1
  162. package/dist/components/MTitle.vue.d.ts +6 -4
  163. package/dist/components/MToggleButton.vue.d.ts +5 -3
  164. package/dist/components/MToolbar.vue.d.ts +24 -22
  165. package/dist/components/MTooltip.vue.d.ts +10 -8
  166. package/dist/components/MTopAppBar.vue.d.ts +22 -20
  167. package/dist/components/MTour.vue.d.ts +28 -26
  168. package/dist/components/MTransition.vue.d.ts +5 -3
  169. package/dist/components/MTree.vue.d.ts +6 -4
  170. package/dist/components/MTreeTable.vue.d.ts +21 -19
  171. package/dist/components/MTypewriter.vue.d.ts +6 -4
  172. package/dist/components/MVirtualTable.vue.d.ts +8 -6
  173. package/dist/components/_MMapLayerItem.vue.d.ts +8 -6
  174. package/dist/components/_MPdfPage.vue.d.ts +2 -2
  175. package/dist/components/_MToolbarFab.vue.d.ts +5 -3
  176. package/dist/components/_MTreeNode.vue.d.ts +13 -11
  177. package/dist/composables/useMap.d.ts +8 -0
  178. package/dist/{dist-CrjSW5DN.js → dist-Bj5kEq8G.js} +4 -6
  179. package/dist/dist-Bj5kEq8G.js.map +1 -0
  180. package/dist/draw.js +62 -82
  181. package/dist/draw.js.map +1 -1
  182. package/dist/{emoji-names-de-BphO5XpV.js → emoji-names-de-Cu3OSpp6.js} +2 -3
  183. package/dist/emoji-names-de-Cu3OSpp6.js.map +1 -0
  184. package/dist/{emoji-names-en-9ZvMRvzi.js → emoji-names-en-BNX1pM9h.js} +2 -3
  185. package/dist/emoji-names-en-BNX1pM9h.js.map +1 -0
  186. package/dist/{emoji-names-es-DvfWU3Pj.js → emoji-names-es-C_Dafg4D.js} +2 -3
  187. package/dist/emoji-names-es-C_Dafg4D.js.map +1 -0
  188. package/dist/{emoji-names-fr-B-jhUlsP.js → emoji-names-fr-D4HTMFuM.js} +2 -3
  189. package/dist/emoji-names-fr-D4HTMFuM.js.map +1 -0
  190. package/dist/{emoji-names-ja-l8cMFJo1.js → emoji-names-ja-BCql-Sj6.js} +2 -3
  191. package/dist/emoji-names-ja-BCql-Sj6.js.map +1 -0
  192. package/dist/{emoji-names-ko-YP-o9G0c.js → emoji-names-ko-CT8L52nn.js} +2 -3
  193. package/dist/emoji-names-ko-CT8L52nn.js.map +1 -0
  194. package/dist/{emoji-names-pt-DGj_Js4M.js → emoji-names-pt-DHiwPiL-.js} +2 -3
  195. package/dist/emoji-names-pt-DHiwPiL-.js.map +1 -0
  196. package/dist/{emoji-names-zh-Dzecwtw_.js → emoji-names-zh-L3FXVief.js} +2 -3
  197. package/dist/emoji-names-zh-L3FXVief.js.map +1 -0
  198. package/dist/flow.js +351 -374
  199. package/dist/flow.js.map +1 -1
  200. package/dist/{flowPaths-CcWOKY4Z.js → flowPaths-BaH7yaUM.js} +3 -8
  201. package/dist/flowPaths-BaH7yaUM.js.map +1 -0
  202. package/dist/gantt.js +272 -333
  203. package/dist/gantt.js.map +1 -1
  204. package/dist/locales/index.js +1 -2
  205. package/dist/locales/index.js.map +1 -1
  206. package/dist/m3ui.js +168 -343
  207. package/dist/m3ui.js.map +1 -1
  208. package/dist/map.d.ts +1 -1
  209. package/dist/map.js +521 -520
  210. package/dist/map.js.map +1 -1
  211. package/dist/markdown.js +3 -4
  212. package/dist/markdown.js.map +1 -1
  213. package/dist/{material-color-utilities-C_iikgRm.js → material-color-utilities-CEFytLsr.js} +15 -32
  214. package/dist/material-color-utilities-CEFytLsr.js.map +1 -0
  215. package/dist/media.js +80 -94
  216. package/dist/media.js.map +1 -1
  217. package/dist/{motion-DZiXG09o.js → motion-BcejVTeX.js} +2 -3
  218. package/dist/motion-BcejVTeX.js.map +1 -0
  219. package/dist/pdf.js +103 -115
  220. package/dist/pdf.js.map +1 -1
  221. package/dist/qrcode.js +1 -2
  222. package/dist/qrcode.js.map +1 -1
  223. package/dist/rich-text-editor.js +33 -34
  224. package/dist/rich-text-editor.js.map +1 -1
  225. package/dist/terminal.js +2 -3
  226. package/dist/terminal.js.map +1 -1
  227. package/dist/{useLocale-DLcG3qPC.js → useLocale-COav9m8C.js} +2 -3
  228. package/dist/useLocale-COav9m8C.js.map +1 -0
  229. package/dist/{useThemeTokens-DQQcaWbE.js → useThemeTokens-DyAdPQB0.js} +6 -10
  230. package/dist/useThemeTokens-DyAdPQB0.js.map +1 -0
  231. package/package.json +32 -32
  232. package/src/__tests__/MFab.test.ts +10 -1
  233. package/src/__tests__/MMap.test.ts +16 -1
  234. package/src/__tests__/_fakeMaplibre.ts +2 -0
  235. package/src/components/MMap.vue +12 -3
  236. package/src/components/MMapMeasure.vue +3 -1
  237. package/src/composables/useMap.ts +17 -0
  238. package/src/composables/useMapLayers.ts +4 -1
  239. package/src/map.ts +1 -1
  240. package/dist/MButton-D_uxtJa-.js.map +0 -1
  241. package/dist/MDialog-DT4KAPmn.js.map +0 -1
  242. package/dist/MIcon-Bxh9j135.js.map +0 -1
  243. package/dist/MIconButton-DoNotQ9v.js.map +0 -1
  244. package/dist/MListItem-CwYrxpPZ.js.map +0 -1
  245. package/dist/MLoadingIndicator-DhzECYRI.js.map +0 -1
  246. package/dist/MMenuItem-Bih0h4-n.js.map +0 -1
  247. package/dist/MProgressBar-BCoruxA-.js.map +0 -1
  248. package/dist/MSeekBar-DQPF5FTp.js.map +0 -1
  249. package/dist/MSegmentedButton-DL9JtJFX.js.map +0 -1
  250. package/dist/MSlider-BvoMZTy9.js.map +0 -1
  251. package/dist/MSpinner-CgcCQhS9.js.map +0 -1
  252. package/dist/MTextField-BRntFeNR.js.map +0 -1
  253. package/dist/MTooltip-YyF1CO75.js.map +0 -1
  254. package/dist/_storageKeys-CYXsUBwK.js.map +0 -1
  255. package/dist/_useEscapeStack-CjndQhqg.js.map +0 -1
  256. package/dist/common-0dgrgaPL.js.map +0 -1
  257. package/dist/dist-CrjSW5DN.js.map +0 -1
  258. package/dist/emoji-names-de-BphO5XpV.js.map +0 -1
  259. package/dist/emoji-names-en-9ZvMRvzi.js.map +0 -1
  260. package/dist/emoji-names-es-DvfWU3Pj.js.map +0 -1
  261. package/dist/emoji-names-fr-B-jhUlsP.js.map +0 -1
  262. package/dist/emoji-names-ja-l8cMFJo1.js.map +0 -1
  263. package/dist/emoji-names-ko-YP-o9G0c.js.map +0 -1
  264. package/dist/emoji-names-pt-DGj_Js4M.js.map +0 -1
  265. package/dist/emoji-names-zh-Dzecwtw_.js.map +0 -1
  266. package/dist/flowPaths-CcWOKY4Z.js.map +0 -1
  267. package/dist/material-color-utilities-C_iikgRm.js.map +0 -1
  268. package/dist/motion-DZiXG09o.js.map +0 -1
  269. package/dist/useLocale-DLcG3qPC.js.map +0 -1
  270. package/dist/useThemeTokens-DQQcaWbE.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { t as e } from "./_storageKeys-CYXsUBwK.js";
2
- import { t } from "./motion-DZiXG09o.js";
1
+ import { t as e } from "./_storageKeys-C4W_4xK4.js";
2
+ import { t } from "./motion-BcejVTeX.js";
3
3
  import { onBeforeUnmount as n, onMounted as r, ref as i } from "vue";
4
- //#region src/composables/_themeTransition.ts
4
+ // src/composables/_themeTransition.ts
5
5
  var a = [
6
6
  "background",
7
7
  "on-background",
@@ -58,12 +58,9 @@ function f(e) {
58
58
  t.classList.add("theme-switching"), t.offsetHeight, e(), clearTimeout(d), d = setTimeout(() => {
59
59
  t.classList.remove("theme-switching"), document.getElementById(s)?.remove();
60
60
  }, 300);
61
- return;
62
- }
63
- t.classList.add("theme-transitioning"), t.offsetHeight, e(), setTimeout(() => t.classList.remove("theme-transitioning"), 300);
61
+ } else t.classList.add("theme-transitioning"), t.offsetHeight, e(), setTimeout(() => t.classList.remove("theme-transitioning"), 300);
64
62
  }
65
- //#endregion
66
- //#region src/composables/useThemeTokens.ts
63
+ // src/composables/useThemeTokens.ts
67
64
  var p = t(.25, .1, .25, 1);
68
65
  function m(e) {
69
66
  let t = e.trim(), n = /^#([0-9a-f]{3,8})$/i.exec(t)?.[1];
@@ -130,7 +127,6 @@ function g(t, a = {}) {
130
127
  c?.disconnect(), clearTimeout(l), cancelAnimationFrame(u);
131
128
  }), s;
132
129
  }
133
- //#endregion
134
130
  export { f as n, g as t };
135
131
 
136
- //# sourceMappingURL=useThemeTokens-DQQcaWbE.js.map
132
+ //# sourceMappingURL=useThemeTokens-DyAdPQB0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThemeTokens-DyAdPQB0.js","names":["STYLE_ID","STYLE_ID$1","COLOR_TOKENS","c","t","DURATION","STYLE_ID","css","isGecko","hasProperty","timer","themeTransition","apply","root","style","ease","cubicBezier","parseColor","v","value","hex","full","n","i","fn","parts","channel","p","alpha","rgba","mix","a","from","b","to","r","g","bl","al","x","useThemeTokens","read","names","tokens","ref","observer","settle","frame","set","next","update","follow","native","start","step","now","onMounted","isPaletteStyle","node","records","options","onBeforeUnmount"],"sources":["../src/composables/_themeTransition.ts","../src/composables/useThemeTokens.ts"],"sourcesContent":["// Internal: animates a theme change (dark mode, palette, contrast).\n//\n// Firefox (and any browser without @property) transitions six color properties on every element\n// (`.theme-transitioning` in theme.css): smooth there, but in Chromium it recalculates every element's transitions\n// each frame and stutters. Chromium and WebKit instead transition the color tokens themselves, once, on <html>:\n// registered as <color> with @property they interpolate, and every element follows them through var(). Components'\n// own color transitions (transition-colors) are turned off meanwhile, or they would restart on every frame of the\n// token's change and trail behind the rest (the navbar and buttons did). A view transition was tried first: it\n// cross-fades two snapshots, which looks washed out midway compared to the colors moving.\n\n// The tokens of theme.css, palettes.css and generated palettes\nconst COLOR_TOKENS = [\n 'background', 'on-background', 'surface', 'surface-dim', 'surface-bright', 'surface-variant', 'on-surface',\n 'on-surface-variant', 'surface-container-lowest', 'surface-container-low', 'surface-container',\n 'surface-container-high', 'surface-container-highest', 'inverse-surface', 'inverse-on-surface', 'inverse-primary',\n 'outline', 'outline-variant', 'shadow', 'scrim',\n ...['primary', 'secondary', 'tertiary', 'error', 'success'].flatMap((c) => [c, `on-${c}`, `${c}-container`, `on-${c}-container`]),\n ...['primary', 'secondary', 'tertiary'].flatMap((c) => [`${c}-fixed`, `${c}-fixed-dim`, `on-${c}-fixed`, `on-${c}-fixed-variant`]),\n].map((t) => `--color-${t}`)\n\nconst DURATION = 250\n/** How long a theme switch's color transition takes, in ms (both paths) */\nexport const THEME_TRANSITION_MS = DURATION\nconst STYLE_ID = 'm3-theme-transition'\n\n// Injected only while switching: a registered <color> computes to rgb(), and code reading a token with\n// getPropertyValue() expects it as written\nconst css = COLOR_TOKENS.map((t) => `@property ${t} { syntax: '<color>'; inherits: true; initial-value: transparent; }`).join('\\n')\n + `\\nhtml.theme-switching { transition: ${COLOR_TOKENS.map((t) => `${t} ${DURATION}ms ease`).join(', ')}; }`\n + '\\nhtml.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }'\n\n// Gecko: a CSS feature only it has, or its user agent (\"Gecko/<version>\" or \"Firefox/\"; Chromium and WebKit only\n// say \"like Gecko\", and Firefox on iOS is WebKit and says \"FxiOS\")\nconst isGecko = () =>\n (typeof CSS !== 'undefined' && !!CSS.supports?.('-moz-appearance', 'none'))\n || (typeof navigator !== 'undefined' && /\\bGecko\\/\\d|\\bFirefox\\//.test(navigator.userAgent))\nconst hasProperty = () => typeof CSS !== 'undefined' && typeof CSS.registerProperty === 'function'\n\nlet timer: ReturnType<typeof setTimeout> | undefined\n\n/** Runs `apply` (the DOM writes of a theme change) with the theme transition. */\nexport function themeTransition(apply: () => void) {\n if (typeof document === 'undefined') return apply()\n const reduced = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n if (reduced) return apply()\n const root = document.documentElement\n\n if (!isGecko() && hasProperty()) {\n if (!document.getElementById(STYLE_ID)) {\n const style = document.createElement('style')\n style.id = STYLE_ID\n style.textContent = css\n document.head.appendChild(style)\n }\n root.classList.add('theme-switching')\n // Style flush: the tokens' current values are computed as registered colors and the transition is in place\n // before they change\n void root.offsetHeight\n apply()\n clearTimeout(timer)\n timer = setTimeout(() => {\n root.classList.remove('theme-switching')\n document.getElementById(STYLE_ID)?.remove()\n }, DURATION + 50)\n return\n }\n\n root.classList.add('theme-transitioning')\n // Force a style flush so the transition is in place before the colors change\n void root.offsetHeight\n apply()\n setTimeout(() => root.classList.remove('theme-transitioning'), 300)\n}\n","import { onBeforeUnmount, onMounted, ref, type Ref } from 'vue'\nimport { STYLE_ID } from './_storageKeys'\nimport { THEME_TRANSITION_MS } from './_themeTransition'\nimport { cubicBezier } from './motion'\n\nexport interface ThemeTokensOptions {\n /**\n * Updates every animation frame while the theme switch's colors fade, so a canvas redrawn on change fades with\n * the page instead of jumping to the new colors. Off by default: what animates color changes itself (Chart.js,\n * MChart, maps) only needs the final values, and would otherwise redraw ~15 times per switch.\n */\n live?: boolean\n}\n\n// The CSS `ease` the switch uses (_themeTransition.ts, and `.theme-transitioning` in theme.css)\nconst ease = cubicBezier(0.25, 0.1, 0.25, 1)\n\ntype Rgba = [number, number, number, number]\n\n// Hex (#rgb, #rgba, #rrggbb, #rrggbbaa) or rgb()/rgba(), the forms tokens are written in or computed to; null for\n// anything else (that token then switches at once)\nfunction parseColor(value: string): Rgba | null {\n const v = value.trim()\n const hex = /^#([0-9a-f]{3,8})$/i.exec(v)?.[1]\n if (hex && hex.length !== 5 && hex.length !== 7) {\n const full = hex.length <= 4 ? [...hex].map((c) => c + c).join('') : hex\n const n = (i: number) => parseInt(full.slice(i, i + 2), 16)\n return [n(0), n(2), n(4), full.length === 8 ? n(6) / 255 : 1]\n }\n const fn = /^rgba?\\(([^)]+)\\)$/i.exec(v)?.[1]\n if (!fn) return null\n const parts = fn.split(/[\\s,/]+/).filter(Boolean)\n if (parts.length < 3) return null\n const channel = (p: string) => (p.endsWith('%') ? parseFloat(p) * 2.55 : parseFloat(p))\n const alpha = parts[3] == null ? 1 : parts[3].endsWith('%') ? parseFloat(parts[3]) / 100 : parseFloat(parts[3])\n const rgba = [channel(parts[0]!), channel(parts[1]!), channel(parts[2]!), alpha] as Rgba\n return rgba.every(Number.isFinite) ? rgba : null\n}\n\nfunction mix(from: string, to: string, t: number): string {\n const a = parseColor(from)\n const b = parseColor(to)\n if (!a || !b) return t < 1 ? from : to\n const [r, g, bl, al] = a.map((x, i) => x + (b[i]! - x) * t)\n return `rgba(${Math.round(r!)}, ${Math.round(g!)}, ${Math.round(bl!)}, ${+al!.toFixed(3)})`\n}\n\n/**\n * The current values of some color tokens (`['primary', 'surface']` → `--color-primary`…), kept up to date across\n * light/dark, palette, contrast and generated (seed) palette changes: for what can't use CSS variables, like a\n * Chart.js dataset, a canvas or a MapLibre layer's paint. Values settle after the theme switch's color transition;\n * with `{ live: true }` they also follow it frame by frame (as `rgba()` midway). Empty strings on the server.\n *\n * ```ts\n * const colors = useThemeTokens(['primary', 'tertiary', 'outline-variant'] as const)\n * const data = computed(() => ({ datasets: [{ data: sales, borderColor: colors.value.primary }] }))\n * ```\n */\nexport function useThemeTokens<T extends string>(names: readonly T[], options: ThemeTokensOptions = {}): Ref<Record<T, string>> {\n const read = () => {\n const style = getComputedStyle(document.documentElement)\n return Object.fromEntries(names.map((n) => [n, style.getPropertyValue(`--color-${n}`).trim()])) as Record<T, string>\n }\n const tokens = ref(typeof document === 'undefined' ? Object.fromEntries(names.map((n) => [n, ''])) as Record<T, string> : read()) as Ref<Record<T, string>>\n let observer: MutationObserver | undefined\n let settle: ReturnType<typeof setTimeout> | undefined\n let frame = 0\n\n const set = (next: Record<T, string>) => {\n if (names.some((n) => next[n] !== tokens.value[n])) tokens.value = next\n }\n const update = () => set(read())\n\n // Follows a switch already under way. Chromium/WebKit animate the tokens themselves (`theme-switching`), so\n // reading them each frame gives the page's own colors; Firefox fades each element's colors instead\n // (`theme-transitioning`) while the tokens jump, so the same `ease` is replayed here from the old values\n function follow(root: HTMLElement) {\n cancelAnimationFrame(frame)\n const native = root.classList.contains('theme-switching')\n const from = { ...tokens.value }\n const to = native ? null : read()\n const start = performance.now()\n const step = (now: number) => {\n const t = Math.min(1, (now - start) / THEME_TRANSITION_MS)\n // The last frame lands on the values as written, not their rgba() form\n if (to) set(t < 1 ? Object.fromEntries(names.map((n) => [n, mix(from[n], to[n], ease(t))])) as Record<T, string> : to)\n else update()\n if (t < 1) frame = requestAnimationFrame(step)\n }\n frame = requestAnimationFrame(step)\n }\n\n onMounted(() => {\n const root = document.documentElement\n // Dark mode (class), a palette or contrast (attributes), or a generated palette rewriting its <style> in <head>\n const isPaletteStyle = (node: Node | null) => (node instanceof Element ? node : node?.parentElement)?.id === STYLE_ID\n observer = new MutationObserver((records) => {\n if (!records.some((r) => r.target === root || isPaletteStyle(r.target)\n || Array.from(r.addedNodes).some(isPaletteStyle))) return\n if (options.live && (root.classList.contains('theme-switching') || root.classList.contains('theme-transitioning'))) follow(root)\n else update()\n // Chromium animates the tokens on a theme switch (_themeTransition, 250ms): read the settled values too\n clearTimeout(settle)\n settle = setTimeout(update, THEME_TRANSITION_MS + 50)\n })\n observer.observe(root, { attributes: true, attributeFilter: ['class', 'style', 'data-palette', 'data-contrast'] })\n observer.observe(document.head, { childList: true, characterData: true, subtree: true })\n })\n onBeforeUnmount(() => {\n observer?.disconnect()\n clearTimeout(settle)\n cancelAnimationFrame(frame)\n })\n\n return tokens\n}\n"],"mappings":";;;;AAWA,IAAME,IAAe;CACnB;CAAc;CAAiB;CAAW;CAAe;CAAkB;CAAmB;CAC9F;CAAsB;CAA4B;CAAyB;CAC3E;CAA0B;CAA6B;CAAmB;CAAsB;CAChG;CAAW;CAAmB;CAAU;CACxC,GAAG;EAAC;EAAW;EAAa;EAAY;EAAS;CAAS,CAAC,CAAC,SAAS,MAAM;EAACC;EAAG,MAAMA;EAAK,GAAGA,EAAE;EAAa,MAAMA,EAAE;CAAW,CAAC;CAChI,GAAG;EAAC;EAAW;EAAa;CAAU,CAAC,CAAC,SAAS,MAAM;EAAC,GAAGA,EAAE;EAAS,GAAGA,EAAE;EAAa,MAAMA,EAAE;EAAS,MAAMA,EAAE;CAAe,CAAC;AACnI,CAAC,C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Q,sBAAsBkD,CAAI;EAC/C;EACA,IAAQ,sBAAsBA,CAAI;CACpC;CAwBA,OAtBAE,QAAgB;EACd,IAAM3C,IAAO,SAAS,iBAEhB4C,KAAkB,OAAuBC,aAAgB,UAAUA,IAAOA,GAAM,cAAA,EAAgB,OAAO1D;EAW7G,AAVA,IAAW,IAAI,kBAAkB,MAAY;GAC3C,AAAK2D,EAAQ,MAAM,MAAMxB,EAAE,WAAWtB,KAAQ4C,EAAetB,EAAE,MAAM,KAChE,MAAM,KAAKA,EAAE,UAAU,CAAC,CAAC,KAAKsB,CAAc,CAAC,MAC9CG,EAAQ,SAAS/C,EAAK,UAAU,SAAS,iBAAiB,KAAKA,EAAK,UAAU,SAAS,qBAAqB,KAAIsC,EAAOtC,CAAI,IAC1HqC,EAAO,GAEZ,aAAaJ,CAAM,GACnB,IAAS,WAAWI,GAAA,GAAgC;EACtD,CAAC,GACDL,EAAS,QAAQhC,GAAM;GAAE,YAAY;GAAM,iBAAiB;IAAC;IAAS;IAAS;IAAgB;GAAe;EAAE,CAAC,GACjHgC,EAAS,QAAQ,SAAS,MAAM;GAAE,WAAW;GAAM,eAAe;GAAM,SAAS;EAAK,CAAC;CACzF,CAAC,GACDgB,QAAsB;EAGpB,AAFAhB,GAAU,WAAW,GACrB,aAAaC,CAAM,GACnB,qBAAqBC,CAAK;CAC5B,CAAC,GAEMJ;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m3ui-vue/m3ui-vue",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "Material 3 component library for Vue 3 + Tailwind CSS v4",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -105,7 +105,7 @@
105
105
  "prepublishOnly": "pnpm build"
106
106
  },
107
107
  "peerDependencies": {
108
- "maplibre-gl": "^5.0.0",
108
+ "maplibre-gl": "^5.0.0 || ^6.0.0",
109
109
  "tailwindcss": "^4.0.0",
110
110
  "vue": "^3.5.0"
111
111
  },
@@ -220,7 +220,7 @@
220
220
  }
221
221
  },
222
222
  "devDependencies": {
223
- "@codemirror/commands": "^6.11.0",
223
+ "@codemirror/commands": "^6.11.1",
224
224
  "@codemirror/lang-cpp": "^6.0.3",
225
225
  "@codemirror/lang-css": "^6.3.1",
226
226
  "@codemirror/lang-html": "^6.4.12",
@@ -229,47 +229,47 @@
229
229
  "@codemirror/lang-python": "^6.2.1",
230
230
  "@codemirror/lang-rust": "^6.0.2",
231
231
  "@codemirror/lang-vue": "^0.1.3",
232
- "@codemirror/language": "^6.12.4",
233
- "@codemirror/legacy-modes": "^6.5.4",
234
- "@codemirror/state": "^6.7.4",
232
+ "@codemirror/language": "^6.13.1",
233
+ "@codemirror/legacy-modes": "^6.5.5",
234
+ "@codemirror/state": "^6.7.6",
235
235
  "@codemirror/theme-one-dark": "^6.1.3",
236
- "@codemirror/view": "^6.43.11",
237
- "@lezer/highlight": "^1.2.3",
236
+ "@codemirror/view": "^6.43.15",
237
+ "@lezer/highlight": "^1.2.5",
238
238
  "@material/material-color-utilities": "^0.4.0",
239
- "@tiptap/extension-color": "^3.31.3",
240
- "@tiptap/extension-highlight": "^3.31.3",
241
- "@tiptap/extension-image": "^3.31.3",
242
- "@tiptap/extension-link": "^3.31.3",
243
- "@tiptap/extension-placeholder": "^3.31.3",
244
- "@tiptap/extension-text-align": "^3.31.3",
245
- "@tiptap/extension-text-style": "^3.31.3",
246
- "@tiptap/extension-underline": "^3.31.3",
247
- "@tiptap/starter-kit": "^3.31.3",
248
- "@tiptap/vue-3": "^3.31.3",
239
+ "@tiptap/extension-color": "^3.35.0",
240
+ "@tiptap/extension-highlight": "^3.35.0",
241
+ "@tiptap/extension-image": "^3.35.0",
242
+ "@tiptap/extension-link": "^3.35.0",
243
+ "@tiptap/extension-placeholder": "^3.35.0",
244
+ "@tiptap/extension-text-align": "^3.35.0",
245
+ "@tiptap/extension-text-style": "^3.35.0",
246
+ "@tiptap/extension-underline": "^3.35.0",
247
+ "@tiptap/starter-kit": "^3.35.0",
248
+ "@tiptap/vue-3": "^3.35.0",
249
249
  "@types/jsbarcode": "^3.11.4",
250
250
  "@types/markdown-it": "^14.2.0",
251
- "@vitejs/plugin-vue": "^6.0.8",
252
- "@vue/test-utils": "^2.5.0",
251
+ "@vitejs/plugin-vue": "^6.0.11",
252
+ "@vue/test-utils": "^2.6.0",
253
253
  "@vue/tsconfig": "^0.9.1",
254
- "@webgpu/types": "^0.1.72",
254
+ "@webgpu/types": "^0.1.74",
255
255
  "@xterm/addon-fit": "^0.11.0",
256
256
  "@xterm/xterm": "^6.0.0",
257
- "chart.js": "^4.5.1",
257
+ "chart.js": "^4.6.1",
258
258
  "codemirror": "^6.0.2",
259
- "happy-dom": "^20.14.5",
259
+ "happy-dom": "^21.0.4",
260
260
  "highlight.js": "^11.12.0",
261
261
  "jsbarcode": "^3.12.3",
262
- "maplibre-gl": "^5.24.0",
263
- "markdown-it": "^15.0.2",
264
- "pdfjs-dist": "^6.4.299",
262
+ "maplibre-gl": "^6.19.0",
263
+ "markdown-it": "^15.0.3",
264
+ "pdfjs-dist": "^6.5.438",
265
265
  "qrcode-generator": "^2.0.4",
266
266
  "typescript": "~6.0.3",
267
- "vite": "^8.3.0",
268
- "vitest": "^5.0.0",
269
- "vue": "^3.5.42",
270
- "vue-chartjs": "^5.3.4",
271
- "vue-component-meta": "3.3.11",
272
- "vue-tsc": "^3.3.11"
267
+ "vite": "^8.3.8",
268
+ "vitest": "^5.1.1",
269
+ "vue": "^3.5.46",
270
+ "vue-chartjs": "^5.3.7",
271
+ "vue-component-meta": "3.3.14",
272
+ "vue-tsc": "^3.3.14"
273
273
  },
274
274
  "publishConfig": {
275
275
  "access": "public"
@@ -60,8 +60,16 @@ describe('MFab', () => {
60
60
 
61
61
  it('hydrates collapsed without mismatches, and still expands', async () => {
62
62
  const container = document.createElement('div')
63
- container.innerHTML = await renderToString(createSSRApp({ render: () => h(MFab, { icon: 'edit', label: 'Compose', expanded: false }) }))
63
+ // Hydration claims <body> as the teleport target, so leftovers of earlier tests can't be in it
64
+ document.body.innerHTML = ''
65
+ // Like a real SSR page: the teleported markup (the content panel's placeholders) ends up in <body>
66
+ const ctx: { teleports?: Record<string, string> } = {}
67
+ container.innerHTML = await renderToString(createSSRApp({ render: () => h(MFab, { icon: 'edit', label: 'Compose', expanded: false }) }), ctx)
64
68
  document.body.appendChild(container)
69
+ const teleported = document.createElement('template')
70
+ teleported.innerHTML = ctx.teleports?.body ?? ''
71
+ const teleportedNodes = [...teleported.content.childNodes]
72
+ document.body.append(...teleportedNodes)
65
73
  const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
66
74
  const expanded = { value: false }
67
75
  const app = createSSRApp({ render: () => h(MFab, { icon: 'edit', label: 'Compose', expanded: expanded.value }) })
@@ -78,5 +86,6 @@ describe('MFab', () => {
78
86
  expect((container.querySelector('button') as HTMLElement).style.width).toBe('')
79
87
  })
80
88
  container.remove()
89
+ for (const node of teleportedNodes) node.remove()
81
90
  })
82
91
  })
@@ -6,7 +6,7 @@ import { defineComponent, h, nextTick } from 'vue'
6
6
  import { created, FakeMap } from './_fakeMaplibre'
7
7
  vi.mock('maplibre-gl', async () => (await import('./_fakeMaplibre')).fakeModule)
8
8
 
9
- const { MMap, MMapMarker, MMapPopup, MMapGeoJson, MMapControl, useMap } = await import('../map')
9
+ const { MMap, MMapMarker, MMapPopup, MMapGeoJson, MMapControl, useMap, setMapWorker } = await import('../map')
10
10
 
11
11
  beforeEach(() => {
12
12
  created.maps = []
@@ -44,6 +44,21 @@ describe('MMap', () => {
44
44
  expect(wrapper.emitted('ready')?.[0]?.[0]).toBe(map)
45
45
  })
46
46
 
47
+ it('hands workerUrl (or setMapWorker) to setWorkerUrl before creating the map (maplibre-gl 6 under a bundler)', async () => {
48
+ const { fakeModule } = await import('./_fakeMaplibre')
49
+ fakeModule.workerUrl = undefined
50
+ await mountMap()
51
+ expect(fakeModule.workerUrl).toBeUndefined()
52
+ await mountMap({ workerUrl: '/assets/maplibre-gl-worker.js' })
53
+ expect(fakeModule.workerUrl).toBe('/assets/maplibre-gl-worker.js')
54
+ setMapWorker('/assets/global-worker.js')
55
+ await mountMap()
56
+ expect(fakeModule.workerUrl).toBe('/assets/global-worker.js')
57
+ await mountMap({ workerUrl: '/assets/own-worker.js' })
58
+ expect(fakeModule.workerUrl).toBe('/assets/own-worker.js')
59
+ setMapWorker(undefined)
60
+ })
61
+
47
62
  it('leaves the view to the style when none is given', async () => {
48
63
  const { map } = await mountMap()
49
64
  expect('center' in map.options).toBe(false)
@@ -160,4 +160,6 @@ export const fakeModule = {
160
160
  FullscreenControl: class FullscreenControl extends Control {},
161
161
  ScaleControl: class ScaleControl extends Control {},
162
162
  AttributionControl: class AttributionControl extends Control {},
163
+ workerUrl: undefined as string | undefined,
164
+ setWorkerUrl(url: string) { fakeModule.workerUrl = url },
163
165
  }
@@ -6,7 +6,8 @@
6
6
  * MapLibre map itself is the `ready` event's argument and the `map` of `useMap()` in components placed inside.
7
7
  * Available from the `/map` entry point; needs `maplibre-gl` installed and its CSS imported
8
8
  * (`maplibre-gl/dist/maplibre-gl.css`). Give it a height. Server-side rendering renders the empty container: MapLibre
9
- * loads in the browser.
9
+ * loads in the browser. With maplibre-gl 6 and a bundler, give it MapLibre's worker URL (`setMapWorker()` once
10
+ * at startup, or the `workerUrl` prop), or the map stays blank.
10
11
  *
11
12
  * @slot default Map components (`MMapMarker`, `MMapPopup`, `MMapGeoJson`, `MMapControl`) and anything to show over
12
13
  * the map, rendered once the map exists
@@ -21,7 +22,7 @@ import { markRaw, onBeforeUnmount, onMounted, onUnmounted, provide, ref, shallow
21
22
  import type * as Maplibre from 'maplibre-gl'
22
23
  import MMapAttribution from './_MMapAttribution.vue'
23
24
  import { useLocale } from '../composables/useLocale'
24
- import { MAP_KEY, type MapContext, type MaplibreModule } from '../composables/useMap'
25
+ import { MAP_KEY, mapWorkerUrl, type MapContext, type MaplibreModule } from '../composables/useMap'
25
26
  import { createLayerState, readLayerState } from '../composables/useMapLayers'
26
27
  import { storageKey } from '../composables/_storageKeys'
27
28
  import type { MapAdapter, MapLayerModel } from '../composables/mapAdapters'
@@ -60,6 +61,12 @@ const props = withDefaults(
60
61
  * under `m3-map-view` (after `createM3UI`'s `storagePrefix`, if any), or your own key (one per map)
61
62
  */
62
63
  persist?: boolean | string
64
+ /**
65
+ * The URL of MapLibre's worker, handed to maplibre's `setWorkerUrl()` before the map is created. maplibre-gl 6
66
+ * needs it under a bundler; with Vite: `import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'`.
67
+ * Overrides `setMapWorker()`; the setting is global to maplibre, so the last one applied wins
68
+ */
69
+ workerUrl?: string
63
70
  /** Zoom and compass buttons: `false`, or a corner (`true` is top-right) */
64
71
  navigation?: boolean | MapControlPosition
65
72
  /** A button that centers the map on the user's location and follows it: `false`, or a corner (`true` is top-right) */
@@ -273,10 +280,12 @@ onBeforeUnmount(() => {
273
280
  let destroyed = false
274
281
 
275
282
  onMounted(async () => {
276
- // maplibre-gl ships a UMD build: depending on the bundler its classes are on the namespace or on `default`
283
+ // maplibre-gl 5 ships a UMD build: depending on the bundler its classes are on the namespace or on `default`
277
284
  const mod = await import('maplibre-gl')
278
285
  const ml = ('Map' in mod ? mod : (mod as { default: MaplibreModule }).default) as MaplibreModule
279
286
  if (destroyed || !container.value) return
287
+ const workerUrl = props.workerUrl ?? mapWorkerUrl()
288
+ if (workerUrl) ml.setWorkerUrl(workerUrl)
280
289
  const saved = readView()
281
290
  const view = {
282
291
  center: saved.center ?? props.center,
@@ -166,11 +166,13 @@ function ensureLayers() {
166
166
  add({ id: VERTEX, type: 'circle', source: SRC.handles, filter: ['==', ['get', 'handle'], 'vertex'], paint: { ...p.vertices, 'circle-radius': 7, 'circle-stroke-width': 2.5 } })
167
167
  }
168
168
 
169
+ type SetPaint = Parameters<Maplibre.Map['setPaintProperty']>
170
+
169
171
  watch(theme, () => {
170
172
  if (!map) return
171
173
  const p = paints()
172
174
  const set = (layer: string, paint: Record<string, unknown>) => {
173
- if (map!.getLayer(layer)) for (const [k, v] of Object.entries(paint)) map!.setPaintProperty(layer, k, v)
175
+ if (map!.getLayer(layer)) for (const [k, v] of Object.entries(paint)) map!.setPaintProperty(layer, k as SetPaint[1], v as SetPaint[2])
174
176
  }
175
177
  for (const source of [SRC.done, SRC.draft]) {
176
178
  set(`${source}-fill`, p.fill)
@@ -6,6 +6,23 @@ import type { MapLayerState } from './useMapLayers'
6
6
  /** The `maplibre-gl` module (its classes: `Map`, `Marker`, `Popup`…) */
7
7
  export type MaplibreModule = typeof import('maplibre-gl')
8
8
 
9
+ let defaultWorkerUrl: string | undefined
10
+
11
+ /**
12
+ * The URL of MapLibre's worker for every `MMap` (its `workerUrl` prop wins), handed to maplibre's `setWorkerUrl()`
13
+ * when the first map loads maplibre-gl. maplibre-gl 6 needs it under a bundler, or maps stay blank; call it once at
14
+ * startup. With Vite: `import workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'`. Unlike calling
15
+ * maplibre's own `setWorkerUrl()`, it doesn't load maplibre-gl before a map needs it.
16
+ */
17
+ export function setMapWorker(url: string | undefined) {
18
+ defaultWorkerUrl = url
19
+ }
20
+
21
+ // Internal: MMap reads it after loading maplibre-gl
22
+ export function mapWorkerUrl() {
23
+ return defaultWorkerUrl
24
+ }
25
+
9
26
  /** What `MMap` provides to everything inside it. */
10
27
  export interface MapContext {
11
28
  /** The MapLibre map, once created (never on the server) */
@@ -3,8 +3,11 @@ import type * as Maplibre from 'maplibre-gl'
3
3
  import { resolveMapContext, type MapSource } from './useMap'
4
4
  import type { MapLayerInfo, MapLayerModel } from './mapAdapters'
5
5
 
6
+ /** A paint property's name (`string` in maplibre-gl 5, a typed union in 6). */
7
+ type PaintProp = Parameters<Maplibre.Map['setPaintProperty']>[1]
8
+
6
9
  /** The paint properties that make each layer type transparent. */
7
- const OPACITY: Record<string, string[]> = {
10
+ const OPACITY: Record<string, PaintProp[]> = {
8
11
  fill: ['fill-opacity'],
9
12
  line: ['line-opacity'],
10
13
  circle: ['circle-opacity', 'circle-stroke-opacity'],
package/src/map.ts CHANGED
@@ -5,7 +5,7 @@ export { default as MMapPopup } from './components/MMapPopup.vue'
5
5
  export { default as MMapGeoJson } from './components/MMapGeoJson.vue'
6
6
  export type { MapGeoJsonLayer } from './components/MMapGeoJson.vue'
7
7
  export { default as MMapControl } from './components/MMapControl.vue'
8
- export { useMap } from './composables/useMap'
8
+ export { useMap, setMapWorker } from './composables/useMap'
9
9
  export type { MapContext, MapSource, MaplibreModule } from './composables/useMap'
10
10
  export { default as MMapLayers } from './components/MMapLayers.vue'
11
11
  export { default as MMapBaseLayers } from './components/MMapBaseLayers.vue'
@@ -1 +0,0 @@
1
- {"version":3,"file":"MButton-D_uxtJa-.js","names":[],"sources":["../src/components/MButton.vue","../src/components/MButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The standard M3 button — five variants, five expressive size tiers, and either color.\n *\n * @slot default The button's label.\n */\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Visual style of the button */\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n /** HTML button type */\n type?: 'button' | 'submit' | 'reset'\n /** Disables interaction */\n disabled?: boolean\n /** Shows a spinner and disables the button */\n loading?: boolean\n /** Material Symbol icon name shown next to the label */\n icon?: string\n /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */\n iconFilled?: boolean\n /** Which side of the label the icon renders on */\n // Which side of the label `icon` renders on. Real M3 buttons support both via\n // `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n // either way at every tier, so this only changes render order, not spacing.\n iconPos?: 'leading' | 'trailing'\n /**\n * M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are\n * meant for hero-style prominent buttons, not everyday UI\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /**\n * Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md,\n * 28px lg/xl)\n */\n shape?: 'rounded' | 'squared'\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Any CSS color for the press ripple; defaults to the button's content color */\n rippleColor?: string\n /**\n * Label and icon color, over what the variant and `color` give: an M3 role (`on-surface` for a neutral text\n * button, `on-primary-container`…) or any CSS color (`#000` on a white filled button). Disabled buttons keep\n * their own\n */\n contentColor?: string\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\n// Color-role names (`on-surface`, `secondary-container`…) read the theme's token; anything else is a CSS color\nconst ROLE = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/\nconst style = computed(() => {\n const c = props.contentColor\n if (!c || props.disabled || props.loading) return customStyle.value\n return { ...customStyle.value, color: ROLE.test(c) ? `var(--color-${c})` : c }\n})\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"style\"\n v-ripple=\"{ disabled: disabled || loading, color: rippleColor }\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n </component>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The standard M3 button — five variants, five expressive size tiers, and either color.\n *\n * @slot default The button's label.\n */\nimport { computed } from 'vue'\nimport MSpinner from './MSpinner.vue'\nimport MIcon from './MIcon.vue'\nimport { vRipple } from '../directives/vRipple'\n\nconst NAMED_COLORS = ['primary', 'error'] as const\ntype NamedColor = (typeof NAMED_COLORS)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Visual style of the button */\n variant?: 'filled' | 'tonal' | 'outlined' | 'text' | 'elevated'\n /**\n * Named semantic color ('primary' | 'error') OR any CSS color string\n * ('red', '#e91e63', 'oklch(0.6 0.2 0)', …).\n * When a CSS color is passed, --color-primary is overridden for this button.\n */\n color?: string\n /** HTML button type */\n type?: 'button' | 'submit' | 'reset'\n /** Disables interaction */\n disabled?: boolean\n /** Shows a spinner and disables the button */\n loading?: boolean\n /** Material Symbol icon name shown next to the label */\n icon?: string\n /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */\n iconFilled?: boolean\n /** Which side of the label the icon renders on */\n // Which side of the label `icon` renders on. Real M3 buttons support both via\n // `ButtonDefaults.contentPaddingFor(hasStartIcon/hasEndIcon)` — padding ends up identical\n // either way at every tier, so this only changes render order, not spacing.\n iconPos?: 'leading' | 'trailing'\n /**\n * M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are\n * meant for hero-style prominent buttons, not everyday UI\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /**\n * Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md,\n * 28px lg/xl)\n */\n shape?: 'rounded' | 'squared'\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Any CSS color for the press ripple; defaults to the button's content color */\n rippleColor?: string\n /**\n * Label and icon color, over what the variant and `color` give: an M3 role (`on-surface` for a neutral text\n * button, `on-primary-container`…) or any CSS color (`#000` on a white filled button). Disabled buttons keep\n * their own\n */\n contentColor?: string\n }>(),\n {\n variant: 'filled',\n color: 'primary',\n type: 'button',\n disabled: false,\n loading: false,\n iconPos: 'leading',\n size: 'sm',\n shape: 'rounded',\n },\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\n\nconst isCustomColor = computed(\n () => !!props.color && !(NAMED_COLORS as readonly string[]).includes(props.color),\n)\n\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--color-primary': props.color,\n '--color-on-primary': '#ffffff',\n '--color-primary-container': props.color + '33',\n '--color-on-primary-container': props.color,\n }\n})\n\nconst isError = computed(() => props.color === 'error')\n\n// Color-role names (`on-surface`, `secondary-container`…) read the theme's token; anything else is a CSS color\nconst ROLE = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/\nconst style = computed(() => {\n const c = props.contentColor\n if (!c || props.disabled || props.loading) return customStyle.value\n return { ...customStyle.value, color: ROLE.test(c) ? `var(--color-${c})` : c }\n})\n\nconst base =\n 'relative inline-flex items-center justify-center font-medium ' +\n 'whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer ' +\n 'disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]'\n\n// M3 disabled tokens: container at 10% on-surface opacity (DisabledContainerOpacity, same\n// across Filled/Tonal/Elevated), content/label always at 38% on-surface (handled in `base`\n// above, applies to every variant including text/elevated which have no container). The\n// outlined border uses the SAME color role as its enabled border (OutlineVariant, not\n// on-surface) just dimmed to that 10% too — see `variantClasses`' outlined case below for\n// why the enabled color is also outline-variant, not outline.\nconst disabledContainerClasses = computed(() => {\n switch (props.variant) {\n case 'filled':\n case 'tonal':\n case 'elevated':\n return 'disabled:bg-on-surface/10'\n case 'outlined':\n return isError.value ? 'disabled:border-error/10' : 'disabled:border-outline-variant/10'\n default:\n return ''\n }\n})\n\n/*\n * M3's newer 5-tier \"expressive\" button sizing (Button{XSmall,Small,Medium,Large,\n * XLarge}Tokens.kt + Button.kt's size-variant overloads — @ExperimentalMaterial3ExpressiveApi\n * in Compose, but this `size` prop is deliberately implementing exactly that system, same\n * as MFabMenu/MLoadingIndicator already do for other Expressive-only components). Content\n * padding is IDENTICAL whether or not an icon is present at every tier in the default\n * (non \"precision pointer\") mode — e.g. `IconMediumLeadingPadding = MediumLeadingPadding`\n * verbatim in the real source — so there's deliberately no separate icon-vs-no-icon padding\n * split here, unlike the old version of this file which had one (and got the values wrong\n * in both directions). `gap` between icon and label also varies by tier (IconLabelSpace),\n * not a flat value for every size.\n */\nconst sizeMap = {\n xs: { h: 'h-8', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-1', px: 'px-3', pxText: 'px-2', squareRadius: 'rounded-md' },\n sm: { h: 'h-10', text: 'text-label-large', icon: 20, spinner: 16, gap: 'gap-2', px: 'px-4', pxText: 'px-3', squareRadius: 'rounded-md' },\n md: { h: 'h-14', text: 'text-title-medium', icon: 24, spinner: 18, gap: 'gap-2', px: 'px-6', pxText: 'px-3', squareRadius: 'rounded-lg' },\n lg: { h: 'h-24', text: 'text-headline-small', icon: 32, spinner: 26, gap: 'gap-3', px: 'px-12', pxText: 'px-4', squareRadius: 'rounded-xl' },\n xl: { h: 'h-[136px]', text: 'text-headline-large', icon: 40, spinner: 34, gap: 'gap-4', px: 'px-16', pxText: 'px-4', squareRadius: 'rounded-xl' },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.sm)\nconst sizeClasses = computed(() => `${s.value.h} ${s.value.text} ${s.value.gap}`)\nconst iconSize = computed(() => s.value.icon)\nconst spinnerSize = computed(() => s.value.spinner)\n\nconst px = computed(() => props.variant === 'text' ? s.value.pxText : s.value.px)\n\n// Squared shape radius scales with size, matching each tier's own ContainerShapeSquare\n// token (ButtonXSmallTokens/ButtonSmallTokens use CornerMedium=12px, ButtonMediumTokens\n// CornerLarge=16px, ButtonLargeTokens/ButtonXLargeTokens CornerExtraLarge=28px) — the\n// pill (ContainerShapeRound) is CornerFull at every tier, so that half doesn't vary.\nconst shapeClass = computed(() => props.shape === 'squared' ? s.value.squareRadius : 'rounded-full')\n\nconst variantClasses = computed(() => {\n const err = isError.value\n switch (props.variant) {\n case 'filled':\n return err\n ? 'bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'tonal':\n return err\n ? 'bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n : 'bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none'\n case 'elevated':\n return err\n ? 'bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2'\n : 'bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2'\n case 'outlined':\n // OutlinedButtonTokens.OutlineColor = ColorSchemeKeyTokens.OutlineVariant, not Outline\n return err\n ? 'border border-error text-error'\n : 'border border-outline-variant text-primary'\n case 'text':\n return err\n ? 'text-error'\n : 'text-primary'\n default:\n return ''\n }\n})\n</script>\n\n<template>\n <component\n :is=\"tag\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : type\"\n :disabled=\"disabled || loading\"\n :class=\"[base, shapeClass, sizeClasses, px, variantClasses, disabledContainerClasses]\"\n :style=\"style\"\n v-ripple=\"{ disabled: disabled || loading, color: rippleColor }\"\n >\n <template v-if=\"iconPos === 'leading'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n <slot />\n <template v-if=\"iconPos === 'trailing'\">\n <MSpinner v-if=\"loading\" :size=\"spinnerSize\" />\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"iconSize\" :filled=\"iconFilled\" />\n </template>\n </component>\n</template>\n"],"mappings":";;;;;AAkGA,IAAM,IACJ;;;;;;;;;;;;;;;;;;;;;;;;EAxFF,IAAM,IAAe,CAAC,WAAW,OAAO,GAGlC,IAAQ,GA0DR,IAAM,QAAe,EAAM,KAAK,eAAe,QAAQ,GAEvD,IAAgB,QACd,CAAC,CAAC,EAAM,SAAS,CAAE,EAAmC,SAAS,EAAM,KAAK,CAClF,GAEM,IAAc,QAAe;GAC5B,MAAc,OACnB,OAAO;IACL,mBAAmB,EAAM;IACzB,sBAAsB;IACtB,6BAA6B,EAAM,QAAQ;IAC3C,gCAAgC,EAAM;GACxC;EACF,CAAC,GAEK,IAAU,QAAe,EAAM,UAAU,OAAO,GAGhD,IAAO,4HACP,IAAQ,QAAe;GAC3B,IAAM,IAAI,EAAM;GAEhB,OADI,CAAC,KAAK,EAAM,YAAY,EAAM,UAAgB,EAAY,QACvD;IAAE,GAAG,EAAY;IAAO,OAAO,E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S,EAAA;EAAW,CAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MDialog-DT4KAPmn.js","names":["$attrs","$slots"],"sources":["../src/composables/_useScrollLock.ts","../src/components/MDialog.vue","../src/components/MDialog.vue"],"sourcesContent":["import { getCurrentInstance, onBeforeUnmount, watch, type WatchSource } from 'vue'\n\n/*\n * Internal (not exported from index.ts): locks the page's scroll (body overflow hidden) while a modal surface is\n * open, shared by every component that does it. Counted, so overlays stacked on each other (a select's modal or a\n * date picker inside an MDialog) release it only when the last one closes: each component used to write\n * `overflow = ''` on its own, so closing the inner one let the page under the outer one scroll again. Each\n * instance also releases what it holds when it unmounts (a dialog removed while open left the page locked for good)\n * and nothing when it holds nothing (a select unmounting inside an open dialog used to unlock it).\n */\n\nlet count = 0\nlet previous = ''\n\nfunction lock() {\n if (count++ === 0) {\n previous = document.body.style.overflow\n document.body.style.overflow = 'hidden'\n }\n}\n\nfunction unlock() {\n if (count > 0 && --count === 0) document.body.style.overflow = previous\n}\n\n/**\n * Locks the page's scroll while `active` is true (from the start too: a dialog mounted open locks it), and releases\n * it when it turns false or the component unmounts. Without `active`, drive it with the returned `set`.\n */\nexport function useScrollLock(active?: WatchSource<boolean>) {\n let held = false\n function set(on: boolean) {\n if (typeof document === 'undefined' || on === held) return\n held = on\n if (on) lock()\n else unlock()\n }\n if (active) watch(active, (on) => set(!!on), { immediate: true })\n if (getCurrentInstance()) onBeforeUnmount(() => set(false))\n return { set }\n}\n","<script setup lang=\"ts\">\n/**\n * The generic M3 modal shell — Escape, scroll lock, and Teleport are handled internally. Supports a centered\n * card, a full-screen variant, and an optional icon that centers the title per spec.\n *\n * @slot icon M3 AlertDialog's optional icon (Secondary color, 24dp expected). Its presence also centers the\n * title, per spec.\n * @slot title Overrides the title prop with custom markup\n * @slot default Dialog body content — scrolls independently when taller than maxHeight. With `bare`, the whole\n * dialog: it fills the box (no title, padding, close button or actions row)\n * @slot actions Row of action buttons — wraps to a new line instead of overflowing when labels are long\n * @event update:modelValue Emitted when the dialog should open/close — powers v-model\n */\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { useScrollLock } from '../composables/_useScrollLock'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\n\nconst props = withDefaults(\n defineProps<{\n /** Open/closed state (v-model) */\n modelValue: boolean\n /** Dialog title (overridable via the #title slot) */\n title?: string\n /** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */\n maxWidth?: string\n /**\n * Maximum height: a Tailwind class (`max-h-[60vh]`) or a CSS value (`480px`, `calc(100dvh - 4rem)`). When the\n * content is taller, the body scrolls and a divider appears above the actions.\n */\n // A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has\n // no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen\n // viewport-relative cap, not a spec value.\n maxHeight?: string\n /** Prevent closing by clicking the scrim, pressing Escape, or the X button */\n persistent?: boolean\n /** Full-screen variant — slides up from the bottom, covers the entire viewport */\n fullscreen?: boolean\n /** Aria label for the close (X) button — falls back to the locale string when omitted */\n closeLabel?: string\n /**\n * Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be\n * turned off\n */\n // Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n // button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n // deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n // this component's existing behavior) rather than added unconditionally.\n closable?: boolean\n /**\n * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default\n * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves\n * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`\n * then only names it for assistive technology\n */\n bare?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n bare: false,\n },\n)\n\n// The root is a Teleport, which can't take the consumer's class/style/attrs: they go on the dialog's surface\ndefineOptions({ inheritAttrs: false })\n\nconst locale = useLocale()\n\n// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function\n// can't be a class, so those go to inline style instead.\nconst isCssValue = (v: string) => /^-?[\\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\\(/i.test(v.trim())\nconst sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))\nconst sizeStyle = computed(() => ({\n ...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),\n ...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nuseScrollLock(() => props.modelValue)\n// Escape closes the dialog on top only, when several are stacked\nuseEscapeStack(() => props.modelValue, close)\n\nconst titleId = `m3-dialog-${useId()}`\n\nwatch(\n () => props.modelValue,\n async (open) => {\n // Server rendering (a dialog open on load runs this immediately): nothing to measure or observe\n if (typeof window === 'undefined') return\n if (open) {\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n { immediate: true },\n)\n\nonUnmounted(() => {\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\" appear>\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n v-bind=\"$attrs\"\n class=\"dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col\"\n :class=\"sizeClasses\"\n :style=\"sizeStyle\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole dialog (scrolling if taller than maxHeight), clipped to the box's\n corners (rounded-[inherit]) so content reaching its edges, like a full-bleed image, keeps them -->\n <div v-if=\"bare\" class=\"min-h-0 overflow-y-auto rounded-[inherit]\">\n <slot />\n </div>\n <template v-else>\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n :id=\"titleId\"\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </template>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\" appear>\n <div\n v-if=\"modelValue\"\n v-bind=\"$attrs\"\n class=\"dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole screen, top bar included, in whatever colors it draws -->\n <div v-if=\"bare\" class=\"min-h-0 flex-1 overflow-y-auto\">\n <slot />\n </div>\n <div v-else class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 :id=\"titleId\" class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div v-if=\"!bare\" class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n\n<style>\n/* The surfaces' look, in the base layer so the consumer's classes on MDialog win (see MShape) */\n@layer base {\n .m3-dialog-surface {\n background-color: var(--color-surface-container-high);\n border-radius: var(--radius-xl);\n box-shadow: var(--shadow-elevation-3);\n }\n .m3-dialog-fs-surface {\n background-color: var(--color-surface);\n }\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * The generic M3 modal shell — Escape, scroll lock, and Teleport are handled internally. Supports a centered\n * card, a full-screen variant, and an optional icon that centers the title per spec.\n *\n * @slot icon M3 AlertDialog's optional icon (Secondary color, 24dp expected). Its presence also centers the\n * title, per spec.\n * @slot title Overrides the title prop with custom markup\n * @slot default Dialog body content — scrolls independently when taller than maxHeight. With `bare`, the whole\n * dialog: it fills the box (no title, padding, close button or actions row)\n * @slot actions Row of action buttons — wraps to a new line instead of overflowing when labels are long\n * @event update:modelValue Emitted when the dialog should open/close — powers v-model\n */\nimport { computed, nextTick, onUnmounted, ref, useId, watch } from 'vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { useScrollLock } from '../composables/_useScrollLock'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\n\nconst props = withDefaults(\n defineProps<{\n /** Open/closed state (v-model) */\n modelValue: boolean\n /** Dialog title (overridable via the #title slot) */\n title?: string\n /** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */\n maxWidth?: string\n /**\n * Maximum height: a Tailwind class (`max-h-[60vh]`) or a CSS value (`480px`, `calc(100dvh - 4rem)`). When the\n * content is taller, the body scrolls and a divider appears above the actions.\n */\n // A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has\n // no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen\n // viewport-relative cap, not a spec value.\n maxHeight?: string\n /** Prevent closing by clicking the scrim, pressing Escape, or the X button */\n persistent?: boolean\n /** Full-screen variant — slides up from the bottom, covers the entire viewport */\n fullscreen?: boolean\n /** Aria label for the close (X) button — falls back to the locale string when omitted */\n closeLabel?: string\n /**\n * Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be\n * turned off\n */\n // Whether the header shows a close (\"X\") icon button. M3's `AlertDialog` spec has no such\n // button — it expects only a Cancel/Confirm text button in the actions row — so this is a\n // deliberate library extension on top of the spec, kept opt-out (default `true`, matching\n // this component's existing behavior) rather than added unconditionally.\n closable?: boolean\n /**\n * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default\n * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves\n * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`\n * then only names it for assistive technology\n */\n bare?: boolean\n }>(),\n {\n // AlertDialogDefaults.DialogMaxWidth = 560dp\n maxWidth: 'max-w-[560px]',\n maxHeight: 'max-h-[90vh]',\n persistent: false,\n fullscreen: false,\n closable: true,\n bare: false,\n },\n)\n\n// The root is a Teleport, which can't take the consumer's class/style/attrs: they go on the dialog's surface\ndefineOptions({ inheritAttrs: false })\n\nconst locale = useLocale()\n\n// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function\n// can't be a class, so those go to inline style instead.\nconst isCssValue = (v: string) => /^-?[\\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\\(/i.test(v.trim())\nconst sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))\nconst sizeStyle = computed(() => ({\n ...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),\n ...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),\n}))\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\nfunction close() {\n if (props.persistent) return\n emit('update:modelValue', false)\n}\n\n\n// M3's dialog anatomy lists an optional divider between the (scrollable) content and the\n// actions row — Compose's own AlertDialog.kt has no built-in implementation of it at all, so\n// this shows it only when the content actually has more to scroll to, above the actions row.\nconst contentEl = ref<HTMLElement>()\nconst contentInnerEl = ref<HTMLElement>()\nconst showDivider = ref(false)\nlet resizeObserver: ResizeObserver | undefined\n\nfunction updateDividerVisibility() {\n const el = contentEl.value\n if (!el) { showDivider.value = false; return }\n showDivider.value = el.scrollHeight - el.scrollTop - el.clientHeight > 1\n}\n\nuseScrollLock(() => props.modelValue)\n// Escape closes the dialog on top only, when several are stacked\nuseEscapeStack(() => props.modelValue, close)\n\nconst titleId = `m3-dialog-${useId()}`\n\nwatch(\n () => props.modelValue,\n async (open) => {\n // Server rendering (a dialog open on load runs this immediately): nothing to measure or observe\n if (typeof window === 'undefined') return\n if (open) {\n await nextTick()\n updateDividerVisibility()\n // Observing contentEl alone only catches viewport-driven resizes (e.g. window resize\n // changing the maxHeight cap) — its own box stays put when the *slotted* content\n // changes height, since overflow doesn't affect the scroll container's own size. The\n // inner wrapper around the slot grows/shrinks with the actual content, so that's what\n // needs observing to catch dynamic content (reactive text, async-loaded content, etc).\n resizeObserver = new ResizeObserver(updateDividerVisibility)\n if (contentEl.value) resizeObserver.observe(contentEl.value)\n if (contentInnerEl.value) resizeObserver.observe(contentInnerEl.value)\n } else {\n resizeObserver?.disconnect()\n resizeObserver = undefined\n }\n },\n { immediate: true },\n)\n\nonUnmounted(() => {\n resizeObserver?.disconnect()\n})\n</script>\n\n<template>\n <Teleport to=\"body\">\n <!-- Basic dialog -->\n <!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->\n <Transition v-if=\"!fullscreen\" name=\"m3-dialog\" appear>\n <div\n v-if=\"modelValue\"\n class=\"fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4\"\n @click.self=\"close\"\n >\n <div\n v-bind=\"$attrs\"\n class=\"dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col\"\n :class=\"sizeClasses\"\n :style=\"sizeStyle\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole dialog (scrolling if taller than maxHeight), clipped to the box's\n corners (rounded-[inherit]) so content reaching its edges, like a full-bleed image, keeps them -->\n <div v-if=\"bare\" class=\"min-h-0 overflow-y-auto rounded-[inherit]\">\n <slot />\n </div>\n <template v-else>\n <!--\n AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content\n column, with per-element bottom paddings (IconPadding/TitlePadding/textPadding)\n providing the gaps BETWEEN elements — not a single wrapping padding, since this\n template uses separate divs per section instead of one padded Column. Each\n section's own top/bottom classes are chosen so the combined gaps still land on\n the right dp value: title-to-body is 16dp (8px here + 8px there), body-to-actions\n is 24dp (8px here + 16px there), and the outermost edges (top of title, bottom of\n whichever section is last) are the full 24dp on their own.\n -->\n <div class=\"relative px-6 pt-6 pb-2\">\n <!--\n Wrapped in a plain div rather than passing `absolute right-4 top-4` straight to\n MIconButton: its root already carries its own `relative` (for the ripple span),\n and Tailwind resolves conflicting position utilities by source order in the\n compiled CSS, not by order in the class attribute — so an external `absolute`\n can silently lose to that internal `relative` instead of overriding it.\n -->\n <div v-if=\"closable && !persistent\" class=\"absolute right-4 top-4\">\n <MIconButton icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n </div>\n <!--\n Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,\n IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),\n which per spec also centers the title (\"Align the title to the center when an\n icon is present\") — reserving `pr-10` on the title only when the close button is\n also showing, so a centered title doesn't collide with it.\n -->\n <div v-if=\"$slots.icon\" class=\"mb-4 flex justify-center text-secondary\">\n <slot name=\"icon\" />\n </div>\n <h2\n :id=\"titleId\"\n class=\"text-headline-small text-on-surface\"\n :class=\"[\n $slots.icon ? 'text-center' : 'text-left',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pr-10') : '',\n ]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n </div>\n <div\n ref=\"contentEl\"\n class=\"overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant\"\n :class=\"$slots.actions ? 'pb-2' : 'pb-6'\"\n @scroll=\"updateDividerVisibility\"\n >\n <div ref=\"contentInnerEl\">\n <slot />\n </div>\n </div>\n <!-- Divider: M3 dialog anatomy's optional divider, shown only while the content has more to scroll to -->\n <div v-if=\"showDivider && $slots.actions\" class=\"shrink-0 border-t border-outline-variant\" />\n <!-- flex-wrap approximates AlertDialogFlowRow: buttons wrap to a new line instead of overflowing when labels are too long to fit on one -->\n <div v-if=\"$slots.actions\" class=\"flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6\">\n <slot name=\"actions\" />\n </div>\n </template>\n </div>\n </div>\n </Transition>\n\n <!-- Fullscreen dialog -->\n <Transition v-else name=\"m3-dialog-fs\" appear>\n <div\n v-if=\"modelValue\"\n v-bind=\"$attrs\"\n class=\"dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-labelledby=\"!bare && ($slots.title || title) ? titleId : undefined\"\n :aria-label=\"bare ? title : undefined\"\n >\n <!-- Bare: the content is the whole screen, top bar included, in whatever colors it draws -->\n <div v-if=\"bare\" class=\"min-h-0 flex-1 overflow-y-auto\">\n <slot />\n </div>\n <div v-else class=\"flex h-14 shrink-0 items-center gap-2 px-2\">\n <MIconButton v-if=\"!persistent\" icon=\"close\" :label=\"closeLabel ?? locale.close\" @click=\"close\" />\n <h2 :id=\"titleId\" class=\"flex-1 text-title-large font-medium text-on-surface\">\n <slot name=\"title\">{{ title }}</slot>\n </h2>\n <div v-if=\"$slots.actions\" class=\"flex items-center gap-2\">\n <slot name=\"actions\" />\n </div>\n </div>\n <div v-if=\"!bare\" class=\"flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant\">\n <slot />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.m3-dialog-enter-active,\n.m3-dialog-leave-active {\n transition: opacity 0.15s ease;\n}\n.m3-dialog-enter-from,\n.m3-dialog-leave-to {\n opacity: 0;\n}\n.m3-dialog-enter-active .dialog-box,\n.m3-dialog-leave-active .dialog-box {\n transition: transform 0.15s ease;\n}\n.m3-dialog-enter-from .dialog-box,\n.m3-dialog-leave-to .dialog-box {\n transform: scale(0.95);\n}\n\n.m3-dialog-fs-enter-active,\n.m3-dialog-fs-leave-active {\n transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s ease;\n}\n.m3-dialog-fs-enter-from {\n transform: translateY(100%);\n opacity: 0;\n}\n.m3-dialog-fs-leave-to {\n transform: translateY(100%);\n opacity: 0;\n}\n</style>\n\n<style>\n/* The surfaces' look, in the base layer so the consumer's classes on MDialog win (see MShape) */\n@layer base {\n .m3-dialog-surface {\n background-color: var(--color-surface-container-high);\n border-radius: var(--radius-xl);\n box-shadow: var(--shadow-elevation-3);\n }\n .m3-dialog-fs-surface {\n background-color: var(--color-surface);\n }\n}\n</style>\n"],"mappings":";;;;;;AAWA,IAAI,IAAQ,GACR,IAAW;AAEf,SAAS,IAAO;CACd,AAAI,QAAY,MACd,IAAW,SAAS,KAAK,MAAM,UAC/B,SAAS,KAAK,MAAM,WAAW;AAEnC;AAEA,SAAS,IAAS;CAChB,AAAI,IAAQ,KAAK,EAAE,MAAU,MAAG,SAAS,KAAK,MAAM,WAAW;AACjE;AAMA,SAAgB,EAAc,GAA+B;CAC3D,IAAI,IAAO;CACX,SAAS,EAAI,GAAa;EACpB,OAAO,WAAa,OAAe,MAAO,MAC9C,IAAO,GACH,IAAI,EAAK,IACR,EAAO;CACd;CAGA,OAFI,KAAQ,EAAM,IAAS,MAAO,EAAI,CAAC,CAAC,CAAE,GAAG,EAAE,WAAW,GAAK,CAAC,GAC5D,EAAmB,KAAG,QAAsB,EAAI,EAAK,CAAC,GACnD,EAAE,OAAI;AACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECrBA,IAAM,IAAQ,GAqDR,IAAS,EAAU,GAInB,KAAc,MAAc,iDAAiD,KAAK,EAAE,KAAK,CAAC,GAC1F,IAAc,QAAe,CAAC,EAAM,UAAU,EAAM,SAAS,CAAC,CAAC,QAAQ,MAAM,CAAC,EAAW,CAAC,CAAC,CAAC,GAC5F,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GAAA,CAAA,GAAA,EAAA;IAID,EAAA,SAAeA,EAAAA,OAAO,WAAjC,EAAA,GAAA,EAA6F,OAA7F,CAA6F,KAAA,EAAA,IAAA,EAAA;IAElFA,EAAAA,OAAO,WAAlB,EAAA,GAAA,EAEM,OAFN,GAEM,CADJ,EAAuB,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;;;EAQjC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MIcon-Bxh9j135.js","names":[],"sources":["../src/components/MIcon.vue","../src/components/MIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class). Decorative by default: hidden from assistive technology, which would otherwise read the\n * glyph's ligature text (its name, e.g. \"arrow_drop_down\"). Give it a `label` when the icon says something on its own.\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */\n filled?: boolean\n /** What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration */\n label?: string\n}>(), { size: 24, filled: false })\n</script>\n\n<template>\n <span\n class=\"material-symbols-outlined leading-none\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n :style=\"{ fontSize: `${size}px`, fontVariationSettings: filled ? `'FILL' 1` : undefined }\"\n >{{ name }}</span>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class). Decorative by default: hidden from assistive technology, which would otherwise read the\n * glyph's ligature text (its name, e.g. \"arrow_drop_down\"). Give it a `label` when the icon says something on its own.\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */\n filled?: boolean\n /** What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration */\n label?: string\n}>(), { size: 24, filled: false })\n</script>\n\n<template>\n <span\n class=\"material-symbols-outlined leading-none\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n :style=\"{ fontSize: `${size}px`, fontVariationSettings: filled ? `'FILL' 1` : undefined }\"\n >{{ name }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;oBAmBE,EAAA,GAAA,EAMkB,QAAA;GALhB,OAAM;GACL,MAAM,EAAA,QAAK,QAAW,KAAA;GACtB,cAAY,EAAA;GACZ,eAAa,EAAA,QAAQ,KAAA,IAAS;GAC9B,OAAK,EAAA;IAAA,UAAA,GAAiB,EAAA,KAAI;IAAA,uBAA6B,EAAA,SAAM,aAAgB,KAAA;GAAS,CAAA;EACrF,GAAA,EAAA,EAAA,IAAI,GAAA,IAAA,CAAA"}