@bwui/css 0.1.5 → 0.1.7

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.
@@ -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 four control role variables.
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
- font-size: var(--bw-text-label-size);
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 four control
3276
- * role variables at the resolved step tokens. The step tokens are the density
3277
- * control base times the kit-wide multiplier (--bw-size-step-*), so every
3278
- * density keeps three distinct heights; no rule here computes a multiplier.
3279
- * xs and xl exist in the token scale and Button does not ship them (BTN-003).
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
@@ -3626,6 +3682,10 @@ a:hover {
3626
3682
  }
3627
3683
  .bw-form__actions {
3628
3684
  display: flex;
3685
+ /* .bw-btn is white-space: nowrap (0.1.5, "a label stays on one line"), so a
3686
+ * row of buttons cannot shrink; it wraps onto further lines instead of
3687
+ * widening the document at narrow widths (icvoss/brickwork#52). */
3688
+ flex-wrap: wrap;
3629
3689
  align-items: center;
3630
3690
  gap: var(--bw-space-3);
3631
3691
  margin-block-start: var(--bw-space-2);
@@ -4977,6 +5037,7 @@ button.bw-account-menu__item {
4977
5037
  }
4978
5038
  .bw-filter-bar__actions {
4979
5039
  display: flex;
5040
+ flex-wrap: wrap;
4980
5041
  align-items: center;
4981
5042
  gap: var(--bw-space-2);
4982
5043
  }
@@ -6997,6 +7058,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
6997
7058
  * render nothing at the template, so no :empty rule is needed. */
6998
7059
  .bw-modal__footer {
6999
7060
  display: flex;
7061
+ flex-wrap: wrap;
7000
7062
  align-items: center;
7001
7063
  justify-content: flex-end;
7002
7064
  gap: var(--bw-space-3);
@@ -7207,6 +7269,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
7207
7269
  }
7208
7270
  .bw-slide-over__footer {
7209
7271
  display: flex;
7272
+ flex-wrap: wrap;
7210
7273
  align-items: center;
7211
7274
  justify-content: flex-end;
7212
7275
  gap: var(--bw-space-3);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bwui/css",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
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.5"
24
+ "@bwui/tokens": "0.1.7"
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 four control role variables.
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
- font-size: var(--bw-text-label-size);
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 four control
56
- * role variables at the resolved step tokens. The step tokens are the density
57
- * control base times the kit-wide multiplier (--bw-size-step-*), so every
58
- * density keeps three distinct heights; no rule here computes a multiplier.
59
- * xs and xl exist in the token scale and Button does not ship them (BTN-003).
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
@@ -406,6 +433,10 @@
406
433
  }
407
434
  .bw-form__actions {
408
435
  display: flex;
436
+ /* .bw-btn is white-space: nowrap (0.1.5, "a label stays on one line"), so a
437
+ * row of buttons cannot shrink; it wraps onto further lines instead of
438
+ * widening the document at narrow widths (icvoss/brickwork#52). */
439
+ flex-wrap: wrap;
409
440
  align-items: center;
410
441
  gap: var(--bw-space-3);
411
442
  margin-block-start: var(--bw-space-2);
@@ -1757,6 +1788,7 @@ button.bw-account-menu__item {
1757
1788
  }
1758
1789
  .bw-filter-bar__actions {
1759
1790
  display: flex;
1791
+ flex-wrap: wrap;
1760
1792
  align-items: center;
1761
1793
  gap: var(--bw-space-2);
1762
1794
  }
@@ -3777,6 +3809,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3777
3809
  * render nothing at the template, so no :empty rule is needed. */
3778
3810
  .bw-modal__footer {
3779
3811
  display: flex;
3812
+ flex-wrap: wrap;
3780
3813
  align-items: center;
3781
3814
  justify-content: flex-end;
3782
3815
  gap: var(--bw-space-3);
@@ -3987,6 +4020,7 @@ a.bw-ranked-list__row:focus-visible .bw-ranked-list__label {
3987
4020
  }
3988
4021
  .bw-slide-over__footer {
3989
4022
  display: flex;
4023
+ flex-wrap: wrap;
3990
4024
  align-items: center;
3991
4025
  justify-content: flex-end;
3992
4026
  gap: var(--bw-space-3);