@navikt/ds-react 4.9.1 → 4.10.1
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 +63 -0
- package/cjs/link/Link.js +13 -2
- package/cjs/util/RandomIcon.js +37 -0
- package/esm/link/Link.d.ts +25 -0
- package/esm/link/Link.js +13 -2
- package/esm/link/Link.js.map +1 -1
- package/esm/util/RandomIcon.d.ts +2 -0
- package/esm/util/RandomIcon.js +8 -0
- package/esm/util/RandomIcon.js.map +1 -0
- package/package.json +2 -2
- package/src/link/Link.tsx +47 -3
- package/src/link/link.stories.tsx +143 -13
- package/src/util/RandomIcon.tsx +9 -0
package/_docs.json
CHANGED
|
@@ -5154,6 +5154,69 @@
|
|
|
5154
5154
|
"filePath": "src/link/Link.tsx",
|
|
5155
5155
|
"displayName": "Link",
|
|
5156
5156
|
"props": {
|
|
5157
|
+
"underline": {
|
|
5158
|
+
"defaultValue": {
|
|
5159
|
+
"value": "true"
|
|
5160
|
+
},
|
|
5161
|
+
"description": "Inverts when the underline appears. If this is false,\nthe underline does not appear by default, but does appear when the link is hovered.\nThis makes it more suitable for use when inlined in text.",
|
|
5162
|
+
"name": "underline",
|
|
5163
|
+
"parent": {
|
|
5164
|
+
"fileName": "src/link/Link.tsx",
|
|
5165
|
+
"name": "LinkProps"
|
|
5166
|
+
},
|
|
5167
|
+
"declarations": [
|
|
5168
|
+
{
|
|
5169
|
+
"fileName": "src/link/Link.tsx",
|
|
5170
|
+
"name": "LinkProps"
|
|
5171
|
+
}
|
|
5172
|
+
],
|
|
5173
|
+
"required": false,
|
|
5174
|
+
"type": {
|
|
5175
|
+
"name": "boolean"
|
|
5176
|
+
}
|
|
5177
|
+
},
|
|
5178
|
+
"inlineText": {
|
|
5179
|
+
"defaultValue": {
|
|
5180
|
+
"value": "false"
|
|
5181
|
+
},
|
|
5182
|
+
"description": "Renders link with `display: inline` for better wrapping in text.",
|
|
5183
|
+
"name": "inlineText",
|
|
5184
|
+
"parent": {
|
|
5185
|
+
"fileName": "src/link/Link.tsx",
|
|
5186
|
+
"name": "LinkProps"
|
|
5187
|
+
},
|
|
5188
|
+
"declarations": [
|
|
5189
|
+
{
|
|
5190
|
+
"fileName": "src/link/Link.tsx",
|
|
5191
|
+
"name": "LinkProps"
|
|
5192
|
+
}
|
|
5193
|
+
],
|
|
5194
|
+
"required": false,
|
|
5195
|
+
"type": {
|
|
5196
|
+
"name": "boolean"
|
|
5197
|
+
}
|
|
5198
|
+
},
|
|
5199
|
+
"variant": {
|
|
5200
|
+
"defaultValue": {
|
|
5201
|
+
"value": "action"
|
|
5202
|
+
},
|
|
5203
|
+
"description": "Variant of the component to use.",
|
|
5204
|
+
"name": "variant",
|
|
5205
|
+
"parent": {
|
|
5206
|
+
"fileName": "src/link/Link.tsx",
|
|
5207
|
+
"name": "LinkProps"
|
|
5208
|
+
},
|
|
5209
|
+
"declarations": [
|
|
5210
|
+
{
|
|
5211
|
+
"fileName": "src/link/Link.tsx",
|
|
5212
|
+
"name": "LinkProps"
|
|
5213
|
+
}
|
|
5214
|
+
],
|
|
5215
|
+
"required": false,
|
|
5216
|
+
"type": {
|
|
5217
|
+
"name": "\"action\" | \"neutral\" | \"subtle\""
|
|
5218
|
+
}
|
|
5219
|
+
},
|
|
5157
5220
|
"children": {
|
|
5158
5221
|
"defaultValue": null,
|
|
5159
5222
|
"description": "Link text",
|
package/cjs/link/Link.js
CHANGED
|
@@ -52,9 +52,20 @@ const clsx_1 = __importDefault(require("clsx"));
|
|
|
52
52
|
* <Link href="#">lenke til ny side</Link>
|
|
53
53
|
* <Link as={ReactRouter.Link} to="#">lenke til ny side</Link>
|
|
54
54
|
* ```
|
|
55
|
+
* @example
|
|
56
|
+
* ```jsx
|
|
57
|
+
* <BodyLong>
|
|
58
|
+
* ...
|
|
59
|
+
* <Link href="#" inlineText>lenke til ny side</Link>
|
|
60
|
+
* ...
|
|
61
|
+
* </BodyLong>
|
|
62
|
+
* ```
|
|
55
63
|
*/
|
|
56
64
|
exports.Link = (0, react_1.forwardRef)((_a, ref) => {
|
|
57
|
-
var { as: Component = "a", className } = _a, rest = __rest(_a, ["as", "className"]);
|
|
58
|
-
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-link", className
|
|
65
|
+
var { as: Component = "a", className, underline = true, variant = "action", inlineText = false } = _a, rest = __rest(_a, ["as", "className", "underline", "variant", "inlineText"]);
|
|
66
|
+
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-link", className, `navds-link--${variant}`, {
|
|
67
|
+
"navds-link--remove-underline": !underline,
|
|
68
|
+
"navds-link--inline-text": inlineText,
|
|
69
|
+
}) })));
|
|
59
70
|
});
|
|
60
71
|
exports.default = exports.Link;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.RandomIcon = void 0;
|
|
30
|
+
const AllIcons = __importStar(require("@navikt/aksel-icons"));
|
|
31
|
+
const react_1 = __importDefault(require("react"));
|
|
32
|
+
const icons = Object.keys(AllIcons).map((key) => AllIcons[key]);
|
|
33
|
+
const RandomIcon = () => {
|
|
34
|
+
const Icon = icons[Math.floor(Math.random() * icons.length)];
|
|
35
|
+
return react_1.default.createElement(Icon, null);
|
|
36
|
+
};
|
|
37
|
+
exports.RandomIcon = RandomIcon;
|
package/esm/link/Link.d.ts
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { OverridableComponent } from "../util/OverridableComponent";
|
|
3
3
|
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Inverts when the underline appears. If this is false,
|
|
6
|
+
* the underline does not appear by default, but does appear when the link is hovered.
|
|
7
|
+
* This makes it more suitable for use when inlined in text.
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
underline?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Renders link with `display: inline` for better wrapping in text.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
inlineText?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Variant of the component to use.
|
|
18
|
+
* @default "action"
|
|
19
|
+
*/
|
|
20
|
+
variant?: "action" | "neutral" | "subtle";
|
|
4
21
|
/**
|
|
5
22
|
* Link text
|
|
6
23
|
*/
|
|
@@ -18,6 +35,14 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
18
35
|
* <Link href="#">lenke til ny side</Link>
|
|
19
36
|
* <Link as={ReactRouter.Link} to="#">lenke til ny side</Link>
|
|
20
37
|
* ```
|
|
38
|
+
* @example
|
|
39
|
+
* ```jsx
|
|
40
|
+
* <BodyLong>
|
|
41
|
+
* ...
|
|
42
|
+
* <Link href="#" inlineText>lenke til ny side</Link>
|
|
43
|
+
* ...
|
|
44
|
+
* </BodyLong>
|
|
45
|
+
* ```
|
|
21
46
|
*/
|
|
22
47
|
export declare const Link: OverridableComponent<LinkProps, HTMLAnchorElement>;
|
|
23
48
|
export default Link;
|
package/esm/link/Link.js
CHANGED
|
@@ -23,10 +23,21 @@ import cl from "clsx";
|
|
|
23
23
|
* <Link href="#">lenke til ny side</Link>
|
|
24
24
|
* <Link as={ReactRouter.Link} to="#">lenke til ny side</Link>
|
|
25
25
|
* ```
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <BodyLong>
|
|
29
|
+
* ...
|
|
30
|
+
* <Link href="#" inlineText>lenke til ny side</Link>
|
|
31
|
+
* ...
|
|
32
|
+
* </BodyLong>
|
|
33
|
+
* ```
|
|
26
34
|
*/
|
|
27
35
|
export const Link = forwardRef((_a, ref) => {
|
|
28
|
-
var { as: Component = "a", className } = _a, rest = __rest(_a, ["as", "className"]);
|
|
29
|
-
return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cl("navds-link", className
|
|
36
|
+
var { as: Component = "a", className, underline = true, variant = "action", inlineText = false } = _a, rest = __rest(_a, ["as", "className", "underline", "variant", "inlineText"]);
|
|
37
|
+
return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cl("navds-link", className, `navds-link--${variant}`, {
|
|
38
|
+
"navds-link--remove-underline": !underline,
|
|
39
|
+
"navds-link--inline-text": inlineText,
|
|
40
|
+
}) })));
|
|
30
41
|
});
|
|
31
42
|
export default Link;
|
|
32
43
|
//# sourceMappingURL=Link.js.map
|
package/esm/link/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;AA4BtB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,IAAI,GACf,UAAU,CACR,CACE,EAOC,EACD,GAAG,EACH,EAAE;QATF,EACE,EAAE,EAAE,SAAS,GAAG,GAAG,EACnB,SAAS,EACT,SAAS,GAAG,IAAI,EAChB,OAAO,GAAG,QAAQ,EAClB,UAAU,GAAG,KAAK,OAEnB,EADI,IAAI,cANT,yDAOC,CADQ;IAGN,OAAA,CACH,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,eAAe,OAAO,EAAE,EAAE;YAC/D,8BAA8B,EAAE,CAAC,SAAS;YAC1C,yBAAyB,EAAE,UAAU;SACtC,CAAC,IACF,CACH,CAAA;CAAA,CACF,CAAC;AAEJ,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as AllIcons from "@navikt/aksel-icons";
|
|
2
|
+
import React from "react";
|
|
3
|
+
const icons = Object.keys(AllIcons).map((key) => AllIcons[key]);
|
|
4
|
+
export const RandomIcon = () => {
|
|
5
|
+
const Icon = icons[Math.floor(Math.random() * icons.length)];
|
|
6
|
+
return React.createElement(Icon, null);
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=RandomIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RandomIcon.js","sourceRoot":"","sources":["../../src/util/RandomIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,oBAAC,IAAI,OAAG,CAAC;AAClB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.1",
|
|
4
4
|
"description": "Aksel react-components for NAV designsystem",
|
|
5
5
|
"author": "Aksel | NAV designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@floating-ui/react": "0.24.1",
|
|
41
|
-
"@navikt/aksel-icons": "^4.
|
|
41
|
+
"@navikt/aksel-icons": "^4.10.1",
|
|
42
42
|
"@radix-ui/react-tabs": "1.0.0",
|
|
43
43
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
44
44
|
"clsx": "^1.2.1",
|
package/src/link/Link.tsx
CHANGED
|
@@ -4,6 +4,23 @@ import { OverridableComponent } from "../util/OverridableComponent";
|
|
|
4
4
|
|
|
5
5
|
export interface LinkProps
|
|
6
6
|
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Inverts when the underline appears. If this is false,
|
|
9
|
+
* the underline does not appear by default, but does appear when the link is hovered.
|
|
10
|
+
* This makes it more suitable for use when inlined in text.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
underline?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Renders link with `display: inline` for better wrapping in text.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
inlineText?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Variant of the component to use.
|
|
21
|
+
* @default "action"
|
|
22
|
+
*/
|
|
23
|
+
variant?: "action" | "neutral" | "subtle";
|
|
7
24
|
/**
|
|
8
25
|
* Link text
|
|
9
26
|
*/
|
|
@@ -22,10 +39,37 @@ export interface LinkProps
|
|
|
22
39
|
* <Link href="#">lenke til ny side</Link>
|
|
23
40
|
* <Link as={ReactRouter.Link} to="#">lenke til ny side</Link>
|
|
24
41
|
* ```
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* <BodyLong>
|
|
45
|
+
* ...
|
|
46
|
+
* <Link href="#" inlineText>lenke til ny side</Link>
|
|
47
|
+
* ...
|
|
48
|
+
* </BodyLong>
|
|
49
|
+
* ```
|
|
25
50
|
*/
|
|
26
51
|
export const Link: OverridableComponent<LinkProps, HTMLAnchorElement> =
|
|
27
|
-
forwardRef(
|
|
28
|
-
|
|
29
|
-
|
|
52
|
+
forwardRef(
|
|
53
|
+
(
|
|
54
|
+
{
|
|
55
|
+
as: Component = "a",
|
|
56
|
+
className,
|
|
57
|
+
underline = true,
|
|
58
|
+
variant = "action",
|
|
59
|
+
inlineText = false,
|
|
60
|
+
...rest
|
|
61
|
+
},
|
|
62
|
+
ref
|
|
63
|
+
) => (
|
|
64
|
+
<Component
|
|
65
|
+
{...rest}
|
|
66
|
+
ref={ref}
|
|
67
|
+
className={cl("navds-link", className, `navds-link--${variant}`, {
|
|
68
|
+
"navds-link--remove-underline": !underline,
|
|
69
|
+
"navds-link--inline-text": inlineText,
|
|
70
|
+
})}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
);
|
|
30
74
|
|
|
31
75
|
export default Link;
|
|
@@ -6,29 +6,76 @@ import {
|
|
|
6
6
|
ConfirmationPanel as DsConfirmationPanel,
|
|
7
7
|
Link,
|
|
8
8
|
} from "..";
|
|
9
|
+
import { RandomIcon } from "../util/RandomIcon";
|
|
10
|
+
|
|
9
11
|
export default {
|
|
10
12
|
title: "ds-react/Link",
|
|
11
13
|
component: Link,
|
|
12
14
|
};
|
|
13
15
|
|
|
16
|
+
const LinkWrapper = ({
|
|
17
|
+
children = "Ex aliqua incididunt",
|
|
18
|
+
iconRight = false,
|
|
19
|
+
iconLeft = false,
|
|
20
|
+
variant = "action",
|
|
21
|
+
underline = false,
|
|
22
|
+
inlineText = true,
|
|
23
|
+
}) => (
|
|
24
|
+
<>
|
|
25
|
+
{" "}
|
|
26
|
+
<Link
|
|
27
|
+
href="#"
|
|
28
|
+
underline={underline}
|
|
29
|
+
variant={variant as "action" | "neutral" | "subtle"}
|
|
30
|
+
inlineText={inlineText}
|
|
31
|
+
>
|
|
32
|
+
{iconLeft && (
|
|
33
|
+
<>
|
|
34
|
+
<RandomIcon />{" "}
|
|
35
|
+
</>
|
|
36
|
+
)}
|
|
37
|
+
{children}
|
|
38
|
+
{iconRight && (
|
|
39
|
+
<>
|
|
40
|
+
{" "}
|
|
41
|
+
<RandomIcon />
|
|
42
|
+
</>
|
|
43
|
+
)}
|
|
44
|
+
</Link>{" "}
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
|
|
14
48
|
export const Default = {
|
|
15
|
-
render: (
|
|
49
|
+
render: ({ icon, inline }) => {
|
|
16
50
|
const LinkD = () => (
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
51
|
+
<>
|
|
52
|
+
{" "}
|
|
53
|
+
<Link href="#" underline={!inline} inlineText={inline}>
|
|
54
|
+
{icon && <PlusCircleFillIcon />}Ex aliqua incididunt
|
|
55
|
+
{icon && <PlusCircleFillIcon />}
|
|
56
|
+
</Link>{" "}
|
|
57
|
+
</>
|
|
21
58
|
);
|
|
22
59
|
|
|
23
|
-
if (
|
|
60
|
+
if (inline) {
|
|
24
61
|
return (
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
<div
|
|
63
|
+
className="colgap"
|
|
64
|
+
style={{
|
|
65
|
+
width: "800px",
|
|
66
|
+
border: "1px solid black",
|
|
67
|
+
borderRadius: "8px",
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<BodyLong>
|
|
71
|
+
Incididunt laborum nisi nisi Lorem
|
|
72
|
+
<LinkD />
|
|
73
|
+
in. Laborum aute fugiat officia adipisicing non veniam dolor nulla
|
|
74
|
+
non ex consectetur fugiat eiusmod aute. Culpa sit aute est duis
|
|
75
|
+
minim in in voluptate velit fugiat. Laboris est id deserunt ut ea
|
|
76
|
+
Lorem eu. Esse elit laboris aute commodo sint laborum fugiat aliqua.
|
|
77
|
+
</BodyLong>
|
|
78
|
+
</div>
|
|
32
79
|
);
|
|
33
80
|
}
|
|
34
81
|
return <LinkD />;
|
|
@@ -40,6 +87,49 @@ export const Default = {
|
|
|
40
87
|
},
|
|
41
88
|
};
|
|
42
89
|
|
|
90
|
+
export const InlineInsideBodyLong = {
|
|
91
|
+
render: ({ iconLeft, iconRight }) => {
|
|
92
|
+
return (
|
|
93
|
+
<div
|
|
94
|
+
className="colgap"
|
|
95
|
+
style={{
|
|
96
|
+
width: "800px",
|
|
97
|
+
border: "1px solid black",
|
|
98
|
+
borderRadius: "8px",
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
<style>{`.storybook-custom-spacing { white-space: pre;}`}</style>
|
|
102
|
+
<BodyLong>
|
|
103
|
+
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight} />
|
|
104
|
+
Eiusmod aute.
|
|
105
|
+
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight} />
|
|
106
|
+
Culpa sit aute est duis minim in in voluptate velit Incididunt laborum
|
|
107
|
+
nisi nisi Lorem officia adipisicing non veniam
|
|
108
|
+
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight}>
|
|
109
|
+
blah blah blah blah blah blah blah blah blah blah blah blah blah
|
|
110
|
+
blah blah blah blah blah blah blah blah
|
|
111
|
+
</LinkWrapper>
|
|
112
|
+
dolor eu. Esse elit laboris aute commodo sint laborum fugiat aliqua.
|
|
113
|
+
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight}>
|
|
114
|
+
Link
|
|
115
|
+
</LinkWrapper>
|
|
116
|
+
</BodyLong>
|
|
117
|
+
<BodyLong className="storybook-custom-spacing">
|
|
118
|
+
Custom{" "}
|
|
119
|
+
<LinkWrapper underline iconLeft={iconLeft} iconRight={iconRight}>
|
|
120
|
+
link
|
|
121
|
+
</LinkWrapper>
|
|
122
|
+
{" "}spacing.
|
|
123
|
+
</BodyLong>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
args: {
|
|
128
|
+
iconLeft: false,
|
|
129
|
+
iconRight: false,
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
43
133
|
const DemoLink = () => (
|
|
44
134
|
<Link href="#">
|
|
45
135
|
<PlusCircleFillIcon aria-hidden /> Ex aliqua incididunt{" "}
|
|
@@ -83,3 +173,43 @@ export const ConfirmationPanel = () => {
|
|
|
83
173
|
</div>
|
|
84
174
|
);
|
|
85
175
|
};
|
|
176
|
+
|
|
177
|
+
export const Variants = {
|
|
178
|
+
render: ({ iconLeft, iconRight }) => {
|
|
179
|
+
return (
|
|
180
|
+
<div className="colgap">
|
|
181
|
+
{["action", "neutral", "subtle"].map((variant) => (
|
|
182
|
+
<>
|
|
183
|
+
<div>
|
|
184
|
+
<LinkWrapper
|
|
185
|
+
iconLeft={iconLeft}
|
|
186
|
+
iconRight={iconRight}
|
|
187
|
+
variant={variant}
|
|
188
|
+
/>
|
|
189
|
+
</div>
|
|
190
|
+
</>
|
|
191
|
+
))}
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
|
+
args: {
|
|
196
|
+
iconLeft: false,
|
|
197
|
+
iconRight: false,
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const InlineLink = {
|
|
202
|
+
render: () => (
|
|
203
|
+
<BodyLong>
|
|
204
|
+
Officia incididunt Culpa sit aute est duis minim in in voluptate velit
|
|
205
|
+
Incididunt laborum nisi nisi Lorem officia adipisicing non veniam{" "}
|
|
206
|
+
<Link href="#" inlineText={true}>
|
|
207
|
+
lenke til ny side
|
|
208
|
+
<PlusCircleFillIcon aria-hidden />
|
|
209
|
+
</Link>{" "}
|
|
210
|
+
Culpa sit aute est duis minim in in voluptate velit Incididunt laborum
|
|
211
|
+
nisi nisi Lorem officia adipisicing non veniam occaecat commodo id ad
|
|
212
|
+
aliquip.
|
|
213
|
+
</BodyLong>
|
|
214
|
+
),
|
|
215
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as AllIcons from "@navikt/aksel-icons";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
const icons = Object.keys(AllIcons).map((key) => AllIcons[key]);
|
|
5
|
+
|
|
6
|
+
export const RandomIcon = () => {
|
|
7
|
+
const Icon = icons[Math.floor(Math.random() * icons.length)];
|
|
8
|
+
return <Icon />;
|
|
9
|
+
};
|