@navikt/ds-react 0.19.9 → 0.19.10
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/_docs.json +1 -1
- package/cjs/loader/Loader.js +2 -2
- package/esm/loader/Loader.d.ts +1 -1
- package/esm/loader/Loader.js +2 -2
- package/esm/loader/Loader.js.map +1 -1
- package/package.json +2 -2
- package/src/alert/alert.stories.tsx +9 -1
- package/src/guide-panel/guidepanel.stories.tsx +51 -0
- package/src/help-text/help-text.stories.tsx +53 -18
- package/src/link/link.stories.tsx +77 -0
- package/src/link-panel/link-panel.stories.tsx +57 -0
- package/src/loader/Loader.tsx +8 -4
- package/src/loader/loader.stories.tsx +79 -0
- package/src/modal/modal.stories.tsx +71 -38
- package/src/panel/{stories/panel.stories.tsx → panel.stories.tsx} +27 -5
- package/src/popover/popover.stories.tsx +126 -0
- package/src/table/stories/table-async.stories.tsx +1 -1
- package/src/table/stories/table-expandable.stories.tsx +89 -62
- package/src/table/stories/table.stories.tsx +73 -83
- package/src/tag/tag.stories.tsx +45 -0
- package/src/typography/heading.stories.tsx +75 -0
- package/src/typography/typography.stories.tsx +184 -111
- package/src/guide-panel/stories/example.css +0 -13
- package/src/guide-panel/stories/guidepanel.stories.mdx +0 -81
- package/src/guide-panel/stories/guidepanel.stories.tsx +0 -68
- package/src/link/stories/link.stories.mdx +0 -26
- package/src/link/stories/link.stories.tsx +0 -53
- package/src/link-panel/stories/illustration.tsx +0 -125
- package/src/link-panel/stories/link-panel.stories.mdx +0 -110
- package/src/link-panel/stories/link-panel.stories.tsx +0 -51
- package/src/loader/stories/loader.stories.mdx +0 -65
- package/src/loader/stories/loader.stories.tsx +0 -69
- package/src/panel/stories/panel.stories.mdx +0 -42
- package/src/popover/stories/popover.stories.mdx +0 -23
- package/src/popover/stories/popover.stories.tsx +0 -56
- package/src/table/stories/table-hot.stories.tsx +0 -376
- package/src/table/stories/table.stories.mdx +0 -112
- package/src/tag/stories/tag.stories.mdx +0 -56
- package/src/tag/stories/tag.stories.tsx +0 -32
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const Illustration = (
|
|
3
|
-
<>
|
|
4
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="110">
|
|
5
|
-
<defs>
|
|
6
|
-
<path id="a" d="M.686.654h4.399v5.852H.686z"></path>
|
|
7
|
-
</defs>
|
|
8
|
-
<g fill="none" fillRule="evenodd">
|
|
9
|
-
<path fill="transparent" d="M-287-1518H993V543H-287z"></path>
|
|
10
|
-
<rect
|
|
11
|
-
width="796"
|
|
12
|
-
height="181"
|
|
13
|
-
fill="transparent"
|
|
14
|
-
rx="8"
|
|
15
|
-
transform="translate(-45 -36)"
|
|
16
|
-
></rect>
|
|
17
|
-
<circle cx="55" cy="55" r="55" fill="#CCDEE6"></circle>
|
|
18
|
-
<g fill="#D8D8D8">
|
|
19
|
-
<path
|
|
20
|
-
fill="#337C9B"
|
|
21
|
-
d="M32.034 5.834l-11.606 3.11-9.517 2.55-4.637 1.242 1.284 4.794 9.069 33.843 1.284 4.795 4.637-1.243 9.518-2.55 11.605-3.11c2.561-.686 4.063-3.389 3.353-6.037L37.956 9.385c-.71-2.648-3.361-4.238-5.922-3.551"
|
|
22
|
-
></path>
|
|
23
|
-
<path
|
|
24
|
-
fill="#38363A"
|
|
25
|
-
d="M38.322 51.833l1.77-.474-12.12-45.233-1.77.474z"
|
|
26
|
-
></path>
|
|
27
|
-
<path
|
|
28
|
-
fill="#CE2128"
|
|
29
|
-
d="M26.593 57.996l-1.179-.613-.713 1.12-.93-3.47 1.892-.507z"
|
|
30
|
-
></path>
|
|
31
|
-
</g>
|
|
32
|
-
<path
|
|
33
|
-
fill="#FFF"
|
|
34
|
-
d="M61.773 69.14l8.95 38.112a2.524 2.524 0 0 0 3.036 1.881l32.913-7.745a2.528 2.528 0 0 0 1.88-3.04L98.279 54.591a2.526 2.526 0 0 0-3.037-1.883L68.425 59.02l-6.652 10.12z"
|
|
35
|
-
></path>
|
|
36
|
-
<path
|
|
37
|
-
fill="#C0C0BE"
|
|
38
|
-
d="M68.425 59.02l1.326 5.645a2.527 2.527 0 0 1-1.88 3.038l-6.098 1.436 6.652-10.12z"
|
|
39
|
-
></path>
|
|
40
|
-
<path
|
|
41
|
-
stroke="#8E9294"
|
|
42
|
-
strokeLinecap="round"
|
|
43
|
-
strokeWidth="2.152"
|
|
44
|
-
d="M68.902 74.197l11.982-2.82m-10.721 8.19l24.874-5.853M71.424 84.937l24.873-5.853"
|
|
45
|
-
></path>
|
|
46
|
-
<path
|
|
47
|
-
stroke="#8E9294"
|
|
48
|
-
strokeLinecap="round"
|
|
49
|
-
strokeWidth="2.264"
|
|
50
|
-
d="M72.685 90.307l24.873-5.854M73.857 95.297l24.873-5.853M75.021 100.7l24.874-5.853"
|
|
51
|
-
></path>
|
|
52
|
-
<path
|
|
53
|
-
fill="#CCDEE6"
|
|
54
|
-
d="M21.698 86.68c-5.726-3.643-7.42-11.243-3.78-16.976 3.64-5.733 11.231-7.427 16.958-3.784 5.727 3.643 7.42 11.243 3.78 16.976-3.639 5.733-11.231 7.427-16.958 3.784z"
|
|
55
|
-
></path>
|
|
56
|
-
<path
|
|
57
|
-
fill="#C42B34"
|
|
58
|
-
d="M9.283 106.905a2.772 2.772 0 0 1-.851-3.823l8.759-13.798a2.765 2.765 0 0 1 3.817-.852 2.77 2.77 0 0 1 .851 3.822l-8.758 13.799a2.764 2.764 0 0 1-3.818.852"
|
|
59
|
-
></path>
|
|
60
|
-
<path
|
|
61
|
-
fill="#2E3137"
|
|
62
|
-
d="M19.032 90.912c-.86-.547-1.348-1.318-.801-2.179l1.826-2.877a1.841 1.841 0 0 1 2.546-.567 1.847 1.847 0 0 1 .566 2.547l-1.826 2.878c-.547.86-1.452.744-2.31.198"
|
|
63
|
-
></path>
|
|
64
|
-
<path
|
|
65
|
-
fill="#D84B55"
|
|
66
|
-
d="M16.41 91l-8.266 13.021a.925.925 0 0 0 .283 1.275.92.92 0 0 0 1.272-.284l7.912-12.463c-.713-.47-1.083-1.039-1.2-1.549"
|
|
67
|
-
></path>
|
|
68
|
-
<path
|
|
69
|
-
fill="#2E3137"
|
|
70
|
-
d="M27.811 87.523a11.115 11.115 0 0 1-1.117-.196 11.283 11.283 0 0 1-3.577-1.48c-5.295-3.369-6.866-10.423-3.502-15.723 3.366-5.301 10.412-6.874 15.709-3.504 5.296 3.368 6.866 10.422 3.5 15.723a11.317 11.317 0 0 1-2.86 3.053 11.4 11.4 0 0 1-4.72 2.029c-1.127.203-2.284.24-3.433.098m12.57-4.19c3.911-6.16 2.085-14.358-4.069-18.271-6.154-3.915-14.342-2.089-18.253 4.072-3.91 6.16-2.085 14.356 4.07 18.271 6.153 3.915 14.343 2.09 18.252-4.072"
|
|
71
|
-
></path>
|
|
72
|
-
<path
|
|
73
|
-
fill="#FFD399"
|
|
74
|
-
d="M93.445 12.554c2.45 5.367.088 11.707-5.274 14.159-5.361 2.452-11.695.088-14.145-5.279-2.449-5.368-.088-11.707 5.275-14.16 5.361-2.452 11.695-.088 14.144 5.28"
|
|
75
|
-
></path>
|
|
76
|
-
<path
|
|
77
|
-
fill="#FFD399"
|
|
78
|
-
d="M91.45 28.239l-4.274 1.954a2.697 2.697 0 0 1-3.574-1.334l-2.775-6.08a2.7 2.7 0 0 1 1.333-3.578l4.274-1.955a2.696 2.696 0 0 1 3.575 1.334l2.775 6.08a2.702 2.702 0 0 1-1.333 3.579"
|
|
79
|
-
></path>
|
|
80
|
-
<path
|
|
81
|
-
fill="#5A5C5D"
|
|
82
|
-
d="M94.1 30.6l-6.9 3.156a1.255 1.255 0 0 1-1.043-2.284l6.902-3.155a1.253 1.253 0 1 1 1.04 2.282m1.275 2.794l-6.9 3.156a1.254 1.254 0 1 1-1.041-2.283l6.9-3.156a1.254 1.254 0 0 1 1.041 2.283m-1.682 1.387l-3.044 1.392c-.458.21-.4.889.09 1.006.685.164 1.425.11 2.115-.207a3.25 3.25 0 0 0 1.54-1.464c.233-.449-.241-.936-.701-.727"
|
|
83
|
-
></path>
|
|
84
|
-
<g transform="rotate(-69 92.268 -44.056)">
|
|
85
|
-
<mask id="b" fill="#fff">
|
|
86
|
-
<use xlinkHref="#a"></use>
|
|
87
|
-
</mask>
|
|
88
|
-
<path
|
|
89
|
-
fill="#C42B34"
|
|
90
|
-
d="M.732 4.08l.397-1.844a1.999 1.999 0 1 1 3.91.842l-.396 1.846A2 2 0 1 1 .732 4.08"
|
|
91
|
-
mask="url(#b)"
|
|
92
|
-
></path>
|
|
93
|
-
</g>
|
|
94
|
-
<path
|
|
95
|
-
fill="#E1CFB4"
|
|
96
|
-
d="M86.458 79.011l-1.334 7.43 6.268-4.21-2.12-2.355z"
|
|
97
|
-
></path>
|
|
98
|
-
<path
|
|
99
|
-
fill="#FECB86"
|
|
100
|
-
d="M103.266 56.87l-1.644-1.073-14.841 22.72 1.643 1.072z"
|
|
101
|
-
></path>
|
|
102
|
-
<path
|
|
103
|
-
fill="#FAA736"
|
|
104
|
-
d="M104.912 57.945l-1.644-1.074-14.841 22.72 1.644 1.073z"
|
|
105
|
-
></path>
|
|
106
|
-
<path
|
|
107
|
-
fill="#FECB86"
|
|
108
|
-
d="M90.071 80.664l1.644 1.072 14.842-22.72-1.645-1.072zm-3.306-.951c.31.203.774-.055 1.188.215a.513.513 0 0 1 .152.15l.32-.488-1.644-1.073-.297.453s-.028.542.281.743"
|
|
109
|
-
></path>
|
|
110
|
-
<path
|
|
111
|
-
fill="#FAA736"
|
|
112
|
-
d="M88.106 80.078c.205.277.111.67.548.956.44.286.764.042 1.098.118l.32-.488-1.648-1.075-.318.489z"
|
|
113
|
-
></path>
|
|
114
|
-
<path
|
|
115
|
-
fill="#FECB86"
|
|
116
|
-
d="M89.752 81.152a.507.507 0 0 1 .198.08c.414.27.365.797.675 1 .311.204.794-.041.794-.041l.296-.454-1.644-1.073-.32.488z"
|
|
117
|
-
></path>
|
|
118
|
-
<path
|
|
119
|
-
fill="#535756"
|
|
120
|
-
d="M85.123 86.44l2.22-1.488-1.749-1.14zm21.434-27.423l-4.935-3.22.437-.67 4.935 3.22z"
|
|
121
|
-
></path>
|
|
122
|
-
</g>
|
|
123
|
-
</svg>
|
|
124
|
-
</>
|
|
125
|
-
);
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas } from "@storybook/addon-docs";
|
|
2
|
-
import { LinkPanel } from "../../index";
|
|
3
|
-
import { Success } from "@navikt/ds-react";
|
|
4
|
-
import { Illustration } from "./illustration";
|
|
5
|
-
|
|
6
|
-
<Meta title="ds-react/linkPanel/intro" />
|
|
7
|
-
|
|
8
|
-
# Hvordan ta i bruk LinkPanel
|
|
9
|
-
|
|
10
|
-
```jsx
|
|
11
|
-
<LinkPanel href="#">
|
|
12
|
-
<LinkPanel.Title>
|
|
13
|
-
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
|
14
|
-
</LinkPanel.Title>
|
|
15
|
-
</LinkPanel>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
<Canvas>
|
|
19
|
-
<LinkPanel href="#">
|
|
20
|
-
<LinkPanel.Title>
|
|
21
|
-
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
|
22
|
-
</LinkPanel.Title>
|
|
23
|
-
</LinkPanel>
|
|
24
|
-
</Canvas>
|
|
25
|
-
|
|
26
|
-
## Med description
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
29
|
-
<LinkPanel href="#">
|
|
30
|
-
<LinkPanel.Title>
|
|
31
|
-
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
|
32
|
-
</LinkPanel.Title>
|
|
33
|
-
<LinkPanel.Description>
|
|
34
|
-
Velit mollit do commodo elit Lorem aliqua Lorem.
|
|
35
|
-
</LinkPanel.Description>
|
|
36
|
-
</LinkPanel>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
<Canvas>
|
|
40
|
-
<LinkPanel href="#">
|
|
41
|
-
<LinkPanel.Title>
|
|
42
|
-
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
|
43
|
-
</LinkPanel.Title>
|
|
44
|
-
<LinkPanel.Description>
|
|
45
|
-
Velit mollit do commodo elit Lorem aliqua Lorem.
|
|
46
|
-
</LinkPanel.Description>
|
|
47
|
-
</LinkPanel>
|
|
48
|
-
</Canvas>
|
|
49
|
-
|
|
50
|
-
## Uten border
|
|
51
|
-
|
|
52
|
-
```jsx
|
|
53
|
-
<LinkPanel href="#" border={false}>
|
|
54
|
-
<LinkPanel.Title>
|
|
55
|
-
Veniam cillum cupidatat aliqua id ipsum culpa ea.
|
|
56
|
-
</LinkPanel.Title>
|
|
57
|
-
</LinkPanel>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
<Canvas>
|
|
61
|
-
<LinkPanel href="#" border={false}>
|
|
62
|
-
<LinkPanel.Title>
|
|
63
|
-
Veniam cillum cupidatat aliqua id ipsum culpa ea.
|
|
64
|
-
</LinkPanel.Title>
|
|
65
|
-
</LinkPanel>
|
|
66
|
-
</Canvas>
|
|
67
|
-
|
|
68
|
-
## Custom styling
|
|
69
|
-
|
|
70
|
-
```jsx
|
|
71
|
-
<LinkPanel href="#">
|
|
72
|
-
<div
|
|
73
|
-
style={{
|
|
74
|
-
display: "grid",
|
|
75
|
-
gridAutoFlow: "column",
|
|
76
|
-
gap: "var(--navds-spacing-8)",
|
|
77
|
-
alignItems: "center",
|
|
78
|
-
}}
|
|
79
|
-
>
|
|
80
|
-
{Illustration}
|
|
81
|
-
<div>
|
|
82
|
-
<LinkPanel.Title>Consectetur eu duis aliqua</LinkPanel.Title>
|
|
83
|
-
<LinkPanel.Description>
|
|
84
|
-
Aliqua id aliquip Lorem esse
|
|
85
|
-
</LinkPanel.Description>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</LinkPanel>
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
<Canvas>
|
|
92
|
-
<LinkPanel href="#">
|
|
93
|
-
<div
|
|
94
|
-
style={{
|
|
95
|
-
display: "grid",
|
|
96
|
-
gridAutoFlow: "column",
|
|
97
|
-
gap: "var(--navds-spacing-8)",
|
|
98
|
-
alignItems: "center",
|
|
99
|
-
}}
|
|
100
|
-
>
|
|
101
|
-
{Illustration}
|
|
102
|
-
<div>
|
|
103
|
-
<LinkPanel.Title>Consectetur eu duis aliqua</LinkPanel.Title>
|
|
104
|
-
<LinkPanel.Description>
|
|
105
|
-
Aliqua id aliquip Lorem esse
|
|
106
|
-
</LinkPanel.Description>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</LinkPanel>
|
|
110
|
-
</Canvas>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { LinkPanel } from "..";
|
|
3
|
-
import { Illustration } from "./illustration";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: "ds-react/linkPanel",
|
|
7
|
-
component: LinkPanel,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const All = () => (
|
|
11
|
-
<>
|
|
12
|
-
<h1>Link panel</h1>
|
|
13
|
-
<LinkPanel href="#">
|
|
14
|
-
<LinkPanel.Title>
|
|
15
|
-
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
|
16
|
-
</LinkPanel.Title>
|
|
17
|
-
<LinkPanel.Description>
|
|
18
|
-
Aliqua id aliquip Lorem esse
|
|
19
|
-
</LinkPanel.Description>
|
|
20
|
-
</LinkPanel>
|
|
21
|
-
|
|
22
|
-
<h1>No border</h1>
|
|
23
|
-
<LinkPanel href="#" border={false}>
|
|
24
|
-
<LinkPanel.Title>
|
|
25
|
-
Veniam cillum cupidatat aliqua id ipsum culpa ea.
|
|
26
|
-
</LinkPanel.Title>
|
|
27
|
-
</LinkPanel>
|
|
28
|
-
|
|
29
|
-
<h1>Custom styling</h1>
|
|
30
|
-
<LinkPanel href="#" className="linkpanel">
|
|
31
|
-
{Illustration}
|
|
32
|
-
<div>
|
|
33
|
-
<LinkPanel.Title>
|
|
34
|
-
Anim pariatur eiusmod deserunt elit cillum
|
|
35
|
-
</LinkPanel.Title>
|
|
36
|
-
<LinkPanel.Description>
|
|
37
|
-
Ex velit id voluptate labore irure ipsum exercitation sunt et id enim
|
|
38
|
-
magna veniam consequat. id aliquip Lorem esse
|
|
39
|
-
</LinkPanel.Description>
|
|
40
|
-
</div>
|
|
41
|
-
</LinkPanel>
|
|
42
|
-
<style>{`
|
|
43
|
-
.linkpanel .navds-link-panel__content {
|
|
44
|
-
display: grid;
|
|
45
|
-
grid-auto-flow: column;
|
|
46
|
-
gap: var(--navds-spacing-8);
|
|
47
|
-
align-items: center;
|
|
48
|
-
}
|
|
49
|
-
`}</style>
|
|
50
|
-
</>
|
|
51
|
-
);
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas } from "@storybook/addon-docs";
|
|
2
|
-
import { background } from "@storybook/theming";
|
|
3
|
-
import { Loader } from "../index";
|
|
4
|
-
import { Button } from "../../index";
|
|
5
|
-
|
|
6
|
-
<Meta title="ds-react/loader/intro" />
|
|
7
|
-
|
|
8
|
-
# Hvordan ta i bruk Loader
|
|
9
|
-
|
|
10
|
-
```jsx
|
|
11
|
-
<Loader title="Laster inn ny data" />
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
<Canvas>
|
|
15
|
-
<Loader />
|
|
16
|
-
</Canvas>
|
|
17
|
-
|
|
18
|
-
Her kan `title` proppen brukes for å gi en liten tooltip som sier hvorfor den laster
|
|
19
|
-
|
|
20
|
-
## Justering av størrelse
|
|
21
|
-
|
|
22
|
-
Loaderen kommer i størrelsene `2xlarge`, `xlarge`, `large`, `medium`, `small` og `xsmall`
|
|
23
|
-
|
|
24
|
-
```jsx
|
|
25
|
-
<Loader size="xlarge" />
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
<Canvas>
|
|
29
|
-
<Loader size="2xlarge" />
|
|
30
|
-
<Loader size="xlarge" />
|
|
31
|
-
<Loader size="large" />
|
|
32
|
-
<Loader size="medium" />
|
|
33
|
-
<Loader size="small" />
|
|
34
|
-
<Loader size="xsmall" />
|
|
35
|
-
</Canvas>
|
|
36
|
-
|
|
37
|
-
## Varianter
|
|
38
|
-
|
|
39
|
-
Loaderen kommer i variantene `neutral`, `interaction` og `inverted`
|
|
40
|
-
|
|
41
|
-
```jsx
|
|
42
|
-
<Loader size="2xlarge" variant="neutral"/>
|
|
43
|
-
<Loader size="2xlarge" variant="interaction"/>
|
|
44
|
-
<Loader size="2xlarge" variant="inverted"/>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
<Canvas>
|
|
48
|
-
<Loader size="2xlarge" variant="neutral" />
|
|
49
|
-
<Loader size="2xlarge" variant="interaction" />
|
|
50
|
-
<div style={{ backgroundColor: "black" }}>
|
|
51
|
-
<Loader size="2xlarge" variant="inverted" />
|
|
52
|
-
</div>
|
|
53
|
-
</Canvas>
|
|
54
|
-
|
|
55
|
-
## Transparent
|
|
56
|
-
|
|
57
|
-
Bakgrunnen kan settes til transparent med `transparent={true}`
|
|
58
|
-
|
|
59
|
-
```jsx
|
|
60
|
-
<Loader transparent />
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
<Canvas>
|
|
64
|
-
<Loader size="2xlarge" transparent />
|
|
65
|
-
</Canvas>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Loader } from "..";
|
|
3
|
-
import { Button } from "../..";
|
|
4
|
-
import { Meta } from "@storybook/react/types-6-0";
|
|
5
|
-
export default {
|
|
6
|
-
title: "ds-react/loader",
|
|
7
|
-
component: Loader,
|
|
8
|
-
} as Meta;
|
|
9
|
-
|
|
10
|
-
export const All = () => {
|
|
11
|
-
return (
|
|
12
|
-
<div>
|
|
13
|
-
<h1>Loader</h1>
|
|
14
|
-
<Loader />
|
|
15
|
-
|
|
16
|
-
<h2>Transparent</h2>
|
|
17
|
-
<Loader transparent />
|
|
18
|
-
|
|
19
|
-
<h2>Sizing</h2>
|
|
20
|
-
<Loader size="2xlarge" />
|
|
21
|
-
<Loader size="xlarge" />
|
|
22
|
-
<Loader size="large" />
|
|
23
|
-
<Loader size="medium" />
|
|
24
|
-
<Loader size="small" />
|
|
25
|
-
<Loader size="xsmall" />
|
|
26
|
-
<h2>Sizing transparent</h2>
|
|
27
|
-
<Loader size="2xlarge" transparent />
|
|
28
|
-
<Loader size="xlarge" transparent />
|
|
29
|
-
<Loader size="large" transparent />
|
|
30
|
-
<Loader size="medium" transparent />
|
|
31
|
-
<Loader size="small" transparent />
|
|
32
|
-
<Loader size="xsmall" transparent />
|
|
33
|
-
<div style={{ backgroundColor: "#c9c9c9" }}>
|
|
34
|
-
<h2>Varianter</h2>
|
|
35
|
-
<Loader size="xlarge" variant="neutral" />
|
|
36
|
-
<Loader size="xlarge" variant="interaction" />
|
|
37
|
-
<Loader size="xlarge" variant="inverted" />
|
|
38
|
-
<h2>Varianter transparent</h2>
|
|
39
|
-
<Loader size="xlarge" variant="neutral" transparent />
|
|
40
|
-
<Loader size="xlarge" variant="interaction" transparent />
|
|
41
|
-
<Loader size="xlarge" variant="inverted" transparent />
|
|
42
|
-
</div>
|
|
43
|
-
<h2>Brukt i knapper</h2>
|
|
44
|
-
<div>
|
|
45
|
-
<Button>
|
|
46
|
-
Laster...
|
|
47
|
-
<Loader />
|
|
48
|
-
</Button>
|
|
49
|
-
<Button size="small">
|
|
50
|
-
Laster...
|
|
51
|
-
<Loader />
|
|
52
|
-
</Button>
|
|
53
|
-
<h2>Variants</h2>
|
|
54
|
-
<Button variant="secondary">
|
|
55
|
-
Laster...
|
|
56
|
-
<Loader />
|
|
57
|
-
</Button>
|
|
58
|
-
<Button variant="action">
|
|
59
|
-
Laster...
|
|
60
|
-
<Loader />
|
|
61
|
-
</Button>
|
|
62
|
-
<Button variant="danger">
|
|
63
|
-
Laster...
|
|
64
|
-
<Loader />
|
|
65
|
-
</Button>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas } from "@storybook/addon-docs";
|
|
2
|
-
import { Panel } from "../../index";
|
|
3
|
-
|
|
4
|
-
<Meta title="ds-react/panel/intro" />
|
|
5
|
-
|
|
6
|
-
# Hvordan ta i bruk Panel
|
|
7
|
-
|
|
8
|
-
Veldig enkel wrapper-komponent for panel-styling. Kan erstattes 1-1 med `nav-frontend-paneler`.
|
|
9
|
-
|
|
10
|
-
```jsx
|
|
11
|
-
<Panel>
|
|
12
|
-
Eu quis exercitation voluptate ex. Aute irure esse occaecat minim cupidatat
|
|
13
|
-
velit minim duis sint culpa anim laboris. Consectetur nulla eu commodo ea
|
|
14
|
-
culpa velit commodo incididunt sunt ipsum.
|
|
15
|
-
</Panel>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
<Canvas>
|
|
19
|
-
<Panel>
|
|
20
|
-
Eu quis exercitation voluptate ex. Aute irure esse occaecat minim cupidatat
|
|
21
|
-
velit minim duis sint culpa anim laboris. Consectetur nulla eu commodo ea
|
|
22
|
-
culpa velit commodo incididunt sunt ipsum.
|
|
23
|
-
</Panel>
|
|
24
|
-
</Canvas>
|
|
25
|
-
|
|
26
|
-
## Border
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
29
|
-
<Panel border>
|
|
30
|
-
Eu quis exercitation voluptate ex. Aute irure esse occaecat minim cupidatat
|
|
31
|
-
velit minim duis sint culpa anim laboris. Consectetur nulla eu commodo ea
|
|
32
|
-
culpa velit commodo incididunt sunt ipsum.
|
|
33
|
-
</Panel>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
<Canvas>
|
|
37
|
-
<Panel border>
|
|
38
|
-
Eu quis exercitation voluptate ex. Aute irure esse occaecat minim cupidatat
|
|
39
|
-
velit minim duis sint culpa anim laboris. Consectetur nulla eu commodo ea
|
|
40
|
-
culpa velit commodo incididunt sunt ipsum.
|
|
41
|
-
</Panel>
|
|
42
|
-
</Canvas>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas } from "@storybook/addon-docs";
|
|
2
|
-
import { Popover } from "../../index";
|
|
3
|
-
import { placements } from "@popperjs/core";
|
|
4
|
-
|
|
5
|
-
<Meta title="ds-react/popover/intro" />
|
|
6
|
-
|
|
7
|
-
# Hvordan ta i bruk Popover
|
|
8
|
-
|
|
9
|
-
```jsx
|
|
10
|
-
<Popover anchorEl={anchorEl} onClose={() => handleClose} open={open}>
|
|
11
|
-
<div style={{ margin: "1rem" }}>Contents</div>
|
|
12
|
-
</Popover>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Plassering
|
|
16
|
-
|
|
17
|
-
Plassering er alle mulighetene tilbytt av `import { placements } from "@popperjs/core";`
|
|
18
|
-
|
|
19
|
-
`auto` , `auto-start` , `auto-end` , `top` , `bottom` , `right` , `left` , `top` ,`top-start` , `top-end` , `bottom-start` , `bottom-end` , `right-start` , `right-end` , `left-start` , `left-end`
|
|
20
|
-
|
|
21
|
-
## Arrow + offset
|
|
22
|
-
|
|
23
|
-
`arrow`-proppen toggler om arrow skal rendres med popoveren, mens `offset`-proppen er `px` offset popoveren har fra ankerelementet.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { Popover } from "../index";
|
|
3
|
-
import { Meta } from "@storybook/react/types-6-0";
|
|
4
|
-
import { placements } from "@popperjs/core";
|
|
5
|
-
export default {
|
|
6
|
-
title: "ds-react/popover",
|
|
7
|
-
component: Popover,
|
|
8
|
-
parameters: {
|
|
9
|
-
chromatic: { disable: true },
|
|
10
|
-
},
|
|
11
|
-
} as Meta;
|
|
12
|
-
|
|
13
|
-
const Template = (props) => {
|
|
14
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<>
|
|
18
|
-
<div
|
|
19
|
-
style={{
|
|
20
|
-
background: "var(--navds-global-color-gray-600)",
|
|
21
|
-
textAlign: "center",
|
|
22
|
-
width: "2rem",
|
|
23
|
-
height: "2rem",
|
|
24
|
-
}}
|
|
25
|
-
ref={(el) => setAnchorEl(el)}
|
|
26
|
-
></div>
|
|
27
|
-
<Popover {...props} anchorEl={anchorEl} onClose={() => {}} open>
|
|
28
|
-
<Popover.Content>{props.placement}</Popover.Content>
|
|
29
|
-
</Popover>
|
|
30
|
-
</>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const All = () => {
|
|
35
|
-
return (
|
|
36
|
-
<div
|
|
37
|
-
style={{
|
|
38
|
-
display: "flex",
|
|
39
|
-
flexWrap: "wrap",
|
|
40
|
-
margin: "4rem 8rem 4rem 8rem",
|
|
41
|
-
gap: "4rem",
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
{placements.map((placement) => (
|
|
45
|
-
<div
|
|
46
|
-
style={{
|
|
47
|
-
width: "20%",
|
|
48
|
-
height: "100px",
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
<Template placement={placement} />
|
|
52
|
-
</div>
|
|
53
|
-
))}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|