@m3ui-vue/m3ui-vue 1.1.3 → 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 (78) hide show
  1. package/README.md +1 -1
  2. package/dist/API.md +70 -8
  3. package/dist/{MMenuItem-BckcR0nW.js → MMenuItem-BfjqwcYP.js} +84 -63
  4. package/dist/MMenuItem-BfjqwcYP.js.map +1 -0
  5. package/dist/MSlider-JflHJ70q.js +1525 -0
  6. package/dist/MSlider-JflHJ70q.js.map +1 -0
  7. package/dist/{MTextField-FCPOTB0o.js → MTextField-NaIB6RbM.js} +5 -4
  8. package/dist/MTextField-NaIB6RbM.js.map +1 -0
  9. package/dist/api.json +1 -1
  10. package/dist/code-editor.js +1 -1
  11. package/dist/components/MAnimatedNumber.vue.d.ts +3 -1
  12. package/dist/components/MButton.vue.d.ts +2 -0
  13. package/dist/components/MContainerTransform.vue.d.ts +59 -0
  14. package/dist/components/MDialog.vue.d.ts +8 -5
  15. package/dist/components/MFlex.vue.d.ts +1 -1
  16. package/dist/components/MIconButton.vue.d.ts +2 -0
  17. package/dist/components/MListItem.vue.d.ts +5 -5
  18. package/dist/components/MNavigationRail.vue.d.ts +1 -1
  19. package/dist/components/MSplitter.vue.d.ts +1 -1
  20. package/dist/components/MStack.vue.d.ts +1 -1
  21. package/dist/components/MToolbar.vue.d.ts +32 -5
  22. package/dist/components/_MToolbarFab.vue.d.ts +16 -0
  23. package/dist/composables/_containerTransform.d.ts +48 -0
  24. package/dist/composables/useContainerTransform.d.ts +30 -0
  25. package/dist/composables/useLocale.d.ts +3 -0
  26. package/dist/index.d.ts +3 -0
  27. package/dist/locales/index.js +14 -0
  28. package/dist/locales/index.js.map +1 -1
  29. package/dist/m3ui-vue.css +1 -1
  30. package/dist/m3ui.js +4217 -3713
  31. package/dist/m3ui.js.map +1 -1
  32. package/dist/map.js +38 -38
  33. package/dist/rich-text-editor.js +10 -10
  34. package/dist/styles.css +1 -1
  35. package/dist/{useLocale-SfQHnJfp.js → useLocale-CXibICQA.js} +3 -1
  36. package/dist/useLocale-CXibICQA.js.map +1 -0
  37. package/package.json +2 -1
  38. package/src/__tests__/MAnimatedNumber.test.ts +24 -2
  39. package/src/__tests__/MContainerTransform.test.ts +279 -0
  40. package/src/__tests__/MDialog.test.ts +27 -0
  41. package/src/__tests__/MListItemExpandable.test.ts +48 -0
  42. package/src/__tests__/MListItemShape.test.ts +9 -6
  43. package/src/__tests__/MListKeyboard.test.ts +90 -0
  44. package/src/__tests__/MMapTools.test.ts +2 -1
  45. package/src/__tests__/MNavigationRail.test.ts +33 -0
  46. package/src/__tests__/MSlider.test.ts +161 -0
  47. package/src/__tests__/MToolbar.test.ts +157 -0
  48. package/src/__tests__/attrsFallthrough.test.ts +6 -0
  49. package/src/__tests__/hydration.test.ts +25 -0
  50. package/src/components/MAnimatedNumber.vue +32 -6
  51. package/src/components/MButton.vue +4 -2
  52. package/src/components/MContainerTransform.vue +321 -0
  53. package/src/components/MDialog.vue +31 -6
  54. package/src/components/MFab.vue +10 -5
  55. package/src/components/MIconButton.vue +3 -1
  56. package/src/components/MList.vue +26 -2
  57. package/src/components/MListItem.vue +138 -84
  58. package/src/components/MNavigationRail.vue +40 -10
  59. package/src/components/MSlider.vue +161 -42
  60. package/src/components/MToolbar.vue +256 -15
  61. package/src/components/_MToolbarFab.vue +14 -0
  62. package/src/composables/_containerTransform.ts +179 -0
  63. package/src/composables/_useEscapeStack.ts +2 -0
  64. package/src/composables/useContainerTransform.ts +59 -0
  65. package/src/composables/useLocale.ts +5 -0
  66. package/src/index.ts +3 -0
  67. package/src/locales/de.ts +2 -0
  68. package/src/locales/es.ts +2 -0
  69. package/src/locales/fr.ts +2 -0
  70. package/src/locales/ja.ts +2 -0
  71. package/src/locales/ko.ts +2 -0
  72. package/src/locales/pt.ts +2 -0
  73. package/src/locales/zh.ts +2 -0
  74. package/dist/MMenuItem-BckcR0nW.js.map +0 -1
  75. package/dist/MSlider-LyH_gy8D.js +0 -1411
  76. package/dist/MSlider-LyH_gy8D.js.map +0 -1
  77. package/dist/MTextField-FCPOTB0o.js.map +0 -1
  78. package/dist/useLocale-SfQHnJfp.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-SfQHnJfp.js";
1
+ import { i as e } from "./useLocale-CXibICQA.js";
2
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";
@@ -10,7 +10,9 @@ type __VLS_Props = {
10
10
  /**
11
11
  * Intl options for the type: `{ style: 'currency', currency: 'EUR' }`, `{ style: 'percent' }`,
12
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
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 `$`)
14
16
  */
15
17
  format?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
16
18
  /** BCP-47 language for the format (`es-AR` for Argentine pesos and separators); defaults to the app's locale */
@@ -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>;
@@ -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;
@@ -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;
@@ -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;
@@ -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,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>;
@@ -160,6 +160,9 @@ export interface M3Locale {
160
160
  carouselItem: string;
161
161
  /** MSparkline's summary for screen readers: {first}, {last}, {min}, {max} */
162
162
  sparklineSummary: string;
163
+ /** MSlider range: its two thumbs */
164
+ sliderRangeStart: string;
165
+ sliderRangeEnd: string;
163
166
  mapTitle: string;
164
167
  mapMarker: string;
165
168
  mapZoomIn: string;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ export type { Theme } from './composables/useTheme';
6
6
  export { useColorPalette, palettes } from './composables/useColorPalette';
7
7
  export { useConfetti, fireConfetti } from './composables/useConfetti';
8
8
  export type { ConfettiOptions, ConfettiOrigin } from './composables/useConfetti';
9
+ export { useContainerTransform } from './composables/useContainerTransform';
10
+ export type { ContainerTransformController, ContainerTransformOrigin } from './composables/useContainerTransform';
9
11
  export type { Palette, PaletteId, ActiveSeed, ContrastLevel } from './composables/useColorPalette';
10
12
  export { SEED_PALETTE } from './composables/useColorPalette';
11
13
  export { themeInitScript } from './composables/themeInitScript';
@@ -61,6 +63,7 @@ export { default as MColorPicker } from './components/MColorPicker.vue';
61
63
  export { default as MColorPickerModal } from './components/MColorPickerModal.vue';
62
64
  export { default as MCommandPalette } from './components/MCommandPalette.vue';
63
65
  export { default as MConfirmDialog } from './components/MConfirmDialog.vue';
66
+ export { default as MContainerTransform } from './components/MContainerTransform.vue';
64
67
  export { default as MContainer } from './components/MContainer.vue';
65
68
  export { default as MContextMenu } from './components/MContextMenu.vue';
66
69
  export { default as MCopyButton } from './components/MCopyButton.vue';
@@ -156,6 +156,8 @@ var e = {
156
156
  carousel: "Carrusel",
157
157
  carouselItem: "{index} de {count}",
158
158
  sparklineSummary: "De {first} a {last}, mínimo {min}, máximo {max}",
159
+ sliderRangeStart: "Inicio del rango",
160
+ sliderRangeEnd: "Fin del rango",
159
161
  mapTitle: "Mapa",
160
162
  mapMarker: "Marcador del mapa",
161
163
  mapZoomIn: "Acercar",
@@ -343,6 +345,8 @@ var e = {
343
345
  carousel: "Carrousel",
344
346
  carouselItem: "{index} sur {count}",
345
347
  sparklineSummary: "De {first} à {last}, minimum {min}, maximum {max}",
348
+ sliderRangeStart: "Début de la plage",
349
+ sliderRangeEnd: "Fin de la plage",
346
350
  mapTitle: "Carte",
347
351
  mapMarker: "Marqueur de carte",
348
352
  mapZoomIn: "Zoom avant",
@@ -530,6 +534,8 @@ var e = {
530
534
  carousel: "Carrossel",
531
535
  carouselItem: "{index} de {count}",
532
536
  sparklineSummary: "De {first} a {last}, mínimo {min}, máximo {max}",
537
+ sliderRangeStart: "Início do intervalo",
538
+ sliderRangeEnd: "Fim do intervalo",
533
539
  mapTitle: "Mapa",
534
540
  mapMarker: "Marcador do mapa",
535
541
  mapZoomIn: "Aproximar",
@@ -717,6 +723,8 @@ var e = {
717
723
  carousel: "Karussell",
718
724
  carouselItem: "{index} von {count}",
719
725
  sparklineSummary: "Von {first} bis {last}, Minimum {min}, Maximum {max}",
726
+ sliderRangeStart: "Bereichsanfang",
727
+ sliderRangeEnd: "Bereichsende",
720
728
  mapTitle: "Karte",
721
729
  mapMarker: "Kartenmarkierung",
722
730
  mapZoomIn: "Vergrößern",
@@ -904,6 +912,8 @@ var e = {
904
912
  carousel: "カルーセル",
905
913
  carouselItem: "{count} 件中 {index} 件目",
906
914
  sparklineSummary: "{first} から {last}、最小 {min}、最大 {max}",
915
+ sliderRangeStart: "範囲の開始",
916
+ sliderRangeEnd: "範囲の終了",
907
917
  mapTitle: "地図",
908
918
  mapMarker: "地図のマーカー",
909
919
  mapZoomIn: "ズームイン",
@@ -1091,6 +1101,8 @@ var e = {
1091
1101
  carousel: "轮播",
1092
1102
  carouselItem: "第 {index} 项,共 {count} 项",
1093
1103
  sparklineSummary: "从 {first} 到 {last},最低 {min},最高 {max}",
1104
+ sliderRangeStart: "范围起点",
1105
+ sliderRangeEnd: "范围终点",
1094
1106
  mapTitle: "地图",
1095
1107
  mapMarker: "地图标记",
1096
1108
  mapZoomIn: "放大",
@@ -1278,6 +1290,8 @@ var e = {
1278
1290
  carousel: "캐러셀",
1279
1291
  carouselItem: "{count}개 중 {index}번째",
1280
1292
  sparklineSummary: "{first}에서 {last}, 최소 {min}, 최대 {max}",
1293
+ sliderRangeStart: "범위 시작",
1294
+ sliderRangeEnd: "범위 끝",
1281
1295
  mapTitle: "지도",
1282
1296
  mapMarker: "지도 마커",
1283
1297
  mapZoomIn: "확대",