@m3ui-vue/m3ui-vue 1.8.1 → 1.10.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 (352) hide show
  1. package/README.md +2 -0
  2. package/dist/API.md +329 -21
  3. package/dist/{MButton-B6eZTfFV.js → MButton-B9RCM06i.js} +5 -5
  4. package/dist/MButton-B9RCM06i.js.map +1 -0
  5. package/dist/{MColorPickerModal-Dajjf6tH.js → MColorPickerModal-ChRtcZOo.js} +185 -185
  6. package/dist/MColorPickerModal-ChRtcZOo.js.map +1 -0
  7. package/dist/{MDialog-DQvE_JBv.js → MDialog-dk07tify.js} +7 -7
  8. package/dist/{MDialog-DQvE_JBv.js.map → MDialog-dk07tify.js.map} +1 -1
  9. package/dist/MIcon-BSsJZhK7.js +116 -0
  10. package/dist/MIcon-BSsJZhK7.js.map +1 -0
  11. package/dist/{MIconButton-BBggVwBV.js → MIconButton-CrBPZidd.js} +59 -52
  12. package/dist/MIconButton-CrBPZidd.js.map +1 -0
  13. package/dist/MListItem-h9H223vx.js +1239 -0
  14. package/dist/MListItem-h9H223vx.js.map +1 -0
  15. package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-YTV1Ov5w.js} +2 -2
  16. package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-YTV1Ov5w.js.map} +1 -1
  17. package/dist/MMenuItem-US0Zbglq.js +596 -0
  18. package/dist/MMenuItem-US0Zbglq.js.map +1 -0
  19. package/dist/{MPdfViewer-C5ngKPRM.js → MPdfViewer-DL9mRsd2.js} +9 -9
  20. package/dist/{MPdfViewer-C5ngKPRM.js.map → MPdfViewer-DL9mRsd2.js.map} +1 -1
  21. package/dist/MProgressBar-BzZMxq7M.js +254 -0
  22. package/dist/MProgressBar-BzZMxq7M.js.map +1 -0
  23. package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-JFZcoJ8y.js} +2 -2
  24. package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-JFZcoJ8y.js.map} +1 -1
  25. package/dist/MSegmentedButton-DMou-8sG.js +106 -0
  26. package/dist/MSegmentedButton-DMou-8sG.js.map +1 -0
  27. package/dist/{MSignaturePad-CxOtelzE.js → MSignaturePad-WuvE_Cyl.js} +2 -2
  28. package/dist/{MSignaturePad-CxOtelzE.js.map → MSignaturePad-WuvE_Cyl.js.map} +1 -1
  29. package/dist/MSlider-7TzhFHKS.js +745 -0
  30. package/dist/MSlider-7TzhFHKS.js.map +1 -0
  31. package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CkIVBuGE.js} +2 -2
  32. package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CkIVBuGE.js.map} +1 -1
  33. package/dist/{MTextField-CYk9yFvi.js → MTextField-B6_iOczK.js} +18 -18
  34. package/dist/MTextField-B6_iOczK.js.map +1 -0
  35. package/dist/MTooltip-Cn_DYm9M.js +90 -0
  36. package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
  37. package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
  38. package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
  39. package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-COBJ1tWr.js} +2 -2
  40. package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-COBJ1tWr.js.map} +1 -1
  41. package/dist/api.json +1 -1
  42. package/dist/code-editor.js +129 -128
  43. package/dist/code-editor.js.map +1 -1
  44. package/dist/components/MAddressField.vue.d.ts +1 -1
  45. package/dist/components/MAudioPlayer.vue.d.ts +1 -1
  46. package/dist/components/MAutocomplete.vue.d.ts +1 -1
  47. package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
  48. package/dist/components/MAvatarGroup.vue.d.ts +48 -0
  49. package/dist/components/MBadge.vue.d.ts +2 -2
  50. package/dist/components/MBar.vue.d.ts +1 -1
  51. package/dist/components/MBeforeAfter.vue.d.ts +3 -3
  52. package/dist/components/MButton.vue.d.ts +1 -1
  53. package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
  54. package/dist/components/MChatBubble.vue.d.ts +1 -1
  55. package/dist/components/MCodeEditor.vue.d.ts +1 -1
  56. package/dist/components/MCommentThread.vue.d.ts +42 -0
  57. package/dist/components/MContainer.vue.d.ts +1 -1
  58. package/dist/components/MContainerTransform.vue.d.ts +1 -1
  59. package/dist/components/MContextMenu.vue.d.ts +7 -0
  60. package/dist/components/MCopyButton.vue.d.ts +2 -2
  61. package/dist/components/MCountrySelect.vue.d.ts +1 -1
  62. package/dist/components/MCreditCardInput.vue.d.ts +2 -2
  63. package/dist/components/MDataTable.vue.d.ts +7 -0
  64. package/dist/components/MDiffViewer.vue.d.ts +1 -1
  65. package/dist/components/MDrawCanvas.vue.d.ts +2 -2
  66. package/dist/components/MExpansionPanel.vue.d.ts +1 -1
  67. package/dist/components/MExportButton.vue.d.ts +1 -1
  68. package/dist/components/MFab.vue.d.ts +1 -1
  69. package/dist/components/MFilterBuilder.vue.d.ts +1 -1
  70. package/dist/components/MFlex.vue.d.ts +2 -2
  71. package/dist/components/MFloorPlan.vue.d.ts +2 -2
  72. package/dist/components/MFlow.vue.d.ts +2 -2
  73. package/dist/components/MFormRenderer.vue.d.ts +2 -2
  74. package/dist/components/MGantt.vue.d.ts +2 -2
  75. package/dist/components/MGanttControls.vue.d.ts +1 -1
  76. package/dist/components/MGrid.vue.d.ts +1 -1
  77. package/dist/components/MIcon.vue.d.ts +3 -5
  78. package/dist/components/MIconButton.vue.d.ts +1 -1
  79. package/dist/components/MLightbox.vue.d.ts +2 -2
  80. package/dist/components/MList.vue.d.ts +11 -0
  81. package/dist/components/MListDetail.vue.d.ts +22 -0
  82. package/dist/components/MListItem.vue.d.ts +9 -1
  83. package/dist/components/MMapMeasure.vue.d.ts +2 -2
  84. package/dist/components/MMenu.vue.d.ts +16 -3
  85. package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
  86. package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
  87. package/dist/components/MMultiSelect.vue.d.ts +1 -1
  88. package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
  89. package/dist/components/MNavigationRail.vue.d.ts +1 -1
  90. package/dist/components/MNumberField.vue.d.ts +1 -1
  91. package/dist/components/MOdontogram.vue.d.ts +2 -2
  92. package/dist/components/MPhoneInput.vue.d.ts +2 -2
  93. package/dist/components/MPinInput.vue.d.ts +3 -3
  94. package/dist/components/MPosKeypad.vue.d.ts +1 -1
  95. package/dist/components/MProductConfigurator.vue.d.ts +1 -1
  96. package/dist/components/MReactions.vue.d.ts +35 -0
  97. package/dist/components/MResourceTimeline.vue.d.ts +2 -2
  98. package/dist/components/MRichTextEditor.vue.d.ts +1 -1
  99. package/dist/components/MScaffold.vue.d.ts +45 -0
  100. package/dist/components/MScheme.vue.d.ts +1 -1
  101. package/dist/components/MScrollField.vue.d.ts +4 -1
  102. package/dist/components/MScrollable.vue.d.ts +5 -4
  103. package/dist/components/MSearchBar.vue.d.ts +2 -2
  104. package/dist/components/MSearchField.vue.d.ts +1 -1
  105. package/dist/components/MSeatMap.vue.d.ts +1 -1
  106. package/dist/components/MSeekBar.vue.d.ts +2 -2
  107. package/dist/components/MSelect.vue.d.ts +1 -1
  108. package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
  109. package/dist/components/MSkeleton.vue.d.ts +1 -1
  110. package/dist/components/MSpreadsheet.vue.d.ts +3 -3
  111. package/dist/components/MStack.vue.d.ts +2 -2
  112. package/dist/components/MSubtitle.vue.d.ts +1 -1
  113. package/dist/components/MSupportingPane.vue.d.ts +22 -0
  114. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  115. package/dist/components/MSwitch.vue.d.ts +1 -1
  116. package/dist/components/MTable.vue.d.ts +7 -0
  117. package/dist/components/MTagInput.vue.d.ts +1 -1
  118. package/dist/components/MText.vue.d.ts +1 -1
  119. package/dist/components/MTextField.vue.d.ts +3 -3
  120. package/dist/components/MTimeScroll.vue.d.ts +1 -1
  121. package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
  122. package/dist/components/MTitle.vue.d.ts +1 -1
  123. package/dist/components/MToolbar.vue.d.ts +1 -1
  124. package/dist/components/MTooltip.vue.d.ts +1 -1
  125. package/dist/components/MTopAppBar.vue.d.ts +2 -2
  126. package/dist/components/MVirtualList.vue.d.ts +51 -0
  127. package/dist/components/MVitalsChart.vue.d.ts +1 -1
  128. package/dist/components/MWindow.vue.d.ts +3 -3
  129. package/dist/components/_MComment.vue.d.ts +8 -0
  130. package/dist/components/_MCommentComposer.vue.d.ts +23 -0
  131. package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
  132. package/dist/components/_commentThread.d.ts +41 -0
  133. package/dist/composables/_fieldLayout.d.ts +8 -8
  134. package/dist/composables/_menuGroups.d.ts +7 -0
  135. package/dist/composables/_popupPosition.d.ts +3 -2
  136. package/dist/composables/_rtl.d.ts +26 -0
  137. package/dist/composables/_usePaneResize.d.ts +45 -0
  138. package/dist/composables/useColorPalette.d.ts +1 -1
  139. package/dist/composables/useLocale.d.ts +26 -0
  140. package/dist/composables/useUndo.d.ts +45 -0
  141. package/dist/directives/vRipple.d.ts +4 -0
  142. package/dist/draw.js +5 -5
  143. package/dist/flow.js +2 -2
  144. package/dist/gantt.js +3 -3
  145. package/dist/index.d.ts +12 -0
  146. package/dist/locales/ar.d.ts +6 -0
  147. package/dist/locales/index.d.ts +1 -0
  148. package/dist/locales/index.js +896 -1
  149. package/dist/locales/index.js.map +1 -1
  150. package/dist/m3ui-vue.css +1 -1
  151. package/dist/m3ui.js +10862 -9655
  152. package/dist/m3ui.js.map +1 -1
  153. package/dist/map.js +1127 -1149
  154. package/dist/map.js.map +1 -1
  155. package/dist/markdown.js +1 -1
  156. package/dist/markdown.js.map +1 -1
  157. package/dist/media.js +7 -7
  158. package/dist/pdf-sign.js +9 -9
  159. package/dist/pdf.js +1 -1
  160. package/dist/plugin.d.ts +14 -0
  161. package/dist/rich-text-editor.js +79 -78
  162. package/dist/rich-text-editor.js.map +1 -1
  163. package/dist/styles/theme.css +56 -6
  164. package/dist/styles.css +1 -1
  165. package/dist/terminal.js +5 -2
  166. package/dist/terminal.js.map +1 -1
  167. package/dist/{useLocale-DL96OFgr.js → useLocale-YRaOT12S.js} +19 -1
  168. package/dist/useLocale-YRaOT12S.js.map +1 -0
  169. package/dist/vTooltip-xESB2YOb.js +154 -0
  170. package/dist/vTooltip-xESB2YOb.js.map +1 -0
  171. package/package.json +1 -1
  172. package/src/__tests__/MAddressField.test.ts +1 -1
  173. package/src/__tests__/MChip.test.ts +3 -3
  174. package/src/__tests__/MFab.test.ts +6 -6
  175. package/src/__tests__/MListItemNestedControl.test.ts +3 -3
  176. package/src/__tests__/MListMultiSelect.test.ts +132 -0
  177. package/src/__tests__/MMenu.test.ts +152 -0
  178. package/src/__tests__/MProgressBar.test.ts +84 -1
  179. package/src/__tests__/MScheduler.test.ts +1 -1
  180. package/src/__tests__/MScrollField.test.ts +16 -0
  181. package/src/__tests__/MScrollable.test.ts +61 -5
  182. package/src/__tests__/MSwitch.test.ts +83 -0
  183. package/src/__tests__/MTrackingTimeline.test.ts +1 -1
  184. package/src/__tests__/MWindow.test.ts +16 -0
  185. package/src/__tests__/adaptiveLayouts.test.ts +167 -0
  186. package/src/__tests__/backlogComponents.test.ts +249 -0
  187. package/src/__tests__/fieldOverflow.test.ts +9 -9
  188. package/src/__tests__/hydration.test.ts +39 -0
  189. package/src/__tests__/localePresets.test.ts +2 -0
  190. package/src/__tests__/popupPosition.test.ts +4 -0
  191. package/src/__tests__/rtl.test.ts +167 -0
  192. package/src/__tests__/ssr.test.ts +6 -0
  193. package/src/__tests__/stateLayerOpacity.test.ts +65 -0
  194. package/src/__tests__/tableCheckboxReveal.test.ts +35 -0
  195. package/src/__tests__/vRipple.test.ts +62 -0
  196. package/src/components/MAlert.vue +1 -1
  197. package/src/components/MAutocomplete.vue +7 -7
  198. package/src/components/MAvailabilityCalendar.vue +5 -3
  199. package/src/components/MAvatarGroup.vue +150 -0
  200. package/src/components/MBadge.vue +12 -3
  201. package/src/components/MBar.vue +1 -1
  202. package/src/components/MBottomAppBar.vue +1 -1
  203. package/src/components/MButton.vue +1 -1
  204. package/src/components/MButtonGroup.vue +1 -1
  205. package/src/components/MCalendar.vue +3 -3
  206. package/src/components/MCalendarHeatmap.vue +3 -3
  207. package/src/components/MCard.vue +4 -2
  208. package/src/components/MChatBubble.vue +3 -3
  209. package/src/components/MCheckbox.vue +13 -2
  210. package/src/components/MChip.vue +12 -9
  211. package/src/components/MCircleProgressBar.vue +69 -21
  212. package/src/components/MCodeEditor.vue +7 -3
  213. package/src/components/MColorPicker.vue +1 -1
  214. package/src/components/MCommandPalette.vue +1 -1
  215. package/src/components/MCommentThread.vue +131 -0
  216. package/src/components/MContainerTransform.vue +1 -1
  217. package/src/components/MContextMenu.vue +18 -31
  218. package/src/components/MDataTable.vue +21 -11
  219. package/src/components/MDatePicker.vue +3 -2
  220. package/src/components/MDateRangePicker.vue +3 -2
  221. package/src/components/MDialog.vue +5 -5
  222. package/src/components/MDiffViewer.vue +1 -1
  223. package/src/components/MDivider.vue +1 -1
  224. package/src/components/MDragDropList.vue +1 -1
  225. package/src/components/MEmojiSelector.vue +11 -7
  226. package/src/components/MExpansionPanel.vue +1 -1
  227. package/src/components/MFab.vue +7 -7
  228. package/src/components/MFormBuilder.vue +3 -3
  229. package/src/components/MIcon.vue +14 -2
  230. package/src/components/MIconButton.vue +2 -2
  231. package/src/components/MJsonEditor.vue +1 -3
  232. package/src/components/MJsonViewer.vue +1 -1
  233. package/src/components/MKanban.vue +2 -1
  234. package/src/components/MList.vue +163 -5
  235. package/src/components/MListDetail.vue +102 -16
  236. package/src/components/MListGroup.vue +1 -1
  237. package/src/components/MListItem.vue +71 -11
  238. package/src/components/MListSubheader.vue +1 -1
  239. package/src/components/MMapDraw.vue +3 -2
  240. package/src/components/MMapHover.vue +2 -1
  241. package/src/components/MMapMeasure.vue +2 -1
  242. package/src/components/MMapRoute.vue +2 -1
  243. package/src/components/MMarkdown.vue +9 -6
  244. package/src/components/MMaskField.vue +6 -6
  245. package/src/components/MMenu.vue +59 -45
  246. package/src/components/MMenuItem.vue +54 -18
  247. package/src/components/MMultiAutocomplete.vue +9 -8
  248. package/src/components/MMultiSelect.vue +9 -8
  249. package/src/components/MNavigationDrawer.vue +39 -27
  250. package/src/components/MNavigationRail.vue +28 -19
  251. package/src/components/MNavigationSuite.vue +1 -1
  252. package/src/components/MNotificationCenter.vue +1 -1
  253. package/src/components/MNotificationHost.vue +1 -1
  254. package/src/components/MNumberField.vue +6 -6
  255. package/src/components/MOrderTicket.vue +1 -1
  256. package/src/components/MPageProgress.vue +1 -1
  257. package/src/components/MPhoneInput.vue +5 -4
  258. package/src/components/MPinInput.vue +3 -2
  259. package/src/components/MPosKeypad.vue +2 -1
  260. package/src/components/MProductConfigurator.vue +2 -1
  261. package/src/components/MProgressBar.vue +185 -52
  262. package/src/components/MRadio.vue +14 -2
  263. package/src/components/MReactions.vue +161 -0
  264. package/src/components/MRichTextEditor.vue +8 -4
  265. package/src/components/MScaffold.vue +213 -0
  266. package/src/components/MScheduler.vue +14 -14
  267. package/src/components/MScrollField.vue +15 -12
  268. package/src/components/MScrollable.vue +187 -46
  269. package/src/components/MSearchField.vue +1 -1
  270. package/src/components/MSeatMap.vue +2 -1
  271. package/src/components/MSegmentedButton.vue +4 -2
  272. package/src/components/MSelect.vue +7 -7
  273. package/src/components/MSideSheet.vue +3 -2
  274. package/src/components/MSimpleCarousel.vue +20 -11
  275. package/src/components/MSlider.vue +15 -5
  276. package/src/components/MSnackbar.vue +2 -2
  277. package/src/components/MSplitButton.vue +3 -2
  278. package/src/components/MSplitter.vue +6 -3
  279. package/src/components/MSpotlightSearch.vue +1 -1
  280. package/src/components/MSupportingPane.vue +102 -12
  281. package/src/components/MSwitch.vue +94 -11
  282. package/src/components/MTable.vue +20 -7
  283. package/src/components/MTabs.vue +4 -1
  284. package/src/components/MTagInput.vue +6 -6
  285. package/src/components/MTerminal.vue +1 -1
  286. package/src/components/MText.vue +1 -1
  287. package/src/components/MTextField.vue +7 -7
  288. package/src/components/MTimePicker.vue +3 -2
  289. package/src/components/MTimePickerModal.vue +2 -2
  290. package/src/components/MTimeScroll.vue +2 -2
  291. package/src/components/MTimeline.vue +12 -12
  292. package/src/components/MToggleButton.vue +2 -2
  293. package/src/components/MToolbar.vue +3 -3
  294. package/src/components/MTrackingTimeline.vue +3 -2
  295. package/src/components/MTransition.vue +8 -3
  296. package/src/components/MTreeTable.vue +1 -1
  297. package/src/components/MTypewriter.vue +1 -1
  298. package/src/components/MVirtualList.vue +222 -0
  299. package/src/components/MVirtualTable.vue +2 -2
  300. package/src/components/MWindow.vue +4 -3
  301. package/src/components/_MColorPanel.vue +5 -4
  302. package/src/components/_MComment.vue +142 -0
  303. package/src/components/_MCommentComposer.vue +68 -0
  304. package/src/components/_MDrawerItemList.vue +9 -5
  305. package/src/components/_MMapAttribution.vue +2 -1
  306. package/src/components/_MMonthYearButton.vue +1 -1
  307. package/src/components/_MTransferPane.vue +8 -1
  308. package/src/components/_MTreeNode.vue +3 -3
  309. package/src/components/_MYearGrid.vue +4 -2
  310. package/src/components/_commentThread.ts +46 -0
  311. package/src/composables/_fieldLayout.ts +19 -19
  312. package/src/composables/_menuGroups.ts +31 -0
  313. package/src/composables/_popupPosition.ts +5 -3
  314. package/src/composables/_rtl.ts +76 -0
  315. package/src/composables/_useMenuNav.ts +24 -17
  316. package/src/composables/_usePaneResize.ts +271 -0
  317. package/src/composables/_useSheetMotion.ts +10 -3
  318. package/src/composables/useLocale.ts +44 -0
  319. package/src/composables/useUndo.ts +170 -0
  320. package/src/directives/vRipple.ts +18 -5
  321. package/src/index.ts +12 -0
  322. package/src/locales/ar.ts +814 -0
  323. package/src/locales/de.ts +18 -0
  324. package/src/locales/es.ts +18 -0
  325. package/src/locales/fr.ts +18 -0
  326. package/src/locales/index.ts +1 -0
  327. package/src/locales/ja.ts +18 -0
  328. package/src/locales/ko.ts +18 -0
  329. package/src/locales/pt.ts +18 -0
  330. package/src/locales/zh.ts +18 -0
  331. package/src/plugin.ts +17 -0
  332. package/src/styles/theme.css +56 -6
  333. package/dist/MButton-B6eZTfFV.js.map +0 -1
  334. package/dist/MColorPickerModal-Dajjf6tH.js.map +0 -1
  335. package/dist/MIcon-DpajuUTJ.js +0 -33
  336. package/dist/MIcon-DpajuUTJ.js.map +0 -1
  337. package/dist/MIconButton-BBggVwBV.js.map +0 -1
  338. package/dist/MListItem-DiOAxaN7.js +0 -991
  339. package/dist/MListItem-DiOAxaN7.js.map +0 -1
  340. package/dist/MMenuItem-BuxYoASE.js +0 -574
  341. package/dist/MMenuItem-BuxYoASE.js.map +0 -1
  342. package/dist/MProgressBar-BWly1UKN.js +0 -179
  343. package/dist/MProgressBar-BWly1UKN.js.map +0 -1
  344. package/dist/MSegmentedButton-BXzRsg1S.js +0 -105
  345. package/dist/MSegmentedButton-BXzRsg1S.js.map +0 -1
  346. package/dist/MSlider-D_O8J9YH.js +0 -739
  347. package/dist/MSlider-D_O8J9YH.js.map +0 -1
  348. package/dist/MTextField-CYk9yFvi.js.map +0 -1
  349. package/dist/MTooltip-CK39Zon4.js +0 -183
  350. package/dist/MTooltip-CK39Zon4.js.map +0 -1
  351. package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
  352. package/dist/useLocale-DL96OFgr.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MColorPickerModal-ChRtcZOo.js","names":["_openBlock","_createElementBlock","_createElementVNode","_unref","_normalizeStyle","_normalizeClass","_withDirectives","_createVNode","MIcon","_toDisplayString","_createBlock","MIconButton","_createTextVNode","_withKeys","_Fragment","_renderList","_openBlock","_createBlock","MDialog","_unref","_withCtx","_createVNode","MButton","_createTextVNode","_toDisplayString","MColorPanel","MButton_default","MIcon_default","vTooltip","MIconButton_default","useLocale","onStoragePrefix","storageKey","_plugin_vue_export_helper_default","parseHex","c","input","ch","i","toHex","h","n","r","g","b","a","normalizeHex","rgbToHsv","max","d","hsvToRgb","f","k","v","s","hsvToHsl","l","hslToHsv","inkFor","hex","lin","RECENT_KEY","readRecents","x","recentColors","ref","pushRecentColor","limit","defaultColorPresets","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","THUMB_INSET","CHECKER","_MColorPanel_default","defineComponent","__expose","__emit","props","__props","emit","t","computed","opaqueHex","hueColor","setFromRgb","hsv","lastEmitted","commit","val","pick","color","areaEl","hueEl","alphaEl","dragging","clamp","min","update","el","target","e","p","onPointerDown","onPointerMove","onPointerUp","onKeydown","step","dx","dy","cur","next","canEyedrop","pickFromScreen","Ctor","sRGBHex","formats","format","formatLabel","cycleFormat","setHsv","alphaField","fields","list","rgb","round","hsl","editing","shown","key","display","onHexInput","text","onFieldInput","onFieldKeydown","recents","isSelected","fill","previewInk","showOriginal","openBlock","createElementBlock","createElementVNode","unref","normalizeStyle","_cache","$event","normalizeClass","createCommentVNode","withDirectives","createVNode","toDisplayString","createBlock","createTextVNode","withKeys","Fragment","renderList","group","MColorPickerModal_default","draft","open","cancel","confirm","picked","MDialog_default","withCtx"],"sources":["../src/composables/_colorUtils.ts","../src/components/_MColorPanel.vue","../src/components/MColorPickerModal.vue"],"sourcesContent":["// Internal color math shared by MColorPicker and MColorPickerModal (through _MColorPanel).\n// Not exported from index.ts.\nimport { ref } from 'vue'\nimport { onStoragePrefix, storageKey } from './_storageKeys'\n\nexport interface Rgba { r: number; g: number; b: number; a: number }\n/** h 0–360, s/v 0–100 */\nexport interface Hsv { h: number; s: number; v: number }\n/** h 0–360, s/l 0–100 */\nexport interface Hsl { h: number; s: number; l: number }\n\n/** Parses `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa` (the `#` is optional). r/g/b 0–255, a 0–1. */\nexport function parseHex(input: string): Rgba | null {\n let c = input.trim().replace(/^#/, '')\n if (!/^([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(c)) return null\n if (c.length <= 4) c = [...c].map((ch) => ch + ch).join('')\n const n = (i: number) => parseInt(c.substring(i, i + 2), 16)\n return { r: n(0), g: n(2), b: n(4), a: c.length === 8 ? n(6) / 255 : 1 }\n}\n\n/** `#rrggbb`, or `#rrggbbaa` when a < 1. Lowercase. */\nexport function toHex({ r, g, b, a }: Rgba): string {\n const h = (n: number) => Math.round(Math.max(0, Math.min(255, n))).toString(16).padStart(2, '0')\n return `#${h(r)}${h(g)}${h(b)}${a < 1 ? h(a * 255) : ''}`\n}\n\n/** Lowercase canonical form of a hex string, or '' when it isn't one. */\nexport function normalizeHex(input: string): string {\n const c = parseHex(input)\n return c ? toHex(c) : ''\n}\n\nexport function rgbToHsv({ r, g, b }: Rgba): Hsv {\n r /= 255; g /= 255; b /= 255\n const max = Math.max(r, g, b), d = max - Math.min(r, g, b)\n let h = 0\n if (d !== 0) {\n if (max === r) h = ((g - b) / d + 6) % 6\n else if (max === g) h = (b - r) / d + 2\n else h = (r - g) / d + 4\n h *= 60\n }\n return { h, s: max === 0 ? 0 : (d / max) * 100, v: max * 100 }\n}\n\nexport function hsvToRgb({ h, s, v }: Hsv, a = 1): Rgba {\n s /= 100; v /= 100\n const f = (n: number) => {\n const k = (n + h / 60) % 6\n return (v - v * s * Math.max(0, Math.min(k, 4 - k, 1))) * 255\n }\n return { r: f(5), g: f(3), b: f(1), a }\n}\n\nexport function hsvToHsl({ h, s, v }: Hsv): Hsl {\n s /= 100; v /= 100\n const l = v * (1 - s / 2)\n const sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l)\n return { h, s: sl * 100, l: l * 100 }\n}\n\nexport function hslToHsv({ h, s, l }: Hsl): Hsv {\n s /= 100; l /= 100\n const v = l + s * Math.min(l, 1 - l)\n return { h, s: v === 0 ? 0 : 2 * (1 - l / v) * 100, v: v * 100 }\n}\n\n/** Black or white, whichever reads better on the color (WCAG relative luminance). */\nexport function inkFor(hex: string): '#000000' | '#ffffff' {\n const c = parseHex(hex)\n if (!c) return '#000000'\n const lin = (n: number) => {\n n /= 255\n return n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4\n }\n const lum = 0.2126 * lin(c.r) + 0.7152 * lin(c.g) + 0.0722 * lin(c.b)\n // Contrast against black beats contrast against white above ~0.179\n return lum > 0.179 ? '#000000' : '#ffffff'\n}\n\n// ── Recent colors (per viewer, localStorage, shared by every picker on the page) ──────────────\n\nconst RECENT_KEY = 'm3-color-recent'\n\nfunction readRecents(): string[] {\n try {\n const v = JSON.parse(localStorage.getItem(storageKey(RECENT_KEY)) ?? '[]')\n return Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string' && !!parseHex(x)) : []\n } catch {\n return []\n }\n}\n\nexport const recentColors = ref<string[]>(readRecents())\nonStoragePrefix(() => { recentColors.value = readRecents() })\n\nexport function pushRecentColor(hex: string, limit: number) {\n const c = normalizeHex(hex)\n if (!c) return\n recentColors.value = [c, ...recentColors.value.filter((x) => x !== c)].slice(0, Math.max(limit, 0))\n try { localStorage.setItem(storageKey(RECENT_KEY), JSON.stringify(recentColors.value)) } catch { /* storage blocked */ }\n}\n\n/** Default swatches for both pickers: the Material 2014 palette's 500 tones plus grey, black and white (3 rows of 7) */\nexport const defaultColorPresets = [\n '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4',\n '#00bcd4', '#009688', '#4caf50', '#8bc34a', '#cddc39', '#ffeb3b', '#ffc107',\n '#ff9800', '#ff5722', '#795548', '#607d8b', '#9e9e9e', '#000000', '#ffffff',\n]\n","<script setup lang=\"ts\">\n/**\n * Internal: the picking UI shared by MColorPicker (in its dropdown) and MColorPickerModal (in its dialog).\n * Saturation/brightness area, hue and opacity sliders, eyedropper, HEX/RGB/HSL fields, recent and preset\n * swatches. Emits on every change; the parent decides when that becomes the real value.\n */\nimport { computed, onMounted, ref, watch } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { vTooltip } from '../directives/vTooltip'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport {\n hslToHsv, hsvToHsl, hsvToRgb, inkFor, normalizeHex, parseHex, recentColors, rgbToHsv, toHex, type Rgba,\n} from '../composables/_colorUtils'\n\nconst props = defineProps<{\n modelValue: string\n presets: string[]\n alpha: boolean\n recent: boolean\n eyedropper: boolean\n /** Shown as the left half of the preview, click to restore */\n original?: string\n}>()\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\nconst t = useLocale()\n\n// ── State: HSV + alpha, kept here so hue survives grays and black ──────────────────────────\nconst h = ref(0)\nconst s = ref(100)\nconst v = ref(100)\nconst a = ref(1)\n\nconst hex = computed(() => toHex(hsvToRgb({ h: h.value, s: s.value, v: v.value }, props.alpha ? a.value : 1)))\nconst opaqueHex = computed(() => toHex(hsvToRgb({ h: h.value, s: s.value, v: v.value })))\nconst hueColor = computed(() => `hsl(${h.value}, 100%, 50%)`)\n\nfunction setFromRgb(c: Rgba) {\n const hsv = rgbToHsv(c)\n // A gray has no hue and black no saturation: keep the ones we had, so the thumbs don't jump\n if (hsv.v > 0 && hsv.s > 0) h.value = hsv.h\n if (hsv.v > 0) s.value = hsv.s\n v.value = hsv.v\n a.value = props.alpha ? c.a : 1\n}\n\nlet lastEmitted = ''\nfunction commit() {\n lastEmitted = hex.value\n if (hex.value !== normalizeHex(props.modelValue)) emit('update:modelValue', hex.value)\n}\n\nwatch(() => props.modelValue, (val) => {\n const n = normalizeHex(val)\n if (!n || n === lastEmitted) return\n setFromRgb(parseHex(n)!)\n lastEmitted = n\n}, { immediate: true })\n\nfunction pick(color: string) {\n const c = parseHex(color)\n if (!c) return\n setFromRgb(c)\n commit()\n}\n\n// ── Pointer: area and sliders ──────────────────────────────────────────────────────────────\ntype Target = 'area' | 'hue' | 'alpha'\nconst areaEl = ref<HTMLElement>()\nconst hueEl = ref<HTMLElement>()\nconst alphaEl = ref<HTMLElement>()\nconst dragging = ref<Target | null>(null)\n// The slider handles travel between the centers of the track's round ends (24px track)\nconst THUMB_INSET = 12\n\nconst clamp = (n: number, min: number, max: number) => Math.min(max, Math.max(min, n))\n\nfunction update(target: Target, e: PointerEvent) {\n const el = target === 'area' ? areaEl.value : target === 'hue' ? hueEl.value : alphaEl.value\n if (!el) return\n const r = el.getBoundingClientRect()\n if (target === 'area') {\n s.value = clamp(((e.clientX - r.left) / r.width) * 100, 0, 100)\n v.value = clamp((1 - (e.clientY - r.top) / r.height) * 100, 0, 100)\n } else {\n const p = clamp((e.clientX - r.left - THUMB_INSET) / (r.width - THUMB_INSET * 2), 0, 1)\n if (target === 'hue') h.value = p * 360\n else a.value = Math.round(p * 100) / 100\n }\n commit()\n}\n\nfunction onPointerDown(target: Target, e: PointerEvent) {\n if (e.button !== 0) return\n e.preventDefault()\n ;(e.currentTarget as HTMLElement).focus({ preventScroll: true })\n ;(e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId)\n dragging.value = target\n update(target, e)\n}\nfunction onPointerMove(target: Target, e: PointerEvent) {\n if (dragging.value === target) update(target, e)\n}\nfunction onPointerUp() {\n dragging.value = null\n}\n\n// ── Keyboard ───────────────────────────────────────────────────────────────────────────────\nfunction onKeydown(target: Target, e: KeyboardEvent) {\n const step = e.shiftKey ? 10 : 1\n const dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n const dy = e.key === 'ArrowUp' ? step : e.key === 'ArrowDown' ? -step : 0\n if (target === 'area') {\n if (!dx && !dy) return\n s.value = clamp(s.value + dx, 0, 100)\n v.value = clamp(v.value + dy, 0, 100)\n } else {\n const max = target === 'hue' ? 360 : 100\n const cur = target === 'hue' ? h.value : a.value * 100\n let next: number\n if (e.key === 'Home') next = 0\n else if (e.key === 'End') next = max\n else if (dx || dy) next = clamp(cur + (dx || dy), 0, max)\n else return\n if (target === 'hue') h.value = next\n else a.value = Math.round(next) / 100\n }\n e.preventDefault()\n commit()\n}\n\n// ── Eyedropper (Chromium only; the button isn't shown elsewhere) ─────────────────────────────\nconst canEyedrop = ref(false)\nonMounted(() => { canEyedrop.value = 'EyeDropper' in window })\n\nasync function pickFromScreen() {\n try {\n const Ctor = (window as unknown as { EyeDropper: new () => { open(): Promise<{ sRGBHex: string }> } }).EyeDropper\n const { sRGBHex } = await new Ctor().open()\n const c = parseHex(sRGBHex)\n if (c) { setFromRgb({ ...c, a: a.value }); commit() }\n } catch { /* cancelled */ }\n}\n\n// ── Text fields ─────────────────────────────────────────────────────────────────────────────\ntype Format = 'hex' | 'rgb' | 'hsl'\nconst formats: { id: Format; label: string }[] = [\n { id: 'hex', label: 'HEX' }, { id: 'rgb', label: 'RGB' }, { id: 'hsl', label: 'HSL' },\n]\nconst format = ref<Format>('hex')\nconst formatLabel = computed(() => formats.find((f) => f.id === format.value)!.label)\nfunction cycleFormat() {\n format.value = formats[(formats.findIndex((f) => f.id === format.value) + 1) % formats.length]!.id\n editing.value = null\n}\n\ninterface Field { key: string; label: string; display: string; max: number; apply: (n: number) => void }\n\nfunction setHsv(next: { h: number; s: number; v: number }) {\n h.value = next.h; s.value = next.s; v.value = next.v\n}\n\nconst alphaField = computed<Field>(() => ({\n key: 'a', label: 'A', display: String(Math.round(a.value * 100)), max: 100,\n apply: (n) => { a.value = n / 100 },\n}))\n\nconst fields = computed<Field[]>(() => {\n const list: Field[] = []\n if (format.value === 'rgb') {\n const rgb = hsvToRgb({ h: h.value, s: s.value, v: v.value })\n const round = { r: Math.round(rgb.r), g: Math.round(rgb.g), b: Math.round(rgb.b), a: a.value }\n for (const ch of ['r', 'g', 'b'] as const) {\n list.push({\n key: ch, label: ch.toUpperCase(), display: String(round[ch]), max: 255,\n apply: (n) => setFromRgb({ ...round, [ch]: n }),\n })\n }\n } else if (format.value === 'hsl') {\n const hsl = hsvToHsl({ h: h.value, s: s.value, v: v.value })\n const round = { h: Math.round(hsl.h), s: Math.round(hsl.s), l: Math.round(hsl.l) }\n for (const ch of ['h', 's', 'l'] as const) {\n list.push({\n key: ch, label: ch.toUpperCase(), display: String(round[ch]), max: ch === 'h' ? 360 : 100,\n // Straight from HSL to HSV, so a hue typed on a gray isn't lost\n apply: (n) => setHsv(hslToHsv({ ...round, [ch]: n })),\n })\n }\n }\n if (props.alpha && format.value !== 'hex') list.push(alphaField.value)\n return list\n})\n\n// While a field is focused it shows what the user typed, not the reformatted value\nconst editing = ref<{ key: string; text: string } | null>(null)\nconst shown = (key: string, display: string) => (editing.value?.key === key ? editing.value.text : display)\n\nfunction onHexInput(e: Event) {\n const text = (e.target as HTMLInputElement).value\n editing.value = { key: 'hex', text }\n const c = parseHex(text)\n if (c) { setFromRgb(c); commit() }\n}\n\nfunction onFieldInput(f: Field, e: Event) {\n const text = (e.target as HTMLInputElement).value\n editing.value = { key: f.key, text }\n if (!/^\\d+$/.test(text.trim())) return\n const n = Number(text)\n if (n > f.max) return\n f.apply(n)\n commit()\n}\n\nfunction onFieldKeydown(f: Field, e: KeyboardEvent) {\n if (e.key === 'Enter') { editing.value = null; return }\n if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown') return\n e.preventDefault()\n const step = (e.shiftKey ? 10 : 1) * (e.key === 'ArrowUp' ? 1 : -1)\n f.apply(clamp(Number(f.display) + step, 0, f.max))\n editing.value = null\n commit()\n}\n\n// ── Swatches ────────────────────────────────────────────────────────────────────────────────\nconst recents = computed(() => (props.recent ? recentColors.value : []))\nconst isSelected = (color: string) => normalizeHex(color) === hex.value\n// Swatches and preview segments paint the color over a checkerboard in one background, so a translucent color\n// shows it and the edge is a single antialiased shape (nested clipped layers looked jagged in Firefox)\nconst CHECKER = 'repeating-conic-gradient(#d4d4d4 0 25%, #fff 0 50%) 0 0 / 8px 8px'\nconst fill = (color: string) => `linear-gradient(${color}, ${color}), ${CHECKER}`\n// Over a mostly transparent color the checkerboard (light) is what's behind the text\nconst previewInk = computed(() => (a.value < 0.5 ? '#000000' : inkFor(opaqueHex.value)))\nconst showOriginal = computed(() => !!props.original && !!normalizeHex(props.original) && normalizeHex(props.original) !== hex.value)\n\ndefineExpose({ focus: () => areaEl.value?.focus({ preventScroll: true }) })\n</script>\n\n<template>\n <div class=\"flex flex-col gap-4\">\n <!-- Saturation (x) / brightness (y) -->\n <div\n ref=\"areaEl\"\n role=\"slider\"\n tabindex=\"0\"\n :aria-label=\"`${t.colorSaturation}, ${t.colorBrightness}`\"\n :aria-valuenow=\"Math.round(s)\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n :aria-valuetext=\"`${t.colorSaturation} ${Math.round(s)}%, ${t.colorBrightness} ${Math.round(v)}%`\"\n class=\"relative h-40 w-full shrink-0 cursor-crosshair touch-none rounded-md outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :style=\"{ background: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${hueColor})` }\"\n @pointerdown=\"onPointerDown('area', $event)\"\n @pointermove=\"onPointerMove('area', $event)\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @keydown=\"onKeydown('area', $event)\"\n >\n <span\n class=\"m3-cp-area-thumb pointer-events-none absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white transition-[scale] duration-150\"\n :class=\"dragging === 'area' ? 'scale-125' : ''\"\n :style=\"{ left: `${s}%`, top: `${100 - v}%`, backgroundColor: opaqueHex }\"\n />\n </div>\n\n <!-- Hue / opacity: thick tracks with M3 Expressive's bar handle -->\n <div class=\"flex flex-col gap-1\">\n <div\n ref=\"hueEl\"\n role=\"slider\"\n tabindex=\"0\"\n :aria-label=\"t.colorHue\"\n :aria-valuenow=\"Math.round(h)\"\n aria-valuemin=\"0\"\n aria-valuemax=\"360\"\n class=\"m3-cp-slider group\"\n @pointerdown=\"onPointerDown('hue', $event)\"\n @pointermove=\"onPointerMove('hue', $event)\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @keydown=\"onKeydown('hue', $event)\"\n >\n <span class=\"m3-cp-track m3-cp-hue\" />\n <span\n class=\"m3-cp-handle\"\n :class=\"{ 'm3-cp-handle-pressed': dragging === 'hue' }\"\n :style=\"{ left: `calc(${THUMB_INSET}px + ${h / 360} * (100% - ${THUMB_INSET * 2}px))` }\"\n />\n </div>\n <div\n v-if=\"alpha\"\n ref=\"alphaEl\"\n role=\"slider\"\n tabindex=\"0\"\n :aria-label=\"t.colorAlpha\"\n :aria-valuenow=\"Math.round(a * 100)\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n :aria-valuetext=\"`${Math.round(a * 100)}%`\"\n class=\"m3-cp-slider group\"\n @pointerdown=\"onPointerDown('alpha', $event)\"\n @pointermove=\"onPointerMove('alpha', $event)\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @keydown=\"onKeydown('alpha', $event)\"\n >\n <span class=\"m3-cp-track\" :style=\"{ background: `linear-gradient(to right, transparent, ${opaqueHex}), ${CHECKER}` }\" />\n <span\n class=\"m3-cp-handle\"\n :class=\"{ 'm3-cp-handle-pressed': dragging === 'alpha' }\"\n :style=\"{ left: `calc(${THUMB_INSET}px + ${a} * (100% - ${THUMB_INSET * 2}px))` }\"\n />\n </div>\n </div>\n\n <!-- Preview (original | new) and eyedropper -->\n <div class=\"flex items-center gap-2\">\n <div class=\"flex h-10 min-w-0 flex-1\">\n <button\n v-if=\"showOriginal\"\n type=\"button\"\n class=\"m3-cp-swatch flex w-12 shrink-0 cursor-pointer items-center justify-center rounded-s-full outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :style=\"{ background: fill(original!) }\"\n :aria-label=\"t.colorOriginal\"\n v-tooltip=\"t.colorOriginal\"\n @click=\"pick(original!)\"\n >\n <MIcon name=\"undo\" :size=\"18\" :style=\"{ color: inkFor(original!) }\" />\n </button>\n <span\n class=\"m3-cp-swatch flex min-w-0 flex-1 items-center px-4 font-mono text-label-large transition-[border-radius] duration-200\"\n :class=\"showOriginal ? 'rounded-e-full' : 'rounded-full'\"\n :style=\"{ background: fill(hex), color: previewInk }\"\n >{{ hex }}</span>\n </div>\n <MIconButton v-if=\"eyedropper && canEyedrop\" icon=\"colorize\" variant=\"tonal\" :label=\"t.colorEyedropper\" @click=\"pickFromScreen\" />\n </div>\n\n <!-- Format + fields -->\n <div class=\"flex items-start gap-2\">\n <button\n type=\"button\"\n class=\"flex h-10 shrink-0 cursor-pointer items-center gap-0.5 rounded-full bg-secondary-container pe-2 ps-3 text-label-large text-on-secondary-container outline-none transition-[background-color] duration-150 hover:bg-[color-mix(in_srgb,var(--color-secondary-container),var(--color-on-secondary-container)_8%)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :aria-label=\"`${t.colorFormat}: ${formatLabel}`\"\n @click=\"cycleFormat\"\n >\n {{ formatLabel }}\n <MIcon name=\"unfold_more\" :size=\"18\" />\n </button>\n <input\n v-if=\"format === 'hex'\"\n type=\"text\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n :maxlength=\"alpha ? 9 : 7\"\n aria-label=\"HEX\"\n :value=\"shown('hex', hex)\"\n class=\"m3-cp-field min-w-0 flex-1 font-mono text-body-medium\"\n @input=\"onHexInput\"\n @blur=\"editing = null\"\n @keydown.enter=\"editing = null\"\n />\n <label v-for=\"f in fields\" :key=\"f.key\" class=\"flex min-w-0 flex-1 flex-col items-center gap-1\">\n <input\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n :maxlength=\"3\"\n :aria-label=\"f.label\"\n :value=\"shown(f.key, f.display)\"\n class=\"m3-cp-field w-full font-mono text-body-medium\"\n @input=\"onFieldInput(f, $event)\"\n @keydown=\"onFieldKeydown(f, $event)\"\n @blur=\"editing = null\"\n />\n <span class=\"text-label-small text-on-surface-variant\">{{ f.label }}</span>\n </label>\n </div>\n\n <!-- Swatches: rounded squares that morph into a circle when selected -->\n <template v-for=\"group in [{ id: 'recent', label: t.colorRecent, colors: recents }, { id: 'presets', label: t.colorPresets, colors: presets }]\" :key=\"group.id\">\n <div v-if=\"group.colors.length\" role=\"group\" :aria-label=\"group.label\" class=\"flex flex-col gap-2\">\n <span v-if=\"recents.length\" class=\"text-label-medium text-on-surface-variant\">{{ group.label }}</span>\n <div class=\"grid grid-cols-7 gap-2\">\n <button\n v-for=\"color in group.colors\"\n :key=\"color\"\n type=\"button\"\n class=\"m3-cp-swatch m3-cp-morph flex aspect-square cursor-pointer items-center justify-center outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :class=\"{ 'm3-cp-morph-selected': isSelected(color) }\"\n :style=\"{ background: fill(color) }\"\n :aria-label=\"color\"\n :aria-pressed=\"isSelected(color)\"\n @click=\"pick(color)\"\n >\n <MIcon v-if=\"isSelected(color)\" name=\"check\" :size=\"18\" :style=\"{ color: inkFor(color) }\" />\n </button>\n </div>\n </div>\n </template>\n </div>\n</template>\n\n<style scoped>\n.m3-cp-hue {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n}\n/* Hairline so white swatches show on light surfaces and black ones on dark */\n.m3-cp-swatch {\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 12%, transparent);\n}\n.m3-cp-morph {\n border-radius: 30%;\n transition: border-radius 250ms cubic-bezier(0.2, 0, 0, 1);\n}\n.m3-cp-morph:hover {\n border-radius: 40%;\n}\n.m3-cp-morph-selected,\n.m3-cp-morph-selected:hover {\n border-radius: 50%;\n}\n.m3-cp-area-thumb {\n box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2), 0 1px 3px 1px rgb(0 0 0 / 0.25);\n}\n.m3-cp-slider {\n position: relative;\n height: 32px;\n cursor: pointer;\n touch-action: none;\n outline: none;\n}\n.m3-cp-track {\n position: absolute;\n inset: 4px 0;\n border-radius: 9999px;\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 12%, transparent);\n}\n/* After M3 Expressive's slider handle: a bar taller than the track that narrows while pressed */\n.m3-cp-handle {\n position: absolute;\n top: 0;\n width: 6px;\n height: 32px;\n translate: -50% 0;\n border-radius: 9999px;\n background: #fff;\n box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2), 0 1px 3px rgb(0 0 0 / 0.3);\n pointer-events: none;\n transition: width 150ms cubic-bezier(0.2, 0, 0, 1);\n}\n.m3-cp-handle-pressed {\n width: 4px;\n}\n.group:focus-visible .m3-cp-handle {\n outline: 2px solid var(--color-primary);\n outline-offset: 2px;\n}\n.m3-cp-field {\n height: 40px;\n border-radius: var(--radius-sm);\n border: none;\n background: var(--color-surface-container-highest);\n padding: 0 8px;\n text-align: center;\n color: var(--color-on-surface);\n caret-color: var(--color-primary);\n outline: 2px solid transparent;\n outline-offset: -2px;\n transition: outline-color 150ms;\n}\n.m3-cp-field:hover {\n outline-color: color-mix(in srgb, var(--color-on-surface) 12%, transparent);\n}\n.m3-cp-field:focus {\n outline-color: var(--color-primary);\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * A color picker in a dialog: saturation/brightness area, hue (and optional opacity) slider, eyedropper,\n * HEX/RGB/HSL fields, recent colors and preset swatches. Built on MDialog; the color is only applied on confirm,\n * and the preview shows it next to the original.\n *\n * @event update:modelValue Emitted when a color is confirmed — powers v-model. Only fires on confirm, not while\n * dragging\n * @event update:show Emitted when the dialog opens or closes — powers v-model:show\n */\nimport { ref, watch } from 'vue'\nimport MButton from './MButton.vue'\nimport MDialog from './MDialog.vue'\nimport MColorPanel from './_MColorPanel.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { defaultColorPresets, normalizeHex, pushRecentColor } from '../composables/_colorUtils'\n\nconst props = withDefaults(defineProps<{\n /** Selected color in hex format (v-model). `#rrggbb`, or `#rrggbbaa` when `alpha` is on and the color isn't opaque. */\n modelValue: string\n /** Controls dialog visibility (v-model:show) */\n show?: boolean\n /** Preset color swatches shown in the dialog */\n presets?: string[]\n /** Dialog title; defaults to the locale's `selectColor` */\n title?: string\n /** Adds an opacity slider and an alpha channel to the value */\n alpha?: boolean\n /** Remember confirmed colors and show them above the presets (stored in localStorage, shared by every picker). */\n recent?: boolean\n /** How many recent colors to keep. */\n recentLimit?: number\n /** Show a button to pick a color from the screen, where the browser supports it (Chrome, Edge). */\n eyedropper?: boolean\n}>(), {\n show: false,\n presets: () => defaultColorPresets,\n alpha: false,\n recent: true,\n recentLimit: 7,\n eyedropper: true,\n})\n\nconst t = useLocale()\nconst emit = defineEmits<{\n 'update:modelValue': [string]\n 'update:show': [boolean]\n}>()\n\n// The color being picked; becomes the value only on confirm\nconst draft = ref(props.modelValue)\n\nwatch(() => props.show, (open) => {\n if (open) draft.value = props.modelValue\n}, { immediate: true })\n\nfunction cancel() { emit('update:show', false) }\n\nfunction confirm() {\n const picked = normalizeHex(draft.value) || draft.value\n if (props.recent) pushRecentColor(picked, props.recentLimit)\n emit('update:modelValue', picked)\n emit('update:show', false)\n}\n</script>\n\n<template>\n <MDialog\n :model-value=\"show\"\n :title=\"title || t.selectColor\"\n max-width=\"328px\"\n :closable=\"false\"\n @update:model-value=\"!$event && cancel()\"\n >\n <MColorPanel\n v-model=\"draft\"\n :presets=\"presets\"\n :alpha=\"alpha\"\n :recent=\"recent\"\n :eyedropper=\"eyedropper\"\n :original=\"modelValue\"\n />\n <template #actions>\n <MButton variant=\"text\" @click=\"cancel\">{{ t.cancel }}</MButton>\n <MButton variant=\"text\" @click=\"confirm\">{{ t.confirm }}</MButton>\n </template>\n </MDialog>\n</template>\n"],"mappings":";;;;;;;;;;AAYA,SAAgBkC,EAAS,GAA4B;CACnD,IAAIC,IAAIC,EAAM,KAAK,CAAC,CAAC,QAAQ,MAAM,EAAE;CACrC,IAAI,CAAC,6CAA6C,KAAKD,CAAC,GAAG,OAAO;CAClE,AAAIA,EAAE,UAAU,MAAG,IAAI,CAAC,GAAGA,CAAC,CAAC,CAAC,KAAK,MAAOE,IAAKA,CAAE,CAAC,CAAC,KAAK,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EAAM,UAAQ1B,EAAgB+G,GAAQrF,EAAM,WAAW,GAC3DE,EAAK,qBAAqBmF,CAAM,GAChCnF,EAAK,eAAe,EAAK;EAC3B;E,kBAIE9E,EAAA,GAAAC,EAmBUC,GAAA;GAlBP,eAAa2E,EAAA;GACb,OAAOA,EAAA,SAAS1E,EAAA4E,CAAA,CAAC,CAAC;GACnB,aAAU;GACT,UAAU;GACV,uBAAkB,AAAAgE,EAAA,QAAA,MAAA,CAAGC,KAAUe,EAAM;;GAU3B,SAAO3J,QACgD,CAAhEC,EAAgEC,GAAA;IAAvD,SAAQ;IAAQ,SAAOyJ;;IAAQ,SAAA3J,QAAc,CAAXG,EAAAC,EAAAL,EAAA4E,CAAA,CAAC,CAAC,MAAM,GAAA,CAAA,C;;G,IACnD1E,EAAkEC,GAAA;IAAzD,SAAQ;IAAQ,SAAO0J;;IAAS,SAAA5J,QAAe,CAAZG,EAAAC,EAAAL,EAAA4E,CAAA,CAAC,CAAC,OAAO,GAAA,CAAA,C;;;GAVvD,SAAA3E,QAOE,CAPFC,EAOEI,GAAA;IANS,YAAAoJ,EAAA;IAAA,uBAAA,AAAAd,EAAA,QAAA,MAAA,EAAK,QAAAC;IACb,SAASnE,EAAA;IACT,OAAOA,EAAA;IACP,QAAQA,EAAA;IACR,YAAYA,EAAA;IACZ,UAAUA,EAAA"}
@@ -1,6 +1,6 @@
1
- import { t as e } from "./MIconButton-BBggVwBV.js";
2
- import { i as t } from "./useLocale-DL96OFgr.js";
3
- import { r as n } from "./_popupPosition-nL8SVKPK.js";
1
+ import { t as e } from "./MIconButton-CrBPZidd.js";
2
+ import { i as t } from "./useLocale-YRaOT12S.js";
3
+ import { r as n } from "./_popupPosition-C_lxj9qU.js";
4
4
  import { t as r } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
5
5
  import { Fragment as i, Teleport as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, mergeProps as g, nextTick as _, normalizeClass as v, onBeforeUnmount as y, onUnmounted as b, openBlock as x, ref as S, renderSlot as C, toDisplayString as w, unref as T, useId as E, watch as D, withCtx as O, withModifiers as k } from "vue";
6
6
  // src/composables/_useScrollLock.ts
@@ -24,7 +24,7 @@ var F = ["aria-labelledby", "aria-label"], I = {
24
24
  class: "min-h-0 overflow-y-auto rounded-[inherit]"
25
25
  }, L = { class: "relative px-6 pt-6 pb-2" }, R = {
26
26
  key: 0,
27
- class: "absolute right-4 top-4"
27
+ class: "absolute end-4 top-4"
28
28
  }, z = {
29
29
  key: 1,
30
30
  class: "mb-4 flex justify-center text-secondary"
@@ -143,7 +143,7 @@ var F = ["aria-labelledby", "aria-label"], I = {
143
143
  t.$slots.icon ? (x(), u("div", z, [C(t.$slots, "icon", {}, void 0, !0)])) : l("", !0),
144
144
  d("h2", {
145
145
  id: $,
146
- class: v(["text-headline-small text-on-surface", [t.$slots.icon ? "text-center" : "text-left", r.closable && !r.persistent ? t.$slots.icon ? "px-10" : "pr-10" : ""]])
146
+ class: v(["text-headline-small text-on-surface", [t.$slots.icon ? "text-center" : "text-start", r.closable && !r.persistent ? t.$slots.icon ? "px-10" : "pe-10" : ""]])
147
147
  }, [C(t.$slots, "title", {}, () => [f(w(r.title), 1)], !0)], 2)
148
148
  ]),
149
149
  d("div", {
@@ -161,7 +161,7 @@ var F = ["aria-labelledby", "aria-label"], I = {
161
161
  _: 3
162
162
  }))]));
163
163
  }
164
- }), [["__scopeId", "data-v-8f788bae"]]);
164
+ }), [["__scopeId", "data-v-38fbaf7b"]]);
165
165
  export { P as n, q as t };
166
166
 
167
- //# sourceMappingURL=MDialog-DQvE_JBv.js.map
167
+ //# sourceMappingURL=MDialog-dk07tify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MDialog-DQvE_JBv.js","names":["$attrs","$slots","_openBlock","_createBlock","_Teleport","_Transition","_withCtx","_createElementBlock","_withModifiers","_createElementVNode","_mergeProps","_renderSlot","_Fragment","_createVNode","MIconButton","_unref","_normalizeClass","_createTextVNode","_toDisplayString","MIconButton_default","useLocale","useEscapeStack","_plugin_vue_export_helper_default","count","previous","lock","unlock","useScrollLock","held","set","on","active","watch","getCurrentInstance","onBeforeUnmount","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","MDialog_default","defineComponent","__emit","props","__props","locale","isCssValue","v","sizeClasses","computed","sizeStyle","emit","close","contentEl","ref","contentInnerEl","showDivider","resizeObserver","updateDividerVisibility","el","titleId","useId","open","nextTick","onUnmounted","openBlock","createBlock","Teleport","Transition","withCtx","createElementBlock","mergeProps","_ctx","renderSlot","createCommentVNode","unref","createElementVNode","createTextVNode","toDisplayString","withModifiers","Fragment","createVNode","normalizeClass"],"sources":["../src/composables/_useScrollLock.ts","../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"],"mappings":";;;;;;AAWA,IAAIuB,IAAQ,GACRC,IAAW;AAEf,SAASC,IAAO;CACd,AAAI,QAAY,MACd,IAAW,SAAS,KAAK,MAAM,UAC/B,SAAS,KAAK,MAAM,WAAW;AAEnC;AAEA,SAASC,IAAS;CAChB,AAAIH,IAAQ,KAAK,EAAEA,MAAU,MAAG,SAAS,KAAK,MAAM,WAAWC;AACjE;AAMA,SAAgBG,EAAc,GAA+B;CAC3D,IAAIC,IAAO;CACX,SAASC,EAAI,GAAa;EACxB,AAAI,OAAO,WAAa,OAAeC,MAAOF,MAC9C,IAAOE,GACHA,IAAIL,EAAK,IACRC,EAAO;CACd;CAGA,OAFIK,KAAQC,EAAMD,IAAS,MAAOF,EAAI,CAAC,CAACC,CAAE,GAAG,EAAE,WAAW,GAAK,CAAC,GAC5DG,EAAmB,KAAGC,QAAsBL,EAAI,EAAK,CAAC,GACnD,EAAE,OAAI;AACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECrBA,IAAMqB,IAAQC,GAqDRC,IAAShC,EAAU,GAInBiC,KAAc,MAAc,iDAAiD,KAAKC,EAAE,KAAK,CAAC,GAC1FC,IAAcC,QA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GAAA,EAAA,C;IAIDhB,EAAA,SAAe9D,EAAAA,OAAO,WAAjCC,EAAA,GAAAK,EAA6F,OAA7FiC,CAA6F,K;IAElFvC,EAAAA,OAAO,WAAlBC,EAAA,GAAAK,EAEM,OAFNkC,GAEM,CADJ9B,EAAuBoE,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C"}
1
+ {"version":3,"file":"MDialog-dk07tify.js","names":["$attrs","$slots","_openBlock","_createBlock","_Teleport","_Transition","_withCtx","_createElementBlock","_withModifiers","_createElementVNode","_mergeProps","_renderSlot","_Fragment","_createVNode","MIconButton","_unref","_normalizeClass","_createTextVNode","_toDisplayString","MIconButton_default","useLocale","useEscapeStack","_plugin_vue_export_helper_default","count","previous","lock","unlock","useScrollLock","held","set","on","active","watch","getCurrentInstance","onBeforeUnmount","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","MDialog_default","defineComponent","__emit","props","__props","locale","isCssValue","v","sizeClasses","computed","sizeStyle","emit","close","contentEl","ref","contentInnerEl","showDivider","resizeObserver","updateDividerVisibility","el","titleId","useId","open","nextTick","onUnmounted","openBlock","createBlock","Teleport","Transition","withCtx","createElementBlock","mergeProps","_ctx","renderSlot","createCommentVNode","unref","createElementVNode","createTextVNode","toDisplayString","withModifiers","Fragment","createVNode","normalizeClass"],"sources":["../src/composables/_useScrollLock.ts","../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 end-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 end-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 `pe-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-start',\n closable && !persistent ? ($slots.icon ? 'px-10' : 'pe-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,IAAIuB,IAAQ,GACRC,IAAW;AAEf,SAASC,IAAO;CACd,AAAI,QAAY,MACd,IAAW,SAAS,KAAK,MAAM,UAC/B,SAAS,KAAK,MAAM,WAAW;AAEnC;AAEA,SAASC,IAAS;CAChB,AAAIH,IAAQ,KAAK,EAAEA,MAAU,MAAG,SAAS,KAAK,MAAM,WAAWC;AACjE;AAMA,SAAgBG,EAAc,GAA+B;CAC3D,IAAIC,IAAO;CACX,SAASC,EAAI,GAAa;EACxB,AAAI,OAAO,WAAa,OAAeC,MAAOF,MAC9C,IAAOE,GACHA,IAAIL,EAAK,IACRC,EAA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,OAAI,UAAA,UAAA,E;K,IAKhIU,EAAqCoE,EAAA,QAAA,SAAA,CAAA,SAAA,CAAf9D,EAAAC,EAAAiC,EAAA,KAAK,GAAA,CAAA,C;;IAG/B1C,EASM,OAAA;KARA,SAAA;KAAJ,KAAImD;KACJ,OAAK5C,EAAA,CAAC,sEACEf,EAAAA,OAAO,UAAO,SAAA,MAAA,CAAA;KACrB,UAAQgE;I,IAETxD,EAEM,OAAA;KAFG,SAAA;KAAJ,KAAIqD;I,IACPnD,EAAQoE,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C;IAIDhB,EAAA,SAAe9D,EAAAA,OAAO,WAAjCC,EAAA,GAAAK,EAA6F,OAA7FiC,CAA6F,K;IAElFvC,EAAAA,OAAO,WAAlBC,EAAA,GAAAK,EAEM,OAFNkC,GAEM,CADJ9B,EAAuBoE,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C"}
@@ -0,0 +1,116 @@
1
+ import { o as e, r as t } from "./_storageKeys-C4W_4xK4.js";
2
+ import { computed as n, createElementBlock as r, defineComponent as i, getCurrentInstance as a, hasInjectionContext as o, inject as s, normalizeClass as c, normalizeStyle as l, onBeforeUnmount as u, onMounted as d, openBlock as f, readonly as p, ref as m, toDisplayString as h } from "vue";
3
+ // src/composables/_hydration.ts
4
+ var g = Symbol("m3-hydrating");
5
+ function _() {
6
+ return a() ? s(g, null)?.() ?? !1 : !1;
7
+ }
8
+ // src/composables/_ssrState.ts
9
+ var v = Symbol("m3-initial-state");
10
+ function y() {
11
+ return o() ? s(v, null) : null;
12
+ }
13
+ function b(e, t) {
14
+ if (t === void 0) return e;
15
+ if (typeof window > "u") return m(t);
16
+ if (!_()) return e;
17
+ let r = m(!1);
18
+ return d(() => {
19
+ r.value = !0;
20
+ }), n({
21
+ get: () => r.value ? e.value : t,
22
+ set: (t) => {
23
+ e.value = t;
24
+ }
25
+ });
26
+ }
27
+ var x = !1;
28
+ function S() {
29
+ x = !0;
30
+ }
31
+ var C = !1;
32
+ function w() {
33
+ if (!x || C || typeof window > "u") return;
34
+ C = !0;
35
+ let n = () => E(e(t), `${window.innerWidth}x${window.innerHeight}`), r;
36
+ n(), window.addEventListener("resize", () => {
37
+ clearTimeout(r), r = setTimeout(n, 300);
38
+ });
39
+ }
40
+ function T(e) {
41
+ if (typeof document > "u") return null;
42
+ let t = document.cookie.match(RegExp(`(?:^|; )${e}=([^;]*)`));
43
+ if (!t) return null;
44
+ try {
45
+ return decodeURIComponent(t[1]);
46
+ } catch {
47
+ return null;
48
+ }
49
+ }
50
+ function E(e, t) {
51
+ x && typeof document < "u" && (document.cookie = t == null ? `${e}=; Max-Age=0; Path=/; SameSite=Lax` : `${e}=${encodeURIComponent(t)}; Max-Age=31536000; Path=/; SameSite=Lax`);
52
+ }
53
+ // src/composables/_rtl.ts
54
+ var D = Symbol("m3-dir"), O = /* @__PURE__ */ new Set(/* @__PURE__ */ "arrow_back.arrow_back_ios.arrow_back_ios_new.arrow_forward.arrow_forward_ios.arrow_left.arrow_right.arrow_left_alt.arrow_right_alt.trending_flat.chevron_left.chevron_right.navigate_before.navigate_next.first_page.last_page.keyboard_arrow_left.keyboard_arrow_right.keyboard_double_arrow_left.keyboard_double_arrow_right.keyboard_tab.keyboard_backspace.backspace.subdirectory_arrow_left.subdirectory_arrow_right.send.reply.reply_all.forward.undo.redo.menu_open.read_more.format_indent_increase.format_indent_decrease.format_list_bulleted.format_list_numbered.toc.notes.short_text.wrap_text.list.segment.login.logout.exit_to_app.input.output.label.label_important.call_made.call_received.call_missed_outgoing.start.help.help_outline".split("."));
55
+ function k(e) {
56
+ if (typeof window > "u") return !1;
57
+ let t = e ?? document.documentElement;
58
+ return getComputedStyle(t).direction === "rtl" || t.closest("[dir]")?.getAttribute("dir") === "rtl";
59
+ }
60
+ var A = m(!1), j = null, M = 0;
61
+ function N() {
62
+ let e = o() ? s(D, void 0) : void 0, t = e === void 0 ? void 0 : e === "rtl";
63
+ if (typeof window > "u") return b(A, t);
64
+ let n = () => {
65
+ A.value = k(document.body ?? document.documentElement);
66
+ };
67
+ return M++ === 0 && (n(), j = new MutationObserver(n), j.observe(document.documentElement, {
68
+ attributes: !0,
69
+ attributeFilter: ["dir"]
70
+ }), document.body && j.observe(document.body, {
71
+ attributes: !0,
72
+ attributeFilter: ["dir"]
73
+ })), a() && u(() => {
74
+ --M === 0 && (j?.disconnect(), j = null);
75
+ }), b(p(A), t);
76
+ }
77
+ function P(e, t) {
78
+ return (e.key === "ArrowLeft" || e.key === "ArrowRight") && k(t) ? e.key === "ArrowLeft" ? "ArrowRight" : "ArrowLeft" : e.key;
79
+ }
80
+ // src/components/MIcon.vue?vue&type=script&setup=true&lang.ts
81
+ var F = [
82
+ "role",
83
+ "aria-label",
84
+ "aria-hidden"
85
+ ], I = /* @__PURE__ */ i({
86
+ __name: "MIcon",
87
+ props: {
88
+ name: {},
89
+ size: { default: 24 },
90
+ filled: {
91
+ type: Boolean,
92
+ default: !1
93
+ },
94
+ label: {},
95
+ mirror: {
96
+ type: Boolean,
97
+ default: void 0
98
+ }
99
+ },
100
+ setup(e) {
101
+ let t = e, i = n(() => t.mirror ?? O.has(t.name));
102
+ return (t, n) => (f(), r("span", {
103
+ class: c(["material-symbols-outlined leading-none", i.value && "m3-rtl:-scale-x-100"]),
104
+ role: e.label ? "img" : void 0,
105
+ "aria-label": e.label,
106
+ "aria-hidden": e.label ? void 0 : "true",
107
+ style: l({
108
+ fontSize: `${e.size}px`,
109
+ fontVariationSettings: e.filled ? "'FILL' 1" : void 0
110
+ })
111
+ }, h(e.name), 15, F));
112
+ }
113
+ });
114
+ export { N as a, y as c, w as d, E as f, P as i, T as l, _ as m, D as n, v as o, g as p, k as r, S as s, I as t, b as u };
115
+
116
+ //# sourceMappingURL=MIcon-BSsJZhK7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MIcon-BSsJZhK7.js","names":["_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_toDisplayString","storageKey","VIEWPORT_KEY","M3_HYDRATING_KEY","isHydrating","getCurrentInstance","inject","M3_INITIAL_STATE_KEY","initialState","hasInjectionContext","ssrValue","initial","live","ref","mounted","onMounted","computed","value","cookiesEnabled","enableCookies","trackingViewport","trackViewport","write","writeCookie","timer","readCookie","match","key","M3_DIR_KEY","MIRRORED_ICONS","isRtl","target","el","docRtl","observer","users","useDocumentRtl","dir","update","onBeforeUnmount","readonly","logicalKey","_hoisted_1","MIcon_default","defineComponent","props","__props","mirrored","openBlock","createElementBlock","normalizeClass","normalizeStyle","toDisplayString"],"sources":["../src/composables/_hydration.ts","../src/composables/_ssrState.ts","../src/composables/_rtl.ts","../src/components/MIcon.vue"],"sourcesContent":["import { getCurrentInstance, inject, type InjectionKey } from 'vue'\n\n// Internal: `createM3UI({ isHydrating })`. A server-rendered app's first client render has to match the server's\n// HTML, so what the server can't know (the window's size) starts from the server's value until the app is mounted.\nexport const M3_HYDRATING_KEY: InjectionKey<() => boolean> = Symbol('m3-hydrating')\n\n/** Whether the calling component is being hydrated from server-rendered HTML (false outside a component's setup). */\nexport function isHydrating(): boolean {\n return getCurrentInstance() ? inject(M3_HYDRATING_KEY, null)?.() ?? false : false\n}\n","import { computed, hasInjectionContext, inject, onMounted, ref, type InjectionKey, type Ref } from 'vue'\nimport { isHydrating } from './_hydration'\nimport { VIEWPORT_KEY, storageKey } from './_storageKeys'\nimport type { Theme } from './useTheme'\nimport type { ContrastLevel } from './useColorPalette'\n\n/** The user's theme choices as a server knows them (from cookies), for server-side rendering. */\nexport interface M3InitialState {\n theme?: Theme\n palette?: string\n contrast?: ContrastLevel\n /** The browser window's size: the adaptive layouts and `useWindowSizeClass()` render for it instead of compact. */\n viewport?: { width: number; height: number }\n}\n\n/** `initialState` with the plugin's defaults filled in (the viewport stays optional: there's no default for it). */\nexport type ResolvedInitialState = Required<Omit<M3InitialState, 'viewport'>> & Pick<M3InitialState, 'viewport'>\n\n// Internal: `createM3UI({ initialState })`, resolved against the plugin's defaults\nexport const M3_INITIAL_STATE_KEY: InjectionKey<ResolvedInitialState> = Symbol('m3-initial-state')\n\nexport function initialState(): ResolvedInitialState | null {\n return hasInjectionContext() ? inject(M3_INITIAL_STATE_KEY, null) : null\n}\n\n/**\n * What a composable reports for a stored choice. On the server: the initial state (the module-level refs are shared\n * by every request and hold nothing there). On the client while hydrating: the initial state too, so the first\n * render matches the server's HTML, then the live value once mounted. Otherwise the live ref itself.\n */\nexport function ssrValue<T>(live: Ref<T>, initial: T | undefined): Ref<T> {\n if (initial === undefined) return live\n if (typeof window === 'undefined') return ref(initial) as Ref<T>\n if (!isHydrating()) return live\n const mounted = ref(false)\n onMounted(() => { mounted.value = true })\n return computed({\n get: () => (mounted.value ? live.value : initial),\n set: (value) => { live.value = value },\n }) as Ref<T>\n}\n\n// ── Cookies ─────────────────────────────────────────────────────────────────────────────────────\n// `createM3UI({ cookies: true })`: the choices are also kept in cookies, which a server can read.\n\nlet cookiesEnabled = false\n\nexport function enableCookies() {\n cookiesEnabled = true\n}\n\nlet trackingViewport = false\n\n/** Keeps the window's size in a cookie, for the server to render the adaptive layouts at it. */\nexport function trackViewport() {\n if (!cookiesEnabled || trackingViewport || typeof window === 'undefined') return\n trackingViewport = true\n const write = () => writeCookie(storageKey(VIEWPORT_KEY), `${window.innerWidth}x${window.innerHeight}`)\n let timer: ReturnType<typeof setTimeout> | undefined\n write()\n window.addEventListener('resize', () => {\n clearTimeout(timer)\n timer = setTimeout(write, 300)\n })\n}\n\n/** A cookie's value: the stored choice when localStorage has none (cleared storage, or a server that set it). */\nexport function readCookie(key: string): string | null {\n if (typeof document === 'undefined') return null\n const match = document.cookie.match(new RegExp(`(?:^|; )${key}=([^;]*)`))\n if (!match) return null\n try { return decodeURIComponent(match[1]!) } catch { return null }\n}\n\nexport function writeCookie(key: string, value: string | null) {\n if (!cookiesEnabled || typeof document === 'undefined') return\n document.cookie = value == null\n ? `${key}=; Max-Age=0; Path=/; SameSite=Lax`\n : `${key}=${encodeURIComponent(value)}; Max-Age=31536000; Path=/; SameSite=Lax`\n}\n","import { getCurrentInstance, hasInjectionContext, inject, onBeforeUnmount, readonly, ref, type InjectionKey, type Ref } from 'vue'\nimport { ssrValue } from './_ssrState'\n\n// Internal: `createM3UI({ dir })`, the page's direction as a server renders it\nexport const M3_DIR_KEY: InjectionKey<'ltr' | 'rtl'> = Symbol('m3-dir')\n/**\n * Right-to-left helpers (internal). Layout mirrors through CSS logical properties (`ms-*`, `start-*`,\n * `text-start`…); what CSS can't mirror on its own (pointer math, `translateX`, directional icons) asks\n * `isRtl()` or uses the `m3-rtl:` variant (theme.css; unlike Tailwind's `rtl:`, it respects a nested `dir=\"ltr\"`).\n */\n\n/**\n * Material Symbols that point along the reading direction, mirrored in RTL like Android's auto-mirrored icons.\n * Media transport icons (play, skip, fast forward) are deliberately left out: M3 never mirrors those.\n */\nexport const MIRRORED_ICONS: ReadonlySet<string> = new Set([\n 'arrow_back', 'arrow_back_ios', 'arrow_back_ios_new', 'arrow_forward', 'arrow_forward_ios',\n 'arrow_left', 'arrow_right', 'arrow_left_alt', 'arrow_right_alt', 'trending_flat',\n 'chevron_left', 'chevron_right', 'navigate_before', 'navigate_next', 'first_page', 'last_page',\n 'keyboard_arrow_left', 'keyboard_arrow_right', 'keyboard_double_arrow_left', 'keyboard_double_arrow_right',\n 'keyboard_tab', 'keyboard_backspace', 'backspace', 'subdirectory_arrow_left', 'subdirectory_arrow_right',\n 'send', 'reply', 'reply_all', 'forward', 'undo', 'redo', 'menu_open', 'read_more',\n 'format_indent_increase', 'format_indent_decrease', 'format_list_bulleted', 'format_list_numbered',\n 'toc', 'notes', 'short_text', 'wrap_text', 'list', 'segment',\n 'login', 'logout', 'exit_to_app', 'input', 'output', 'label', 'label_important',\n 'call_made', 'call_received', 'call_missed_outgoing', 'start', 'help', 'help_outline',\n])\n\n/** Whether `el` (or the document, without one) lays out right to left */\nexport function isRtl(el?: Element | null): boolean {\n if (typeof window === 'undefined') return false\n const target = el ?? document.documentElement\n if (getComputedStyle(target).direction === 'rtl') return true\n // DOMs without a style engine (happy-dom) report ltr whatever dir says: go by the nearest dir attribute\n return target.closest('[dir]')?.getAttribute('dir') === 'rtl'\n}\n\n\nconst docRtl = ref(false)\nlet observer: MutationObserver | null = null\nlet users = 0\n\n/**\n * Whether the page reads right to left, kept up to date when the `dir` attribute of `<html>` or `<body>`\n * changes. For things decided at render time (which edge a drawer sits on); pointer math should ask\n * `isRtl(el)` at the event instead, which also sees a `dir` set on a closer ancestor. Server-rendered apps pass\n * `createM3UI({ dir })`, which the server renders and hydration starts from.\n */\nexport function useDocumentRtl(): Readonly<Ref<boolean>> {\n // With `createM3UI({ dir })`: what the server renders, and the client's first frame while hydrating\n const dir = hasInjectionContext() ? inject(M3_DIR_KEY, undefined) : undefined\n const initial = dir === undefined ? undefined : dir === 'rtl'\n if (typeof window === 'undefined') return ssrValue(docRtl, initial)\n const update = () => { docRtl.value = isRtl(document.body ?? document.documentElement) }\n if (users++ === 0) {\n update()\n observer = new MutationObserver(update)\n observer.observe(document.documentElement, { attributes: true, attributeFilter: ['dir'] })\n if (document.body) observer.observe(document.body, { attributes: true, attributeFilter: ['dir'] })\n }\n if (getCurrentInstance()) {\n onBeforeUnmount(() => {\n if (--users === 0) { observer?.disconnect(); observer = null }\n })\n }\n return ssrValue(readonly(docRtl) as Ref<boolean>, initial)\n}\n\n/**\n * The key as if the layout were left to right: ArrowLeft and ArrowRight swap when `el` lays out right to left,\n * so \"ArrowRight\" keeps meaning \"next\" in a row of items that flex has mirrored\n */\nexport function logicalKey(e: KeyboardEvent, el?: Element | null): string {\n if ((e.key === 'ArrowLeft' || e.key === 'ArrowRight') && isRtl(el)) return e.key === 'ArrowLeft' ? 'ArrowRight' : 'ArrowLeft'\n return e.key\n}\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 *\n * In a right-to-left layout (`dir=\"rtl\"` on the page or any ancestor), icons that point along the reading\n * direction (`arrow_back`, `chevron_right`, `send`, `undo`…, see `MIRRORED_ICONS`) are drawn mirrored, as\n * Android's auto-mirrored icons are; `mirror` forces it on or off for one icon.\n */\nimport { computed } from 'vue'\nimport { MIRRORED_ICONS } from '../composables/_rtl'\n\nconst props = withDefaults(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 /** Mirror the glyph in a right-to-left layout. By default, only the directional icons in `MIRRORED_ICONS` are */\n mirror?: boolean\n}>(), { size: 24, filled: false, mirror: undefined })\n\nconst mirrored = computed(() => props.mirror ?? MIRRORED_ICONS.has(props.name))\n</script>\n\n<template>\n <span\n class=\"material-symbols-outlined leading-none\"\n :class=\"mirrored && 'm3-rtl:-scale-x-100'\"\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":";;;AAIA,IAAaO,IAAgD,OAAO,cAAc;AAGlF,SAAgBC,IAAuB;CACrC,OAAOC,EAAmB,IAAIC,EAAOH,GAAkB,IAAI,CAAC,GAAG,KAAK,KAAQ;AAC9E;;ACUA,IAAaI,IAA2D,OAAO,kBAAkB;AAEjG,SAAgBC,IAA4C;CAC1D,OAAOC,EAAoB,IAAIH,EAAOC,GAAsB,IAAI,IAAI;AACtE;AAOA,SAAgBG,EAAY,GAAc,GAAgC;CACxE,IAAIC,MAAY,KAAA,GAAW,OAAOC;CAClC,IAAI,OAAO,SAAW,KAAa,OAAOC,EAAIF,CAAO;CACrD,IAAI,CA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