@danske/sapphire-css 50.2.1 → 52.2.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.
Files changed (50) hide show
  1. package/build/themes/cjs/default-dark.js +4 -1
  2. package/build/themes/cjs/default.js +4 -1
  3. package/build/themes/cjs/index.d.ts +3 -0
  4. package/build/themes/cjs/realkredit.js +4 -1
  5. package/build/themes/esm/default-dark.js +4 -1
  6. package/build/themes/esm/default.js +4 -1
  7. package/build/themes/esm/index.d.ts +3 -0
  8. package/build/themes/esm/realkredit.js +4 -1
  9. package/components/alert/alert.module.css +3 -2
  10. package/components/avatar/avatar.module.css +1 -0
  11. package/components/button/button.module.css +1 -1
  12. package/components/calendar/calendar.module.css +46 -4
  13. package/components/calendar/calendar.module.css.d.ts +1 -0
  14. package/components/checkbox/checkbox.module.css +48 -3
  15. package/components/checkbox/checkbox.module.css.d.ts +5 -0
  16. package/components/danskeProgressBar/danskeProgressBar.module.css +178 -0
  17. package/components/danskeProgressBar/danskeProgressBar.module.css.d.ts +9 -0
  18. package/components/dateField/dateField.module.css +30 -1
  19. package/components/dateField/dateField.module.css.d.ts +1 -0
  20. package/components/dropzone/dropzone.module.css +12 -49
  21. package/components/field/field.module.css +180 -15
  22. package/components/field/field.module.css.d.ts +9 -2
  23. package/components/fieldGroup/fieldGroup.module.css +4 -0
  24. package/components/fieldGroup/fieldGroup.module.css.d.ts +1 -0
  25. package/components/label/label.module.css +5 -0
  26. package/components/label/label.module.css.d.ts +1 -0
  27. package/components/link/link.module.css +0 -1
  28. package/components/listbox/listbox.module.css +6 -0
  29. package/components/modalLayout/modalLayout.module.css +2 -1
  30. package/components/radio/radio.module.css +79 -18
  31. package/components/radio/radio.module.css.d.ts +5 -0
  32. package/components/searchField/searchField.module.css +31 -6
  33. package/components/searchField/searchField.module.css.d.ts +1 -0
  34. package/components/select/select.module.css +61 -16
  35. package/components/select/select.module.css.d.ts +2 -0
  36. package/components/slider/slider.module.css +2 -3
  37. package/components/switch/switch.module.css +42 -8
  38. package/components/switch/switch.module.css.d.ts +2 -0
  39. package/components/table/table.module.css +108 -10
  40. package/components/table/table.module.css.d.ts +5 -1
  41. package/components/textField/textField.module.css +43 -10
  42. package/components/textField/textField.module.css.d.ts +1 -0
  43. package/components/toast/toast.module.css +1 -0
  44. package/components/truncate-overflow/truncate-overflow.module.css +7 -0
  45. package/components/truncate-overflow/truncate-overflow.module.css.d.ts +5 -0
  46. package/package.json +19 -22
  47. package/themes/default-dark.js +4 -1
  48. package/themes/default.js +4 -1
  49. package/themes/index.d.ts +3 -0
  50. package/themes/realkredit.js +4 -1
@@ -11,8 +11,10 @@
11
11
  height: var(--sapphire-global-size-generic-480);
12
12
  min-height: var(--sapphire-global-size-generic-480);
13
13
  padding: var(--sapphire-semantic-size-spacing-2xl);
14
+ border: var(--sapphire-semantic-size-border-sm) dashed
15
+ var(--sapphire-semantic-color-border-field-default);
14
16
  border-radius: var(--sapphire-semantic-size-radius-md);
15
- transition-property: opacity, background-color, color;
17
+ transition-property: opacity, background-color, border-color, color;
16
18
  transition-duration: var(--sapphire-semantic-time-fade-quick);
17
19
  transition-timing-function: var(--sapphire-semantic-transitions-fade);
18
20
  overflow: hidden;
@@ -29,29 +31,10 @@
29
31
  */
30
32
  -webkit-font-smoothing: antialiased;
31
33
  -moz-osx-font-smoothing: grayscale;
32
- --mask-data: url('data:image/svg+xml,%3csvg stroke="black" width="70%25" height="70%25" xmlns="http://www.w3.org/2000/svg"%3e%3crect width="100%25" height="100%25" fill="none" rx="6" ry="6" stroke-width="2" stroke-dasharray="5 6.01126518182488" stroke-dashoffset="4" stroke-linecap="butt"/%3e%3c/svg%3e');
33
34
  }
34
35
 
35
- /* The before is needed because the SVG image cannot take CSS var, so the background of the ::before is set to the correct color instead */
36
- .sapphire-dropzone::before {
37
- content: '';
38
- position: absolute;
39
- top: 0;
40
- left: 0;
41
- right: 0;
42
- bottom: 0;
43
- /* Dashed borders cannot be customised, so we use a trick with the SVG image to customise it */
44
- mask: var(--mask-data);
45
- -webkit-mask: var(--mask-data);
46
- background: var(--sapphire-semantic-color-border-field-default);
47
- border-radius: var(--sapphire-semantic-size-radius-md);
48
- transition-property: opacity, background-color, color;
49
- transition-duration: var(--sapphire-semantic-time-fade-quick);
50
- transition-timing-function: var(--sapphire-semantic-transitions-fade);
51
- }
52
-
53
- .sapphire-dropzone.sapphire-dropzone--error::before {
54
- background: var(--sapphire-semantic-color-foreground-negative);
36
+ .sapphire-dropzone.sapphire-dropzone--error {
37
+ border-color: var(--sapphire-semantic-color-border-negative-default);
55
38
  }
56
39
 
57
40
  .sapphire-dropzone:not(:disabled):not(.is-disabled):not(:active):not(
@@ -60,7 +43,7 @@
60
43
  .sapphire-dropzone:not(:disabled):not(.is-disabled):not(:active):not(
61
44
  .is-active
62
45
  ).is-hover {
63
- background: none;
46
+ background: var(--sapphire-semantic-color-background-action-tertiary-hover);
64
47
  }
65
48
 
66
49
  .sapphire-dropzone:not(:disabled):not(.is-disabled).sapphire-dropzone:active,
@@ -70,20 +53,7 @@
70
53
  .sapphire-dropzone:not(:disabled):not(
71
54
  .is-disabled
72
55
  ).sapphire-dropzone.is-active {
73
- background: none;
74
- }
75
-
76
- .sapphire-dropzone:not(:active):not(.is-disabled):not(
77
- .is-active
78
- ).is-hover::before,
79
- .sapphire-dropzone:not(:active):not(.is-disabled):not(.is-active):not(
80
- .js-hover
81
- ):hover::before {
82
- background: var(--sapphire-semantic-color-background-action-primary-hover);
83
- }
84
-
85
- .sapphire-dropzone.is-active::before {
86
- background: var(--sapphire-semantic-color-background-action-primary-active);
56
+ background: var(--sapphire-semantic-color-background-action-tertiary-active);
87
57
  }
88
58
 
89
59
  .sapphire-dropzone:focus {
@@ -92,14 +62,9 @@
92
62
 
93
63
  .sapphire-dropzone.is-focus,
94
64
  .sapphire-dropzone:not(.js-focus):focus-visible {
95
- outline: none;
96
- }
97
-
98
- .sapphire-dropzone.is-focus::before,
99
- .sapphire-dropzone:not(.js-focus):focus-visible::before {
100
- mask: var(--mask-data);
101
- -webkit-mask: var(--mask-data);
102
- background: var(--sapphire-semantic-color-focus-ring);
65
+ outline: var(--sapphire-semantic-size-focus-ring) solid
66
+ var(--sapphire-semantic-color-focus-ring);
67
+ outline-offset: var(--sapphire-semantic-size-focus-ring);
103
68
  }
104
69
 
105
70
  .sapphire-dropzone:disabled,
@@ -111,10 +76,8 @@
111
76
  .sapphire-dropzone--dropping {
112
77
  background: var(--sapphire-semantic-color-background-accent-subtle);
113
78
  backdrop-filter: var(--sapphire-semantic-backdrop-filter-blur);
114
- }
115
-
116
- .sapphire-dropzone.sapphire-dropzone--dropping::before {
117
- background: var(--sapphire-semantic-color-foreground-on-accent-subtle);
79
+ border-style: solid;
80
+ border-color: var(--sapphire-semantic-color-border-accent);
118
81
  }
119
82
 
120
83
  .sapphire-dropzone__content {
@@ -29,10 +29,26 @@
29
29
  width: auto;
30
30
  }
31
31
 
32
+ /**
33
+ * When a field contains a field group, add some extra spacing
34
+ * between the control and the group.
35
+ */
36
+ .sapphire-field--has-field-group {
37
+ row-gap: var(--sapphire-semantic-size-spacing-sm);
38
+ }
39
+
40
+ .sapphire-field--has-field-group.sapphire-field--md {
41
+ row-gap: var(--sapphire-semantic-size-spacing-xs);
42
+ }
43
+
44
+ .sapphire-field--has-field-group.sapphire-field--sm {
45
+ row-gap: var(--sapphire-semantic-size-spacing-2xs);
46
+ }
47
+
32
48
  /**
33
49
  * We need to reset browser styles in case the DOM element is a <fieldset>
34
50
  */
35
- fieldset.sapphire-field {
51
+ .sapphire-field--fieldset {
36
52
  border: 0;
37
53
  margin: 0;
38
54
  padding: 0;
@@ -61,10 +77,36 @@ legend.sapphire-field__label {
61
77
  font-size: var(--sapphire-semantic-size-font-control-lg);
62
78
  }
63
79
 
80
+ .sapphire-field--md {
81
+ row-gap: var(--sapphire-semantic-size-spacing-3xs);
82
+ }
83
+
84
+ .sapphire-field--sm {
85
+ row-gap: var(--sapphire-semantic-size-spacing-4xs);
86
+ }
87
+
64
88
  .sapphire-field--md .sapphire-field__control {
65
89
  font-size: var(--sapphire-semantic-size-font-control-md);
66
90
  }
67
91
 
92
+ .sapphire-field--sm .sapphire-field__control {
93
+ font-size: var(--sapphire-semantic-size-font-control-md);
94
+ }
95
+
96
+ .sapphire-field__labeled-value {
97
+ display: flex;
98
+ align-items: center;
99
+ min-height: var(--sapphire-semantic-size-height-control-lg);
100
+ }
101
+
102
+ .sapphire-field--md .sapphire-field__labeled-value {
103
+ min-height: var(--sapphire-semantic-size-height-control-md);
104
+ }
105
+
106
+ .sapphire-field--sm .sapphire-field__labeled-value {
107
+ min-height: var(--sapphire-semantic-size-height-control-sm);
108
+ }
109
+
68
110
  /**
69
111
  * For when the control contains a group of inputs
70
112
  */
@@ -77,6 +119,10 @@ legend.sapphire-field__label {
77
119
  gap: var(--sapphire-semantic-size-spacing-2xs);
78
120
  }
79
121
 
122
+ .sapphire-field--sm .sapphire-field__control--group {
123
+ gap: var(--sapphire-semantic-size-spacing-3xs);
124
+ }
125
+
80
126
  /**
81
127
  * Modifier which makes the control's width exceed the
82
128
  * field's container. This is useful when the control's
@@ -123,6 +169,12 @@ legend.sapphire-field__label {
123
169
  gap: var(--sapphire-semantic-size-spacing-2xs);
124
170
  }
125
171
 
172
+ .sapphire-field--sm .sapphire-field__note-row {
173
+ font-size: var(--sapphire-semantic-size-font-label-sm);
174
+ line-height: var(--sapphire-semantic-size-line-height-sm);
175
+ gap: var(--sapphire-semantic-size-spacing-2xs);
176
+ }
177
+
126
178
  .sapphire-field__note {
127
179
  flex: 1;
128
180
  }
@@ -138,6 +190,10 @@ legend.sapphire-field__label {
138
190
  padding-top: 0;
139
191
  }
140
192
 
193
+ .sapphire-field--sm .sapphire-field__note-icon {
194
+ padding-top: 0;
195
+ }
196
+
141
197
  /**
142
198
  * Disabled
143
199
  */
@@ -178,6 +234,11 @@ legend.sapphire-field__label {
178
234
  max-height: var(--sapphire-semantic-size-height-control-md);
179
235
  }
180
236
 
237
+ .sapphire-field--label-placement-side.sapphire-field--sm
238
+ .sapphire-field__label {
239
+ max-height: var(--sapphire-semantic-size-height-control-sm);
240
+ }
241
+
181
242
  .sapphire-field--label-placement-side.sapphire-field--label-alignment-top
182
243
  .sapphire-field__label {
183
244
  align-items: flex-start;
@@ -185,26 +246,130 @@ legend.sapphire-field__label {
185
246
  }
186
247
 
187
248
  /*
188
- * FieldSet - a wrapper for fields, that handles spacing, and label alignment when labels are on
189
- * the side.
249
+ * FormLayout
190
250
  */
191
- .sapphire-fieldset {
251
+ .sapphire-form-layout {
192
252
  display: inline-flex;
193
253
  flex-direction: column;
194
- width: min-content; /* this is needed to have the labels column shrunk to the largest one */
195
- gap: var(--sapphire-semantic-size-spacing-lg);
254
+ align-items: flex-start;
255
+ row-gap: var(--sapphire-semantic-size-spacing-xl);
196
256
  }
197
257
 
198
- .sapphire-fieldset .sapphire-field--label-placement-side {
199
- grid-template-columns: 1fr min-content;
258
+ .sapphire-form-layout--md {
259
+ row-gap: var(--sapphire-semantic-size-spacing-lg);
200
260
  }
201
261
 
202
- .sapphire-fieldset
203
- .sapphire-field--label-placement-side
204
- .sapphire-field__label {
205
- /* That is necessary because of width: min-content on field-set. Would be nice to avoid it
206
- but couldn't find a way to avoid it while meeting the other requirements of having labels
207
- aligned and not take up more space than needed.
208
- */
262
+ .sapphire-form-layout--sm {
263
+ row-gap: var(--sapphire-semantic-size-spacing-md);
264
+ }
265
+
266
+ .sapphire-form-layout--sm:has(> .sapphire-field--label-placement-side) {
267
+ row-gap: var(--sapphire-semantic-size-spacing-sm);
268
+ }
269
+
270
+ .sapphire-form-layout--has-width {
271
+ --sapphire-form-layout-field-width: 100%;
272
+ }
273
+
274
+ .sapphire-form-layout
275
+ > .sapphire-field--label-placement-side:not(.sapphire-field--fieldset) {
276
+ grid-template-columns:
277
+ var(--sapphire-form-layout-label-width, max-content)
278
+ minmax(var(--sapphire-semantic-size-width-field), 1fr);
279
+ }
280
+
281
+ .sapphire-form-layout
282
+ > .sapphire-field--label-placement-side:not(
283
+ .sapphire-field--fieldset
284
+ )[style*='width'] {
285
+ grid-template-columns:
286
+ var(--sapphire-form-layout-label-width, max-content)
287
+ 1fr;
288
+ }
289
+
290
+ .sapphire-form-layout
291
+ > .sapphire-field--label-placement-side
292
+ > .sapphire-field__label {
209
293
  white-space: nowrap;
210
294
  }
295
+
296
+ .sapphire-form-layout
297
+ > .sapphire-field--label-placement-side
298
+ .sapphire-field__control {
299
+ width: 100%;
300
+ }
301
+
302
+ .sapphire-form-layout
303
+ > .sapphire-field:not(.sapphire-field--label-placement-side) {
304
+ width: var(
305
+ --sapphire-form-layout-field-width,
306
+ var(--sapphire-semantic-size-width-field)
307
+ );
308
+ }
309
+
310
+ .sapphire-form-layout > .sapphire-field--label-placement-side {
311
+ width: var(--sapphire-form-layout-field-width, auto);
312
+ }
313
+
314
+ /* flex layout since <legend> cannot be a grid item */
315
+ .sapphire-form-layout
316
+ > .sapphire-field--fieldset.sapphire-field--label-placement-side {
317
+ display: flex;
318
+ flex-wrap: wrap;
319
+ align-items: center;
320
+ column-gap: var(--sapphire-semantic-size-spacing-md);
321
+ min-width: 0;
322
+ }
323
+
324
+ .sapphire-form-layout
325
+ > .sapphire-field--fieldset.sapphire-field--label-placement-side
326
+ > .sapphire-field__label {
327
+ flex: 0 0 auto;
328
+ width: var(--sapphire-form-layout-label-width, auto);
329
+ }
330
+
331
+ .sapphire-form-layout
332
+ > .sapphire-field--fieldset.sapphire-field--label-placement-side
333
+ > .sapphire-field__control {
334
+ flex: 1 1 var(--sapphire-semantic-size-width-field);
335
+ min-width: 0;
336
+ width: auto;
337
+ max-width: var(
338
+ --sapphire-form-layout-field-width,
339
+ var(--sapphire-semantic-size-width-field)
340
+ );
341
+ }
342
+
343
+ /* [style*='width'] also matches min-width/max-width, but that's fine here —
344
+ * fields with any width intent should opt into this sizing behavior. */
345
+
346
+ /* Fieldset with explicit width: lift the max-width cap */
347
+ .sapphire-form-layout
348
+ > .sapphire-field--fieldset.sapphire-field--label-placement-side[style*='width']
349
+ > .sapphire-field__control {
350
+ max-width: none;
351
+ }
352
+
353
+ /* Inner fields without an explicit width fill remaining space */
354
+ .sapphire-form-layout
355
+ > .sapphire-field--fieldset
356
+ > .sapphire-field__control
357
+ > .sapphire-field:not([style*='width']) {
358
+ flex: 1 1 0;
359
+ min-width: 0;
360
+ }
361
+
362
+ .sapphire-form-layout
363
+ > .sapphire-field--fieldset.sapphire-field--label-placement-side
364
+ > .sapphire-field__message {
365
+ flex: 0 0 100%;
366
+ padding-left: calc(
367
+ var(--sapphire-form-layout-label-width, 0px) +
368
+ var(--sapphire-semantic-size-spacing-md)
369
+ );
370
+ }
371
+
372
+ .sapphire-form-layout
373
+ > .sapphire-field--fieldset.sapphire-field--label-placement-side.sapphire-field--label-alignment-top {
374
+ align-items: flex-start;
375
+ }
@@ -1,9 +1,13 @@
1
1
  declare const styles: {
2
2
  readonly "sapphire-field": string;
3
3
  readonly "sapphire-field--no-width": string;
4
+ readonly "sapphire-field--has-field-group": string;
5
+ readonly "sapphire-field--md": string;
6
+ readonly "sapphire-field--sm": string;
7
+ readonly "sapphire-field--fieldset": string;
4
8
  readonly "sapphire-field__label": string;
5
9
  readonly "sapphire-field__control": string;
6
- readonly "sapphire-field--md": string;
10
+ readonly "sapphire-field__labeled-value": string;
7
11
  readonly "sapphire-field__control--group": string;
8
12
  readonly "sapphire-field--no-shrink": string;
9
13
  readonly "sapphire-field__message": string;
@@ -13,7 +17,10 @@ declare const styles: {
13
17
  readonly "is-disabled": string;
14
18
  readonly "sapphire-field--label-placement-side": string;
15
19
  readonly "sapphire-field--label-alignment-top": string;
16
- readonly "sapphire-fieldset": string;
20
+ readonly "sapphire-form-layout": string;
21
+ readonly "sapphire-form-layout--md": string;
22
+ readonly "sapphire-form-layout--sm": string;
23
+ readonly "sapphire-form-layout--has-width": string;
17
24
  };
18
25
  export = styles;
19
26
 
@@ -16,3 +16,7 @@
16
16
  .sapphire-field-group--md {
17
17
  row-gap: var(--sapphire-semantic-size-spacing-xs);
18
18
  }
19
+
20
+ .sapphire-field-group--sm {
21
+ row-gap: var(--sapphire-semantic-size-spacing-2xs);
22
+ }
@@ -3,6 +3,7 @@ declare const styles: {
3
3
  readonly "sapphire-field-group--horizontal": string;
4
4
  readonly "sapphire-field-group--vertical": string;
5
5
  readonly "sapphire-field-group--md": string;
6
+ readonly "sapphire-field-group--sm": string;
6
7
  };
7
8
  export = styles;
8
9
 
@@ -9,6 +9,11 @@
9
9
  min-height: var(--sapphire-semantic-size-height-control-2xs);
10
10
  }
11
11
 
12
+ .sapphire-label--sm {
13
+ font-size: var(--sapphire-semantic-size-font-label-sm);
14
+ min-height: var(--sapphire-semantic-size-height-control-2xs);
15
+ }
16
+
12
17
  .sapphire-label__text {
13
18
  font-weight: var(--sapphire-semantic-font-weight-default-medium);
14
19
  color: var(--sapphire-semantic-color-foreground-primary);
@@ -1,6 +1,7 @@
1
1
  declare const styles: {
2
2
  readonly "sapphire-label": string;
3
3
  readonly "sapphire-label--md": string;
4
+ readonly "sapphire-label--sm": string;
4
5
  readonly "sapphire-label__text": string;
5
6
  readonly "sapphire-label__required-indicator": string;
6
7
  readonly "sapphire-label__optional-indicator": string;
@@ -23,7 +23,6 @@
23
23
  color: var(--sapphire-semantic-color-foreground-action-link-default);
24
24
 
25
25
  text-decoration: underline;
26
- text-decoration-thickness: var(--sapphire-semantic-size-border-sm);
27
26
  }
28
27
 
29
28
  /* Disabled state for all variants */
@@ -154,6 +154,12 @@ Hence a separate class for checkmark icon to be used in the alignment styles */
154
154
  );
155
155
  }
156
156
 
157
+ .sapphire-listbox__icon svg {
158
+ width: var(--sapphire-listbox-icon-size);
159
+ height: var(--sapphire-listbox-icon-size);
160
+ flex-shrink: 0;
161
+ }
162
+
157
163
  .sapphire-listbox__text-container {
158
164
  line-height: var(--sapphire-semantic-size-line-height-md);
159
165
  flex: 1;
@@ -31,7 +31,8 @@
31
31
  overflow-y: auto;
32
32
  overflow-x: hidden;
33
33
  flex-grow: 1;
34
- padding: 0 var(--sapphire-semantic-size-spacing-container-horizontal-md);
34
+ padding: var(--sapphire-semantic-size-focus-ring)
35
+ var(--sapphire-semantic-size-spacing-container-horizontal-md);
35
36
  }
36
37
 
37
38
  .sapphire-modal-layout__body.sapphire-modal-layout__body--no-padding {
@@ -3,6 +3,7 @@
3
3
  font-family: var(--sapphire-semantic-font-name-default);
4
4
  max-width: 100%;
5
5
  position: relative;
6
+ cursor: pointer;
6
7
  }
7
8
 
8
9
  .sapphire-radio-container {
@@ -20,7 +21,12 @@
20
21
  width: 100%;
21
22
  opacity: 0.0001; /** Some of the screen readers may ignore element with opacity:0 */
22
23
  z-index: 1;
23
- cursor: pointer;
24
+ cursor: inherit;
25
+ }
26
+
27
+ .sapphire-radio.is-readonly,
28
+ .sapphire-radio:has(.sapphire-radio__input[readonly]) {
29
+ cursor: default;
24
30
  }
25
31
 
26
32
  .sapphire-radio__label {
@@ -47,10 +53,29 @@
47
53
  .sapphire-radio--md .sapphire-radio__label {
48
54
  font-size: var(--sapphire-semantic-size-font-control-md);
49
55
  line-height: var(--sapphire-semantic-size-height-control-2xs);
56
+ margin-left: var(--sapphire-semantic-size-spacing-xs);
57
+ }
58
+
59
+ .sapphire-radio--sm .sapphire-radio__label {
60
+ font-size: var(--sapphire-semantic-size-font-control-md);
61
+ line-height: var(--sapphire-semantic-size-height-control-2xs);
62
+ margin-left: var(--sapphire-semantic-size-spacing-xs);
50
63
  }
51
64
 
52
65
  /* The radio box */
53
66
 
67
+ .sapphire-radio__box-wrapper {
68
+ display: flex;
69
+ align-items: center;
70
+ height: var(--sapphire-semantic-size-height-control-xs);
71
+ flex-shrink: 0;
72
+ }
73
+
74
+ .sapphire-radio--md .sapphire-radio__box-wrapper,
75
+ .sapphire-radio--sm .sapphire-radio__box-wrapper {
76
+ height: var(--sapphire-semantic-size-height-control-2xs);
77
+ }
78
+
54
79
  .sapphire-radio__box {
55
80
  box-sizing: border-box;
56
81
  background-color: var(--sapphire-semantic-color-background-field);
@@ -61,8 +86,6 @@
61
86
  border: var(--sapphire-semantic-size-border-sm) solid
62
87
  var(--sapphire-semantic-color-border-field-default);
63
88
  position: relative;
64
- margin-top: var(--sapphire-semantic-size-spacing-4xs);
65
-
66
89
  transition-property: background-color, border-color, border-width;
67
90
  transition-duration: var(--sapphire-semantic-time-fade-quick);
68
91
  transition-timing-function: var(--sapphire-semantic-transitions-fade);
@@ -73,6 +96,11 @@
73
96
  height: var(--sapphire-semantic-size-height-box-md);
74
97
  }
75
98
 
99
+ .sapphire-radio--sm .sapphire-radio__box {
100
+ width: var(--sapphire-global-size-generic-35);
101
+ height: var(--sapphire-global-size-generic-35);
102
+ }
103
+
76
104
  .sapphire-radio--checked .sapphire-radio__box {
77
105
  border-color: var(
78
106
  --sapphire-semantic-color-background-action-primary-default
@@ -97,6 +125,15 @@
97
125
  );
98
126
  }
99
127
 
128
+ .sapphire-radio--sm.sapphire-radio--checked .sapphire-radio__box {
129
+ border-width: calc(
130
+ (
131
+ var(--sapphire-global-size-generic-35) -
132
+ var(--sapphire-global-size-generic-15)
133
+ ) / 2
134
+ );
135
+ }
136
+
100
137
  .sapphire-radio--checked .sapphire-radio__box::after {
101
138
  display: block;
102
139
  }
@@ -105,25 +142,27 @@
105
142
 
106
143
  /* Hover when not checked */
107
144
 
108
- .sapphire-radio:not(:active):not(.is-active):not(
109
- .sapphire-radio--checked
145
+ .sapphire-radio:not(:active):not(.is-active):not(.sapphire-radio--checked):not(
146
+ .is-disabled
110
147
  ).is-hover
111
148
  .sapphire-radio__box,
112
149
  .sapphire-radio:not(:active):not(.is-active):not(.sapphire-radio--checked):not(
113
150
  .js-hover
114
151
  ):hover
115
152
  .sapphire-radio__input:not(:disabled)
116
- ~ .sapphire-radio__box {
153
+ ~ .sapphire-radio__box-wrapper
154
+ .sapphire-radio__box {
117
155
  border-color: var(--sapphire-semantic-color-border-field-hover);
118
156
  }
119
157
 
120
158
  /* Hover when checked */
121
159
 
122
- .sapphire-radio--checked:not(:active):not(.is-active).is-hover
160
+ .sapphire-radio--checked:not(:active):not(.is-active):not(.is-disabled).is-hover
123
161
  .sapphire-radio__box,
124
162
  .sapphire-radio--checked:not(:active):not(.is-active):not(.js-hover):hover
125
163
  .sapphire-radio__input:not(:disabled)
126
- ~ .sapphire-radio__box {
164
+ ~ .sapphire-radio__box-wrapper
165
+ .sapphire-radio__box {
127
166
  border-color: var(--sapphire-semantic-color-background-action-primary-hover);
128
167
  }
129
168
 
@@ -131,28 +170,35 @@
131
170
 
132
171
  /* Active when not checked */
133
172
 
134
- .sapphire-radio:not(.sapphire-radio--checked).is-active .sapphire-radio__box,
173
+ .sapphire-radio:not(.sapphire-radio--checked):not(.is-disabled).is-active
174
+ .sapphire-radio__box,
135
175
  .sapphire-radio:not(.sapphire-radio--checked):active
136
176
  .sapphire-radio__input:not(:disabled)
137
- ~ .sapphire-radio__box {
177
+ ~ .sapphire-radio__box-wrapper
178
+ .sapphire-radio__box {
138
179
  border-color: var(--sapphire-semantic-color-border-field-active);
139
180
  }
140
181
 
141
182
  /* Active when checked */
142
183
 
143
- .sapphire-radio--checked.is-active .sapphire-radio__box,
184
+ .sapphire-radio--checked:not(.is-disabled).is-active .sapphire-radio__box,
144
185
  .sapphire-radio--checked:active
145
186
  .sapphire-radio__input:not(:disabled)
146
- ~ .sapphire-radio__box {
187
+ ~ .sapphire-radio__box-wrapper
188
+ .sapphire-radio__box {
147
189
  border-color: var(--sapphire-semantic-color-background-action-primary-active);
148
190
  }
149
191
 
150
192
  /* FOCUS */
151
193
 
152
- .sapphire-radio.is-focus .sapphire-radio__input ~ .sapphire-radio__box,
194
+ .sapphire-radio.is-focus
195
+ .sapphire-radio__input
196
+ ~ .sapphire-radio__box-wrapper
197
+ .sapphire-radio__box,
153
198
  .sapphire-radio:not(.js-focus)
154
199
  .sapphire-radio__input:focus-visible
155
- ~ .sapphire-radio__box {
200
+ ~ .sapphire-radio__box-wrapper
201
+ .sapphire-radio__box {
156
202
  outline: var(--sapphire-semantic-size-focus-ring) solid
157
203
  var(--sapphire-semantic-color-focus-ring);
158
204
  outline-offset: var(--sapphire-semantic-size-focus-ring);
@@ -160,12 +206,18 @@
160
206
 
161
207
  /* DISABLED */
162
208
 
163
- .sapphire-radio__input:disabled {
209
+ .sapphire-radio:has(.sapphire-radio__input:disabled),
210
+ .sapphire-radio.is-disabled {
164
211
  cursor: not-allowed;
165
212
  }
166
213
 
167
- .sapphire-radio .sapphire-radio__input:disabled ~ .sapphire-radio__box,
168
- .sapphire-radio .sapphire-radio__input:disabled ~ .sapphire-radio__label {
214
+ .sapphire-radio
215
+ .sapphire-radio__input:disabled
216
+ ~ .sapphire-radio__box-wrapper
217
+ .sapphire-radio__box,
218
+ .sapphire-radio .sapphire-radio__input:disabled ~ .sapphire-radio__label,
219
+ .sapphire-radio.is-disabled .sapphire-radio__box,
220
+ .sapphire-radio.is-disabled .sapphire-radio__label {
169
221
  opacity: var(--sapphire-semantic-opacity-disabled);
170
222
  }
171
223
 
@@ -189,6 +241,15 @@
189
241
  line-height: var(--sapphire-semantic-size-line-height-sm);
190
242
  margin-left: calc(
191
243
  var(--sapphire-semantic-size-spacing-xs) +
192
- var(--sapphire-semantic-size-height-box-lg)
244
+ var(--sapphire-semantic-size-height-box-md)
245
+ );
246
+ }
247
+
248
+ .sapphire-radio__note--sm {
249
+ font-size: var(--sapphire-semantic-size-font-label-sm);
250
+ line-height: var(--sapphire-semantic-size-line-height-sm);
251
+ margin-left: calc(
252
+ var(--sapphire-semantic-size-spacing-xs) +
253
+ var(--sapphire-global-size-generic-35)
193
254
  );
194
255
  }
@@ -2,17 +2,22 @@ declare const styles: {
2
2
  readonly "sapphire-radio": string;
3
3
  readonly "sapphire-radio-container": string;
4
4
  readonly "sapphire-radio__input": string;
5
+ readonly "is-readonly": string;
5
6
  readonly "sapphire-radio__label": string;
6
7
  readonly "sapphire-radio--md": string;
8
+ readonly "sapphire-radio--sm": string;
9
+ readonly "sapphire-radio__box-wrapper": string;
7
10
  readonly "sapphire-radio__box": string;
8
11
  readonly "sapphire-radio--checked": string;
9
12
  readonly "is-active": string;
13
+ readonly "is-disabled": string;
10
14
  readonly "is-hover": string;
11
15
  readonly "js-hover": string;
12
16
  readonly "is-focus": string;
13
17
  readonly "js-focus": string;
14
18
  readonly "sapphire-radio__note": string;
15
19
  readonly "sapphire-radio__note--md": string;
20
+ readonly "sapphire-radio__note--sm": string;
16
21
  };
17
22
  export = styles;
18
23