actual-css 0.14.1 → 0.15.1

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 (67) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +4 -4
  3. package/components.json +51 -6
  4. package/dist/actual.full.css +380 -32
  5. package/dist/actual.full.js +1 -1
  6. package/dist/actual.full.min.css +1 -1
  7. package/docs/design-notes/architecture.md +3 -0
  8. package/docs/design-notes/enhancement-contract.md +14 -0
  9. package/docs/design-notes/naming.md +6 -0
  10. package/docs/design-notes/steps.md +13 -2
  11. package/docs/design-notes/tokens.md +159 -0
  12. package/docs/navigation.json +4 -1
  13. package/docs/pages/components/accordion.md +15 -18
  14. package/docs/pages/components/avatar.md +1 -0
  15. package/docs/pages/components/badge.md +41 -5
  16. package/docs/pages/components/button.md +32 -7
  17. package/docs/pages/components/card.md +40 -7
  18. package/docs/pages/components/diagrams.md +96 -0
  19. package/docs/pages/components/steps.md +31 -17
  20. package/docs/pages/components/table.md +4 -0
  21. package/docs/pages/components/timeline.md +111 -0
  22. package/docs/pages/enhancements/overview.md +13 -20
  23. package/docs/pages/enhancements/status-bar.md +7 -9
  24. package/docs/pages/enhancements/tabs.md +59 -21
  25. package/docs/pages/enhancements/tooltip.md +10 -19
  26. package/docs/pages/examples/overview.md +3 -0
  27. package/docs/pages/forms/choice-cards.md +3 -0
  28. package/docs/pages/forms/combobox.md +34 -19
  29. package/docs/pages/forms/controls.md +2 -0
  30. package/docs/pages/forms/date-picker.md +34 -13
  31. package/docs/pages/forms/file-upload.md +120 -0
  32. package/docs/pages/forms/joined-controls.md +4 -2
  33. package/docs/pages/forms/overview.md +8 -0
  34. package/docs/pages/foundations/philosophy.md +32 -62
  35. package/docs/pages/foundations/theming.md +63 -26
  36. package/docs/pages/foundations/tokens.md +91 -159
  37. package/docs/pages/foundations/typography.md +3 -0
  38. package/docs/pages/guides/integrating-actual-css.md +1 -1
  39. package/docs/pages/guides/introduction.md +14 -14
  40. package/docs/pages/guides/modular-import.md +124 -0
  41. package/docs/pages/guides/upgrading.md +63 -0
  42. package/docs/pages/layout/choosing.md +10 -16
  43. package/docs/pages/layout/grid.md +8 -16
  44. package/docs/pages/patterns/intent-nesting.md +13 -1
  45. package/package.json +2 -2
  46. package/reserved-classes.json +3 -0
  47. package/src/css/components/accordion.css +7 -3
  48. package/src/css/components/alert.css +9 -1
  49. package/src/css/components/app-nav.css +2 -0
  50. package/src/css/components/badge.css +38 -11
  51. package/src/css/components/button.css +10 -2
  52. package/src/css/components/card.css +9 -0
  53. package/src/css/components/index.css +1 -0
  54. package/src/css/components/skeleton.css +11 -0
  55. package/src/css/components/tab.css +77 -0
  56. package/src/css/components/table.css +7 -1
  57. package/src/css/components/timeline.css +160 -0
  58. package/src/css/core/base.css +13 -2
  59. package/src/css/core/reset.css +5 -0
  60. package/src/css/core/theme.css +6 -1
  61. package/src/css/core/tokens.css +3 -3
  62. package/src/css/forms/choice-card.css +5 -2
  63. package/src/css/forms/control.css +12 -3
  64. package/src/css/forms/custom-select.css +1 -1
  65. package/src/css/typography/prose.css +4 -2
  66. package/src/tooling/design-tokens.js +2 -0
  67. package/src/tooling/theme-contrast.js +1 -1
@@ -4,7 +4,7 @@
4
4
 
5
5
  Use an `<ol>` because the order is part of the meaning. Add `.step-complete` to
6
6
  finished steps and `aria-current="step"` to the current one. Unmarked steps are
7
- upcoming.
7
+ upcoming. For a history of past events, use [Timeline](timeline.md).
8
8
 
9
9
  Orientation and labels are two independent choices.
10
10
 
@@ -139,23 +139,37 @@ names, or when a step should be navigable:
139
139
 
140
140
  ```html demo
141
141
  <ol class="steps steps-horizontal" aria-label="Checkout progress">
142
- <li class="step-complete"><span class="step-label">Account</span></li>
143
- <li class="step-complete"><span class="step-label">Profile</span></li>
144
- <li aria-current="step"><span class="step-label">Validation</span></li>
145
- <li><span class="step-label">Payment</span></li>
142
+ <li class="step-complete"><span class="step-label">Cart</span></li>
143
+ <li class="step-complete"><span class="step-label">Details</span></li>
144
+ <li aria-current="step"><span class="step-label">Review</span></li>
145
+ <li><span class="step-label">Pay</span></li>
146
146
  </ol>
147
147
  ```
148
148
 
149
149
  **Actual CSS never hides an authored step label.** Labels stay visible at every
150
150
  width. Stacked steps keep their markers evenly spaced, and long names wrap
151
- inside their share, hyphenated when the page declares a `lang`. The first and
152
- last steps align with the row's edges, labels included, so the track lines up
153
- with the heading above it. Short labels fit a phone with no width budget.
151
+ inside their share. The first and last steps align with the row's edges, labels
152
+ included, so the track lines up with the heading above it. Their labels get
153
+ half a share, so a phone-width row reads best with short names at both ends.
154
+
155
+ Automatic hyphenation depends on the browser, the language and its
156
+ dictionaries. Mark break points with `&shy;` (`Ac&shy;count`) when a long name
157
+ must wrap predictably.
154
158
 
155
159
  Set `--step-min` when names need a wider minimum share. If the markers or that
156
160
  minimum do not fit, the row scrolls; use `.steps-vertical` when every name must
157
161
  remain visible without horizontal scrolling.
158
162
 
163
+ ```html demo
164
+ <ol class="steps steps-horizontal scroller" style="--step-min: 7rem" aria-label="Order progress">
165
+ <li class="step-complete"><span class="step-label">Account</span></li>
166
+ <li class="step-complete"><span class="step-label">Shipping address</span></li>
167
+ <li aria-current="step"><span class="step-label">Payment method</span></li>
168
+ <li><span class="step-label">Review order</span></li>
169
+ <li><span class="step-label">Confirm</span></li>
170
+ </ol>
171
+ ```
172
+
159
173
  In supporting browsers, a row that scrolls starts on its `aria-current="step"`
160
174
  instead of step 1. A row
161
175
  that raises `--step-min` can scroll, so it is worth pairing with `.scroller`,
@@ -198,17 +212,17 @@ Resize the demo below. The 3-step flow needs less room than the supported
198
212
  ```html demo resize
199
213
  <div class="stack">
200
214
  <ol class="steps steps-horizontal container-query scroller" style="--step-complete-mark: '✓'">
201
- <li class="step-complete"><span class="step-label">Identification</span></li>
202
- <li aria-current="step"><span class="step-label">Confirmation</span></li>
203
- <li><span class="step-label">Finalisation</span></li>
215
+ <li class="step-complete"><span class="step-label">Account</span></li>
216
+ <li aria-current="step"><span class="step-label">Payment</span></li>
217
+ <li><span class="step-label">Confirm</span></li>
204
218
  </ol>
205
219
 
206
220
  <ol class="steps steps-horizontal container-query scroller" style="--step-complete-mark: '✓'">
207
- <li class="step-complete"><span class="step-label">Account</span></li>
208
- <li class="step-complete"><span class="step-label">Details</span></li>
209
- <li aria-current="step"><span class="step-label">Payment</span></li>
221
+ <li class="step-complete"><span class="step-label">Cart</span></li>
222
+ <li class="step-complete"><span class="step-label">Ship</span></li>
223
+ <li aria-current="step"><span class="step-label">Pay</span></li>
210
224
  <li><span class="step-label">Review</span></li>
211
- <li><span class="step-label">Confirm</span></li>
225
+ <li><span class="step-label">Done</span></li>
212
226
  </ol>
213
227
  </div>
214
228
  ```
@@ -334,7 +348,7 @@ label a link when the workflow genuinely allows navigation to that step:
334
348
  ```html demo resize
335
349
  <ol class="steps steps-horizontal container-query scroller">
336
350
  <li class="step-complete">
337
- <a class="step-label" href="#">Account</a>
351
+ <a class="step-label" href="#">Cart</a>
338
352
  </li>
339
353
  <li class="step-complete">
340
354
  <a class="step-label" href="#">Details</a>
@@ -343,7 +357,7 @@ label a link when the workflow genuinely allows navigation to that step:
343
357
  <span class="step-label">Payment</span>
344
358
  </li>
345
359
  <li>
346
- <span class="step-label">Confirm</span>
360
+ <span class="step-label">Done</span>
347
361
  </li>
348
362
  </ol>
349
363
  ```
@@ -141,3 +141,7 @@ a duplication.
141
141
 
142
142
  - `--table-cell-pad` — cell padding; `.compact` re-declares it tighter.
143
143
  - `--table-min` — minimum table width before `.table-wrap` scrolls horizontally.
144
+ - `--table-header-bg`, `--table-header-fg` — header band fill and ink. Set
145
+ them on a theme root rather than on `.table`: a data grid bridge reads the
146
+ same pair, so the table and the grid share one header (see the
147
+ [data grid template](../../demo/templates/data-grid.html)).
@@ -0,0 +1,111 @@
1
+ # Timeline
2
+
3
+ > Vertical history of dated events: activity feed, audit log, order tracking.
4
+
5
+ Use an `<ol>` of events, most recent first or oldest first. Each event gets a
6
+ dot on a rail; a direct `<time>` child is its dateline. The content is plain
7
+ HTML in block flow, so a sentence that mixes text and links stays one
8
+ sentence.
9
+
10
+ **Related terms:** activity feed, activity log, history, audit trail, event
11
+ log, changelog, order tracking.
12
+
13
+ For progress through a process (checkout, onboarding), use
14
+ [Steps](steps.md): a timeline records what happened, steps show where you
15
+ are. For a horizontal, alternating or time-scaled chronology, or a Gantt
16
+ chart, render a diagram: see [Diagrams](diagrams.md).
17
+
18
+ ## Basic usage
19
+
20
+ ```html demo
21
+ <ol class="timeline">
22
+ <li>
23
+ <time datetime="2026-10-18T09:30">Today, 09:30</time>
24
+ <strong>Appointment confirmed</strong>
25
+ <p class="muted">The patient received a confirmation email.</p>
26
+ </li>
27
+ <li>
28
+ <time datetime="2026-10-17T14:00">Yesterday, 14:00</time>
29
+ <strong>Appointment requested</strong>
30
+ <p class="muted">The booking was submitted online.</p>
31
+ </li>
32
+ <li>
33
+ <time datetime="2026-10-15">October 15</time>
34
+ <strong>Patient registered</strong>
35
+ </li>
36
+ </ol>
37
+ ```
38
+
39
+ The dot lines up with the first line of the event, whether it opens with the
40
+ `<time>` or with text. Block children drop their margins; wrap the content in
41
+ a [`.stack`](../layout/stack.md) when an event needs more spacing.
42
+
43
+ ## Intents
44
+
45
+ An intent class on the `<li>` colors its dot.
46
+
47
+ ```html demo
48
+ <ol class="timeline">
49
+ <li class="success">
50
+ <time datetime="2026-10-18">October 18</time>
51
+ Order delivered
52
+ </li>
53
+ <li class="warning">
54
+ <time datetime="2026-10-17">October 17</time>
55
+ Delivery delayed
56
+ </li>
57
+ <li class="primary">
58
+ <time datetime="2026-10-16">October 16</time>
59
+ Order shipped
60
+ </li>
61
+ </ol>
62
+ ```
63
+
64
+ The color is decoration: write the state in the text too.
65
+
66
+ ## Avatars and icons
67
+
68
+ An [`.avatar`](avatar.md) or an `aria-hidden` icon written first in the `<li>`
69
+ replaces the dot. One such event widens the rail for the whole list, so dots
70
+ and slots stay aligned. An icon sits in a disc colored by the event's intent.
71
+
72
+ ```html demo
73
+ <ol class="timeline">
74
+ <li>
75
+ <span class="avatar primary"><abbr>AM</abbr></span>
76
+ <time datetime="2026-10-18T09:30">Today, 09:30</time>
77
+ <a href="#">Ada Morgan</a> approved the security terms.
78
+ </li>
79
+ <li class="success">
80
+ <i class="ti ti-check" aria-hidden="true"></i>
81
+ <time datetime="2026-10-17">Yesterday</time>
82
+ Contract signed
83
+ </li>
84
+ <li>
85
+ <time datetime="2026-10-15">October 15</time>
86
+ Account created
87
+ </li>
88
+ </ol>
89
+ ```
90
+
91
+ ## Density
92
+
93
+ The gap between events follows the density context: `.compact` and
94
+ `.spacious` on the list or an ancestor tighten or loosen it.
95
+
96
+ ```html demo
97
+ <ol class="timeline compact">
98
+ <li><time datetime="2026-10-18">Today</time>Build passed</li>
99
+ <li><time datetime="2026-10-17">Yesterday</time>Build failed</li>
100
+ <li><time datetime="2026-10-16">October 16</time>Build passed</li>
101
+ </ol>
102
+ ```
103
+
104
+ ## Hooks
105
+
106
+ - `--timeline-dot-size` — dot diameter.
107
+ - `--timeline-slot-size` — avatar and icon diameter; the rail takes this width
108
+ as soon as one event has a slot.
109
+ - `--timeline-gap` — space between events; follows `--density-space`.
110
+ - `--timeline-inline-gap` — space between the rail and the content.
111
+ - `--timeline-line-size` — rail line thickness.
@@ -19,24 +19,19 @@ Actual drives the top layer itself. On every surface and tooltip its runtime
19
19
  manages, `surface.js` and `tooltip.js` own the `popover` attribute and both
20
20
  `showPopover()` and `hidePopover()`.
21
21
 
22
- On a managed element, an application must not:
22
+ On a managed element, leave `popover` and its native show/hide methods to the
23
+ runtime, and let `beforetoggle` proceed. To stop a surface from opening,
24
+ cancel `actual:surface-open`.
23
25
 
24
- - set or change `popover`. The runtime writes `manual` over any other value, because `popover="auto"` hands the browser a dismissal policy of its own that competes with `data-flyout-auto-close`.
25
- - call `showPopover()`, `hidePopover()`, or `togglePopover()`.
26
- - cancel its `beforetoggle`. Preventing an open leaves Actual's state saying open while the element is not in the top layer, and nothing repairs that — Actual owns the lifecycle rather than mediating it.
26
+ The runtime manages elements connected to these triggers:
27
27
 
28
- To stop a surface from opening, cancel Actual's own `actual:surface-open`
29
- instead. It is dispatched before anything is promoted, so cancelling it leaves
30
- no state behind.
28
+ - `data-enhance="flyout"`, pointing to the panel through `aria-controls`.
29
+ - `data-context-menu`, naming the menu.
30
+ - `data-tooltip`, pointing to the tooltip.
31
31
 
32
- **What counts as managed is the runtime's decision, not the attribute's.** A
33
- panel is managed when a `data-enhance="flyout"` trigger points at it through
34
- `aria-controls`, or when a `data-context-menu` target names it; a tooltip is
35
- managed when a `data-tooltip` trigger points at it. A `.flyout[popover]` or
36
- `.tooltip[popover]` that no such trigger reaches is never touched — Actual
37
- supplies its presentation and the application owns its lifecycle. That is the
38
- supported way to drive either class with `popovertarget` or a third-party
39
- lifecycle. Do not do both to the same element.
32
+ You can drive an unconnected `.flyout[popover]` or `.tooltip[popover]` with
33
+ `popovertarget` or a third-party library. Actual supplies its appearance;
34
+ your code owns opening and dismissal. Use one owner per element.
40
35
 
41
36
  ## Modules
42
37
 
@@ -53,11 +48,9 @@ Enhancer modules self-register when imported. They do not require init calls and
53
48
  are safe to import during server-side rendering: outside a browser, registration
54
49
  is a no-op until the module is loaded again with a DOM.
55
50
 
56
- Load the full bundle **or** the source modules, never both: each evaluation
57
- owns its registry and document handlers, so a dist bundle mixed with
58
- `actual-css/js/*` source subpaths (or two dist bundles) registers every
59
- behavior twice and a flyout opens then immediately closes. The second copy
60
- logs a console warning when it loads.
51
+ Load the full bundle **or** individual source modules. Mixing them, or loading
52
+ two bundles, registers behaviors twice and can make a flyout close immediately
53
+ after opening. The runtime warns in the console when a second copy loads.
61
54
 
62
55
  ## Component pages
63
56
 
@@ -15,15 +15,13 @@ runtime targets, empty by default.
15
15
  - Use it for transient status (`Saved.`, `Reconnected.`, `Copied.`). Critical, persistent, or actionable information belongs in `.alert`, inline messages, or dialogs.
16
16
  - Intents: `danger`, `success`, `warning`, `neutral`. The default (no intent) is a neutral dark pill.
17
17
  - On mobile, the runtime keeps the bar above the software keyboard by tracking `visualViewport` while a message is showing.
18
- - A message originating inside an open modal dialog temporarily moves the singleton bar into that dialog. A modal inerts the rest of the document, and being painted above it would not undo that — inertness is computed on the DOM — so the bar has to be in the dialog's subtree to be announced and seen. The bar returns to its original DOM position after its exit.
19
-
20
- Clearing is deferred, not immediate: the bar closes first and only empties its
21
- text and intent once the exit transition has finished, so it leaves at the size
22
- and color it was shown at. A new message during that exit wins — it cancels the
23
- pending cleanup instead of being wiped by it. Read the bar's content right after
24
- `clear()` and you still see the outgoing message; that is the contract, not a
25
- race. An empty message clears too, so `status(response.error)` on a successful
26
- response closes the bar rather than opening a blank pill.
18
+ - A message from an open modal dialog temporarily moves the bar inside that
19
+ dialog so it remains visible and announced. The bar returns after its exit.
20
+
21
+ `clear()` closes the bar, then removes its text and intent after the exit
22
+ transition. The outgoing message remains readable in the DOM until then.
23
+ A new message replaces it safely, even during exit. Passing an empty message
24
+ also clears the bar.
27
25
 
28
26
  The runtime auto-wires the status bar to Actual's form validation: a form that
29
27
  fails to submit shows its `data-validation-message` in the status bar with the
@@ -4,11 +4,13 @@
4
4
 
5
5
  ## Class reference
6
6
 
7
- | Class | Kind | Description |
8
- | ---------- | --------- | -------------------------------------------- |
9
- | `.tabs` | Component | Tab strip; pairs with `role="tablist"`. |
10
- | `.tab` | Component | One tab trigger; pairs with `role="tab"`. |
11
- | `.primary` | Intent | Tints the selected tab's indicator and text. |
7
+ | Class | Kind | Description |
8
+ | ---------------- | --------- | -------------------------------------------- |
9
+ | `.tabs` | Component | Tab strip; pairs with `role="tablist"`. |
10
+ | `.tab` | Component | One tab trigger; pairs with `role="tab"`. |
11
+ | `.primary` | Intent | Tints the selected tab's indicator and text. |
12
+ | `.tabs-attached` | Component | Joins a horizontal tablist to its panels. |
13
+ | `.tab-panel` | Part | Framed panel inside `.tabs-attached`. |
12
14
 
13
15
  ## Usage
14
16
 
@@ -25,10 +27,7 @@
25
27
  - A tab list needs both `.tabs` and `role="tablist"`; `.tab` styles each trigger.
26
28
  A tab belongs to its closest `role="tablist"`. `data-enhance="tabs"` on an
27
29
  element without that role wires nothing and warns in the console.
28
- - Naming follows the container/item convention (like `menu` / `menu-item`):
29
- `.tabs` is the strip, `.tab` is one trigger. The JS module
30
- (`actual-css/js/tab`) is named for the file; the behavior token
31
- (`data-enhance="tabs"`) is named for what it wires.
30
+ - Import `actual-css/js/tab` to register the `data-enhance="tabs"` behavior.
32
31
  - A `.tab` with an icon uses `--tab-gap` (default `0.375em`) for the space between icon and label.
33
32
  - A tab that is `hidden`, `disabled`, `aria-disabled`, or has no panel is skipped
34
33
  by the arrow keys. An application filtering a tab strip only has to set
@@ -89,6 +88,43 @@ JavaScript involved:
89
88
  </nav>
90
89
  ```
91
90
 
91
+ ## Attached panels
92
+
93
+ For attached tabs (folder tabs, connected or enclosed panels), wrap the
94
+ horizontal tablist and its panels as direct children of `.tabs-attached`.
95
+ Put `.tab` buttons directly in the strip and `.tab-panel` on each panel.
96
+ The selected tab and panel share one surface; selection uses the open edge
97
+ instead of an underline.
98
+ The selected tab uses the panel fill and text color; intent classes such as
99
+ `.primary` do not tint it. `.tab-panel` receives its frame only as a direct
100
+ child of `.tabs-attached`.
101
+ Keep the wrapper free of layout gaps and panel background overrides.
102
+
103
+ ```html demo
104
+ <div class="tabs-attached">
105
+ <div class="tabs" role="tablist" aria-label="Traffic" data-enhance="tabs">
106
+ <button class="tab" type="button" role="tab" id="traffic-overview-tab"
107
+ aria-selected="true" aria-controls="traffic-overview">Overview</button>
108
+ <button class="tab" type="button" role="tab" id="traffic-activity-tab"
109
+ aria-selected="false" aria-controls="traffic-activity" tabindex="-1">Activity</button>
110
+ </div>
111
+ <section class="tab-panel" role="tabpanel" id="traffic-overview"
112
+ aria-labelledby="traffic-overview-tab" tabindex="-1">
113
+ Traffic is up 12% week over week, led by organic search.
114
+ </section>
115
+ <section class="tab-panel" role="tabpanel" id="traffic-activity"
116
+ aria-labelledby="traffic-activity-tab" tabindex="-1" hidden>
117
+ Recent activity appears here.
118
+ </section>
119
+ </div>
120
+ ```
121
+
122
+ Set `--tab-panel-bg`, `--tab-panel-pad`, and `--tab-panel-shadow` on
123
+ `.tabs-attached` to customize the shared fill, panel padding and elevation.
124
+ The neo-brutalist demo theme supplies the panel shadow. Use ordinary `.tabs`
125
+ for vertical rails or navigation links; attached tabs are a horizontal panel
126
+ switcher. Long strips retain horizontal scrolling and keyboard navigation.
127
+
92
128
  ## Equal-width tabs
93
129
 
94
130
  To make a few tabs share the strip's width (full-width, fill), set
@@ -111,17 +147,16 @@ what fits on one row.
111
147
 
112
148
  ## Too many tabs
113
149
 
114
- A horizontal strip is one row and never wraps, nor does a label: a second line
115
- would not match the Left/Right keys and reads as a nested level. When the tabs
116
- do not fit (narrow screen, mobile, long translations), the strip scrolls
117
- horizontally without a scrollbar; in supporting browsers, the edges it can
118
- still scroll toward fade out. Selecting or focusing the tab clipped at the edge
119
- scrolls it into view with the next one peeking, so a click, the arrow keys or a
120
- swipe move along the strip. A tab selected in the markup starts in view too,
121
- when the strip is visible at connect; the placement moves the strip only, never
122
- the page. In supporting browsers, so does the current link tab (or flyout
123
- trigger), without the runtime; elsewhere the strip starts at its first tab. A
124
- vertical strip (`aria-orientation="vertical"`) keeps wrapping its labels.
150
+ Horizontal tabs and their labels stay on one line. When they do not fit, the
151
+ strip scrolls without a scrollbar. Supporting browsers fade the edges to show
152
+ where more tabs remain. Selecting or focusing a clipped tab brings it into view.
153
+
154
+ A tab selected in the markup starts in view if the strip is visible when the
155
+ runtime connects. Only the strip scrolls; the page stays put. Current link tabs
156
+ and flyout triggers also start in view in supporting browsers, without the
157
+ runtime; other browsers start at the first tab.
158
+
159
+ Vertical tabs (`aria-orientation="vertical"`) allow their labels to wrap.
125
160
 
126
161
  Scrolling is the fallback, not a responsive design. If a strip regularly
127
162
  overflows, shorten the labels, group sections, or switch to a vertical rail.
@@ -160,8 +195,11 @@ the current item of the strip. This is the only place a `.tab` takes `true`.
160
195
  Do not put a flyout trigger in a `role="tablist"`: a tablist holds only
161
196
  `role="tab"` items, and the arrow keys of the two widgets collide.
162
197
 
163
- ## CSS hooks
198
+ ### Hooks
164
199
 
165
200
  - `--tab-flex` — flex of each item; set `1 1 0` on the strip for equal-width tabs
166
201
  (fill the width). A strip that cannot fit its labels still scrolls.
167
202
  - `--tab-gap` — space between an icon and the label text (default `0.375em`).
203
+ - `--tab-panel-bg` — shared fill for the attached panel and selected tab.
204
+ - `--tab-panel-pad` — attached panel padding.
205
+ - `--tab-panel-shadow` — attached panel elevation; the strip casts no shadow.
@@ -28,25 +28,16 @@ positioning and with the projecting arrow, while leaving bare `[popover]`
28
28
  elements untouched. The lifecycle owner still writes `position`, the
29
29
  coordinates, and the arrow position; Actual only supplies the presentation.
30
30
 
31
- Do not combine them. `tooltip.js` writes `popover="manual"` on every tooltip it
32
- manages and calls `showPopover()` / `hidePopover()` itself, so a tooltip handed
33
- to the runtime has its mode overwritten. The runtime only ever reaches a
34
- tooltip that a `data-tooltip` trigger points at, so a `.tooltip[popover]` with
35
- no such trigger stays yours to drive. Use `data-tooltip` and the built-in
36
- runtime when Actual should own showing and hiding.
37
-
38
- **Where the element lives is part of the contract.** An explicit tooltip stays
39
- exactly where you wrote it, so it keeps every scope that reaches it by
40
- inheritance — a theme island, a density scope, your own scoped
41
- custom properties. It also means placement is yours to get right: a tooltip
42
- used from inside a modal dialog must be authored inside that dialog, because
43
- the top layer does not lift an element out of a modal's inertness.
44
-
45
- A generated tooltip (`data-tooltip="Help"`) is Actual's to place, and it goes
46
- at document level rather than beside the trigger, so it cannot disturb the
47
- trigger's structural position — a generated sibling would take
48
- `.join > :last-child` from a trigger that ends a group. It therefore makes no
49
- inheritance promise. Use the explicit form when the local CSS context matters.
31
+ Choose one lifecycle owner. Use `data-tooltip` when Actual should show and
32
+ hide the tooltip; the runtime sets `popover="manual"`. To manage a
33
+ `.tooltip[popover]` yourself, leave it unconnected to any `data-tooltip` trigger.
34
+
35
+ An explicit tooltip stays where you wrote it and inherits that location's
36
+ theme, density, and custom properties. Place it inside the dialog when its
37
+ trigger is in a modal dialog; content outside the modal is inert.
38
+
39
+ A generated tooltip (`data-tooltip="Help"`) does not inherit the trigger's
40
+ local CSS context. Use an explicit tooltip when that context matters.
50
41
 
51
42
  ```html demo
52
43
  <button class="btn ghost"
@@ -33,6 +33,7 @@ Whole pages, composed the way a real product would.
33
33
  - [Workspace settings](../../demo/templates/settings-pricing.html) - plans with visible native choices, preferences and segmented tabs
34
34
  - [iOS-style settings](../../demo/templates/settings-ios.html) - iOS-like controls and grouped settings from unchanged framework markup, a local theme, and its findings listed rule by rule
35
35
  - [Card compositions](../../demo/templates/card-compositions.html) - editorial, team, sign-in and horizontal cards composed from existing primitives
36
+ - [Neo-brutalist](../../demo/templates/neo-brutalist.html) - a risograph print studio on the `neo-brutalist` theme (order alerts, plus-marker FAQ, ruled testimonial grid, docked cookie banner) with the page loading its own fonts
36
37
  - [Register form](../../demo/templates/register-form.html) - registration page with choice cards, masks, the password toggle, `tel-prefix` validation, an OTP verification dialog, and status feedback
37
38
 
38
39
  ### Layout references
@@ -63,6 +64,8 @@ extension points.
63
64
  - [Data grid](../../demo/templates/data-grid.html) - an external data grid component themed with Actual tokens (sort, filter, search, selection)
64
65
  - [Combobox](../../demo/templates/combobox.html) - an external combobox themed with Actual tokens (search, tags, autocomplete)
65
66
  - [Date fields](../../demo/templates/date-fields.html) - a native date input, a masked text field and an external date picker on Actual tokens, side by side
67
+ - [File upload](../../demo/templates/file-upload.html) - the native file input, Dropzone rendering its file rows as Actual components, and FilePond on Actual tokens
68
+ - [Diagrams](../../demo/templates/diagrams.html) - Mermaid timelines, Gantt charts and flowcharts drawn by Pele through a small web component, on Actual tokens
66
69
 
67
70
  ## Sites
68
71
 
@@ -197,6 +197,9 @@ The dot is `::before`: a full-chip layer clipped to a `circle()` centred on
197
197
  the check slot (`--choice-chip-dot`). A theme can grow it into a selected fill
198
198
  by widening the clip, as the `material` theme does.
199
199
 
200
+ The check uses `--state-selected-text` when the theme sets it, including on
201
+ chips with an explicit intent. Otherwise it follows the chip's intent.
202
+
200
203
  ## CSS hooks
201
204
 
202
205
  - `--choice-card-pad` — inner padding.
@@ -16,15 +16,14 @@ properties onto Actual's tokens.
16
16
 
17
17
  The [combobox template](../../demo/templates/combobox.html) themes
18
18
  [`@lekoala/combobox`](https://github.com/lekoala/combobox) entirely with Actual
19
- tokens: the control mirrors `.input`, chips re-derive the `.badge` soft recipe,
20
- and the picker popover follows `--surface-raised` and `--shadow-popout`. No
21
- adapter, no compatibility layer — a handful of `--cb-*` assignments and shared
22
- mix tokens.
19
+ tokens: the control mirrors `.input`, chips are real `.badge` elements, and the
20
+ picker popover follows `--surface-raised` and `--shadow-popout`. No adapter, no
21
+ compatibility layer — a handful of `--cb-*` assignments and shared mix tokens.
23
22
 
24
23
  ```html
25
24
  <label class="field actual-combobox">
26
25
  <span class="field-label">Skills</span>
27
- <combo-box placeholder="Search or add a skill…">
26
+ <combo-box chip-class="badge primary" placeholder="Search or add a skill…">
28
27
  <select class="select" name="skills[]" multiple>
29
28
  <option value="design" selected>Design</option>
30
29
  <option value="css" selected>CSS</option>
@@ -34,6 +33,17 @@ mix tokens.
34
33
  </label>
35
34
  ```
36
35
 
36
+ `chip-class` hands the chip skin to the host classes, so badge variants and
37
+ theme rules on `.badge` apply; the widget keeps layout, removal and keyboard
38
+ focus. Set the default before creating comboboxes, after loading the CDN script:
39
+
40
+ ```js
41
+ customElements.get("combo-box").setDefaultChipClass("badge primary");
42
+ ```
43
+
44
+ With a bundler, use `Combobox.setDefaultChipClass("badge primary")`.
45
+ The `chip-class` attribute overrides the default for one element.
46
+
37
47
  The card in the template documents the full token map of this recipe.
38
48
 
39
49
  ## Bridge contract
@@ -60,14 +70,13 @@ contrast contracts apply to the combobox for free:
60
70
 
61
71
  ```css
62
72
  .actual-combobox {
63
- --cb-bg: var(--surface);
73
+ --cb-bg: var(--control-default-bg, var(--surface));
64
74
  --cb-color: var(--text);
65
75
  --cb-border-color: var(--form-invalid-border, var(--border));
66
76
  --cb-border-radius: var(--radius);
67
77
  --cb-focus-color: var(--focus);
68
78
  --cb-muted-color: var(--text-muted);
69
79
  --cb-error-color: var(--danger);
70
- --cb-chip-bg: transparent;
71
80
  --cb-control-height: var(--control-size);
72
81
  --cb-option-min-height: var(--control-size);
73
82
  }
@@ -76,7 +85,7 @@ contrast contracts apply to the combobox for free:
76
85
  border-color: var(--form-invalid-border, var(--cb-border-color));
77
86
  outline: var(--focus-ring-width) solid var(--form-invalid-border, var(--focus));
78
87
  outline-offset: calc(var(--focus-ring-width) * -1);
79
- box-shadow: none;
88
+ box-shadow: var(--control-shadow, none);
80
89
  }
81
90
 
82
91
  .actual-combobox :is(.cb-text-control[aria-invalid="true"], .cb-control:has([aria-invalid="true"])) {
@@ -88,27 +97,33 @@ contrast contracts apply to the combobox for free:
88
97
  }
89
98
 
90
99
  .actual-combobox :is(.cb-control, .cb-text-control) {
100
+ border-width: var(--border-width);
91
101
  border-radius: inherit;
102
+ box-shadow: var(--control-shadow, none);
92
103
  }
93
104
 
94
- .actual-combobox .cb-chip {
95
- border: var(--border-width) solid
96
- color-mix(in oklab, var(--primary) calc(100% - var(--soft-border-mix, 100%)), transparent);
97
- border-radius: var(--radius-full);
98
- background: color-mix(in oklab, var(--primary) calc(100% - var(--soft-bg-mix)), transparent);
99
- color: color-mix(in oklab, var(--primary) var(--soft-fg-mix), var(--text));
100
- font-size: var(--font-size-xs);
101
- font-weight: var(--font-weight-semibold);
105
+ .actual-combobox :is(.cb-control, .cb-text-control):hover {
106
+ border-color: var(--form-invalid-border, var(--control-hover-border, var(--text-subtle)));
102
107
  }
103
108
  ```
104
109
 
105
- While the search input is focused, the control takes the same inset outline as
106
- `.input` in place of the library's accent border and outer halo; a focused chip
110
+ The control reads the field geometry a theme gives `.input`: `--border-width`
111
+ and the `--control-shadow` elevation, which focus keeps. Hover follows `.input`
112
+ too (`--control-hover-border`), since the control is typed into, in place of
113
+ the library's own border mix. While the search input
114
+ is focused, the control takes the same inset outline as `.input` in place of
115
+ the library's accent border and outer halo; a focused chip
107
116
  or remove × keeps the library's own inner ring. Being inset, the outline needs
108
117
  no adaptation inside `.join`: `combo-box` owns the radius at zero specificity,
109
118
  so the join gives it the group corners and the visible control inherits them. The invalid rule sets `--form-invalid-border`,
110
119
  the hook `.field.danger` and `aria-invalid` already use, so border and outline
111
120
  turn danger together.
112
121
 
122
+ ### Limits
123
+
124
+ The bridge shares the inherited resting field fill through `--control-default-bg`.
125
+ It follows tokens, not native-control selectors: local `--control-bg` overrides
126
+ and theme-specific invalid or disabled fills need matching widget state rules.
127
+
113
128
  The same approach works for any widget that exposes a custom-property skin —
114
- keep the widget's behavior, restyle its tokens through the shared vocabulary.
129
+ keep the widget's behavior, restyle its tokens through the shared vocabulary.
@@ -33,3 +33,5 @@ The filename area stays muted.
33
33
  <span class="field-help" id="file-help">JPG, PNG or WebP — max 2 MB</span>
34
34
  </label>
35
35
  ```
36
+
37
+ For drag and drop, previews and upload progress, see [File upload](file-upload.md).