@clderystd/m3-ui 0.0.0-stage → 0.1.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 +92 -2
- package/dist/components/M3Avatar.vue.d.ts +20 -0
- package/dist/components/M3Button.vue.d.ts +57 -0
- package/dist/components/M3Card.vue.d.ts +37 -0
- package/dist/components/M3Chip.vue.d.ts +25 -0
- package/dist/components/M3Dialog.vue.d.ts +41 -0
- package/dist/components/M3Divider.vue.d.ts +10 -0
- package/dist/components/M3Fab.vue.d.ts +31 -0
- package/dist/components/M3Icon.vue.d.ts +30 -0
- package/dist/components/M3IconButton.vue.d.ts +33 -0
- package/dist/components/M3List.vue.d.ts +22 -0
- package/dist/components/M3ListItem.vue.d.ts +52 -0
- package/dist/components/M3Menu.vue.d.ts +61 -0
- package/dist/components/M3MenuItem.vue.d.ts +39 -0
- package/dist/components/M3SegmentedButton.vue.d.ts +23 -0
- package/dist/components/M3Sheet.vue.d.ts +44 -0
- package/dist/components/M3Switch.vue.d.ts +30 -0
- package/dist/components/M3Tooltip.vue.d.ts +24 -0
- package/dist/components/M3TopAppBar.vue.d.ts +41 -0
- package/dist/components/index.d.ts +30 -0
- package/dist/composables/useModal.d.ts +16 -0
- package/dist/directives/reveal.d.ts +15 -0
- package/dist/directives/ripple.d.ts +6 -0
- package/dist/icons/index.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1011 -0
- package/dist/m3-ui.css +2 -0
- package/dist/types.d.ts +11 -0
- package/package.json +45 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Tooltip text (plain tooltip, MD3). */
|
|
3
|
+
text: string;
|
|
4
|
+
placement?: 'top' | 'bottom';
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: HTMLSpanElement;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
placement: "top" | "bottom";
|
|
17
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** True once the page is scrolled: switches the bar to the container colour. */
|
|
3
|
+
scrolled?: boolean;
|
|
4
|
+
/** Force the elevated/scrolled treatment regardless of scroll position. */
|
|
5
|
+
elevated?: boolean;
|
|
6
|
+
/** Small (64dp) is the default; medium (112dp) and large (152dp) stack the title. */
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
/** Centre the title. */
|
|
9
|
+
centered?: boolean;
|
|
10
|
+
/** Stick to the top of the viewport. */
|
|
11
|
+
sticky?: boolean;
|
|
12
|
+
/** Paint no surface of its own so the page shows through; use the `background` slot. */
|
|
13
|
+
overlay?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
attrs: Partial<{}>;
|
|
17
|
+
slots: {
|
|
18
|
+
background?(_: {}): any;
|
|
19
|
+
leading?(_: {}): any;
|
|
20
|
+
default?(_: {}): any;
|
|
21
|
+
actions?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {};
|
|
24
|
+
rootEl: HTMLElement;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
28
|
+
size: "small" | "medium" | "large";
|
|
29
|
+
elevated: boolean;
|
|
30
|
+
scrolled: boolean;
|
|
31
|
+
centered: boolean;
|
|
32
|
+
sticky: boolean;
|
|
33
|
+
overlay: boolean;
|
|
34
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
35
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
36
|
+
export default _default;
|
|
37
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Material Design 3 组件库。
|
|
3
|
+
*
|
|
4
|
+
* 只用官方 M3 设计令牌实现,不依赖任何第三方 UI 组件库。
|
|
5
|
+
* 配色(--md-sys-color-*)由使用方提供:本包只带结构令牌
|
|
6
|
+
* (形状 / 字阶 / 海拔 / 动效 / 状态层),可换主题色。
|
|
7
|
+
*/
|
|
8
|
+
export { default as M3Avatar } from './M3Avatar.vue';
|
|
9
|
+
export { default as M3Button } from './M3Button.vue';
|
|
10
|
+
export { default as M3Card } from './M3Card.vue';
|
|
11
|
+
export { default as M3Chip } from './M3Chip.vue';
|
|
12
|
+
export { default as M3Dialog } from './M3Dialog.vue';
|
|
13
|
+
export { default as M3Divider } from './M3Divider.vue';
|
|
14
|
+
export { default as M3Fab } from './M3Fab.vue';
|
|
15
|
+
export { default as M3Icon } from './M3Icon.vue';
|
|
16
|
+
export { default as M3IconButton } from './M3IconButton.vue';
|
|
17
|
+
export { default as M3List } from './M3List.vue';
|
|
18
|
+
export { default as M3ListItem } from './M3ListItem.vue';
|
|
19
|
+
export { default as M3Menu } from './M3Menu.vue';
|
|
20
|
+
export { default as M3MenuItem } from './M3MenuItem.vue';
|
|
21
|
+
export { default as M3SegmentedButton, type SegmentedOption } from './M3SegmentedButton.vue';
|
|
22
|
+
export { default as M3Sheet } from './M3Sheet.vue';
|
|
23
|
+
export { default as M3Switch } from './M3Switch.vue';
|
|
24
|
+
export { default as M3Tooltip } from './M3Tooltip.vue';
|
|
25
|
+
export { default as M3TopAppBar } from './M3TopAppBar.vue';
|
|
26
|
+
export type { IconComponent } from '../types';
|
|
27
|
+
export { IconCheck, IconClose, IconExpandMore } from '../icons';
|
|
28
|
+
export { vRipple } from '../directives/ripple';
|
|
29
|
+
export { vReveal } from '../directives/reveal';
|
|
30
|
+
export { useModal, type UseModalOptions, type ModalControls } from '../composables/useModal';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface UseModalOptions {
|
|
3
|
+
/** Called when the user presses Escape or clicks the scrim. */
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
/** Keep the panel mounted; skip restoring focus to the trigger. */
|
|
6
|
+
restoreFocus?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ModalControls {
|
|
9
|
+
/** Move focus to the first focusable element inside the panel. */
|
|
10
|
+
focusFirst: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Shared behaviour for M3 dialogs and sheets: scroll lock, a focus trap that keeps Tab
|
|
14
|
+
* inside the panel, Escape-to-close, and focus restoration to the invoking element.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useModal(isOpen: Ref<boolean>, panelRef: Ref<HTMLElement | null>, options: UseModalOptions): ModalControls;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from 'vue';
|
|
2
|
+
interface RevealOptions {
|
|
3
|
+
/** Transition delay in ms, for staggering grids. */
|
|
4
|
+
delay?: number;
|
|
5
|
+
/** Start blurred and sharpen into place. */
|
|
6
|
+
blur?: boolean;
|
|
7
|
+
/** Reveal only the first time (default) or every time it enters view. */
|
|
8
|
+
once?: boolean;
|
|
9
|
+
/** Starting vertical offset in px (defaults to the stylesheet value). */
|
|
10
|
+
y?: number;
|
|
11
|
+
/** Starting scale (defaults to the stylesheet value). */
|
|
12
|
+
scale?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const vReveal: Directive<HTMLElement, RevealOptions | number | undefined>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FunctionalComponent } from 'vue';
|
|
2
|
+
/** Material Symbols: check */
|
|
3
|
+
export declare const IconCheck: FunctionalComponent<{}, {}, any, {}>;
|
|
4
|
+
/** Material Symbols: close */
|
|
5
|
+
export declare const IconClose: FunctionalComponent<{}, {}, any, {}>;
|
|
6
|
+
/** Material Symbols: expand-more */
|
|
7
|
+
export declare const IconExpandMore: FunctionalComponent<{}, {}, any, {}>;
|
|
8
|
+
/** 图标组件的形状;外面传图标时用它标注类型。 */
|
|
9
|
+
export type { IconComponent } from '../types';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|