daub-ui 2.6.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/daub.d.ts ADDED
@@ -0,0 +1,110 @@
1
+ /**
2
+ * DAUB UI Kit — TypeScript Declarations
3
+ * Version 2.3.0
4
+ * https://daub.dev
5
+ */
6
+
7
+ interface DAUBToastOptions {
8
+ type?: 'info' | 'success' | 'warning' | 'error';
9
+ title?: string;
10
+ message: string;
11
+ duration?: number;
12
+ }
13
+
14
+ interface DAUBStatic {
15
+ /** Re-initialize all components (or scoped to a root element) */
16
+ init(root?: Element): void;
17
+
18
+ /** Show a toast notification. Pass a string for quick info toast, or options object for full control. */
19
+ toast(opts: string | DAUBToastOptions): void;
20
+
21
+ // --- Theme API ---
22
+
23
+ /** Get current theme variant name (e.g. 'light', 'dark', 'ink') */
24
+ getTheme(): string;
25
+ /** Set theme by variant name */
26
+ setTheme(theme: string): void;
27
+ /** Cycle to the next theme family */
28
+ cycleTheme(): void;
29
+ /** Get current theme family name (e.g. 'default', 'ink', 'dracula') */
30
+ getFamily(): string;
31
+ /** Set theme family by name */
32
+ setFamily(family: string): void;
33
+ /** Get current color scheme ('auto', 'light', or 'dark') */
34
+ getScheme(): string;
35
+ /** Set color scheme */
36
+ setScheme(scheme: 'auto' | 'light' | 'dark'): void;
37
+ /** Override accent color with a hex value */
38
+ setAccent(color: string): void;
39
+ /** Restore theme default accent color */
40
+ resetAccent(): void;
41
+ /** Get current accent color hex */
42
+ getAccent(): string;
43
+ /** Get computed value of any --db-* CSS variable (e.g. 'terracotta' → value of --db-terracotta) */
44
+ getColor(token: string): string;
45
+ /** Get category name for a theme family */
46
+ getCategory(family: string): string | undefined;
47
+
48
+ /** Array of all theme variant names */
49
+ readonly THEMES: string[];
50
+ /** Map of family name → { light, dark } variant names */
51
+ readonly THEME_FAMILIES: Record<string, { light: string; dark: string }>;
52
+ /** Array of all family names */
53
+ readonly FAMILY_NAMES: string[];
54
+ /** Map of category name → family name array */
55
+ readonly THEME_CATEGORIES: Record<string, string[]>;
56
+ /** Array of category names */
57
+ readonly CATEGORY_NAMES: string[];
58
+
59
+ // --- Overlay API ---
60
+
61
+ /** Open a modal by id or element */
62
+ openModal(id: string | Element): void;
63
+ /** Close a modal by id or element */
64
+ closeModal(id: string | Element): void;
65
+ /** Open an alert dialog by id */
66
+ openAlertDialog(id: string): void;
67
+ /** Close an alert dialog */
68
+ closeAlertDialog(el: string | Element): void;
69
+ /** Open a sheet panel by id */
70
+ openSheet(id: string): void;
71
+ /** Close a sheet panel by id */
72
+ closeSheet(id: string): void;
73
+ /** Open a drawer by id */
74
+ openDrawer(id: string): void;
75
+ /** Close a drawer by id */
76
+ closeDrawer(id: string): void;
77
+ /** Open a command palette by id */
78
+ openCommand(id: string): void;
79
+ /** Close a command palette by id */
80
+ closeCommand(id: string): void;
81
+
82
+ // --- Layout API ---
83
+
84
+ /** Toggle sidebar collapsed state */
85
+ toggleSidebar(id: string | Element): void;
86
+ /** Toggle mobile navbar menu */
87
+ toggleNavbar(id: string | Element): void;
88
+ /** Fix nested border-radius for inner elements */
89
+ fixNestedRadius(el?: Element): void;
90
+
91
+ // --- Texture API ---
92
+
93
+ /** Set background texture type */
94
+ setTexture(type: string): void;
95
+ /** Get current background texture type */
96
+ getTexture(): string;
97
+ /** Array of available texture types */
98
+ readonly TEXTURES: string[];
99
+
100
+ // --- Icons ---
101
+
102
+ /** Re-initialize Lucide icons (call after adding dynamic content) */
103
+ refreshIcons(): void;
104
+ }
105
+
106
+ declare const DAUB: DAUBStatic;
107
+
108
+ interface Window {
109
+ DAUB: DAUBStatic;
110
+ }