@mattilsynet/design 3.2.9 → 3.3.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 (90) hide show
  1. package/mtds/ai/AGENTS.md +892 -0
  2. package/mtds/ai/alert.mdx +63 -0
  3. package/mtds/ai/alert.stories.tsx +128 -0
  4. package/mtds/ai/analytics.mdx +185 -0
  5. package/mtds/ai/app.mdx +60 -0
  6. package/mtds/ai/app.stories.tsx +897 -0
  7. package/mtds/ai/atlas.mdx +82 -0
  8. package/mtds/ai/atlas.stories.tsx +424 -0
  9. package/mtds/ai/avatar.mdx +45 -0
  10. package/mtds/ai/avatar.stories.tsx +109 -0
  11. package/mtds/ai/badge.mdx +70 -0
  12. package/mtds/ai/badge.stories.tsx +122 -0
  13. package/mtds/ai/breadcrumbs.mdx +36 -0
  14. package/mtds/ai/breadcrumbs.stories.tsx +158 -0
  15. package/mtds/ai/button.mdx +179 -0
  16. package/mtds/ai/button.stories.tsx +440 -0
  17. package/mtds/ai/card.mdx +51 -0
  18. package/mtds/ai/card.stories.tsx +469 -0
  19. package/mtds/ai/chart.mdx +67 -0
  20. package/mtds/ai/chart.stories.tsx +519 -0
  21. package/mtds/ai/chip.mdx +71 -0
  22. package/mtds/ai/chip.stories.tsx +211 -0
  23. package/mtds/ai/details.mdx +33 -0
  24. package/mtds/ai/details.stories.tsx +91 -0
  25. package/mtds/ai/dialog.mdx +38 -0
  26. package/mtds/ai/dialog.stories.tsx +373 -0
  27. package/mtds/ai/divider.mdx +19 -0
  28. package/mtds/ai/divider.stories.tsx +50 -0
  29. package/mtds/ai/errorsummary.mdx +26 -0
  30. package/mtds/ai/errorsummary.stories.tsx +137 -0
  31. package/mtds/ai/field.mdx +86 -0
  32. package/mtds/ai/field.stories.tsx +863 -0
  33. package/mtds/ai/fieldset.mdx +126 -0
  34. package/mtds/ai/fieldset.stories.tsx +298 -0
  35. package/mtds/ai/fileupload.mdx +16 -0
  36. package/mtds/ai/fileupload.stories.tsx +126 -0
  37. package/mtds/ai/helptext.mdx +24 -0
  38. package/mtds/ai/helptext.stories.tsx +106 -0
  39. package/mtds/ai/input.mdx +223 -0
  40. package/mtds/ai/input.stories.tsx +352 -0
  41. package/mtds/ai/law.mdx +115 -0
  42. package/mtds/ai/law.stories.tsx +168 -0
  43. package/mtds/ai/layout.mdx +145 -0
  44. package/mtds/ai/layout.stories.tsx +443 -0
  45. package/mtds/ai/link.mdx +45 -0
  46. package/mtds/ai/link.stories.tsx +44 -0
  47. package/mtds/ai/logo.mdx +86 -0
  48. package/mtds/ai/logo.stories.tsx +146 -0
  49. package/mtds/ai/pagination.mdx +136 -0
  50. package/mtds/ai/pagination.stories.tsx +404 -0
  51. package/mtds/ai/popover.mdx +86 -0
  52. package/mtds/ai/popover.stories.tsx +355 -0
  53. package/mtds/ai/print.mdx +96 -0
  54. package/mtds/ai/print.stories.tsx +839 -0
  55. package/mtds/ai/progress.mdx +41 -0
  56. package/mtds/ai/progress.stories.tsx +141 -0
  57. package/mtds/ai/skeleton.mdx +26 -0
  58. package/mtds/ai/skeleton.stories.tsx +131 -0
  59. package/mtds/ai/spinner.mdx +26 -0
  60. package/mtds/ai/spinner.stories.tsx +72 -0
  61. package/mtds/ai/steps.mdx +37 -0
  62. package/mtds/ai/steps.stories.tsx +568 -0
  63. package/mtds/ai/table.mdx +124 -0
  64. package/mtds/ai/table.stories.tsx +1715 -0
  65. package/mtds/ai/tabs.mdx +106 -0
  66. package/mtds/ai/tabs.stories.tsx +159 -0
  67. package/mtds/ai/tag.mdx +49 -0
  68. package/mtds/ai/tag.stories.tsx +111 -0
  69. package/mtds/ai/toast.mdx +67 -0
  70. package/mtds/ai/toast.stories.tsx +215 -0
  71. package/mtds/ai/togglegroup.mdx +75 -0
  72. package/mtds/ai/togglegroup.stories.tsx +96 -0
  73. package/mtds/ai/tooltip.mdx +32 -0
  74. package/mtds/ai/tooltip.stories.tsx +34 -0
  75. package/mtds/ai/typography.mdx +67 -0
  76. package/mtds/ai/typography.stories.tsx +798 -0
  77. package/mtds/ai/validation.mdx +19 -0
  78. package/mtds/ai/validation.stories.tsx +45 -0
  79. package/mtds/atlas/atlas-element.js +1 -1
  80. package/mtds/chart/chart-lines.js +19 -19
  81. package/mtds/chart/chart-lines.js.map +1 -1
  82. package/mtds/chart/chart.css.js +16 -1
  83. package/mtds/chart/chart.css.js.map +1 -1
  84. package/mtds/chart/chart.stories.d.ts +1 -0
  85. package/mtds/index.iife.js +32 -17
  86. package/mtds/package.json.js +1 -1
  87. package/mtds/styles.css +1 -1
  88. package/mtds/table/table-observer.js +26 -15
  89. package/mtds/table/table-observer.js.map +1 -1
  90. package/package.json +4 -2
@@ -0,0 +1,443 @@
1
+ import type { Meta, StoryObj } from "@storybook/react-vite";
2
+ import { Fragment } from "react";
3
+ import { Button, Flex, Grid } from "../react";
4
+ import styles from "../styles.module.css";
5
+
6
+ const gaps = [
7
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 22, 26, 30,
8
+ ];
9
+ const meta = {
10
+ title: "Designsystem/Layout",
11
+ parameters: {
12
+ layout: "padded",
13
+ },
14
+ decorators: [
15
+ (Story) => (
16
+ <div className="mt-story">
17
+ <Story />
18
+ <style>{`
19
+ .mt-story:not(:has(.${styles.body.split(" ")[0]})) {
20
+ display: grid;
21
+ gap: 1rem;
22
+ padding: 1px;
23
+
24
+ & b { display: flex; align-items: center; padding: .5em 1em; border: 1px solid; border-radius: var(--mtds-border-radius-md) }
25
+ & code { font-size: .875rem }
26
+ & div:not([class*="box"]) { outline: 1px dashed color-mix(in hsl, currentcolor 50%, transparent) }
27
+ & div[data-align-content] { height: 150px }
28
+ }
29
+ `}</style>
30
+ </div>
31
+ ),
32
+ ],
33
+ } satisfies Meta;
34
+
35
+ export default meta;
36
+ type Story = StoryObj<typeof meta>;
37
+
38
+ export const FlexStory: Story = {
39
+ name: "Flex",
40
+ parameters: {
41
+ showInOverview: true,
42
+ },
43
+ render: () => (
44
+ <div className={styles.flex}>
45
+ <button type="button" className={styles.button} data-variant="primary">
46
+ Action 1
47
+ </button>
48
+ <button type="button" className={styles.button} data-variant="primary">
49
+ Action som er lengre 2
50
+ </button>
51
+ <button type="button" className={styles.button} data-variant="primary">
52
+ Action 3
53
+ </button>
54
+ <button type="button" className={styles.button} data-variant="primary">
55
+ Action 4
56
+ </button>
57
+ <button type="button" className={styles.button} data-variant="primary">
58
+ Action 5
59
+ </button>
60
+ <button type="button" className={styles.button} data-variant="primary">
61
+ Action 6
62
+ </button>
63
+ </div>
64
+ ),
65
+ };
66
+
67
+ export const GridStory: Story = {
68
+ name: "Grid",
69
+ parameters: {
70
+ showInOverview: true,
71
+ },
72
+ render: () => (
73
+ <div className={styles.grid} data-gap="6">
74
+ <div className={styles.grid} data-items="auto">
75
+ <div>auto</div>
76
+ <div>auto</div>
77
+ </div>
78
+ <div
79
+ className={styles.grid}
80
+ data-gap="6"
81
+ style={{ gridTemplateColumns: "1fr 2fr" }}
82
+ >
83
+ <div>
84
+ Custom
85
+ <div className={styles.grid} data-items="100" data-gap="0">
86
+ <div>100</div>
87
+ <div>100</div>
88
+ </div>
89
+ </div>
90
+ <div className={styles.grid} data-items="300" data-gap="4">
91
+ <div>300</div>
92
+ <div className={styles.grid} data-items="100">
93
+ <div>100</div>
94
+ <div>100</div>
95
+ <div>100</div>
96
+ <div>100</div>
97
+ <div>100</div>
98
+ <div>100</div>
99
+ </div>
100
+ <div>300</div>
101
+ <div>300</div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ ),
106
+ };
107
+
108
+ export const React: Story = {
109
+ render: () => (
110
+ <>
111
+ <Flex>
112
+ <Button data-variant="primary">Action 1</Button>
113
+ <Button data-variant="primary">Action som er lengre 2</Button>
114
+ <Button data-variant="primary">Action 3</Button>
115
+ <Button data-variant="primary">Action 4</Button>
116
+ <Button data-variant="primary">Action 5</Button>
117
+ <Button data-variant="primary">Action 6</Button>
118
+ </Flex>
119
+ <Grid data-gap="6">
120
+ <Grid data-items="auto">
121
+ <div>auto</div>
122
+ <div>auto</div>
123
+ </Grid>
124
+ <Grid style={{ gridTemplateColumns: "1fr 2fr" }} data-gap="6">
125
+ <div>
126
+ Custom
127
+ <Grid data-items="100" data-gap="0">
128
+ <div>100</div>
129
+ <div>100</div>
130
+ </Grid>
131
+ </div>
132
+ <Grid data-items="300" data-gap="4">
133
+ <div>300</div>
134
+ <Grid data-items="100">
135
+ <div>100</div>
136
+ <div>100</div>
137
+ <div>100</div>
138
+ <div>100</div>
139
+ <div>100</div>
140
+ <div>100</div>
141
+ </Grid>
142
+ <div>300</div>
143
+ <div>300</div>
144
+ </Grid>
145
+ </Grid>
146
+ </Grid>
147
+ </>
148
+ ),
149
+ };
150
+
151
+ export const Gap: Story = {
152
+ render: () => (
153
+ <section className={styles.grid} style={{ gridTemplateColumns: "1fr 2fr" }}>
154
+ {gaps.map((gap) => (
155
+ <Fragment key={gap}>
156
+ <code>data-gap="{gap}"</code>
157
+ <div className={styles.flex} data-gap={gap}>
158
+ <b>a</b>
159
+ <b>b</b>
160
+ <b>c</b>
161
+ </div>
162
+ </Fragment>
163
+ ))}
164
+ </section>
165
+ ),
166
+ };
167
+
168
+ export const Center: Story = {
169
+ parameters: {
170
+ layout: "fullscreen",
171
+ },
172
+ render: () => (
173
+ <>
174
+ <div className={styles.grid} data-center="sm">
175
+ sm (640px)
176
+ </div>
177
+ <div className={styles.grid} data-center="md">
178
+ md (768px)
179
+ </div>
180
+ <div className={styles.grid} data-center="lg">
181
+ lg (1024px)
182
+ </div>
183
+ <div className={styles.grid} data-center="xl">
184
+ xl (1280px)
185
+ </div>
186
+ <div className={styles.grid} data-center="2xl">
187
+ 2xl (1536px)
188
+ </div>
189
+ </>
190
+ ),
191
+ };
192
+
193
+ export const ItemSizes: Story = {
194
+ render: () => (
195
+ <>
196
+ <h2 className={styles.heading}>
197
+ Minimumsstørrelser Grid og Flex data-items:
198
+ </h2>
199
+ {[
200
+ 25,
201
+ 50,
202
+ 75,
203
+ 100,
204
+ 125,
205
+ 150,
206
+ 175,
207
+ 200,
208
+ 225,
209
+ 250,
210
+ 275,
211
+ 300,
212
+ 325,
213
+ 350,
214
+ 375,
215
+ 400,
216
+ 425,
217
+ 450,
218
+ 475,
219
+ 500,
220
+ 525,
221
+ 550,
222
+ 575,
223
+ 600,
224
+ "auto",
225
+ "full",
226
+ ].map((i) => (
227
+ <div key={i}>
228
+ <div className={styles.flex} key={i} data-gap="3" data-fixed>
229
+ <div
230
+ data-self={i}
231
+ style={{
232
+ background: "var(--mtds-color-surface-tinted)",
233
+ whiteSpace: "nowrap",
234
+ }}
235
+ >
236
+ {i}
237
+ </div>
238
+ </div>
239
+ </div>
240
+ ))}
241
+ </>
242
+ ),
243
+ };
244
+
245
+ export const ItemFixed: Story = {
246
+ render: () => (
247
+ <>
248
+ <span>
249
+ Flex <code>data-items="100"</code> with <code>data-fixed</code> (does
250
+ not allow growing over <code>data-items</code> value):
251
+ </span>
252
+ <div className={styles.flex} data-items="100" data-fixed>
253
+ <div>a</div>
254
+ <div>b</div>
255
+ <div>c</div>
256
+ <div>d</div>
257
+ </div>
258
+ <span>
259
+ Flex <code>data-items="100"</code> without <code>data-fixed</code>{" "}
260
+ (allows items to grow):
261
+ </span>
262
+ <div className={styles.flex} data-items="100">
263
+ <div>a</div>
264
+ <div>b</div>
265
+ <div>c</div>
266
+ <div>d</div>
267
+ </div>
268
+ <span>
269
+ Grid <code>data-items="100"</code> with <code>data-fixed</code> (repeats
270
+ "fake" empty columns to align ish with <code>data-items</code>):
271
+ </span>
272
+ <div className={styles.grid} data-items="100" data-fixed>
273
+ <div>a</div>
274
+ <div>b</div>
275
+ <div>c</div>
276
+ <div>d</div>
277
+ </div>
278
+ <span>
279
+ Grid <code>data-items="100"</code> without <code>data-fixed</code>{" "}
280
+ (fills grid with actual columns):
281
+ </span>
282
+ <div className={styles.grid} data-items="100">
283
+ <div>a</div>
284
+ <div>b</div>
285
+ <div>c</div>
286
+ <div>d</div>
287
+ </div>
288
+ </>
289
+ ),
290
+ };
291
+
292
+ export const Align: Story = {
293
+ render: () => (
294
+ <section
295
+ className={styles.grid}
296
+ data-align="center"
297
+ data-gap="6"
298
+ style={{ gridTemplateColumns: "1fr 2fr" }}
299
+ >
300
+ <code>data-align="stretch"</code>
301
+ <div className={styles.flex} data-align="stretch">
302
+ <b data-size="sm">Small</b>
303
+ <b data-size="md">Medium</b>
304
+ <b data-size="lg">Large</b>
305
+ </div>
306
+ <code>data-align="start"</code>
307
+ <div className={styles.flex} data-align="start">
308
+ <b data-size="sm">Small</b>
309
+ <b data-size="md">Medium</b>
310
+ <b data-size="lg">Large</b>
311
+ </div>
312
+ <code>data-align="center"</code>
313
+ <div className={styles.flex} data-align="center">
314
+ <b data-size="sm">Small</b>
315
+ <b data-size="md">Medium</b>
316
+ <b data-size="lg">Large</b>
317
+ </div>
318
+ <code>data-align="end"</code>
319
+ <div className={styles.flex} data-align="end">
320
+ <b data-size="sm">Small</b>
321
+ <b data-size="md">Medium</b>
322
+ <b data-size="lg">Large</b>
323
+ </div>
324
+ </section>
325
+ ),
326
+ };
327
+
328
+ export const Justify: Story = {
329
+ render: () => (
330
+ <section
331
+ className={styles.grid}
332
+ data-align="center"
333
+ data-gap="6"
334
+ style={{ gridTemplateColumns: "1fr 2fr" }}
335
+ >
336
+ <code>data-justify="start"</code>
337
+ <div className={styles.flex} data-justify="start">
338
+ <b>Box</b>
339
+ <b>Box</b>
340
+ <b>Box</b>
341
+ </div>
342
+ <code>data-justify="center"</code>
343
+ <div className={styles.flex} data-justify="center">
344
+ <b>Box</b>
345
+ <b>Box</b>
346
+ <b>Box</b>
347
+ </div>
348
+ <code>data-justify="end"</code>
349
+ <div className={styles.flex} data-justify="end">
350
+ <b>Box</b>
351
+ <b>Box</b>
352
+ <b>Box</b>
353
+ </div>
354
+ <code>data-justify="space-between"</code>
355
+ <div className={styles.flex} data-justify="space-between">
356
+ <b>Box</b>
357
+ <b>Box</b>
358
+ <b>Box</b>
359
+ </div>
360
+ <code>data-justify="space-around"</code>
361
+ <div className={styles.flex} data-justify="space-around">
362
+ <b>Box</b>
363
+ <b>Box</b>
364
+ <b>Box</b>
365
+ </div>
366
+ <code>data-justify="space-evenly"</code>
367
+ <div className={styles.flex} data-justify="space-evenly">
368
+ <b>Box</b>
369
+ <b>Box</b>
370
+ <b>Box</b>
371
+ </div>
372
+ <span>
373
+ <code>.grid</code> +<br />
374
+ <code>data-justify="center"</code>
375
+ </span>
376
+ <div className={styles.grid} data-justify="center">
377
+ <b>Box Box</b>
378
+ <b>Box Box Box</b>
379
+ <b>Box</b>
380
+ </div>
381
+ </section>
382
+ ),
383
+ };
384
+
385
+ export const AlignContent: Story = {
386
+ render: () => (
387
+ <section
388
+ className={styles.grid}
389
+ data-items="200"
390
+ data-gap="6"
391
+ style={{ maxWidth: 700 }}
392
+ >
393
+ <article>
394
+ <code>start</code>
395
+ <div className={styles.flex} data-align-content="start">
396
+ <b>Box</b>
397
+ <b>Box</b>
398
+ <b>Box</b>
399
+ </div>
400
+ </article>
401
+ <article>
402
+ <code>center</code>
403
+ <div className={styles.flex} data-align-content="center">
404
+ <b>Box</b>
405
+ <b>Box</b>
406
+ <b>Box</b>
407
+ </div>
408
+ </article>
409
+ <article>
410
+ <code>end</code>
411
+ <div className={styles.flex} data-align-content="end">
412
+ <b>Box</b>
413
+ <b>Box</b>
414
+ <b>Box</b>
415
+ </div>
416
+ </article>
417
+ <article>
418
+ <code>space-between</code>
419
+ <div className={styles.flex} data-align-content="space-between">
420
+ <b>Box</b>
421
+ <b>Box</b>
422
+ <b>Box</b>
423
+ </div>
424
+ </article>
425
+ <article>
426
+ <code>space-around</code>
427
+ <div className={styles.flex} data-align-content="space-around">
428
+ <b>Box</b>
429
+ <b>Box</b>
430
+ <b>Box</b>
431
+ </div>
432
+ </article>
433
+ <article>
434
+ <code>space-evenly</code>
435
+ <div className={styles.flex} data-align-content="space-evenly">
436
+ <b>Box</b>
437
+ <b>Box</b>
438
+ <b>Box</b>
439
+ </div>
440
+ </article>
441
+ </section>
442
+ ),
443
+ };
@@ -0,0 +1,45 @@
1
+ import { Meta, Canvas } from '@storybook/addon-docs/blocks';
2
+ import { Example, CssVariables } from '../../.storybook/blocks';
3
+ import { Button } from '../react';
4
+ import * as stories from './link.stories';
5
+ import { Flex, Prose } from '../react';
6
+ import styles from '../styles.module.css';
7
+
8
+ <Meta of={stories} />
9
+
10
+ # Link
11
+ > Link er klikkbar tekst eller grafikk, som gjør det enkelt for brukerne å navigere til filer eller interne- og eksterne sider.
12
+
13
+ ## Kode
14
+ - `<a>` får automatisk lenkestil
15
+ - Lenker burde alltid være `<a>` for å oppnå god universell utforming
16
+ - Bruk klassen `link` om du mot formodning trenger lenkestil på andre element
17
+ - **Mønster:** [Se mønster for merking av eksterne lenker](https://www.designsystemet.no/no/patterns/external-links)
18
+
19
+ <Canvas of={stories.Default} />
20
+
21
+ ## Skikk og bruk
22
+ <Flex data-items="350">
23
+
24
+ {/* Lenker som CTA: */}
25
+ <Example data-color="success" text="Lenker brukes til å navigere eller laste ned innhold." zoom="100%">
26
+
27
+ <a href="https://www.mattilsynet.no/">Mattilsynet</a> er et statlig tilsyn
28
+ og direktorat som har som visjon å trygge framtiden for mennesker, dyr og
29
+ natur.
30
+
31
+
32
+ </Example>
33
+
34
+ <Example data-color="danger" text="Ikke bruk lenker til å utføre handlinger (call to action). Bruk heller Button-komponenten." zoom="100%">
35
+
36
+
37
+ Skjemaet er ferdig utfylt. <a href="https://www.mattilsynet.no/">Trykk her for å sende inn</a>
38
+
39
+ </Example>
40
+
41
+ </Flex>
42
+
43
+
44
+
45
+ <CssVariables component="link" />
@@ -0,0 +1,44 @@
1
+ import { HeartIcon } from "@phosphor-icons/react";
2
+ import type { Meta, StoryObj } from "@storybook/react-vite";
3
+ import { Link } from "../react";
4
+
5
+ const meta = {
6
+ title: "Designsystem/Link",
7
+ } satisfies Meta;
8
+
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+
12
+ export const Default: Story = {
13
+ render: () => (
14
+ <>
15
+ <a href="https://www.mattilsynet.no/">Mattilsynet</a> er et statlig tilsyn
16
+ og direktorat som har som visjon å trygge framtiden for mennesker, dyr og
17
+ natur.
18
+ </>
19
+ ),
20
+ };
21
+
22
+ export const React: Story = {
23
+ render: () => (
24
+ <>
25
+ <a href="https://www.mattilsynet.no/">Mattilsynet</a> er et statlig tilsyn
26
+ og direktorat som har som visjon å trygge framtiden for mennesker, dyr og
27
+ natur.{" "}
28
+ <Link as="button" type="button">
29
+ Button om ser ut som lenke
30
+ </Link>
31
+ </>
32
+ ),
33
+ };
34
+
35
+ export const WithIcon: Story = {
36
+ render: () => (
37
+ <>
38
+ <a href="https://www.mattilsynet.no/">
39
+ Mattilsynet <HeartIcon />
40
+ </a>{" "}
41
+ trygger framtiden for mennesker, dyr og natur.
42
+ </>
43
+ ),
44
+ };
@@ -0,0 +1,86 @@
1
+ import { Meta, Canvas } from '@storybook/addon-docs/blocks';
2
+ import { Details } from '../react';
3
+ import { Example, CssVariables } from '../../.storybook/blocks';
4
+ import { Flex } from '../react';
5
+ import * as stories from './logo.stories';
6
+ import styles from '../styles.module.css';
7
+
8
+
9
+ <Meta of={stories} />
10
+
11
+ # Logo
12
+ > Mattilsynet har logoer som er spesialutviklet for definerte bruksområder i våre digitale løsninger. Her finner du alle tilgjengelige varianter
13
+
14
+ ## Kode
15
+ - Legg klassen `logo` på typisk `<h1>` eller `<a>`
16
+ - Teksten "Mattilsynet" blir automatisk lagt inn for skjermlesere
17
+ - Logo følger tekststørrelse og tekstfarge
18
+ - Ved lite plass blir tekst visuelt
19
+
20
+ <Details>
21
+ <Details.Summary>Opplever at logoen bare blir en firkant i Next.js eller Tailwind?</Details.Summary>
22
+
23
+ Noen versjoner av [Autoprefixer](https://github.com/postcss/autoprefixer) er vell ivrig på å prefixe `mask`.
24
+ Det er dessverre lite å gjøre med i `@mattilsynet/design`, men du kan fikse dette igjen ved å sette:
25
+ ```html
26
+ style="-webkit-mask-box-image: none"
27
+ ```
28
+
29
+
30
+ </Details>
31
+
32
+ <Canvas of={stories.Default} />
33
+
34
+ ## Skikk og bruk
35
+ <Flex data-items="350">
36
+
37
+ {/* Logofarger */}
38
+ <Example data-color="success" text="Logo skal kun brukes i fargene som er definert i designsystemet." zoom="100%">
39
+
40
+ <a className={styles.logo} href="https://mattilsynet.no"></a>
41
+
42
+
43
+ </Example>
44
+
45
+ <Example data-color="danger" text="Ikke bruk Mattilsynets logo med andre farger enn definert i designsystemet." zoom="100%">
46
+
47
+ <a style={{ color: 'purple' }} className={styles.logo} href="https://mattilsynet.no"></a>
48
+
49
+ </Example>
50
+
51
+ </Flex>
52
+
53
+ ## App logo
54
+ - Applikasjonsnavn i Mattilsynet følger [språkrådets retningslinjer for statlige navn](https://sprakradet.no/stedsnavn-og-navn-pa-statsorgan/veiledning-om-valg-av-navn-i-staten/krav-til-og-rad-om-selve-navnet/)
55
+ - Legg en `<svg>` fra [phosphoricons.com](https://phosphoricons.com) i `filled` variant som første barn
56
+ - Legg appnavn inn i `logo` som tekst
57
+ - Applogo endrer automatisk favion
58
+ <Canvas of={stories.WithAppIcon} />
59
+
60
+ ## App logo med teknisk miljø
61
+ - Bruk `data-color="orange | blue"` på `logo` for å få en distinkt fargeendring
62
+ - Bruk `data-env="MILJØNAVN"` for å indikere teknisk kjøremiljø
63
+ <Canvas of={stories.WithAppIconEnvironment} />
64
+
65
+ ## Undermerke
66
+ - Legg tekst inn i `logo` for å lage et undermerke
67
+ - Bruk `<wbr />` dersom du ønsker at et ord skal kunne brekke i flere deler, eksempel: `Helse&shy;sertifikat`
68
+ <Canvas of={stories.WithSubbrand} />
69
+
70
+ ## Undermerke på engelsk
71
+ - Logo blir engelsk dersom du setter `<html lang="en">`
72
+ <Canvas of={stories.WithSubbrandEnglish} />
73
+
74
+ ## Favicon
75
+ - For å støtte dark mode og eldre Safari, bruker vi flere favicon-filer (<a href="/favicon.svg" download>svg</a>, <a href="/favicon.ico" download>ico</a> og <a href="/favicon-dark.ico" download>ico dark</a>)
76
+ - Disse er tilgjengelig via `@mattilsynet/design/favicon.[svg|ico]`
77
+ - **Merk:** App-logo endrer automatisk på favicon ([utenom i Safari som ikke støtter dette](https://bugs.webkit.org/show_bug.cgi?id=95979#c2))
78
+ ```html
79
+ <head>
80
+ <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
81
+ <link rel="icon" href="/favicon.ico" media="(prefers-color-scheme: light)" />
82
+ <link rel="icon" href="/favicon-dark.ico" media="(prefers-color-scheme: dark)" />
83
+ </head>
84
+ ```
85
+
86
+ <CssVariables component="logo" />