apptify 0.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/LICENSE +25 -0
- package/README.md +294 -0
- package/dist/apptify.css +1 -0
- package/dist/apptify.js +5863 -0
- package/dist/components/button.d.ts +67 -0
- package/dist/components/content.d.ts +3038 -0
- package/dist/components/date-picker.d.ts +136 -0
- package/dist/components/forms.d.ts +2998 -0
- package/dist/components/foundation.d.ts +843 -0
- package/dist/components/motion.d.ts +131 -0
- package/dist/components/navibar.d.ts +184 -0
- package/dist/components/overlays.d.ts +1771 -0
- package/dist/core/context.d.ts +100 -0
- package/dist/core/motion.d.ts +10 -0
- package/dist/index.d.ts +4621 -0
- package/docs/COMPONENTS.md +204 -0
- package/docs/VALIDATION.md +36 -0
- package/package.json +55 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type Component, type InjectionKey, type PropType, type Ref } from 'vue';
|
|
2
|
+
export type Motion = 'auto' | 'full' | 'reduced' | 'none';
|
|
3
|
+
export type ComponentMotion = Motion | 'inherit';
|
|
4
|
+
export type ThemeTokens = Record<string, string>;
|
|
5
|
+
export interface AppleTheme {
|
|
6
|
+
scheme: 'light' | 'dark';
|
|
7
|
+
tokens: ThemeTokens;
|
|
8
|
+
}
|
|
9
|
+
export declare const builtInThemes: Record<string, AppleTheme>;
|
|
10
|
+
export declare function resolveMotion(value?: ComponentMotion, global?: Motion, reduced?: boolean): Exclude<Motion, 'auto'>;
|
|
11
|
+
export declare const motionProps: {
|
|
12
|
+
motion: {
|
|
13
|
+
type: PropType<ComponentMotion>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare function createMessageBus(): {
|
|
18
|
+
onMessage<T = unknown>(channel: string, listener: (payload: T) => unknown): () => void;
|
|
19
|
+
sendMessage<T = unknown>(channel: string, payload?: T): unknown[];
|
|
20
|
+
clear(): void;
|
|
21
|
+
};
|
|
22
|
+
export interface OverlayOptions {
|
|
23
|
+
kind?: 'dialog' | 'drawer' | 'sheet' | 'snackbar';
|
|
24
|
+
title?: string;
|
|
25
|
+
message?: string;
|
|
26
|
+
component?: Component;
|
|
27
|
+
props?: Record<string, unknown>;
|
|
28
|
+
onMessage?: (channel: string, payload: unknown) => unknown;
|
|
29
|
+
persistent?: boolean;
|
|
30
|
+
confirmText?: string;
|
|
31
|
+
cancelText?: string;
|
|
32
|
+
tone?: string;
|
|
33
|
+
duration?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface OverlayEntry extends OverlayOptions {
|
|
36
|
+
id: string;
|
|
37
|
+
kind: NonNullable<OverlayOptions['kind']>;
|
|
38
|
+
}
|
|
39
|
+
export interface OverlayHandle<T = unknown> {
|
|
40
|
+
id: string;
|
|
41
|
+
close(value?: T): void;
|
|
42
|
+
update(patch: Partial<OverlayOptions>): void;
|
|
43
|
+
result: Promise<T | undefined>;
|
|
44
|
+
}
|
|
45
|
+
export declare function createOverlayService(): {
|
|
46
|
+
entries: import("vue").Reactive<OverlayEntry[]>;
|
|
47
|
+
open<T = unknown>(options: OverlayOptions): OverlayHandle<T>;
|
|
48
|
+
close: (id: string, value?: unknown) => void;
|
|
49
|
+
closeTop(value?: unknown): void;
|
|
50
|
+
clear(): void;
|
|
51
|
+
};
|
|
52
|
+
export interface AppleOptions {
|
|
53
|
+
theme?: string;
|
|
54
|
+
themes?: Record<string, AppleTheme>;
|
|
55
|
+
motion?: Motion;
|
|
56
|
+
persist?: boolean;
|
|
57
|
+
storageKey?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function createApple(options?: AppleOptions): {
|
|
60
|
+
theme: {
|
|
61
|
+
name: string;
|
|
62
|
+
themes: Record<string, AppleTheme>;
|
|
63
|
+
readonly resolved: string;
|
|
64
|
+
readonly current: {
|
|
65
|
+
scheme: "light" | "dark";
|
|
66
|
+
tokens: ThemeTokens;
|
|
67
|
+
};
|
|
68
|
+
set: (name: string) => void;
|
|
69
|
+
register: (name: string, tokens: ThemeTokens, scheme?: "light" | "dark") => void;
|
|
70
|
+
};
|
|
71
|
+
motion: {
|
|
72
|
+
mode: Motion;
|
|
73
|
+
reduced: boolean;
|
|
74
|
+
set: (mode: Motion) => void;
|
|
75
|
+
};
|
|
76
|
+
messages: {
|
|
77
|
+
onMessage<T = unknown>(channel: string, listener: (payload: T) => unknown): () => void;
|
|
78
|
+
sendMessage<T = unknown>(channel: string, payload?: T): unknown[];
|
|
79
|
+
clear(): void;
|
|
80
|
+
};
|
|
81
|
+
overlays: {
|
|
82
|
+
entries: import("vue").Reactive<OverlayEntry[]>;
|
|
83
|
+
open<T = unknown>(options: OverlayOptions): OverlayHandle<T>;
|
|
84
|
+
close: (id: string, value?: unknown) => void;
|
|
85
|
+
closeTop(value?: unknown): void;
|
|
86
|
+
clear(): void;
|
|
87
|
+
};
|
|
88
|
+
portalTarget: Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
89
|
+
dialog: <T = unknown>(settings: Omit<OverlayOptions, "kind">) => OverlayHandle<T>;
|
|
90
|
+
notify: (message: string, settings?: Omit<OverlayOptions, "kind" | "message">) => OverlayHandle<unknown>;
|
|
91
|
+
sendMessage: <T = unknown>(channel: string, payload?: T) => unknown[];
|
|
92
|
+
onMessage: <T = unknown>(channel: string, listener: (payload: T) => unknown) => () => void;
|
|
93
|
+
attach(): void;
|
|
94
|
+
detach(): void;
|
|
95
|
+
dispose(): void;
|
|
96
|
+
};
|
|
97
|
+
export type AppleContext = ReturnType<typeof createApple>;
|
|
98
|
+
export declare const appleKey: InjectionKey<AppleContext>;
|
|
99
|
+
export declare function useApple(): AppleContext;
|
|
100
|
+
export declare function themeStyle(context: AppleContext): Record<string, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ObjectDirective, type VNode } from 'vue';
|
|
2
|
+
export declare function motionDuration(element: HTMLElement, fallback?: number): number;
|
|
3
|
+
export declare const AppleRipple: ObjectDirective<HTMLElement, boolean>;
|
|
4
|
+
export declare function ripple(node: VNode, enabled?: boolean): VNode;
|
|
5
|
+
export declare const AppleEntrance: ObjectDirective<HTMLElement, unknown>;
|
|
6
|
+
type SelectionValue = unknown | {
|
|
7
|
+
selector: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const AppleSelection: ObjectDirective<HTMLElement, SelectionValue>;
|
|
10
|
+
export {};
|