@m3ui-vue/m3ui-vue 0.9.1 → 0.9.3
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.
- package/README.md +43 -0
- package/dist/API.md +266 -60
- package/dist/{MIcon-CaEooCmZ.js → MIcon-DLOkQduI.js} +10 -3
- package/dist/MIcon-DLOkQduI.js.map +1 -0
- package/dist/{MTextField-pJU1vFaR.js → MTextField-DKtgPymd.js} +422 -206
- package/dist/MTextField-DKtgPymd.js.map +1 -0
- package/dist/THIRD_PARTY_LICENSES.md +547 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MBox.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +4 -2
- package/dist/components/MButtonGroup.vue.d.ts +2 -0
- package/dist/components/MColorPicker.vue.d.ts +13 -1
- package/dist/components/MColorPickerModal.vue.d.ts +14 -2
- package/dist/components/MDragHandle.vue.d.ts +12 -0
- package/dist/components/MEmojiSelector.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +5 -3
- package/dist/components/MFabMenu.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -0
- package/dist/components/MIconButton.vue.d.ts +15 -1
- package/dist/components/MListItem.vue.d.ts +5 -5
- package/dist/components/MMenuItem.vue.d.ts +17 -4
- package/dist/components/MOverlay.vue.d.ts +1 -1
- package/dist/components/MScrollField.vue.d.ts +40 -0
- package/dist/components/MScrollable.vue.d.ts +9 -0
- package/dist/components/MSplitButton.vue.d.ts +2 -0
- package/dist/components/MSplitter.vue.d.ts +2 -2
- package/dist/components/MSwipeToDismiss.vue.d.ts +49 -0
- package/dist/components/MTabs.vue.d.ts +6 -0
- package/dist/components/MTimePickerModal.vue.d.ts +3 -0
- package/dist/components/MTimeScroll.vue.d.ts +22 -0
- package/dist/components/MToggleButton.vue.d.ts +2 -0
- package/dist/components/MTransition.vue.d.ts +34 -0
- package/dist/components/MTree.vue.d.ts +2 -2
- package/dist/components/MWindow.vue.d.ts +1 -1
- package/dist/components/_MColorPanel.vue.d.ts +18 -0
- package/dist/components/_MDrawerItemList.vue.d.ts +3 -0
- package/dist/composables/_colorUtils.d.ts +34 -0
- package/dist/composables/_themeColor.d.ts +1 -0
- package/dist/composables/_useSpring.d.ts +17 -0
- package/dist/composables/dynamicColor.d.ts +18 -0
- package/dist/composables/useColorPalette.d.ts +27 -0
- package/dist/composables/useLocale.d.ts +16 -0
- package/dist/directives/vRipple.d.ts +16 -0
- package/dist/emoji-names-de-BphO5XpV.js.map +1 -1
- package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -1
- package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -1
- package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -1
- package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -1
- package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -1
- package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -1
- package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/locales/index.js +112 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7443 -6150
- package/dist/m3ui.js.map +1 -1
- package/dist/material-color-utilities-Cktu8DBU.js +3160 -0
- package/dist/material-color-utilities-Cktu8DBU.js.map +1 -0
- package/dist/plugin.d.ts +18 -0
- package/dist/rich-text-editor.js +22 -22
- package/dist/styles/palettes.css +546 -0
- package/dist/styles/theme.css +90 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-Drihe5G2.js → useLocale-Cn9MVIdw.js} +17 -1
- package/dist/useLocale-Cn9MVIdw.js.map +1 -0
- package/package.json +3 -2
- package/src/__tests__/MButtonGroup.test.ts +51 -0
- package/src/__tests__/MColorPicker.test.ts +141 -0
- package/src/__tests__/MDragHandle.test.ts +57 -0
- package/src/__tests__/MIconButton.test.ts +60 -0
- package/src/__tests__/MListItemShape.test.ts +76 -0
- package/src/__tests__/MMenuItem.test.ts +84 -0
- package/src/__tests__/MScrollField.test.ts +69 -0
- package/src/__tests__/MScrollable.test.ts +42 -0
- package/src/__tests__/MSwipeToDismiss.test.ts +104 -0
- package/src/__tests__/MTabs.test.ts +39 -0
- package/src/__tests__/MTimePickerModal.test.ts +52 -0
- package/src/__tests__/MTimeScroll.test.ts +44 -0
- package/src/__tests__/MTransition.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +191 -0
- package/src/__tests__/vRipple.test.ts +92 -0
- package/src/components/MBox.vue +4 -2
- package/src/components/MButton.vue +4 -13
- package/src/components/MButtonGroup.vue +118 -44
- package/src/components/MColorPicker.vue +114 -210
- package/src/components/MColorPickerModal.vue +50 -251
- package/src/components/MDragHandle.vue +54 -0
- package/src/components/MFab.vue +8 -15
- package/src/components/MIcon.vue +4 -2
- package/src/components/MIconButton.vue +96 -24
- package/src/components/MList.vue +33 -3
- package/src/components/MListItem.vue +75 -5
- package/src/components/MMenuItem.vue +115 -13
- package/src/components/MScrollField.vue +310 -0
- package/src/components/MScrollable.vue +160 -5
- package/src/components/MSplitButton.vue +5 -12
- package/src/components/MSplitter.vue +33 -10
- package/src/components/MSwipeToDismiss.vue +247 -0
- package/src/components/MTabs.vue +16 -5
- package/src/components/MTimePickerModal.vue +48 -8
- package/src/components/MTimeScroll.vue +161 -0
- package/src/components/MToggleButton.vue +5 -12
- package/src/components/MTransition.vue +149 -0
- package/src/components/_MColorPanel.vue +478 -0
- package/src/composables/_carouselStrategy.ts +3 -0
- package/src/composables/_colorUtils.ts +107 -0
- package/src/composables/_themeColor.ts +33 -0
- package/src/composables/_useSpring.ts +91 -0
- package/src/composables/dynamicColor.ts +85 -0
- package/src/composables/useColorPalette.ts +171 -25
- package/src/composables/useFieldBg.ts +6 -0
- package/src/composables/useLocale.ts +34 -0
- package/src/data/emoji-names/emoji-names-de.ts +1 -0
- package/src/data/emoji-names/emoji-names-en.ts +1 -0
- package/src/data/emoji-names/emoji-names-es.ts +1 -0
- package/src/data/emoji-names/emoji-names-fr.ts +1 -0
- package/src/data/emoji-names/emoji-names-ja.ts +1 -0
- package/src/data/emoji-names/emoji-names-ko.ts +1 -0
- package/src/data/emoji-names/emoji-names-pt.ts +1 -0
- package/src/data/emoji-names/emoji-names-zh.ts +1 -0
- package/src/data/emojis.ts +1 -0
- package/src/directives/vRipple.ts +73 -0
- package/src/index.ts +14 -1
- package/src/locales/de.ts +16 -0
- package/src/locales/es.ts +16 -0
- package/src/locales/fr.ts +16 -0
- package/src/locales/ja.ts +16 -0
- package/src/locales/ko.ts +16 -0
- package/src/locales/pt.ts +16 -0
- package/src/locales/zh.ts +16 -0
- package/src/plugin.ts +30 -7
- package/src/styles/palettes.css +546 -0
- package/src/styles/theme.css +90 -0
- package/dist/MIcon-CaEooCmZ.js.map +0 -1
- package/dist/MTextField-pJU1vFaR.js.map +0 -1
- package/dist/useLocale-Drihe5G2.js.map +0 -1
|
@@ -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,17 @@
|
|
|
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.FastEffects in the Standard scheme */
|
|
8
|
+
export declare const FAST_EFFECTS: SpringSpec;
|
|
9
|
+
/** MotionSchemeKeyTokens.DefaultEffects in the Standard scheme */
|
|
10
|
+
export declare const DEFAULT_EFFECTS: SpringSpec;
|
|
11
|
+
/** MotionSchemeKeyTokens.DefaultSpatial in the Standard scheme */
|
|
12
|
+
export declare const DEFAULT_SPATIAL: SpringSpec;
|
|
13
|
+
export declare function useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec?: SpringSpec): {
|
|
14
|
+
snap: () => void;
|
|
15
|
+
};
|
|
16
|
+
/** Compose's FastOutSlowInEasing, cubic-bezier(0.4, 0, 0.2, 1) — the easing of a default tween() */
|
|
17
|
+
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>;
|
|
@@ -26,11 +26,27 @@ 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;
|
|
29
35
|
selectRange: string;
|
|
30
36
|
pickStart: string;
|
|
31
37
|
pickEnd: string;
|
|
32
38
|
previousMonth: string;
|
|
33
39
|
nextMonth: string;
|
|
40
|
+
selectColor: string;
|
|
41
|
+
colorHue: string;
|
|
42
|
+
colorSaturation: string;
|
|
43
|
+
colorBrightness: string;
|
|
44
|
+
colorAlpha: string;
|
|
45
|
+
colorEyedropper: string;
|
|
46
|
+
colorOriginal: string;
|
|
47
|
+
colorFormat: string;
|
|
48
|
+
colorRecent: string;
|
|
49
|
+
colorPresets: string;
|
|
34
50
|
dayView: string;
|
|
35
51
|
weekView: string;
|
|
36
52
|
allDay: 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>;
|