@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.
Files changed (30) hide show
  1. package/dist/assets/ListItemBase.css +1 -1
  2. package/dist/assets/ListItemControls.css +1 -0
  3. package/dist/assets/ListItemSelect.css +1 -0
  4. package/dist/components/ContextMenu/ContextMenu.d.ts +2 -1
  5. package/dist/components/ContextMenu/ContextMenu.js +19 -8
  6. package/dist/components/ContextMenu/ContextMenuBase.d.ts +2 -1
  7. package/dist/components/ContextMenu/ContextMenuBase.js +19 -18
  8. package/dist/components/Dialog/DialogListItem.js +8 -8
  9. package/dist/components/List/List.js +3 -2
  10. package/dist/components/List/ListItem.d.ts +1 -1
  11. package/dist/components/List/ListItem.js +35 -39
  12. package/dist/components/List/ListItem.stories.js +45 -21
  13. package/dist/components/List/ListItemBase.d.ts +4 -1
  14. package/dist/components/List/ListItemBase.js +44 -42
  15. package/dist/components/List/ListItemControls.d.ts +13 -0
  16. package/dist/components/List/ListItemControls.js +19 -0
  17. package/dist/components/List/ListItemSelect.d.ts +12 -0
  18. package/dist/components/List/ListItemSelect.js +15 -0
  19. package/dist/components/List/index.d.ts +2 -1
  20. package/dist/components/List/index.js +14 -12
  21. package/dist/components/Searchbar/ScopeListItem.js +3 -2
  22. package/dist/components/index.js +100 -98
  23. package/dist/index.js +123 -121
  24. package/package.json +1 -1
  25. package/dist/assets/ListItemAction.css +0 -1
  26. package/dist/assets/ListItemFooter.css +0 -1
  27. package/dist/components/List/ListItemAction.d.ts +0 -8
  28. package/dist/components/List/ListItemAction.js +0 -8
  29. package/dist/components/List/ListItemFooter.d.ts +0 -11
  30. package/dist/components/List/ListItemFooter.js +0 -17
@@ -1 +1 @@
1
- ._item_jxdl8_1{position:relative;width:100%;display:flex;align-items:stretch;justify-content:stretch}._item_jxdl8_1[data-shadow=xs]{box-shadow:var(--ds-shadow-xs)}._item_jxdl8_1[data-size=xs]{min-height:36px}._item_jxdl8_1[data-size=sm]{min-height:44px}._item_jxdl8_1[data-size=md]{min-height:56px}._item_jxdl8_1[data-size=lg]{min-height:64px}._item_jxdl8_1[data-size=xl]{min-height:72px}._item_jxdl8_1{background-color:var(--theme-background-default)}._item_jxdl8_1:hover{outline:2px solid var(--theme-border-strong);z-index:2}._item_jxdl8_1:hover strong,._item_jxdl8_1:hover h2{text-decoration:underline}._item_jxdl8_1[data-active=true],._item_jxdl8_1[data-color=accent]{background-color:var(--theme-surface-default)}._item_jxdl8_1[data-color=accent]:hover{background-color:var(--theme-surface-hover)}._link_jxdl8_69{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_jxdl8_69{flex-grow:1;display:flex;align-items:center}
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 u } from "../Menu/MenuItems.js";
7
- import { useRootContext as s } from "../RootProvider/RootProvider.js";
8
- import { ContextMenuBase as x } from "./ContextMenuBase.js";
9
- const M = ({
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
- items: m
14
+ className: m,
15
+ items: i
15
16
  }) => {
16
- const { currentId: i, toggleId: p } = s();
17
- return /* @__PURE__ */ o(x, { size: r, placement: e, expanded: i === t, onToggle: () => p(t), children: /* @__PURE__ */ o(u, { groups: n, items: m }) });
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
- M as ContextMenu
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 a, jsx as t } from "react/jsx-runtime";
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 c } from "../Button/IconButton.js";
5
+ import { IconButton as l } from "../Button/IconButton.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { DropdownBase as m } from "../Dropdown/DropdownBase.js";
8
- import '../../assets/ContextMenuBase.css';const l = "_toggle_ya7jy_1", d = "_button_ya7jy_5", p = "_icon_ya7jy_14", _ = "_dropdown_ya7jy_18", o = {
9
- toggle: l,
10
- button: d,
11
- icon: p,
12
- dropdown: _
13
- }, f = ({
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: e = !1,
17
- onToggle: s,
18
- children: i
19
- }) => /* @__PURE__ */ a("div", { className: o.toggle, "data-theme": "neutral", children: [
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
- c,
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: s
30
+ onClick: a
30
31
  }
31
32
  ),
32
- /* @__PURE__ */ t(m, { className: o.dropdown, placement: r, expanded: e, children: i })
33
+ /* @__PURE__ */ t(d, { className: o.dropdown, placement: r, expanded: s, children: c })
33
34
  ] });
34
35
  export {
35
- f as ContextMenuBase
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: c,
32
- archivedAt: s,
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" : s ? "archived" : u;
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: c })
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
- action: a && /* @__PURE__ */ r(w, { className: t.select, ...a }),
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: c,
71
- archivedAt: s,
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 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 })) });
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
- x as List
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, selected, disabled, size, icon, avatar, avatarGroup, title, description, children, collapsible, expanded, badge, linkText, linkIcon, menu, action, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
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 { 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";
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 J = ({
9
- as: s = "a",
7
+ const E = ({
8
+ as: n = "a",
10
9
  color: r,
11
- loading: A,
12
- selected: B,
13
- disabled: F,
10
+ loading: B,
14
11
  size: t = "sm",
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,
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: s,
30
+ as: n,
33
31
  size: t,
34
32
  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
- ]
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
- J as ListItem
44
+ E as ListItem
49
45
  };
@@ -1,14 +1,14 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { Fragment as p, useState as g } from "react";
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 c } from "./ListBase.js";
10
- import { List as y } from "./List.js";
11
- const s = ["lg", "md", "sm", "xs"], T = {
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__ */ a(c, { children: [
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__ */ a(c, { children: [
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 context menu and linkIcon" }),
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
- 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" }) })
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 action" })
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
- ] }), P = (n) => /* @__PURE__ */ e(c, { children: s == null ? void 0 : s.map((o) => /* @__PURE__ */ a(p, { children: [
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)) }), _ = (n) => {
150
- const [o, d] = g(!1), m = () => {
151
- d((i) => !i);
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__ */ a(p, { children: [
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(y, { size: "sm", spacing: "none", items: h })
223
+ o && /* @__PURE__ */ e(b, { size: "sm", spacing: "none", items: h })
201
224
  ] });
202
225
  };
203
226
  export {
204
- H as ActionProps,
205
- _ as Collapsible,
206
- M as Colors,
227
+ j as Collapsible,
228
+ S as Colors,
229
+ H as Controls,
207
230
  B as Default,
208
231
  E as MediaTypes,
209
- P as Sizes,
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, disabled, selected, expanded, action, onClick, onKeyPress, style, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
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 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 = ({
7
- as: m,
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: 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,
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: t,
22
- style: i
23
+ onKeyPress: e,
24
+ style: b
23
25
  }) => {
24
- const b = m || "a";
25
- return /* @__PURE__ */ I(
26
+ const j = c || "a";
27
+ return /* @__PURE__ */ L(
26
28
  "article",
27
29
  {
28
30
  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,
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__ */ N(
40
- b,
40
+ s && /* @__PURE__ */ m(v, { ...s, size: t }),
41
+ /* @__PURE__ */ m(
42
+ j,
41
43
  {
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);
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
- h
57
+ I
56
58
  ]
57
59
  }
58
60
  );
59
61
  };
60
62
  export {
61
- E as ListItemBase
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';