actual-css 0.9.0 → 0.9.2

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 (94) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +2 -1
  3. package/components.json +2 -0
  4. package/dist/actual.css +26 -6
  5. package/dist/actual.full.css +260 -74
  6. package/dist/actual.full.js +1 -1
  7. package/dist/actual.full.min.css +1 -1
  8. package/dist/actual.min.css +1 -1
  9. package/docs/pages/components/table.md +3 -2
  10. package/docs/pages/examples/overview.md +1 -0
  11. package/docs/pages/forms/input-policy.md +59 -0
  12. package/docs/pages/forms/validation.md +37 -1
  13. package/docs/pages/foundations/tokens.md +23 -4
  14. package/docs/pages/foundations/typography.md +10 -0
  15. package/docs/pages/guides/introduction.md +2 -1
  16. package/docs/pages/guides/progressive-enhancement.md +15 -10
  17. package/package.json +160 -159
  18. package/src/css/components/accordion.css +2 -0
  19. package/src/css/components/actions.css +2 -0
  20. package/src/css/components/alert.css +2 -0
  21. package/src/css/components/app-nav.css +2 -0
  22. package/src/css/components/avatar.css +2 -0
  23. package/src/css/components/badge.css +2 -0
  24. package/src/css/components/breadcrumb.css +2 -0
  25. package/src/css/components/busy.css +2 -0
  26. package/src/css/components/button.css +2 -0
  27. package/src/css/components/card.css +2 -0
  28. package/src/css/components/chat.css +2 -0
  29. package/src/css/components/data-list.css +2 -0
  30. package/src/css/components/drawer.css +35 -22
  31. package/src/css/components/fab.css +2 -0
  32. package/src/css/components/flyout.css +2 -0
  33. package/src/css/components/indicator.css +2 -0
  34. package/src/css/components/join.css +2 -0
  35. package/src/css/components/key.css +2 -0
  36. package/src/css/components/list.css +2 -0
  37. package/src/css/components/meter.css +2 -0
  38. package/src/css/components/modal.css +47 -40
  39. package/src/css/components/navbar.css +2 -0
  40. package/src/css/components/pagination.css +2 -0
  41. package/src/css/components/progress.css +2 -0
  42. package/src/css/components/rating.css +2 -0
  43. package/src/css/components/scrollspy.css +2 -0
  44. package/src/css/components/skeleton.css +2 -0
  45. package/src/css/components/spinner.css +2 -0
  46. package/src/css/components/status-bar.css +2 -0
  47. package/src/css/components/steps.css +2 -0
  48. package/src/css/components/tab.css +2 -0
  49. package/src/css/components/table.css +2 -0
  50. package/src/css/components/tooltip.css +2 -0
  51. package/src/css/core/base.css +2 -0
  52. package/src/css/core/print.css +3 -0
  53. package/src/css/core/tokens.css +2 -0
  54. package/src/css/core/variants.css +19 -6
  55. package/src/css/effects/aura.css +2 -0
  56. package/src/css/forms/choice-card.css +4 -0
  57. package/src/css/forms/control.css +2 -0
  58. package/src/css/forms/floating-field.css +5 -1
  59. package/src/css/forms/form-actions.css +2 -0
  60. package/src/css/forms/form.css +8 -0
  61. package/src/css/forms/input-icon.css +2 -0
  62. package/src/css/forms/native.css +2 -0
  63. package/src/css/forms/otp.css +10 -0
  64. package/src/css/forms/range.css +2 -0
  65. package/src/css/forms/select.css +2 -0
  66. package/src/css/forms/switch.css +2 -0
  67. package/src/css/forms/validation.css +2 -0
  68. package/src/css/layout/app-layout.css +2 -0
  69. package/src/css/layout/app-shell.css +5 -1
  70. package/src/css/layout/center.css +2 -0
  71. package/src/css/layout/cluster.css +2 -0
  72. package/src/css/layout/column-layout.css +2 -0
  73. package/src/css/layout/frame.css +2 -0
  74. package/src/css/layout/grid.css +2 -0
  75. package/src/css/layout/media.css +2 -1
  76. package/src/css/layout/scroll-snap.css +2 -0
  77. package/src/css/layout/scroll-target.css +2 -0
  78. package/src/css/layout/sidebar-layout.css +2 -0
  79. package/src/css/layout/stack.css +2 -1
  80. package/src/css/layout/switcher.css +2 -0
  81. package/src/css/layout/topbar.css +2 -0
  82. package/src/css/typography/fluid.css +2 -0
  83. package/src/css/typography/lead.css +2 -1
  84. package/src/css/typography/overline.css +2 -0
  85. package/src/css/typography/prose.css +2 -0
  86. package/src/css/utilities/base.css +6 -1
  87. package/src/js/context-menu.js +56 -15
  88. package/src/js/enhancement-loader.js +5 -1
  89. package/src/js/escape.js +11 -1
  90. package/src/js/flyout.js +6 -1
  91. package/src/js/focus.js +8 -3
  92. package/src/js/surface.js +28 -0
  93. package/src/js/tooltip.js +10 -4
  94. package/src/js/validation.js +31 -0
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Join — visually groups adjacent controls into a single unit.
3
3
  *
4
+ * Docs: docs/pages/forms/joined-controls.md
5
+ *
4
6
  * This is a cross-cutting control primitive, not a forms-only component:
5
7
  * it applies equally to inputs, selects, buttons, and button-like links.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Key — keyboard keys and shortcut tokens for UI chrome.
3
3
  *
4
+ * Docs: docs/pages/components/key.md
5
+ *
4
6
  * Use .key outside prose. Plain kbd inside .prose gets the same visual
5
7
  * treatment from prose.css so authored content stays convenient.
6
8
  *
@@ -3,6 +3,8 @@
3
3
  * Content determines the number of lines; the component only owns the row
4
4
  * geometry, dividers, and supporting-text treatment.
5
5
  *
6
+ * Docs: docs/pages/components/list.md
7
+ *
6
8
  * Public hooks:
7
9
  * --list-item-min-size
8
10
  * --list-item-pad-block
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Meter — native and segmented gauges for known-range values.
3
3
  *
4
+ * Docs: docs/pages/components/meter.md
5
+ *
4
6
  * Maps the three standard meter zones (optimum / suboptimum / even-less-good)
5
7
  * to the shared success / warning / danger intent colors.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Modal shell styling for native dialog elements.
3
3
  *
4
+ * Docs: docs/pages/components/dialog.md
5
+ *
4
6
  * Spacing, radius, transitions, and focus treatment come from shared tokens.
5
7
  * Opening behavior and intent-specific decisions stay outside this component.
6
8
  *
@@ -12,16 +14,15 @@
12
14
  *
13
15
  * Internal:
14
16
  * --dialog-close-icon-size
17
+ * --dialog-focus-bleed
15
18
  * --dialog-viewport-block
16
19
  * --dialog-viewport-gap-default
17
20
  * --dialog-viewport-gap-2x
18
21
  */
19
- dialog.modal {
20
- /* --dialog-viewport-gap stays fallback-only for the same reason as
21
- --modal-size below: declaring the public hook here would give it
22
- type+class specificity that a single author class cannot outrank. The
23
- responsive default lives in an internal token instead, so a media query
24
- can still move it without closing the hook.
22
+ :where(dialog).modal {
23
+ /* --dialog-viewport-gap stays fallback-only so the responsive default can
24
+ live in an internal token: a media query moves it without closing the
25
+ public hook.
25
26
 
26
27
  calc() multiplication is not in the supported browser range, so the
27
28
  doubled gap is spelled out with an additive calc. */
@@ -35,10 +36,8 @@ dialog.modal {
35
36
  provides the containing block for the absolutely positioned close button. */
36
37
  position: fixed;
37
38
 
38
- /* --modal-size stays fallback-only: declaring it on dialog.modal gives it
39
- type+class specificity, which a single author class cannot outrank, so the
40
- public hook would silently keep this default. Same reason choice.css never
41
- declares --choice-control-nudge. */
39
+ /* The root is :where(dialog).modal (0-1-0), so a single author class can
40
+ outrank these defaults — no fallback-only indirection needed here. */
42
41
  max-inline-size: min(calc(100% - var(--dialog-viewport-gap-2x)), var(--modal-size, 32rem));
43
42
 
44
43
  /* Stable viewport cap for the panel: dvh tracks the dynamic browser toolbar
@@ -68,8 +67,8 @@ dialog.modal {
68
67
  transform var(--duration) var(--ease-exit);
69
68
  }
70
69
 
71
- dialog.modal > form,
72
- dialog.modal > .stack {
70
+ :where(dialog).modal > form,
71
+ :where(dialog).modal > .stack {
73
72
  display: grid;
74
73
  gap: var(--space-40);
75
74
  max-block-size: calc(var(--dialog-viewport-block) - var(--dialog-viewport-gap-2x));
@@ -79,7 +78,7 @@ dialog.modal > .stack {
79
78
  }
80
79
 
81
80
  @supports (block-size: 100svh) {
82
- dialog.modal {
81
+ :where(dialog).modal {
83
82
  --dialog-viewport-block: 100svh;
84
83
  }
85
84
  }
@@ -87,42 +86,50 @@ dialog.modal > .stack {
87
86
  /* Keep the dialog off the viewport edges on small screens. Moves the internal
88
87
  default, not the public hook, so an author override still wins here too. */
89
88
  @media (max-width: 30rem) {
90
- dialog.modal {
89
+ :where(dialog).modal {
91
90
  --dialog-viewport-gap-default: var(--space-30);
92
91
  }
93
92
  }
94
93
 
95
- dialog.modal.scrollable > form,
96
- dialog.modal.scrollable > .stack {
94
+ :where(dialog).modal.scrollable > form,
95
+ :where(dialog).modal.scrollable > .stack {
97
96
  grid-template-rows: auto minmax(0, 1fr) auto;
98
97
  overflow: hidden;
99
98
  }
100
99
 
101
- dialog.modal.scrollable > form > :not(:is(header, footer)),
102
- dialog.modal.scrollable > .stack > :not(:is(header, footer)) {
100
+ :where(dialog).modal.scrollable > form > :not(:is(header, footer)),
101
+ :where(dialog).modal.scrollable > .stack > :not(:is(header, footer)) {
102
+ --dialog-focus-bleed: calc(var(--focus-outline-offset) + var(--border-width) * 2);
103
+
103
104
  min-block-size: 0;
105
+ /* Keep focus paint inside the clip without moving the body off the fixed
106
+ header and footer edges. */
107
+ margin-inline: calc(var(--dialog-focus-bleed) * -1);
108
+ padding-inline: var(--dialog-focus-bleed);
104
109
  overflow: auto;
105
110
  overscroll-behavior: contain;
106
111
  }
107
112
 
108
- dialog.modal header > :first-child,
109
- dialog.modal footer > :first-child {
113
+ /* Anatomy is bounded to the structural slots (direct children of the
114
+ form/.stack body): a header or footer deeper in the content keeps its own
115
+ rhythm and is not restyled as the modal's chrome. */
116
+ :where(dialog).modal > :where(form, .stack) > :is(header, footer) > :first-child {
110
117
  margin-block-start: 0;
111
118
  }
112
119
 
113
- dialog.modal header > :last-child,
114
- dialog.modal footer > :last-child {
120
+ :where(dialog).modal > :where(form, .stack) > :is(header, footer) > :last-child {
115
121
  margin-block-end: 0;
116
122
  }
117
123
 
118
124
  /* The close button is anchored to the dialog at top inline-end, out of the
119
- content flow; headers reserve inline room so titles never run under it. */
120
- dialog.modal > form > header,
121
- dialog.modal > .stack > header {
125
+ content flow; headers reserve inline room so titles never run under it.
126
+ The form/.stack anatomy is structural, so it stays in :where() and never
127
+ lends .stack's specificity to a bare <form>. */
128
+ :where(dialog).modal > :where(form, .stack) > header {
122
129
  padding-inline-end: calc(var(--control-size) + var(--space-30));
123
130
  }
124
131
 
125
- dialog.modal footer {
132
+ :where(dialog).modal > :where(form, .stack) > footer {
126
133
  display: flex;
127
134
  flex-wrap: wrap;
128
135
  justify-content: flex-end;
@@ -132,17 +139,17 @@ dialog.modal footer {
132
139
  /* Confirmation layout — a focused message followed by a visually distinct
133
140
  action band. The media primitive owns icon/content alignment; this variant
134
141
  only removes the standard form inset so both regions can own their padding. */
135
- dialog.modal.dialog-confirmation > form {
142
+ :where(dialog).modal.dialog-confirmation > form {
136
143
  gap: 0;
137
144
  padding: 0;
138
145
  }
139
146
 
140
- dialog.modal.dialog-confirmation > form > .media {
147
+ :where(dialog).modal.dialog-confirmation > form > .media {
141
148
  gap: var(--space-40);
142
149
  padding: var(--space-50);
143
150
  }
144
151
 
145
- dialog.modal.dialog-confirmation > form > footer {
152
+ :where(dialog).modal.dialog-confirmation > form > footer {
146
153
  padding: var(--space-40) var(--space-50);
147
154
  border-end-start-radius: calc(var(--radius-lg) - var(--border-width));
148
155
  border-end-end-radius: calc(var(--radius-lg) - var(--border-width));
@@ -183,13 +190,13 @@ dialog.modal.dialog-confirmation > form > footer {
183
190
  }
184
191
 
185
192
  @media (max-width: 30rem) {
186
- dialog.modal.dialog-confirmation > form > .media,
187
- dialog.modal.dialog-confirmation > form > footer {
193
+ :where(dialog).modal.dialog-confirmation > form > .media,
194
+ :where(dialog).modal.dialog-confirmation > form > footer {
188
195
  padding: var(--space-40);
189
196
  }
190
197
  }
191
198
 
192
- dialog.modal[open] {
199
+ :where(dialog).modal[open] {
193
200
  opacity: 1;
194
201
  transform: none;
195
202
  transition:
@@ -198,13 +205,13 @@ dialog.modal[open] {
198
205
  }
199
206
 
200
207
  @starting-style {
201
- dialog.modal[open] {
208
+ :where(dialog).modal[open] {
202
209
  opacity: 0;
203
210
  transform: translateY(0.35rem);
204
211
  }
205
212
  }
206
213
 
207
- dialog.modal::backdrop {
214
+ :where(dialog).modal::backdrop {
208
215
  background: var(--backdrop-fill);
209
216
  opacity: 0;
210
217
  /* Scrim curve stays neutral `ease`; only the panel carries the character
@@ -213,7 +220,7 @@ dialog.modal::backdrop {
213
220
  }
214
221
 
215
222
  @supports (transition-behavior: allow-discrete) {
216
- dialog.modal {
223
+ :where(dialog).modal {
217
224
  transition:
218
225
  opacity var(--duration) var(--ease-exit),
219
226
  transform var(--duration) var(--ease-exit),
@@ -221,7 +228,7 @@ dialog.modal::backdrop {
221
228
  display var(--duration) allow-discrete;
222
229
  }
223
230
 
224
- dialog.modal[open] {
231
+ :where(dialog).modal[open] {
225
232
  transition:
226
233
  opacity var(--duration) var(--ease-enter),
227
234
  transform var(--duration) var(--ease-enter),
@@ -229,7 +236,7 @@ dialog.modal::backdrop {
229
236
  display var(--duration) allow-discrete;
230
237
  }
231
238
 
232
- dialog.modal::backdrop {
239
+ :where(dialog).modal::backdrop {
233
240
  transition:
234
241
  opacity var(--duration) ease,
235
242
  overlay var(--duration) allow-discrete,
@@ -237,7 +244,7 @@ dialog.modal::backdrop {
237
244
  }
238
245
  }
239
246
 
240
- dialog.modal[open]::backdrop {
247
+ :where(dialog).modal[open]::backdrop {
241
248
  opacity: 1;
242
249
  }
243
250
 
@@ -250,7 +257,7 @@ html.has-modal-open.had-scrollbar {
250
257
  }
251
258
 
252
259
  @starting-style {
253
- dialog.modal[open]::backdrop {
260
+ :where(dialog).modal[open]::backdrop {
254
261
  opacity: 0;
255
262
  }
256
263
  }
@@ -258,7 +265,7 @@ html.has-modal-open.had-scrollbar {
258
265
  @media (prefers-reduced-motion: no-preference) {
259
266
  /* Wrong-close feedback and view-transition transport are motion quirks, not
260
267
  presence enter/exit, so they stay on the plain CSS default easing. */
261
- dialog.modal.is-static {
268
+ :where(dialog).modal.is-static {
262
269
  animation: actual-dialog-static var(--duration-slow) ease;
263
270
  }
264
271
 
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Navbar — top-level navigation bar.
3
3
  *
4
+ * Docs: docs/pages/components/navbar.md
5
+ *
4
6
  * .navbar is a horizontal bar; .navbar-brand is the brand link; .navbar-nav is
5
7
  * the inline link list using .nav-link items. .nav-list is the vertical nav
6
8
  * list shared with .drawer, fed by the shared --gap token.
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Pagination — page navigation for paginated lists.
3
3
  *
4
+ * Docs: docs/pages/components/pagination.md
5
+ *
4
6
  * Render .btn elements inside a .pagination list. The active page is marked
5
7
  * with aria-current="page"; .btn owns the active state styling.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Progress — native progress bar with theme-aware track and value.
3
3
  *
4
+ * Docs: docs/pages/components/progress.md
5
+ *
4
6
  * Consumes the shared --intent/--primary for the value bar and --bar-height
5
7
  * for thickness. Indeterminate state animates a shimmer using --duration-shimmer.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Rating — integer star rating drawn on native radio inputs.
3
3
  *
4
+ * Docs: docs/pages/components/rating.md
5
+ *
4
6
  * The checked radio remains the functional baseline. :has() progressively
5
7
  * fills preceding stars without reversing DOM or keyboard order. Forced
6
8
  * colors restores the platform radio presentation.
@@ -2,6 +2,8 @@
2
2
  * Scrollspy — behavior hook for navigation that marks the active section
3
3
  * while the page scrolls.
4
4
  *
5
+ * Docs: docs/pages/enhancements/scrollspy.md
6
+ *
5
7
  * Does not add visual styles by itself. scrollspy.js watches
6
8
  * <nav class="scrollspy">
7
9
  * containing <a href="#section"> links and toggles aria-current="location" on
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Skeleton placeholders for loading states.
3
3
  *
4
+ * Docs: docs/pages/components/skeleton.md
5
+ *
4
6
  * Shows approximate loading structure without implying real content hierarchy.
5
7
  * Geometry, animation, and color stay theme-aware.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Spinner — compact loading feedback.
3
3
  *
4
+ * Docs: docs/pages/components/spinner.md
5
+ *
4
6
  * Uses currentColor so it adapts to buttons, alerts, badges, and text. The
5
7
  * [aria-busy] overlay composition lives in components/busy.css.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Status bar — singleton floating status area.
3
3
  *
4
+ * Docs: docs/pages/enhancements/status-bar.md
5
+ *
4
6
  * One element in the HTML, empty by default. .is-open is the visual state, set
5
7
  * by status.js like any other surface: it lands after the message is written
6
8
  * and lifts before the bar is cleared, so the bar leaves in the exact state it
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Steps — semantic ordered-list progression for a multi-step process.
3
3
  *
4
+ * Docs: docs/pages/components/steps.md
5
+ *
4
6
  * One primitive, two explicit compositions. Both classes are required:
5
7
  *
6
8
  * <ol class="steps steps-horizontal"> horizontal, 2 to 5 stages
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Tabs — in-place panel switcher with real tab semantics.
3
3
  *
4
+ * Docs: docs/pages/enhancements/tabs.md
5
+ *
4
6
  * JavaScript owns roving tabindex, aria-selected, panel visibility,
5
7
  * and arrow-key navigation. CSS owns the tab strip appearance and
6
8
  * active indicator.
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Table — structured tabular data.
3
3
  *
4
+ * Docs: docs/pages/components/table.md
5
+ *
4
6
  * .table-wrap provides the scroll container and outer chrome; .table owns row
5
7
  * and cell rules. Tokens are sourced from the shared scale.
6
8
  *
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Tooltip — supplemental label overlaid near a trigger.
3
3
  *
4
+ * Docs: docs/pages/enhancements/tooltip.md
5
+ *
4
6
  * Position, placement, and arrow position are managed by JavaScript via left,
5
7
  * top, data-placement, and --arrow-x. The runtime also owns `position`: it
6
8
  * writes `absolute` for a tip whose trigger scrolls with the page, so the
@@ -7,12 +7,14 @@
7
7
  * Public hooks:
8
8
  * --link
9
9
  * --hr-space
10
+ * --font-width / --font-width-dense (see variants.css for the dense application)
10
11
  */
11
12
 
12
13
  body {
13
14
  background: var(--surface);
14
15
  color: var(--text);
15
16
  font-family: var(--font-sans);
17
+ font-stretch: var(--font-width);
16
18
  line-height: var(--line-height);
17
19
  }
18
20
 
@@ -1,5 +1,8 @@
1
1
  @media print {
2
2
  :root,
3
+ /* The doubled attribute intentionally outranks single-attribute preset
4
+ islands (data-theme="dark", paired themes) loaded after the core. */
5
+ [data-theme][data-theme],
3
6
  body {
4
7
  /* Save some ink in dark mode */
5
8
  color-scheme: light;
@@ -19,6 +19,8 @@
19
19
  /* Typography */
20
20
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
21
21
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
22
+ --font-width: 100%;
23
+ --font-width-dense: 95%;
22
24
  --line-height: 1.5;
23
25
  --line-height-tight: 1.25;
24
26
  --line-height-relaxed: 1.75;
@@ -16,9 +16,16 @@
16
16
  * components/alert.css — .alert default soft behind explicit --ui-*
17
17
  *
18
18
  * .compact/.spacious set inherited density tokens: spacing rhythm and geometry
19
- * only. Density never changes typography or icon size. Controls consume
20
- * --control-size; non-control components may consume --density-* when the
21
- * context should affect their local rhythm.
19
+ * only, plus a slight typographic width bonus. Density never changes font size
20
+ * or icon size. Controls consume --control-size; non-control components may
21
+ * consume --density-* when the context should affect their local rhythm.
22
+ * .compact applies --font-width-dense through font-stretch (a variable wdth
23
+ * axis when available, otherwise normal width-face matching); layout must
24
+ * never depend on the narrowing being available. .spacious restores
25
+ * --font-width, so a spacious island inside a compact context returns to the
26
+ * normal width exactly as it restores its own gap, spacing, and control size.
27
+ * Themes whose typeface has no useful width axis opt out with
28
+ * --font-width-dense: 100%.
22
29
  *
23
30
  * .sm/.lg are local size roles, not shared measurements. Shared control
24
31
  * participants below map both typography and geometry; components with
@@ -83,18 +90,20 @@
83
90
  --gap: var(--space-20);
84
91
  --density-space: var(--space-20);
85
92
  --control-size: var(--control-size-sm);
93
+ font-stretch: var(--font-width-dense);
86
94
  }
87
95
 
88
96
  .spacious {
89
97
  --gap: var(--space-50);
90
98
  --density-space: var(--space-50);
91
99
  --control-size: var(--control-size-lg);
100
+ font-stretch: var(--font-width);
92
101
  }
93
102
 
94
103
  /* Shared control scale. Wrappers are listed when their descendants form one
95
- component (field, input-icon, join, pagination, tabs, flyout). A local size
96
- declaration beats inherited density because it is declared on the sized
97
- component itself. */
104
+ component (field, choice-card, floating-field, input-icon, join, pagination,
105
+ tabs, flyout). A local size declaration beats inherited density because it
106
+ is declared on the sized component itself. */
98
107
  :where(
99
108
  .btn,
100
109
  .input,
@@ -104,7 +113,9 @@
104
113
  .file,
105
114
  .field,
106
115
  .choice,
116
+ .choice-card,
107
117
  .input-icon,
118
+ .floating-field,
108
119
  .otp,
109
120
  .join,
110
121
  .pagination,
@@ -126,7 +137,9 @@
126
137
  .file,
127
138
  .field,
128
139
  .choice,
140
+ .choice-card,
129
141
  .input-icon,
142
+ .floating-field,
130
143
  .otp,
131
144
  .join,
132
145
  .pagination,
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Decorative intent-colored frame for one direct child.
3
3
  *
4
+ * Docs: docs/pages/components/aura.md
5
+ *
4
6
  * The effect is built from three layers with distinct roles: a frame carrying
5
7
  * a short accent of light, a small halo that belongs to the frame and keeps
6
8
  * that light attached to the edge, and a wide static halo that belongs to the
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Choice cards — card-style radio and checkbox labels.
3
3
  *
4
+ * Docs: docs/pages/forms/choice-cards.md
5
+ *
4
6
  * Each .choice-card is a <label> wrapping a native radio or checkbox. When
5
7
  * :has() is supported the input is visually hidden and the card mirrors its
6
8
  * state: checked border and tint, checkmark badge (round for radio, rounded
@@ -37,6 +39,8 @@
37
39
  border-radius: var(--choice-card-radius);
38
40
  background: var(--choice-card-bg);
39
41
  color: var(--text);
42
+ /* Consumed so .sm/.lg reach the card; the badge's em sizing follows. */
43
+ font-size: var(--control-font-size);
40
44
  cursor: pointer;
41
45
  transition:
42
46
  border-color var(--duration),
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Text controls — input, textarea, select.
3
3
  *
4
+ * Docs: docs/pages/forms/overview.md
5
+ *
4
6
  * Neutral geometry and interaction states shared across all text-like
5
7
  * controls. select shares this base recipe; its chevron/appearance layer
6
8
  * lives in select.css. checkbox, radio, range, switch, and file have their
@@ -2,6 +2,8 @@
2
2
  * Floating labels — optional composition over the text controls
3
3
  * (.input, .textarea, .select) and .field-label.
4
4
  *
5
+ * Docs: docs/pages/forms/floating-field.md
6
+ *
5
7
  * The cell owns a control plus its label; the label overlays the control and
6
8
  * floats to the top when the control is focused or non-empty. Help and error
7
9
  * messages stay in the surrounding .field, not inside the cell, so the
@@ -43,7 +45,9 @@
43
45
 
44
46
  .floating-field > .field-label {
45
47
  position: absolute;
46
- inset-inline-start: calc(var(--space-30) + var(--border-width));
48
+ /* Same start edge as the control's text: --control-pad-x owns that shared
49
+ geometry, so .sm/.lg keep label and value aligned. */
50
+ inset-inline-start: calc(var(--control-pad-x) + var(--border-width));
47
51
  color: var(--text-muted);
48
52
  font-size: var(--control-font-size);
49
53
  font-weight: var(--font-weight-normal);
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Form actions — bottom form bar with sticky variant.
3
3
  *
4
+ * Docs: docs/pages/forms/form-actions.md
5
+ *
4
6
  * A flex cluster of buttons/actions that closes a form. The sticky variant
5
7
  * docks to the viewport bottom with a translucent blur where supported; at
6
8
  * rest it stays visually neutral so it does not double as a separator.
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Form layout and supporting text.
3
3
  *
4
+ * Docs: docs/pages/forms/overview.md
5
+ *
4
6
  * Individual controls keep their own files; .choice label layout lives in
5
7
  * choice.css; .form-actions lives in form-actions.css.
6
8
  *
@@ -16,6 +18,12 @@
16
18
  */
17
19
  .field {
18
20
  display: grid;
21
+
22
+ /* why: a field stretched by a taller row sibling — the classic case is a
23
+ neighbour revealing its .field-error — would otherwise hand the extra
24
+ block size to its auto rows and inflate the control. Rows keep their
25
+ natural height; the slack stays at the end. */
26
+ align-content: start;
19
27
  gap: var(--space-10);
20
28
  color: var(--text);
21
29
  font-size: var(--control-font-size);
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Input Icon — decorative icon inside a relative wrapper, leading or trailing.
3
3
  *
4
+ * Docs: docs/pages/patterns/icon-input.md
5
+ *
4
6
  * Icon-library agnostic: detects position by DOM order. First child that is
5
7
  * not .input = leading icon; icon after .input = trailing. The icon follows
6
8
  * local typography; density contexts shrink the control geometry around it
@@ -3,6 +3,8 @@
3
3
  * custom styling, so the framework stays out of the way and just keeps them
4
4
  * readable and theme-aware.
5
5
  *
6
+ * Docs: docs/pages/forms/controls.md
7
+ *
6
8
  * Range has its own custom-styled file (range.css) so the focus ring can
7
9
  * target the thumb pseudo-element rather than the rectangular CSS box.
8
10
  */
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * One-time code input with visual cells and one native input.
3
3
  *
4
+ * Docs: docs/pages/forms/otp.md
5
+ *
4
6
  * Add one direct span per accepted character. The cells determine the
5
7
  * component width; the overlaid input remains the only interactive control.
6
8
  *
@@ -129,4 +131,12 @@
129
131
  .needs-validation.was-validated .otp > input:invalid ~ span {
130
132
  --otp-cell-border: Mark;
131
133
  }
134
+
135
+ /* biome-ignore lint/style/noDescendingSpecificity: the :user-invalid route
136
+ mirrors the non-forced-colors block above and must come last — the three
137
+ invalid markers write the same value, so source order is inert. An engine
138
+ without the pseudo drops this rule alone. */
139
+ .needs-validation .otp > input:user-invalid ~ span {
140
+ --otp-cell-border: Mark;
141
+ }
132
142
  }
@@ -2,6 +2,8 @@
2
2
  * Range slider — custom-styled so the focus ring always targets the
3
3
  * user-manipulated surface (the thumb) rather than the CSS box.
4
4
  *
5
+ * Docs: docs/pages/forms/range.md
6
+ *
5
7
  * appearance: none gives us full control over track and thumb; without it,
6
8
  * pseudo-element rules for ::-webkit-slider-thumb and ::-moz-range-thumb
7
9
  * are not reliably applied across browsers.
@@ -2,6 +2,8 @@
2
2
  * Select — chevron and appearance layer on top of the shared text-control
3
3
  * recipe.
4
4
  *
5
+ * Docs: docs/pages/forms/overview.md
6
+ *
5
7
  * Base geometry and interaction states come from control.css (select shares
6
8
  * the --control-* tokens). This file only removes the native arrow and draws
7
9
  * the CSS chevron, so the picker (appearance: base-select) enhancement in
@@ -1,6 +1,8 @@
1
1
  /*
2
2
  * Switch controls for checkbox inputs with switch semantics.
3
3
  *
4
+ * Docs: docs/pages/forms/switch.md
5
+ *
4
6
  * The switch remains an input control, not a decorative toggle. Checked, hover,
5
7
  * focus-visible, and disabled states stay clear.
6
8
  *