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
@@ -0,0 +1,160 @@
1
+ /*
2
+ * Timeline — a vertical history of dated events: activity feed, audit log,
3
+ * order tracking.
4
+ *
5
+ * Docs: docs/pages/components/timeline.md
6
+ *
7
+ * <ol class="timeline">
8
+ * <li class="success">
9
+ * <time datetime="2026-10-18T09:30">Today, 09:30</time>
10
+ * Appointment confirmed
11
+ * </li>
12
+ * </ol>
13
+ *
14
+ * Each event draws a dot on a rail; an intent class on the <li> colors it. An
15
+ * .avatar or an aria-hidden icon written first in the <li> takes the dot's
16
+ * place. A direct <time> child is the event's dateline. The content stays in
17
+ * block flow, so a sentence mixing text and links is never split into items.
18
+ *
19
+ * Progress through a process is .steps, not a timeline.
20
+ *
21
+ * Public hooks:
22
+ * --timeline-dot-size
23
+ * --timeline-slot-size
24
+ * --timeline-gap
25
+ * --timeline-inline-gap
26
+ * --timeline-line-size
27
+ *
28
+ * Internal:
29
+ * --timeline-rail-size
30
+ * --timeline-line-box
31
+ */
32
+
33
+ /* Registered so the event's line box computes to a length on the <li> and
34
+ inherits as one: an avatar slot sets its own font size and line-height, and
35
+ an unregistered em would resolve against those. Unregistered, the dot still
36
+ lines up and the slot drifts by the font difference.
37
+
38
+ The initial value must be computationally independent: a rem or em there
39
+ invalidates the whole @property rule, silently. Every <li> sets its own. */
40
+ @property --timeline-line-box {
41
+ syntax: "<length>";
42
+ inherits: true;
43
+ initial-value: 0px;
44
+ }
45
+
46
+ .timeline {
47
+ --timeline-dot-size: 0.625rem;
48
+ --timeline-slot-size: 1.75rem;
49
+ --timeline-gap: var(--density-space);
50
+ --timeline-inline-gap: var(--space-30);
51
+ --timeline-line-size: var(--border-width);
52
+ --timeline-rail-size: var(--timeline-dot-size);
53
+
54
+ display: grid;
55
+ /* A long URL or token in an event wraps instead of widening the list. */
56
+ grid-template-columns: minmax(0, 1fr);
57
+ /* A list stretched by its parent (a grid cell, an equal-height card) keeps
58
+ its rhythm instead of spreading the events over the extra height. */
59
+ align-content: start;
60
+ gap: var(--timeline-gap);
61
+ margin: 0;
62
+ padding: 0;
63
+ list-style: none;
64
+ }
65
+
66
+ /* One slotted event widens the rail of the whole list, so every line and every
67
+ text column stays aligned when dots and avatars mix. Without :has() the rail
68
+ keeps the dot's width and a slot shrinks to it: the degraded list stays
69
+ aligned and readable, with a dot-sized avatar. */
70
+ .timeline:has(> li > :is(.avatar, [aria-hidden="true"]):first-child) {
71
+ --timeline-rail-size: var(--timeline-slot-size);
72
+ }
73
+
74
+ /* The line box is a length, not the unitless ratio: a smaller <time> opening
75
+ the event keeps the same first line as text would, so the marker centred on
76
+ it lines up whichever element comes first. */
77
+ .timeline > li {
78
+ --timeline-line-box: calc(var(--line-height) * 1em);
79
+
80
+ position: relative;
81
+ padding-inline-start: calc(var(--timeline-rail-size) + var(--timeline-inline-gap));
82
+ line-height: var(--timeline-line-box);
83
+ }
84
+
85
+ /* The event owns no rhythm beyond its dateline: block children drop their own
86
+ margins, and an author who needs more spacing composes a .stack inside. */
87
+ .timeline > li > * {
88
+ margin-block: 0;
89
+ }
90
+
91
+ .timeline > li > time {
92
+ display: block;
93
+ color: var(--text-muted);
94
+ font-size: var(--font-size-sm);
95
+ }
96
+
97
+ .timeline > li::before {
98
+ content: "";
99
+ position: absolute;
100
+ inset-block-start: calc((var(--timeline-line-box) - var(--timeline-dot-size)) / 2);
101
+ inset-inline-start: calc((var(--timeline-rail-size) - var(--timeline-dot-size)) / 2);
102
+ inline-size: var(--timeline-dot-size);
103
+ block-size: var(--timeline-dot-size);
104
+ border-radius: var(--radius-full);
105
+ background: var(--intent, var(--neutral));
106
+ }
107
+
108
+ /* Stated as an undo, not as `:not(:has(...))` on the dot rule: an engine
109
+ without :has() would drop that whole rule and lose every dot, where this way
110
+ it only keeps a dot under the slot. */
111
+ .timeline > li:has(> :is(.avatar, [aria-hidden="true"]):first-child)::before {
112
+ content: none;
113
+ }
114
+
115
+ /* The segment clears each marker by half the rail, so it never shows through
116
+ a translucent avatar fill, and a dot in a list widened by a slot keeps the
117
+ slot's clearance. A border rather than a background: forced colors keep a
118
+ border and wipe a background. */
119
+ .timeline > li:not(:last-child)::after {
120
+ content: "";
121
+ position: absolute;
122
+ inset-block-start: calc((var(--timeline-line-box) + var(--timeline-rail-size)) / 2);
123
+ inset-inline-start: calc((var(--timeline-rail-size) - var(--timeline-line-size)) / 2);
124
+ block-size: calc(100% + var(--timeline-gap) - var(--timeline-rail-size));
125
+ border-inline-start: var(--timeline-line-size) solid var(--border);
126
+ }
127
+
128
+ .timeline > li > :is(.avatar, [aria-hidden="true"]):first-child {
129
+ --avatar-size: var(--timeline-rail-size);
130
+
131
+ position: absolute;
132
+ inset-block-start: calc((var(--timeline-line-box) - var(--timeline-rail-size)) / 2);
133
+ inset-inline-start: 0;
134
+ }
135
+
136
+ /* An icon slot gets a disc of the avatar's size, so both slot kinds read as one
137
+ rail. The event's intent colors the glyph. */
138
+ .timeline > li > [aria-hidden="true"]:first-child:not(.avatar) {
139
+ display: grid;
140
+ place-items: center;
141
+ inline-size: var(--timeline-rail-size);
142
+ block-size: var(--timeline-rail-size);
143
+ border: var(--border-width) solid var(--border);
144
+ border-radius: var(--radius-full);
145
+ background: var(--surface-opaque);
146
+ color: var(--intent, var(--text-muted));
147
+ font-size: var(--font-size-sm);
148
+ line-height: 1;
149
+ }
150
+
151
+ .timeline > li > [aria-hidden="true"]:first-child:not(.avatar) > svg {
152
+ inline-size: 1em;
153
+ block-size: 1em;
154
+ }
155
+
156
+ @media (forced-colors: active) {
157
+ .timeline > li::before {
158
+ background: CanvasText;
159
+ }
160
+ }
@@ -22,14 +22,23 @@ body {
22
22
  opts in by setting --link. Because this is an element selector, any component
23
23
  rule that colors its own anchors still wins. */
24
24
  a {
25
- color: var(--link, inherit);
25
+ color: var(--surface-link, var(--link, inherit));
26
26
  text-underline-offset: 0.18em;
27
27
  }
28
28
 
29
- a:hover {
29
+ /* :active stands in for the native tap highlight the reset removes. */
30
+ a:is(:hover, :active) {
30
31
  text-decoration-thickness: 0.12em;
31
32
  }
32
33
 
34
+ /* Bare text links get back the tap flash the reset removes: a text link has
35
+ no pressed state of its own. Tinted from the link ink so it reads on any
36
+ surface. Zero specificity so a component styling classless anchors (an
37
+ .app-nav tile) can opt out with transparent. */
38
+ :where(a[href]:not([class])) {
39
+ -webkit-tap-highlight-color: color-mix(in oklab, currentColor 18%, transparent);
40
+ }
41
+
33
42
  /* Global heading chrome: color (--heading or inherit), a tight line-height,
34
43
  and progressive text-wrap. No font-size or font-weight is set globally —
35
44
  components and .prose own the per-context scale. */
@@ -91,4 +100,6 @@ small {
91
100
  ::selection {
92
101
  background: var(--selection-bg, var(--primary));
93
102
  color: var(--selection-fg, var(--primary-fg));
103
+ /* SVG text paints with fill, including labels with an explicit fill. */
104
+ fill: currentColor;
94
105
  }
@@ -7,6 +7,11 @@
7
7
 
8
8
  html {
9
9
  -webkit-text-size-adjust: 100%;
10
+ /* The native tap highlight is a rectangle that ignores border-radius and
11
+ custom surfaces; components use their own interaction states where
12
+ relevant. Inherited, so one declaration covers every element; base.css
13
+ restores a tinted flash on bare text links. */
14
+ -webkit-tap-highlight-color: transparent;
10
15
  }
11
16
 
12
17
  body {
@@ -10,7 +10,7 @@
10
10
  * Exception: --surface-opaque and --surface-solid-fg are public; a theme with
11
11
  * translucent surfaces overrides them with opaque values. --border-control is
12
12
  * public too: the resting edge of a neutral control, apart from structural
13
- * separators.
13
+ * separators. --control-default-bg is the inherited resting field fill.
14
14
  * Internal: --hgroup-gap.
15
15
  */
16
16
  :root {
@@ -103,6 +103,8 @@
103
103
  their own tokens instead of inheriting :root's resolved values. */
104
104
  :root,
105
105
  [data-theme] {
106
+ /* A painted parent's link context must not cross into a new palette. */
107
+ --surface-link: initial;
106
108
  --heading: var(--text);
107
109
  --selection-bg: var(--primary);
108
110
  --selection-fg: var(--primary-fg);
@@ -115,6 +117,9 @@
115
117
  /* The edge that tells a control apart from the surface, where --border only
116
118
  separates surfaces: fields, choices, switch, OTP cells, choice cards. */
117
119
  --border-control: var(--border);
120
+ /* Inherited resting field fill, shared with external control bridges.
121
+ Component state rules still own readonly, disabled and invalid fills. */
122
+ --control-default-bg: var(--surface);
118
123
  }
119
124
 
120
125
  /* Soft foreground hooks — the soft ink is the intent rebated toward the local
@@ -125,14 +125,14 @@
125
125
  Like --control-size, it is a scale plus a selection: themes set the
126
126
  -sm/-md/-lg steps, and :root, .sm/.lg and .compact/.spacious (variants.css)
127
127
  pick one. A theme that wrote --control-pad-x itself would be overwritten
128
- by every size and density boundary — bootstrap-v6's 12px became a wider
129
- 13px inside .compact. The selection is rebound at each boundary because a
128
+ by every size and density boundary — a theme's 12px became a wider 13px
129
+ inside .compact. The selection is rebound at each boundary because a
130
130
  var() inside a custom property resolves where it is declared.
131
131
 
132
132
  The boundaries also write --control-step-sm/-md/-lg: which step is
133
133
  selected, as 0/1 weights that mean the same under every theme. A theme
134
134
  that sets its own steps rebuilds the selection from them in its own block
135
- (bootstrap-v6.css), so a nested island of it reads its steps without
135
+ (docs: Tokens · Controls), so a nested island of it reads its steps without
136
136
  resetting the density it sits in. Never rebind on every [data-theme]: a
137
137
  palette-only island then became a geometry boundary that an inherited
138
138
  --control-size or --control-pad-x no longer crossed. */
@@ -225,14 +225,17 @@
225
225
  clip-path: circle(0 at var(--choice-chip-dot));
226
226
  }
227
227
 
228
- /* The check keeps the card's scale-in, in flow ahead of the label. */
228
+ /* The check keeps the card's scale-in, in flow ahead of the label. It is ink
229
+ on the chip, not a fill: a theme whose selected fill cannot be text (a
230
+ yellow or lime accent) lends its selected ink here, as for tabs and steps.
231
+ It outranks explicit intents too: their pastel fills are still not ink. */
229
232
  .choice-card.chip::after {
230
233
  order: -1;
231
234
  flex: none;
232
235
  align-self: center;
233
236
  margin-block: 0;
234
237
  margin-inline: 0 0.375em;
235
- background: var(--intent, var(--state-selected));
238
+ background: var(--state-selected-text, var(--intent, var(--state-selected)));
236
239
  -webkit-mask-size: contain;
237
240
  mask-size: contain;
238
241
  }
@@ -20,8 +20,10 @@
20
20
  * Public hooks:
21
21
  * --control-border
22
22
  * --control-bg
23
+ * --control-default-bg
23
24
  * --control-fg
24
25
  * --control-cursor
26
+ * --control-shadow
25
27
  * --control-border-block-end-color
26
28
  * --control-border-block-end-width
27
29
  * --control-hover-border (input and textarea)
@@ -31,7 +33,7 @@
31
33
  .textarea,
32
34
  .select {
33
35
  --control-border: var(--border-control);
34
- --control-bg: var(--surface);
36
+ --control-bg: var(--control-default-bg, var(--surface));
35
37
  --control-fg: var(--text);
36
38
  --control-cursor: auto;
37
39
 
@@ -49,6 +51,11 @@
49
51
  border-radius: var(--radius);
50
52
  background: var(--control-bg);
51
53
  color: var(--control-fg);
54
+ /* why: an unset hook, so a theme can give every field a resting elevation
55
+ that focus keeps (see the focus rule). The fallback is none, the same as
56
+ the focus rule's: a transparent 0 0 shadow here made focus transition
57
+ between two values and expose a phantom shadow mid-way. */
58
+ box-shadow: var(--control-shadow, none);
52
59
  font-size: var(--control-font-size);
53
60
  cursor: var(--control-cursor);
54
61
  /* No outline: none here — the core :focus fallback must survive for browsers
@@ -81,13 +88,15 @@
81
88
  the control's border box (any smaller offset bleeds outward), so it covers
82
89
  the border, never touches a .join neighbour or a scrollport edge, and needs
83
90
  no group treatment. Width follows --focus-ring-width, including its
84
- prefers-contrast step. Border = shape and validation, outline = focus. */
91
+ prefers-contrast step. Border = shape and validation, outline = focus.
92
+ The box-shadow reset drops any halo but keeps the field's own elevation:
93
+ a plain none erased --control-shadow on keyboard focus. */
85
94
  .input:focus-visible:not(:disabled),
86
95
  .textarea:focus-visible:not(:disabled),
87
96
  .select:focus-visible:not(:disabled) {
88
97
  outline: var(--focus-ring-width) solid var(--form-invalid-border, var(--focus));
89
98
  outline-offset: calc(var(--focus-ring-width) * -1);
90
- box-shadow: none;
99
+ box-shadow: var(--control-shadow, none);
91
100
  }
92
101
 
93
102
  .input[readonly],
@@ -38,7 +38,7 @@
38
38
  --control-bg: var(--surface-raised);
39
39
  outline: var(--focus-ring-width) solid var(--form-invalid-border, var(--focus));
40
40
  outline-offset: calc(var(--focus-ring-width) * -1);
41
- box-shadow: none;
41
+ box-shadow: var(--control-shadow, none);
42
42
  }
43
43
 
44
44
  &::picker-icon {
@@ -88,7 +88,7 @@
88
88
  /* --link is a theme-level token (core/base.css also reads it for bare links);
89
89
  prose falls back to --primary so a theme that never sets it is unaffected. */
90
90
  .prose :where(a) {
91
- color: var(--link, var(--primary));
91
+ color: var(--surface-link, var(--link, var(--primary)));
92
92
  text-decoration-line: underline;
93
93
  text-decoration-thickness: 0.08em;
94
94
  text-underline-offset: 0.18em;
@@ -100,7 +100,9 @@
100
100
 
101
101
  @supports (color: color-mix(in oklch, red, white)) {
102
102
  .prose :where(a:hover, a:focus-visible) {
103
- color: color-mix(in oklab, var(--link, var(--primary)), var(--text) 15%);
103
+ /* A solid surface owns its contrast pair in every state; mixing in the
104
+ page's --text would pull its links toward the wrong background. */
105
+ color: var(--surface-link, color-mix(in oklab, var(--link, var(--primary)), var(--text) 15%));
104
106
  }
105
107
  }
106
108
 
@@ -44,6 +44,7 @@ export const THEME_COLORS = [
44
44
  "heading",
45
45
  "border",
46
46
  "border-control",
47
+ "control-default-bg",
47
48
  "focus",
48
49
  "hover-overlay",
49
50
  "hover-overlay-solid",
@@ -101,6 +102,7 @@ export const FOUNDATIONS = {
101
102
  listed here (tests/design-tokens.test.js), so a new token cannot silently
102
103
  stay out of the design tools. */
103
104
  export const NOT_EXPORTED = {
105
+ "internal surface context, not a palette color": ["surface-link"],
104
106
  "internal 0/1 weights selecting a control step; the steps are exported": [
105
107
  "control-step-sm",
106
108
  "control-step-md",
@@ -37,7 +37,7 @@ export const INTENTS = ["primary", "secondary", "success", "warning", "danger",
37
37
  export const SURFACES = ["surface", "surface-raised", "surface-subtle"];
38
38
 
39
39
  /* Badges state .soft explicitly: a theme may fill badges by default
40
- (bootstrap-v6), which would measure a solid pair against the soft hover.
40
+ by a local rule, which would measure a solid pair against the soft hover.
41
41
  The theme name is read from a file by a regex, so it never enters this
42
42
  markup: measureContrast() sets it through dataset. `scheme` is only ever
43
43
  "light" or "dark". */