@altinn/altinn-components 0.6.12 → 0.7.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/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/ListItemBase.css +1 -1
- package/dist/assets/ListItemControls.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/ListItemSelect.css +1 -0
- 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/ContextMenu/ContextMenu.d.ts +2 -1
- package/dist/components/ContextMenu/ContextMenu.js +19 -8
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +2 -1
- package/dist/components/ContextMenu/ContextMenuBase.js +19 -18
- 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/ListItem.d.ts +5 -25
- package/dist/components/List/ListItem.js +41 -20
- package/dist/components/List/ListItem.stories.js +79 -45
- package/dist/components/List/ListItemBase.d.ts +8 -10
- package/dist/components/List/ListItemBase.js +52 -46
- package/dist/components/List/{ListItemAction.d.ts → ListItemControls.d.ts} +3 -3
- package/dist/components/List/ListItemControls.js +19 -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/ListItemSelect.d.ts +12 -0
- package/dist/components/List/ListItemSelect.js +15 -0
- package/dist/components/List/index.d.ts +5 -3
- package/dist/components/List/index.js +16 -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 +12 -0
- package/dist/components/Toolbar/ToolbarButton.js +2 -1
- package/dist/components/index.js +153 -149
- package/dist/hooks/useMenu.js +19 -19
- package/dist/index.js +163 -159
- package/package.json +1 -1
- package/dist/assets/DialogListItemBase.css +0 -1
- package/dist/assets/ListItemAction.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.js +0 -19
- 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
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */ s("
|
|
9
|
-
t && /* @__PURE__ */ s(m, { name: t, className: a.icon })
|
|
1
|
+
import { jsxs as o, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { DialogLabel as d } from "./DialogLabel.js";
|
|
3
|
+
import '../../assets/DialogTitle.css';const r = "_heading_1fk12_1", c = "_title_1fk12_7", i = {
|
|
4
|
+
heading: r,
|
|
5
|
+
title: c
|
|
6
|
+
}, g = ({ size: a = "sm", seen: l = !1, variant: e, label: t, children: n }) => /* @__PURE__ */ o("div", { className: i.heading, children: [
|
|
7
|
+
/* @__PURE__ */ s("h2", { className: i.title, "data-seen": l, "data-size": a, "data-variant": e, children: n }),
|
|
8
|
+
t && /* @__PURE__ */ s(d, { variant: e, size: "xs", children: t })
|
|
10
9
|
] });
|
|
11
10
|
export {
|
|
12
|
-
|
|
11
|
+
g as DialogTitle
|
|
13
12
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { withThemeByDataAttribute as m } from "@storybook/addon-themes";
|
|
3
|
+
import "../../index-L8X2o7IH.js";
|
|
4
|
+
import "../Icon/SvgIcon.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import { MetaItem as s } from "../Meta/MetaItem.js";
|
|
8
|
+
import { DialogListItem as o } from "./DialogListItem.js";
|
|
9
|
+
import { ListBase as a } from "../List/ListBase.js";
|
|
10
|
+
const y = {
|
|
11
|
+
title: "Dialog/Examples",
|
|
12
|
+
component: o,
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
decorators: [
|
|
15
|
+
m({
|
|
16
|
+
themes: {
|
|
17
|
+
company: "company",
|
|
18
|
+
person: "person"
|
|
19
|
+
},
|
|
20
|
+
defaultTheme: "company"
|
|
21
|
+
})
|
|
22
|
+
],
|
|
23
|
+
argTypes: {}
|
|
24
|
+
}, g = (e) => /* @__PURE__ */ r(a, { children: [
|
|
25
|
+
/* @__PURE__ */ t(o, { ...e, status }),
|
|
26
|
+
/* @__PURE__ */ t(s, { children: status == null ? void 0 : status.value })
|
|
27
|
+
] });
|
|
28
|
+
export {
|
|
29
|
+
g as RequiresAttention,
|
|
30
|
+
y as default
|
|
31
|
+
};
|
|
@@ -2,7 +2,6 @@ export * from './Dialog';
|
|
|
2
2
|
export * from './DialogList';
|
|
3
3
|
export * from './DialogMetadata';
|
|
4
4
|
export * from './DialogListItem';
|
|
5
|
-
export * from './DialogListItemBase';
|
|
6
5
|
export * from './DialogActions.tsx';
|
|
7
6
|
export * from './DialogActivityLog';
|
|
8
7
|
export * from './DialogArticleBase';
|
|
@@ -22,3 +21,4 @@ export * from './DialogSelect';
|
|
|
22
21
|
export * from './DialogStatus';
|
|
23
22
|
export * from './DialogTitle';
|
|
24
23
|
export * from './DialogTouchedBy';
|
|
24
|
+
export * from './DialogLabel';
|
|
@@ -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
|
};
|
|
@@ -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,
|
|
35
|
+
export declare const ListItem: ({ as, color, loading, size, icon, avatar, avatarGroup, title, description, children, collapsible, expanded, badge, linkText, linkIcon, menu, select, controls, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ListItemBase as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as o, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { ListItemBase as u } from "./ListItemBase.js";
|
|
3
|
+
import { ListItemControls as v } from "./ListItemControls.js";
|
|
4
|
+
import { ListItemHeader as x } from "./ListItemHeader.js";
|
|
5
|
+
import { ListItemLabel as g } from "./ListItemLabel.js";
|
|
6
|
+
import { ListItemMedia as w } from "./ListItemMedia.js";
|
|
7
|
+
const E = ({
|
|
8
|
+
as: n = "a",
|
|
9
|
+
color: r,
|
|
10
|
+
loading: B,
|
|
10
11
|
size: t = "sm",
|
|
11
|
-
icon:
|
|
12
|
-
avatar:
|
|
13
|
-
avatarGroup:
|
|
12
|
+
icon: e,
|
|
13
|
+
avatar: s,
|
|
14
|
+
avatarGroup: c,
|
|
14
15
|
title: p,
|
|
15
|
-
description:
|
|
16
|
-
children:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
description: I,
|
|
17
|
+
children: L,
|
|
18
|
+
collapsible: m,
|
|
19
|
+
expanded: i,
|
|
20
|
+
badge: a,
|
|
21
|
+
linkText: l,
|
|
22
|
+
linkIcon: f,
|
|
23
|
+
menu: d,
|
|
24
|
+
select: h,
|
|
25
|
+
controls: k,
|
|
26
|
+
...b
|
|
27
|
+
}) => /* @__PURE__ */ o(
|
|
28
|
+
u,
|
|
29
|
+
{
|
|
30
|
+
as: n,
|
|
31
|
+
size: t,
|
|
32
|
+
color: r,
|
|
33
|
+
expanded: i,
|
|
34
|
+
select: h,
|
|
35
|
+
controls: k || /* @__PURE__ */ o(v, { linkIcon: m && i ? "chevron-up" : m ? "chevron-down" : f, linkText: l, menu: d, badge: a }),
|
|
36
|
+
...b,
|
|
37
|
+
children: /* @__PURE__ */ j(x, { size: t, children: [
|
|
38
|
+
/* @__PURE__ */ o(w, { color: r, size: t, icon: e, avatar: s, avatarGroup: c }),
|
|
39
|
+
/* @__PURE__ */ o(g, { title: p, description: I, size: t, children: L })
|
|
40
|
+
] })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
22
43
|
export {
|
|
23
|
-
|
|
44
|
+
E as ListItem
|
|
24
45
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { MetaItem as i } from "../Meta/MetaItem.js";
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as d, useState as g } from "react";
|
|
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
9
|
import { ListBase as s } from "./ListBase.js";
|
|
9
|
-
import { List as
|
|
10
|
-
const
|
|
10
|
+
import { List as b } from "./List.js";
|
|
11
|
+
const a = ["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__ */ c(s, { 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__ */ c(s, { 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,49 @@ 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 badge, linkIcon and context menu" }),
|
|
133
|
+
/* @__PURE__ */ e(
|
|
134
|
+
t,
|
|
135
|
+
{
|
|
136
|
+
...n,
|
|
137
|
+
controls: /* @__PURE__ */ e("div", { style: { position: "absolute", right: 0, display: "flex", alignItems: "center", margin: "0.625rem" }, children: /* @__PURE__ */ e(k, { icon: "pencil", size: "sm", variant: "outline", children: "Rediger" }) })
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ e(r, { children: "List item with custom controls" })
|
|
141
|
+
] }), M = (n) => /* @__PURE__ */ e(s, { children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ c(d, { children: [
|
|
142
|
+
/* @__PURE__ */ e(
|
|
143
|
+
t,
|
|
144
|
+
{
|
|
145
|
+
...n,
|
|
146
|
+
size: o,
|
|
147
|
+
select: {
|
|
148
|
+
checked: !1
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ e(
|
|
153
|
+
t,
|
|
154
|
+
{
|
|
155
|
+
...n,
|
|
156
|
+
size: o,
|
|
157
|
+
select: {
|
|
158
|
+
checked: !0
|
|
159
|
+
},
|
|
160
|
+
selected: !0
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ e(r, { children: o })
|
|
164
|
+
] }, o)) }), S = (n) => /* @__PURE__ */ c(s, { children: [
|
|
132
165
|
/* @__PURE__ */ e(t, { ...n }),
|
|
133
|
-
/* @__PURE__ */ e(
|
|
166
|
+
/* @__PURE__ */ e(r, { children: "Default" }),
|
|
134
167
|
/* @__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)) }),
|
|
140
|
-
const [o,
|
|
141
|
-
|
|
168
|
+
/* @__PURE__ */ e(r, { children: "Accent" })
|
|
169
|
+
] }), _ = (n) => /* @__PURE__ */ e(s, { children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ c(d, { children: [
|
|
170
|
+
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: o, selected: o === (n == null ? void 0 : n.size), linkIcon: "chevron-right" }),
|
|
171
|
+
/* @__PURE__ */ e(r, { children: o })
|
|
172
|
+
] }, o)) }), j = (n) => {
|
|
173
|
+
const [o, p] = g(!1), m = () => {
|
|
174
|
+
p((i) => !i);
|
|
142
175
|
}, l = [
|
|
143
176
|
{
|
|
144
177
|
name: "Per Ove Ludvigsen",
|
|
@@ -160,22 +193,22 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
160
193
|
role: "Toppspillerutvikler",
|
|
161
194
|
rights: "Ingen rettigheter"
|
|
162
195
|
}
|
|
163
|
-
], h = l == null ? void 0 : l.map((
|
|
196
|
+
], h = l == null ? void 0 : l.map((i) => ({
|
|
164
197
|
avatar: {
|
|
165
|
-
...
|
|
198
|
+
...i,
|
|
166
199
|
type: "person"
|
|
167
200
|
},
|
|
168
|
-
title:
|
|
169
|
-
description:
|
|
170
|
-
badge: { label:
|
|
201
|
+
title: i == null ? void 0 : i.name,
|
|
202
|
+
description: i == null ? void 0 : i.role,
|
|
203
|
+
badge: { label: i == null ? void 0 : i.rights },
|
|
171
204
|
linkIcon: "menu-elipsis-horizontal"
|
|
172
205
|
})), u = {
|
|
173
|
-
items: l == null ? void 0 : l.map((
|
|
174
|
-
name:
|
|
206
|
+
items: l == null ? void 0 : l.map((i) => ({
|
|
207
|
+
name: i == null ? void 0 : i.name,
|
|
175
208
|
type: "person"
|
|
176
209
|
}))
|
|
177
210
|
};
|
|
178
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ c(d, { children: [
|
|
179
212
|
/* @__PURE__ */ e(
|
|
180
213
|
t,
|
|
181
214
|
{
|
|
@@ -187,15 +220,16 @@ const c = ["lg", "md", "sm", "xs"], D = {
|
|
|
187
220
|
as: "button"
|
|
188
221
|
}
|
|
189
222
|
),
|
|
190
|
-
o && /* @__PURE__ */ e(
|
|
223
|
+
o && /* @__PURE__ */ e(b, { size: "sm", spacing: "none", items: h })
|
|
191
224
|
] });
|
|
192
225
|
};
|
|
193
226
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
H as
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
227
|
+
j as Collapsible,
|
|
228
|
+
S as Colors,
|
|
229
|
+
H as Controls,
|
|
230
|
+
B as Default,
|
|
231
|
+
E as MediaTypes,
|
|
232
|
+
M as Selectable,
|
|
233
|
+
_ as Sizes,
|
|
234
|
+
T as default
|
|
201
235
|
};
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ContextMenuProps } from '../ContextMenu';
|
|
4
|
-
import { IconName } from '../Icon';
|
|
2
|
+
import { ListItemSelectProps } from './ListItemSelect';
|
|
5
3
|
export type ListItemColor = 'default' | 'accent';
|
|
6
4
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
-
|
|
5
|
+
export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
export interface ListItemBaseProps {
|
|
8
7
|
as?: ElementType;
|
|
9
8
|
size?: ListItemSize;
|
|
10
|
-
|
|
11
|
-
linkText?: string;
|
|
12
|
-
linkIcon?: IconName;
|
|
9
|
+
shadow?: ListItemShadow;
|
|
13
10
|
color?: ListItemColor;
|
|
14
|
-
badge?: BadgeProps;
|
|
15
11
|
href?: string;
|
|
16
12
|
className?: string;
|
|
17
13
|
active?: boolean;
|
|
18
14
|
hidden?: boolean;
|
|
19
15
|
collapsible?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
select?: ListItemSelectProps;
|
|
20
18
|
selected?: boolean;
|
|
21
19
|
expanded?: boolean;
|
|
22
20
|
onClick?: () => void;
|
|
23
21
|
onKeyPress?: KeyboardEventHandler;
|
|
24
22
|
action?: ReactNode;
|
|
23
|
+
controls?: ReactNode;
|
|
25
24
|
children?: ReactNode;
|
|
26
25
|
style?: React.CSSProperties;
|
|
27
26
|
}
|
|
28
|
-
export declare const ListItemBase: ({ as, children, className, href, size, color, active, hidden,
|
|
29
|
-
export {};
|
|
27
|
+
export declare const ListItemBase: ({ as, children, className, href, size, color, active, hidden, shadow, select, selected, disabled, expanded, controls, onClick, onKeyPress, style, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,58 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as L, jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { c as N } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import {
|
|
4
|
-
import '../../assets/ListItemBase.css';const
|
|
5
|
-
item:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
href: d,
|
|
15
|
-
size: c,
|
|
16
|
-
color: l,
|
|
3
|
+
import { ListItemSelect as v } from "./ListItemSelect.js";
|
|
4
|
+
import '../../assets/ListItemBase.css';const w = "_item_us7f0_1", B = "_link_us7f0_74", r = {
|
|
5
|
+
item: w,
|
|
6
|
+
link: B
|
|
7
|
+
}, k = ({
|
|
8
|
+
as: c,
|
|
9
|
+
children: l,
|
|
10
|
+
className: n,
|
|
11
|
+
href: o,
|
|
12
|
+
size: t,
|
|
13
|
+
color: f,
|
|
17
14
|
active: x = !1,
|
|
18
|
-
hidden:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onKeyPress: n,
|
|
29
|
-
style: L
|
|
15
|
+
hidden: p = !1,
|
|
16
|
+
shadow: _ = "xs",
|
|
17
|
+
select: s,
|
|
18
|
+
selected: h,
|
|
19
|
+
disabled: u,
|
|
20
|
+
expanded: i,
|
|
21
|
+
controls: I,
|
|
22
|
+
onClick: a,
|
|
23
|
+
onKeyPress: e,
|
|
24
|
+
style: b
|
|
30
25
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
26
|
+
const j = c || "a";
|
|
27
|
+
return /* @__PURE__ */ L(
|
|
28
|
+
"article",
|
|
34
29
|
{
|
|
35
|
-
className:
|
|
36
|
-
"data-color":
|
|
37
|
-
"data-size":
|
|
30
|
+
className: r.item,
|
|
31
|
+
"data-color": f,
|
|
32
|
+
"data-size": t,
|
|
33
|
+
"data-shadow": _,
|
|
38
34
|
"data-active": x,
|
|
39
|
-
"aria-hidden":
|
|
40
|
-
"aria-
|
|
41
|
-
"aria-
|
|
42
|
-
|
|
43
|
-
onKeyPress: (o) => {
|
|
44
|
-
o.key === "Enter" && (t == null || t()), n == null || n(o);
|
|
45
|
-
},
|
|
46
|
-
onClick: t,
|
|
47
|
-
tabIndex: -1,
|
|
48
|
-
style: L,
|
|
35
|
+
"aria-hidden": p,
|
|
36
|
+
"aria-disabled": u,
|
|
37
|
+
"aria-selected": h,
|
|
38
|
+
"aria-expanded": i,
|
|
49
39
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
40
|
+
s && /* @__PURE__ */ m(v, { ...s, size: t }),
|
|
41
|
+
/* @__PURE__ */ m(
|
|
42
|
+
j,
|
|
43
|
+
{
|
|
44
|
+
className: N(r.link, n),
|
|
45
|
+
"data-size": t,
|
|
46
|
+
"aria-expanded": i,
|
|
47
|
+
style: b,
|
|
48
|
+
href: o,
|
|
49
|
+
onKeyPress: (d) => {
|
|
50
|
+
d.key === "Enter" && (a == null || a()), e == null || e(d);
|
|
51
|
+
},
|
|
52
|
+
onClick: a,
|
|
53
|
+
tabIndex: -1,
|
|
54
|
+
children: l
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
I
|
|
52
58
|
]
|
|
53
59
|
}
|
|
54
60
|
);
|
|
55
61
|
};
|
|
56
62
|
export {
|
|
57
|
-
|
|
63
|
+
k as ListItemBase
|
|
58
64
|
};
|