@m3ui-vue/m3ui-vue 1.1.2 → 1.1.4

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 (128) hide show
  1. package/README.md +1 -1
  2. package/dist/API.md +202 -10
  3. package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
  4. package/dist/MIcon-Bxh9j135.js.map +1 -0
  5. package/dist/{MMenuItem-DVxKEv1W.js → MMenuItem-BfjqwcYP.js} +85 -64
  6. package/dist/MMenuItem-BfjqwcYP.js.map +1 -0
  7. package/dist/MSlider-JflHJ70q.js +1525 -0
  8. package/dist/MSlider-JflHJ70q.js.map +1 -0
  9. package/dist/{MTextField-rML9jnXs.js → MTextField-NaIB6RbM.js} +68 -66
  10. package/dist/MTextField-NaIB6RbM.js.map +1 -0
  11. package/dist/api.json +1 -1
  12. package/dist/code-editor.js +2 -2
  13. package/dist/components/MAnimatedNumber.vue.d.ts +29 -0
  14. package/dist/components/MButton.vue.d.ts +2 -0
  15. package/dist/components/MContainerTransform.vue.d.ts +59 -0
  16. package/dist/components/MDialog.vue.d.ts +8 -5
  17. package/dist/components/MFlex.vue.d.ts +1 -1
  18. package/dist/components/MIcon.vue.d.ts +2 -0
  19. package/dist/components/MIconButton.vue.d.ts +2 -0
  20. package/dist/components/MListGroup.vue.d.ts +23 -0
  21. package/dist/components/MListItem.vue.d.ts +5 -5
  22. package/dist/components/MNavigationRail.vue.d.ts +1 -1
  23. package/dist/components/MScheduler.vue.d.ts +2 -2
  24. package/dist/components/MScheme.vue.d.ts +60 -0
  25. package/dist/components/MSparkline.vue.d.ts +41 -0
  26. package/dist/components/MSplitter.vue.d.ts +1 -1
  27. package/dist/components/MStack.vue.d.ts +1 -1
  28. package/dist/components/MToolbar.vue.d.ts +32 -5
  29. package/dist/components/MWindow.vue.d.ts +2 -2
  30. package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
  31. package/dist/components/_MToolbarFab.vue.d.ts +16 -0
  32. package/dist/composables/_containerTransform.d.ts +48 -0
  33. package/dist/composables/_useSegmentRuns.d.ts +8 -0
  34. package/dist/composables/dynamicColor.d.ts +11 -0
  35. package/dist/composables/useColorPalette.d.ts +3 -1
  36. package/dist/composables/useConfetti.d.ts +32 -0
  37. package/dist/composables/useContainerTransform.d.ts +30 -0
  38. package/dist/composables/useLocale.d.ts +9 -0
  39. package/dist/index.d.ts +10 -1
  40. package/dist/locales/index.js +35 -0
  41. package/dist/locales/index.js.map +1 -1
  42. package/dist/m3ui-vue.css +1 -1
  43. package/dist/m3ui.js +16844 -15530
  44. package/dist/m3ui.js.map +1 -1
  45. package/dist/map.js +55 -55
  46. package/dist/{material-color-utilities-Cktu8DBU.js → material-color-utilities-C_iikgRm.js} +928 -603
  47. package/dist/material-color-utilities-C_iikgRm.js.map +1 -0
  48. package/dist/rich-text-editor.js +11 -11
  49. package/dist/styles.css +1 -1
  50. package/dist/terminal.js +1 -1
  51. package/dist/{useLocale-CqQrhWFl.js → useLocale-CXibICQA.js} +6 -1
  52. package/dist/useLocale-CXibICQA.js.map +1 -0
  53. package/package.json +2 -1
  54. package/src/__tests__/MAnimatedNumber.test.ts +128 -0
  55. package/src/__tests__/MContainerTransform.test.ts +279 -0
  56. package/src/__tests__/MDialog.test.ts +27 -0
  57. package/src/__tests__/MIcon.test.ts +19 -0
  58. package/src/__tests__/MListItemExpandable.test.ts +48 -0
  59. package/src/__tests__/MListItemShape.test.ts +42 -5
  60. package/src/__tests__/MListKeyboard.test.ts +90 -0
  61. package/src/__tests__/MMapTools.test.ts +2 -1
  62. package/src/__tests__/MNavigationRail.test.ts +33 -0
  63. package/src/__tests__/MScheme.test.ts +107 -0
  64. package/src/__tests__/MSlider.test.ts +161 -0
  65. package/src/__tests__/MSparkline.test.ts +96 -0
  66. package/src/__tests__/MToolbar.test.ts +157 -0
  67. package/src/__tests__/attrsFallthrough.test.ts +6 -0
  68. package/src/__tests__/hydration.test.ts +25 -0
  69. package/src/__tests__/iconButtonNames.test.ts +124 -0
  70. package/src/__tests__/ssr.test.ts +1 -0
  71. package/src/__tests__/useConfetti.test.ts +81 -0
  72. package/src/components/MAnimatedNumber.vue +327 -0
  73. package/src/components/MAutocomplete.vue +34 -4
  74. package/src/components/MBottomSheet.vue +1 -0
  75. package/src/components/MButton.vue +4 -2
  76. package/src/components/MContainerTransform.vue +321 -0
  77. package/src/components/MDataTable.vue +1 -1
  78. package/src/components/MDialog.vue +31 -6
  79. package/src/components/MFab.vue +10 -5
  80. package/src/components/MIcon.vue +11 -4
  81. package/src/components/MIconButton.vue +3 -1
  82. package/src/components/MList.vue +33 -31
  83. package/src/components/MListGroup.vue +66 -0
  84. package/src/components/MListItem.vue +138 -84
  85. package/src/components/MMaskField.vue +3 -0
  86. package/src/components/MMultiAutocomplete.vue +5 -1
  87. package/src/components/MMultiSelect.vue +19 -9
  88. package/src/components/MNavigationRail.vue +40 -10
  89. package/src/components/MScheme.vue +162 -0
  90. package/src/components/MSearchBar.vue +2 -0
  91. package/src/components/MSelect.vue +44 -10
  92. package/src/components/MSideSheet.vue +3 -0
  93. package/src/components/MSimpleCarousel.vue +6 -0
  94. package/src/components/MSlider.vue +161 -42
  95. package/src/components/MSparkline.vue +250 -0
  96. package/src/components/MSplitButton.vue +3 -0
  97. package/src/components/MSpotlightSearch.vue +1 -0
  98. package/src/components/MTable.vue +1 -0
  99. package/src/components/MTagInput.vue +4 -0
  100. package/src/components/MTextField.vue +3 -0
  101. package/src/components/MToolbar.vue +256 -15
  102. package/src/components/MTour.vue +1 -0
  103. package/src/components/MTreeTable.vue +1 -0
  104. package/src/components/_MToolbarFab.vue +14 -0
  105. package/src/components/_MTreeNode.vue +3 -0
  106. package/src/composables/_containerTransform.ts +179 -0
  107. package/src/composables/_useEscapeStack.ts +2 -0
  108. package/src/composables/_useSegmentRuns.ts +39 -0
  109. package/src/composables/dynamicColor.ts +66 -0
  110. package/src/composables/useColorPalette.ts +2 -2
  111. package/src/composables/useConfetti.ts +204 -0
  112. package/src/composables/useContainerTransform.ts +59 -0
  113. package/src/composables/useLocale.ts +14 -0
  114. package/src/index.ts +10 -1
  115. package/src/locales/de.ts +5 -0
  116. package/src/locales/es.ts +5 -0
  117. package/src/locales/fr.ts +5 -0
  118. package/src/locales/ja.ts +5 -0
  119. package/src/locales/ko.ts +5 -0
  120. package/src/locales/pt.ts +5 -0
  121. package/src/locales/zh.ts +5 -0
  122. package/dist/MIcon-DLOkQduI.js.map +0 -1
  123. package/dist/MMenuItem-DVxKEv1W.js.map +0 -1
  124. package/dist/MSlider-BXsBv0ox.js +0 -1402
  125. package/dist/MSlider-BXsBv0ox.js.map +0 -1
  126. package/dist/MTextField-rML9jnXs.js.map +0 -1
  127. package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
  128. package/dist/useLocale-CqQrhWFl.js.map +0 -1
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  ---
22
22
 
23
- 135+ tree-shakeable components following [Material Design 3](https://m3.material.io/) guidelines. Ships with 40 color palettes, dark mode, i18n support, and full TypeScript coverage.
23
+ 170+ tree-shakeable components following [Material Design 3](https://m3.material.io/) guidelines. Ships with 40 color palettes, dark mode, i18n support, and full TypeScript coverage.
24
24
 
25
25
  ## Getting Started
26
26
 
package/dist/API.md CHANGED
@@ -1,4 +1,4 @@
1
- # @m3ui-vue/m3ui-vue 1.1.2 — API reference
1
+ # @m3ui-vue/m3ui-vue 1.1.4 — API reference
2
2
 
3
3
  Material Design 3 components for Vue 3 + Tailwind CSS v4. Generated from the source by
4
4
  `scripts/generate-api.mjs`; full docs with live demos at https://m3ui.dev.
@@ -78,6 +78,18 @@ Slots:
78
78
  - `#default` — Alert body content
79
79
  - `#actions` — Optional row of action buttons rendered below the body
80
80
 
81
+ ### MAnimatedNumber
82
+
83
+ A number, time or duration whose digits roll to their new value on a spring when it changes, like an odometer: each digit rolls on its own (up when the value grows, down when it shrinks) and digits that appear or go away open and close. Numbers are formatted with `Intl.NumberFormat` (currency, percent, units, compact), times with `Intl.DateTimeFormat`, both in the app's language; durations as `h:mm:ss`. Tabular figures. Assistive technology reads the formatted value, not the rolling digits. Not an M3 spec component.
84
+
85
+ Props:
86
+ - `value: number | Date` — The value: a number, a `Date` for times, or seconds for a duration
87
+ - `type?: "number" | "datetime" | "duration"` — `number` (Intl.NumberFormat), `datetime` (Intl.DateTimeFormat; a `Date` or a timestamp) or `duration` (seconds as `h:mm:ss`, hours only when there are some). Defaults to `datetime` for a `Date`, `number` otherwise
88
+ - `format?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions` — Intl options for the type: `{ style: 'currency', currency: 'EUR' }`, `{ style: 'percent' }`, `{ style: 'unit', unit: 'kilometer-per-hour' }`, `{ notation: 'compact' }` for numbers; `{ timeStyle: 'medium' }` (the default), `{ hour: '2-digit', minute: '2-digit' }`, `{ dateStyle: 'short' }` for times. Unused for durations. Dollar-sign currencies show their country (`AR$`, `MX$`, `US$`) in any language; set `currencyDisplay` for Intl's own output (`'symbol'` gives the local peso as a plain `$`)
89
+ - `locale?: string` — BCP-47 language for the format (`es-AR` for Argentine pesos and separators); defaults to the app's locale
90
+ - `spring?: SpringSpec` — The rolling spring; Standard SlowSpatial by default (an unhurried landing, no visible bounce)
91
+ - `animate?: boolean = true` — Roll to new values; false (or the system's reduced motion) jumps to them
92
+
81
93
  ### MAppBar
82
94
 
83
95
  A simple, generic slot-based app bar with leading, default, and trailing areas — a lighter-weight alternative to MTopAppBar for when you don't need its variant/title-row layouts.
@@ -361,6 +373,7 @@ Props:
361
373
  - `disabled?: boolean = false` — Disables interaction
362
374
  - `loading?: boolean = false` — Shows a spinner and disables the button
363
375
  - `icon?: string` — Material Symbol icon name shown next to the label
376
+ - `iconFilled?: boolean` — Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon
364
377
  - `iconPos?: "leading" | "trailing" = "leading"` — Which side of the label the icon renders on
365
378
  - `size?: "xs" | "sm" | "md" | "lg" | "xl" = "sm"` — M3's 5-tier expressive button sizing (xs: 32px, sm: 40px, md: 56px, lg: 96px, xl: 136px) — lg/xl are meant for hero-style prominent buttons, not everyday UI
366
379
  - `shape?: "rounded" | "squared" = "rounded"` — Button shape — rounded (pill, always) or squared (corner radius scales with size: 12px xs/sm, 16px md, 28px lg/xl)
@@ -715,6 +728,27 @@ Props:
715
728
  Slots:
716
729
  - `#default` — Content.
717
730
 
731
+ ### MContainerTransform
732
+
733
+ Material's container transform: an element (a card, a list item, an image, a FAB…) grows into an expanded view and shrinks back into it, morphing its bounds and shape while its content fades into the new one. The expanded view opens over the page, full screen, as a centered panel, or wherever your classes put it (`custom`), with a scrim (optional), Escape and scroll lock; focus goes to it and back to the element on close. A port of Android's MaterialContainerTransform, played on the compositor. For elements that live apart from the expanded view (a grid of cards, one detail), pass a `useContainerTransform()` controller instead of the default slot.
734
+
735
+ Props:
736
+ - `controller?: ContainerTransformController<T>` — A `useContainerTransform()` controller, to open it from elements elsewhere (`controller.open($event, item)`)
737
+ - `mode?: "fullscreen" | "dialog" | "custom" = "fullscreen"` — Where the expanded view opens: over the whole screen, as a centered panel (wider screens), or `custom`: the classes you give the component place and size it (`bottom-4 right-4 w-80 h-96`, `inset-y-0 right-0 w-96`…), anywhere over the page
738
+ - `maxWidth?: string = "560px"` — The centered panel's maximum width (`dialog` mode)
739
+ - `label?: string` — Accessible name of the expanded view
740
+ - `scrim?: boolean = true` — Dims the page behind it, which makes it modal (scroll lock, `aria-modal`). Without one the page stays usable: a click outside closes it instead (unless `persistent`)
741
+ - `persistent?: boolean = false` — A click on the scrim, or outside without one, doesn't close it
742
+ - `closeOnBack?: boolean = true` — Android's back (button or gesture) closes it, like an expanded view in an app, where the browser has the CloseWatcher API (Chrome, Edge); the history and the router are left alone. Default `true`
743
+ - `open?: boolean = false` (v-model:open) — Whether the expanded view is open; opening it from here grows it from the default slot's element
744
+
745
+ Events:
746
+ - `update:open(value: boolean)` — The expanded view opened or closed (v-model:open)
747
+
748
+ Slots:
749
+ - `#default { open: () => void; isOpen: boolean; }` — The element that opens it, with `{ open, isOpen }`: call `open()` from its click
750
+ - `#expanded { close: () => void; item: T | undefined; }` — The expanded view, with `{ close, item }` (`item` is what the controller's `open` was given)
751
+
718
752
  ### MContextMenu
719
753
 
720
754
  A right-click context menu composed with MMenuItem — same item/divider/submenu building blocks as MMenu, but positioned at the cursor instead of anchored to a trigger element.
@@ -928,7 +962,7 @@ Props:
928
962
  - `fullscreen?: boolean = false` — Full-screen variant — slides up from the bottom, covers the entire viewport
929
963
  - `closeLabel?: string` — Aria label for the close (X) button — falls back to the locale string when omitted
930
964
  - `closable?: boolean = true` — Show the header close (X) button — a library addition, not part of the M3 AlertDialog spec, so it can be turned off
931
- - `bare?: boolean = false` — Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves (the date and time pickers). `title` then only names it for assistive technology
965
+ - `bare?: boolean = false` — Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title` then only names it for assistive technology
932
966
 
933
967
  Events:
934
968
  - `update:modelValue(boolean)` — Emitted when the dialog should open/close — powers v-model
@@ -1274,12 +1308,13 @@ export interface HotkeyBinding {
1274
1308
 
1275
1309
  ### MIcon
1276
1310
 
1277
- Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a Tailwind text-* class).
1311
+ Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a Tailwind text-* class). Decorative by default: hidden from assistive technology, which would otherwise read the glyph's ligature text (its name, e.g. "arrow_drop_down"). Give it a `label` when the icon says something on its own.
1278
1312
 
1279
1313
  Props:
1280
1314
  - `name: string` — Material Symbol name (e.g. "settings", "favorite")
1281
1315
  - `size?: number = 24` — Icon size in px
1282
1316
  - `filled?: boolean = false` — Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon
1317
+ - `label?: string` — What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration
1283
1318
 
1284
1319
  ### MIconButton
1285
1320
 
@@ -1296,6 +1331,7 @@ Props:
1296
1331
  - `rippleColor?: string` — Any CSS color for the press ripple; defaults to the button's content color
1297
1332
  - `checked?: boolean` (v-model:checked) — Makes it a toggle button (v-model:checked): selected colors, a filled icon, and a shape that morphs when pressed and when checked. Leave it unset for a plain icon button
1298
1333
  - `checkedIcon?: string` — Icon shown while checked, when it differs from `icon` (e.g. 'pause' for 'play_arrow')
1334
+ - `iconFilled?: boolean` — Draw the icon filled (Material Symbols' FILL axis) without making it a toggle, e.g. media controls
1299
1335
 
1300
1336
  Events:
1301
1337
  - `update:checked(boolean)` — Emitted on click when `checked` is set — powers v-model:checked
@@ -1448,7 +1484,7 @@ export interface LightboxItem {
1448
1484
 
1449
1485
  ### MList
1450
1486
 
1451
- A vertical list container (MList) with rich, flexible rows (MListItem) and optional section headers (MListSubheader) — one-line to three-line items, leading/trailing elements, selection, navigation, segmented, and expandable variants.
1487
+ A vertical list container (MList) with rich, flexible rows (MListItem) and optional section headers (MListSubheader) — one-line to three-line items, leading/trailing elements, selection, navigation, segmented, and expandable variants. MListGroup splits a list into groups (separate rounded runs in a segmented list).
1452
1488
 
1453
1489
  Props:
1454
1490
  - `dense?: boolean = false` — Compact vertical padding on child items
@@ -1463,7 +1499,7 @@ Events:
1463
1499
  - `update:selected(value: string | number | null)` — Fires when a selectable item is clicked (via v-model:selected)
1464
1500
 
1465
1501
  Slots:
1466
- - `#default` — MListItem / MListSubheader children
1502
+ - `#default` — MListItem / MListSubheader / MListGroup children
1467
1503
 
1468
1504
  ### MListDetail
1469
1505
 
@@ -1480,6 +1516,18 @@ Slots:
1480
1516
  - `#list { twoPane: boolean; }` — The list pane. Scrolls on its own and keeps its scroll position while the detail is open
1481
1517
  - `#detail { twoPane: boolean; back: () => void; }` — `back()` returns to the list (sets `showDetail` to false).
1482
1518
 
1519
+ ### MListGroup
1520
+
1521
+ A group of items inside an MList, optionally titled. In a segmented list each group is a rounded run of its own (its first and last items take the large outer corners), set apart from the items and groups around it, like the grouped cards of a settings screen. Elsewhere it only groups and titles its items. Assistive technology announces it as a nested list named by its title.
1522
+
1523
+ Props:
1524
+ - `title?: string` — Heading above the group, styled like MListSubheader
1525
+ - `inset?: boolean = false` — Align the title with items that have a leading icon (adds left padding)
1526
+
1527
+ Slots:
1528
+ - `#title` — Custom title content, replacing the title prop
1529
+ - `#default` — MListItem children
1530
+
1483
1531
  ### MListItem
1484
1532
 
1485
1533
  A row of an MList: headline with optional overline, supporting text, a leading icon, avatar or image, and trailing text, icon, checkbox or switch. It can be a link, be clickable or expand to show nested items.
@@ -2069,7 +2117,7 @@ Props:
2069
2117
  - `modelValue: string | number` (v-model) — Active item value, v-model
2070
2118
  - `items: NavRailItem[]` — Array of rail items (see `NavRailItem`)
2071
2119
  - `alignment?: "top" | "bottom" | "center" = "top"` — Vertical alignment of items within the rail
2072
- - `expanded?: boolean = false` (v-model:expanded) — Widens the rail (220px) and shows each item's icon beside its label in a full-width pill, instead of the icon over the label. Toggle it from your own menu button.
2120
+ - `expanded?: boolean = false` (v-model:expanded) — Widens the rail (to fit the longest label, 220 to 360px) and shows each item's icon beside its label in a full-width pill, instead of the icon over the label. Toggle it from your own menu button.
2073
2121
  - `modal?: boolean = false` — Keeps the rail collapsed and opens the expanded rail as a panel over the app, with a scrim, instead of widening in place. It closes on a scrim click, Escape or picking an item, emitting `update:expanded`.
2074
2122
  - `hideOnCollapse?: boolean = false` — With `modal`: no collapsed rail on screen; the expanded rail slides in from off-screen and can be swiped away (Compose's `hideOnCollapse`). Open it from your own menu button
2075
2123
 
@@ -2464,6 +2512,24 @@ export interface SchedulerEvent {
2464
2512
  }
2465
2513
  ```
2466
2514
 
2515
+ ### MScheme
2516
+
2517
+ Paints its content with a color scheme of its own, built from a seed color or from an image's dominant color (Material You's content color: an album, a dish or a profile photo coloring its own page), or one of the palettes (a theme picker's previews). Every `bg-*`/`text-*` M3 utility and every component inside it uses the scheme, in light or dark like the rest of the app, while the rest of the app keeps its palette. Its text color is the scheme's `on-surface`; it sets no background.
2518
+
2519
+ Props:
2520
+ - `seed?: string` — Seed color (`#rrggbb`) the scheme is built from
2521
+ - `image?: string` — An image (URL) whose dominant color becomes the seed, picked as Android picks a wallpaper's. Cross-origin images need CORS headers. `seed` wins while both are set
2522
+ - `palette?: string` — One of the palettes (`useColorPalette().palettes`, custom ones included), applied to this element only with its own CSS, in its standard contrast. `seed` and `image` win while set
2523
+ - `variant?: SchemeVariant = "tonal-spot"` — How the seed spreads into the scheme; `content` and `fidelity` keep the seed's own color most visible
2524
+ - `contrast?: number = 0` — Contrast level: 0 standard, 0.5 medium, 1 high (-1 reduced)
2525
+ - `as?: string = "div"` — Element to render
2526
+
2527
+ Events:
2528
+ - `seed(color: string)` — Emitted with the seed color read from `image`
2529
+
2530
+ Slots:
2531
+ - `#default { seed: string | undefined; ready: boolean; }` — The content. Receives `{ seed, ready }`: the seed in use (the image's once it's read) and whether the scheme is applied yet
2532
+
2467
2533
  ### MScrollable
2468
2534
 
2469
2535
  A constrained scroll area — vertical, horizontal, or both directions. Shows the browser's scrollbar, or with `scrollbar="indicator"` M3's thin visual-only scrollbar (Compose's `Modifier.nonInteractiveScrollbar`), which appears while scrolling and fades out after.
@@ -2839,6 +2905,27 @@ Props:
2839
2905
 
2840
2906
  Pushes flex siblings apart — renders a simple `flex: 1` div. Use it inside MFlex/MStack (or any flex container) to push a group of items to the far edge.
2841
2907
 
2908
+ ### MSparkline
2909
+
2910
+ A small trend chart, drawn as SVG with no chart library: a line, an area or bars, for next to a number (a stat card, a table cell, a list item). It fills its box (size it with classes; 96×28px by default), drawn at its real size so dots and bars don't stretch. When the data changes the shape springs to the new values. Screen readers get a summary (first, last, low, high) instead of the drawing. Not an M3 spec component.
2911
+
2912
+ Props:
2913
+ - `data: number[]` — The values, oldest first
2914
+ - `type?: "line" | "bar" | "area" = "line"` — Line, line with a soft fill under it, or bars
2915
+ - `color?: string = "primary"` — An M3 color role (`primary`, `tertiary`, `error`...) or any CSS color
2916
+ - `smooth?: boolean = true` — Smooth curve through the points (monotone: it never overshoots them) instead of straight segments
2917
+ - `showLast?: boolean = true` — A dot on the last point (line and area)
2918
+ - `strokeWidth?: number = 2` — Line width in px
2919
+ - `min?: number` — Fix the bottom of the scale (otherwise the lowest value, or 0 for bars)
2920
+ - `max?: number` — Fix the top of the scale (otherwise the highest value)
2921
+ - `baseline?: number` — A dashed reference line at this value (a target, yesterday's close)
2922
+ - `interactive?: boolean = false` — Follow the pointer with a dot and emit `hover` with the index under it
2923
+ - `label?: string` — Accessible name; defaults to a summary of the data in the app's language
2924
+ - `animate?: boolean = true` — Spring to new data; false (or reduced motion) jumps
2925
+
2926
+ Events:
2927
+ - `hover(index: number | null)` — With `interactive`: the index of the point under the pointer, or null when it leaves
2928
+
2842
2929
  ### MSpinner
2843
2930
 
2844
2931
  A small circular loading spinner — a standard ring, or the M3 Expressive wavy variant. For a larger, shape-morphing loading affordance, see MLoadingIndicator.
@@ -3336,7 +3423,7 @@ Slots:
3336
3423
 
3337
3424
  ### MToolbar
3338
3425
 
3339
- A container for grouping icon buttons and actions — docked to an edge or floating as a rounded pill, horizontal or vertical, with an optional paired FAB.
3426
+ A container for grouping icon buttons and actions — docked to an edge or floating as a rounded pill, horizontal or vertical, with an optional paired FAB. A floating toolbar collapses (`v-model:expanded`): with a FAB, into the FAB, which grows to 80px; without one, to its center (the default slot), closing `#leading` and `#trailing`. `collapseOnScroll` does it as the content scrolls.
3340
3427
 
3341
3428
  Props:
3342
3429
  - `variant?: "docked" | "floating" = "docked"` — Docked (edge-attached, full width/height, bordered) or floating (rounded pill with shadow)
@@ -3344,10 +3431,17 @@ Props:
3344
3431
  - `color?: "surface" | "primary" | "secondary" | "tertiary" = "surface"` — Background color scheme
3345
3432
  - `fabPosition?: "start" | "none" | "end" = "none"` — Where the #fab slot renders relative to the toolbar body
3346
3433
  - `align?: "center" | "start" | "between" | "end" = "center"` — Item alignment along the main axis
3434
+ - `collapseOnScroll?: string | boolean | HTMLElement | null = false` — Collapse a floating toolbar as the content scrolls down and expand it as it scrolls back up (40px each way): `true` follows the window, or pass the scrolling element (or a CSS selector for it). Off by default
3435
+ - `expanded?: boolean = true` (v-model:expanded) — A floating toolbar's state: collapsed, it shows only the FAB, or only its center without one. Default `true`
3436
+
3437
+ Events:
3438
+ - `update:expanded(value: boolean)` — The toolbar collapsed or expanded on scroll (`collapseOnScroll`)
3347
3439
 
3348
3440
  Slots:
3349
- - `#fab` — A FAB rendered alongside the toolbar body, positioned by fabPosition
3350
- - `#default` — Toolbar items — typically MIconButton/MButton, separated with MDivider
3441
+ - `#fab` — A FAB rendered alongside the toolbar body, positioned by fabPosition. The toolbar sizes an MFab in it
3442
+ - `#leading` — Items before the center, hidden when a floating toolbar without a FAB collapses
3443
+ - `#default` — Toolbar items — typically MIconButton/MButton, separated with MDivider. With #leading or #trailing, the center, which stays when a floating toolbar without a FAB collapses
3444
+ - `#trailing` — Items after the center, hidden when a floating toolbar without a FAB collapses
3351
3445
 
3352
3446
  ### MTooltip
3353
3447
 
@@ -3768,6 +3862,32 @@ Every palette: the built-in ones, plus `createM3UI({ customPalettes })`.
3768
3862
  palettes: Palette[]
3769
3863
  ```
3770
3864
 
3865
+ ### useConfetti
3866
+
3867
+ Confetti for a component: `fire(event)` from the pointer, `fire(el)` from an element, `fire({ from: 'top' })`.
3868
+
3869
+ ```ts
3870
+ useConfetti(): {
3871
+ fire: (origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) => void
3872
+ }
3873
+ ```
3874
+
3875
+ ### fireConfetti
3876
+
3877
+ Fires a burst of confetti. Browser only; does nothing under reduced motion.
3878
+
3879
+ ```ts
3880
+ fireConfetti(origin?: ConfettiOrigin, options: ConfettiOptions = {}): void
3881
+ ```
3882
+
3883
+ ### useContainerTransform
3884
+
3885
+ Material's container transform for elements that live apart from their expanded view: one controller, many elements opening it (a grid of cards), and one `<MContainerTransform :controller>` wherever the expanded view belongs. `open(event, item)` from a click grows that element into the expanded view, with `item` for it to show. ```ts const detail = useContainerTransform<Recipe>() // <MCard v-for="r in recipes"
3886
+
3887
+ ```ts
3888
+ useContainerTransform(): ContainerTransformController<T>
3889
+ ```
3890
+
3771
3891
  ### SEED_PALETTE
3772
3892
 
3773
3893
  The palette id used while a seed color is active (`useColorPalette().setSeed()`).
@@ -3808,6 +3928,22 @@ The `--color-*` roles a generated scheme sets. `success*` is a library extension
3808
3928
  schemeRoles: readonly ["primary", "on-primary", "primary-container", "on-primary-container", "secondary", "on-secondary", "secondary-container", "on-secondary-container", "tertiary", "on-tertiary", "tertiary-container", "on-tertiary-container", "error", "on-error", "error-container", "on-error-container", "background", "on-background", "surface", "on-surface", "surface-variant", "on-surface-variant", "surface-dim", "surface-bright", "surface-container-lowest", "surface-container-low", "surface-container", "surface-container-high", "surface-container-highest", "outline", "outline-variant", "inverse-surface", "inverse-on-surface", "inverse-primary", "scrim", "shadow", "primary-fixed", "primary-fixed-dim", "on-primary-fixed", "on-primary-fixed-variant", "secondary-fixed", "secondary-fixed-dim", "on-secondary-fixed", "on-secondary-fixed-variant", "tertiary-fixed", "tertiary-fixed-dim", "on-tertiary-fixed", "on-tertiary-fixed-variant"]
3809
3929
  ```
3810
3930
 
3931
+ ### seedFromImage
3932
+
3933
+ The seed color of an image, for `generateScheme`, `useColorPalette().setSeed()` or `MScheme`: what Android does with the wallpaper. Takes a URL (cross-origin images need CORS headers, or the canvas can't be read), an `<img>`, an `ImageBitmap` or a `Blob` (a file the user picked). Browser only.
3934
+
3935
+ ```ts
3936
+ seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string>
3937
+ ```
3938
+
3939
+ ### seedFromPixels
3940
+
3941
+ The seed color of an image's pixels (RGBA bytes, as `ImageData.data`): its colors quantized and scored the way Android picks a wallpaper's source color (QuantizerCelebi + Score). Fully transparent pixels are skipped.
3942
+
3943
+ ```ts
3944
+ seedFromPixels(rgba: ArrayLike<number>): Promise<string>
3945
+ ```
3946
+
3811
3947
  ### useToast
3812
3948
 
3813
3949
  ```ts
@@ -4248,6 +4384,53 @@ export interface M3InitialState {
4248
4384
  export type Theme = 'light' | 'dark' | 'system'
4249
4385
  ```
4250
4386
 
4387
+ ```ts
4388
+ export interface ConfettiOptions {
4389
+ /** How many pieces (default 80; 160 for `from: 'top'`) */
4390
+ count?: number
4391
+ /** Shapes to pick from (MShape's names) */
4392
+ shapes?: ShapeName[]
4393
+ /** Any CSS colors. Default: the theme's primary, secondary and tertiary roles and their containers, read at the origin */
4394
+ colors?: string[]
4395
+ /** Burst from a point (default) or rain from the top of the screen */
4396
+ from?: 'point' | 'top'
4397
+ /** Burst angle in degrees, 0 = up (default 0) */
4398
+ angle?: number
4399
+ /** Cone the pieces leave in, in degrees (default 70) */
4400
+ spread?: number
4401
+ /** Launch speed in px/s (default 950) */
4402
+ velocity?: number
4403
+ /** Piece size in px (default 14) */
4404
+ size?: number
4405
+ }
4406
+ ```
4407
+
4408
+ ```ts
4409
+ /** Where a burst starts: the pointer of an event, an element's center, or a point in viewport pixels */
4410
+ export type ConfettiOrigin = MouseEvent | PointerEvent | Element | { x: number; y: number }
4411
+ ```
4412
+
4413
+ ```ts
4414
+ /** The state MContainerTransform plays, shared between the elements that open it and the panel they open */
4415
+ export interface ContainerTransformController<T = unknown> {
4416
+ /** Whether the expanded view is open (or opening) */
4417
+ isOpen: Ref<boolean>
4418
+ /** What `open` was given, for the expanded view to show */
4419
+ item: Ref<T | undefined>
4420
+ /** The element it grows from and shrinks back into */
4421
+ source: ShallowRef<HTMLElement | null>
4422
+ /** Opens from `origin` (a click's element, an element or a component), with an optional `item` */
4423
+ open: (origin?: ContainerTransformOrigin, item?: T) => void
4424
+ /** Shrinks the expanded view back into the element it opened from */
4425
+ close: () => void
4426
+ }
4427
+ ```
4428
+
4429
+ ```ts
4430
+ /** What a container transform opens from: a click (its element), an element, or a component */
4431
+ export type ContainerTransformOrigin = Event | Element | ComponentPublicInstance | null | undefined
4432
+ ```
4433
+
4251
4434
  ```ts
4252
4435
  export interface Palette {
4253
4436
  id: string
@@ -4388,6 +4571,10 @@ export interface M3Locale {
4388
4571
  selectedCount: string
4389
4572
  recordCount: string
4390
4573
  expand: string
4574
+ /** Collapses an expanded item (the opposite of `expand`) */
4575
+ collapse: string
4576
+ /** Clears a field's value (the × at its end) */
4577
+ clear: string
4391
4578
  columns: string
4392
4579
  exportCsv: string
4393
4580
  noGroup: string
@@ -4560,6 +4747,11 @@ export interface M3Locale {
4560
4747
  nextPage: string
4561
4748
  carousel: string
4562
4749
  carouselItem: string
4750
+ /** MSparkline's summary for screen readers: {first}, {last}, {min}, {max} */
4751
+ sparklineSummary: string
4752
+ /** MSlider range: its two thumbs */
4753
+ sliderRangeStart: string
4754
+ sliderRangeEnd: string
4563
4755
  // MMap (maplibre controls)
4564
4756
  mapTitle: string
4565
4757
  mapMarker: string
@@ -4693,7 +4885,7 @@ export interface EmojiCategory {
4693
4885
  `M3Locale` keys (pass a partial object to `createM3UI({ locale })`; presets from `@m3ui-vue/m3ui-vue/locales`:
4694
4886
  `esLocale`, `frLocale`, `ptLocale`, `deLocale`, `jaLocale`, `zhLocale`, `koLocale`):
4695
4887
 
4696
- lang, search, noResults, close, cancel, confirm, loading, menu, previous, next, today, more, selectedCount, recordCount, expand, columns, exportCsv, noGroup, finish, dropText, selectText, maxSizePrefix, remove, selectDate, ok, dateToggleInput, dateToggleCalendar, dateInputLabel, selectTime, timeHourSelection, timeMinuteSelection, timePeriodToggle, timeToggleKeyboard, timeToggleDial, timeToggleScroll, sheetExpand, sheetCollapse, sheetDismiss, seekBar, seekBarValue, seekBarShowRemaining, seekBarShowDuration, selectRange, pickStart, pickEnd, previousMonth, nextMonth, selectColor, colorHue, colorSaturation, colorBrightness, colorAlpha, colorEyedropper, colorOriginal, colorFormat, colorRecent, colorPresets, dayView, weekView, allDay, emojiSearch, emojiNoResults, emojiRecent, emojiSkinTone, emojiSkinTones, emojiCategorySmileys, emojiCategoryGestures, emojiCategoryPeople, emojiCategoryAnimals, emojiCategoryNature, emojiCategoryFood, emojiCategoryActivities, emojiCategoryTravel, emojiCategoryObjects, emojiCategorySymbols, emojiCategoryFlags, available, selected, noItems, moveAllRight, moveRight, moveLeft, moveAllLeft, searchCommand, navigateHint, selectHint, openHint, closeHint, loadingMore, noMoreItems, bold, italic, underline, strikethrough, highlight, bulletList, orderedList, blockquote, code, alignLeft, alignCenter, alignRight, undo, redo, link, image, paragraph, heading1, heading2, heading3, insertLink, insertImage, imageUrlLabel, insert, jsonValid, jsonInvalid, jsonFormat, jsonMinify, jsonElements, jsonFields, resultSuccessTitle, resultSuccessDesc, resultErrorTitle, resultErrorDesc, resultWarningTitle, resultWarningDesc, resultInfoTitle, resultInfoDesc, result404Title, result404Desc, result403Title, result403Desc, result500Title, result500Desc, chatTyping, chatRecordingAudio, reorderHandle, reorderGrabbed, reorderMoved, reorderDropped, reorderCancelled, selectAll, clearSearch, kanbanMoved, windowMinimize, windowMaximize, windowRestore, paginationRange, paginationPage, previousPage, nextPage, carousel, carouselItem, mapTitle, mapMarker, mapZoomIn, mapZoomOut, mapResetBearing, mapFindMyLocation, mapLocationNotAvailable, mapEnterFullscreen, mapExitFullscreen, mapToggleAttribution, mapFeedback, mapCtrlScroll, mapCmdScroll, mapTwoFingers, mapLayers, mapSearchLayers, mapNoLayers, mapShowLayer, mapHideLayer, mapOpacity, mapDownload, mapNoBaseLayer, mapHoverInfo, mapNoValue, mapMeasureDistance, mapMeasureArea, mapClearMeasurements, mapDeleteMeasurement, mapTotal, mapSearchPlaces
4888
+ lang, search, noResults, close, cancel, confirm, loading, menu, previous, next, today, more, selectedCount, recordCount, expand, collapse, clear, columns, exportCsv, noGroup, finish, dropText, selectText, maxSizePrefix, remove, selectDate, ok, dateToggleInput, dateToggleCalendar, dateInputLabel, selectTime, timeHourSelection, timeMinuteSelection, timePeriodToggle, timeToggleKeyboard, timeToggleDial, timeToggleScroll, sheetExpand, sheetCollapse, sheetDismiss, seekBar, seekBarValue, seekBarShowRemaining, seekBarShowDuration, selectRange, pickStart, pickEnd, previousMonth, nextMonth, selectColor, colorHue, colorSaturation, colorBrightness, colorAlpha, colorEyedropper, colorOriginal, colorFormat, colorRecent, colorPresets, dayView, weekView, allDay, emojiSearch, emojiNoResults, emojiRecent, emojiSkinTone, emojiSkinTones, emojiCategorySmileys, emojiCategoryGestures, emojiCategoryPeople, emojiCategoryAnimals, emojiCategoryNature, emojiCategoryFood, emojiCategoryActivities, emojiCategoryTravel, emojiCategoryObjects, emojiCategorySymbols, emojiCategoryFlags, available, selected, noItems, moveAllRight, moveRight, moveLeft, moveAllLeft, searchCommand, navigateHint, selectHint, openHint, closeHint, loadingMore, noMoreItems, bold, italic, underline, strikethrough, highlight, bulletList, orderedList, blockquote, code, alignLeft, alignCenter, alignRight, undo, redo, link, image, paragraph, heading1, heading2, heading3, insertLink, insertImage, imageUrlLabel, insert, jsonValid, jsonInvalid, jsonFormat, jsonMinify, jsonElements, jsonFields, resultSuccessTitle, resultSuccessDesc, resultErrorTitle, resultErrorDesc, resultWarningTitle, resultWarningDesc, resultInfoTitle, resultInfoDesc, result404Title, result404Desc, result403Title, result403Desc, result500Title, result500Desc, chatTyping, chatRecordingAudio, reorderHandle, reorderGrabbed, reorderMoved, reorderDropped, reorderCancelled, selectAll, clearSearch, kanbanMoved, windowMinimize, windowMaximize, windowRestore, paginationRange, paginationPage, previousPage, nextPage, carousel, carouselItem, sparklineSummary, sliderRangeStart, sliderRangeEnd, mapTitle, mapMarker, mapZoomIn, mapZoomOut, mapResetBearing, mapFindMyLocation, mapLocationNotAvailable, mapEnterFullscreen, mapExitFullscreen, mapToggleAttribution, mapFeedback, mapCtrlScroll, mapCmdScroll, mapTwoFingers, mapLayers, mapSearchLayers, mapNoLayers, mapShowLayer, mapHideLayer, mapOpacity, mapDownload, mapNoBaseLayer, mapHoverInfo, mapNoValue, mapMeasureDistance, mapMeasureArea, mapClearMeasurements, mapDeleteMeasurement, mapTotal, mapSearchPlaces
4697
4889
 
4698
4890
  ## Theme tokens
4699
4891
 
@@ -1,7 +1,10 @@
1
1
  import { createElementBlock as e, defineComponent as t, normalizeStyle as n, openBlock as r, toDisplayString as i } from "vue";
2
- //#endregion
3
- //#region src/components/MIcon.vue
4
- var a = /* @__PURE__ */ t({
2
+ //#region src/components/MIcon.vue?vue&type=script&setup=true&lang.ts
3
+ var a = [
4
+ "role",
5
+ "aria-label",
6
+ "aria-hidden"
7
+ ], o = /* @__PURE__ */ t({
5
8
  __name: "MIcon",
6
9
  props: {
7
10
  name: {},
@@ -9,19 +12,23 @@ var a = /* @__PURE__ */ t({
9
12
  filled: {
10
13
  type: Boolean,
11
14
  default: !1
12
- }
15
+ },
16
+ label: {}
13
17
  },
14
18
  setup(t) {
15
- return (a, o) => (r(), e("span", {
19
+ return (o, s) => (r(), e("span", {
16
20
  class: "material-symbols-outlined leading-none",
21
+ role: t.label ? "img" : void 0,
22
+ "aria-label": t.label,
23
+ "aria-hidden": t.label ? void 0 : "true",
17
24
  style: n({
18
25
  fontSize: `${t.size}px`,
19
26
  fontVariationSettings: t.filled ? "'FILL' 1" : void 0
20
27
  })
21
- }, i(t.name), 5));
28
+ }, i(t.name), 13, a));
22
29
  }
23
30
  });
24
31
  //#endregion
25
- export { a as t };
32
+ export { o as t };
26
33
 
27
- //# sourceMappingURL=MIcon-DLOkQduI.js.map
34
+ //# sourceMappingURL=MIcon-Bxh9j135.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MIcon-Bxh9j135.js","names":[],"sources":["../src/components/MIcon.vue","../src/components/MIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class). Decorative by default: hidden from assistive technology, which would otherwise read the\n * glyph's ligature text (its name, e.g. \"arrow_drop_down\"). Give it a `label` when the icon says something on its own.\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */\n filled?: boolean\n /** What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration */\n label?: string\n}>(), { size: 24, filled: false })\n</script>\n\n<template>\n <span\n class=\"material-symbols-outlined leading-none\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n :style=\"{ fontSize: `${size}px`, fontVariationSettings: filled ? `'FILL' 1` : undefined }\"\n >{{ name }}</span>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class). Decorative by default: hidden from assistive technology, which would otherwise read the\n * glyph's ligature text (its name, e.g. \"arrow_drop_down\"). Give it a `label` when the icon says something on its own.\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */\n filled?: boolean\n /** What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration */\n label?: string\n}>(), { size: 24, filled: false })\n</script>\n\n<template>\n <span\n class=\"material-symbols-outlined leading-none\"\n :role=\"label ? 'img' : undefined\"\n :aria-label=\"label\"\n :aria-hidden=\"label ? undefined : 'true'\"\n :style=\"{ fontSize: `${size}px`, fontVariationSettings: filled ? `'FILL' 1` : undefined }\"\n >{{ name }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;oBAmBE,EAAA,GAAA,EAMkB,QAAA;GALhB,OAAM;GACL,MAAM,EAAA,QAAK,QAAW,KAAA;GACtB,cAAY,EAAA;GACZ,eAAa,EAAA,QAAQ,KAAA,IAAS;GAC9B,OAAK,EAAA;IAAA,UAAA,GAAiB,EAAA,KAAI;IAAA,uBAA6B,EAAA,SAAM,aAAgB,KAAA;GAAS,CAAA;EACrF,GAAA,EAAA,EAAA,IAAI,GAAA,IAAA,CAAA"}