actual-css 0.7.0 → 0.9.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 (144) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/README.md +13 -11
  3. package/components.json +668 -0
  4. package/dist/actual.css +166 -37
  5. package/dist/actual.full.css +1087 -643
  6. package/dist/actual.full.js +1 -1
  7. package/dist/actual.full.min.css +1 -1
  8. package/dist/actual.js +1 -1
  9. package/dist/actual.min.css +1 -1
  10. package/docs/design-notes/accessibility-decisions.md +33 -0
  11. package/docs/design-notes/browser-support.md +62 -30
  12. package/docs/design-notes/column-layout.md +3 -3
  13. package/docs/design-notes/css-anchor.md +75 -21
  14. package/docs/design-notes/enhancement-contract.md +14 -6
  15. package/docs/design-notes/grid.md +4 -4
  16. package/docs/design-notes/naming.md +6 -1
  17. package/docs/design-notes/platform-alignment.md +53 -7
  18. package/docs/design-notes/popover-manual-poc.md +105 -25
  19. package/docs/design-notes/surface-reparenting.md +56 -47
  20. package/docs/design-notes/tooltip-coordinate-space.md +132 -0
  21. package/docs/design-notes/widget-primitives.md +7 -4
  22. package/docs/pages/components/accordion.md +41 -2
  23. package/docs/pages/components/alert.md +85 -30
  24. package/docs/pages/components/app-navigation.md +6 -0
  25. package/docs/pages/components/avatar.md +6 -6
  26. package/docs/pages/components/badge.md +101 -16
  27. package/docs/pages/components/button.md +16 -8
  28. package/docs/pages/components/card.md +10 -10
  29. package/docs/pages/components/dialog.md +21 -6
  30. package/docs/pages/components/drawer.md +13 -0
  31. package/docs/pages/components/fab.md +4 -3
  32. package/docs/pages/components/list.md +42 -4
  33. package/docs/pages/components/navbar.md +17 -1
  34. package/docs/pages/components/pagination.md +2 -2
  35. package/docs/pages/components/skeleton.md +3 -1
  36. package/docs/pages/components/steps.md +19 -0
  37. package/docs/pages/components/table.md +3 -2
  38. package/docs/pages/enhancements/flyout.md +82 -38
  39. package/docs/pages/enhancements/overview.md +25 -0
  40. package/docs/pages/enhancements/status-bar.md +1 -1
  41. package/docs/pages/enhancements/tabs.md +45 -37
  42. package/docs/pages/enhancements/tooltip.md +36 -10
  43. package/docs/pages/examples/overview.md +38 -5
  44. package/docs/pages/forms/choice-cards.md +11 -6
  45. package/docs/pages/forms/combobox.md +1 -1
  46. package/docs/pages/forms/floating-field.md +4 -3
  47. package/docs/pages/forms/joined-controls.md +22 -0
  48. package/docs/pages/forms/otp.md +2 -1
  49. package/docs/pages/forms/overview.md +1 -1
  50. package/docs/pages/forms/states-and-sizes.md +16 -18
  51. package/docs/pages/forms/sticky-actions.md +2 -2
  52. package/docs/pages/forms/switch.md +1 -1
  53. package/docs/pages/foundations/philosophy.md +57 -26
  54. package/docs/pages/foundations/theming.md +2 -2
  55. package/docs/pages/foundations/tokens.md +118 -21
  56. package/docs/pages/foundations/typography.md +35 -14
  57. package/docs/pages/guides/introduction.md +11 -9
  58. package/docs/pages/guides/progressive-enhancement.md +115 -30
  59. package/docs/pages/guides/tailwind.md +3 -2
  60. package/docs/pages/layout/media.md +1 -1
  61. package/docs/pages/layout/overview.md +11 -1
  62. package/docs/pages/layout/scroll-snap.md +3 -3
  63. package/docs/pages/layout/stack.md +17 -9
  64. package/docs/pages/patterns/icon-input.md +4 -2
  65. package/docs/pages/patterns/icon-slot.md +2 -0
  66. package/docs/pages/patterns/intent-nesting.md +1 -1
  67. package/docs/pages/utilities/overview.md +23 -2
  68. package/docs/pages/utilities/sizing-wrapping.md +1 -1
  69. package/docs/pages/utilities/spacing.md +10 -8
  70. package/llms.txt +2 -1
  71. package/package.json +159 -149
  72. package/{scripts/reserved-classes.json → reserved-classes.json} +4 -6
  73. package/src/css/components/accordion.css +42 -3
  74. package/src/css/components/alert.css +25 -13
  75. package/src/css/components/app-nav.css +18 -8
  76. package/src/css/components/avatar.css +13 -1
  77. package/src/css/components/badge.css +78 -12
  78. package/src/css/components/breadcrumb.css +2 -3
  79. package/src/css/components/button.css +9 -16
  80. package/src/css/components/card.css +9 -2
  81. package/src/css/components/chat.css +1 -0
  82. package/src/css/components/data-list.css +1 -1
  83. package/src/css/components/drawer.css +101 -32
  84. package/src/css/components/fab.css +0 -6
  85. package/src/css/components/flyout.css +35 -98
  86. package/src/css/components/index.css +0 -1
  87. package/src/css/components/indicator.css +21 -0
  88. package/src/css/components/key.css +10 -0
  89. package/src/css/components/list.css +40 -4
  90. package/src/css/components/menu.css +2 -1
  91. package/src/css/components/modal.css +48 -33
  92. package/src/css/components/navbar.css +37 -4
  93. package/src/css/components/pagination.css +1 -0
  94. package/src/css/components/skeleton.css +15 -4
  95. package/src/css/components/spinner.css +6 -6
  96. package/src/css/components/status-bar.css +0 -5
  97. package/src/css/components/steps.css +45 -59
  98. package/src/css/components/tab.css +29 -9
  99. package/src/css/components/table.css +13 -5
  100. package/src/css/components/tooltip.css +36 -40
  101. package/src/css/core/base.css +23 -1
  102. package/src/css/core/intents.css +17 -6
  103. package/src/css/core/theme.css +27 -0
  104. package/src/css/core/tokens.css +35 -15
  105. package/src/css/core/variants.css +64 -15
  106. package/src/css/forms/choice-card.css +4 -4
  107. package/src/css/forms/choice.css +76 -29
  108. package/src/css/forms/control.css +2 -1
  109. package/src/css/forms/floating-field.css +3 -3
  110. package/src/css/forms/form.css +4 -3
  111. package/src/css/forms/input-icon.css +20 -14
  112. package/src/css/forms/native.css +6 -1
  113. package/src/css/forms/otp.css +9 -1
  114. package/src/css/forms/range.css +2 -0
  115. package/src/css/forms/select.css +29 -9
  116. package/src/css/forms/switch.css +28 -8
  117. package/src/css/layout/app-layout.css +1 -1
  118. package/src/css/layout/grid.css +50 -76
  119. package/src/css/layout/scroll-snap.css +11 -7
  120. package/src/css/layout/scroller.css +3 -4
  121. package/src/css/layout/stack.css +2 -2
  122. package/src/css/typography/fluid.css +4 -3
  123. package/src/css/typography/prose.css +6 -5
  124. package/src/css/utilities/base.css +2 -1
  125. package/src/css/utilities/extra.css +20 -17
  126. package/src/js/context-menu.js +27 -26
  127. package/src/js/dialog.js +2 -1
  128. package/src/js/dismiss.js +5 -0
  129. package/src/js/enhance.js +34 -2
  130. package/src/js/enhancement-loader.js +36 -43
  131. package/src/js/events.js +0 -3
  132. package/src/js/filter.js +0 -1
  133. package/src/js/floating-space.js +42 -0
  134. package/src/js/flyout.js +9 -44
  135. package/src/js/focus-group.js +7 -0
  136. package/src/js/focus.js +6 -0
  137. package/src/js/menu.js +10 -1
  138. package/src/js/selectors.js +5 -9
  139. package/src/js/status.js +6 -5
  140. package/src/js/surface.js +97 -139
  141. package/src/js/tab.js +6 -1
  142. package/src/js/tooltip.js +150 -51
  143. package/src/js/validation.js +1 -1
  144. package/src/css/components/surface.css +0 -49
package/CHANGELOG.md CHANGED
@@ -3,6 +3,223 @@
3
3
  ## [Unreleased]
4
4
 
5
5
 
6
+ ## [0.9.0] - 2026-09-13
7
+
8
+ ### Breaking changes
9
+
10
+ - `--choice-control-offset` is renamed `--choice-control-nudge` and adds to the
11
+ derived first-line offset instead of replacing it — an old value is a whole
12
+ offset and will sit that far too low.
13
+ - `--skeleton-width` is a maximum inline size, not a width: a placeholder fills
14
+ its container and stops there, so it no longer gives every shrink-to-fit
15
+ ancestor a min-content floor. A placeholder in a container sized by its own
16
+ content now collapses instead of forcing that container open.
17
+
18
+ ### Fixed
19
+
20
+ - `.choice` aligns its control on the first line's cap height with the `cap`
21
+ unit, so a checkbox, radio or switch is level with the label text in any
22
+ font — the previous constant was tuned for Segoe UI and sat ~2px low on
23
+ Roboto.
24
+ - `.switch` lays its knob out of flow, so the track's baseline is its own
25
+ border box.
26
+ - `dialog.drawer` is `--viewport-block` tall again, so a mobile browser's
27
+ collapsing URL bar no longer pushes its footer below the fold.
28
+ - `dialog.drawer` scrolls its body region, so the footer stays reachable
29
+ whatever the content length; the rule replaces the `nav`-only one.
30
+ - `.table-wrap` is `position: relative`, so an `.sr-only` header inside a wide
31
+ table no longer escapes the scroller and gives the page a phantom horizontal
32
+ scrollbar on small viewports.
33
+
34
+ ### Documentation and tooling
35
+
36
+ - `tests/browser/mobile-overflow.test.js` asserts that no component scrolls the
37
+ page sideways at 320px and 360px, and that wide content scrolls inside its
38
+ own container.
39
+ - `bun run report:overflow` surveys demo and site pages at phone width and
40
+ bisects each failure down to the element that owns it.
41
+ - `tests/browser/mega-menu.test.js` exercises three wide sibling nav panels —
42
+ takeover, toggle, focus handover, keyboard open, Escape, clamping at both
43
+ viewport edges, and no drawer mutation on a phone.
44
+ - The flyout hooks are documented as a preferred width and a width cap, with
45
+ the cap's `20rem` default stated: a wide panel sets both, like `width` and
46
+ `max-width`.
47
+ - The drawer and scrollable-modal pages state that a scrolling body region is
48
+ keyboard-focusable, takes a focus ring, and can claim a dialog's initial
49
+ focus — put the close control in the `header`, or use `autofocus`.
50
+ - The kitchen-sink, blocks, blog, combobox and select-intents templates no
51
+ longer scroll sideways at phone widths.
52
+ - The alert trailing-action recipe and the dashboard template add `.items-center`:
53
+ a trailing control makes the row taller than a line of text, which left the
54
+ start-aligned `.alert-icon` above the message.
55
+
56
+ ## [0.8.0] - 2026-09-10
57
+
58
+ Actual CSS 0.8 focuses on a cleaner component contract, more predictable sizing
59
+ and density, simpler surface behavior, stronger progressive enhancement, and a
60
+ more polished JavaScript runtime.
61
+
62
+ ### Breaking changes
63
+
64
+ - The JavaScript browser floor is now Safari 17+, Firefox 125+, and Chromium
65
+ 116+. Older browsers still receive the CSS degradation covered by the
66
+ Degraded tier, but no longer receive the supported JavaScript runtime.
67
+ - The Intermediate browser tier is removed; Minimal now covers the supported
68
+ JavaScript baseline.
69
+ - `.gap-sm`, `.gap-md`, and `.gap-lg` are removed. They changed the `gap`
70
+ property without updating Actual's inherited `--gap` rhythm, which could also
71
+ diverge from `.grid-N` track sizing. Use `gap: var(--space-*)` for a local
72
+ one-off gap, and `--gap` only when intentionally rebinding the rhythm inherited
73
+ by nested layout primitives.
74
+ - `.alert.callout` is now purely a leading-flag treatment. It no longer forces a
75
+ neutral surface, so intents and surface variants compose with it normally.
76
+ - `--font-weight` is renamed to `--font-weight-normal`,
77
+ `--font-weight-strong` to `--font-weight-semibold`, and
78
+ `.font-weight-strong` to `.font-weight-semibold`. Semibold is now 600.
79
+ - Badge sizing is independent from density. `--density-compact-size` is removed;
80
+ use the badge size hooks and `.sm` / `.lg` instead.
81
+ - Flyouts and context menus no longer turn into mobile sheets. They remain
82
+ anchored non-modal popovers at every viewport size.
83
+ `data-flyout-mobile`, `data-flyout-breakpoint`, the responsive sheet
84
+ presentation, and its generated backdrop are removed.
85
+ - `disconnectSurface(menu, { restore })` no longer accepts options; surface
86
+ reparenting is gone.
87
+ - `EVENTS.reposition`, `EVENTS.hide`, and `EVENTS.outOfView` are removed from
88
+ `actual-css/js/events`. No runtime path dispatched them.
89
+
90
+ ### Added
91
+
92
+ - `applyEnhancement(name, selector, root?)` lets applications apply
93
+ `data-enhance` behavior tokens programmatically while preserving existing
94
+ tokens and refreshing registered behaviors.
95
+ - Accordion now supports `.flush` and `.separated` container treatments.
96
+ - `.list` rows can freely combine leading, content, and trailing regions.
97
+ - `--hr-space` customizes an `hr`'s block spacing when used in normal document
98
+ flow.
99
+ - Global `pre` elements now use `overflow-x: auto`, preventing long
100
+ unbreakable lines from widening the page.
101
+ - Badge status dots use `currentColor`, so they compose naturally with badge
102
+ intent and text color.
103
+ - New demos and references:
104
+ - visual guide for spacing, layout primitives, density, and size;
105
+ - color guide for theme islands, intent colors, gradients, and interaction
106
+ colors;
107
+ - popover transport, adaptive filter surface, and settings modal examples;
108
+ - expanded kitchen sink coverage for steps, aura, inverted contexts, density,
109
+ and nested intents.
110
+ - New tooling:
111
+ - `bun run serve` for opening demos from another device;
112
+ - `report:dead-css` for unused demo CSS;
113
+ - `report:neutral-ramp` for preset neutral-ramp analysis;
114
+ - `report:theme-contrast` for soft-state contrast reporting.
115
+
116
+ ### Changed
117
+
118
+ - Updated `@lekoala/floating` to 0.2.0.
119
+ - `.sm` and `.lg` now scale participating component families locally.
120
+ `.compact` and `.spacious` remain inherited density contexts.
121
+ - Text controls now use the shared `--control-pad-x` geometry. Horizontal
122
+ padding scales with the control size, and select/input-icon geometry follows
123
+ the same control frame.
124
+ - Badge size now scales its label, icons, dots, and geometry proportionally.
125
+ Badge inline padding is derived from `--badge-size`, and badges no longer
126
+ shrink inside flex layouts.
127
+ - Badge and button typography now both use the medium font weight.
128
+ - Accordion summaries use the medium font weight and keep hover feedback in the
129
+ current text color instead of switching to the primary color.
130
+ - `.soft` interactions now use one consistent fill change. Soft foreground
131
+ colors resolve per intent through `--intent-soft-fg`, with theme hooks tuned
132
+ for readable hovered states.
133
+ - Surface behavior is simpler:
134
+ - interactive surfaces use `popover="manual"` instead of DOM reparenting;
135
+ - `.is-open` is the only state written by `surface.js`;
136
+ - `prepareSurface()` removes `[hidden]` and normalizes the popover transport;
137
+ - Actual surfaces remain mutually exclusive per document; nested surfaces are
138
+ unsupported.
139
+ - Tooltips now choose their coordinate space based on their trigger:
140
+ scrolling page content uses absolute/document coordinates, while fixed,
141
+ sticky, popover, and modal contexts stay viewport-relative.
142
+ - Tooltips that temporarily leave their positioning boundary are hidden and
143
+ restored rather than torn down.
144
+ - Modal dialogs use the small viewport height (`svh`) for their block-size cap,
145
+ avoiding panel reflow while mobile browser chrome expands or collapses.
146
+ - RTL fallbacks now use `[dir="rtl"]` for the Degraded tier and `:dir()` for
147
+ nested direction changes. Redundant `@supports selector(:dir(...))` wrappers
148
+ were removed.
149
+ - Form controls include `-webkit-appearance` alongside `appearance` where
150
+ needed for older WebKit.
151
+ - `.scroll-snap` now uses `proximity` by default.
152
+ `data-snap="mandatory"` opts into strict snapping and
153
+ `data-snap-align="center"` controls item alignment.
154
+ - Print styles focus on structural repair and preserve semantic component
155
+ content.
156
+ - `reserved-classes.json` now lives at the package root while keeping the same
157
+ public package export.
158
+ - Compatibility checks now explicitly audit against the Degraded CSS floor,
159
+ including structural selectors such as `:has()` and selector lists in
160
+ `:not()`.
161
+
162
+ ### Fixed
163
+
164
+ - `applyEnhancement(name, selector, document)` now refreshes registrations owned
165
+ by either `document` or `document.documentElement`.
166
+ - `enhance()` no longer starts an idle `MutationObserver` when no valid enhancer
167
+ record exists.
168
+ - Context-menu button triggers now use the same opening path as pointer and
169
+ keyboard triggers, including `data-context-menu-scope`.
170
+ - Tooltips shown from touch/focus recover correctly after leaving and re-entering
171
+ their positioning boundary.
172
+ - Reusing one explicit tooltip from another trigger correctly restarts position
173
+ tracking.
174
+ - Tabs skip hidden items during keyboard navigation.
175
+ - Vertical tab focus rings use the correct inline edge.
176
+ - `.tabs` keeps `aria-orientation` inside `:where()`, allowing application
177
+ classes to override layout without fighting framework specificity.
178
+ - An unchecked `.switch` keeps the correct hover treatment without the hover
179
+ selector overriding the checked state.
180
+ - `.input-icon` supports leading and trailing icons at the same time and keeps
181
+ their inset tied to the control frame even when the icon has its own font
182
+ size.
183
+ - `.list-item` correctly lays out rows with no leading region.
184
+ - `.card.subtle` now propagates its subtle surface to contextual aliases and
185
+ busy overlays.
186
+ - `.card`, `.navbar`, and `.app-nav` reset inherited intent state at their
187
+ component boundary, preventing unrelated ancestor intents from tinting their
188
+ variants.
189
+ - `.app-nav` uses the system Highlight colors for its current item in forced
190
+ colors mode.
191
+ - `.background-surface`, `.background-raised`, and `.background-subtle` restore
192
+ their matching text color and heading context, including inside `.inverted`
193
+ sections.
194
+ - All paired themes provide their own `--hover-overlay` and `--shadow-color`
195
+ baseline values instead of inheriting the core tint.
196
+ - `.prose` resets the browser's default inline blockquote margin.
197
+ - `hr` no longer collapses to zero width inside `.stack`.
198
+ - Select styling and modal body scrolling remain functional in Degraded
199
+ Firefox 78–83.
200
+ - Badge dismiss buttons keep a 24px pointer-target floor and empty dismiss
201
+ buttons render their built-in close icon correctly.
202
+ - `.menu-separator` documentation now uses plain `<hr>` without a redundant
203
+ separator role.
204
+ - `--modal-size` can once again be overridden directly on a dialog.
205
+ - Theme, density, inverted, and application custom properties now inherit
206
+ correctly into anchored surfaces.
207
+
208
+ ### Documentation and tooling
209
+
210
+ - Updated the progressive-enhancement, surface, sizing, theme, layout, alert,
211
+ badge, joined-control, and browser-support documentation to match the 0.8
212
+ behavior.
213
+ - Added clearer guidance around `--gap`: setting the custom property changes an
214
+ inherited rhythm, while `.gap-context` applies that rhythm to containers that
215
+ do not already consume it.
216
+ - Updated Biome guidance for known false positives around `<menu role="menu">`
217
+ and `role="group"`.
218
+ - Documentation examples and the examples index were cleaned up to remove stale
219
+ framework classes and retired surface/sheet behavior.
220
+ - Package export tests now cover the documented `applyEnhancement()` and
221
+ `ACTUAL_EVENT_PREFIX` exports.
222
+
6
223
  ## [0.7.0] - 2026-09-04
7
224
 
8
225
  ### Added
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Plain CSS component framework for new projects. Semantic classes, shared variants, small tokens, theme hooks, and progressive enhancement.
4
4
 
5
5
  Actual CSS claims a documented set of global class names; the package publishes
6
- it as [`actual-css/reserved-classes.json`](scripts/reserved-classes.json).
6
+ it as [`actual-css/reserved-classes.json`](reserved-classes.json).
7
7
 
8
8
  For existing projects: use cascade layers, import order, or your own build-time
9
9
  prefix transform.
@@ -67,7 +67,9 @@ Intents such as `.primary`, `.secondary`, `.success`, `.warning`, and `.danger`
67
67
 
68
68
  Variants such as `.solid`, `.soft`, `.outline`, and `.surface` are shared by components like buttons, badges, alerts, and cards. `.inverted` is a shared surface modifier: it paints any block with the inverse surface. `.ghost` and `.link` are button-only variants.
69
69
 
70
- Size variants `.sm` and `.lg` scale controls consistently.
70
+ Size variants `.sm` and `.lg` scale typography and participating component
71
+ geometry consistently. Density contexts `.compact` and `.spacious` change
72
+ spacing and geometry without changing typography or icons.
71
73
 
72
74
  ## Public Class Grammar
73
75
 
@@ -77,7 +79,7 @@ Actual CSS uses a small unprefixed class grammar:
77
79
  .component [intent] [variant] [size] [modifier]
78
80
  ```
79
81
 
80
- Components, layout helpers, form helpers, and utilities claim their documented class names. Intents are `.primary`, `.secondary`, `.success`, `.warning`, and `.danger`; shared variants are `.solid`, `.soft`, `.outline`, and `.surface`; `.inverted` is a shared surface modifier; button-only variants are `.ghost` and `.link`; shared sizes are `.sm` and `.lg`.
82
+ Components, layout helpers, form helpers, and utilities claim their documented class names. Intents are `.primary`, `.secondary`, `.success`, `.warning`, and `.danger`; shared variants are `.solid`, `.soft`, `.outline`, and `.surface`; `.inverted` is a shared surface modifier; button-only variants are `.ghost` and `.link`; shared sizes are `.sm` and `.lg`; density contexts are `.compact` and `.spacious`.
81
83
 
82
84
  Undocumented `is-*` classes are runtime internals.
83
85
 
@@ -151,19 +153,19 @@ For more conservative fallbacks, import and compose the source entrypoints direc
151
153
 
152
154
  Actual CSS is built around progressive enhancement.
153
155
 
154
- | Tier | Firefox | Safari | Chromium |
155
- | ------------ | ------: | --------: | -------: |
156
- | Degraded | 78+ | 14+ | 88+ |
157
- | **Minimal** | **98+** | **15.4+** | **99+** |
158
- | Intermediate | 121+ | 16+ | 106+ |
159
- | Recommended | 129+ | 17.5+ | 123+ |
156
+ | Tier | Firefox | Safari | Chromium |
157
+ | ----------- | -------: | ------: | -------: |
158
+ | Degraded | 78+ | 14+ | 88+ |
159
+ | **Minimal** | **125+** | **17+** | **116+** |
160
+ | Recommended | 129+ | 17.5+ | 123+ |
160
161
 
161
162
  **Degraded** — semantic HTML and core CSS remain usable. JavaScript
162
163
  enhancements are outside the supported contract.
163
164
 
164
165
  **Minimal** — full Actual support, including the JavaScript runtime. The
165
- runtime assumes modern browser APIs and does not ship legacy compatibility
166
- layers or polyfills.
166
+ runtime assumes modern browser APIs — including the native manual Popover
167
+ transport used by interactive surfaces — and does not ship legacy
168
+ compatibility layers or polyfills.
167
169
 
168
170
  Degraded browsers may execute some enhancements successfully, but this
169
171
  behavior is not tested or preserved.