@m3ui-vue/m3ui-vue 0.9.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +26 -29
  2. package/dist/API.md +242 -22
  3. package/dist/{MIcon-CaEooCmZ.js → MIcon-DLOkQduI.js} +10 -3
  4. package/dist/MIcon-DLOkQduI.js.map +1 -0
  5. package/dist/{MTextField-Ck0oWDMk.js → MTextField-TZ7lfr09.js} +551 -216
  6. package/dist/MTextField-TZ7lfr09.js.map +1 -0
  7. package/dist/THIRD_PARTY_LICENSES.md +547 -0
  8. package/dist/api.json +1 -1
  9. package/dist/code-editor.js +2 -2
  10. package/dist/components/MAppBarWithSearch.vue.d.ts +70 -0
  11. package/dist/components/MBottomAppBar.vue.d.ts +37 -0
  12. package/dist/components/MBottomSheetScaffold.vue.d.ts +40 -0
  13. package/dist/components/MButton.vue.d.ts +4 -2
  14. package/dist/components/MButtonGroup.vue.d.ts +2 -0
  15. package/dist/components/MChatBubble.vue.d.ts +1 -1
  16. package/dist/components/MChip.vue.d.ts +19 -2
  17. package/dist/components/MContainer.vue.d.ts +1 -1
  18. package/dist/components/MDataTable.vue.d.ts +1 -1
  19. package/dist/components/MDialog.vue.d.ts +1 -1
  20. package/dist/components/MFab.vue.d.ts +15 -4
  21. package/dist/components/MIcon.vue.d.ts +3 -0
  22. package/dist/components/MIconButton.vue.d.ts +15 -1
  23. package/dist/components/MListItem.vue.d.ts +2 -2
  24. package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
  25. package/dist/components/MMenuItem.vue.d.ts +17 -4
  26. package/dist/components/MNavigationRail.vue.d.ts +6 -0
  27. package/dist/components/MSearchBar.vue.d.ts +5 -3
  28. package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
  29. package/dist/components/MSplitButton.vue.d.ts +2 -0
  30. package/dist/components/MTable.vue.d.ts +1 -1
  31. package/dist/components/MTabs.vue.d.ts +6 -0
  32. package/dist/components/MTimePickerModal.vue.d.ts +3 -0
  33. package/dist/components/MTimeScroll.vue.d.ts +22 -0
  34. package/dist/components/MToggleButton.vue.d.ts +2 -0
  35. package/dist/components/MTopAppBar.vue.d.ts +33 -2
  36. package/dist/components/MTree.vue.d.ts +2 -2
  37. package/dist/components/_MDrawerItemList.vue.d.ts +3 -0
  38. package/dist/composables/_searchAppBar.d.ts +6 -0
  39. package/dist/composables/_themeTransition.d.ts +2 -0
  40. package/dist/composables/_useSpring.d.ts +5 -5
  41. package/dist/composables/motion.d.ts +101 -0
  42. package/dist/composables/useColorPalette.d.ts +10 -0
  43. package/dist/composables/useLocale.d.ts +9 -0
  44. package/dist/directives/vRipple.d.ts +16 -0
  45. package/dist/emoji-names-de-BphO5XpV.js.map +1 -1
  46. package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -1
  47. package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -1
  48. package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -1
  49. package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -1
  50. package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -1
  51. package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -1
  52. package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -1
  53. package/dist/index.d.ts +11 -1
  54. package/dist/locales/index.js +63 -0
  55. package/dist/locales/index.js.map +1 -1
  56. package/dist/m3ui-vue.css +1 -1
  57. package/dist/m3ui.js +7716 -6768
  58. package/dist/m3ui.js.map +1 -1
  59. package/dist/plugin.d.ts +7 -0
  60. package/dist/rich-text-editor.js +22 -22
  61. package/dist/styles/palettes-contrast.css +7764 -0
  62. package/dist/styles/theme.css +59 -2
  63. package/dist/styles.css +1 -1
  64. package/dist/terminal.js +1 -1
  65. package/dist/{useLocale-CFW8cIzL.js → useLocale-CuvWRZ1h.js} +10 -1
  66. package/dist/useLocale-CuvWRZ1h.js.map +1 -0
  67. package/package.json +4 -2
  68. package/src/__tests__/MAppBarWithSearch.test.ts +96 -0
  69. package/src/__tests__/MBottomAppBar.test.ts +71 -0
  70. package/src/__tests__/MBottomSheetScaffold.test.ts +101 -0
  71. package/src/__tests__/MChip.test.ts +63 -0
  72. package/src/__tests__/MFab.test.ts +36 -0
  73. package/src/__tests__/MIconButton.test.ts +60 -0
  74. package/src/__tests__/MMenuItem.test.ts +84 -0
  75. package/src/__tests__/MNavigationRail.test.ts +77 -0
  76. package/src/__tests__/MScrollField.test.ts +28 -0
  77. package/src/__tests__/MTabs.test.ts +39 -0
  78. package/src/__tests__/MTimePickerModal.test.ts +52 -0
  79. package/src/__tests__/MTimeScroll.test.ts +44 -0
  80. package/src/__tests__/MTopAppBar.test.ts +99 -0
  81. package/src/__tests__/contrast.test.ts +64 -0
  82. package/src/__tests__/dynamicColor.test.ts +17 -0
  83. package/src/__tests__/motion.test.ts +37 -0
  84. package/src/__tests__/themeTransition.test.ts +119 -0
  85. package/src/__tests__/vRipple.test.ts +92 -0
  86. package/src/components/MAppBarWithSearch.vue +236 -0
  87. package/src/components/MBottomAppBar.vue +181 -0
  88. package/src/components/MBottomSheetScaffold.vue +296 -0
  89. package/src/components/MBreadcrumbs.vue +1 -1
  90. package/src/components/MButton.vue +4 -13
  91. package/src/components/MButtonGroup.vue +4 -11
  92. package/src/components/MChip.vue +137 -5
  93. package/src/components/MFab.vue +81 -27
  94. package/src/components/MIcon.vue +4 -2
  95. package/src/components/MIconButton.vue +96 -24
  96. package/src/components/MMenuItem.vue +115 -13
  97. package/src/components/MNavigationDrawer.vue +2 -2
  98. package/src/components/MNavigationRail.vue +135 -8
  99. package/src/components/MScrollField.vue +10 -2
  100. package/src/components/MSearchBar.vue +28 -12
  101. package/src/components/MSplitButton.vue +5 -12
  102. package/src/components/MTabs.vue +16 -5
  103. package/src/components/MTimePickerModal.vue +48 -8
  104. package/src/components/MTimeScroll.vue +161 -0
  105. package/src/components/MToggleButton.vue +5 -12
  106. package/src/components/MTopAppBar.vue +252 -28
  107. package/src/composables/_carouselStrategy.ts +3 -0
  108. package/src/composables/_searchAppBar.ts +9 -0
  109. package/src/composables/_themeColor.ts +11 -4
  110. package/src/composables/_themeTransition.ts +71 -0
  111. package/src/composables/_useSpring.ts +12 -20
  112. package/src/composables/motion.ts +73 -0
  113. package/src/composables/useColorPalette.ts +103 -20
  114. package/src/composables/useLocale.ts +18 -0
  115. package/src/composables/useTheme.ts +4 -12
  116. package/src/data/emoji-names/emoji-names-de.ts +1 -0
  117. package/src/data/emoji-names/emoji-names-en.ts +1 -0
  118. package/src/data/emoji-names/emoji-names-es.ts +1 -0
  119. package/src/data/emoji-names/emoji-names-fr.ts +1 -0
  120. package/src/data/emoji-names/emoji-names-ja.ts +1 -0
  121. package/src/data/emoji-names/emoji-names-ko.ts +1 -0
  122. package/src/data/emoji-names/emoji-names-pt.ts +1 -0
  123. package/src/data/emoji-names/emoji-names-zh.ts +1 -0
  124. package/src/data/emojis.ts +1 -0
  125. package/src/directives/vRipple.ts +73 -0
  126. package/src/index.ts +13 -1
  127. package/src/locales/de.ts +9 -0
  128. package/src/locales/es.ts +9 -0
  129. package/src/locales/fr.ts +9 -0
  130. package/src/locales/ja.ts +9 -0
  131. package/src/locales/ko.ts +9 -0
  132. package/src/locales/pt.ts +9 -0
  133. package/src/locales/zh.ts +9 -0
  134. package/src/plugin.ts +11 -1
  135. package/src/styles/palettes-contrast.css +7764 -0
  136. package/src/styles/theme.css +59 -2
  137. package/dist/MIcon-CaEooCmZ.js.map +0 -1
  138. package/dist/MTextField-Ck0oWDMk.js.map +0 -1
  139. package/dist/useLocale-CFW8cIzL.js.map +0 -1
@@ -55,12 +55,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
55
55
  expandAll: typeof expandAll;
56
56
  collapseAll: typeof collapseAll;
57
57
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
58
- "update:selected": (args_0: string | number | null) => any;
59
58
  "update:checked": (args_0: (string | number)[]) => any;
59
+ "update:selected": (args_0: string | number | null) => any;
60
60
  "node-click": (args_0: TreeNode) => any;
61
61
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
62
- "onUpdate:selected"?: ((args_0: string | number | null) => any) | undefined;
63
62
  "onUpdate:checked"?: ((args_0: (string | number)[]) => any) | undefined;
63
+ "onUpdate:selected"?: ((args_0: string | number | null) => any) | undefined;
64
64
  "onNode-click"?: ((args_0: TreeNode) => any) | undefined;
65
65
  }>, {
66
66
  selected: string | number | null;
@@ -48,10 +48,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
48
48
  MIcon: import("vue").DefineComponent<{
49
49
  name: string;
50
50
  size?: number;
51
+ filled?: boolean;
51
52
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
52
53
  name: string;
53
54
  size?: number;
55
+ filled?: boolean;
54
56
  }> & Readonly<{}>, {
55
57
  size: number;
58
+ filled: boolean;
56
59
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
60
  }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,6 @@
1
+ import type { InjectionKey, Ref } from 'vue';
2
+ export interface SearchAppBarContext {
3
+ /** Content is scrolled under the app bar: the search bar takes its scrolled container color */
4
+ scrolled: Ref<boolean>;
5
+ }
6
+ export declare const searchAppBarKey: InjectionKey<SearchAppBarContext>;
@@ -0,0 +1,2 @@
1
+ /** Runs `apply` (the DOM writes of a theme change) with the theme transition. */
2
+ export declare function themeTransition(apply: () => void): void;
@@ -1,9 +1,9 @@
1
- export interface SpringSpec {
2
- dampingRatio: number;
3
- stiffness: number;
4
- }
1
+ import { type SpringSpec } from './motion';
2
+ export type { SpringSpec };
5
3
  /** MotionSchemeKeyTokens.FastSpatial in the Standard scheme (StandardMotionTokens.SpringFastSpatial*) */
6
4
  export declare const FAST_SPATIAL: SpringSpec;
5
+ /** MotionSchemeKeyTokens.FastEffects in the Standard scheme */
6
+ export declare const FAST_EFFECTS: SpringSpec;
7
7
  /** MotionSchemeKeyTokens.DefaultEffects in the Standard scheme */
8
8
  export declare const DEFAULT_EFFECTS: SpringSpec;
9
9
  /** MotionSchemeKeyTokens.DefaultSpatial in the Standard scheme */
@@ -12,4 +12,4 @@ export declare function useSpring(target: () => number[], apply: (values: readon
12
12
  snap: () => void;
13
13
  };
14
14
  /** Compose's FastOutSlowInEasing, cubic-bezier(0.4, 0, 0.2, 1) — the easing of a default tween() */
15
- export declare function fastOutSlowIn(t: number): number;
15
+ export declare const fastOutSlowIn: (t: number) => number;
@@ -0,0 +1,101 @@
1
+ /** A spring: dampingRatio 1 settles without overshoot, lower bounces; higher stiffness is faster */
2
+ export interface SpringSpec {
3
+ dampingRatio: number;
4
+ stiffness: number;
5
+ }
6
+ /**
7
+ * Spring specs of the two motion schemes. Spatial springs move things (position, size, shape); effects springs
8
+ * change color and opacity and never overshoot. Standard is the default scheme; Expressive is bouncier, for
9
+ * Expressive components and moments that should feel lively.
10
+ */
11
+ export declare const motionSprings: {
12
+ readonly standard: {
13
+ readonly fastSpatial: {
14
+ readonly dampingRatio: 0.9;
15
+ readonly stiffness: 1400;
16
+ };
17
+ readonly defaultSpatial: {
18
+ readonly dampingRatio: 0.9;
19
+ readonly stiffness: 700;
20
+ };
21
+ readonly slowSpatial: {
22
+ readonly dampingRatio: 0.9;
23
+ readonly stiffness: 300;
24
+ };
25
+ readonly fastEffects: {
26
+ readonly dampingRatio: 1;
27
+ readonly stiffness: 3800;
28
+ };
29
+ readonly defaultEffects: {
30
+ readonly dampingRatio: 1;
31
+ readonly stiffness: 1600;
32
+ };
33
+ readonly slowEffects: {
34
+ readonly dampingRatio: 1;
35
+ readonly stiffness: 800;
36
+ };
37
+ };
38
+ readonly expressive: {
39
+ readonly fastSpatial: {
40
+ readonly dampingRatio: 0.6;
41
+ readonly stiffness: 800;
42
+ };
43
+ readonly defaultSpatial: {
44
+ readonly dampingRatio: 0.8;
45
+ readonly stiffness: 380;
46
+ };
47
+ readonly slowSpatial: {
48
+ readonly dampingRatio: 0.8;
49
+ readonly stiffness: 200;
50
+ };
51
+ readonly fastEffects: {
52
+ readonly dampingRatio: 1;
53
+ readonly stiffness: 3800;
54
+ };
55
+ readonly defaultEffects: {
56
+ readonly dampingRatio: 1;
57
+ readonly stiffness: 1600;
58
+ };
59
+ readonly slowEffects: {
60
+ readonly dampingRatio: 1;
61
+ readonly stiffness: 800;
62
+ };
63
+ };
64
+ };
65
+ /** Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`) */
66
+ export declare const motionEasings: {
67
+ readonly emphasized: readonly [0.2, 0, 0, 1];
68
+ readonly emphasizedDecelerate: readonly [0.05, 0.7, 0.1, 1];
69
+ readonly emphasizedAccelerate: readonly [0.3, 0, 0.8, 0.15];
70
+ readonly standard: readonly [0.2, 0, 0, 1];
71
+ readonly standardDecelerate: readonly [0, 0, 0, 1];
72
+ readonly standardAccelerate: readonly [0.3, 0, 1, 1];
73
+ readonly legacy: readonly [0.4, 0, 0.2, 1];
74
+ readonly legacyDecelerate: readonly [0, 0, 0.2, 1];
75
+ readonly legacyAccelerate: readonly [0.4, 0, 1, 1];
76
+ readonly linear: readonly [0, 0, 1, 1];
77
+ };
78
+ /** Durations in ms (theme.css has them as `--duration-short-1` … `--duration-extra-long-4`) */
79
+ export declare const motionDurations: {
80
+ readonly short1: 50;
81
+ readonly short2: 100;
82
+ readonly short3: 150;
83
+ readonly short4: 200;
84
+ readonly medium1: 250;
85
+ readonly medium2: 300;
86
+ readonly medium3: 350;
87
+ readonly medium4: 400;
88
+ readonly long1: 450;
89
+ readonly long2: 500;
90
+ readonly long3: 550;
91
+ readonly long4: 600;
92
+ readonly extraLong1: 700;
93
+ readonly extraLong2: 800;
94
+ readonly extraLong3: 900;
95
+ readonly extraLong4: 1000;
96
+ };
97
+ /**
98
+ * A cubic-bezier easing as a function of progress (0–1), e.g. `cubicBezier(...motionEasings.emphasized)`, for
99
+ * JS-driven tweens and for mapping a fraction through a curve
100
+ */
101
+ export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number;
@@ -14,6 +14,11 @@ export declare const SEED_PALETTE = "seed";
14
14
  export interface ActiveSeed extends SeedOptions {
15
15
  seed: string;
16
16
  }
17
+ /**
18
+ * M3's contrast levels. `system` follows the OS (`prefers-contrast: more` → high). Built-in palettes need
19
+ * `@m3ui-vue/m3ui-vue/palettes-contrast` imported for medium and high; seed palettes are regenerated.
20
+ */
21
+ export type ContrastLevel = 'standard' | 'medium' | 'high' | 'system';
17
22
  export declare function useColorPalette(): {
18
23
  palette: import("vue").Ref<string, string>;
19
24
  palettes: Palette[];
@@ -28,6 +33,9 @@ export declare function useColorPalette(): {
28
33
  readonly contrast?: number | undefined;
29
34
  } | null>>;
30
35
  setSeed: (seed: string, options?: SeedOptions) => Promise<void>;
36
+ contrast: Readonly<import("vue").Ref<ContrastLevel, ContrastLevel>>;
37
+ activeContrast: import("vue").ComputedRef<"medium" | "standard" | "high">;
38
+ setContrast: (level: ContrastLevel) => void;
31
39
  persistPalette: import("vue").Ref<boolean, boolean>;
32
40
  setPersistPalette: (enabled: boolean) => void;
33
41
  };
@@ -45,3 +53,5 @@ export declare function __forcePalette(id: string, persist: boolean): void;
45
53
  export declare function __defaultPalette(id: string): void;
46
54
  /** Internal: `createM3UI({ seed })`. */
47
55
  export declare function __defaultSeed(seed: string, options: SeedOptions | undefined, persist: boolean): Promise<void>;
56
+ /** Internal: `createM3UI({ contrast })`, the first-visit default (or forced with `persistPalette: false`). */
57
+ export declare function __defaultContrast(level: ContrastLevel, persist: boolean): void;
@@ -26,6 +26,15 @@ export interface M3Locale {
26
26
  remove: string;
27
27
  selectDate: string;
28
28
  selectTime: string;
29
+ timeHourSelection: string;
30
+ timeMinuteSelection: string;
31
+ timePeriodToggle: string;
32
+ timeToggleKeyboard: string;
33
+ timeToggleDial: string;
34
+ timeToggleScroll: string;
35
+ sheetExpand: string;
36
+ sheetCollapse: string;
37
+ sheetDismiss: string;
29
38
  selectRange: string;
30
39
  pickStart: string;
31
40
  pickEnd: string;
@@ -0,0 +1,16 @@
1
+ import type { Directive } from 'vue';
2
+ /** Options for `v-ripple`. */
3
+ export interface RippleOptions {
4
+ /** No ripple while true (e.g. bound to the element's disabled state). */
5
+ disabled?: boolean;
6
+ /** Any CSS color for the ripple; defaults to the element's text color (`currentColor`). */
7
+ color?: string;
8
+ }
9
+ /** `v-ripple` value: nothing or `true` (on), `false` (off), a CSS color, or an options object. */
10
+ export type RippleValue = boolean | string | RippleOptions | null | undefined;
11
+ /**
12
+ * The M3 press ripple for any element: `<div v-ripple>`, `v-ripple="false"`, `v-ripple="'#e91e63'"`
13
+ * or `v-ripple="{ disabled, color }"`. A statically positioned element is made `position: relative`.
14
+ * Registered globally as `v-ripple` by `createM3UI()`; import `vRipple` to use it without the plugin.
15
+ */
16
+ export declare const vRipple: Directive<HTMLElement, RippleValue>;