@m3ui-vue/m3ui-vue 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +41 -0
  2. package/dist/API.md +199 -54
  3. package/dist/{MTextField-pJU1vFaR.js → MTextField-Ck0oWDMk.js} +8 -2
  4. package/dist/MTextField-Ck0oWDMk.js.map +1 -0
  5. package/dist/api.json +1 -1
  6. package/dist/code-editor.js +1 -1
  7. package/dist/components/MBox.vue.d.ts +3 -3
  8. package/dist/components/MColorPicker.vue.d.ts +13 -1
  9. package/dist/components/MColorPickerModal.vue.d.ts +14 -2
  10. package/dist/components/MDragHandle.vue.d.ts +12 -0
  11. package/dist/components/MEmojiSelector.vue.d.ts +1 -1
  12. package/dist/components/MFab.vue.d.ts +1 -1
  13. package/dist/components/MFabMenu.vue.d.ts +1 -1
  14. package/dist/components/MListItem.vue.d.ts +5 -5
  15. package/dist/components/MOverlay.vue.d.ts +1 -1
  16. package/dist/components/MScrollField.vue.d.ts +40 -0
  17. package/dist/components/MScrollable.vue.d.ts +9 -0
  18. package/dist/components/MSplitter.vue.d.ts +2 -2
  19. package/dist/components/MSwipeToDismiss.vue.d.ts +49 -0
  20. package/dist/components/MTransition.vue.d.ts +34 -0
  21. package/dist/components/MWindow.vue.d.ts +1 -1
  22. package/dist/components/_MColorPanel.vue.d.ts +18 -0
  23. package/dist/composables/_colorUtils.d.ts +34 -0
  24. package/dist/composables/_themeColor.d.ts +1 -0
  25. package/dist/composables/_useSpring.d.ts +15 -0
  26. package/dist/composables/dynamicColor.d.ts +18 -0
  27. package/dist/composables/useColorPalette.d.ts +27 -0
  28. package/dist/composables/useLocale.d.ts +10 -0
  29. package/dist/index.d.ts +9 -1
  30. package/dist/locales/index.js +70 -0
  31. package/dist/locales/index.js.map +1 -1
  32. package/dist/m3ui-vue.css +1 -1
  33. package/dist/m3ui.js +4808 -3622
  34. package/dist/m3ui.js.map +1 -1
  35. package/dist/material-color-utilities-Cktu8DBU.js +3160 -0
  36. package/dist/material-color-utilities-Cktu8DBU.js.map +1 -0
  37. package/dist/plugin.d.ts +18 -0
  38. package/dist/rich-text-editor.js +2 -2
  39. package/dist/styles/palettes.css +546 -0
  40. package/dist/styles/theme.css +77 -0
  41. package/dist/styles.css +1 -1
  42. package/dist/{useLocale-Drihe5G2.js → useLocale-CFW8cIzL.js} +11 -1
  43. package/dist/useLocale-CFW8cIzL.js.map +1 -0
  44. package/package.json +2 -1
  45. package/src/__tests__/MButtonGroup.test.ts +51 -0
  46. package/src/__tests__/MColorPicker.test.ts +141 -0
  47. package/src/__tests__/MDragHandle.test.ts +57 -0
  48. package/src/__tests__/MListItemShape.test.ts +76 -0
  49. package/src/__tests__/MScrollField.test.ts +41 -0
  50. package/src/__tests__/MScrollable.test.ts +42 -0
  51. package/src/__tests__/MSwipeToDismiss.test.ts +104 -0
  52. package/src/__tests__/MTransition.test.ts +27 -0
  53. package/src/__tests__/dynamicColor.test.ts +191 -0
  54. package/src/components/MBox.vue +4 -2
  55. package/src/components/MButtonGroup.vue +116 -35
  56. package/src/components/MColorPicker.vue +114 -210
  57. package/src/components/MColorPickerModal.vue +50 -251
  58. package/src/components/MDragHandle.vue +54 -0
  59. package/src/components/MList.vue +33 -3
  60. package/src/components/MListItem.vue +75 -5
  61. package/src/components/MScrollField.vue +302 -0
  62. package/src/components/MScrollable.vue +160 -5
  63. package/src/components/MSplitter.vue +33 -10
  64. package/src/components/MSwipeToDismiss.vue +247 -0
  65. package/src/components/MTransition.vue +149 -0
  66. package/src/components/_MColorPanel.vue +478 -0
  67. package/src/composables/_colorUtils.ts +107 -0
  68. package/src/composables/_themeColor.ts +33 -0
  69. package/src/composables/_useSpring.ts +89 -0
  70. package/src/composables/dynamicColor.ts +85 -0
  71. package/src/composables/useColorPalette.ts +171 -25
  72. package/src/composables/useFieldBg.ts +6 -0
  73. package/src/composables/useLocale.ts +22 -0
  74. package/src/index.ts +9 -1
  75. package/src/locales/de.ts +10 -0
  76. package/src/locales/es.ts +10 -0
  77. package/src/locales/fr.ts +10 -0
  78. package/src/locales/ja.ts +10 -0
  79. package/src/locales/ko.ts +10 -0
  80. package/src/locales/pt.ts +10 -0
  81. package/src/locales/zh.ts +10 -0
  82. package/src/plugin.ts +28 -7
  83. package/src/styles/palettes.css +546 -0
  84. package/src/styles/theme.css +77 -0
  85. package/dist/MTextField-pJU1vFaR.js.map +0 -1
  86. package/dist/useLocale-Drihe5G2.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-Drihe5G2.js";
1
+ import { i as e } from "./useLocale-CFW8cIzL.js";
2
2
  import { t } from "./MIcon-CaEooCmZ.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,8 +5,8 @@ type __VLS_Props = {
5
5
  padding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
6
  /** Border radius */
7
7
  rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
8
- /** Shadow elevation level */
9
- elevation?: 0 | 1 | 2 | 3;
8
+ /** Shadow elevation level (M3 levels 0–5) */
9
+ elevation?: 0 | 1 | 2 | 3 | 4 | 5;
10
10
  /** Show border */
11
11
  border?: boolean;
12
12
  /** HTML tag to render */
@@ -20,7 +20,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
20
20
  tag: string;
21
21
  rounded: "none" | "sm" | "md" | "lg" | "xl" | "full";
22
22
  padding: "none" | "xs" | "sm" | "md" | "lg" | "xl";
23
- elevation: 0 | 1 | 2 | 3;
23
+ elevation: 0 | 1 | 2 | 3 | 4 | 5;
24
24
  border: boolean;
25
25
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,10 +1,18 @@
1
1
  type __VLS_Props = {
2
- /** Selected color in hex format (v-model) */
2
+ /** Selected color in hex format (v-model). `#rrggbb`, or `#rrggbbaa` when `alpha` is on and the color isn't opaque. */
3
3
  modelValue: string;
4
4
  /** Field label */
5
5
  label?: string;
6
6
  /** Preset color swatches shown in the panel */
7
7
  presets?: string[];
8
+ /** Adds an opacity slider and an alpha channel to the value */
9
+ alpha?: boolean;
10
+ /** Remember picked colors and show them above the presets (stored in localStorage, shared by every picker). */
11
+ recent?: boolean;
12
+ /** How many recent colors to keep. */
13
+ recentLimit?: number;
14
+ /** Show a button to pick a color from the screen, where the browser supports it (Chrome, Edge). */
15
+ eyedropper?: boolean;
8
16
  /** Disables the picker */
9
17
  disabled?: boolean;
10
18
  /** Error state */
@@ -22,6 +30,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
22
30
  "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
23
31
  }>, {
24
32
  presets: string[];
33
+ alpha: boolean;
34
+ recent: boolean;
35
+ eyedropper: boolean;
36
+ recentLimit: number;
25
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
38
  declare const _default: typeof __VLS_export;
27
39
  export default _default;
@@ -1,12 +1,20 @@
1
1
  type __VLS_Props = {
2
- /** Selected color in hex format (v-model) */
2
+ /** Selected color in hex format (v-model). `#rrggbb`, or `#rrggbbaa` when `alpha` is on and the color isn't opaque. */
3
3
  modelValue: string;
4
4
  /** Controls dialog visibility (v-model:show) */
5
5
  show?: boolean;
6
6
  /** Preset color swatches shown in the dialog */
7
7
  presets?: string[];
8
- /** Dialog title */
8
+ /** Dialog title; defaults to the locale's `selectColor` */
9
9
  title?: string;
10
+ /** Adds an opacity slider and an alpha channel to the value */
11
+ alpha?: boolean;
12
+ /** Remember confirmed colors and show them above the presets (stored in localStorage, shared by every picker). */
13
+ recent?: boolean;
14
+ /** How many recent colors to keep. */
15
+ recentLimit?: number;
16
+ /** Show a button to pick a color from the screen, where the browser supports it (Chrome, Edge). */
17
+ eyedropper?: boolean;
10
18
  };
11
19
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
20
  "update:modelValue": (args_0: string) => any;
@@ -17,6 +25,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
17
25
  }>, {
18
26
  show: boolean;
19
27
  presets: string[];
28
+ alpha: boolean;
29
+ recent: boolean;
30
+ eyedropper: boolean;
31
+ recentLimit: number;
20
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
33
  declare const _default: typeof __VLS_export;
22
34
  export default _default;
@@ -0,0 +1,12 @@
1
+ type __VLS_Props = {
2
+ /** `vertical` is a tall capsule for horizontal drags (between side-by-side panes); `horizontal` is a wide one for vertical drags. */
3
+ orientation?: 'vertical' | 'horizontal';
4
+ /** Show the dragged look (the parent is dragging) */
5
+ dragging?: boolean;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ orientation: "vertical" | "horizontal";
9
+ dragging: boolean;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -27,9 +27,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
27
27
  }>, {
28
28
  height: string;
29
29
  search: boolean;
30
- emojiSize: number;
31
30
  recent: boolean;
32
31
  recentLimit: number;
32
+ emojiSize: number;
33
33
  skinTones: boolean;
34
34
  preview: boolean;
35
35
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -56,11 +56,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
56
56
  }>, {
57
57
  color: "primary" | "secondary" | "tertiary" | "surface";
58
58
  size: "small" | "regular" | "medium" | "large";
59
+ scrim: boolean;
59
60
  disabled: boolean;
60
61
  persistent: boolean;
61
62
  direction: "up" | "down" | "left" | "right" | "radial";
62
63
  align: "start" | "end";
63
- scrim: boolean;
64
64
  contentTransition: "scale" | "fade" | "none";
65
65
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
66
66
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -40,12 +40,12 @@ type __VLS_Props = {
40
40
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
41
41
  color: "primary" | "secondary" | "tertiary" | "surface";
42
42
  size: "small" | "regular" | "large";
43
+ scrim: boolean;
43
44
  disabled: boolean;
44
45
  itemSize: "small" | "regular" | "large";
45
46
  persistent: boolean;
46
47
  direction: "up" | "down";
47
48
  align: "start" | "end";
48
- scrim: boolean;
49
49
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
50
  declare const _default: typeof __VLS_export;
51
51
  export default _default;
@@ -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_34: {}, __VLS_56: {}, __VLS_58: {}, __VLS_60: {};
51
+ declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {}, __VLS_23: {}, __VLS_42: {}, __VLS_64: {}, __VLS_66: {}, __VLS_68: {};
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_34) => any;
61
+ leading?: (props: typeof __VLS_42) => any;
62
62
  } & {
63
- overline?: (props: typeof __VLS_56) => any;
63
+ overline?: (props: typeof __VLS_64) => any;
64
64
  } & {
65
- default?: (props: typeof __VLS_58) => any;
65
+ default?: (props: typeof __VLS_66) => any;
66
66
  } & {
67
- trailing?: (props: typeof __VLS_60) => any;
67
+ trailing?: (props: typeof __VLS_68) => 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;
@@ -16,8 +16,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
16
16
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
17
17
  }>, {
18
18
  modelValue: boolean;
19
- zIndex: number;
20
19
  scrim: boolean;
20
+ zIndex: number;
21
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
23
  declare const _default: typeof __VLS_export;
@@ -0,0 +1,40 @@
1
+ type __VLS_Props = {
2
+ /** Index of the selected item, 0 to count - 1 (v-model) */
3
+ modelValue: number;
4
+ /** Number of items; the wheel wraps around after the last one */
5
+ count: number;
6
+ /**
7
+ * Accessible name of the field. Include the range when it isn't obvious ("Select year between 2000 and
8
+ * 2025"): the wheel wraps, so screen readers can't tell where it ends.
9
+ */
10
+ label?: string;
11
+ /** Text for each item (also what screen readers announce). Defaults to the index with at least 2 digits. */
12
+ format?: (index: number) => string;
13
+ /** Height in px; three items fit in the default 200 (ScrollFieldDefaults.ScrollFieldHeight) */
14
+ height?: number;
15
+ /** Disables the field */
16
+ disabled?: boolean;
17
+ };
18
+ type __VLS_Slots = {
19
+ item?: (props: {
20
+ index: number;
21
+ selected: boolean;
22
+ }) => unknown;
23
+ };
24
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ "update:modelValue": (args_0: number) => any;
26
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
27
+ "onUpdate:modelValue"?: ((args_0: number) => any) | undefined;
28
+ }>, {
29
+ format: (index: number) => string;
30
+ height: number;
31
+ disabled: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -5,6 +5,13 @@ type __VLS_Props = {
5
5
  height?: string;
6
6
  /** Maximum height (CSS value) */
7
7
  maxHeight?: string;
8
+ /**
9
+ * `native`: the browser's scrollbar. `indicator`: M3's thin scrollbar, visual only (scroll with the wheel,
10
+ * touch or keys). `none`: no scrollbar at all.
11
+ */
12
+ scrollbar?: 'native' | 'indicator' | 'none';
13
+ /** With `scrollbar="indicator"`: show it only while scrolling, fading out after (false keeps it visible) */
14
+ scrollbarFade?: boolean;
8
15
  };
9
16
  declare var __VLS_1: {};
10
17
  type __VLS_Slots = {} & {
@@ -12,6 +19,8 @@ type __VLS_Slots = {} & {
12
19
  };
13
20
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
21
  direction: "vertical" | "horizontal" | "both";
22
+ scrollbar: "native" | "indicator" | "none";
23
+ scrollbarFade: boolean;
15
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
17
26
  declare const _default: typeof __VLS_export;
@@ -8,11 +8,11 @@ type __VLS_Props = {
8
8
  /** Maximum panel percentage */
9
9
  max?: number;
10
10
  };
11
- declare var __VLS_1: {}, __VLS_3: {};
11
+ declare var __VLS_1: {}, __VLS_8: {};
12
12
  type __VLS_Slots = {} & {
13
13
  first?: (props: typeof __VLS_1) => any;
14
14
  } & {
15
- second?: (props: typeof __VLS_3) => any;
15
+ second?: (props: typeof __VLS_8) => any;
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;
@@ -0,0 +1,49 @@
1
+ export type SwipeToDismissValue = 'settled' | 'start-to-end' | 'end-to-start';
2
+ type __VLS_Props = {
3
+ /** State (v-model): `'settled'`, or dismissed towards `'start-to-end'` / `'end-to-start'`. Set it to animate there. */
4
+ modelValue?: SwipeToDismissValue;
5
+ /** Allow dismissing by swiping in the reading direction (right in LTR) */
6
+ startToEnd?: boolean;
7
+ /** Allow dismissing by swiping against the reading direction (left in LTR) */
8
+ endToStart?: boolean;
9
+ /** Turns the swipe gesture off (setting v-model still works) */
10
+ disabled?: boolean;
11
+ /** How far, in px, the content has to move before releasing dismisses it (SwipeToDismissBoxDefaults: 56dp) */
12
+ threshold?: number;
13
+ };
14
+ declare var __VLS_1: {
15
+ direction: SwipeToDismissValue;
16
+ target: SwipeToDismissValue;
17
+ progress: number;
18
+ }, __VLS_3: {};
19
+ type __VLS_Slots = {} & {
20
+ background?: (props: typeof __VLS_1) => any;
21
+ } & {
22
+ default?: (props: typeof __VLS_3) => any;
23
+ };
24
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
25
+ /** Animates back to `'settled'` */
26
+ reset: () => void;
27
+ /** Animates away in the given direction */
28
+ dismiss: (dir: Exclude<SwipeToDismissValue, "settled">) => void;
29
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ "update:modelValue": (args_0: SwipeToDismissValue) => any;
31
+ dismiss: (args_0: "start-to-end" | "end-to-start") => any;
32
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
33
+ "onUpdate:modelValue"?: ((args_0: SwipeToDismissValue) => any) | undefined;
34
+ onDismiss?: ((args_0: "start-to-end" | "end-to-start") => any) | undefined;
35
+ }>, {
36
+ modelValue: SwipeToDismissValue;
37
+ disabled: boolean;
38
+ threshold: number;
39
+ startToEnd: boolean;
40
+ endToStart: boolean;
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * M3's navigation transitions between two views (a port of Compose's `MaterialTransitions`): `shared-axis`
3
+ * slides the new view in from the side as the old one slides out (use `reverse` when going back), and
4
+ * `fade-through` fades the old view out and the new one in with a slight scale, for destinations without a
5
+ * spatial relationship such as navigation bar tabs. Wrap content that changes its `key` (or a `v-if`/`v-else`
6
+ * pair, or a `<RouterView>` slot's component); both views overlap while they animate.
7
+ *
8
+ * @slot default The current view; give it a `key` that changes with it
9
+ */
10
+ type __VLS_Props = {
11
+ /** `shared-axis` (horizontal, for forward/back navigation) or `fade-through` (unrelated destinations) */
12
+ type?: 'shared-axis' | 'fade-through';
13
+ /** Shared axis: play the backward transition (the new view comes from the start side) */
14
+ reverse?: boolean;
15
+ /** Animate the first view too */
16
+ appear?: boolean;
17
+ };
18
+ declare var __VLS_12: {};
19
+ type __VLS_Slots = {} & {
20
+ default?: (props: typeof __VLS_12) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
23
+ reverse: boolean;
24
+ type: "shared-axis" | "fade-through";
25
+ appear: boolean;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -120,8 +120,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
120
120
  maximizable: boolean;
121
121
  draggable: boolean;
122
122
  minWidth: number;
123
- resizable: boolean;
124
123
  snap: boolean;
124
+ resizable: boolean;
125
125
  offscreen: boolean;
126
126
  resetPosition: boolean;
127
127
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -0,0 +1,18 @@
1
+ type __VLS_Props = {
2
+ modelValue: string;
3
+ presets: string[];
4
+ alpha: boolean;
5
+ recent: boolean;
6
+ eyedropper: boolean;
7
+ /** Shown as the left half of the preview, click to restore */
8
+ original?: string;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
11
+ focus: () => void | undefined;
12
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (args_0: string) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
16
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare const _default: typeof __VLS_export;
18
+ export default _default;
@@ -0,0 +1,34 @@
1
+ export interface Rgba {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ a: number;
6
+ }
7
+ /** h 0–360, s/v 0–100 */
8
+ export interface Hsv {
9
+ h: number;
10
+ s: number;
11
+ v: number;
12
+ }
13
+ /** h 0–360, s/l 0–100 */
14
+ export interface Hsl {
15
+ h: number;
16
+ s: number;
17
+ l: number;
18
+ }
19
+ /** Parses `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa` (the `#` is optional). r/g/b 0–255, a 0–1. */
20
+ export declare function parseHex(input: string): Rgba | null;
21
+ /** `#rrggbb`, or `#rrggbbaa` when a < 1. Lowercase. */
22
+ export declare function toHex({ r, g, b, a }: Rgba): string;
23
+ /** Lowercase canonical form of a hex string, or '' when it isn't one. */
24
+ export declare function normalizeHex(input: string): string;
25
+ export declare function rgbToHsv({ r, g, b }: Rgba): Hsv;
26
+ export declare function hsvToRgb({ h, s, v }: Hsv, a?: number): Rgba;
27
+ export declare function hsvToHsl({ h, s, v }: Hsv): Hsl;
28
+ export declare function hslToHsv({ h, s, l }: Hsl): Hsv;
29
+ /** Black or white, whichever reads better on the color (WCAG relative luminance). */
30
+ export declare function inkFor(hex: string): '#000000' | '#ffffff';
31
+ export declare const recentColors: import("vue").Ref<string[], string[]>;
32
+ export declare function pushRecentColor(hex: string, limit: number): void;
33
+ /** Default swatches for both pickers: the Material 2014 palette's 500 tones plus grey, black and white (3 rows of 7) */
34
+ export declare const defaultColorPresets: string[];
@@ -0,0 +1 @@
1
+ export declare function syncThemeColor(role: string): void;
@@ -0,0 +1,15 @@
1
+ export interface SpringSpec {
2
+ dampingRatio: number;
3
+ stiffness: number;
4
+ }
5
+ /** MotionSchemeKeyTokens.FastSpatial in the Standard scheme (StandardMotionTokens.SpringFastSpatial*) */
6
+ export declare const FAST_SPATIAL: SpringSpec;
7
+ /** MotionSchemeKeyTokens.DefaultEffects in the Standard scheme */
8
+ export declare const DEFAULT_EFFECTS: SpringSpec;
9
+ /** MotionSchemeKeyTokens.DefaultSpatial in the Standard scheme */
10
+ export declare const DEFAULT_SPATIAL: SpringSpec;
11
+ export declare function useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec?: SpringSpec): {
12
+ snap: () => void;
13
+ };
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;
@@ -0,0 +1,18 @@
1
+ export type SchemeVariant = 'tonal-spot' | 'expressive' | 'vibrant' | 'fidelity' | 'content' | 'neutral' | 'monochrome' | 'rainbow' | 'fruit-salad';
2
+ export interface SeedOptions {
3
+ /** How the seed spreads into the scheme. `tonal-spot` is Android's default (calm, seed-led). */
4
+ variant?: SchemeVariant;
5
+ /** Contrast level: 0 standard, 0.5 medium, 1 high (-1 reduced). */
6
+ contrast?: number;
7
+ }
8
+ /** Token name (as in `--color-<name>`) → hex, for each scheme. */
9
+ export interface GeneratedScheme {
10
+ light: Record<string, string>;
11
+ dark: Record<string, string>;
12
+ }
13
+ /** The `--color-*` roles a generated scheme sets. `success*` is a library extension and stays as themed. */
14
+ export declare const 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"];
15
+ /** Generates the light and dark schemes for a seed color (`#rrggbb`). */
16
+ export declare function generateScheme(seed: string, options?: SeedOptions): Promise<GeneratedScheme>;
17
+ /** CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css. */
18
+ export declare function schemeToCss(scheme: GeneratedScheme, id: string): string;
@@ -1,13 +1,33 @@
1
+ import { type SeedOptions } from './dynamicColor';
1
2
  export interface Palette {
2
3
  id: string;
3
4
  label: string;
5
+ /**
6
+ * The palette's key color. A custom palette (`createM3UI({ customPalettes })`) with no CSS of its own gets its
7
+ * scheme generated from it; one with `[data-palette='<id>']` rules keeps them.
8
+ */
4
9
  seed: string;
5
10
  }
6
11
  export declare const palettes: Palette[];
12
+ /** The palette id used while a seed color is active (`useColorPalette().setSeed()`). */
13
+ export declare const SEED_PALETTE = "seed";
14
+ export interface ActiveSeed extends SeedOptions {
15
+ seed: string;
16
+ }
7
17
  export declare function useColorPalette(): {
8
18
  palette: import("vue").Ref<string, string>;
9
19
  palettes: Palette[];
10
20
  set: (id: string) => void;
21
+ seed: Readonly<import("vue").Ref<{
22
+ readonly seed: string;
23
+ readonly variant?: import("./dynamicColor").SchemeVariant | undefined;
24
+ readonly contrast?: number | undefined;
25
+ } | null, {
26
+ readonly seed: string;
27
+ readonly variant?: import("./dynamicColor").SchemeVariant | undefined;
28
+ readonly contrast?: number | undefined;
29
+ } | null>>;
30
+ setSeed: (seed: string, options?: SeedOptions) => Promise<void>;
11
31
  persistPalette: import("vue").Ref<boolean, boolean>;
12
32
  setPersistPalette: (enabled: boolean) => void;
13
33
  };
@@ -18,3 +38,10 @@ export declare function useColorPalette(): {
18
38
  * Not exported from the package's public entry points.
19
39
  */
20
40
  export declare function __forcePalette(id: string, persist: boolean): void;
41
+ /**
42
+ * Internal: `createM3UI({ palette })`'s first-visit default. Sets `current` too, so a later `useColorPalette()`
43
+ * doesn't write its stale initial value back over it.
44
+ */
45
+ export declare function __defaultPalette(id: string): void;
46
+ /** Internal: `createM3UI({ seed })`. */
47
+ export declare function __defaultSeed(seed: string, options: SeedOptions | undefined, persist: boolean): Promise<void>;
@@ -31,6 +31,16 @@ export interface M3Locale {
31
31
  pickEnd: string;
32
32
  previousMonth: string;
33
33
  nextMonth: string;
34
+ selectColor: string;
35
+ colorHue: string;
36
+ colorSaturation: string;
37
+ colorBrightness: string;
38
+ colorAlpha: string;
39
+ colorEyedropper: string;
40
+ colorOriginal: string;
41
+ colorFormat: string;
42
+ colorRecent: string;
43
+ colorPresets: string;
34
44
  dayView: string;
35
45
  weekView: string;
36
46
  allDay: string;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,10 @@ export type { M3UIOptions } from './plugin';
3
3
  export { useTheme } from './composables/useTheme';
4
4
  export type { Theme } from './composables/useTheme';
5
5
  export { useColorPalette, palettes } from './composables/useColorPalette';
6
- export type { Palette } from './composables/useColorPalette';
6
+ export type { Palette, ActiveSeed } from './composables/useColorPalette';
7
+ export { SEED_PALETTE } from './composables/useColorPalette';
8
+ export { generateScheme, schemeToCss, schemeRoles } from './composables/dynamicColor';
9
+ export type { SchemeVariant, SeedOptions, GeneratedScheme } from './composables/dynamicColor';
7
10
  export { useToast } from './composables/useToast';
8
11
  export type { Toast, ToastVariant, ToastPosition, ToastAction, ToastOptions } from './composables/useToast';
9
12
  export { useFieldBg } from './composables/useFieldBg';
@@ -53,6 +56,7 @@ export { default as MDateRangePicker } from './components/MDateRangePicker.vue';
53
56
  export { default as MDateRangePickerModal } from './components/MDateRangePickerModal.vue';
54
57
  export { default as MDialog } from './components/MDialog.vue';
55
58
  export { default as MDivider } from './components/MDivider.vue';
59
+ export { default as MDragHandle } from './components/MDragHandle.vue';
56
60
  export { default as MDragDropList } from './components/MDragDropList.vue';
57
61
  export { default as MEmoji } from './components/MEmoji.vue';
58
62
  export { default as MEmojiButton } from './components/MEmojiButton.vue';
@@ -120,6 +124,7 @@ export { default as MScrollable } from './components/MScrollable.vue';
120
124
  export { default as MSearchBar } from './components/MSearchBar.vue';
121
125
  export { default as MSection } from './components/MSection.vue';
122
126
  export { default as MSegmentedButton } from './components/MSegmentedButton.vue';
127
+ export { default as MScrollField } from './components/MScrollField.vue';
123
128
  export { default as MSelect } from './components/MSelect.vue';
124
129
  export type { SelectOption } from './components/MSelect.vue';
125
130
  export { default as MShader } from './components/MShader.vue';
@@ -146,6 +151,8 @@ export { default as MStatCard } from './components/MStatCard.vue';
146
151
  export { default as MStepper } from './components/MStepper.vue';
147
152
  export { default as MSticky } from './components/MSticky.vue';
148
153
  export { default as MSubtitle } from './components/MSubtitle.vue';
154
+ export { default as MSwipeToDismiss } from './components/MSwipeToDismiss.vue';
155
+ export type { SwipeToDismissValue } from './components/MSwipeToDismiss.vue';
149
156
  export { default as MSwitch } from './components/MSwitch.vue';
150
157
  export { default as MTable } from './components/MTable.vue';
151
158
  export { default as MTagInput } from './components/MTagInput.vue';
@@ -163,6 +170,7 @@ export { default as MTopAppBar } from './components/MTopAppBar.vue';
163
170
  export { default as MTour } from './components/MTour.vue';
164
171
  export { default as MTransferList } from './components/MTransferList.vue';
165
172
  export { default as MTree } from './components/MTree.vue';
173
+ export { default as MTransition } from './components/MTransition.vue';
166
174
  export { default as MTreeTable } from './components/MTreeTable.vue';
167
175
  export { default as MVirtualTable } from './components/MVirtualTable.vue';
168
176
  export { default as MWindow } from './components/MWindow.vue';