@bwui/css 0.1.3 → 0.1.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bwui/css",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Framework-agnostic Brickwork primitives and component classes. Consumes @bwui/tokens and works with plain HTML, Django, or any framework — no JavaScript required.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "./src/*": "./src/*"
22
22
  },
23
23
  "dependencies": {
24
- "@bwui/tokens": "0.1.3"
24
+ "@bwui/tokens": "0.1.5"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsx": "^4.19.2"
@@ -34,6 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "scripts": {
37
- "build": "tsx scripts/build.ts"
37
+ "build": "tsx scripts/build.ts",
38
+ "test": "node --test \"test/*.test.mjs\""
38
39
  }
39
40
  }
@@ -36,13 +36,13 @@
36
36
  pointer-events: none;
37
37
  }
38
38
 
39
- .bw-btn--sm {
39
+ .bw-btn--sm, .bw-btn--size-sm {
40
40
  height: 2rem;
41
41
  padding: 0 0.75rem;
42
42
  font-size: var(--bw-typography-body-sm-size);
43
43
  }
44
44
 
45
- .bw-btn--lg {
45
+ .bw-btn--lg, .bw-btn--size-lg {
46
46
  height: 3rem;
47
47
  padding: 0 1.5rem;
48
48
  font-size: var(--bw-typography-body-lg-size);
@@ -14,13 +14,21 @@
14
14
  color-scheme: dark;
15
15
  }
16
16
 
17
- input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
18
- [type="file"]
19
- ):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
20
- [type="reset"]
21
- ):not([type="image"]):not([type="color"]),
22
- textarea,
23
- select {
17
+ /* Zero specificity on purpose (icvoss/brickwork#25): this is a fallback for
18
+ * unstyled native controls. As a bare selector its seven :not() terms scored
19
+ * about (0,7,1) and outranked .bw-input:disabled and .bw-input[readonly]
20
+ * (0,2,0), so disabled and read-only inputs kept the enabled fill and ink.
21
+ * :where() keeps the repair for plain controls and lets every component rule
22
+ * win. */
23
+ :where(
24
+ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
25
+ [type="file"]
26
+ ):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
27
+ [type="reset"]
28
+ ):not([type="image"]):not([type="color"]),
29
+ textarea,
30
+ select
31
+ ) {
24
32
  background-color: var(--bw-color-surface);
25
33
  color: var(--bw-color-fg);
26
34
  }
@@ -2,16 +2,32 @@
2
2
  * Logical CSS properties throughout (RTL via `dir`). Nothing here needs JS.
3
3
  */
4
4
 
5
- /* --- Buttons --------------------------------------------------------------- */
5
+ /* --- Buttons (docs/components/button.md) ----------------------------------- */
6
+
7
+ /* Operable guard. A state rule (hover, press) applies only to a control that is
8
+ * operable and not busy: not the .bw-btn--disabled class (the non-button
9
+ * elements), not :disabled (a real <button>), not aria-disabled, not
10
+ * aria-busy. :not() takes the specificity of its most specific argument, so
11
+ * the guard weighs the same as the single :not(.bw-btn--disabled) it replaces
12
+ * and no existing cascade relationship moves. The resting shadow rules use a
13
+ * narrower guard (not disabled, but a busy control keeps its resting shadow).
14
+ * Before this guard a disabled or loading <button> still took the hover fill,
15
+ * ring and (for ghost) the full ink: .bw-btn:disabled weighs 0,2,0 and the
16
+ * hover rules weighed 0,3,0 (GAP-BTN-1). */
6
17
 
7
18
  .bw-btn {
8
19
  display: inline-flex;
9
20
  align-items: center;
10
21
  justify-content: center;
11
- gap: var(--bw-space-2);
22
+ /* ADR-126 section 4: the button reads only the four control role variables.
23
+ * They are declared on :root and in every [data-density] block (md at the
24
+ * density in force) and are inherited here, so a bare .bw-btn is md, a size
25
+ * class re-points them, and a control container can set one step for its
26
+ * children. The button never reads a density or step token itself. */
27
+ gap: var(--bw-control-gap);
12
28
  padding-block: 0;
13
- padding-inline: var(--bw-density-control-padding-inline);
14
- block-size: var(--bw-density-control-height);
29
+ padding-inline: var(--bw-control-padding-inline);
30
+ block-size: var(--bw-control-height);
15
31
  border: var(--bw-size-border-hairline) solid transparent;
16
32
  border-radius: var(--bw-component-button-radius);
17
33
  font: inherit;
@@ -20,6 +36,9 @@
20
36
  font-weight: var(--bw-text-label-weight);
21
37
  line-height: var(--bw-text-label-line-height);
22
38
  letter-spacing: var(--bw-text-label-tracking);
39
+ /* One line, always (BTN-014): the block size is fixed, so a wrapped label
40
+ * would spill out of the control (GAP-BTN-4). */
41
+ white-space: nowrap;
23
42
  cursor: pointer;
24
43
  text-decoration: none;
25
44
  transition:
@@ -27,37 +46,83 @@
27
46
  var(--bw-transition-shadow),
28
47
  var(--bw-transition-transform);
29
48
  }
30
- .bw-btn--sm {
31
- block-size: var(--bw-size-control-height-sm);
32
- padding-inline: var(--bw-space-2);
49
+ /* The reset underlines every a:hover (0,1,1), which outweighs the 0,1,0 above,
50
+ * so a link-button underlined on hover (GAP-BTN-2). */
51
+ .bw-btn:hover {
52
+ text-decoration: none;
33
53
  }
34
- /* md is the base .bw-btn size (icvoss/django-brickwork#130): every shipped
35
- * template that names a size emits bw-btn--md explicitly rather than leaving
36
- * it implicit, so the class needs its own rule even though it restates the
37
- * base values, exactly as .bw-btn--sm and .bw-btn--lg restate theirs relative
38
- * to the base. Without this rule the class existed in markup with nothing in
39
- * the stylesheet naming it, which is the defect class this issue is about:
40
- * the base values happened to make it look correct by accident. */
41
- .bw-btn--md {
42
- block-size: var(--bw-density-control-height);
43
- padding-inline: var(--bw-density-control-padding-inline);
54
+ /* Size classes (ADR-125 section 6, ADR-126 section 4): the grammar is
55
+ * bw-<component>--size-<step>, and a size class only re-points the four control
56
+ * role variables at the resolved step tokens. The step tokens are the density
57
+ * control base times the kit-wide multiplier (--bw-size-step-*), so every
58
+ * density keeps three distinct heights; no rule here computes a multiplier.
59
+ * xs and xl exist in the token scale and Button does not ship them (BTN-003).
60
+ *
61
+ * The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
62
+ * slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
63
+ * one grouped rule for the deprecation window; the bare ones are removed in
64
+ * the next major of django-brickwork and in the @bwui/css release shipped with
65
+ * it. Templates, React, Vue and the gallery emit the new class.
66
+ *
67
+ * md has its own rule (icvoss/django-brickwork#130) so the class that markup
68
+ * emits is named in the stylesheet, and so a button that names md keeps md
69
+ * inside a container that scoped a different step. */
70
+ .bw-btn--sm, .bw-btn--size-sm {
71
+ --bw-control-height: var(--bw-size-control-height-sm);
72
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
73
+ --bw-control-icon-size: var(--bw-size-control-icon-sm);
74
+ --bw-control-gap: var(--bw-size-control-gap-sm);
75
+ }
76
+ .bw-btn--md, .bw-btn--size-md {
77
+ --bw-control-height: var(--bw-size-control-height-md);
78
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
79
+ --bw-control-icon-size: var(--bw-size-control-icon-md);
80
+ --bw-control-gap: var(--bw-size-control-gap-md);
81
+ }
82
+ .bw-btn--lg, .bw-btn--size-lg {
83
+ --bw-control-height: var(--bw-size-control-height-lg);
84
+ --bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
85
+ --bw-control-icon-size: var(--bw-size-control-icon-lg);
86
+ --bw-control-gap: var(--bw-size-control-gap-lg);
87
+ }
88
+ /* The glyph and the label are one line of content. The icon is a bw-icon, and
89
+ * a bare .bw-icon (wave-e) paints a raised box and a muted ink, which showed
90
+ * as a white square and a grey glyph on a primary button (GAP-BTN-3). Inside
91
+ * a button the icon is a plain glyph in the button's own ink. Two classes
92
+ * outrank .bw-icon whatever the layer order. */
93
+ .bw-btn .bw-btn__icon {
94
+ background: transparent;
95
+ border-radius: 0;
96
+ color: inherit;
44
97
  }
45
- .bw-btn--lg {
46
- block-size: var(--bw-size-control-height-lg);
47
- padding-inline: var(--bw-space-4);
98
+ /* The glyph and the busy spinner follow the control's step through the role
99
+ * variable (ADR-125 section 5: an icon inside a control follows its step). The
100
+ * box is set directly, not through --bw-icon-size, because {% bw_icon %} writes
101
+ * that custom property inline and an inline declaration would outrank this
102
+ * rule. Markup in a button carries no inline size. */
103
+ .bw-btn .bw-btn__icon,
104
+ .bw-btn .bw-spinner {
105
+ inline-size: var(--bw-control-icon-size);
106
+ block-size: var(--bw-control-icon-size);
48
107
  }
49
108
  /* Solid buttons carry a border in their own hue (0.7.0 craft): 80% of the fill
50
109
  * toward black is the Radix solid-button edge, a shade the fill visibly sits
51
110
  * inside (decorative against the fill at 1.59:1 light / 1.73:1 dark; it also
52
111
  * defines the button against the surface at 8.10:1 / 4.12:1 for primary and
53
112
  * 7.74:1 / 3.00:1 for danger). The edge deliberately outlives hover: the
54
- * hover fill (89% toward black) stays lighter than the 80% edge. */
55
- .bw-btn--primary {
113
+ * hover fill (89% toward black) stays lighter than the 80% edge.
114
+ *
115
+ * .bw-btn--solid is the early-draft name of primary. It is DEPRECATED, kept
116
+ * here as an alias through :is() (class weight) for the window ADR-125 sets
117
+ * for the bare size classes, and removed with them. Its old standalone rule
118
+ * read --bw-color-accent-fg, which is not a token, so it needed a per-page
119
+ * shim (GAP-BTN-6). */
120
+ :is(.bw-btn--primary, .bw-btn--solid) {
56
121
  background: var(--bw-color-accent);
57
122
  color: var(--bw-color-fg-on-accent);
58
123
  border-color: color-mix(in oklab, var(--bw-color-accent) 80%, black);
59
124
  }
60
- .bw-btn--primary:not(.bw-btn--disabled):hover {
125
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
61
126
  background: var(--bw-color-accent-hover);
62
127
  box-shadow: var(--bw-component-button-elevation-hover), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
63
128
  transform: translateY(var(--bw-component-button-hover-translate));
@@ -71,10 +136,10 @@
71
136
  color: var(--bw-color-fg);
72
137
  border-color: var(--bw-color-border);
73
138
  }
74
- .bw-btn--secondary:not(.bw-btn--disabled) {
139
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])) {
75
140
  box-shadow: var(--bw-component-button-elevation);
76
141
  }
77
- .bw-btn--secondary:not(.bw-btn--disabled):hover {
142
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
78
143
  border-color: var(--bw-color-border-strong);
79
144
  background-color: var(--bw-color-surface-sunken);
80
145
  box-shadow: var(--bw-component-button-elevation-hover);
@@ -86,7 +151,7 @@
86
151
  * weight; steps up to full fg on hover. */
87
152
  color: var(--bw-color-fg-muted);
88
153
  }
89
- .bw-btn--ghost:not(.bw-btn--disabled):hover {
154
+ .bw-btn--ghost:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
90
155
  background-color: var(--bw-state-hover-overlay);
91
156
  color: var(--bw-color-fg);
92
157
  }
@@ -96,7 +161,7 @@
96
161
  /* Same 80%-toward-black edge as primary, in the danger hue (ratios above). */
97
162
  border-color: color-mix(in oklab, var(--bw-color-danger) 80%, black);
98
163
  }
99
- .bw-btn--danger:not(.bw-btn--disabled):hover {
164
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
100
165
  background-image: linear-gradient(var(--bw-state-hover-overlay), var(--bw-state-hover-overlay));
101
166
  box-shadow: var(--bw-component-button-elevation-hover), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
102
167
  transform: translateY(var(--bw-component-button-hover-translate));
@@ -104,12 +169,12 @@
104
169
  /* Filled action buttons carry physical weight: resting elevation plus a faint
105
170
  * top bevel; pressing swaps to an inset shadow so the button visibly sinks.
106
171
  * Elevation is the per-button token (#649); the inset highlight is craft. */
107
- .bw-btn--primary:not(.bw-btn--disabled),
108
- .bw-btn--danger:not(.bw-btn--disabled) {
172
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])),
173
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled:not([aria-busy="true"]), [aria-disabled="true"]:not([aria-busy="true"])) {
109
174
  box-shadow: var(--bw-component-button-elevation), inset 0 1px 0 0 oklch(1 0 0 / 0.12);
110
175
  }
111
- .bw-btn--primary:not(.bw-btn--disabled):active,
112
- .bw-btn--danger:not(.bw-btn--disabled):active {
176
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active,
177
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active {
113
178
  box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.2);
114
179
  transform: none;
115
180
  }
@@ -118,12 +183,12 @@
118
183
  * hovers so it wins the background-image cascade; instant so the press reads
119
184
  * immediately. Ghost is excluded (its states are solid overlay fills, so a
120
185
  * stacked image would double the tint) and gets its own solid active fill. */
121
- .bw-btn:not(.bw-btn--disabled):not(.bw-btn--ghost):active {
186
+ .bw-btn:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):not(.bw-btn--ghost):active {
122
187
  background-image: linear-gradient(var(--bw-state-active-overlay), var(--bw-state-active-overlay));
123
188
  transition-duration: var(--bw-duration-instant);
124
189
  transform: none;
125
190
  }
126
- .bw-btn--ghost:not(.bw-btn--disabled):active {
191
+ .bw-btn--ghost:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):active {
127
192
  background-color: var(--bw-state-active-overlay);
128
193
  background-image: none;
129
194
  transition-duration: var(--bw-duration-instant);
@@ -131,28 +196,36 @@
131
196
  /* Hover-lift is opt-in via --bw-component-button-hover-translate (#649).
132
197
  * Prefer no transform when the user asks for reduced motion. */
133
198
  @media (prefers-reduced-motion: reduce) {
134
- .bw-btn--primary:not(.bw-btn--disabled):hover,
135
- .bw-btn--secondary:not(.bw-btn--disabled):hover,
136
- .bw-btn--danger:not(.bw-btn--disabled):hover {
199
+ :is(.bw-btn--primary, .bw-btn--solid):not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover,
200
+ .bw-btn--secondary:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover,
201
+ .bw-btn--danger:not(.bw-btn--disabled, :disabled, [aria-disabled="true"], [aria-busy="true"]):hover {
137
202
  transform: none;
138
203
  }
139
204
  }
140
205
  .bw-btn--icon-only {
141
- inline-size: var(--bw-density-control-height);
206
+ inline-size: var(--bw-control-height);
142
207
  padding-inline: 0;
143
208
  }
144
- /* Exact square at every size (0.7.0 craft): the sm/lg heights bring their own
145
- * widths, so an icon button's optical padding is identical on all four sides. */
146
- .bw-btn--sm.bw-btn--icon-only {
147
- inline-size: var(--bw-size-control-height-sm);
148
- }
149
- .bw-btn--lg.bw-btn--icon-only {
150
- inline-size: var(--bw-size-control-height-lg);
209
+ /* Exact square at every size (0.7.0 craft): the role variable carries the
210
+ * step's height, so the optical padding is identical on all four sides with no
211
+ * per-size rule. */
212
+ /* fit (ADR-126 section 3): auto is the default and emits no class; fill takes
213
+ * the width of its container. After the icon-only rule so the two never fight.
214
+ * Django and React reject fit="fill" with icon_only: an icon-only control is a
215
+ * square, so fill would be a silent no-op (ADR-060 section 3). */
216
+ .bw-btn--fit-fill {
217
+ inline-size: 100%;
151
218
  }
152
219
  /* Flat disabled colours (COL-018 / #282), not opacity: opacity failed
153
- * contrast on most surfaces and cannot be gated under brand overrides. */
154
- .bw-btn:disabled,
155
- .bw-btn--disabled {
220
+ * contrast on most surfaces and cannot be gated under brand overrides. Three
221
+ * spellings, one look: the disabled attribute (a <button>), the class (the
222
+ * non-navigable <span> a disabled link-button renders as) and aria-disabled
223
+ * (any other host). A busy control is not flat: it holds its variant colours
224
+ * (BTN-031) and is told apart by the spinner, the not-operable cursor and
225
+ * aria-busy, so a loading primary does not flash grey. */
226
+ .bw-btn:disabled:not([aria-busy="true"]),
227
+ .bw-btn--disabled:not([aria-busy="true"]),
228
+ .bw-btn[aria-disabled="true"]:not([aria-busy="true"]) {
156
229
  background: var(--bw-color-action-disabled-bg);
157
230
  background-image: none;
158
231
  color: var(--bw-color-action-disabled-text);
@@ -160,6 +233,9 @@
160
233
  box-shadow: none;
161
234
  cursor: not-allowed;
162
235
  }
236
+ .bw-btn[aria-busy="true"] {
237
+ cursor: progress;
238
+ }
163
239
 
164
240
  .bw-spinner {
165
241
  /* Sized via --bw-icon-size (set inline to a size token), the same mechanism
@@ -429,11 +505,14 @@ select.bw-input {
429
505
  [dir="rtl"] select.bw-input {
430
506
  background-position: left var(--bw-density-control-padding-inline) center;
431
507
  }
508
+ /* background-color, not the shorthand: the shorthand also reset
509
+ * background-image, so a disabled select.bw-input lost its chevron (the
510
+ * select rule is less specific than these state rules). */
432
511
  .bw-input[readonly] {
433
- background: var(--bw-color-surface-sunken);
512
+ background-color: var(--bw-color-surface-sunken);
434
513
  }
435
514
  .bw-input:disabled {
436
- background: var(--bw-color-action-disabled-bg);
515
+ background-color: var(--bw-color-action-disabled-bg);
437
516
  color: var(--bw-color-action-disabled-text);
438
517
  border-color: var(--bw-color-action-disabled-border);
439
518
  cursor: not-allowed;
@@ -2373,11 +2452,11 @@ a.bw-stat:hover {
2373
2452
  consumer stylesheet that selects .bw-stat__trend directly; #334). */
2374
2453
  /* size arg (VIZ-027): modifiers re-point the value-size component token, so
2375
2454
  the numeral rule itself never forks. */
2376
- .bw-stat--sm {
2455
+ .bw-stat--sm, .bw-stat--size-sm {
2377
2456
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2378
2457
  padding: var(--bw-space-3);
2379
2458
  }
2380
- .bw-stat--lg {
2459
+ .bw-stat--lg, .bw-stat--size-lg {
2381
2460
  --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
2382
2461
  padding: var(--bw-space-6);
2383
2462
  }
@@ -2392,8 +2471,11 @@ a.bw-stat:hover {
2392
2471
  padding: 0;
2393
2472
  }
2394
2473
  .bw-stat--chrome-plain.bw-stat--sm,
2474
+ .bw-stat--chrome-plain.bw-stat--size-sm,
2395
2475
  .bw-stat--chrome-plain.bw-stat--lg,
2396
- .bw-stat--chrome-plain.bw-stat--md {
2476
+ .bw-stat--chrome-plain.bw-stat--size-lg,
2477
+ .bw-stat--chrome-plain.bw-stat--md,
2478
+ .bw-stat--chrome-plain.bw-stat--size-md {
2397
2479
  padding: 0;
2398
2480
  }
2399
2481
  a.bw-stat--chrome-plain:hover {
@@ -2567,11 +2649,11 @@ a.bw-stat--chrome-plain:hover {
2567
2649
  /* size arg (mirrors _stat.html's VIZ-027 seam): modifiers re-point the
2568
2650
  same value-size component token _stat.html uses, so a comparison tile
2569
2651
  sits at the same scale as a plain stat tile sharing its grid. */
2570
- .bw-stat-comparison--sm {
2652
+ .bw-stat-comparison--sm, .bw-stat-comparison--size-sm {
2571
2653
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2572
2654
  padding: var(--bw-space-3);
2573
2655
  }
2574
- .bw-stat-comparison--lg {
2656
+ .bw-stat-comparison--lg, .bw-stat-comparison--size-lg {
2575
2657
  --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
2576
2658
  padding: var(--bw-space-6);
2577
2659
  }
@@ -2876,15 +2958,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
2876
2958
  }
2877
2959
  /* size arg (VIZ-010): modifiers re-point the diameter component token, the
2878
2960
  same mechanism .bw-stat--sm/--lg use for their own value-size token. */
2879
- .bw-gauge--sm {
2961
+ .bw-gauge--sm, .bw-gauge--size-sm {
2880
2962
  inline-size: var(--bw-component-gauge-diameter-sm);
2881
2963
  block-size: var(--bw-component-gauge-diameter-sm);
2882
2964
  }
2883
- .bw-gauge--md {
2965
+ .bw-gauge--md, .bw-gauge--size-md {
2884
2966
  inline-size: var(--bw-component-gauge-diameter-md);
2885
2967
  block-size: var(--bw-component-gauge-diameter-md);
2886
2968
  }
2887
- .bw-gauge--lg {
2969
+ .bw-gauge--lg, .bw-gauge--size-lg {
2888
2970
  inline-size: var(--bw-component-gauge-diameter-lg);
2889
2971
  block-size: var(--bw-component-gauge-diameter-lg);
2890
2972
  }
@@ -3643,16 +3725,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3643
3725
  /* Size modifiers (CMP-020): sm/lg re-point the max-width token (the floor
3644
3726
  * panel honours them too); full is full-viewport, gutterless, radius
3645
3727
  * squared off, and only means anything as an overlay. */
3646
- .bw-modal--sm .bw-modal__panel {
3728
+ .bw-modal--sm .bw-modal__panel, .bw-modal--size-sm .bw-modal__panel {
3647
3729
  max-inline-size: var(--bw-size-max-width-modal-sm);
3648
3730
  }
3649
- .bw-modal--lg .bw-modal__panel {
3731
+ .bw-modal--lg .bw-modal__panel, .bw-modal--size-lg .bw-modal__panel {
3650
3732
  max-inline-size: var(--bw-size-max-width-modal-lg);
3651
3733
  }
3652
- .bw-modal--full:is(.bw-modal--open, [data-bw-open]) {
3734
+ .bw-modal--full:is(.bw-modal--open, [data-bw-open]), .bw-modal--size-full:is(.bw-modal--open, [data-bw-open]) {
3653
3735
  padding: 0;
3654
3736
  }
3655
- .bw-modal--full:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel {
3737
+ .bw-modal--full:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel, .bw-modal--size-full:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel {
3656
3738
  max-inline-size: none;
3657
3739
  block-size: 100%;
3658
3740
  border-radius: var(--bw-radius-none);
@@ -3861,17 +3943,17 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3861
3943
  }
3862
3944
  }
3863
3945
  /* Size modifiers: reuse the modal's own width ramp. */
3864
- .bw-slide-over--sm .bw-slide-over__panel {
3946
+ .bw-slide-over--sm .bw-slide-over__panel, .bw-slide-over--size-sm .bw-slide-over__panel {
3865
3947
  max-inline-size: var(--bw-size-max-width-modal-sm);
3866
3948
  }
3867
3949
  /* --md is the DOCUMENTED DEFAULT and the template emits it unconditionally, so
3868
3950
  * it needs a real rule: without one the default size resolved to the panel's
3869
3951
  * base width by accident rather than by declaration (the #120 defect class,
3870
3952
  * found in the 3.0.0 options audit). */
3871
- .bw-slide-over--md .bw-slide-over__panel {
3953
+ .bw-slide-over--md .bw-slide-over__panel, .bw-slide-over--size-md .bw-slide-over__panel {
3872
3954
  max-inline-size: var(--bw-size-max-width-modal-md);
3873
3955
  }
3874
- .bw-slide-over--lg .bw-slide-over__panel {
3956
+ .bw-slide-over--lg .bw-slide-over__panel, .bw-slide-over--size-lg .bw-slide-over__panel {
3875
3957
  max-inline-size: var(--bw-size-max-width-modal-lg);
3876
3958
  }
3877
3959
  /* Sticky header: title plus the always-present close control, divided
@@ -4139,6 +4221,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4139
4221
  * list too (compose, never duplicate); only combobox-specific physics live
4140
4222
  * here. */
4141
4223
  .bw-combobox {
4224
+ /* Chip block size (CMB-038): the control height less the frame's own
4225
+ * block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
4226
+ * hairline border. Shared by the chip and the multiple-mode input. */
4227
+ --bw-combobox-chip-size: max(
4228
+ calc(1.5rem + 2 * var(--bw-size-border-hairline)),
4229
+ calc(var(--bw-density-control-height) - 2 * var(--bw-space-2))
4230
+ );
4142
4231
  position: relative;
4143
4232
  }
4144
4233
  /* Chips and the input share one wrapping row; the absolutely positioned
@@ -4156,6 +4245,90 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4156
4245
  inline-size: auto;
4157
4246
  min-inline-size: 0;
4158
4247
  }
4248
+ /* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
4249
+ * placeholder rule, so the UA default applied. Scoped to the combobox input;
4250
+ * opacity is reset because Firefox dims ::placeholder on top of its colour.
4251
+ * fg-muted, not fg-subtle: composed on the frame fill fg-subtle measures
4252
+ * 2.62:1 light and 3.84:1 dark, under the 4.5:1 text floor (AC-CMB-019),
4253
+ * where fg-muted clears it in both themes (combobox.md 4.3). */
4254
+ .bw-combobox__input::placeholder {
4255
+ color: var(--bw-color-fg-muted);
4256
+ opacity: 1;
4257
+ }
4258
+ /* A disabled control prompts in its disabled ink, not the live placeholder
4259
+ * colour, so the whole field reads as one inactive surface. */
4260
+ .bw-combobox__input:disabled::placeholder {
4261
+ color: var(--bw-color-action-disabled-text);
4262
+ }
4263
+ /* Multiple-mode frame (CMB-031, deliberate break, combobox.md 13.3): the chips
4264
+ * and the input share ONE frame. The frame moves from the input to the field
4265
+ * wrapper (the shared .bw-input recipe restated: control border, radius-md,
4266
+ * inset hairline, hover pre-light, accent border plus halo on focus) and
4267
+ * grows with wrapped chips (min-block-size, never a fixed height). The input
4268
+ * goes borderless so it reads as part of the field. Single mode is untouched:
4269
+ * it keeps the bare .bw-input frame (CMB-030). */
4270
+ .bw-combobox--multiple .bw-combobox__field {
4271
+ min-block-size: var(--bw-density-control-height);
4272
+ padding-block: var(--bw-space-1);
4273
+ padding-inline: var(--bw-density-control-padding-inline);
4274
+ background: var(--bw-color-surface);
4275
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
4276
+ border-radius: var(--bw-radius-md);
4277
+ box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
4278
+ transition: var(--bw-transition-colors), var(--bw-transition-shadow);
4279
+ }
4280
+ .bw-combobox--multiple .bw-combobox__field:hover:where(
4281
+ :not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
4282
+ ) {
4283
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
4284
+ }
4285
+ .bw-combobox--multiple .bw-combobox__field:focus-within {
4286
+ border-color: var(--bw-color-accent);
4287
+ box-shadow:
4288
+ inset 0 1px 2px 0 oklch(0 0 0 / 0.04),
4289
+ 0 0 0 3px color-mix(in oklab, var(--bw-color-accent) 18%, transparent);
4290
+ }
4291
+ /* The global ring (reset.css :focus-visible) moves from the input to the
4292
+ * frame so keyboard focus is outlined at the control edge, once. */
4293
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input:focus-visible) {
4294
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
4295
+ outline-offset: 2px;
4296
+ }
4297
+ /* Declared after focus so the danger border persists while focused, as for
4298
+ * .bw-input. */
4299
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input[aria-invalid="true"]) {
4300
+ border-color: var(--bw-color-danger);
4301
+ }
4302
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input[readonly]) {
4303
+ background: var(--bw-color-surface-sunken);
4304
+ }
4305
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input:disabled) {
4306
+ background: var(--bw-color-action-disabled-bg);
4307
+ border-color: var(--bw-color-action-disabled-border);
4308
+ cursor: not-allowed;
4309
+ }
4310
+ .bw-combobox--multiple .bw-combobox__input,
4311
+ .bw-combobox--multiple .bw-combobox__input:hover,
4312
+ .bw-combobox--multiple .bw-combobox__input:focus-visible,
4313
+ .bw-combobox--multiple .bw-combobox__input:disabled,
4314
+ .bw-combobox--multiple .bw-combobox__input[readonly] {
4315
+ /* The frame owns border, fill, well and ring; the input only types. The
4316
+ * block-size mirrors a chip so a wrapped row keeps one baseline rhythm. */
4317
+ /* A length literal: a typing run beside chips, no sizing-ramp step. Wide
4318
+ * enough for a short placeholder ("Add team"), so a row with no room wraps
4319
+ * the input to its own line instead of clipping the prompt. */
4320
+ flex-basis: 6rem;
4321
+ block-size: auto;
4322
+ min-block-size: var(--bw-combobox-chip-size, 1.5rem);
4323
+ padding-inline: var(--bw-space-1);
4324
+ background: transparent;
4325
+ border: 0;
4326
+ box-shadow: none;
4327
+ outline: none;
4328
+ }
4329
+ .bw-combobox--multiple .bw-combobox__input:disabled {
4330
+ color: var(--bw-color-action-disabled-text);
4331
+ }
4159
4332
  /* The listbox mirrors the dropdown panel exactly (DESIGN.md reserved rows):
4160
4333
  * raised surface, elevation-3 at z-dropdown, radius-lg, menu min-width, the
4161
4334
  * light-theme top-light (dark reset at the end of this file), bw-fade-in-up
@@ -4197,6 +4370,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4197
4370
  * stamps it on: the target listbox itself, or the requesting input beside
4198
4371
  * it. First consumer of --bw-component-htmx-indicator-opacity. */
4199
4372
  .bw-combobox__listbox.htmx-request,
4373
+ .bw-combobox__listbox[aria-busy="true"],
4200
4374
  .bw-combobox__input.htmx-request ~ .bw-combobox__listbox {
4201
4375
  opacity: var(--bw-component-htmx-indicator-opacity);
4202
4376
  }
@@ -4227,19 +4401,47 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4227
4401
  .bw-combobox__option[aria-selected="true"] {
4228
4402
  font-weight: var(--bw-font-weight-medium);
4229
4403
  }
4404
+ /* Disabled option (CMB-016): stays visible and filterable, paints the flat
4405
+ * disabled colours, shows no hover wash and cannot be chosen (the behaviour
4406
+ * skips it). The state is also carried by aria-disabled, not colour alone. */
4407
+ .bw-combobox__option[aria-disabled="true"] {
4408
+ color: var(--bw-color-action-disabled-text);
4409
+ cursor: not-allowed;
4410
+ }
4411
+ .bw-combobox__option[aria-disabled="true"]:hover {
4412
+ background-color: transparent;
4413
+ }
4414
+ /* Create row (CMB-020, GAP-CMB-16): the lead word is quiet and the echoed
4415
+ * query carries the weight, so the row reads "Create <query>". */
4416
+ .bw-combobox__option--create {
4417
+ color: var(--bw-color-fg-muted);
4418
+ }
4419
+ .bw-combobox__create-query {
4420
+ color: var(--bw-color-fg);
4421
+ font-weight: var(--bw-font-weight-medium);
4422
+ overflow-wrap: anywhere;
4423
+ }
4230
4424
  .bw-combobox__empty {
4231
4425
  padding: var(--bw-space-2) var(--bw-space-3);
4232
4426
  color: var(--bw-color-fg-muted);
4233
4427
  font-size: var(--bw-text-body-sm-size);
4234
4428
  line-height: var(--bw-text-body-sm-line-height);
4235
4429
  }
4430
+ /* Server-filter failure row (CMB-019): the same row shape as the empty
4431
+ * message, in the text-duty danger tier (the .bw-field__error precedent). */
4432
+ .bw-combobox__error {
4433
+ padding: var(--bw-space-2) var(--bw-space-3);
4434
+ color: var(--bw-color-danger-fg);
4435
+ font-size: var(--bw-text-body-sm-size);
4436
+ line-height: var(--bw-text-body-sm-line-height);
4437
+ }
4236
4438
  /* Selected-value chips (multiple mode, CMP-028): the selected wash at
4237
- * radius-full, block-sized by the floor-height remove control (the
4238
- * pagination-link touch pattern), so a chip row sits level with the
4239
- * control beside it. */
4439
+ * radius-full, sized by --bw-combobox-chip-size (CMB-038) so a chip row sits
4440
+ * inside the control's height rather than stretching it. */
4240
4441
  .bw-combobox__chip {
4241
4442
  display: inline-flex;
4242
4443
  align-items: center;
4444
+ block-size: var(--bw-combobox-chip-size, 1.5rem);
4243
4445
  gap: var(--bw-space-1);
4244
4446
  padding-inline: var(--bw-space-3) var(--bw-space-1);
4245
4447
  background: var(--bw-state-selected-bg);
@@ -4252,13 +4454,19 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4252
4454
  display: inline-flex;
4253
4455
  align-items: center;
4254
4456
  justify-content: center;
4255
- min-block-size: var(--bw-size-touch-target-min);
4256
- min-inline-size: var(--bw-size-touch-target-min);
4457
+ /* 1.5rem is the WCAG 2.5.8 floor (CMB-053); the chip sizes to it, so the
4458
+ * remove control no longer pushes a chip taller than the control (CMB-038,
4459
+ * GAP-CMB-10). It fills the chip's inner block size. */
4460
+ block-size: 100%;
4461
+ min-block-size: 1.5rem;
4462
+ min-inline-size: 1.5rem;
4257
4463
  padding: var(--bw-space-1);
4258
4464
  background: transparent;
4259
4465
  border: 0;
4260
4466
  border-radius: var(--bw-radius-full);
4261
- color: var(--bw-color-icon-muted);
4467
+ /* fg-muted, not icon-muted: composed on the chip fill icon-muted measures
4468
+ * 2.39:1 in light, under the 3:1 non-text floor (AC-CMB-019, CMB-054). */
4469
+ color: var(--bw-color-fg-muted);
4262
4470
  cursor: pointer;
4263
4471
  transition: var(--bw-transition-colors);
4264
4472
  }
package/src/layout.css CHANGED
@@ -108,12 +108,5 @@
108
108
  text-transform: uppercase;
109
109
  }
110
110
 
111
- /* Primary CTA alias used in early gallery drafts */
112
- .bw-btn--solid {
113
- background-color: var(--bw-color-accent);
114
- color: var(--bw-color-accent-fg);
115
- border-color: transparent;
116
- }
117
- .bw-btn--solid:hover {
118
- background-color: var(--bw-color-accent-hover, var(--bw-color-accent));
119
- }
111
+ /* .bw-btn--solid (the early-draft name of primary) is a deprecated alias of
112
+ * .bw-btn--primary and lives with the button rules in layers/components.css. */