@altinn/altinn-components 0.6.12 → 0.7.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.
- package/dist/assets/AutocompleteBase.css +1 -1
- package/dist/assets/AutocompleteGroup.css +1 -1
- package/dist/assets/DialogBorder.css +1 -1
- package/dist/assets/DialogHeaderBase.css +1 -1
- package/dist/assets/DialogHeadings.css +1 -1
- package/dist/assets/DialogListItem.css +1 -1
- package/dist/assets/DialogTitle.css +1 -1
- package/dist/assets/ListItemAction.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemFooter.css +1 -0
- package/dist/assets/ListItemHeader.css +1 -0
- package/dist/assets/ListItemLabel.css +1 -1
- package/dist/assets/ListItemMedia.css +1 -1
- package/dist/assets/MetaItemBase.css +1 -0
- package/dist/assets/MetaItemLabel.css +1 -0
- package/dist/assets/MetaItemMedia.css +1 -0
- package/dist/components/Bookmarks/BookmarksList.d.ts +1 -1
- package/dist/components/Bookmarks/BookmarksListItem.d.ts +2 -13
- package/dist/components/Bookmarks/BookmarksListItem.js +5 -10
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Buttons.stories.js +2 -2
- package/dist/components/Dialog/Dialog.stories.js +30 -20
- package/dist/components/Dialog/DialogBase.d.ts +2 -0
- package/dist/components/Dialog/DialogBorder.d.ts +1 -1
- package/dist/components/Dialog/DialogBorder.js +5 -5
- package/dist/components/Dialog/DialogContent.stories.js +1 -1
- package/dist/components/Dialog/DialogGroup.js +5 -5
- package/dist/components/Dialog/DialogHeader.d.ts +1 -1
- package/dist/components/Dialog/DialogHeader.js +6 -6
- package/dist/components/Dialog/DialogHeaderBase.d.ts +3 -1
- package/dist/components/Dialog/DialogHeaderBase.js +3 -3
- package/dist/components/Dialog/DialogHeadings.d.ts +2 -3
- package/dist/components/Dialog/DialogHeadings.js +24 -26
- package/dist/components/Dialog/DialogLabel.d.ts +13 -0
- package/dist/components/Dialog/DialogLabel.js +17 -0
- package/dist/components/Dialog/DialogListItem.d.ts +17 -5
- package/dist/components/Dialog/DialogListItem.js +86 -70
- package/dist/components/Dialog/DialogListItem.stories.js +117 -68
- package/dist/components/Dialog/DialogMetadata.d.ts +9 -1
- package/dist/components/Dialog/DialogMetadata.js +25 -21
- package/dist/components/Dialog/DialogNav.js +16 -16
- package/dist/components/Dialog/DialogTitle.d.ts +7 -9
- package/dist/components/Dialog/DialogTitle.js +9 -10
- package/dist/components/Dialog/Examples.stories.js +31 -0
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Dialog/index.js +41 -41
- package/dist/components/List/List.js +2 -3
- package/dist/components/List/ListItem.d.ts +5 -25
- package/dist/components/List/ListItem.js +46 -21
- package/dist/components/List/ListItem.stories.js +52 -42
- package/dist/components/List/ListItemAction.d.ts +2 -7
- package/dist/components/List/ListItemAction.js +6 -17
- package/dist/components/List/ListItemBase.d.ts +5 -10
- package/dist/components/List/ListItemBase.js +52 -48
- package/dist/components/List/ListItemFooter.d.ts +11 -0
- package/dist/components/List/ListItemFooter.js +17 -0
- package/dist/components/List/ListItemHeader.d.ts +8 -0
- package/dist/components/List/ListItemHeader.js +8 -0
- package/dist/components/List/ListItemLabel.js +7 -7
- package/dist/components/List/ListItemMedia.js +7 -7
- package/dist/components/List/index.d.ts +4 -3
- package/dist/components/List/index.js +14 -12
- package/dist/components/Meta/MetaItemBase.d.ts +1 -1
- package/dist/components/Meta/MetaItemBase.js +21 -20
- package/dist/components/Meta/MetaItemLabel.js +5 -4
- package/dist/components/Meta/MetaItemMedia.js +9 -8
- package/dist/components/Page/PageNav.js +7 -7
- package/dist/components/Searchbar/Autocomplete.stories.js +241 -13
- package/dist/components/Searchbar/AutocompleteBase.js +5 -5
- package/dist/components/Searchbar/AutocompleteGroup.js +9 -12
- package/dist/components/Searchbar/AutocompleteItem.d.ts +23 -11
- package/dist/components/Searchbar/AutocompleteItem.js +21 -8
- package/dist/components/Searchbar/ScopeListItem.d.ts +12 -0
- package/dist/components/Searchbar/ScopeListItem.js +11 -0
- package/dist/components/Toolbar/ToolbarButton.js +2 -1
- package/dist/components/index.js +153 -151
- package/dist/hooks/useMenu.js +19 -19
- package/dist/index.js +155 -153
- package/package.json +1 -1
- package/dist/assets/DialogListItemBase.css +0 -1
- package/dist/assets/metaItem.css +0 -1
- package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
- package/dist/components/Dialog/DialogListItemBase.js +0 -24
- package/dist/components/Dialog/DialogTitle.stories.js +0 -26
- package/dist/components/List/ListItemAction.stories.js +0 -45
- package/dist/metaItem.module-CfNiX769.js +0 -8
- /package/dist/assets/{AutocompleteItem.css → ScopeListItem.css} +0 -0
|
@@ -2,50 +2,50 @@ import { Dialog as e } from "./Dialog.js";
|
|
|
2
2
|
import { DialogList as a } from "./DialogList.js";
|
|
3
3
|
import { DialogMetadata as l } from "./DialogMetadata.js";
|
|
4
4
|
import { DialogListItem as m } from "./DialogListItem.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
5
|
+
import { DialogActions as f } from "./DialogActions.js";
|
|
6
|
+
import { DialogActivityLog as x } from "./DialogActivityLog.js";
|
|
7
|
+
import { DialogArticleBase as B } from "./DialogArticleBase.js";
|
|
8
|
+
import { DialogBase as n } from "./DialogBase.js";
|
|
9
|
+
import { DialogBodyBase as y } from "./DialogBodyBase.js";
|
|
10
|
+
import { DialogBorder as u } from "./DialogBorder.js";
|
|
11
|
+
import { DialogContent as L } from "./DialogContent.js";
|
|
12
|
+
import { DialogFooter as v } from "./DialogFooter.js";
|
|
13
|
+
import { DialogHeader as b } from "./DialogHeader.js";
|
|
14
|
+
import { DialogHeaderBase as C } from "./DialogHeaderBase.js";
|
|
15
|
+
import { DialogHeadings as F } from "./DialogHeadings.js";
|
|
16
|
+
import { DialogHistory as M } from "./DialogHistory.js";
|
|
17
|
+
import { DialogNav as j } from "./DialogNav.js";
|
|
18
|
+
import { DialogSectionBase as q } from "./DialogSectionBase.js";
|
|
19
|
+
import { DialogSeenBy as z } from "./DialogSeenBy.js";
|
|
20
|
+
import { DialogSelect as J } from "./DialogSelect.js";
|
|
21
|
+
import { DialogStatus as O, DialogStatusEnum as P } from "./DialogStatus.js";
|
|
22
|
+
import { DialogTitle as R } from "./DialogTitle.js";
|
|
23
|
+
import { DialogTouchedBy as V } from "./DialogTouchedBy.js";
|
|
24
|
+
import { DialogLabel as X } from "./DialogLabel.js";
|
|
25
25
|
export {
|
|
26
26
|
e as Dialog,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
f as DialogActions,
|
|
28
|
+
x as DialogActivityLog,
|
|
29
|
+
B as DialogArticleBase,
|
|
30
|
+
n as DialogBase,
|
|
31
|
+
y as DialogBodyBase,
|
|
32
|
+
u as DialogBorder,
|
|
33
|
+
L as DialogContent,
|
|
34
|
+
v as DialogFooter,
|
|
35
|
+
b as DialogHeader,
|
|
36
|
+
C as DialogHeaderBase,
|
|
37
|
+
F as DialogHeadings,
|
|
38
|
+
M as DialogHistory,
|
|
39
|
+
X as DialogLabel,
|
|
39
40
|
a as DialogList,
|
|
40
41
|
m as DialogListItem,
|
|
41
|
-
f as DialogListItemBase,
|
|
42
42
|
l as DialogMetadata,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
j as DialogNav,
|
|
44
|
+
q as DialogSectionBase,
|
|
45
|
+
z as DialogSeenBy,
|
|
46
|
+
J as DialogSelect,
|
|
47
|
+
O as DialogStatus,
|
|
48
|
+
P as DialogStatusEnum,
|
|
49
|
+
R as DialogTitle,
|
|
50
|
+
V as DialogTouchedBy
|
|
51
51
|
};
|
|
@@ -2,10 +2,9 @@ import { jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import { createElement as s } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
|
-
import "../RootProvider/RootProvider.js";
|
|
6
5
|
import { ListItem as n } from "./ListItem.js";
|
|
7
6
|
import { ListBase as f } from "./ListBase.js";
|
|
8
|
-
const
|
|
7
|
+
const x = ({ theme: r, size: t = "md", spacing: m = "md", items: e = [] }) => /* @__PURE__ */ p(f, { theme: r, spacing: m, children: e.map((o, i) => /* @__PURE__ */ s(n, { ...o, size: t, key: "item" + i })) });
|
|
9
8
|
export {
|
|
10
|
-
|
|
9
|
+
x as List
|
|
11
10
|
};
|
|
@@ -1,37 +1,20 @@
|
|
|
1
|
-
import { ElementType, ReactNode } from 'react';
|
|
2
1
|
import { AvatarGroupProps, AvatarProps } from '../Avatar';
|
|
3
2
|
import { BadgeProps } from '../Badge';
|
|
4
3
|
import { ContextMenuProps } from '../ContextMenu';
|
|
5
4
|
import { IconName } from '../Icon';
|
|
6
|
-
import {
|
|
7
|
-
export interface ListItemProps {
|
|
5
|
+
import { ListItemBaseProps } from './ListItemBase';
|
|
6
|
+
export interface ListItemProps extends ListItemBaseProps {
|
|
8
7
|
id: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
as?: ElementType;
|
|
12
|
-
color?: ListItemColor;
|
|
13
|
-
href?: string;
|
|
14
|
-
onClick?(): void;
|
|
15
|
-
/** Item is active */
|
|
16
|
-
active?: boolean;
|
|
17
|
-
/** Item should be hidden from view */
|
|
18
|
-
hidden?: boolean;
|
|
8
|
+
/** Element is loading, display a placeholder */
|
|
9
|
+
loading?: boolean;
|
|
19
10
|
/** Collapsible item, sets linkIcon to "chevron down" */
|
|
20
11
|
collapsible?: boolean;
|
|
21
12
|
/** Item is expanded, sets linkIcon to "chevron up" */
|
|
22
13
|
expanded?: boolean;
|
|
23
|
-
/** Item is selected */
|
|
24
|
-
selected?: boolean;
|
|
25
|
-
/** Item is disabled, should disable mouse events */
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** Size of list item */
|
|
28
|
-
size?: ListItemSize;
|
|
29
14
|
/** Title */
|
|
30
15
|
title?: string;
|
|
31
16
|
/** Optional description */
|
|
32
17
|
description?: string;
|
|
33
|
-
/** Use children to create a custom label, overriding title and description */
|
|
34
|
-
children?: ReactNode;
|
|
35
18
|
/** List item icon */
|
|
36
19
|
icon?: IconName;
|
|
37
20
|
/** List item avatar */
|
|
@@ -46,10 +29,7 @@ export interface ListItemProps {
|
|
|
46
29
|
badge?: BadgeProps;
|
|
47
30
|
/** Optional context menu */
|
|
48
31
|
menu?: ContextMenuProps;
|
|
49
|
-
/** Custom action overrides linkText, linkIcon, badge and menu */
|
|
50
|
-
action?: ReactNode;
|
|
51
32
|
/** Child items */
|
|
52
33
|
items?: ListItemProps[];
|
|
53
|
-
className?: string;
|
|
54
34
|
}
|
|
55
|
-
export declare const ListItem: ({ as, color, selected, disabled, size, icon, avatar, avatarGroup, title, description, children, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const ListItem: ({ as, color, loading, selected, disabled, size, icon, avatar, avatarGroup, title, description, children, collapsible, expanded, badge, linkText, linkIcon, menu, action, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ListItemAction as j } from "./ListItemAction.js";
|
|
3
|
+
import { ListItemBase as v } from "./ListItemBase.js";
|
|
4
|
+
import { ListItemFooter as x } from "./ListItemFooter.js";
|
|
5
|
+
import { ListItemHeader as g } from "./ListItemHeader.js";
|
|
6
|
+
import { ListItemLabel as u } from "./ListItemLabel.js";
|
|
7
|
+
import { ListItemMedia as w } from "./ListItemMedia.js";
|
|
8
|
+
const J = ({
|
|
9
|
+
as: s = "a",
|
|
10
|
+
color: r,
|
|
11
|
+
loading: A,
|
|
12
|
+
selected: B,
|
|
13
|
+
disabled: F,
|
|
10
14
|
size: t = "sm",
|
|
11
|
-
icon:
|
|
12
|
-
avatar:
|
|
13
|
-
avatarGroup:
|
|
14
|
-
title:
|
|
15
|
-
description:
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
icon: p,
|
|
16
|
+
avatar: I,
|
|
17
|
+
avatarGroup: L,
|
|
18
|
+
title: a,
|
|
19
|
+
description: d,
|
|
20
|
+
children: l,
|
|
21
|
+
collapsible: i,
|
|
22
|
+
expanded: m,
|
|
23
|
+
badge: f,
|
|
24
|
+
linkText: h,
|
|
25
|
+
linkIcon: b,
|
|
26
|
+
menu: e,
|
|
27
|
+
action: n,
|
|
28
|
+
...k
|
|
29
|
+
}) => /* @__PURE__ */ c(
|
|
30
|
+
v,
|
|
31
|
+
{
|
|
32
|
+
as: s,
|
|
33
|
+
size: t,
|
|
34
|
+
color: r,
|
|
35
|
+
expanded: m,
|
|
36
|
+
action: n || e && /* @__PURE__ */ o(j, { menu: e, children: n }),
|
|
37
|
+
...k,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ c(g, { size: t, children: [
|
|
40
|
+
/* @__PURE__ */ o(w, { color: r, size: t, icon: p, avatar: I, avatarGroup: L }),
|
|
41
|
+
/* @__PURE__ */ o(u, { title: a, description: d, size: t, children: l })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ o(x, { linkIcon: i && m ? "chevron-up" : i ? "chevron-down" : b, linkText: h, badge: f })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
22
47
|
export {
|
|
23
|
-
|
|
48
|
+
J as ListItem
|
|
24
49
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment as p, useState as g } from "react";
|
|
3
|
-
import { MetaItem as i } from "../Meta/MetaItem.js";
|
|
4
3
|
import "../../index-L8X2o7IH.js";
|
|
5
4
|
import "../Icon/SvgIcon.js";
|
|
5
|
+
import { Button as k } from "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import { MetaItem as r } from "../Meta/MetaItem.js";
|
|
7
8
|
import { ListItem as t } from "./ListItem.js";
|
|
8
|
-
import { ListBase as
|
|
9
|
-
import { List as
|
|
10
|
-
const
|
|
9
|
+
import { ListBase as c } from "./ListBase.js";
|
|
10
|
+
import { List as y } from "./List.js";
|
|
11
|
+
const s = ["lg", "md", "sm", "xs"], T = {
|
|
11
12
|
title: "List/ListItem",
|
|
12
13
|
component: t,
|
|
13
14
|
tags: ["autodocs"],
|
|
@@ -18,13 +19,13 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
18
19
|
description: "Description",
|
|
19
20
|
size: "md"
|
|
20
21
|
}
|
|
21
|
-
},
|
|
22
|
+
}, B = {
|
|
22
23
|
args: {}
|
|
23
|
-
},
|
|
24
|
+
}, E = (n) => /* @__PURE__ */ a(c, { children: [
|
|
24
25
|
/* @__PURE__ */ e(t, { ...n }),
|
|
25
|
-
/* @__PURE__ */ e(
|
|
26
|
+
/* @__PURE__ */ e(r, { children: "No media" }),
|
|
26
27
|
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear" }),
|
|
27
|
-
/* @__PURE__ */ e(
|
|
28
|
+
/* @__PURE__ */ e(r, { children: "Icon" }),
|
|
28
29
|
/* @__PURE__ */ e(
|
|
29
30
|
t,
|
|
30
31
|
{
|
|
@@ -35,7 +36,7 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
),
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
+
/* @__PURE__ */ e(r, { children: "Person" }),
|
|
39
40
|
/* @__PURE__ */ e(
|
|
40
41
|
t,
|
|
41
42
|
{
|
|
@@ -46,7 +47,7 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
),
|
|
49
|
-
/* @__PURE__ */ e(
|
|
50
|
+
/* @__PURE__ */ e(r, { children: "Company" }),
|
|
50
51
|
/* @__PURE__ */ e(
|
|
51
52
|
t,
|
|
52
53
|
{
|
|
@@ -58,7 +59,7 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
+
/* @__PURE__ */ e(r, { children: "Logo" }),
|
|
62
63
|
/* @__PURE__ */ e(
|
|
63
64
|
t,
|
|
64
65
|
{
|
|
@@ -81,7 +82,7 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
),
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
+
/* @__PURE__ */ e(r, { children: "People group" }),
|
|
85
86
|
/* @__PURE__ */ e(
|
|
86
87
|
t,
|
|
87
88
|
{
|
|
@@ -104,20 +105,21 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
),
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
] }),
|
|
108
|
+
/* @__PURE__ */ e(r, { children: "Company group" })
|
|
109
|
+
] }), H = (n) => /* @__PURE__ */ a(c, { children: [
|
|
109
110
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right" }),
|
|
110
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(r, { children: "Link icon, emphasising that this will take you somewhere" }),
|
|
111
112
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right", linkText: "Åpne" }),
|
|
112
|
-
/* @__PURE__ */ e(
|
|
113
|
+
/* @__PURE__ */ e(r, { children: "Link icon + link text, emphasising that this will take you somewhere" }),
|
|
113
114
|
/* @__PURE__ */ e(t, { ...n, collapsible: !0, badge: { label: "Admin" } }),
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
+
/* @__PURE__ */ e(r, { children: "Collapsible item with badge" }),
|
|
115
116
|
/* @__PURE__ */ e(t, { ...n, collapsible: !0, expanded: !0 }),
|
|
116
|
-
/* @__PURE__ */ e(
|
|
117
|
+
/* @__PURE__ */ e(r, { children: "Collapsible and expanded item" }),
|
|
117
118
|
/* @__PURE__ */ e(
|
|
118
119
|
t,
|
|
119
120
|
{
|
|
120
121
|
...n,
|
|
122
|
+
badge: { label: "Admin" },
|
|
121
123
|
linkIcon: "chevron-right",
|
|
122
124
|
menu: {
|
|
123
125
|
items: [
|
|
@@ -127,18 +129,26 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
),
|
|
130
|
-
/* @__PURE__ */ e(
|
|
131
|
-
|
|
132
|
+
/* @__PURE__ */ e(r, { children: "List item with context menu and linkIcon" }),
|
|
133
|
+
/* @__PURE__ */ e(
|
|
134
|
+
t,
|
|
135
|
+
{
|
|
136
|
+
...n,
|
|
137
|
+
action: /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", margin: "0.625rem" }, children: /* @__PURE__ */ e(k, { icon: "pencil", reverse: !0, size: "sm", variant: "outline", children: "Rediger" }) })
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ e(r, { children: "List item with custom action" })
|
|
141
|
+
] }), M = (n) => /* @__PURE__ */ a(c, { children: [
|
|
132
142
|
/* @__PURE__ */ e(t, { ...n }),
|
|
133
|
-
/* @__PURE__ */ e(
|
|
143
|
+
/* @__PURE__ */ e(r, { children: "Default" }),
|
|
134
144
|
/* @__PURE__ */ e(t, { ...n, color: "accent" }),
|
|
135
|
-
/* @__PURE__ */ e(
|
|
136
|
-
] }),
|
|
137
|
-
/* @__PURE__ */ e(t, { ...n, size: o, selected: o === (n == null ? void 0 : n.size) }),
|
|
138
|
-
/* @__PURE__ */ e(
|
|
139
|
-
] }, o)) }),
|
|
145
|
+
/* @__PURE__ */ e(r, { children: "Accent" })
|
|
146
|
+
] }), P = (n) => /* @__PURE__ */ e(c, { children: s == null ? void 0 : s.map((o) => /* @__PURE__ */ a(p, { children: [
|
|
147
|
+
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: o, selected: o === (n == null ? void 0 : n.size), linkIcon: "chevron-right" }),
|
|
148
|
+
/* @__PURE__ */ e(r, { children: o })
|
|
149
|
+
] }, o)) }), _ = (n) => {
|
|
140
150
|
const [o, d] = g(!1), m = () => {
|
|
141
|
-
d((
|
|
151
|
+
d((i) => !i);
|
|
142
152
|
}, l = [
|
|
143
153
|
{
|
|
144
154
|
name: "Per Ove Ludvigsen",
|
|
@@ -160,18 +170,18 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
160
170
|
role: "Toppspillerutvikler",
|
|
161
171
|
rights: "Ingen rettigheter"
|
|
162
172
|
}
|
|
163
|
-
], h = l == null ? void 0 : l.map((
|
|
173
|
+
], h = l == null ? void 0 : l.map((i) => ({
|
|
164
174
|
avatar: {
|
|
165
|
-
...
|
|
175
|
+
...i,
|
|
166
176
|
type: "person"
|
|
167
177
|
},
|
|
168
|
-
title:
|
|
169
|
-
description:
|
|
170
|
-
badge: { label:
|
|
178
|
+
title: i == null ? void 0 : i.name,
|
|
179
|
+
description: i == null ? void 0 : i.role,
|
|
180
|
+
badge: { label: i == null ? void 0 : i.rights },
|
|
171
181
|
linkIcon: "menu-elipsis-horizontal"
|
|
172
182
|
})), u = {
|
|
173
|
-
items: l == null ? void 0 : l.map((
|
|
174
|
-
name:
|
|
183
|
+
items: l == null ? void 0 : l.map((i) => ({
|
|
184
|
+
name: i == null ? void 0 : i.name,
|
|
175
185
|
type: "person"
|
|
176
186
|
}))
|
|
177
187
|
};
|
|
@@ -187,15 +197,15 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
187
197
|
as: "button"
|
|
188
198
|
}
|
|
189
199
|
),
|
|
190
|
-
o && /* @__PURE__ */ e(
|
|
200
|
+
o && /* @__PURE__ */ e(y, { size: "sm", spacing: "none", items: h })
|
|
191
201
|
] });
|
|
192
202
|
};
|
|
193
203
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
204
|
+
H as ActionProps,
|
|
205
|
+
_ as Collapsible,
|
|
206
|
+
M as Colors,
|
|
207
|
+
B as Default,
|
|
208
|
+
E as MediaTypes,
|
|
209
|
+
P as Sizes,
|
|
210
|
+
T as default
|
|
201
211
|
};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BadgeProps } from '../Badge';
|
|
3
2
|
import { ContextMenuProps } from '../ContextMenu';
|
|
4
|
-
|
|
5
|
-
interface ListItemActionProps {
|
|
6
|
-
badge?: BadgeProps;
|
|
3
|
+
interface ListItemLinkProps {
|
|
7
4
|
menu?: ContextMenuProps;
|
|
8
|
-
linkText?: string;
|
|
9
|
-
linkIcon?: IconName;
|
|
10
5
|
children?: ReactNode;
|
|
11
6
|
}
|
|
12
|
-
export declare const ListItemAction: ({
|
|
7
|
+
export declare const ListItemAction: ({ menu, children }: ListItemLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
8
|
export {};
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../../index-L8X2o7IH.js";
|
|
7
|
-
import '../../assets/ListItemAction.css';const p = "_action_1lv65_3", x = "_linkText_1lv65_10", k = "_linkIcon_1lv65_15", t = {
|
|
8
|
-
action: p,
|
|
9
|
-
linkText: x,
|
|
10
|
-
linkIcon: k
|
|
11
|
-
}, h = ({ linkText: o, linkIcon: i, menu: c, badge: s, children: r }) => /* @__PURE__ */ n("div", { className: t.action, children: r || /* @__PURE__ */ e(l, { children: [
|
|
12
|
-
s && /* @__PURE__ */ n(m, { ...s }),
|
|
13
|
-
c && /* @__PURE__ */ n(a, { ...c }),
|
|
14
|
-
o && /* @__PURE__ */ n("span", { className: t.linkText, children: o }),
|
|
15
|
-
i && /* @__PURE__ */ n(_, { name: i, className: t.linkIcon })
|
|
16
|
-
] }) });
|
|
1
|
+
import { jsx as t, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { ContextMenu as i } from "../ContextMenu/ContextMenu.js";
|
|
3
|
+
import '../../assets/ListItemAction.css';const r = "_action_mbqkv_3", s = {
|
|
4
|
+
action: r
|
|
5
|
+
}, m = ({ menu: o, children: n }) => /* @__PURE__ */ t("div", { className: s.action, children: n || /* @__PURE__ */ t(c, { children: o && /* @__PURE__ */ t(i, { ...o }) }) });
|
|
17
6
|
export {
|
|
18
|
-
|
|
7
|
+
m as ListItemAction
|
|
19
8
|
};
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
|
-
import { BadgeProps } from '../Badge';
|
|
3
|
-
import { ContextMenuProps } from '../ContextMenu';
|
|
4
|
-
import { IconName } from '../Icon';
|
|
5
2
|
export type ListItemColor = 'default' | 'accent';
|
|
6
3
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
-
|
|
4
|
+
export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
export interface ListItemBaseProps {
|
|
8
6
|
as?: ElementType;
|
|
9
7
|
size?: ListItemSize;
|
|
10
|
-
|
|
11
|
-
linkText?: string;
|
|
12
|
-
linkIcon?: IconName;
|
|
8
|
+
shadow?: ListItemShadow;
|
|
13
9
|
color?: ListItemColor;
|
|
14
|
-
badge?: BadgeProps;
|
|
15
10
|
href?: string;
|
|
16
11
|
className?: string;
|
|
17
12
|
active?: boolean;
|
|
18
13
|
hidden?: boolean;
|
|
19
14
|
collapsible?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
20
16
|
selected?: boolean;
|
|
21
17
|
expanded?: boolean;
|
|
22
18
|
onClick?: () => void;
|
|
@@ -25,5 +21,4 @@ interface ListItemBaseProps {
|
|
|
25
21
|
children?: ReactNode;
|
|
26
22
|
style?: React.CSSProperties;
|
|
27
23
|
}
|
|
28
|
-
export declare const ListItemBase: ({ as, children, className, href, size, color, active, hidden,
|
|
29
|
-
export {};
|
|
24
|
+
export declare const ListItemBase: ({ as, children, className, href, size, color, active, hidden, shadow, disabled, selected, expanded, action, onClick, onKeyPress, style, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,58 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
action: B,
|
|
8
|
-
linkText: E,
|
|
9
|
-
linkIcon: g
|
|
10
|
-
}, G = ({
|
|
1
|
+
import { jsxs as I, jsx as N } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/ListItemBase.css';const v = "_item_jxdl8_1", w = "_link_jxdl8_69", r = {
|
|
4
|
+
item: v,
|
|
5
|
+
link: w
|
|
6
|
+
}, E = ({
|
|
11
7
|
as: m,
|
|
12
|
-
children:
|
|
13
|
-
className:
|
|
14
|
-
href:
|
|
15
|
-
size:
|
|
16
|
-
color:
|
|
17
|
-
active:
|
|
18
|
-
hidden:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
onClick: t,
|
|
28
|
-
onKeyPress: n,
|
|
29
|
-
style: L
|
|
8
|
+
children: l,
|
|
9
|
+
className: c,
|
|
10
|
+
href: n,
|
|
11
|
+
size: e,
|
|
12
|
+
color: x,
|
|
13
|
+
active: o = !1,
|
|
14
|
+
hidden: _ = !1,
|
|
15
|
+
shadow: p = "xs",
|
|
16
|
+
disabled: f,
|
|
17
|
+
selected: j,
|
|
18
|
+
expanded: d,
|
|
19
|
+
action: h,
|
|
20
|
+
onClick: a,
|
|
21
|
+
onKeyPress: t,
|
|
22
|
+
style: i
|
|
30
23
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
24
|
+
const b = m || "a";
|
|
25
|
+
return /* @__PURE__ */ I(
|
|
26
|
+
"article",
|
|
34
27
|
{
|
|
35
|
-
className:
|
|
36
|
-
"data-color":
|
|
37
|
-
"data-size":
|
|
38
|
-
"data-
|
|
39
|
-
"
|
|
40
|
-
"aria-
|
|
41
|
-
"aria-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
onClick: t,
|
|
47
|
-
tabIndex: -1,
|
|
48
|
-
style: L,
|
|
28
|
+
className: r.item,
|
|
29
|
+
"data-color": x,
|
|
30
|
+
"data-size": e,
|
|
31
|
+
"data-shadow": p,
|
|
32
|
+
"data-active": o,
|
|
33
|
+
"aria-hidden": _,
|
|
34
|
+
"aria-disabled": f,
|
|
35
|
+
"aria-selected": j,
|
|
36
|
+
"aria-expanded": d,
|
|
37
|
+
style: i,
|
|
49
38
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
39
|
+
/* @__PURE__ */ N(
|
|
40
|
+
b,
|
|
41
|
+
{
|
|
42
|
+
className: u(r.link, c),
|
|
43
|
+
"data-size": e,
|
|
44
|
+
"aria-expanded": d,
|
|
45
|
+
style: i,
|
|
46
|
+
href: n,
|
|
47
|
+
onKeyPress: (s) => {
|
|
48
|
+
s.key === "Enter" && (a == null || a()), t == null || t(s);
|
|
49
|
+
},
|
|
50
|
+
onClick: a,
|
|
51
|
+
tabIndex: -1,
|
|
52
|
+
children: l
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
h
|
|
52
56
|
]
|
|
53
57
|
}
|
|
54
58
|
);
|
|
55
59
|
};
|
|
56
60
|
export {
|
|
57
|
-
|
|
61
|
+
E as ListItemBase
|
|
58
62
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BadgeProps } from '../Badge';
|
|
3
|
+
import { IconName } from '../Icon';
|
|
4
|
+
interface ListItemFooterProps {
|
|
5
|
+
badge?: BadgeProps;
|
|
6
|
+
linkText?: string;
|
|
7
|
+
linkIcon?: IconName;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const ListItemFooter: ({ badge, linkText, linkIcon, children }: ListItemFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as o, jsxs as c, Fragment as i } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as m } from "../Badge/Badge.js";
|
|
3
|
+
import { Icon as l } from "../Icon/Icon.js";
|
|
4
|
+
import "../Icon/SvgIcon.js";
|
|
5
|
+
import "../../index-L8X2o7IH.js";
|
|
6
|
+
import '../../assets/ListItemFooter.css';const a = "_footer_r3tc7_1", _ = "_linkText_r3tc7_8", f = "_linkIcon_r3tc7_13", t = {
|
|
7
|
+
footer: a,
|
|
8
|
+
linkText: _,
|
|
9
|
+
linkIcon: f
|
|
10
|
+
}, T = ({ badge: r, linkText: n, linkIcon: e, children: s }) => /* @__PURE__ */ o("footer", { className: t.footer, children: s || /* @__PURE__ */ c(i, { children: [
|
|
11
|
+
r && /* @__PURE__ */ o(m, { ...r }),
|
|
12
|
+
n && /* @__PURE__ */ o("span", { className: t.linkText, children: n }),
|
|
13
|
+
e && /* @__PURE__ */ o(l, { name: e, className: t.linkIcon })
|
|
14
|
+
] }) });
|
|
15
|
+
export {
|
|
16
|
+
T as ListItemFooter
|
|
17
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ListItemSize } from './ListItemBase';
|
|
3
|
+
export interface ListItemHeaderProps {
|
|
4
|
+
size?: ListItemSize;
|
|
5
|
+
className?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const ListItemHeader: ({ size, className, children }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
|