@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.
Files changed (87) hide show
  1. package/dist/assets/AutocompleteBase.css +1 -1
  2. package/dist/assets/AutocompleteGroup.css +1 -1
  3. package/dist/assets/DialogBorder.css +1 -1
  4. package/dist/assets/DialogHeaderBase.css +1 -1
  5. package/dist/assets/DialogHeadings.css +1 -1
  6. package/dist/assets/DialogListItem.css +1 -1
  7. package/dist/assets/DialogTitle.css +1 -1
  8. package/dist/assets/ListItemAction.css +1 -1
  9. package/dist/assets/ListItemBase.css +1 -1
  10. package/dist/assets/ListItemFooter.css +1 -0
  11. package/dist/assets/ListItemHeader.css +1 -0
  12. package/dist/assets/ListItemLabel.css +1 -1
  13. package/dist/assets/ListItemMedia.css +1 -1
  14. package/dist/assets/MetaItemBase.css +1 -0
  15. package/dist/assets/MetaItemLabel.css +1 -0
  16. package/dist/assets/MetaItemMedia.css +1 -0
  17. package/dist/components/Bookmarks/BookmarksList.d.ts +1 -1
  18. package/dist/components/Bookmarks/BookmarksListItem.d.ts +2 -13
  19. package/dist/components/Bookmarks/BookmarksListItem.js +5 -10
  20. package/dist/components/Button/Button.js +2 -2
  21. package/dist/components/Button/Buttons.stories.js +2 -2
  22. package/dist/components/Dialog/Dialog.stories.js +30 -20
  23. package/dist/components/Dialog/DialogBase.d.ts +2 -0
  24. package/dist/components/Dialog/DialogBorder.d.ts +1 -1
  25. package/dist/components/Dialog/DialogBorder.js +5 -5
  26. package/dist/components/Dialog/DialogContent.stories.js +1 -1
  27. package/dist/components/Dialog/DialogGroup.js +5 -5
  28. package/dist/components/Dialog/DialogHeader.d.ts +1 -1
  29. package/dist/components/Dialog/DialogHeader.js +6 -6
  30. package/dist/components/Dialog/DialogHeaderBase.d.ts +3 -1
  31. package/dist/components/Dialog/DialogHeaderBase.js +3 -3
  32. package/dist/components/Dialog/DialogHeadings.d.ts +2 -3
  33. package/dist/components/Dialog/DialogHeadings.js +24 -26
  34. package/dist/components/Dialog/DialogLabel.d.ts +13 -0
  35. package/dist/components/Dialog/DialogLabel.js +17 -0
  36. package/dist/components/Dialog/DialogListItem.d.ts +17 -5
  37. package/dist/components/Dialog/DialogListItem.js +86 -70
  38. package/dist/components/Dialog/DialogListItem.stories.js +117 -68
  39. package/dist/components/Dialog/DialogMetadata.d.ts +9 -1
  40. package/dist/components/Dialog/DialogMetadata.js +25 -21
  41. package/dist/components/Dialog/DialogNav.js +16 -16
  42. package/dist/components/Dialog/DialogTitle.d.ts +7 -9
  43. package/dist/components/Dialog/DialogTitle.js +9 -10
  44. package/dist/components/Dialog/Examples.stories.js +31 -0
  45. package/dist/components/Dialog/index.d.ts +1 -1
  46. package/dist/components/Dialog/index.js +41 -41
  47. package/dist/components/List/List.js +2 -3
  48. package/dist/components/List/ListItem.d.ts +5 -25
  49. package/dist/components/List/ListItem.js +46 -21
  50. package/dist/components/List/ListItem.stories.js +52 -42
  51. package/dist/components/List/ListItemAction.d.ts +2 -7
  52. package/dist/components/List/ListItemAction.js +6 -17
  53. package/dist/components/List/ListItemBase.d.ts +5 -10
  54. package/dist/components/List/ListItemBase.js +52 -48
  55. package/dist/components/List/ListItemFooter.d.ts +11 -0
  56. package/dist/components/List/ListItemFooter.js +17 -0
  57. package/dist/components/List/ListItemHeader.d.ts +8 -0
  58. package/dist/components/List/ListItemHeader.js +8 -0
  59. package/dist/components/List/ListItemLabel.js +7 -7
  60. package/dist/components/List/ListItemMedia.js +7 -7
  61. package/dist/components/List/index.d.ts +4 -3
  62. package/dist/components/List/index.js +14 -12
  63. package/dist/components/Meta/MetaItemBase.d.ts +1 -1
  64. package/dist/components/Meta/MetaItemBase.js +21 -20
  65. package/dist/components/Meta/MetaItemLabel.js +5 -4
  66. package/dist/components/Meta/MetaItemMedia.js +9 -8
  67. package/dist/components/Page/PageNav.js +7 -7
  68. package/dist/components/Searchbar/Autocomplete.stories.js +241 -13
  69. package/dist/components/Searchbar/AutocompleteBase.js +5 -5
  70. package/dist/components/Searchbar/AutocompleteGroup.js +9 -12
  71. package/dist/components/Searchbar/AutocompleteItem.d.ts +23 -11
  72. package/dist/components/Searchbar/AutocompleteItem.js +21 -8
  73. package/dist/components/Searchbar/ScopeListItem.d.ts +12 -0
  74. package/dist/components/Searchbar/ScopeListItem.js +11 -0
  75. package/dist/components/Toolbar/ToolbarButton.js +2 -1
  76. package/dist/components/index.js +153 -151
  77. package/dist/hooks/useMenu.js +19 -19
  78. package/dist/index.js +155 -153
  79. package/package.json +1 -1
  80. package/dist/assets/DialogListItemBase.css +0 -1
  81. package/dist/assets/metaItem.css +0 -1
  82. package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
  83. package/dist/components/Dialog/DialogListItemBase.js +0 -24
  84. package/dist/components/Dialog/DialogTitle.stories.js +0 -26
  85. package/dist/components/List/ListItemAction.stories.js +0 -45
  86. package/dist/metaItem.module-CfNiX769.js +0 -8
  87. /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 { DialogListItemBase as f } from "./DialogListItemBase.js";
6
- import { DialogActions as x } from "./DialogActions.js";
7
- import { DialogActivityLog as B } from "./DialogActivityLog.js";
8
- import { DialogArticleBase as n } from "./DialogArticleBase.js";
9
- import { DialogBase as y } from "./DialogBase.js";
10
- import { DialogBodyBase as u } from "./DialogBodyBase.js";
11
- import { DialogBorder as L } from "./DialogBorder.js";
12
- import { DialogContent as v } from "./DialogContent.js";
13
- import { DialogFooter as T } from "./DialogFooter.js";
14
- import { DialogHeader as C } from "./DialogHeader.js";
15
- import { DialogHeaderBase as F } from "./DialogHeaderBase.js";
16
- import { DialogHeadings as N } from "./DialogHeadings.js";
17
- import { DialogHistory as j } from "./DialogHistory.js";
18
- import { DialogNav as q } from "./DialogNav.js";
19
- import { DialogSectionBase as z } from "./DialogSectionBase.js";
20
- import { DialogSeenBy as J } from "./DialogSeenBy.js";
21
- import { DialogSelect as O } from "./DialogSelect.js";
22
- import { DialogStatus as Q, DialogStatusEnum as R } from "./DialogStatus.js";
23
- import { DialogTitle as V } from "./DialogTitle.js";
24
- import { DialogTouchedBy as X } from "./DialogTouchedBy.js";
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
- x as DialogActions,
28
- B as DialogActivityLog,
29
- n as DialogArticleBase,
30
- y as DialogBase,
31
- u as DialogBodyBase,
32
- L as DialogBorder,
33
- v as DialogContent,
34
- T as DialogFooter,
35
- C as DialogHeader,
36
- F as DialogHeaderBase,
37
- N as DialogHeadings,
38
- j as DialogHistory,
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
- q as DialogNav,
44
- z as DialogSectionBase,
45
- J as DialogSeenBy,
46
- O as DialogSelect,
47
- Q as DialogStatus,
48
- R as DialogStatusEnum,
49
- V as DialogTitle,
50
- X as DialogTouchedBy
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 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 })) });
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
- h as List
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 { ListItemColor, ListItemSize } from './ListItemBase';
7
- export interface ListItemProps {
5
+ import { ListItemBaseProps } from './ListItemBase';
6
+ export interface ListItemProps extends ListItemBaseProps {
8
7
  id: string;
9
- type?: string;
10
- /** Element type to render */
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 I, jsx as r } from "react/jsx-runtime";
2
- import { ListItemBase as n } from "./ListItemBase.js";
3
- import { ListItemLabel as x } from "./ListItemLabel.js";
4
- import { ListItemMedia as b } from "./ListItemMedia.js";
5
- const B = ({
6
- as: e = "a",
7
- color: m,
8
- selected: i,
9
- disabled: j,
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: s,
12
- avatar: o,
13
- avatarGroup: a,
14
- title: p,
15
- description: L,
16
- children: d,
17
- ...f
18
- }) => /* @__PURE__ */ I(n, { as: e, size: t, color: m, selected: i, ...f, children: [
19
- /* @__PURE__ */ r(b, { color: m, size: t, icon: s, avatar: o, avatarGroup: a }),
20
- /* @__PURE__ */ r(x, { title: p, description: L, size: t, children: d })
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
- B as ListItem
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 s } from "./ListBase.js";
9
- import { List as k } from "./List.js";
10
- const c = ["lg", "md", "sm", "xs"], D = {
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
- }, T = {
22
+ }, B = {
22
23
  args: {}
23
- }, w = (n) => /* @__PURE__ */ a(s, { children: [
24
+ }, E = (n) => /* @__PURE__ */ a(c, { children: [
24
25
  /* @__PURE__ */ e(t, { ...n }),
25
- /* @__PURE__ */ e(i, { children: "No media" }),
26
+ /* @__PURE__ */ e(r, { children: "No media" }),
26
27
  /* @__PURE__ */ e(t, { ...n, icon: "teddy-bear" }),
27
- /* @__PURE__ */ e(i, { children: "Icon" }),
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(i, { children: "Person" }),
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(i, { children: "Company" }),
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(i, { children: "Logo" }),
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(i, { children: "People group" }),
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(i, { children: "Company group" })
108
- ] }), E = (n) => /* @__PURE__ */ a(s, { children: [
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(i, { children: "Link icon, emphasising that this will take you somewhere" }),
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(i, { children: "Link icon + link text, emphasising that this will take you somewhere" }),
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(i, { children: "Collapsible item with badge" }),
115
+ /* @__PURE__ */ e(r, { children: "Collapsible item with badge" }),
115
116
  /* @__PURE__ */ e(t, { ...n, collapsible: !0, expanded: !0 }),
116
- /* @__PURE__ */ e(i, { children: "Collapsible and expanded item" }),
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(i, { children: "List item with context menu and linkIcon" })
131
- ] }), H = (n) => /* @__PURE__ */ a(s, { children: [
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(i, { children: "Default" }),
143
+ /* @__PURE__ */ e(r, { children: "Default" }),
134
144
  /* @__PURE__ */ e(t, { ...n, color: "accent" }),
135
- /* @__PURE__ */ e(i, { children: "Accent" })
136
- ] }), B = (n) => /* @__PURE__ */ e(s, { children: c == null ? void 0 : c.map((o) => /* @__PURE__ */ a(p, { children: [
137
- /* @__PURE__ */ e(t, { ...n, size: o, selected: o === (n == null ? void 0 : n.size) }),
138
- /* @__PURE__ */ e(i, { children: o })
139
- ] }, o)) }), M = (n) => {
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((r) => !r);
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((r) => ({
173
+ ], h = l == null ? void 0 : l.map((i) => ({
164
174
  avatar: {
165
- ...r,
175
+ ...i,
166
176
  type: "person"
167
177
  },
168
- title: r == null ? void 0 : r.name,
169
- description: r == null ? void 0 : r.role,
170
- badge: { label: r == null ? void 0 : r.rights },
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((r) => ({
174
- name: r == null ? void 0 : r.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(k, { size: "xs", spacing: "none", items: h })
200
+ o && /* @__PURE__ */ e(y, { size: "sm", spacing: "none", items: h })
191
201
  ] });
192
202
  };
193
203
  export {
194
- E as ActionProps,
195
- M as Collapsible,
196
- H as Colors,
197
- T as Default,
198
- w as MediaTypes,
199
- B as Sizes,
200
- D as default
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
- import { IconName } from '../Icon';
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: ({ linkText, linkIcon, menu, badge, children }: ListItemActionProps) => import("react/jsx-runtime").JSX.Element;
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 n, jsxs as e, Fragment as l } from "react/jsx-runtime";
2
- import { Badge as m } from "../Badge/Badge.js";
3
- import { ContextMenu as a } from "../ContextMenu/ContextMenu.js";
4
- import { Icon as _ } from "../Icon/Icon.js";
5
- import "../Icon/SvgIcon.js";
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
- h as ListItemAction
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
- interface ListItemBaseProps {
4
+ export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ export interface ListItemBaseProps {
8
6
  as?: ElementType;
9
7
  size?: ListItemSize;
10
- menu?: ContextMenuProps;
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, selected, collapsible, expanded, linkText, linkIcon, menu, badge, action, onClick, onKeyPress, style, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
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 u, jsx as i } from "react/jsx-runtime";
2
- import { c as N } from "../../index-L8X2o7IH.js";
3
- import { ListItemAction as w } from "./ListItemAction.js";
4
- import '../../assets/ListItemBase.css';const z = "_item_17cbe_3", A = "_content_17cbe_46", B = "_action_17cbe_56", E = "_linkText_17cbe_63", g = "_linkIcon_17cbe_68", s = {
5
- item: z,
6
- content: A,
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: r,
13
- className: _,
14
- href: d,
15
- size: c,
16
- color: l,
17
- active: x = !1,
18
- hidden: I = !1,
19
- selected: p,
20
- collapsible: e,
21
- expanded: a,
22
- linkText: b,
23
- linkIcon: f,
24
- menu: h,
25
- badge: k,
26
- action: v,
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 T = m || "a", j = e && a ? "chevron-up" : e ? "chevron-down" : f;
32
- return /* @__PURE__ */ u(
33
- T,
24
+ const b = m || "a";
25
+ return /* @__PURE__ */ I(
26
+ "article",
34
27
  {
35
- className: N(s.item, _),
36
- "data-color": l,
37
- "data-size": c,
38
- "data-active": x,
39
- "aria-hidden": I,
40
- "aria-selected": p,
41
- "aria-expanded": a,
42
- href: d,
43
- onKeyPress: (o) => {
44
- o.key === "Enter" && (t == null || t()), n == null || n(o);
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__ */ i("div", { className: s.content, "data-size": c, children: r }),
51
- /* @__PURE__ */ i(w, { badge: k, linkText: b, linkIcon: j, menu: h, children: v })
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
- G as ListItemBase
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;