@danske/sapphire-css 51.0.0 → 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 (47) 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/listbox/listbox.module.css +6 -0
  28. package/components/modalLayout/modalLayout.module.css +2 -1
  29. package/components/radio/radio.module.css +79 -18
  30. package/components/radio/radio.module.css.d.ts +5 -0
  31. package/components/searchField/searchField.module.css +31 -6
  32. package/components/searchField/searchField.module.css.d.ts +1 -0
  33. package/components/select/select.module.css +52 -11
  34. package/components/select/select.module.css.d.ts +2 -0
  35. package/components/slider/slider.module.css +2 -3
  36. package/components/switch/switch.module.css +42 -8
  37. package/components/switch/switch.module.css.d.ts +2 -0
  38. package/components/table/table.module.css +45 -2
  39. package/components/table/table.module.css.d.ts +3 -2
  40. package/components/textField/textField.module.css +43 -10
  41. package/components/textField/textField.module.css.d.ts +1 -0
  42. package/components/toast/toast.module.css +1 -0
  43. package/package.json +19 -22
  44. package/themes/default-dark.js +4 -1
  45. package/themes/default.js +4 -1
  46. package/themes/index.d.ts +3 -0
  47. package/themes/realkredit.js +4 -1
@@ -8,6 +8,9 @@ var tokens_module_css_1 = __importDefault(require("@danske/sapphire-design-token
8
8
  var theme = {
9
9
  themeClassName: tokens_module_css_1["default"]['sapphire-theme-default-dark'],
10
10
  themeSecondaryModifierClassName: tokens_module_css_1["default"]['sapphire-theme--secondary'],
11
- themeContrastModifierClassName: tokens_module_css_1["default"]['sapphire-theme--contrast']
11
+ themeContrastModifierClassName: tokens_module_css_1["default"]['sapphire-theme--contrast'],
12
+ themeScaleSmModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-sm'],
13
+ themeScaleMdModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-md'],
14
+ themeScaleAutoModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-auto']
12
15
  };
13
16
  exports["default"] = theme;
@@ -9,6 +9,9 @@ var theme = {
9
9
  themeClassName: tokens_module_css_1["default"]['sapphire-theme-default'],
10
10
  themeSecondaryModifierClassName: tokens_module_css_1["default"]['sapphire-theme--secondary'],
11
11
  themeTertiaryModifierClassName: tokens_module_css_1["default"]['sapphire-theme--tertiary'],
12
- themeContrastModifierClassName: tokens_module_css_1["default"]['sapphire-theme--contrast']
12
+ themeContrastModifierClassName: tokens_module_css_1["default"]['sapphire-theme--contrast'],
13
+ themeScaleSmModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-sm'],
14
+ themeScaleMdModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-md'],
15
+ themeScaleAutoModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-auto']
13
16
  };
14
17
  exports["default"] = theme;
@@ -4,4 +4,7 @@ export interface Theme {
4
4
  themeSecondaryModifierClassName?: string;
5
5
  themeTertiaryModifierClassName?: string;
6
6
  themeContrastModifierClassName?: string;
7
+ themeScaleSmModifierClassName?: string;
8
+ themeScaleMdModifierClassName?: string;
9
+ themeScaleAutoModifierClassName?: string;
7
10
  }
@@ -6,6 +6,9 @@ exports.__esModule = true;
6
6
  require("@danske/sapphire-design-tokens/build/themes/realkredit/assets/fonts/realkredit/fontFace.css");
7
7
  var tokens_module_css_1 = __importDefault(require("@danske/sapphire-design-tokens/build/themes/realkredit/css/tokens.module.css"));
8
8
  var theme = {
9
- themeClassName: tokens_module_css_1["default"]['sapphire-theme-realkredit']
9
+ themeClassName: tokens_module_css_1["default"]['sapphire-theme-realkredit'],
10
+ themeScaleSmModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-sm'],
11
+ themeScaleMdModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-md'],
12
+ themeScaleAutoModifierClassName: tokens_module_css_1["default"]['sapphire-theme--scale-auto']
10
13
  };
11
14
  exports["default"] = theme;
@@ -3,6 +3,9 @@ import styles from '@danske/sapphire-design-tokens/build/themes/default-dark/css
3
3
  var theme = {
4
4
  themeClassName: styles['sapphire-theme-default-dark'],
5
5
  themeSecondaryModifierClassName: styles['sapphire-theme--secondary'],
6
- themeContrastModifierClassName: styles['sapphire-theme--contrast']
6
+ themeContrastModifierClassName: styles['sapphire-theme--contrast'],
7
+ themeScaleSmModifierClassName: styles['sapphire-theme--scale-sm'],
8
+ themeScaleMdModifierClassName: styles['sapphire-theme--scale-md'],
9
+ themeScaleAutoModifierClassName: styles['sapphire-theme--scale-auto']
7
10
  };
8
11
  export default theme;
@@ -4,6 +4,9 @@ var theme = {
4
4
  themeClassName: styles['sapphire-theme-default'],
5
5
  themeSecondaryModifierClassName: styles['sapphire-theme--secondary'],
6
6
  themeTertiaryModifierClassName: styles['sapphire-theme--tertiary'],
7
- themeContrastModifierClassName: styles['sapphire-theme--contrast']
7
+ themeContrastModifierClassName: styles['sapphire-theme--contrast'],
8
+ themeScaleSmModifierClassName: styles['sapphire-theme--scale-sm'],
9
+ themeScaleMdModifierClassName: styles['sapphire-theme--scale-md'],
10
+ themeScaleAutoModifierClassName: styles['sapphire-theme--scale-auto']
8
11
  };
9
12
  export default theme;
@@ -4,4 +4,7 @@ export interface Theme {
4
4
  themeSecondaryModifierClassName?: string;
5
5
  themeTertiaryModifierClassName?: string;
6
6
  themeContrastModifierClassName?: string;
7
+ themeScaleSmModifierClassName?: string;
8
+ themeScaleMdModifierClassName?: string;
9
+ themeScaleAutoModifierClassName?: string;
7
10
  }
@@ -1,6 +1,9 @@
1
1
  import '@danske/sapphire-design-tokens/build/themes/realkredit/assets/fonts/realkredit/fontFace.css';
2
2
  import styles from '@danske/sapphire-design-tokens/build/themes/realkredit/css/tokens.module.css';
3
3
  var theme = {
4
- themeClassName: styles['sapphire-theme-realkredit']
4
+ themeClassName: styles['sapphire-theme-realkredit'],
5
+ themeScaleSmModifierClassName: styles['sapphire-theme--scale-sm'],
6
+ themeScaleMdModifierClassName: styles['sapphire-theme--scale-md'],
7
+ themeScaleAutoModifierClassName: styles['sapphire-theme--scale-auto']
5
8
  };
6
9
  export default theme;
@@ -3,11 +3,10 @@
3
3
  margin: 0;
4
4
  display: grid;
5
5
  column-gap: var(--sapphire-semantic-size-spacing-2xs);
6
- row-gap: var(--sapphire-semantic-size-spacing-sm);
6
+ row-gap: var(--sapphire-semantic-size-spacing-2xs);
7
7
  grid-template-columns: var(--sapphire-semantic-size-icon-sm) 1fr;
8
8
  padding: var(--sapphire-semantic-size-spacing-md);
9
9
  border-radius: var(--sapphire-semantic-size-radius-lg);
10
-
11
10
  color: var(--sapphire-semantic-color-foreground-primary);
12
11
 
13
12
  /* Default variant "info" */
@@ -49,6 +48,7 @@
49
48
  .sapphire-alert--warning {
50
49
  background-color: var(--sapphire-semantic-color-background-warning-subtle);
51
50
  }
51
+
52
52
  .sapphire-alert--warning .sapphire-alert__icon {
53
53
  color: var(--sapphire-semantic-color-foreground-on-warning-subtle);
54
54
  }
@@ -63,6 +63,7 @@
63
63
  .sapphire-alert--positive {
64
64
  background-color: var(--sapphire-semantic-color-background-positive-subtle);
65
65
  }
66
+
66
67
  .sapphire-alert--positive .sapphire-alert__icon {
67
68
  color: var(--sapphire-semantic-color-foreground-on-positive-subtle);
68
69
  }
@@ -1,5 +1,6 @@
1
1
  .sapphire-avatar {
2
2
  display: inline-flex;
3
+ flex-shrink: 0;
3
4
  flex-direction: column;
4
5
  justify-content: center;
5
6
  align-items: center;
@@ -66,7 +66,6 @@
66
66
  * https://github.com/necolas/normalize.css/blob/master/normalize.css#L160-L169
67
67
  */
68
68
  margin: 0;
69
- width: 100%;
70
69
  padding: 0 var(--sapphire-semantic-size-spacing-xs);
71
70
  max-width: calc(10 * var(--sapphire-semantic-size-height-control-md));
72
71
  overflow: hidden;
@@ -87,6 +86,7 @@
87
86
 
88
87
  .sapphire-button--stretch-left-align .sapphire-button__content {
89
88
  text-align: start;
89
+ width: 100%;
90
90
  }
91
91
 
92
92
  a.sapphire-button {
@@ -27,6 +27,13 @@
27
27
  );
28
28
  }
29
29
 
30
+ .sapphire-calendar__table-container--sm {
31
+ --sapphire-calendar-cell-size: var(--sapphire-global-size-generic-80);
32
+ --sapphire-calendar-control-size: var(
33
+ --sapphire-semantic-size-height-control-sm
34
+ );
35
+ }
36
+
30
37
  .sapphire-calendar__header {
31
38
  display: flex;
32
39
  align-items: center;
@@ -58,7 +65,9 @@
58
65
  }
59
66
 
60
67
  .sapphire-calendar__table-container--md .sapphire-calendar__header-title,
61
- .sapphire-calendar__table-container--md
68
+ .sapphire-calendar__table-container--md .sapphire-calendar__header-title button,
69
+ .sapphire-calendar__table-container--sm .sapphire-calendar__header-title,
70
+ .sapphire-calendar__table-container--sm
62
71
  .sapphire-calendar__header-title
63
72
  button {
64
73
  font-size: var(--sapphire-semantic-size-font-body-sm) !important;
@@ -107,6 +116,12 @@
107
116
  padding: 0;
108
117
  }
109
118
 
119
+ .sapphire-calendar__table-container--sm .sapphire-calendar__table-head-cell {
120
+ height: var(--sapphire-semantic-size-height-control-xs);
121
+ /* 2px gap between the weekday labels and the first row of days */
122
+ padding-bottom: var(--sapphire-semantic-size-spacing-4xs);
123
+ }
124
+
110
125
  .sapphire-calendar__table-body-cell {
111
126
  height: var(--sapphire-calendar-control-size);
112
127
  text-align: center;
@@ -126,7 +141,11 @@
126
141
  padding-right: var(--sapphire-semantic-size-spacing-lg);
127
142
  }
128
143
 
129
- .sapphire-calendar__table-container--md .sapphire-calendar__custom-ranges {
144
+ .sapphire-calendar__table-container--md ~ .sapphire-calendar__custom-ranges {
145
+ padding-right: var(--sapphire-semantic-size-spacing-4xs);
146
+ }
147
+
148
+ .sapphire-calendar__table-container--sm ~ .sapphire-calendar__custom-ranges {
130
149
  padding-right: var(--sapphire-semantic-size-spacing-4xs);
131
150
  }
132
151
 
@@ -137,6 +156,10 @@
137
156
  font-size: var(--sapphire-semantic-size-font-body-sm);
138
157
  }
139
158
 
159
+ .sapphire-calendar__table-container--sm .sapphire-calendar__day-of-week {
160
+ font-size: var(--sapphire-semantic-size-font-body-xs);
161
+ }
162
+
140
163
  .sapphire-calendar__week-number {
141
164
  display: block;
142
165
  text-decoration: none;
@@ -146,6 +169,10 @@
146
169
  width: var(--sapphire-calendar-cell-size);
147
170
  }
148
171
 
172
+ .sapphire-calendar__table-container--sm .sapphire-calendar__week-number {
173
+ font-size: var(--sapphire-semantic-size-font-body-xs);
174
+ }
175
+
149
176
  .sapphire-calendar__button {
150
177
  all: unset;
151
178
  display: flex;
@@ -181,6 +208,9 @@
181
208
  }
182
209
 
183
210
  .sapphire-calendar__table-container--md
211
+ .sapphire-calendar__button
212
+ .sapphire-calendar__button-text,
213
+ .sapphire-calendar__table-container--sm
184
214
  .sapphire-calendar__button
185
215
  .sapphire-calendar__button-text {
186
216
  font-size: var(--sapphire-semantic-size-font-body-sm);
@@ -201,6 +231,7 @@
201
231
  var(--sapphire-calendar-cell-size) - 2 *
202
232
  var(--sapphire-semantic-size-focus-ring)
203
233
  );
234
+ flex-shrink: 0;
204
235
  padding: 0;
205
236
  }
206
237
 
@@ -210,13 +241,18 @@
210
241
  cursor: not-allowed;
211
242
  }
212
243
 
244
+ /* Raise the focused button so its focus ring is not covered by the
245
+ neighbouring cell's range background. */
246
+ .sapphire-calendar__button.is-focus,
247
+ .sapphire-calendar__button:not(.js-focus):focus-visible {
248
+ z-index: 2;
249
+ }
250
+
213
251
  .sapphire-calendar__button.is-focus .sapphire-calendar__button-text,
214
252
  .sapphire-calendar__button:not(.js-focus):focus-visible
215
253
  .sapphire-calendar__button-text {
216
254
  outline: var(--sapphire-semantic-size-focus-ring) solid
217
255
  var(--sapphire-semantic-color-focus-ring);
218
- outline-offset: var(--sapphire-semantic-size-focus-ring);
219
- z-index: 2;
220
256
  background: var(--sapphire-semantic-color-background-action-tertiary-default);
221
257
  transition-duration: var(--sapphire-semantic-time-fade-quick);
222
258
  }
@@ -400,6 +436,7 @@
400
436
  ):focus-visible
401
437
  .sapphire-calendar__button-text {
402
438
  background: var(--sapphire-semantic-color-background-action-select-default);
439
+ outline-offset: var(--sapphire-semantic-size-focus-ring);
403
440
  }
404
441
 
405
442
  .sapphire-calendar__button.sapphire-calendar__button--range-selection.sapphire-calendar__button--selection-start,
@@ -430,6 +467,11 @@
430
467
  bottom: var(--sapphire-semantic-size-spacing-2xs);
431
468
  }
432
469
 
470
+ .sapphire-calendar__table-container--sm
471
+ .sapphire-calendar__button.sapphire-calendar__button--current::after {
472
+ bottom: var(--sapphire-semantic-size-spacing-3xs);
473
+ }
474
+
433
475
  .sapphire-calendar__button.sapphire-calendar__button--selected:not(
434
476
  .sapphire-calendar__button--range-selection
435
477
  ).sapphire-calendar__button--current::after,
@@ -2,6 +2,7 @@ declare const styles: {
2
2
  readonly "sapphire-calendar": string;
3
3
  readonly "sapphire-calendar__table-container": string;
4
4
  readonly "sapphire-calendar__table-container--md": string;
5
+ readonly "sapphire-calendar__table-container--sm": string;
5
6
  readonly "sapphire-calendar__header": string;
6
7
  readonly "sapphire-calendar__header--left": string;
7
8
  readonly "sapphire-calendar__header-next-month": string;
@@ -26,7 +26,11 @@
26
26
  opacity: 0.0001;
27
27
  z-index: 1;
28
28
 
29
- cursor: pointer;
29
+ cursor: inherit;
30
+ }
31
+
32
+ .sapphire-checkbox.is-readonly {
33
+ cursor: default;
30
34
  }
31
35
  .sapphire-checkbox__label {
32
36
  /* The below is meant to address a font rendering quirk in OSX where the text
@@ -72,6 +76,12 @@
72
76
  margin-left: var(--sapphire-semantic-size-spacing-xs);
73
77
  }
74
78
 
79
+ .sapphire-checkbox--sm .sapphire-checkbox__label {
80
+ font-size: var(--sapphire-semantic-size-font-control-md);
81
+ line-height: var(--sapphire-semantic-size-height-control-2xs);
82
+ margin-left: var(--sapphire-semantic-size-spacing-xs);
83
+ }
84
+
75
85
  .sapphire-checkbox__note,
76
86
  .sapphire-checkbox__error-text {
77
87
  display: block;
@@ -104,8 +114,29 @@
104
114
  );
105
115
  }
106
116
 
117
+ .sapphire-checkbox__note--sm,
118
+ .sapphire-checkbox__error-text--sm {
119
+ font-size: var(--sapphire-semantic-size-font-label-sm);
120
+ line-height: var(--sapphire-semantic-size-line-height-sm);
121
+ margin-left: calc(
122
+ var(--sapphire-semantic-size-spacing-xs) +
123
+ var(--sapphire-global-size-generic-35)
124
+ );
125
+ }
126
+
107
127
  /* The checkbox box */
108
128
 
129
+ .sapphire-checkbox__box-wrapper {
130
+ display: flex;
131
+ align-items: center;
132
+ height: var(--sapphire-semantic-size-height-control-xs);
133
+ }
134
+
135
+ .sapphire-checkbox--md .sapphire-checkbox__box-wrapper,
136
+ .sapphire-checkbox--sm .sapphire-checkbox__box-wrapper {
137
+ height: var(--sapphire-semantic-size-height-control-2xs);
138
+ }
139
+
109
140
  .sapphire-checkbox__box {
110
141
  box-sizing: border-box;
111
142
  position: relative;
@@ -115,14 +146,17 @@
115
146
  border: var(--sapphire-semantic-size-border-sm) solid
116
147
  var(--sapphire-semantic-color-border-field-default);
117
148
  background: var(--sapphire-semantic-color-background-field);
118
- transition: all var(--sapphire-semantic-time-fade-quick)
119
- var(--sapphire-semantic-transitions-fade);
149
+ transition-property: background, border-color, box-shadow, color;
150
+ transition-duration: var(--sapphire-semantic-time-fade-quick);
151
+ transition-timing-function: var(--sapphire-semantic-transitions-fade);
120
152
  flex-shrink: 0;
121
153
  display: inline-flex;
122
154
  justify-content: center;
123
155
  align-items: center;
124
156
  }
125
157
 
158
+ /* We should use flex to align the checkbox with the label instead of hardcoding margins */
159
+
126
160
  .sapphire-checkbox__box:has(~ .sapphire-checkbox__label:not(:empty)) {
127
161
  margin-top: var(--sapphire-semantic-size-spacing-4xs);
128
162
  }
@@ -132,6 +166,11 @@
132
166
  height: var(--sapphire-semantic-size-height-box-md);
133
167
  }
134
168
 
169
+ .sapphire-checkbox--sm .sapphire-checkbox__box {
170
+ width: var(--sapphire-global-size-generic-35);
171
+ height: var(--sapphire-global-size-generic-35);
172
+ }
173
+
135
174
  .sapphire-checkbox__box-icon {
136
175
  display: inherit;
137
176
  line-height: 0;
@@ -146,6 +185,11 @@
146
185
  width: var(--sapphire-semantic-size-height-box-md);
147
186
  }
148
187
 
188
+ .sapphire-checkbox--sm .sapphire-checkbox__box-icon {
189
+ height: var(--sapphire-semantic-size-height-box-md);
190
+ width: var(--sapphire-semantic-size-height-box-md);
191
+ }
192
+
149
193
  .sapphire-checkbox--error .sapphire-checkbox__box {
150
194
  border-color: var(--sapphire-semantic-color-border-negative-default);
151
195
  }
@@ -298,4 +342,5 @@
298
342
  .sapphire-checkbox.is-disabled,
299
343
  .sapphire-checkbox:has(:disabled) {
300
344
  opacity: var(--sapphire-semantic-opacity-disabled);
345
+ cursor: not-allowed;
301
346
  }
@@ -2,14 +2,19 @@ declare const styles: {
2
2
  readonly "sapphire-checkbox-container": string;
3
3
  readonly "sapphire-checkbox": string;
4
4
  readonly "sapphire-checkbox__input": string;
5
+ readonly "is-readonly": string;
5
6
  readonly "sapphire-checkbox__label": string;
6
7
  readonly "sapphire-checkbox__required-indicator": string;
7
8
  readonly "sapphire-checkbox__optional-indicator": string;
8
9
  readonly "sapphire-checkbox--md": string;
10
+ readonly "sapphire-checkbox--sm": string;
9
11
  readonly "sapphire-checkbox__note": string;
10
12
  readonly "sapphire-checkbox__error-text": string;
11
13
  readonly "sapphire-checkbox__note--md": string;
12
14
  readonly "sapphire-checkbox__error-text--md": string;
15
+ readonly "sapphire-checkbox__note--sm": string;
16
+ readonly "sapphire-checkbox__error-text--sm": string;
17
+ readonly "sapphire-checkbox__box-wrapper": string;
13
18
  readonly "sapphire-checkbox__box": string;
14
19
  readonly "sapphire-checkbox__box-icon": string;
15
20
  readonly "sapphire-checkbox--error": string;
@@ -0,0 +1,178 @@
1
+ /* DanskeProgressBar 3D scene */
2
+ .sapphire-danske-progress-bar {
3
+ /*
4
+ * Set --sapphire-danske-progress-bar-height (px) or --sapphire-danske-progress-bar-width (px)
5
+ * to control the size. If both are set, height takes precedence.
6
+ * All geometry is derived from a single face height:
7
+ * faceWidth = faceHeight × PHI × √(2+PHI) ≈ faceHeight × 3.07768
8
+ * halfDepth = faceWidth / 2
9
+ * containerWidth = faceWidth × √2 ≈ faceWidth × 1.41421
10
+ *
11
+ * The nested var() fallback derives face height from width when only width is given.
12
+ * When neither variable is set the inner literal (40px × ratio) cancels with the
13
+ * outer division, yielding the 40px default without any extra magic numbers.
14
+ */
15
+ --_face-height: var(
16
+ --sapphire-danske-progress-bar-height,
17
+ calc(
18
+ var(--sapphire-danske-progress-bar-width, calc(40px * 3.07768 * 1.41421)) /
19
+ (3.07768 * 1.41421)
20
+ )
21
+ );
22
+ --_face-width: calc(var(--_face-height) * 3.07768);
23
+ --_half-depth: calc(var(--_face-width) / 2);
24
+
25
+ /* Width is set to faceWidth × √2 (max projected width during rotation).
26
+ Flexbox centres the narrower scene div horizontally so the 3D faces always
27
+ have room to rotate without overflowing the element's layout bounds. */
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ position: relative;
32
+ width: calc(var(--_face-width) * 1.41421);
33
+ height: var(--_face-height);
34
+ }
35
+
36
+ @property --_angle {
37
+ syntax: '<angle>';
38
+ inherits: false;
39
+ initial-value: -31.7175deg;
40
+ }
41
+
42
+ /*
43
+ * 2D outline: a pseudo-element whose width tracks the orthographic projection of
44
+ * the rotating box — W × (|cos θ| + |sin θ|). Fixed layout width + scaleX keeps
45
+ * the border on a GPU-composited layer, avoiding sub-pixel rasterization changes.
46
+ * NOTE: Title-Case math functions prevent Dart Sass from evaluating them at build
47
+ * time when compiling Angular stylesheets.
48
+ * Hidden and replaced by 3D face borders in the @supports not block below.
49
+ */
50
+ .sapphire-danske-progress-bar::after {
51
+ content: '';
52
+ position: absolute;
53
+ top: 0;
54
+ left: 50%;
55
+ z-index: 1;
56
+ width: calc(var(--_face-width) * 1.41421);
57
+ transform: translateX(-50%)
58
+ scaleX(calc((Abs(Cos(var(--_angle))) + Abs(Sin(var(--_angle)))) / 1.41421));
59
+ height: 100%;
60
+ border: max(1px, calc(var(--_face-width) / 100)) solid
61
+ var(--sapphire-semantic-color-background-spinner-primary);
62
+ box-sizing: border-box;
63
+ animation: sapphire-danske-progress-bar-rotate 2000ms
64
+ cubic-bezier(0.5, 0, 0, 1) infinite;
65
+ will-change: transform;
66
+ pointer-events: none;
67
+ }
68
+
69
+ .sapphire-danske-progress-bar__box {
70
+ position: relative;
71
+ width: var(--_face-width);
72
+ height: var(--_face-height);
73
+ transform-style: preserve-3d;
74
+ transform: rotateY(var(--_angle));
75
+ animation: sapphire-danske-progress-bar-rotate 2000ms
76
+ cubic-bezier(0.5, 0, 0, 1) infinite;
77
+ }
78
+
79
+ @keyframes sapphire-danske-progress-bar-rotate {
80
+ from {
81
+ --_angle: -31.7175deg;
82
+ }
83
+ to {
84
+ --_angle: 148.2825deg;
85
+ }
86
+ }
87
+
88
+ /*
89
+ * Faces are rendered via pseudo-elements to avoid extra markup.
90
+ * __box::before/::after are the front/back (signature colour) faces.
91
+ * __box-inner::before/::after are the left/right (white) side faces.
92
+ * All borders are absent here — the 2D outline above handles the stroke.
93
+ */
94
+ .sapphire-danske-progress-bar__box::before,
95
+ .sapphire-danske-progress-bar__box::after,
96
+ .sapphire-danske-progress-bar__box-inner::before,
97
+ .sapphire-danske-progress-bar__box-inner::after {
98
+ content: '';
99
+ position: absolute;
100
+ backface-visibility: hidden;
101
+ width: var(--_face-width);
102
+ height: var(--_face-height);
103
+ }
104
+
105
+ /* Front and back faces use the signature colour */
106
+ .sapphire-danske-progress-bar__box::before,
107
+ .sapphire-danske-progress-bar__box::after {
108
+ background: var(--sapphire-semantic-color-background-signature);
109
+ }
110
+
111
+ .sapphire-danske-progress-bar__box::before {
112
+ transform: translateZ(var(--_half-depth));
113
+ }
114
+
115
+ .sapphire-danske-progress-bar__box::after {
116
+ transform: translateZ(calc(var(--_half-depth) * -1)) rotateY(180deg);
117
+ }
118
+
119
+ /* Left and right faces are white (catching the "light") */
120
+ .sapphire-danske-progress-bar__box-inner {
121
+ position: absolute;
122
+ width: var(--_face-width);
123
+ height: var(--_face-height);
124
+ transform-style: preserve-3d; /* allows pseudo-elements to participate in the 3D scene */
125
+ }
126
+
127
+ .sapphire-danske-progress-bar__box-inner::before,
128
+ .sapphire-danske-progress-bar__box-inner::after {
129
+ background: #ffffff; /* Intentionally hard coded, as it's a part of the logo. */
130
+ }
131
+
132
+ .sapphire-danske-progress-bar__box-inner::before {
133
+ transform: translateX(calc(var(--_half-depth) * -1)) rotateY(-90deg);
134
+ }
135
+
136
+ .sapphire-danske-progress-bar__box-inner::after {
137
+ transform: translateX(var(--_half-depth)) rotateY(90deg);
138
+ }
139
+
140
+ /* Suppress the 2D outline when the --no-outline modifier is present on the root. */
141
+ .sapphire-danske-progress-bar--no-outline::after {
142
+ display: none;
143
+ }
144
+
145
+ /*
146
+ * Fallback for browsers without CSS math functions (abs, cos, sin) — primarily
147
+ * browsers older than Chrome 117 / Firefox 128 / Safari 16.4.
148
+ * The 2D outline is hidden (its scaleX formula requires trig functions) and
149
+ * replaced by traditional 3D borders on the face pseudo-elements. Left/right
150
+ * borders may flicker slightly as they foreshorten during rotation — this is an
151
+ * accepted trade-off for the degraded experience.
152
+ */
153
+ @supports not (width: Abs(1px)) {
154
+ .sapphire-danske-progress-bar::after {
155
+ display: none;
156
+ }
157
+
158
+ .sapphire-danske-progress-bar__box::before,
159
+ .sapphire-danske-progress-bar__box::after,
160
+ .sapphire-danske-progress-bar__box-inner::before,
161
+ .sapphire-danske-progress-bar__box-inner::after {
162
+ box-sizing: border-box;
163
+ border: max(1px, calc(var(--_face-width) / 100)) solid
164
+ var(--sapphire-semantic-color-background-signature);
165
+ }
166
+
167
+ .sapphire-danske-progress-bar--no-outline
168
+ .sapphire-danske-progress-bar__box::before,
169
+ .sapphire-danske-progress-bar--no-outline
170
+ .sapphire-danske-progress-bar__box::after,
171
+ .sapphire-danske-progress-bar--no-outline
172
+ .sapphire-danske-progress-bar__box-inner::before,
173
+ .sapphire-danske-progress-bar--no-outline
174
+ .sapphire-danske-progress-bar__box-inner::after {
175
+ border: none;
176
+ box-sizing: content-box;
177
+ }
178
+ }
@@ -0,0 +1,9 @@
1
+ declare const styles: {
2
+ readonly "sapphire-danske-progress-bar": string;
3
+ readonly "sapphire-danske-progress-bar-rotate": string;
4
+ readonly "sapphire-danske-progress-bar__box": string;
5
+ readonly "sapphire-danske-progress-bar__box-inner": string;
6
+ readonly "sapphire-danske-progress-bar--no-outline": string;
7
+ };
8
+ export = styles;
9
+
@@ -53,7 +53,7 @@
53
53
  }
54
54
 
55
55
  .sapphire-date-field--no-calendar {
56
- padding-left: var(--sapphire-semantic-size-spacing-control-horizontal-lg);
56
+ padding-left: var(--sapphire-semantic-size-spacing-control-horizontal-md);
57
57
  }
58
58
 
59
59
  .sapphire-date-field--no-clear-button {
@@ -133,6 +133,35 @@
133
133
  font-size: var(--sapphire-semantic-size-font-control-md);
134
134
  }
135
135
 
136
+ /**
137
+ * Small size
138
+ */
139
+ .sapphire-date-field--sm {
140
+ --sapphire-dateField-icon-size: var(--sapphire-semantic-size-icon-sm);
141
+
142
+ height: var(--sapphire-semantic-size-height-control-sm);
143
+ padding: 0 var(--sapphire-semantic-size-spacing-control-horizontal-sm);
144
+ gap: var(--sapphire-semantic-size-spacing-2xs);
145
+ border-radius: var(--sapphire-semantic-size-radius-sm);
146
+ }
147
+
148
+ .sapphire-date-field--no-calendar.sapphire-date-field--sm {
149
+ padding-left: var(--sapphire-semantic-size-spacing-control-horizontal-md);
150
+ }
151
+
152
+ .sapphire-date-field--align-right.sapphire-date-field--no-calendar.sapphire-date-field--sm {
153
+ padding-left: var(--sapphire-semantic-size-spacing-control-horizontal-sm);
154
+ padding-right: var(--sapphire-semantic-size-spacing-control-horizontal-md);
155
+ }
156
+
157
+ .sapphire-date-field--sm .sapphire-date-field__input-group {
158
+ gap: var(--sapphire-semantic-size-spacing-4xs);
159
+ }
160
+
161
+ .sapphire-date-field--sm .sapphire-date-field__input {
162
+ font-size: var(--sapphire-semantic-size-font-control-sm);
163
+ }
164
+
136
165
  /**
137
166
  * Disabled
138
167
  */
@@ -10,6 +10,7 @@ declare const styles: {
10
10
  readonly "sapphire-date-field__input--align-right": string;
11
11
  readonly "sapphire-date-field__range-separator": string;
12
12
  readonly "sapphire-date-field--md": string;
13
+ readonly "sapphire-date-field--sm": string;
13
14
  readonly "is-disabled": string;
14
15
  readonly "sapphire-date-field__segment": string;
15
16
  readonly "is-focus": string;