@bwui/css 0.1.6 → 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 +259 -15
- package/package.json +2 -2
- package/src/layers/components.css +230 -15
package/dist/brickwork.css
CHANGED
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
--bw-size-step-md: 1;
|
|
52
52
|
--bw-size-step-lg: 1.125;
|
|
53
53
|
--bw-size-step-xl: 1.25;
|
|
54
|
+
--bw-size-text-step-xs: 0.875;
|
|
55
|
+
--bw-size-text-step-sm: 0.9375;
|
|
56
|
+
--bw-size-text-step-md: 1;
|
|
57
|
+
--bw-size-text-step-lg: 1.125;
|
|
58
|
+
--bw-size-text-step-xl: 1.25;
|
|
54
59
|
--bw-size-control-height-xs: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-xs)));
|
|
55
60
|
--bw-size-control-height-sm: max(1.5rem, calc(var(--bw-density-control-height) * var(--bw-size-step-sm)));
|
|
56
61
|
--bw-size-control-height-md: var(--bw-density-control-height);
|
|
@@ -71,6 +76,11 @@
|
|
|
71
76
|
--bw-size-control-gap-md: var(--bw-space-2);
|
|
72
77
|
--bw-size-control-gap-lg: var(--bw-space-3);
|
|
73
78
|
--bw-size-control-gap-xl: var(--bw-space-3);
|
|
79
|
+
--bw-size-control-font-size-xs: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xs)));
|
|
80
|
+
--bw-size-control-font-size-sm: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-sm)));
|
|
81
|
+
--bw-size-control-font-size-md: var(--bw-text-label-size);
|
|
82
|
+
--bw-size-control-font-size-lg: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-lg)));
|
|
83
|
+
--bw-size-control-font-size-xl: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xl)));
|
|
74
84
|
--bw-size-touch-target-min: 2.75rem;
|
|
75
85
|
--bw-size-max-width-prose: 65ch;
|
|
76
86
|
--bw-size-max-width-form: 32rem;
|
|
@@ -81,6 +91,7 @@
|
|
|
81
91
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
82
92
|
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
83
93
|
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
94
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
84
95
|
--bw-component-icon-size-sm: 1rem;
|
|
85
96
|
--bw-component-icon-size-md: 1.25rem;
|
|
86
97
|
--bw-component-icon-size-lg: 1.5rem;
|
|
@@ -647,10 +658,16 @@
|
|
|
647
658
|
--bw-size-control-gap-md: var(--bw-space-2);
|
|
648
659
|
--bw-size-control-gap-lg: var(--bw-space-3);
|
|
649
660
|
--bw-size-control-gap-xl: var(--bw-space-3);
|
|
661
|
+
--bw-size-control-font-size-xs: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xs)));
|
|
662
|
+
--bw-size-control-font-size-sm: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-sm)));
|
|
663
|
+
--bw-size-control-font-size-md: var(--bw-text-label-size);
|
|
664
|
+
--bw-size-control-font-size-lg: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-lg)));
|
|
665
|
+
--bw-size-control-font-size-xl: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xl)));
|
|
650
666
|
--bw-control-height: var(--bw-size-control-height-md);
|
|
651
667
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
652
668
|
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
653
669
|
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
670
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
654
671
|
}
|
|
655
672
|
|
|
656
673
|
[data-density="compact"] {
|
|
@@ -687,10 +704,16 @@
|
|
|
687
704
|
--bw-size-control-gap-md: var(--bw-space-2);
|
|
688
705
|
--bw-size-control-gap-lg: var(--bw-space-3);
|
|
689
706
|
--bw-size-control-gap-xl: var(--bw-space-3);
|
|
707
|
+
--bw-size-control-font-size-xs: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xs)));
|
|
708
|
+
--bw-size-control-font-size-sm: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-sm)));
|
|
709
|
+
--bw-size-control-font-size-md: var(--bw-text-label-size);
|
|
710
|
+
--bw-size-control-font-size-lg: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-lg)));
|
|
711
|
+
--bw-size-control-font-size-xl: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xl)));
|
|
690
712
|
--bw-control-height: var(--bw-size-control-height-md);
|
|
691
713
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
692
714
|
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
693
715
|
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
716
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
694
717
|
}
|
|
695
718
|
|
|
696
719
|
[data-density="spacious"] {
|
|
@@ -727,10 +750,16 @@
|
|
|
727
750
|
--bw-size-control-gap-md: var(--bw-space-2);
|
|
728
751
|
--bw-size-control-gap-lg: var(--bw-space-3);
|
|
729
752
|
--bw-size-control-gap-xl: var(--bw-space-3);
|
|
753
|
+
--bw-size-control-font-size-xs: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xs)));
|
|
754
|
+
--bw-size-control-font-size-sm: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-sm)));
|
|
755
|
+
--bw-size-control-font-size-md: var(--bw-text-label-size);
|
|
756
|
+
--bw-size-control-font-size-lg: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-lg)));
|
|
757
|
+
--bw-size-control-font-size-xl: max(var(--bw-font-size-xs), calc(var(--bw-text-label-size) * var(--bw-size-text-step-xl)));
|
|
730
758
|
--bw-control-height: var(--bw-size-control-height-md);
|
|
731
759
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
732
760
|
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
733
761
|
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
762
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
734
763
|
}
|
|
735
764
|
|
|
736
765
|
:root {
|
|
@@ -3239,7 +3268,7 @@ a:hover {
|
|
|
3239
3268
|
display: inline-flex;
|
|
3240
3269
|
align-items: center;
|
|
3241
3270
|
justify-content: center;
|
|
3242
|
-
/* ADR-126 section 4: the button reads only the
|
|
3271
|
+
/* ADR-126 section 4: the button reads only the five control role variables.
|
|
3243
3272
|
* They are declared on :root and in every [data-density] block (md at the
|
|
3244
3273
|
* density in force) and are inherited here, so a bare .bw-btn is md, a size
|
|
3245
3274
|
* class re-points them, and a control container can set one step for its
|
|
@@ -3252,7 +3281,11 @@ a:hover {
|
|
|
3252
3281
|
border-radius: var(--bw-component-button-radius);
|
|
3253
3282
|
font: inherit;
|
|
3254
3283
|
font-family: var(--bw-text-label-family);
|
|
3255
|
-
|
|
3284
|
+
/* Type follows the step: the size is the fifth role variable (ADR-126
|
|
3285
|
+
* section 4), the label role size at md and scaled by the text step ratio at
|
|
3286
|
+
* the other steps, never below the 12 px legibility floor. Family, weight,
|
|
3287
|
+
* line height and tracking stay the label role at every step (BTN-011). */
|
|
3288
|
+
font-size: var(--bw-control-font-size);
|
|
3256
3289
|
font-weight: var(--bw-text-label-weight);
|
|
3257
3290
|
line-height: var(--bw-text-label-line-height);
|
|
3258
3291
|
letter-spacing: var(--bw-text-label-tracking);
|
|
@@ -3272,11 +3305,17 @@ a:hover {
|
|
|
3272
3305
|
text-decoration: none;
|
|
3273
3306
|
}
|
|
3274
3307
|
/* Size classes (ADR-125 section 6, ADR-126 section 4): the grammar is
|
|
3275
|
-
* bw-<component>--size-<step>, and a size class only re-points the
|
|
3276
|
-
* role variables at the resolved step tokens
|
|
3277
|
-
*
|
|
3278
|
-
*
|
|
3279
|
-
*
|
|
3308
|
+
* bw-<component>--size-<step>, and a size class only re-points the five control
|
|
3309
|
+
* role variables at the resolved step tokens: height, padding, icon, gap and
|
|
3310
|
+
* the label font size. The box tokens are the density control base times the
|
|
3311
|
+
* kit-wide multiplier (--bw-size-step-*), so every density keeps five distinct
|
|
3312
|
+
* heights; the font size is the label role size times the gentler text
|
|
3313
|
+
* multiplier (--bw-size-text-step-*), clamped to the 12 px legibility floor.
|
|
3314
|
+
* No rule here computes a multiplier. Button earns all five steps, xs to xl
|
|
3315
|
+
* (BTN-003). The 1.5rem target floor is carried by the height tokens (compact
|
|
3316
|
+
* xs is exactly 1.5rem), not by a rule here. xs and xl have no bare spelling:
|
|
3317
|
+
* they were never shipped, so they are new-grammar only and are not part of the
|
|
3318
|
+
* deprecation window.
|
|
3280
3319
|
*
|
|
3281
3320
|
* The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
|
|
3282
3321
|
* slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
|
|
@@ -3287,23 +3326,40 @@ a:hover {
|
|
|
3287
3326
|
* md has its own rule (icvoss/django-brickwork#130) so the class that markup
|
|
3288
3327
|
* emits is named in the stylesheet, and so a button that names md keeps md
|
|
3289
3328
|
* inside a container that scoped a different step. */
|
|
3329
|
+
.bw-btn--size-xs {
|
|
3330
|
+
--bw-control-height: var(--bw-size-control-height-xs);
|
|
3331
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
|
|
3332
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xs);
|
|
3333
|
+
--bw-control-gap: var(--bw-size-control-gap-xs);
|
|
3334
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xs);
|
|
3335
|
+
}
|
|
3290
3336
|
.bw-btn--sm, .bw-btn--size-sm {
|
|
3291
3337
|
--bw-control-height: var(--bw-size-control-height-sm);
|
|
3292
3338
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
|
|
3293
3339
|
--bw-control-icon-size: var(--bw-size-control-icon-sm);
|
|
3294
3340
|
--bw-control-gap: var(--bw-size-control-gap-sm);
|
|
3341
|
+
--bw-control-font-size: var(--bw-size-control-font-size-sm);
|
|
3295
3342
|
}
|
|
3296
3343
|
.bw-btn--md, .bw-btn--size-md {
|
|
3297
3344
|
--bw-control-height: var(--bw-size-control-height-md);
|
|
3298
3345
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
3299
3346
|
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
3300
3347
|
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
3348
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
3301
3349
|
}
|
|
3302
3350
|
.bw-btn--lg, .bw-btn--size-lg {
|
|
3303
3351
|
--bw-control-height: var(--bw-size-control-height-lg);
|
|
3304
3352
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
|
|
3305
3353
|
--bw-control-icon-size: var(--bw-size-control-icon-lg);
|
|
3306
3354
|
--bw-control-gap: var(--bw-size-control-gap-lg);
|
|
3355
|
+
--bw-control-font-size: var(--bw-size-control-font-size-lg);
|
|
3356
|
+
}
|
|
3357
|
+
.bw-btn--size-xl {
|
|
3358
|
+
--bw-control-height: var(--bw-size-control-height-xl);
|
|
3359
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
|
|
3360
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xl);
|
|
3361
|
+
--bw-control-gap: var(--bw-size-control-gap-xl);
|
|
3362
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xl);
|
|
3307
3363
|
}
|
|
3308
3364
|
/* The glyph and the label are one line of content. The icon is a bw-icon, and
|
|
3309
3365
|
* a bare .bw-icon (wave-e) paints a raised box and a muted ink, which showed
|
|
@@ -7447,15 +7503,65 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7447
7503
|
* own .bw-input class. The enhanced input composes .bw-input in its class
|
|
7448
7504
|
* list too (compose, never duplicate); only combobox-specific physics live
|
|
7449
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
|
+
}
|
|
7450
7548
|
.bw-combobox {
|
|
7451
7549
|
/* Chip block size (CMB-038): the control height less the frame's own
|
|
7452
7550
|
* block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
|
|
7453
|
-
* 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. */
|
|
7454
7553
|
--bw-combobox-chip-size: max(
|
|
7455
7554
|
calc(1.5rem + 2 * var(--bw-size-border-hairline)),
|
|
7456
|
-
calc(var(--bw-
|
|
7555
|
+
calc(var(--bw-control-height) - 2 * var(--bw-space-2))
|
|
7457
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));
|
|
7458
7563
|
position: relative;
|
|
7564
|
+
font-size: var(--bw-control-font-size);
|
|
7459
7565
|
}
|
|
7460
7566
|
/* Chips and the input share one wrapping row; the absolutely positioned
|
|
7461
7567
|
* listbox anchors to it. The input trades .bw-input's full width for a
|
|
@@ -7467,10 +7573,83 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7467
7573
|
align-items: center;
|
|
7468
7574
|
gap: var(--bw-space-1);
|
|
7469
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. */
|
|
7470
7579
|
.bw-combobox__input {
|
|
7471
7580
|
flex: 1 1 var(--bw-component-menu-min-width);
|
|
7472
7581
|
inline-size: auto;
|
|
7473
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);
|
|
7474
7653
|
}
|
|
7475
7654
|
/* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
|
|
7476
7655
|
* placeholder rule, so the UA default applied. Scoped to the combobox input;
|
|
@@ -7495,15 +7674,18 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7495
7674
|
* goes borderless so it reads as part of the field. Single mode is untouched:
|
|
7496
7675
|
* it keeps the bare .bw-input frame (CMB-030). */
|
|
7497
7676
|
.bw-combobox--multiple .bw-combobox__field {
|
|
7498
|
-
min-block-size: var(--bw-
|
|
7677
|
+
min-block-size: var(--bw-control-height);
|
|
7499
7678
|
padding-block: var(--bw-space-1);
|
|
7500
|
-
padding-inline: var(--bw-
|
|
7679
|
+
padding-inline: var(--bw-control-padding-inline) var(--bw-combobox-end-gutter);
|
|
7501
7680
|
background: var(--bw-color-surface);
|
|
7502
7681
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
|
|
7503
7682
|
border-radius: var(--bw-radius-md);
|
|
7504
7683
|
box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
|
|
7505
7684
|
transition: var(--bw-transition-colors), var(--bw-transition-shadow);
|
|
7506
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
|
+
}
|
|
7507
7689
|
.bw-combobox--multiple .bw-combobox__field:hover:where(
|
|
7508
7690
|
:not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
|
|
7509
7691
|
) {
|
|
@@ -7548,6 +7730,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7548
7730
|
block-size: auto;
|
|
7549
7731
|
min-block-size: var(--bw-combobox-chip-size, 1.5rem);
|
|
7550
7732
|
padding-inline: var(--bw-space-1);
|
|
7733
|
+
font-size: var(--bw-control-font-size);
|
|
7551
7734
|
background: transparent;
|
|
7552
7735
|
border: 0;
|
|
7553
7736
|
box-shadow: none;
|
|
@@ -7610,7 +7793,9 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7610
7793
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
7611
7794
|
border-radius: var(--bw-radius-md);
|
|
7612
7795
|
color: var(--bw-color-fg);
|
|
7613
|
-
|
|
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);
|
|
7614
7799
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7615
7800
|
cursor: pointer;
|
|
7616
7801
|
transition: var(--bw-transition-colors);
|
|
@@ -7628,6 +7813,46 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7628
7813
|
.bw-combobox__option[aria-selected="true"] {
|
|
7629
7814
|
font-weight: var(--bw-font-weight-medium);
|
|
7630
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
|
+
}
|
|
7631
7856
|
/* Disabled option (CMB-016): stays visible and filterable, paints the flat
|
|
7632
7857
|
* disabled colours, shows no hover wash and cannot be chosen (the behaviour
|
|
7633
7858
|
* skips it). The state is also carried by aria-disabled, not colour alone. */
|
|
@@ -7651,7 +7876,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7651
7876
|
.bw-combobox__empty {
|
|
7652
7877
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
7653
7878
|
color: var(--bw-color-fg-muted);
|
|
7654
|
-
font-size: var(--bw-
|
|
7879
|
+
font-size: var(--bw-control-font-size);
|
|
7655
7880
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7656
7881
|
}
|
|
7657
7882
|
/* Server-filter failure row (CMB-019): the same row shape as the empty
|
|
@@ -7659,7 +7884,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7659
7884
|
.bw-combobox__error {
|
|
7660
7885
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
7661
7886
|
color: var(--bw-color-danger-fg);
|
|
7662
|
-
font-size: var(--bw-
|
|
7887
|
+
font-size: var(--bw-control-font-size);
|
|
7663
7888
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7664
7889
|
}
|
|
7665
7890
|
/* Selected-value chips (multiple mode, CMP-028): the selected wash at
|
|
@@ -7674,7 +7899,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7674
7899
|
background: var(--bw-state-selected-bg);
|
|
7675
7900
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border);
|
|
7676
7901
|
border-radius: var(--bw-radius-full);
|
|
7677
|
-
font-size: var(--bw-
|
|
7902
|
+
font-size: var(--bw-control-font-size);
|
|
7678
7903
|
line-height: var(--bw-text-body-sm-line-height);
|
|
7679
7904
|
}
|
|
7680
7905
|
.bw-combobox__chip-remove {
|
|
@@ -7697,6 +7922,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7697
7922
|
cursor: pointer;
|
|
7698
7923
|
transition: var(--bw-transition-colors);
|
|
7699
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
|
+
}
|
|
7700
7935
|
.bw-combobox__chip-remove:hover {
|
|
7701
7936
|
background-color: var(--bw-state-hover-overlay);
|
|
7702
7937
|
color: var(--bw-color-fg);
|
|
@@ -7705,6 +7940,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
7705
7940
|
background-color: var(--bw-state-active-overlay);
|
|
7706
7941
|
transition-duration: var(--bw-duration-instant);
|
|
7707
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
|
+
}
|
|
7708
7952
|
|
|
7709
7953
|
/* --- Dismissible exit (0.9.0 interaction set, CMP-010/012 adoption) ---------- */
|
|
7710
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"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
display: inline-flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: center;
|
|
22
|
-
/* ADR-126 section 4: the button reads only the
|
|
22
|
+
/* ADR-126 section 4: the button reads only the five control role variables.
|
|
23
23
|
* They are declared on :root and in every [data-density] block (md at the
|
|
24
24
|
* density in force) and are inherited here, so a bare .bw-btn is md, a size
|
|
25
25
|
* class re-points them, and a control container can set one step for its
|
|
@@ -32,7 +32,11 @@
|
|
|
32
32
|
border-radius: var(--bw-component-button-radius);
|
|
33
33
|
font: inherit;
|
|
34
34
|
font-family: var(--bw-text-label-family);
|
|
35
|
-
|
|
35
|
+
/* Type follows the step: the size is the fifth role variable (ADR-126
|
|
36
|
+
* section 4), the label role size at md and scaled by the text step ratio at
|
|
37
|
+
* the other steps, never below the 12 px legibility floor. Family, weight,
|
|
38
|
+
* line height and tracking stay the label role at every step (BTN-011). */
|
|
39
|
+
font-size: var(--bw-control-font-size);
|
|
36
40
|
font-weight: var(--bw-text-label-weight);
|
|
37
41
|
line-height: var(--bw-text-label-line-height);
|
|
38
42
|
letter-spacing: var(--bw-text-label-tracking);
|
|
@@ -52,11 +56,17 @@
|
|
|
52
56
|
text-decoration: none;
|
|
53
57
|
}
|
|
54
58
|
/* Size classes (ADR-125 section 6, ADR-126 section 4): the grammar is
|
|
55
|
-
* bw-<component>--size-<step>, and a size class only re-points the
|
|
56
|
-
* role variables at the resolved step tokens
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
59
|
+
* bw-<component>--size-<step>, and a size class only re-points the five control
|
|
60
|
+
* role variables at the resolved step tokens: height, padding, icon, gap and
|
|
61
|
+
* the label font size. The box tokens are the density control base times the
|
|
62
|
+
* kit-wide multiplier (--bw-size-step-*), so every density keeps five distinct
|
|
63
|
+
* heights; the font size is the label role size times the gentler text
|
|
64
|
+
* multiplier (--bw-size-text-step-*), clamped to the 12 px legibility floor.
|
|
65
|
+
* No rule here computes a multiplier. Button earns all five steps, xs to xl
|
|
66
|
+
* (BTN-003). The 1.5rem target floor is carried by the height tokens (compact
|
|
67
|
+
* xs is exactly 1.5rem), not by a rule here. xs and xl have no bare spelling:
|
|
68
|
+
* they were never shipped, so they are new-grammar only and are not part of the
|
|
69
|
+
* deprecation window.
|
|
60
70
|
*
|
|
61
71
|
* The bare spelling (bw-btn--sm, and the same for gauge, icon, modal,
|
|
62
72
|
* slide-over, stat and stat-comparison) is DEPRECATED. Both selectors stay in
|
|
@@ -67,23 +77,40 @@
|
|
|
67
77
|
* md has its own rule (icvoss/django-brickwork#130) so the class that markup
|
|
68
78
|
* emits is named in the stylesheet, and so a button that names md keeps md
|
|
69
79
|
* inside a container that scoped a different step. */
|
|
80
|
+
.bw-btn--size-xs {
|
|
81
|
+
--bw-control-height: var(--bw-size-control-height-xs);
|
|
82
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xs);
|
|
83
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xs);
|
|
84
|
+
--bw-control-gap: var(--bw-size-control-gap-xs);
|
|
85
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xs);
|
|
86
|
+
}
|
|
70
87
|
.bw-btn--sm, .bw-btn--size-sm {
|
|
71
88
|
--bw-control-height: var(--bw-size-control-height-sm);
|
|
72
89
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-sm);
|
|
73
90
|
--bw-control-icon-size: var(--bw-size-control-icon-sm);
|
|
74
91
|
--bw-control-gap: var(--bw-size-control-gap-sm);
|
|
92
|
+
--bw-control-font-size: var(--bw-size-control-font-size-sm);
|
|
75
93
|
}
|
|
76
94
|
.bw-btn--md, .bw-btn--size-md {
|
|
77
95
|
--bw-control-height: var(--bw-size-control-height-md);
|
|
78
96
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-md);
|
|
79
97
|
--bw-control-icon-size: var(--bw-size-control-icon-md);
|
|
80
98
|
--bw-control-gap: var(--bw-size-control-gap-md);
|
|
99
|
+
--bw-control-font-size: var(--bw-size-control-font-size-md);
|
|
81
100
|
}
|
|
82
101
|
.bw-btn--lg, .bw-btn--size-lg {
|
|
83
102
|
--bw-control-height: var(--bw-size-control-height-lg);
|
|
84
103
|
--bw-control-padding-inline: var(--bw-size-control-padding-inline-lg);
|
|
85
104
|
--bw-control-icon-size: var(--bw-size-control-icon-lg);
|
|
86
105
|
--bw-control-gap: var(--bw-size-control-gap-lg);
|
|
106
|
+
--bw-control-font-size: var(--bw-size-control-font-size-lg);
|
|
107
|
+
}
|
|
108
|
+
.bw-btn--size-xl {
|
|
109
|
+
--bw-control-height: var(--bw-size-control-height-xl);
|
|
110
|
+
--bw-control-padding-inline: var(--bw-size-control-padding-inline-xl);
|
|
111
|
+
--bw-control-icon-size: var(--bw-size-control-icon-xl);
|
|
112
|
+
--bw-control-gap: var(--bw-size-control-gap-xl);
|
|
113
|
+
--bw-control-font-size: var(--bw-size-control-font-size-xl);
|
|
87
114
|
}
|
|
88
115
|
/* The glyph and the label are one line of content. The icon is a bw-icon, and
|
|
89
116
|
* a bare .bw-icon (wave-e) paints a raised box and a muted ink, which showed
|
|
@@ -4227,15 +4254,65 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4227
4254
|
* own .bw-input class. The enhanced input composes .bw-input in its class
|
|
4228
4255
|
* list too (compose, never duplicate); only combobox-specific physics live
|
|
4229
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
|
+
}
|
|
4230
4299
|
.bw-combobox {
|
|
4231
4300
|
/* Chip block size (CMB-038): the control height less the frame's own
|
|
4232
4301
|
* block padding, never below the 1.5rem WCAG 2.5.8 target plus the chip's
|
|
4233
|
-
* 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. */
|
|
4234
4304
|
--bw-combobox-chip-size: max(
|
|
4235
4305
|
calc(1.5rem + 2 * var(--bw-size-border-hairline)),
|
|
4236
|
-
calc(var(--bw-
|
|
4306
|
+
calc(var(--bw-control-height) - 2 * var(--bw-space-2))
|
|
4237
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));
|
|
4238
4314
|
position: relative;
|
|
4315
|
+
font-size: var(--bw-control-font-size);
|
|
4239
4316
|
}
|
|
4240
4317
|
/* Chips and the input share one wrapping row; the absolutely positioned
|
|
4241
4318
|
* listbox anchors to it. The input trades .bw-input's full width for a
|
|
@@ -4247,10 +4324,83 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4247
4324
|
align-items: center;
|
|
4248
4325
|
gap: var(--bw-space-1);
|
|
4249
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. */
|
|
4250
4330
|
.bw-combobox__input {
|
|
4251
4331
|
flex: 1 1 var(--bw-component-menu-min-width);
|
|
4252
4332
|
inline-size: auto;
|
|
4253
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);
|
|
4254
4404
|
}
|
|
4255
4405
|
/* Placeholder colour (CMB-035, GAP-CMB-15): the shipped bundle had no
|
|
4256
4406
|
* placeholder rule, so the UA default applied. Scoped to the combobox input;
|
|
@@ -4275,15 +4425,18 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4275
4425
|
* goes borderless so it reads as part of the field. Single mode is untouched:
|
|
4276
4426
|
* it keeps the bare .bw-input frame (CMB-030). */
|
|
4277
4427
|
.bw-combobox--multiple .bw-combobox__field {
|
|
4278
|
-
min-block-size: var(--bw-
|
|
4428
|
+
min-block-size: var(--bw-control-height);
|
|
4279
4429
|
padding-block: var(--bw-space-1);
|
|
4280
|
-
padding-inline: var(--bw-
|
|
4430
|
+
padding-inline: var(--bw-control-padding-inline) var(--bw-combobox-end-gutter);
|
|
4281
4431
|
background: var(--bw-color-surface);
|
|
4282
4432
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border-control);
|
|
4283
4433
|
border-radius: var(--bw-radius-md);
|
|
4284
4434
|
box-shadow: inset 0 1px 2px 0 oklch(0 0 0 / 0.04);
|
|
4285
4435
|
transition: var(--bw-transition-colors), var(--bw-transition-shadow);
|
|
4286
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
|
+
}
|
|
4287
4440
|
.bw-combobox--multiple .bw-combobox__field:hover:where(
|
|
4288
4441
|
:not(:focus-within):not(:has(.bw-combobox__input:disabled, .bw-combobox__input[readonly]))
|
|
4289
4442
|
) {
|
|
@@ -4328,6 +4481,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4328
4481
|
block-size: auto;
|
|
4329
4482
|
min-block-size: var(--bw-combobox-chip-size, 1.5rem);
|
|
4330
4483
|
padding-inline: var(--bw-space-1);
|
|
4484
|
+
font-size: var(--bw-control-font-size);
|
|
4331
4485
|
background: transparent;
|
|
4332
4486
|
border: 0;
|
|
4333
4487
|
box-shadow: none;
|
|
@@ -4390,7 +4544,9 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4390
4544
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
4391
4545
|
border-radius: var(--bw-radius-md);
|
|
4392
4546
|
color: var(--bw-color-fg);
|
|
4393
|
-
|
|
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);
|
|
4394
4550
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4395
4551
|
cursor: pointer;
|
|
4396
4552
|
transition: var(--bw-transition-colors);
|
|
@@ -4408,6 +4564,46 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4408
4564
|
.bw-combobox__option[aria-selected="true"] {
|
|
4409
4565
|
font-weight: var(--bw-font-weight-medium);
|
|
4410
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
|
+
}
|
|
4411
4607
|
/* Disabled option (CMB-016): stays visible and filterable, paints the flat
|
|
4412
4608
|
* disabled colours, shows no hover wash and cannot be chosen (the behaviour
|
|
4413
4609
|
* skips it). The state is also carried by aria-disabled, not colour alone. */
|
|
@@ -4431,7 +4627,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4431
4627
|
.bw-combobox__empty {
|
|
4432
4628
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
4433
4629
|
color: var(--bw-color-fg-muted);
|
|
4434
|
-
font-size: var(--bw-
|
|
4630
|
+
font-size: var(--bw-control-font-size);
|
|
4435
4631
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4436
4632
|
}
|
|
4437
4633
|
/* Server-filter failure row (CMB-019): the same row shape as the empty
|
|
@@ -4439,7 +4635,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4439
4635
|
.bw-combobox__error {
|
|
4440
4636
|
padding: var(--bw-space-2) var(--bw-space-3);
|
|
4441
4637
|
color: var(--bw-color-danger-fg);
|
|
4442
|
-
font-size: var(--bw-
|
|
4638
|
+
font-size: var(--bw-control-font-size);
|
|
4443
4639
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4444
4640
|
}
|
|
4445
4641
|
/* Selected-value chips (multiple mode, CMP-028): the selected wash at
|
|
@@ -4454,7 +4650,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4454
4650
|
background: var(--bw-state-selected-bg);
|
|
4455
4651
|
border: var(--bw-size-border-hairline) solid var(--bw-color-border);
|
|
4456
4652
|
border-radius: var(--bw-radius-full);
|
|
4457
|
-
font-size: var(--bw-
|
|
4653
|
+
font-size: var(--bw-control-font-size);
|
|
4458
4654
|
line-height: var(--bw-text-body-sm-line-height);
|
|
4459
4655
|
}
|
|
4460
4656
|
.bw-combobox__chip-remove {
|
|
@@ -4477,6 +4673,16 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4477
4673
|
cursor: pointer;
|
|
4478
4674
|
transition: var(--bw-transition-colors);
|
|
4479
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
|
+
}
|
|
4480
4686
|
.bw-combobox__chip-remove:hover {
|
|
4481
4687
|
background-color: var(--bw-state-hover-overlay);
|
|
4482
4688
|
color: var(--bw-color-fg);
|
|
@@ -4485,6 +4691,15 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
|
|
|
4485
4691
|
background-color: var(--bw-state-active-overlay);
|
|
4486
4692
|
transition-duration: var(--bw-duration-instant);
|
|
4487
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
|
+
}
|
|
4488
4703
|
|
|
4489
4704
|
/* --- Dismissible exit (0.9.0 interaction set, CMP-010/012 adoption) ---------- */
|
|
4490
4705
|
|