@ponchia/ui 0.4.1 → 0.6.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 (153) hide show
  1. package/CHANGELOG.md +552 -8
  2. package/MIGRATIONS.json +106 -0
  3. package/README.md +34 -8
  4. package/annotations/index.d.ts +402 -0
  5. package/annotations/index.d.ts.map +1 -0
  6. package/annotations/index.js +792 -0
  7. package/behaviors/carousel.js +198 -0
  8. package/behaviors/combobox.js +226 -0
  9. package/behaviors/command.js +190 -0
  10. package/behaviors/connectors.js +95 -0
  11. package/behaviors/crosshair.js +57 -0
  12. package/behaviors/dialog.js +74 -0
  13. package/behaviors/disclosure.js +26 -0
  14. package/behaviors/dismissible.js +25 -0
  15. package/behaviors/forms.js +186 -0
  16. package/behaviors/glyph.js +108 -0
  17. package/behaviors/index.d.ts +79 -0
  18. package/behaviors/index.js +18 -1409
  19. package/behaviors/internal.js +97 -0
  20. package/behaviors/legend.js +67 -0
  21. package/behaviors/menu.js +47 -0
  22. package/behaviors/popover.js +179 -0
  23. package/behaviors/spotlight.js +52 -0
  24. package/behaviors/table.js +136 -0
  25. package/behaviors/tabs.js +103 -0
  26. package/behaviors/theme.js +84 -0
  27. package/behaviors/toast.js +164 -0
  28. package/classes/classes.json +1857 -0
  29. package/classes/index.d.ts +306 -13
  30. package/classes/index.js +339 -12
  31. package/classes/vscode.css-custom-data.json +12 -0
  32. package/connectors/index.d.ts +191 -0
  33. package/connectors/index.d.ts.map +1 -0
  34. package/connectors/index.js +275 -0
  35. package/css/analytical.css +21 -0
  36. package/css/annotations.css +292 -0
  37. package/css/app.css +43 -13
  38. package/css/base.css +15 -10
  39. package/css/command.css +97 -0
  40. package/css/connectors.css +110 -0
  41. package/css/content.css +7 -1
  42. package/css/crosshair.css +100 -0
  43. package/css/dataviz.css +5 -1
  44. package/css/disclosure.css +38 -6
  45. package/css/dots.css +57 -0
  46. package/css/feedback.css +111 -2
  47. package/css/fonts.css +11 -7
  48. package/css/forms.css +42 -1
  49. package/css/generated.css +117 -0
  50. package/css/legend.css +272 -0
  51. package/css/marks.css +174 -0
  52. package/css/motion.css +24 -44
  53. package/css/navigation.css +7 -0
  54. package/css/overlay.css +31 -1
  55. package/css/primitives.css +109 -5
  56. package/css/report.css +39 -81
  57. package/css/selection.css +46 -0
  58. package/css/site.css +16 -2
  59. package/css/sources.css +221 -0
  60. package/css/spotlight.css +104 -0
  61. package/css/state.css +121 -0
  62. package/css/tokens.css +60 -37
  63. package/css/workbench.css +83 -0
  64. package/dist/bronto.css +1 -1
  65. package/dist/css/analytical.css +1 -0
  66. package/dist/css/annotations.css +1 -0
  67. package/dist/css/app.css +1 -1
  68. package/dist/css/base.css +1 -1
  69. package/dist/css/command.css +1 -0
  70. package/dist/css/connectors.css +1 -0
  71. package/dist/css/content.css +1 -1
  72. package/dist/css/crosshair.css +1 -0
  73. package/dist/css/disclosure.css +1 -1
  74. package/dist/css/dots.css +1 -1
  75. package/dist/css/feedback.css +1 -1
  76. package/dist/css/fonts.css +1 -1
  77. package/dist/css/forms.css +1 -1
  78. package/dist/css/generated.css +1 -0
  79. package/dist/css/legend.css +1 -0
  80. package/dist/css/marks.css +1 -0
  81. package/dist/css/motion.css +1 -1
  82. package/dist/css/navigation.css +1 -1
  83. package/dist/css/overlay.css +1 -1
  84. package/dist/css/primitives.css +1 -1
  85. package/dist/css/report.css +1 -1
  86. package/dist/css/selection.css +1 -0
  87. package/dist/css/site.css +1 -1
  88. package/dist/css/sources.css +1 -0
  89. package/dist/css/spotlight.css +1 -0
  90. package/dist/css/state.css +1 -0
  91. package/dist/css/tokens.css +1 -1
  92. package/dist/css/workbench.css +1 -0
  93. package/docs/adr/0003-theme-model.md +7 -4
  94. package/docs/annotations.md +425 -0
  95. package/docs/architecture.md +246 -0
  96. package/docs/command.md +95 -0
  97. package/docs/connectors.md +91 -0
  98. package/docs/contrast.md +116 -92
  99. package/docs/crosshair.md +63 -0
  100. package/docs/d2.md +195 -0
  101. package/docs/generated.md +91 -0
  102. package/docs/legends.md +184 -0
  103. package/docs/marks.md +93 -0
  104. package/docs/mermaid.md +152 -0
  105. package/docs/reference.md +385 -23
  106. package/docs/reporting.md +436 -63
  107. package/docs/selection.md +40 -0
  108. package/docs/sources.md +137 -0
  109. package/docs/spotlight.md +78 -0
  110. package/docs/stability.md +24 -2
  111. package/docs/state.md +85 -0
  112. package/docs/usage.md +123 -4
  113. package/docs/vega.md +225 -0
  114. package/docs/workbench.md +78 -0
  115. package/fonts/doto-400.woff2 +0 -0
  116. package/fonts/doto-500.woff2 +0 -0
  117. package/fonts/doto-600.woff2 +0 -0
  118. package/fonts/doto-700.woff2 +0 -0
  119. package/fonts/doto-800.woff2 +0 -0
  120. package/fonts/doto-900.woff2 +0 -0
  121. package/glyphs/glyphs.js +6 -4
  122. package/llms.txt +362 -14
  123. package/package.json +115 -12
  124. package/qwik/index.d.ts +42 -54
  125. package/qwik/index.d.ts.map +1 -0
  126. package/qwik/index.js +75 -3
  127. package/react/index.d.ts +39 -56
  128. package/react/index.d.ts.map +1 -0
  129. package/react/index.js +67 -3
  130. package/solid/index.d.ts +64 -56
  131. package/solid/index.d.ts.map +1 -0
  132. package/solid/index.js +70 -3
  133. package/tokens/d2.d.ts +38 -0
  134. package/tokens/d2.js +71 -0
  135. package/tokens/d2.json +43 -0
  136. package/tokens/index.d.ts +5 -5
  137. package/tokens/index.js +23 -5
  138. package/tokens/index.json +9 -0
  139. package/tokens/mermaid.d.ts +23 -0
  140. package/tokens/mermaid.js +181 -0
  141. package/tokens/mermaid.json +163 -0
  142. package/tokens/resolved.json +45 -1
  143. package/tokens/skins.js +3 -2
  144. package/tokens/tokens.dtcg.json +26 -0
  145. package/tokens/vega.d.ts +34 -0
  146. package/tokens/vega.js +155 -0
  147. package/tokens/vega.json +179 -0
  148. package/fonts/doto-400.ttf +0 -0
  149. package/fonts/doto-500.ttf +0 -0
  150. package/fonts/doto-600.ttf +0 -0
  151. package/fonts/doto-700.ttf +0 -0
  152. package/fonts/doto-800.ttf +0 -0
  153. package/fonts/doto-900.ttf +0 -0
package/css/tokens.css CHANGED
@@ -1,11 +1,12 @@
1
1
  /* ==========================================================================
2
- @ponchia/ui — design tokens
3
- Nothing-inspired: monochrome surfaces, single red accent, dot-matrix type.
4
- Dual light/dark. Variable names are stable so semantic classes inherit.
5
- The Doto @font-face declarations live in fonts.css (bundled by
6
- core.css/index.css) so font hosting is decoupled from these tokens
7
- a consumer can self-host Doto and still use the token layer by
8
- overriding --display / --dot-font.
2
+ @ponchia/ui — design tokens ⟨generated⟩
3
+ Single source of truth: tokens/index.js (`cssVars`). Edit token VALUES
4
+ there, then run `npm run tokens:css:build`. The four :root blocks below are
5
+ emitted from cssVars the dark palette is authored ONCE (not the former two
6
+ CSS blocks + the JS mirror). Drift-checked by `npm run check:fresh` (scripts/check-fresh.mjs).
7
+ The Doto @font-face lives in fonts.css; override --display / --dot-font to
8
+ self-host. CSS-only presets (density / contrast / OLED) are hand-authored
9
+ below the marker — they are intentionally not part of the JS token model.
9
10
  ========================================================================== */
10
11
 
11
12
  :root {
@@ -16,7 +17,7 @@
16
17
  --radius-sm: 1px;
17
18
  --radius-pill: 999px;
18
19
 
19
- /* Spacing scale */
20
+ /* Spacing scale. */
20
21
  --space-2xs: 0.25rem;
21
22
  --space-xs: 0.5rem;
22
23
  --space-sm: 0.75rem;
@@ -27,10 +28,11 @@
27
28
 
28
29
  /* Type — Doto is the dot-matrix display face; body stays mono-grotesque. */
29
30
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', ui-monospace, monospace;
30
- --sans:
31
- 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
31
+ --sans: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
32
32
  --dot-font: 'Doto', var(--mono);
33
33
  --display: var(--dot-font);
34
+ --display-weight: 700;
35
+ --display-weight-strong: 800;
34
36
  --text-2xs: 0.68rem;
35
37
  --text-xs: 0.76rem;
36
38
  --text-sm: 0.86rem;
@@ -48,14 +50,11 @@
48
50
  --duration-base: 200ms;
49
51
  --duration-slow: 360ms;
50
52
 
51
- /* Dot-matrix motif sizing */
53
+ /* Dot-matrix motif sizing. */
52
54
  --dot-size: 2px;
53
55
  --dot-gap: 14px;
54
56
 
55
- /* Stacking-context scale. Replaces scattered magic z-indexes so
56
- consumers can reason about (and override) layering coherently.
57
- Values match the prior literals — purely a refactor, no visual
58
- change. */
57
+ /* Stacking-context scale (values match the prior literals — pure refactor). */
59
58
  --z-base: 0;
60
59
  --z-raised: 10;
61
60
  --z-sticky: 20;
@@ -63,11 +62,7 @@
63
62
  --z-popover: 50;
64
63
  --z-toast: 60;
65
64
 
66
- /* Accent ramp — a stepped family for charts / data-viz / multi-state
67
- surfaces (the use case tokens/index.js advertises). Derived from the
68
- single --accent knob via OKLCH color-mix against a per-theme white/black
69
- endpoint. Using an explicit neutral endpoint avoids low-chroma background
70
- hue differences between browser engines. */
65
+ /* Accent ramp — a stepped family for charts / data-viz, derived from the single --accent knob via OKLCH color-mix against a per-theme white/black endpoint. */
71
66
  --accent-1: color-mix(in oklch, var(--accent) 8%, var(--accent-ramp-end));
72
67
  --accent-2: color-mix(in oklch, var(--accent) 16%, var(--accent-ramp-end));
73
68
  --accent-3: color-mix(in oklch, var(--accent) 32%, var(--accent-ramp-end));
@@ -83,10 +78,7 @@
83
78
  --surface-5: var(--line);
84
79
  --surface-6: var(--line-strong);
85
80
 
86
- /* Semantic tier — stable, prefixed aliases over the (shorter,
87
- legacy) primitive names. New consumer code should target these:
88
- re-skinning one role no longer means chasing component internals.
89
- The short names below stay as permanent back-compat aliases. */
81
+ /* Semantic --bronto-color-* tier — stable, prefixed aliases over the primitives. */
90
82
  --bronto-color-bg: var(--bg);
91
83
  --bronto-color-surface: var(--panel);
92
84
  --bronto-color-surface-raised: var(--panel-strong);
@@ -102,7 +94,7 @@
102
94
  --bronto-color-danger: var(--danger);
103
95
  --bronto-color-info: var(--info);
104
96
 
105
- /* Aliases kept for back-compat with existing semantic classes */
97
+ /* Aliases kept for back-compat with existing semantic classes. */
106
98
  --surface: var(--panel);
107
99
  --surface-raised: var(--panel-strong);
108
100
  --surface-muted: var(--panel-soft);
@@ -132,6 +124,7 @@
132
124
  --accent-ramp-end: #ffffff;
133
125
  --accent-strong: color-mix(in srgb, var(--accent) 83%, #000);
134
126
  --accent-text: var(--accent-strong);
127
+ --on-accent: var(--button-text);
135
128
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
136
129
  --success: #2f7d4f;
137
130
  --success-soft: rgb(47, 125, 79, 0.12);
@@ -146,24 +139,15 @@
146
139
  --field-dot: rgb(10, 10, 10, 0.16);
147
140
  --field-dot-hot: rgb(10, 10, 10, 0.4);
148
141
  --field-dot-accent: color-mix(in srgb, var(--accent) 78%, transparent);
149
-
150
- /* Solid by default: this token drives every focus outline, so it must
151
- clear the 3:1 non-text contrast minimum. Override per theme/subtree
152
- to tune the ring without touching --accent. */
153
142
  --focus-ring: var(--accent);
154
143
  --shadow: none;
155
144
  --shadow-raised: 0 0 0 1px var(--line-strong);
156
145
  }
157
146
 
158
147
  /* --------------------------------------------------------------------------
159
- Dark — true black. The Nothing default.
160
-
161
- The palette below is intentionally written twice: once under
162
- `prefers-color-scheme: dark` (system default, unless overridden to light)
163
- and once under `[data-theme='dark']` (explicit opt-in). Vanilla CSS can't
164
- share one declaration block between a media query and a top-level selector
165
- without a build step or nesting, neither of which this zero-dep package
166
- has. Keep the two blocks in sync when editing dark tokens.
148
+ Dark — emitted from cssVars.dark under BOTH the system preference and the
149
+ explicit [data-theme='dark'] opt-in. Authored once in tokens/index.js, so
150
+ the two blocks below can no longer drift from each other.
167
151
  -------------------------------------------------------------------------- */
168
152
  @media (prefers-color-scheme: dark) {
169
153
  :root:not([data-theme='light']) {
@@ -184,6 +168,7 @@
184
168
  --accent-ramp-end: #000000;
185
169
  --accent-strong: color-mix(in srgb, var(--accent) 84%, #fff);
186
170
  --accent-text: var(--accent-strong);
171
+ --on-accent: var(--button-text);
187
172
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
188
173
  --success: #4ec27e;
189
174
  --success-soft: rgb(78, 194, 126, 0.14);
@@ -222,6 +207,7 @@
222
207
  --accent-ramp-end: #000000;
223
208
  --accent-strong: color-mix(in srgb, var(--accent) 84%, #fff);
224
209
  --accent-text: var(--accent-strong);
210
+ --on-accent: var(--button-text);
225
211
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
226
212
  --success: #4ec27e;
227
213
  --success-soft: rgb(78, 194, 126, 0.14);
@@ -241,6 +227,13 @@
241
227
  --shadow-raised: 0 0 0 1px var(--line-strong);
242
228
  }
243
229
 
230
+ /* ==========================================================================
231
+ HAND-AUTHORED BELOW — CSS-only presets (density / contrast / OLED) and the
232
+ theming-contract notes. These are intentionally NOT in the JS token model
233
+ (tokens/index.js), so they are preserved verbatim when the palette above is
234
+ regenerated by scripts/gen-tokens-css.mjs.
235
+ ========================================================================== */
236
+
244
237
  /* --------------------------------------------------------------------------
245
238
  Theming contract — the public override surface.
246
239
 
@@ -323,3 +316,33 @@
323
316
  --panel-soft: #1a1a1a;
324
317
  }
325
318
  }
319
+
320
+ /* --------------------------------------------------------------------------
321
+ Print — force an ink-on-white document regardless of the on-screen theme.
322
+ The palette tokens are [data-theme]-scoped raw values, so `color-scheme`
323
+ alone can't flip them: re-point the neutrals to achromatic ink/paper and the
324
+ status/accent hues to their light-theme (print-legible) values. This lifts
325
+ the same remap report.css scopes to `.ui-report` up to :root, so a bare
326
+ .ui-card / .ui-statgrid / .ui-table (the markup an external LLM emits) also
327
+ prints dark-on-white instead of light-grey text or a dark panel on white.
328
+ Lives here, in the exempt tier-definition file, because it is a token-value
329
+ override (ADR-0001), not component styling. CSS-only, like the presets above.
330
+ -------------------------------------------------------------------------- */
331
+ @media print {
332
+ :root {
333
+ color-scheme: light;
334
+
335
+ --text: #111;
336
+ --text-soft: #2a2a2a;
337
+ --text-dim: #555;
338
+ --panel: #fff;
339
+ --panel-soft: #f7f7f7;
340
+ --line: #d9d9d9;
341
+ --line-strong: #b3b3b3;
342
+ --success: #2f7d4f;
343
+ --danger: #c01622;
344
+ --warning: #806414;
345
+ --info: #1f63c4;
346
+ --accent: #d71921;
347
+ }
348
+ }
@@ -0,0 +1,83 @@
1
+ /* ==========================================================================
2
+ workbench — opt-in inspector / property / selection-bar primitives.
3
+
4
+ Real tools need inspectors, property rows, and a bar of actions on the
5
+ current selection. Generic kits stop at cards/tables/forms, so every app
6
+ builds its own half-consistent workbench. This is the low-risk CSS core:
7
+ layout and affordances only. Resizable split panes (a focusable ARIA
8
+ window-splitter behavior) and drag handles are deliberately deferred until a
9
+ consumer needs them. Not imported by core.css.
10
+ ========================================================================== */
11
+
12
+ /* --- Inspector — a panel of details for the selected object. --- */
13
+ .ui-inspector {
14
+ background: var(--panel);
15
+ border: 1px solid var(--line);
16
+ border-radius: var(--radius-md);
17
+ display: grid;
18
+ gap: var(--space-sm);
19
+ padding: var(--space-md);
20
+ }
21
+
22
+ .ui-inspector__head {
23
+ align-items: baseline;
24
+ border-block-end: 1px solid var(--line);
25
+ display: flex;
26
+ gap: var(--space-sm);
27
+ justify-content: space-between;
28
+ padding-block-end: var(--space-xs);
29
+ }
30
+
31
+ .ui-inspector__body {
32
+ display: grid;
33
+ gap: var(--space-2xs);
34
+ }
35
+
36
+ /* --- Property row — a label/value pair, denser than ui-key-value and tuned
37
+ for an inspector (the value can hold an input or a static read-out). --- */
38
+ .ui-property {
39
+ align-items: baseline;
40
+ display: grid;
41
+ gap: var(--space-sm);
42
+ grid-template-columns: minmax(6rem, 38%) 1fr;
43
+ }
44
+
45
+ .ui-property__label {
46
+ color: var(--text-dim);
47
+ font-family: var(--mono);
48
+ font-size: var(--text-2xs);
49
+ letter-spacing: var(--tracking-wide);
50
+ text-transform: uppercase;
51
+ }
52
+
53
+ .ui-property__value {
54
+ color: var(--text);
55
+ font-size: var(--text-sm);
56
+ min-inline-size: 0;
57
+ }
58
+
59
+ /* --- Selection bar — actions on the current selection ("3 selected"). --- */
60
+ .ui-selectionbar {
61
+ align-items: center;
62
+ background: var(--panel-strong);
63
+ border: 1px solid var(--line-strong);
64
+ border-radius: var(--radius-md);
65
+ box-shadow: var(--shadow-raised);
66
+ display: flex;
67
+ flex-wrap: wrap;
68
+ gap: var(--space-sm) var(--space-md);
69
+ justify-content: space-between;
70
+ padding: 0.5rem 0.85rem;
71
+ }
72
+
73
+ .ui-selectionbar__count {
74
+ color: var(--text);
75
+ font-family: var(--mono);
76
+ font-size: var(--text-sm);
77
+ }
78
+
79
+ .ui-selectionbar__actions {
80
+ display: flex;
81
+ flex-wrap: wrap;
82
+ gap: var(--space-xs);
83
+ }