@bwui/css 0.1.2 → 0.1.4

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/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # `@bwui/css`
2
+
3
+ Framework-agnostic Brickwork primitives and component classes. Consumes
4
+ `@bwui/tokens`. Works with plain HTML, React, Vue, or Django. No JavaScript
5
+ required for the stylesheet itself.
6
+
7
+ ```bash
8
+ npm install @bwui/css
9
+ ```
10
+
11
+ ```js
12
+ import "@bwui/css";
13
+ ```
14
+
15
+ ```html
16
+ <link rel="stylesheet" href="node_modules/@bwui/css/dist/brickwork.css" />
17
+ <body data-theme="light">
18
+ <button class="bw-btn bw-btn--primary">Save</button>
19
+ </body>
20
+ ```
21
+
22
+ For gallery pages that need combobox, date picker, CMDK, modal or toast,
23
+ also install `@bwui/js` and load `behaviours.js`.
24
+
25
+ ## Contract
26
+
27
+ - Classes are `bw-*`. Do not style against them from a consumer brand sheet.
28
+ - Recolour by overriding `--bw-*` tokens after this stylesheet.
29
+ - A Django site on `django-brickwork` already vendors this CSS. Do not npm
30
+ `@bwui/css` there just to style the host.
31
+
32
+ ## Stack mates
33
+
34
+ - Tokens: `@bwui/tokens`
35
+ - HTML behaviours: `@bwui/js`
36
+ - React: `@bwui/react` (peer CSS is this package)
37
+ - Django: `django-brickwork` on PyPI
38
+
39
+ Agents: do not invent `bw-*` class names. Copy a gallery page or a React
40
+ export, then read the installed CSS. Catalogue: https://brickworkui.com/catalog.json
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Brickwork CSS v0.1.0
3
3
  * Framework-agnostic UI substrate. Generated by @bwui/css build.
4
- * Layers: tokens -> reset -> primitives -> layout -> shell -> nav -> components -> marketing -> wave-b -> wave-e
4
+ * Layers: tokens -> reset -> primitives -> layout -> shell -> nav -> components -> marketing -> wave-b -> wave-e -> index-extras -> document-a11y
5
5
  */
6
6
 
7
7
  /* ==== layer: tokens ==== */
@@ -46,9 +46,21 @@
46
46
  --bw-component-icon-size-lg: 1.5rem;
47
47
  --bw-component-icon-size-xl: 2rem;
48
48
  --bw-component-icon-size-2xl: 2.5rem;
49
- --bw-size-control-height-sm: 2rem;
49
+ --bw-size-step-xs: 0.75;
50
+ --bw-size-step-sm: 0.875;
51
+ --bw-size-step-md: 1;
52
+ --bw-size-step-lg: 1.125;
53
+ --bw-size-step-xl: 1.25;
54
+ --bw-size-control-height-xs: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xs)));
55
+ --bw-size-control-height-sm: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-sm)));
50
56
  --bw-size-control-height-md: var(--bw-density-control-height);
51
- --bw-size-control-height-lg: 3rem;
57
+ --bw-size-control-height-lg: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-lg)));
58
+ --bw-size-control-height-xl: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xl)));
59
+ --bw-size-control-padding-inline-xs: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xs));
60
+ --bw-size-control-padding-inline-sm: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-sm));
61
+ --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
62
+ --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
63
+ --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
52
64
  --bw-size-touch-target-min: 2.75rem;
53
65
  --bw-size-max-width-prose: 65ch;
54
66
  --bw-size-max-width-form: 32rem;
@@ -601,6 +613,16 @@
601
613
  --bw-density-section-gap: 2rem;
602
614
  --bw-density-card-padding: 1rem;
603
615
  --bw-density-page-gutter-inline: 1.5rem;
616
+ --bw-size-control-height-xs: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xs)));
617
+ --bw-size-control-height-sm: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-sm)));
618
+ --bw-size-control-height-md: var(--bw-density-control-height);
619
+ --bw-size-control-height-lg: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-lg)));
620
+ --bw-size-control-height-xl: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xl)));
621
+ --bw-size-control-padding-inline-xs: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xs));
622
+ --bw-size-control-padding-inline-sm: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-sm));
623
+ --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
624
+ --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
625
+ --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
604
626
  }
605
627
 
606
628
  [data-density="compact"] {
@@ -617,6 +639,16 @@
617
639
  --bw-density-section-gap: 1.5rem;
618
640
  --bw-density-card-padding: 0.75rem;
619
641
  --bw-density-page-gutter-inline: 1rem;
642
+ --bw-size-control-height-xs: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xs)));
643
+ --bw-size-control-height-sm: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-sm)));
644
+ --bw-size-control-height-md: var(--bw-density-control-height);
645
+ --bw-size-control-height-lg: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-lg)));
646
+ --bw-size-control-height-xl: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xl)));
647
+ --bw-size-control-padding-inline-xs: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xs));
648
+ --bw-size-control-padding-inline-sm: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-sm));
649
+ --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
650
+ --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
651
+ --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
620
652
  }
621
653
 
622
654
  [data-density="spacious"] {
@@ -633,6 +665,16 @@
633
665
  --bw-density-section-gap: 3rem;
634
666
  --bw-density-card-padding: 1.5rem;
635
667
  --bw-density-page-gutter-inline: 2rem;
668
+ --bw-size-control-height-xs: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xs)));
669
+ --bw-size-control-height-sm: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-sm)));
670
+ --bw-size-control-height-md: var(--bw-density-control-height);
671
+ --bw-size-control-height-lg: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-lg)));
672
+ --bw-size-control-height-xl: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xl)));
673
+ --bw-size-control-padding-inline-xs: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xs));
674
+ --bw-size-control-padding-inline-sm: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-sm));
675
+ --bw-size-control-padding-inline-md: var(--bw-density-control-padding-inline);
676
+ --bw-size-control-padding-inline-lg: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-lg));
677
+ --bw-size-control-padding-inline-xl: calc(var(--bw-density-control-padding-inline) * var(--bw-size-step-xl));
636
678
  }
637
679
 
638
680
  :root {
@@ -763,7 +805,12 @@ body {
763
805
  font-size: var(--bw-text-body-md-size, 1rem);
764
806
  -webkit-font-smoothing: antialiased;
765
807
  color: var(--bw-color-fg);
766
- background-color: var(--bw-color-bg);
808
+ /* Page ground (icvoss/brickwork#26): the surface token. A prior
809
+ * var(--bw-color-bg) named a token no theme defines, so the declaration was
810
+ * invalid at computed-value time and the body stayed transparent (a white
811
+ * canvas under dark text colours). Surface is white in light and near-black
812
+ * in dark, so light output is unchanged and dark now paints its own ground. */
813
+ background-color: var(--bw-color-surface);
767
814
  }
768
815
 
769
816
  img,
@@ -947,8 +994,10 @@ a:hover {
947
994
  .bw-fg-subtle {
948
995
  color: var(--bw-color-fg-subtle);
949
996
  }
997
+ /* Page ground; the same token as the body (icvoss/brickwork#26). There is no
998
+ * --bw-color-bg token, so this resolves to the surface role. */
950
999
  .bw-bg {
951
- background-color: var(--bw-color-bg);
1000
+ background-color: var(--bw-color-surface);
952
1001
  }
953
1002
  .bw-surface {
954
1003
  background-color: var(--bw-color-surface);
@@ -3149,9 +3198,15 @@ a:hover {
3149
3198
  var(--bw-transition-shadow),
3150
3199
  var(--bw-transition-transform);
3151
3200
  }
3152
- .bw-btn--sm {
3201
+ /* Size classes (ADR-125 section 6): the grammar is bw-<component>--size-<step>.
3202
+ * The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
3203
+ * slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
3204
+ * one grouped rule for the deprecation window; the bare ones are removed in
3205
+ * the next major of django-brickwork and in the @bwui/css release shipped with
3206
+ * it. Templates, React, Vue and the gallery emit the new class. */
3207
+ .bw-btn--sm, .bw-btn--size-sm {
3153
3208
  block-size: var(--bw-size-control-height-sm);
3154
- padding-inline: var(--bw-space-2);
3209
+ padding-inline: var(--bw-size-control-padding-inline-sm);
3155
3210
  }
3156
3211
  /* md is the base .bw-btn size (icvoss/django-brickwork#130): every shipped
3157
3212
  * template that names a size emits bw-btn--md explicitly rather than leaving
@@ -3160,13 +3215,16 @@ a:hover {
3160
3215
  * to the base. Without this rule the class existed in markup with nothing in
3161
3216
  * the stylesheet naming it, which is the defect class this issue is about:
3162
3217
  * the base values happened to make it look correct by accident. */
3163
- .bw-btn--md {
3164
- block-size: var(--bw-density-control-height);
3165
- padding-inline: var(--bw-density-control-padding-inline);
3218
+ .bw-btn--md, .bw-btn--size-md {
3219
+ block-size: var(--bw-size-control-height-md);
3220
+ padding-inline: var(--bw-size-control-padding-inline-md);
3166
3221
  }
3167
- .bw-btn--lg {
3222
+ /* ADR-125: sm, md and lg resolve from the density control base times a
3223
+ * kit-wide step multiplier (--bw-size-step-*), not from absolute rem values,
3224
+ * so every density keeps three distinct heights. */
3225
+ .bw-btn--lg, .bw-btn--size-lg {
3168
3226
  block-size: var(--bw-size-control-height-lg);
3169
- padding-inline: var(--bw-space-4);
3227
+ padding-inline: var(--bw-size-control-padding-inline-lg);
3170
3228
  }
3171
3229
  /* Solid buttons carry a border in their own hue (0.7.0 craft): 80% of the fill
3172
3230
  * toward black is the Radix solid-button edge, a shade the fill visibly sits
@@ -3265,10 +3323,10 @@ a:hover {
3265
3323
  }
3266
3324
  /* Exact square at every size (0.7.0 craft): the sm/lg heights bring their own
3267
3325
  * widths, so an icon button's optical padding is identical on all four sides. */
3268
- .bw-btn--sm.bw-btn--icon-only {
3326
+ .bw-btn--sm.bw-btn--icon-only, .bw-btn--size-sm.bw-btn--icon-only {
3269
3327
  inline-size: var(--bw-size-control-height-sm);
3270
3328
  }
3271
- .bw-btn--lg.bw-btn--icon-only {
3329
+ .bw-btn--lg.bw-btn--icon-only, .bw-btn--size-lg.bw-btn--icon-only {
3272
3330
  inline-size: var(--bw-size-control-height-lg);
3273
3331
  }
3274
3332
  /* Flat disabled colours (COL-018 / #282), not opacity: opacity failed
@@ -3551,11 +3609,14 @@ select.bw-input {
3551
3609
  [dir="rtl"] select.bw-input {
3552
3610
  background-position: left var(--bw-density-control-padding-inline) center;
3553
3611
  }
3612
+ /* background-color, not the shorthand: the shorthand also reset
3613
+ * background-image, so a disabled select.bw-input lost its chevron (the
3614
+ * select rule is less specific than these state rules). */
3554
3615
  .bw-input[readonly] {
3555
- background: var(--bw-color-surface-sunken);
3616
+ background-color: var(--bw-color-surface-sunken);
3556
3617
  }
3557
3618
  .bw-input:disabled {
3558
- background: var(--bw-color-action-disabled-bg);
3619
+ background-color: var(--bw-color-action-disabled-bg);
3559
3620
  color: var(--bw-color-action-disabled-text);
3560
3621
  border-color: var(--bw-color-action-disabled-border);
3561
3622
  cursor: not-allowed;
@@ -5495,11 +5556,11 @@ a.bw-stat:hover {
5495
5556
  consumer stylesheet that selects .bw-stat__trend directly; #334). */
5496
5557
  /* size arg (VIZ-027): modifiers re-point the value-size component token, so
5497
5558
  the numeral rule itself never forks. */
5498
- .bw-stat--sm {
5559
+ .bw-stat--sm, .bw-stat--size-sm {
5499
5560
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
5500
5561
  padding: var(--bw-space-3);
5501
5562
  }
5502
- .bw-stat--lg {
5563
+ .bw-stat--lg, .bw-stat--size-lg {
5503
5564
  --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
5504
5565
  padding: var(--bw-space-6);
5505
5566
  }
@@ -5514,8 +5575,11 @@ a.bw-stat:hover {
5514
5575
  padding: 0;
5515
5576
  }
5516
5577
  .bw-stat--chrome-plain.bw-stat--sm,
5578
+ .bw-stat--chrome-plain.bw-stat--size-sm,
5517
5579
  .bw-stat--chrome-plain.bw-stat--lg,
5518
- .bw-stat--chrome-plain.bw-stat--md {
5580
+ .bw-stat--chrome-plain.bw-stat--size-lg,
5581
+ .bw-stat--chrome-plain.bw-stat--md,
5582
+ .bw-stat--chrome-plain.bw-stat--size-md {
5519
5583
  padding: 0;
5520
5584
  }
5521
5585
  a.bw-stat--chrome-plain:hover {
@@ -5689,11 +5753,11 @@ a.bw-stat--chrome-plain:hover {
5689
5753
  /* size arg (mirrors _stat.html's VIZ-027 seam): modifiers re-point the
5690
5754
  same value-size component token _stat.html uses, so a comparison tile
5691
5755
  sits at the same scale as a plain stat tile sharing its grid. */
5692
- .bw-stat-comparison--sm {
5756
+ .bw-stat-comparison--sm, .bw-stat-comparison--size-sm {
5693
5757
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
5694
5758
  padding: var(--bw-space-3);
5695
5759
  }
5696
- .bw-stat-comparison--lg {
5760
+ .bw-stat-comparison--lg, .bw-stat-comparison--size-lg {
5697
5761
  --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
5698
5762
  padding: var(--bw-space-6);
5699
5763
  }
@@ -5998,15 +6062,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
5998
6062
  }
5999
6063
  /* size arg (VIZ-010): modifiers re-point the diameter component token, the
6000
6064
  same mechanism .bw-stat--sm/--lg use for their own value-size token. */
6001
- .bw-gauge--sm {
6065
+ .bw-gauge--sm, .bw-gauge--size-sm {
6002
6066
  inline-size: var(--bw-component-gauge-diameter-sm);
6003
6067
  block-size: var(--bw-component-gauge-diameter-sm);
6004
6068
  }
6005
- .bw-gauge--md {
6069
+ .bw-gauge--md, .bw-gauge--size-md {
6006
6070
  inline-size: var(--bw-component-gauge-diameter-md);
6007
6071
  block-size: var(--bw-component-gauge-diameter-md);
6008
6072
  }
6009
- .bw-gauge--lg {
6073
+ .bw-gauge--lg, .bw-gauge--size-lg {
6010
6074
  inline-size: var(--bw-component-gauge-diameter-lg);
6011
6075
  block-size: var(--bw-component-gauge-diameter-lg);
6012
6076
  }
@@ -6765,16 +6829,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
6765
6829
  /* Size modifiers (CMP-020): sm/lg re-point the max-width token (the floor
6766
6830
  * panel honours them too); full is full-viewport, gutterless, radius
6767
6831
  * squared off, and only means anything as an overlay. */
6768
- .bw-modal--sm .bw-modal__panel {
6832
+ .bw-modal--sm .bw-modal__panel, .bw-modal--size-sm .bw-modal__panel {
6769
6833
  max-inline-size: var(--bw-size-max-width-modal-sm);
6770
6834
  }
6771
- .bw-modal--lg .bw-modal__panel {
6835
+ .bw-modal--lg .bw-modal__panel, .bw-modal--size-lg .bw-modal__panel {
6772
6836
  max-inline-size: var(--bw-size-max-width-modal-lg);
6773
6837
  }
6774
- .bw-modal--full:is(.bw-modal--open, [data-bw-open]) {
6838
+ .bw-modal--full:is(.bw-modal--open, [data-bw-open]), .bw-modal--size-full:is(.bw-modal--open, [data-bw-open]) {
6775
6839
  padding: 0;
6776
6840
  }
6777
- .bw-modal--full:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel {
6841
+ .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 {
6778
6842
  max-inline-size: none;
6779
6843
  block-size: 100%;
6780
6844
  border-radius: var(--bw-radius-none);
@@ -6983,17 +7047,17 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
6983
7047
  }
6984
7048
  }
6985
7049
  /* Size modifiers: reuse the modal's own width ramp. */
6986
- .bw-slide-over--sm .bw-slide-over__panel {
7050
+ .bw-slide-over--sm .bw-slide-over__panel, .bw-slide-over--size-sm .bw-slide-over__panel {
6987
7051
  max-inline-size: var(--bw-size-max-width-modal-sm);
6988
7052
  }
6989
7053
  /* --md is the DOCUMENTED DEFAULT and the template emits it unconditionally, so
6990
7054
  * it needs a real rule: without one the default size resolved to the panel's
6991
7055
  * base width by accident rather than by declaration (the #120 defect class,
6992
7056
  * found in the 3.0.0 options audit). */
6993
- .bw-slide-over--md .bw-slide-over__panel {
7057
+ .bw-slide-over--md .bw-slide-over__panel, .bw-slide-over--size-md .bw-slide-over__panel {
6994
7058
  max-inline-size: var(--bw-size-max-width-modal-md);
6995
7059
  }
6996
- .bw-slide-over--lg .bw-slide-over__panel {
7060
+ .bw-slide-over--lg .bw-slide-over__panel, .bw-slide-over--size-lg .bw-slide-over__panel {
6997
7061
  max-inline-size: var(--bw-size-max-width-modal-lg);
6998
7062
  }
6999
7063
  /* Sticky header: title plus the always-present close control, divided
@@ -7261,6 +7325,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7261
7325
  * list too (compose, never duplicate); only combobox-specific physics live
7262
7326
  * here. */
7263
7327
  .bw-combobox {
7328
+ /* Chip block size (CMB-038): the control height less the frame's own
7329
+ * block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
7330
+ * hairline border. Shared by the chip and the multiple-mode input. */
7331
+ --bw-combobox-chip-size: max(
7332
+ calc(1.5rem + 2 * var(--bw-size-border-hairline)),
7333
+ calc(var(--bw-density-control-height) - 2 * var(--bw-space-2))
7334
+ );
7264
7335
  position: relative;
7265
7336
  }
7266
7337
  /* Chips and the input share one wrapping row; the absolutely positioned
@@ -7278,6 +7349,90 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7278
7349
  inline-size: auto;
7279
7350
  min-inline-size: 0;
7280
7351
  }
7352
+ /* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
7353
+ * placeholder rule, so the UA default applied. Scoped to the combobox input;
7354
+ * opacity is reset because Firefox dims ::placeholder on top of its colour.
7355
+ * fg-muted, not fg-subtle: composed on the frame fill fg-subtle measures
7356
+ * 2.62:1 light and 3.84:1 dark, under the 4.5:1 text floor (AC-CMB-019),
7357
+ * where fg-muted clears it in both themes (combobox.md 4.3). */
7358
+ .bw-combobox__input::placeholder {
7359
+ color: var(--bw-color-fg-muted);
7360
+ opacity: 1;
7361
+ }
7362
+ /* A disabled control prompts in its disabled ink, not the live placeholder
7363
+ * colour, so the whole field reads as one inactive surface. */
7364
+ .bw-combobox__input:disabled::placeholder {
7365
+ color: var(--bw-color-action-disabled-text);
7366
+ }
7367
+ /* Multiple-mode frame (CMB-031, deliberate break, combobox.md 13.3): the chips
7368
+ * and the input share ONE frame. The frame moves from the input to the field
7369
+ * wrapper (the shared .bw-input recipe restated: control border, radius-md,
7370
+ * inset hairline, hover pre-light, accent border plus halo on focus) and
7371
+ * grows with wrapped chips (min-block-size, never a fixed height). The input
7372
+ * goes borderless so it reads as part of the field. Single mode is untouched:
7373
+ * it keeps the bare .bw-input frame (CMB-030). */
7374
+ .bw-combobox--multiple .bw-combobox__field {
7375
+ min-block-size: var(--bw-density-control-height);
7376
+ padding-block: var(--bw-space-1);
7377
+ padding-inline: var(--bw-density-control-padding-inline);
7378
+ background: var(--bw-color-surface);
7379
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
7380
+ border-radius: var(--bw-radius-md);
7381
+ box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
7382
+ transition: var(--bw-transition-colors), var(--bw-transition-shadow);
7383
+ }
7384
+ .bw-combobox--multiple .bw-combobox__field:hover:where(
7385
+ :not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
7386
+ ) {
7387
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
7388
+ }
7389
+ .bw-combobox--multiple .bw-combobox__field:focus-within {
7390
+ border-color: var(--bw-color-accent);
7391
+ box-shadow:
7392
+ inset 0 1px 2px 0 oklch(0 0 0 / 0.04),
7393
+ 0 0 0 3px color-mix(in oklab, var(--bw-color-accent) 18%, transparent);
7394
+ }
7395
+ /* The global ring (reset.css :focus-visible) moves from the input to the
7396
+ * frame so keyboard focus is outlined at the control edge, once. */
7397
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input:focus-visible) {
7398
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
7399
+ outline-offset: 2px;
7400
+ }
7401
+ /* Declared after focus so the danger border persists while focused, as for
7402
+ * .bw-input. */
7403
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input[aria-invalid="true"]) {
7404
+ border-color: var(--bw-color-danger);
7405
+ }
7406
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input[readonly]) {
7407
+ background: var(--bw-color-surface-sunken);
7408
+ }
7409
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input:disabled) {
7410
+ background: var(--bw-color-action-disabled-bg);
7411
+ border-color: var(--bw-color-action-disabled-border);
7412
+ cursor: not-allowed;
7413
+ }
7414
+ .bw-combobox--multiple .bw-combobox__input,
7415
+ .bw-combobox--multiple .bw-combobox__input:hover,
7416
+ .bw-combobox--multiple .bw-combobox__input:focus-visible,
7417
+ .bw-combobox--multiple .bw-combobox__input:disabled,
7418
+ .bw-combobox--multiple .bw-combobox__input[readonly] {
7419
+ /* The frame owns border, fill, well and ring; the input only types. The
7420
+ * block-size mirrors a chip so a wrapped row keeps one baseline rhythm. */
7421
+ /* A length literal: a typing run beside chips, no sizing-ramp step. Wide
7422
+ * enough for a short placeholder ("Add team"), so a row with no room wraps
7423
+ * the input to its own line instead of clipping the prompt. */
7424
+ flex-basis: 6rem;
7425
+ block-size: auto;
7426
+ min-block-size: var(--bw-combobox-chip-size, 1.5rem);
7427
+ padding-inline: var(--bw-space-1);
7428
+ background: transparent;
7429
+ border: 0;
7430
+ box-shadow: none;
7431
+ outline: none;
7432
+ }
7433
+ .bw-combobox--multiple .bw-combobox__input:disabled {
7434
+ color: var(--bw-color-action-disabled-text);
7435
+ }
7281
7436
  /* The listbox mirrors the dropdown panel exactly (DESIGN.md reserved rows):
7282
7437
  * raised surface, elevation-3 at z-dropdown, radius-lg, menu min-width, the
7283
7438
  * light-theme top-light (dark reset at the end of this file), bw-fade-in-up
@@ -7319,6 +7474,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7319
7474
  * stamps it on: the target listbox itself, or the requesting input beside
7320
7475
  * it. First consumer of --bw-component-htmx-indicator-opacity. */
7321
7476
  .bw-combobox__listbox.htmx-request,
7477
+ .bw-combobox__listbox[aria-busy="true"],
7322
7478
  .bw-combobox__input.htmx-request ~ .bw-combobox__listbox {
7323
7479
  opacity: var(--bw-component-htmx-indicator-opacity);
7324
7480
  }
@@ -7349,19 +7505,47 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7349
7505
  .bw-combobox__option[aria-selected="true"] {
7350
7506
  font-weight: var(--bw-font-weight-medium);
7351
7507
  }
7508
+ /* Disabled option (CMB-016): stays visible and filterable, paints the flat
7509
+ * disabled colours, shows no hover wash and cannot be chosen (the behaviour
7510
+ * skips it). The state is also carried by aria-disabled, not colour alone. */
7511
+ .bw-combobox__option[aria-disabled="true"] {
7512
+ color: var(--bw-color-action-disabled-text);
7513
+ cursor: not-allowed;
7514
+ }
7515
+ .bw-combobox__option[aria-disabled="true"]:hover {
7516
+ background-color: transparent;
7517
+ }
7518
+ /* Create row (CMB-020, GAP-CMB-16): the lead word is quiet and the echoed
7519
+ * query carries the weight, so the row reads "Create <query>". */
7520
+ .bw-combobox__option--create {
7521
+ color: var(--bw-color-fg-muted);
7522
+ }
7523
+ .bw-combobox__create-query {
7524
+ color: var(--bw-color-fg);
7525
+ font-weight: var(--bw-font-weight-medium);
7526
+ overflow-wrap: anywhere;
7527
+ }
7352
7528
  .bw-combobox__empty {
7353
7529
  padding: var(--bw-space-2) var(--bw-space-3);
7354
7530
  color: var(--bw-color-fg-muted);
7355
7531
  font-size: var(--bw-text-body-sm-size);
7356
7532
  line-height: var(--bw-text-body-sm-line-height);
7357
7533
  }
7534
+ /* Server-filter failure row (CMB-019): the same row shape as the empty
7535
+ * message, in the text-duty danger tier (the .bw-field__error precedent). */
7536
+ .bw-combobox__error {
7537
+ padding: var(--bw-space-2) var(--bw-space-3);
7538
+ color: var(--bw-color-danger-fg);
7539
+ font-size: var(--bw-text-body-sm-size);
7540
+ line-height: var(--bw-text-body-sm-line-height);
7541
+ }
7358
7542
  /* Selected-value chips (multiple mode, CMP-028): the selected wash at
7359
- * radius-full, block-sized by the floor-height remove control (the
7360
- * pagination-link touch pattern), so a chip row sits level with the
7361
- * control beside it. */
7543
+ * radius-full, sized by --bw-combobox-chip-size (CMB-038) so a chip row sits
7544
+ * inside the control's height rather than stretching it. */
7362
7545
  .bw-combobox__chip {
7363
7546
  display: inline-flex;
7364
7547
  align-items: center;
7548
+ block-size: var(--bw-combobox-chip-size, 1.5rem);
7365
7549
  gap: var(--bw-space-1);
7366
7550
  padding-inline: var(--bw-space-3) var(--bw-space-1);
7367
7551
  background: var(--bw-state-selected-bg);
@@ -7374,13 +7558,19 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7374
7558
  display: inline-flex;
7375
7559
  align-items: center;
7376
7560
  justify-content: center;
7377
- min-block-size: var(--bw-size-touch-target-min);
7378
- min-inline-size: var(--bw-size-touch-target-min);
7561
+ /* 1.5rem is the WCAG 2.5.8 floor (CMB-053); the chip sizes to it, so the
7562
+ * remove control no longer pushes a chip taller than the control (CMB-038,
7563
+ * GAP-CMB-10). It fills the chip's inner block size. */
7564
+ block-size: 100%;
7565
+ min-block-size: 1.5rem;
7566
+ min-inline-size: 1.5rem;
7379
7567
  padding: var(--bw-space-1);
7380
7568
  background: transparent;
7381
7569
  border: 0;
7382
7570
  border-radius: var(--bw-radius-full);
7383
- color: var(--bw-color-icon-muted);
7571
+ /* fg-muted, not icon-muted: composed on the chip fill icon-muted measures
7572
+ * 2.39:1 in light, under the 3:1 non-text floor (AC-CMB-019, CMB-054). */
7573
+ color: var(--bw-color-fg-muted);
7384
7574
  cursor: pointer;
7385
7575
  transition: var(--bw-transition-colors);
7386
7576
  }
@@ -13625,7 +13815,7 @@ same pattern as .bw-bio__profile-link. */
13625
13815
  line-height: 1;
13626
13816
  }
13627
13817
 
13628
- .bw-icon--lg {
13818
+ .bw-icon--lg, .bw-icon--size-lg {
13629
13819
  inline-size: 2.5rem;
13630
13820
  block-size: 2.5rem;
13631
13821
  font-size: var(--bw-text-heading-md-size);
@@ -13663,22 +13853,141 @@ same pattern as .bw-bio__profile-link. */
13663
13853
  border-radius: var(--bw-radius-md);
13664
13854
  }
13665
13855
 
13666
- .bw-sparkline {
13856
+ /* Demo bar chart only. Must not use .bw-sparkline: that class belongs to the
13857
+ * product sparkline component in layers/components.css (brickwork#11). */
13858
+ .bw-demo-barchart {
13667
13859
  display: flex;
13668
13860
  align-items: flex-end;
13669
13861
  gap: 0.35rem;
13670
13862
  block-size: 4rem;
13671
13863
  }
13672
13864
 
13673
- .bw-sparkline > span {
13865
+ .bw-demo-barchart > span {
13674
13866
  flex: 1;
13675
13867
  background: var(--bw-color-accent);
13676
13868
  border-radius: 2px 2px 0 0;
13677
13869
  opacity: 0.85;
13678
13870
  }
13679
13871
 
13680
- .bw-sparkline > span:nth-child(1) { block-size: 35%; }
13681
- .bw-sparkline > span:nth-child(2) { block-size: 55%; }
13682
- .bw-sparkline > span:nth-child(3) { block-size: 40%; }
13683
- .bw-sparkline > span:nth-child(4) { block-size: 75%; }
13684
- .bw-sparkline > span:nth-child(5) { block-size: 60%; }
13872
+ .bw-demo-barchart > span:nth-child(1) { block-size: 35%; }
13873
+ .bw-demo-barchart > span:nth-child(2) { block-size: 55%; }
13874
+ .bw-demo-barchart > span:nth-child(3) { block-size: 40%; }
13875
+ .bw-demo-barchart > span:nth-child(4) { block-size: 75%; }
13876
+ .bw-demo-barchart > span:nth-child(5) { block-size: 60%; }
13877
+
13878
+
13879
+ /* ==== layer: index-extras ==== */
13880
+ /*
13881
+ * Django index extras (icvoss/brickwork#11).
13882
+ *
13883
+ * Previously appended by django-brickwork's vendor-bwui.mjs from
13884
+ * frontend/src/index.css after stripping @imports. Shipped in @bwui/css so
13885
+ * every stack gets the same a11y/RTL floor without a Django-only overlay.
13886
+ *
13887
+ * Source twin: src/layers/_index-reference.css (keeps the documented import
13888
+ * order for Django Vite consumers; this file is the import-free slice the
13889
+ * plain CSS bundle concatenates).
13890
+ */
13891
+
13892
+ /* Scoped box-sizing reset: the library must be correct without a consumer preflight. */
13893
+ [class^="bw-"],
13894
+ [class*=" bw-"] {
13895
+ box-sizing: border-box;
13896
+ }
13897
+
13898
+ /* Scoped hidden floor: the interaction set toggles the hidden ATTRIBUTE on
13899
+ * elements whose component class sets display, and any author display rule
13900
+ * outranks the UA sheet's [hidden]. */
13901
+ [class^="bw-"][hidden],
13902
+ [class*=" bw-"][hidden] {
13903
+ display: none !important;
13904
+ }
13905
+
13906
+ /* Skip link: visually hidden until focused, then pinned to the top-inline-start. */
13907
+ .bw-skip-link {
13908
+ position: absolute;
13909
+ inset-block-start: 0;
13910
+ inset-inline-start: 0;
13911
+ transform: translateY(-100%);
13912
+ padding: var(--bw-space-2) var(--bw-space-4);
13913
+ background: var(--bw-color-surface);
13914
+ color: var(--bw-color-accent);
13915
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
13916
+ border-start-start-radius: 0;
13917
+ border-end-end-radius: var(--bw-radius-md);
13918
+ z-index: var(--bw-z-skip-link);
13919
+ transition: transform var(--bw-duration-fast) var(--bw-ease-out);
13920
+ }
13921
+ .bw-skip-link:focus {
13922
+ transform: translateY(0);
13923
+ }
13924
+
13925
+ .bw-icon {
13926
+ display: inline-block;
13927
+ flex-shrink: 0;
13928
+ vertical-align: middle;
13929
+ inline-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
13930
+ block-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
13931
+ }
13932
+ [dir="rtl"] .bw-icon-directional {
13933
+ transform: scaleX(-1);
13934
+ }
13935
+
13936
+ :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
13937
+ outline: var(--bw-focus-ring-width) var(--bw-focus-ring-style) var(--bw-color-focus-ring);
13938
+ outline-offset: var(--bw-focus-ring-offset);
13939
+ }
13940
+
13941
+ @media (prefers-reduced-motion: reduce) {
13942
+ *,
13943
+ *::before,
13944
+ *::after {
13945
+ animation-duration: 0.001ms !important;
13946
+ animation-iteration-count: 1 !important;
13947
+ transition-duration: 0.001ms !important;
13948
+ }
13949
+ }
13950
+
13951
+
13952
+ /* ==== layer: document-a11y ==== */
13953
+ /*
13954
+ * Document-level a11y repairs (icvoss/brickwork#11).
13955
+ *
13956
+ * Previously django-brickwork frontend/src/vendor-overlays.css. Folded into
13957
+ * @bwui/css so pip and npm consumers share one substrate.
13958
+ */
13959
+
13960
+ /* Native form controls inherit --bw-color-fg but keep the UA light fill unless
13961
+ * the document declares a dark color-scheme. */
13962
+ [data-theme="light"] {
13963
+ color-scheme: light;
13964
+ }
13965
+ [data-theme="dark"] {
13966
+ color-scheme: dark;
13967
+ }
13968
+
13969
+ /* Zero specificity on purpose (icvoss/brickwork#25): this is a fallback for
13970
+ * unstyled native controls. As a bare selector its seven :not() terms scored
13971
+ * about (0,7,1) and outranked .bw-input:disabled and .bw-input[readonly]
13972
+ * (0,2,0), so disabled and read-only inputs kept the enabled fill and ink.
13973
+ * :where() keeps the repair for plain controls and lets every component rule
13974
+ * win. */
13975
+ :where(
13976
+ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(
13977
+ [type="file"]
13978
+ ):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
13979
+ [type="reset"]
13980
+ ):not([type="image"]):not([type="color"]),
13981
+ textarea,
13982
+ select
13983
+ ) {
13984
+ background-color: var(--bw-color-surface);
13985
+ color: var(--bw-color-fg);
13986
+ }
13987
+
13988
+ /* The reset sets a { text-decoration: none }. Bare inline links then fail
13989
+ * WCAG 1.4.1 in dark theme. Classed chrome that wants no underline
13990
+ * (.bw-btn, .bw-nav__link) still wins on specificity. */
13991
+ a {
13992
+ text-decoration: underline;
13993
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bwui/css",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
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",
@@ -9,7 +9,9 @@
9
9
  ],
10
10
  "files": [
11
11
  "dist",
12
- "src"
12
+ "src",
13
+ "README.md",
14
+ "LICENSE"
13
15
  ],
14
16
  "exports": {
15
17
  ".": "./dist/brickwork.css",
@@ -19,7 +21,7 @@
19
21
  "./src/*": "./src/*"
20
22
  },
21
23
  "dependencies": {
22
- "@bwui/tokens": "0.1.2"
24
+ "@bwui/tokens": "0.1.4"
23
25
  },
24
26
  "devDependencies": {
25
27
  "tsx": "^4.19.2"
@@ -32,6 +34,7 @@
32
34
  "access": "public"
33
35
  },
34
36
  "scripts": {
35
- "build": "tsx scripts/build.ts"
37
+ "build": "tsx scripts/build.ts",
38
+ "test": "node --test \"test/*.test.mjs\""
36
39
  }
37
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);
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Document-level a11y repairs (icvoss/brickwork#11).
3
+ *
4
+ * Previously django-brickwork frontend/src/vendor-overlays.css. Folded into
5
+ * @bwui/css so pip and npm consumers share one substrate.
6
+ */
7
+
8
+ /* Native form controls inherit --bw-color-fg but keep the UA light fill unless
9
+ * the document declares a dark color-scheme. */
10
+ [data-theme="light"] {
11
+ color-scheme: light;
12
+ }
13
+ [data-theme="dark"] {
14
+ color-scheme: dark;
15
+ }
16
+
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
+ ) {
32
+ background-color: var(--bw-color-surface);
33
+ color: var(--bw-color-fg);
34
+ }
35
+
36
+ /* The reset sets a { text-decoration: none }. Bare inline links then fail
37
+ * WCAG 1.4.1 in dark theme. Classed chrome that wants no underline
38
+ * (.bw-btn, .bw-nav__link) still wins on specificity. */
39
+ a {
40
+ text-decoration: underline;
41
+ }
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Django index extras (icvoss/brickwork#11).
3
+ *
4
+ * Previously appended by django-brickwork's vendor-bwui.mjs from
5
+ * frontend/src/index.css after stripping @imports. Shipped in @bwui/css so
6
+ * every stack gets the same a11y/RTL floor without a Django-only overlay.
7
+ *
8
+ * Source twin: src/layers/_index-reference.css (keeps the documented import
9
+ * order for Django Vite consumers; this file is the import-free slice the
10
+ * plain CSS bundle concatenates).
11
+ */
12
+
13
+ /* Scoped box-sizing reset: the library must be correct without a consumer preflight. */
14
+ [class^="bw-"],
15
+ [class*=" bw-"] {
16
+ box-sizing: border-box;
17
+ }
18
+
19
+ /* Scoped hidden floor: the interaction set toggles the hidden ATTRIBUTE on
20
+ * elements whose component class sets display, and any author display rule
21
+ * outranks the UA sheet's [hidden]. */
22
+ [class^="bw-"][hidden],
23
+ [class*=" bw-"][hidden] {
24
+ display: none !important;
25
+ }
26
+
27
+ /* Skip link: visually hidden until focused, then pinned to the top-inline-start. */
28
+ .bw-skip-link {
29
+ position: absolute;
30
+ inset-block-start: 0;
31
+ inset-inline-start: 0;
32
+ transform: translateY(-100%);
33
+ padding: var(--bw-space-2) var(--bw-space-4);
34
+ background: var(--bw-color-surface);
35
+ color: var(--bw-color-accent);
36
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border);
37
+ border-start-start-radius: 0;
38
+ border-end-end-radius: var(--bw-radius-md);
39
+ z-index: var(--bw-z-skip-link);
40
+ transition: transform var(--bw-duration-fast) var(--bw-ease-out);
41
+ }
42
+ .bw-skip-link:focus {
43
+ transform: translateY(0);
44
+ }
45
+
46
+ .bw-icon {
47
+ display: inline-block;
48
+ flex-shrink: 0;
49
+ vertical-align: middle;
50
+ inline-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
51
+ block-size: var(--bw-icon-size, var(--bw-component-icon-size-md));
52
+ }
53
+ [dir="rtl"] .bw-icon-directional {
54
+ transform: scaleX(-1);
55
+ }
56
+
57
+ :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
58
+ outline: var(--bw-focus-ring-width) var(--bw-focus-ring-style) var(--bw-color-focus-ring);
59
+ outline-offset: var(--bw-focus-ring-offset);
60
+ }
61
+
62
+ @media (prefers-reduced-motion: reduce) {
63
+ *,
64
+ *::before,
65
+ *::after {
66
+ animation-duration: 0.001ms !important;
67
+ animation-iteration-count: 1 !important;
68
+ transition-duration: 0.001ms !important;
69
+ }
70
+ }
@@ -27,9 +27,15 @@
27
27
  var(--bw-transition-shadow),
28
28
  var(--bw-transition-transform);
29
29
  }
30
- .bw-btn--sm {
30
+ /* Size classes (ADR-125 section 6): the grammar is bw-<component>--size-<step>.
31
+ * The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
32
+ * slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
33
+ * one grouped rule for the deprecation window; the bare ones are removed in
34
+ * the next major of django-brickwork and in the @bwui/css release shipped with
35
+ * it. Templates, React, Vue and the gallery emit the new class. */
36
+ .bw-btn--sm, .bw-btn--size-sm {
31
37
  block-size: var(--bw-size-control-height-sm);
32
- padding-inline: var(--bw-space-2);
38
+ padding-inline: var(--bw-size-control-padding-inline-sm);
33
39
  }
34
40
  /* md is the base .bw-btn size (icvoss/django-brickwork#130): every shipped
35
41
  * template that names a size emits bw-btn--md explicitly rather than leaving
@@ -38,13 +44,16 @@
38
44
  * to the base. Without this rule the class existed in markup with nothing in
39
45
  * the stylesheet naming it, which is the defect class this issue is about:
40
46
  * 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);
47
+ .bw-btn--md, .bw-btn--size-md {
48
+ block-size: var(--bw-size-control-height-md);
49
+ padding-inline: var(--bw-size-control-padding-inline-md);
44
50
  }
45
- .bw-btn--lg {
51
+ /* ADR-125: sm, md and lg resolve from the density control base times a
52
+ * kit-wide step multiplier (--bw-size-step-*), not from absolute rem values,
53
+ * so every density keeps three distinct heights. */
54
+ .bw-btn--lg, .bw-btn--size-lg {
46
55
  block-size: var(--bw-size-control-height-lg);
47
- padding-inline: var(--bw-space-4);
56
+ padding-inline: var(--bw-size-control-padding-inline-lg);
48
57
  }
49
58
  /* Solid buttons carry a border in their own hue (0.7.0 craft): 80% of the fill
50
59
  * toward black is the Radix solid-button edge, a shade the fill visibly sits
@@ -143,10 +152,10 @@
143
152
  }
144
153
  /* Exact square at every size (0.7.0 craft): the sm/lg heights bring their own
145
154
  * widths, so an icon button's optical padding is identical on all four sides. */
146
- .bw-btn--sm.bw-btn--icon-only {
155
+ .bw-btn--sm.bw-btn--icon-only, .bw-btn--size-sm.bw-btn--icon-only {
147
156
  inline-size: var(--bw-size-control-height-sm);
148
157
  }
149
- .bw-btn--lg.bw-btn--icon-only {
158
+ .bw-btn--lg.bw-btn--icon-only, .bw-btn--size-lg.bw-btn--icon-only {
150
159
  inline-size: var(--bw-size-control-height-lg);
151
160
  }
152
161
  /* Flat disabled colours (COL-018 / #282), not opacity: opacity failed
@@ -429,11 +438,14 @@ select.bw-input {
429
438
  [dir="rtl"] select.bw-input {
430
439
  background-position: left var(--bw-density-control-padding-inline) center;
431
440
  }
441
+ /* background-color, not the shorthand: the shorthand also reset
442
+ * background-image, so a disabled select.bw-input lost its chevron (the
443
+ * select rule is less specific than these state rules). */
432
444
  .bw-input[readonly] {
433
- background: var(--bw-color-surface-sunken);
445
+ background-color: var(--bw-color-surface-sunken);
434
446
  }
435
447
  .bw-input:disabled {
436
- background: var(--bw-color-action-disabled-bg);
448
+ background-color: var(--bw-color-action-disabled-bg);
437
449
  color: var(--bw-color-action-disabled-text);
438
450
  border-color: var(--bw-color-action-disabled-border);
439
451
  cursor: not-allowed;
@@ -2373,11 +2385,11 @@ a.bw-stat:hover {
2373
2385
  consumer stylesheet that selects .bw-stat__trend directly; #334). */
2374
2386
  /* size arg (VIZ-027): modifiers re-point the value-size component token, so
2375
2387
  the numeral rule itself never forks. */
2376
- .bw-stat--sm {
2388
+ .bw-stat--sm, .bw-stat--size-sm {
2377
2389
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2378
2390
  padding: var(--bw-space-3);
2379
2391
  }
2380
- .bw-stat--lg {
2392
+ .bw-stat--lg, .bw-stat--size-lg {
2381
2393
  --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
2382
2394
  padding: var(--bw-space-6);
2383
2395
  }
@@ -2392,8 +2404,11 @@ a.bw-stat:hover {
2392
2404
  padding: 0;
2393
2405
  }
2394
2406
  .bw-stat--chrome-plain.bw-stat--sm,
2407
+ .bw-stat--chrome-plain.bw-stat--size-sm,
2395
2408
  .bw-stat--chrome-plain.bw-stat--lg,
2396
- .bw-stat--chrome-plain.bw-stat--md {
2409
+ .bw-stat--chrome-plain.bw-stat--size-lg,
2410
+ .bw-stat--chrome-plain.bw-stat--md,
2411
+ .bw-stat--chrome-plain.bw-stat--size-md {
2397
2412
  padding: 0;
2398
2413
  }
2399
2414
  a.bw-stat--chrome-plain:hover {
@@ -2567,11 +2582,11 @@ a.bw-stat--chrome-plain:hover {
2567
2582
  /* size arg (mirrors _stat.html's VIZ-027 seam): modifiers re-point the
2568
2583
  same value-size component token _stat.html uses, so a comparison tile
2569
2584
  sits at the same scale as a plain stat tile sharing its grid. */
2570
- .bw-stat-comparison--sm {
2585
+ .bw-stat-comparison--sm, .bw-stat-comparison--size-sm {
2571
2586
  --bw-component-stat-tile-value-size: var(--bw-font-size-2xl);
2572
2587
  padding: var(--bw-space-3);
2573
2588
  }
2574
- .bw-stat-comparison--lg {
2589
+ .bw-stat-comparison--lg, .bw-stat-comparison--size-lg {
2575
2590
  --bw-component-stat-tile-value-size: var(--bw-font-size-4xl);
2576
2591
  padding: var(--bw-space-6);
2577
2592
  }
@@ -2876,15 +2891,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
2876
2891
  }
2877
2892
  /* size arg (VIZ-010): modifiers re-point the diameter component token, the
2878
2893
  same mechanism .bw-stat--sm/--lg use for their own value-size token. */
2879
- .bw-gauge--sm {
2894
+ .bw-gauge--sm, .bw-gauge--size-sm {
2880
2895
  inline-size: var(--bw-component-gauge-diameter-sm);
2881
2896
  block-size: var(--bw-component-gauge-diameter-sm);
2882
2897
  }
2883
- .bw-gauge--md {
2898
+ .bw-gauge--md, .bw-gauge--size-md {
2884
2899
  inline-size: var(--bw-component-gauge-diameter-md);
2885
2900
  block-size: var(--bw-component-gauge-diameter-md);
2886
2901
  }
2887
- .bw-gauge--lg {
2902
+ .bw-gauge--lg, .bw-gauge--size-lg {
2888
2903
  inline-size: var(--bw-component-gauge-diameter-lg);
2889
2904
  block-size: var(--bw-component-gauge-diameter-lg);
2890
2905
  }
@@ -3643,16 +3658,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3643
3658
  /* Size modifiers (CMP-020): sm/lg re-point the max-width token (the floor
3644
3659
  * panel honours them too); full is full-viewport, gutterless, radius
3645
3660
  * squared off, and only means anything as an overlay. */
3646
- .bw-modal--sm .bw-modal__panel {
3661
+ .bw-modal--sm .bw-modal__panel, .bw-modal--size-sm .bw-modal__panel {
3647
3662
  max-inline-size: var(--bw-size-max-width-modal-sm);
3648
3663
  }
3649
- .bw-modal--lg .bw-modal__panel {
3664
+ .bw-modal--lg .bw-modal__panel, .bw-modal--size-lg .bw-modal__panel {
3650
3665
  max-inline-size: var(--bw-size-max-width-modal-lg);
3651
3666
  }
3652
- .bw-modal--full:is(.bw-modal--open, [data-bw-open]) {
3667
+ .bw-modal--full:is(.bw-modal--open, [data-bw-open]), .bw-modal--size-full:is(.bw-modal--open, [data-bw-open]) {
3653
3668
  padding: 0;
3654
3669
  }
3655
- .bw-modal--full:is(.bw-modal--open, [data-bw-open]) .bw-modal__panel {
3670
+ .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
3671
  max-inline-size: none;
3657
3672
  block-size: 100%;
3658
3673
  border-radius: var(--bw-radius-none);
@@ -3861,17 +3876,17 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3861
3876
  }
3862
3877
  }
3863
3878
  /* Size modifiers: reuse the modal's own width ramp. */
3864
- .bw-slide-over--sm .bw-slide-over__panel {
3879
+ .bw-slide-over--sm .bw-slide-over__panel, .bw-slide-over--size-sm .bw-slide-over__panel {
3865
3880
  max-inline-size: var(--bw-size-max-width-modal-sm);
3866
3881
  }
3867
3882
  /* --md is the DOCUMENTED DEFAULT and the template emits it unconditionally, so
3868
3883
  * it needs a real rule: without one the default size resolved to the panel's
3869
3884
  * base width by accident rather than by declaration (the #120 defect class,
3870
3885
  * found in the 3.0.0 options audit). */
3871
- .bw-slide-over--md .bw-slide-over__panel {
3886
+ .bw-slide-over--md .bw-slide-over__panel, .bw-slide-over--size-md .bw-slide-over__panel {
3872
3887
  max-inline-size: var(--bw-size-max-width-modal-md);
3873
3888
  }
3874
- .bw-slide-over--lg .bw-slide-over__panel {
3889
+ .bw-slide-over--lg .bw-slide-over__panel, .bw-slide-over--size-lg .bw-slide-over__panel {
3875
3890
  max-inline-size: var(--bw-size-max-width-modal-lg);
3876
3891
  }
3877
3892
  /* Sticky header: title plus the always-present close control, divided
@@ -4139,6 +4154,13 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4139
4154
  * list too (compose, never duplicate); only combobox-specific physics live
4140
4155
  * here. */
4141
4156
  .bw-combobox {
4157
+ /* Chip block size (CMB-038): the control height less the frame's own
4158
+ * block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
4159
+ * hairline border. Shared by the chip and the multiple-mode input. */
4160
+ --bw-combobox-chip-size: max(
4161
+ calc(1.5rem + 2 * var(--bw-size-border-hairline)),
4162
+ calc(var(--bw-density-control-height) - 2 * var(--bw-space-2))
4163
+ );
4142
4164
  position: relative;
4143
4165
  }
4144
4166
  /* Chips and the input share one wrapping row; the absolutely positioned
@@ -4156,6 +4178,90 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4156
4178
  inline-size: auto;
4157
4179
  min-inline-size: 0;
4158
4180
  }
4181
+ /* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
4182
+ * placeholder rule, so the UA default applied. Scoped to the combobox input;
4183
+ * opacity is reset because Firefox dims ::placeholder on top of its colour.
4184
+ * fg-muted, not fg-subtle: composed on the frame fill fg-subtle measures
4185
+ * 2.62:1 light and 3.84:1 dark, under the 4.5:1 text floor (AC-CMB-019),
4186
+ * where fg-muted clears it in both themes (combobox.md 4.3). */
4187
+ .bw-combobox__input::placeholder {
4188
+ color: var(--bw-color-fg-muted);
4189
+ opacity: 1;
4190
+ }
4191
+ /* A disabled control prompts in its disabled ink, not the live placeholder
4192
+ * colour, so the whole field reads as one inactive surface. */
4193
+ .bw-combobox__input:disabled::placeholder {
4194
+ color: var(--bw-color-action-disabled-text);
4195
+ }
4196
+ /* Multiple-mode frame (CMB-031, deliberate break, combobox.md 13.3): the chips
4197
+ * and the input share ONE frame. The frame moves from the input to the field
4198
+ * wrapper (the shared .bw-input recipe restated: control border, radius-md,
4199
+ * inset hairline, hover pre-light, accent border plus halo on focus) and
4200
+ * grows with wrapped chips (min-block-size, never a fixed height). The input
4201
+ * goes borderless so it reads as part of the field. Single mode is untouched:
4202
+ * it keeps the bare .bw-input frame (CMB-030). */
4203
+ .bw-combobox--multiple .bw-combobox__field {
4204
+ min-block-size: var(--bw-density-control-height);
4205
+ padding-block: var(--bw-space-1);
4206
+ padding-inline: var(--bw-density-control-padding-inline);
4207
+ background: var(--bw-color-surface);
4208
+ border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
4209
+ border-radius: var(--bw-radius-md);
4210
+ box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
4211
+ transition: var(--bw-transition-colors), var(--bw-transition-shadow);
4212
+ }
4213
+ .bw-combobox--multiple .bw-combobox__field:hover:where(
4214
+ :not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
4215
+ ) {
4216
+ border-color: color-mix(in oklab, var(--bw-color-border-control) 82%, var(--bw-color-fg));
4217
+ }
4218
+ .bw-combobox--multiple .bw-combobox__field:focus-within {
4219
+ border-color: var(--bw-color-accent);
4220
+ box-shadow:
4221
+ inset 0 1px 2px 0 oklch(0 0 0 / 0.04),
4222
+ 0 0 0 3px color-mix(in oklab, var(--bw-color-accent) 18%, transparent);
4223
+ }
4224
+ /* The global ring (reset.css :focus-visible) moves from the input to the
4225
+ * frame so keyboard focus is outlined at the control edge, once. */
4226
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input:focus-visible) {
4227
+ outline: 2px solid var(--bw-color-focus-ring, var(--bw-color-accent));
4228
+ outline-offset: 2px;
4229
+ }
4230
+ /* Declared after focus so the danger border persists while focused, as for
4231
+ * .bw-input. */
4232
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input[aria-invalid="true"]) {
4233
+ border-color: var(--bw-color-danger);
4234
+ }
4235
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input[readonly]) {
4236
+ background: var(--bw-color-surface-sunken);
4237
+ }
4238
+ .bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__input:disabled) {
4239
+ background: var(--bw-color-action-disabled-bg);
4240
+ border-color: var(--bw-color-action-disabled-border);
4241
+ cursor: not-allowed;
4242
+ }
4243
+ .bw-combobox--multiple .bw-combobox__input,
4244
+ .bw-combobox--multiple .bw-combobox__input:hover,
4245
+ .bw-combobox--multiple .bw-combobox__input:focus-visible,
4246
+ .bw-combobox--multiple .bw-combobox__input:disabled,
4247
+ .bw-combobox--multiple .bw-combobox__input[readonly] {
4248
+ /* The frame owns border, fill, well and ring; the input only types. The
4249
+ * block-size mirrors a chip so a wrapped row keeps one baseline rhythm. */
4250
+ /* A length literal: a typing run beside chips, no sizing-ramp step. Wide
4251
+ * enough for a short placeholder ("Add team"), so a row with no room wraps
4252
+ * the input to its own line instead of clipping the prompt. */
4253
+ flex-basis: 6rem;
4254
+ block-size: auto;
4255
+ min-block-size: var(--bw-combobox-chip-size, 1.5rem);
4256
+ padding-inline: var(--bw-space-1);
4257
+ background: transparent;
4258
+ border: 0;
4259
+ box-shadow: none;
4260
+ outline: none;
4261
+ }
4262
+ .bw-combobox--multiple .bw-combobox__input:disabled {
4263
+ color: var(--bw-color-action-disabled-text);
4264
+ }
4159
4265
  /* The listbox mirrors the dropdown panel exactly (DESIGN.md reserved rows):
4160
4266
  * raised surface, elevation-3 at z-dropdown, radius-lg, menu min-width, the
4161
4267
  * light-theme top-light (dark reset at the end of this file), bw-fade-in-up
@@ -4197,6 +4303,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4197
4303
  * stamps it on: the target listbox itself, or the requesting input beside
4198
4304
  * it. First consumer of --bw-component-htmx-indicator-opacity. */
4199
4305
  .bw-combobox__listbox.htmx-request,
4306
+ .bw-combobox__listbox[aria-busy="true"],
4200
4307
  .bw-combobox__input.htmx-request ~ .bw-combobox__listbox {
4201
4308
  opacity: var(--bw-component-htmx-indicator-opacity);
4202
4309
  }
@@ -4227,19 +4334,47 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4227
4334
  .bw-combobox__option[aria-selected="true"] {
4228
4335
  font-weight: var(--bw-font-weight-medium);
4229
4336
  }
4337
+ /* Disabled option (CMB-016): stays visible and filterable, paints the flat
4338
+ * disabled colours, shows no hover wash and cannot be chosen (the behaviour
4339
+ * skips it). The state is also carried by aria-disabled, not colour alone. */
4340
+ .bw-combobox__option[aria-disabled="true"] {
4341
+ color: var(--bw-color-action-disabled-text);
4342
+ cursor: not-allowed;
4343
+ }
4344
+ .bw-combobox__option[aria-disabled="true"]:hover {
4345
+ background-color: transparent;
4346
+ }
4347
+ /* Create row (CMB-020, GAP-CMB-16): the lead word is quiet and the echoed
4348
+ * query carries the weight, so the row reads "Create <query>". */
4349
+ .bw-combobox__option--create {
4350
+ color: var(--bw-color-fg-muted);
4351
+ }
4352
+ .bw-combobox__create-query {
4353
+ color: var(--bw-color-fg);
4354
+ font-weight: var(--bw-font-weight-medium);
4355
+ overflow-wrap: anywhere;
4356
+ }
4230
4357
  .bw-combobox__empty {
4231
4358
  padding: var(--bw-space-2) var(--bw-space-3);
4232
4359
  color: var(--bw-color-fg-muted);
4233
4360
  font-size: var(--bw-text-body-sm-size);
4234
4361
  line-height: var(--bw-text-body-sm-line-height);
4235
4362
  }
4363
+ /* Server-filter failure row (CMB-019): the same row shape as the empty
4364
+ * message, in the text-duty danger tier (the .bw-field__error precedent). */
4365
+ .bw-combobox__error {
4366
+ padding: var(--bw-space-2) var(--bw-space-3);
4367
+ color: var(--bw-color-danger-fg);
4368
+ font-size: var(--bw-text-body-sm-size);
4369
+ line-height: var(--bw-text-body-sm-line-height);
4370
+ }
4236
4371
  /* 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. */
4372
+ * radius-full, sized by --bw-combobox-chip-size (CMB-038) so a chip row sits
4373
+ * inside the control's height rather than stretching it. */
4240
4374
  .bw-combobox__chip {
4241
4375
  display: inline-flex;
4242
4376
  align-items: center;
4377
+ block-size: var(--bw-combobox-chip-size, 1.5rem);
4243
4378
  gap: var(--bw-space-1);
4244
4379
  padding-inline: var(--bw-space-3) var(--bw-space-1);
4245
4380
  background: var(--bw-state-selected-bg);
@@ -4252,13 +4387,19 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
4252
4387
  display: inline-flex;
4253
4388
  align-items: center;
4254
4389
  justify-content: center;
4255
- min-block-size: var(--bw-size-touch-target-min);
4256
- min-inline-size: var(--bw-size-touch-target-min);
4390
+ /* 1.5rem is the WCAG 2.5.8 floor (CMB-053); the chip sizes to it, so the
4391
+ * remove control no longer pushes a chip taller than the control (CMB-038,
4392
+ * GAP-CMB-10). It fills the chip's inner block size. */
4393
+ block-size: 100%;
4394
+ min-block-size: 1.5rem;
4395
+ min-inline-size: 1.5rem;
4257
4396
  padding: var(--bw-space-1);
4258
4397
  background: transparent;
4259
4398
  border: 0;
4260
4399
  border-radius: var(--bw-radius-full);
4261
- color: var(--bw-color-icon-muted);
4400
+ /* fg-muted, not icon-muted: composed on the chip fill icon-muted measures
4401
+ * 2.39:1 in light, under the 3:1 non-text floor (AC-CMB-019, CMB-054). */
4402
+ color: var(--bw-color-fg-muted);
4262
4403
  cursor: pointer;
4263
4404
  transition: var(--bw-transition-colors);
4264
4405
  }
@@ -115,8 +115,10 @@
115
115
  .bw-fg-subtle {
116
116
  color: var(--bw-color-fg-subtle);
117
117
  }
118
+ /* Page ground; the same token as the body (icvoss/brickwork#26). There is no
119
+ * --bw-color-bg token, so this resolves to the surface role. */
118
120
  .bw-bg {
119
- background-color: var(--bw-color-bg);
121
+ background-color: var(--bw-color-surface);
120
122
  }
121
123
  .bw-surface {
122
124
  background-color: var(--bw-color-surface);
package/src/reset.css CHANGED
@@ -29,7 +29,12 @@ body {
29
29
  font-size: var(--bw-text-body-md-size, 1rem);
30
30
  -webkit-font-smoothing: antialiased;
31
31
  color: var(--bw-color-fg);
32
- background-color: var(--bw-color-bg);
32
+ /* Page ground (icvoss/brickwork#26): the surface token. A prior
33
+ * var(--bw-color-bg) named a token no theme defines, so the declaration was
34
+ * invalid at computed-value time and the body stayed transparent (a white
35
+ * canvas under dark text colours). Surface is white in light and near-black
36
+ * in dark, so light output is unchanged and dark now paints its own ground. */
37
+ background-color: var(--bw-color-surface);
33
38
  }
34
39
 
35
40
  img,
package/src/wave-e.css CHANGED
@@ -122,7 +122,7 @@
122
122
  line-height: 1;
123
123
  }
124
124
 
125
- .bw-icon--lg {
125
+ .bw-icon--lg, .bw-icon--size-lg {
126
126
  inline-size: 2.5rem;
127
127
  block-size: 2.5rem;
128
128
  font-size: var(--bw-text-heading-md-size);
@@ -160,22 +160,24 @@
160
160
  border-radius: var(--bw-radius-md);
161
161
  }
162
162
 
163
- .bw-sparkline {
163
+ /* Demo bar chart only. Must not use .bw-sparkline: that class belongs to the
164
+ * product sparkline component in layers/components.css (brickwork#11). */
165
+ .bw-demo-barchart {
164
166
  display: flex;
165
167
  align-items: flex-end;
166
168
  gap: 0.35rem;
167
169
  block-size: 4rem;
168
170
  }
169
171
 
170
- .bw-sparkline > span {
172
+ .bw-demo-barchart > span {
171
173
  flex: 1;
172
174
  background: var(--bw-color-accent);
173
175
  border-radius: 2px 2px 0 0;
174
176
  opacity: 0.85;
175
177
  }
176
178
 
177
- .bw-sparkline > span:nth-child(1) { block-size: 35%; }
178
- .bw-sparkline > span:nth-child(2) { block-size: 55%; }
179
- .bw-sparkline > span:nth-child(3) { block-size: 40%; }
180
- .bw-sparkline > span:nth-child(4) { block-size: 75%; }
181
- .bw-sparkline > span:nth-child(5) { block-size: 60%; }
179
+ .bw-demo-barchart > span:nth-child(1) { block-size: 35%; }
180
+ .bw-demo-barchart > span:nth-child(2) { block-size: 55%; }
181
+ .bw-demo-barchart > span:nth-child(3) { block-size: 40%; }
182
+ .bw-demo-barchart > span:nth-child(4) { block-size: 75%; }
183
+ .bw-demo-barchart > span:nth-child(5) { block-size: 60%; }