zabi-components 4.0.2 → 5.0.2

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.
Files changed (92) hide show
  1. package/README.md +2 -2
  2. package/dist/SSRSafe.svelte +47 -0
  3. package/dist/SSRSafe.svelte.d.ts +11 -0
  4. package/dist/atoms/Badge.svelte +76 -0
  5. package/dist/atoms/Badge.svelte.d.ts +9 -0
  6. package/dist/atoms/Button.svelte +72 -0
  7. package/dist/atoms/Button.svelte.d.ts +13 -0
  8. package/dist/atoms/Card.svelte +59 -0
  9. package/dist/atoms/Card.svelte.d.ts +12 -0
  10. package/dist/atoms/Checkbox.svelte +60 -0
  11. package/dist/atoms/Checkbox.svelte.d.ts +10 -0
  12. package/dist/atoms/CodeBlock.svelte +125 -0
  13. package/dist/atoms/CodeBlock.svelte.d.ts +8 -0
  14. package/dist/atoms/ColorPicker.svelte +171 -0
  15. package/dist/atoms/ColorPicker.svelte.d.ts +9 -0
  16. package/dist/atoms/FeatureCard.svelte +74 -0
  17. package/dist/atoms/FeatureCard.svelte.d.ts +17 -0
  18. package/dist/atoms/Heading.svelte +5 -0
  19. package/dist/atoms/Heading.svelte.d.ts +7 -0
  20. package/dist/atoms/Input.svelte +98 -0
  21. package/dist/atoms/Input.svelte.d.ts +14 -0
  22. package/dist/atoms/OptimizedImage.svelte +32 -0
  23. package/dist/atoms/OptimizedImage.svelte.d.ts +13 -0
  24. package/dist/atoms/Progress.svelte +61 -0
  25. package/dist/atoms/Progress.svelte.d.ts +9 -0
  26. package/dist/atoms/Select.svelte +85 -0
  27. package/dist/atoms/Select.svelte.d.ts +16 -0
  28. package/dist/atoms/Skeleton.svelte +20 -0
  29. package/dist/atoms/Skeleton.svelte.d.ts +8 -0
  30. package/dist/atoms/Textarea.svelte +116 -0
  31. package/dist/atoms/Textarea.svelte.d.ts +14 -0
  32. package/dist/atoms/ThemeToggle.svelte +89 -0
  33. package/dist/atoms/ThemeToggle.svelte.d.ts +7 -0
  34. package/dist/atoms/Toast.svelte +58 -0
  35. package/dist/atoms/Toast.svelte.d.ts +9 -0
  36. package/dist/atoms/Toggle.svelte +94 -0
  37. package/dist/atoms/Toggle.svelte.d.ts +12 -0
  38. package/dist/atoms/Tooltip.svelte +188 -0
  39. package/dist/atoms/Tooltip.svelte.d.ts +12 -0
  40. package/dist/atoms/index.d.ts +4 -15
  41. package/dist/atoms/index.js +10 -23
  42. package/dist/components/atoms/index.d.ts +10 -0
  43. package/dist/components/atoms/index.d.ts.map +1 -0
  44. package/dist/components/index.d.ts +32 -0
  45. package/dist/components/index.d.ts.map +1 -0
  46. package/dist/components/molecules/index.d.ts +1 -0
  47. package/dist/components/molecules/index.d.ts.map +1 -0
  48. package/dist/components/organisms/index.d.ts +1 -0
  49. package/dist/components/organisms/index.d.ts.map +1 -0
  50. package/dist/index.d.ts +31 -15
  51. package/dist/index.js +75 -0
  52. package/dist/molecules/Alert.svelte +114 -0
  53. package/dist/molecules/Alert.svelte.d.ts +14 -0
  54. package/dist/molecules/ComponentDemo.svelte +96 -0
  55. package/dist/molecules/ComponentDemo.svelte.d.ts +13 -0
  56. package/dist/molecules/ContactForm.svelte +98 -0
  57. package/dist/molecules/ContactForm.svelte.d.ts +10 -0
  58. package/dist/molecules/Dropdown.svelte +128 -0
  59. package/dist/molecules/Dropdown.svelte.d.ts +11 -0
  60. package/dist/molecules/Form.svelte +37 -0
  61. package/dist/molecules/Form.svelte.d.ts +12 -0
  62. package/dist/molecules/ImageUpload.svelte +112 -0
  63. package/dist/molecules/ImageUpload.svelte.d.ts +14 -0
  64. package/dist/molecules/Modal.svelte +85 -0
  65. package/dist/molecules/Modal.svelte.d.ts +13 -0
  66. package/dist/molecules/SlideUp.svelte +73 -0
  67. package/dist/molecules/SlideUp.svelte.d.ts +12 -0
  68. package/dist/molecules/Tabs.svelte +68 -0
  69. package/dist/molecules/Tabs.svelte.d.ts +17 -0
  70. package/dist/molecules/index.d.ts +0 -11
  71. package/dist/molecules/index.js +2 -13
  72. package/dist/organisms/Navbar.svelte +99 -0
  73. package/dist/organisms/Navbar.svelte.d.ts +14 -0
  74. package/dist/organisms/Navigation.svelte +48 -0
  75. package/dist/organisms/Navigation.svelte.d.ts +15 -0
  76. package/dist/organisms/index.d.ts +0 -4
  77. package/dist/organisms/index.js +2 -5
  78. package/dist/routes/lib/ssr-safe.ts +57 -0
  79. package/dist/routes/lib/variant-utils.ts +98 -0
  80. package/dist/zabi-components.css +399 -1
  81. package/package.json +41 -17
  82. package/dist/CodeBlock-pT5-FgZd.js +0 -431
  83. package/dist/ContactForm-CHI_jeFY.js +0 -580
  84. package/dist/FeatureCard-iBFGbgVE.js +0 -656
  85. package/dist/Navigation-BOT-UHg0.js +0 -104
  86. package/dist/ThemeToggle-BlNPkAQy.js +0 -48
  87. package/dist/index/index.js +0 -63
  88. package/dist/molecules/KeyValueForm.types.d.ts +0 -11
  89. package/dist/ssr-safe-bsWGK4V4.js +0 -2232
  90. package/dist/types/index.d.ts +0 -4
  91. package/dist/types/index.js +0 -1
  92. 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
+ }
@@ -1 +1,399 @@
1
- :root{--zabi-primary: #2563eb;--zabi-primary-hover: #1d4ed8;--zabi-primary-active: #1e40af;--zabi-primary-disabled: #93c5fd;--zabi-primary-light: #dbeafe;--zabi-primary-dark: #1e40af;--zabi-secondary: #57534e;--zabi-secondary-hover: #44403c;--zabi-secondary-active: #292524;--zabi-secondary-disabled: #d6d3d1;--zabi-secondary-light: #f5f5f4;--zabi-secondary-dark: #292524;--zabi-success: #16a34a;--zabi-success-hover: #15803d;--zabi-success-active: #166534;--zabi-success-disabled: #86efac;--zabi-success-light: #dcfce7;--zabi-success-dark: #166534;--zabi-warning: #ca8a04;--zabi-warning-hover: #a16207;--zabi-warning-active: #854d0e;--zabi-warning-disabled: #fde047;--zabi-warning-light: #fef9c3;--zabi-warning-dark: #854d0e;--zabi-error: #dc2626;--zabi-error-hover: #b91c1c;--zabi-error-active: #991b1b;--zabi-error-disabled: #fca5a5;--zabi-error-light: #fee2e2;--zabi-error-dark: #991b1b;--zabi-info: #2563eb;--zabi-info-hover: #1d4ed8;--zabi-info-active: #1e40af;--zabi-info-disabled: #93c5fd;--zabi-info-light: #dbeafe;--zabi-info-dark: #1e40af;--zabi-surface: #fff;--zabi-surface-hover: #fafaf9;--zabi-surface-active: #f5f5f4;--zabi-surface-disabled: #f5f5f4;--zabi-border: #d6d3d1;--zabi-border-hover: #a8a29e;--zabi-border-focus: #3b82f6;--zabi-border-disabled: #e7e5e4;--zabi-text: #1c1917;--zabi-text-muted: #57534e;--zabi-text-placeholder: #a8a29e;--zabi-text-inverse: #fff;--zabi-text-disabled: #a8a29e;--zabi-focus-ring: #3b82f6;--zabi-focus-ring-offset: #fff;--zabi-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--zabi-shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--zabi-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--zabi-radius-sm: var(--radius-sm);--zabi-radius-md: var(--radius-md);--zabi-radius-lg: var(--radius-lg);--zabi-spacing-xs: .25rem;--zabi-spacing-sm: .5rem;--zabi-spacing-md: 1rem;--zabi-spacing-lg: 1.5rem;--zabi-spacing-xl: 2rem}.dark{--zabi-surface: #292524;--zabi-surface-hover: #44403c;--zabi-surface-active: #57534e;--zabi-surface-disabled: #44403c;--zabi-border: #57534e;--zabi-border-hover: #78716c;--zabi-border-focus: #60a5fa;--zabi-border-disabled: #57534e;--zabi-text: #e7e5e4;--zabi-text-muted: #78716c;--zabi-text-placeholder: #57534e;--zabi-text-inverse: #292524;--zabi-text-disabled: #57534e;--zabi-focus-ring-offset: #292524}.zabi-primary{background-color:var(--zabi-primary);color:var(--zabi-text-inverse)}.zabi-primary:hover{background-color:var(--zabi-primary-hover)}.zabi-primary:active{background-color:var(--zabi-primary-active)}.zabi-primary:disabled{background-color:var(--zabi-primary-disabled);color:var(--zabi-text-disabled)}.zabi-secondary{background-color:var(--zabi-secondary);color:var(--zabi-text-inverse)}.zabi-secondary:hover{background-color:var(--zabi-secondary-hover)}.zabi-secondary:active{background-color:var(--zabi-secondary-active)}.zabi-secondary:disabled{background-color:var(--zabi-secondary-disabled);color:var(--zabi-text-disabled)}.zabi-success{background-color:var(--zabi-success);color:var(--zabi-text-inverse)}.zabi-success:hover{background-color:var(--zabi-success-hover)}.zabi-success:active{background-color:var(--zabi-success-active)}.zabi-success:disabled{background-color:var(--zabi-success-disabled);color:var(--zabi-text-disabled)}.zabi-warning{background-color:var(--zabi-warning);color:var(--zabi-text-inverse)}.zabi-warning:hover{background-color:var(--zabi-warning-hover)}.zabi-warning:active{background-color:var(--zabi-warning-active)}.zabi-warning:disabled{background-color:var(--zabi-warning-disabled);color:var(--zabi-text-disabled)}.zabi-error{background-color:var(--zabi-error);color:var(--zabi-text-inverse)}.zabi-error:hover{background-color:var(--zabi-error-hover)}.zabi-error:active{background-color:var(--zabi-error-active)}.zabi-error:disabled{background-color:var(--zabi-error-disabled);color:var(--zabi-text-disabled)}.zabi-info{background-color:var(--zabi-info);color:var(--zabi-text-inverse)}.zabi-info:hover{background-color:var(--zabi-info-hover)}.zabi-info:active{background-color:var(--zabi-info-active)}.zabi-info:disabled{background-color:var(--zabi-info-disabled);color:var(--zabi-text-disabled)}.zabi-surface{background-color:var(--zabi-surface);color:var(--zabi-text)}.zabi-surface:hover{background-color:var(--zabi-surface-hover)}.zabi-surface:active{background-color:var(--zabi-surface-active)}.zabi-border{border-color:var(--zabi-border)}.zabi-border:hover{border-color:var(--zabi-border-hover)}.zabi-border:focus{border-color:var(--zabi-border-focus)}.zabi-border:disabled{border-color:var(--zabi-border-disabled)}.zabi-text{color:var(--zabi-text)}.zabi-text-muted{color:var(--zabi-text-muted)}.zabi-text-placeholder{color:var(--zabi-text-placeholder)}.zabi-text-inverse{color:var(--zabi-text-inverse)}.zabi-text-disabled{color:var(--zabi-text-disabled)}.zabi-focus{outline:2px solid var(--zabi-focus-ring);outline-offset:2px}.zabi-focus-ring{box-shadow:0 0 0 2px var(--zabi-focus-ring-offset),0 0 0 4px var(--zabi-focus-ring)}
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.0.2",
4
- "description": "A modern Svelte 5 component library with TypeScript, Tailwind CSS, and 100% SSR-safe components",
3
+ "version": "5.0.2",
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/index.js",
7
- "module": "dist/index/index.js",
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/index.js",
13
- "svelte": "./dist/index/index.js"
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": "vite build --config vite.lib.config.ts && node scripts/generate-types.js",
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": "^3.0.0",
73
- "@sveltejs/kit": "^2.44.0",
74
- "@sveltejs/vite-plugin-svelte": "^5.0.0",
75
- "@tsconfig/svelte": "^5.0.2",
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.0.0",
82
- "tailwindcss": "^3.4.1",
83
- "typescript": "^5.3.3",
84
- "vite": "^6.0.0"
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
- "svelte": "./dist/index/index.js",
123
+ "overrides": {
124
+ "cookie": "^0.7.0"
125
+ },
126
+ "svelte": "./dist/index.js",
103
127
  "ssr": true
104
128
  }