@cognitap/radiant 0.0.6 → 0.0.8

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 (196) hide show
  1. package/CHANGELOG.md +82 -395
  2. package/README.md +41 -1014
  3. package/RELEASE_POLICY.md +3 -3
  4. package/dist/library/Accordion.d.ts +3 -0
  5. package/dist/library/Accordion.d.ts.map +1 -1
  6. package/dist/library/Accordion.js +1 -1
  7. package/dist/library/Accordion.js.map +1 -1
  8. package/dist/library/Button.d.ts +5 -0
  9. package/dist/library/Button.d.ts.map +1 -1
  10. package/dist/library/Button.js +8 -7
  11. package/dist/library/Button.js.map +1 -1
  12. package/dist/library/Card.d.ts +2 -0
  13. package/dist/library/Card.d.ts.map +1 -1
  14. package/dist/library/Card.js +1 -1
  15. package/dist/library/Card.js.map +1 -1
  16. package/dist/library/Checkbox.d.ts +5 -0
  17. package/dist/library/Checkbox.d.ts.map +1 -1
  18. package/dist/library/Checkbox.js +3 -2
  19. package/dist/library/Checkbox.js.map +1 -1
  20. package/dist/library/Collapsible.d.ts +4 -0
  21. package/dist/library/Collapsible.d.ts.map +1 -1
  22. package/dist/library/Collapsible.js +22 -4
  23. package/dist/library/Collapsible.js.map +1 -1
  24. package/dist/library/Dialog.d.ts +3 -0
  25. package/dist/library/Dialog.d.ts.map +1 -1
  26. package/dist/library/Dialog.js.map +1 -1
  27. package/dist/library/Field.d.ts +8 -0
  28. package/dist/library/Field.d.ts.map +1 -1
  29. package/dist/library/Field.js +2 -0
  30. package/dist/library/Field.js.map +1 -1
  31. package/dist/library/Input.d.ts +3 -0
  32. package/dist/library/Input.d.ts.map +1 -1
  33. package/dist/library/Input.js +1 -0
  34. package/dist/library/Input.js.map +1 -1
  35. package/dist/library/Link.d.ts +5 -0
  36. package/dist/library/Link.d.ts.map +1 -1
  37. package/dist/library/Link.js.map +1 -1
  38. package/dist/library/RadioGroup.d.ts +8 -0
  39. package/dist/library/RadioGroup.d.ts.map +1 -1
  40. package/dist/library/RadioGroup.js +4 -2
  41. package/dist/library/RadioGroup.js.map +1 -1
  42. package/dist/library/Select.d.ts +87 -0
  43. package/dist/library/Select.d.ts.map +1 -0
  44. package/dist/library/Select.js +454 -0
  45. package/dist/library/Select.js.map +1 -0
  46. package/dist/library/cn.d.ts.map +1 -1
  47. package/dist/library/cn.js +20 -3
  48. package/dist/library/cn.js.map +1 -1
  49. package/dist/library/examples/expressive.d.ts +4 -0
  50. package/dist/library/examples/expressive.d.ts.map +1 -0
  51. package/dist/library/{themes → examples}/expressive.js +4 -3
  52. package/dist/library/examples/expressive.js.map +1 -0
  53. package/dist/library/examples/glass.d.ts +4 -0
  54. package/dist/library/examples/glass.d.ts.map +1 -0
  55. package/dist/library/{themes → examples}/glass.js +9 -3
  56. package/dist/library/examples/glass.js.map +1 -0
  57. package/dist/library/examples/index.d.ts +13 -0
  58. package/dist/library/examples/index.d.ts.map +1 -0
  59. package/dist/library/examples/index.js +32 -0
  60. package/dist/library/examples/index.js.map +1 -0
  61. package/dist/library/examples/jelly.d.ts +4 -0
  62. package/dist/library/examples/jelly.d.ts.map +1 -0
  63. package/dist/library/{themes → examples}/jelly.js +4 -3
  64. package/dist/library/examples/jelly.js.map +1 -0
  65. package/dist/library/examples/preset-values.d.ts.map +1 -0
  66. package/dist/library/examples/preset-values.js.map +1 -0
  67. package/dist/library/examples/radiant.d.ts +4 -0
  68. package/dist/library/examples/radiant.d.ts.map +1 -0
  69. package/dist/library/{themes → examples}/radiant.js +4 -3
  70. package/dist/library/examples/radiant.js.map +1 -0
  71. package/dist/library/examples/sharp-3d.d.ts +4 -0
  72. package/dist/library/examples/sharp-3d.d.ts.map +1 -0
  73. package/dist/library/{themes → examples}/sharp-3d.js +4 -3
  74. package/dist/library/examples/sharp-3d.js.map +1 -0
  75. package/dist/library/examples/soft-squircle.d.ts +4 -0
  76. package/dist/library/examples/soft-squircle.d.ts.map +1 -0
  77. package/dist/library/{themes → examples}/soft-squircle.js +4 -3
  78. package/dist/library/examples/soft-squircle.js.map +1 -0
  79. package/dist/library/examples/ticket.d.ts +4 -0
  80. package/dist/library/examples/ticket.d.ts.map +1 -0
  81. package/dist/library/{themes → examples}/ticket.js +4 -3
  82. package/dist/library/examples/ticket.js.map +1 -0
  83. package/dist/library/index.d.ts +3 -1
  84. package/dist/library/index.d.ts.map +1 -1
  85. package/dist/library/index.js +2 -1
  86. package/dist/library/index.js.map +1 -1
  87. package/dist/library/internal/select.d.ts +37 -0
  88. package/dist/library/internal/select.d.ts.map +1 -0
  89. package/dist/library/internal/select.js +42 -0
  90. package/dist/library/internal/select.js.map +1 -0
  91. package/dist/library/motion/MotionLink.d.ts +1 -0
  92. package/dist/library/motion/MotionLink.d.ts.map +1 -1
  93. package/dist/library/motion/MotionLink.js +9 -10
  94. package/dist/library/motion/MotionLink.js.map +1 -1
  95. package/dist/library/motion/host.d.ts +7 -3
  96. package/dist/library/motion/host.d.ts.map +1 -1
  97. package/dist/library/motion/host.js +13 -5
  98. package/dist/library/motion/host.js.map +1 -1
  99. package/dist/library/motion/popup.d.ts +5 -0
  100. package/dist/library/motion/popup.d.ts.map +1 -0
  101. package/dist/library/motion/popup.js +60 -0
  102. package/dist/library/motion/popup.js.map +1 -0
  103. package/dist/library/motion/press.d.ts.map +1 -1
  104. package/dist/library/motion/press.js +41 -14
  105. package/dist/library/motion/press.js.map +1 -1
  106. package/dist/library/motion/pressPolicy.d.ts.map +1 -1
  107. package/dist/library/motion/pressPolicy.js +2 -2
  108. package/dist/library/motion/pressPolicy.js.map +1 -1
  109. package/dist/library/motion/react.d.ts.map +1 -1
  110. package/dist/library/motion/react.js +3 -1
  111. package/dist/library/motion/react.js.map +1 -1
  112. package/dist/library/motion/transitions.d.ts.map +1 -1
  113. package/dist/library/motion/transitions.js +48 -15
  114. package/dist/library/motion/transitions.js.map +1 -1
  115. package/dist/library/react/useControllableState.d.ts +1 -0
  116. package/dist/library/react/useControllableState.d.ts.map +1 -1
  117. package/dist/library/react/useControllableState.js +8 -1
  118. package/dist/library/react/useControllableState.js.map +1 -1
  119. package/dist/library/selectStyles.d.ts +4 -0
  120. package/dist/library/selectStyles.d.ts.map +1 -0
  121. package/dist/library/selectStyles.js +32 -0
  122. package/dist/library/selectStyles.js.map +1 -0
  123. package/dist/library/styles.css +1 -1
  124. package/dist/library/themes/components.d.ts +24 -0
  125. package/dist/library/themes/components.d.ts.map +1 -1
  126. package/dist/library/themes/components.js +24 -0
  127. package/dist/library/themes/components.js.map +1 -1
  128. package/dist/library/themes/index.d.ts +1 -11
  129. package/dist/library/themes/index.d.ts.map +1 -1
  130. package/dist/library/themes/index.js +1 -19
  131. package/dist/library/themes/index.js.map +1 -1
  132. package/docs/accessibility.md +76 -142
  133. package/docs/architecture.md +208 -0
  134. package/docs/motion.md +115 -396
  135. package/docs/theming.md +275 -882
  136. package/package.json +9 -5
  137. package/src/Accordion.tsx +4 -1
  138. package/src/Button.tsx +13 -7
  139. package/src/Card.tsx +3 -1
  140. package/src/Checkbox.tsx +7 -2
  141. package/src/Collapsible.tsx +28 -4
  142. package/src/Dialog.tsx +3 -0
  143. package/src/Field.tsx +8 -0
  144. package/src/Input.tsx +3 -0
  145. package/src/Link.tsx +5 -0
  146. package/src/RadioGroup.tsx +10 -2
  147. package/src/Select.tsx +781 -0
  148. package/src/cn.ts +20 -3
  149. package/src/{themes → examples}/expressive.ts +5 -3
  150. package/src/{themes → examples}/glass.ts +10 -3
  151. package/src/examples/index.ts +35 -0
  152. package/src/{themes → examples}/jelly.ts +5 -3
  153. package/src/{themes → examples}/radiant.ts +5 -3
  154. package/src/{themes → examples}/sharp-3d.ts +5 -3
  155. package/src/{themes → examples}/soft-squircle.ts +5 -3
  156. package/src/{themes → examples}/ticket.ts +5 -3
  157. package/src/index.ts +28 -13
  158. package/src/internal/select.ts +80 -0
  159. package/src/motion/MotionLink.tsx +16 -11
  160. package/src/motion/host.ts +16 -7
  161. package/src/motion/popup.ts +55 -0
  162. package/src/motion/press.ts +32 -12
  163. package/src/motion/pressPolicy.ts +4 -2
  164. package/src/motion/react.ts +3 -1
  165. package/src/motion/transitions.ts +45 -14
  166. package/src/react/useControllableState.ts +7 -1
  167. package/src/selectStyles.ts +34 -0
  168. package/src/themes/components.ts +24 -0
  169. package/src/themes/index.ts +1 -22
  170. package/dist/library/themes/expressive.d.ts +0 -2
  171. package/dist/library/themes/expressive.d.ts.map +0 -1
  172. package/dist/library/themes/expressive.js.map +0 -1
  173. package/dist/library/themes/glass.d.ts +0 -2
  174. package/dist/library/themes/glass.d.ts.map +0 -1
  175. package/dist/library/themes/glass.js.map +0 -1
  176. package/dist/library/themes/jelly.d.ts +0 -2
  177. package/dist/library/themes/jelly.d.ts.map +0 -1
  178. package/dist/library/themes/jelly.js.map +0 -1
  179. package/dist/library/themes/preset-values.d.ts.map +0 -1
  180. package/dist/library/themes/preset-values.js.map +0 -1
  181. package/dist/library/themes/radiant.d.ts +0 -2
  182. package/dist/library/themes/radiant.d.ts.map +0 -1
  183. package/dist/library/themes/radiant.js.map +0 -1
  184. package/dist/library/themes/sharp-3d.d.ts +0 -2
  185. package/dist/library/themes/sharp-3d.d.ts.map +0 -1
  186. package/dist/library/themes/sharp-3d.js.map +0 -1
  187. package/dist/library/themes/soft-squircle.d.ts +0 -2
  188. package/dist/library/themes/soft-squircle.d.ts.map +0 -1
  189. package/dist/library/themes/soft-squircle.js.map +0 -1
  190. package/dist/library/themes/ticket.d.ts +0 -2
  191. package/dist/library/themes/ticket.d.ts.map +0 -1
  192. package/dist/library/themes/ticket.js.map +0 -1
  193. package/docs/system.md +0 -264
  194. /package/dist/library/{themes → examples}/preset-values.d.ts +0 -0
  195. /package/dist/library/{themes → examples}/preset-values.js +0 -0
  196. /package/src/{themes → examples}/preset-values.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,417 +1,104 @@
1
1
  # Changelog
2
2
 
3
- See the [release policy](RELEASE_POLICY.md) for versioning and migration rules.
3
+ One line per user-visible change. See the [release policy](RELEASE_POLICY.md)
4
+ for versioning. Use the JavaScript and CSS from the same version.
4
5
 
5
6
  ## Unreleased
6
7
 
8
+ ## 0.0.8
9
+
10
+ - Add Select with item focus, Field/native forms, themes and springs; open at trigger width without drift or flashes.
11
+
12
+ ## 0.0.7
13
+
14
+ - Breaking: the example themes moved out of the core entry. Before, `import { jelly, themes } from '@cognitap/radiant'`. After, `import { jelly, themes } from '@cognitap/radiant/examples'`. `defaultTheme` stays in core, and `themeDefinitions` exposes each example's definition.
15
+
16
+ - Reconcile native disclosure changes made before hydration: local Collapsible state adopts once, while controlled disclosures and Accordion items restore their owner's value without a change request.
17
+
18
+ - Align Card root minimum-width styling with its compound parts in narrow layouts.
19
+
20
+ - Let Accordion roots shrink inside narrow grid and flex layouts, matching their Collapsible items.
21
+
22
+ - Keep disclosure resize observation and inert cleanup current, preserve the native pre-hydration fallback, and honor motion off for height and markers.
23
+
24
+ - Bound Dialog visual exits to two seconds and 500 descendants, and skip nested dialogs and customized built-in elements.
25
+
26
+ - Wrap long Radio labels within narrow layouts without shrinking the native indicator.
27
+
28
+ - Wrap long Checkbox labels within narrow layouts without shrinking the native indicator.
29
+
30
+ - Release MotionLink springs on lost pointer capture or removed destinations while preserving native anchor navigation.
31
+
32
+ - Keep Button presses tied to their active input, cancel unavailable motion cleanly, and honor theme motion off for CSS lift and shift.
33
+
7
34
  ## 0.0.6
8
35
 
9
- - Add serializable motion profiles and opt-in `motion` and `motion/react` entries
10
- powered by Motion springs. Root imports stay engine-free.
11
- - Add MotionProvider for native Button/Link press feedback, disclosure height
12
- and Dialog presentation. Native actions, dismissal and focus stay immediate.
13
- - Add bounded one-axis drag/release/snap with signed velocity, cancellation,
14
- re-grab and keyboard alternatives.
15
- - Add subscribed sources, React changing-target followers and measured grid/flex
16
- resize/reorder. Interrupted targets retain position and momentum.
17
- - Apply live reduced motion, theme off and lifecycle cleanup. Layout uses
18
- dedicated, unscaled slots/parts; nested animated groups and shared-element
19
- morphing are excluded. See [motion usage](docs/motion.md).
20
-
21
- Opt in explicitly and use matching package JavaScript/CSS. Legacy duration/easing
22
- CSS tokens remain available.
36
+ - Add opt-in spring motion in `@cognitap/radiant/motion` and `/motion/react`, with serializable motion profiles in themes. Root imports stay free of the engine.
37
+ - Add `MotionProvider` for spring press feedback on Button and Dialog actions, disclosure height and Dialog presentation. Dismissal and focus stay immediate.
38
+ - Add `MotionLink` for spring feedback on action-shaped links.
39
+ - Add one-axis drag with release, snapping, cancellation and keyboard alternatives.
40
+ - Add `useSpringFollow` for changing targets and `useSpringLayout` for grid and flex resize and reorder.
41
+ - Motion follows live reduced-motion settings, `motion="off"` and the theme's motion profile. See [motion](docs/motion.md).
23
42
 
24
43
  ## 0.0.5
25
44
 
26
- - Add responsive typography: Body/Headings/UI/Code assignments, 16 reusable
27
- styles, independent prose/UI rhythm, font-aware starting points, responsive
28
- local-container sizes, deliberate style overrides and weight warnings. Export
29
- the pure `@cognitap/radiant/typography` entry and compile the normalized
30
- `typography.typesetting` recipe through portable theme documents (DEV-163).
31
- - **Breaking layout adoption (DEV-167):** production component text consumes UI
32
- Body/Title/Label/Supporting roles. Inline/subtle links inherit surrounding
33
- text. UI leading is explicit and selection/disclosure labels use label weight;
34
- review wrapping/layouts. Control-size metrics and component/caller overrides
35
- retain precedence. Baseline role aliases preserve earlier theme and preset
36
- settings; see [component mapping and migration](docs/theming.md#component-roles-and-earlier-themes).
37
- - Preserve available font axis ranges as portable metadata in full/selective
38
- theme documents (DEV-168). `ThemeFontAxis` records tag/min/default/max; the
39
- parser rejects malformed, duplicate and unbounded ranges. Axes describe file
40
- capabilities; trial-only adjustments and local binary files are not exported.
41
- Metadata never loads a font or changes compiled paint.
42
-
43
- Experimental 0.x release. Use matching package JavaScript/CSS. Older parsers
44
- reject new recipe/axis keys. Applications own font files, licensing, loading and
45
- script/fallback verification. Automated installed Chromium evidence covers both
46
- CSS routes, modes/scopes, caller overrides, responsive roles and canonical forms;
47
- it is not manual browser/AT or broad font/script certification. The public
48
- workshop is promoted by the coordinated DEV-169 docs PR after registry integrity
49
- is verified.
45
+ - Add typography recipes (`typography.typesetting`): Body, Headings, UI and Code fonts, 16 text styles and separate prose and UI rhythms.
46
+ - Add the React-free `@cognitap/radiant/typography` entry with `generateTypography`.
47
+ - Add `data-rad-prose`, `data-rad-text` and `data-rad-type-container` HTML hooks.
48
+ - Add font axis ranges (`ThemeFontAxis`) to theme document font metadata.
49
+ - **Breaking:** component text now uses the UI typography roles. UI line heights are explicit, and checkbox, radio and disclosure labels use the label weight. Check wrapping in your layouts.
50
+
51
+ Old typography leaves still apply. To move a theme to roles:
52
+
53
+ | Before | After |
54
+ | ---------------------------------- | ----------------------------- |
55
+ | `family`, `bodySize`, `bodyWeight` | `roles['ui-body']` |
56
+ | `smallSize` | `roles['ui-supporting'].size` |
57
+ | `headingSize`, `headingWeight` | `roles['ui-title']` |
58
+ | `labelWeight` | `roles['ui-label'].weight` |
59
+
60
+ The old `family` and `letterSpacing` applied to all four roles, so set them on each role.
50
61
 
51
62
  ## 0.0.4
52
63
 
53
- - Expose independent Classic, Balanced and Expressive wall/brand-ramp presets,
54
- with Balanced defaults, separate vividness controls and materialised replay.
55
- Semantic action fills now choose the nearby readable brand shade at 4.5:1
56
- text and 3:1 surface boundaries; explicit semantic overrides stay authored.
57
-
58
- Experimental, additive workshop APIs for portable theme documents, deterministic
59
- color walls, semantic palettes and bounded appearance controls. Existing 0.0.3
60
- components and themes require no migration. See `docs/theming.md` for the
61
- document format, merge/replace rules, supported controls and installed CSS routes.
62
- Output is opaque sRGB; Display P3 generation and font loading are not included.
63
- Automated Chromium and installed-consumer checks do not establish manual
64
- screen-reader, Safari/Firefox or stable-library readiness. The public workshop
65
- is delivered independently by radiant-docs after it pins this registry release.
66
-
67
- - Add `updateThemeAppearance` for generated palette/canvas integration and bounded
68
- spacing, density, radius, border, elevation and backdrop controls (DEV-155).
69
- Preserve independent modes, unrelated settings and component exceptions;
70
- compile ordinary theme documents through the existing runtime and CSS routes.
71
- Add canonical workspace and installed-package appearance verification.
72
-
73
- - Add working-palette recommendations and semantic light/dark mapping (DEV-154).
74
- `recommendColorPalette` preserves the exact source and full wall, supports
75
- deliberate family/role overrides and reports unrounded contrast for named
76
- pairs, including explicit inactive-control exceptions. Return existing color
77
- and canvas token layers; inspect real component states using the canonical form.
78
-
79
- - Add the deterministic OKLCH color-wall generator (DEV-153), available through
80
- the package root and a React-free `@cognitap/radiant/color` entry. It emits 16
81
- hue families plus Brand and Neutral ramps, defaults to exact source anchoring
82
- with reshaped neighbors, exposes bounded calibration controls and returns
83
- immutable replayable inputs and theme-document-compatible color data. Add
84
- reference/extreme-case coverage and a Storybook wall inspection story.
85
-
86
- - Add versioned theme workshop documents (DEV-152): typed token sections,
87
- source/palette and portable font metadata, full/selective JSON exports,
88
- explicit merge/replace/reset updates and compilation through the existing
89
- `defineTheme`/`ThemeScope` contract. Exact brand anchoring is the default policy;
90
- palette generation and semantic role selection follow separately. Existing
91
- themes, component exceptions and scope behavior are preserved.
64
+ - Add `ThemeDocument`: a versioned, JSON-portable theme format with section merge, replace and reset.
65
+ - Add `generateColorWall` in `@cognitap/radiant/color`: 18 palettes from one brand color, with Classic, Balanced and Expressive presets.
66
+ - Add `recommendColorPalette`: a working palette, light and dark color roles, and contrast checks.
67
+ - Add `updateThemeAppearance`: apply a palette with spacing, density, radius, border, elevation and backdrop settings.
92
68
 
93
69
  ## 0.0.3
94
70
 
95
- Experimental release of the harmonised ten-family system. **Breaking changes**
96
- to component props, composition and theme interfaces are detailed below, with
97
- migration guidance in `docs/system.md` and `docs/theming.md`. Version 0.0.3 is
98
- explicitly selected for this experimental release. Automated installed-consumer
99
- checks cover native/TanStack flows; actual VoiceOver verification is deferred
100
- and is not claimed by this release.
101
-
102
- - Verify the canonical native/TanStack forms and ten-family Workspace composition
103
- through an installed production archive (DEV-57), including hydration, native
104
- keyboard/form/reset behavior and modal cleanup. Add an opt-in Cognitap
105
- production checkpoint that preserves its registry pins and distinguishes the
106
- historical Button-only package from unreleased archive evidence. Actual AT
107
- verification remains explicitly pending; these checks do not publish a release.
108
-
109
- - Verify installed styling artifacts through production builds (DEV-135):
110
- compiled CSS and Tailwind, with both reset choices, across all eight presets
111
- in light/dark. The required gate now retains versioned results and captures.
112
- - Preserve complete CSS layer order in both compiled exports so consumer
113
- bundling cannot put Preflight above component utilities. Action-shaped Links
114
- explicitly remove native underlining without depending on a global reset.
115
- - Let caller `hover:`/`active:` color utilities replace the shared action defaults,
116
- while explicit disabled/busy backgrounds preserve paint guards.
117
-
118
- - Audit the ten-family harmonisation coverage (DEV-134), adding focused rendered
119
- scope and reduced-motion/forced-colors browser checks. Record the required gate
120
- and explicit manual/browser/artifact gaps without expanding support claims.
121
-
122
- - Publish the browser/assistive-technology target matrix and evidence process
123
- (DEV-47), including manual scenarios, WCAG 2.2 A/AA mapping and explicit gaps.
124
- Browser runs now capture exact environment versions with their existing
125
- result artifacts. This does not declare untested browser/screen-reader support.
126
-
127
- - Add the concise Radiant system guide (DEV-133), shipped with the package and
128
- linked from introductory, theming, Storybook and agent documentation. It covers
129
- the current ten-family contract and points to canonical live recipes; the
130
- original harmonisation sketches remain labelled as historical design evidence.
131
-
132
- - **Breaking: remove superseded theme paths (DEV-132).** Remove all ten family
133
- `*Theme()` helpers and their corresponding type aliases, `radiantTheme`, and
134
- the resolved `Theme.style`/`Theme.surface` compatibility fields. Author shared
135
- themes with `defineTheme`, apply them with `ThemeScope`, and use
136
- `ThemeComponentOverrides` for reusable exceptions or `ThemeStyle` for local
137
- `--rad-*` styles. The old Radio gap shortcut moves to `components.radioGroup.gap`.
138
- - Remove unused unprefixed Tailwind color/radius aliases and ambient
139
- `--ease-spring`, `--ease-snap`, `--ease-settle` variables. Use prefixed roles
140
- directly and define literal motion curves or application-owned variables.
141
- See the [migration steps and cleanup inventory](docs/theming.md#migration-from-button-centred-themes).
142
- Preset mode values, native composition and shared action styling are preserved.
143
- Button/Link local styles now accept typed CSS custom properties directly.
144
-
145
- Earlier entries below record behavior at delivery time; DEV-132 supersedes their
146
- compatibility-export and ambient-token availability notes.
147
-
148
- - **Button-owned host replacement (DEV-119).** Button now accepts
149
- `render(resolvedNativeProps)` and exports ButtonRenderProps. DialogTrigger/Close
150
- inherit ButtonProps and compose Button in both default and replacement paths.
151
- Button owns resolved presentation and compatible-host validation.
152
- - **Breaking: Dialog action replacement contract (DEV-119).** `render` now
153
- receives Button's resolved native presentation, including merged classes,
154
- children/pending markup, native attributes/ref and protected Dialog semantics.
155
- Set presentation props on DialogTrigger/Close and forward to one native/custom
156
- button; replace render→Button adapters, which would style and wrap children
157
- twice. Null, text, arrays, fragments and direct non-button hosts are rejected.
158
- `DialogRenderProps` exposes required, typed resolved presentation attributes.
159
- - Both Dialog paths compose Button; guards run before the consumer once and
160
- then uncancelled Dialog requests. Pending busy state and computed presentation attributes are protected;
161
- composed actions retain both Button and Dialog part identities.
162
-
163
- - **Breaking: Link replacement contract (DEV-118).** `render` returns one
164
- compatible `ReactElement`; null, text, arrays, fragments and direct native
165
- hosts other than anchors are rejected. Return your router element directly
166
- and forward its resolved native props to one anchor. `LinkRenderProps` now
167
- exposes the real anchor ref and required, typed resolved presentation attributes.
168
- - Link protects its computed identity and presentation attributes from caller
169
- overrides. Native handlers/attributes/ref and merged presentation reach
170
- default and router anchors unchanged, including React callback-ref cleanup.
171
- - Real Chromium checks cover Link click/Enter/Space, form behaviour, consumer
172
- cancellation, router interception, modified/middle-click tabs, external
173
- targets and downloads in Light/Dark. Storybook's router example now performs
174
- visible navigation and verifies it under every theme/mode.
175
-
176
- - **Breaking: action presentation API (DEV-117).** Button and action-shaped
177
- Link use `variant="solid|soft|outline|ghost"`, `tone="accent|neutral|warning|danger"`
178
- and `controlSize="small|medium|large"`. Button defaults to solid/accent/medium;
179
- Link defaults to inline/accent/medium and also retains subtle decoration.
180
- Dialog actions inherit these props. `size`, `radius`, Link's `button` variant,
181
- and the old colour-named variants/tones are removed. Replace `ButtonSize` with
182
- `ControlSize`; remove `ButtonRadius` and use theme/local CSS. `ButtonVariant`
183
- and `LinkVariant` reflect the new vocabulary; `Tone` is a shared export.
184
- Selectors migrate from `data-size` to `data-control-size`, with `data-tone`
185
- recording palette independently. See the README's action migration table.
186
- - Soft actions support all four tones; unfilled action/text-link ink derives
187
- from the selected palette and scope foreground. Neutral soft/outline/ghost
188
- preserve the previous neutral palette. The private shared recipe retains
189
- theme shape, motion, focus and elevation for both native buttons and anchors.
190
- - Storybook controls and examples use the new API. Button's treatment/tone and
191
- size comparisons verify matching Link presentation across every theme/mode;
192
- inline/subtle links have a corresponding tone comparison.
193
-
194
- - Shared private React bindings now preserve composed callback-ref cleanup,
195
- deduplicate owned/external description IDs and apply one cancellable activation
196
- order. Disabled Accordion activation guards run before consumer handlers.
197
- - Dialog, Collapsible and Accordion share state ownership and no-op suppression.
198
- Composite defaults remain initial snapshots; prop synchronisation/restoration
199
- no longer emit semantic change requests. Ownership/type switches and supplying
200
- a controlled value together with its default now throw a descriptive error;
201
- remount with a new key for a new owner/type.
202
- - An open Dialog now responds to changes in `modal` and preserves cleanup when
203
- rendered in another document. Interactive/context modules retain individual
204
- client boundaries; the package entry and pure modules remain server-safe.
205
- - Storybook plays and axe now run as a required part of `pnpm check` and CI,
206
- across every preset in Light and Dark. Native Chromium scenarios cover modal
207
- keyboard/focus, cancellation, refs, StrictMode cleanup and hydration. CI saves
208
- JUnit results and failure screenshots; see the verification guide.
209
- - Field groups no longer emit unsupported `aria-required` on fieldsets. Native
210
- radio `required` behavior is preserved. Disabled Field help/error text remains
211
- readable while its controls and labels dim once.
212
- - Dialog ignores a queued native close notification when the same element has
213
- already reopened, preventing StrictMode effect cleanup from dismissing it.
214
- - Storybook paints the real Canvas page background once instead of using a
215
- pseudo-element, so accessibility checks resolve the same backdrop as viewers.
216
- - DialogTrigger and DialogClose now compose Button by default, inheriting its
217
- presentation options, theme effects, interaction states, and pending behavior.
218
- The separate Dialog action style recipe is removed. Action slots now include
219
- both identities (`button dialog-trigger` / `button dialog-close`); migrate
220
- equality selectors to `[data-slot~="dialog-trigger"]` / `[data-slot~="dialog-close"]`.
221
- DEV-119 subsequently migrates native render callbacks to resolved presentation.
222
- - Dialog's default Storybook play compares its actual rendered actions against
223
- Button. The theme comparison uses default Dialog composition rather than
224
- manually opting into Button, exposing future drift at the default call site.
225
- - A complete Storybook audit covers all 58 stories and 11 Docs pages across
226
- eight themes in light and dark. Form controls have clearer outlines, Checkbox
227
- keeps a box shape, and disabled checked/mixed marks remain visible, including
228
- forced colors. Nested disclosure arrows follow their own open state and focus
229
- rings follow the themed shape. Glass dialogs frost underlying content, and
230
- Sharp 3D links retain readable hover text. Responsive examples and Docs frames
231
- avoid clipping; Docs controls follow the selected palette and open dialogs no
232
- longer scroll the page on load. Demo actions and navigation show useful results.
233
- - Browser play checks guard disabled selection visibility/alignment and the
234
- custom native Field input. These complement the theme comparison and now run
235
- in the required browser matrix.
236
- - Ticket checkboxes use a compact solid outline instead of inheriting the
237
- scooped, dashed shape intended for larger controls and surfaces.
238
- - Button-styled links share Button hover and pressed feedback while retaining
239
- native anchor navigation. Disabled and pending buttons keep suppressing it.
240
- - Checkbox check and mixed marks stay aligned with the native control when
241
- an unlabelled checkbox is placed in a stretched grid or Field.
242
- - Storybook has global **Theme** and **Mode** controls, backed by the public
243
- preset registry and `ThemeScope`. Canvas and Docs share the selection.
244
- Ordinary stories inherit it; one system comparison replaces repeated family
245
- theme galleries. Stories use a shared default/state/composition/customisation
246
- structure and public imports.
247
- - **Breaking: shared theme system (DEV-44).** `defineTheme` now authors typed
248
- semantic tokens, optional component overrides, and light/dark layers.
249
- `ThemeScope` applies a theme and independent light/dark/system mode to a
250
- subtree. The stylesheet supplies a provider-free neutral baseline; nested
251
- named themes reset omitted tokens and effects. Components consume shared
252
- roles instead of Button's overrides, and Button focus overrides are local.
253
- - All eight presets have stable IDs and deliberate light/dark palettes. The
254
- `themes` registry is readonly; individual presets are exported. Font loading
255
- remains the application's responsibility, with system fallbacks supplied.
256
- - Storybook theme frames use `ThemeScope`, keeping canvases, ghost text and
257
- shadows in the same mode. Sharp 3D retains its explicit hard borders. The
258
- Button comparison story checks its rendered canvases, palettes and shadows.
259
- - **Migration:** replace `{ name, style }` themes with `defineTheme` and
260
- `theme.style` wrappers with `ThemeScope`. `Theme.style`, `Theme.surface`, and
261
- `radiantTheme` remain deprecated compatibility exports. Family theme helpers
262
- remain available but emit `--rad-<family>-*` variables; direct old CSS
263
- overrides must migrate. Shared primary/secondary/destructive roles become
264
- accent/neutral/danger. `radio.gap` moves to `radioGroup.gap`; inert
265
- `glowHover` is rejected by the new theme API. See the
266
- [theming guide](docs/theming.md) for defaults and the complete migration.
267
-
268
- Earlier batch entries below record behavior at delivery time; the theme
269
- migration above supersedes their token names and baseline measurements.
270
-
271
- - `Card` is a grouped surface. It is a `<div>`, not a button, link, or region.
272
- The title is a level-2 heading unless `level` says otherwise. Actions inside
273
- the card stay real controls. In Storybook on Chrome 155, the accessibility
274
- tree exposed the title as a level-2 heading, the description as a paragraph,
275
- and the footer actions as a button and a link. The card itself had no role.
276
- The first Tab landed on Track, and the next Tab landed on the Details link.
277
- Tab on a card with no actions moved to the document body. A consumer
278
- section labelled by the title was exposed as a region. The Radiant surface
279
- was 384px wide in a 24rem frame, with an 8px radius, an 18px title at
280
- weight 550, and a shadow of 0 1px 2px at 6% black. The Ticket surface used
281
- the scooped corner. The card does not set a transition. Screen reader
282
- checks were not run.
283
- - `Accordion` groups `Collapsible` sections. `single` keeps one section open,
284
- and `multiple` toggles each section on its own. The trigger is the summary,
285
- and its label is a level-3 heading unless `level` says otherwise. A disabled
286
- summary stays out of the tab order and does not toggle. In Storybook on
287
- Chrome 155, the accessibility tree exposed each trigger label as a level-3
288
- heading. Space and Enter toggled the focused summary and left focus there.
289
- Tab from a closed summary moved to the next summary. Tab from an open
290
- summary reached a button in the content. ArrowDown left focus on the summary.
291
- Opening one section in single mode closed the other. In multiple mode, Enter
292
- opened a second section and left the first open. Clicking another summary
293
- while focus was on a button inside the open section closed the first, opened
294
- the second, and left focus on that summary. Tab skipped a disabled summary.
295
- Space, Enter, and a click did not open it. Enter on a nested summary left
296
- the parent section open. A controlled accordion followed `onValueChange`.
297
- Submitting a form while the section was closed included the hidden field.
298
- Reduced motion set `transition-property` to `none` on the panel and marker.
299
- The Radiant surface was 384px wide in a 24rem frame, with an 8px radius.
300
- The summary focus ring was a 2px solid outline, offset 2px. The Ticket
301
- surface used the scooped corner. Screen reader checks were not run.
302
- - `Collapsible` is a native `<details>` element. The summary toggles it, and
303
- `open` is the browser's open state. Uncontrolled disclosures use
304
- `defaultOpen`. Controlled disclosures use `open` and `onOpenChange`; if
305
- `open` stays unchanged, the disclosure restores that value. A shared `name`
306
- is the native exclusive group. Closed content stays mounted, so a field
307
- inside it still submits with an ancestor form. The panel height and marker
308
- animate for 200ms, and `prefers-reduced-motion` sets `transition-property`
309
- to `none`. In Storybook on Chrome 155, Space and Enter toggled the summary
310
- and left focus there. Tab reached a button in the content only while open;
311
- while closed, Tab moved to the document body. Clicking the summary while
312
- focus was inside the content closed the disclosure and moved focus to the
313
- summary. Enter on a second disclosure with the same `name` opened it and
314
- closed the first. Enter on a nested summary left the parent open. A
315
- controlled disclosure followed `onOpenChange`. Submitting a form while the
316
- disclosure was closed included the hidden field. The Radiant surface was
317
- 384px wide in a 24rem frame, with an 8px radius. The Ticket surface used the
318
- scooped corner. The summary focus ring was a 2px solid outline, offset 2px.
319
- Screen reader checks were not run.
320
- - `Dialog` is a native `<dialog>`. `showModal()` supplies the modal layer, so
321
- the component does not add a portal, a focus trap, or a body scroll lock.
322
- Uncontrolled dialogs use `defaultOpen`. Controlled dialogs use `open` and
323
- `onOpenChange`; if `open` stays true after the browser closes, the dialog
324
- opens again. `closeOnBackdrop` and `closeOnEscape` default to true. A form
325
- with `method="dialog"` closes it. The panel stays in its document, so an
326
- ancestor form still owns its fields. `dialogTheme` maps typed settings to
327
- `--dialog-*` variables, and the panel inherits the button radius and corner
328
- shape. In Storybook on Chrome 155, the first focusable control was focused,
329
- and an `autoFocus` field took focus instead. Shift+Tab wrapped from the first
330
- control to the last. Tab from the last control focused the document body, and
331
- the next Tab returned to the first control without focusing the trigger.
332
- Escape closed the top dialog and restored the opener, including a nested
333
- dialog and a dialog opened without a trigger. A backdrop click closed and
334
- restored the trigger. Turning backdrop or Escape dismissal off left the
335
- dialog open. Submitting `method="dialog"` closed it. A field inside the
336
- dialog submitted with its ancestor form. A wheel and `scrollTo` still moved
337
- the page behind the open dialog. The Radiant panel was 512px wide with an
338
- 8px radius, and the Ticket panel used the scooped corner. Screen reader
339
- checks were not run.
340
- - `RadioGroup` is a fieldset of native radios. Uncontrolled groups use
341
- `defaultValue` and `form.reset()`. Controlled groups use `value` and
342
- `onValueChange` or `onChange`. Each `Radio` keeps its own label. A disabled
343
- choice stays in the group and is not selected. `radioTheme` maps typed
344
- settings to `--radio-*` variables. The disk stays a circle instead of
345
- inheriting the button corner shape. Arrow keys, focus entry, and focus exit
346
- were checked in Storybook: Tab entered on the selected radio, ArrowDown and
347
- ArrowUp skipped a disabled choice, and Tab left the group. Screen reader
348
- checks were not run.
349
- - `Checkbox` is a native checkbox. Uncontrolled boxes use `defaultChecked` and
350
- `form.reset()`. Controlled boxes use `checked` and `onChange`. `indeterminate`
351
- is a visual mixed state on the DOM property, not a submitted value. A `label`
352
- wraps the input so the text toggles it, and a single-control Field supplies
353
- the accessible name. `checkboxTheme` maps typed settings to `--checkbox-*`
354
- variables. Space activation was checked in Storybook. Screen reader checks
355
- were not run.
356
- - `Input` is a native text field. Uncontrolled inputs use `defaultValue` and
357
- `form.reset()`. Controlled inputs use `value` and `onChange`; `onBlur` stays
358
- the native event. Inside Field it takes the label, description, and error
359
- relationships. `inputTheme` maps typed settings to `--input-*` variables, which
360
- fall back to the button metrics. The native `size` attribute stays the
361
- character width. A plain form and a TanStack Form 1.33.5 reference (value,
362
- change, blur, reset) were verified. TanStack Form is not a package dependency.
363
- Keyboard, focus, and screen reader checks were not run.
364
- - `Field` is the form anatomy for one control or a group. A host control receives
365
- its label, description, and error relationships; component controls read them
366
- with `useField()`. The consumer owns the error message. `fieldTheme` maps typed
367
- settings to `--field-*` variables. Keyboard, focus, and screen reader checks
368
- were not run. A native form submit was verified.
369
- - `Link` joins the library: a native anchor for navigation with `inline`,
370
- `subtle`, and `button` variants (the button form reuses Button's variants via
371
- `tone`, `size`, and `radius`). `external` adds a safe target and rel when the
372
- consumer has not set them. A `render` prop hands the anchor props to a router
373
- adapter, keeping routers outside the core. `linkTheme` maps typed settings to
374
- `--link-*` variables, and links share the button focus variables and the shared
375
- themes. Keyboard, focus, and screen reader checks were not run for Link either.
376
- - Themes moved to a shared `themes` export (with a `Theme` type), so future
377
- components wear the same design systems. Button stories consume the registry.
378
- - Button ships with a neutral baseline (sizes, type, an ink-and-gray palette,
379
- focus ring, quiet press). Every value is a CSS variable, and Storybook shows
380
- the baseline next to fully themed variants, including the pine Radiant theme.
381
- - Button's shape, size, type, elevation, state colors, and motion are CSS
382
- variables. Press and release take separate durations and easings, and the
383
- radius and `corner-shape` can change on press. `buttonTheme` maps typed settings
384
- to those variables. Button sets `data-slot`, `data-variant`, and `data-size`.
385
- - `--ease-spring`, `--ease-snap`, and `--ease-settle` are new easing tokens.
386
- - Migration: `--color-primary-hover` and `--color-primary-active` are removed.
387
- Hover and press colors are derived from `--color-primary`. Tune them with
388
- `--button-hover-layer` and `--button-press-layer`. `--color-disabled` and
389
- `--color-disabled-foreground` are removed. A disabled button fades to
390
- `--button-disabled-opacity` when a theme sets it.
391
- - Button adds `variant` (primary, secondary, warning, destructive, outline,
392
- ghost), `size` (small, default, large), `radius` (none, small, default, large,
393
- full), `iconOnly`, and `fullWidth`. New color tokens back each variant.
394
- - `buttonTheme` adds `fontFamily`, `textTransform`, and `borderStyle`. Each DesignSystems theme
395
- now sets a matching Google Font, loaded in Storybook. The
396
- DesignSystems story replaces Midnight and Clay with Jelly (squircle pills,
397
- deep squishy press, spring release) and Ticket (scooped corners, dashed border).
398
- - `buttonTheme` adds `borderWidth`, `borderColor`, `pressShiftX`,
399
- `ghostShadow`, and `ghostShadowPressed`. The
400
- DesignSystems story adds a Sharp 3D theme with square corners, 2px borders,
401
- and hard offset shadows.
402
- - `class-variance-authority` 0.7.1 is a new runtime dependency.
403
- - `pending` keeps the label's space, shows a spinner, and ignores activation.
404
- It does not set `disabled`, so focus can stay on the button.
405
- - Keyboard, focus, and screen reader checks were not run in this change.
406
- Storybook has no interaction runner yet, and Button is not marked ready.
71
+ - Add Link, Field, Input, Checkbox, RadioGroup, Radio, Dialog, Collapsible, Accordion and Card, each built on the native element.
72
+ - Add `defineTheme` and `ThemeScope`: typed shared tokens, per-component overrides, and light, dark and system modes.
73
+ - Add eight presets in the readonly `themes` registry, each also a named export.
74
+ - Add Button `variant`, `tone`, `controlSize`, `pending`, `iconOnly`, `fullWidth` and `render`.
75
+ - Add `ThemeStyle` for typed `--rad-*` variables in `style`.
76
+ - `data-slot` holds a set of identities. Select with `~=`, as in `[data-slot~="button"]`.
77
+ - Passing a controlled value together with its default, or switching owner during a mount, throws.
78
+ - **Breaking:** CSS variables gain the `--rad-` prefix and semantic names.
79
+
80
+ ```css
81
+ /* Before */
82
+ --color-primary: #166534;
83
+ /* After */
84
+ --rad-color-accent: #166534;
85
+ ```
86
+
87
+ | Before | After |
88
+ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
89
+ | `--color-background` | `--rad-color-surface`; the page canvas is `--rad-surface-canvas` |
90
+ | `--color-foreground`, `--color-border`, `--color-focus` | `--rad-color-foreground`, `--rad-color-border`, `--rad-color-focus` |
91
+ | `--color-primary`, `--color-primary-foreground` | `--rad-color-accent`, `--rad-color-accent-foreground` |
92
+ | `--color-primary-hover`, `--color-primary-active` | Removed; hover and press colors derive from the accent |
93
+ | `--color-disabled`, `--color-disabled-foreground` | Removed; disabled controls use `--rad-color-disabled-*` and `--rad-state-disabled-opacity` |
94
+ | `--radius-control` | `--rad-control-radius` |
95
+
96
+ - **Breaking:** the Tailwind route no longer registers unprefixed aliases. Replace `bg-primary` with `bg-(--rad-color-accent)` and `rounded-control` with `rounded-(--rad-control-radius)`.
407
97
 
408
98
  ## 0.0.2
409
99
 
410
- - Documentation and maintainer tooling cleanup. The Button API, styles and
411
- dependency requirements are unchanged; no migration is needed.
412
- - Still experimental, with a single native Button. Automated package checks do
413
- not replace manual keyboard, focus and screen reader verification.
100
+ - Documentation and tooling cleanup. No API change.
414
101
 
415
102
  ## 0.0.1
416
103
 
417
- - Public package identity for the first, `0.0.1` release. Do not expect granular updates until package is mature enough to be used by third parties.
104
+ - First public release.