hydrateless 0.2.0 → 0.4.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/dist/tokens.css CHANGED
@@ -1,43 +1,333 @@
1
+ /**
2
+ * Raw color ramps. These are the only place literal colors live; everything
3
+ * else references them through the semantic tokens. Ramps follow the familiar
4
+ * 50 (lightest) → 950 (darkest) scale.
5
+ */
6
+ @layer tokens {
7
+ :root {
8
+ /* Neutral / gray */
9
+ --hl-gray-50: hsl(210, 40%, 98%);
10
+ --hl-gray-100: hsl(210, 40%, 96%);
11
+ --hl-gray-200: hsl(214, 32%, 91%);
12
+ --hl-gray-300: hsl(213, 27%, 84%);
13
+ --hl-gray-400: hsl(215, 20%, 65%);
14
+ --hl-gray-500: hsl(215, 16%, 47%);
15
+ --hl-gray-600: hsl(215, 19%, 35%);
16
+ --hl-gray-700: hsl(215, 25%, 27%);
17
+ --hl-gray-800: hsl(217, 33%, 17%);
18
+ --hl-gray-900: hsl(222, 47%, 11%);
19
+ --hl-gray-950: hsl(229, 41%, 8%);
20
+
21
+ /* Brand / primary (blue) */
22
+ --hl-brand-50: hsl(214, 100%, 97%);
23
+ --hl-brand-100: hsl(214, 95%, 93%);
24
+ --hl-brand-200: hsl(213, 97%, 87%);
25
+ --hl-brand-300: hsl(212, 96%, 78%);
26
+ --hl-brand-400: hsl(213, 94%, 68%);
27
+ --hl-brand-500: hsl(217, 91%, 60%);
28
+ --hl-brand-600: hsl(221, 83%, 53%);
29
+ --hl-brand-700: hsl(224, 76%, 48%);
30
+ --hl-brand-800: hsl(226, 71%, 40%);
31
+ --hl-brand-900: hsl(224, 64%, 33%);
32
+ --hl-brand-950: hsl(226, 57%, 21%);
33
+
34
+ /* Danger (red) */
35
+ --hl-red-50: hsl(0, 86%, 97%);
36
+ --hl-red-100: hsl(0, 93%, 94%);
37
+ --hl-red-200: hsl(0, 96%, 89%);
38
+ --hl-red-300: hsl(0, 94%, 82%);
39
+ --hl-red-400: hsl(0, 91%, 71%);
40
+ --hl-red-500: hsl(0, 84%, 60%);
41
+ --hl-red-600: hsl(0, 72%, 51%);
42
+ --hl-red-700: hsl(0, 74%, 42%);
43
+ --hl-red-800: hsl(0, 70%, 35%);
44
+ --hl-red-900: hsl(0, 63%, 31%);
45
+ --hl-red-950: hsl(0, 75%, 15%);
46
+
47
+ /* Warning (amber) */
48
+ --hl-amber-50: hsl(48, 100%, 96%);
49
+ --hl-amber-100: hsl(48, 96%, 89%);
50
+ --hl-amber-200: hsl(48, 97%, 77%);
51
+ --hl-amber-300: hsl(46, 97%, 65%);
52
+ --hl-amber-400: hsl(43, 96%, 56%);
53
+ --hl-amber-500: hsl(38, 92%, 50%);
54
+ --hl-amber-600: hsl(32, 95%, 44%);
55
+ --hl-amber-700: hsl(26, 90%, 37%);
56
+ --hl-amber-800: hsl(23, 83%, 31%);
57
+ --hl-amber-900: hsl(22, 78%, 26%);
58
+ --hl-amber-950: hsl(21, 92%, 14%);
59
+
60
+ /* Success (green) */
61
+ --hl-green-50: hsl(138, 76%, 97%);
62
+ --hl-green-100: hsl(141, 84%, 93%);
63
+ --hl-green-200: hsl(141, 79%, 85%);
64
+ --hl-green-300: hsl(142, 77%, 73%);
65
+ --hl-green-400: hsl(142, 69%, 58%);
66
+ --hl-green-500: hsl(142, 71%, 45%);
67
+ --hl-green-600: hsl(142, 76%, 36%);
68
+ --hl-green-700: hsl(142, 72%, 29%);
69
+ --hl-green-800: hsl(143, 64%, 24%);
70
+ --hl-green-900: hsl(144, 61%, 20%);
71
+ --hl-green-950: hsl(145, 80%, 10%);
1
72
 
73
+ /* Info (sky) */
74
+ --hl-sky-50: hsl(204, 100%, 97%);
75
+ --hl-sky-100: hsl(204, 94%, 94%);
76
+ --hl-sky-200: hsl(201, 94%, 86%);
77
+ --hl-sky-300: hsl(199, 95%, 74%);
78
+ --hl-sky-400: hsl(198, 93%, 60%);
79
+ --hl-sky-500: hsl(199, 89%, 48%);
80
+ --hl-sky-600: hsl(200, 98%, 39%);
81
+ --hl-sky-700: hsl(201, 96%, 32%);
82
+ --hl-sky-800: hsl(201, 90%, 27%);
83
+ --hl-sky-900: hsl(202, 80%, 24%);
84
+ --hl-sky-950: hsl(202, 80%, 16%);
85
+ }
86
+ }
87
+ /**
88
+ * Non-color design scales: spacing, radii, typography, elevation, z-index, and
89
+ * motion. These are theme-independent and rarely overridden per component.
90
+ */
91
+ @layer tokens {
2
92
  :root {
3
- --hl-color-bg: hsl(0, 0%, 100%);
4
- --hl-color-fg: hsl(222, 47%, 11%);
5
- --hl-color-muted: hsl(220, 14%, 96%);
6
- --hl-color-accent: hsl(221, 75%, 55%);
93
+ /* Spacing scale (rem) */
94
+ --hl-space-0: 0;
95
+ --hl-space-px: 1px;
96
+ --hl-space-0-5: 0.125rem;
97
+ --hl-space-1: 0.25rem;
98
+ --hl-space-1-5: 0.375rem;
99
+ --hl-space-2: 0.5rem;
100
+ --hl-space-3: 0.75rem;
101
+ --hl-space-4: 1rem;
102
+ --hl-space-5: 1.25rem;
103
+ --hl-space-6: 1.5rem;
104
+ --hl-space-8: 2rem;
105
+ --hl-space-10: 2.5rem;
106
+ --hl-space-12: 3rem;
107
+ --hl-space-16: 4rem;
108
+ --hl-space-20: 5rem;
109
+ --hl-space-24: 6rem;
110
+
111
+ /* Border radii */
112
+ --hl-radius-xs: 0.125rem;
113
+ --hl-radius-sm: 0.25rem;
114
+ --hl-radius-md: 0.375rem;
115
+ --hl-radius-lg: 0.5rem;
116
+ --hl-radius-xl: 0.75rem;
117
+ --hl-radius-2xl: 1rem;
118
+ --hl-radius-full: 9999px;
119
+
120
+ /* Border widths */
121
+ --hl-border-width: 1px;
122
+ --hl-border-width-2: 2px;
123
+
124
+ /* Typography */
125
+ --hl-font-sans:
126
+ ui-sans-serif,system-ui,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans, -apple-system, 'Segoe UI', roboto, helvetica, arial, sans-serif,
127
+ 'Apple Color Emoji', 'Segoe UI Emoji';
128
+ --hl-font-mono:
129
+ ui-monospace, sfmono-regular, 'SF Mono', menlo, consolas, 'Liberation Mono', monospace;
130
+ --hl-text-xs: 0.75rem;
131
+ --hl-text-sm: 0.875rem;
132
+ --hl-text-base: 1rem;
133
+ --hl-text-lg: 1.125rem;
134
+ --hl-text-xl: 1.25rem;
135
+ --hl-text-2xl: 1.5rem;
136
+ --hl-text-3xl: 1.875rem;
137
+ --hl-text-4xl: 2.25rem;
138
+ --hl-leading-tight: 1.25;
139
+ --hl-leading-normal: 1.5;
140
+ --hl-leading-relaxed: 1.75;
141
+ --hl-font-normal: 400;
142
+ --hl-font-medium: 500;
143
+ --hl-font-semibold: 600;
144
+ --hl-font-bold: 700;
145
+
146
+ /* Elevation (shadows) — tuned for light surfaces */
147
+ --hl-shadow-xs: 0 1px 2px 0 hsla(222, 47%, 11%, 0.05);
148
+ --hl-shadow-sm: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
149
+ --hl-shadow-md:
150
+ 0 4px 6px -1px hsla(222, 47%, 11%, 0.1), 0 2px 4px -2px hsla(222, 47%, 11%, 0.1);
151
+ --hl-shadow-lg:
152
+ 0 10px 15px -3px hsla(222, 47%, 11%, 0.1), 0 4px 6px -4px hsla(222, 47%, 11%, 0.1);
153
+ --hl-shadow-xl:
154
+ 0 20px 25px -5px hsla(222, 47%, 11%, 0.1), 0 8px 10px -6px hsla(222, 47%, 11%, 0.1);
7
155
 
8
- --hl-radius-2: 0.25rem;
9
- --hl-radius-3: 0.5rem;
156
+ /* Control sizing */
157
+ --hl-control-height-sm: 2rem;
158
+ --hl-control-height-md: 2.5rem;
159
+ --hl-control-height-lg: 3rem;
10
160
 
11
- --hl-spacing-1: 0.25rem;
12
- --hl-spacing-2: 0.5rem;
13
- --hl-spacing-3: 0.75rem;
14
- --hl-spacing-4: 1rem;
161
+ /* Z-index scale */
162
+ --hl-z-base: 0;
163
+ --hl-z-dropdown: 1000;
164
+ --hl-z-sticky: 1100;
165
+ --hl-z-drawer: 1200;
166
+ --hl-z-modal: 1300;
167
+ --hl-z-popover: 1400;
168
+ --hl-z-toast: 1500;
169
+ --hl-z-tooltip: 1600;
15
170
 
16
- --hl-focus-ring: 2px solid hsl(221, 80%, 55%);
171
+ /* Motion */
172
+ --hl-duration-fast: 120ms;
173
+ --hl-duration-base: 180ms;
174
+ --hl-duration-slow: 280ms;
175
+ --hl-ease-standard: cubic-bezier(0.2, 0, 0, 1);
176
+ --hl-ease-emphasized: cubic-bezier(0.3, 0, 0, 1);
17
177
  }
18
178
 
19
- @media (prefers-color-scheme: dark) {
179
+ @media (prefers-reduced-motion: reduce) {
20
180
  :root {
21
- --hl-color-bg: hsl(222, 47%, 11%);
22
- --hl-color-fg: hsl(210, 40%, 98%);
23
- --hl-color-muted: hsl(223, 20%, 17%);
24
- --hl-color-accent: hsl(221, 80%, 65%);
25
- --hl-focus-ring: 2px solid hsl(221, 85%, 65%);
181
+ --hl-duration-fast: 0ms;
182
+ --hl-duration-base: 0ms;
183
+ --hl-duration-slow: 0ms;
26
184
  }
27
185
  }
186
+ }
187
+ /**
188
+ * Semantic tokens map the raw palette to roles (surface, text, border, intent
189
+ * colors). Components reference only these, so theming and dark mode are a
190
+ * matter of remapping a couple dozen variables — never touching component CSS.
191
+ *
192
+ * Light is the default in `:root`. Dark applies automatically via
193
+ * `prefers-color-scheme` (unless `[data-theme="light"]` opts out) and always
194
+ * via `[data-theme="dark"]`.
195
+ */
196
+ @layer tokens {
197
+ :root {
198
+ --hl-bg: var(--hl-gray-50);
199
+ --hl-surface: hsl(0, 0%, 100%);
200
+ --hl-surface-2: var(--hl-gray-100);
201
+ --hl-surface-3: var(--hl-gray-200);
202
+ --hl-fg: var(--hl-gray-900);
203
+ --hl-fg-muted: var(--hl-gray-600);
204
+ --hl-fg-subtle: var(--hl-gray-500);
205
+ --hl-border: var(--hl-gray-200);
206
+ --hl-border-strong: var(--hl-gray-300);
207
+ --hl-ring: var(--hl-brand-500);
208
+ --hl-focus-ring: var(--hl-border-width-2) solid var(--hl-ring);
209
+ --hl-primary: var(--hl-brand-600);
210
+ --hl-primary-hover: var(--hl-brand-700);
211
+ --hl-primary-active: var(--hl-brand-800);
212
+ --hl-primary-fg: hsl(0, 0%, 100%);
213
+ --hl-primary-subtle: var(--hl-brand-50);
214
+ --hl-primary-subtle-fg: var(--hl-brand-700);
215
+ --hl-danger: var(--hl-red-600);
216
+ --hl-danger-hover: var(--hl-red-700);
217
+ --hl-danger-fg: hsl(0, 0%, 100%);
218
+ --hl-danger-subtle: var(--hl-red-50);
219
+ --hl-danger-subtle-fg: var(--hl-red-700);
220
+ --hl-success: var(--hl-green-600);
221
+ --hl-success-hover: var(--hl-green-700);
222
+ --hl-success-fg: hsl(0, 0%, 100%);
223
+ --hl-success-subtle: var(--hl-green-50);
224
+ --hl-success-subtle-fg: var(--hl-green-700);
225
+ --hl-warning: var(--hl-amber-500);
226
+ --hl-warning-hover: var(--hl-amber-600);
227
+ --hl-warning-fg: var(--hl-gray-950);
228
+ --hl-warning-subtle: var(--hl-amber-50);
229
+ --hl-warning-subtle-fg: var(--hl-amber-800);
230
+ --hl-info: var(--hl-sky-600);
231
+ --hl-info-hover: var(--hl-sky-700);
232
+ --hl-info-fg: hsl(0, 0%, 100%);
233
+ --hl-info-subtle: var(--hl-sky-50);
234
+ --hl-info-subtle-fg: var(--hl-sky-700);
235
+ --hl-scrim: hsla(222, 47%, 11%, 0.5);
236
+ --hl-overlay: var(--hl-surface);
237
+ --hl-overlay-shadow: var(--hl-shadow-lg);
28
238
 
29
- [data-theme='light'] {
30
- --hl-color-bg: hsl(0, 0%, 100%);
31
- --hl-color-fg: hsl(222, 47%, 11%);
32
- --hl-color-muted: hsl(220, 14%, 96%);
33
- --hl-color-accent: hsl(221, 75%, 55%);
34
- --hl-focus-ring: 2px solid hsl(221, 80%, 55%);
239
+ /* Component-facing aliases — a single mapping onto the tokens above so every
240
+ component (old and new) themes and dark-modes from one source of truth. */
241
+ --hl-color-bg: var(--hl-surface);
242
+ --hl-color-fg: var(--hl-fg);
243
+ --hl-color-muted: var(--hl-surface-2);
244
+ --hl-color-accent: var(--hl-primary);
245
+ --hl-radius-2: var(--hl-radius-sm);
246
+ --hl-radius-3: var(--hl-radius-lg);
247
+ --hl-spacing-1: var(--hl-space-1);
248
+ --hl-spacing-2: var(--hl-space-2);
249
+ --hl-spacing-3: var(--hl-space-3);
250
+ --hl-spacing-4: var(--hl-space-4);
251
+ }
252
+
253
+ /* Dark theme values, shared by auto + manual dark. */
254
+ @media (prefers-color-scheme: dark) {
255
+ :root:not([data-theme='light']) {
256
+ --hl-bg: var(--hl-gray-950);
257
+ --hl-surface: var(--hl-gray-900);
258
+ --hl-surface-2: var(--hl-gray-800);
259
+ --hl-surface-3: var(--hl-gray-700);
260
+ --hl-fg: var(--hl-gray-50);
261
+ --hl-fg-muted: var(--hl-gray-400);
262
+ --hl-fg-subtle: var(--hl-gray-500);
263
+ --hl-border: var(--hl-gray-800);
264
+ --hl-border-strong: var(--hl-gray-700);
265
+ --hl-ring: var(--hl-brand-400);
266
+ --hl-primary: var(--hl-brand-500);
267
+ --hl-primary-hover: var(--hl-brand-400);
268
+ --hl-primary-active: var(--hl-brand-300);
269
+ --hl-primary-fg: var(--hl-gray-950);
270
+ --hl-primary-subtle: hsla(226, 57%, 21%, 0.5);
271
+ --hl-primary-subtle-fg: var(--hl-brand-200);
272
+ --hl-danger-subtle: hsla(0, 63%, 31%, 0.35);
273
+ --hl-danger-subtle-fg: var(--hl-red-200);
274
+ --hl-success-subtle: hsla(144, 61%, 20%, 0.35);
275
+ --hl-success-subtle-fg: var(--hl-green-200);
276
+ --hl-warning-subtle: hsla(22, 78%, 26%, 0.35);
277
+ --hl-warning-subtle-fg: var(--hl-amber-200);
278
+ --hl-info-subtle: hsla(202, 80%, 24%, 0.35);
279
+ --hl-info-subtle-fg: var(--hl-sky-200);
280
+ --hl-scrim: hsla(0, 0%, 0%, 0.65);
281
+ --hl-shadow-xs: 0 1px 2px 0 hsla(0, 0%, 0%, 0.3);
282
+ --hl-shadow-sm: 0 1px 3px 0 hsla(0, 0%, 0%, 0.4), 0 1px 2px -1px hsla(0, 0%, 0%, 0.4);
283
+ --hl-shadow-md: 0 4px 6px -1px hsla(0, 0%, 0%, 0.45), 0 2px 4px -2px hsla(0, 0%, 0%, 0.45);
284
+ --hl-shadow-lg: 0 10px 15px -3px hsla(0, 0%, 0%, 0.5), 0 4px 6px -4px hsla(0, 0%, 0%, 0.5);
285
+ --hl-shadow-xl:
286
+ 0 20px 25px -5px hsla(0, 0%, 0%, 0.55), 0 8px 10px -6px hsla(0, 0%, 0%, 0.55);
287
+ }
35
288
  }
36
289
 
37
290
  [data-theme='dark'] {
38
- --hl-color-bg: hsl(222, 47%, 11%);
39
- --hl-color-fg: hsl(210, 40%, 98%);
40
- --hl-color-muted: hsl(223, 20%, 17%);
41
- --hl-color-accent: hsl(221, 80%, 65%);
42
- --hl-focus-ring: 2px solid hsl(221, 85%, 65%);
291
+ --hl-bg: var(--hl-gray-950);
292
+ --hl-surface: var(--hl-gray-900);
293
+ --hl-surface-2: var(--hl-gray-800);
294
+ --hl-surface-3: var(--hl-gray-700);
295
+ --hl-fg: var(--hl-gray-50);
296
+ --hl-fg-muted: var(--hl-gray-400);
297
+ --hl-fg-subtle: var(--hl-gray-500);
298
+ --hl-border: var(--hl-gray-800);
299
+ --hl-border-strong: var(--hl-gray-700);
300
+ --hl-ring: var(--hl-brand-400);
301
+ --hl-primary: var(--hl-brand-500);
302
+ --hl-primary-hover: var(--hl-brand-400);
303
+ --hl-primary-active: var(--hl-brand-300);
304
+ --hl-primary-fg: var(--hl-gray-950);
305
+ --hl-primary-subtle: hsla(226, 57%, 21%, 0.5);
306
+ --hl-primary-subtle-fg: var(--hl-brand-200);
307
+ --hl-danger-subtle: hsla(0, 63%, 31%, 0.35);
308
+ --hl-danger-subtle-fg: var(--hl-red-200);
309
+ --hl-success-subtle: hsla(144, 61%, 20%, 0.35);
310
+ --hl-success-subtle-fg: var(--hl-green-200);
311
+ --hl-warning-subtle: hsla(22, 78%, 26%, 0.35);
312
+ --hl-warning-subtle-fg: var(--hl-amber-200);
313
+ --hl-info-subtle: hsla(202, 80%, 24%, 0.35);
314
+ --hl-info-subtle-fg: var(--hl-sky-200);
315
+ --hl-scrim: hsla(0, 0%, 0%, 0.65);
316
+ --hl-shadow-xs: 0 1px 2px 0 hsla(0, 0%, 0%, 0.3);
317
+ --hl-shadow-sm: 0 1px 3px 0 hsla(0, 0%, 0%, 0.4), 0 1px 2px -1px hsla(0, 0%, 0%, 0.4);
318
+ --hl-shadow-md: 0 4px 6px -1px hsla(0, 0%, 0%, 0.45), 0 2px 4px -2px hsla(0, 0%, 0%, 0.45);
319
+ --hl-shadow-lg: 0 10px 15px -3px hsla(0, 0%, 0%, 0.5), 0 4px 6px -4px hsla(0, 0%, 0%, 0.5);
320
+ --hl-shadow-xl: 0 20px 25px -5px hsla(0, 0%, 0%, 0.55), 0 8px 10px -6px hsla(0, 0%, 0%, 0.55);
321
+ }
322
+
323
+ /* Windows High Contrast / forced-colors: defer to system colors. */
324
+ @media (forced-colors: active) {
325
+ :root {
326
+ --hl-border: CanvasText;
327
+ --hl-border-strong: CanvasText;
328
+ --hl-ring: Highlight;
329
+ --hl-primary: Highlight;
330
+ --hl-primary-fg: Canvas;
331
+ }
43
332
  }
333
+ }
package/dist/tooltip.css CHANGED
@@ -1,4 +1,4 @@
1
-
1
+ @layer components {
2
2
  [role='tooltip'] {
3
3
  position: absolute;
4
4
  z-index: 1000;
@@ -18,3 +18,4 @@
18
18
  [role='tooltip'][hidden] {
19
19
  display: none;
20
20
  }
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hydrateless",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Accessible, themeable UI primitives — semantic HTML + modern CSS first, optional JS enhancers.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,6 +13,8 @@
13
13
  "dist"
14
14
  ],
15
15
  "style": "dist/hydrateless.css",
16
+ "unpkg": "dist/hydrateless.min.css",
17
+ "jsdelivr": "dist/hydrateless.min.css",
16
18
  "sideEffects": [
17
19
  "**/*.css"
18
20
  ],
@@ -25,6 +27,8 @@
25
27
  "style": "./dist/hydrateless.css",
26
28
  "default": "./dist/hydrateless.css"
27
29
  },
30
+ "./hydrateless.css": "./dist/hydrateless.css",
31
+ "./hydrateless.min.css": "./dist/hydrateless.min.css",
28
32
  "./reset.css": "./dist/reset.css",
29
33
  "./tokens.css": "./dist/tokens.css",
30
34
  "./theme.css": "./dist/theme.css",
@@ -41,7 +45,30 @@
41
45
  "./tooltip.css": "./dist/tooltip.css",
42
46
  "./breadcrumb.css": "./dist/breadcrumb.css",
43
47
  "./dropdown.css": "./dist/dropdown.css",
44
- "./toast.css": "./dist/toast.css"
48
+ "./toast.css": "./dist/toast.css",
49
+ "./menu.css": "./dist/menu.css",
50
+ "./combobox.css": "./dist/combobox.css",
51
+ "./command.css": "./dist/command.css",
52
+ "./button.css": "./dist/button.css",
53
+ "./input.css": "./dist/input.css",
54
+ "./textarea.css": "./dist/textarea.css",
55
+ "./select.css": "./dist/select.css",
56
+ "./checkbox.css": "./dist/checkbox.css",
57
+ "./radio.css": "./dist/radio.css",
58
+ "./field.css": "./dist/field.css",
59
+ "./segmented.css": "./dist/segmented.css",
60
+ "./slider.css": "./dist/slider.css",
61
+ "./alert.css": "./dist/alert.css",
62
+ "./badge.css": "./dist/badge.css",
63
+ "./card.css": "./dist/card.css",
64
+ "./avatar.css": "./dist/avatar.css",
65
+ "./progress.css": "./dist/progress.css",
66
+ "./spinner.css": "./dist/spinner.css",
67
+ "./skeleton.css": "./dist/skeleton.css",
68
+ "./kbd.css": "./dist/kbd.css",
69
+ "./table.css": "./dist/table.css",
70
+ "./pagination.css": "./dist/pagination.css",
71
+ "./separator.css": "./dist/separator.css"
45
72
  },
46
73
  "publishConfig": {
47
74
  "access": "public"