snice 3.3.1 → 3.4.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.
Files changed (35) hide show
  1. package/bin/snice.js +56 -11
  2. package/bin/templates/CLAUDE.md +138 -0
  3. package/bin/templates/base/package.json +2 -2
  4. package/bin/templates/base/src/components/feature-card.ts +59 -0
  5. package/bin/templates/base/src/components/feature-card.types.ts +5 -0
  6. package/bin/templates/base/src/main.ts +7 -2
  7. package/bin/templates/base/src/pages/home-page.ts +38 -22
  8. package/bin/templates/base/src/types/api-response.ts +5 -0
  9. package/bin/templates/base/src/types/status.ts +1 -0
  10. package/bin/templates/base/src/types/theme.ts +1 -0
  11. package/bin/templates/base/src/types/user.ts +5 -0
  12. package/bin/templates/social/README.md +42 -0
  13. package/bin/templates/social/global.d.ts +14 -0
  14. package/bin/templates/social/index.html +13 -0
  15. package/bin/templates/social/package.json +21 -0
  16. package/bin/templates/social/public/vite.svg +1 -0
  17. package/bin/templates/social/src/main.ts +33 -0
  18. package/bin/templates/social/src/pages/feed-page.ts +111 -0
  19. package/bin/templates/social/src/pages/messages-page.ts +102 -0
  20. package/bin/templates/social/src/pages/not-found-page.ts +46 -0
  21. package/bin/templates/social/src/pages/profile-page.ts +99 -0
  22. package/bin/templates/social/src/pages/settings-page.ts +119 -0
  23. package/bin/templates/social/src/router.ts +9 -0
  24. package/bin/templates/social/src/styles/global.css +147 -0
  25. package/bin/templates/social/tsconfig.json +22 -0
  26. package/bin/templates/social/vite.config.ts +38 -0
  27. package/dist/components/theme/theme.css +234 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.esm.js +1 -1
  30. package/dist/index.iife.js +1 -1
  31. package/dist/symbols.cjs +1 -1
  32. package/dist/symbols.esm.js +1 -1
  33. package/dist/transitions.cjs +1 -1
  34. package/dist/transitions.esm.js +1 -1
  35. package/package.json +5 -1
@@ -0,0 +1,234 @@
1
+ :root {
2
+ /* Color primitives */
3
+ --snice-color-gray-50: 250 250 250;
4
+ --snice-color-gray-100: 241 241 241;
5
+ --snice-color-gray-200: 226 226 226;
6
+ --snice-color-gray-300: 204 204 204;
7
+ --snice-color-gray-400: 163 163 163;
8
+ --snice-color-gray-500: 115 115 115;
9
+ --snice-color-gray-600: 82 82 82;
10
+ --snice-color-gray-700: 64 64 64;
11
+ --snice-color-gray-800: 38 38 38;
12
+ --snice-color-gray-900: 23 23 23;
13
+ --snice-color-gray-950: 10 10 10;
14
+
15
+ --snice-color-blue-50: 239 246 255;
16
+ --snice-color-blue-100: 219 234 254;
17
+ --snice-color-blue-200: 191 219 254;
18
+ --snice-color-blue-300: 147 197 253;
19
+ --snice-color-blue-400: 96 165 250;
20
+ --snice-color-blue-500: 59 130 246;
21
+ --snice-color-blue-600: 37 99 235;
22
+ --snice-color-blue-700: 29 78 216;
23
+ --snice-color-blue-800: 30 64 175;
24
+ --snice-color-blue-900: 30 58 138;
25
+ --snice-color-blue-950: 23 37 84;
26
+
27
+ --snice-color-green-50: 240 253 244;
28
+ --snice-color-green-100: 220 252 231;
29
+ --snice-color-green-200: 187 247 208;
30
+ --snice-color-green-300: 134 239 172;
31
+ --snice-color-green-400: 74 222 128;
32
+ --snice-color-green-500: 34 197 94;
33
+ --snice-color-green-600: 22 163 74;
34
+ --snice-color-green-700: 21 128 61;
35
+ --snice-color-green-800: 22 101 52;
36
+ --snice-color-green-900: 20 83 45;
37
+ --snice-color-green-950: 5 46 22;
38
+
39
+ --snice-color-red-50: 254 242 242;
40
+ --snice-color-red-100: 254 226 226;
41
+ --snice-color-red-200: 254 202 202;
42
+ --snice-color-red-300: 252 165 165;
43
+ --snice-color-red-400: 248 113 113;
44
+ --snice-color-red-500: 239 68 68;
45
+ --snice-color-red-600: 220 38 38;
46
+ --snice-color-red-700: 185 28 28;
47
+ --snice-color-red-800: 153 27 27;
48
+ --snice-color-red-900: 127 29 29;
49
+ --snice-color-red-950: 69 10 10;
50
+
51
+ --snice-color-yellow-50: 254 252 232;
52
+ --snice-color-yellow-100: 254 249 195;
53
+ --snice-color-yellow-200: 254 240 138;
54
+ --snice-color-yellow-300: 253 224 71;
55
+ --snice-color-yellow-400: 250 204 21;
56
+ --snice-color-yellow-500: 234 179 8;
57
+ --snice-color-yellow-600: 202 138 4;
58
+ --snice-color-yellow-700: 161 98 7;
59
+ --snice-color-yellow-800: 133 77 14;
60
+ --snice-color-yellow-900: 113 63 18;
61
+ --snice-color-yellow-950: 66 32 6;
62
+
63
+ /* Light theme (default) */
64
+ --snice-color-primary: rgb(var(--snice-color-blue-600));
65
+ --snice-color-success: rgb(var(--snice-color-green-600));
66
+ --snice-color-warning: rgb(var(--snice-color-yellow-600));
67
+ --snice-color-danger: rgb(var(--snice-color-red-600));
68
+ --snice-color-neutral: rgb(var(--snice-color-gray-600));
69
+
70
+ --snice-color-primary-hover: rgb(var(--snice-color-blue-700));
71
+ --snice-color-success-hover: rgb(var(--snice-color-green-700));
72
+ --snice-color-warning-hover: rgb(var(--snice-color-yellow-700));
73
+ --snice-color-danger-hover: rgb(var(--snice-color-red-700));
74
+ --snice-color-neutral-hover: rgb(var(--snice-color-gray-700));
75
+
76
+ /* Semantic colors */
77
+ --snice-color-text: rgb(var(--snice-color-gray-900));
78
+ --snice-color-text-secondary: rgb(var(--snice-color-gray-600));
79
+ --snice-color-text-tertiary: rgb(var(--snice-color-gray-500));
80
+ --snice-color-text-inverse: rgb(var(--snice-color-gray-50));
81
+
82
+ --snice-color-background: rgb(255 255 255);
83
+ --snice-color-background-secondary: rgb(var(--snice-color-gray-50));
84
+ --snice-color-background-tertiary: rgb(var(--snice-color-gray-100));
85
+ --snice-color-background-element: rgb(252 251 249);
86
+
87
+ --snice-color-border: rgb(var(--snice-color-gray-200));
88
+ --snice-color-border-hover: rgb(var(--snice-color-gray-300));
89
+ --snice-color-border-focus: rgb(var(--snice-color-blue-500));
90
+
91
+ /* Spacing */
92
+ --snice-spacing-3xs: 0.125rem; /* 2px */
93
+ --snice-spacing-2xs: 0.25rem; /* 4px */
94
+ --snice-spacing-xs: 0.5rem; /* 8px */
95
+ --snice-spacing-sm: 0.75rem; /* 12px */
96
+ --snice-spacing-md: 1rem; /* 16px */
97
+ --snice-spacing-lg: 1.5rem; /* 24px */
98
+ --snice-spacing-xl: 2rem; /* 32px */
99
+ --snice-spacing-2xl: 3rem; /* 48px */
100
+ --snice-spacing-3xl: 4rem; /* 64px */
101
+
102
+ /* Typography */
103
+ --snice-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
104
+ --snice-font-family-mono: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
105
+
106
+ --snice-font-size-2xs: 0.625rem; /* 10px */
107
+ --snice-font-size-xs: 0.75rem; /* 12px */
108
+ --snice-font-size-sm: 0.875rem; /* 14px */
109
+ --snice-font-size-md: 1rem; /* 16px */
110
+ --snice-font-size-lg: 1.125rem; /* 18px */
111
+ --snice-font-size-xl: 1.25rem; /* 20px */
112
+ --snice-font-size-2xl: 1.5rem; /* 24px */
113
+ --snice-font-size-3xl: 1.875rem; /* 30px */
114
+ --snice-font-size-4xl: 2.25rem; /* 36px */
115
+
116
+ --snice-font-weight-light: 300;
117
+ --snice-font-weight-normal: 400;
118
+ --snice-font-weight-medium: 500;
119
+ --snice-font-weight-semibold: 600;
120
+ --snice-font-weight-bold: 700;
121
+
122
+ --snice-line-height-dense: 1.25;
123
+ --snice-line-height-normal: 1.5;
124
+ --snice-line-height-loose: 1.75;
125
+
126
+ /* Border radius */
127
+ --snice-border-radius-sm: 0.125rem; /* 2px */
128
+ --snice-border-radius-md: 0.25rem; /* 4px */
129
+ --snice-border-radius-lg: 0.5rem; /* 8px */
130
+ --snice-border-radius-xl: 1rem; /* 16px */
131
+ --snice-border-radius-circle: 50%;
132
+ --snice-border-radius-pill: 9999px;
133
+
134
+ /* Shadows */
135
+ --snice-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
136
+ --snice-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
137
+ --snice-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
138
+ --snice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
139
+ --snice-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
140
+ --snice-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
141
+
142
+ /* Transitions */
143
+ --snice-transition-fast: 150ms;
144
+ --snice-transition-medium: 250ms;
145
+ --snice-transition-slow: 350ms;
146
+
147
+ /* Z-index */
148
+ --snice-z-index-dropdown: 1000;
149
+ --snice-z-index-sticky: 1020;
150
+ --snice-z-index-fixed: 1030;
151
+ --snice-z-index-modal-backdrop: 1040;
152
+ --snice-z-index-modal: 1050;
153
+ --snice-z-index-popover: 1060;
154
+ --snice-z-index-tooltip: 1070;
155
+
156
+ /* Focus */
157
+ --snice-focus-ring-width: 2px;
158
+ --snice-focus-ring-color: rgb(var(--snice-color-blue-500) / 0.5);
159
+ --snice-focus-ring-offset: 2px;
160
+ }
161
+
162
+ /* Dark theme */
163
+ [data-theme="dark"] {
164
+ --snice-color-primary: rgb(var(--snice-color-blue-500));
165
+ --snice-color-success: rgb(var(--snice-color-green-500));
166
+ --snice-color-warning: rgb(var(--snice-color-yellow-500));
167
+ --snice-color-danger: rgb(var(--snice-color-red-500));
168
+ --snice-color-neutral: rgb(var(--snice-color-gray-400));
169
+
170
+ --snice-color-primary-hover: rgb(var(--snice-color-blue-400));
171
+ --snice-color-success-hover: rgb(var(--snice-color-green-400));
172
+ --snice-color-warning-hover: rgb(var(--snice-color-yellow-400));
173
+ --snice-color-danger-hover: rgb(var(--snice-color-red-400));
174
+ --snice-color-neutral-hover: rgb(var(--snice-color-gray-300));
175
+
176
+ --snice-color-text: rgb(var(--snice-color-gray-50));
177
+ --snice-color-text-secondary: rgb(var(--snice-color-gray-300));
178
+ --snice-color-text-tertiary: rgb(var(--snice-color-gray-400));
179
+ --snice-color-text-inverse: rgb(var(--snice-color-gray-900));
180
+
181
+ --snice-color-background: rgb(var(--snice-color-gray-900));
182
+ --snice-color-background-secondary: rgb(var(--snice-color-gray-800));
183
+ --snice-color-background-tertiary: rgb(var(--snice-color-gray-700));
184
+ --snice-color-background-element: rgb(47 45 43);
185
+
186
+ --snice-color-border: rgb(var(--snice-color-gray-700));
187
+ --snice-color-border-hover: rgb(var(--snice-color-gray-600));
188
+ --snice-color-border-focus: rgb(var(--snice-color-blue-400));
189
+
190
+ --snice-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.1);
191
+ --snice-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.15), 0 1px 2px -1px rgb(0 0 0 / 0.15);
192
+ --snice-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.15);
193
+ --snice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.15);
194
+ --snice-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15);
195
+ --snice-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.35);
196
+ }
197
+
198
+ /* Auto dark theme based on system preference */
199
+ @media (prefers-color-scheme: dark) {
200
+ :root:not([data-theme="light"]) {
201
+ --snice-color-primary: rgb(var(--snice-color-blue-500));
202
+ --snice-color-success: rgb(var(--snice-color-green-500));
203
+ --snice-color-warning: rgb(var(--snice-color-yellow-500));
204
+ --snice-color-danger: rgb(var(--snice-color-red-500));
205
+ --snice-color-neutral: rgb(var(--snice-color-gray-400));
206
+
207
+ --snice-color-primary-hover: rgb(var(--snice-color-blue-400));
208
+ --snice-color-success-hover: rgb(var(--snice-color-green-400));
209
+ --snice-color-warning-hover: rgb(var(--snice-color-yellow-400));
210
+ --snice-color-danger-hover: rgb(var(--snice-color-red-400));
211
+ --snice-color-neutral-hover: rgb(var(--snice-color-gray-300));
212
+
213
+ --snice-color-text: rgb(var(--snice-color-gray-50));
214
+ --snice-color-text-secondary: rgb(var(--snice-color-gray-300));
215
+ --snice-color-text-tertiary: rgb(var(--snice-color-gray-400));
216
+ --snice-color-text-inverse: rgb(var(--snice-color-gray-900));
217
+
218
+ --snice-color-background: rgb(var(--snice-color-gray-900));
219
+ --snice-color-background-secondary: rgb(var(--snice-color-gray-800));
220
+ --snice-color-background-tertiary: rgb(var(--snice-color-gray-700));
221
+ --snice-color-background-element: rgb(47 45 43);
222
+
223
+ --snice-color-border: rgb(var(--snice-color-gray-700));
224
+ --snice-color-border-hover: rgb(var(--snice-color-gray-600));
225
+ --snice-color-border-focus: rgb(var(--snice-color-blue-400));
226
+
227
+ --snice-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.1);
228
+ --snice-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.15), 0 1px 2px -1px rgb(0 0 0 / 0.15);
229
+ --snice-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.15), 0 2px 4px -2px rgb(0 0 0 / 0.15);
230
+ --snice-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.15);
231
+ --snice-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.15);
232
+ --snice-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.35);
233
+ }
234
+ }
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
package/dist/symbols.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * snice v3.3.0
2
+ * snice v3.4.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snice",
3
- "version": "3.3.1",
3
+ "version": "3.4.1",
4
4
  "type": "module",
5
5
  "description": "Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.",
6
6
  "main": "dist/index.cjs",
@@ -24,6 +24,7 @@
24
24
  "require": "./dist/transitions.cjs",
25
25
  "types": "./dist/transitions.d.ts"
26
26
  },
27
+ "./components/theme/theme.css": "./dist/components/theme/theme.css",
27
28
  "./components/*": {
28
29
  "import": "./dist/components/*.js",
29
30
  "types": "./dist/components/*.d.ts"
@@ -77,10 +78,13 @@
77
78
  },
78
79
  "scripts": {
79
80
  "dev": "vite",
81
+ "sync-versions": "node scripts/sync-template-versions.js",
82
+ "prebuild": "npm run sync-versions",
80
83
  "build": "rm -rf dist && rollup -c && npm run build:types",
81
84
  "build:types": "tsc --project components/tsconfig.json --emitDeclarationOnly",
82
85
  "build:test": "rollup -c rollup.config.test.js",
83
86
  "preview": "vite preview",
87
+ "pretest": "npm run sync-versions",
84
88
  "test": "npm run build:test && vitest run",
85
89
  "test:watch": "vitest",
86
90
  "test:ui": "vitest --ui",