@arbeidstilsynet/design-css 0.10.4 → 0.11.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 (40) hide show
  1. package/dist/digdir/alert.css +1 -1
  2. package/dist/digdir/avatar-stack.css +1 -1
  3. package/dist/digdir/avatar.css +1 -1
  4. package/dist/digdir/badge.css +1 -1
  5. package/dist/digdir/base.css +1 -1
  6. package/dist/digdir/breadcrumbs.css +1 -1
  7. package/dist/digdir/button.css +1 -1
  8. package/dist/digdir/card.css +1 -1
  9. package/dist/digdir/chip.css +1 -1
  10. package/dist/digdir/combobox.css +1 -1
  11. package/dist/digdir/details.css +1 -1
  12. package/dist/digdir/dialog.css +1 -1
  13. package/dist/digdir/divider.css +1 -1
  14. package/dist/digdir/dropdown.css +1 -1
  15. package/dist/digdir/error-summary.css +1 -1
  16. package/dist/digdir/field.css +1 -3
  17. package/dist/digdir/fieldset.css +1 -1
  18. package/dist/digdir/heading.css +1 -1
  19. package/dist/digdir/input.css +1 -1
  20. package/dist/digdir/link.css +1 -1
  21. package/dist/digdir/pagination.css +1 -1
  22. package/dist/digdir/paragraph.css +1 -1
  23. package/dist/digdir/popover.css +1 -1
  24. package/dist/digdir/search.css +1 -1
  25. package/dist/digdir/skeleton.css +1 -1
  26. package/dist/digdir/skip-link.css +1 -1
  27. package/dist/digdir/skiplink.css +1 -1
  28. package/dist/digdir/suggestion.css +1 -1
  29. package/dist/digdir/table.css +1 -1
  30. package/dist/digdir/tabs.css +1 -1
  31. package/dist/digdir/tag.css +1 -1
  32. package/dist/digdir/toggle-group.css +1 -1
  33. package/dist/digdir/togglegroup.css +1 -1
  34. package/dist/digdir/tooltip.css +1 -1
  35. package/dist/digdir/validation-message.css +1 -1
  36. package/dist/src/filepicker.css +8 -9
  37. package/dist/src/index.css +418 -44
  38. package/dist/src/link.css +8 -0
  39. package/dist/src/steps.css +398 -0
  40. package/package.json +14 -14
@@ -0,0 +1,8 @@
1
+ /** Overrides the default link styles to match Gnist design. */
2
+
3
+ .ds-link {
4
+ /** Text **/
5
+ --dsc-link-color: var(--ds-color-text-default);
6
+ --dsc-link-color--hover: var(--ds-color-base-hover);
7
+ --dsc-link-color--visited: var(--dsc-link-color);
8
+ }
@@ -0,0 +1,398 @@
1
+ /*
2
+ * Portions of this file are based on Steps from Mattilsynet Design System (https://github.com/Mattilsynet/design)
3
+ * Copyright (c) 2024 Mattilsynet
4
+ * Licensed under the MIT License
5
+ */
6
+
7
+ .at-steps {
8
+ --at-steps-dot-size: var(--ds-size-8);
9
+ --at-steps-gap: var(--ds-size-4);
10
+ --at-steps-padding: 0px;
11
+ --at-steps-stroke-color: var(--ds-color-border-subtle);
12
+ --at-steps-stroke-size: 2px;
13
+ --at-steps-line-active: var(--ds-color-base-default);
14
+ --at-steps-line-faint: color-mix(
15
+ in oklab,
16
+ var(--ds-color-base-default) 30%,
17
+ transparent
18
+ );
19
+
20
+ --at-steps-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M13.3144 5.12704C13.5895 4.81749 14.0634 4.78947 14.373 5.06454C14.6824 5.33971 14.7105 5.81358 14.4355 6.12313L8.43547 12.8731C8.29835 13.0274 8.10365 13.1189 7.89738 13.1251C7.69096 13.1312 7.4907 13.0514 7.34465 12.9054L3.59465 9.15536C3.30177 8.86248 3.3018 8.38771 3.59465 8.09481C3.88754 7.80192 4.3623 7.80192 4.65519 8.09481L7.8427 11.2823L13.3144 5.12704Z'/%3E%3C/svg%3E");
21
+ --at-steps-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M12.9697 3.96967C13.2626 3.67678 13.7373 3.67678 14.0302 3.96967C14.3231 4.26256 14.3231 4.73732 14.0302 5.03022L10.0605 8.99994L14.0302 12.9697C14.3231 13.2626 14.3231 13.7373 14.0302 14.0302C13.7373 14.3231 13.2626 14.3231 12.9697 14.0302L8.99994 10.0605L5.03022 14.0302C4.73732 14.3231 4.26256 14.3231 3.96967 14.0302C3.67678 13.7373 3.67678 13.2626 3.96967 12.9697L7.9394 8.99994L3.96967 5.03022C3.67678 4.73732 3.67678 4.26256 3.96967 3.96967C4.26256 3.67678 4.73732 3.67678 5.03022 3.96967L8.99994 7.9394L12.9697 3.96967Z'/%3E%3C/svg%3E");
22
+ --at-steps-icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M128 24a16 16 0 0 1 16 16v104a16 16 0 0 1-32 0V40a16 16 0 0 1 16-16Zm0 176a20 20 0 1 0 20 20 20 20 0 0 0-20-20Z'/%3E%3C/svg%3E");
23
+
24
+ list-style: none;
25
+ margin: 0;
26
+ padding: 0;
27
+ text-align: center;
28
+ }
29
+
30
+ .at-steps:not([hidden]) {
31
+ display: flex;
32
+ gap: var(--at-steps-gap);
33
+ }
34
+
35
+ .at-steps__step {
36
+ --dot-after: var(--at-steps-line-faint);
37
+ --dot-before: var(--at-steps-line-faint);
38
+ --dot-text: initial;
39
+ --dot-fill: initial;
40
+ --dot-icon: linear-gradient(transparent);
41
+
42
+ border-radius: var(--ds-border-radius-md);
43
+ box-sizing: border-box;
44
+ flex: 1;
45
+ padding: var(--at-steps-padding);
46
+ position: relative;
47
+ z-index: 2;
48
+ text-decoration: none;
49
+ }
50
+
51
+ /*
52
+ * Line
53
+ */
54
+
55
+ .at-steps__step::before,
56
+ .at-steps__step::after {
57
+ content: "";
58
+ height: var(--at-steps-stroke-size);
59
+ inset: var(--at-steps-padding) 50% auto -50%;
60
+ margin: calc(var(--at-steps-dot-size) / 2);
61
+ position: absolute;
62
+ translate: 0 -50%;
63
+ }
64
+
65
+ .at-steps__step::before {
66
+ background: linear-gradient(to right, transparent, var(--dot-before));
67
+ }
68
+
69
+ .at-steps__step::after {
70
+ background: linear-gradient(to right, var(--dot-after), transparent);
71
+ inset-inline: 50% -50%;
72
+ }
73
+
74
+ .at-steps__step:first-child::before {
75
+ left: 0;
76
+ }
77
+
78
+ .at-steps__step:last-child::after {
79
+ right: 0;
80
+ }
81
+
82
+ /*
83
+ * Dot
84
+ */
85
+
86
+ .at-steps__step-mark {
87
+ background: var(--dot-fill);
88
+ border-radius: var(--ds-border-radius-full);
89
+ border: var(--at-steps-stroke-size) solid
90
+ var(--dot-fill, var(--at-steps-stroke-color));
91
+ box-sizing: border-box;
92
+ color: var(--dot-text); /* Let it be affected by data-color */
93
+ height: var(--at-steps-dot-size);
94
+ place-items: center;
95
+ margin: 0 auto var(--at-steps-gap);
96
+ position: relative;
97
+ transition: 0.2s scale;
98
+ width: var(--at-steps-dot-size);
99
+ z-index: 2; /* Place above line */
100
+ }
101
+
102
+ .at-steps__step-mark:not([hidden]) {
103
+ display: grid;
104
+ }
105
+
106
+ .at-steps__step-mark > svg,
107
+ .at-steps__step-mark:empty::before {
108
+ display: block;
109
+ fill: currentColor;
110
+ /*
111
+ * Icon (18px) inside the dot's bounding box (--ds-size-8 = 28px).
112
+ * Sized off the dot variable rather than a percentage, because a percentage
113
+ * resolves against the mark's content box (28px − 2×2px border = 24px), which
114
+ * would render the icon smaller than intended.
115
+ */
116
+ width: calc(var(--at-steps-dot-size) * 18 / 28);
117
+ height: calc(var(--at-steps-dot-size) * 18 / 28);
118
+ }
119
+
120
+ .at-steps__step-mark:empty::before {
121
+ background: currentColor;
122
+ content: "";
123
+ -webkit-mask: var(--dot-icon) center / contain no-repeat;
124
+ mask: var(--dot-icon) center / contain no-repeat;
125
+ }
126
+
127
+ /*
128
+ * Interaction
129
+ */
130
+
131
+ .at-steps__step > :is(a, button):not([hidden]):only-child {
132
+ background: none;
133
+ border-radius: inherit;
134
+ border: 0;
135
+ box-sizing: border-box;
136
+ color: inherit;
137
+ cursor: pointer;
138
+ display: block;
139
+ font: inherit;
140
+ margin: 0;
141
+ padding: 0;
142
+ text-align: inherit;
143
+ text-decoration: none;
144
+ width: 100%;
145
+ }
146
+
147
+ .at-steps__step > :is(a, button):only-child:focus-visible {
148
+ background: var(--ds-color-surface-tinted);
149
+ box-shadow: var(--dsc-focus-boxShadow);
150
+ outline: var(--dsc-focus-outline);
151
+ outline-offset: var(--ds-border-width-focus);
152
+ }
153
+
154
+ .at-steps__step
155
+ > :is(a, button):only-child:hover:not(:active)
156
+ .at-steps__step-mark {
157
+ scale: 1.175;
158
+ }
159
+
160
+ /*
161
+ * States
162
+ */
163
+
164
+ .at-steps:not([data-direction="up"]) > .at-steps__step[aria-current="step"] {
165
+ z-index: 1; /* Let lines from other steps enter the current one */
166
+ }
167
+
168
+ .at-steps:not([data-direction="up"]) > .at-steps__step[aria-current="step"],
169
+ .at-steps:not([data-direction="up"])
170
+ > .at-steps__step:has(~ .at-steps__step[aria-current="step"]),
171
+ .at-steps[data-direction="up"] > [aria-current="step"] ~ .at-steps__step,
172
+ .at-steps__step[data-state="complete"],
173
+ .at-steps[data-state="complete"] > .at-steps__step {
174
+ --dot-before: var(--at-steps-line-active);
175
+ }
176
+
177
+ .at-steps:not([data-direction="up"])
178
+ > .at-steps__step:has(~ .at-steps__step[aria-current="step"]),
179
+ .at-steps[data-direction="up"]
180
+ > .at-steps__step[aria-current="step"]
181
+ ~ .at-steps__step,
182
+ .at-steps[data-direction="up"] > .at-steps__step[aria-current="step"],
183
+ .at-steps__step[data-state="complete"],
184
+ .at-steps[data-state="complete"] > .at-steps__step {
185
+ --dot-after: var(--at-steps-line-active);
186
+ }
187
+
188
+ /*
189
+ * The current step's mark gets an extra ring detached from the dot by a
190
+ * genuinely transparent gap. `outline` + `outline-offset` draws the ring
191
+ * outside the border-box with a see-through gap between them, so the real
192
+ * background shows through (unlike a box-shadow gap, which can only fake it
193
+ * with a solid color).
194
+ */
195
+
196
+ .at-steps__step[aria-current="step"] .at-steps__step-mark {
197
+ outline: var(--at-steps-stroke-size) solid var(--dot-fill);
198
+ outline-offset: var(--at-steps-stroke-size);
199
+ }
200
+
201
+ /*
202
+ * Keep the see-through gap clean: stop the current step's connector lines at the
203
+ * outer edge of the ring instead of letting them run under the transparent gap
204
+ * to the dot. Horizontal layouts — vertical is handled in the direction section.
205
+ */
206
+
207
+ .at-steps:not([data-direction]) > .at-steps__step[aria-current="step"]::before,
208
+ .at-steps[data-direction="right"]
209
+ > .at-steps__step[aria-current="step"]::before {
210
+ margin-right: calc(
211
+ var(--at-steps-dot-size) / 2 + var(--at-steps-stroke-size) * 2
212
+ );
213
+ }
214
+
215
+ .at-steps:not([data-direction]) > .at-steps__step[aria-current="step"]::after,
216
+ .at-steps[data-direction="right"]
217
+ > .at-steps__step[aria-current="step"]::after {
218
+ margin-left: calc(
219
+ var(--at-steps-dot-size) / 2 + var(--at-steps-stroke-size) * 2
220
+ );
221
+ }
222
+
223
+ .at-steps__step[data-state="complete"],
224
+ .at-steps[data-state="complete"] > .at-steps__step,
225
+ .at-steps:not([data-direction="up"])
226
+ > .at-steps__step:where(:has(~ .at-steps__step[aria-current="step"])),
227
+ .at-steps[data-direction="up"]
228
+ > .at-steps__step:where([aria-current="step"] ~ .at-steps__step) {
229
+ --dot-icon: var(--at-steps-icon-check);
230
+ }
231
+
232
+ .at-steps__step[data-state="complete"],
233
+ .at-steps[data-state="complete"] > .at-steps__step,
234
+ .at-steps[data-direction="up"]
235
+ > .at-steps__step[aria-current="step"]
236
+ ~ .at-steps__step,
237
+ .at-steps:not([data-direction="up"])
238
+ > .at-steps__step:has(~ .at-steps__step[aria-current="step"]),
239
+ .at-steps__step[aria-current="step"],
240
+ .at-steps__step-mark[data-color] {
241
+ --dot-text: var(--ds-color-base-contrast-default);
242
+ --dot-fill: var(--ds-color-base-default);
243
+ }
244
+
245
+ .at-steps__step-mark[data-color="danger"],
246
+ .at-steps__step-mark[data-color="warning"] {
247
+ --dot-icon: var(--at-steps-icon-close);
248
+ }
249
+
250
+ .at-steps__step-mark[data-color="info"] {
251
+ --dot-icon: var(--at-steps-icon-info);
252
+ }
253
+
254
+ /*
255
+ * Overrides default step state, to force a step to appear unchecked.
256
+ * The four [data-state] attribute selectors give (0,5,0), matching the
257
+ * :has()-based auto-complete rule; placement after it wins by cascade order.
258
+ */
259
+
260
+ .at-steps__step[data-state][data-state][data-state][data-state="incomplete"] {
261
+ --dot-before: var(--at-steps-line-faint);
262
+ --dot-after: var(--at-steps-line-faint);
263
+ --dot-icon: linear-gradient(transparent);
264
+ --dot-text: initial;
265
+ --dot-fill: initial;
266
+ }
267
+
268
+ /*
269
+ * Fade
270
+ */
271
+
272
+ .at-steps:is(
273
+ :not([data-fade]),
274
+ [data-fade="none"],
275
+ [data-fade="end"]:not([data-direction="up"]),
276
+ [data-fade="start"][data-direction="up"]
277
+ )
278
+ > .at-steps__step:first-child::before {
279
+ display: none;
280
+ }
281
+
282
+ .at-steps:is(
283
+ :not([data-fade]),
284
+ [data-fade="none"],
285
+ [data-fade="start"]:not([data-direction="up"]),
286
+ [data-fade="end"][data-direction="up"]
287
+ )
288
+ > .at-steps__step:last-child::after {
289
+ display: none;
290
+ }
291
+
292
+ /*
293
+ * Vertical
294
+ */
295
+
296
+ .at-steps[data-direction]:not([data-direction="right"]) {
297
+ flex-wrap: wrap;
298
+ text-align: left;
299
+
300
+ --at-steps-gap: var(--ds-size-5);
301
+ gap: var(--at-steps-gap);
302
+ }
303
+
304
+ .at-steps[data-direction]:not([data-direction="right"]) > .at-steps__step {
305
+ flex: 1 0 100%;
306
+ min-height: calc(var(--at-steps-dot-size) * 2);
307
+ padding-block: var(--at-steps-padding);
308
+ padding-inline: calc(
309
+ var(--at-steps-dot-size) + var(--at-steps-gap) + var(--at-steps-padding)
310
+ )
311
+ var(--at-steps-padding);
312
+ }
313
+
314
+ .at-steps[data-direction]:not([data-direction="right"])
315
+ > .at-steps__step
316
+ .at-steps__step-mark {
317
+ inset: var(--at-steps-padding);
318
+ margin: 0;
319
+ position: absolute;
320
+ }
321
+
322
+ .at-steps[data-direction]:not([data-direction="right"])
323
+ > .at-steps__step::before,
324
+ .at-steps[data-direction]:not([data-direction="right"])
325
+ > .at-steps__step::after {
326
+ background: linear-gradient(transparent, var(--dot-before));
327
+ height: auto;
328
+ margin-block: 0;
329
+ width: var(--at-steps-stroke-size);
330
+ inset: calc(var(--at-steps-dot-size) * -1) var(--at-steps-padding) 100%;
331
+ translate: -50% var(--at-steps-padding);
332
+ }
333
+
334
+ .at-steps[data-direction]:not([data-direction="right"])
335
+ > .at-steps__step::after {
336
+ inset-block: var(--at-steps-dot-size) calc(var(--at-steps-gap) * -1);
337
+
338
+ background: linear-gradient(
339
+ var(--dot-after) calc(100% - var(--at-steps-padding) - var(--at-steps-gap)),
340
+ transparent
341
+ );
342
+ }
343
+
344
+ .at-steps[data-direction]:not([data-direction="right"])
345
+ > .at-steps__step:last-child::after {
346
+ background: linear-gradient(var(--dot-after), transparent);
347
+ inset-block-end: 0;
348
+ }
349
+
350
+ /*
351
+ * Vertical counterpart of the horizontal rule above: pull the current step's
352
+ * connector lines back to the outer edge of the ring so the see-through gap
353
+ * stays clean above and below the dot.
354
+ */
355
+
356
+ .at-steps[data-direction]:not([data-direction="right"])
357
+ > .at-steps__step[aria-current="step"]::before {
358
+ inset-block-end: calc(100% + var(--at-steps-stroke-size) * 2);
359
+ }
360
+
361
+ .at-steps[data-direction]:not([data-direction="right"])
362
+ > .at-steps__step[aria-current="step"]::after {
363
+ inset-block-start: calc(
364
+ var(--at-steps-dot-size) + var(--at-steps-stroke-size) * 2
365
+ );
366
+ }
367
+
368
+ .at-steps__title {
369
+ color: var(--ds-color-text-default);
370
+ font-size: var(--ds-font-size-4);
371
+ font-weight: var(--ds-font-weight-semibold);
372
+ }
373
+
374
+ .at-steps__description {
375
+ display: block;
376
+ color: var(--ds-color-text-default);
377
+ font-size: var(--ds-font-size-3);
378
+ }
379
+
380
+ .at-steps__details {
381
+ display: block;
382
+ color: var(--ds-color-text-subtle);
383
+ font-size: var(--ds-font-size-2);
384
+ }
385
+
386
+ /*
387
+ * Disabled
388
+ */
389
+
390
+ .at-steps__step:has(> button:disabled:only-child, > a[disabled]:only-child) {
391
+ opacity: 0.4;
392
+ }
393
+
394
+ .at-steps__step > button:disabled:only-child,
395
+ .at-steps__step > a[disabled]:only-child {
396
+ pointer-events: none;
397
+ cursor: default;
398
+ }
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@arbeidstilsynet/design-css",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "CSS for Designsystemet",
5
+ "license": "MIT",
5
6
  "author": "Arbeidstilsynet",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/Arbeidstilsynet/design.git"
9
10
  },
10
- "license": "MIT",
11
- "publishConfig": {
12
- "access": "public"
13
- },
11
+ "files": [
12
+ "./types.d.ts",
13
+ "dist"
14
+ ],
14
15
  "type": "module",
15
16
  "exports": {
16
17
  ".": {
@@ -20,23 +21,22 @@
20
21
  "./digdir/*": "./dist/digdir/*",
21
22
  "./*": "./dist/src/*"
22
23
  },
23
- "files": [
24
- "./types.d.ts",
25
- "dist"
26
- ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
27
  "dependencies": {
28
- "@digdir/designsystemet-css": "1.13.3"
28
+ "@digdir/designsystemet-css": "1.16.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/node": "24.12.2",
31
+ "@types/node": "24.13.1",
32
32
  "autoprefixer": "10.5.0",
33
- "cssnano": "7.1.7",
33
+ "cssnano": "8.0.2",
34
34
  "del-cli": "7.0.0",
35
- "postcss": "8.5.10",
35
+ "postcss": "8.5.15",
36
36
  "postcss-cli": "11.0.1",
37
37
  "postcss-import": "16.1.1",
38
38
  "postcss-nesting": "14.0.0",
39
- "tsx": "4.21.0"
39
+ "tsx": "4.22.4"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "postcss ./src/*.css --base . --dir ./dist --watch",