@navikt/ds-css 8.7.0 → 8.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-css",
3
- "version": "8.7.0",
3
+ "version": "8.9.0",
4
4
  "description": "CSS for Nav Designsystem",
5
5
  "author": "Aksel | Nav designsystem team",
6
6
  "keywords": [
@@ -30,9 +30,9 @@
30
30
  "css:get-version": "node config/get-version.js"
31
31
  },
32
32
  "devDependencies": {
33
- "@navikt/ds-tokens": "^8.7.0",
33
+ "@navikt/ds-tokens": "^8.9.0",
34
34
  "browserslist": "^4.25.0",
35
- "esbuild": "^0.27.2",
35
+ "esbuild": "^0.27.4",
36
36
  "fast-glob": "3.3.3",
37
37
  "lightningcss": "^1.30.1",
38
38
  "normalize.css": "^8.0.1",
package/src/alert.css CHANGED
@@ -117,8 +117,8 @@
117
117
  }
118
118
 
119
119
  &[data-variant="strong"] {
120
- outline: 4px solid var(--ax-border-default);
121
- outline-offset: -4px;
120
+ outline: 2px solid var(--ax-border-default);
121
+ outline-offset: -2px;
122
122
 
123
123
  &[data-color="neutral"] {
124
124
  outline-color: var(--ax-border-strong);
@@ -192,3 +192,24 @@
192
192
  color: var(--ax-text-neutral-contrast);
193
193
  }
194
194
  }
195
+
196
+ .aksel-base-alert__message {
197
+ border-radius: var(--ax-radius-12);
198
+ height: fit-content;
199
+ outline: 1px solid var(--ax-border-default);
200
+ outline-offset: -1px;
201
+ background: var(--ax-bg-moderate);
202
+ color: var(--ax-text-default);
203
+ display: flex;
204
+ align-items: flex-start;
205
+ gap: var(--ax-space-8);
206
+ padding: var(--ax-space-12) var(--ax-space-16);
207
+
208
+ & > .aksel-base-alert__icon {
209
+ margin-top: var(--ax-space-2);
210
+ }
211
+
212
+ .aksel-base-alert[data-size="small"] & > .aksel-base-alert__icon {
213
+ margin-top: 0;
214
+ }
215
+ }
package/src/chips.css CHANGED
@@ -95,8 +95,6 @@
95
95
  padding-left: var(--ax-space-6);
96
96
  }
97
97
 
98
- /* -------------------------- start old CSS -------------------------- */
99
-
100
98
  /* ----------------------------- Chips removable ---------------------------- */
101
99
  .aksel-chips__removable {
102
100
  gap: 0;
@@ -33,14 +33,14 @@
33
33
  min-width: 100%;
34
34
  }
35
35
 
36
- --__axc-data-table-density: var(--ax-space-16) 0;
36
+ --__axc-data-table-density: var(--ax-space-16);
37
37
 
38
38
  &[data-density="condensed"] {
39
- --__axc-data-table-density: var(--ax-space-8) 0;
39
+ --__axc-data-table-density: var(--ax-space-8);
40
40
  }
41
41
 
42
42
  &[data-density="spacious"] {
43
- --__axc-data-table-density: var(--ax-space-32) 0;
43
+ --__axc-data-table-density: var(--ax-space-32);
44
44
  }
45
45
 
46
46
  &[data-zebra-stripes="true"] {
@@ -118,6 +118,18 @@
118
118
  .aksel-data-table__td {
119
119
  /* border doesn't work on sticky thead when we have collapsed borders, so using box-shadow instead */
120
120
  box-shadow: inset 1px 1px 0 0 var(--ax-border-neutral-subtle);
121
+
122
+ &[data-align="left"] {
123
+ text-align: left;
124
+ }
125
+
126
+ &[data-align="center"] {
127
+ text-align: center;
128
+ }
129
+
130
+ &[data-align="right"] {
131
+ text-align: right;
132
+ }
121
133
  }
122
134
 
123
135
  /* BORDER STYLING END */
@@ -128,10 +140,19 @@
128
140
  color: var(--ax-text-neutral);
129
141
  padding: var(--ax-space-8) var(--ax-space-16);
130
142
  text-align: start;
143
+ font-weight: var(--ax-font-weight-bold);
144
+
145
+ &:has(.aksel-data-table__th-sort-button):hover {
146
+ background-color: var(--ax-bg-neutral-moderate-hover);
147
+ }
148
+
149
+ &:has(.aksel-data-table__th-sort-button):active {
150
+ background-color: var(--ax-bg-neutral-moderate-pressed);
151
+ }
131
152
 
132
153
  &[data-sortable="true"] {
133
154
  padding: 0;
134
- block-size: 2rem;
155
+ block-size: calc(var(--__axc-data-table-density) + 1.5rem);
135
156
  }
136
157
  }
137
158
 
@@ -140,35 +161,36 @@
140
161
  align-items: center;
141
162
  gap: var(--ax-space-2);
142
163
  padding-inline-start: var(--ax-space-16);
143
- block-size: 2rem;
164
+ block-size: calc(var(--__axc-data-table-density) + 1.5rem);
144
165
  width: 100%;
145
166
  cursor: pointer;
146
167
  text-align: start;
147
168
  background-color: transparent;
148
169
  border: none;
149
-
150
- &:hover {
151
- background-color: var(--ax-bg-neutral-moderate-hover);
152
- }
153
-
154
- &:active {
155
- background-color: var(--ax-bg-neutral-moderate-pressed);
156
- }
170
+ font-weight: inherit;
157
171
 
158
172
  &:focus-visible {
159
- outline: 2px solid var(--ax-border-focus);
160
- outline-offset: -2px;
173
+ outline: none;
161
174
  }
162
175
  }
163
176
 
164
177
  .aksel-data-table__th-sort-icon {
165
178
  flex-shrink: 0;
179
+ margin-left: auto;
166
180
 
167
181
  &[data-sort-direction="none"] {
168
- display: none;
182
+ visibility: hidden;
169
183
  }
170
184
 
171
185
  .aksel-data-table__th-sort-button:is(:hover, :focus-visible, :focus-within) & {
186
+ visibility: visible;
187
+ }
188
+
189
+ .aksel-data-table[data-layout="fixed"] &[data-sort-direction="none"] {
190
+ display: none;
191
+ }
192
+
193
+ .aksel-data-table[data-layout="fixed"] .aksel-data-table__th-sort-button:is(:hover, :focus-visible, :focus-within) & {
172
194
  display: block;
173
195
  }
174
196
  }
@@ -194,8 +216,8 @@
194
216
  width: 19px; /* TODO: Violation of WCAG SC 2.5.8 Target Size? https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html */
195
217
 
196
218
  &:focus-visible {
197
- outline: 3px solid var(--ax-border-focus);
198
- outline-offset: -3px;
219
+ outline: 2px solid var(--ax-border-focus);
220
+ outline-offset: -4px;
199
221
  border-radius: var(--ax-radius-8);
200
222
  }
201
223
 
@@ -204,6 +226,11 @@
204
226
  position: absolute;
205
227
  inset-block: 0;
206
228
  width: 3px;
229
+ height: 75%;
230
+ top: 50%;
231
+ transform: translateY(-50%);
232
+ border-radius: var(--ax-radius-full);
233
+ transition: background 50ms linear;
207
234
  }
208
235
 
209
236
  &:hover::after {
@@ -212,11 +239,11 @@
212
239
  }
213
240
 
214
241
  &:active::after,
215
- &:focus::after {
242
+ &:focus-visible::after {
216
243
  background: var(--ax-bg-strong-pressed);
217
244
  }
218
245
 
219
- .aksel-data-table__th:last-child & {
246
+ .aksel-data-table__th:last-of-type & {
220
247
  inset-inline-end: 0;
221
248
  width: 15px;
222
249
 
@@ -280,7 +307,7 @@
280
307
  color: var(--ax-text-neutral-subtle);
281
308
 
282
309
  > div {
283
- padding: var(--__axc-data-table-density);
310
+ padding-block: var(--__axc-data-table-density);
284
311
  padding-inline: 1rem;
285
312
  }
286
313
  }
@@ -290,7 +317,9 @@
290
317
  scroll-margin-block: var(--ax-space-0);
291
318
  scroll-margin-inline: var(--ax-space-0);
292
319
 
293
- &:focus-visible {
320
+ &:focus-visible,
321
+ /* Focus instead of focus-visible so that effect of sort-icon staying isnt strange */
322
+ &:has(.aksel-data-table__th-sort-button:focus) {
294
323
  outline: 2px solid var(--ax-border-focus);
295
324
  outline-offset: -4px;
296
325
  }
@@ -303,53 +332,143 @@
303
332
  .aksel-data-table__filler-cell {
304
333
  width: auto;
305
334
  display: table-cell;
335
+ padding: 0;
306
336
  }
307
337
 
308
- .aksel-data-table__drag-and-drop-item {
309
- &[data-dragging="true"] {
310
- background: var(--ax-bg-default);
338
+ .aksel-data-drag-and-drop__drag-handler__button {
339
+ height: 1.5rem;
340
+ position: relative;
341
+ background: transparent;
342
+ border: none;
343
+ padding: 0;
344
+
345
+ &:hover {
346
+ cursor: grab;
311
347
  }
312
348
 
313
- &[data-mouse-dragging="true"]:not(:active) {
349
+ &:focus-visible,
350
+ &[data-drag-handler-active="true"] {
351
+ outline: 2px solid var(--ax-border-focus);
352
+ outline-offset: -1px;
353
+ border-radius: var(--ax-radius-8);
354
+ }
355
+ }
356
+
357
+ .aksel-data-table__drag-and-drop-item {
358
+ background-color: var(--ax-bg-default);
359
+
360
+ &[data-overlay="true"] {
361
+ width: 100%;
314
362
  opacity: 0.8;
363
+ box-shadow: var(--ax-shadow-dialog);
315
364
  }
316
365
 
366
+ /* TODO - might be removable */
317
367
  &[data-keyboard-dragging="true"] {
318
- .aksel-data-table__drag-and-drop-item-drag-handler {
368
+ .aksel-data-drag-and-drop__drag-handler__button {
319
369
  outline: 2px solid var(--ax-border-focus);
320
370
  outline-offset: -1px;
321
371
  border-radius: var(--ax-radius-8);
322
372
  }
323
373
  }
324
374
 
325
- &[data-drop-target="true"] {
375
+ &[data-drop-target="true"]:not([data-overlay="true"]) {
326
376
  background: var(--ax-bg-neutral-moderate);
327
377
  }
328
378
  }
329
379
 
330
- .aksel-data-table__drag-and-drop-item-drag-handler {
331
- cursor: grab;
380
+ .aksel-data-drag-and-drop__drag-handler__arrow {
381
+ height: 1.2rem;
382
+ }
383
+
384
+ .aksel-data-drag-and-drop__drag-handler__alt,
385
+ .aksel-data-drag-and-drop__drag-handler {
386
+ position: relative;
332
387
  height: 1.5rem;
388
+
389
+ .aksel-data-drag-and-drop__drag-handler__arrow {
390
+ position: absolute;
391
+ left: 50%;
392
+ transform: translate(-50%, -50%);
393
+
394
+ &[data-direction="up"] {
395
+ top: -10px;
396
+ }
397
+
398
+ &[data-direction="down"] {
399
+ bottom: calc(-100% - 6px);
400
+ }
401
+ }
402
+ }
403
+
404
+ .aksel-data-table__empty-state {
405
+ display: grid;
406
+ place-content: center;
407
+ padding-block: var(--ax-space-32);
408
+ padding-inline: var(--ax-space-16);
409
+ text-align: center;
410
+ gap: var(--ax-space-8);
411
+ justify-items: center;
412
+ }
413
+
414
+ .aksel-data-table__loading-state {
415
+ display: grid;
416
+ place-content: center;
417
+ padding-block: var(--ax-space-32);
418
+ padding-inline: var(--ax-space-16);
419
+ text-align: center;
420
+ gap: var(--ax-space-8);
421
+ justify-items: center;
333
422
  position: relative;
334
423
 
335
- &:focus-visible {
336
- outline: 2px solid var(--ax-border-focus);
337
- outline-offset: -1px;
338
- border-radius: var(--ax-radius-8);
424
+ &::before {
425
+ content: "";
426
+ position: absolute;
427
+ inline-size: 100%;
428
+ block-size: 2px;
429
+ inset-block-start: -1px;
430
+ background-color: var(--ax-bg-strong);
431
+ animation: animateDataTableLoading 1s linear infinite;
339
432
  }
340
433
  }
341
434
 
342
- .aksel-data-table__drag-and-drop-item-keyboard-drag-icon {
343
- position: absolute;
344
- left: 50%;
345
- transform: translate(-50%, -50%);
346
- height: 1.2rem;
435
+ @keyframes animateDataTableLoading {
436
+ 0% {
437
+ inset-inline-start: 0;
438
+ inline-size: 0;
439
+ }
347
440
 
348
- &[data-direction="up"] {
349
- top: -10px;
441
+ 20% {
442
+ inset-inline-start: 0;
443
+ inline-size: 40%;
350
444
  }
351
445
 
352
- &[data-direction="down"] {
353
- bottom: -29px;
446
+ 80% {
447
+ inset-inline-start: 60%;
448
+ inline-size: 40%;
354
449
  }
450
+
451
+ 100% {
452
+ inset-inline-start: 100%;
453
+ inline-size: 0;
454
+ }
455
+ }
456
+
457
+ /* TODO: Look to handle "inline"-checkbox better than custom CSS-overrides in the future. */
458
+ .aksel-data-table tr .aksel-checkbox {
459
+ padding: 0;
460
+ }
461
+
462
+ .aksel-data-table tr .aksel-checkbox:focus-within::after {
463
+ inset: 0;
464
+ }
465
+
466
+ /* TODO -
467
+ * This is needed to prevent the cursor from changing back to default when dragging over interactive elements in the row.
468
+ * Not sure if this is the best approach or breaks styling elsewhere */
469
+ html[data-dragging="true"],
470
+ html[data-dragging="true"] *,
471
+ html[data-dragging="true"] *::before,
472
+ html[data-dragging="true"] *::after {
473
+ cursor: grabbing !important;
355
474
  }
@@ -1,35 +1,30 @@
1
1
  .aksel-property-filter__popup {
2
2
  overflow: hidden;
3
- border-radius: var(--ax-radius-12);
3
+ border-radius: var(--ax-radius-8);
4
4
  border: 1px solid var(--ax-border-neutral-subtleA);
5
5
  box-shadow: var(--ax-shadow-dialog);
6
6
  /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
7
7
  transform-origin: var(--__axc-floating-transform-origin);
8
- transition:
9
- transform 150ms ease allow-discrete,
10
- opacity 150ms ease allow-discrete;
8
+ transition: opacity 150ms ease allow-discrete;
11
9
 
12
10
  @starting-style {
13
- opacity: 0.8;
14
- transform: scale3d(0.94, 0.94, 0.94);
11
+ opacity: 0.6;
15
12
  }
16
13
 
17
14
  min-width: 260px;
18
15
  }
19
16
 
20
17
  .aksel-property-filter__popup-inner {
21
- --__axc-token-filter-content-p: var(--ax-space-8);
22
18
  --__axc-token-filter-item-pr: var(--ax-space-8);
23
19
  --__axc-token-filter-item-pl: var(--ax-space-8);
24
20
  --__axc-token-filter-item-height: 2rem;
25
21
 
26
- border-radius: var(--ax-radius-12);
22
+ border-radius: var(--ax-radius-8);
27
23
  background-color: var(--ax-bg-raised);
28
24
  min-width: 128px;
29
25
  max-width: min(95vw, 640px);
30
26
  animation-duration: 160ms;
31
27
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
32
- padding: var(--__axc-token-filter-content-p);
33
28
  overflow: auto;
34
29
  /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
35
30
  max-height: calc(var(--__axc-floating-available-height) - 4px);
@@ -1,18 +1,30 @@
1
1
  .aksel-data-toolbar {
2
- padding: var(--ax-space-12);
3
2
  display: flex;
3
+ flex-wrap: wrap;
4
4
  align-items: center;
5
5
  gap: var(--ax-space-8);
6
- border: 1px solid var(--ax-border-neutral);
7
- border-radius: var(--ax-radius-12);
8
- background-color: var(--ax-bg-raised);
6
+ grid-template-columns: 1fr 1fr;
9
7
  }
10
8
 
11
- .aksel-data-toolbar__toggle-button {
12
- &[aria-pressed="true"] {
13
- --__axc-button-border-width: 0px; /* ??? */
9
+ .aksel-data-toolbar__actions {
10
+ margin-inline-start: auto;
11
+ display: flex;
12
+ align-items: center;
14
13
 
15
- color: var(--ax-text-contrast);
16
- background-color: var(--ax-bg-strong-pressed);
14
+ > :not(:last-child) {
15
+ border-right: 1px solid var(--ax-border-neutral-subtle);
16
+ margin-inline-end: var(--ax-space-4);
17
+ padding-inline-end: var(--ax-space-4);
17
18
  }
18
19
  }
20
+
21
+ .aksel-data-toolbar__input {
22
+ max-inline-size: 600px;
23
+ width: 100%;
24
+ }
25
+
26
+ .aksel-data-toolbar__pagination {
27
+ display: flex;
28
+ align-items: center;
29
+ gap: var(--ax-space-8);
30
+ }
package/src/date.css CHANGED
@@ -203,36 +203,41 @@
203
203
  }
204
204
 
205
205
  .aksel-date__field-input {
206
- &.aksel-text-field__input {
207
- padding-right: var(--ax-space-48);
206
+ border-top-right-radius: 0;
207
+ border-bottom-right-radius: 0;
208
+ border-right: none;
209
+
210
+ &:focus-visible {
211
+ outline: none;
208
212
  }
209
213
 
210
- .aksel-form-field--small & {
211
- padding-right: var(--ax-space-32);
214
+ .aksel-date__field--error &:not(:disabled) {
215
+ box-shadow:
216
+ inset -2px 0 0 0 var(--ax-border-danger-strong),
217
+ inset 0 0 0 1px var(--ax-border-danger-strong);
212
218
  }
213
219
  }
214
220
 
215
221
  .aksel-date__field-button {
216
- position: absolute;
217
- right: 0.0625rem;
218
- top: 50%;
219
- transform: translateY(-50%);
220
- color: var(--ax-text-neutral);
221
- display: inline-flex;
222
- cursor: pointer;
223
- margin: 0;
224
- text-decoration: none;
225
- border: none;
226
- background: none;
227
- border-radius: calc(var(--ax-radius-8) - 1px);
228
- padding: var(--ax-space-12);
229
- align-items: center;
230
- justify-content: center;
231
- font-size: 1.5rem;
232
- height: calc(100% - 0.125rem);
222
+ --__axc-button-border-width: 1px;
223
+ --__axc-button-border-color: var(--ax-border-neutral);
224
+
233
225
  border-start-start-radius: 0;
234
226
  border-end-start-radius: 0;
235
227
 
228
+ &:focus-visible {
229
+ outline: 3px solid var(--ax-border-focus);
230
+ outline-offset: 3px;
231
+ }
232
+
233
+ .aksel-date__field:not(.aksel-date__field--readonly):has(.aksel-date__field-input:not(:disabled)) &:hover,
234
+ .aksel-date__field:not(.aksel-date__field--readonly, .aksel-date__field--error):has(
235
+ .aksel-date__field-input:is(:focus-visible, :hover):not(:disabled)
236
+ )
237
+ & {
238
+ --__axc-button-border-color: var(--ax-border-strong);
239
+ }
240
+
236
241
  .aksel-form-field--small & {
237
242
  padding: var(--ax-space-4);
238
243
  }
@@ -244,19 +249,24 @@
244
249
 
245
250
  /* Readonly */
246
251
  .aksel-date__field--readonly & {
247
- cursor: default;
248
- }
252
+ --__axc-button-border-color: var(--ax-border-neutral-subtleA);
249
253
 
250
- &:focus-visible {
251
- outline-color: var(--ax-border-focus);
254
+ cursor: default;
255
+ opacity: 1;
256
+ background-color: var(--ax-bg-neutral-moderate);
257
+ color: var(--ax-text-neutral-subtle);
252
258
  }
253
259
  }
254
260
 
255
261
  .aksel-date__field-wrapper {
256
262
  display: inline-flex;
257
- align-items: center;
258
- position: relative;
259
263
  width: fit-content;
264
+ border-radius: var(--ax-radius-8);
265
+
266
+ &:has(.aksel-date__field-input:focus-visible) {
267
+ outline: 3px solid var(--ax-border-focus);
268
+ outline-offset: 3px;
269
+ }
260
270
  }
261
271
 
262
272
  .aksel-date__week-row {
@@ -67,10 +67,28 @@
67
67
  gap: var(--ax-space-8);
68
68
  border-left: 1px solid var(--ax-border-neutral-subtleA);
69
69
  color: var(--ax-text-neutral);
70
+ text-decoration: none;
71
+ position: relative;
70
72
 
71
73
  &:hover {
72
74
  background: var(--ax-bg-neutral-moderate-hoverA);
73
75
  }
76
+
77
+ &[data-active="true"] {
78
+ &::after {
79
+ content: "";
80
+ position: absolute;
81
+ width: 100%;
82
+ height: 6px;
83
+ bottom: -1px;
84
+ left: 0;
85
+ background-color: var(--ax-border-strong);
86
+
87
+ @media (forced-colors: active) {
88
+ background-color: Highlight;
89
+ }
90
+ }
91
+ }
74
92
  }
75
93
 
76
94
  @media (forced-colors: active) {
package/src/list.css CHANGED
@@ -39,7 +39,6 @@
39
39
 
40
40
  /* SAFARI HACK START */
41
41
 
42
- /* biome-ignore lint/a11y/useGenericFontNames: Hack for targeting Safari */
43
42
  @supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {
44
43
  .aksel-list ol {
45
44
  padding-left: 2.1rem;
package/src/listbox.css CHANGED
@@ -1,14 +1,52 @@
1
- .aksel-listbox__list {
2
- padding: var(--ax-space-4);
3
- }
1
+ /* .aksel-listbox__options {} */
4
2
 
5
- .aksel-listbox__item {
3
+ .aksel-listbox__option {
4
+ position: relative;
6
5
  cursor: default;
7
- border-radius: var(--ax-radius-8);
8
- padding: var(--ax-space-4) var(--ax-space-2);
6
+ padding: var(--ax-space-6) var(--ax-space-4);
9
7
  scroll-margin-block: 4px;
8
+ border-radius: var(--ax-radius-8);
9
+ margin-top: 1px;
10
10
 
11
11
  &[data-virtual-focus="true"] {
12
12
  outline: 2px solid var(--ax-border-focus);
13
+ outline-offset: -2px;
14
+ background-color: var(--ax-bg-neutral-soft);
15
+ }
16
+
17
+ .aksel-listbox__group & {
18
+ padding-inline: var(--ax-space-24);
19
+ }
20
+
21
+ ::before {
22
+ content: "";
23
+ position: absolute;
24
+ top: -1px;
25
+ left: 0;
26
+ width: 100%;
27
+ height: 1px;
28
+ background-color: var(--ax-border-neutral-subtle);
13
29
  }
14
30
  }
31
+
32
+ .aksel-listbox__group-label {
33
+ padding: var(--ax-space-6) var(--ax-space-8);
34
+ position: relative;
35
+
36
+ &:not(:first-of-type)::before {
37
+ content: "";
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ width: 100%;
42
+ height: 1px;
43
+ background-color: var(--ax-border-neutral-subtle);
44
+ }
45
+ }
46
+
47
+ .aksel-listbox__highlight {
48
+ /* background-color: var(--ax-bg-sunken); */
49
+ background: transparent;
50
+ color: var(--ax-text-accent-subtle);
51
+ font-weight: 700;
52
+ }