@bwui/css 0.1.7 → 0.1.8
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/dist/brickwork.css +196 -8
- package/package.json +2 -2
- package/src/layers/components.css +196 -8
package/dist/brickwork.css
CHANGED
|
@@ -7503,15 +7503,65 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7503
7503
|
* own .bw-input class. The enhanced input composes .bw-input in its class
|
|
7504
7504
|
* list too (compose, never duplicate); only combobox-specific physics live
|
|
7505
7505
|
* here. */
|
|
7506
|
+
/* Size (CMB-002, ADR-125, ADR-126): the combobox reads only the control role
|
|
7507
|
+
* variables (height, padding-inline, icon size, gap, font size). They are
|
|
7508
|
+
* declared on :root and re-emitted in every [data-density] block, so a bare
|
|
7509
|
+
* combobox is md at the density in force; bw-combobox--size-<step> re-points
|
|
7510
|
+
* them for the whole control, so the frame, the chips, the option rows, the
|
|
7511
|
+
* chevron and the clear control all follow one step and the text scales with
|
|
7512
|
+
* it. The grammar is the kit's one size class grammar (no bare spelling). */
|
|
7513
|
+
.bw-combobox--size-xs {
|
|
7514
|
+
--bw-control-height: var(--bw-size-control-height-xs);
|
|
7515
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
|
|
7516
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xs);
|
|
7517
|
+
--bw-control-gap: var(--bw-size-control-gap-xs);
|
|
7518
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xs);
|
|
7519
|
+
}
|
|
7520
|
+
.bw-combobox--size-sm {
|
|
7521
|
+
--bw-control-height: var(--bw-size-control-height-sm);
|
|
7522
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
|
|
7523
|
+
--bw-control-icon-size: var(--bw-size-control-icon-sm);
|
|
7524
|
+
--bw-control-gap: var(--bw-size-control-gap-sm);
|
|
7525
|
+
--bw-control-font-size: var(--bw-size-control-font-size-sm);
|
|
7526
|
+
}
|
|
7527
|
+
.bw-combobox--size-md {
|
|
7528
|
+
--bw-control-height: var(--bw-size-control-height-md);
|
|
7529
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
7530
|
+
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
7531
|
+
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
7532
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
7533
|
+
}
|
|
7534
|
+
.bw-combobox--size-lg {
|
|
7535
|
+
--bw-control-height: var(--bw-size-control-height-lg);
|
|
7536
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
|
|
7537
|
+
--bw-control-icon-size: var(--bw-size-control-icon-lg);
|
|
7538
|
+
--bw-control-gap: var(--bw-size-control-gap-lg);
|
|
7539
|
+
--bw-control-font-size: var(--bw-size-control-font-size-lg);
|
|
7540
|
+
}
|
|
7541
|
+
.bw-combobox--size-xl {
|
|
7542
|
+
--bw-control-height: var(--bw-size-control-height-xl);
|
|
7543
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
|
|
7544
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xl);
|
|
7545
|
+
--bw-control-gap: var(--bw-size-control-gap-xl);
|
|
7546
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xl);
|
|
7547
|
+
}
|
|
7506
7548
|
.bw-combobox {
|
|
7507
7549
|
/* Chip block size (CMB-038): the control height less the frame's own
|
|
7508
7550
|
* block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
|
|
7509
|
-
* hairline border. Shared by the chip and the multiple-mode input.
|
|
7551
|
+
* hairline border. Shared by the chip and the multiple-mode input. It
|
|
7552
|
+
* reads the role variable, so it follows the size step. */
|
|
7510
7553
|
--bw-combobox-chip-size: max(
|
|
7511
7554
|
calc(1.5rem + 2 * var(--bw-size-border-hairline)),
|
|
7512
|
-
calc(var(--bw-
|
|
7555
|
+
calc(var(--bw-control-height) - 2 * var(--bw-space-2))
|
|
7513
7556
|
);
|
|
7557
|
+
/* The clear control's square: the step's icon plus its own padding, never
|
|
7558
|
+
* under the 1.5rem WCAG 2.5.8 floor (CMB-053). */
|
|
7559
|
+
--bw-combobox-clear-size: max(1.5rem, calc(var(--bw-control-icon-size) + 2 * var(--bw-space-1)));
|
|
7560
|
+
/* Room kept at the inline end for the chevron (padding, glyph, breathing
|
|
7561
|
+
* space); the clear control adds its own square when it is shown. */
|
|
7562
|
+
--bw-combobox-end-gutter: calc(var(--bw-control-padding-inline) + var(--bw-control-icon-size) + var(--bw-space-1));
|
|
7514
7563
|
position: relative;
|
|
7564
|
+
font-size: var(--bw-control-font-size);
|
|
7515
7565
|
}
|
|
7516
7566
|
/* Chips and the input share one wrapping row; the absolutely positioned
|
|
7517
7567
|
* listbox anchors to it. The input trades .bw-input's full width for a
|
|
@@ -7523,10 +7573,83 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7523
7573
|
align-items: center;
|
|
7524
7574
|
gap: var(--bw-space-1);
|
|
7525
7575
|
}
|
|
7576
|
+
/* The frame reads the role variables (CMB-002), not the density tokens, so the
|
|
7577
|
+
* size step resizes it; the text takes the step's font size. The end padding
|
|
7578
|
+
* clears the chevron, and the clear control when it is shown. */
|
|
7526
7579
|
.bw-combobox__input {
|
|
7527
7580
|
flex: 1 1 var(--bw-component-menu-min-width);
|
|
7528
7581
|
inline-size: auto;
|
|
7529
7582
|
min-inline-size: 0;
|
|
7583
|
+
block-size: var(--bw-control-height);
|
|
7584
|
+
padding-inline: var(--bw-control-padding-inline) var(--bw-combobox-end-gutter);
|
|
7585
|
+
font-size: var(--bw-control-font-size);
|
|
7586
|
+
}
|
|
7587
|
+
.bw-combobox:not(.bw-combobox--multiple) .bw-combobox__field:has(.bw-combobox__clear:not([hidden])) .bw-combobox__input {
|
|
7588
|
+
padding-inline-end: calc(var(--bw-combobox-end-gutter) + var(--bw-combobox-clear-size));
|
|
7589
|
+
}
|
|
7590
|
+
/* Open affordance (CMB-034): the same chevron token as bw-select, drawn as a
|
|
7591
|
+
* pseudo-element at the inline end so it mirrors under RTL with logical
|
|
7592
|
+
* offsets and needs no markup. Visual only: the whole input is the click
|
|
7593
|
+
* target, so it takes no pointer events. It turns over while the list is
|
|
7594
|
+
* open. A read-only control cannot open, so it shows no chevron. */
|
|
7595
|
+
.bw-combobox__field::after {
|
|
7596
|
+
content: "";
|
|
7597
|
+
position: absolute;
|
|
7598
|
+
inset-inline-end: var(--bw-control-padding-inline);
|
|
7599
|
+
inset-block-start: calc(var(--bw-control-height) / 2);
|
|
7600
|
+
inline-size: var(--bw-control-icon-size);
|
|
7601
|
+
block-size: var(--bw-control-icon-size);
|
|
7602
|
+
background-image: var(--bw-component-select-indicator);
|
|
7603
|
+
background-repeat: no-repeat;
|
|
7604
|
+
background-position: center;
|
|
7605
|
+
background-size: contain;
|
|
7606
|
+
translate: 0 -50%;
|
|
7607
|
+
pointer-events: none;
|
|
7608
|
+
transition: var(--bw-transition-transform);
|
|
7609
|
+
}
|
|
7610
|
+
.bw-combobox[data-bw-open] .bw-combobox__field::after {
|
|
7611
|
+
rotate: 180deg;
|
|
7612
|
+
}
|
|
7613
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly])::after {
|
|
7614
|
+
display: none;
|
|
7615
|
+
}
|
|
7616
|
+
/* Clear control (CMB-015): an icon-only button seated just inside the chevron,
|
|
7617
|
+
* centred on the first row of the frame. It is rendered with the hidden
|
|
7618
|
+
* attribute and shown only while there is a value or a query and the control
|
|
7619
|
+
* is operable. fg-muted on the frame fill, as for the chip remove. */
|
|
7620
|
+
.bw-combobox__clear {
|
|
7621
|
+
position: absolute;
|
|
7622
|
+
inset-inline-end: calc(var(--bw-control-padding-inline) + var(--bw-control-icon-size));
|
|
7623
|
+
inset-block-start: calc(var(--bw-control-height) / 2);
|
|
7624
|
+
translate: 0 -50%;
|
|
7625
|
+
display: inline-flex;
|
|
7626
|
+
align-items: center;
|
|
7627
|
+
justify-content: center;
|
|
7628
|
+
inline-size: var(--bw-combobox-clear-size);
|
|
7629
|
+
block-size: var(--bw-combobox-clear-size);
|
|
7630
|
+
padding: 0;
|
|
7631
|
+
background: transparent;
|
|
7632
|
+
border: 0;
|
|
7633
|
+
border-radius: var(--bw-radius-full);
|
|
7634
|
+
color: var(--bw-color-fg-muted);
|
|
7635
|
+
cursor: pointer;
|
|
7636
|
+
transition: var(--bw-transition-colors);
|
|
7637
|
+
}
|
|
7638
|
+
.bw-combobox__clear .bw-icon,
|
|
7639
|
+
.bw-combobox__clear svg {
|
|
7640
|
+
inline-size: var(--bw-control-icon-size);
|
|
7641
|
+
block-size: var(--bw-control-icon-size);
|
|
7642
|
+
background: transparent;
|
|
7643
|
+
border-radius: 0;
|
|
7644
|
+
color: inherit;
|
|
7645
|
+
}
|
|
7646
|
+
.bw-combobox__clear:hover {
|
|
7647
|
+
background-color: var(--bw-state-hover-overlay);
|
|
7648
|
+
color: var(--bw-color-fg);
|
|
7649
|
+
}
|
|
7650
|
+
.bw-combobox__clear:active {
|
|
7651
|
+
background-color: var(--bw-state-active-overlay);
|
|
7652
|
+
transition-duration: var(--bw-duration-instant);
|
|
7530
7653
|
}
|
|
7531
7654
|
/* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
|
|
7532
7655
|
* placeholder rule, so the UA default applied. Scoped to the combobox input;
|
|
@@ -7551,15 +7674,18 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7551
7674
|
* goes borderless so it reads as part of the field. Single mode is untouched:
|
|
7552
7675
|
* it keeps the bare .bw-input frame (CMB-030). */
|
|
7553
7676
|
.bw-combobox--multiple .bw-combobox__field {
|
|
7554
|
-
min-block-size: var(--bw-
|
|
7677
|
+
min-block-size: var(--bw-control-height);
|
|
7555
7678
|
padding-block: var(--bw-space-1);
|
|
7556
|
-
padding-inline: var(--bw-
|
|
7679
|
+
padding-inline: var(--bw-control-padding-inline) var(--bw-combobox-end-gutter);
|
|
7557
7680
|
background: var(--bw-color-surface);
|
|
7558
7681
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
|
|
7559
7682
|
border-radius: var(--bw-radius-md);
|
|
7560
7683
|
box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
|
|
7561
7684
|
transition: var(--bw-transition-colors), var(--bw-transition-shadow);
|
|
7562
7685
|
}
|
|
7686
|
+
.bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__clear:not([hidden])) {
|
|
7687
|
+
padding-inline-end: calc(var(--bw-combobox-end-gutter) + var(--bw-combobox-clear-size));
|
|
7688
|
+
}
|
|
7563
7689
|
.bw-combobox--multiple .bw-combobox__field:hover:where(
|
|
7564
7690
|
:not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
|
|
7565
7691
|
) {
|
|
@@ -7604,6 +7730,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7604
7730
|
block-size: auto;
|
|
7605
7731
|
min-block-size: var(--bw-combobox-chip-size, 1.5rem);
|
|
7606
7732
|
padding-inline: var(--bw-space-1);
|
|
7733
|
+
font-size: var(--bw-control-font-size);
|
|
7607
7734
|
background: transparent;
|
|
7608
7735
|
border: 0;
|
|
7609
7736
|
box-shadow: none;
|
|
@@ -7666,7 +7793,9 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7666
7793
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
7667
7794
|
border-radius: var(--bw-radius-md);
|
|
7668
7795
|
color: var(--bw-color-fg);
|
|
7669
|
-
|
|
7796
|
+
/* The rows follow the control's step so a larger control lists larger text
|
|
7797
|
+
* (CMB-038); the line height stays the body-sm leading ratio. */
|
|
7798
|
+
font-size: var(--bw-control-font-size);
|
|
7670
7799
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7671
7800
|
cursor: pointer;
|
|
7672
7801
|
transition: var(--bw-transition-colors);
|
|
@@ -7684,6 +7813,46 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7684
7813
|
.bw-combobox__option[aria-selected="true"] {
|
|
7685
7814
|
font-weight: var(--bw-font-weight-medium);
|
|
7686
7815
|
}
|
|
7816
|
+
/* Selected check (CMB-033): in multiple mode a chosen row also shows a check at
|
|
7817
|
+
* its inline end, so selection is not carried by weight alone (CMB-054). It is
|
|
7818
|
+
* a mask over currentColor, so it takes the row's ink in both themes and needs
|
|
7819
|
+
* no markup or raw colour. */
|
|
7820
|
+
.bw-combobox__listbox[aria-multiselectable="true"] .bw-combobox__option[aria-selected="true"]::after {
|
|
7821
|
+
content: "";
|
|
7822
|
+
flex: none;
|
|
7823
|
+
margin-inline-start: auto;
|
|
7824
|
+
inline-size: var(--bw-control-icon-size);
|
|
7825
|
+
block-size: var(--bw-control-icon-size);
|
|
7826
|
+
background-color: currentColor;
|
|
7827
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
7828
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
7829
|
+
}
|
|
7830
|
+
/* Groups (CMB-017): a wrapper row (presentation) holds the heading and a
|
|
7831
|
+
* role="group" list of options. The wrapper is hidden while none of its
|
|
7832
|
+
* options is visible; arrow movement never lands on a heading because it is
|
|
7833
|
+
* not an option. The heading is the quiet label tier. */
|
|
7834
|
+
.bw-combobox__group {
|
|
7835
|
+
margin: 0;
|
|
7836
|
+
padding: 0;
|
|
7837
|
+
list-style: none;
|
|
7838
|
+
}
|
|
7839
|
+
.bw-combobox__group + .bw-combobox__group,
|
|
7840
|
+
.bw-combobox__option + .bw-combobox__group {
|
|
7841
|
+
margin-block-start: var(--bw-space-1);
|
|
7842
|
+
}
|
|
7843
|
+
.bw-combobox__group-label {
|
|
7844
|
+
display: block;
|
|
7845
|
+
padding: var(--bw-space-2) var(--bw-space-3) var(--bw-space-1);
|
|
7846
|
+
color: var(--bw-color-fg-muted);
|
|
7847
|
+
font-size: var(--bw-control-font-size);
|
|
7848
|
+
font-weight: var(--bw-font-weight-medium);
|
|
7849
|
+
line-height: var(--bw-text-body-sm-line-height);
|
|
7850
|
+
}
|
|
7851
|
+
.bw-combobox__group-options {
|
|
7852
|
+
margin: 0;
|
|
7853
|
+
padding: 0;
|
|
7854
|
+
list-style: none;
|
|
7855
|
+
}
|
|
7687
7856
|
/* Disabled option (CMB-016): stays visible and filterable, paints the flat
|
|
7688
7857
|
* disabled colours, shows no hover wash and cannot be chosen (the behaviour
|
|
7689
7858
|
* skips it). The state is also carried by aria-disabled, not colour alone. */
|
|
@@ -7707,7 +7876,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7707
7876
|
.bw-combobox__empty {
|
|
7708
7877
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
7709
7878
|
color: var(--bw-color-fg-muted);
|
|
7710
|
-
font-size: var(--bw-
|
|
7879
|
+
font-size: var(--bw-control-font-size);
|
|
7711
7880
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7712
7881
|
}
|
|
7713
7882
|
/* Server-filter failure row (CMB-019): the same row shape as the empty
|
|
@@ -7715,7 +7884,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7715
7884
|
.bw-combobox__error {
|
|
7716
7885
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
7717
7886
|
color: var(--bw-color-danger-fg);
|
|
7718
|
-
font-size: var(--bw-
|
|
7887
|
+
font-size: var(--bw-control-font-size);
|
|
7719
7888
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7720
7889
|
}
|
|
7721
7890
|
/* Selected-value chips (multiple mode, CMP-028): the selected wash at
|
|
@@ -7730,7 +7899,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7730
7899
|
background: var(--bw-state-selected-bg);
|
|
7731
7900
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border);
|
|
7732
7901
|
border-radius: var(--bw-radius-full);
|
|
7733
|
-
font-size: var(--bw-
|
|
7902
|
+
font-size: var(--bw-control-font-size);
|
|
7734
7903
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7735
7904
|
}
|
|
7736
7905
|
.bw-combobox__chip-remove {
|
|
@@ -7753,6 +7922,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7753
7922
|
cursor: pointer;
|
|
7754
7923
|
transition: var(--bw-transition-colors);
|
|
7755
7924
|
}
|
|
7925
|
+
/* The glyph follows the step, like the clear control's: the wave-e .bw-icon box
|
|
7926
|
+
* (a raised fill and a larger default) must not show inside a chip. */
|
|
7927
|
+
.bw-combobox__chip-remove .bw-icon,
|
|
7928
|
+
.bw-combobox__chip-remove svg {
|
|
7929
|
+
inline-size: var(--bw-control-icon-size);
|
|
7930
|
+
block-size: var(--bw-control-icon-size);
|
|
7931
|
+
background: transparent;
|
|
7932
|
+
border-radius: 0;
|
|
7933
|
+
color: inherit;
|
|
7934
|
+
}
|
|
7756
7935
|
.bw-combobox__chip-remove:hover {
|
|
7757
7936
|
background-color: var(--bw-state-hover-overlay);
|
|
7758
7937
|
color: var(--bw-color-fg);
|
|
@@ -7761,6 +7940,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7761
7940
|
background-color: var(--bw-state-active-overlay);
|
|
7762
7941
|
transition-duration: var(--bw-duration-instant);
|
|
7763
7942
|
}
|
|
7943
|
+
/* Read-only or disabled (CMB-024, CMB-025): chips stay as text; their remove
|
|
7944
|
+
* controls and the clear control are not operable, so they are not shown. */
|
|
7945
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly], .bw-combobox__input:disabled) .bw-combobox__chip-remove,
|
|
7946
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly], .bw-combobox__input:disabled) .bw-combobox__clear {
|
|
7947
|
+
display: none;
|
|
7948
|
+
}
|
|
7949
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly], .bw-combobox__input:disabled) .bw-combobox__chip {
|
|
7950
|
+
padding-inline-end: var(--bw-space-3);
|
|
7951
|
+
}
|
|
7764
7952
|
|
|
7765
7953
|
/* --- Dismissible exit (0.9.0 interaction set, CMP-010/012 adoption) ---------- */
|
|
7766
7954
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bwui/css",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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.
|
|
24
|
+
"@bwui/tokens": "0.1.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"tsx": "^4.19.2"
|
|
@@ -4254,15 +4254,65 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4254
4254
|
* own .bw-input class. The enhanced input composes .bw-input in its class
|
|
4255
4255
|
* list too (compose, never duplicate); only combobox-specific physics live
|
|
4256
4256
|
* here. */
|
|
4257
|
+
/* Size (CMB-002, ADR-125, ADR-126): the combobox reads only the control role
|
|
4258
|
+
* variables (height, padding-inline, icon size, gap, font size). They are
|
|
4259
|
+
* declared on :root and re-emitted in every [data-density] block, so a bare
|
|
4260
|
+
* combobox is md at the density in force; bw-combobox--size-<step> re-points
|
|
4261
|
+
* them for the whole control, so the frame, the chips, the option rows, the
|
|
4262
|
+
* chevron and the clear control all follow one step and the text scales with
|
|
4263
|
+
* it. The grammar is the kit's one size class grammar (no bare spelling). */
|
|
4264
|
+
.bw-combobox--size-xs {
|
|
4265
|
+
--bw-control-height: var(--bw-size-control-height-xs);
|
|
4266
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
|
|
4267
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xs);
|
|
4268
|
+
--bw-control-gap: var(--bw-size-control-gap-xs);
|
|
4269
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xs);
|
|
4270
|
+
}
|
|
4271
|
+
.bw-combobox--size-sm {
|
|
4272
|
+
--bw-control-height: var(--bw-size-control-height-sm);
|
|
4273
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
|
|
4274
|
+
--bw-control-icon-size: var(--bw-size-control-icon-sm);
|
|
4275
|
+
--bw-control-gap: var(--bw-size-control-gap-sm);
|
|
4276
|
+
--bw-control-font-size: var(--bw-size-control-font-size-sm);
|
|
4277
|
+
}
|
|
4278
|
+
.bw-combobox--size-md {
|
|
4279
|
+
--bw-control-height: var(--bw-size-control-height-md);
|
|
4280
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
4281
|
+
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
4282
|
+
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
4283
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
4284
|
+
}
|
|
4285
|
+
.bw-combobox--size-lg {
|
|
4286
|
+
--bw-control-height: var(--bw-size-control-height-lg);
|
|
4287
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
|
|
4288
|
+
--bw-control-icon-size: var(--bw-size-control-icon-lg);
|
|
4289
|
+
--bw-control-gap: var(--bw-size-control-gap-lg);
|
|
4290
|
+
--bw-control-font-size: var(--bw-size-control-font-size-lg);
|
|
4291
|
+
}
|
|
4292
|
+
.bw-combobox--size-xl {
|
|
4293
|
+
--bw-control-height: var(--bw-size-control-height-xl);
|
|
4294
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
|
|
4295
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xl);
|
|
4296
|
+
--bw-control-gap: var(--bw-size-control-gap-xl);
|
|
4297
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xl);
|
|
4298
|
+
}
|
|
4257
4299
|
.bw-combobox {
|
|
4258
4300
|
/* Chip block size (CMB-038): the control height less the frame's own
|
|
4259
4301
|
* block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
|
|
4260
|
-
* hairline border. Shared by the chip and the multiple-mode input.
|
|
4302
|
+
* hairline border. Shared by the chip and the multiple-mode input. It
|
|
4303
|
+
* reads the role variable, so it follows the size step. */
|
|
4261
4304
|
--bw-combobox-chip-size: max(
|
|
4262
4305
|
calc(1.5rem + 2 * var(--bw-size-border-hairline)),
|
|
4263
|
-
calc(var(--bw-
|
|
4306
|
+
calc(var(--bw-control-height) - 2 * var(--bw-space-2))
|
|
4264
4307
|
);
|
|
4308
|
+
/* The clear control's square: the step's icon plus its own padding, never
|
|
4309
|
+
* under the 1.5rem WCAG 2.5.8 floor (CMB-053). */
|
|
4310
|
+
--bw-combobox-clear-size: max(1.5rem, calc(var(--bw-control-icon-size) + 2 * var(--bw-space-1)));
|
|
4311
|
+
/* Room kept at the inline end for the chevron (padding, glyph, breathing
|
|
4312
|
+
* space); the clear control adds its own square when it is shown. */
|
|
4313
|
+
--bw-combobox-end-gutter: calc(var(--bw-control-padding-inline) + var(--bw-control-icon-size) + var(--bw-space-1));
|
|
4265
4314
|
position: relative;
|
|
4315
|
+
font-size: var(--bw-control-font-size);
|
|
4266
4316
|
}
|
|
4267
4317
|
/* Chips and the input share one wrapping row; the absolutely positioned
|
|
4268
4318
|
* listbox anchors to it. The input trades .bw-input's full width for a
|
|
@@ -4274,10 +4324,83 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4274
4324
|
align-items: center;
|
|
4275
4325
|
gap: var(--bw-space-1);
|
|
4276
4326
|
}
|
|
4327
|
+
/* The frame reads the role variables (CMB-002), not the density tokens, so the
|
|
4328
|
+
* size step resizes it; the text takes the step's font size. The end padding
|
|
4329
|
+
* clears the chevron, and the clear control when it is shown. */
|
|
4277
4330
|
.bw-combobox__input {
|
|
4278
4331
|
flex: 1 1 var(--bw-component-menu-min-width);
|
|
4279
4332
|
inline-size: auto;
|
|
4280
4333
|
min-inline-size: 0;
|
|
4334
|
+
block-size: var(--bw-control-height);
|
|
4335
|
+
padding-inline: var(--bw-control-padding-inline) var(--bw-combobox-end-gutter);
|
|
4336
|
+
font-size: var(--bw-control-font-size);
|
|
4337
|
+
}
|
|
4338
|
+
.bw-combobox:not(.bw-combobox--multiple) .bw-combobox__field:has(.bw-combobox__clear:not([hidden])) .bw-combobox__input {
|
|
4339
|
+
padding-inline-end: calc(var(--bw-combobox-end-gutter) + var(--bw-combobox-clear-size));
|
|
4340
|
+
}
|
|
4341
|
+
/* Open affordance (CMB-034): the same chevron token as bw-select, drawn as a
|
|
4342
|
+
* pseudo-element at the inline end so it mirrors under RTL with logical
|
|
4343
|
+
* offsets and needs no markup. Visual only: the whole input is the click
|
|
4344
|
+
* target, so it takes no pointer events. It turns over while the list is
|
|
4345
|
+
* open. A read-only control cannot open, so it shows no chevron. */
|
|
4346
|
+
.bw-combobox__field::after {
|
|
4347
|
+
content: "";
|
|
4348
|
+
position: absolute;
|
|
4349
|
+
inset-inline-end: var(--bw-control-padding-inline);
|
|
4350
|
+
inset-block-start: calc(var(--bw-control-height) / 2);
|
|
4351
|
+
inline-size: var(--bw-control-icon-size);
|
|
4352
|
+
block-size: var(--bw-control-icon-size);
|
|
4353
|
+
background-image: var(--bw-component-select-indicator);
|
|
4354
|
+
background-repeat: no-repeat;
|
|
4355
|
+
background-position: center;
|
|
4356
|
+
background-size: contain;
|
|
4357
|
+
translate: 0 -50%;
|
|
4358
|
+
pointer-events: none;
|
|
4359
|
+
transition: var(--bw-transition-transform);
|
|
4360
|
+
}
|
|
4361
|
+
.bw-combobox[data-bw-open] .bw-combobox__field::after {
|
|
4362
|
+
rotate: 180deg;
|
|
4363
|
+
}
|
|
4364
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly])::after {
|
|
4365
|
+
display: none;
|
|
4366
|
+
}
|
|
4367
|
+
/* Clear control (CMB-015): an icon-only button seated just inside the chevron,
|
|
4368
|
+
* centred on the first row of the frame. It is rendered with the hidden
|
|
4369
|
+
* attribute and shown only while there is a value or a query and the control
|
|
4370
|
+
* is operable. fg-muted on the frame fill, as for the chip remove. */
|
|
4371
|
+
.bw-combobox__clear {
|
|
4372
|
+
position: absolute;
|
|
4373
|
+
inset-inline-end: calc(var(--bw-control-padding-inline) + var(--bw-control-icon-size));
|
|
4374
|
+
inset-block-start: calc(var(--bw-control-height) / 2);
|
|
4375
|
+
translate: 0 -50%;
|
|
4376
|
+
display: inline-flex;
|
|
4377
|
+
align-items: center;
|
|
4378
|
+
justify-content: center;
|
|
4379
|
+
inline-size: var(--bw-combobox-clear-size);
|
|
4380
|
+
block-size: var(--bw-combobox-clear-size);
|
|
4381
|
+
padding: 0;
|
|
4382
|
+
background: transparent;
|
|
4383
|
+
border: 0;
|
|
4384
|
+
border-radius: var(--bw-radius-full);
|
|
4385
|
+
color: var(--bw-color-fg-muted);
|
|
4386
|
+
cursor: pointer;
|
|
4387
|
+
transition: var(--bw-transition-colors);
|
|
4388
|
+
}
|
|
4389
|
+
.bw-combobox__clear .bw-icon,
|
|
4390
|
+
.bw-combobox__clear svg {
|
|
4391
|
+
inline-size: var(--bw-control-icon-size);
|
|
4392
|
+
block-size: var(--bw-control-icon-size);
|
|
4393
|
+
background: transparent;
|
|
4394
|
+
border-radius: 0;
|
|
4395
|
+
color: inherit;
|
|
4396
|
+
}
|
|
4397
|
+
.bw-combobox__clear:hover {
|
|
4398
|
+
background-color: var(--bw-state-hover-overlay);
|
|
4399
|
+
color: var(--bw-color-fg);
|
|
4400
|
+
}
|
|
4401
|
+
.bw-combobox__clear:active {
|
|
4402
|
+
background-color: var(--bw-state-active-overlay);
|
|
4403
|
+
transition-duration: var(--bw-duration-instant);
|
|
4281
4404
|
}
|
|
4282
4405
|
/* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
|
|
4283
4406
|
* placeholder rule, so the UA default applied. Scoped to the combobox input;
|
|
@@ -4302,15 +4425,18 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4302
4425
|
* goes borderless so it reads as part of the field. Single mode is untouched:
|
|
4303
4426
|
* it keeps the bare .bw-input frame (CMB-030). */
|
|
4304
4427
|
.bw-combobox--multiple .bw-combobox__field {
|
|
4305
|
-
min-block-size: var(--bw-
|
|
4428
|
+
min-block-size: var(--bw-control-height);
|
|
4306
4429
|
padding-block: var(--bw-space-1);
|
|
4307
|
-
padding-inline: var(--bw-
|
|
4430
|
+
padding-inline: var(--bw-control-padding-inline) var(--bw-combobox-end-gutter);
|
|
4308
4431
|
background: var(--bw-color-surface);
|
|
4309
4432
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
|
|
4310
4433
|
border-radius: var(--bw-radius-md);
|
|
4311
4434
|
box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
|
|
4312
4435
|
transition: var(--bw-transition-colors), var(--bw-transition-shadow);
|
|
4313
4436
|
}
|
|
4437
|
+
.bw-combobox--multiple .bw-combobox__field:has(.bw-combobox__clear:not([hidden])) {
|
|
4438
|
+
padding-inline-end: calc(var(--bw-combobox-end-gutter) + var(--bw-combobox-clear-size));
|
|
4439
|
+
}
|
|
4314
4440
|
.bw-combobox--multiple .bw-combobox__field:hover:where(
|
|
4315
4441
|
:not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
|
|
4316
4442
|
) {
|
|
@@ -4355,6 +4481,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4355
4481
|
block-size: auto;
|
|
4356
4482
|
min-block-size: var(--bw-combobox-chip-size, 1.5rem);
|
|
4357
4483
|
padding-inline: var(--bw-space-1);
|
|
4484
|
+
font-size: var(--bw-control-font-size);
|
|
4358
4485
|
background: transparent;
|
|
4359
4486
|
border: 0;
|
|
4360
4487
|
box-shadow: none;
|
|
@@ -4417,7 +4544,9 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4417
4544
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
4418
4545
|
border-radius: var(--bw-radius-md);
|
|
4419
4546
|
color: var(--bw-color-fg);
|
|
4420
|
-
|
|
4547
|
+
/* The rows follow the control's step so a larger control lists larger text
|
|
4548
|
+
* (CMB-038); the line height stays the body-sm leading ratio. */
|
|
4549
|
+
font-size: var(--bw-control-font-size);
|
|
4421
4550
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4422
4551
|
cursor: pointer;
|
|
4423
4552
|
transition: var(--bw-transition-colors);
|
|
@@ -4435,6 +4564,46 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4435
4564
|
.bw-combobox__option[aria-selected="true"] {
|
|
4436
4565
|
font-weight: var(--bw-font-weight-medium);
|
|
4437
4566
|
}
|
|
4567
|
+
/* Selected check (CMB-033): in multiple mode a chosen row also shows a check at
|
|
4568
|
+
* its inline end, so selection is not carried by weight alone (CMB-054). It is
|
|
4569
|
+
* a mask over currentColor, so it takes the row's ink in both themes and needs
|
|
4570
|
+
* no markup or raw colour. */
|
|
4571
|
+
.bw-combobox__listbox[aria-multiselectable="true"] .bw-combobox__option[aria-selected="true"]::after {
|
|
4572
|
+
content: "";
|
|
4573
|
+
flex: none;
|
|
4574
|
+
margin-inline-start: auto;
|
|
4575
|
+
inline-size: var(--bw-control-icon-size);
|
|
4576
|
+
block-size: var(--bw-control-icon-size);
|
|
4577
|
+
background-color: currentColor;
|
|
4578
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
4579
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
4580
|
+
}
|
|
4581
|
+
/* Groups (CMB-017): a wrapper row (presentation) holds the heading and a
|
|
4582
|
+
* role="group" list of options. The wrapper is hidden while none of its
|
|
4583
|
+
* options is visible; arrow movement never lands on a heading because it is
|
|
4584
|
+
* not an option. The heading is the quiet label tier. */
|
|
4585
|
+
.bw-combobox__group {
|
|
4586
|
+
margin: 0;
|
|
4587
|
+
padding: 0;
|
|
4588
|
+
list-style: none;
|
|
4589
|
+
}
|
|
4590
|
+
.bw-combobox__group + .bw-combobox__group,
|
|
4591
|
+
.bw-combobox__option + .bw-combobox__group {
|
|
4592
|
+
margin-block-start: var(--bw-space-1);
|
|
4593
|
+
}
|
|
4594
|
+
.bw-combobox__group-label {
|
|
4595
|
+
display: block;
|
|
4596
|
+
padding: var(--bw-space-2) var(--bw-space-3) var(--bw-space-1);
|
|
4597
|
+
color: var(--bw-color-fg-muted);
|
|
4598
|
+
font-size: var(--bw-control-font-size);
|
|
4599
|
+
font-weight: var(--bw-font-weight-medium);
|
|
4600
|
+
line-height: var(--bw-text-body-sm-line-height);
|
|
4601
|
+
}
|
|
4602
|
+
.bw-combobox__group-options {
|
|
4603
|
+
margin: 0;
|
|
4604
|
+
padding: 0;
|
|
4605
|
+
list-style: none;
|
|
4606
|
+
}
|
|
4438
4607
|
/* Disabled option (CMB-016): stays visible and filterable, paints the flat
|
|
4439
4608
|
* disabled colours, shows no hover wash and cannot be chosen (the behaviour
|
|
4440
4609
|
* skips it). The state is also carried by aria-disabled, not colour alone. */
|
|
@@ -4458,7 +4627,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4458
4627
|
.bw-combobox__empty {
|
|
4459
4628
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
4460
4629
|
color: var(--bw-color-fg-muted);
|
|
4461
|
-
font-size: var(--bw-
|
|
4630
|
+
font-size: var(--bw-control-font-size);
|
|
4462
4631
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4463
4632
|
}
|
|
4464
4633
|
/* Server-filter failure row (CMB-019): the same row shape as the empty
|
|
@@ -4466,7 +4635,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4466
4635
|
.bw-combobox__error {
|
|
4467
4636
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
4468
4637
|
color: var(--bw-color-danger-fg);
|
|
4469
|
-
font-size: var(--bw-
|
|
4638
|
+
font-size: var(--bw-control-font-size);
|
|
4470
4639
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4471
4640
|
}
|
|
4472
4641
|
/* Selected-value chips (multiple mode, CMP-028): the selected wash at
|
|
@@ -4481,7 +4650,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4481
4650
|
background: var(--bw-state-selected-bg);
|
|
4482
4651
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border);
|
|
4483
4652
|
border-radius: var(--bw-radius-full);
|
|
4484
|
-
font-size: var(--bw-
|
|
4653
|
+
font-size: var(--bw-control-font-size);
|
|
4485
4654
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4486
4655
|
}
|
|
4487
4656
|
.bw-combobox__chip-remove {
|
|
@@ -4504,6 +4673,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4504
4673
|
cursor: pointer;
|
|
4505
4674
|
transition: var(--bw-transition-colors);
|
|
4506
4675
|
}
|
|
4676
|
+
/* The glyph follows the step, like the clear control's: the wave-e .bw-icon box
|
|
4677
|
+
* (a raised fill and a larger default) must not show inside a chip. */
|
|
4678
|
+
.bw-combobox__chip-remove .bw-icon,
|
|
4679
|
+
.bw-combobox__chip-remove svg {
|
|
4680
|
+
inline-size: var(--bw-control-icon-size);
|
|
4681
|
+
block-size: var(--bw-control-icon-size);
|
|
4682
|
+
background: transparent;
|
|
4683
|
+
border-radius: 0;
|
|
4684
|
+
color: inherit;
|
|
4685
|
+
}
|
|
4507
4686
|
.bw-combobox__chip-remove:hover {
|
|
4508
4687
|
background-color: var(--bw-state-hover-overlay);
|
|
4509
4688
|
color: var(--bw-color-fg);
|
|
@@ -4512,6 +4691,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4512
4691
|
background-color: var(--bw-state-active-overlay);
|
|
4513
4692
|
transition-duration: var(--bw-duration-instant);
|
|
4514
4693
|
}
|
|
4694
|
+
/* Read-only or disabled (CMB-024, CMB-025): chips stay as text; their remove
|
|
4695
|
+
* controls and the clear control are not operable, so they are not shown. */
|
|
4696
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly], .bw-combobox__input:disabled) .bw-combobox__chip-remove,
|
|
4697
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly], .bw-combobox__input:disabled) .bw-combobox__clear {
|
|
4698
|
+
display: none;
|
|
4699
|
+
}
|
|
4700
|
+
.bw-combobox__field:has(.bw-combobox__input[readonly], .bw-combobox__input:disabled) .bw-combobox__chip {
|
|
4701
|
+
padding-inline-end: var(--bw-space-3);
|
|
4702
|
+
}
|
|
4515
4703
|
|
|
4516
4704
|
/* --- Dismissible exit (0.9.0 interaction set, CMP-010/012 adoption) ---------- */
|
|
4517
4705
|
|