zabi-components 4.0.2 → 5.0.1
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 +2 -2
- package/dist/SSRSafe.svelte +47 -0
- package/dist/SSRSafe.svelte.d.ts +11 -0
- package/dist/atoms/Badge.svelte +76 -0
- package/dist/atoms/Badge.svelte.d.ts +9 -0
- package/dist/atoms/Button.svelte +72 -0
- package/dist/atoms/Button.svelte.d.ts +13 -0
- package/dist/atoms/Card.svelte +59 -0
- package/dist/atoms/Card.svelte.d.ts +12 -0
- package/dist/atoms/Checkbox.svelte +60 -0
- package/dist/atoms/Checkbox.svelte.d.ts +10 -0
- package/dist/atoms/CodeBlock.svelte +125 -0
- package/dist/atoms/CodeBlock.svelte.d.ts +8 -0
- package/dist/atoms/ColorPicker.svelte +171 -0
- package/dist/atoms/ColorPicker.svelte.d.ts +9 -0
- package/dist/atoms/FeatureCard.svelte +74 -0
- package/dist/atoms/FeatureCard.svelte.d.ts +17 -0
- package/dist/atoms/Heading.svelte +5 -0
- package/dist/atoms/Heading.svelte.d.ts +7 -0
- package/dist/atoms/Input.svelte +98 -0
- package/dist/atoms/Input.svelte.d.ts +14 -0
- package/dist/atoms/OptimizedImage.svelte +32 -0
- package/dist/atoms/OptimizedImage.svelte.d.ts +13 -0
- package/dist/atoms/Progress.svelte +61 -0
- package/dist/atoms/Progress.svelte.d.ts +9 -0
- package/dist/atoms/Select.svelte +85 -0
- package/dist/atoms/Select.svelte.d.ts +16 -0
- package/dist/atoms/Skeleton.svelte +20 -0
- package/dist/atoms/Skeleton.svelte.d.ts +8 -0
- package/dist/atoms/Textarea.svelte +116 -0
- package/dist/atoms/Textarea.svelte.d.ts +14 -0
- package/dist/atoms/ThemeToggle.svelte +89 -0
- package/dist/atoms/ThemeToggle.svelte.d.ts +7 -0
- package/dist/atoms/Toast.svelte +58 -0
- package/dist/atoms/Toast.svelte.d.ts +9 -0
- package/dist/atoms/Toggle.svelte +94 -0
- package/dist/atoms/Toggle.svelte.d.ts +12 -0
- package/dist/atoms/Tooltip.svelte +188 -0
- package/dist/atoms/Tooltip.svelte.d.ts +12 -0
- package/dist/atoms/index.d.ts +4 -15
- package/dist/atoms/index.js +10 -23
- package/dist/components/atoms/index.d.ts +10 -0
- package/dist/components/atoms/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/components/molecules/index.d.ts.map +1 -0
- package/dist/components/organisms/index.d.ts +1 -0
- package/dist/components/organisms/index.d.ts.map +1 -0
- package/dist/index.d.ts +30 -15
- package/dist/index.js +74 -0
- package/dist/molecules/Alert.svelte +114 -0
- package/dist/molecules/Alert.svelte.d.ts +14 -0
- package/dist/molecules/ComponentDemo.svelte +96 -0
- package/dist/molecules/ComponentDemo.svelte.d.ts +13 -0
- package/dist/molecules/ContactForm.svelte +98 -0
- package/dist/molecules/ContactForm.svelte.d.ts +10 -0
- package/dist/molecules/Dropdown.svelte +128 -0
- package/dist/molecules/Dropdown.svelte.d.ts +11 -0
- package/dist/molecules/Form.svelte +37 -0
- package/dist/molecules/Form.svelte.d.ts +12 -0
- package/dist/molecules/ImageUpload.svelte +112 -0
- package/dist/molecules/ImageUpload.svelte.d.ts +14 -0
- package/dist/molecules/Modal.svelte +85 -0
- package/dist/molecules/Modal.svelte.d.ts +13 -0
- package/dist/molecules/SlideUp.svelte +73 -0
- package/dist/molecules/SlideUp.svelte.d.ts +12 -0
- package/dist/molecules/Tabs.svelte +68 -0
- package/dist/molecules/Tabs.svelte.d.ts +17 -0
- package/dist/molecules/index.d.ts +0 -11
- package/dist/molecules/index.js +2 -13
- package/dist/organisms/Navbar.svelte +99 -0
- package/dist/organisms/Navbar.svelte.d.ts +14 -0
- package/dist/organisms/Navigation.svelte +48 -0
- package/dist/organisms/Navigation.svelte.d.ts +15 -0
- package/dist/organisms/index.d.ts +0 -4
- package/dist/organisms/index.js +2 -5
- package/dist/routes/lib/ssr-safe.ts +57 -0
- package/dist/routes/lib/variant-utils.ts +98 -0
- package/dist/zabi-components.css +399 -1
- package/package.json +41 -17
- package/dist/CodeBlock-pT5-FgZd.js +0 -431
- package/dist/ContactForm-CHI_jeFY.js +0 -580
- package/dist/FeatureCard-iBFGbgVE.js +0 -656
- package/dist/Navigation-BOT-UHg0.js +0 -104
- package/dist/ThemeToggle-BlNPkAQy.js +0 -48
- package/dist/index/index.js +0 -63
- package/dist/molecules/KeyValueForm.types.d.ts +0 -11
- package/dist/ssr-safe-bsWGK4V4.js +0 -2232
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.js +0 -1
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// SSR-safe utilities for zabi-components
|
|
2
|
+
// This ensures components work properly during server-side rendering
|
|
3
|
+
|
|
4
|
+
// Check if we're in a browser environment
|
|
5
|
+
export function isBrowser(): boolean {
|
|
6
|
+
return typeof window !== 'undefined';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function safeWindow(): Window | undefined {
|
|
10
|
+
return isBrowser() ? window : undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function safeDocument(): Document | undefined {
|
|
14
|
+
return isBrowser() ? document : undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function safeLocalStorage(): Storage | undefined {
|
|
18
|
+
return isBrowser() ? localStorage : undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function safeSessionStorage(): Storage | undefined {
|
|
22
|
+
return isBrowser() ? sessionStorage : undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function safeRequestAnimationFrame(callback: FrameRequestCallback): number | undefined {
|
|
26
|
+
return isBrowser() ? requestAnimationFrame(callback) : undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function safeSetTimeout(callback: () => void, delay: number): NodeJS.Timeout | undefined {
|
|
30
|
+
return isBrowser() ? setTimeout(callback, delay) : undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function safeClearTimeout(id: NodeJS.Timeout | undefined): void {
|
|
34
|
+
if (isBrowser() && id) {
|
|
35
|
+
clearTimeout(id);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function safeSetInterval(callback: () => void, delay: number): NodeJS.Timeout | undefined {
|
|
40
|
+
return isBrowser() ? setInterval(callback, delay) : undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function safeClearInterval(id: NodeJS.Timeout | undefined): void {
|
|
44
|
+
if (isBrowser() && id) {
|
|
45
|
+
clearInterval(id);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Generate SSR-safe unique IDs
|
|
50
|
+
let idCounter = 0;
|
|
51
|
+
export function generateId(prefix: string = 'id'): string {
|
|
52
|
+
if (isBrowser()) {
|
|
53
|
+
return `${prefix}-${Math.random().toString(36).substr(2, 9)}`;
|
|
54
|
+
} else {
|
|
55
|
+
return `${prefix}-ssr-${++idCounter}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for handling component variants with semantic colors
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type Variant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Get variant classes for input components (Input, Textarea)
|
|
9
|
+
*/
|
|
10
|
+
export function getInputVariantClasses(variant: Variant): string {
|
|
11
|
+
const variantMap: Record<Variant, string> = {
|
|
12
|
+
default: 'border-gray-300 focus:border-blue-500 focus:ring-blue-500',
|
|
13
|
+
success: 'border-green-300 focus:border-green-500 focus:ring-green-500',
|
|
14
|
+
warning: 'border-yellow-300 focus:border-yellow-500 focus:ring-yellow-500',
|
|
15
|
+
error: 'border-red-300 focus:border-red-500 focus:ring-red-500',
|
|
16
|
+
info: 'border-blue-300 focus:border-blue-500 focus:ring-blue-500',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return variantMap[variant] || variantMap.default;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get variant classes for card components
|
|
24
|
+
*/
|
|
25
|
+
export function getCardVariantClasses(variant: Variant): string {
|
|
26
|
+
const variantMap: Record<Variant, string> = {
|
|
27
|
+
default: 'border-gray-200 bg-white',
|
|
28
|
+
success: 'border-green-200 bg-green-50',
|
|
29
|
+
warning: 'border-yellow-200 bg-yellow-50',
|
|
30
|
+
error: 'border-red-200 bg-red-50',
|
|
31
|
+
info: 'border-blue-200 bg-blue-50',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return variantMap[variant] || variantMap.default;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get generic variant classes for any component
|
|
39
|
+
*/
|
|
40
|
+
export function getVariantClasses(variant: Variant, type: 'border' | 'text' | 'bg'): string {
|
|
41
|
+
const variantMap: Record<Variant, Record<'border' | 'text' | 'bg', string>> = {
|
|
42
|
+
default: {
|
|
43
|
+
border: 'border-gray-300',
|
|
44
|
+
text: 'text-gray-900',
|
|
45
|
+
bg: 'bg-white'
|
|
46
|
+
},
|
|
47
|
+
success: {
|
|
48
|
+
border: 'border-green-300',
|
|
49
|
+
text: 'text-green-900',
|
|
50
|
+
bg: 'bg-green-50'
|
|
51
|
+
},
|
|
52
|
+
warning: {
|
|
53
|
+
border: 'border-yellow-300',
|
|
54
|
+
text: 'text-yellow-900',
|
|
55
|
+
bg: 'bg-yellow-50'
|
|
56
|
+
},
|
|
57
|
+
error: {
|
|
58
|
+
border: 'border-red-300',
|
|
59
|
+
text: 'text-red-900',
|
|
60
|
+
bg: 'bg-red-50'
|
|
61
|
+
},
|
|
62
|
+
info: {
|
|
63
|
+
border: 'border-blue-300',
|
|
64
|
+
text: 'text-blue-900',
|
|
65
|
+
bg: 'bg-blue-50'
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return variantMap[variant]?.[type] || variantMap.default[type];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get all variant classes for a component (border, text, background)
|
|
74
|
+
*/
|
|
75
|
+
export function getAllVariantClasses(variant: Variant): {
|
|
76
|
+
border: string;
|
|
77
|
+
text: string;
|
|
78
|
+
bg: string;
|
|
79
|
+
} {
|
|
80
|
+
return {
|
|
81
|
+
border: getVariantClasses(variant, 'border'),
|
|
82
|
+
text: getVariantClasses(variant, 'text'),
|
|
83
|
+
bg: getVariantClasses(variant, 'bg'),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Create a variant class map for use in reactive statements
|
|
89
|
+
*/
|
|
90
|
+
export function createVariantClassMap<T extends string>(
|
|
91
|
+
variants: T[],
|
|
92
|
+
prefix: string
|
|
93
|
+
): Record<T, string> {
|
|
94
|
+
return variants.reduce((acc, variant) => {
|
|
95
|
+
acc[variant] = `${prefix}-${variant}`;
|
|
96
|
+
return acc;
|
|
97
|
+
}, {} as Record<T, string>);
|
|
98
|
+
}
|
package/dist/zabi-components.css
CHANGED
|
@@ -1 +1,399 @@
|
|
|
1
|
-
|
|
1
|
+
/* Zabi Components CSS */
|
|
2
|
+
@import "tailwindcss";
|
|
3
|
+
|
|
4
|
+
/* ========================================
|
|
5
|
+
SEMANTIC COLOR SYSTEM
|
|
6
|
+
======================================== */
|
|
7
|
+
|
|
8
|
+
@theme {
|
|
9
|
+
/* Surface Colors - Semantic naming with stone palette */
|
|
10
|
+
--color-surface: theme(colors.stone.50);
|
|
11
|
+
--color-surface-secondary: theme(colors.stone.100);
|
|
12
|
+
--color-surface-tertiary: theme(colors.stone.200);
|
|
13
|
+
--color-surface-elevated: theme(colors.white);
|
|
14
|
+
--color-surface-hover: theme(colors.stone.100);
|
|
15
|
+
--color-surface-active: theme(colors.stone.200);
|
|
16
|
+
--color-surface-inverse: theme(colors.stone.900);
|
|
17
|
+
--color-surface-disabled: theme(colors.stone.200);
|
|
18
|
+
|
|
19
|
+
/* Background Colors */
|
|
20
|
+
--color-background: theme(colors.white);
|
|
21
|
+
--color-background-secondary: theme(colors.stone.50);
|
|
22
|
+
--color-background-tertiary: theme(colors.stone.100);
|
|
23
|
+
|
|
24
|
+
/* Page Colors */
|
|
25
|
+
--color-page: theme(colors.white);
|
|
26
|
+
--color-page-secondary: theme(colors.stone.50);
|
|
27
|
+
|
|
28
|
+
/* Card Colors */
|
|
29
|
+
--color-card: theme(colors.white);
|
|
30
|
+
--color-card-hover: theme(colors.stone.50);
|
|
31
|
+
--color-card-active: theme(colors.stone.100);
|
|
32
|
+
--color-card-elevated: theme(colors.white);
|
|
33
|
+
|
|
34
|
+
/* Text Colors */
|
|
35
|
+
--color-headline: theme(colors.stone.900);
|
|
36
|
+
--color-body: theme(colors.stone.800);
|
|
37
|
+
--color-description: theme(colors.stone.600);
|
|
38
|
+
--color-caption: theme(colors.stone.500);
|
|
39
|
+
--color-input-placeholder: theme(colors.stone.400);
|
|
40
|
+
--color-label: theme(colors.stone.700);
|
|
41
|
+
--color-link: theme(colors.blue.600);
|
|
42
|
+
--color-link-hover: theme(colors.blue.700);
|
|
43
|
+
--color-success: theme(colors.green.700);
|
|
44
|
+
--color-warning: theme(colors.yellow.700);
|
|
45
|
+
--color-error: theme(colors.red.700);
|
|
46
|
+
--color-inverse: theme(colors.white);
|
|
47
|
+
--color-disabled: theme(colors.stone.400);
|
|
48
|
+
|
|
49
|
+
/* Border Colors */
|
|
50
|
+
--color-border: theme(colors.stone.200);
|
|
51
|
+
--color-border-secondary: theme(colors.stone.300);
|
|
52
|
+
--color-border-hover: theme(colors.stone.400);
|
|
53
|
+
--color-border-focus: theme(colors.blue.500);
|
|
54
|
+
--color-border-disabled: theme(colors.stone.200);
|
|
55
|
+
|
|
56
|
+
/* Focus Colors */
|
|
57
|
+
--color-focus: theme(colors.blue.500);
|
|
58
|
+
--color-focus-hover: theme(colors.blue.600);
|
|
59
|
+
--color-focus-active: theme(colors.blue.700);
|
|
60
|
+
--color-focus-disabled: theme(colors.blue.300);
|
|
61
|
+
--color-focus-light: theme(colors.blue.50);
|
|
62
|
+
--color-focus-dark: theme(colors.blue.700);
|
|
63
|
+
--color-focus-surface: theme(colors.blue.50);
|
|
64
|
+
--color-focus-text: theme(colors.blue.700);
|
|
65
|
+
--color-focus-ring: theme(colors.blue.500);
|
|
66
|
+
--color-focus-ring-offset: theme(colors.white);
|
|
67
|
+
|
|
68
|
+
/* Primary Colors */
|
|
69
|
+
--color-primary: theme(colors.blue.600);
|
|
70
|
+
--color-primary-hover: theme(colors.blue.700);
|
|
71
|
+
--color-primary-active: theme(colors.blue.800);
|
|
72
|
+
--color-primary-disabled: theme(colors.blue.300);
|
|
73
|
+
--color-primary-light: theme(colors.blue.100);
|
|
74
|
+
--color-primary-dark: theme(colors.blue.800);
|
|
75
|
+
|
|
76
|
+
/* Secondary Colors */
|
|
77
|
+
--color-secondary: theme(colors.stone.600);
|
|
78
|
+
--color-secondary-hover: theme(colors.stone.700);
|
|
79
|
+
--color-secondary-active: theme(colors.stone.800);
|
|
80
|
+
--color-secondary-disabled: theme(colors.stone.300);
|
|
81
|
+
--color-secondary-light: theme(colors.stone.100);
|
|
82
|
+
--color-secondary-dark: theme(colors.stone.800);
|
|
83
|
+
|
|
84
|
+
/* Success Colors */
|
|
85
|
+
--color-success: theme(colors.green.600);
|
|
86
|
+
--color-success-hover: theme(colors.green.700);
|
|
87
|
+
--color-success-active: theme(colors.green.800);
|
|
88
|
+
--color-success-disabled: theme(colors.green.300);
|
|
89
|
+
--color-success-light: theme(colors.green.100);
|
|
90
|
+
--color-success-dark: theme(colors.green.800);
|
|
91
|
+
--color-success-surface: theme(colors.green.100);
|
|
92
|
+
--color-success-text: theme(colors.green.800);
|
|
93
|
+
|
|
94
|
+
/* Warning Colors */
|
|
95
|
+
--color-warning: theme(colors.yellow.600);
|
|
96
|
+
--color-warning-hover: theme(colors.yellow.700);
|
|
97
|
+
--color-warning-active: theme(colors.yellow.800);
|
|
98
|
+
--color-warning-disabled: theme(colors.yellow.300);
|
|
99
|
+
--color-warning-light: theme(colors.yellow.100);
|
|
100
|
+
--color-warning-dark: theme(colors.yellow.800);
|
|
101
|
+
--color-warning-surface: theme(colors.yellow.100);
|
|
102
|
+
--color-warning-text: theme(colors.yellow.800);
|
|
103
|
+
|
|
104
|
+
/* Error Colors */
|
|
105
|
+
--color-error: theme(colors.red.600);
|
|
106
|
+
--color-error-hover: theme(colors.red.700);
|
|
107
|
+
--color-error-active: theme(colors.red.800);
|
|
108
|
+
--color-error-disabled: theme(colors.red.300);
|
|
109
|
+
--color-error-light: theme(colors.red.100);
|
|
110
|
+
--color-error-dark: theme(colors.red.800);
|
|
111
|
+
--color-error-surface: theme(colors.red.100);
|
|
112
|
+
--color-error-text: theme(colors.red.800);
|
|
113
|
+
|
|
114
|
+
/* Info Colors */
|
|
115
|
+
--color-info: theme(colors.blue.600);
|
|
116
|
+
--color-info-hover: theme(colors.blue.700);
|
|
117
|
+
--color-info-active: theme(colors.blue.800);
|
|
118
|
+
--color-info-disabled: theme(colors.blue.300);
|
|
119
|
+
--color-info-light: theme(colors.blue.100);
|
|
120
|
+
--color-info-dark: theme(colors.blue.800);
|
|
121
|
+
--color-info-surface: theme(colors.blue.100);
|
|
122
|
+
--color-info-text: theme(colors.blue.800);
|
|
123
|
+
|
|
124
|
+
/* Shadow Colors */
|
|
125
|
+
--shadow-color: 0 0 0;
|
|
126
|
+
--shadow-opacity: 0.1;
|
|
127
|
+
--shadow-sm: 0 1px 3px 0 rgb(var(--shadow-color) / var(--shadow-opacity)), 0 1px 2px -1px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
128
|
+
--shadow-md: 0 4px 6px -1px rgb(var(--shadow-color) / var(--shadow-opacity)), 0 2px 4px -2px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
129
|
+
--shadow-lg: 0 10px 15px -3px rgb(var(--shadow-color) / var(--shadow-opacity)), 0 4px 6px -4px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
130
|
+
--shadow-xl: 0 20px 25px -5px rgb(var(--shadow-color) / var(--shadow-opacity)), 0 8px 10px -6px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
131
|
+
|
|
132
|
+
/* Spacing */
|
|
133
|
+
--spacing-xs: 0.25rem;
|
|
134
|
+
--spacing-sm: 0.5rem;
|
|
135
|
+
--spacing-md: 1rem;
|
|
136
|
+
--spacing-lg: 1.5rem;
|
|
137
|
+
--spacing-xl: 2rem;
|
|
138
|
+
--spacing-2xl: 3rem;
|
|
139
|
+
|
|
140
|
+
/* Border Radius */
|
|
141
|
+
--radius-sm: 0.25rem;
|
|
142
|
+
--radius-md: 0.375rem;
|
|
143
|
+
--radius-lg: 0.5rem;
|
|
144
|
+
--radius-xl: 0.75rem;
|
|
145
|
+
|
|
146
|
+
/* Z-index */
|
|
147
|
+
--z-dropdown: 1000;
|
|
148
|
+
--z-sticky: 1020;
|
|
149
|
+
--z-fixed: 1030;
|
|
150
|
+
--z-modal-backdrop: 1040;
|
|
151
|
+
--z-modal: 1050;
|
|
152
|
+
--z-popover: 1060;
|
|
153
|
+
--z-tooltip: 1070;
|
|
154
|
+
--z-toast: 1080;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ========================================
|
|
158
|
+
DARK MODE THEME
|
|
159
|
+
======================================== */
|
|
160
|
+
.dark {
|
|
161
|
+
/* Surface Colors - Dark mode variants */
|
|
162
|
+
--color-surface: theme(colors.stone.800);
|
|
163
|
+
--color-surface-secondary: theme(colors.stone.700);
|
|
164
|
+
--color-surface-tertiary: theme(colors.stone.600);
|
|
165
|
+
--color-surface-elevated: theme(colors.stone.800);
|
|
166
|
+
--color-surface-hover: theme(colors.stone.700);
|
|
167
|
+
--color-surface-active: theme(colors.stone.600);
|
|
168
|
+
--color-surface-inverse: theme(colors.stone.100);
|
|
169
|
+
--color-surface-disabled: theme(colors.stone.700);
|
|
170
|
+
|
|
171
|
+
/* Background Colors */
|
|
172
|
+
--color-background: theme(colors.stone.900);
|
|
173
|
+
--color-background-secondary: theme(colors.stone.800);
|
|
174
|
+
--color-background-tertiary: theme(colors.stone.700);
|
|
175
|
+
|
|
176
|
+
/* Page Colors */
|
|
177
|
+
--color-page: theme(colors.stone.800);
|
|
178
|
+
--color-page-secondary: theme(colors.stone.800);
|
|
179
|
+
|
|
180
|
+
/* Card Colors */
|
|
181
|
+
--color-card: theme(colors.stone.800);
|
|
182
|
+
--color-card-hover: theme(colors.stone.700);
|
|
183
|
+
--color-card-active: theme(colors.stone.600);
|
|
184
|
+
--color-card-elevated: theme(colors.stone.800);
|
|
185
|
+
|
|
186
|
+
/* Text Colors */
|
|
187
|
+
--color-headline: theme(colors.stone.100);
|
|
188
|
+
--color-body: theme(colors.stone.200);
|
|
189
|
+
--color-description: theme(colors.stone.300);
|
|
190
|
+
--color-caption: theme(colors.stone.400);
|
|
191
|
+
--color-input-placeholder: theme(colors.stone.500);
|
|
192
|
+
--color-label: theme(colors.stone.200);
|
|
193
|
+
--color-link: theme(colors.blue.400);
|
|
194
|
+
--color-link-hover: theme(colors.blue.300);
|
|
195
|
+
--color-success: theme(colors.green.400);
|
|
196
|
+
--color-warning: theme(colors.yellow.400);
|
|
197
|
+
--color-error: theme(colors.red.400);
|
|
198
|
+
--color-inverse: theme(colors.stone.900);
|
|
199
|
+
--color-disabled: theme(colors.stone.500);
|
|
200
|
+
|
|
201
|
+
/* Border Colors */
|
|
202
|
+
--color-border: theme(colors.stone.600);
|
|
203
|
+
--color-border-secondary: theme(colors.stone.500);
|
|
204
|
+
--color-border-hover: theme(colors.stone.400);
|
|
205
|
+
--color-border-focus: theme(colors.blue.400);
|
|
206
|
+
--color-border-disabled: theme(colors.stone.600);
|
|
207
|
+
|
|
208
|
+
/* Focus Colors */
|
|
209
|
+
--color-focus: theme(colors.blue.400);
|
|
210
|
+
--color-focus-hover: theme(colors.blue.500);
|
|
211
|
+
--color-focus-active: theme(colors.blue.600);
|
|
212
|
+
--color-focus-disabled: theme(colors.blue.600);
|
|
213
|
+
--color-focus-light: theme(colors.blue.900);
|
|
214
|
+
--color-focus-dark: theme(colors.blue.400);
|
|
215
|
+
--color-focus-surface: theme(colors.blue.900);
|
|
216
|
+
--color-focus-text: theme(colors.blue.400);
|
|
217
|
+
--color-focus-ring: theme(colors.blue.400);
|
|
218
|
+
--color-focus-ring-offset: theme(colors.stone.700);
|
|
219
|
+
|
|
220
|
+
/* Primary Colors */
|
|
221
|
+
--color-primary: theme(colors.blue.600);
|
|
222
|
+
--color-primary-hover: theme(colors.blue.700);
|
|
223
|
+
--color-primary-active: theme(colors.blue.800);
|
|
224
|
+
--color-primary-disabled: theme(colors.blue.300);
|
|
225
|
+
--color-primary-light: theme(colors.blue.100);
|
|
226
|
+
--color-primary-dark: theme(colors.blue.800);
|
|
227
|
+
|
|
228
|
+
/* Secondary Colors */
|
|
229
|
+
--color-secondary: theme(colors.stone.600);
|
|
230
|
+
--color-secondary-hover: theme(colors.stone.700);
|
|
231
|
+
--color-secondary-active: theme(colors.stone.800);
|
|
232
|
+
--color-secondary-disabled: theme(colors.stone.300);
|
|
233
|
+
--color-secondary-light: theme(colors.stone.100);
|
|
234
|
+
--color-secondary-dark: theme(colors.stone.800);
|
|
235
|
+
|
|
236
|
+
/* Success Colors */
|
|
237
|
+
--color-success: theme(colors.green.600);
|
|
238
|
+
--color-success-hover: theme(colors.green.700);
|
|
239
|
+
--color-success-active: theme(colors.green.800);
|
|
240
|
+
--color-success-disabled: theme(colors.green.300);
|
|
241
|
+
--color-success-light: theme(colors.green.100);
|
|
242
|
+
--color-success-dark: theme(colors.green.800);
|
|
243
|
+
--color-success-surface: theme(colors.green.100);
|
|
244
|
+
--color-success-text: theme(colors.green.800);
|
|
245
|
+
|
|
246
|
+
/* Warning Colors */
|
|
247
|
+
--color-warning: theme(colors.yellow.600);
|
|
248
|
+
--color-warning-hover: theme(colors.yellow.700);
|
|
249
|
+
--color-warning-active: theme(colors.yellow.800);
|
|
250
|
+
--color-warning-disabled: theme(colors.yellow.300);
|
|
251
|
+
--color-warning-light: theme(colors.yellow.100);
|
|
252
|
+
--color-warning-dark: theme(colors.yellow.800);
|
|
253
|
+
--color-warning-surface: theme(colors.yellow.100);
|
|
254
|
+
--color-warning-text: theme(colors.yellow.800);
|
|
255
|
+
|
|
256
|
+
/* Error Colors */
|
|
257
|
+
--color-error: theme(colors.red.600);
|
|
258
|
+
--color-error-hover: theme(colors.red.700);
|
|
259
|
+
--color-error-active: theme(colors.red.800);
|
|
260
|
+
--color-error-disabled: theme(colors.red.300);
|
|
261
|
+
--color-error-light: theme(colors.red.100);
|
|
262
|
+
--color-error-dark: theme(colors.red.800);
|
|
263
|
+
--color-error-surface: theme(colors.red.100);
|
|
264
|
+
--color-error-text: theme(colors.red.800);
|
|
265
|
+
|
|
266
|
+
/* Info Colors */
|
|
267
|
+
--color-info: theme(colors.blue.600);
|
|
268
|
+
--color-info-hover: theme(colors.blue.700);
|
|
269
|
+
--color-info-active: theme(colors.blue.800);
|
|
270
|
+
--color-info-disabled: theme(colors.blue.300);
|
|
271
|
+
--color-info-light: theme(colors.blue.100);
|
|
272
|
+
--color-info-dark: theme(colors.blue.800);
|
|
273
|
+
--color-info-surface: theme(colors.blue.100);
|
|
274
|
+
--color-info-text: theme(colors.blue.800);
|
|
275
|
+
|
|
276
|
+
/* Shadow Colors */
|
|
277
|
+
--shadow-opacity: 0.3;
|
|
278
|
+
--shadow-sm: 0 1px 3px 0 rgb(var(--shadow-color) / var(--shadow-opacity)), 0 1px 2px -1px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
279
|
+
--shadow-md: 0 4px 6px -1px rgb(var(--shadow-color) / var(--shadow-opacity)), 0 2px 4px -2px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
280
|
+
--shadow-lg: 0 10px 15px -3px rgb(var(--shadow-color) / var(--shadow-opacity)), 0 4px 6px -4px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
281
|
+
--shadow-xl: 0 20px 25px -5px rgb(var(--shadow-color) / var(--shadow-opacity)), 0 8px 10px -6px rgb(var(--shadow-color) / var(--shadow-opacity));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* ========================================
|
|
285
|
+
UTILITY CLASSES
|
|
286
|
+
======================================== */
|
|
287
|
+
|
|
288
|
+
/* Surface utilities */
|
|
289
|
+
.bg-surface {
|
|
290
|
+
background-color: var(--color-surface);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.bg-surface-secondary {
|
|
294
|
+
background-color: var(--color-surface-secondary);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.bg-surface-tertiary {
|
|
298
|
+
background-color: var(--color-surface-tertiary);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.bg-surface-elevated {
|
|
302
|
+
background-color: var(--color-surface-elevated);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.bg-surface-hover:hover {
|
|
306
|
+
background-color: var(--color-surface-hover);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.bg-surface-active:active {
|
|
310
|
+
background-color: var(--color-surface-active);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.bg-page {
|
|
314
|
+
background-color: var(--color-page);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* Text utilities */
|
|
318
|
+
.text-headline {
|
|
319
|
+
color: var(--color-headline);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.text-body {
|
|
323
|
+
color: var(--color-body);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.text-description {
|
|
327
|
+
color: var(--color-description);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.text-caption {
|
|
331
|
+
color: var(--color-caption);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.text-input-placeholder {
|
|
335
|
+
color: var(--color-input-placeholder);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.text-label {
|
|
339
|
+
color: var(--color-label);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.text-link {
|
|
343
|
+
color: var(--color-link);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.text-link:hover {
|
|
347
|
+
color: var(--color-link-hover);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.text-success {
|
|
351
|
+
color: var(--color-success);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.text-warning {
|
|
355
|
+
color: var(--color-warning);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.text-error {
|
|
359
|
+
color: var(--color-error);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.text-inverse {
|
|
363
|
+
color: var(--color-inverse);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.text-disabled {
|
|
367
|
+
color: var(--color-disabled);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/* Border utilities */
|
|
371
|
+
.border-primary {
|
|
372
|
+
border-color: var(--color-border);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.border-secondary {
|
|
376
|
+
border-color: var(--color-border-secondary);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.border-hover:hover {
|
|
380
|
+
border-color: var(--color-border-hover);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.border-focus:focus {
|
|
384
|
+
border-color: var(--color-border-focus);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.border-disabled:disabled {
|
|
388
|
+
border-color: var(--color-border-disabled);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* Focus utilities */
|
|
392
|
+
.focus-ring {
|
|
393
|
+
box-shadow: 0 0 0 2px var(--color-focus-ring-offset), 0 0 0 4px var(--color-focus-ring);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.focus-outline {
|
|
397
|
+
outline: 2px solid var(--color-focus-ring);
|
|
398
|
+
outline-offset: 2px;
|
|
399
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zabi-components",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A modern Svelte 5 component library with TypeScript, Tailwind CSS, and 100% SSR-safe components",
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"description": "A modern Svelte 5 component library with TypeScript, Tailwind CSS v4, and 100% SSR-safe components",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index
|
|
7
|
-
"module": "dist/index
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index
|
|
13
|
-
"svelte": "./dist/index
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"svelte": "./dist/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./atoms": {
|
|
16
16
|
"types": "./dist/atoms/index.d.ts",
|
|
@@ -31,6 +31,18 @@
|
|
|
31
31
|
"types": "./dist/types/index.d.ts",
|
|
32
32
|
"import": "./dist/types/index.js"
|
|
33
33
|
},
|
|
34
|
+
"./react": {
|
|
35
|
+
"types": "./dist/react/index.d.ts",
|
|
36
|
+
"import": "./dist/react/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./lib/ssr-safe": {
|
|
39
|
+
"types": "./dist/routes/lib/ssr-safe.ts",
|
|
40
|
+
"import": "./dist/routes/lib/ssr-safe.ts"
|
|
41
|
+
},
|
|
42
|
+
"./lib/variant-utils": {
|
|
43
|
+
"types": "./dist/routes/lib/variant-utils.ts",
|
|
44
|
+
"import": "./dist/routes/lib/variant-utils.ts"
|
|
45
|
+
},
|
|
34
46
|
"./dist/zabi-components.css": "./dist/zabi-components.css",
|
|
35
47
|
"./package.json": "./package.json"
|
|
36
48
|
},
|
|
@@ -58,7 +70,8 @@
|
|
|
58
70
|
"scripts": {
|
|
59
71
|
"dev": "vite dev",
|
|
60
72
|
"build": "vite build && npm run build:types",
|
|
61
|
-
"build:lib": "
|
|
73
|
+
"build:lib": "svelte-package -o dist --input src/components && mkdir -p dist/routes/lib && cp src/routes/lib/ssr-safe.ts dist/routes/lib/ && cp src/routes/lib/variant-utils.ts dist/routes/lib/ && npm run build:css && npm run build:types",
|
|
74
|
+
"build:css": "echo '/* Zabi Components CSS */' > dist/zabi-components.css && cat src/app.css >> dist/zabi-components.css && find dist -name '*.css' -not -name 'zabi-components.css' -exec cat {} \\; >> dist/zabi-components.css",
|
|
62
75
|
"build:types": "tsc --project tsconfig.lib.json",
|
|
63
76
|
"preview": "vite preview",
|
|
64
77
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
@@ -69,26 +82,31 @@
|
|
|
69
82
|
"devDependencies": {
|
|
70
83
|
"@storybook/addon-svelte-csf": "^5.0.8",
|
|
71
84
|
"@storybook/sveltekit": "^9.1.7",
|
|
72
|
-
"@sveltejs/adapter-auto": "^
|
|
73
|
-
"@sveltejs/kit": "^2.
|
|
74
|
-
"@sveltejs/
|
|
75
|
-
"@
|
|
85
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
86
|
+
"@sveltejs/kit": "^2.47.2",
|
|
87
|
+
"@sveltejs/package": "^2.5.4",
|
|
88
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.0",
|
|
89
|
+
"@tsconfig/svelte": "^5.0.5",
|
|
76
90
|
"@types/node": "^24.5.2",
|
|
91
|
+
"@types/react": "^19.2.2",
|
|
92
|
+
"@tailwindcss/postcss": "^4.1.13",
|
|
77
93
|
"autoprefixer": "^10.4.17",
|
|
78
94
|
"postcss": "^8.4.35",
|
|
79
95
|
"storybook": "^9.1.7",
|
|
80
96
|
"svelte": "^5.38.10",
|
|
81
|
-
"svelte-check": "^4.
|
|
82
|
-
"tailwindcss": "^
|
|
83
|
-
"typescript": "
|
|
84
|
-
"vite": "^
|
|
97
|
+
"svelte-check": "^4.3.1",
|
|
98
|
+
"tailwindcss": "^4.1.13",
|
|
99
|
+
"typescript": "~5.8.3",
|
|
100
|
+
"vite": "^7.1.6"
|
|
85
101
|
},
|
|
86
102
|
"dependencies": {
|
|
87
103
|
"@lucide/svelte": "^0.544.0",
|
|
88
|
-
"@opentelemetry/api": "^1.9.0"
|
|
104
|
+
"@opentelemetry/api": "^1.9.0",
|
|
105
|
+
"glob": "^11.0.3"
|
|
89
106
|
},
|
|
90
107
|
"peerDependencies": {
|
|
91
108
|
"@sveltejs/kit": "^2.0.0",
|
|
109
|
+
"react": "^18.0.0",
|
|
92
110
|
"svelte": "^5.38.10"
|
|
93
111
|
},
|
|
94
112
|
"peerDependenciesMeta": {
|
|
@@ -97,8 +115,14 @@
|
|
|
97
115
|
},
|
|
98
116
|
"@sveltejs/kit": {
|
|
99
117
|
"optional": true
|
|
118
|
+
},
|
|
119
|
+
"react": {
|
|
120
|
+
"optional": true
|
|
100
121
|
}
|
|
101
122
|
},
|
|
102
|
-
"
|
|
123
|
+
"overrides": {
|
|
124
|
+
"cookie": "^0.7.0"
|
|
125
|
+
},
|
|
126
|
+
"svelte": "./dist/index.js",
|
|
103
127
|
"ssr": true
|
|
104
128
|
}
|