@danske/sapphire-css 40.1.0 → 40.2.1

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.
@@ -70,7 +70,11 @@ legend.sapphire-field__label {
70
70
  */
71
71
  .sapphire-field__control--group {
72
72
  display: flex;
73
- gap: var(--sapphire-semantic-size-spacing-control-horizontal-lg);
73
+ gap: var(--sapphire-semantic-size-spacing-xs);
74
+ }
75
+
76
+ .sapphire-field--md .sapphire-field__control--group {
77
+ gap: var(--sapphire-semantic-size-spacing-2xs);
74
78
  }
75
79
 
76
80
  /**
@@ -94,11 +98,15 @@ legend.sapphire-field__label {
94
98
  min-width: 100%;
95
99
  max-width: min-content;
96
100
  order: 3;
101
+ display: flex;
102
+ flex-direction: column;
103
+ gap: var(--sapphire-semantic-size-spacing-4xs);
104
+ padding: var(--sapphire-semantic-size-spacing-4xs) 0;
97
105
  }
98
106
 
99
107
  /**
100
108
  * Note
101
- * An error message or a note, which by design are mutually exclusive.
109
+ * An error message or a note. In rare cases both can appear at the same time.
102
110
  */
103
111
  .sapphire-field__note-row {
104
112
  display: flex;
@@ -111,6 +119,8 @@ legend.sapphire-field__label {
111
119
 
112
120
  .sapphire-field--md .sapphire-field__note-row {
113
121
  font-size: var(--sapphire-semantic-size-font-label-sm);
122
+ line-height: var(--sapphire-semantic-size-line-height-sm);
123
+ gap: var(--sapphire-semantic-size-spacing-2xs);
114
124
  }
115
125
 
116
126
  .sapphire-field__note {
@@ -119,9 +129,13 @@ legend.sapphire-field__label {
119
129
 
120
130
  .sapphire-field__note-icon {
121
131
  display: inline-flex;
122
- align-items: center;
123
- /** For alignment with text */
124
- height: calc(1em * var(--sapphire-semantic-size-line-height-md));
132
+ /* For alignment with text */
133
+ line-height: 0;
134
+ padding-top: var(--sapphire-semantic-size-spacing-4xs);
135
+ }
136
+
137
+ .sapphire-field--md .sapphire-field__note-icon {
138
+ padding-top: 0;
125
139
  }
126
140
 
127
141
  /**
@@ -299,7 +299,9 @@ a.sapphire-icon-button {
299
299
  background: var(
300
300
  --sapphire-semantic-color-background-action-danger-tertiary-active
301
301
  );
302
- color: var(--sapphire-semantic-color-foreground-action-on-danger-active);
302
+ color: var(
303
+ --sapphire-semantic-color-foreground-action-on-danger-tertiary-active
304
+ );
303
305
  }
304
306
 
305
307
  /**
@@ -34,6 +34,7 @@
34
34
  }
35
35
 
36
36
  .sapphire-pagination__text {
37
+ font-size: var(--sapphire-semantic-size-font-body-sm);
37
38
  font-weight: var(--sapphire-semantic-font-weight-default-regular);
38
39
  padding-left: var(--sapphire-semantic-size-spacing-2xs);
39
40
  padding-right: var(--sapphire-semantic-size-spacing-2xs);
@@ -59,12 +59,11 @@
59
59
 
60
60
  .sapphire-tabs {
61
61
  display: inline-flex;
62
+ align-items: center;
62
63
  box-sizing: border-box;
63
- height: var(--sapphire-semantic-size-height-control-lg);
64
- gap: var(--sapphire-semantic-size-spacing-md);
64
+ height: var(--sapphire-semantic-size-height-control-xl);
65
65
  position: relative;
66
66
  overflow: hidden;
67
- position: relative;
68
67
  min-width: 100%;
69
68
  flex: 1;
70
69
  padding: 0 var(--sapphire-semantic-size-focus-ring);
@@ -88,11 +87,29 @@
88
87
  position: absolute;
89
88
  bottom: 0;
90
89
  width: 100%;
91
- height: var(--sapphire-semantic-size-border-md);
90
+ height: var(--sapphire-global-size-static-2);
92
91
  background: var(--sapphire-semantic-color-border-secondary);
93
92
  border-radius: var(--sapphire-semantic-size-border-md);
94
93
  }
95
94
 
95
+ .sapphire-tabs__underline {
96
+ position: absolute;
97
+ bottom: 0;
98
+ height: var(--sapphire-semantic-size-border-md);
99
+ background: var(--sapphire-semantic-color-foreground-action-select-default);
100
+ z-index: 2;
101
+ transform-origin: left;
102
+ }
103
+
104
+ .sapphire-tabs__underline--with-transition {
105
+ transition: transform var(--sapphire-semantic-time-motion-default)
106
+ var(--sapphire-semantic-transitions-dynamic),
107
+ width var(--sapphire-semantic-time-motion-default)
108
+ var(--sapphire-global-transitions-ease-in-out-quick);
109
+ transition-duration: var(--sapphire-semantic-time-fade-quick);
110
+ transition-timing-function: var(--sapphire-semantic-transitions-fade);
111
+ }
112
+
96
113
  /**
97
114
  * No underline modifier
98
115
  */
@@ -113,12 +130,12 @@
113
130
  font-size: var(--sapphire-semantic-size-font-control-md);
114
131
  text-decoration: none;
115
132
 
116
- background: none;
117
133
  color: var(--sapphire-semantic-color-foreground-primary);
118
134
  box-sizing: border-box;
119
135
  white-space: nowrap;
120
136
  border-width: 0;
121
- padding: 0;
137
+ padding: 0 var(--sapphire-semantic-size-spacing-md);
138
+ height: var(--sapphire-semantic-size-height-control-md);
122
139
  /**
123
140
  * The 0 padding is for Safari which adds 2px padding to buttons (meaning gap
124
141
  * between tabs when tab is a button).
@@ -132,25 +149,47 @@
132
149
  outline: none;
133
150
 
134
151
  /* Need the border radius to round the focus ring*/
135
- border-radius: var(--sapphire-semantic-size-radius-sm);
152
+ border-radius: var(--sapphire-semantic-size-height-control-md);
136
153
 
137
154
  /* Just to make sure it's above the grey border */
138
155
  z-index: 1;
156
+
157
+ transition: background var(--sapphire-semantic-time-motion-default)
158
+ var(--sapphire-semantic-transitions-dynamic),
159
+ color var(--sapphire-semantic-time-motion-default)
160
+ var(--sapphire-semantic-transitions-dynamic),
161
+ width var(--sapphire-semantic-time-motion-default)
162
+ var(--sapphire-semantic-transitions-dynamic);
163
+ transition-duration: var(--sapphire-semantic-time-fade-quick);
164
+ transition-timing-function: var(--sapphire-semantic-transitions-fade);
139
165
  }
140
166
 
141
167
  .sapphire-tabs__tab:not(:disabled):not(.is-disabled):not(:active):not(
142
168
  .is-active
143
- ):not(.js-hover):hover,
169
+ ):not(.sapphire-tabs__tab--active):not(.js-hover):hover,
144
170
  .sapphire-tabs__tab:not(:disabled):not(.is-disabled):not(:active):not(
145
171
  .is-active
146
- ).is-hover {
147
- color: var(--sapphire-semantic-color-foreground-action-select-hover);
172
+ ):not(.sapphire-tabs__tab--active).is-hover {
173
+ background: var(--sapphire-semantic-color-background-action-tertiary-hover);
174
+ }
175
+
176
+ .sapphire-tabs__tab--active:not(:disabled):not(.is-disabled):not(
177
+ .js-hover
178
+ ):hover,
179
+ .sapphire-tabs__tab--active:not(:disabled):not(.is-disabled).is-hover {
180
+ background: var(--sapphire-semantic-color-state-accent-subtle-hover);
148
181
  }
149
182
 
150
183
  .sapphire-tabs__tab:not(:disabled):not(.is-disabled):active,
151
- .sapphire-tabs__tab:not(:disabled):not(.is-disabled):focus-visible:active,
152
- .sapphire-tabs__tab:not(:disabled):not(.is-disabled).is-active {
153
- color: var(--sapphire-semantic-color-foreground-action-select-active);
184
+ .sapphire-tabs__tab:not(:disabled):not(.is-disabled):focus-visible:active {
185
+ background: var(--sapphire-semantic-color-background-action-tertiary-active);
186
+ }
187
+
188
+ .sapphire-tabs__tab--active:active:not(:disabled):not(.is-disabled):not(
189
+ .js-hover
190
+ ):hover,
191
+ .sapphire-tabs__tab--active:active:not(:disabled):not(.is-disabled).is-hover {
192
+ background: var(--sapphire-semantic-color-state-accent-subtle-active);
154
193
  }
155
194
 
156
195
  .sapphire-tabs__tab.js-focus.is-focus,
@@ -177,13 +216,13 @@
177
216
  padding: 0 1px;
178
217
  }
179
218
 
180
- /**
181
- * Active tab
182
- */
183
- .sapphire-tabs__tab--active {
219
+ .sapphire-tabs__tab--active,
220
+ .sapphire-tabs__tab--active:hover,
221
+ .sapphire-tabs__tab--active.is-hover {
184
222
  color: var(--sapphire-semantic-color-foreground-action-select-default);
185
223
  }
186
224
 
225
+ /* Default behavior: Show individual tab underlines for active tabs */
187
226
  .sapphire-tabs__tab--active.js-focus:not(.is-focus)::after,
188
227
  .sapphire-tabs__tab--active:not(.js-focus):not(:focus-visible)::after {
189
228
  content: '';
@@ -193,30 +232,39 @@
193
232
  bottom: calc(-1 * var(--sapphire-semantic-size-focus-ring));
194
233
  width: 100%;
195
234
  height: var(--sapphire-semantic-size-border-md);
196
- background: var(--sapphire-semantic-color-foreground-action-select-default);
197
- border-radius: var(--sapphire-semantic-size-border-md);
235
+ background: var(
236
+ --sapphire-semantic-color-background-action-select-secondary-hover
237
+ );
238
+ }
239
+
240
+ /* Hide individual tab underlines when using animated underline */
241
+ .sapphire-tabs .sapphire-tabs__tab--active.js-focus:not(.is-focus)::after,
242
+ .sapphire-tabs
243
+ .sapphire-tabs__tab--active:not(.js-focus):not(:focus-visible)::after {
244
+ display: none;
198
245
  }
199
246
 
200
247
  /**
201
248
  * Small
202
249
  */
203
250
  .sapphire-tabs--sm {
204
- height: var(--sapphire-semantic-size-height-control-md);
205
- gap: var(--sapphire-semantic-size-spacing-md);
251
+ height: var(--sapphire-semantic-size-height-control-lg);
206
252
  }
207
253
  .sapphire-tabs--sm .sapphire-tabs__tab {
208
254
  font-size: var(--sapphire-semantic-size-font-control-sm);
255
+ padding: 0 var(--sapphire-semantic-size-spacing-sm);
256
+ height: var(--sapphire-semantic-size-height-control-sm);
209
257
  }
210
258
 
211
259
  /**
212
260
  * Large
213
261
  */
214
262
  .sapphire-tabs--lg {
215
- height: var(--sapphire-semantic-size-height-control-xl);
216
- gap: var(--sapphire-semantic-size-spacing-lg);
263
+ height: var(--sapphire-semantic-size-height-control-2xl);
217
264
  }
218
265
  .sapphire-tabs--lg .sapphire-tabs__tab {
219
266
  font-size: var(--sapphire-semantic-size-font-control-lg);
267
+ padding: 0 var(--sapphire-semantic-size-spacing-lg);
220
268
  }
221
269
 
222
270
  .sapphire-tab-panel {
@@ -9,16 +9,18 @@ declare const styles: {
9
9
  readonly "sapphire-tabs--align-left": string;
10
10
  readonly "sapphire-tabs--align-center": string;
11
11
  readonly "sapphire-tabs--align-right": string;
12
+ readonly "sapphire-tabs__underline": string;
13
+ readonly "sapphire-tabs__underline--with-transition": string;
12
14
  readonly "sapphire-tabs--no-border": string;
13
15
  readonly "sapphire-tabs__tab": string;
14
16
  readonly "is-disabled": string;
15
17
  readonly "is-active": string;
18
+ readonly "sapphire-tabs__tab--active": string;
16
19
  readonly "js-hover": string;
17
20
  readonly "is-hover": string;
18
21
  readonly "js-focus": string;
19
22
  readonly "is-focus": string;
20
23
  readonly "sapphire-tabs__label": string;
21
- readonly "sapphire-tabs__tab--active": string;
22
24
  readonly "sapphire-tabs--sm": string;
23
25
  readonly "sapphire-tabs--lg": string;
24
26
  readonly "sapphire-tab-panel": string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danske/sapphire-css",
3
- "version": "40.1.0",
3
+ "version": "40.2.1",
4
4
  "description": "CSS implementation of the Sapphire Design System from Danske Bank A/S",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "sideEffects": false,
@@ -67,7 +67,7 @@
67
67
  "typescript": "~4.6.4"
68
68
  },
69
69
  "dependencies": {
70
- "@danske/sapphire-design-tokens": "^42.0.0"
70
+ "@danske/sapphire-design-tokens": "^42.1.0"
71
71
  },
72
- "gitHead": "a2fe96ba580fd6c06c3ddaac972775f59f55879b"
72
+ "gitHead": "612c203ea4278deafe40f5477b5b33569cf06cfb"
73
73
  }