@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.
Files changed (92) 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/ListItemBase.css +1 -1
  9. package/dist/assets/ListItemControls.css +1 -0
  10. package/dist/assets/ListItemHeader.css +1 -0
  11. package/dist/assets/ListItemLabel.css +1 -1
  12. package/dist/assets/ListItemMedia.css +1 -1
  13. package/dist/assets/ListItemSelect.css +1 -0
  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/ContextMenu/ContextMenu.d.ts +2 -1
  23. package/dist/components/ContextMenu/ContextMenu.js +19 -8
  24. package/dist/components/ContextMenu/ContextMenuBase.d.ts +2 -1
  25. package/dist/components/ContextMenu/ContextMenuBase.js +19 -18
  26. package/dist/components/Dialog/Dialog.stories.js +30 -20
  27. package/dist/components/Dialog/DialogBase.d.ts +2 -0
  28. package/dist/components/Dialog/DialogBorder.d.ts +1 -1
  29. package/dist/components/Dialog/DialogBorder.js +5 -5
  30. package/dist/components/Dialog/DialogContent.stories.js +1 -1
  31. package/dist/components/Dialog/DialogGroup.js +5 -5
  32. package/dist/components/Dialog/DialogHeader.d.ts +1 -1
  33. package/dist/components/Dialog/DialogHeader.js +6 -6
  34. package/dist/components/Dialog/DialogHeaderBase.d.ts +3 -1
  35. package/dist/components/Dialog/DialogHeaderBase.js +3 -3
  36. package/dist/components/Dialog/DialogHeadings.d.ts +2 -3
  37. package/dist/components/Dialog/DialogHeadings.js +24 -26
  38. package/dist/components/Dialog/DialogLabel.d.ts +13 -0
  39. package/dist/components/Dialog/DialogLabel.js +17 -0
  40. package/dist/components/Dialog/DialogListItem.d.ts +17 -5
  41. package/dist/components/Dialog/DialogListItem.js +86 -70
  42. package/dist/components/Dialog/DialogListItem.stories.js +117 -68
  43. package/dist/components/Dialog/DialogMetadata.d.ts +9 -1
  44. package/dist/components/Dialog/DialogMetadata.js +25 -21
  45. package/dist/components/Dialog/DialogNav.js +16 -16
  46. package/dist/components/Dialog/DialogTitle.d.ts +7 -9
  47. package/dist/components/Dialog/DialogTitle.js +9 -10
  48. package/dist/components/Dialog/Examples.stories.js +31 -0
  49. package/dist/components/Dialog/index.d.ts +1 -1
  50. package/dist/components/Dialog/index.js +41 -41
  51. package/dist/components/List/ListItem.d.ts +5 -25
  52. package/dist/components/List/ListItem.js +41 -20
  53. package/dist/components/List/ListItem.stories.js +79 -45
  54. package/dist/components/List/ListItemBase.d.ts +8 -10
  55. package/dist/components/List/ListItemBase.js +52 -46
  56. package/dist/components/List/{ListItemAction.d.ts → ListItemControls.d.ts} +3 -3
  57. package/dist/components/List/ListItemControls.js +19 -0
  58. package/dist/components/List/ListItemHeader.d.ts +8 -0
  59. package/dist/components/List/ListItemHeader.js +8 -0
  60. package/dist/components/List/ListItemLabel.js +7 -7
  61. package/dist/components/List/ListItemMedia.js +7 -7
  62. package/dist/components/List/ListItemSelect.d.ts +12 -0
  63. package/dist/components/List/ListItemSelect.js +15 -0
  64. package/dist/components/List/index.d.ts +5 -3
  65. package/dist/components/List/index.js +16 -12
  66. package/dist/components/Meta/MetaItemBase.d.ts +1 -1
  67. package/dist/components/Meta/MetaItemBase.js +21 -20
  68. package/dist/components/Meta/MetaItemLabel.js +5 -4
  69. package/dist/components/Meta/MetaItemMedia.js +9 -8
  70. package/dist/components/Page/PageNav.js +7 -7
  71. package/dist/components/Searchbar/Autocomplete.stories.js +241 -13
  72. package/dist/components/Searchbar/AutocompleteBase.js +5 -5
  73. package/dist/components/Searchbar/AutocompleteGroup.js +9 -12
  74. package/dist/components/Searchbar/AutocompleteItem.d.ts +23 -11
  75. package/dist/components/Searchbar/AutocompleteItem.js +21 -8
  76. package/dist/components/Searchbar/ScopeListItem.d.ts +12 -0
  77. package/dist/components/Searchbar/ScopeListItem.js +12 -0
  78. package/dist/components/Toolbar/ToolbarButton.js +2 -1
  79. package/dist/components/index.js +153 -149
  80. package/dist/hooks/useMenu.js +19 -19
  81. package/dist/index.js +163 -159
  82. package/package.json +1 -1
  83. package/dist/assets/DialogListItemBase.css +0 -1
  84. package/dist/assets/ListItemAction.css +0 -1
  85. package/dist/assets/metaItem.css +0 -1
  86. package/dist/components/Dialog/DialogListItemBase.d.ts +0 -28
  87. package/dist/components/Dialog/DialogListItemBase.js +0 -24
  88. package/dist/components/Dialog/DialogTitle.stories.js +0 -26
  89. package/dist/components/List/ListItemAction.js +0 -19
  90. package/dist/components/List/ListItemAction.stories.js +0 -45
  91. package/dist/metaItem.module-CfNiX769.js +0 -8
  92. /package/dist/assets/{AutocompleteItem.css → ScopeListItem.css} +0 -0
@@ -1,13 +1,12 @@
1
- import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
- import { Icon as m } from "../Icon/Icon.js";
3
- import "../Icon/SvgIcon.js";
4
- import "../../index-L8X2o7IH.js";
5
- import '../../assets/DialogTitle.css';const n = "_title_ls5lr_1", a = {
6
- title: n
7
- }, x = ({ size: e = "sm", seen: i = !1, variant: l, icon: t, children: o }) => /* @__PURE__ */ r("h2", { className: a.title, "data-seen": i, "data-size": e, "data-variant": l, children: [
8
- /* @__PURE__ */ s("span", { children: o }),
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
- x as DialogTitle
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 { 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
  };
@@ -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, 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 { 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 { 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: s,
12
- avatar: o,
13
- avatarGroup: a,
12
+ icon: e,
13
+ avatar: s,
14
+ avatarGroup: c,
14
15
  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
- ] });
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
- B as ListItem
44
+ E as ListItem
24
45
  };
@@ -1,13 +1,14 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { Fragment as p, useState as g } from "react";
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 k } from "./List.js";
10
- const c = ["lg", "md", "sm", "xs"], D = {
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
- }, T = {
22
+ }, B = {
22
23
  args: {}
23
- }, w = (n) => /* @__PURE__ */ a(s, { children: [
24
+ }, E = (n) => /* @__PURE__ */ c(s, { 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__ */ c(s, { 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,49 @@ 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 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(i, { children: "Default" }),
166
+ /* @__PURE__ */ e(r, { children: "Default" }),
134
167
  /* @__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) => {
140
- const [o, d] = g(!1), m = () => {
141
- d((r) => !r);
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((r) => ({
196
+ ], h = l == null ? void 0 : l.map((i) => ({
164
197
  avatar: {
165
- ...r,
198
+ ...i,
166
199
  type: "person"
167
200
  },
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 },
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((r) => ({
174
- name: r == null ? void 0 : r.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__ */ a(p, { children: [
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(k, { size: "xs", spacing: "none", items: h })
223
+ o && /* @__PURE__ */ e(b, { size: "sm", spacing: "none", items: h })
191
224
  ] });
192
225
  };
193
226
  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
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 { BadgeProps } from '../Badge';
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
- interface ListItemBaseProps {
5
+ export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ export interface ListItemBaseProps {
8
7
  as?: ElementType;
9
8
  size?: ListItemSize;
10
- menu?: ContextMenuProps;
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, selected, collapsible, expanded, linkText, linkIcon, menu, badge, action, onClick, onKeyPress, style, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
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 u, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as L, jsx as m } from "react/jsx-runtime";
2
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 = ({
11
- as: m,
12
- children: r,
13
- className: _,
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: 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
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 T = m || "a", j = e && a ? "chevron-up" : e ? "chevron-down" : f;
32
- return /* @__PURE__ */ u(
33
- T,
26
+ const j = c || "a";
27
+ return /* @__PURE__ */ L(
28
+ "article",
34
29
  {
35
- className: N(s.item, _),
36
- "data-color": l,
37
- "data-size": c,
30
+ className: r.item,
31
+ "data-color": f,
32
+ "data-size": t,
33
+ "data-shadow": _,
38
34
  "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,
35
+ "aria-hidden": p,
36
+ "aria-disabled": u,
37
+ "aria-selected": h,
38
+ "aria-expanded": i,
49
39
  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 })
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
- G as ListItemBase
63
+ k as ListItemBase
58
64
  };