@m3ui-vue/m3ui-vue 1.1.3 → 1.2.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.
- package/README.md +1 -1
- package/dist/API.md +579 -40
- package/dist/MMenuItem-DI351kIf.js +929 -0
- package/dist/MMenuItem-DI351kIf.js.map +1 -0
- package/dist/MSlider-BnEy5ieZ.js +1500 -0
- package/dist/MSlider-BnEy5ieZ.js.map +1 -0
- package/dist/MTextField-BBmkaIbO.js +633 -0
- package/dist/MTextField-BBmkaIbO.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/chart.js +83 -49
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAnimatedNumber.vue.d.ts +3 -1
- package/dist/components/MButton.vue.d.ts +9 -1
- package/dist/components/MButtonGroup.vue.d.ts +40 -31
- package/dist/components/MCarousel.vue.d.ts +2 -0
- package/dist/components/MChart.vue.d.ts +6 -0
- package/dist/components/MCircleProgressBar.vue.d.ts +5 -3
- package/dist/components/MContainerTransform.vue.d.ts +59 -0
- package/dist/components/MContextMenu.vue.d.ts +2 -2
- package/dist/components/MCopyButton.vue.d.ts +1 -1
- package/dist/components/MDialog.vue.d.ts +8 -5
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MFabMenu.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MIconButton.vue.d.ts +15 -1
- package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
- package/dist/components/MListItem.vue.d.ts +5 -5
- package/dist/components/MMap.vue.d.ts +20 -2
- package/dist/components/MMapBaseLayers.vue.d.ts +3 -0
- package/dist/components/MMapFilter.vue.d.ts +3 -0
- package/dist/components/MMapLayers.vue.d.ts +3 -0
- package/dist/components/MMenu.vue.d.ts +2 -2
- package/dist/components/MMenuItem.vue.d.ts +7 -3
- package/dist/components/MNavigationDrawer.vue.d.ts +13 -2
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MOverlay.vue.d.ts +12 -1
- package/dist/components/MProgressBar.vue.d.ts +5 -3
- package/dist/components/MPullToRefresh.vue.d.ts +7 -2
- package/dist/components/MRichTextEditor.vue.d.ts +7 -1
- package/dist/components/MSearchField.vue.d.ts +58 -0
- package/dist/components/MSegmentedButton.vue.d.ts +31 -23
- package/dist/components/MSimpleCarousel.vue.d.ts +2 -0
- package/dist/components/MSkeleton.vue.d.ts +6 -3
- package/dist/components/MSplitter.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +5 -1
- package/dist/components/MTimeline.vue.d.ts +85 -22
- package/dist/components/MToolbar.vue.d.ts +32 -5
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
- package/dist/components/_MToolbarFab.vue.d.ts +16 -0
- package/dist/composables/_containerTransform.d.ts +48 -0
- package/dist/composables/_mapStyle.d.ts +13 -0
- package/dist/composables/_themeTransition.d.ts +2 -0
- package/dist/composables/_tooltipTrigger.d.ts +22 -0
- package/dist/composables/_useMenuNav.d.ts +28 -0
- package/dist/composables/useAutoGrow.d.ts +21 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useContainerTransform.d.ts +30 -0
- package/dist/composables/useLocale.d.ts +6 -0
- package/dist/composables/useMap.d.ts +19 -3
- package/dist/composables/useMapFilter.d.ts +4 -1
- package/dist/composables/useMapLayers.d.ts +5 -2
- package/dist/composables/useScrollReveal.d.ts +44 -0
- package/dist/composables/useThemeTokens.d.ts +21 -0
- package/dist/composables/viewportHints.d.ts +27 -0
- package/dist/directives/vClickOutside.d.ts +25 -0
- package/dist/directives/vFocusRing.d.ts +22 -0
- package/dist/directives/vLongPress.d.ts +27 -0
- package/dist/directives/vReveal.d.ts +10 -0
- package/dist/directives/vScrollElevation.d.ts +31 -0
- package/dist/directives/vSkeleton.d.ts +19 -0
- package/dist/directives/vStateLayer.d.ts +20 -0
- package/dist/directives/vSwipe.d.ts +45 -0
- package/dist/directives/vTooltip.d.ts +23 -0
- package/dist/index.d.ts +31 -1
- package/dist/locales/index.js +35 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7692 -6273
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +823 -793
- package/dist/map.js.map +1 -1
- package/dist/motion-DZiXG09o.js +150 -0
- package/dist/motion-DZiXG09o.js.map +1 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/rich-text-editor.js +20 -16
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +63 -0
- package/dist/styles.css +1 -1
- package/dist/{useLocale-SfQHnJfp.js → useLocale-JYxDDeXC.js} +6 -2
- package/dist/useLocale-JYxDDeXC.js.map +1 -0
- package/dist/useThemeTokens-Bv-Uv8eX.js +135 -0
- package/dist/useThemeTokens-Bv-Uv8eX.js.map +1 -0
- package/package.json +2 -1
- package/src/__tests__/MAnimatedNumber.test.ts +24 -2
- package/src/__tests__/MButton.test.ts +22 -0
- package/src/__tests__/MCarousel.test.ts +9 -0
- package/src/__tests__/MChart.test.ts +77 -5
- package/src/__tests__/MContainerTransform.test.ts +279 -0
- package/src/__tests__/MDialog.test.ts +27 -0
- package/src/__tests__/MIconButton.test.ts +33 -0
- package/src/__tests__/MListItemExpandable.test.ts +48 -0
- package/src/__tests__/MListItemShape.test.ts +9 -6
- package/src/__tests__/MListKeyboard.test.ts +90 -0
- package/src/__tests__/MMap.test.ts +53 -1
- package/src/__tests__/MMapLayers.test.ts +46 -2
- package/src/__tests__/MMapTools.test.ts +2 -1
- package/src/__tests__/MMenu.test.ts +104 -1
- package/src/__tests__/MMenuItem.test.ts +18 -0
- package/src/__tests__/MNavigationDrawer.test.ts +80 -0
- package/src/__tests__/MNavigationRail.test.ts +33 -0
- package/src/__tests__/MOverlay.test.ts +49 -0
- package/src/__tests__/MProgressBar.test.ts +41 -0
- package/src/__tests__/MPullToRefresh.test.ts +33 -0
- package/src/__tests__/MRichTextEditor.test.ts +22 -0
- package/src/__tests__/MSearchField.test.ts +71 -0
- package/src/__tests__/MSkeleton.test.ts +38 -0
- package/src/__tests__/MSlider.test.ts +161 -0
- package/src/__tests__/MTimeline.test.ts +238 -0
- package/src/__tests__/MToolbar.test.ts +157 -0
- package/src/__tests__/_fakeMaplibre.ts +3 -1
- package/src/__tests__/attrsFallthrough.test.ts +9 -0
- package/src/__tests__/escapeStack.test.ts +93 -0
- package/src/__tests__/hydration.test.ts +25 -0
- package/src/__tests__/ssr.test.ts +21 -2
- package/src/__tests__/useAutoGrow.test.ts +103 -0
- package/src/__tests__/useScrollReveal.test.ts +102 -0
- package/src/__tests__/useThemeTokens.test.ts +114 -0
- package/src/__tests__/vClickOutside.test.ts +82 -0
- package/src/__tests__/vFocusRing.test.ts +36 -0
- package/src/__tests__/vLongPress.test.ts +81 -0
- package/src/__tests__/vScrollElevation.test.ts +89 -0
- package/src/__tests__/vSkeleton.test.ts +48 -0
- package/src/__tests__/vStateLayer.test.ts +53 -0
- package/src/__tests__/vSwipe.test.ts +93 -0
- package/src/__tests__/vTooltip.test.ts +95 -0
- package/src/__tests__/viewportHints.test.ts +41 -0
- package/src/components/MAnimatedNumber.vue +32 -6
- package/src/components/MAutocomplete.vue +5 -0
- package/src/components/MBottomSheet.vue +4 -1
- package/src/components/MButton.vue +19 -3
- package/src/components/MButtonGroup.vue +22 -17
- package/src/components/MCarousel.vue +7 -1
- package/src/components/MChart.vue +74 -34
- package/src/components/MCircleProgressBar.vue +14 -9
- package/src/components/MCommandPalette.vue +3 -2
- package/src/components/MContainerTransform.vue +321 -0
- package/src/components/MContextMenu.vue +19 -60
- package/src/components/MDialog.vue +31 -6
- package/src/components/MDragDropList.vue +2 -0
- package/src/components/MFab.vue +10 -5
- package/src/components/MIconButton.vue +43 -2
- package/src/components/MKanban.vue +2 -0
- package/src/components/MLightbox.vue +7 -2
- package/src/components/MList.vue +26 -2
- package/src/components/MListItem.vue +138 -84
- package/src/components/MMap.vue +38 -5
- package/src/components/MMapBaseLayers.vue +7 -3
- package/src/components/MMapFilter.vue +7 -4
- package/src/components/MMapGeoJson.vue +1 -1
- package/src/components/MMapLayers.vue +6 -2
- package/src/components/MMapMeasure.vue +5 -2
- package/src/components/MMenu.vue +18 -59
- package/src/components/MMenuItem.vue +11 -2
- package/src/components/MMultiAutocomplete.vue +5 -0
- package/src/components/MNavigationDrawer.vue +96 -11
- package/src/components/MNavigationRail.vue +44 -25
- package/src/components/MOverlay.vue +32 -13
- package/src/components/MProgressBar.vue +25 -27
- package/src/components/MPullToRefresh.vue +20 -1
- package/src/components/MRichTextEditor.vue +19 -5
- package/src/components/MSearchBar.vue +5 -0
- package/src/components/MSearchField.vue +142 -0
- package/src/components/MSegmentedButton.vue +19 -17
- package/src/components/MSelect.vue +10 -1
- package/src/components/MSideSheet.vue +5 -2
- package/src/components/MSimpleCarousel.vue +10 -1
- package/src/components/MSkeleton.vue +30 -8
- package/src/components/MSlider.vue +161 -42
- package/src/components/MSpotlightSearch.vue +3 -2
- package/src/components/MTextField.vue +15 -2
- package/src/components/MTimeline.vue +370 -81
- package/src/components/MToolbar.vue +256 -15
- package/src/components/MTooltip.vue +20 -152
- package/src/components/_MDrawerItemList.vue +25 -6
- package/src/components/_MToolbarFab.vue +14 -0
- package/src/composables/_containerTransform.ts +179 -0
- package/src/composables/_mapStyle.ts +45 -0
- package/src/composables/_themeTransition.ts +2 -0
- package/src/composables/_tooltipTrigger.ts +184 -0
- package/src/composables/_useEscapeStack.ts +2 -0
- package/src/composables/_useMenuNav.ts +209 -0
- package/src/composables/useAutoGrow.ts +78 -0
- package/src/composables/useContainerTransform.ts +59 -0
- package/src/composables/useLocale.ts +10 -0
- package/src/composables/useMap.ts +43 -5
- package/src/composables/useMapFilter.ts +6 -5
- package/src/composables/useMapLayers.ts +7 -6
- package/src/composables/useScrollReveal.ts +151 -0
- package/src/composables/useThemeTokens.ts +116 -0
- package/src/composables/viewportHints.ts +80 -0
- package/src/directives/vClickOutside.ts +90 -0
- package/src/directives/vFocusRing.ts +60 -0
- package/src/directives/vLongPress.ts +134 -0
- package/src/directives/vReveal.ts +57 -0
- package/src/directives/vScrollElevation.ts +116 -0
- package/src/directives/vSkeleton.ts +87 -0
- package/src/directives/vStateLayer.ts +83 -0
- package/src/directives/vSwipe.ts +197 -0
- package/src/directives/vTooltip.ts +128 -0
- package/src/index.ts +31 -1
- package/src/locales/de.ts +4 -0
- package/src/locales/es.ts +4 -0
- package/src/locales/fr.ts +4 -0
- package/src/locales/ja.ts +4 -0
- package/src/locales/ko.ts +4 -0
- package/src/locales/pt.ts +4 -0
- package/src/locales/zh.ts +4 -0
- package/src/map.ts +1 -1
- package/src/plugin.ts +34 -0
- package/src/styles/theme.css +63 -0
- package/dist/MMenuItem-BckcR0nW.js +0 -809
- package/dist/MMenuItem-BckcR0nW.js.map +0 -1
- package/dist/MSlider-LyH_gy8D.js +0 -1411
- package/dist/MSlider-LyH_gy8D.js.map +0 -1
- package/dist/MTextField-FCPOTB0o.js +0 -672
- package/dist/MTextField-FCPOTB0o.js.map +0 -1
- package/dist/composables/_useThemeTokens.d.ts +0 -7
- package/dist/useLocale-SfQHnJfp.js.map +0 -1
- package/src/composables/_useThemeTokens.ts +0 -42
|
@@ -1,34 +1,97 @@
|
|
|
1
1
|
export interface TimelineItem {
|
|
2
|
+
/** Stable key for the entry (defaults to its index): set it when entries are added or removed */
|
|
3
|
+
key?: string | number;
|
|
2
4
|
title: string;
|
|
3
5
|
description?: string;
|
|
4
6
|
date?: string;
|
|
5
7
|
icon?: string;
|
|
6
8
|
color?: "primary" | "secondary" | "tertiary" | "error" | "success";
|
|
9
|
+
/** Any CSS color for the dot (and its line), over `color` */
|
|
7
10
|
dotColor?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Progress of a step: `done` (filled, a solid line to the next), `current` (filled, with a pulsing halo) or
|
|
13
|
+
* `pending` (outlined, a dashed line). Over what the timeline's `current` gives it
|
|
14
|
+
*/
|
|
15
|
+
status?: "done" | "current" | "pending";
|
|
16
|
+
/**
|
|
17
|
+
* A group to show it under ("Today", "Yesterday"): a header goes before each run of consecutive entries with the
|
|
18
|
+
* same group, and the line stops at the end of the run
|
|
19
|
+
*/
|
|
20
|
+
group?: string;
|
|
8
21
|
}
|
|
9
|
-
type
|
|
10
|
-
/** Array of timeline entries — required */
|
|
11
|
-
items: TimelineItem[];
|
|
12
|
-
/** Compact spacing between items */
|
|
13
|
-
dense?: boolean;
|
|
14
|
-
/** Alternate items left/right of a central line instead of a single left-aligned column */
|
|
15
|
-
alternating?: boolean;
|
|
16
|
-
};
|
|
17
|
-
declare var __VLS_7: `item-${number}`, __VLS_8: {
|
|
18
|
-
item: TimelineItem;
|
|
19
|
-
};
|
|
20
|
-
type __VLS_Slots = {} & {
|
|
21
|
-
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
22
|
-
};
|
|
23
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
-
dense: boolean;
|
|
25
|
-
alternating: boolean;
|
|
26
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
export type TimelineStatus = NonNullable<TimelineItem["status"]>;
|
|
28
23
|
declare const _default: typeof __VLS_export;
|
|
29
24
|
export default _default;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
declare const __VLS_export: <T extends TimelineItem = TimelineItem>(__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<{
|
|
26
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
27
|
+
/** Array of timeline entries — required */
|
|
28
|
+
items: T[];
|
|
29
|
+
/** Compact spacing between items */
|
|
30
|
+
dense?: boolean;
|
|
31
|
+
/** Alternate items left/right of a central line instead of a single left-aligned column (vertical only) */
|
|
32
|
+
alternating?: boolean;
|
|
33
|
+
/** Vertical (default) or horizontal: entries side by side along a line, scrolling sideways when they don't fit */
|
|
34
|
+
orientation?: "vertical" | "horizontal";
|
|
35
|
+
/** Leaves each entry's content to the `#item` slot: no title, description or date */
|
|
36
|
+
bare?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Makes it a progress timeline (an order's tracking, a setup's steps): the index of the current step. The ones
|
|
39
|
+
* before are done, the ones after pending; an item's own `status` wins. `items.length` marks them all done
|
|
40
|
+
*/
|
|
41
|
+
current?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Lets the alternating layout fold into a single column (the line on the left, `#opposite` under the content)
|
|
44
|
+
* while the timeline is narrower than 32rem: its own width, so it works in a side column too
|
|
45
|
+
*/
|
|
46
|
+
responsive?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Entries added after it mounts fade and slide in, and the rest move to their new places, on M3 springs (none
|
|
49
|
+
* with reduced motion). Give items a `key`, or an insertion looks like a change to every entry after it
|
|
50
|
+
*/
|
|
51
|
+
animate?: boolean;
|
|
52
|
+
/** Shows only the first entries (a count; groups' headers don't count), with a button for the rest */
|
|
53
|
+
limit?: number;
|
|
54
|
+
/** Whether the entries past `limit` show (v-model:expanded); the timeline keeps its own state otherwise */
|
|
55
|
+
expanded?: boolean;
|
|
56
|
+
} & {
|
|
57
|
+
"onUpdate:expanded"?: ((expanded: boolean) => any) | undefined;
|
|
58
|
+
}> & (typeof globalThis extends {
|
|
59
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
60
|
+
} ? P : {});
|
|
61
|
+
expose: (exposed: {}) => void;
|
|
62
|
+
attrs: any;
|
|
63
|
+
slots: {
|
|
64
|
+
[name: `item-${number}`]: ((props: {
|
|
65
|
+
item: T;
|
|
66
|
+
index: number;
|
|
67
|
+
}) => unknown) | undefined;
|
|
68
|
+
item?: (props: {
|
|
69
|
+
item: T;
|
|
70
|
+
index: number;
|
|
71
|
+
}) => unknown;
|
|
72
|
+
title?: (props: {
|
|
73
|
+
item: T;
|
|
74
|
+
index: number;
|
|
75
|
+
}) => unknown;
|
|
76
|
+
dot?: (props: {
|
|
77
|
+
item: T;
|
|
78
|
+
index: number;
|
|
79
|
+
}) => unknown;
|
|
80
|
+
opposite?: (props: {
|
|
81
|
+
item: T;
|
|
82
|
+
index: number;
|
|
83
|
+
}) => unknown;
|
|
84
|
+
group?: (props: {
|
|
85
|
+
group: string;
|
|
86
|
+
items: T[];
|
|
87
|
+
}) => unknown;
|
|
33
88
|
};
|
|
89
|
+
emit: (evt: "update:expanded", expanded: boolean) => void;
|
|
90
|
+
}>) => import("vue").VNode & {
|
|
91
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
34
92
|
};
|
|
93
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
94
|
+
[K in keyof T]: T[K];
|
|
95
|
+
} : {
|
|
96
|
+
[K in keyof T as K]: T[K];
|
|
97
|
+
}) & {};
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
39
|
+
default?: (props: typeof __VLS_21) => any;
|
|
18
40
|
} & {
|
|
19
|
-
fab?: (props: typeof
|
|
41
|
+
fab?: (props: typeof __VLS_29) => any;
|
|
20
42
|
};
|
|
21
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
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;
|
|
@@ -20,8 +20,8 @@ type __VLS_Slots = {} & {
|
|
|
20
20
|
actions?: (props: typeof __VLS_17) => any;
|
|
21
21
|
};
|
|
22
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
|
-
placement: "top" | "bottom" | "left" | "right";
|
|
24
23
|
delay: number;
|
|
24
|
+
placement: "top" | "bottom" | "left" | "right";
|
|
25
25
|
rich: boolean;
|
|
26
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -20,6 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
20
20
|
toggleItem: (item: DrawerItem) => void;
|
|
21
21
|
selectItem: (item: DrawerItem) => void;
|
|
22
22
|
collapsed: Ref<boolean, boolean>;
|
|
23
|
+
rail: Ref<boolean, boolean>;
|
|
24
|
+
collapsedLabels: Ref<boolean, boolean>;
|
|
23
25
|
}, {}, {}, {
|
|
24
26
|
itemTag(item: DrawerItem): "button" | "RouterLink";
|
|
25
27
|
onClick(item: DrawerItem): void;
|
|
@@ -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,13 @@
|
|
|
1
|
+
import type * as Maplibre from 'maplibre-gl';
|
|
2
|
+
/** The ids a style came with, before anything was added at runtime */
|
|
3
|
+
export interface StyleIds {
|
|
4
|
+
sources: Set<string>;
|
|
5
|
+
layers: Set<string>;
|
|
6
|
+
}
|
|
7
|
+
export declare function styleIds(style: Pick<Maplibre.StyleSpecification, 'sources' | 'layers'> | undefined): StyleIds;
|
|
8
|
+
/**
|
|
9
|
+
* `next` with the runtime sources and layers of `previous` added: layers on top, in their order, unless `keep`
|
|
10
|
+
* says no or the next style has the same id; sources unless the next style has one by that id (it wins, and
|
|
11
|
+
* carried layers use it).
|
|
12
|
+
*/
|
|
13
|
+
export declare function carryRuntimeLayers(previous: Maplibre.StyleSpecification | undefined, next: Maplibre.StyleSpecification, own: StyleIds, keep?: (layer: Maplibre.LayerSpecification) => boolean): Maplibre.StyleSpecification;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
/** How long a theme switch's color transition takes, in ms (both paths) */
|
|
2
|
+
export declare const THEME_TRANSITION_MS = 250;
|
|
1
3
|
/** Runs `apply` (the DOM writes of a theme change) with the theme transition. */
|
|
2
4
|
export declare function themeTransition(apply: () => void): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
2
|
+
/** Where `tip` goes next to `trigger`, kept 6px inside the window */
|
|
3
|
+
export declare function placeTooltip(trigger: HTMLElement, tip: HTMLElement, placement: TooltipPlacement): {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
};
|
|
7
|
+
export interface TooltipTriggerOptions {
|
|
8
|
+
delay: () => number;
|
|
9
|
+
rich?: () => boolean;
|
|
10
|
+
visible: () => boolean;
|
|
11
|
+
open: () => void;
|
|
12
|
+
close: () => void;
|
|
13
|
+
/** The tooltip's element while shown: a touch on it doesn't close a rich tooltip */
|
|
14
|
+
tip: () => HTMLElement | null | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare function createTooltipTrigger(el: HTMLElement, o: TooltipTriggerOptions): {
|
|
17
|
+
/** Keeps it open (the pointer moved onto a rich tooltip) */
|
|
18
|
+
cancel: () => void;
|
|
19
|
+
/** Closes it at once */
|
|
20
|
+
closeNow: () => void;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type MenuNavEntry = {
|
|
2
|
+
icon?: string;
|
|
3
|
+
header?: () => any;
|
|
4
|
+
content?: () => any;
|
|
5
|
+
};
|
|
6
|
+
export declare function useMenuNav(focusFirst: () => void): {
|
|
7
|
+
navStack: import("vue").Ref<{
|
|
8
|
+
icon?: string | undefined;
|
|
9
|
+
header?: (() => any) | undefined;
|
|
10
|
+
content?: (() => any) | undefined;
|
|
11
|
+
}[], MenuNavEntry[] | {
|
|
12
|
+
icon?: string | undefined;
|
|
13
|
+
header?: (() => any) | undefined;
|
|
14
|
+
content?: (() => any) | undefined;
|
|
15
|
+
}[]>;
|
|
16
|
+
currentNav: import("vue").ComputedRef<{
|
|
17
|
+
icon?: string | undefined;
|
|
18
|
+
header?: (() => any) | undefined;
|
|
19
|
+
content?: (() => any) | undefined;
|
|
20
|
+
} | undefined>;
|
|
21
|
+
navBox: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
22
|
+
navSlideEnter: (el: Element, done: () => void) => void;
|
|
23
|
+
navSlideLeave: (el: Element, done: () => void) => void;
|
|
24
|
+
pushNav: (entry: MenuNavEntry) => void;
|
|
25
|
+
popNav: () => void;
|
|
26
|
+
resetNav: () => void;
|
|
27
|
+
onNavPointerDown: (e: PointerEvent) => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, type WatchSource } from 'vue';
|
|
2
|
+
export interface AutoGrowOptions {
|
|
3
|
+
/** Fewest rows it shrinks to (default 1) */
|
|
4
|
+
minRows?: MaybeRefOrGetter<number | undefined>;
|
|
5
|
+
/** Most rows it grows to; past them it scrolls. Unset grows without limit */
|
|
6
|
+
maxRows?: MaybeRefOrGetter<number | undefined>;
|
|
7
|
+
/**
|
|
8
|
+
* The text, when it can change without typing (cleared after sending, an emoji inserted…): a ref or getter, so the
|
|
9
|
+
* height follows. Typing is followed on its own
|
|
10
|
+
*/
|
|
11
|
+
value?: WatchSource<unknown>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Makes a `<textarea>` grow with its text, between `minRows` and `maxRows` rows, scrolling past the last one: a chat
|
|
15
|
+
* composer, a comment box. Works on any textarea, styled however you like (rows are measured from its computed line
|
|
16
|
+
* height, padding and border). It also follows width changes, which rewrap the text. Returns `resize()` for anything
|
|
17
|
+
* else that changes the text.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options?: AutoGrowOptions): {
|
|
20
|
+
resize: () => void;
|
|
21
|
+
};
|
|
@@ -206,7 +206,7 @@ export declare function useColorPalette(): {
|
|
|
206
206
|
} | null>>;
|
|
207
207
|
setSeed: (seed: string, options?: SeedOptions) => Promise<void>;
|
|
208
208
|
contrast: Readonly<Ref<ContrastLevel>>;
|
|
209
|
-
activeContrast: Ref<"
|
|
209
|
+
activeContrast: Ref<"standard" | "medium" | "high", "standard" | "medium" | "high">;
|
|
210
210
|
setContrast: (level: ContrastLevel) => void;
|
|
211
211
|
persistPalette: Ref<boolean, boolean>;
|
|
212
212
|
setPersistPalette: (enabled: boolean) => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentPublicInstance, type Ref, type ShallowRef } from 'vue';
|
|
2
|
+
/** What a container transform opens from: a click (its element), an element, or a component */
|
|
3
|
+
export type ContainerTransformOrigin = Event | Element | ComponentPublicInstance | null | undefined;
|
|
4
|
+
/** The state MContainerTransform plays, shared between the elements that open it and the panel they open */
|
|
5
|
+
export interface ContainerTransformController<T = unknown> {
|
|
6
|
+
/** Whether the expanded view is open (or opening) */
|
|
7
|
+
isOpen: Ref<boolean>;
|
|
8
|
+
/** What `open` was given, for the expanded view to show */
|
|
9
|
+
item: Ref<T | undefined>;
|
|
10
|
+
/** The element it grows from and shrinks back into */
|
|
11
|
+
source: ShallowRef<HTMLElement | null>;
|
|
12
|
+
/** Opens from `origin` (a click's element, an element or a component), with an optional `item` */
|
|
13
|
+
open: (origin?: ContainerTransformOrigin, item?: T) => void;
|
|
14
|
+
/** Shrinks the expanded view back into the element it opened from */
|
|
15
|
+
close: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** The element an origin stands for: a click's `currentTarget` (or `target`), a component's root element */
|
|
18
|
+
export declare function originElement(origin: ContainerTransformOrigin): HTMLElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* Material's container transform for elements that live apart from their expanded view: one controller, many
|
|
21
|
+
* elements opening it (a grid of cards), and one `<MContainerTransform :controller>` wherever the expanded view
|
|
22
|
+
* belongs. `open(event, item)` from a click grows that element into the expanded view, with `item` for it to show.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* const detail = useContainerTransform<Recipe>()
|
|
26
|
+
* // <MCard v-for="r in recipes" @click="detail.open($event, r)">…</MCard>
|
|
27
|
+
* // <MContainerTransform :controller="detail"><template #expanded="{ item }">…</template></MContainerTransform>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useContainerTransform<T = unknown>(): ContainerTransformController<T>;
|
|
@@ -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;
|
|
@@ -190,6 +193,9 @@ export interface M3Locale {
|
|
|
190
193
|
mapDeleteMeasurement: string;
|
|
191
194
|
mapTotal: string;
|
|
192
195
|
mapSearchPlaces: string;
|
|
196
|
+
/** MTimeline's button past `limit`; `{count}` is how many entries are hidden */
|
|
197
|
+
timelineShowMore: string;
|
|
198
|
+
timelineShowLess: string;
|
|
193
199
|
}
|
|
194
200
|
export declare const defaultLocale: M3Locale;
|
|
195
201
|
export declare const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComputedRef, type InjectionKey, type Ref, type ShallowRef } from 'vue';
|
|
1
|
+
import { type ComputedRef, type InjectionKey, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
|
|
2
2
|
import type * as Maplibre from 'maplibre-gl';
|
|
3
3
|
import type { MapLayerModel } from './mapAdapters';
|
|
4
4
|
import type { MapLayerState } from './useMapLayers';
|
|
@@ -23,18 +23,34 @@ export interface MapContext {
|
|
|
23
23
|
activeTool: Ref<string | null>;
|
|
24
24
|
}
|
|
25
25
|
export declare const MAP_KEY: InjectionKey<MapContext>;
|
|
26
|
+
/**
|
|
27
|
+
* A map to use from outside `<MMap>`: the `MMap` itself (a template ref: `<MMap ref="map">` → `:map="map"`) or its
|
|
28
|
+
* `context`. Null or undefined until it mounts.
|
|
29
|
+
*/
|
|
30
|
+
export type MapSource = {
|
|
31
|
+
context: MapContext;
|
|
32
|
+
} | MapContext | null | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Internal: the enclosing MMap's context or, outside one, a context that follows `source` (empty until it's
|
|
35
|
+
* there), provided to the caller's children too. Null when there's neither.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveMapContext(source?: MaybeRefOrGetter<MapSource>): MapContext | null;
|
|
26
38
|
type MapEventType = keyof Maplibre.MapEventType;
|
|
27
39
|
type LayerEventType = keyof Maplibre.MapLayerEventType;
|
|
28
40
|
/**
|
|
29
41
|
* The map of the enclosing `MMap`, for your own controls, layers and handlers (call it in a component inside
|
|
30
|
-
* `MMap`). Listeners added through it are removed when the component unmounts.
|
|
42
|
+
* `MMap`). Listeners added through it are removed when the component unmounts. Outside an `MMap` (a side panel),
|
|
43
|
+
* pass it one: the `MMap`'s template ref, or a getter for it; until it mounts, `map` is undefined and `onReady` waits.
|
|
31
44
|
*
|
|
32
45
|
* ```ts
|
|
33
46
|
* const { map, onLayer } = useMap()
|
|
34
47
|
* onLayer('click', 'parcels-fill', (e) => console.log(e.features?.[0]?.properties))
|
|
48
|
+
*
|
|
49
|
+
* // In a panel next to the map: <MMap ref="mapRef"> … <MyPanel :map="mapRef" />
|
|
50
|
+
* const { map } = useMap(() => props.map)
|
|
35
51
|
* ```
|
|
36
52
|
*/
|
|
37
|
-
export declare function useMap(): {
|
|
53
|
+
export declare function useMap(source?: MaybeRefOrGetter<MapSource>): {
|
|
38
54
|
map: ComputedRef<Maplibre.Map | undefined>;
|
|
39
55
|
maplibre: ComputedRef<MaplibreModule | undefined>;
|
|
40
56
|
styleVersion: ComputedRef<number>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
1
2
|
import type * as Maplibre from 'maplibre-gl';
|
|
3
|
+
import { type MapSource } from './useMap';
|
|
2
4
|
/**
|
|
3
5
|
* Filters for the layers of the enclosing `MMap`, on top of the filters their style already has (a layer that only
|
|
4
6
|
* draws parks keeps doing so): `setFilter(layer, expression)` combines both, `setFilter(layer, null)` brings the
|
|
5
7
|
* style's back. `MMapFilter` is built on it; use it for filters of your own (a range slider, a date, a search…).
|
|
8
|
+
* Outside an `MMap`, pass it one (its template ref), as with `useMap`.
|
|
6
9
|
*/
|
|
7
|
-
export declare function useMapFilter(): {
|
|
10
|
+
export declare function useMapFilter(source?: MaybeRefOrGetter<MapSource>): {
|
|
8
11
|
setFilter: (layerId: string, filter: Maplibre.FilterSpecification | null) => void;
|
|
9
12
|
valuesOf: (layerId: string, property: string) => (string | number)[];
|
|
10
13
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
1
2
|
import type * as Maplibre from 'maplibre-gl';
|
|
3
|
+
import { type MapSource } from './useMap';
|
|
2
4
|
import type { MapLayerInfo, MapLayerModel } from './mapAdapters';
|
|
3
5
|
/** Visibility and opacity of the model's layers, shared by everything inside one `MMap`. */
|
|
4
6
|
export interface MapLayerState {
|
|
@@ -10,9 +12,10 @@ export declare function readLayerState(state: MapLayerState, map: Maplibre.Map,
|
|
|
10
12
|
/**
|
|
11
13
|
* The layers of the enclosing `MMap`'s style as its `adapter` describes them, with their visibility and opacity, for a
|
|
12
14
|
* layer panel or a base layer switcher of your own (`MMapLayers` and `MMapBaseLayers` are built on it). Changes go to
|
|
13
|
-
* the map and to every component using it; a layer's `children` follow it.
|
|
15
|
+
* the map and to every component using it; a layer's `children` follow it. Outside an `MMap`, pass it one (its
|
|
16
|
+
* template ref), as with `useMap`.
|
|
14
17
|
*/
|
|
15
|
-
export declare function useMapLayers(): {
|
|
18
|
+
export declare function useMapLayers(source?: MaybeRefOrGetter<MapSource>): {
|
|
16
19
|
/** The adapter's model (undefined without an `adapter`) */
|
|
17
20
|
model: import("vue").ComputedRef<MapLayerModel | undefined>;
|
|
18
21
|
layers: import("vue").ComputedRef<MapLayerInfo[]>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
/** How an element enters: from below, from a side, growing, or only fading. */
|
|
3
|
+
export type RevealEffect = 'fade-up' | 'fade' | 'scale' | 'slide-left' | 'slide-right';
|
|
4
|
+
export interface ScrollRevealOptions {
|
|
5
|
+
/** How it enters (default `'fade-up'`) */
|
|
6
|
+
effect?: RevealEffect;
|
|
7
|
+
/** Distance in px for the slide effects (default 24) */
|
|
8
|
+
distance?: number;
|
|
9
|
+
/** Delay in ms before it starts (default 0) */
|
|
10
|
+
delay?: number;
|
|
11
|
+
/** Extra delay in ms for each next element revealed at the same time, so a list cascades in (default 60) */
|
|
12
|
+
stagger?: number;
|
|
13
|
+
/** Reveal only the first time (default `true`); with `false` it hides again once it leaves the screen */
|
|
14
|
+
once?: boolean;
|
|
15
|
+
/** How much of the element has to be visible, 0 to 1 (default 0.15) */
|
|
16
|
+
threshold?: number;
|
|
17
|
+
/** Grows or shrinks the area that counts as visible, like IntersectionObserver's `rootMargin` (default `'0px'`) */
|
|
18
|
+
rootMargin?: string;
|
|
19
|
+
/** Motion scheme of the springs: `'standard'` (default) or `'expressive'` (a little bounce) */
|
|
20
|
+
scheme?: 'standard' | 'expressive';
|
|
21
|
+
/** Pace: M3's fast, default or slow springs (default `'default'`); slow suits large, calm entrances */
|
|
22
|
+
speed?: 'fast' | 'default' | 'slow';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Internal engine shared by `useScrollReveal` and `v-reveal`: one IntersectionObserver for a set of options.
|
|
26
|
+
* Elements are hidden (inline opacity/transform) when observed and play the springs in as they enter; the ones
|
|
27
|
+
* entering together cascade by `stagger`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createReveal(options?: ScrollRevealOptions): {
|
|
30
|
+
observe(el: Element): void;
|
|
31
|
+
unobserve(el: Element): void;
|
|
32
|
+
disconnect(): void;
|
|
33
|
+
};
|
|
34
|
+
type Target = Element | null | undefined | Iterable<Element | null | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Reveals elements as they scroll into view: they fade (and slide or grow) in on M3's springs, cascading when
|
|
37
|
+
* several enter together. Pass an element, a template ref, an array of them, or a getter. Off with reduced motion:
|
|
38
|
+
* everything is simply there. For a single element in a template, `v-reveal` does the same.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useScrollReveal(target: MaybeRefOrGetter<Target>, options?: ScrollRevealOptions): {
|
|
41
|
+
/** Stops watching (elements already revealed stay) */
|
|
42
|
+
stop: () => void;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface ThemeTokensOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Updates every animation frame while the theme switch's colors fade, so a canvas redrawn on change fades with
|
|
5
|
+
* the page instead of jumping to the new colors. Off by default: what animates color changes itself (Chart.js,
|
|
6
|
+
* MChart, maps) only needs the final values, and would otherwise redraw ~15 times per switch.
|
|
7
|
+
*/
|
|
8
|
+
live?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The current values of some color tokens (`['primary', 'surface']` → `--color-primary`…), kept up to date across
|
|
12
|
+
* light/dark, palette, contrast and generated (seed) palette changes: for what can't use CSS variables, like a
|
|
13
|
+
* Chart.js dataset, a canvas or a MapLibre layer's paint. Values settle after the theme switch's color transition;
|
|
14
|
+
* with `{ live: true }` they also follow it frame by frame (as `rgba()` midway). Empty strings on the server.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* const colors = useThemeTokens(['primary', 'tertiary', 'outline-variant'] as const)
|
|
18
|
+
* const data = computed(() => ({ datasets: [{ data: sales, borderColor: colors.value.primary }] }))
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useThemeTokens<T extends string>(names: readonly T[], options?: ThemeTokensOptions): Ref<Record<T, string>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** A request's headers as server frameworks hand them over: a `Headers`, or a plain object (Node's, h3's). */
|
|
2
|
+
export type RequestHeaders = Headers | Record<string, string | string[] | undefined>;
|
|
3
|
+
/** A window size, for `createM3UI({ initialState: { viewport } })` */
|
|
4
|
+
export interface ViewportSize {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The client hints that carry the window's size (Chromium), for a server's `Accept-CH` and `Critical-CH` response
|
|
10
|
+
* headers. With `Critical-CH`, Chromium repeats the very first request once to send them; later requests carry them
|
|
11
|
+
* after `Accept-CH` alone.
|
|
12
|
+
*/
|
|
13
|
+
export declare const VIEWPORT_HINTS = "Sec-CH-Viewport-Width, Sec-CH-Viewport-Height";
|
|
14
|
+
/**
|
|
15
|
+
* The window size to server-render the adaptive layouts at, from a request's headers: the size `createM3UI({
|
|
16
|
+
* cookies: true })` keeps in the `m3-viewport` cookie (any visit after the first); the viewport client hints
|
|
17
|
+
* (Chromium, once the server asked for them with `VIEWPORT_HINTS`); or, on a first visit, a size standing for the
|
|
18
|
+
* kind of device (`Sec-CH-UA-Mobile`, then the user agent: a phone, a tablet or a desktop), unless `guess: false`.
|
|
19
|
+
* Undefined when nothing tells: the layouts then render compact.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* createM3UI({ cookies: true, initialState: { viewport: viewportFromHeaders(request.headers) } })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function viewportFromHeaders(headers: RequestHeaders, options?: {
|
|
26
|
+
guess?: boolean;
|
|
27
|
+
}): ViewportSize | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Directive } from 'vue';
|
|
2
|
+
/** Options for `v-click-outside`. */
|
|
3
|
+
export interface ClickOutsideOptions {
|
|
4
|
+
/** Called with the event that landed outside the element. */
|
|
5
|
+
handler?: (event: PointerEvent | MouseEvent) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Elements that count as inside too: elements or CSS selectors (the button that toggles a panel, or a panel's
|
|
8
|
+
* own popup teleported to `<body>`).
|
|
9
|
+
*/
|
|
10
|
+
exclude?: Array<HTMLElement | string | null | undefined>;
|
|
11
|
+
/** `'pointerdown'` (default) reacts as the press starts, like menus; `'click'` once it ends, so a drag out doesn't count. */
|
|
12
|
+
event?: 'pointerdown' | 'click';
|
|
13
|
+
/** Off while true. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** `v-click-outside` value: the handler, or an options object. */
|
|
17
|
+
export type ClickOutsideValue = ((event: PointerEvent | MouseEvent) => void) | ClickOutsideOptions | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Calls a handler when a press lands outside the element: `v-click-outside="close"` or
|
|
20
|
+
* `v-click-outside="{ handler, exclude, event, disabled }"`. `exclude` takes elements or selectors that count
|
|
21
|
+
* as inside (the toggle button, a teleported popup). Only the primary button counts. Starts listening after the
|
|
22
|
+
* event that mounted it, so the click that opened a panel doesn't close it. Registered globally as
|
|
23
|
+
* `v-click-outside` by `createM3UI()`; import `vClickOutside` to use it without the plugin.
|
|
24
|
+
*/
|
|
25
|
+
export declare const vClickOutside: Directive<HTMLElement, ClickOutsideValue>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Directive } from 'vue';
|
|
2
|
+
/** Options for `v-focus-ring`. */
|
|
3
|
+
export interface FocusRingOptions {
|
|
4
|
+
/** No ring while true. */
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Any CSS color or token for the ring; defaults to `var(--color-secondary)`, as M3's focus indicator. */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Draws the ring inside the element's edge instead of 2px outside it, for elements clipped by a parent. */
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
/** Also shows while an element inside it has keyboard focus (a card holding a link or a field). */
|
|
11
|
+
within?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** `v-focus-ring` value: nothing or `true` (on), `false` (off), a CSS color, or an options object. */
|
|
14
|
+
export type FocusRingValue = boolean | string | FocusRingOptions | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The M3 focus indicator on any element: a 3dp ring in `secondary`, 2dp outside the element, shown on keyboard
|
|
17
|
+
* focus only (`:focus-visible`), never on a click or tap. `<div v-focus-ring tabindex="0">`, `v-focus-ring="false"`,
|
|
18
|
+
* `v-focus-ring="'#e91e63'"` or `v-focus-ring="{ disabled, color, inset, within }"`. It wins over an `outline-none`
|
|
19
|
+
* class on the same element. Registered globally as `v-focus-ring` by `createM3UI()`; import `vFocusRing` to use
|
|
20
|
+
* it without the plugin.
|
|
21
|
+
*/
|
|
22
|
+
export declare const vFocusRing: Directive<HTMLElement, FocusRingValue>;
|