@navikt/ds-react 0.19.8 → 0.19.11

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 (50) hide show
  1. package/_docs.json +20 -1
  2. package/cjs/form/Textarea.js +12 -4
  3. package/cjs/form/error-summary/ErrorSummary.js +4 -2
  4. package/cjs/loader/Loader.js +2 -2
  5. package/esm/form/Textarea.d.ts +4 -0
  6. package/esm/form/Textarea.js +12 -4
  7. package/esm/form/Textarea.js.map +1 -1
  8. package/esm/form/error-summary/ErrorSummary.js +4 -2
  9. package/esm/form/error-summary/ErrorSummary.js.map +1 -1
  10. package/esm/loader/Loader.d.ts +1 -1
  11. package/esm/loader/Loader.js +2 -2
  12. package/esm/loader/Loader.js.map +1 -1
  13. package/package.json +2 -2
  14. package/src/alert/alert.stories.tsx +9 -1
  15. package/src/form/Textarea.tsx +17 -2
  16. package/src/form/error-summary/ErrorSummary.tsx +9 -3
  17. package/src/form/stories/textarea.stories.tsx +10 -0
  18. package/src/guide-panel/guidepanel.stories.tsx +51 -0
  19. package/src/help-text/help-text.stories.tsx +53 -18
  20. package/src/link/link.stories.tsx +77 -0
  21. package/src/link-panel/link-panel.stories.tsx +57 -0
  22. package/src/loader/Loader.tsx +8 -4
  23. package/src/loader/loader.stories.tsx +79 -0
  24. package/src/modal/modal.stories.tsx +71 -38
  25. package/src/panel/{stories/panel.stories.tsx → panel.stories.tsx} +27 -5
  26. package/src/popover/popover.stories.tsx +126 -0
  27. package/src/table/stories/table-async.stories.tsx +1 -1
  28. package/src/table/stories/table-expandable.stories.tsx +89 -62
  29. package/src/table/stories/table.stories.tsx +73 -83
  30. package/src/tag/tag.stories.tsx +45 -0
  31. package/src/toggle-group/ToggleGroup.stories.tsx +63 -81
  32. package/src/typography/heading.stories.tsx +75 -0
  33. package/src/typography/typography.stories.tsx +184 -111
  34. package/src/guide-panel/stories/example.css +0 -13
  35. package/src/guide-panel/stories/guidepanel.stories.mdx +0 -81
  36. package/src/guide-panel/stories/guidepanel.stories.tsx +0 -68
  37. package/src/link/stories/link.stories.mdx +0 -26
  38. package/src/link/stories/link.stories.tsx +0 -53
  39. package/src/link-panel/stories/illustration.tsx +0 -125
  40. package/src/link-panel/stories/link-panel.stories.mdx +0 -110
  41. package/src/link-panel/stories/link-panel.stories.tsx +0 -51
  42. package/src/loader/stories/loader.stories.mdx +0 -65
  43. package/src/loader/stories/loader.stories.tsx +0 -69
  44. package/src/panel/stories/panel.stories.mdx +0 -42
  45. package/src/popover/stories/popover.stories.mdx +0 -23
  46. package/src/popover/stories/popover.stories.tsx +0 -56
  47. package/src/table/stories/table-hot.stories.tsx +0 -376
  48. package/src/table/stories/table.stories.mdx +0 -112
  49. package/src/tag/stories/tag.stories.mdx +0 -56
  50. package/src/tag/stories/tag.stories.tsx +0 -32
@@ -1,137 +1,210 @@
1
+ import { Meta } from "@storybook/react";
1
2
  import React from "react";
2
3
  import {
3
- Heading,
4
- BodyShort,
5
- BodyLong,
6
- Detail,
7
- Ingress,
8
- Label,
9
- ErrorMessage,
4
+ BodyLong as DsBodyLong,
5
+ BodyShort as DsBodyShort,
6
+ Detail as DsDetail,
7
+ ErrorMessage as DsErrorMessage,
8
+ Ingress as DsIngress,
9
+ Label as DsLabel,
10
10
  } from "..";
11
11
 
12
12
  export default {
13
- title: "ds-react/typography",
14
- component: BodyLong,
13
+ title: "ds-react/Typography",
14
+ component: DsBodyLong,
15
+ subcomponents: {
16
+ DsBodyShort,
17
+ DsDetail,
18
+ DsErrorMessage,
19
+ DsIngress,
20
+ DsLabel,
21
+ },
22
+ argTypes: {
23
+ size: {
24
+ defaultValue: "large",
25
+ control: {
26
+ type: "radio",
27
+ options: ["medium", "small"],
28
+ },
29
+ },
30
+ component: {
31
+ defaultValue: "BodyLong",
32
+ control: {
33
+ type: "radio",
34
+ options: [
35
+ "BodyLong",
36
+ "BodyShort",
37
+ "Detail",
38
+ "Ingress",
39
+ "Label",
40
+ "ErrorMessage",
41
+ ],
42
+ },
43
+ },
44
+ },
45
+ } as Meta;
46
+
47
+ const lorem =
48
+ "Velit quis in laborum occaecat laborum magna id nisi veniam aliqua velit amet non. In quis sit proident dolore reprehenderit laborum aliquip";
49
+
50
+ const compMap = {
51
+ BodyLong: DsBodyLong,
52
+ BodyShort: DsBodyShort,
53
+ Detail: DsDetail,
54
+ Ingress: DsIngress,
55
+ Label: DsLabel,
56
+ ErrorMessage: DsErrorMessage,
15
57
  };
16
58
 
17
- const lorem = () => <>Veniam consequat cillum pariatur officia duis</>;
18
-
19
- const TitleTemplate = ({ level, size, spacing }) => (
20
- <Heading spacing={spacing} size={size} level={level}>
21
- {lorem()}
22
- </Heading>
23
- );
59
+ export const Default = (props) => {
60
+ const Comp = compMap[props.component];
61
+ return <Comp {...props}>{lorem}</Comp>;
62
+ };
24
63
 
25
- export const HeadingStory = TitleTemplate.bind({});
26
- HeadingStory.args = { level: 1, size: "xlarge", spacing: false };
64
+ Default.args = {
65
+ spacing: false,
66
+ };
27
67
 
28
- const IngressTemplate = ({ spacing }) => (
29
- <Ingress spacing={spacing}>{lorem()}</Ingress>
68
+ export const Ingress = () => (
69
+ <>
70
+ <DsIngress spacing>
71
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
72
+ </DsIngress>
73
+ <DsIngress>
74
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
75
+ </DsIngress>
76
+ </>
30
77
  );
31
78
 
32
- export const IngressStory = IngressTemplate.bind({});
33
- IngressStory.args = { spacing: false };
79
+ export const BodyLong = () => (
80
+ <>
81
+ <DsBodyLong spacing>
82
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip. Aute amet
83
+ occaecat ex aliqua irure elit labore pariatur. Proident pariatur proident
84
+ pariatur magna consequat velit id commodo quis sunt tempor ullamco aliquip
85
+ pariatur.
86
+ </DsBodyLong>
87
+ <DsBodyLong>
88
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip. Aute amet
89
+ occaecat ex aliqua irure elit labore pariatur. Proident pariatur proident
90
+ pariatur magna consequat velit id commodo quis sunt tempor ullamco aliquip
91
+ pariatur.
92
+ </DsBodyLong>
93
+ </>
94
+ );
34
95
 
35
- const BodyLongTemplate = ({ spacing, size }) => (
36
- <BodyLong size={size} spacing={spacing}>
37
- {lorem()}
38
- </BodyLong>
96
+ export const BodyLongSmall = () => (
97
+ <>
98
+ <DsBodyLong size="small" spacing>
99
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip. Aute amet
100
+ occaecat ex aliqua irure elit labore pariatur. Proident pariatur proident
101
+ pariatur magna consequat velit id commodo quis sunt tempor ullamco aliquip
102
+ pariatur.
103
+ </DsBodyLong>
104
+ <DsBodyLong size="small">
105
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip. Aute amet
106
+ occaecat ex aliqua irure elit labore pariatur. Proident pariatur proident
107
+ pariatur magna consequat velit id commodo quis sunt tempor ullamco aliquip
108
+ pariatur.
109
+ </DsBodyLong>
110
+ </>
39
111
  );
40
112
 
41
- export const BodyLongStory = BodyLongTemplate.bind({});
42
- BodyLongStory.args = { spacing: false, size: "medium" };
113
+ export const BodyShort = () => (
114
+ <>
115
+ <DsBodyShort spacing>
116
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
117
+ </DsBodyShort>
118
+ <DsBodyShort>
119
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
120
+ </DsBodyShort>
121
+ </>
122
+ );
43
123
 
44
- const BodyShortTemplate = ({ spacing, size }) => (
45
- <BodyShort size={size} spacing={spacing}>
46
- {lorem()}
47
- </BodyShort>
124
+ export const BodyShortSmall = () => (
125
+ <>
126
+ <DsBodyShort size="small" spacing>
127
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
128
+ </DsBodyShort>
129
+ <DsBodyShort size="small">
130
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
131
+ </DsBodyShort>
132
+ </>
48
133
  );
49
134
 
50
- export const BodyShortStory = BodyShortTemplate.bind({});
51
- BodyShortStory.args = { spacing: false, size: "medium" };
135
+ export const Label = () => (
136
+ <>
137
+ <DsLabel spacing>
138
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
139
+ </DsLabel>
140
+ <DsLabel>
141
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
142
+ </DsLabel>
143
+ </>
144
+ );
52
145
 
53
- const LabelTemplate = ({ spacing, size }) => (
54
- <Label size={size} spacing={spacing}>
55
- {lorem()}
56
- </Label>
146
+ export const LabelSmall = () => (
147
+ <>
148
+ <DsLabel size="small" spacing>
149
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
150
+ </DsLabel>
151
+ <DsLabel size="small">
152
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
153
+ </DsLabel>
154
+ </>
57
155
  );
58
156
 
59
- export const LabelStory = LabelTemplate.bind({});
60
- LabelStory.args = { spacing: false, size: "medium" };
157
+ export const Detail = () => (
158
+ <>
159
+ <DsDetail spacing>
160
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
161
+ </DsDetail>
162
+ <DsDetail>
163
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
164
+ </DsDetail>
165
+ </>
166
+ );
61
167
 
62
- const DetailTemplate = ({ spacing, size, uppercase }) => (
63
- <Detail size={size} spacing={spacing} uppercase={uppercase}>
64
- {lorem()}
65
- </Detail>
168
+ export const DetailUppercase = () => (
169
+ <>
170
+ <DsDetail spacing uppercase>
171
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
172
+ </DsDetail>
173
+ <DsDetail uppercase>
174
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
175
+ </DsDetail>
176
+ </>
66
177
  );
67
178
 
68
- export const DetailStory = DetailTemplate.bind({});
69
- DetailStory.args = { spacing: false, uppercase: false, size: "medium" };
179
+ export const DetailSmall = () => (
180
+ <>
181
+ <DsDetail size="small" spacing>
182
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
183
+ </DsDetail>
184
+ <DsDetail size="small">
185
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
186
+ </DsDetail>
187
+ </>
188
+ );
70
189
 
71
- const ErrorMessageTemplate = ({ size }) => (
72
- <ErrorMessage size={size}>{lorem()}</ErrorMessage>
190
+ export const ErrorMessage = () => (
191
+ <>
192
+ <DsErrorMessage spacing>
193
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
194
+ </DsErrorMessage>
195
+ <DsErrorMessage>
196
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
197
+ </DsErrorMessage>
198
+ </>
73
199
  );
74
200
 
75
- export const ErrorMessageStory = ErrorMessageTemplate.bind({});
76
- ErrorMessageStory.args = { size: "medium" };
77
-
78
- export const SideInnholdEksempel = () => {
79
- return (
80
- <div style={{ maxWidth: 600 }}>
81
- <Heading level={"1"} size="xlarge" spacing>
82
- Title lvl 1 xlarge
83
- </Heading>
84
- <BodyLong spacing>
85
- BodyLong: Aliqua ad et nisi commodo sit excepteur in commodo proident
86
- proident. Nostrud consectetur dolore eu nostrud aliqua. Adipisicing
87
- labore aliqua qui velit amet ea amet do. Magna anim velit et incididunt.
88
- Lorem ad pariatur pariatur quis magna cupidatat. Exercitation officia
89
- occaecat occaecat id nulla fugiat laborum elit laboris non est ex
90
- nostrud occaecat. Commodo laboris veniam cillum in aute.
91
- </BodyLong>
92
- <BodyLong spacing>
93
- BodyLong: Cillum consequat velit est ea voluptate. Et elit irure magna
94
- sit consequat mollit excepteur ad non excepteur velit exercitation aute.
95
- Fugiat deserunt quis nulla cupidatat esse quis ex. Laborum eiusmod culpa
96
- labore eu irure quis laborum. Irure veniam et nostrud do. Quis ut ea est
97
- culpa tempor anim.
98
- </BodyLong>
99
- <BodyLong spacing>
100
- BodyLong: Dolore commodo ad veniam commodo aute voluptate est officia
101
- sunt proident irure consectetur excepteur.
102
- </BodyLong>
103
- <Heading level={"2"} size="xlarge" spacing>
104
- Title lvl 2 large
105
- </Heading>
106
- <Ingress spacing>
107
- Ingress: Mollit incididunt incididunt officia amet est et non aliqua
108
- officia nulla et aute aliqua culpa.
109
- </Ingress>
110
- <BodyLong spacing>
111
- BodyLong: Commodo veniam enim laborum pariatur excepteur commodo do
112
- cillum. Nisi elit sunt commodo id in adipisicing cupidatat dolore dolore
113
- et tempor cupidatat. Cillum quis sunt in dolor occaecat.
114
- </BodyLong>
115
- <BodyLong spacing>
116
- BodyLong: Irure dolore laborum amet occaecat ex laboris mollit
117
- reprehenderit nisi laborum voluptate laborum. Ipsum eu sint laborum
118
- adipisicing ut incididunt laborum laborum. Ipsum non amet laboris quis
119
- Lorem est laborum qui pariatur ex eu. Eiusmod proident amet esse ex.
120
- </BodyLong>
121
- <BodyLong size="small" spacing>
122
- BodyLong small: Irure dolore laborum amet occaecat ex laboris mollit
123
- reprehenderit nisi laborum voluptate laborum. Ipsum eu sint laborum
124
- adipisicing ut incididunt laborum laborum. Ipsum non amet laboris quis
125
- Lorem est laborum qui pariatur ex eu. Eiusmod proident amet esse ex.
126
- </BodyLong>
127
- <BodyShort spacing>
128
- BodyShort: Id consectetur velit sunt laboris consequat ullamco
129
- incididunt.
130
- </BodyShort>
131
- <BodyShort size="small" spacing>
132
- BodyShort small: Sunt amet officia sit excepteur sit pariatur sit
133
- reprehenderit irure ipsum.
134
- </BodyShort>
135
- </div>
136
- );
137
- };
201
+ export const ErrorMessageSmall = () => (
202
+ <>
203
+ <DsErrorMessage size="small" spacing>
204
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
205
+ </DsErrorMessage>
206
+ <DsErrorMessage size="small">
207
+ Deserunt veniam eu fugiat ad est occaecat aliqua nisi aliquip.
208
+ </DsErrorMessage>
209
+ </>
210
+ );
@@ -1,13 +0,0 @@
1
- .sb-guidepanel__tokens--purple {
2
- --navds-guide-panel-color-border: var(--navds-global-color-purple-400);
3
- --navds-guide-panel-color-illustration-background: var(
4
- --navds-global-color-purple-200
5
- );
6
- }
7
-
8
- .sb-guidepanel__tokens--green {
9
- --navds-guide-panel-color-border: var(--navds-global-color-green-400);
10
- --navds-guide-panel-color-illustration-background: var(
11
- --navds-global-color-green-200
12
- );
13
- }
@@ -1,81 +0,0 @@
1
- import { Meta, Canvas } from "@storybook/addon-docs";
2
- import { Button, Loader, GuidePanel } from "../../index";
3
- import { Success } from "@navikt/ds-react";
4
- import "./example.css";
5
-
6
- <Meta title="ds-react/guidepanel/intro" />
7
-
8
- # Hvordan ta i bruk GuidePanel
9
-
10
- ```jsx
11
- <GuidePanel>
12
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
13
- </GuidePanel>
14
- ```
15
-
16
- <Canvas>
17
- <GuidePanel>
18
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
19
- </GuidePanel>
20
- </Canvas>
21
-
22
- ## Varianter
23
-
24
- `poster` endrer på plassering av illustrasjon
25
-
26
- <Canvas>
27
- <GuidePanel>
28
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
29
- </GuidePanel>
30
- <GuidePanel poster>
31
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
32
- </GuidePanel>
33
- </Canvas>
34
-
35
- ## Fargebruk
36
-
37
- Istedenfor fargetema/themes slik som tidligere veileder brukte velger man nå selv farge på border/illustrasjons-bakgrunn ved å
38
- overskrive tokens. Det anbefalses å gjøre dette med eks Styled-Components eller css-klasser, men kan inlines også
39
-
40
- ```css
41
- /* Tokens */
42
- --navds-guide-panel-color-border
43
- --navds-guide-panel-color-illustration-background
44
- ```
45
-
46
- ```jsx
47
- /* Css */
48
- <GuidePanel className="sb-guidepanel__tokens--purple">
49
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
50
- </GuidePanel>
51
- <GuidePanel className="sb-guidepanel__tokens--green">
52
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
53
- </GuidePanel>
54
-
55
- /* Inline */
56
- <GuidePanel
57
- style={{
58
- ["--navds-guide-panel-color-illustration-background" as any]: "var(--navds-global-color-orange-200)",
59
- ["--navds-guide-panel-color-border" as any]: "var(--navds-global-color-orange-400)",
60
- }}
61
- >
62
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
63
- </GuidePanel>
64
- <GuidePanel
65
- style={{
66
- ["--navds-guide-panel-color-illustration-background" as any]: "var(--navds-global-color-orange-200)",
67
- ["--navds-guide-panel-color-border" as any]: "var(--navds-global-color-orange-400)",
68
- }}
69
- >
70
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
71
- </GuidePanel>
72
- ```
73
-
74
- <Canvas>
75
- <GuidePanel className="sb-guidepanel__tokens--purple">
76
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
77
- </GuidePanel>
78
- <GuidePanel className="sb-guidepanel__tokens--green">
79
- Cupidatat proident adipisicing eu nulla laborum dolore irure aliqua.
80
- </GuidePanel>
81
- </Canvas>
@@ -1,68 +0,0 @@
1
- import React from "react";
2
- import { GuidePanel } from "../index";
3
- import { Meta } from "@storybook/react/types-6-0";
4
- export default {
5
- title: "ds-react/guidepanel",
6
- component: GuidePanel,
7
- } as Meta;
8
-
9
- const panelText = `Sit sint eu dolore reprehenderit exercitation labore aute anim sit
10
- adipisicing proident. Tempor ipsum ea cupidatat qui esse do veniam
11
- cupidatat. Excepteur irure reprehenderit esse tempor nisi duis qui ea
12
- enim id.`;
13
-
14
- export const All = () => {
15
- return (
16
- <div>
17
- <h1>GuidePanel</h1>
18
- <GuidePanel>{panelText}</GuidePanel>
19
- <h2>GuidePanel poster</h2>
20
- <GuidePanel poster>{panelText}</GuidePanel>
21
- <h2>custom colors</h2>
22
- <GuidePanel
23
- style={{
24
- ["--navds-guide-panel-color-illustration-background" as any]: "var(--navds-global-color-purple-200)",
25
- ["--navds-guide-panel-color-border" as any]: "var(--navds-global-color-purple-400)",
26
- }}
27
- >
28
- {panelText}
29
- </GuidePanel>
30
- <GuidePanel
31
- style={{
32
- ["--navds-guide-panel-color-illustration-background" as any]: "var(--navds-global-color-green-200)",
33
- ["--navds-guide-panel-color-border" as any]: "var(--navds-global-color-green-400)",
34
- }}
35
- >
36
- {panelText}
37
- </GuidePanel>
38
- <GuidePanel
39
- style={{
40
- ["--navds-guide-panel-color-illustration-background" as any]: "var(--navds-global-color-orange-200)",
41
- ["--navds-guide-panel-color-border" as any]: "var(--navds-global-color-orange-400)",
42
- }}
43
- >
44
- {panelText}Ullamco reprehenderit fugiat reprehenderit ad nisi aliqua
45
- irure enim id nisi do non magna. Nisi ut incididunt dolor aliqua
46
- adipisicing. Cupidatat sint et qui minim sint aute anim non Lorem
47
- reprehenderit id et excepteur. Consectetur velit aliqua eiusmod sit. Sit
48
- velit minim consectetur deserunt Lorem non elit fugiat consectetur sunt
49
- aliqua Lorem minim. Ullamco dolor mollit laboris velit deserunt nisi
50
- ipsum minim dolor ad cillum in id do.
51
- {panelText}Ullamco reprehenderit fugiat reprehenderit ad nisi aliqua
52
- irure enim id nisi do non magna. Nisi ut incididunt dolor aliqua
53
- adipisicing. Cupidatat sint et qui minim sint aute anim non Lorem
54
- reprehenderit id et excepteur. Consectetur velit aliqua eiusmod sit. Sit
55
- velit minim consectetur deserunt Lorem non elit fugiat consectetur sunt
56
- aliqua Lorem minim. Ullamco dolor mollit laboris velit deserunt nisi
57
- ipsum minim dolor ad cillum in id do.
58
- {panelText}Ullamco reprehenderit fugiat reprehenderit ad nisi aliqua
59
- irure enim id nisi do non magna. Nisi ut incididunt dolor aliqua
60
- adipisicing. Cupidatat sint et qui minim sint aute anim non Lorem
61
- reprehenderit id et excepteur. Consectetur velit aliqua eiusmod sit. Sit
62
- velit minim consectetur deserunt Lorem non elit fugiat consectetur sunt
63
- aliqua Lorem minim. Ullamco dolor mollit laboris velit deserunt nisi
64
- ipsum minim dolor ad cillum in id do.
65
- </GuidePanel>
66
- </div>
67
- );
68
- };
@@ -1,26 +0,0 @@
1
- import { Meta, Canvas } from "@storybook/addon-docs";
2
- import { Link } from "../../index";
3
- import { Add } from "@navikt/ds-icons";
4
-
5
- <Meta title="ds-react/link/intro" />
6
-
7
- # Hvordan ta i bruk Link
8
-
9
- Komponeten skal være nesten 1-1 med nav-frontend-lenker for de som er kjent med den.
10
-
11
- ```jsx
12
- <Link href="#">Dette er en tekstlenke</Link>
13
- ```
14
-
15
- <Canvas>
16
- <Link href="#">Dette er en tekstlenke</Link>
17
- </Canvas>
18
-
19
- ## Med ikon
20
-
21
- <Canvas>
22
- <Link href="#">
23
- <span>Dette er en tekstlenke</span>
24
- <Add />
25
- </Link>
26
- </Canvas>
@@ -1,53 +0,0 @@
1
- import React from "react";
2
- import { Link } from "..";
3
- import { Add } from "@navikt/ds-icons";
4
- import { Alert } from "../..";
5
- import { ConfirmationPanel } from "../../form";
6
- export default {
7
- title: "ds-react/link",
8
- component: Link,
9
- };
10
-
11
- export const All = () => {
12
- return (
13
- <>
14
- <h1>Link</h1>
15
- <Link href="#">Dette er en tekstlenke</Link>
16
- <h2>Icon after</h2>
17
- <Link href="#">
18
- <span>Dette er en tekstlenke</span>
19
- <Add />
20
- </Link>
21
- <h2>Icon before</h2>
22
- <Link href="#">
23
- <Add />
24
- <span>Dette er en tekstlenke </span>
25
- </Link>
26
- <h2>På farget bakgrunn</h2>
27
- <Alert variant="error">
28
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
29
- </Alert>
30
- <Alert variant="info">
31
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
32
- </Alert>
33
- <Alert variant="success">
34
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
35
- </Alert>
36
- <Alert variant="warning">
37
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
38
- </Alert>
39
- <ConfirmationPanel label="Samtykke?" checked={false} error="feilmelding">
40
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
41
- </ConfirmationPanel>
42
- <ConfirmationPanel label="Samtykke?" checked error="feilmelding">
43
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
44
- </ConfirmationPanel>
45
- <ConfirmationPanel label="Samtykke?" checked={false}>
46
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
47
- </ConfirmationPanel>
48
- <ConfirmationPanel label="Samtykke?" checked>
49
- Her er en <Link href="#about">lenke</Link> på farget bakgrunn
50
- </ConfirmationPanel>
51
- </>
52
- );
53
- };