@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
@@ -1,5 +1,5 @@
1
- import { i as e } from "./useLocale-CqQrhWFl.js";
2
- import { t } from "./MIcon-DLOkQduI.js";
1
+ import { i as e } from "./useLocale-CXibICQA.js";
2
+ import { t } from "./MIcon-Bxh9j135.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
5
5
  //#region src/components/MCodeEditor.vue?vue&type=script&setup=true&lang.ts
@@ -0,0 +1,29 @@
1
+ import { type SpringSpec } from '../composables/motion';
2
+ type __VLS_Props = {
3
+ /** The value: a number, a `Date` for times, or seconds for a duration */
4
+ value: number | Date;
5
+ /**
6
+ * `number` (Intl.NumberFormat), `datetime` (Intl.DateTimeFormat; a `Date` or a timestamp) or `duration`
7
+ * (seconds as `h:mm:ss`, hours only when there are some). Defaults to `datetime` for a `Date`, `number` otherwise
8
+ */
9
+ type?: 'number' | 'datetime' | 'duration';
10
+ /**
11
+ * Intl options for the type: `{ style: 'currency', currency: 'EUR' }`, `{ style: 'percent' }`,
12
+ * `{ style: 'unit', unit: 'kilometer-per-hour' }`, `{ notation: 'compact' }` for numbers; `{ timeStyle: 'medium' }`
13
+ * (the default), `{ hour: '2-digit', minute: '2-digit' }`, `{ dateStyle: 'short' }` for times. Unused for durations.
14
+ * Dollar-sign currencies show their country (`AR$`, `MX$`, `US$`) in any language; set `currencyDisplay` for
15
+ * Intl's own output (`'symbol'` gives the local peso as a plain `$`)
16
+ */
17
+ format?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
18
+ /** BCP-47 language for the format (`es-AR` for Argentine pesos and separators); defaults to the app's locale */
19
+ locale?: string;
20
+ /** The rolling spring; Standard SlowSpatial by default (an unhurried landing, no visible bounce) */
21
+ spring?: SpringSpec;
22
+ /** Roll to new values; false (or the system's reduced motion) jumps to them */
23
+ animate?: boolean;
24
+ };
25
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
26
+ animate: boolean;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
@@ -15,6 +15,8 @@ type __VLS_Props = {
15
15
  loading?: boolean;
16
16
  /** Material Symbol icon name shown next to the label */
17
17
  icon?: string;
18
+ /** Draw the icon filled (Material Symbols' FILL axis), e.g. a starred star or a play icon */
19
+ iconFilled?: boolean;
18
20
  /** Which side of the label the icon renders on */
19
21
  iconPos?: 'leading' | 'trailing';
20
22
  /**
@@ -0,0 +1,59 @@
1
+ import { type ContainerTransformController } from '../composables/useContainerTransform';
2
+ declare const __VLS_export: <T = unknown>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
4
+ /** A `useContainerTransform()` controller, to open it from elements elsewhere (`controller.open($event, item)`) */
5
+ controller?: ContainerTransformController<T>;
6
+ /**
7
+ * Where the expanded view opens: over the whole screen, as a centered panel (wider screens), or `custom`: the
8
+ * classes you give the component place and size it (`bottom-4 right-4 w-80 h-96`, `inset-y-0 right-0 w-96`…),
9
+ * anywhere over the page
10
+ */
11
+ mode?: "fullscreen" | "dialog" | "custom";
12
+ /** The centered panel's maximum width (`dialog` mode) */
13
+ maxWidth?: string;
14
+ /** Accessible name of the expanded view */
15
+ label?: string;
16
+ /**
17
+ * Dims the page behind it, which makes it modal (scroll lock, `aria-modal`). Without one the page stays usable:
18
+ * a click outside closes it instead (unless `persistent`)
19
+ */
20
+ scrim?: boolean;
21
+ /** A click on the scrim, or outside without one, doesn't close it */
22
+ persistent?: boolean;
23
+ /**
24
+ * Android's back (button or gesture) closes it, like an expanded view in an app, where the browser has the
25
+ * CloseWatcher API (Chrome, Edge); the history and the router are left alone. Default `true`
26
+ */
27
+ closeOnBack?: boolean;
28
+ } & {
29
+ /** Whether the expanded view is open; opening it from here grows it from the default slot's element */
30
+ open?: boolean;
31
+ }) & {
32
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
33
+ }> & (typeof globalThis extends {
34
+ __VLS_PROPS_FALLBACK: infer P;
35
+ } ? P : {});
36
+ expose: (exposed: {}) => void;
37
+ attrs: any;
38
+ slots: {
39
+ default?: (props: {
40
+ open: () => void;
41
+ isOpen: boolean;
42
+ }) => any;
43
+ } & {
44
+ expanded?: (props: {
45
+ close: () => void;
46
+ item: T | undefined;
47
+ }) => any;
48
+ };
49
+ emit: (event: "update:open", value: boolean) => void;
50
+ }>) => import("vue").VNode & {
51
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
52
+ };
53
+ declare const _default: typeof __VLS_export;
54
+ export default _default;
55
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
56
+ [K in keyof T]: T[K];
57
+ } : {
58
+ [K in keyof T as K]: T[K];
59
+ }) & {};
@@ -24,11 +24,12 @@ type __VLS_Props = {
24
24
  /**
25
25
  * Just the dialog's box (surface, shape, elevation), scrim, Escape, scroll lock and animation, with the default
26
26
  * slot filling it: no title row, padding, close button or actions. For dialogs that draw everything themselves
27
- * (the date and time pickers). `title` then only names it for assistive technology
27
+ * (the date and time pickers). With `fullscreen`, the slot fills the screen and draws its own top bar. `title`
28
+ * then only names it for assistive technology
28
29
  */
29
30
  bare?: boolean;
30
31
  };
31
- declare var __VLS_13: {}, __VLS_22: {}, __VLS_24: {}, __VLS_26: {}, __VLS_28: {}, __VLS_43: {}, __VLS_45: {}, __VLS_47: {};
32
+ declare var __VLS_13: {}, __VLS_22: {}, __VLS_24: {}, __VLS_26: {}, __VLS_28: {}, __VLS_36: {}, __VLS_45: {}, __VLS_47: {}, __VLS_49: {};
32
33
  type __VLS_Slots = {} & {
33
34
  default?: (props: typeof __VLS_13) => any;
34
35
  } & {
@@ -40,11 +41,13 @@ type __VLS_Slots = {} & {
40
41
  } & {
41
42
  actions?: (props: typeof __VLS_28) => any;
42
43
  } & {
43
- title?: (props: typeof __VLS_43) => any;
44
+ default?: (props: typeof __VLS_36) => any;
44
45
  } & {
45
- actions?: (props: typeof __VLS_45) => any;
46
+ title?: (props: typeof __VLS_45) => any;
46
47
  } & {
47
- default?: (props: typeof __VLS_47) => any;
48
+ actions?: (props: typeof __VLS_47) => any;
49
+ } & {
50
+ default?: (props: typeof __VLS_49) => any;
48
51
  };
49
52
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
50
53
  "update:modelValue": (args_0: boolean) => any;
@@ -19,8 +19,8 @@ type __VLS_Slots = {} & {
19
19
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
20
  wrap: boolean;
21
21
  inline: boolean;
22
- gap: "none" | "xs" | "sm" | "md" | "lg" | "xl";
23
22
  direction: "row" | "column" | "row-reverse" | "column-reverse";
23
+ gap: "none" | "xs" | "sm" | "md" | "lg" | "xl";
24
24
  align: "start" | "center" | "end" | "stretch" | "baseline";
25
25
  justify: "start" | "center" | "end" | "between" | "around" | "evenly";
26
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -5,6 +5,8 @@ type __VLS_Props = {
5
5
  size?: number;
6
6
  /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */
7
7
  filled?: boolean;
8
+ /** What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration */
9
+ label?: string;
8
10
  };
9
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
12
  size: number;
@@ -25,6 +25,8 @@ type __VLS_Props = {
25
25
  checked?: boolean;
26
26
  /** Icon shown while checked, when it differs from `icon` (e.g. 'pause' for 'play_arrow') */
27
27
  checkedIcon?: string;
28
+ /** Draw the icon filled (Material Symbols' FILL axis) without making it a toggle, e.g. media controls */
29
+ iconFilled?: boolean;
28
30
  };
29
31
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
32
  "update:checked": (args_0: boolean) => any;
@@ -0,0 +1,23 @@
1
+ type __VLS_Props = {
2
+ /** Heading above the group, styled like MListSubheader */
3
+ title?: string;
4
+ /** Align the title with items that have a leading icon (adds left padding) */
5
+ inset?: boolean;
6
+ };
7
+ declare var __VLS_1: {}, __VLS_3: {};
8
+ type __VLS_Slots = {} & {
9
+ title?: (props: typeof __VLS_1) => any;
10
+ } & {
11
+ default?: (props: typeof __VLS_3) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
+ inset: boolean;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -48,7 +48,7 @@ type __VLS_Props = {
48
48
  /** Control the expanded state (v-model:expanded) — otherwise managed internally */
49
49
  expanded?: boolean;
50
50
  };
51
- declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {}, __VLS_23: {}, __VLS_42: {}, __VLS_64: {}, __VLS_66: {}, __VLS_68: {};
51
+ declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {}, __VLS_23: {}, __VLS_50: {}, __VLS_72: {}, __VLS_74: {}, __VLS_76: {};
52
52
  type __VLS_Slots = {} & {
53
53
  leading?: (props: typeof __VLS_1) => any;
54
54
  } & {
@@ -58,13 +58,13 @@ type __VLS_Slots = {} & {
58
58
  } & {
59
59
  children?: (props: typeof __VLS_23) => any;
60
60
  } & {
61
- leading?: (props: typeof __VLS_42) => any;
61
+ leading?: (props: typeof __VLS_50) => any;
62
62
  } & {
63
- overline?: (props: typeof __VLS_64) => any;
63
+ overline?: (props: typeof __VLS_72) => any;
64
64
  } & {
65
- default?: (props: typeof __VLS_66) => any;
65
+ default?: (props: typeof __VLS_74) => any;
66
66
  } & {
67
- trailing?: (props: typeof __VLS_68) => any;
67
+ trailing?: (props: typeof __VLS_76) => any;
68
68
  };
69
69
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
70
70
  click: (e: MouseEvent) => any;
@@ -17,7 +17,7 @@ type __VLS_Props = {
17
17
  /** Vertical alignment of items within the rail */
18
18
  alignment?: 'top' | 'center' | 'bottom';
19
19
  /**
20
- * Widens the rail (220px) and shows each item's icon beside its label in a full-width pill, instead of the icon
20
+ * 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
21
21
  * over the label. Toggle it from your own menu button.
22
22
  */
23
23
  expanded?: boolean;
@@ -58,7 +58,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
58
58
  hour: number;
59
59
  }) => any;
60
60
  "update:date": (args_0: string) => any;
61
- "update:view": (args_0: "week" | "day") => any;
61
+ "update:view": (args_0: "day" | "week") => any;
62
62
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
63
63
  onEventClick?: ((args_0: SchedulerEvent) => any) | undefined;
64
64
  onSlotClick?: ((args_0: {
@@ -66,7 +66,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
66
66
  hour: number;
67
67
  }) => any) | undefined;
68
68
  "onUpdate:date"?: ((args_0: string) => any) | undefined;
69
- "onUpdate:view"?: ((args_0: "week" | "day") => any) | undefined;
69
+ "onUpdate:view"?: ((args_0: "day" | "week") => any) | undefined;
70
70
  }>, {
71
71
  view: "week" | "day";
72
72
  events: SchedulerEvent[];
@@ -0,0 +1,60 @@
1
+ import { type SchemeVariant } from '../composables/dynamicColor';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
5
+ /** Seed color (`#rrggbb`) the scheme is built from */
6
+ seed?: string;
7
+ /**
8
+ * An image (URL) whose dominant color becomes the seed, picked as Android picks a wallpaper's. Cross-origin
9
+ * images need CORS headers. `seed` wins while both are set
10
+ */
11
+ image?: string;
12
+ /**
13
+ * One of the palettes (`useColorPalette().palettes`, custom ones included), applied to this element only with
14
+ * its own CSS, in its standard contrast. `seed` and `image` win while set
15
+ */
16
+ palette?: string;
17
+ /** How the seed spreads into the scheme; `content` and `fidelity` keep the seed's own color most visible */
18
+ variant?: SchemeVariant;
19
+ /** Contrast level: 0 standard, 0.5 medium, 1 high (-1 reduced) */
20
+ contrast?: number;
21
+ /** Element to render */
22
+ as?: string;
23
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ seed: (color: string) => any;
25
+ }, string, import("vue").PublicProps, Readonly<{
26
+ /** Seed color (`#rrggbb`) the scheme is built from */
27
+ seed?: string;
28
+ /**
29
+ * An image (URL) whose dominant color becomes the seed, picked as Android picks a wallpaper's. Cross-origin
30
+ * images need CORS headers. `seed` wins while both are set
31
+ */
32
+ image?: string;
33
+ /**
34
+ * One of the palettes (`useColorPalette().palettes`, custom ones included), applied to this element only with
35
+ * its own CSS, in its standard contrast. `seed` and `image` win while set
36
+ */
37
+ palette?: string;
38
+ /** How the seed spreads into the scheme; `content` and `fidelity` keep the seed's own color most visible */
39
+ variant?: SchemeVariant;
40
+ /** Contrast level: 0 standard, 0.5 medium, 1 high (-1 reduced) */
41
+ contrast?: number;
42
+ /** Element to render */
43
+ as?: string;
44
+ }> & Readonly<{
45
+ onSeed?: ((color: string) => any) | undefined;
46
+ }>, {
47
+ contrast: number;
48
+ variant: SchemeVariant;
49
+ as: string;
50
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
51
+ default?: (props: {
52
+ seed: string | undefined;
53
+ ready: boolean;
54
+ }) => any;
55
+ }>;
56
+ type __VLS_WithSlots<T, S> = T & {
57
+ new (): {
58
+ $slots: S;
59
+ };
60
+ };
@@ -0,0 +1,41 @@
1
+ type __VLS_Props = {
2
+ /** The values, oldest first */
3
+ data: number[];
4
+ /** Line, line with a soft fill under it, or bars */
5
+ type?: 'line' | 'area' | 'bar';
6
+ /** An M3 color role (`primary`, `tertiary`, `error`...) or any CSS color */
7
+ color?: string;
8
+ /** Smooth curve through the points (monotone: it never overshoots them) instead of straight segments */
9
+ smooth?: boolean;
10
+ /** A dot on the last point (line and area) */
11
+ showLast?: boolean;
12
+ /** Line width in px */
13
+ strokeWidth?: number;
14
+ /** Fix the bottom of the scale (otherwise the lowest value, or 0 for bars) */
15
+ min?: number;
16
+ /** Fix the top of the scale (otherwise the highest value) */
17
+ max?: number;
18
+ /** A dashed reference line at this value (a target, yesterday's close) */
19
+ baseline?: number;
20
+ /** Follow the pointer with a dot and emit `hover` with the index under it */
21
+ interactive?: boolean;
22
+ /** Accessible name; defaults to a summary of the data in the app's language */
23
+ label?: string;
24
+ /** Spring to new data; false (or reduced motion) jumps */
25
+ animate?: boolean;
26
+ };
27
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ hover: (index: number | null) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onHover?: ((index: number | null) => any) | undefined;
31
+ }>, {
32
+ color: string;
33
+ animate: boolean;
34
+ type: "line" | "area" | "bar";
35
+ smooth: boolean;
36
+ interactive: boolean;
37
+ showLast: boolean;
38
+ strokeWidth: number;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: typeof __VLS_export;
41
+ export default _default;
@@ -16,8 +16,8 @@ type __VLS_Slots = {} & {
16
16
  };
17
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
18
18
  max: number;
19
- min: number;
20
19
  direction: "horizontal" | "vertical";
20
+ min: number;
21
21
  initialSplit: number;
22
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
23
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -21,8 +21,8 @@ type __VLS_Slots = {} & {
21
21
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
22
22
  wrap: boolean;
23
23
  inline: boolean;
24
- gap: "none" | "xs" | "sm" | "md" | "lg" | "xl";
25
24
  direction: "column" | "row";
25
+ gap: "none" | "xs" | "sm" | "md" | "lg" | "xl";
26
26
  align: "start" | "center" | "end" | "stretch" | "baseline";
27
27
  justify: "start" | "center" | "end" | "between" | "around" | "evenly";
28
28
  divider: boolean;
@@ -9,21 +9,48 @@ type __VLS_Props = {
9
9
  fabPosition?: 'start' | 'end' | 'none';
10
10
  /** Item alignment along the main axis */
11
11
  align?: 'start' | 'center' | 'end' | 'between';
12
+ /**
13
+ * Collapse a floating toolbar as the content scrolls down and expand it as it scrolls back up (40px each way):
14
+ * `true` follows the window, or pass the scrolling element (or a CSS selector for it). Off by default
15
+ */
16
+ collapseOnScroll?: boolean | string | HTMLElement | null;
12
17
  };
13
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
18
+ type __VLS_ModelProps = {
19
+ /** A floating toolbar's state: collapsed, it shows only the FAB, or only its center without one. Default `true` */
20
+ 'expanded'?: boolean;
21
+ };
22
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
23
+ declare var __VLS_7: {}, __VLS_9: {}, __VLS_11: {}, __VLS_13: {}, __VLS_15: {}, __VLS_17: {}, __VLS_19: {}, __VLS_21: {}, __VLS_29: {};
14
24
  type __VLS_Slots = {} & {
15
- fab?: (props: typeof __VLS_1) => any;
25
+ fab?: (props: typeof __VLS_7) => any;
26
+ } & {
27
+ leading?: (props: typeof __VLS_9) => any;
28
+ } & {
29
+ default?: (props: typeof __VLS_11) => any;
30
+ } & {
31
+ trailing?: (props: typeof __VLS_13) => any;
32
+ } & {
33
+ leading?: (props: typeof __VLS_15) => any;
34
+ } & {
35
+ default?: (props: typeof __VLS_17) => any;
36
+ } & {
37
+ trailing?: (props: typeof __VLS_19) => any;
16
38
  } & {
17
- default?: (props: typeof __VLS_3) => any;
39
+ default?: (props: typeof __VLS_21) => any;
18
40
  } & {
19
- fab?: (props: typeof __VLS_5) => any;
41
+ fab?: (props: typeof __VLS_29) => any;
20
42
  };
21
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
43
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
+ "update:expanded": (value: boolean) => any;
45
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
46
+ "onUpdate:expanded"?: ((value: boolean) => any) | undefined;
47
+ }>, {
22
48
  color: "surface" | "primary" | "secondary" | "tertiary";
23
49
  variant: "docked" | "floating";
24
50
  orientation: "horizontal" | "vertical";
25
51
  align: "start" | "center" | "end" | "between";
26
52
  fabPosition: "start" | "end" | "none";
53
+ collapseOnScroll: boolean | string | HTMLElement | null;
27
54
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
55
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
56
  declare const _default: typeof __VLS_export;
@@ -113,9 +113,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
113
113
  width: string;
114
114
  height: string;
115
115
  minHeight: number;
116
- closable: boolean;
117
- y: number;
118
116
  x: number;
117
+ y: number;
118
+ closable: boolean;
119
119
  minimizable: boolean;
120
120
  maximizable: boolean;
121
121
  draggable: boolean;
@@ -49,10 +49,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
49
49
  name: string;
50
50
  size?: number;
51
51
  filled?: boolean;
52
+ label?: string;
52
53
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
53
54
  name: string;
54
55
  size?: number;
55
56
  filled?: boolean;
57
+ label?: string;
56
58
  }> & Readonly<{}>, {
57
59
  size: number;
58
60
  filled: boolean;
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ color: 'primary' | 'tertiary';
3
+ };
4
+ declare var __VLS_1: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ };
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -0,0 +1,48 @@
1
+ export interface Box {
2
+ left: number;
3
+ top: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export declare const OPEN_MS = 500;
8
+ export declare const CLOSE_MS = 400;
9
+ export declare const SCRIM_OPACITY: number;
10
+ export declare function emphasized(t: number): number;
11
+ /** Where a view sits: translate from its own resting box, uniform scale from its top-left corner, opacity */
12
+ export interface ViewState {
13
+ x: number;
14
+ y: number;
15
+ scale: number;
16
+ opacity: number;
17
+ }
18
+ export interface Frame {
19
+ /** The container's clip, in the same coordinates as the boxes, and its corner radius */
20
+ clip: Box;
21
+ radius: number;
22
+ start: ViewState;
23
+ end: ViewState;
24
+ scrim: number;
25
+ }
26
+ /**
27
+ * The transition's state at progress `p` (already eased), from the `start` box to the `end` one. `entering` is the
28
+ * direction (Android's TRANSITION_DIRECTION_AUTO: the bigger box is the detail), which picks the thresholds and the
29
+ * fade: entering, the end view fades in on top of the start one; returning, the start one fades out on top.
30
+ */
31
+ export declare function containerFrame(p: number, start: Box, end: Box, startRadius: number, endRadius: number, entering: boolean): Frame;
32
+ /** Every frame of a transition, one per 60Hz frame of `duration` ms, on the emphasized curve */
33
+ export declare function containerFrames(start: Box, end: Box, startRadius: number, endRadius: number, entering: boolean, duration: number): Frame[];
34
+ /**
35
+ * Plays `frames` on the clip layer (positioned at the viewport's origin, `vw` × `vh`), the two views and the scrim.
36
+ * Returns the running animations (empty without the Web Animations API). `fill: 'forwards'` holds the last frame
37
+ * (a closing run, until the layer is removed).
38
+ */
39
+ export declare function playContainerFrames(frames: Frame[], els: {
40
+ clip: HTMLElement;
41
+ start?: HTMLElement | null;
42
+ end: HTMLElement;
43
+ scrim?: HTMLElement | null;
44
+ }, vw: number, vh: number, fill?: FillMode): Animation[];
45
+ /** A resting box in viewport coordinates */
46
+ export declare function boxOf(el: Element): Box;
47
+ /** An element's top-left corner radius in px (a percentage resolves against its width) */
48
+ export declare function radiusOf(el: Element): number;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Internal (not exported from index.ts): where each item of a segmented list sits in its run, for
3
+ * SegmentedListItem's segmentedShapes(index, count). A run is consecutive `role="listitem"` children of `el`;
4
+ * anything else (a subheader, an MListGroup) ends it. Used by MList and by MListGroup for its own items.
5
+ */
6
+ import { type Ref } from 'vue';
7
+ export type SegmentPosition = 'single' | 'first' | 'middle' | 'last';
8
+ export declare function useSegmentRuns(el: Ref<HTMLElement | undefined>): (item: Element | null | undefined) => SegmentPosition | undefined;
@@ -16,3 +16,14 @@ export declare const schemeRoles: readonly ["primary", "on-primary", "primary-co
16
16
  export declare function generateScheme(seed: string, options?: SeedOptions): Promise<GeneratedScheme>;
17
17
  /** CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css. */
18
18
  export declare function schemeToCss(scheme: GeneratedScheme, id: string): string;
19
+ /**
20
+ * The seed color of an image's pixels (RGBA bytes, as `ImageData.data`): its colors quantized and scored the way
21
+ * Android picks a wallpaper's source color (QuantizerCelebi + Score). Fully transparent pixels are skipped.
22
+ */
23
+ export declare function seedFromPixels(rgba: ArrayLike<number>): Promise<string>;
24
+ /**
25
+ * The seed color of an image, for `generateScheme`, `useColorPalette().setSeed()` or `MScheme`: what Android does
26
+ * with the wallpaper. Takes a URL (cross-origin images need CORS headers, or the canvas can't be read), an `<img>`,
27
+ * an `ImageBitmap` or a `Blob` (a file the user picked). Browser only.
28
+ */
29
+ export declare function seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string>;
@@ -189,6 +189,8 @@ export declare const CSS_KEY = "m3-palette-css";
189
189
  */
190
190
  export type ContrastLevel = 'standard' | 'medium' | 'high' | 'system';
191
191
  export { STYLE_ID };
192
+ /** Whether a stylesheet (other than our generated one) already styles `[data-palette='<id>']`. Also used by MScheme; not exported from index.ts. */
193
+ export declare function hasPaletteCss(id: string): boolean;
192
194
  export declare function useColorPalette(): {
193
195
  palette: Ref<string, string>;
194
196
  palettes: Palette[];
@@ -204,7 +206,7 @@ export declare function useColorPalette(): {
204
206
  } | null>>;
205
207
  setSeed: (seed: string, options?: SeedOptions) => Promise<void>;
206
208
  contrast: Readonly<Ref<ContrastLevel>>;
207
- activeContrast: Ref<"medium" | "standard" | "high", "medium" | "standard" | "high">;
209
+ activeContrast: Ref<"medium" | "high" | "standard", "medium" | "high" | "standard">;
208
210
  setContrast: (level: ContrastLevel) => void;
209
211
  persistPalette: Ref<boolean, boolean>;
210
212
  setPersistPalette: (enabled: boolean) => void;
@@ -0,0 +1,32 @@
1
+ import { type ShapeName } from 'shape-morph';
2
+ export interface ConfettiOptions {
3
+ /** How many pieces (default 80; 160 for `from: 'top'`) */
4
+ count?: number;
5
+ /** Shapes to pick from (MShape's names) */
6
+ shapes?: ShapeName[];
7
+ /** Any CSS colors. Default: the theme's primary, secondary and tertiary roles and their containers, read at the origin */
8
+ colors?: string[];
9
+ /** Burst from a point (default) or rain from the top of the screen */
10
+ from?: 'point' | 'top';
11
+ /** Burst angle in degrees, 0 = up (default 0) */
12
+ angle?: number;
13
+ /** Cone the pieces leave in, in degrees (default 70) */
14
+ spread?: number;
15
+ /** Launch speed in px/s (default 950) */
16
+ velocity?: number;
17
+ /** Piece size in px (default 14) */
18
+ size?: number;
19
+ }
20
+ /** Where a burst starts: the pointer of an event, an element's center, or a point in viewport pixels */
21
+ export type ConfettiOrigin = MouseEvent | PointerEvent | Element | {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ /** Fires a burst of confetti. Browser only; does nothing under reduced motion. */
26
+ export declare function fireConfetti(origin?: ConfettiOrigin, options?: ConfettiOptions): void;
27
+ /** Confetti for a component: `fire(event)` from the pointer, `fire(el)` from an element, `fire({ from: 'top' })`. */
28
+ export declare function useConfetti(): {
29
+ fire: (origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) => void;
30
+ };
31
+ /** Stops every burst and removes the canvas. Internal, for tests; not exported from index.ts. */
32
+ export declare function __resetConfetti(): void;
@@ -0,0 +1,30 @@
1
+ import { type ComponentPublicInstance, type Ref, type ShallowRef } from 'vue';
2
+ /** What a container transform opens from: a click (its element), an element, or a component */
3
+ export type ContainerTransformOrigin = Event | Element | ComponentPublicInstance | null | undefined;
4
+ /** The state MContainerTransform plays, shared between the elements that open it and the panel they open */
5
+ export interface ContainerTransformController<T = unknown> {
6
+ /** Whether the expanded view is open (or opening) */
7
+ isOpen: Ref<boolean>;
8
+ /** What `open` was given, for the expanded view to show */
9
+ item: Ref<T | undefined>;
10
+ /** The element it grows from and shrinks back into */
11
+ source: ShallowRef<HTMLElement | null>;
12
+ /** Opens from `origin` (a click's element, an element or a component), with an optional `item` */
13
+ open: (origin?: ContainerTransformOrigin, item?: T) => void;
14
+ /** Shrinks the expanded view back into the element it opened from */
15
+ close: () => void;
16
+ }
17
+ /** The element an origin stands for: a click's `currentTarget` (or `target`), a component's root element */
18
+ export declare function originElement(origin: ContainerTransformOrigin): HTMLElement | null;
19
+ /**
20
+ * Material's container transform for elements that live apart from their expanded view: one controller, many
21
+ * elements opening it (a grid of cards), and one `<MContainerTransform :controller>` wherever the expanded view
22
+ * belongs. `open(event, item)` from a click grows that element into the expanded view, with `item` for it to show.
23
+ *
24
+ * ```ts
25
+ * const detail = useContainerTransform<Recipe>()
26
+ * // <MCard v-for="r in recipes" @click="detail.open($event, r)">…</MCard>
27
+ * // <MContainerTransform :controller="detail"><template #expanded="{ item }">…</template></MContainerTransform>
28
+ * ```
29
+ */
30
+ export declare function useContainerTransform<T = unknown>(): ContainerTransformController<T>;