@altinn/altinn-components 0.7.0 → 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/ListItemBase.css +1 -1
- package/dist/assets/ListItemControls.css +1 -0
- package/dist/assets/ListItemSelect.css +1 -0
- 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/DialogListItem.js +8 -8
- package/dist/components/List/List.js +3 -2
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/List/ListItem.js +35 -39
- package/dist/components/List/ListItem.stories.js +45 -21
- package/dist/components/List/ListItemBase.d.ts +4 -1
- package/dist/components/List/ListItemBase.js +44 -42
- package/dist/components/List/ListItemControls.d.ts +13 -0
- package/dist/components/List/ListItemControls.js +19 -0
- package/dist/components/List/ListItemSelect.d.ts +12 -0
- package/dist/components/List/ListItemSelect.js +15 -0
- package/dist/components/List/index.d.ts +2 -1
- package/dist/components/List/index.js +14 -12
- package/dist/components/Searchbar/ScopeListItem.js +3 -2
- package/dist/components/index.js +100 -98
- package/dist/index.js +123 -121
- package/package.json +1 -1
- package/dist/assets/ListItemAction.css +0 -1
- package/dist/assets/ListItemFooter.css +0 -1
- package/dist/components/List/ListItemAction.d.ts +0 -8
- package/dist/components/List/ListItemAction.js +0 -8
- package/dist/components/List/ListItemFooter.d.ts +0 -11
- package/dist/components/List/ListItemFooter.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._item_us7f0_1{position:relative;width:100%;display:flex;align-items:center;justify-content:stretch}._item_us7f0_1[aria-selected=true]{background-color:var(--theme-background-subtle);outline:2px solid}._item_us7f0_1[data-shadow=xs]{box-shadow:var(--ds-shadow-xs)}._item_us7f0_1[data-size=xs]{min-height:36px}._item_us7f0_1[data-size=sm]{min-height:44px}._item_us7f0_1[data-size=md]{min-height:56px}._item_us7f0_1[data-size=lg]{min-height:64px}._item_us7f0_1[data-size=xl]{min-height:72px}._item_us7f0_1{background-color:var(--theme-background-default)}._item_us7f0_1:hover{outline:2px solid var(--theme-border-strong);z-index:2}._item_us7f0_1:hover strong,._item_us7f0_1:hover h2{text-decoration:underline}._item_us7f0_1[data-active=true],._item_us7f0_1[data-color=accent]{background-color:var(--theme-surface-default)}._item_us7f0_1[data-color=accent]:hover{background-color:var(--theme-surface-hover)}._link_us7f0_74{align-self:stretch;padding:0;border:0;background-color:transparent;color:inherit;font:inherit;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer}._link_us7f0_74{flex-grow:1;display:flex;align-items:center}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._controls_dduzt_1{position:absolute;right:0;display:flex;align-items:center;gap:.625rem;padding:0 .625rem}._controls_dduzt_1:empty{display:none}._linkText_dduzt_14{font-size:.875rem;white-space:nowrap}._linkIcon_dduzt_19{font-size:1.5rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._label_hd89l_1{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;background-color:transparent;padding:.75rem;border-radius:50%;border:0}._label_hd89l_1[data-size=lg],._label_hd89l_1[data-size=md]{font-size:1.25rem;margin-left:.375rem;margin-right:-.25rem}._label_hd89l_1[data-size=sm],._label_hd89l_1[data-size=xs]{font-size:1rem;padding:.625rem;margin-left:.325rem;margin-right:-.5rem}._label_hd89l_1[data-size=xs]{font-size:1rem;padding:.5rem;margin-left:.25rem;margin-right:-.5rem}._label_hd89l_1:hover{background-color:var(--theme-surface-default)}._input_hd89l_38{position:absolute;opacity:0}._icon_hd89l_43{color:var(--theme-base-default)}._icon_hd89l_43 [data-hover=true]{opacity:0}._label_hd89l_1:hover [data-hover=true]{opacity:1}
|
|
@@ -6,5 +6,6 @@ export interface ContextMenuProps {
|
|
|
6
6
|
placement?: DropdownPlacement;
|
|
7
7
|
size?: ContextMenuSize;
|
|
8
8
|
groups?: MenuItemGroups;
|
|
9
|
+
className?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare const ContextMenu: ({ id, placement, size, groups, items, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const ContextMenu: ({ id, placement, size, groups, className, items, }: ContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,19 +3,30 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { MenuItems as
|
|
7
|
-
import { useRootContext as
|
|
8
|
-
import { ContextMenuBase as
|
|
9
|
-
const
|
|
6
|
+
import { MenuItems as s } from "../Menu/MenuItems.js";
|
|
7
|
+
import { useRootContext as x } from "../RootProvider/RootProvider.js";
|
|
8
|
+
import { ContextMenuBase as c } from "./ContextMenuBase.js";
|
|
9
|
+
const a = ({
|
|
10
10
|
id: t = "context-menu",
|
|
11
11
|
placement: e = "right",
|
|
12
12
|
size: r,
|
|
13
13
|
groups: n = {},
|
|
14
|
-
|
|
14
|
+
className: m,
|
|
15
|
+
items: i
|
|
15
16
|
}) => {
|
|
16
|
-
const { currentId:
|
|
17
|
-
return /* @__PURE__ */ o(
|
|
17
|
+
const { currentId: p, toggleId: u } = x();
|
|
18
|
+
return /* @__PURE__ */ o(
|
|
19
|
+
c,
|
|
20
|
+
{
|
|
21
|
+
size: r,
|
|
22
|
+
placement: e,
|
|
23
|
+
className: m,
|
|
24
|
+
expanded: p === t,
|
|
25
|
+
onToggle: () => u(t),
|
|
26
|
+
children: /* @__PURE__ */ o(s, { groups: n, items: i })
|
|
27
|
+
}
|
|
28
|
+
);
|
|
18
29
|
};
|
|
19
30
|
export {
|
|
20
|
-
|
|
31
|
+
a as ContextMenu
|
|
21
32
|
};
|
|
@@ -5,7 +5,8 @@ export interface ContextMenuBaseProps {
|
|
|
5
5
|
placement: DropdownPlacement;
|
|
6
6
|
expanded: boolean;
|
|
7
7
|
size?: ContextMenuSize;
|
|
8
|
+
className?: string;
|
|
8
9
|
onToggle?: () => void;
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
}
|
|
11
|
-
export declare const ContextMenuBase: ({ size, placement, expanded, onToggle, children, }: ContextMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const ContextMenuBase: ({ size, placement, expanded, className, onToggle, children, }: ContextMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import "../../index-L8X2o7IH.js";
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import "../Icon/SvgIcon.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { IconButton as
|
|
5
|
+
import { IconButton as l } from "../Button/IconButton.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { DropdownBase as
|
|
8
|
-
import '../../assets/ContextMenuBase.css';const
|
|
9
|
-
toggle:
|
|
10
|
-
button:
|
|
11
|
-
icon:
|
|
12
|
-
dropdown:
|
|
13
|
-
},
|
|
7
|
+
import { DropdownBase as d } from "../Dropdown/DropdownBase.js";
|
|
8
|
+
import '../../assets/ContextMenuBase.css';const p = "_toggle_ya7jy_1", _ = "_button_ya7jy_5", y = "_icon_ya7jy_14", g = "_dropdown_ya7jy_18", o = {
|
|
9
|
+
toggle: p,
|
|
10
|
+
button: _,
|
|
11
|
+
icon: y,
|
|
12
|
+
dropdown: g
|
|
13
|
+
}, B = ({
|
|
14
14
|
size: n = "sm",
|
|
15
15
|
placement: r = "right",
|
|
16
|
-
expanded:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
expanded: s = !1,
|
|
17
|
+
className: e,
|
|
18
|
+
onToggle: a,
|
|
19
|
+
children: c
|
|
20
|
+
}) => /* @__PURE__ */ i("div", { className: m(o.toggle, e), "data-theme": "neutral", children: [
|
|
20
21
|
/* @__PURE__ */ t(
|
|
21
|
-
|
|
22
|
+
l,
|
|
22
23
|
{
|
|
23
24
|
className: o.button,
|
|
24
25
|
size: n,
|
|
@@ -26,11 +27,11 @@ import '../../assets/ContextMenuBase.css';const l = "_toggle_ya7jy_1", d = "_but
|
|
|
26
27
|
iconSize: "md",
|
|
27
28
|
variant: "text",
|
|
28
29
|
color: "secondary",
|
|
29
|
-
onClick:
|
|
30
|
+
onClick: a
|
|
30
31
|
}
|
|
31
32
|
),
|
|
32
|
-
/* @__PURE__ */ t(
|
|
33
|
+
/* @__PURE__ */ t(d, { className: o.dropdown, placement: r, expanded: s, children: c })
|
|
33
34
|
] });
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
B as ContextMenuBase
|
|
36
37
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { ListItemBase as p } from "../List/ListItemBase.js";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import "../Icon/SvgIcon.js";
|
|
5
4
|
import { ListItemLabel as M } from "../List/ListItemLabel.js";
|
|
6
5
|
import "react";
|
|
6
|
+
import "../Icon/SvgIcon.js";
|
|
7
7
|
import { DialogBorder as h } from "./DialogBorder.js";
|
|
8
8
|
import { DialogMetadata as g } from "./DialogMetadata.js";
|
|
9
9
|
import { DialogHeaderBase as S } from "./DialogHeaderBase.js";
|
|
@@ -28,8 +28,8 @@ import '../../assets/DialogListItem.css';const C = "_item_vo44o_1", E = "_select
|
|
|
28
28
|
recipient: N,
|
|
29
29
|
grouped: v,
|
|
30
30
|
updatedAt: i,
|
|
31
|
-
updatedAtLabel:
|
|
32
|
-
archivedAt:
|
|
31
|
+
updatedAtLabel: s,
|
|
32
|
+
archivedAt: c,
|
|
33
33
|
archivedAtLabel: B,
|
|
34
34
|
trashedAt: l,
|
|
35
35
|
trashedAtLabel: b,
|
|
@@ -44,17 +44,17 @@ import '../../assets/DialogListItem.css';const C = "_item_vo44o_1", E = "_select
|
|
|
44
44
|
summary: _,
|
|
45
45
|
...f
|
|
46
46
|
}) => {
|
|
47
|
-
const T = l ? "trashed" :
|
|
47
|
+
const T = l ? "trashed" : c ? "archived" : u;
|
|
48
48
|
return o === "xs" || o === "sm" ? /* @__PURE__ */ r(p, { ...f, size: o, className: t.item, children: /* @__PURE__ */ m(h, { className: t.border, size: o, seen: e, children: [
|
|
49
49
|
/* @__PURE__ */ r(M, { size: o, title: d, description: _ }),
|
|
50
|
-
/* @__PURE__ */ r(g, { updatedAt: i, updatedAtLabel:
|
|
50
|
+
/* @__PURE__ */ r(g, { updatedAt: i, updatedAtLabel: s })
|
|
51
51
|
] }) }) : /* @__PURE__ */ r(
|
|
52
52
|
p,
|
|
53
53
|
{
|
|
54
54
|
...f,
|
|
55
55
|
size: o,
|
|
56
56
|
className: t.item,
|
|
57
|
-
|
|
57
|
+
controls: a && /* @__PURE__ */ r(w, { className: t.select, ...a }),
|
|
58
58
|
children: /* @__PURE__ */ m(h, { className: t.border, size: o, seen: e, children: [
|
|
59
59
|
/* @__PURE__ */ m(S, { size: o, children: [
|
|
60
60
|
/* @__PURE__ */ r(k, { size: o, variant: T, label: x, seen: e, children: d }),
|
|
@@ -67,8 +67,8 @@ import '../../assets/DialogListItem.css';const C = "_item_vo44o_1", E = "_select
|
|
|
67
67
|
{
|
|
68
68
|
status: y,
|
|
69
69
|
updatedAt: i,
|
|
70
|
-
updatedAtLabel:
|
|
71
|
-
archivedAt:
|
|
70
|
+
updatedAtLabel: s,
|
|
71
|
+
archivedAt: c,
|
|
72
72
|
archivedAtLabel: B,
|
|
73
73
|
trashedAt: l,
|
|
74
74
|
trashedAtLabel: b,
|
|
@@ -2,9 +2,10 @@ 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";
|
|
5
6
|
import { ListItem as n } from "./ListItem.js";
|
|
6
7
|
import { ListBase as f } from "./ListBase.js";
|
|
7
|
-
const
|
|
8
|
+
const h = ({ theme: r, size: t = "md", spacing: m = "md", items: o = [] }) => /* @__PURE__ */ p(f, { theme: r, spacing: m, children: o.map((e, i) => /* @__PURE__ */ s(n, { ...e, size: t, key: "item" + i })) });
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
h as List
|
|
10
11
|
};
|
|
@@ -32,4 +32,4 @@ export interface ListItemProps extends ListItemBaseProps {
|
|
|
32
32
|
/** Child items */
|
|
33
33
|
items?: ListItemProps[];
|
|
34
34
|
}
|
|
35
|
-
export declare const ListItem: ({ as, color, loading,
|
|
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,49 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ListItemLabel as u } from "./ListItemLabel.js";
|
|
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";
|
|
7
6
|
import { ListItemMedia as w } from "./ListItemMedia.js";
|
|
8
|
-
const
|
|
9
|
-
as:
|
|
7
|
+
const E = ({
|
|
8
|
+
as: n = "a",
|
|
10
9
|
color: r,
|
|
11
|
-
loading:
|
|
12
|
-
selected: B,
|
|
13
|
-
disabled: F,
|
|
10
|
+
loading: B,
|
|
14
11
|
size: t = "sm",
|
|
15
|
-
icon:
|
|
16
|
-
avatar:
|
|
17
|
-
avatarGroup:
|
|
18
|
-
title:
|
|
19
|
-
description:
|
|
20
|
-
children:
|
|
21
|
-
collapsible:
|
|
22
|
-
expanded:
|
|
23
|
-
badge:
|
|
24
|
-
linkText:
|
|
25
|
-
linkIcon:
|
|
26
|
-
menu:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
icon: e,
|
|
13
|
+
avatar: s,
|
|
14
|
+
avatarGroup: c,
|
|
15
|
+
title: p,
|
|
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,
|
|
31
29
|
{
|
|
32
|
-
as:
|
|
30
|
+
as: n,
|
|
33
31
|
size: t,
|
|
34
32
|
color: r,
|
|
35
|
-
expanded:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */ o(x, { linkIcon: i && m ? "chevron-up" : i ? "chevron-down" : b, linkText: h, badge: f })
|
|
44
|
-
]
|
|
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
|
+
] })
|
|
45
41
|
}
|
|
46
42
|
);
|
|
47
43
|
export {
|
|
48
|
-
|
|
44
|
+
E as ListItem
|
|
49
45
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as d, useState as g } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import { Button as k } from "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import { MetaItem as r } from "../Meta/MetaItem.js";
|
|
8
8
|
import { ListItem as t } from "./ListItem.js";
|
|
9
|
-
import { ListBase as
|
|
10
|
-
import { List as
|
|
11
|
-
const
|
|
9
|
+
import { ListBase as s } from "./ListBase.js";
|
|
10
|
+
import { List as b } from "./List.js";
|
|
11
|
+
const a = ["lg", "md", "sm", "xs"], T = {
|
|
12
12
|
title: "List/ListItem",
|
|
13
13
|
component: t,
|
|
14
14
|
tags: ["autodocs"],
|
|
@@ -21,7 +21,7 @@ const s = ["lg", "md", "sm", "xs"], T = {
|
|
|
21
21
|
}
|
|
22
22
|
}, B = {
|
|
23
23
|
args: {}
|
|
24
|
-
}, E = (n) => /* @__PURE__ */
|
|
24
|
+
}, E = (n) => /* @__PURE__ */ c(s, { children: [
|
|
25
25
|
/* @__PURE__ */ e(t, { ...n }),
|
|
26
26
|
/* @__PURE__ */ e(r, { children: "No media" }),
|
|
27
27
|
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear" }),
|
|
@@ -106,7 +106,7 @@ const s = ["lg", "md", "sm", "xs"], T = {
|
|
|
106
106
|
}
|
|
107
107
|
),
|
|
108
108
|
/* @__PURE__ */ e(r, { children: "Company group" })
|
|
109
|
-
] }), H = (n) => /* @__PURE__ */
|
|
109
|
+
] }), H = (n) => /* @__PURE__ */ c(s, { children: [
|
|
110
110
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right" }),
|
|
111
111
|
/* @__PURE__ */ e(r, { children: "Link icon, emphasising that this will take you somewhere" }),
|
|
112
112
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right", linkText: "Åpne" }),
|
|
@@ -129,26 +129,49 @@ const s = ["lg", "md", "sm", "xs"], T = {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
),
|
|
132
|
-
/* @__PURE__ */ e(r, { children: "List item with
|
|
132
|
+
/* @__PURE__ */ e(r, { children: "List item with badge, linkIcon and context menu" }),
|
|
133
133
|
/* @__PURE__ */ e(
|
|
134
134
|
t,
|
|
135
135
|
{
|
|
136
136
|
...n,
|
|
137
|
-
|
|
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
138
|
}
|
|
139
139
|
),
|
|
140
|
-
/* @__PURE__ */ e(r, { children: "List item with custom
|
|
141
|
-
] }), M = (n) => /* @__PURE__ */ a(c, { children: [
|
|
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: [
|
|
142
165
|
/* @__PURE__ */ e(t, { ...n }),
|
|
143
166
|
/* @__PURE__ */ e(r, { children: "Default" }),
|
|
144
167
|
/* @__PURE__ */ e(t, { ...n, color: "accent" }),
|
|
145
168
|
/* @__PURE__ */ e(r, { children: "Accent" })
|
|
146
|
-
] }),
|
|
169
|
+
] }), _ = (n) => /* @__PURE__ */ e(s, { children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ c(d, { children: [
|
|
147
170
|
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: o, selected: o === (n == null ? void 0 : n.size), linkIcon: "chevron-right" }),
|
|
148
171
|
/* @__PURE__ */ e(r, { children: o })
|
|
149
|
-
] }, o)) }),
|
|
150
|
-
const [o,
|
|
151
|
-
|
|
172
|
+
] }, o)) }), j = (n) => {
|
|
173
|
+
const [o, p] = g(!1), m = () => {
|
|
174
|
+
p((i) => !i);
|
|
152
175
|
}, l = [
|
|
153
176
|
{
|
|
154
177
|
name: "Per Ove Ludvigsen",
|
|
@@ -185,7 +208,7 @@ const s = ["lg", "md", "sm", "xs"], T = {
|
|
|
185
208
|
type: "person"
|
|
186
209
|
}))
|
|
187
210
|
};
|
|
188
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ c(d, { children: [
|
|
189
212
|
/* @__PURE__ */ e(
|
|
190
213
|
t,
|
|
191
214
|
{
|
|
@@ -197,15 +220,16 @@ const s = ["lg", "md", "sm", "xs"], T = {
|
|
|
197
220
|
as: "button"
|
|
198
221
|
}
|
|
199
222
|
),
|
|
200
|
-
o && /* @__PURE__ */ e(
|
|
223
|
+
o && /* @__PURE__ */ e(b, { size: "sm", spacing: "none", items: h })
|
|
201
224
|
] });
|
|
202
225
|
};
|
|
203
226
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
227
|
+
j as Collapsible,
|
|
228
|
+
S as Colors,
|
|
229
|
+
H as Controls,
|
|
207
230
|
B as Default,
|
|
208
231
|
E as MediaTypes,
|
|
209
|
-
|
|
232
|
+
M as Selectable,
|
|
233
|
+
_ as Sizes,
|
|
210
234
|
T as default
|
|
211
235
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { ListItemSelectProps } from './ListItemSelect';
|
|
2
3
|
export type ListItemColor = 'default' | 'accent';
|
|
3
4
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
5
|
export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -13,12 +14,14 @@ export interface ListItemBaseProps {
|
|
|
13
14
|
hidden?: boolean;
|
|
14
15
|
collapsible?: boolean;
|
|
15
16
|
disabled?: boolean;
|
|
17
|
+
select?: ListItemSelectProps;
|
|
16
18
|
selected?: boolean;
|
|
17
19
|
expanded?: boolean;
|
|
18
20
|
onClick?: () => void;
|
|
19
21
|
onKeyPress?: KeyboardEventHandler;
|
|
20
22
|
action?: ReactNode;
|
|
23
|
+
controls?: ReactNode;
|
|
21
24
|
children?: ReactNode;
|
|
22
25
|
style?: React.CSSProperties;
|
|
23
26
|
}
|
|
24
|
-
export declare const ListItemBase: ({ as, children, className, href, size, color, active, hidden, shadow,
|
|
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,62 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as L, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as N } from "../../index-L8X2o7IH.js";
|
|
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,
|
|
8
9
|
children: l,
|
|
9
|
-
className:
|
|
10
|
-
href:
|
|
11
|
-
size:
|
|
12
|
-
color:
|
|
13
|
-
active:
|
|
14
|
-
hidden:
|
|
15
|
-
shadow:
|
|
16
|
-
|
|
17
|
-
selected:
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
className: n,
|
|
11
|
+
href: o,
|
|
12
|
+
size: t,
|
|
13
|
+
color: f,
|
|
14
|
+
active: x = !1,
|
|
15
|
+
hidden: p = !1,
|
|
16
|
+
shadow: _ = "xs",
|
|
17
|
+
select: s,
|
|
18
|
+
selected: h,
|
|
19
|
+
disabled: u,
|
|
20
|
+
expanded: i,
|
|
21
|
+
controls: I,
|
|
20
22
|
onClick: a,
|
|
21
|
-
onKeyPress:
|
|
22
|
-
style:
|
|
23
|
+
onKeyPress: e,
|
|
24
|
+
style: b
|
|
23
25
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
+
const j = c || "a";
|
|
27
|
+
return /* @__PURE__ */ L(
|
|
26
28
|
"article",
|
|
27
29
|
{
|
|
28
30
|
className: r.item,
|
|
29
|
-
"data-color":
|
|
30
|
-
"data-size":
|
|
31
|
-
"data-shadow":
|
|
32
|
-
"data-active":
|
|
33
|
-
"aria-hidden":
|
|
34
|
-
"aria-disabled":
|
|
35
|
-
"aria-selected":
|
|
36
|
-
"aria-expanded":
|
|
37
|
-
style: i,
|
|
31
|
+
"data-color": f,
|
|
32
|
+
"data-size": t,
|
|
33
|
+
"data-shadow": _,
|
|
34
|
+
"data-active": x,
|
|
35
|
+
"aria-hidden": p,
|
|
36
|
+
"aria-disabled": u,
|
|
37
|
+
"aria-selected": h,
|
|
38
|
+
"aria-expanded": i,
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
|
|
40
|
+
s && /* @__PURE__ */ m(v, { ...s, size: t }),
|
|
41
|
+
/* @__PURE__ */ m(
|
|
42
|
+
j,
|
|
41
43
|
{
|
|
42
|
-
className:
|
|
43
|
-
"data-size":
|
|
44
|
-
"aria-expanded":
|
|
45
|
-
style:
|
|
46
|
-
href:
|
|
47
|
-
onKeyPress: (
|
|
48
|
-
|
|
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);
|
|
49
51
|
},
|
|
50
52
|
onClick: a,
|
|
51
53
|
tabIndex: -1,
|
|
52
54
|
children: l
|
|
53
55
|
}
|
|
54
56
|
),
|
|
55
|
-
|
|
57
|
+
I
|
|
56
58
|
]
|
|
57
59
|
}
|
|
58
60
|
);
|
|
59
61
|
};
|
|
60
62
|
export {
|
|
61
|
-
|
|
63
|
+
k as ListItemBase
|
|
62
64
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BadgeProps } from '../Badge';
|
|
3
|
+
import { ContextMenuProps } from '../ContextMenu';
|
|
4
|
+
import { IconName } from '../Icon';
|
|
5
|
+
interface ListItemControlsProps {
|
|
6
|
+
badge?: BadgeProps;
|
|
7
|
+
linkText?: string;
|
|
8
|
+
linkIcon?: IconName;
|
|
9
|
+
menu?: ContextMenuProps;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const ListItemControls: ({ badge, linkText, linkIcon, menu, children }: ListItemControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as t, jsxs as l, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as i } from "../Badge/Badge.js";
|
|
3
|
+
import { ContextMenu as a } from "../ContextMenu/ContextMenu.js";
|
|
4
|
+
import { Icon as d } from "../Icon/Icon.js";
|
|
5
|
+
import "../Icon/SvgIcon.js";
|
|
6
|
+
import "../../index-L8X2o7IH.js";
|
|
7
|
+
import '../../assets/ListItemControls.css';const _ = "_controls_dduzt_1", p = "_linkText_dduzt_14", x = "_linkIcon_dduzt_19", o = {
|
|
8
|
+
controls: _,
|
|
9
|
+
linkText: p,
|
|
10
|
+
linkIcon: x
|
|
11
|
+
}, T = ({ badge: s, linkText: r, linkIcon: c, menu: n, children: e }) => /* @__PURE__ */ t("div", { className: o.controls, "data-menu": n && !0, children: e || /* @__PURE__ */ l(m, { children: [
|
|
12
|
+
s && /* @__PURE__ */ t(i, { ...s }),
|
|
13
|
+
r && /* @__PURE__ */ t("span", { className: o.linkText, children: r }),
|
|
14
|
+
c && /* @__PURE__ */ t(d, { name: c, className: o.linkIcon }),
|
|
15
|
+
n && /* @__PURE__ */ t(a, { ...n, className: o.menu })
|
|
16
|
+
] }) });
|
|
17
|
+
export {
|
|
18
|
+
T as ListItemControls
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChangeEventHandler } from 'react';
|
|
2
|
+
import { ListItemSize } from './ListItemBase';
|
|
3
|
+
export type ListItemSelectProps = {
|
|
4
|
+
size?: ListItemSize;
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
onChange?: ChangeEventHandler;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Dialog checkbox
|
|
11
|
+
*/
|
|
12
|
+
export declare const ListItemSelect: ({ size, checked, onChange, className }: ListItemSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import "../Icon/SvgIcon.js";
|
|
4
|
+
import { CheckboxIcon as i } from "../Icon/CheckboxIcon.js";
|
|
5
|
+
import '../../assets/ListItemSelect.css';const r = "_label_hd89l_1", m = "_input_hd89l_38", p = "_icon_hd89l_43", t = {
|
|
6
|
+
label: r,
|
|
7
|
+
input: m,
|
|
8
|
+
icon: p
|
|
9
|
+
}, h = ({ size: l, checked: e = !1, onChange: s, className: c }) => /* @__PURE__ */ n("label", { className: a(t.label, c), "data-size": l, children: [
|
|
10
|
+
/* @__PURE__ */ o("input", { type: "checkbox", checked: e, onChange: s, className: t.input, tabIndex: -1 }),
|
|
11
|
+
/* @__PURE__ */ o(i, { hover: !0, checked: e, className: t.icon })
|
|
12
|
+
] });
|
|
13
|
+
export {
|
|
14
|
+
h as ListItemSelect
|
|
15
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './ListItemBase';
|
|
2
2
|
export * from './ListItemHeader';
|
|
3
|
-
export * from './ListItemFooter';
|
|
4
3
|
export * from './ListItemLabel';
|
|
5
4
|
export * from './ListItemMedia';
|
|
5
|
+
export * from './ListItemControls';
|
|
6
|
+
export * from './ListItemSelect';
|
|
6
7
|
export * from './ListItem';
|
|
7
8
|
export * from './ListBase';
|
|
8
9
|
export * from './List';
|