@m3ui-vue/m3ui-vue 1.6.0 → 1.6.2

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 (158) hide show
  1. package/dist/API.md +940 -33
  2. package/dist/{MButton-CPghlKb0.js → MButton-OQ4wIERQ.js} +2 -2
  3. package/dist/{MButton-CPghlKb0.js.map → MButton-OQ4wIERQ.js.map} +1 -1
  4. package/dist/MColorPickerModal-NtkihoK6.js +577 -0
  5. package/dist/MColorPickerModal-NtkihoK6.js.map +1 -0
  6. package/dist/{MDialog-X50At1Gk.js → MDialog-DYMnaBlt.js} +3 -3
  7. package/dist/{MDialog-X50At1Gk.js.map → MDialog-DYMnaBlt.js.map} +1 -1
  8. package/dist/{MListItem-DVi1j1QI.js → MListItem-D2cNUyzP.js} +211 -168
  9. package/dist/MListItem-D2cNUyzP.js.map +1 -0
  10. package/dist/{MLoadingIndicator-vooA3110.js → MLoadingIndicator-DWUj0BAB.js} +2 -2
  11. package/dist/{MLoadingIndicator-vooA3110.js.map → MLoadingIndicator-DWUj0BAB.js.map} +1 -1
  12. package/dist/{MMenuItem-CRNZkVVr.js → MMenuItem-BuxYoASE.js} +133 -151
  13. package/dist/MMenuItem-BuxYoASE.js.map +1 -0
  14. package/dist/{MSeekBar-BL2W5_rD.js → MSeekBar-C4cn9RIF.js} +2 -2
  15. package/dist/{MSeekBar-BL2W5_rD.js.map → MSeekBar-C4cn9RIF.js.map} +1 -1
  16. package/dist/{MSlider-B9NcKTmZ.js → MSlider-BIkA6DiE.js} +2 -2
  17. package/dist/{MSlider-B9NcKTmZ.js.map → MSlider-BIkA6DiE.js.map} +1 -1
  18. package/dist/{MSpinner-_XpTRkAg.js → MSpinner-DZkXZJpc.js} +2 -2
  19. package/dist/{MSpinner-_XpTRkAg.js.map → MSpinner-DZkXZJpc.js.map} +1 -1
  20. package/dist/{MTextField-DpcPmR5B.js → MTextField-CNH-byir.js} +2 -2
  21. package/dist/{MTextField-DpcPmR5B.js.map → MTextField-CNH-byir.js.map} +1 -1
  22. package/dist/MTooltip-CK39Zon4.js +183 -0
  23. package/dist/MTooltip-CK39Zon4.js.map +1 -0
  24. package/dist/{_useEscapeStack-C5-BYr8y.js → _popupPosition-nL8SVKPK.js} +20 -2
  25. package/dist/_popupPosition-nL8SVKPK.js.map +1 -0
  26. package/dist/api.json +1 -1
  27. package/dist/code-editor.js +1 -1
  28. package/dist/components/MAddressField.vue.d.ts +54 -0
  29. package/dist/components/MAudioPlayer.vue.d.ts +1 -1
  30. package/dist/components/MAudioRecorder.vue.d.ts +51 -0
  31. package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
  32. package/dist/components/MCameraCapture.vue.d.ts +51 -0
  33. package/dist/components/MCollapse.vue.d.ts +32 -0
  34. package/dist/components/MCountrySelect.vue.d.ts +41 -0
  35. package/dist/components/MCronField.vue.d.ts +26 -0
  36. package/dist/components/MDashboardGrid.vue.d.ts +65 -0
  37. package/dist/components/MDiffViewer.vue.d.ts +56 -0
  38. package/dist/components/MExpansionPanel.vue.d.ts +26 -3
  39. package/dist/components/MFilterBuilder.vue.d.ts +22 -0
  40. package/dist/components/MFlex.vue.d.ts +1 -1
  41. package/dist/components/MMapCluster.vue.d.ts +80 -0
  42. package/dist/components/MMapDraw.vue.d.ts +79 -0
  43. package/dist/components/MMentionField.vue.d.ts +102 -0
  44. package/dist/components/MNotificationCenter.vue.d.ts +57 -0
  45. package/dist/components/MQRScanner.vue.d.ts +52 -0
  46. package/dist/components/MQuiz.vue.d.ts +1 -1
  47. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  48. package/dist/components/MStack.vue.d.ts +1 -1
  49. package/dist/components/MTimezoneSelect.vue.d.ts +39 -0
  50. package/dist/components/MToolbar.vue.d.ts +1 -1
  51. package/dist/components/MVideoPlayer.vue.d.ts +1 -1
  52. package/dist/components/_MFilterGroup.vue.d.ts +17 -0
  53. package/dist/composables/_caretPosition.d.ts +6 -0
  54. package/dist/composables/_useCamera.d.ts +16 -0
  55. package/dist/composables/_useFollowAnchor.d.ts +15 -0
  56. package/dist/composables/cron.d.ts +29 -0
  57. package/dist/composables/dashboardLayout.d.ts +28 -0
  58. package/dist/composables/filterBuilder.d.ts +55 -0
  59. package/dist/composables/mapAdapters.d.ts +6 -1
  60. package/dist/composables/mapSearch.d.ts +1 -0
  61. package/dist/composables/textDiff.d.ts +24 -0
  62. package/dist/composables/useLocale.d.ts +108 -0
  63. package/dist/draw.js +28 -27
  64. package/dist/draw.js.map +1 -1
  65. package/dist/flow.js +1 -1
  66. package/dist/gantt.js +1 -1
  67. package/dist/index.d.ts +25 -0
  68. package/dist/locales/index.js +749 -0
  69. package/dist/locales/index.js.map +1 -1
  70. package/dist/m3ui-vue.css +1 -1
  71. package/dist/m3ui.js +10444 -7495
  72. package/dist/m3ui.js.map +1 -1
  73. package/dist/map.d.ts +5 -0
  74. package/dist/map.js +1509 -617
  75. package/dist/map.js.map +1 -1
  76. package/dist/media.js +5 -5
  77. package/dist/pdf.js +5 -5
  78. package/dist/rich-text-editor.js +5 -5
  79. package/dist/styles.css +1 -1
  80. package/dist/{useLocale-COav9m8C.js → useLocale-DaVSTdm0.js} +108 -1
  81. package/dist/useLocale-DaVSTdm0.js.map +1 -0
  82. package/package.json +1 -1
  83. package/src/__tests__/MAddressField.test.ts +149 -0
  84. package/src/__tests__/MAudioRecorder.test.ts +125 -0
  85. package/src/__tests__/MCameraCapture.test.ts +154 -0
  86. package/src/__tests__/MCountrySelect.test.ts +67 -0
  87. package/src/__tests__/MCronField.test.ts +100 -0
  88. package/src/__tests__/MDashboardGrid.test.ts +122 -0
  89. package/src/__tests__/MDiffViewer.test.ts +68 -0
  90. package/src/__tests__/MExpansionPanel.test.ts +107 -0
  91. package/src/__tests__/MFilterBuilder.test.ts +130 -0
  92. package/src/__tests__/MMapCluster.test.ts +127 -0
  93. package/src/__tests__/MMapDraw.test.ts +188 -0
  94. package/src/__tests__/MMapLayers.test.ts +56 -0
  95. package/src/__tests__/MMentionField.test.ts +163 -0
  96. package/src/__tests__/MNotificationCenter.test.ts +94 -0
  97. package/src/__tests__/_fakeMaplibre.ts +14 -3
  98. package/src/__tests__/attrsFallthrough.test.ts +4 -0
  99. package/src/__tests__/cron.test.ts +68 -0
  100. package/src/__tests__/dashboardLayout.test.ts +45 -0
  101. package/src/__tests__/filterBuilder.test.ts +91 -0
  102. package/src/__tests__/followAnchor.test.ts +162 -0
  103. package/src/__tests__/ssr.test.ts +3 -0
  104. package/src/__tests__/textDiff.test.ts +37 -0
  105. package/src/components/MAddressField.vue +301 -0
  106. package/src/components/MAudioRecorder.vue +334 -0
  107. package/src/components/MAutocomplete.vue +3 -7
  108. package/src/components/MCameraCapture.vue +156 -0
  109. package/src/components/MCollapse.vue +91 -0
  110. package/src/components/MColorPicker.vue +4 -8
  111. package/src/components/MCountrySelect.vue +89 -0
  112. package/src/components/MCronField.vue +251 -0
  113. package/src/components/MDashboardGrid.vue +382 -0
  114. package/src/components/MDatePicker.vue +10 -7
  115. package/src/components/MDateRangePicker.vue +10 -7
  116. package/src/components/MDiffViewer.vue +234 -0
  117. package/src/components/MExpansionPanel.vue +56 -48
  118. package/src/components/MFilterBuilder.vue +47 -0
  119. package/src/components/MMapBaseLayers.vue +29 -28
  120. package/src/components/MMapCluster.vue +295 -0
  121. package/src/components/MMapDraw.vue +601 -0
  122. package/src/components/MMapMeasure.vue +1 -1
  123. package/src/components/MMapSearch.vue +1 -9
  124. package/src/components/MMentionField.vue +373 -0
  125. package/src/components/MMultiAutocomplete.vue +3 -7
  126. package/src/components/MMultiSelect.vue +3 -7
  127. package/src/components/MNotificationCenter.vue +252 -0
  128. package/src/components/MPhoneInput.vue +3 -10
  129. package/src/components/MQRScanner.vue +177 -0
  130. package/src/components/MSelect.vue +3 -7
  131. package/src/components/MTimePicker.vue +10 -7
  132. package/src/components/MTimezoneSelect.vue +116 -0
  133. package/src/components/_MFilterGroup.vue +210 -0
  134. package/src/composables/_caretPosition.ts +44 -0
  135. package/src/composables/_useCamera.ts +66 -0
  136. package/src/composables/_useFollowAnchor.ts +109 -0
  137. package/src/composables/cron.ts +179 -0
  138. package/src/composables/dashboardLayout.ts +94 -0
  139. package/src/composables/filterBuilder.ts +195 -0
  140. package/src/composables/mapAdapters.ts +29 -15
  141. package/src/composables/mapSearch.ts +10 -0
  142. package/src/composables/textDiff.ts +106 -0
  143. package/src/composables/useLocale.ts +215 -0
  144. package/src/index.ts +25 -0
  145. package/src/locales/de.ts +107 -0
  146. package/src/locales/es.ts +107 -0
  147. package/src/locales/fr.ts +107 -0
  148. package/src/locales/ja.ts +107 -0
  149. package/src/locales/ko.ts +107 -0
  150. package/src/locales/pt.ts +107 -0
  151. package/src/locales/zh.ts +107 -0
  152. package/src/map.ts +5 -0
  153. package/dist/MListItem-DVi1j1QI.js.map +0 -1
  154. package/dist/MMenuItem-CRNZkVVr.js.map +0 -1
  155. package/dist/MTooltip-BL3jPYPT.js +0 -754
  156. package/dist/MTooltip-BL3jPYPT.js.map +0 -1
  157. package/dist/_useEscapeStack-C5-BYr8y.js.map +0 -1
  158. package/dist/useLocale-COav9m8C.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"MListItem-DVi1j1QI.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_toDisplayString","$slots","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_renderSlot","_createElementVNode","_toDisplayString","$slots","_hoisted_1","_hoisted_3","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_createVNode","MIcon","_renderSlot","_createTextVNode","_toDisplayString","_hoisted_2","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_renderSlot","_createBlock","MIcon","_createVNode","_unref","_withModifiers","_resolveDynamicComponent","_normalizeStyle","_withCtx","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_hoisted_1","_hoisted_3","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_normalizeStyle","_createVNode","_Transition","_withCtx","_createBlock","MIcon","_toDisplayString","$attrs","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_unref","_normalizeClass","_normalizeStyle","_renderSlot","_createBlock","MIcon","_toDisplayString","_createVNode","_Transition","_withCtx","_resolveDynamicComponent","MAvatar","MCheckbox","MSwitch","useLocale","FAST_SPATIAL","FAST_EFFECTS","useSpring","MIcon_default","MAvatar_default","defineComponent","props","__props","initials","computed","parts","openBlock","createElementBlock","normalizeStyle","toDisplayString","_hoisted_1$5","_hoisted_2$4","_hoisted_3$4","_hoisted_4$2","_hoisted_5$1","_hoisted_6","_hoisted_7","stateLayerClasses","MCard_default","resolvedVariant","fieldBgByVariant","containerClasses","clickableClasses","isInteractive","onKeydown","event","normalizeClass","_ctx","renderSlot","createCommentVNode","createElementVNode","_hoisted_1$4","_hoisted_2$3","_hoisted_3$3","MCheckbox_default","__emit","emit","checkedClasses","checkedBgClasses","_cache","createVNode","createTextVNode","_hoisted_1$3","_hoisted_2$2","_hoisted_3$2","_hoisted_4$1","interactiveClasses","MChip_default","NAMED_TONES","locale","slots","useSlots","isCustomColor","customStyle","toneClasses","map","shapeClass","selectable","hasAvatar","hasTrailing","typedContainer","on","label","leadingIconClass","typedPadding","slidingCheck","pressed","ref","typedEl","checkEl","radius","width","opacity","onTypedClick","createBlock","\"width\"","\"opacity\"","unref","withModifiers","resolveDynamicComponent","withCtx","useSegmentRuns","positions","shallowRef","measure","run","flush","item","i","child","el","observer","onMounted","onUnmounted","_hoisted_1$2","MList_default","listEl","segmentPosition","value","options","o","all","next","keepTabStop","onUpdated","nextTick","classes","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","unselectedThumbClasses","MSwitch_default","trackClasses","thumbClasses","iconClasses","stateLayerBg","isPressed","onPointerDown","onPointerEnd","thumbScale","thumbStyle","stateLayerStyle","Transition","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","REST","HOVERED","LARGE","NESTED_CONTROL","MListItem_default","instance","getCurrentInstance","hasClickListener","internalExpanded","v","isExpanded","list","inject","resolvedLines","isClickable","isOption","isLink","isButton","wrapped","rowRole","rowTabindex","isActive","onRowKeyDown","handleClick","resolvedLeading","resolvedTrailing","iconContainerClasses","isDense","isNav","isSegmented","hasDivider","activeTextClass","activeIconClass","minHeightClass","rootEl","wrapperEl","RowWrapper","shapeEl","r","hovered","focused","expressiveRadii","interactive","pos","top","bottom","target","n","snap","onNestedControl","row","control","onPointerMove","onPointerLeave","onPointerUp","stateLayerOpacity","indentStyle","onFocus","onBlur","tag","linkProps","childrenId","useId","onHeaderKeyDown","toggleExpand","handleTrailingToggle","mergeProps"],"sources":["../src/components/MAvatar.vue","../src/components/MCard.vue","../src/components/MCheckbox.vue","../src/components/MChip.vue","../src/composables/_useSegmentRuns.ts","../src/components/MList.vue","../src/components/MSwitch.vue","../src/components/MListItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A circular initials avatar. There's no image-source prop — it always renders extracted initials or a fallback\n * string, never a photo.\n */\nimport { computed } from 'vue'\n\nconst props = withDefaults(defineProps<{\n /** Full name — initials are extracted automatically (first + last). Takes priority over fallback */\n name?: string\n /** Custom text shown when name is not provided (e.g. 'AJ'). Falls back to '?' if neither is set */\n fallback?: string\n /** Avatar size in px — also scales the font size proportionally (40%) */\n size?: number\n}>(), { size: 40 })\n\nconst initials = computed(() => {\n if (props.name) {\n const parts = props.name.trim().split(/\\s+/).filter(Boolean)\n const first = parts[0]?.[0] ?? ''\n const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? '') : ''\n return (first + last).toUpperCase() || props.fallback || '?'\n }\n return props.fallback || '?'\n})\n</script>\n\n<template>\n <div\n class=\"inline-flex shrink-0 items-center justify-center rounded-full bg-primary-container font-medium text-on-primary-container\"\n :style=\"{ width: `${size}px`, height: `${size}px`, fontSize: `${Math.round(size * 0.4)}px` }\"\n >\n {{ initials }}\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * A flexible surface for grouping related content — three variants following the M3 elevation system, with\n * optional header image, structured title/subtitle, and action buttons.\n *\n * @slot media Custom media content (alternative to the image prop)\n * @slot header Custom header content (overrides title/subtitle props)\n * @slot default Main content area (raw, no wrapper)\n * @slot actions Bottom action buttons (flex row, right-aligned)\n */\nimport { computed } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Card surface style */\n variant?: 'elevated' | 'filled' | 'outlined'\n /**\n * Makes the card an interactive element — hover/press elevation (varies by variant per M3), a focus\n * ring/border on keyboard focus, and reachable/activatable via Tab + Enter/Space, not just mouse\n */\n clickable?: boolean\n /**\n * Shortcut that forces the elevated variant regardless of variant — true is equivalent to\n * variant='elevated'\n */\n elevated?: boolean\n /**\n * Disabled visual state (own per-variant color, not just a dimmed one) and, when combined with clickable,\n * blocks interaction entirely\n */\n disabled?: boolean\n /** src URL for a full-bleed header image */\n image?: string\n /** Alt text for the header image */\n imageAlt?: string\n /** Tailwind height class for the image */\n imageHeight?: string\n /** Card title text */\n title?: string\n /** Supporting text below the title */\n subtitle?: string\n }>(),\n { variant: 'elevated', clickable: false, elevated: false, disabled: false },\n)\n\nconst resolvedVariant = computed(() => (props.elevated ? 'elevated' : props.variant))\n\n// Expose the card's background as --field-bg so outlined text-field labels\n// inside the card automatically match without needing the fieldBg prop.\nconst fieldBgByVariant: Record<string, string> = {\n elevated: 'var(--color-surface-container-low)',\n filled: 'var(--color-surface-container-highest)',\n outlined: 'var(--color-surface)',\n}\n\n/*\n * M3 Card{Filled,Elevated,Outlined}Tokens: all three variants share ContainerShape =\n * CornerMedium (12px), so a flat `rounded-md` on the wrapper (below) is correct for all of\n * them already — no per-variant shape difference. Container color/border IS mutually\n * exclusive between the disabled and enabled cases on purpose (a single computed picking\n * ONE class set, never both at once): two competing `bg-*`/`border-*` utilities for the\n * same CSS property risk losing to each other based on Tailwind's compiled-CSS source\n * order rather than which one appears later in this class list — bit us for real on\n * MIconButton's `relative`/`absolute` and would bite here too with `bg-surface-variant`\n * vs `bg-surface-container-highest` fighting over `background-color`.\n *\n * Disabled colors are real per-variant token overrides (elevated swaps to plain `surface`,\n * filled to `surface-variant`), not just a dimmed version of the resting color, all at 38%\n * container opacity EXCEPT outlined, which keeps its background as-is and only dims the\n * border — to a *different* color too (`outline` at 12%, not the resting `outline-variant`).\n * The opacity is applied via Tailwind's `/38` color-opacity modifier on the background\n * color itself (`bg-surface/38`), not a `opacity-*` utility on the whole element — the\n * real Compose Card only dims the container color, not its content/text, and a plain\n * `opacity-*` class would incorrectly wash out the card's text/icons along with it.\n */\nconst containerClasses = computed(() => {\n const map = props.disabled\n ? {\n elevated: 'bg-surface/38 shadow-none',\n filled: 'bg-surface-variant/38',\n outlined: 'bg-surface border border-outline/12',\n }\n : {\n elevated: 'bg-surface-container-low shadow-elevation-1',\n filled: 'bg-surface-container-highest',\n outlined: 'bg-surface border border-outline-variant',\n }\n return map[resolvedVariant.value]\n})\n\n/*\n * Hover/pressed elevation differ per variant — only `elevated` goes up to Level2 on hover\n * and stays at Level1 while pressed; `filled`/`outlined` only reach Level1 on hover and\n * drop back to flat (Level0/`shadow-none`) while pressed, they never match elevated's\n * pressed-but-still-elevated Level1. Focus indicator also differs: elevated/filled get a\n * `secondary` ring (FocusIndicatorColor) since they have no border to repurpose; outlined\n * instead darkens its own border to `on-surface` (FocusOutlineColor) rather than adding a\n * separate ring on top of the border it already has.\n */\nconst clickableClasses: Record<string, string> = {\n elevated: 'hover:shadow-elevation-2 active:shadow-elevation-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary',\n filled: 'hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary',\n outlined: 'hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:border-on-surface',\n}\n\n// State layer (8% hover / 12% active), same before:-pseudo pattern as MButton/MFab.\n// Needed because the card has a real background to preserve underneath — unlike\n// MListItem, a plain hover:bg-on-surface/8 here would replace the card's own tone.\nconst stateLayerClasses =\n 'relative ' +\n \"before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-on-surface before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'hover:before:opacity-[0.08] active:before:opacity-[0.12]'\n\nconst isInteractive = computed(() => props.clickable && !props.disabled)\n\n// A plain div has no native :disabled/keyboard behavior — role=\"button\" + tabindex make it\n// reachable and identifiable, and Enter/Space here replicate a real button's activation\n// keys by just triggering a native click on the root, so whatever @click listener the\n// consumer attached (via plain attribute fallthrough, since MCard doesn't declare an emit\n// for this) fires exactly as it would for a mouse click, with no separate code path needed.\nfunction onKeydown(event: KeyboardEvent) {\n if (!isInteractive.value) return\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n ;(event.currentTarget as HTMLElement).click()\n }\n}\n</script>\n\n<template>\n <div\n class=\"overflow-hidden rounded-md transition-shadow duration-150\"\n :class=\"[\n containerClasses,\n isInteractive ? ['cursor-pointer', clickableClasses[resolvedVariant], stateLayerClasses] : '',\n disabled ? 'cursor-not-allowed pointer-events-none' : '',\n ]\"\n :style=\"{ '--field-bg': fieldBgByVariant[resolvedVariant] }\"\n :role=\"clickable ? 'button' : undefined\"\n :tabindex=\"isInteractive ? 0 : undefined\"\n :aria-disabled=\"clickable && disabled ? 'true' : undefined\"\n @keydown=\"onKeydown\"\n >\n <!-- Optional header image -->\n <div v-if=\"image || $slots.media\" :class=\"['w-full overflow-hidden', imageHeight ?? 'h-48']\">\n <img\n v-if=\"image\"\n :src=\"image\"\n :alt=\"imageAlt ?? ''\"\n class=\"h-full w-full object-cover\"\n />\n <slot v-else name=\"media\" />\n </div>\n\n <div v-if=\"$slots.header\" class=\"px-4 pt-4 pb-2\">\n <slot name=\"header\" />\n </div>\n <div v-else-if=\"title\" class=\"px-4 pt-4 pb-2\">\n <h3 class=\"text-title-large font-medium text-on-surface\">{{ title }}</h3>\n <p v-if=\"subtitle\" class=\"mt-1 text-body-medium text-on-surface-variant\">{{ subtitle }}</p>\n </div>\n\n <slot />\n\n <div v-if=\"$slots.actions\" class=\"flex justify-end gap-2 px-4 pt-2 pb-4\">\n <slot name=\"actions\" />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * A checkbox with checked, indeterminate, and disabled states, and 4 semantic color options.\n *\n * @slot default Custom label content — overrides the label prop when provided\n * @event update:modelValue Emitted with the new checked state.\n */\nimport MIcon from \"./MIcon.vue\";\n\nwithDefaults(\n defineProps<{\n /** Checked state (v-model) */\n modelValue: boolean;\n /** Indeterminate state */\n indeterminate?: boolean;\n /** Disables the checkbox */\n disabled?: boolean;\n /** Label text — overridden by the default slot when present */\n label?: string;\n /** Checked/indeterminate color */\n color?: \"primary\" | \"secondary\" | \"tertiary\" | \"error\";\n /** Accessible name for the input when there's no visible label (e.g. a list row's checkbox). */\n ariaLabel?: string;\n }>(),\n { indeterminate: false, disabled: false, color: \"primary\" },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [boolean] }>();\n\n// Same 4 named colors + fallback shape as MRadio's checkedColor map. M3's real\n// CheckboxTokens only define Primary (SelectedContainerColor) and Error (as an error\n// STATE, not a color variant) — secondary/tertiary are a deliberate library extension on\n// top of the spec, same status as MSlider's `color`/`icon` props.\nconst checkedClasses: Record<string, string> = {\n primary: \"border-primary bg-primary text-on-primary\",\n secondary: \"border-secondary bg-secondary text-on-secondary\",\n tertiary: \"border-tertiary bg-tertiary text-on-tertiary\",\n error: \"border-error bg-error text-on-error\",\n};\n\n// Just the fill color, reused for the hover/press state layer's tint below.\nconst checkedBgClasses: Record<string, string> = {\n primary: \"bg-primary\",\n secondary: \"bg-secondary\",\n tertiary: \"bg-tertiary\",\n error: \"bg-error\",\n};\n</script>\n\n<template>\n <label\n class=\"group inline-flex items-center gap-2 select-none\"\n :class=\"disabled ? 'cursor-not-allowed' : 'cursor-pointer'\"\n >\n <!--\n CheckboxTokens.StateLayerSize = 40dp (was 48px), StateLayerShape = CornerFull. The\n negative margin cancels the touch target's own overhang past the visible 18px box\n (40-18)/2 = 11px per side, so it doesn't push the label text over.\n -->\n <span class=\"relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full\">\n <!--\n Input must stay nested INSIDE this `relative` span (a true sibling of the state-layer\n /focus-ring spans below, satisfying `peer-*`'s sibling-combinator requirement, but not\n hoisted all the way up to be a direct child of <label>): a sr-only, `position: absolute`\n input with no nearby positioned ancestor made the browser's native focus-scroll\n algorithm treat a distant `overflow: hidden` ancestor as the thing to scroll into view\n on click, which — since that ancestor wasn't meant to scroll at all — blew out to its\n max scrollTop and pushed the entire page off-screen. Real bug, found by testing in the\n docs site; MSwitch's input, nested the same way this one now is again, never had it.\n -->\n <input\n type=\"checkbox\"\n class=\"peer sr-only\"\n :checked=\"modelValue\"\n :disabled=\"disabled\"\n :aria-label=\"ariaLabel\"\n @change=\"emit('update:modelValue', !modelValue)\"\n />\n <!--\n Hover/press state layer (8%/12%), tinted with the checkbox's own indicator color\n (primary/color prop when checked, on-surface when not) — same `before:`-overlay\n spirit as MButton/MCard/MIconButton, just a real sibling span here since the parent\n span is already used for centering/sizing. `group-*` (not a plain `hover:`) so\n hovering anywhere over the row (including the label text) triggers it, not just\n the small 18px glyph itself.\n -->\n <span\n v-if=\"!disabled\"\n class=\"pointer-events-none absolute inset-0 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12]\"\n :class=\"modelValue || indeterminate ? checkedBgClasses[color] : 'bg-on-surface'\"\n />\n <!-- Keyboard-focus ring (FocusIndicatorColor = secondary) -->\n <span\n v-if=\"!disabled\"\n class=\"pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2\"\n />\n\n <span\n class=\"relative inline-flex h-4.5 w-4.5 items-center justify-center rounded-[2px] border-2 transition-colors\"\n :class=\"\n disabled\n ? (modelValue || indeterminate ? 'border-on-surface/38 bg-on-surface/38 text-surface' : 'border-on-surface/38 text-transparent')\n : (modelValue || indeterminate ? checkedClasses[color] : 'border-on-surface-variant text-transparent group-hover:border-on-surface group-active:border-on-surface')\n \"\n >\n <MIcon\n :name=\"indeterminate ? 'remove' : 'check'\"\n :size=\"18\"\n class=\"transition-[opacity,transform] duration-150\"\n :class=\"modelValue || indeterminate ? 'scale-100 opacity-100' : 'scale-0 opacity-0'\"\n />\n </span>\n </span>\n <span\n v-if=\"label || $slots.default\"\n class=\"text-body-large\"\n :class=\"disabled ? 'text-on-surface/38' : 'text-on-surface'\"\n >\n <slot>{{ label }}</slot>\n </span>\n </label>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Compact elements for filters, input, or actions — named semantic tones or any CSS color, with optional icon,\n * click, selection, and removal support. With `type` it's one of M3's four chips instead (assist, filter,\n * input, suggestion), styled by the spec and always interactive; `tone` then doesn't apply.\n *\n * @slot default The chip's label.\n * @slot avatar Input chips only: a 24px round avatar before the label (e.g. an MAvatar or an img)\n * @event click Emitted when a clickable (or typed), non-disabled chip is clicked\n * @event remove Emitted when the remove (X) button is clicked (removable only)\n * @event update:selected Filter and input chips: emitted on click with the new selected state — powers\n * v-model:selected\n */\nimport { computed, ref, useSlots } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { FAST_EFFECTS, FAST_SPATIAL, useSpring } from '../composables/_useSpring'\n\nconst NAMED_TONES = ['neutral', 'primary', 'success', 'error', 'tertiary', 'secondary'] as const\ntype NamedTone = (typeof NAMED_TONES)[number]\n\nconst props = withDefaults(\n defineProps<{\n /** Color tone or any CSS color string */\n tone?: string // named tone OR CSS color string\n /** Selected/active state — the chip's shape morphs from a rounded rect to a full pill when selected */\n selected?: boolean\n /** Show a remove (X) button */\n removable?: boolean\n /**\n * Makes the chip an interactive `<button>` with hover/press/focus feedback (otherwise renders as a plain\n * `<span>`)\n */\n clickable?: boolean\n /** Disables interaction */\n disabled?: boolean\n /** Leading Material Symbol icon */\n icon?: string\n /**\n * One of M3's chips: `assist` (an action), `filter` (on/off, v-model:selected; a check slides in while\n * selected), `input` (a piece of user input, with an optional #avatar and `removable`), `suggestion`.\n * Leave unset for the generic tone-colored chip\n */\n type?: 'assist' | 'filter' | 'input' | 'suggestion'\n /** Typed assist, filter and suggestion chips: surface-container-low with elevation 1 instead of an outline */\n elevated?: boolean\n /** Typed chips: a trailing Material Symbol icon (e.g. arrow_drop_down on a filter chip that opens a menu) */\n trailingIcon?: string\n }>(),\n {\n tone: 'neutral',\n selected: false,\n removable: false,\n clickable: false,\n disabled: false,\n elevated: false,\n },\n)\n\nconst emit = defineEmits<{ click: []; remove: []; 'update:selected': [boolean] }>()\nconst locale = useLocale()\nconst slots = useSlots()\n\nconst isCustomColor = computed(\n () => !!props.tone && !(NAMED_TONES as readonly string[]).includes(props.tone),\n)\n\n// When a CSS color is passed, apply it via CSS variables\nconst customStyle = computed(() => {\n if (!isCustomColor.value) return undefined\n return {\n '--chip-bg': props.tone + '22',\n '--chip-color': props.tone,\n }\n})\n\n// M3 disabled tokens: label/icon always at 38% on-surface. Container: neutral/unselected\n// chips are outline-only (no fill), so the outline fades to 10% (UnselectedDisabledOutlineOpacity);\n// every other tone/selected chip has a filled container, so the fill fades to 12%\n// (SelectedDisabledContainerOpacity) instead, with any border dropped.\nconst toneClasses = computed(() => {\n if (props.disabled) {\n if (props.tone === 'neutral' && !props.selected && !isCustomColor.value) {\n return 'border border-on-surface/10 bg-transparent text-on-surface/38'\n }\n return 'border border-transparent bg-on-surface/12 text-on-surface/38'\n }\n if (isCustomColor.value) {\n return 'border border-transparent bg-[var(--chip-bg)] text-[var(--chip-color)]'\n }\n if (props.tone === 'neutral' && !props.selected) {\n // ChipsTokens.UnselectedOutlineColor = OutlineVariant, not Outline\n return 'border border-outline-variant bg-transparent text-on-surface-variant'\n }\n const map: Record<string, string> = {\n neutral: 'border border-transparent bg-secondary-container text-on-secondary-container',\n primary: 'border border-transparent bg-primary-container text-on-primary-container',\n secondary: 'border border-transparent bg-secondary-container text-on-secondary-container',\n success: 'border border-transparent bg-success-container text-on-success-container',\n error: 'border border-transparent bg-error-container text-on-error-container',\n tertiary: 'border border-transparent bg-tertiary-container text-on-tertiary-container',\n }\n return map[props.tone ?? 'neutral'] ?? map.neutral\n})\n\n// ChipsTokens: UnselectedShape = CornerMedium (12dp), SelectedShape = CornerFull — a chip\n// becomes a full pill once selected, it doesn't keep the same small corner radius.\nconst shapeClass = computed(() => props.selected ? 'rounded-full' : 'rounded-md')\n\n// Hover/press state layer (8%/12%, ChipsTokens has no dedicated token but this matches the\n// universal M3 state-layer convention used everywhere else in this library) via the same\n// `before:`-overlay technique as MButton/MCard/MIconButton — a plain `hover:bg-*` would just\n// replace a filled/selected chip's own background outright instead of overlaying on top of\n// it. `ring-inset` on the focus ring (FocusedIndicatorColor = secondary) because `overflow-\n// hidden` on this same element (needed to clip the state-layer to the chip's shape) would\n// otherwise clip an outset ring's box-shadow too.\n// ── Typed chips (Compose's AssistChip / FilterChip / InputChip / SuggestionChip) ─────────────────────\n// 32dp, label-large, 18dp icons. Assist and suggestion keep CornerSmall (8dp); filter and input use the\n// Expressive ChipShapes (CornerMedium 12dp, CornerFull while selected, CornerSmall while pressed) and the\n// unified ChipsTokens colors.\nconst selectable = computed(() => props.type === 'filter' || props.type === 'input')\nconst hasAvatar = computed(() => props.type === 'input' && !!slots.avatar)\nconst hasTrailing = computed(() => !!props.trailingIcon || (props.type === 'input' && props.removable))\n\nconst typedContainer = computed(() => {\n const on = selectable.value && props.selected\n if (props.disabled) {\n if (on) return 'bg-on-surface/12 text-on-surface/38'\n return props.elevated && props.type !== 'input'\n ? 'bg-on-surface/12 text-on-surface/38'\n : 'border border-on-surface/12 text-on-surface/38'\n }\n if (on) return ['bg-secondary-container text-on-secondary-container', props.elevated ? 'shadow-elevation-1 hover:shadow-elevation-2' : '']\n const label = props.type === 'assist' ? 'text-on-surface' : 'text-on-surface-variant'\n return props.elevated && props.type !== 'input'\n ? ['bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2', label]\n : ['border border-outline-variant', label]\n})\n\nconst leadingIconClass = computed(() => {\n if (props.disabled) return ''\n if (props.type === 'assist' || props.type === 'suggestion') return 'text-primary'\n return props.selected ? 'text-on-secondary-container' : 'text-on-surface-variant'\n})\n\n// Compose's chip paddings: 8dp next to a leading/trailing icon, 16dp otherwise; an input chip 4dp next to an\n// avatar, 8dp next to an icon, 12dp (4 + the label's 8) otherwise\nconst typedPadding = computed(() => {\n if (props.type === 'input') {\n return [hasAvatar.value ? 'pl-1' : props.icon ? 'pl-2' : 'pl-3', hasTrailing.value ? 'pr-2' : 'pr-3']\n }\n // A filter chip's sliding check carries its own spacing (see checkEl), so its padding stays put\n return [props.icon || slidingCheck.value ? 'pl-2' : 'pl-4', hasTrailing.value ? 'pr-2' : 'pr-4']\n})\n\nconst pressed = ref(false)\nconst typedEl = ref<HTMLElement>()\nconst checkEl = ref<HTMLElement>()\n// Filter chip without its own icon: the check expands in (FastSpatial) and fades in (FastEffects) as it gets\n// selected, like Compose's animated chip content. Its slot runs from 8px (with the 8px padding: the label at\n// 16px, an iconless chip's padding) to 26px (the check at 8px, the label 8px after it).\nconst slidingCheck = computed(() => props.type === 'filter' && !props.icon)\nuseSpring(\n () => (props.type === 'filter' || props.type === 'input'\n ? [pressed.value ? 8 : props.selected ? 16 : 12, slidingCheck.value ? (props.selected ? 26 : 8) : 0]\n : []),\n ([radius, width]) => {\n if (typedEl.value && radius !== undefined) typedEl.value.style.borderRadius = `${radius}px`\n if (checkEl.value && width !== undefined) checkEl.value.style.width = `${width}px`\n },\n FAST_SPATIAL,\n)\nuseSpring(\n () => (slidingCheck.value ? [props.selected ? 1 : 0] : []),\n ([opacity]) => { if (checkEl.value && opacity !== undefined) checkEl.value.style.opacity = String(opacity) },\n FAST_EFFECTS,\n)\n\nfunction onTypedClick() {\n if (props.disabled) return\n if (selectable.value) emit('update:selected', !props.selected)\n emit('click')\n}\n\nconst interactiveClasses =\n \"relative cursor-pointer before:content-[''] before:pointer-events-none before:absolute before:inset-0 \" +\n 'before:bg-current before:opacity-0 before:transition-opacity before:duration-150 ' +\n 'hover:before:opacity-[0.08] active:before:opacity-[0.12] ' +\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary'\n</script>\n\n<template>\n <span\n v-if=\"type\"\n ref=\"typedEl\"\n class=\"relative inline-flex h-8 items-center overflow-hidden align-middle text-label-large transition-[background-color,box-shadow,color] has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-inset has-[button:focus-visible]:ring-secondary\"\n :class=\"[typedContainer, type === 'assist' || type === 'suggestion' ? 'rounded-sm' : 'rounded-md']\"\n >\n <!-- Typed chip: the container is a span so an input chip's remove button can sit beside (not inside) the\n main button; the main button's state layer (before:) covers the whole chip -->\n <button\n type=\"button\"\n class=\"flex h-full items-center gap-2 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity\"\n :class=\"[typedPadding, disabled ? 'cursor-not-allowed' : 'cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]']\"\n :disabled=\"disabled\"\n :aria-pressed=\"selectable ? selected : undefined\"\n @pointerdown=\"pressed = true\"\n @pointerup=\"pressed = false\"\n @pointerleave=\"pressed = false\"\n @pointercancel=\"pressed = false\"\n @click=\"onTypedClick\"\n >\n <span v-if=\"hasAvatar\" class=\"-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full\" :class=\"disabled ? 'opacity-38' : ''\">\n <slot name=\"avatar\" />\n </span>\n <MIcon v-else-if=\"icon\" :name=\"icon\" :size=\"18\" :filled=\"type === 'filter' && selected\" class=\"shrink-0\" :class=\"leadingIconClass\" />\n <!-- -mr-2 cancels the gap while the check is closed -->\n <span v-else-if=\"slidingCheck\" ref=\"checkEl\" class=\"-mr-2 flex shrink-0 overflow-hidden\" style=\"width: 8px; opacity: 0\" aria-hidden=\"true\">\n <MIcon name=\"check\" :size=\"18\" class=\"shrink-0\" :class=\"leadingIconClass\" />\n </span>\n <span class=\"whitespace-nowrap\"><slot /></span>\n <MIcon v-if=\"trailingIcon\" :name=\"trailingIcon\" :size=\"18\" class=\"shrink-0\" :class=\"disabled ? '' : selected && selectable ? 'text-on-secondary-container' : 'text-on-surface-variant'\" />\n </button>\n <button\n v-if=\"type === 'input' && removable\"\n type=\"button\"\n class=\"relative -ml-1 mr-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary\"\n :class=\"disabled ? 'cursor-not-allowed' : 'cursor-pointer'\"\n :aria-label=\"locale.remove\"\n :disabled=\"disabled\"\n @click.stop=\"emit('remove')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </span>\n\n <component\n :is=\"clickable ? 'button' : 'span'\"\n v-else\n :type=\"clickable ? 'button' : undefined\"\n :disabled=\"clickable && disabled ? true : undefined\"\n class=\"inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors\"\n :class=\"[\n shapeClass,\n toneClasses,\n clickable && !disabled ? interactiveClasses : '',\n disabled ? 'cursor-not-allowed' : '',\n ]\"\n :style=\"customStyle\"\n @click=\"clickable && !disabled && emit('click')\"\n >\n <MIcon v-if=\"icon\" :name=\"icon\" :size=\"18\" />\n <slot />\n <button\n v-if=\"removable\"\n type=\"button\"\n class=\"-mr-1 ml-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/12\"\n :aria-label=\"locale.remove\"\n :disabled=\"disabled\"\n @click.stop=\"emit('remove')\"\n >\n <MIcon name=\"close\" :size=\"16\" />\n </button>\n </component>\n</template>\n","/**\n * Internal (not exported from index.ts): where each item of a segmented list sits in its run, for\n * SegmentedListItem's segmentedShapes(index, count). A run is consecutive `role=\"listitem\"` children of `el`;\n * anything else (a subheader, an MListGroup) ends it. Used by MList and by MListGroup for its own items.\n */\nimport { onMounted, onUnmounted, shallowRef, type Ref } from 'vue'\n\nexport type SegmentPosition = 'single' | 'first' | 'middle' | 'last'\n\nexport function useSegmentRuns(el: Ref<HTMLElement | undefined>) {\n const positions = shallowRef(new Map<Element, SegmentPosition>())\n\n function measure() {\n const map = new Map<Element, SegmentPosition>()\n let run: Element[] = []\n const flush = () => {\n run.forEach((item, i) => map.set(item, run.length === 1 ? 'single' : i === 0 ? 'first' : i === run.length - 1 ? 'last' : 'middle'))\n run = []\n }\n for (const child of el.value?.children ?? []) {\n if (child.getAttribute('role') === 'listitem') run.push(child)\n else flush()\n }\n flush()\n positions.value = map\n }\n\n let observer: MutationObserver | undefined\n onMounted(() => {\n measure()\n if (el.value) {\n observer = new MutationObserver(measure)\n observer.observe(el.value, { childList: true })\n }\n })\n onUnmounted(() => observer?.disconnect())\n\n return (item: Element | null | undefined) => (item ? positions.value.get(item) : undefined)\n}\n","<script setup lang=\"ts\">\n/**\n * A vertical list container (MList) with rich, flexible rows (MListItem) and optional section headers\n * (MListSubheader) — one-line to three-line items, leading/trailing elements, selection, navigation, segmented,\n * and expandable variants. MListGroup splits a list into groups (separate rounded runs in a segmented list).\n *\n * @slot default MListItem / MListSubheader / MListGroup children\n * @event update:selected Fires when a selectable item is clicked (via v-model:selected)\n */\nimport { computed, nextTick, onMounted, onUpdated, provide, ref } from 'vue'\nimport { useSegmentRuns } from '../composables/_useSegmentRuns'\n\nconst props = withDefaults(\n defineProps<{\n /** Compact vertical padding on child items */\n dense?: boolean\n /** Show separators between items — 'inset' aligns the line past a leading icon/avatar */\n dividers?: boolean | 'inset'\n /** Navigation variant with rounded (pill) active items, ideal for drawers */\n nav?: boolean\n /** Segmented style — items each get an individual rounded background instead of a flat list */\n segmented?: boolean\n /** Enable single-item selection — items compare their value prop against selected */\n selectable?: boolean\n /** Currently selected item value (v-model:selected) */\n selected?: string | number | null\n /** Default line count for child items that don't set their own lines prop */\n lines?: 1 | 2 | 3\n }>(),\n { dense: false, dividers: false, nav: false, segmented: false, selectable: false },\n)\n\nconst emit = defineEmits<{\n 'update:selected': [value: string | number | null]\n}>()\n\n// Segmented items need to know whether they open or close their run of items. A subheader, an MListGroup\n// or any other non-item child starts a new run.\nconst listEl = ref<HTMLElement>()\nconst segmentPosition = useSegmentRuns(listEl)\n\nprovide('m-list', {\n segmentPosition,\n dense: computed(() => props.dense),\n nav: computed(() => props.nav),\n segmented: computed(() => props.segmented),\n selectable: computed(() => props.selectable),\n selected: computed(() => props.selected),\n dividers: computed(() => props.dividers),\n lines: computed(() => props.lines),\n select: (value: string | number) => emit('update:selected', value),\n})\n\n// A selectable list is a listbox: its items are options, one Tab stop (the selected one, else the first), the\n// arrows, Home and End move between them, Enter/Space select (MListItem)\nconst options = () => [...(listEl.value?.querySelectorAll<HTMLElement>('[role=\"option\"]') ?? [])]\n .filter((o) => o.getAttribute('aria-disabled') !== 'true')\nfunction onKeydown(e: KeyboardEvent) {\n if (!props.selectable) return\n const all = options()\n const i = all.indexOf(document.activeElement as HTMLElement)\n if (i < 0) return\n const next = e.key === 'ArrowDown' ? all[i + 1] : e.key === 'ArrowUp' ? all[i - 1] : e.key === 'Home' ? all[0] : e.key === 'End' ? all[all.length - 1] : undefined\n if (!next) return\n e.preventDefault()\n next.focus()\n}\n// With nothing selected (or a selection not in the list), the first option takes the Tab stop. Bound tabindexes\n// only patch when they change, so this one stays until the selection moves it.\nfunction keepTabStop() {\n if (!props.selectable) return\n const all = options()\n if (all.length && !all.some((o) => o.tabIndex === 0)) all[0]!.tabIndex = 0\n}\nonMounted(keepTabStop)\nonUpdated(() => nextTick(keepTabStop))\n\nconst classes = computed(() => [\n 'flex flex-col',\n // ListTokens.SegmentedGap = 2dp\n props.segmented ? 'gap-0.5 p-2' : 'py-2',\n props.nav && !props.segmented && 'gap-0.5 px-3',\n])\n</script>\n\n<template>\n <ul ref=\"listEl\" :role=\"selectable ? 'listbox' : 'list'\" :class=\"classes\" @keydown=\"onKeydown\">\n <slot />\n </ul>\n</template>\n","<script setup lang=\"ts\">\n/**\n * A toggle switch with an optional label, 4 semantic colors, and both M3 icon variants.\n *\n * @event update:modelValue Emitted with the new on/off state.\n */\nimport { computed, ref } from 'vue'\nimport MIcon from './MIcon.vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Toggle state (v-model) */\n modelValue: boolean\n /** Disables the switch */\n disabled?: boolean\n /** Label text */\n label?: string\n /** Track/thumb color when on */\n color?: 'primary' | 'secondary' | 'tertiary' | 'error'\n /** Shows a check icon in the thumb while on. Set to `false` for M3's plain switch without an icon. */\n // M3 officially has two Switch variants: with a check icon inside the thumb (the\n // `thumbContent` slot filled), and without (Compose's actual default — `thumbContent`\n // defaults to `null`). Defaults to `true` here to keep this component's existing look;\n // pass `false` for the plain/no-icon variant.\n icon?: boolean\n }>(),\n { disabled: false, color: 'primary', icon: true },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [boolean] }>()\n\n// Same 4 named colors as MRadio/MCheckbox's color prop.\nconst trackClasses: Record<string, string> = {\n primary: 'border-primary bg-primary',\n secondary: 'border-secondary bg-secondary',\n tertiary: 'border-tertiary bg-tertiary',\n error: 'border-error bg-error',\n}\n// Selected handle: resting = on-{color} (OnPrimary etc.), hover/focus/press = {color}-container\n// (SwitchTokens.Selected{Hover,Focus,Pressed}HandleColor = PrimaryContainer, NOT OnPrimary —\n// the handle itself recolors on interaction, distinct from the track staying put).\nconst thumbClasses: Record<string, string> = {\n primary: 'bg-on-primary group-hover:bg-primary-container group-active:bg-primary-container peer-focus-visible:bg-primary-container',\n secondary: 'bg-on-secondary group-hover:bg-secondary-container group-active:bg-secondary-container peer-focus-visible:bg-secondary-container',\n tertiary: 'bg-on-tertiary group-hover:bg-tertiary-container group-active:bg-tertiary-container peer-focus-visible:bg-tertiary-container',\n error: 'bg-on-error group-hover:bg-error-container group-active:bg-error-container peer-focus-visible:bg-error-container',\n}\n// Unselected handle: resting = outline, hover/focus/press = on-surface-variant — a fixed\n// color regardless of the `color` prop, since the unselected state never carries it.\nconst unselectedThumbClasses =\n 'bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant'\n\n// Icon-on-handle color is a DIFFERENT role from the handle's own fill (SelectedIconColor =\n// OnPrimaryContainer, not OnPrimary) — it needs to read against whatever the handle is\n// currently showing (on-primary at rest, primary-container on hover/press), and\n// on-primary-container works against both.\nconst iconClasses: Record<string, string> = {\n primary: 'text-on-primary-container',\n secondary: 'text-on-secondary-container',\n tertiary: 'text-on-tertiary-container',\n error: 'text-on-error-container',\n}\n\n// State layer + focus ring tint, same idea as the handle color map above but for the\n// larger 40px circle that trails the thumb (see stateLayerStyle below) rather than the\n// handle itself — reuses the selected color's own base tone (bg-primary etc.), not the\n// container variant, matching StateLayerShape's plain-color state-layer convention used\n// for MCheckbox/MChip/MRadio elsewhere in this library.\nconst stateLayerBg: Record<string, string> = {\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n tertiary: 'bg-tertiary',\n error: 'bg-error',\n}\n\n// Real handle grows from 24dp (selected) / 16dp (unselected) to a shared 28dp while\n// pressed (SwitchTokens.Pressed{Handle}Width/Height) — via `scale()` on the same fixed-size\n// box the 16dp unselected state already uses `scale(0.667)` for, not by changing width/\n// height directly (which would fight the JS-computed inline `transform` below on\n// specificity, the same class-vs-inline-style trap already hit once this session).\n// Needs real pointerdown/up tracking (not a CSS `active:` utility) because that transform\n// is computed in JS, not a plain class, so CSS pseudo-classes can't reach into it.\nconst isPressed = ref(false)\nfunction onPointerDown() {\n if (!props.disabled) isPressed.value = true\n}\nfunction onPointerEnd() {\n isPressed.value = false\n}\n\nconst thumbScale = computed(() => {\n if (isPressed.value) return 28 / 24\n return props.modelValue ? 1 : 16 / 24\n})\n\n// All thumb transforms live here so each direction can use its own easing curve.\n// translateY(-50%) vertically centres the thumb in the 32px track.\n// ON → spring cubic-bezier: overshoots ~2px then settles → satisfying \"click\"\n// OFF → M3 standard decelerate: clean snap back, no undershoot\nconst thumbStyle = computed(() => ({\n transform: `translateY(-50%) translateX(${props.modelValue ? 18 : 0}px) scale(${thumbScale.value})`,\n transition: props.modelValue\n ? 'transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 280ms ease'\n : 'transform 240ms cubic-bezier(0.2, 0, 0, 1), background-color 240ms ease',\n}))\n\n// StateLayerSize/StateLayerShape = 40dp circle, CornerFull — positioned to trail the\n// thumb's own translateX so it's centered on the thumb at both ends of the track, not a\n// static overlay covering the whole switch the way MCheckbox/MRadio's does (those don't\n// have a moving part). Base offset -4px accounts for the 40px circle being 8px taller/wider\n// than the 32px track and 24px thumb it's centered on.\nconst stateLayerStyle = computed(() => ({\n transform: `translateX(${props.modelValue ? 18 : 0}px)`,\n transition: props.modelValue\n ? 'transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)'\n : 'transform 240ms cubic-bezier(0.2, 0, 0, 1)',\n}))\n</script>\n\n<template>\n <label\n class=\"group inline-flex items-center gap-3 select-none\"\n :class=\"disabled ? 'cursor-not-allowed opacity-[0.38]' : 'cursor-pointer'\"\n @pointerdown=\"onPointerDown\"\n @pointerup=\"onPointerEnd\"\n @pointerleave=\"onPointerEnd\"\n @pointercancel=\"onPointerEnd\"\n >\n <span class=\"relative -my-2 inline-flex h-12 shrink-0 items-center\">\n <span\n class=\"relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200\"\n :class=\"modelValue ? trackClasses[color] : 'border-outline bg-surface-container-highest'\"\n >\n <input\n type=\"checkbox\"\n class=\"peer sr-only\"\n :checked=\"modelValue\"\n :disabled=\"disabled\"\n @change=\"emit('update:modelValue', !modelValue)\"\n />\n\n <!-- Hover/press/focus state layer + focus ring, both tracking the thumb's position (see stateLayerStyle doc above) -->\n <span\n v-if=\"!disabled\"\n class=\"pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12] peer-focus-visible:opacity-[0.08]\"\n :class=\"modelValue ? stateLayerBg[color] : 'bg-on-surface-variant'\"\n :style=\"stateLayerStyle\"\n />\n <span\n v-if=\"!disabled\"\n class=\"pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2\"\n :style=\"stateLayerStyle\"\n />\n\n <!-- Thumb: position + size animated via inline style (allows per-direction easing) -->\n <span\n class=\"absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform\"\n :class=\"modelValue ? [thumbClasses[color], 'shadow-sm'] : unselectedThumbClasses\"\n :style=\"thumbStyle\"\n >\n <Transition\n enter-active-class=\"transition-opacity duration-150 delay-[120ms]\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <MIcon v-if=\"modelValue && icon\" name=\"check\" :size=\"14\" :class=\"iconClasses[color]\" />\n </Transition>\n </span>\n </span>\n </span>\n <span v-if=\"label\" class=\"text-body-large text-on-surface\">{{ label }}</span>\n </label>\n</template>\n","<script setup lang=\"ts\">\n/**\n * A row of an MList: headline with optional overline, supporting text, a leading icon, avatar or image, and\n * trailing text, icon, checkbox or switch. It can be a link, be clickable or expand to show nested items.\n *\n * @slot leading Custom leading element, replacing the icon/avatar/image/icon-container\n * @slot overline Custom overline content, replacing the overline prop\n * @slot default Custom content replacing the title/subtitle/description text block\n * @slot children Nested content revealed when expandable is set and the item is expanded\n * @slot trailing Custom trailing element, replacing the icon/text/switch/checkbox. On an expandable item it sits\n * before the expand icon, and its controls (a switch, a button) don't open or close the item\n * @event click Fires on any click, including on an expandable item (right before it toggles)\n * @event update:trailingValue Fires when a trailing switch/checkbox is toggled (trailing='switch' | 'checkbox')\n * @event update:expanded Fires when an expandable item is toggled open/closed\n */\nimport { computed, getCurrentInstance, h, inject, ref, useId, watch, type FunctionalComponent } from 'vue'\nimport type { ComponentPublicInstance } from 'vue'\nimport type { ComputedRef } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MAvatar from './MAvatar.vue'\nimport MCheckbox from './MCheckbox.vue'\nimport MSwitch from './MSwitch.vue'\nimport { useSpring } from '../composables/_useSpring'\n\nexport type ListItemLeading = 'icon' | 'avatar' | 'checkbox' | 'radio' | 'image' | 'icon-container'\nexport type ListItemTrailing = 'icon' | 'text' | 'switch' | 'checkbox'\n\nconst props = withDefaults(\n defineProps<{\n /** Primary text (headline) */\n title?: string\n /** Small label above the title */\n overline?: string\n /** Secondary text (line 2) */\n subtitle?: string\n /** Tertiary text (line 3) */\n description?: string\n /** Number of text lines — auto-detected from which text props/parent MList lines are set when omitted */\n lines?: 1 | 2 | 3\n /** Leading Material Symbol icon */\n icon?: string\n /**\n * Leading element type — auto-resolves to 'icon'/'avatar'/'image' from icon/avatarName/image when omitted\n */\n leading?: ListItemLeading\n /** Name for the avatar (when leading='avatar') */\n avatarName?: string\n /** Image URL (when leading='image') */\n image?: string\n /** Icon container background color (when leading='icon-container') */\n iconContainerColor?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success'\n /** Trailing icon name */\n trailingIcon?: string\n /** Trailing text label */\n trailingText?: string\n /** Trailing element type — auto-resolves from trailingIcon/trailingText when omitted */\n trailing?: ListItemTrailing\n /** Value for a trailing switch/checkbox (v-model:trailingValue) */\n trailingValue?: boolean\n /** Selection value — compared against the parent MList selected prop */\n value?: string | number\n /** Force the active/highlighted state regardless of parent list selection */\n active?: boolean\n /** Disabled state (38% opacity, blocks interaction) */\n disabled?: boolean\n /** Force interactive styling/behavior (auto-true when href, to, @click, selectable, or expandable apply) */\n clickable?: boolean\n /** Link URL — renders the item as an `<a>` */\n href?: string\n /** Vue Router destination — renders the item as a router-link */\n to?: string | object\n /** Show an expand/collapse chevron revealing the #children slot */\n expandable?: boolean\n /** Control the expanded state (v-model:expanded) — otherwise managed internally */\n expanded?: boolean\n /** Indent of the expanded #children: px, or any CSS length. Narrow it on small screens */\n indent?: number | string\n }>(),\n { active: false, disabled: false, expandable: false },\n)\n\nconst emit = defineEmits<{\n click: [e: MouseEvent]\n 'update:trailingValue': [value: boolean]\n 'update:expanded': [value: boolean]\n}>()\n\n// Root attrs go on the row (the element that looks like the item), which is wrapped in an <li> for links and buttons\ndefineOptions({ inheritAttrs: false })\n// `click` is a declared emit, so a listener for it never shows up in attrs: read it off the vnode\nconst instance = getCurrentInstance()\nconst hasClickListener = () => !!instance?.vnode.props?.onClick\n\nconst internalExpanded = ref(props.expanded ?? false)\nwatch(() => props.expanded, (v) => { if (v !== undefined) internalExpanded.value = v })\nconst isExpanded = computed(() => internalExpanded.value)\n\nconst list = inject<{\n segmentPosition: (el: Element | null | undefined) => 'single' | 'first' | 'middle' | 'last' | undefined\n dense: ComputedRef<boolean>\n nav: ComputedRef<boolean>\n segmented: ComputedRef<boolean>\n selectable: ComputedRef<boolean>\n selected: ComputedRef<string | number | null | undefined>\n dividers: ComputedRef<boolean | 'inset'>\n lines: ComputedRef<1 | 2 | 3 | undefined>\n select: (value: string | number) => void\n} | null>('m-list', null)\n\nconst resolvedLines = computed(() => {\n if (props.lines) return props.lines\n if (list?.lines.value) return list.lines.value\n if (props.description || (props.overline && props.subtitle)) return 3\n if (props.subtitle || props.overline) return 2\n return 1\n})\n\nconst isClickable = computed(() =>\n props.clickable || props.href || props.to || hasClickListener() || list?.selectable.value || props.expandable,\n)\n\n// What the row is for assistive technology and the keyboard. In a selectable list, an option of its listbox\n// (MList moves focus between them with the arrows); a link stays a link and a clickable row is a button, each\n// inside an <li> since a list can only hold list items; anything else is a plain list item.\nconst isOption = computed(() => !!list?.selectable.value && props.value != null && !props.href && !props.to && !props.expandable)\nconst isLink = computed(() => !!(props.href || props.to))\nconst isButton = computed(() => !isOption.value && !isLink.value && !props.expandable && (props.clickable || hasClickListener()))\nconst wrapped = computed(() => isLink.value || isButton.value)\nconst rowRole = computed(() => (isOption.value ? 'option' : isButton.value ? 'button' : isLink.value ? undefined : 'listitem'))\nconst rowTabindex = computed(() => {\n if (isOption.value) return isActive.value && !props.disabled ? 0 : -1\n if (isButton.value) return props.disabled ? -1 : 0\n return undefined\n})\nfunction onRowKeyDown(e: KeyboardEvent) {\n if (!isOption.value && !isButton.value) return\n if ((e.key !== 'Enter' && e.key !== ' ') || e.target !== e.currentTarget) return\n e.preventDefault()\n handleClick(e as unknown as MouseEvent)\n}\n\nconst isActive = computed(() => {\n if (props.active) return true\n if (list?.selectable.value && props.value != null) return list.selected.value === props.value\n return false\n})\n\nconst resolvedLeading = computed(() => {\n if (props.leading) return props.leading\n if (props.icon) return 'icon'\n if (props.avatarName) return 'avatar'\n if (props.image) return 'image'\n return null\n})\n\nconst resolvedTrailing = computed(() => {\n if (props.expandable) return 'expand'\n if (props.trailing) return props.trailing\n if (props.trailingIcon) return 'icon'\n if (props.trailingText) return 'text'\n return null\n})\n\nconst iconContainerClasses: Record<string, string> = {\n primary: 'bg-primary-container text-on-primary-container',\n secondary: 'bg-secondary-container text-on-secondary-container',\n tertiary: 'bg-tertiary-container text-on-tertiary-container',\n error: 'bg-error-container text-on-error-container',\n success: 'bg-success-container text-on-success-container',\n}\n\nconst isDense = computed(() => list?.dense.value ?? false)\nconst isNav = computed(() => list?.nav.value ?? false)\nconst isSegmented = computed(() => list?.segmented.value ?? false)\nconst hasDivider = computed(() => list?.dividers.value ?? false)\n\n// ListTokens: ItemSelectedLabelTextColor/ItemSelectedLeadingIconColor/etc = OnSecondaryContainer\nconst activeTextClass = computed(() => (isActive.value ? 'text-on-secondary-container' : 'text-on-surface'))\nconst activeIconClass = computed(() => (isActive.value ? 'text-on-secondary-container' : 'text-on-surface-variant'))\n\n// ListTokens: ItemOneLineContainerHeight/TwoLine/ThreeLine = 56/72/88dp; dense is a library\n// extension with no spec token, so it keeps its own compact padding instead of this floor.\nconst minHeightClass = computed(() => {\n if (isDense.value) return ''\n return resolvedLines.value === 3 ? 'min-h-22' : resolvedLines.value === 2 ? 'min-h-18' : 'min-h-14'\n})\n\nconst containerClasses = computed(() => [\n 'mli-row relative flex w-full items-center gap-4 text-left',\n // Corner radius: a pill in nav lists, otherwise sprung by expressiveRadii below\n isSegmented.value ? 'bg-surface-container px-4' : isNav.value ? 'rounded-full px-4' : 'px-4',\n isDense.value\n ? 'py-1'\n : resolvedLines.value === 3 ? 'py-3' : 'py-2',\n minHeightClass.value,\n isClickable.value && !props.disabled && 'cursor-pointer',\n // ListTokens: ItemSelectedContainerColor = SecondaryContainer, applies to any selected list\n // item, not just nav/segmented contexts.\n isActive.value && 'bg-secondary-container text-on-secondary-container',\n props.disabled && 'opacity-[0.38] pointer-events-none',\n])\n\n// ── Expressive shape morph ──────────────────────────────────────────────────────────────────\n// The current (non-deprecated) ListItem overloads morph the container's corners by interaction, with\n// ListItemDefaults.shapes(): ListTokens.ItemContainerExpressiveShape CornerExtraSmall (4dp) at rest,\n// ItemHovered… CornerMedium (8dp), ItemPressed/Focused/Selected… CornerLarge (16dp), priority\n// pressed > selected > focused > hovered (shapeForInteraction). SegmentedListItem's segmentedShapes() swaps\n// only the resting shape's outer corners for ListTokens.ContainerShape (CornerLarge) on the first and last\n// item of a run; the interaction shapes stay the same. Animated with MotionSchemeKeyTokens.FastSpatial.\n// Nav lists keep their pill (that's NavigationDrawerItem's shape, which doesn't morph).\nconst rootEl = ref<Element | ComponentPublicInstance | null>(null)\n// The <li> around a link or button row (the list's child, for segment runs); other rows are the <li> themselves\nconst wrapperEl = ref<Element | null>(null)\nconst RowWrapper: FunctionalComponent = (_, { slots }) =>\n wrapped.value\n ? h('li', { role: 'listitem', ref: (e) => { wrapperEl.value = e as Element | null } }, slots.default?.())\n : slots.default?.()\nconst shapeEl = ref<HTMLElement | null>(null)\nconst el = (r: Element | ComponentPublicInstance | null) => (r && '$el' in r ? (r.$el as Element) : r)\nconst hovered = ref(false)\nconst pressed = ref(false)\nconst focused = ref(false)\n\nconst REST = 4\nconst HOVERED = 8\nconst LARGE = 16\n\nconst segmentPosition = computed(() => (isSegmented.value ? list?.segmentPosition(wrapped.value ? wrapperEl.value : el(rootEl.value)) : undefined))\n\nconst expressiveRadii = computed<number[]>(() => {\n if (isNav.value) return []\n const interactive = isClickable.value && !props.disabled\n const r = interactive && pressed.value ? LARGE\n : isActive.value ? LARGE\n : interactive && focused.value ? LARGE\n : interactive && hovered.value ? HOVERED\n : null\n if (r !== null) return [r, r, r, r]\n const pos = segmentPosition.value\n const top = pos === 'first' || pos === 'single' ? LARGE : REST\n const bottom = pos === 'last' || pos === 'single' ? LARGE : REST\n return [top, top, bottom, bottom]\n})\n\nconst { snap } = useSpring(() => expressiveRadii.value, (v) => {\n const target = shapeEl.value ?? (el(rootEl.value) as HTMLElement | null)\n if (!target) return\n target.style.borderRadius = v.length ? v.map((n) => `${n}px`).join(' ') : ''\n})\n// A change of place in the list (or of list style) isn't an interaction: jump there\nwatch([segmentPosition, isNav], () => snap())\n\n// A control inside the row (a button or switch in #trailing, a checkbox in #leading) has its own interaction\n// surface, as in M3: hovering or pressing it leaves the row alone. The row's own built-in leading checkbox is\n// part of the row (data-mli-part), so it still presses it.\nconst NESTED_CONTROL = 'button, a, input, select, textarea, label, [role=\"button\"], [role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"link\"], [tabindex]'\nfunction onNestedControl(e: Event) {\n const row = e.currentTarget as Element\n const control = (e.target as Element | null)?.closest?.(NESTED_CONTROL)\n return !!control && control !== row && row.contains(control) && !control.closest('[data-mli-part]')\n}\n\nfunction onPointerMove(e: PointerEvent) { if (e.pointerType !== 'touch') hovered.value = !onNestedControl(e) }\nfunction onPointerLeave() { hovered.value = false; pressed.value = false }\nfunction onPointerDown(e: PointerEvent) { if (e.button === 0 && !onNestedControl(e)) pressed.value = true }\nfunction onPointerUp() { pressed.value = false }\n\n// The state layer (ListTokens: hover 8%, pressed 12% of the content color), drawn by JS so that pressing a nested\n// control doesn't light up the row through CSS :active, which every ancestor of the pressed element matches\nconst stateLayerOpacity = computed(() => {\n if (!isClickable.value || props.disabled) return 0\n return pressed.value ? 0.12 : hovered.value ? 0.08 : 0\n})\nconst indentStyle = computed(() =>\n props.indent === undefined ? undefined : { paddingLeft: typeof props.indent === 'number' ? `${props.indent}px` : props.indent },\n)\nfunction onFocus(e: FocusEvent) { focused.value = (e.currentTarget as Element).matches(':focus-visible') }\nfunction onBlur() { focused.value = false }\n\nconst tag = computed(() => {\n if (props.href) return 'a'\n if (props.to) return 'router-link'\n if (isButton.value) return 'div'\n return 'li'\n})\n\nconst linkProps = computed(() => {\n if (props.href) return { href: props.href }\n if (props.to) return { to: props.to }\n return {}\n})\n\n// An expandable item's header is a button (the row stays the list item): reachable and operable from the\n// keyboard, telling assistive technology whether its children are shown\nconst childrenId = useId()\nfunction onHeaderKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Enter' && e.key !== ' ') return\n if (e.target !== e.currentTarget) return\n e.preventDefault()\n handleClick(e as unknown as MouseEvent)\n}\n\nfunction toggleExpand(e: MouseEvent) {\n if (props.disabled) return\n internalExpanded.value = !internalExpanded.value\n emit('update:expanded', internalExpanded.value)\n emit('click', e)\n}\n\nfunction handleClick(e: MouseEvent) {\n if (props.disabled) return\n if (props.expandable) {\n // A switch or button in the header's #trailing works on its own\n if (onNestedControl(e)) return\n toggleExpand(e)\n return\n }\n if (list?.selectable.value && props.value != null) {\n list.select(props.value)\n }\n emit('click', e)\n}\n\nfunction handleTrailingToggle() {\n emit('update:trailingValue', !props.trailingValue)\n}\n</script>\n\n<template>\n <li v-if=\"expandable\" ref=\"rootEl\" v-bind=\"$attrs\" role=\"listitem\">\n <div\n ref=\"shapeEl\"\n role=\"button\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-expanded=\"isExpanded\"\n :aria-controls=\"childrenId\"\n :aria-disabled=\"disabled || undefined\"\n class=\"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"containerClasses\"\n @click=\"handleClick\"\n @keydown=\"onHeaderKeyDown\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @pointerenter=\"onPointerMove\"\n @pointermove=\"onPointerMove\"\n @pointerleave=\"onPointerLeave\"\n @pointerdown=\"onPointerDown\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n >\n <span\n class=\"mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]\"\n :class=\"isActive ? 'bg-on-secondary-container' : 'bg-on-surface'\"\n :style=\"{ opacity: stateLayerOpacity }\"\n aria-hidden=\"true\"\n />\n\n <!-- Leading -->\n <slot name=\"leading\">\n <MIcon v-if=\"resolvedLeading === 'icon'\" :name=\"icon!\" :size=\"24\" class=\"shrink-0\" :class=\"activeIconClass\" />\n </slot>\n\n <!-- Content -->\n <div class=\"min-w-0 flex-1\">\n <slot name=\"overline\">\n <p v-if=\"overline\" class=\"truncate text-label-small\" :class=\"activeIconClass\">{{ overline }}</p>\n </slot>\n <slot>\n <p class=\"truncate text-body-large\" :class=\"activeTextClass\">{{ title }}</p>\n <p v-if=\"subtitle && resolvedLines >= 2\" class=\"text-body-medium\" :class=\"[activeIconClass, resolvedLines === 2 && 'truncate']\">\n {{ subtitle }}\n </p>\n </slot>\n </div>\n\n <slot name=\"trailing\" />\n\n <!-- Expand icon -->\n <MIcon\n :name=\"isExpanded ? 'expand_less' : 'expand_more'\"\n :size=\"20\"\n class=\"shrink-0\"\n :class=\"activeIconClass\"\n />\n </div>\n\n <!-- Children with collapse animation -->\n <Transition name=\"mli-expand\">\n <div v-if=\"isExpanded\" :id=\"childrenId\" class=\"mli-expand-grid\">\n <div class=\"mli-expand-body\" :style=\"indentStyle\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </li>\n\n <RowWrapper v-else>\n <component\n :is=\"tag\"\n :class=\"containerClasses\"\n ref=\"rootEl\"\n v-bind=\"{ ...linkProps, ...$attrs }\"\n :role=\"rowRole\"\n :tabindex=\"rowTabindex\"\n :aria-selected=\"isOption ? isActive : undefined\"\n :aria-disabled=\"(isOption || isButton) && disabled ? 'true' : undefined\"\n @click=\"handleClick\"\n @keydown=\"onRowKeyDown\"\n @pointerenter=\"onPointerMove\"\n @pointermove=\"onPointerMove\"\n @pointerleave=\"onPointerLeave\"\n @pointerdown=\"onPointerDown\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n >\n <span\n class=\"mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]\"\n :class=\"isActive ? 'bg-on-secondary-container' : 'bg-on-surface'\"\n :style=\"{ opacity: stateLayerOpacity }\"\n aria-hidden=\"true\"\n />\n\n <!-- Divider -->\n <div\n v-if=\"hasDivider\"\n class=\"absolute top-0 right-0 h-px bg-outline-variant\"\n :class=\"hasDivider === 'inset' ? 'left-16' : 'left-0'\"\n />\n\n <!-- Leading -->\n <slot name=\"leading\">\n <template v-if=\"resolvedLeading === 'icon'\">\n <MIcon :name=\"icon!\" :size=\"24\" class=\"shrink-0\" :class=\"activeIconClass\" />\n </template>\n <template v-else-if=\"resolvedLeading === 'icon-container'\">\n <div\n class=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-full\"\n :class=\"iconContainerClasses[iconContainerColor || 'primary']\"\n >\n <MIcon :name=\"icon!\" :size=\"24\" />\n </div>\n </template>\n <template v-else-if=\"resolvedLeading === 'avatar'\">\n <MAvatar :name=\"avatarName!\" :size=\"40\" class=\"shrink-0\" />\n </template>\n <template v-else-if=\"resolvedLeading === 'image'\">\n <img :src=\"image\" alt=\"\" class=\"h-14 w-14 shrink-0 rounded-md object-cover\">\n </template>\n <template v-else-if=\"resolvedLeading === 'checkbox'\">\n <MCheckbox :model-value=\"isActive\" class=\"shrink-0\" data-mli-part />\n </template>\n </slot>\n\n <!-- Content -->\n <div class=\"min-w-0 flex-1\">\n <slot name=\"overline\">\n <p v-if=\"overline\" class=\"truncate text-label-small\" :class=\"activeIconClass\">{{ overline }}</p>\n </slot>\n <slot>\n <p class=\"truncate text-body-large\" :class=\"activeTextClass\">{{ title }}</p>\n <p v-if=\"subtitle && resolvedLines >= 2\" class=\"text-body-medium\" :class=\"[activeIconClass, resolvedLines === 2 && 'truncate']\">\n {{ subtitle }}\n </p>\n <p v-if=\"description && resolvedLines >= 3\" class=\"line-clamp-2 text-body-small\" :class=\"activeIconClass\">\n {{ description }}\n </p>\n </slot>\n </div>\n\n <!-- Trailing -->\n <slot name=\"trailing\">\n <template v-if=\"resolvedTrailing === 'icon'\">\n <MIcon :name=\"trailingIcon!\" :size=\"24\" class=\"shrink-0\" :class=\"activeIconClass\" />\n </template>\n <template v-else-if=\"resolvedTrailing === 'text'\">\n <span class=\"shrink-0 text-label-small\" :class=\"activeIconClass\">{{ trailingText }}</span>\n </template>\n <template v-else-if=\"resolvedTrailing === 'switch'\">\n <MSwitch :model-value=\"!!trailingValue\" @update:model-value=\"handleTrailingToggle\" />\n </template>\n <template v-else-if=\"resolvedTrailing === 'checkbox'\">\n <MCheckbox :model-value=\"!!trailingValue\" @update:model-value=\"handleTrailingToggle\" />\n </template>\n </slot>\n </component>\n </RowWrapper>\n</template>\n\n<style>\n.mli-state-layer {\n transition: opacity 150ms;\n}\n.mli-expand-grid {\n display: grid;\n grid-template-rows: 1fr;\n}\n.mli-expand-body {\n min-height: 0;\n overflow: hidden;\n padding-left: 2rem;\n}\n\n.mli-expand-enter-active {\n transition: grid-template-rows 300ms cubic-bezier(0.2, 0, 0, 1);\n}\n.mli-expand-enter-active > .mli-expand-body {\n transition: opacity 200ms 80ms cubic-bezier(0.2, 0, 0, 1);\n}\n.mli-expand-enter-from {\n grid-template-rows: 0fr;\n}\n.mli-expand-enter-from > .mli-expand-body {\n opacity: 0;\n}\n\n.mli-expand-leave-active {\n transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 1, 1);\n}\n.mli-expand-leave-active > .mli-expand-body {\n transition: opacity 120ms cubic-bezier(0.4, 0, 1, 1);\n}\n.mli-expand-leave-to {\n grid-template-rows: 0fr;\n}\n.mli-expand-leave-to > .mli-expand-body {\n opacity: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;EAOA,IAAMoF,IAAQC,GASRC,IAAWC,QAAe;GAC9B,IAAIH,EAAM,MAAM;I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EAAAgB,EAAA,YAAY,GAAA,CAAA,KAE7DuJ,EAAA,UAAgB,YACnCjL,EAAA,GAAAQ,EAAqFS,IAAA;;MAA3E,eAAW,CAAA,CAAIS,EAAA;MAAgB,uBAAoB+L;K,gCAE1CxC,EAAA,UAAgB,cACnCjL,EAAA,GAAAQ,EAAuFQ,IAAA;;MAA3E,eAAW,CAAA,CAAIU,EAAA;MAAgB,uBAAoB+L"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MMenuItem-CRNZkVVr.js","names":["_hoisted_1","_openBlock","_createElementBlock","$attrs","_hoisted_2","_hoisted_3","_hoisted_4","MMenuDivider","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_mergeProps","_renderSlot","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_normalizeClass","_normalizeStyle","_unref","MIcon","_resolveDynamicComponent","_renderList","$slots","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createVNode","MIcon","_renderSlot","_createElementVNode","_toDisplayString","_unref","_Teleport","_Transition","_normalizeStyle","FAST_SPATIAL","sampleSpring","FAST_EFFECTS","playSamples","useSpring","prefersReducedMotion","motionSprings","MIcon_default","useEscapeStack","_hoisted_1$2","MMenuDivider_default","defineComponent","openBlock","createElementBlock","SHARED_AXIS_OFFSET","SLIDE_SETTLE_MS","SWIPE_SLOP","SWIPE_DISTANCE","SWIPE_VELOCITY","useMenuNav","navStack","ref","currentNav","computed","navDirection","navBox","leaveFromX","leaveFromOpacity","navSlideEnter","dir","anim","el","done","navSlideLeave","htmlEl","from","opacity","resizeAround","prevOverflow","restore","change","to","h","slide","r","pushNav","entry","nextTick","focusFirst","popNav","resetNav","swipe","levelEl","onNavPointerDown","level","onMove","onUp","onCancel","writeDrag","dx","dy","stopListening","a","dt","s","swallowClick","swallowTimer","stopSwallowing","settleBack","width","x","onUnmounted","fitPopup","candidates","margin","size","viewport","last","dropdownX","start","anchor","end","windowSide","align","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5","trajectoryStep","MMenu_default","__expose","props","__props","slots","useSlots","flattenVNodes","out","vnode","vnodes","Fragment","isGapDivider","gap","groups","raw","result","g","isGrouped","focusFirstItem","cachedTrajectory","openTrajectory","samples","scale","scaleVel","alpha","alphaVel","t","currentIdx","cancelActive","finishLeave","playTrajectory","opening","step","frames","i","style","ended","complete","panelEnter","placeX","panelLeave","open","triggerEl","dropdownEl","dropStyle","panelRegistry","inject","provide","watch","oldEl","siblingGroup","anchorRect","openAbove","computePos","rect","spaceBelow","originX","pivot","fromEdge","focusableItems","moveFocus","items","idx","toggle","close","onOutsideClick","panel","onScroll","onKeydown","onMounted","origin","createElementVNode","mergeProps","_ctx","renderSlot","createBlock","Teleport","createVNode","Transition","withCtx","normalizeClass","normalizeStyle","unref","_cache","args","resolveDynamicComponent","renderList","group","createCommentVNode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","ICON_SPACE","MMenuItem_default","__emit","emit","checkable","selectable","on","slidingIcon","onIcon","position","measurePosition","itemEl","choice","n","prev","next","radii","top","bottom","tl","tr","br","bl","controlEl","iconSlotEl","snap","siblingsObserver","parent","tag","hasChildren","menuClose","nav","showSub","subStyle","positionSub","placeSub","sub","w","left","toggleSub","handleClick","onPointerEnter","onPointerLeave","onSubPointerLeave","related","\"width\"","\"opacity\"","toDisplayString"],"sources":["../src/components/MMenuDivider.vue","../src/composables/_useMenuNav.ts","../src/composables/_popupPosition.ts","../src/components/MMenu.vue","../src/components/MMenuItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A line between groups of items in an MMenu or MContextMenu; with `gap` in an expressive menu it splits the\n * menu into separate rounded groups.\n */\nwithDefaults(\n defineProps<{\n /**\n * Marks this as a group boundary for `MMenu`/`MContextMenu`'s\n * `variant=\"expressive\"` — instead of rendering this divider in place,\n * the parent menu splits its panel into two independently-rounded group\n * boxes with a small gap between them. Has no effect outside an\n * `expressive` menu, where it renders as a normal divider line.\n */\n gap?: boolean\n }>(),\n { gap: false },\n)\n</script>\n\n<template>\n <hr class=\"my-1 border-outline-variant\" />\n</template>\n","import { computed, nextTick, onUnmounted, ref } from 'vue'\nimport { motionSprings } from './motion'\nimport { playSamples, prefersReducedMotion, sampleSpring } from './_springAnimation'\n\n/*\n * Internal (not exported from index.ts): the `submenuMode=\"push\"` navigation shared by MMenu and MContextMenu.\n * A stack of levels (one per opened MMenuItem with #children) shown one at a time in the panel's scroll\n * wrapper (`navBox`), with:\n * - M3's shared axis X between levels: a 30dp slide with a crossfade, the old level fading out quickly and the\n * new one fading in after it. Driven by the Web Animations API through a `:css=\"false\"` Transition: with\n * direction-dependent classes on a mode-less Transition, Vue's class swap unreliably never completed.\n * - the panel's height following the new level on a spring (Standard DefaultSpatial), measured before and\n * after the swap, with no scrollbar while the levels cross.\n * - swipe right to go back on touch: the level follows the finger and, released past a third of the panel\n * (or flung), leaves from where it is; otherwise it springs back.\n */\n\nexport type MenuNavEntry = { icon?: string, header?: () => any, content?: () => any }\n\nconst SHARED_AXIS_OFFSET = 30\n// Back to scrolling once the slide (60ms delay + 300ms) has settled\nconst SLIDE_SETTLE_MS = 380\n// A touch decides between a vertical scroll and a swipe once it has moved this far\nconst SWIPE_SLOP = 8\nconst SWIPE_DISTANCE = 1 / 3\nconst SWIPE_VELOCITY = 0.5 // px/ms\n\nexport function useMenuNav(focusFirst: () => void) {\n const navStack = ref<MenuNavEntry[]>([])\n const currentNav = computed(() => navStack.value[navStack.value.length - 1])\n const navDirection = ref<'forward' | 'backward'>('forward')\n const navBox = ref<HTMLElement>()\n\n // Where a swiped level was released, so its leave starts there instead of jumping back to 0\n let leaveFromX = 0\n let leaveFromOpacity = 1\n\n function navSlideEnter(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? 1 : -1\n const anim = (el as HTMLElement).animate(\n [\n { transform: `translateX(${dir * SHARED_AXIS_OFFSET}px)`, opacity: 0 },\n { transform: 'translateX(0)', opacity: 1 },\n ],\n { duration: 300, delay: 60, easing: 'cubic-bezier(0.05,0.7,0.1,1)', fill: 'backwards' },\n )\n anim.onfinish = done\n }\n\n function navSlideLeave(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? -1 : 1\n const htmlEl = el as HTMLElement\n htmlEl.style.position = 'absolute'\n htmlEl.style.insetInline = '0'\n htmlEl.style.top = '0'\n const from = leaveFromX\n const opacity = leaveFromOpacity\n leaveFromX = 0\n leaveFromOpacity = 1\n const anim = htmlEl.animate(\n [\n { transform: `translateX(${from}px)`, opacity },\n { transform: `translateX(${from + dir * SHARED_AXIS_OFFSET}px)`, opacity: 0 },\n ],\n { duration: 90, easing: 'cubic-bezier(0.3,0,0.8,0.15)', fill: 'forwards' },\n )\n anim.onfinish = done\n }\n\n function resizeAround(change: () => void) {\n const el = navBox.value\n const from = el?.offsetHeight ?? 0\n // Both levels overflow for a moment: no scrollbar until they settle, then the wrapper's own inline value\n const prevOverflow = el?.style.overflowY ?? ''\n if (el) el.style.overflowY = 'hidden'\n const restore = () => { if (el) el.style.overflowY = prevOverflow }\n change()\n if (!el || prefersReducedMotion()) return restore()\n nextTick(() => {\n const to = el.offsetHeight\n const anim = Math.abs(to - from) < 1 ? null\n : playSamples(el, sampleSpring(from, to, 0, motionSprings.standard.defaultSpatial, 0.5), (h) => ({ height: `${h}px` }))\n const slide = new Promise((r) => setTimeout(r, SLIDE_SETTLE_MS))\n Promise.all([slide, anim?.finished.catch(() => {})]).then(restore)\n })\n }\n\n function pushNav(entry: MenuNavEntry) {\n navDirection.value = 'forward'\n resizeAround(() => navStack.value.push(entry))\n nextTick(focusFirst)\n }\n\n function popNav() {\n navDirection.value = 'backward'\n resizeAround(() => navStack.value.pop())\n nextTick(focusFirst)\n }\n\n function resetNav() {\n navStack.value = []\n }\n\n // Swipe back. The wrapper has `touch-action: pan-y` while a level is pushed, so a sideways drag reaches us\n // as pointer events while vertical ones still scroll the list\n let swipe: { id: number, x: number, y: number, level: HTMLElement, width: number, active: boolean, lastX: number, lastT: number, vel: number } | null = null\n\n function levelEl() {\n // The level on screen (a level still leaving has another depth)\n return navBox.value?.querySelector<HTMLElement>(`:scope > [data-menu-level=\"${navStack.value.length}\"]`) ?? null\n }\n\n function onNavPointerDown(e: PointerEvent) {\n if (e.pointerType !== 'touch' || !navStack.value.length || swipe) return\n const level = levelEl()\n if (!level) return\n swipe = { id: e.pointerId, x: e.clientX, y: e.clientY, level, width: navBox.value!.clientWidth, active: false, lastX: e.clientX, lastT: e.timeStamp, vel: 0 }\n window.addEventListener('pointermove', onMove)\n window.addEventListener('pointerup', onUp)\n window.addEventListener('pointercancel', onCancel)\n }\n\n function writeDrag(dx: number) {\n if (!swipe) return\n swipe.level.style.transform = `translateX(${dx}px)`\n swipe.level.style.opacity = String(1 - 0.5 * Math.min(1, dx / swipe.width))\n }\n\n function onMove(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const dx = e.clientX - swipe.x\n const dy = e.clientY - swipe.y\n if (!swipe.active) {\n if (Math.hypot(dx, dy) < SWIPE_SLOP) return\n // Vertical (a scroll) or leftwards: not ours\n if (Math.abs(dy) > Math.abs(dx) || dx < 0) return stopListening()\n swipe.active = true\n swipe.x = e.clientX\n swipe.level.getAnimations().forEach((a) => a.finish())\n }\n const dt = e.timeStamp - swipe.lastT\n if (dt > 0) swipe.vel = 0.8 * ((e.clientX - swipe.lastX) / dt) + 0.2 * swipe.vel\n swipe.lastX = e.clientX\n swipe.lastT = e.timeStamp\n writeDrag(Math.max(0, e.clientX - swipe.x))\n }\n\n function onUp(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const s = swipe\n stopListening()\n if (!s.active) return\n // The finger lifted on an item: that's not a tap on it. The click comes in a later task, so the guard\n // waits for it a little while\n window.addEventListener('click', swallowClick, { capture: true, once: true })\n clearTimeout(swallowTimer)\n swallowTimer = setTimeout(stopSwallowing, 400)\n const dx = Math.max(0, e.clientX - s.x)\n if (dx > s.width * SWIPE_DISTANCE || s.vel > SWIPE_VELOCITY) {\n leaveFromX = dx\n leaveFromOpacity = Number(s.level.style.opacity || 1)\n popNav()\n }\n else settleBack(s.level, dx)\n }\n\n function onCancel(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const s = swipe\n stopListening()\n if (s.active) settleBack(s.level, Math.max(0, s.lastX - s.x))\n }\n\n function settleBack(level: HTMLElement, dx: number) {\n level.style.transform = ''\n level.style.opacity = ''\n if (prefersReducedMotion() || dx < 1) return\n const width = navBox.value?.clientWidth || 1\n playSamples(level, sampleSpring(dx, 0, 0, motionSprings.standard.defaultSpatial, 0.5), (x) => ({\n transform: `translateX(${x}px)`,\n opacity: String(1 - 0.5 * Math.min(1, x / width)),\n }))\n }\n\n let swallowTimer: ReturnType<typeof setTimeout> | undefined\n function stopSwallowing() {\n clearTimeout(swallowTimer)\n window.removeEventListener('click', swallowClick, { capture: true })\n }\n\n function swallowClick(e: Event) {\n e.stopPropagation()\n e.preventDefault()\n }\n\n function stopListening() {\n swipe = null\n window.removeEventListener('pointermove', onMove)\n window.removeEventListener('pointerup', onUp)\n window.removeEventListener('pointercancel', onCancel)\n }\n\n onUnmounted(() => {\n stopListening()\n stopSwallowing()\n })\n\n return { navStack, currentNav, navBox, navSlideEnter, navSlideLeave, pushNav, popNav, resetNav, onNavPointerDown }\n}\n","/*\n * Internal (not exported from index.ts): keeps a popup on screen along one axis, after Compose's\n * DropdownMenuPositionProvider (material3/internal/MenuPosition.kt). The candidates are tried in order and the\n * first that fits inside the window, MARGIN in from its edges (MenuHorizontalMargin), wins; when none does, a\n * popup wider than the window minus the margins is centered, anything else is clamped inside them.\n *\n * Measure the popup with nothing constraining its width (no `right`, no narrow `left`) before calling this:\n * a fixed element anchored on its right shrinks to the space on its left, which is the very overflow to avoid.\n */\n\n/** Compose's MenuHorizontalMargin (8dp). */\nexport const POPUP_MARGIN = 8\n\n/** The first candidate start position that keeps `size` inside `viewport`, else centered or clamped. */\nexport function fitPopup(candidates: number[], size: number, viewport: number, margin = POPUP_MARGIN): number {\n for (const x of candidates) {\n if (x >= margin && x + size <= viewport - margin) return x\n }\n if (size >= viewport - 2 * margin) return (viewport - size) / 2\n const last = candidates[candidates.length - 1] ?? margin\n return Math.min(viewport - margin - size, Math.max(margin, last))\n}\n\n/**\n * A dropdown's left edge: aligned with the anchor's start or end edge (`align` picks which is tried first), else\n * against the window edge on the anchor's side (MenuAnchorPosition.Below's xCandidates).\n */\nexport function dropdownX(\n anchor: { left: number; right: number },\n width: number,\n viewport: number,\n align: 'start' | 'end',\n margin = POPUP_MARGIN,\n): number {\n const start = anchor.left\n const end = anchor.right - width\n const windowSide = (anchor.left + anchor.right) / 2 < viewport / 2 ? margin : viewport - margin - width\n return fitPopup(align === 'start' ? [start, end, windowSide] : [end, start, windowSide], width, viewport, margin)\n}\n","<script setup lang=\"ts\">\n/**\n * A trigger-based dropdown menu, composed with `MMenuItem` and `MMenuDivider`. Items support unlimited-depth\n * nested submenus via the `#children` slot.\n *\n * @slot trigger The element that opens the menu when clicked; `open` tells whether it's open.\n * @slot default The menu's items (MMenuItem, MMenuDivider or your own markup); `close()` closes the menu.\n */\nimport { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenuDivider from './MMenuDivider.vue'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\nimport { useMenuNav } from '../composables/_useMenuNav'\nimport { POPUP_MARGIN, dropdownX } from '../composables/_popupPosition'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(\n defineProps<{\n /** Which edge of the trigger the dropdown aligns to. */\n align?: 'left' | 'right'\n /**\n * How items with a `#children` slot behave.\n * `'flyout'` opens a hover-positioned side panel (desktop).\n * `'push'` replaces the panel's own content with the submenu and a\n * back header — no positioning math, works with touch. Useful for mobile.\n */\n submenuMode?: 'flyout' | 'push'\n /**\n * 'standard' is M3's baseline menu (4dp corners). 'expressive' is M3's rounder 'vertical menu' styling\n * (16dp corners) — combine with `<MMenuDivider gap />` to split the panel into independently-rounded groups\n * with a visible gap, instead of a plain divider line.\n */\n // `'standard'` is M3's baseline menu — square-ish 4dp corners\n // (`MenuTokens.ContainerShape`/`CornerExtraSmall`).\n // `'expressive'` is M3's rounder \"vertical menu\" styling — 16dp corners\n // (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with\n // `<MMenuDivider gap />` to split the panel into independently-rounded\n // groups with a visible gap between them, instead of a plain line.\n variant?: 'standard' | 'expressive'\n }>(),\n { align: 'right', submenuMode: 'flyout', variant: 'standard' },\n)\n\nconst slots = useSlots()\n\nfunction flattenVNodes(vnodes: VNode[]): VNode[] {\n const out: VNode[] = []\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n out.push(...flattenVNodes(vnode.children as VNode[]))\n } else {\n out.push(vnode)\n }\n }\n return out\n}\n\nfunction isGapDivider(vnode: VNode): boolean {\n if (vnode.type !== MMenuDivider) return false\n const gap = (vnode.props as { gap?: unknown } | null)?.gap\n return gap === '' || gap === true || gap === 'true'\n}\n\n// Splits the default slot's content into groups at each `<MMenuDivider gap />`\n// — only used by the 'expressive' variant to render independently-rounded\n// group boxes. A plain `<MMenuDivider />` (no `gap`) stays a normal in-line\n// divider inside a single group, same as 'standard'.\nconst groups = computed(() => {\n if (props.variant !== 'expressive') return null\n const raw = flattenVNodes((slots.default?.({ close }) ?? []) as VNode[])\n const result: VNode[][] = [[]]\n for (const vnode of raw) {\n if (isGapDivider(vnode)) result.push([])\n else result[result.length - 1]!.push(vnode)\n }\n return result.filter(g => g.length > 0)\n})\nconst isGrouped = computed(() => !!groups.value && groups.value.length > 1)\n\nconst { navStack, currentNav, navBox, navSlideEnter, navSlideLeave, pushNav, popNav, onNavPointerDown } = useMenuNav(() => focusFirstItem())\n\n// The real DropdownMenuContent in Menu.kt animates scale (0.8 -> 1) and alpha\n// (0 -> 1) with actual springs (MotionSchemeKeyTokens.FastSpatial/FastEffects\n// on the Standard scheme, StandardMotionTokens: scale dampingRatio 0.9/\n// stiffness 1400, alpha dampingRatio 1.0/stiffness 3800) — not a duration+\n// easing tween, which is why a cubic-bezier stand-in read as an abrupt cut on\n// close (a bezier can't carry a spring's momentum). But running the *close*\n// as its own independent spring toward the opposite target isn't right\n// either: alpha (stiffness 3800) settles much faster than scale (stiffness\n// 1400), so on close the panel fades to invisible well before it finishes\n// shrinking — you never actually see the shrink. On open this isn't a\n// problem (it becomes visible early, *then* you watch it keep growing), but\n// close needs to be the literal time-reverse of open, not a forward\n// simulation toward reversed targets, so the shrink stays visible the whole\n// time and only the fade races ahead right at the very end (mirroring how\n// the fade led at the very start of open). Simulated once (open direction\n// only) and played back forwards for enter, backwards for leave.\n//\n// A damped spring approaches its target exponentially, so it keeps \"settling\"\n// long after the motion is visually done — with a tight (0.001) tolerance on\n// both position *and* velocity, roughly the last third of the recorded\n// trajectory is values within a fraction of a percent of the target, visually\n// indistinguishable from it. Reversed for close, that flat tail lands at the\n// *start* instead, so nothing visibly happens for the first ~80ms before the\n// close animation actually appears to begin. Trimmed on position alone with a\n// much looser tolerance instead, since that's what's actually visible.\nlet cachedTrajectory: { scale: number, alpha: number }[] | null = null\nconst trajectoryStep = 1 / 240\nfunction openTrajectory() {\n if (cachedTrajectory) return cachedTrajectory\n const samples: { scale: number, alpha: number }[] = []\n let scale = 0.8\n let scaleVel = 0\n let alpha = 0\n let alphaVel = 0\n const scaleDamping = 0.9\n const scaleStiffness = 1400\n const alphaDamping = 1.0\n const alphaStiffness = 3800\n for (let t = 0; t < 1; t += trajectoryStep) {\n samples.push({ scale, alpha })\n scaleVel += (-scaleStiffness * (scale - 1) - 2 * scaleDamping * Math.sqrt(scaleStiffness) * scaleVel) * trajectoryStep\n scale += scaleVel * trajectoryStep\n alphaVel += (-alphaStiffness * (alpha - 1) - 2 * alphaDamping * Math.sqrt(alphaStiffness) * alphaVel) * trajectoryStep\n alpha += alphaVel * trajectoryStep\n const visuallySettled = Math.abs(scale - 1) < 0.003 && Math.abs(alpha - 1) < 0.003\n if (visuallySettled) break\n }\n samples.push({ scale: 1, alpha: 1 })\n cachedTrajectory = samples\n return samples\n}\n\n// Vue interrupts and reverses this mid-flight when the menu is toggled\n// quickly (close while still opening, or vice versa) — it calls the other\n// hook on the same still-mounted element without waiting for `done()`. Both\n// `currentIdx` (how far along the trajectory we are, so a reversal continues\n// smoothly from wherever it currently is instead of snapping back to a fixed\n// start) and `cancelActive` (so the previous animation actually stops instead\n// of running alongside the new one, fighting over the same style) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n// Set only while a close is playing: stops the animation *and* calls its `done()`.\n// Used on unmount — a menu item that navigates away (e.g. \"Log out\" ->\n// router.push) unmounts this component mid-close, and Vue only removes the\n// Teleported panel from <body> inside the leave's `done()`, so merely\n// cancelling the animation there left the half-closed panel stranded on screen.\nlet finishLeave: (() => void) | null = null\n\nfunction playTrajectory(el: Element, done: () => void, opening: boolean) {\n cancelActive?.()\n const htmlEl = el as HTMLElement\n const samples = openTrajectory()\n const last = samples.length - 1\n const from = Math.round(Math.max(0, Math.min(last, currentIdx)))\n const to = opening ? last : 0\n const step = opening ? 1 : -1\n const frames: { scale: number, alpha: number }[] = []\n for (let i = from; opening ? i <= to : i >= to; i += step) frames.push(samples[i]!)\n const style = (s: { scale: number, alpha: number }) => ({\n transform: `scale(${s.scale})`,\n opacity: String(Math.min(1, Math.max(0, s.alpha))),\n })\n // Played as a Web Animation (see _springAnimation.ts), which the compositor runs, so the open isn't janked by\n // the panel's content mounting at the same moment. The end state goes inline underneath it.\n Object.assign(htmlEl.style, style(samples[to]!))\n let ended = false\n function complete() {\n if (ended) return\n ended = true\n currentIdx = to\n cancelActive = null\n finishLeave = null\n done()\n }\n if (frames.length < 2 || typeof htmlEl.animate !== 'function') return complete()\n const anim = htmlEl.animate(frames.map(style), { duration: (frames.length - 1) * trajectoryStep * 1000, easing: 'linear' })\n anim.finished.catch(() => {})\n anim.onfinish = complete\n cancelActive = () => {\n // Remember where it got to, so the reversal continues from there\n const t = Number(anim.currentTime ?? 0) / (trajectoryStep * 1000)\n currentIdx = Math.max(0, Math.min(last, from + step * t))\n ended = true\n anim.cancel()\n }\n finishLeave = opening ? null : () => { cancelActive?.(); cancelActive = null; finishLeave = null; done() }\n}\nfunction panelEnter(el: Element, done: () => void) {\n placeX(el as HTMLElement)\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\n}\n\nconst open = ref(false)\nconst triggerEl = ref<HTMLElement | null>(null)\nconst dropdownEl = ref<HTMLElement | null>(null)\nconst dropStyle = ref<Record<string, string>>({})\n\n// A menu can be nested inside another MMenu/MContextMenu's slot (e.g. a\n// \"Language\" picker menu inside a \"More options\" overflow menu) — since both\n// Teleport straight to <body>, the outer one's panel DOM never contains the\n// inner one's, so the outer's outside-click check would otherwise see a click\n// inside the nested menu as \"outside\" and close (unmount) itself on\n// mousedown, before the inner button's own click can fire. Sharing one\n// registry of open panel elements across the whole logical (not DOM) menu\n// tree via provide/inject fixes that for arbitrary nesting depth.\nconst panelRegistry = inject<Set<HTMLElement>>('m-menu-panel-registry', new Set())\nprovide('m-menu-panel-registry', panelRegistry)\n\nwatch(dropdownEl, (el, oldEl) => {\n if (oldEl) panelRegistry.delete(oldEl)\n if (el) panelRegistry.add(el)\n})\n\nonUnmounted(() => {\n if (dropdownEl.value) panelRegistry.delete(dropdownEl.value)\n})\n\n// Separate from panelRegistry above: that one is shared all the way down the\n// nesting chain so a click inside a descendant menu never closes an ancestor.\n// This one is scoped to just this menu's *direct* children (e.g. \"Language\"\n// and \"Color palette\", both nested inside the same \"More options\" menu) —\n// without it, opening one no longer closes the other (since panelRegistry now\n// treats a click on either as \"inside\" the shared ancestor), so two sibling\n// pickers could stay open at once. Only one child of the same parent open at\n// a time, like an accordion; doesn't affect unrelated top-level menus.\nconst siblingGroup = inject<{ current: (() => void) | null } | null>('m-menu-sibling-group', null)\nprovide('m-menu-sibling-group', { current: null })\n\n// The vertical side and height from the trigger alone; the horizontal position needs the panel's width, so\n// placeX() sets it once the panel is in the DOM (in its enter hook, before it paints). Until then it sits at the\n// window's left edge, where nothing narrows it while it's measured.\nlet anchorRect: DOMRect | null = null\nconst openAbove = ref(false)\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n anchorRect = rect\n const spaceBelow = window.innerHeight - rect.bottom - 8\n openAbove.value = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove.value ? rect.top - 12 : spaceBelow, 400)}px`,\n maxWidth: `${window.innerWidth - 2 * POPUP_MARGIN}px`,\n left: '0px',\n }\n\n if (openAbove.value) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n dropStyle.value = style\n}\n\n// Keeps the panel on screen (Compose's DropdownMenuPositionProvider, see _popupPosition.ts): aligned with the\n// trigger's `align` edge if it fits there, else its other edge, else against the window edge on its side. The\n// animation grows from the trigger, wherever the panel ended up.\nconst originX = ref(props.align === 'right' ? 'right' : 'left')\nfunction placeX(el: HTMLElement) {\n if (!anchorRect) return\n const width = el.offsetWidth\n const x = dropdownX(anchorRect, width, window.innerWidth, props.align === 'right' ? 'end' : 'start')\n const pivot = Math.min(width, Math.max(0, (anchorRect.left + anchorRect.right) / 2 - x))\n const fromEdge = Math.abs(x - anchorRect.left) < 1 ? 'left' : Math.abs(x + width - anchorRect.right) < 1 ? 'right' : `${pivot}px`\n originX.value = fromEdge\n dropStyle.value = { ...dropStyle.value, left: `${x}px` }\n // Now, not on the next render: the enter animation starts this frame\n el.style.left = `${x}px`\n el.style.transformOrigin = `${fromEdge} ${openAbove.value ? 'bottom' : 'top'}`\n}\n\nfunction focusableItems() {\n if (!dropdownEl.value) return []\n return Array.from(\n dropdownEl.value.querySelectorAll<HTMLElement>('button:not(:disabled), a[href]'),\n )\n}\n\nfunction focusFirstItem() {\n nextTick(() => focusableItems()[0]?.focus())\n}\n\nfunction moveFocus(dir: 1 | -1) {\n const items = focusableItems()\n if (!items.length) return\n const idx = items.indexOf(document.activeElement as HTMLElement)\n const next = idx === -1\n ? (dir === 1 ? items[0] : items[items.length - 1])\n : items[(idx + dir + items.length) % items.length]\n next?.focus()\n}\n\nfunction toggle() {\n if (!open.value) {\n if (siblingGroup && siblingGroup.current && siblingGroup.current !== close) {\n siblingGroup.current()\n }\n if (siblingGroup) siblingGroup.current = close\n computePos()\n navStack.value = []\n } else if (siblingGroup?.current === close) {\n siblingGroup.current = null\n }\n open.value = !open.value\n if (open.value) focusFirstItem()\n}\n\nfunction close() {\n if (siblingGroup?.current === close) siblingGroup.current = null\n open.value = false\n}\n\nprovide('m-menu-close', close)\nprovide('m-menu-nav', { mode: props.submenuMode, push: pushNav })\ndefineExpose({ close, open })\n\nfunction onOutsideClick(e: MouseEvent) {\n const t = e.target as Node\n if (triggerEl.value?.contains(t)) return\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\n// Scrolling inside any panel of this menu tree (own, or a nested menu's\n// Teleported panel) isn't an \"outside\" scroll — same registry as onOutsideClick\nfunction onScroll(e: Event) {\n if (!open.value) return\n const t = e.target as Node\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\n// Escape goes through the library's stack, so a menu open in a dialog or an overlay closes alone (a pushed\n// submenu steps back first)\nuseEscapeStack(() => open.value, () => (navStack.value.length ? popNav() : close()))\n\nfunction onKeydown(e: KeyboardEvent) {\n if (!open.value) return\n if (e.key === 'ArrowDown') { e.preventDefault(); moveFocus(1) }\n else if (e.key === 'ArrowUp') { e.preventDefault(); moveFocus(-1) }\n}\n\nonMounted(() => {\n document.addEventListener('mousedown', onOutsideClick)\n document.addEventListener('keydown', onKeydown)\n window.addEventListener('scroll', onScroll, true)\n})\n\nonUnmounted(() => {\n document.removeEventListener('mousedown', onOutsideClick)\n document.removeEventListener('keydown', onKeydown)\n window.removeEventListener('scroll', onScroll, true)\n if (finishLeave) finishLeave()\n else cancelActive?.()\n})\n\nconst origin = computed(() => `${originX.value} ${openAbove.value ? 'bottom' : 'top'}`)\n</script>\n\n<template>\n <div ref=\"triggerEl\" v-bind=\"$attrs\" class=\"inline-block\" @click=\"toggle\">\n <slot name=\"trigger\" :open=\"open\" />\n </div>\n\n <Teleport to=\"body\">\n <Transition :css=\"false\" @enter=\"panelEnter\" @leave=\"panelLeave\">\n <div\n v-if=\"open\"\n ref=\"dropdownEl\"\n class=\"fixed z-500 min-w-48\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'shadow-elevation-2',\n ]\"\n :style=\"{ ...dropStyle, transformOrigin: origin }\"\n >\n <!-- overflow-hidden (for the rounded-corner clip and to clip the push\n submenu's slide) lives on this inner wrapper, never together with\n shadow-elevation-2 on the same box — overflow-hidden clips an\n element's own box-shadow too, so the two have to be on separate\n elements or the shadow gets cut off -->\n <div\n class=\"overflow-hidden\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'bg-surface-container',\n ]\"\n >\n <div\n ref=\"navBox\"\n class=\"relative overflow-x-hidden overflow-y-auto overscroll-contain py-1\"\n :style=\"{ maxHeight: dropStyle.maxHeight, touchAction: currentNav ? 'pan-y' : undefined }\"\n @pointerdown=\"onNavPointerDown\"\n >\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\" :data-menu-level=\"navStack.length\">\n <!-- Back: a header row in the menu's own item metrics, labelled like an M3 menu group, then a divider -->\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-label-large text-on-surface-variant outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n @click=\"popNav\"\n >\n <MIcon name=\"arrow_back\" :size=\"20\" class=\"shrink-0\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <hr class=\"my-1 border-outline-variant\" />\n <component :is=\"() => currentNav?.content?.()\" />\n </div>\n <div v-else key=\"root\">\n <div v-if=\"isGrouped\" class=\"flex flex-col gap-1 px-1.5\">\n <div v-for=\"(group, i) in groups\" :key=\"i\" class=\"rounded-lg shadow-elevation-2\">\n <div class=\"overflow-hidden rounded-lg bg-surface-container\">\n <component :is=\"() => group\" />\n </div>\n </div>\n </div>\n <slot v-else :close=\"close\" />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\n/**\n * An item of an MMenu or MContextMenu: icon, label and a shortcut hint. Put more items in its `#children` slot\n * to make it open a submenu. With `selected` it's one choice of several (Compose's SelectableDropdownMenuItem),\n * with `checked` an on/off setting (CheckableDropdownMenuItem): tertiary-container and rounder while on, with a\n * check that slides in.\n *\n * @slot default Item label text.\n * @slot icon Replaces the leading icon (an `MIcon` with a class, an image, an avatar…), `{ on }` while selected or\n * checked. It gets the icon's 20px box and color\n * @slot children Nested submenu items. In the parent MMenu's default 'flyout' mode, clicking or hovering (mouse\n * only) the item opens a side panel — supports unlimited nesting depth. In 'push' mode, clicking the item\n * instead swaps the whole menu panel to the submenu with a back header; hover does nothing.\n * @event click Emitted when a leaf item (no #children) is clicked. Not emitted for disabled items or for items\n * with #children, since clicking those just opens/toggles the submenu instead.\n * @event update:checked Emitted on click when `checked` is set, with the new value — powers v-model:checked\n */\nimport { computed, inject, nextTick, onMounted, onUnmounted, ref, useSlots, watch } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { FAST_EFFECTS, FAST_SPATIAL, useSpring } from '../composables/_useSpring'\nimport { POPUP_MARGIN, fitPopup } from '../composables/_popupPosition'\n\nconst props = withDefaults(defineProps<{\n /** Material Symbol icon name */\n icon?: string\n /** Keyboard shortcut hint displayed on the right (e.g. \"Ctrl+C\") — hidden when the item has #children */\n shortcut?: string\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Disables the item */\n disabled?: boolean\n /** Danger/destructive styling (error color) */\n danger?: boolean\n /** Keep the menu open after this item is clicked. Defaults to true for `checked` items, false otherwise */\n keepOpen?: boolean\n /** Makes it one choice of several (radio-like): selected look while true. Leave unset for a plain item */\n selected?: boolean\n /** Makes it an on/off setting (v-model:checked, checkbox-like): checked look while true. Leave unset for a plain item */\n checked?: boolean\n /**\n * Icon shown while selected or checked. Defaults to a check that slides in when the item has no `icon`;\n * with an `icon`, that icon stays and turns filled\n */\n selectedIcon?: string\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: undefined,\n selected: undefined,\n checked: undefined,\n})\n\nconst emit = defineEmits<{ click: [], 'update:checked': [boolean] }>()\n\nconst slots = useSlots()\nconst checkable = computed(() => props.checked !== undefined)\nconst selectable = computed(() => checkable.value || props.selected !== undefined)\nconst on = computed(() => !!(props.checked ?? props.selected))\n// Without an `icon`, the selected icon (a check by default) only shows while on and slides the label aside\nconst slidingIcon = computed(() => selectable.value && !props.icon && !slots.icon)\nconst onIcon = computed(() => props.selectedIcon ?? (props.icon ? undefined : 'check'))\n\n// Where this item sits in a run of consecutive selectable/checkable siblings, MenuDefaults.itemShape(index,\n// count): the first rounds its top corners, the last its bottom ones, a lone one stays square-ish\nconst position = ref<'single' | 'first' | 'middle' | 'last'>('single')\nfunction measurePosition() {\n const el = itemEl.value\n if (!el || !selectable.value) return\n const choice = (n: Element | null) => !!n?.hasAttribute('data-m3-menu-choice')\n const prev = choice(el.previousElementSibling)\n const next = choice(el.nextElementSibling)\n position.value = prev && next ? 'middle' : prev ? 'last' : next ? 'first' : 'single'\n}\n\n// Item shapes (SegmentedMenuTokens, MenuDefaults' leading/middle/trailing/standalone item shapes): ItemShape\n// 4dp, CornerMedium 12dp on the group's outer corners, ItemSelectedShape 12dp all round; corners morph on\n// FastSpatial. The sliding icon expands on FastSpatial and fades on FastEffects (AnimatedVisibility's\n// expandHorizontally + fadeIn).\nconst ICON_SPACE = 32 // 20dp icon + 12dp to the label\nfunction radii(): number[] {\n if (on.value) return [12, 12, 12, 12]\n const top = position.value === 'first' ? 12 : 4\n const bottom = position.value === 'last' ? 12 : 4\n return [top, top, bottom, bottom]\n}\nconst { snap } = useSpring(\n () => (selectable.value ? [...radii(), slidingIcon.value && on.value ? ICON_SPACE : 0] : []),\n ([tl, tr, br, bl, width]) => {\n const el = controlEl.value instanceof HTMLElement ? controlEl.value : controlEl.value?.$el\n if (el && bl !== undefined) el.style.borderRadius = `${tl}px ${tr}px ${br}px ${bl}px`\n if (iconSlotEl.value && width !== undefined) iconSlotEl.value.style.width = `${width}px`\n },\n FAST_SPATIAL,\n)\n// A position change comes from the layout (items added, removed, the menu opening): jump, don't morph\nwatch(position, () => snap())\n\nlet siblingsObserver: MutationObserver | null = null\nonMounted(() => {\n measurePosition()\n const parent = itemEl.value?.parentElement\n if (!parent) return\n siblingsObserver = new MutationObserver(measurePosition)\n siblingsObserver.observe(parent, { childList: true })\n})\nonUnmounted(() => siblingsObserver?.disconnect())\nwatch(selectable, () => nextTick(measurePosition))\nuseSpring(\n () => (slidingIcon.value ? [on.value ? 1 : 0] : []),\n ([opacity]) => { if (iconSlotEl.value && opacity !== undefined) iconSlotEl.value.style.opacity = String(opacity) },\n FAST_EFFECTS,\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\nconst hasChildren = computed(() => !!slots.children)\nconst menuClose = inject<(() => void) | null>('m-menu-close', null)\nconst nav = inject<{\n mode: 'flyout' | 'push'\n push: (entry: { icon?: string, header?: () => any, content?: () => any }) => void\n} | null>('m-menu-nav', null)\n\nconst itemEl = ref<HTMLElement>()\n// The button, or a RouterLink instance when `to` is set\nconst controlEl = ref<HTMLElement | { $el: HTMLElement }>()\nconst iconSlotEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\n// To the item's right, else its left, else clamped on screen (see _popupPosition.ts); placeSub() settles it once\n// the submenu is in the DOM and its size is known, before it paints\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.right}px`,\n maxWidth: `${window.innerWidth - 2 * POPUP_MARGIN}px`,\n zIndex: '501',\n }\n}\n\nfunction placeSub(el: Element) {\n if (!itemEl.value) return\n const sub = el as HTMLElement\n const rect = itemEl.value.getBoundingClientRect()\n // Measured at the window's left edge, where nothing narrows it\n sub.style.left = '0px'\n const w = sub.offsetWidth\n const h = sub.offsetHeight\n const left = fitPopup([rect.right, rect.left - w], w, window.innerWidth)\n const top = fitPopup([rect.top, rect.bottom - h], h, window.innerHeight)\n subStyle.value = { ...subStyle.value, left: `${left}px`, top: `${top}px` }\n sub.style.left = `${left}px`\n sub.style.top = `${top}px`\n}\n\nfunction toggleSub() {\n if (showSub.value) {\n showSub.value = false\n return\n }\n positionSub()\n showSub.value = true\n}\n\nfunction handleClick() {\n if (props.disabled) return\n\n if (hasChildren.value) {\n if (nav?.mode === 'push') {\n nav.push({ icon: props.icon, header: slots.default, content: slots.children })\n } else {\n toggleSub()\n }\n return\n }\n\n if (checkable.value) emit('update:checked', !props.checked)\n emit('click')\n if (!(props.keepOpen ?? checkable.value)) menuClose?.()\n}\n\n// Desktop hover convenience for the flyout variant — ignored on touch/pen so a\n// tap doesn't fire a spurious pointerleave (relatedTarget is null on touch)\n// and close the submenu before its click event can land.\nfunction onPointerEnter(e: PointerEvent) {\n if (e.pointerType !== 'mouse' || !hasChildren.value || props.disabled) return\n positionSub()\n showSub.value = true\n}\n\nfunction onPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu')) return\n showSub.value = false\n}\n\nfunction onSubPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu') || itemEl.value?.contains(related as Node)) return\n showSub.value = false\n}\n</script>\n\n<template>\n <div\n ref=\"itemEl\"\n :data-m3-menu-choice=\"selectable || undefined\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <!-- Selectable/checkable items sit 4dp in from the edges (DropdownMenuSelectableItemPadding) with 12dp\n inside, so their label lines up with plain items; the state layer is a pseudo-element so it can\n tint the selected container too -->\n <component\n :is=\"tag\"\n ref=\"controlEl\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :role=\"selectable ? (checkable ? 'menuitemcheckbox' : 'menuitemradio') : undefined\"\n :aria-checked=\"selectable ? on : undefined\"\n class=\"flex items-center gap-3 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"selectable\n ? [\n 'relative mx-1 w-[calc(100%-0.5rem)] px-3 duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity',\n on ? 'bg-tertiary-container text-on-tertiary-container' : 'text-on-surface',\n disabled ? 'cursor-not-allowed opacity-[0.38]' : 'cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]',\n ]\n : [\n 'w-full px-4',\n disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'cursor-pointer',\n !disabled && danger ? 'text-error hover:bg-error/8' : '',\n !disabled && !danger ? 'text-on-surface hover:bg-on-surface/8' : '',\n ]\"\n :disabled=\"disabled || undefined\"\n :aria-haspopup=\"hasChildren ? 'menu' : undefined\"\n :aria-expanded=\"hasChildren ? showSub : undefined\"\n @click=\"handleClick\"\n >\n <!-- -mr-3 cancels the flex gap, so the label sits flush while the slot is closed -->\n <span v-if=\"slidingIcon\" ref=\"iconSlotEl\" class=\"-mr-3 flex shrink-0 overflow-hidden\" style=\"width: 0; opacity: 0\">\n <MIcon :name=\"onIcon!\" :size=\"20\" class=\"shrink-0\" />\n </span>\n <span\n v-else-if=\"$slots.icon\"\n class=\"flex size-5 shrink-0 items-center justify-center\"\n :class=\"selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'\"\n >\n <slot name=\"icon\" :on=\"on\" />\n </span>\n <MIcon\n v-else-if=\"icon\"\n :name=\"on && onIcon ? onIcon : icon\"\n :filled=\"on && !onIcon\"\n :size=\"20\"\n class=\"shrink-0\"\n :class=\"selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'\"\n />\n <span class=\"flex-1\"><slot /></span>\n <span v-if=\"shortcut && !hasChildren\" class=\"ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60\">{{ shortcut }}</span>\n <MIcon v-if=\"hasChildren\" name=\"chevron_right\" :size=\"18\" class=\"shrink-0 text-on-surface-variant\" />\n </component>\n\n <!-- Submenu (flyout variant only — \"push\" mode is rendered by the root MMenu/MContextMenu panel) -->\n <Teleport v-if=\"hasChildren && nav?.mode !== 'push'\" to=\"body\">\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n @enter=\"placeSub\"\n >\n <div\n v-if=\"showSub\"\n class=\"m3-submenu min-w-44 rounded-xs shadow-elevation-2\"\n :style=\"subStyle\"\n @pointerleave=\"onSubPointerLeave\"\n >\n <!-- overflow-hidden lives here, separate from shadow-elevation-2 above —\n overflow-hidden clips an element's own box-shadow too -->\n <div class=\"overflow-hidden rounded-xs bg-surface-container py-1\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;E,kBAqBEC,EAAA,GAAAC,EAA0C,MAA1CF,CAA0C;;A,ICFtCuD,KAAqB,IAErBC,KAAkB,KAElBC,IAAa,GACbC,KAAiB,IAAI,GACrBC,IAA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