@m3ui-vue/m3ui-vue 1.10.2 → 1.11.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 +19 -4
- package/dist/API.md +195 -56
- package/dist/MButton-gWoOzFWf.js +284 -0
- package/dist/MButton-gWoOzFWf.js.map +1 -0
- package/dist/MColorPickerModal-CJYMvlgK.js +466 -0
- package/dist/MColorPickerModal-CJYMvlgK.js.map +1 -0
- package/dist/MDialog-CU8EYgCC.js +226 -0
- package/dist/MDialog-CU8EYgCC.js.map +1 -0
- package/dist/{MIcon-BSsJZhK7.js → MIcon-CkUc9kuQ.js} +10 -4
- package/dist/MIcon-CkUc9kuQ.js.map +1 -0
- package/dist/MIconButton-DTFOfsTy.js +317 -0
- package/dist/MIconButton-DTFOfsTy.js.map +1 -0
- package/dist/MListItem-Cdw2FqCT.js +1306 -0
- package/dist/MListItem-Cdw2FqCT.js.map +1 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js +115 -0
- package/dist/MLoadingIndicator-BxAy2x7P.js.map +1 -0
- package/dist/{MMenuItem-US0Zbglq.js → MMenuItem-CEIKYvaX.js} +216 -214
- package/dist/MMenuItem-CEIKYvaX.js.map +1 -0
- package/dist/{MPdfViewer-DL9mRsd2.js → MPdfViewer-CEfyXGq2.js} +674 -671
- package/dist/MPdfViewer-CEfyXGq2.js.map +1 -0
- package/dist/MProgressBar-BzZMxq7M.js.map +1 -1
- package/dist/MSeekBar-B3_D-PwH.js +435 -0
- package/dist/MSeekBar-B3_D-PwH.js.map +1 -0
- package/dist/{MSegmentedButton-DMou-8sG.js → MSegmentedButton-Dg07j-4r.js} +4 -4
- package/dist/{MSegmentedButton-DMou-8sG.js.map → MSegmentedButton-Dg07j-4r.js.map} +1 -1
- package/dist/{MSignaturePad-WuvE_Cyl.js → MSignaturePad-3nddtLKI.js} +2 -2
- package/dist/{MSignaturePad-WuvE_Cyl.js.map → MSignaturePad-3nddtLKI.js.map} +1 -1
- package/dist/{MSlider-7TzhFHKS.js → MSlider-BrpLbqwt.js} +4 -4
- package/dist/{MSlider-7TzhFHKS.js.map → MSlider-BrpLbqwt.js.map} +1 -1
- package/dist/{MSpinner-CkIVBuGE.js → MSpinner-CLwzDH33.js} +2 -2
- package/dist/{MSpinner-CkIVBuGE.js.map → MSpinner-CLwzDH33.js.map} +1 -1
- package/dist/{MTextField-B6_iOczK.js → MTextField-CZRizAwA.js} +136 -134
- package/dist/MTextField-CZRizAwA.js.map +1 -0
- package/dist/{_useFieldValidation-COBJ1tWr.js → _useFieldValidation-DVcqyy9g.js} +2 -2
- package/dist/{_useFieldValidation-COBJ1tWr.js.map → _useFieldValidation-DVcqyy9g.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAlert.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +3 -3
- package/dist/components/MAvatar.vue.d.ts +19 -1
- package/dist/components/MButton.vue.d.ts +2 -1
- package/dist/components/MChatBubble.vue.d.ts +2 -0
- package/dist/components/MCheckbox.vue.d.ts +2 -0
- package/dist/components/MDataTable.vue.d.ts +31 -3
- package/dist/components/MFlow.vue.d.ts +1 -1
- package/dist/components/MHotkeys.vue.d.ts +1 -0
- package/dist/components/MIcon.vue.d.ts +6 -0
- package/dist/components/MIconButton.vue.d.ts +5 -0
- package/dist/components/MKanban.vue.d.ts +1 -1
- package/dist/components/MLink.vue.d.ts +59 -0
- package/dist/components/MListItem.vue.d.ts +3 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MPagination.vue.d.ts +14 -1
- package/dist/components/MPdfSigner.vue.d.ts +2 -2
- package/dist/components/MRadio.vue.d.ts +2 -0
- package/dist/components/MRadioGroup.vue.d.ts +2 -0
- package/dist/components/MStatCard.vue.d.ts +2 -2
- package/dist/components/MSwitch.vue.d.ts +2 -0
- package/dist/components/MText.vue.d.ts +4 -2
- package/dist/components/MTextField.vue.d.ts +2 -0
- package/dist/components/_MDrawerItemList.vue.d.ts +6 -0
- package/dist/composables/_menuGroups.d.ts +10 -1
- package/dist/composables/_splitAttrs.d.ts +6 -0
- package/dist/composables/_springAnimation.d.ts +2 -2
- package/dist/composables/_useFocusTrap.d.ts +15 -0
- package/dist/composables/_usePaneResize.d.ts +1 -1
- package/dist/composables/_useSpring.d.ts +4 -4
- package/dist/composables/dynamicColor.d.ts +9 -1
- package/dist/composables/motion.d.ts +63 -0
- package/dist/composables/useConfirm.d.ts +28 -0
- package/dist/composables/useDevice.d.ts +8 -1
- package/dist/composables/useLocale.d.ts +14 -0
- package/dist/composables/useScrollReveal.d.ts +1 -1
- package/dist/composables/useTheme.d.ts +1 -0
- package/dist/composables/useToast.d.ts +7 -0
- package/dist/draw.js +556 -556
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +854 -851
- package/dist/flow.js.map +1 -1
- package/dist/gantt.js +1118 -1096
- package/dist/gantt.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +833 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/locales/pl.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10327 -9796
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +860 -860
- package/dist/map.js.map +1 -1
- package/dist/{material-color-utilities-CEFytLsr.js → material-color-utilities-BZsBNIhi.js} +276 -217
- package/dist/material-color-utilities-BZsBNIhi.js.map +1 -0
- package/dist/media.js +7 -7
- package/dist/{motion-BcejVTeX.js → motion-BqYcqcim.js} +15 -5
- package/dist/motion-BqYcqcim.js.map +1 -0
- package/dist/pdf-sign.js +140 -137
- package/dist/pdf-sign.js.map +1 -1
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +11 -0
- package/dist/rich-text-editor.js +7 -7
- package/dist/styles/theme.css +40 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-YRaOT12S.js → useLocale-BjcYauXr.js} +60 -4
- package/dist/useLocale-BjcYauXr.js.map +1 -0
- package/dist/{useThemeTokens-DyAdPQB0.js → useThemeTokens-D5nr5KHf.js} +28 -27
- package/dist/useThemeTokens-D5nr5KHf.js.map +1 -0
- package/package.json +17 -2
- package/src/__tests__/MAvatarImage.test.ts +37 -0
- package/src/__tests__/MDataTableControlled.test.ts +68 -0
- package/src/__tests__/MHotkeysSequence.test.ts +53 -0
- package/src/__tests__/MIconAxes.test.ts +16 -0
- package/src/__tests__/MIconButtonWidth.test.ts +22 -0
- package/src/__tests__/MLink.test.ts +46 -0
- package/src/__tests__/MPaginationPages.test.ts +43 -0
- package/src/__tests__/MTextEmphasized.test.ts +14 -0
- package/src/__tests__/controlDescription.test.ts +34 -0
- package/src/__tests__/customColor.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +3 -2
- package/src/__tests__/focusTrap.test.ts +124 -0
- package/src/__tests__/formatMessage.test.ts +20 -0
- package/src/__tests__/inputAttrs.test.ts +103 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/menuGroupsRemount.test.ts +40 -0
- package/src/__tests__/menuHydration.test.ts +41 -0
- package/src/__tests__/motionPrefs.test.ts +28 -0
- package/src/__tests__/ssr.test.ts +11 -0
- package/src/__tests__/ssrToast.test.ts +20 -0
- package/src/__tests__/toastDetails.test.ts +39 -0
- package/src/__tests__/useConfirm.test.ts +47 -0
- package/src/__tests__/useTheme.test.ts +14 -0
- package/src/__tests__/warningRole.test.ts +22 -0
- package/src/components/MAlert.vue +2 -2
- package/src/components/MAnimatedNumber.vue +9 -3
- package/src/components/MAutocomplete.vue +16 -4
- package/src/components/MAvailabilityCalendar.vue +3 -3
- package/src/components/MAvatar.vue +32 -5
- package/src/components/MAvatarGroup.vue +7 -2
- package/src/components/MBottomSheet.vue +18 -2
- package/src/components/MButton.vue +18 -5
- package/src/components/MCarousel.vue +3 -3
- package/src/components/MChatBubble.vue +14 -1
- package/src/components/MCheckbox.vue +21 -4
- package/src/components/MChip.vue +4 -2
- package/src/components/MCollapse.vue +7 -1
- package/src/components/MCommandPalette.vue +6 -2
- package/src/components/MContextMenu.vue +4 -4
- package/src/components/MCreditCardInput.vue +5 -0
- package/src/components/MDashboardGrid.vue +2 -1
- package/src/components/MDataTable.vue +63 -16
- package/src/components/MDialog.vue +21 -3
- package/src/components/MDiffViewer.vue +3 -3
- package/src/components/MDrawLayers.vue +3 -3
- package/src/components/MFabMenu.vue +7 -0
- package/src/components/MFloorPlan.vue +3 -3
- package/src/components/MFloorPlanInspector.vue +3 -3
- package/src/components/MFlow.vue +9 -5
- package/src/components/MFlowControls.vue +6 -0
- package/src/components/MFormBuilder.vue +1 -1
- package/src/components/MGantt.vue +10 -10
- package/src/components/MHotkeys.vue +61 -16
- package/src/components/MIcon.vue +17 -1
- package/src/components/MIconButton.vue +29 -6
- package/src/components/MImageCropper.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MLightbox.vue +5 -4
- package/src/components/MLink.vue +136 -0
- package/src/components/MListDetail.vue +7 -0
- package/src/components/MListItem.vue +7 -4
- package/src/components/MLoadingIndicator.vue +2 -1
- package/src/components/MMap.vue +3 -0
- package/src/components/MMapCluster.vue +2 -2
- package/src/components/MMapControl.vue +2 -2
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMaskField.vue +16 -3
- package/src/components/MMenu.vue +4 -4
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMeterGroup.vue +3 -2
- package/src/components/MMortgageCalculator.vue +3 -3
- package/src/components/MMultiAutocomplete.vue +19 -7
- package/src/components/MMultiSelect.vue +19 -7
- package/src/components/MNavigationDrawer.vue +10 -3
- package/src/components/MNavigationRail.vue +5 -1
- package/src/components/MNotificationCenter.vue +2 -1
- package/src/components/MNotificationHost.vue +3 -3
- package/src/components/MNumberField.vue +23 -6
- package/src/components/MOdontogram.vue +4 -4
- package/src/components/MOrderBook.vue +4 -0
- package/src/components/MPagination.vue +91 -12
- package/src/components/MPdfSigner.vue +3 -3
- package/src/components/MPdfViewer.vue +7 -7
- package/src/components/MPhoneInput.vue +17 -4
- package/src/components/MProductConfigurator.vue +4 -4
- package/src/components/MProgressBar.vue +5 -0
- package/src/components/MQuiz.vue +8 -5
- package/src/components/MRadio.vue +24 -5
- package/src/components/MRadioGroup.vue +3 -0
- package/src/components/MReactions.vue +2 -2
- package/src/components/MResourceTimeline.vue +3 -3
- package/src/components/MResult.vue +1 -1
- package/src/components/MScrollField.vue +1 -1
- package/src/components/MSearchField.vue +6 -5
- package/src/components/MSeatMap.vue +5 -0
- package/src/components/MSeekBar.vue +3 -2
- package/src/components/MSelect.vue +16 -4
- package/src/components/MSideSheet.vue +25 -3
- package/src/components/MSimpleCarousel.vue +2 -2
- package/src/components/MSnackbar.vue +16 -13
- package/src/components/MSparkline.vue +2 -1
- package/src/components/MSpinner.vue +8 -0
- package/src/components/MSplitter.vue +1 -1
- package/src/components/MSpotlightSearch.vue +6 -2
- package/src/components/MSpreadsheet.vue +1 -1
- package/src/components/MStatCard.vue +2 -1
- package/src/components/MSwitch.vue +21 -4
- package/src/components/MTabs.vue +2 -1
- package/src/components/MTagInput.vue +19 -6
- package/src/components/MText.vue +23 -4
- package/src/components/MTextField.vue +25 -6
- package/src/components/MTimeline.vue +5 -5
- package/src/components/MToolbar.vue +2 -2
- package/src/components/MTour.vue +3 -0
- package/src/components/MTrackingTimeline.vue +6 -0
- package/src/components/MTypewriter.vue +7 -1
- package/src/components/MWindow.vue +10 -1
- package/src/components/_MColorPanel.vue +4 -4
- package/src/components/_MComment.vue +3 -2
- package/src/components/_MFlowNodeShell.vue +1 -1
- package/src/components/_MPdfPage.vue +1 -1
- package/src/components/_MTransferPane.vue +10 -0
- package/src/composables/_effectCanvas.ts +2 -1
- package/src/composables/_menuGroups.ts +10 -1
- package/src/composables/_splitAttrs.ts +29 -0
- package/src/composables/_springAnimation.ts +3 -3
- package/src/composables/_themeTransition.ts +3 -2
- package/src/composables/_useFocusTrap.ts +142 -0
- package/src/composables/_useMenuNav.ts +3 -3
- package/src/composables/_usePaneResize.ts +2 -1
- package/src/composables/_useSheetMotion.ts +3 -4
- package/src/composables/_useSpring.ts +16 -10
- package/src/composables/cron.ts +7 -6
- package/src/composables/dynamicColor.ts +21 -2
- package/src/composables/motion.ts +27 -0
- package/src/composables/useConfirm.ts +116 -0
- package/src/composables/useDevice.ts +23 -3
- package/src/composables/useFieldBg.ts +4 -0
- package/src/composables/useLocale.ts +74 -0
- package/src/composables/useNotification.ts +3 -0
- package/src/composables/useScrollReveal.ts +3 -3
- package/src/composables/useTheme.ts +8 -2
- package/src/composables/useToast.ts +27 -4
- package/src/directives/vSparkle.ts +2 -1
- package/src/index.ts +8 -5
- package/src/locales/ar.ts +7 -0
- package/src/locales/de.ts +7 -0
- package/src/locales/es.ts +7 -0
- package/src/locales/fr.ts +7 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +7 -0
- package/src/locales/ko.ts +7 -0
- package/src/locales/pl.ts +807 -0
- package/src/locales/pt.ts +7 -0
- package/src/locales/zh.ts +7 -0
- package/src/plugin.ts +16 -0
- package/src/styles/theme.css +40 -0
- package/dist/MButton-B9RCM06i.js +0 -171
- package/dist/MButton-B9RCM06i.js.map +0 -1
- package/dist/MColorPickerModal-ChRtcZOo.js +0 -577
- package/dist/MColorPickerModal-ChRtcZOo.js.map +0 -1
- package/dist/MDialog-dk07tify.js +0 -167
- package/dist/MDialog-dk07tify.js.map +0 -1
- package/dist/MIcon-BSsJZhK7.js.map +0 -1
- package/dist/MIconButton-CrBPZidd.js +0 -288
- package/dist/MIconButton-CrBPZidd.js.map +0 -1
- package/dist/MListItem-h9H223vx.js +0 -1239
- package/dist/MListItem-h9H223vx.js.map +0 -1
- package/dist/MLoadingIndicator-YTV1Ov5w.js +0 -114
- package/dist/MLoadingIndicator-YTV1Ov5w.js.map +0 -1
- package/dist/MMenuItem-US0Zbglq.js.map +0 -1
- package/dist/MPdfViewer-DL9mRsd2.js.map +0 -1
- package/dist/MSeekBar-JFZcoJ8y.js +0 -434
- package/dist/MSeekBar-JFZcoJ8y.js.map +0 -1
- package/dist/MTextField-B6_iOczK.js.map +0 -1
- package/dist/material-color-utilities-CEFytLsr.js.map +0 -1
- package/dist/motion-BcejVTeX.js.map +0 -1
- package/dist/useLocale-YRaOT12S.js.map +0 -1
- package/dist/useThemeTokens-DyAdPQB0.js.map +0 -1
|
@@ -10,7 +10,7 @@ type __VLS_Props = {
|
|
|
10
10
|
/** Text next to the trend indicator (e.g. "vs last month") */
|
|
11
11
|
trendLabel?: string;
|
|
12
12
|
/** Icon container color */
|
|
13
|
-
color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success';
|
|
13
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' | 'warning';
|
|
14
14
|
/** Show a skeleton placeholder instead of the value */
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
};
|
|
@@ -21,7 +21,7 @@ declare const __VLS_template: () => {
|
|
|
21
21
|
};
|
|
22
22
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
23
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
|
-
color: "primary" | "secondary" | "tertiary" | "error" | "success";
|
|
24
|
+
color: "primary" | "secondary" | "tertiary" | "error" | "success" | "warning";
|
|
25
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
27
|
declare const _default: typeof __VLS_export;
|
|
@@ -6,6 +6,8 @@ type __VLS_Props = {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
/** Label text */
|
|
8
8
|
label?: string;
|
|
9
|
+
/** Supporting text under the label (M3 list-style two-line control); screen readers read it as the description */
|
|
10
|
+
description?: string;
|
|
9
11
|
/** Track/thumb color when on */
|
|
10
12
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error';
|
|
11
13
|
/** Shows a check icon in the thumb while on. Set to `false` for M3's plain switch without an icon. */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type BaseTextVariant = 'display-large' | 'display-medium' | 'display-small' | 'headline-large' | 'headline-medium' | 'headline-small' | 'title-large' | 'title-medium' | 'title-small' | 'body-large' | 'body-medium' | 'body-small' | 'label-large' | 'label-medium' | 'label-small';
|
|
2
|
+
/** A type-scale style, or its M3 Expressive emphasized twin (same size and tracking, heavier) */
|
|
3
|
+
export type TextVariant = BaseTextVariant | `${BaseTextVariant}-emphasized`;
|
|
2
4
|
type __VLS_Props = {
|
|
3
|
-
/** Typography variant from the Material 3 type scale */
|
|
5
|
+
/** Typography variant from the Material 3 type scale; add `-emphasized` for the M3 Expressive heavier twin */
|
|
4
6
|
variant?: TextVariant;
|
|
5
7
|
/**
|
|
6
8
|
* HTML tag to render (auto-selected based on variant — h1/h2/h3 for display/headline, p for title/body,
|
|
@@ -4,6 +4,8 @@ type __VLS_Props = {
|
|
|
4
4
|
modelValue: string | number;
|
|
5
5
|
/** Field label */
|
|
6
6
|
label: string;
|
|
7
|
+
/** Placeholder, shown while the field is focused and empty (the label sits above it then, as in M3) */
|
|
8
|
+
placeholder?: string;
|
|
7
9
|
/** HTML input type */
|
|
8
10
|
type?: string;
|
|
9
11
|
/** Visual style */
|
|
@@ -55,12 +55,18 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
55
55
|
filled?: boolean;
|
|
56
56
|
label?: string;
|
|
57
57
|
mirror?: boolean;
|
|
58
|
+
weight?: number;
|
|
59
|
+
grade?: number;
|
|
60
|
+
opticalSize?: number;
|
|
58
61
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
59
62
|
name: string;
|
|
60
63
|
size?: number;
|
|
61
64
|
filled?: boolean;
|
|
62
65
|
label?: string;
|
|
63
66
|
mirror?: boolean;
|
|
67
|
+
weight?: number;
|
|
68
|
+
grade?: number;
|
|
69
|
+
opticalSize?: number;
|
|
64
70
|
}> & Readonly<{}>, {
|
|
65
71
|
size: number;
|
|
66
72
|
filled: boolean;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import { type VNode } from 'vue';
|
|
1
|
+
import { type FunctionalComponent, type VNode, type VNodeChild } from 'vue';
|
|
2
2
|
/**
|
|
3
3
|
* Splits a menu's slot content into groups at each `<MMenuDivider gap />`, for the expressive variant's
|
|
4
4
|
* independently-rounded group boxes (MMenu, MContextMenu, and MMenuItem's flyout submenus). A plain
|
|
5
5
|
* `<MMenuDivider />` stays an in-line divider inside its group. Returns empty groups filtered out.
|
|
6
6
|
*/
|
|
7
7
|
export declare function splitMenuGroups(vnodes: VNode[]): VNode[][];
|
|
8
|
+
/**
|
|
9
|
+
* Renders VNodes built elsewhere (a menu group, a push submenu's header or content). A stable component type: an
|
|
10
|
+
* inline `<component :is="() => nodes" />` is a new function on every render, so Vue treats it as a different
|
|
11
|
+
* component each time and unmounts and re-creates everything inside it (items lost focus and DOM identity on any
|
|
12
|
+
* re-render of the menu).
|
|
13
|
+
*/
|
|
14
|
+
export declare const RenderNodes: FunctionalComponent<{
|
|
15
|
+
nodes?: () => VNodeChild;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function useSplitAttrs(): {
|
|
2
|
+
rootAttrs: () => Record<string, unknown>;
|
|
3
|
+
inputAttrs: () => Record<string, unknown>;
|
|
4
|
+
/** The consumer's `id`, if given: the control takes it, so `<label for>` and `getElementById` keep working */
|
|
5
|
+
attrId: () => string | undefined;
|
|
6
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { shouldReduceMotion, type SpringSpec } from './motion';
|
|
2
2
|
export declare const SAMPLE_MS: number;
|
|
3
3
|
/**
|
|
4
4
|
* The spring from `from` to `to`, starting at `velocity` (units/s), one sample per 60Hz frame until it's within
|
|
@@ -14,4 +14,4 @@ export declare const samplesDuration: (samples: number[]) => number;
|
|
|
14
14
|
* play or no Web Animations API (the inline end state then simply stands).
|
|
15
15
|
*/
|
|
16
16
|
export declare function playSamples(el: Element | null | undefined, samples: number[], keyframe: (value: number) => Keyframe, delay?: number): Animation | null;
|
|
17
|
-
export declare const prefersReducedMotion:
|
|
17
|
+
export declare const prefersReducedMotion: typeof shouldReduceMotion;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** The elements Tab reaches inside `root`, in order (skipping inert, hidden and disabled ones) */
|
|
2
|
+
export declare function focusableIn(root: HTMLElement): HTMLElement[];
|
|
3
|
+
export interface FocusTrapOptions {
|
|
4
|
+
/** What gets focus on open, instead of the first autofocus / focusable element */
|
|
5
|
+
initialFocus?: () => HTMLElement | null | undefined;
|
|
6
|
+
/** Return focus to the element that had it before opening (default true) */
|
|
7
|
+
restoreFocus?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Traps keyboard focus in `container()` while `active()` is true; see the file comment. `container` is read after
|
|
11
|
+
* the DOM updates, so a surface rendered by the same `v-if` that `active` drives is already there.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useFocusTrap(container: () => HTMLElement | null | undefined, active: () => boolean, options?: FocusTrapOptions): {
|
|
14
|
+
focusFirst: () => void;
|
|
15
|
+
};
|
|
@@ -32,7 +32,7 @@ export declare function usePaneResize(o: {
|
|
|
32
32
|
onChange?: (anchor: PaneAnchor) => void;
|
|
33
33
|
}): {
|
|
34
34
|
dragging: Ref<boolean, boolean>;
|
|
35
|
-
collapsed: Ref<"
|
|
35
|
+
collapsed: Ref<"other" | "pane" | null, "other" | "pane" | null>;
|
|
36
36
|
position: Ref<number, number>;
|
|
37
37
|
anchor: import("vue").ComputedRef<PaneAnchor | null>;
|
|
38
38
|
handlers: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type SpringSpec } from './motion';
|
|
2
2
|
export type { SpringSpec };
|
|
3
|
-
/** MotionSchemeKeyTokens.FastSpatial in the
|
|
3
|
+
/** MotionSchemeKeyTokens.FastSpatial in the app's scheme (Standard unless createM3UI picks Expressive) */
|
|
4
4
|
export declare const FAST_SPATIAL: SpringSpec;
|
|
5
|
-
/** MotionSchemeKeyTokens.FastEffects in
|
|
5
|
+
/** MotionSchemeKeyTokens.FastEffects (the same in both schemes) */
|
|
6
6
|
export declare const FAST_EFFECTS: SpringSpec;
|
|
7
|
-
/** MotionSchemeKeyTokens.DefaultEffects in
|
|
7
|
+
/** MotionSchemeKeyTokens.DefaultEffects (the same in both schemes) */
|
|
8
8
|
export declare const DEFAULT_EFFECTS: SpringSpec;
|
|
9
|
-
/** MotionSchemeKeyTokens.DefaultSpatial in the
|
|
9
|
+
/** MotionSchemeKeyTokens.DefaultSpatial in the app's scheme */
|
|
10
10
|
export declare const DEFAULT_SPATIAL: SpringSpec;
|
|
11
11
|
export declare function useSpring(target: () => number[], apply: (values: readonly number[]) => void, spec?: SpringSpec): {
|
|
12
12
|
snap: () => void;
|
|
@@ -10,10 +10,18 @@ export interface GeneratedScheme {
|
|
|
10
10
|
light: Record<string, string>;
|
|
11
11
|
dark: Record<string, string>;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* The `--color-*` roles a generated scheme sets from M3's dynamic colors. The library's status extensions
|
|
15
|
+
* (`success*`, `warning*`) are added on top, harmonized with the seed (see `statusColors`).
|
|
16
|
+
*/
|
|
14
17
|
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
18
|
/** Generates the light and dark schemes for a seed color (`#rrggbb`). */
|
|
16
19
|
export declare function generateScheme(seed: string, options?: SeedOptions): Promise<GeneratedScheme>;
|
|
20
|
+
/** The base colors of the status extensions, before a seed harmonizes them */
|
|
21
|
+
export declare const statusColors: {
|
|
22
|
+
readonly success: "#2e7d32";
|
|
23
|
+
readonly warning: "#ffb300";
|
|
24
|
+
};
|
|
17
25
|
/** CSS for a scheme under `[data-palette='<id>']` (light) and `[data-palette='<id>'].dark`, like palettes.css. */
|
|
18
26
|
export declare function schemeToCss(scheme: GeneratedScheme, id: string): string;
|
|
19
27
|
/**
|
|
@@ -62,6 +62,69 @@ export declare const motionSprings: {
|
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
+
export type MotionScheme = 'standard' | 'expressive';
|
|
66
|
+
/**
|
|
67
|
+
* The app's motion scheme, from `createM3UI({ motionScheme })` (or `data-m3-motion-scheme` on `<html>`, which a
|
|
68
|
+
* server-rendered page can set itself). Components that follow the scheme read it when an animation starts.
|
|
69
|
+
*/
|
|
70
|
+
export declare function getMotionScheme(): MotionScheme;
|
|
71
|
+
/** The springs of the app's motion scheme: `motionSprings[getMotionScheme()]` */
|
|
72
|
+
export declare function appSprings(): {
|
|
73
|
+
readonly fastSpatial: {
|
|
74
|
+
readonly dampingRatio: 0.9;
|
|
75
|
+
readonly stiffness: 1400;
|
|
76
|
+
};
|
|
77
|
+
readonly defaultSpatial: {
|
|
78
|
+
readonly dampingRatio: 0.9;
|
|
79
|
+
readonly stiffness: 700;
|
|
80
|
+
};
|
|
81
|
+
readonly slowSpatial: {
|
|
82
|
+
readonly dampingRatio: 0.9;
|
|
83
|
+
readonly stiffness: 300;
|
|
84
|
+
};
|
|
85
|
+
readonly fastEffects: {
|
|
86
|
+
readonly dampingRatio: 1;
|
|
87
|
+
readonly stiffness: 3800;
|
|
88
|
+
};
|
|
89
|
+
readonly defaultEffects: {
|
|
90
|
+
readonly dampingRatio: 1;
|
|
91
|
+
readonly stiffness: 1600;
|
|
92
|
+
};
|
|
93
|
+
readonly slowEffects: {
|
|
94
|
+
readonly dampingRatio: 1;
|
|
95
|
+
readonly stiffness: 800;
|
|
96
|
+
};
|
|
97
|
+
} | {
|
|
98
|
+
readonly fastSpatial: {
|
|
99
|
+
readonly dampingRatio: 0.6;
|
|
100
|
+
readonly stiffness: 800;
|
|
101
|
+
};
|
|
102
|
+
readonly defaultSpatial: {
|
|
103
|
+
readonly dampingRatio: 0.8;
|
|
104
|
+
readonly stiffness: 380;
|
|
105
|
+
};
|
|
106
|
+
readonly slowSpatial: {
|
|
107
|
+
readonly dampingRatio: 0.8;
|
|
108
|
+
readonly stiffness: 200;
|
|
109
|
+
};
|
|
110
|
+
readonly fastEffects: {
|
|
111
|
+
readonly dampingRatio: 1;
|
|
112
|
+
readonly stiffness: 3800;
|
|
113
|
+
};
|
|
114
|
+
readonly defaultEffects: {
|
|
115
|
+
readonly dampingRatio: 1;
|
|
116
|
+
readonly stiffness: 1600;
|
|
117
|
+
};
|
|
118
|
+
readonly slowEffects: {
|
|
119
|
+
readonly dampingRatio: 1;
|
|
120
|
+
readonly stiffness: 800;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Whether to cut animations down: the user's "reduce motion" setting, or `createM3UI({ reducedMotion: 'always' })`
|
|
125
|
+
* (`data-m3-motion="reduce"` on `<html>`). Ask it when an animation starts, as the library's own components do.
|
|
126
|
+
*/
|
|
127
|
+
export declare function shouldReduceMotion(): boolean;
|
|
65
128
|
/** Easing curves as cubic-bezier control points [x1, y1, x2, y2] (theme.css has them as `--ease-*`) */
|
|
66
129
|
export declare const motionEasings: {
|
|
67
130
|
readonly emphasized: readonly [0.2, 0, 0, 1];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ConfirmOptions {
|
|
2
|
+
/** Dialog title */
|
|
3
|
+
title: string;
|
|
4
|
+
/** The question or what will happen */
|
|
5
|
+
message: string;
|
|
6
|
+
/** Confirm button label; the locale's `confirm` when omitted */
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
/** Cancel button label; the locale's `cancel` when omitted */
|
|
9
|
+
cancelLabel?: string;
|
|
10
|
+
/** Error color on the confirm button, for destructive actions */
|
|
11
|
+
danger?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Work to do on confirm, with the dialog still open: the button shows a spinner until it settles, then the promise
|
|
14
|
+
* resolves `true`. If it throws, the dialog stays open so the user can retry or cancel; the error isn't passed on,
|
|
15
|
+
* so report it from inside `onConfirm` (a toast, say)
|
|
16
|
+
*/
|
|
17
|
+
onConfirm?: () => unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asks with an `MConfirmDialog` and resolves `true` (confirmed) or `false` (cancelled, Escape, the close button or
|
|
21
|
+
* the scrim). Calls made while one is open wait their turn. On the server it resolves `false` at once.
|
|
22
|
+
*/
|
|
23
|
+
declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
24
|
+
/** Promise-based confirmation dialogs, without placing a dialog or wiring a v-model: `if (await confirm({…})) …` */
|
|
25
|
+
export declare function useConfirm(): {
|
|
26
|
+
confirm: typeof confirm;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* `isMobile`: whether the window is narrower than 768px, kept up to date on resize. In the browser it's right from
|
|
4
|
+
* the first render. Server-side rendering with `createM3UI({ initialState: { viewport } })` (the viewport cookie the
|
|
5
|
+
* Nuxt module keeps) renders and hydrates with the size the server was given, then follows the window; without a
|
|
6
|
+
* viewport the server renders the desktop markup (`false`).
|
|
7
|
+
*/
|
|
1
8
|
export declare function useDevice(): {
|
|
2
|
-
isMobile:
|
|
9
|
+
isMobile: Readonly<Ref<boolean>>;
|
|
3
10
|
};
|
|
@@ -20,6 +20,8 @@ export interface M3Locale {
|
|
|
20
20
|
collapse: string;
|
|
21
21
|
/** Clears a field's value (the × at its end) */
|
|
22
22
|
clear: string;
|
|
23
|
+
increase: string;
|
|
24
|
+
decrease: string;
|
|
23
25
|
columns: string;
|
|
24
26
|
exportCsv: string;
|
|
25
27
|
noGroup: string;
|
|
@@ -174,6 +176,11 @@ export interface M3Locale {
|
|
|
174
176
|
paginationPage: string;
|
|
175
177
|
previousPage: string;
|
|
176
178
|
nextPage: string;
|
|
179
|
+
firstPage: string;
|
|
180
|
+
lastPage: string;
|
|
181
|
+
goToPage: string;
|
|
182
|
+
pagination: string;
|
|
183
|
+
opensInNewTab: string;
|
|
177
184
|
carousel: string;
|
|
178
185
|
carouselItem: string;
|
|
179
186
|
/** MSparkline's summary for screen readers: {first}, {last}, {min}, {max} */
|
|
@@ -876,5 +883,12 @@ export interface M3Locale {
|
|
|
876
883
|
export declare const defaultLocale: M3Locale;
|
|
877
884
|
export declare const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>>;
|
|
878
885
|
/** @internal Called by `createM3UI()`; not exported from the package. */
|
|
886
|
+
/**
|
|
887
|
+
* Fills a locale string's placeholders: `{name}` takes `vars.name`, and a plural block
|
|
888
|
+
* `{count, plural, one {# file} few {# files} other {# files}}` picks the form `Intl.PluralRules` gives for `lang`
|
|
889
|
+
* (`zero`, `one`, `two`, `few`, `many`, `other`, or an exact `=0`), with `#` standing for the number. Strings without
|
|
890
|
+
* a plural block work as before, so a locale only needs them where its grammar does (Polish, Arabic…).
|
|
891
|
+
*/
|
|
892
|
+
export declare function formatMessage(template: string, vars?: Record<string, string | number>, lang?: string): string;
|
|
879
893
|
export declare function __setAppLocale(locale: MaybeRef<Partial<M3Locale>> | null): void;
|
|
880
894
|
export declare function useLocale(): M3Locale;
|
|
@@ -16,7 +16,7 @@ export interface ScrollRevealOptions {
|
|
|
16
16
|
threshold?: number;
|
|
17
17
|
/** Grows or shrinks the area that counts as visible, like IntersectionObserver's `rootMargin` (default `'0px'`) */
|
|
18
18
|
rootMargin?: string;
|
|
19
|
-
/** Motion scheme of the springs: `'standard'`
|
|
19
|
+
/** Motion scheme of the springs: `'standard'` or `'expressive'` (a little bounce). Defaults to the app's (createM3UI's `motionScheme`) */
|
|
20
20
|
scheme?: 'standard' | 'expressive';
|
|
21
21
|
/** Pace: M3's fast, default or slow springs (default `'default'`); slow suits large, calm entrances */
|
|
22
22
|
speed?: 'fast' | 'default' | 'slow';
|
|
@@ -7,6 +7,8 @@ export interface ToastAction {
|
|
|
7
7
|
export interface Toast {
|
|
8
8
|
id: number;
|
|
9
9
|
message: string;
|
|
10
|
+
/** Second line under the message, in a smaller, quieter style (the message then reads as a title) */
|
|
11
|
+
description?: string;
|
|
10
12
|
variant: ToastVariant;
|
|
11
13
|
duration: number;
|
|
12
14
|
loading?: boolean;
|
|
@@ -17,6 +19,8 @@ export interface Toast {
|
|
|
17
19
|
}
|
|
18
20
|
declare function dismiss(id: number): void;
|
|
19
21
|
export interface ToastOptions {
|
|
22
|
+
/** Second line under the message (the message then reads as a title) */
|
|
23
|
+
description?: string;
|
|
20
24
|
duration?: number;
|
|
21
25
|
loading?: boolean;
|
|
22
26
|
action?: ToastAction;
|
|
@@ -30,6 +34,7 @@ export declare function useToast(): {
|
|
|
30
34
|
toasts: import("vue").Ref<{
|
|
31
35
|
id: number;
|
|
32
36
|
message: string;
|
|
37
|
+
description?: string | undefined;
|
|
33
38
|
variant: ToastVariant;
|
|
34
39
|
duration: number;
|
|
35
40
|
loading?: boolean | undefined;
|
|
@@ -43,6 +48,7 @@ export declare function useToast(): {
|
|
|
43
48
|
}[], Toast[] | {
|
|
44
49
|
id: number;
|
|
45
50
|
message: string;
|
|
51
|
+
description?: string | undefined;
|
|
46
52
|
variant: ToastVariant;
|
|
47
53
|
duration: number;
|
|
48
54
|
loading?: boolean | undefined;
|
|
@@ -55,6 +61,7 @@ export declare function useToast(): {
|
|
|
55
61
|
count: number;
|
|
56
62
|
}[]>;
|
|
57
63
|
position: import("vue").Ref<ToastPosition, ToastPosition>;
|
|
64
|
+
max: import("vue").Ref<number, number>;
|
|
58
65
|
show: typeof show;
|
|
59
66
|
success: (msg: string, opts?: ToastOptions) => number;
|
|
60
67
|
error: (msg: string, opts?: ToastOptions) => number;
|