@ponchia/ui 0.3.0 → 0.3.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.
@@ -0,0 +1,407 @@
1
+ {
2
+ "version": 1.1,
3
+ "properties": [
4
+ {
5
+ "name": "--accent",
6
+ "description": "Theme token. Light: `#d71921` · Dark: `#ff3b41`"
7
+ },
8
+ {
9
+ "name": "--accent-1",
10
+ "description": "Global scale token. Value: `color-mix(in srgb, var(--accent) 8%, var(--bg))`"
11
+ },
12
+ {
13
+ "name": "--accent-2",
14
+ "description": "Global scale token. Value: `color-mix(in srgb, var(--accent) 16%, var(--bg))`"
15
+ },
16
+ {
17
+ "name": "--accent-3",
18
+ "description": "Global scale token. Value: `color-mix(in srgb, var(--accent) 32%, var(--bg))`"
19
+ },
20
+ {
21
+ "name": "--accent-4",
22
+ "description": "Global scale token. Value: `color-mix(in srgb, var(--accent) 60%, var(--bg))`"
23
+ },
24
+ {
25
+ "name": "--accent-5",
26
+ "description": "Global scale token. Value: `var(--accent)`"
27
+ },
28
+ {
29
+ "name": "--accent-6",
30
+ "description": "Global scale token. Value: `var(--accent-strong)`"
31
+ },
32
+ {
33
+ "name": "--accent-soft",
34
+ "description": "Theme token. Light: `color-mix(in srgb, var(--accent) 10%, transparent)` · Dark: `color-mix(in srgb, var(--accent) 14%, transparent)`"
35
+ },
36
+ {
37
+ "name": "--accent-strong",
38
+ "description": "Theme token. Light: `color-mix(in srgb, var(--accent) 83%, #000)` · Dark: `color-mix(in srgb, var(--accent) 84%, #fff)`"
39
+ },
40
+ {
41
+ "name": "--accent-text",
42
+ "description": "Theme token. Light: `var(--accent-strong)` · Dark: `var(--accent-strong)`"
43
+ },
44
+ {
45
+ "name": "--bg",
46
+ "description": "Theme token. Light: `#f4f4f2` · Dark: `#000000`"
47
+ },
48
+ {
49
+ "name": "--bg-accent",
50
+ "description": "Theme token. Light: `color-mix(in srgb, var(--accent) 6%, transparent)` · Dark: `color-mix(in srgb, var(--accent) 8%, transparent)`"
51
+ },
52
+ {
53
+ "name": "--bg-elevated",
54
+ "description": "Theme token. Light: `#fbfbfa` · Dark: `#0a0a0a`"
55
+ },
56
+ {
57
+ "name": "--border",
58
+ "description": "Global scale token. Value: `var(--line)`"
59
+ },
60
+ {
61
+ "name": "--border-strong",
62
+ "description": "Global scale token. Value: `var(--line-strong)`"
63
+ },
64
+ {
65
+ "name": "--bronto-color-action",
66
+ "description": "Global scale token. Value: `var(--accent)`"
67
+ },
68
+ {
69
+ "name": "--bronto-color-bg",
70
+ "description": "Global scale token. Value: `var(--bg)`"
71
+ },
72
+ {
73
+ "name": "--bronto-color-border",
74
+ "description": "Global scale token. Value: `var(--line)`"
75
+ },
76
+ {
77
+ "name": "--bronto-color-border-strong",
78
+ "description": "Global scale token. Value: `var(--line-strong)`"
79
+ },
80
+ {
81
+ "name": "--bronto-color-danger",
82
+ "description": "Global scale token. Value: `var(--danger)`"
83
+ },
84
+ {
85
+ "name": "--bronto-color-focus",
86
+ "description": "Global scale token. Value: `var(--focus-ring)`"
87
+ },
88
+ {
89
+ "name": "--bronto-color-on-action",
90
+ "description": "Global scale token. Value: `var(--button-text)`"
91
+ },
92
+ {
93
+ "name": "--bronto-color-success",
94
+ "description": "Global scale token. Value: `var(--success)`"
95
+ },
96
+ {
97
+ "name": "--bronto-color-surface",
98
+ "description": "Global scale token. Value: `var(--panel)`"
99
+ },
100
+ {
101
+ "name": "--bronto-color-surface-raised",
102
+ "description": "Global scale token. Value: `var(--panel-strong)`"
103
+ },
104
+ {
105
+ "name": "--bronto-color-text",
106
+ "description": "Global scale token. Value: `var(--text)`"
107
+ },
108
+ {
109
+ "name": "--bronto-color-text-muted",
110
+ "description": "Global scale token. Value: `var(--text-dim)`"
111
+ },
112
+ {
113
+ "name": "--bronto-color-warning",
114
+ "description": "Global scale token. Value: `var(--warning)`"
115
+ },
116
+ {
117
+ "name": "--button-text",
118
+ "description": "Theme token. Light: `#ffffff` · Dark: `#000000`"
119
+ },
120
+ {
121
+ "name": "--code-bg",
122
+ "description": "Theme token. Light: `rgb(10, 10, 10, 0.05)` · Dark: `rgb(255, 255, 255, 0.05)`"
123
+ },
124
+ {
125
+ "name": "--danger",
126
+ "description": "Theme token. Light: `#c01622` · Dark: `#ff4d54`"
127
+ },
128
+ {
129
+ "name": "--danger-soft",
130
+ "description": "Theme token. Light: `rgb(192, 22, 34, 0.1)` · Dark: `rgb(255, 77, 84, 0.15)`"
131
+ },
132
+ {
133
+ "name": "--display",
134
+ "description": "Global scale token. Value: `'Doto', var(--mono)`"
135
+ },
136
+ {
137
+ "name": "--dot-font",
138
+ "description": "Global scale token. Value: `'Doto', var(--mono)`"
139
+ },
140
+ {
141
+ "name": "--dot-gap",
142
+ "description": "Global scale token. Value: `14px`"
143
+ },
144
+ {
145
+ "name": "--dot-size",
146
+ "description": "Global scale token. Value: `2px`"
147
+ },
148
+ {
149
+ "name": "--duration-base",
150
+ "description": "Global scale token. Value: `200ms`"
151
+ },
152
+ {
153
+ "name": "--duration-fast",
154
+ "description": "Global scale token. Value: `130ms`"
155
+ },
156
+ {
157
+ "name": "--duration-slow",
158
+ "description": "Global scale token. Value: `360ms`"
159
+ },
160
+ {
161
+ "name": "--ease-out",
162
+ "description": "Global scale token. Value: `cubic-bezier(0.33, 1, 0.68, 1)`"
163
+ },
164
+ {
165
+ "name": "--ease-spring",
166
+ "description": "Global scale token. Value: `cubic-bezier(0.16, 1, 0.3, 1)`"
167
+ },
168
+ {
169
+ "name": "--ease-standard",
170
+ "description": "Global scale token. Value: `cubic-bezier(0.2, 0.8, 0.2, 1)`"
171
+ },
172
+ {
173
+ "name": "--field-dot",
174
+ "description": "Theme token. Light: `rgb(10, 10, 10, 0.16)` · Dark: `rgb(242, 242, 242, 0.14)`"
175
+ },
176
+ {
177
+ "name": "--field-dot-accent",
178
+ "description": "Theme token. Light: `color-mix(in srgb, var(--accent) 78%, transparent)` · Dark: `color-mix(in srgb, var(--accent) 82%, transparent)`"
179
+ },
180
+ {
181
+ "name": "--field-dot-hot",
182
+ "description": "Theme token. Light: `rgb(10, 10, 10, 0.4)` · Dark: `rgb(242, 242, 242, 0.36)`"
183
+ },
184
+ {
185
+ "name": "--focus-ring",
186
+ "description": "Theme token. Light: `var(--accent)` · Dark: `var(--accent)`"
187
+ },
188
+ {
189
+ "name": "--line",
190
+ "description": "Theme token. Light: `#d8d8d4` · Dark: `#2a2a2a`"
191
+ },
192
+ {
193
+ "name": "--line-strong",
194
+ "description": "Theme token. Light: `#a8a8a2` · Dark: `#444444`"
195
+ },
196
+ {
197
+ "name": "--mono",
198
+ "description": "Global scale token. Value: `'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', ui-monospace, monospace`"
199
+ },
200
+ {
201
+ "name": "--orange",
202
+ "description": "Theme token. Light: `#a85f32` · Dark: `#d08c5b`"
203
+ },
204
+ {
205
+ "name": "--orange-soft",
206
+ "description": "Theme token. Light: `rgb(168, 95, 50, 0.13)` · Dark: `rgb(208, 140, 91, 0.15)`"
207
+ },
208
+ {
209
+ "name": "--panel",
210
+ "description": "Theme token. Light: `#ffffff` · Dark: `#0c0c0c`"
211
+ },
212
+ {
213
+ "name": "--panel-soft",
214
+ "description": "Theme token. Light: `#ececea` · Dark: `#1a1a1a`"
215
+ },
216
+ {
217
+ "name": "--panel-strong",
218
+ "description": "Theme token. Light: `#ffffff` · Dark: `#141414`"
219
+ },
220
+ {
221
+ "name": "--radius-lg",
222
+ "description": "Global scale token. Value: `3px`"
223
+ },
224
+ {
225
+ "name": "--radius-md",
226
+ "description": "Global scale token. Value: `2px`"
227
+ },
228
+ {
229
+ "name": "--radius-pill",
230
+ "description": "Global scale token. Value: `999px`"
231
+ },
232
+ {
233
+ "name": "--radius-sm",
234
+ "description": "Global scale token. Value: `1px`"
235
+ },
236
+ {
237
+ "name": "--radius-xl",
238
+ "description": "Global scale token. Value: `4px`"
239
+ },
240
+ {
241
+ "name": "--sans",
242
+ "description": "Global scale token. Value: `'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif`"
243
+ },
244
+ {
245
+ "name": "--shadow",
246
+ "description": "Theme token. Light: `none` · Dark: `none`"
247
+ },
248
+ {
249
+ "name": "--shadow-raised",
250
+ "description": "Theme token. Light: `0 0 0 1px var(--line-strong)` · Dark: `0 0 0 1px var(--line-strong)`"
251
+ },
252
+ {
253
+ "name": "--space-2xl",
254
+ "description": "Global scale token. Value: `2.5rem`"
255
+ },
256
+ {
257
+ "name": "--space-2xs",
258
+ "description": "Global scale token. Value: `0.25rem`"
259
+ },
260
+ {
261
+ "name": "--space-lg",
262
+ "description": "Global scale token. Value: `1.35rem`"
263
+ },
264
+ {
265
+ "name": "--space-md",
266
+ "description": "Global scale token. Value: `1rem`"
267
+ },
268
+ {
269
+ "name": "--space-sm",
270
+ "description": "Global scale token. Value: `0.75rem`"
271
+ },
272
+ {
273
+ "name": "--space-xl",
274
+ "description": "Global scale token. Value: `1.75rem`"
275
+ },
276
+ {
277
+ "name": "--space-xs",
278
+ "description": "Global scale token. Value: `0.5rem`"
279
+ },
280
+ {
281
+ "name": "--success",
282
+ "description": "Theme token. Light: `#2f7d4f` · Dark: `#4ec27e`"
283
+ },
284
+ {
285
+ "name": "--success-soft",
286
+ "description": "Theme token. Light: `rgb(47, 125, 79, 0.12)` · Dark: `rgb(78, 194, 126, 0.14)`"
287
+ },
288
+ {
289
+ "name": "--surface",
290
+ "description": "Global scale token. Value: `var(--panel)`"
291
+ },
292
+ {
293
+ "name": "--surface-1",
294
+ "description": "Global scale token. Value: `var(--bg)`"
295
+ },
296
+ {
297
+ "name": "--surface-2",
298
+ "description": "Global scale token. Value: `var(--bg-elevated)`"
299
+ },
300
+ {
301
+ "name": "--surface-3",
302
+ "description": "Global scale token. Value: `var(--panel)`"
303
+ },
304
+ {
305
+ "name": "--surface-4",
306
+ "description": "Global scale token. Value: `var(--panel-soft)`"
307
+ },
308
+ {
309
+ "name": "--surface-5",
310
+ "description": "Global scale token. Value: `var(--line)`"
311
+ },
312
+ {
313
+ "name": "--surface-6",
314
+ "description": "Global scale token. Value: `var(--line-strong)`"
315
+ },
316
+ {
317
+ "name": "--surface-muted",
318
+ "description": "Global scale token. Value: `var(--panel-soft)`"
319
+ },
320
+ {
321
+ "name": "--surface-raised",
322
+ "description": "Global scale token. Value: `var(--panel-strong)`"
323
+ },
324
+ {
325
+ "name": "--text",
326
+ "description": "Theme token. Light: `#0a0a0a` · Dark: `#f2f2f2`"
327
+ },
328
+ {
329
+ "name": "--text-2xs",
330
+ "description": "Global scale token. Value: `0.68rem`"
331
+ },
332
+ {
333
+ "name": "--text-base",
334
+ "description": "Global scale token. Value: `0.95rem`"
335
+ },
336
+ {
337
+ "name": "--text-dim",
338
+ "description": "Theme token. Light: `#686863` · Dark: `#858585`"
339
+ },
340
+ {
341
+ "name": "--text-lg",
342
+ "description": "Global scale token. Value: `1.15rem`"
343
+ },
344
+ {
345
+ "name": "--text-sm",
346
+ "description": "Global scale token. Value: `0.86rem`"
347
+ },
348
+ {
349
+ "name": "--text-soft",
350
+ "description": "Theme token. Light: `#353533` · Dark: `#c4c4c4`"
351
+ },
352
+ {
353
+ "name": "--text-xl",
354
+ "description": "Global scale token. Value: `1.45rem`"
355
+ },
356
+ {
357
+ "name": "--text-xs",
358
+ "description": "Global scale token. Value: `0.76rem`"
359
+ },
360
+ {
361
+ "name": "--tracking-wide",
362
+ "description": "Global scale token. Value: `0.14em`"
363
+ },
364
+ {
365
+ "name": "--tracking-wider",
366
+ "description": "Global scale token. Value: `0.22em`"
367
+ },
368
+ {
369
+ "name": "--warning",
370
+ "description": "Theme token. Light: `#806414` · Dark: `#d8bd72`"
371
+ },
372
+ {
373
+ "name": "--warning-soft",
374
+ "description": "Theme token. Light: `rgb(128, 100, 20, 0.13)` · Dark: `rgb(216, 189, 114, 0.14)`"
375
+ },
376
+ {
377
+ "name": "--z-base",
378
+ "description": "Global scale token. Value: `0`"
379
+ },
380
+ {
381
+ "name": "--z-overlay",
382
+ "description": "Global scale token. Value: `30`"
383
+ },
384
+ {
385
+ "name": "--z-popover",
386
+ "description": "Global scale token. Value: `50`"
387
+ },
388
+ {
389
+ "name": "--z-raised",
390
+ "description": "Global scale token. Value: `10`"
391
+ },
392
+ {
393
+ "name": "--z-sticky",
394
+ "description": "Global scale token. Value: `20`"
395
+ },
396
+ {
397
+ "name": "--z-toast",
398
+ "description": "Global scale token. Value: `60`"
399
+ }
400
+ ],
401
+ "atDirectives": [
402
+ {
403
+ "name": "@layer bronto",
404
+ "description": "The single cascade layer @ponchia/ui ships in. Un-layered app CSS overrides it without specificity conflict."
405
+ }
406
+ ]
407
+ }
package/css/app.css CHANGED
@@ -130,7 +130,7 @@
130
130
  padding: 0.75rem var(--space-lg);
131
131
  position: sticky;
132
132
  inset-block-start: 0;
133
- z-index: 10;
133
+ z-index: var(--z-raised);
134
134
  }
135
135
 
136
136
  .ui-app-topbar__title {
@@ -202,52 +202,12 @@
202
202
  margin: 0.3rem 0 0;
203
203
  }
204
204
 
205
- /* --- Metric tiles --- */
206
-
207
- .ui-app-metrics {
208
- display: grid;
209
- gap: var(--space-md);
210
- grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
211
- }
212
-
213
- .ui-app-metric {
214
- background: var(--panel);
215
- border: 1px solid var(--line);
216
- border-radius: var(--radius-md);
217
- display: grid;
218
- gap: 0.4rem;
219
- padding: var(--space-md);
220
- }
221
-
222
- .ui-app-metric__label {
223
- color: var(--text-dim);
224
- font-family: var(--mono);
225
- font-size: var(--text-2xs);
226
- letter-spacing: var(--tracking-wide);
227
- text-transform: uppercase;
228
- }
229
-
230
- .ui-app-metric__value {
231
- color: var(--text);
232
- font-family: var(--display);
233
- font-size: 1.9rem;
234
- font-variant-numeric: tabular-nums;
235
- letter-spacing: 0.01em;
236
- line-height: 1;
237
- }
238
-
239
- .ui-app-metric__delta {
240
- font-family: var(--mono);
241
- font-size: var(--text-xs);
242
- }
243
-
244
- .ui-app-metric__delta.is-pos {
245
- color: var(--success);
246
- }
247
-
248
- .ui-app-metric__delta.is-neg {
249
- color: var(--danger);
250
- }
205
+ /* --- Metric tiles ---
206
+ The metric primitive itself is shell-agnostic and now lives in
207
+ primitives.css as `.ui-stat` / `.ui-statgrid`; `.ui-app-metric*` and
208
+ `.ui-app-metrics` remain as permanent admin-shell aliases (grouped on
209
+ the canonical rules there — identical output). Nothing app-specific
210
+ left to define here. */
251
211
 
252
212
  /* --- Empty state --- */
253
213
 
@@ -276,7 +236,7 @@
276
236
  overflow-x: auto;
277
237
  position: sticky;
278
238
  inset-block-start: 0;
279
- z-index: 11;
239
+ z-index: calc(var(--z-raised) + 1);
280
240
  }
281
241
 
282
242
  .ui-app-rail__foot {
package/css/base.css CHANGED
@@ -180,7 +180,6 @@ textarea:focus-visible,
180
180
  }
181
181
 
182
182
  .ui-visually-hidden {
183
- clip: rect(0 0 0 0);
184
183
  clip-path: inset(50%);
185
184
  block-size: 1px;
186
185
  overflow: hidden;
package/css/dots.css CHANGED
@@ -30,7 +30,7 @@
30
30
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 78%);
31
31
  pointer-events: none;
32
32
  position: fixed;
33
- z-index: 0;
33
+ z-index: var(--z-base);
34
34
  }
35
35
 
36
36
  /* Dotted divider — replaces a plain rule. */
@@ -44,6 +44,30 @@
44
44
  inline-size: 100%;
45
45
  }
46
46
 
47
+ /* Data-bound dot matrix — a grid of state cells (activity / heatmap),
48
+ the on-brand counterpart to the decorative .ui-dotgrid background.
49
+ This is the grid + cell tones only; the data→cell mapping is the
50
+ consumer's. Tune density via --dotmatrix-cols / --dotmatrix-gap. */
51
+ .ui-dotmatrix {
52
+ display: grid;
53
+ gap: var(--dotmatrix-gap, 0.5rem);
54
+ grid-template-columns: repeat(var(--dotmatrix-cols, 12), minmax(0, 1fr));
55
+ }
56
+
57
+ .ui-dotmatrix__cell {
58
+ aspect-ratio: 1;
59
+ background: var(--field-dot);
60
+ border-radius: 50%;
61
+ }
62
+
63
+ .ui-dotmatrix__cell--hot {
64
+ background: var(--field-dot-hot);
65
+ }
66
+
67
+ .ui-dotmatrix__cell--accent {
68
+ background: var(--field-dot-accent);
69
+ }
70
+
47
71
  /* Status dot — the glyph-style state indicator. */
48
72
  .ui-dot {
49
73
  background: var(--text-dim);
package/css/feedback.css CHANGED
@@ -114,7 +114,14 @@
114
114
  max-inline-size: min(22rem, calc(100vw - 2rem));
115
115
  pointer-events: none;
116
116
  position: fixed;
117
- z-index: 60;
117
+ z-index: var(--z-toast);
118
+ }
119
+
120
+ /* Assertive (error) region — anchored top inline-end so it never
121
+ overlaps the polite bottom stack and reads as a distinct, urgent
122
+ channel. */
123
+ .ui-toast-stack--assertive {
124
+ inset-block: 1.25rem auto;
118
125
  }
119
126
 
120
127
  .ui-toast {
@@ -154,6 +161,30 @@
154
161
  text-transform: uppercase;
155
162
  }
156
163
 
164
+ .ui-toast__close {
165
+ align-self: start;
166
+ background: none;
167
+ border: 0;
168
+ block-size: 1.4rem;
169
+ color: var(--text-dim);
170
+ cursor: pointer;
171
+ font: inherit;
172
+ grid-column: 3;
173
+ grid-row: 1 / -1;
174
+ inline-size: 1.4rem;
175
+ padding: 0;
176
+ }
177
+
178
+ .ui-toast__close::before {
179
+ content: '\00d7'; /* × — glyph via CSS so the button has no text node */
180
+ font-size: 1.1rem;
181
+ line-height: 1;
182
+ }
183
+
184
+ .ui-toast__close:hover {
185
+ color: var(--text);
186
+ }
187
+
157
188
  .ui-toast--accent::before {
158
189
  background: var(--accent);
159
190
  }
@@ -196,7 +227,7 @@
196
227
  opacity var(--duration-fast) var(--ease-standard),
197
228
  transform var(--duration-fast) var(--ease-standard);
198
229
  white-space: nowrap;
199
- z-index: 50;
230
+ z-index: var(--z-popover);
200
231
  }
201
232
 
202
233
  .ui-tooltip:hover .ui-tooltip__bubble,
@@ -205,6 +236,60 @@
205
236
  transform: translate(-50%, 0);
206
237
  }
207
238
 
239
+ /* Progressive enhancement: where CSS anchor positioning exists, lift
240
+ the bubble out of the normal flow so it can't be clipped by an
241
+ ancestor's overflow/scroll and auto-flips at the viewport edge.
242
+ Unsupported browsers keep the absolutely-positioned fallback above
243
+ (fine for short labels; use .ui-popover + initPopover for rich or
244
+ edge-critical content). */
245
+ @supports (anchor-name: --x) {
246
+ .ui-tooltip {
247
+ anchor-name: --ui-tooltip;
248
+ }
249
+
250
+ .ui-tooltip__bubble {
251
+ inset: auto;
252
+ margin-block-end: 0.5rem;
253
+ position: fixed;
254
+ position-anchor: --ui-tooltip;
255
+ position-area: block-start center;
256
+ position-try-fallbacks: flip-block;
257
+ transform: translateY(4px);
258
+ }
259
+
260
+ .ui-tooltip:hover .ui-tooltip__bubble,
261
+ .ui-tooltip:focus-within .ui-tooltip__bubble {
262
+ transform: translateY(0);
263
+ }
264
+ }
265
+
266
+ /* Popover surface — a top-layer panel positioned by initPopover (JS
267
+ collision-aware, dependency-free). Uses the native [popover] top
268
+ layer when available so it never clips; the class styles it either
269
+ way. */
270
+ .ui-popover {
271
+ background: var(--panel-strong);
272
+ border: 1px solid var(--line-strong);
273
+ border-radius: var(--radius-md);
274
+ box-shadow: var(--shadow-raised);
275
+ color: var(--text-soft);
276
+ font-size: var(--text-sm);
277
+ inline-size: max-content;
278
+ margin: 0;
279
+ max-inline-size: min(22rem, calc(100vw - 2rem));
280
+ padding: var(--space-sm) var(--space-md);
281
+ position: fixed;
282
+ z-index: var(--z-popover);
283
+ }
284
+
285
+ .ui-popover:not([popover], .is-open) {
286
+ display: none;
287
+ }
288
+
289
+ .ui-popover[popover]:not(:popover-open) {
290
+ display: none;
291
+ }
292
+
208
293
  /* --- Progress — linear, determinate or indeterminate --- */
209
294
 
210
295
  .ui-progress {