actual-css 0.19.4 → 0.20.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 (95) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +6 -6
  3. package/components.json +6 -3
  4. package/dist/actual.full.css +249 -50
  5. package/dist/actual.full.js +2 -2
  6. package/dist/actual.full.min.css +1 -1
  7. package/dist/types/menu.d.ts +2 -5
  8. package/docs/pages/components/accordion.md +11 -6
  9. package/docs/pages/components/alert.md +64 -62
  10. package/docs/pages/components/avatar.md +12 -12
  11. package/docs/pages/components/badge.md +15 -15
  12. package/docs/pages/components/breadcrumb.md +10 -8
  13. package/docs/pages/components/button.md +56 -7
  14. package/docs/pages/components/card.md +21 -21
  15. package/docs/pages/components/dialog.md +97 -69
  16. package/docs/pages/components/drawer.md +33 -33
  17. package/docs/pages/components/indicator.md +12 -12
  18. package/docs/pages/components/navbar.md +41 -9
  19. package/docs/pages/components/pagination.md +7 -7
  20. package/docs/pages/components/progress.md +18 -13
  21. package/docs/pages/components/rating.md +19 -19
  22. package/docs/pages/components/reveal.md +2 -0
  23. package/docs/pages/components/segmented.md +35 -31
  24. package/docs/pages/components/skeleton.md +10 -8
  25. package/docs/pages/components/spinner.md +21 -15
  26. package/docs/pages/components/table.md +26 -28
  27. package/docs/pages/enhancements/flyout.md +94 -43
  28. package/docs/pages/enhancements/in-view.md +3 -1
  29. package/docs/pages/enhancements/scrollspy.md +51 -18
  30. package/docs/pages/enhancements/tabs.md +43 -37
  31. package/docs/pages/enhancements/tooltip.md +4 -2
  32. package/docs/pages/forms/ajax.md +66 -0
  33. package/docs/pages/forms/choice-cards.md +8 -8
  34. package/docs/pages/forms/color-swatches.md +12 -12
  35. package/docs/pages/forms/form-actions.md +23 -0
  36. package/docs/pages/forms/joined-controls.md +8 -8
  37. package/docs/pages/forms/labels.md +11 -11
  38. package/docs/pages/forms/overview.md +35 -29
  39. package/docs/pages/forms/states-and-sizes.md +9 -9
  40. package/docs/pages/forms/switch.md +35 -2
  41. package/docs/pages/forms/validation.md +16 -16
  42. package/docs/pages/foundations/theming.md +32 -2
  43. package/docs/pages/foundations/tokens.md +18 -16
  44. package/docs/pages/guides/coding-agents.md +18 -0
  45. package/docs/pages/guides/introduction.md +1 -1
  46. package/llms.txt +3 -3
  47. package/package.json +5 -5
  48. package/reserved-classes.json +1 -0
  49. package/skills/actual-css/SKILL.md +7 -0
  50. package/src/cli/actual-css.js +3 -3
  51. package/src/css/components/badge.css +10 -6
  52. package/src/css/components/button.css +20 -7
  53. package/src/css/components/join.css +14 -4
  54. package/src/css/components/navbar.css +83 -1
  55. package/src/css/components/pagination.css +3 -1
  56. package/src/css/components/segmented.css +27 -7
  57. package/src/css/core/theme.css +11 -9
  58. package/src/css/core/tokens.css +7 -1
  59. package/src/css/core/variants.css +2 -0
  60. package/src/css/effects/reveal.css +15 -6
  61. package/src/css/forms/control.css +11 -1
  62. package/src/css/forms/form.css +14 -4
  63. package/src/css/forms/switch.css +32 -3
  64. package/src/js/ajax.js +18 -1
  65. package/src/js/context-menu.js +1 -3
  66. package/src/js/flyout.js +14 -5
  67. package/src/js/in-view.js +41 -30
  68. package/src/js/menu.js +9 -21
  69. package/src/js/surface.js +38 -0
  70. package/src/tooling/design-tokens.js +1 -0
  71. package/src/tooling/theme-contrast.js +24 -9
  72. package/tokens.json +1 -0
  73. package/docs/design-notes/accessibility-decisions.md +0 -63
  74. package/docs/design-notes/app-ui.md +0 -67
  75. package/docs/design-notes/architecture.md +0 -70
  76. package/docs/design-notes/browser-support.md +0 -239
  77. package/docs/design-notes/cascade-layer.md +0 -74
  78. package/docs/design-notes/column-layout.md +0 -260
  79. package/docs/design-notes/css-anchor.md +0 -87
  80. package/docs/design-notes/enhancement-contract.md +0 -193
  81. package/docs/design-notes/forced-colors.md +0 -123
  82. package/docs/design-notes/grid.md +0 -785
  83. package/docs/design-notes/motion-cost.md +0 -62
  84. package/docs/design-notes/naming.md +0 -71
  85. package/docs/design-notes/platform-alignment.md +0 -602
  86. package/docs/design-notes/popover-manual-poc.md +0 -328
  87. package/docs/design-notes/references.md +0 -336
  88. package/docs/design-notes/rich-text.md +0 -61
  89. package/docs/design-notes/spacing-units.md +0 -286
  90. package/docs/design-notes/steps.md +0 -776
  91. package/docs/design-notes/surface-reparenting.md +0 -130
  92. package/docs/design-notes/tokens.md +0 -166
  93. package/docs/design-notes/tooltip-coordinate-space.md +0 -130
  94. package/docs/design-notes/widget-primitives.md +0 -144
  95. package/docs/navigation.json +0 -176
@@ -1,62 +0,0 @@
1
- # Motion cost
2
-
3
- What an animation costs per frame depends on the property it animates, not on
4
- how complex the effect looks. `transform` and `opacity` run on the compositor:
5
- the layer is rastered once and moved. Anything else — a registered custom
6
- property, `box-shadow`, `background-position` — runs style and paint on the
7
- main thread every frame, off screen included.
8
-
9
- ## Measuring
10
-
11
- `bun run report:paint` loads each page it is given and reports renderer CPU,
12
- main-thread task time and frame pacing over a fixed window. Give it one page
13
- per variant; a fixture reads its variant from the query string. Confirm a
14
- finding in a real browser with DevTools → Rendering → Paint flashing: a
15
- repainted element flashes green on every frame.
16
-
17
- ## Aura
18
-
19
- `.aura` animates `--aura-angle`, a registered property that feeds the frame's
20
- `conic-gradient`. The usual border-beam technique, built with a JavaScript
21
- component that adds a beam element, draws the same light by rotating a static
22
- conic square with `transform`, cut to a ring by a mask.
23
-
24
- ```sh
25
- bun run report:paint \
26
- "scripts/fixtures/aura-paint.html?variant=frozen&n=20" \
27
- "scripts/fixtures/aura-paint.html?variant=current&n=20" \
28
- "scripts/fixtures/aura-paint.html?variant=glow&n=20" \
29
- "scripts/fixtures/aura-paint.html?variant=layout&n=20" \
30
- "scripts/fixtures/aura-paint.html?variant=static&n=20" \
31
- "scripts/fixtures/aura-paint.html?variant=nohalo&n=20" \
32
- "scripts/fixtures/aura-paint.html?variant=rotate&n=20"
33
- ```
34
-
35
- Measured on 2026-11-12, headless Chrome, renderer CPU in ms per second:
36
-
37
- | Auras on screen | Frozen | `.aura` | `.aura-glow` | Rotated beam |
38
- | ------------------ | ------ | --------- | ------------ | ------------ |
39
- | 1 | 14 | 150–210 | 118 | 35–45 |
40
- | 4 | 17 | 290–590 | 537 | 35–90 |
41
- | 20 | 20–40 | 1150–1700 | 815 | 90–100 |
42
- | 5 (+15 off screen) | 20 | ~500 | 360 | ~90 |
43
-
44
- Paint flashing in Chrome agreed: every `.aura` flashes, the beam never does.
45
- No variant dropped below 60 fps.
46
-
47
- - The cost is the `--aura-angle` animation itself. `contain: layout`, a static
48
- near halo on its own layer, and no near halo at all all stayed within noise
49
- of the current aura.
50
- - Off-screen auras keep paying main-thread style on every frame.
51
- - `.aura-glow` costs less but still repaints: its far halo breathes through
52
- `box-shadow`.
53
-
54
- Aura keeps its implementation. The compositor version needs an element to
55
- rotate inside a ring-shaped clip, and `.aura` has none to give: both pseudos
56
- are taken (near halo, occlusion), a mask on `.aura` would clip the child, and
57
- `overflow: clip` would cut the halo and the child's focus ring. Adding a beam
58
- element would break the one-child contract for an effect meant for one or two
59
- objects per view, which is what the Aura page now asks.
60
-
61
- Reopen this if a design needs many simultaneous auras: the answer is then an
62
- explicit beam element, not containment.
@@ -1,71 +0,0 @@
1
- # Naming conventions
2
-
3
- ## Sources
4
-
5
- - Stick to [uiterms.com](https://uiterms.com/) naming when choosing component and pattern names.
6
- - Reference [Open UI](https://open-ui.org/) research when designing new primitives.
7
-
8
- ## Public class grammar
9
-
10
- Actual CSS uses bare global class names as its public CSS API. The grammar is:
11
-
12
- ```
13
- .component [intent] [variant] [size] [modifier]
14
- ```
15
-
16
- Examples:
17
-
18
- ```html
19
- <button class="btn primary outline lg">Publish</button>
20
- <span class="badge success soft">Online</span>
21
- <section class="card raised stack">...</section>
22
- ```
23
-
24
- Documented classes are the public API. Treat them like package exports: adding one is an API decision, renaming or removing one is breaking, and `is-*` classes belong to runtime internals rather than the author API.
25
-
26
- Actual CSS is intended for new projects. Existing projects with class collisions should use `actual.layer.css`, import order, or their own prefix transform as a pipeline output. The primary API remains unprefixed.
27
-
28
- ### Rules
29
-
30
- Modifiers use separate classes because intents, treatments, and sizes are
31
- shared across components. A custom `.tertiary` intent can then work on buttons,
32
- badges, and alerts without a modifier for each block. Native and ARIA attributes
33
- carry state without a parallel class to synchronize. Semantic children such as
34
- a card's `header` and `footer` need no extra element class.
35
-
36
- - Classes name components, not markup. Prefer the established UI term even when it matches the element (`.select`, `.table`); do not invent synonyms just to avoid repetition.
37
- - When one element can host multiple components, use the component role instead of the element name (`.modal` / `.drawer` on `dialog`, `.check` / `.radio` / `.switch` on `input`).
38
- - Do not merely restate the element when a more precise or canonical component name exists (`.key`, not `.kbd`; `.modal` / `.drawer`, not `.dialog`).
39
- - Prefer the shortest established term when it improves searchability without drifting from the component vocabulary (`.btn`, not `.button`).
40
- - Classes name roles and boolean modifiers; `data-*` carries configurable values.
41
- - `is-*` classes are runtime internals, not author API.
42
- - Public JS data attributes are namespaced by feature (`data-flyout-*`, `data-context-menu-*`, `data-dialog-*`, `data-tooltip-*`; `data-toast-*` is reserved).
43
- - Shared runtime primitives may have public JavaScript APIs without becoming author-facing CSS or HTML vocabulary. Do not introduce `.surface` or `data-surface-*`; components keep their feature-specific author APIs (`data-flyout-*`, `data-context-menu-*`, CSS `.flyout`, `.menu`, …).
44
- - `data-enhance` is the one un-namespaced attribute — it carries *opt-in* for any feature, not *configuration* for one feature. Feature-namespaced attributes carry configuration.
45
- - Custom events use the `actual:*` namespace.
46
-
47
- ## Utilities
48
-
49
- Utilities ship in two modules that follow the same class grammar. Both are
50
- imported by `utilities/index.css`, so the split is about naming and curation,
51
- never about opting in.
52
-
53
- - **Base** (`utilities/base.css`) is a curated set of common ergonomic
54
- shortcuts (`.overflow-auto`, `.gap-none`, `.text-nowrap`, `.px`, `.py`).
55
- - **Extra** (`utilities/extra.css`) uses explicit property/value names
56
- (`.overflow-hidden`, `.padding-context`, `.flex-nowrap`).
57
-
58
- Call them base and extra, after the files. "Optional" is the wrong word for
59
- either: it reads as a layer an author has to opt into, which is true of every
60
- module outside `core/` and therefore says nothing about these two.
61
-
62
- The `.gap-sm` / `.gap-md` / `.gap-lg` scale was removed before 0.8: it set `gap`
63
- without `--gap`, which can diverge from `.grid-N` track sizing. A local gap is
64
- now a direct `gap` declaration; `--gap` is reserved for rebinding an inherited
65
- rhythm.
66
-
67
- Base may use compact names for a small set of frequent operations (`.px`,
68
- `.py`, `.mbs`, `.mbe`). Extra uses explicit property/value names and must not
69
- duplicate an operation already provided by base. The two sets may cover the
70
- same CSS property, but must not expose competing names for the same
71
- declaration.