@boostdev/design-system-components 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boostdev/design-system-components",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "description": "BoostDev React component library: accessible, token-driven components built on @boostdev/design-system-foundation",
5
5
  "keywords": [
6
6
  "React",
@@ -43,6 +43,7 @@ Vertically stacked sections that can be expanded and collapsed independently.
43
43
  <tr><th>Variable</th><th>Default</th><th>Description</th></tr>
44
44
  </thead>
45
45
  <tbody>
46
+ <tr><td>`--accordion_divider-color`</td><td>`var(--bds-color_on-bg--as-surface)`</td><td>Colour of the rule between items — the non-text member of the colour set (≥ 3:1), not a ground colour</td></tr>
46
47
  <tr><td>`--accordion_border`</td><td>`none`</td><td>Container border</td></tr>
47
48
  <tr><td>`--accordion_radius`</td><td>`var(--bdc-outline_radius)`</td><td>Container corner radius</td></tr>
48
49
  <tr><td>`--accordion_shadow`</td><td>`var(--bdc-outline_shadow)`</td><td>Container box-shadow tail (layered after the frame border)</td></tr>
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  .item {
16
- border-block-end: 1px solid var(--bds-color_bg--subtle);
16
+ border-block-end: 1px solid var(--accordion_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
17
17
  }
18
18
 
19
19
  .item:last-child {
@@ -40,6 +40,7 @@ Data table with optional sortable columns and caption.
40
40
  <tr><th>Variable</th><th>Default</th><th>Description</th></tr>
41
41
  </thead>
42
42
  <tbody>
43
+ <tr><td>`--table_divider-color`</td><td>`var(--bds-color_on-bg--as-surface)`</td><td>Colour of the header underline and the row rules — the non-text member of the colour set (≥ 3:1), not a ground colour</td></tr>
43
44
  <tr><td>`--table_border`</td><td>`none`</td><td>Container border</td></tr>
44
45
  <tr><td>`--table_radius`</td><td>`var(--bdc-outline_radius)`</td><td>Container corner radius</td></tr>
45
46
  <tr><td>`--table_shadow`</td><td>`var(--bdc-outline_shadow)`</td><td>Container frame shadow (appended to the inset border box-shadow)</td></tr>
@@ -41,7 +41,7 @@
41
41
  font-size: var(--table_header-font-size, var(--bds-font_size--body--s));
42
42
  color: var(--bds-color_on-bg--subtle);
43
43
  white-space: nowrap;
44
- border-block-end: 1px solid var(--bds-color_bg--subtle);
44
+ border-block-end: 1px solid var(--table_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
45
45
  }
46
46
 
47
47
  .th.--sortable {
@@ -92,7 +92,7 @@
92
92
  }
93
93
 
94
94
  .tbody .tr {
95
- border-block-end: 1px solid var(--bds-color_bg--subtle);
95
+ border-block-end: 1px solid var(--table_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
96
96
  transition: var(--bds-animation_transition);
97
97
  }
98
98
 
@@ -74,6 +74,7 @@ Defaults: hover/active text resolves to `--bds-color_interactive_on-bg`; active
74
74
  </thead>
75
75
  <tbody>
76
76
  <tr><td>`--tab_padding`</td><td>`var(--bds-space_s) var(--bds-space_m)`</td><td>Padding of each tab button.</td></tr>
77
+ <tr><td>`--tabs_divider-color`</td><td>`var(--bds-color_on-bg--as-surface)`</td><td>Colour of the rail under the tablist — the non-text member of the colour set (≥ 3:1), not a ground colour</td></tr>
77
78
  <tr><td>`--tabs_gap`</td><td>`var(--bds-space_xxs)`</td><td>Gap between tab buttons in the tablist.</td></tr>
78
79
  <tr><td>`--tabs_panel-padding`</td><td>`var(--bds-space_m)`</td><td>Block-start padding of the active panel.</td></tr>
79
80
  </tbody>
@@ -6,7 +6,7 @@
6
6
 
7
7
  .tabList {
8
8
  display: flex;
9
- border-block-end: 1px solid var(--bds-color_bg--subtle);
9
+ border-block-end: 1px solid var(--tabs_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
10
10
  gap: var(--tabs_gap, var(--bds-space_xxs));
11
11
  }
12
12
 
@@ -93,6 +93,9 @@ const NON_TEXT_MARKS: { file: string; rule: string }[] = [
93
93
  { file: 'components/ui/Separator/Separator.module.css', rule: '.separator' },
94
94
  { file: 'components/interaction/DropdownMenu/DropdownMenu.module.css', rule: '.separator' },
95
95
  { file: 'components/interaction/Drawer/Drawer.module.css', rule: '.header' },
96
+ { file: 'components/ui/Accordion/Accordion.module.css', rule: '.item' },
97
+ { file: 'components/ui/Tabs/Tabs.module.css', rule: '.tabList' },
98
+ { file: 'components/ui/Table/Table.module.css', rule: '.th' },
96
99
  ];
97
100
 
98
101
  describe('non-text marks use the as-surface member of the colour set', () => {
@@ -114,3 +117,41 @@ describe('non-text marks use the as-surface member of the colour set', () => {
114
117
  });
115
118
  }
116
119
  });
120
+
121
+ // A surface token on a hairline is the mirror of the same mistake: `bg--subtle`
122
+ // on `bg` measures 1.10:1 in light and 1.72:1 in dark, well under the 3:1 a
123
+ // non-text mark needs. Dividers must not be painted with a ground colour.
124
+ // A ground colour is correct where the border is not separating anything: the
125
+ // Loading spinner's ring is the track its coloured arc rotates against, and is
126
+ // meant to recede. The contrast that matters there is arc-vs-track, not
127
+ // track-vs-page.
128
+ const GROUND_BORDER_EXEMPTIONS = ['Loading/Loading.module.css', 'bds-loading.ts'];
129
+
130
+ describe('no component paints a hairline with a background token', () => {
131
+ const srcRoot = join(__dirname, '../');
132
+
133
+ it('component CSS and web component styles', () => {
134
+ const offenders: string[] = [];
135
+ const files = [
136
+ ...collectFiles(join(srcRoot, 'components'), '.module.css'),
137
+ ...collectFiles(join(srcRoot, 'web-components'), '.ts').filter((f) => !f.endsWith('.spec.ts')),
138
+ ];
139
+
140
+ for (const file of files) {
141
+ if (GROUND_BORDER_EXEMPTIONS.some((e) => file.endsWith(e))) continue;
142
+
143
+ const css = readFileSync(file, 'utf-8');
144
+ for (const [, side] of css.matchAll(
145
+ /border[\w-]*:\s*\d+px\s+solid\s+var\(--bds-color_(bg[\w-]*)\)/g,
146
+ )) {
147
+ offenders.push(` --bds-color_${side} in ${relative(srcRoot, file)}`);
148
+ }
149
+ }
150
+
151
+ if (offenders.length > 0) {
152
+ expect.fail(
153
+ `Hairlines painted with a ground colour (needs --bds-color_on-X--as-surface):\n${offenders.join('\n')}`,
154
+ );
155
+ }
156
+ });
157
+ });
@@ -79,6 +79,7 @@ Or in HTML without a bundler:
79
79
 
80
80
  | Property | Default | Description |
81
81
  |----------|---------|-------------|
82
+ | `--accordion_divider-color` | `var(--bds-color_on-bg--as-surface)` | Colour of the rule between items — the non-text member of the colour set (≥ 3:1), not a ground colour |
82
83
  | `--accordion_border` | `none` | Container border |
83
84
  | `--accordion_radius` | `var(--bdc-outline_radius)` | Container corner radius |
84
85
  | `--accordion_shadow` | `var(--bdc-outline_shadow)` | Container box-shadow tail (layered after the frame border) |
@@ -96,6 +96,7 @@ across every state; set `--tab_color--active` to theme only the selected tab.
96
96
 
97
97
  | Property | Description |
98
98
  |----------|-------------|
99
+ | `--tabs_divider-color` | Colour of the rail under the tablist (default: `--bds-color_on-bg--as-surface`, the non-text member of the set — ≥ 3:1, not a ground colour) |
99
100
  | `--tab_color` | Tab text colour override (all states) |
100
101
  | `--tab_border-color` | Tab bottom-border colour override (all states) |
101
102
  | `--tab_color--active` | Text colour override for the selected tab |
@@ -39,7 +39,7 @@ export class BdsAccordionItem extends LitElement {
39
39
 
40
40
  :host {
41
41
  display: block;
42
- border-block-end: 1px solid var(--bds-color_bg--subtle);
42
+ border-block-end: 1px solid var(--accordion_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
43
43
  }
44
44
 
45
45
  :host(:last-child) {
@@ -43,7 +43,7 @@ export class BdsTabs extends LitElement {
43
43
 
44
44
  .tablist {
45
45
  display: flex;
46
- border-block-end: 1px solid var(--bds-color_bg--subtle);
46
+ border-block-end: 1px solid var(--tabs_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
47
47
  gap: var(--bds-space_xxs);
48
48
  }
49
49
  `;
@@ -56,6 +56,7 @@ import '@boostdev/design-system-components/web-components';
56
56
 
57
57
  | Property | Description |
58
58
  |----------|-------------|
59
+ | `--table_divider-color` | Colour of the header underline and row rules (default: `--bds-color_on-bg--as-surface`, the non-text member of the set — ≥ 3:1, not a ground colour) |
59
60
  | `--table_border` | Wrapper border (default: `none`) |
60
61
  | `--table_radius` | Wrapper corner radius (default: `var(--bdc-outline_radius)`, itself set to `var(--bds-border_radius--s)` on the wrapper) |
61
62
  | `--table_row-bg--hover` | Row background on hover, pointer devices only (default: `var(--bds-color_bg--subtle)`) |
@@ -20,13 +20,13 @@ const tableLightDomCss = `
20
20
  font-size: var(--bds-font_size--body--s);
21
21
  text-align: start;
22
22
  color: var(--bds-color_on-bg--subtle);
23
- border-block-end: 1px solid var(--bds-color_bg--subtle);
23
+ border-block-end: 1px solid var(--table_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
24
24
  white-space: nowrap;
25
25
  }
26
26
 
27
27
  bds-table > table td {
28
28
  padding: var(--bds-space_s) var(--bds-space_m);
29
- border-block-end: 1px solid var(--bds-color_bg--subtle);
29
+ border-block-end: 1px solid var(--table_divider-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_bg--subtle))));
30
30
  vertical-align: middle;
31
31
  }
32
32