@boostdev/design-system-components 2.16.0 → 2.18.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/AGENTS.md +5 -2
- package/dist/client.cjs +57 -57
- package/dist/client.css +641 -631
- package/dist/client.js +57 -57
- package/dist/index.cjs +57 -57
- package/dist/index.css +641 -631
- package/dist/index.js +57 -57
- package/dist/web-components/{chunk-XI2U6U26.js → chunk-2FNCV46J.js} +4 -5
- package/dist/web-components/{chunk-SYNLFKD3.js → chunk-3LQKFSMR.js} +6 -0
- package/dist/web-components/{chunk-RZH5IVB5.js → chunk-5ATTKUCP.js} +2 -2
- package/dist/web-components/{chunk-XJU7KITO.js → chunk-5QA7JOC3.js} +4 -5
- package/dist/web-components/{chunk-EYCW7TKB.js → chunk-7GEAT2TY.js} +4 -5
- package/dist/web-components/chunk-FYTISJN3.js +18 -0
- package/dist/web-components/{chunk-LHFUXZ52.js → chunk-ISV56UWR.js} +4 -8
- package/dist/web-components/{chunk-YLDQOESI.js → chunk-K3VK6VEL.js} +6 -5
- package/dist/web-components/{chunk-GQNQBEYR.js → chunk-QZMFNJSN.js} +4 -5
- package/dist/web-components/{chunk-BPYKZVDK.js → chunk-SJLMW2VR.js} +2 -2
- package/dist/web-components/{chunk-GPJWLAKU.js → chunk-VGPJ5L6N.js} +6 -5
- package/dist/web-components/{chunk-AGI6YQRC.js → chunk-WOFGYU6E.js} +4 -5
- package/dist/web-components/{chunk-2MJTO2IW.js → chunk-WWWJCSXN.js} +2 -2
- package/dist/web-components/index.js +13 -12
- package/dist/web-components/interaction/form/bds-checkbox-group.js +1 -1
- package/dist/web-components/interaction/form/bds-combobox.js +2 -1
- package/dist/web-components/interaction/form/bds-form-input.js +2 -1
- package/dist/web-components/interaction/form/bds-number-input.js +2 -1
- package/dist/web-components/interaction/form/bds-radio-group.js +1 -1
- package/dist/web-components/interaction/form/bds-select.js +2 -1
- package/dist/web-components/interaction/form/bds-slider.js +2 -1
- package/dist/web-components/interaction/form/bds-textarea.js +2 -1
- package/dist/web-components/ui/bds-alert.js +1 -1
- package/dist/web-components/ui/bds-badge.js +1 -1
- package/dist/web-components/ui/bds-notification-banner.js +1 -1
- package/dist/web-components/ui/bds-rating.js +1 -1
- package/package.json +1 -1
- package/src/components/interaction/Rating/Rating.mdx +4 -1
- package/src/components/interaction/Rating/Rating.module.css +9 -0
- package/src/components/interaction/Rating/Rating.spec.tsx +9 -0
- package/src/components/interaction/form/Checkbox/Checkbox.tsx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.mdx +1 -1
- package/src/components/interaction/form/CheckboxGroup/CheckboxGroup.spec.tsx +5 -0
- package/src/components/interaction/form/Combobox/Combobox.mdx +2 -0
- package/src/components/interaction/form/FormInput/FormInput.mdx +4 -0
- package/src/components/interaction/form/NumberInput/NumberInput.mdx +2 -0
- package/src/components/interaction/form/Radio/Radio.tsx +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.mdx +1 -1
- package/src/components/interaction/form/RadioGroup/RadioGroup.spec.tsx +5 -0
- package/src/components/interaction/form/Select/Select.mdx +2 -0
- package/src/components/interaction/form/Slider/Slider.mdx +2 -0
- package/src/components/interaction/form/Switch/Switch.tsx +1 -1
- package/src/components/interaction/form/Textarea/Textarea.mdx +2 -0
- package/src/components/interaction/form/atoms/Label.module.css +10 -0
- package/src/components/interaction/form/atoms/Label.spec.tsx +48 -0
- package/src/components/interaction/form/atoms/Label.stories.tsx +3 -0
- package/src/components/interaction/form/atoms/Label.tsx +4 -2
- package/src/components/ui/Alert/Alert.mdx +1 -1
- package/src/components/ui/Alert/Alert.module.css +2 -2
- package/src/components/ui/Alert/Alert.spec.tsx +6 -0
- package/src/components/ui/Badge/Badge.mdx +1 -1
- package/src/components/ui/Badge/Badge.module.css +2 -2
- package/src/components/ui/Badge/Badge.spec.tsx +8 -0
- package/src/components/ui/NotificationBanner/NotificationBanner.mdx +13 -1
- package/src/components/ui/NotificationBanner/NotificationBanner.module.css +2 -2
- package/src/components/ui/NotificationBanner/NotificationBanner.spec.tsx +6 -0
- package/src/test/token-contract.spec.ts +1 -0
- package/src/web-components/interaction/form/BdsCheckboxGroup.mdx +14 -0
- package/src/web-components/interaction/form/BdsCombobox.mdx +4 -0
- package/src/web-components/interaction/form/BdsFormInput.mdx +4 -0
- package/src/web-components/interaction/form/BdsNumberInput.mdx +4 -0
- package/src/web-components/interaction/form/BdsRadioGroup.mdx +11 -1
- package/src/web-components/interaction/form/BdsSelect.mdx +4 -0
- package/src/web-components/interaction/form/BdsSlider.mdx +4 -0
- package/src/web-components/interaction/form/BdsTextarea.mdx +4 -0
- package/src/web-components/interaction/form/bds-checkbox-group.spec.ts +11 -1
- package/src/web-components/interaction/form/bds-checkbox-group.ts +6 -5
- package/src/web-components/interaction/form/bds-combobox.ts +2 -5
- package/src/web-components/interaction/form/bds-form-input.ts +2 -5
- package/src/web-components/interaction/form/bds-number-input.ts +2 -5
- package/src/web-components/interaction/form/bds-radio-group.spec.ts +11 -1
- package/src/web-components/interaction/form/bds-radio-group.ts +6 -5
- package/src/web-components/interaction/form/bds-select.ts +2 -5
- package/src/web-components/interaction/form/bds-slider.ts +2 -8
- package/src/web-components/interaction/form/bds-textarea.ts +2 -5
- package/src/web-components/interaction/form/field-label.spec.ts +42 -0
- package/src/web-components/interaction/form/field-label.ts +20 -0
- package/src/web-components/test/helpers.ts +20 -0
- package/src/web-components/ui/BdsAlert.mdx +1 -0
- package/src/web-components/ui/BdsBadge.mdx +1 -0
- package/src/web-components/ui/BdsNotificationBanner.mdx +1 -1
- package/src/web-components/ui/BdsRating.mdx +4 -1
- package/src/web-components/ui/bds-alert.spec.ts +7 -0
- package/src/web-components/ui/bds-alert.ts +2 -2
- package/src/web-components/ui/bds-badge.spec.ts +6 -0
- package/src/web-components/ui/bds-badge.ts +2 -2
- package/src/web-components/ui/bds-notification-banner.spec.ts +7 -0
- package/src/web-components/ui/bds-notification-banner.ts +2 -2
- package/src/web-components/ui/bds-rating.spec.ts +7 -0
- package/src/web-components/ui/bds-rating.ts +6 -0
|
@@ -62,8 +62,8 @@ var BdsAlert = class extends i2 {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
:host([variant='error']) .alert {
|
|
65
|
-
--alert_bg--variant: var(--alert_bg--error,
|
|
66
|
-
--alert_text--variant: var(--alert_text--error, var(--bds-color_on-
|
|
65
|
+
--alert_bg--variant: var(--alert_bg--error, var(--bds-color_error--subtle));
|
|
66
|
+
--alert_text--variant: var(--alert_text--error, var(--bds-color_on-error--subtle));
|
|
67
67
|
--alert_border--variant: var(--alert_border--error, var(--bds-color_error));
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fieldLabelStyles
|
|
3
|
+
} from "./chunk-FYTISJN3.js";
|
|
1
4
|
import {
|
|
2
5
|
fieldMessageStyles,
|
|
3
6
|
renderFieldMessage
|
|
@@ -33,11 +36,6 @@ var BdsSelect = class extends i2 {
|
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
.label {
|
|
36
|
-
display: block;
|
|
37
|
-
font-size: var(--bds-font_size--body--s);
|
|
38
|
-
font-family: var(--bds-font_family--body);
|
|
39
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
40
|
-
color: var(--bds-color_on-bg);
|
|
41
39
|
margin-block-end: var(--bds-space_xxs);
|
|
42
40
|
}
|
|
43
41
|
|
|
@@ -102,6 +100,7 @@ var BdsSelect = class extends i2 {
|
|
|
102
100
|
block-size: 100%;
|
|
103
101
|
}
|
|
104
102
|
|
|
103
|
+
${fieldLabelStyles}
|
|
105
104
|
${fieldMessageStyles}
|
|
106
105
|
`;
|
|
107
106
|
static properties = {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fieldLabelStyles
|
|
3
|
+
} from "./chunk-FYTISJN3.js";
|
|
1
4
|
import {
|
|
2
5
|
fieldMessageStyles,
|
|
3
6
|
renderFieldMessage
|
|
@@ -32,11 +35,6 @@ var BdsTextarea = class extends i2 {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
.label {
|
|
35
|
-
display: block;
|
|
36
|
-
font-size: var(--bds-font_size--body--s);
|
|
37
|
-
font-family: var(--bds-font_family--body);
|
|
38
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
39
|
-
color: var(--bds-color_on-bg);
|
|
40
38
|
margin-block-end: var(--bds-space_xxs);
|
|
41
39
|
}
|
|
42
40
|
|
|
@@ -91,6 +89,7 @@ var BdsTextarea = class extends i2 {
|
|
|
91
89
|
--bdc-outline_width: var(--bdc-outline_width--error, 2px);
|
|
92
90
|
}
|
|
93
91
|
|
|
92
|
+
${fieldLabelStyles}
|
|
94
93
|
${fieldMessageStyles}
|
|
95
94
|
`;
|
|
96
95
|
static properties = {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
i
|
|
3
|
+
} from "./chunk-LGEZYFUU.js";
|
|
4
|
+
|
|
5
|
+
// src/web-components/interaction/form/field-label.ts
|
|
6
|
+
var fieldLabelStyles = i`
|
|
7
|
+
.label {
|
|
8
|
+
display: block;
|
|
9
|
+
font-family: var(--formLabel_font-family, var(--bds-font_family--body));
|
|
10
|
+
font-size: var(--formLabel_font-size, var(--bds-font_size--body--s));
|
|
11
|
+
font-weight: var(--formLabel_font-weight, var(--bds-font_weight--semibold));
|
|
12
|
+
color: var(--formLabel_color, var(--bds-color_on-bg));
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
fieldLabelStyles
|
|
18
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fieldLabelStyles
|
|
3
|
+
} from "./chunk-FYTISJN3.js";
|
|
1
4
|
import {
|
|
2
5
|
fieldMessageStyles,
|
|
3
6
|
renderFieldMessage
|
|
@@ -38,14 +41,6 @@ var BdsSlider = class extends i2 {
|
|
|
38
41
|
margin-block-end: var(--bds-space_xxs);
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
.label {
|
|
42
|
-
display: block;
|
|
43
|
-
font-size: var(--bds-font_size--body--s);
|
|
44
|
-
font-family: var(--bds-font_family--body);
|
|
45
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
46
|
-
color: var(--bds-color_on-bg);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
44
|
.value {
|
|
50
45
|
font-size: var(--bds-font_size--body--s);
|
|
51
46
|
font-variant-numeric: tabular-nums;
|
|
@@ -135,6 +130,7 @@ var BdsSlider = class extends i2 {
|
|
|
135
130
|
}
|
|
136
131
|
}
|
|
137
132
|
|
|
133
|
+
${fieldLabelStyles}
|
|
138
134
|
${fieldMessageStyles}
|
|
139
135
|
`;
|
|
140
136
|
static properties = {
|
|
@@ -33,11 +33,12 @@ var BdsRadioGroup = class extends i2 {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.legend {
|
|
36
|
-
|
|
37
|
-
font-family: var(--bds-font_family--body);
|
|
38
|
-
font-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
padding: 0;
|
|
37
|
+
font-family: var(--radioGroup_legend-font-family, var(--bds-font_family--body));
|
|
38
|
+
font-size: var(--radioGroup_legend-font-size, var(--bds-font_size--body--s));
|
|
39
|
+
font-weight: var(--radioGroup_legend-font-weight, var(--bds-font_weight--medium));
|
|
40
|
+
color: var(--radioGroup_legend-color, var(--bds-color_on-bg));
|
|
41
|
+
margin-block-end: var(--radioGroup_legend-gap, var(--bds-space_xs));
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
.required {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fieldLabelStyles
|
|
3
|
+
} from "./chunk-FYTISJN3.js";
|
|
1
4
|
import {
|
|
2
5
|
fieldMessageStyles,
|
|
3
6
|
renderFieldMessage
|
|
@@ -32,11 +35,6 @@ var BdsNumberInput = class extends i2 {
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
.label {
|
|
35
|
-
display: block;
|
|
36
|
-
font-size: var(--bds-font_size--body--s);
|
|
37
|
-
font-family: var(--bds-font_family--body);
|
|
38
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
39
|
-
color: var(--bds-color_on-bg);
|
|
40
38
|
margin-block-end: var(--bds-space_xxs);
|
|
41
39
|
}
|
|
42
40
|
|
|
@@ -143,6 +141,7 @@ var BdsNumberInput = class extends i2 {
|
|
|
143
141
|
color: var(--numberInput_stepper-color, var(--bds-color_interactive));
|
|
144
142
|
}
|
|
145
143
|
|
|
144
|
+
${fieldLabelStyles}
|
|
146
145
|
${fieldMessageStyles}
|
|
147
146
|
`;
|
|
148
147
|
static properties = {
|
|
@@ -45,8 +45,8 @@ var BdsBadge = class extends i2 {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
:host([variant='secondary']) .badge {
|
|
48
|
-
--badge_bg--variant: var(--badge_bg--secondary, var(--bds-
|
|
49
|
-
--badge_text--variant: var(--badge_text--secondary, var(--bds-color_on-
|
|
48
|
+
--badge_bg--variant: var(--badge_bg--secondary, var(--bds-color_grey));
|
|
49
|
+
--badge_text--variant: var(--badge_text--secondary, var(--bds-color_on-grey));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
:host([variant='success']) .badge {
|
|
@@ -38,11 +38,12 @@ var BdsCheckboxGroup = class extends i2 {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
.legend {
|
|
41
|
-
|
|
42
|
-
font-family: var(--bds-font_family--body);
|
|
43
|
-
font-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
padding: 0;
|
|
42
|
+
font-family: var(--checkboxGroup_legend-font-family, var(--bds-font_family--body));
|
|
43
|
+
font-size: var(--checkboxGroup_legend-font-size, var(--bds-font_size--body--s));
|
|
44
|
+
font-weight: var(--checkboxGroup_legend-font-weight, var(--bds-font_weight--medium));
|
|
45
|
+
color: var(--checkboxGroup_legend-color, var(--bds-color_on-bg));
|
|
46
|
+
margin-block-end: var(--checkboxGroup_legend-gap, var(--bds-space_xs));
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
.required {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fieldLabelStyles
|
|
3
|
+
} from "./chunk-FYTISJN3.js";
|
|
1
4
|
import {
|
|
2
5
|
fieldMessageStyles,
|
|
3
6
|
renderFieldMessage
|
|
@@ -36,11 +39,6 @@ var BdsFormInput = class extends i2 {
|
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.label {
|
|
39
|
-
display: block;
|
|
40
|
-
font-size: var(--bds-font_size--body--s);
|
|
41
|
-
font-family: var(--bds-font_family--body);
|
|
42
|
-
font-weight: var(--bds-font_weight--semibold);
|
|
43
|
-
color: var(--bds-color_on-bg);
|
|
44
42
|
margin-block-end: var(--bds-space_xxs);
|
|
45
43
|
}
|
|
46
44
|
|
|
@@ -126,6 +124,7 @@ var BdsFormInput = class extends i2 {
|
|
|
126
124
|
display: none;
|
|
127
125
|
}
|
|
128
126
|
|
|
127
|
+
${fieldLabelStyles}
|
|
129
128
|
${fieldMessageStyles}
|
|
130
129
|
`;
|
|
131
130
|
static properties = {
|
|
@@ -55,8 +55,8 @@ var BdsNotificationBanner = class extends i2 {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
:host([variant='error']) .banner {
|
|
58
|
-
--banner_bg--variant: var(--banner_bg--error,
|
|
59
|
-
--banner_text--variant: var(--banner_text--error, var(--bds-color_on-
|
|
58
|
+
--banner_bg--variant: var(--banner_bg--error, var(--bds-color_error--subtle));
|
|
59
|
+
--banner_text--variant: var(--banner_text--error, var(--bds-color_on-error--subtle));
|
|
60
60
|
--banner_border--variant: var(--banner_border--error, var(--bds-color_error));
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -6,22 +6,22 @@ import {
|
|
|
6
6
|
} from "./chunk-3FSGP35V.js";
|
|
7
7
|
import {
|
|
8
8
|
BdsRadioGroup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K3VK6VEL.js";
|
|
10
10
|
import {
|
|
11
11
|
BdsSegmentedControl
|
|
12
12
|
} from "./chunk-NTQ4TCUT.js";
|
|
13
13
|
import {
|
|
14
14
|
BdsSelect
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5QA7JOC3.js";
|
|
16
16
|
import {
|
|
17
17
|
BdsSlider
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ISV56UWR.js";
|
|
19
19
|
import {
|
|
20
20
|
BdsSwitch
|
|
21
21
|
} from "./chunk-CKCPV347.js";
|
|
22
22
|
import {
|
|
23
23
|
BdsTextarea
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7GEAT2TY.js";
|
|
25
25
|
import {
|
|
26
26
|
BdsGrid
|
|
27
27
|
} from "./chunk-ITD2MV5K.js";
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
} from "./chunk-4MB2ICSK.js";
|
|
34
34
|
import {
|
|
35
35
|
BdsCheckboxGroup
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-VGPJ5L6N.js";
|
|
37
37
|
import {
|
|
38
38
|
BdsCombobox
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-2FNCV46J.js";
|
|
40
40
|
import {
|
|
41
41
|
BdsFieldGroup
|
|
42
42
|
} from "./chunk-SEO2F5KJ.js";
|
|
@@ -45,10 +45,11 @@ import {
|
|
|
45
45
|
} from "./chunk-KZPRFY5P.js";
|
|
46
46
|
import {
|
|
47
47
|
BdsFormInput
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-WOFGYU6E.js";
|
|
49
49
|
import {
|
|
50
50
|
BdsNumberInput
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-QZMFNJSN.js";
|
|
52
|
+
import "./chunk-FYTISJN3.js";
|
|
52
53
|
import "./chunk-SRKQ6GST.js";
|
|
53
54
|
import {
|
|
54
55
|
BdsDropdownMenuItem
|
|
@@ -109,7 +110,7 @@ import {
|
|
|
109
110
|
} from "./chunk-7ZOJ7N4E.js";
|
|
110
111
|
import {
|
|
111
112
|
BdsRating
|
|
112
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-3LQKFSMR.js";
|
|
113
114
|
import {
|
|
114
115
|
BdsSectionHeader
|
|
115
116
|
} from "./chunk-DGOCPKHI.js";
|
|
@@ -158,17 +159,17 @@ import {
|
|
|
158
159
|
} from "./chunk-AIBOHNDU.js";
|
|
159
160
|
import {
|
|
160
161
|
BdsNotificationBanner
|
|
161
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-WWWJCSXN.js";
|
|
162
163
|
import "./chunk-7VXRMCAL.js";
|
|
163
164
|
import {
|
|
164
165
|
BdsAlert
|
|
165
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-5ATTKUCP.js";
|
|
166
167
|
import {
|
|
167
168
|
BdsAvatar
|
|
168
169
|
} from "./chunk-IKAJLROF.js";
|
|
169
170
|
import {
|
|
170
171
|
BdsBadge
|
|
171
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-SJLMW2VR.js";
|
|
172
173
|
import {
|
|
173
174
|
BdsBreadcrumb
|
|
174
175
|
} from "./chunk-62NK3ZSC.js";
|
package/package.json
CHANGED
|
@@ -40,8 +40,11 @@ Read-only star rating display. Use to show an existing score; for user input, co
|
|
|
40
40
|
<tr><th>Variable</th><th>Default</th><th>Description</th></tr>
|
|
41
41
|
</thead>
|
|
42
42
|
<tbody>
|
|
43
|
-
<tr><td>`--rating_color`</td><td>`var(--bds-color_bg)`</td><td>Empty star
|
|
43
|
+
<tr><td>`--rating_color`</td><td>`var(--bds-color_bg)`</td><td>Empty star fill</td></tr>
|
|
44
44
|
<tr><td>`--rating_color--filled`</td><td>`var(--bds-color_warning)`</td><td>Filled star colour</td></tr>
|
|
45
|
+
<tr><td>`--rating_stroke-color`</td><td>`var(--bds-color_on-bg--as-surface)`</td><td>Empty star outline, a non-text mark (falls back to `--bds-color_on-bg--border`, then `--bds-color_on-bg`, on foundations before 2.3.0)</td></tr>
|
|
46
|
+
<tr><td>`--rating_stroke-color--filled`</td><td>`currentcolor`</td><td>Filled star outline, the filled colour by default so both kinds keep the same size</td></tr>
|
|
47
|
+
<tr><td>`--rating_stroke-width`</td><td>`var(--bdc-outline_width)`</td><td>Outline width, in the star's 24-unit viewBox</td></tr>
|
|
45
48
|
</tbody>
|
|
46
49
|
</table>
|
|
47
50
|
|
|
@@ -5,12 +5,21 @@
|
|
|
5
5
|
color: var(--rating_color, var(--bds-color_bg));
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
/* Empty stars are outlined, filled stars solid: the two differ in shape, not
|
|
9
|
+
only in hue, because the as-surface grey and the warning fill are close in
|
|
10
|
+
lightness. The outline is a non-text mark, so it takes the as-surface
|
|
11
|
+
member (>= 3:1 on the page). Filled stars stroke in their own colour so
|
|
12
|
+
both kinds keep the same size. */
|
|
8
13
|
.star {
|
|
9
14
|
inline-size: 1.5em;
|
|
10
15
|
block-size: 1.5em;
|
|
16
|
+
stroke: var(--rating_stroke-color, var(--bds-color_on-bg--as-surface, var(--bds-color_on-bg--border, var(--bds-color_on-bg))));
|
|
17
|
+
stroke-width: var(--rating_stroke-width, var(--bdc-outline_width));
|
|
18
|
+
stroke-linejoin: round;
|
|
11
19
|
}
|
|
12
20
|
|
|
13
21
|
.--filled {
|
|
14
22
|
color: var(--rating_color--filled, var(--bds-color_warning));
|
|
23
|
+
stroke: var(--rating_stroke-color--filled, currentcolor);
|
|
15
24
|
}
|
|
16
25
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
1
3
|
import { render, screen } from '@testing-library/react';
|
|
2
4
|
import { Rating } from './Rating';
|
|
3
5
|
|
|
@@ -27,4 +29,11 @@ describe('Rating', () => {
|
|
|
27
29
|
render(<Rating value={3} className="custom" />);
|
|
28
30
|
expect(screen.getByRole('img')).toHaveClass('custom');
|
|
29
31
|
});
|
|
32
|
+
|
|
33
|
+
it('outlines empty stars with the as-surface mark colour and strokes filled stars in their own colour', () => {
|
|
34
|
+
const css = readFileSync(resolve(process.cwd(), 'src/components/interaction/Rating/Rating.module.css'), 'utf8');
|
|
35
|
+
expect(css).toMatch(/\.star \{[^}]*stroke:\s*var\(--rating_stroke-color,\s*var\(--bds-color_on-bg--as-surface,\s*var\(--bds-color_on-bg--border,\s*var\(--bds-color_on-bg\)\)\)\)/);
|
|
36
|
+
expect(css).toMatch(/\.star \{[^}]*stroke-width:\s*var\(--rating_stroke-width,\s*var\(--bdc-outline_width\)\)/);
|
|
37
|
+
expect(css).toMatch(/\.--filled \{[^}]*stroke:\s*var\(--rating_stroke-color--filled,\s*currentcolor\)/);
|
|
38
|
+
});
|
|
30
39
|
});
|
|
@@ -31,7 +31,7 @@ export function Checkbox({ label, name, error, hint, className, ...props }: Chec
|
|
|
31
31
|
name={name}
|
|
32
32
|
className={cn(css.checkbox, error && css.checkboxError)}
|
|
33
33
|
/>
|
|
34
|
-
<Label id={id} label={label} />
|
|
34
|
+
<Label id={id} label={label} variant="option" />
|
|
35
35
|
</div>
|
|
36
36
|
<Message inputId={id} type="error" message={error} />
|
|
37
37
|
<Message inputId={id} type="hint" message={hint} />
|
|
@@ -46,7 +46,7 @@ All public override tokens. Set on the CheckboxGroup or any ancestor; they casca
|
|
|
46
46
|
| `--checkboxGroup_items-gap` | `var(--bds-space_xs)` | Gap between the child checkboxes. |
|
|
47
47
|
| `--checkboxGroup_legend-color` | `var(--bds-color_on-bg)` | Legend text colour. |
|
|
48
48
|
| `--checkboxGroup_legend-font-family` | `var(--bds-font_family--body)` | Legend font family. |
|
|
49
|
-
| `--checkboxGroup_legend-font-size` | `var(--bds-font_size--body--s)` | Legend font size. |
|
|
49
|
+
| `--checkboxGroup_legend-font-size` | `var(--bds-font_size--body--s)` | Legend font size, the same as the labels of the other fields. |
|
|
50
50
|
| `--checkboxGroup_legend-font-weight` | `var(--bds-font_weight--medium)` | Legend font weight. |
|
|
51
51
|
| `--checkboxGroup_legend-gap` | `var(--bds-space_xs)` | Space below the legend before the items. |
|
|
52
52
|
| `--checkboxGroup_required-color` | `var(--bds-color_error)` | Colour of the visible `*` required marker. |
|
|
@@ -136,4 +136,9 @@ describe('CheckboxGroup', () => {
|
|
|
136
136
|
);
|
|
137
137
|
expect(screen.getByRole('group', { name: 'Pick' }).className).not.toContain('groupError');
|
|
138
138
|
});
|
|
139
|
+
|
|
140
|
+
it('sizes the legend like the labels of the other fields', () => {
|
|
141
|
+
const css = readFileSync(resolve(process.cwd(), 'src/components/interaction/form/CheckboxGroup/CheckboxGroup.module.css'), 'utf8');
|
|
142
|
+
expect(css).toMatch(/\.legend \{[^}]*font-size:\s*var\(--checkboxGroup_legend-font-size,\s*var\(--bds-font_size--body--s\)\)/);
|
|
143
|
+
});
|
|
139
144
|
});
|
|
@@ -57,6 +57,8 @@ Searchable select with type-ahead filtering. Combines a text input with a dropdo
|
|
|
57
57
|
</tbody>
|
|
58
58
|
</table>
|
|
59
59
|
|
|
60
|
+
The label above the field reads the shared label hooks (`--formLabel_*`: font-family, font-size, font-weight, color), listed on FormInput.
|
|
61
|
+
|
|
60
62
|
|
|
61
63
|
## Accessibility
|
|
62
64
|
|
|
@@ -43,6 +43,10 @@ Text input field with label, optional hint, and error state. The label and input
|
|
|
43
43
|
<tr><td>`--formInput_border`</td><td>`none`</td><td>Border</td></tr>
|
|
44
44
|
<tr><td>`--formInput_radius`</td><td>`var(--bds-border_radius--full)`</td><td>Corner radius</td></tr>
|
|
45
45
|
<tr><td>`--formInput_shadow`</td><td>`var(--bdc-outline_shadow)`</td><td>Box shadow</td></tr>
|
|
46
|
+
<tr><td>`--formLabel_font-family`</td><td>`var(--bds-font_family--body)`</td><td>Font family of the label above the field (shared by all form controls with a label above the field)</td></tr>
|
|
47
|
+
<tr><td>`--formLabel_font-size`</td><td>`var(--bds-font_size--body--s)`</td><td>Label font size</td></tr>
|
|
48
|
+
<tr><td>`--formLabel_font-weight`</td><td>`var(--bds-font_weight--semibold)`</td><td>Label font weight</td></tr>
|
|
49
|
+
<tr><td>`--formLabel_color`</td><td>`var(--bds-color_on-bg)`</td><td>Label colour</td></tr>
|
|
46
50
|
<tr><td>`--formMessage_font-size`</td><td>`var(--bds-font_size--body--s)`</td><td>Font size of the error and hint message (shared by all form controls)</td></tr>
|
|
47
51
|
<tr><td>`--formMessage_gap`</td><td>`var(--bds-space_xxs)`</td><td>Gap between the error icon and the error text</td></tr>
|
|
48
52
|
<tr><td>`--formMessage_icon-size`</td><td>`1.15em`</td><td>Size of the error icon</td></tr>
|
|
@@ -53,6 +53,8 @@ Numeric text input with increment/decrement stepper buttons. Enforces `min`, `ma
|
|
|
53
53
|
</tbody>
|
|
54
54
|
</table>
|
|
55
55
|
|
|
56
|
+
The label above the field reads the shared label hooks (`--formLabel_*`: font-family, font-size, font-weight, color), listed on FormInput.
|
|
57
|
+
|
|
56
58
|
|
|
57
59
|
## Accessibility
|
|
58
60
|
|
|
@@ -35,7 +35,7 @@ export function Radio({ label, name, description, error, hint, className, id: co
|
|
|
35
35
|
{...props}
|
|
36
36
|
/>
|
|
37
37
|
<div className={css.textWrapper}>
|
|
38
|
-
<Label id={id} label={label} />
|
|
38
|
+
<Label id={id} label={label} variant="option" />
|
|
39
39
|
{description && (
|
|
40
40
|
<span id={descriptionId} className={css.description}>
|
|
41
41
|
{description}
|
|
@@ -46,7 +46,7 @@ All public override tokens. Set on the RadioGroup or any ancestor; they cascade.
|
|
|
46
46
|
| `--radioGroup_items-gap` | `var(--bds-space_xs)` | Gap between the child radios. |
|
|
47
47
|
| `--radioGroup_legend-color` | `var(--bds-color_on-bg)` | Legend text colour. |
|
|
48
48
|
| `--radioGroup_legend-font-family` | `var(--bds-font_family--body)` | Legend font family. |
|
|
49
|
-
| `--radioGroup_legend-font-size` | `var(--bds-font_size--body--s)` | Legend font size. |
|
|
49
|
+
| `--radioGroup_legend-font-size` | `var(--bds-font_size--body--s)` | Legend font size, the same as the labels of the other fields. |
|
|
50
50
|
| `--radioGroup_legend-font-weight` | `var(--bds-font_weight--medium)` | Legend font weight. |
|
|
51
51
|
| `--radioGroup_legend-gap` | `var(--bds-space_xs)` | Space below the legend before the items. |
|
|
52
52
|
| `--radioGroup_required-color` | `var(--bds-color_error)` | Colour of the visible `*` required marker. |
|
|
@@ -124,4 +124,9 @@ describe('RadioGroup', () => {
|
|
|
124
124
|
);
|
|
125
125
|
expect(screen.getByRole('group', { name: 'Pick' }).className).not.toContain('groupError');
|
|
126
126
|
});
|
|
127
|
+
|
|
128
|
+
it('sizes the legend like the labels of the other fields', () => {
|
|
129
|
+
const css = readFileSync(resolve(process.cwd(), 'src/components/interaction/form/RadioGroup/RadioGroup.module.css'), 'utf8');
|
|
130
|
+
expect(css).toMatch(/\.legend \{[^}]*font-size:\s*var\(--radioGroup_legend-font-size,\s*var\(--bds-font_size--body--s\)\)/);
|
|
131
|
+
});
|
|
127
132
|
});
|
|
@@ -56,6 +56,8 @@ Native dropdown for choosing one option from a list. Renders a styled `<select>`
|
|
|
56
56
|
</tbody>
|
|
57
57
|
</table>
|
|
58
58
|
|
|
59
|
+
The label above the field reads the shared label hooks (`--formLabel_*`: font-family, font-size, font-weight, color), listed on FormInput.
|
|
60
|
+
|
|
59
61
|
|
|
60
62
|
## Accessibility
|
|
61
63
|
|
|
@@ -56,6 +56,8 @@ Range input for selecting a numeric value within a bounded range.
|
|
|
56
56
|
</tbody>
|
|
57
57
|
</table>
|
|
58
58
|
|
|
59
|
+
The label above the field reads the shared label hooks (`--formLabel_*`: font-family, font-size, font-weight, color), listed on FormInput.
|
|
60
|
+
|
|
59
61
|
|
|
60
62
|
## Accessibility
|
|
61
63
|
|
|
@@ -49,7 +49,7 @@ export function Switch({
|
|
|
49
49
|
<span className={css.thumb} />
|
|
50
50
|
</span>
|
|
51
51
|
</div>
|
|
52
|
-
<Label id={id} label={label} />
|
|
52
|
+
<Label id={id} label={label} variant="option" />
|
|
53
53
|
</div>
|
|
54
54
|
<Message inputId={id} type="error" message={error} />
|
|
55
55
|
<Message inputId={id} type="hint" message={hint} />
|