@ponchia/ui 0.2.1 → 0.3.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.
Files changed (48) hide show
  1. package/README.md +128 -54
  2. package/behaviors/index.d.ts +36 -0
  3. package/behaviors/index.js +321 -7
  4. package/classes/index.d.ts +228 -3
  5. package/classes/index.js +139 -4
  6. package/css/app.css +64 -64
  7. package/css/base.css +136 -24
  8. package/css/content.css +324 -0
  9. package/css/core.css +9 -5
  10. package/css/disclosure.css +323 -0
  11. package/css/dots.css +125 -8
  12. package/css/feedback.css +243 -0
  13. package/css/fonts.css +11 -0
  14. package/css/forms.css +41 -14
  15. package/css/motion.css +29 -5
  16. package/css/navigation.css +22 -86
  17. package/css/overlay.css +206 -0
  18. package/css/primitives.css +37 -18
  19. package/css/site.css +295 -0
  20. package/css/table.css +9 -9
  21. package/css/tokens.css +84 -20
  22. package/dist/bronto.css +1 -0
  23. package/dist/css/app.css +1 -0
  24. package/dist/css/base.css +1 -0
  25. package/dist/css/content.css +1 -0
  26. package/dist/css/disclosure.css +1 -0
  27. package/dist/css/dots.css +1 -0
  28. package/dist/css/feedback.css +1 -0
  29. package/dist/css/fonts.css +1 -0
  30. package/dist/css/forms.css +1 -0
  31. package/dist/css/motion.css +1 -0
  32. package/dist/css/navigation.css +1 -0
  33. package/dist/css/overlay.css +1 -0
  34. package/dist/css/primitives.css +1 -0
  35. package/dist/css/site.css +1 -0
  36. package/dist/css/table.css +1 -0
  37. package/dist/css/tokens.css +1 -0
  38. package/package.json +62 -21
  39. package/shiki/nothing.json +83 -0
  40. package/tokens/index.d.ts +18 -10
  41. package/tokens/index.js +16 -14
  42. package/tokens/index.json +32 -28
  43. package/tokens/tokens.dtcg.json +589 -0
  44. package/css/cards.css +0 -336
  45. package/css/index.css +0 -5
  46. package/css/layout.css +0 -219
  47. package/css/responsive.css +0 -157
  48. package/css/typography.css +0 -139
package/css/app.css CHANGED
@@ -3,32 +3,32 @@
3
3
  For admin / operator dashboards.
4
4
  ========================================================================== */
5
5
 
6
- .app-shell {
6
+ .ui-app-shell {
7
7
  display: grid;
8
8
  grid-template-columns: var(--app-rail, 14rem) minmax(0, 1fr);
9
- min-height: 100vh;
9
+ min-block-size: 100vh;
10
10
  }
11
11
 
12
- .app-shell--full {
12
+ .ui-app-shell--full {
13
13
  grid-template-columns: minmax(0, 1fr);
14
14
  }
15
15
 
16
16
  /* --- Sidebar rail --- */
17
17
 
18
- .app-rail {
18
+ .ui-app-rail {
19
19
  background: var(--panel);
20
- border-right: 1px solid var(--line);
20
+ border-inline-end: 1px solid var(--line);
21
21
  display: flex;
22
22
  flex-direction: column;
23
23
  gap: var(--space-md);
24
24
  padding: var(--space-md);
25
25
  position: sticky;
26
- top: 0;
27
- height: 100vh;
26
+ inset-block-start: 0;
27
+ block-size: 100vh;
28
28
  overflow-y: auto;
29
29
  }
30
30
 
31
- .app-rail__brand {
31
+ .ui-app-rail__brand {
32
32
  align-items: center;
33
33
  color: var(--text);
34
34
  display: flex;
@@ -40,20 +40,20 @@
40
40
  text-transform: uppercase;
41
41
  }
42
42
 
43
- .app-rail__brand::before {
43
+ .ui-app-rail__brand::before {
44
44
  background: var(--accent);
45
45
  border-radius: 50%;
46
46
  content: '';
47
- height: 0.5rem;
48
- width: 0.5rem;
47
+ block-size: 0.5rem;
48
+ inline-size: 0.5rem;
49
49
  }
50
50
 
51
- .app-nav {
51
+ .ui-app-nav {
52
52
  display: grid;
53
53
  gap: 0.15rem;
54
54
  }
55
55
 
56
- .app-nav__section {
56
+ .ui-app-nav__section {
57
57
  color: var(--text-dim);
58
58
  font-family: var(--mono);
59
59
  font-size: var(--text-2xs);
@@ -63,9 +63,9 @@
63
63
  text-transform: uppercase;
64
64
  }
65
65
 
66
- .app-nav a {
66
+ .ui-app-nav a {
67
67
  align-items: center;
68
- border-left: 2px solid transparent;
68
+ border-inline-start: 2px solid transparent;
69
69
  color: var(--text-soft);
70
70
  display: flex;
71
71
  font-family: var(--mono);
@@ -78,62 +78,62 @@
78
78
  color var(--duration-fast) var(--ease-standard);
79
79
  }
80
80
 
81
- .app-nav a::before {
81
+ .ui-app-nav a::before {
82
82
  background: currentColor;
83
83
  border-radius: 50%;
84
84
  content: '';
85
- height: 0.34rem;
85
+ block-size: 0.34rem;
86
86
  opacity: 0.45;
87
- width: 0.34rem;
87
+ inline-size: 0.34rem;
88
88
  }
89
89
 
90
- .app-nav a:hover {
90
+ .ui-app-nav a:hover {
91
91
  background: var(--bg-accent);
92
92
  color: var(--text);
93
93
  }
94
94
 
95
- .app-nav a.is-active {
95
+ .ui-app-nav a.is-active {
96
96
  background: var(--accent-soft);
97
- border-left-color: var(--accent);
98
- color: var(--accent);
97
+ border-inline-start-color: var(--accent);
98
+ color: var(--accent-text);
99
99
  }
100
100
 
101
- .app-nav a.is-active::before {
101
+ .ui-app-nav a.is-active::before {
102
102
  opacity: 1;
103
103
  }
104
104
 
105
- .app-rail__foot {
106
- border-top: 1px solid var(--line);
105
+ .ui-app-rail__foot {
106
+ border-block-start: 1px solid var(--line);
107
107
  color: var(--text-dim);
108
108
  font-family: var(--mono);
109
109
  font-size: var(--text-2xs);
110
- margin-top: auto;
111
- padding-top: var(--space-sm);
110
+ margin-block-start: auto;
111
+ padding-block-start: var(--space-sm);
112
112
  }
113
113
 
114
114
  /* --- Main column --- */
115
115
 
116
- .app-main {
116
+ .ui-app-main {
117
117
  display: flex;
118
118
  flex-direction: column;
119
- min-width: 0;
119
+ min-inline-size: 0;
120
120
  }
121
121
 
122
- .app-topbar {
122
+ .ui-app-topbar {
123
123
  align-items: center;
124
124
  background: color-mix(in srgb, var(--bg) 86%, transparent);
125
125
  backdrop-filter: blur(8px);
126
- border-bottom: 1px solid var(--line);
126
+ border-block-end: 1px solid var(--line);
127
127
  display: flex;
128
128
  gap: var(--space-md);
129
129
  justify-content: space-between;
130
130
  padding: 0.75rem var(--space-lg);
131
131
  position: sticky;
132
- top: 0;
132
+ inset-block-start: 0;
133
133
  z-index: 10;
134
134
  }
135
135
 
136
- .app-topbar__title {
136
+ .ui-app-topbar__title {
137
137
  color: var(--text);
138
138
  font-family: var(--display);
139
139
  font-size: 1.1rem;
@@ -142,7 +142,7 @@
142
142
  text-transform: uppercase;
143
143
  }
144
144
 
145
- .app-content {
145
+ .ui-app-content {
146
146
  display: grid;
147
147
  gap: var(--space-lg);
148
148
  padding: var(--space-lg);
@@ -150,7 +150,7 @@
150
150
 
151
151
  /* --- Toolbar --- */
152
152
 
153
- .app-toolbar {
153
+ .ui-app-toolbar {
154
154
  align-items: center;
155
155
  background: var(--panel);
156
156
  border: 1px solid var(--line);
@@ -162,7 +162,7 @@
162
162
  padding: 0.7rem 0.85rem;
163
163
  }
164
164
 
165
- .app-toolbar__group {
165
+ .ui-app-toolbar__group {
166
166
  align-items: center;
167
167
  display: flex;
168
168
  flex-wrap: wrap;
@@ -171,7 +171,7 @@
171
171
 
172
172
  /* --- Panel --- */
173
173
 
174
- .app-panel {
174
+ .ui-app-panel {
175
175
  background: var(--panel);
176
176
  border: 1px solid var(--line);
177
177
  border-radius: var(--radius-md);
@@ -180,14 +180,14 @@
180
180
  padding: var(--space-md);
181
181
  }
182
182
 
183
- .app-panel__head {
183
+ .ui-app-panel__head {
184
184
  align-items: flex-start;
185
185
  display: flex;
186
186
  gap: 0.7rem;
187
187
  justify-content: space-between;
188
188
  }
189
189
 
190
- .app-panel__title {
190
+ .ui-app-panel__title {
191
191
  color: var(--text);
192
192
  font-family: var(--display);
193
193
  font-size: 0.95rem;
@@ -196,21 +196,21 @@
196
196
  text-transform: uppercase;
197
197
  }
198
198
 
199
- .app-panel__head p,
200
- .app-empty-state p {
199
+ .ui-app-panel__head p,
200
+ .ui-app-empty-state p {
201
201
  color: var(--text-dim);
202
202
  margin: 0.3rem 0 0;
203
203
  }
204
204
 
205
205
  /* --- Metric tiles --- */
206
206
 
207
- .app-metrics {
207
+ .ui-app-metrics {
208
208
  display: grid;
209
209
  gap: var(--space-md);
210
210
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
211
211
  }
212
212
 
213
- .app-metric {
213
+ .ui-app-metric {
214
214
  background: var(--panel);
215
215
  border: 1px solid var(--line);
216
216
  border-radius: var(--radius-md);
@@ -219,7 +219,7 @@
219
219
  padding: var(--space-md);
220
220
  }
221
221
 
222
- .app-metric__label {
222
+ .ui-app-metric__label {
223
223
  color: var(--text-dim);
224
224
  font-family: var(--mono);
225
225
  font-size: var(--text-2xs);
@@ -227,7 +227,7 @@
227
227
  text-transform: uppercase;
228
228
  }
229
229
 
230
- .app-metric__value {
230
+ .ui-app-metric__value {
231
231
  color: var(--text);
232
232
  font-family: var(--display);
233
233
  font-size: 1.9rem;
@@ -236,22 +236,22 @@
236
236
  line-height: 1;
237
237
  }
238
238
 
239
- .app-metric__delta {
239
+ .ui-app-metric__delta {
240
240
  font-family: var(--mono);
241
241
  font-size: var(--text-xs);
242
242
  }
243
243
 
244
- .app-metric__delta.is-pos {
244
+ .ui-app-metric__delta.is-pos {
245
245
  color: var(--success);
246
246
  }
247
247
 
248
- .app-metric__delta.is-neg {
248
+ .ui-app-metric__delta.is-neg {
249
249
  color: var(--danger);
250
250
  }
251
251
 
252
252
  /* --- Empty state --- */
253
253
 
254
- .app-empty-state {
254
+ .ui-app-empty-state {
255
255
  border: 1px dashed var(--line-strong);
256
256
  border-radius: var(--radius-md);
257
257
  color: var(--text-dim);
@@ -261,49 +261,49 @@
261
261
 
262
262
  /* --- Mobile rail collapse --- */
263
263
 
264
- .app-rail__toggle {
264
+ .ui-app-rail__toggle {
265
265
  display: none;
266
266
  }
267
267
 
268
268
  @media (max-width: 880px) {
269
- .app-shell {
269
+ .ui-app-shell {
270
270
  grid-template-columns: minmax(0, 1fr);
271
271
  }
272
272
 
273
- .app-rail {
273
+ .ui-app-rail {
274
274
  flex-direction: row;
275
- height: auto;
275
+ block-size: auto;
276
276
  overflow-x: auto;
277
277
  position: sticky;
278
- top: 0;
278
+ inset-block-start: 0;
279
279
  z-index: 11;
280
280
  }
281
281
 
282
- .app-rail__foot {
282
+ .ui-app-rail__foot {
283
283
  display: none;
284
284
  }
285
285
 
286
- .app-nav {
286
+ .ui-app-nav {
287
287
  grid-auto-flow: column;
288
288
  gap: 0.15rem;
289
289
  }
290
290
 
291
- .app-nav__section {
291
+ .ui-app-nav__section {
292
292
  display: none;
293
293
  }
294
294
 
295
- .app-nav a {
296
- border-left: 0;
297
- border-bottom: 2px solid transparent;
295
+ .ui-app-nav a {
296
+ border-inline-start: 0;
297
+ border-block-end: 2px solid transparent;
298
298
  white-space: nowrap;
299
299
  }
300
300
 
301
- .app-nav a.is-active {
302
- border-left: 0;
303
- border-bottom-color: var(--accent);
301
+ .ui-app-nav a.is-active {
302
+ border-inline-start: 0;
303
+ border-block-end-color: var(--accent);
304
304
  }
305
305
 
306
- .app-content {
306
+ .ui-app-content {
307
307
  padding: var(--space-md);
308
308
  }
309
309
  }
package/css/base.css CHANGED
@@ -24,7 +24,7 @@ body {
24
24
  background: var(--bg);
25
25
  color: var(--text);
26
26
  margin: 0;
27
- min-height: 100vh;
27
+ min-block-size: 100vh;
28
28
  position: relative;
29
29
  }
30
30
 
@@ -58,7 +58,7 @@ textarea {
58
58
  img,
59
59
  svg {
60
60
  display: block;
61
- max-width: 100%;
61
+ max-inline-size: 100%;
62
62
  }
63
63
 
64
64
  p,
@@ -134,13 +134,13 @@ pre code {
134
134
 
135
135
  hr {
136
136
  border: 0;
137
- border-top: 1px solid var(--line);
137
+ border-block-start: 1px solid var(--line);
138
138
  margin: var(--space-lg) 0;
139
139
  }
140
140
 
141
141
  ::-webkit-scrollbar {
142
- height: 10px;
143
- width: 10px;
142
+ block-size: 10px;
143
+ inline-size: 10px;
144
144
  }
145
145
 
146
146
  ::-webkit-scrollbar-thumb {
@@ -161,26 +161,10 @@ input:focus-visible,
161
161
  select:focus-visible,
162
162
  textarea:focus-visible,
163
163
  [tabindex]:focus-visible {
164
- outline: 2px solid var(--accent);
164
+ outline: 2px solid var(--focus-ring);
165
165
  outline-offset: 2px;
166
166
  }
167
167
 
168
- .skip-link {
169
- background: var(--panel-strong);
170
- border: 1px solid var(--line-strong);
171
- border-radius: var(--radius-md);
172
- color: var(--text);
173
- left: 1rem;
174
- padding: 0.7rem 1rem;
175
- position: fixed;
176
- top: -4rem;
177
- z-index: 40;
178
- }
179
-
180
- .skip-link:focus {
181
- top: 1rem;
182
- }
183
-
184
168
  /* Small global helpers reused across apps. */
185
169
  .ui-muted {
186
170
  color: var(--text-dim);
@@ -198,9 +182,137 @@ textarea:focus-visible,
198
182
  .ui-visually-hidden {
199
183
  clip: rect(0 0 0 0);
200
184
  clip-path: inset(50%);
201
- height: 1px;
185
+ block-size: 1px;
202
186
  overflow: hidden;
203
187
  position: absolute;
204
188
  white-space: nowrap;
205
- width: 1px;
189
+ inline-size: 1px;
190
+ }
191
+
192
+ /* --------------------------------------------------------------------------
193
+ Forced colors (Windows High Contrast). The OS replaces the palette and
194
+ strips backgrounds/shadows, so any state signalled only by a fill goes
195
+ invisible. Re-assert those with system colors so meaning survives.
196
+ -------------------------------------------------------------------------- */
197
+ @media (forced-colors: active) {
198
+ .ui-progress__bar,
199
+ .ui-dotbar i.is-on,
200
+ .ui-dotspinner i {
201
+ background: Highlight;
202
+ }
203
+
204
+ .ui-dot,
205
+ .ui-dot--accent,
206
+ .ui-dot--success,
207
+ .ui-dot--warning,
208
+ .ui-dot--danger,
209
+ .ui-switch__thumb {
210
+ background: CanvasText;
211
+ }
212
+
213
+ .ui-dot--live::after {
214
+ border-color: CanvasText;
215
+ }
216
+
217
+ .ui-switch input:checked + .ui-switch__track,
218
+ .ui-segmented__option:has(input:checked) {
219
+ outline: 2px solid Highlight;
220
+ outline-offset: -2px;
221
+ }
222
+
223
+ /* The active tab signals selection only via accent colour/border, both
224
+ flattened by the forced palette — re-assert it with a system colour
225
+ so the selected tab stays distinguishable (a11y review L3). */
226
+ .ui-tab.is-active {
227
+ border-block-end-color: Highlight;
228
+ color: Highlight;
229
+ }
230
+
231
+ /* Keyboard focus must never depend on a colour that gets overridden. */
232
+ a:focus-visible,
233
+ button:focus-visible,
234
+ summary:focus-visible,
235
+ input:focus-visible,
236
+ select:focus-visible,
237
+ textarea:focus-visible,
238
+ [tabindex]:focus-visible {
239
+ outline: 2px solid Highlight;
240
+ }
241
+ }
242
+
243
+ /* --------------------------------------------------------------------------
244
+ Print — ink on white, no chrome, no page-break scars. The framework
245
+ dresses content sites too, so a clean printout / PDF matters.
246
+ -------------------------------------------------------------------------- */
247
+ @media print {
248
+ html,
249
+ body {
250
+ background: #fff;
251
+ color: #000;
252
+ }
253
+
254
+ /* Decorative / interactive chrome never prints. */
255
+ .ui-dotfield,
256
+ .ui-toast-stack,
257
+ .ui-app-rail,
258
+ .ui-app-topbar,
259
+ .ui-sitenav,
260
+ .ui-themetoggle__button,
261
+ .ui-sitemenu,
262
+ .ui-spinner,
263
+ .ui-dotloader,
264
+ .ui-dotspinner,
265
+ dialog.ui-modal::backdrop {
266
+ display: none !important;
267
+ }
268
+
269
+ /* Flat ink: drop shadows/fills, keep hairlines as real rules. */
270
+ *,
271
+ *::before,
272
+ *::after {
273
+ box-shadow: none !important;
274
+ text-shadow: none !important;
275
+ }
276
+
277
+ .ui-card,
278
+ .ui-panel,
279
+ .ui-surface,
280
+ .ui-alert,
281
+ .ui-table-wrap {
282
+ border: 1px solid #999;
283
+ }
284
+
285
+ /* Scroll containers must spill on paper, not clip. */
286
+ .ui-table-wrap,
287
+ .ui-prose table,
288
+ .ui-tabs__list,
289
+ pre {
290
+ overflow: visible !important;
291
+ }
292
+
293
+ /* Do not split atomic blocks across pages. */
294
+ .ui-card,
295
+ .ui-panel,
296
+ .ui-alert,
297
+ figure,
298
+ blockquote,
299
+ pre,
300
+ tr {
301
+ break-inside: avoid;
302
+ }
303
+
304
+ :is(h1, h2, h3, h4, h5, h6) {
305
+ break-after: avoid;
306
+ }
307
+
308
+ /* Long-form: surface link targets when printed. */
309
+ .ui-prose a[href^="http"]::after {
310
+ content: " (" attr(href) ")";
311
+ font-size: 0.85em;
312
+ word-break: break-all;
313
+ }
314
+
315
+ @page {
316
+ margin: 18mm;
317
+ }
206
318
  }