strata-react 1.3.15 → 1.3.17

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 (58) hide show
  1. package/README.md +47 -8
  2. package/UPGRADING.md +15 -0
  3. package/dist/components/data-table.d.ts +6 -0
  4. package/dist/components/field.d.ts +2 -0
  5. package/dist/components/hotkeys.d.ts +1 -1
  6. package/dist/components/link-card.d.ts +4 -2
  7. package/dist/components/pause-button.d.ts +7 -0
  8. package/dist/components/schedule-table.d.ts +24 -0
  9. package/dist/components/system-panel.d.ts +58 -0
  10. package/dist/components/theme.d.ts +46 -1
  11. package/dist/components/thumbnail.d.ts +2 -0
  12. package/dist/{errors-D99YX4XL.js → errors-jep2voNI.js} +42 -3
  13. package/dist/errors-jep2voNI.js.map +1 -0
  14. package/dist/field-t4Hoer0d.js +587 -0
  15. package/dist/field-t4Hoer0d.js.map +1 -0
  16. package/dist/index.d.ts +6 -3
  17. package/dist/index.js +669 -463
  18. package/dist/index.js.map +1 -1
  19. package/dist/lib/breakpoint.d.ts +4 -0
  20. package/dist/lib/format.d.ts +59 -6
  21. package/dist/map.js +2 -3
  22. package/dist/map.js.map +1 -1
  23. package/dist/microphone-Cu1u5Yml.js +547 -0
  24. package/dist/microphone-Cu1u5Yml.js.map +1 -0
  25. package/dist/panorama.js +3 -2
  26. package/dist/panorama.js.map +1 -1
  27. package/dist/query/index.d.ts +5 -1
  28. package/dist/query/poll.d.ts +24 -0
  29. package/dist/reading.css +11 -0
  30. package/dist/{run-hR9neQHM.js → run-BT2WKzMz.js} +83 -17
  31. package/dist/run-BT2WKzMz.js.map +1 -0
  32. package/dist/strata.bare.css +279 -0
  33. package/dist/strata.css +840 -10
  34. package/dist/strata.migrate.css +15 -6
  35. package/dist/testing/index.d.ts +4 -2
  36. package/dist/testing.js +34 -6
  37. package/dist/testing.js.map +1 -1
  38. package/dist/{theme-By3DSUTs.js → theme-DXacprlw.js} +147 -6
  39. package/dist/theme-DXacprlw.js.map +1 -0
  40. package/dist/{value-controls-B7iNh4WO.js → value-controls-DB5l5Qe2.js} +21 -46
  41. package/dist/value-controls-DB5l5Qe2.js.map +1 -0
  42. package/dist/visual/capture.d.ts +2 -0
  43. package/dist/visual/fonts.d.ts +18 -0
  44. package/dist/visual/index.d.ts +1 -0
  45. package/dist/visual/types.d.ts +7 -1
  46. package/dist/visual-cli.js +1 -1
  47. package/dist/visual.js +1 -1
  48. package/package.json +12 -3
  49. package/dist/errors-D99YX4XL.js.map +0 -1
  50. package/dist/field-QCCmWTuY.js +0 -321
  51. package/dist/field-QCCmWTuY.js.map +0 -1
  52. package/dist/format-B32-PVi2.js +0 -201
  53. package/dist/format-B32-PVi2.js.map +0 -1
  54. package/dist/microphone-BZXMKTCM.js +0 -292
  55. package/dist/microphone-BZXMKTCM.js.map +0 -1
  56. package/dist/run-hR9neQHM.js.map +0 -1
  57. package/dist/theme-By3DSUTs.js.map +0 -1
  58. package/dist/value-controls-B7iNh4WO.js.map +0 -1
@@ -0,0 +1,279 @@
1
+ /* strata-react, the contract alone (`strata-react/strata.bare.css`): the token contract, the namespace
2
+ reset, the type steps, motion utilities and the base layer. It ships no colours and no look. This is
3
+ what an app that brings its own look imports, between Tailwind and its own theme:
4
+
5
+ @import "tailwindcss";
6
+ @import "strata-react/strata.bare.css";
7
+ @import "./theme.generated.css"; (palette.mjs output: shadcn roles + 12-step ramps)
8
+ @import "./theme.css"; (status roles, fonts, any subject colours, with reasons)
9
+
10
+ `strata-react/strata.css` is this file plus Strata's default look (src/styles/theme.css); apps that
11
+ want the default import that one and override what they like (CLAUDE.md, "The stance").
12
+
13
+ An app that already has its own Tailwind colours and sizes imports "strata-react/strata.migrate.css"
14
+ instead: this file without the reset below, so its stock classes keep compiling while it moves
15
+ screens over (the build writes it from this file: scripts/copy-css.mjs). The README says when.
16
+
17
+ The research behind every value is in jburnhams/ux-research, ui-library/tokens.md. */
18
+
19
+ /* strata:geist-begin */
20
+ /* The face of the contract on its own, bundled so no screen is drawn in whatever the machine has (Jonathan, 2026-11-25):
21
+ Geist Variable from Fontsource, a dependency of this package, so an app installs nothing. The
22
+ @font-face rules carry unicode-range, so a browser downloads only the subset a page uses (about
23
+ 32 KB for Latin). A product that names its own face in `--font-sans` still wins; this only
24
+ replaces the system fallback. Vite resolves the files, as it does for any imported CSS. */
25
+ @import "@fontsource-variable/geist";
26
+ /* strata:geist-end */
27
+
28
+ /* strata:strict-begin */
29
+ /* Clear Tailwind's stock namespaces right after Tailwind's own theme loads. With these gone,
30
+ `bg-indigo-500`, `text-sm`, `rounded-xl` and `shadow-lg` do not compile at all: the only colours,
31
+ type steps, radii and shadows that exist are the ones the product's theme names. That is the
32
+ library's strongest anti-drift rule, and it costs nothing at runtime. */
33
+ @theme {
34
+ --color-*: initial;
35
+ --text-*: initial;
36
+ --radius-*: initial;
37
+ --shadow-*: initial;
38
+ --font-*: initial;
39
+ }
40
+ /* strata:strict-end */
41
+
42
+ /* React Aria's state variants (`selected:`, `pressed:`, `hover:`, `focus-visible:`, `disabled:`, `open:`,
43
+ `invalid:`, `expanded:`, `sort-ascending:`…): each reads the `data-*` attribute React Aria Components
44
+ sets, so state is styled once where it is used and never copied into a variant map. On a plain
45
+ element `hover:`, `focus-visible:` and `disabled:` still mean the browser's own (the plugin only takes
46
+ over on elements React Aria marks with `data-rac`). The plugin is a dependency of strata-react, so an
47
+ app needs no install step for it. */
48
+ @plugin "tailwindcss-react-aria-components";
49
+
50
+ @custom-variant dark (&:is(.dark *));
51
+
52
+ /* Status roles are part of the contract but not of the generated palette: the product solves them
53
+ (pale tint + dark ink of one hue, ink >= 6:1 on its tint and on the ground) and sets the
54
+ variables in its theme. Strata only names them. Never the accent. */
55
+ @theme inline {
56
+ --color-success: var(--success);
57
+ --color-success-subtle: var(--success-subtle);
58
+ --color-warning: var(--warning);
59
+ --color-warning-subtle: var(--warning-subtle);
60
+ --color-danger: var(--danger);
61
+ --color-danger-subtle: var(--danger-subtle);
62
+ --color-info: var(--info);
63
+ --color-info-subtle: var(--info-subtle);
64
+ --color-surface-sunken: var(--surface-sunken);
65
+ }
66
+
67
+ @theme {
68
+ /* Geist Variable until the product names its own (a later @theme block wins), then the system
69
+ faces only for the instant before it loads. One family on an Operate surface; --font-display
70
+ is for page titles only. Mono stays a system face: Strata draws little code. */
71
+ --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
72
+ --font-mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
73
+ --font-display: var(--font-sans);
74
+
75
+ /* Radius by role. Optical nesting: inner = outer - padding, so a control inside an 8px overlay
76
+ with 4px padding is 4px, never the same value as its container. */
77
+ --radius-control: 4px;
78
+ --radius-surface: 6px;
79
+ --radius-overlay: 8px;
80
+ --radius-pill: 9999px;
81
+
82
+ /* One elevation channel per surface: hairlines for things on the page, a shadow only for what
83
+ floats above it. */
84
+ --shadow-overlay: 0 1px 2px oklch(0% 0 0 / 0.08), 0 8px 24px oklch(0% 0 0 / 0.12);
85
+
86
+ /* Effects (colour, opacity) never overshoot; spatial gets Material Standard's barely visible
87
+ settle. Expressive springs are a product allowance, recorded in its DESIGN.md. */
88
+ --ease-effects: cubic-bezier(0.34, 0.8, 0.34, 1);
89
+ --ease-spatial: cubic-bezier(0.27, 1.06, 0.18, 1);
90
+ --ease-moment: cubic-bezier(0.23, 1, 0.32, 1);
91
+ }
92
+
93
+ /* Non-colour defaults in the base layer, so any unlayered rule in the product's theme wins
94
+ regardless of import order. */
95
+ @layer base {
96
+ :root {
97
+ --surface-sunken: var(--neutral-2);
98
+
99
+ /* Density: control heights move together (button, input, select). */
100
+ --control-h: 2.5rem;
101
+ --control-h-sm: 2rem;
102
+ /* A button's side padding and icon size, a role like its height (issue #210): a second look scopes them on a class. */
103
+ --control-px: 1rem;
104
+ --control-px-sm: 0.75rem;
105
+ --control-icon: 1rem;
106
+
107
+ --motion-effects: 200ms;
108
+ --motion-spatial: 350ms;
109
+ /* Press feedback is the one motion on a frequent action: 100ms, 2%, felt more than seen. A
110
+ moment is the rare, earned one; slower, hard ease-out, no overshoot. */
111
+ --motion-press: 100ms;
112
+ --motion-moment: 500ms;
113
+
114
+ /* The page title's voice. A product with a display face sets these with it. */
115
+ --title-weight: 650;
116
+ --title-stretch: 100%;
117
+ --title-tracking: -0.01em;
118
+ }
119
+ .dark {
120
+ --surface-sunken: var(--neutral-1);
121
+ }
122
+ /* `default` exists so a region can step back to ordinary density inside a compact page. */
123
+ [data-density="default"] {
124
+ --control-h: 2.5rem;
125
+ --control-h-sm: 2rem;
126
+ }
127
+ [data-density="compact"] {
128
+ --control-h: 2rem;
129
+ --control-h-sm: 1.75rem;
130
+ }
131
+ /* After the density rules, so a coarse pointer always wins: every control stays a 44px target. */
132
+ @media (pointer: coarse) {
133
+ :root,
134
+ [data-density="default"],
135
+ [data-density="compact"] {
136
+ --control-h: 2.75rem;
137
+ --control-h-sm: 2.75rem;
138
+ }
139
+ }
140
+ }
141
+
142
+ /* Type steps as utilities, not --text-* keys: a compound of size, line height and weight that
143
+ cn() can tell apart from text colours. Operate scale, ratio about 1.2, fixed rem; nothing above
144
+ 28px except `type-display`, which is for Persuade surfaces only. */
145
+ /* `type-figure` also reads `--figure-font` and `--figure-stretch` (defaults: inherit, 100%), so a theme can set its big numbers in the
146
+ title voice (the default theme does) without every app that names a display face getting it. */
147
+ /* Each step reads its own variables and falls back to today's value, so a product with another scale (or a
148
+ region with a second look) sets `--type-body-size`, `--type-body-leading`, `--type-heading-weight`… on a
149
+ class and every component with that step follows (issue #210). Names: --type-<step>-size, -leading, -weight. */
150
+ @utility type-caption { font-size: var(--type-caption-size, 0.75rem); line-height: var(--type-caption-leading, 1rem); font-weight: var(--type-caption-weight, 400); }
151
+ @utility type-label { font-size: var(--type-label-size, 0.875rem); line-height: var(--type-label-leading, 1.25rem); font-weight: var(--type-label-weight, 500); }
152
+ @utility type-body-sm { font-size: var(--type-body-sm-size, 0.875rem); line-height: var(--type-body-sm-leading, 1.25rem); font-weight: var(--type-body-sm-weight, 400); }
153
+ @utility type-body { font-size: var(--type-body-size, 1rem); line-height: var(--type-body-leading, 1.5rem); font-weight: var(--type-body-weight, 400); }
154
+ @utility type-heading { font-size: var(--type-heading-size, 1.125rem); line-height: var(--type-heading-leading, 1.5rem); font-weight: var(--type-heading-weight, 600); }
155
+ @utility type-title {
156
+ font-family: var(--font-display);
157
+ font-size: var(--type-title-size, 1.75rem);
158
+ line-height: var(--type-title-leading, 2.25rem);
159
+ font-weight: var(--title-weight);
160
+ font-stretch: var(--title-stretch);
161
+ letter-spacing: var(--title-tracking);
162
+ }
163
+ @utility type-figure { font-size: var(--type-figure-size, 1.75rem); line-height: var(--type-figure-leading, 2.25rem); font-weight: var(--type-figure-weight, 500); font-variant-numeric: tabular-nums; font-family: var(--figure-font, inherit); font-stretch: var(--figure-stretch, 100%); }
164
+ @utility type-display {
165
+ font-family: var(--font-display);
166
+ font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem);
167
+ line-height: 1.05;
168
+ font-weight: var(--title-weight);
169
+ font-stretch: var(--title-stretch);
170
+ letter-spacing: -0.02em;
171
+ }
172
+
173
+ /* A picture drawn as type: the emoji or numeral on a `ChoiceGrid` tile, or the one a question shows above
174
+ it. Above the 28px ceiling because it is recognised, not read, by a child at arm's length; the leading
175
+ is loose because a colour emoji's glyph is taller than the face's em and would run into the word under it. */
176
+ @utility type-picture { font-size: var(--type-picture-size, clamp(2.5rem, 1.75rem + 4vw, 4.5rem)); line-height: var(--type-picture-leading, 1.25); }
177
+
178
+ /* State transitions: named properties only (never `transition: all`). `scale` is listed for the
179
+ press feedback and runs at the shorter press duration. */
180
+ @utility transition-state {
181
+ transition-property: color, background-color, border-color, opacity, box-shadow, scale;
182
+ transition-duration: var(--motion-effects), var(--motion-effects), var(--motion-effects), var(--motion-effects),
183
+ var(--motion-effects), var(--motion-press);
184
+ transition-timing-function: var(--ease-effects);
185
+ }
186
+
187
+ /* Press feedback: 2% is the most a control used tens of times a day can move without feeling slow. */
188
+ @utility press {
189
+ &:active:not(:disabled) { scale: 0.98; }
190
+ }
191
+
192
+ /* A moment's entrance: CSS only, runs once when the element mounts. Reduced motion collapses it. */
193
+ @utility enter-moment {
194
+ transition-property: opacity, translate;
195
+ transition-duration: var(--motion-moment);
196
+ transition-timing-function: var(--ease-moment);
197
+ @starting-style { opacity: 0; translate: 0 -0.75rem; }
198
+ }
199
+
200
+ /* Stacking, once, for every floating thing, so an app never writes a z-index. A bar (the undo
201
+ bar, toasts) sits above panes and sticky headers; overlays (dialogs, popovers, menus) above
202
+ bars; a tooltip above everything, since it can name a control inside an overlay. */
203
+ @utility layer-bar { z-index: 50; }
204
+ @utility layer-overlay { z-index: 60; }
205
+ @utility layer-tip { z-index: 70; }
206
+
207
+ /* The dim behind a dialog or full-screen view. Black at an alpha, not the foreground role: in a dark
208
+ theme `foreground` is light, so a foreground scrim brightened the page instead of dimming it
209
+ (strata-react issue #136). Not a theme role, so no app has anything to add; darker in the dark
210
+ scheme, where the same alpha would barely show. */
211
+ @utility scrim {
212
+ background-color: rgb(0 0 0 / 0.4);
213
+ :where(.dark) & { background-color: rgb(0 0 0 / 0.65); }
214
+ }
215
+
216
+ /* Words over a moving picture (a video's heading while it is paused): white on a shade that darkens
217
+ toward the edge, in either scheme, since the picture under it is neither light nor dark. Like
218
+ `scrim`, not a theme role (strata-react issue #329). */
219
+ @utility picture-shade {
220
+ background-image: linear-gradient(to bottom, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0));
221
+ color: rgb(255 255 255);
222
+ text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
223
+ }
224
+
225
+ /* An overlay's entrance: an ordinary effect (fade and 2% scale), CSS only, once on mount. Overlays
226
+ are occasional (character.md), so the effects duration and no overshoot; they close at once.
227
+ Reduced motion collapses it in the rule below. */
228
+ @utility enter-overlay {
229
+ transition-property: opacity, scale;
230
+ transition-duration: var(--motion-effects);
231
+ transition-timing-function: var(--ease-effects);
232
+ @starting-style { opacity: 0; scale: 0.98; }
233
+ }
234
+
235
+ @utility player-warning {
236
+ animation: strata-player-warning-in var(--motion-effects) var(--ease-effects) both;
237
+ &[data-leaving] { animation-name: strata-player-warning-out; }
238
+ }
239
+
240
+ @keyframes strata-player-warning-in {
241
+ from { opacity: 0; translate: 0 -0.75rem; }
242
+ to { opacity: 1; translate: 0 0; }
243
+ }
244
+
245
+ @keyframes strata-player-warning-out {
246
+ from { opacity: 1; translate: 0 0; }
247
+ to { opacity: 0; translate: 0 -0.75rem; }
248
+ }
249
+
250
+ @layer base {
251
+ html { color-scheme: light; }
252
+ .dark { color-scheme: dark; }
253
+ body {
254
+ background-color: var(--background);
255
+ color: var(--foreground);
256
+ font-family: var(--font-sans);
257
+ font-size: 1rem;
258
+ line-height: 1.5rem;
259
+ -webkit-font-smoothing: antialiased;
260
+ }
261
+ /* One focus treatment for everything focusable, so no component can forget it. */
262
+ :focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
263
+ /* Except where a script moved focus to a heading to announce a result (Done): the heading is not
264
+ a control, so a ring around it says "press me" to nobody. */
265
+ h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; }
266
+ ::selection { background-color: var(--primary-5); color: var(--foreground); }
267
+ a { text-underline-offset: 0.2em; }
268
+ }
269
+
270
+ @media (prefers-reduced-motion: reduce) {
271
+ *, *::before, *::after {
272
+ animation-duration: 0.01ms !important;
273
+ animation-iteration-count: 1 !important;
274
+ transition-duration: 0.01ms !important;
275
+ }
276
+ }
277
+
278
+ /* The built components, so their classes are generated. */
279
+ @source "./*.js";