@altinn/altinn-components 0.7.1 → 0.7.3

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 (73) hide show
  1. package/dist/assets/DialogBorder.css +1 -1
  2. package/dist/assets/DialogDescription.css +1 -0
  3. package/dist/assets/DialogHeadings.css +1 -1
  4. package/dist/assets/DialogListItem.css +1 -1
  5. package/dist/assets/HeaderButton.css +1 -1
  6. package/dist/assets/ListItemBase.css +1 -1
  7. package/dist/assets/ListItemLabel.css +1 -1
  8. package/dist/assets/MenuItemBase.css +1 -1
  9. package/dist/assets/MenuSearch.css +1 -1
  10. package/dist/assets/Skeleton.css +1 -0
  11. package/dist/assets/ToolbarSearch.css +1 -1
  12. package/dist/components/Dialog/DialogActions.d.ts +1 -2
  13. package/dist/components/Dialog/DialogBorder.d.ts +2 -1
  14. package/dist/components/Dialog/DialogBorder.js +6 -6
  15. package/dist/components/Dialog/DialogDescription.d.ts +12 -0
  16. package/dist/components/Dialog/DialogDescription.js +8 -0
  17. package/dist/components/Dialog/DialogHeadings.d.ts +2 -1
  18. package/dist/components/Dialog/DialogHeadings.js +37 -32
  19. package/dist/components/Dialog/DialogListItem.d.ts +5 -3
  20. package/dist/components/Dialog/DialogListItem.js +75 -71
  21. package/dist/components/Dialog/DialogListItem.stories.js +40 -34
  22. package/dist/components/Dialog/DialogMetadata.d.ts +3 -1
  23. package/dist/components/Dialog/DialogMetadata.js +26 -25
  24. package/dist/components/Dialog/DialogStatus.d.ts +2 -1
  25. package/dist/components/Dialog/DialogStatus.js +11 -9
  26. package/dist/components/Dialog/DialogTitle.d.ts +2 -1
  27. package/dist/components/Dialog/DialogTitle.js +10 -9
  28. package/dist/components/Dialog/DialogTouchedBy.d.ts +2 -1
  29. package/dist/components/Dialog/DialogTouchedBy.js +4 -4
  30. package/dist/components/GlobalMenu/AccountButton.js +1 -1
  31. package/dist/components/GlobalMenu/AccountMenu.js +16 -15
  32. package/dist/components/Header/Header.d.ts +3 -1
  33. package/dist/components/Header/Header.js +30 -29
  34. package/dist/components/Header/HeaderButton.d.ts +3 -1
  35. package/dist/components/Header/HeaderButton.js +37 -29
  36. package/dist/components/Header/HeaderButton.stories.js +10 -6
  37. package/dist/components/List/ListItem.d.ts +1 -1
  38. package/dist/components/List/ListItem.js +33 -37
  39. package/dist/components/List/ListItem.stories.js +41 -36
  40. package/dist/components/List/ListItemBase.d.ts +12 -12
  41. package/dist/components/List/ListItemBase.js +45 -43
  42. package/dist/components/List/ListItemHeader.d.ts +14 -2
  43. package/dist/components/List/ListItemHeader.js +29 -6
  44. package/dist/components/List/ListItemLabel.d.ts +2 -1
  45. package/dist/components/List/ListItemLabel.js +10 -9
  46. package/dist/components/List/ListItemMedia.d.ts +2 -1
  47. package/dist/components/List/ListItemMedia.js +23 -21
  48. package/dist/components/Menu/MenuItem.d.ts +7 -8
  49. package/dist/components/Menu/MenuItem.js +35 -21
  50. package/dist/components/Menu/MenuItem.stories.js +37 -35
  51. package/dist/components/Menu/MenuItemBase.d.ts +15 -13
  52. package/dist/components/Menu/MenuItemBase.js +59 -57
  53. package/dist/components/Menu/MenuSearch.d.ts +2 -1
  54. package/dist/components/Menu/MenuSearch.js +39 -19
  55. package/dist/components/Menu/MenuSearch.stories.js +10 -7
  56. package/dist/components/Meta/MetaItem.d.ts +2 -1
  57. package/dist/components/Meta/MetaItem.js +9 -8
  58. package/dist/components/Meta/MetaTimestamp.d.ts +2 -1
  59. package/dist/components/Meta/MetaTimestamp.js +14 -6
  60. package/dist/components/Searchbar/Autocomplete.d.ts +1 -0
  61. package/dist/components/Searchbar/Autocomplete.stories.js +88 -62
  62. package/dist/components/Searchbar/AutocompleteItem.js +12 -12
  63. package/dist/components/Searchbar/Searchbar.d.ts +1 -1
  64. package/dist/components/Searchbar/Searchbar.js +12 -11
  65. package/dist/components/Skeleton/Skeleton.d.ts +11 -0
  66. package/dist/components/Skeleton/Skeleton.js +9 -0
  67. package/dist/components/Skeleton/index.d.ts +1 -0
  68. package/dist/components/Skeleton/index.js +4 -0
  69. package/dist/components/Toolbar/Toolbar.js +1 -1
  70. package/dist/components/Toolbar/ToolbarSearch.d.ts +2 -1
  71. package/dist/components/Toolbar/ToolbarSearch.js +38 -18
  72. package/dist/components/Toolbar/ToolbarSearch.stories.js +8 -5
  73. package/package.json +1 -1
@@ -1,30 +1,31 @@
1
- import { jsxs as z, jsx as i } from "react/jsx-runtime";
2
- import { MetaBase as f } from "../Meta/MetaBase.js";
3
- import { MetaItem as d } from "../Meta/MetaItem.js";
1
+ import { jsxs as M, jsx as e } from "react/jsx-runtime";
2
+ import { MetaBase as a } from "../Meta/MetaBase.js";
3
+ import { MetaItem as D } from "../Meta/MetaItem.js";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../Icon/SvgIcon.js";
6
- import { MetaTimestamp as e } from "../Meta/MetaTimestamp.js";
7
- import { DialogSeenBy as h } from "./DialogSeenBy.js";
8
- import { DialogStatus as M } from "./DialogStatus.js";
9
- const q = ({
10
- status: o,
11
- updatedAt: r,
12
- updatedAtLabel: l,
13
- dueAt: m,
14
- dueAtLabel: s,
15
- trashedAt: t,
16
- trashedAtLabel: c,
17
- archivedAt: p,
18
- archivedAtLabel: x,
19
- seenBy: n,
20
- attachmentsCount: a = 0
21
- }) => /* @__PURE__ */ z(f, { size: "xs", children: [
22
- o && /* @__PURE__ */ i(M, { size: "xs", ...o }),
23
- r && /* @__PURE__ */ i(e, { datetime: r, size: "xs", children: l }),
24
- m && s && /* @__PURE__ */ i(e, { datetime: m, size: "xs", icon: "clock-dashed", children: s }),
25
- a > 0 && /* @__PURE__ */ i(d, { size: "xs", icon: "paperclip", children: a }),
26
- t && c && /* @__PURE__ */ i(e, { datetime: t, size: "xs", icon: "trash", children: c }) || p && x && /* @__PURE__ */ i(e, { datetime: p, size: "xs", icon: "archive", children: x }) || n && /* @__PURE__ */ i(h, { size: "xs", ...n })
6
+ import { MetaTimestamp as r } from "../Meta/MetaTimestamp.js";
7
+ import { DialogSeenBy as j } from "./DialogSeenBy.js";
8
+ import { DialogStatus as l } from "./DialogStatus.js";
9
+ const E = ({
10
+ loading: i,
11
+ status: m,
12
+ updatedAt: s,
13
+ updatedAtLabel: n,
14
+ dueAt: o,
15
+ dueAtLabel: t,
16
+ trashedAt: c,
17
+ trashedAtLabel: p,
18
+ archivedAt: x,
19
+ archivedAtLabel: z,
20
+ seenBy: f,
21
+ attachmentsCount: h = 0
22
+ }) => /* @__PURE__ */ M(a, { size: "xs", children: [
23
+ m && /* @__PURE__ */ e(l, { loading: i, size: "xs", ...m }),
24
+ s && /* @__PURE__ */ e(r, { loading: i, datetime: s, size: "xs", children: n }),
25
+ o && t && /* @__PURE__ */ e(r, { loading: i, datetime: o, size: "xs", icon: "clock-dashed", children: t }),
26
+ h > 0 && /* @__PURE__ */ e(D, { loading: i, size: "xs", icon: "paperclip", children: h }),
27
+ c && p && /* @__PURE__ */ e(r, { loading: i, datetime: c, size: "xs", icon: "trash", children: p }) || x && z && /* @__PURE__ */ e(r, { loading: i, datetime: x, size: "xs", icon: "archive", children: z }) || !i && f && /* @__PURE__ */ e(j, { size: "xs", ...f })
27
28
  ] });
28
29
  export {
29
- q as DialogMetadata
30
+ E as DialogMetadata
30
31
  };
@@ -15,6 +15,7 @@ export declare enum DialogStatusEnum {
15
15
  }
16
16
  export type DialogStatusValue = keyof typeof DialogStatusEnum;
17
17
  export interface DialogStatusProps {
18
+ loading?: boolean;
18
19
  size?: MetaItemSize;
19
20
  value?: DialogStatusValue;
20
21
  label?: string;
@@ -22,4 +23,4 @@ export interface DialogStatusProps {
22
23
  /**
23
24
  * Dialog status.
24
25
  */
25
- export declare const DialogStatus: ({ size, value, label }: DialogStatusProps) => import("react/jsx-runtime").JSX.Element | null;
26
+ export declare const DialogStatus: ({ loading, size, value, label }: DialogStatusProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,26 +1,28 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { MetaItem as o } from "../Meta/MetaItem.js";
3
- import { MetaProgress as i } from "../Meta/MetaProgress.js";
3
+ import { MetaProgress as s } from "../Meta/MetaProgress.js";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../Icon/SvgIcon.js";
6
- var s = /* @__PURE__ */ ((r) => (r.draft = "DRAFT", r.sent = "SENT", r.new = "NEW", r.completed = "COMPLETED", r["in-progress"] = "IN_PROGRESS", r["requires-attention"] = "REQUIRES_ATTENTION", r))(s || {});
7
- const h = ({ size: r = "xs", value: e = "new", label: t }) => {
6
+ var c = /* @__PURE__ */ ((r) => (r.draft = "DRAFT", r.sent = "SENT", r.new = "NEW", r.completed = "COMPLETED", r["in-progress"] = "IN_PROGRESS", r["requires-attention"] = "REQUIRES_ATTENTION", r))(c || {});
7
+ const m = ({ loading: r, size: i = "xs", value: e = "new", label: t }) => {
8
+ if (r)
9
+ return null;
8
10
  switch (e) {
9
11
  case "new":
10
12
  return null;
11
13
  case "draft":
12
- return /* @__PURE__ */ n(o, { size: r, variant: "dotted", children: t || e });
14
+ return /* @__PURE__ */ n(o, { size: i, variant: "dotted", children: t || e });
13
15
  case "requires-attention":
14
16
  return /* @__PURE__ */ n(o, { variant: "solid", children: t || e });
15
17
  case "in-progress":
16
- return /* @__PURE__ */ n(i, { size: r, variant: "outline", progress: 75, children: t || e });
18
+ return /* @__PURE__ */ n(s, { size: i, variant: "outline", progress: 75, children: t || e });
17
19
  case "completed":
18
- return /* @__PURE__ */ n(i, { size: r, variant: "outline", progress: 100, children: t || e });
20
+ return /* @__PURE__ */ n(s, { size: i, variant: "outline", progress: 100, children: t || e });
19
21
  default:
20
- return /* @__PURE__ */ n(o, { size: r, variant: "outline", children: t || e });
22
+ return /* @__PURE__ */ n(o, { size: i, variant: "outline", children: t || e });
21
23
  }
22
24
  };
23
25
  export {
24
- h as DialogStatus,
25
- s as DialogStatusEnum
26
+ m as DialogStatus,
27
+ c as DialogStatusEnum
26
28
  };
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { DialogSize, DialogVariant } from './DialogBase';
3
3
  export type DialogTitleProps = {
4
+ loading?: boolean;
4
5
  /** Size */
5
6
  size?: DialogSize;
6
7
  /** Variant */
@@ -15,4 +16,4 @@ export type DialogTitleProps = {
15
16
  /**
16
17
  * Dialog title
17
18
  */
18
- export declare const DialogTitle: ({ size, seen, variant, label, children }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const DialogTitle: ({ loading, size, seen, variant, label, children }: DialogTitleProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
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 })
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { Skeleton as d } from "../Skeleton/Skeleton.js";
3
+ import { DialogLabel as c } from "./DialogLabel.js";
4
+ import '../../assets/DialogTitle.css';const m = "_heading_1fk12_1", h = "_title_1fk12_7", a = {
5
+ heading: m,
6
+ title: h
7
+ }, p = ({ loading: t, size: l = "sm", seen: n = !1, variant: i, label: s, children: o }) => /* @__PURE__ */ r("div", { className: a.heading, children: [
8
+ /* @__PURE__ */ e("h2", { className: a.title, "data-seen": n, "data-size": l, "data-variant": i, children: /* @__PURE__ */ e(d, { loading: t, children: o }) }),
9
+ !t && s && /* @__PURE__ */ e(c, { variant: i, size: "xs", children: s })
9
10
  ] });
10
11
  export {
11
- g as DialogTitle
12
+ p as DialogTitle
12
13
  };
@@ -3,8 +3,9 @@ export interface DialogTouchedByActor {
3
3
  name: string;
4
4
  }
5
5
  export interface DialogTouchedByProps {
6
+ loading?: boolean;
6
7
  size?: AvatarSize;
7
8
  touchedBy?: DialogTouchedByActor[];
8
9
  className?: string;
9
10
  }
10
- export declare const DialogTouchedBy: ({ size, touchedBy, className }: DialogTouchedByProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ export declare const DialogTouchedBy: ({ loading, size, touchedBy, className }: DialogTouchedByProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,8 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { AvatarGroup as o } from "../Avatar/AvatarGroup.js";
5
- const a = ({ size: m = "sm", touchedBy: r = [], className: p }) => r != null && r.length ? /* @__PURE__ */ i(o, { defaultType: "person", items: r, size: m, className: p }) : null;
4
+ import { AvatarGroup as t } from "../Avatar/AvatarGroup.js";
5
+ const e = ({ loading: m, size: p = "sm", touchedBy: r = [], className: i }) => !(r != null && r.length) || m ? null : /* @__PURE__ */ o(t, { defaultType: "person", items: r, size: p, className: i });
6
6
  export {
7
- a as DialogTouchedBy
7
+ e as DialogTouchedBy
8
8
  };
@@ -6,7 +6,7 @@ import "../../index-L8X2o7IH.js";
6
6
  import "../Icon/SvgIcon.js";
7
7
  import "react";
8
8
  import "../RootProvider/RootProvider.js";
9
- const x = ({ account: e, linkText: l, onClick: t, multipleAccounts: d }) => d ? /* @__PURE__ */ r(m, { size: "lg", onClick: t, linkText: l, linkIcon: "arrow-right", as: "button", children: [
9
+ const x = ({ account: e, linkText: l, onClick: t, multipleAccounts: d }) => d ? /* @__PURE__ */ r(m, { size: "lg", onClick: t, linkText: l, linkIcon: "chevron-right", as: "button", children: [
10
10
  /* @__PURE__ */ i(
11
11
  s,
12
12
  {
@@ -5,14 +5,14 @@ import "../../index-L8X2o7IH.js";
5
5
  import "../Icon/SvgIcon.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import { Menu as b } from "../Menu/Menu.js";
8
- const v = (r) => `${r} hits`, k = ({
8
+ const v = (r) => `${r} hits`, a = ({
9
9
  accounts: r = [],
10
- accountGroups: f = {},
10
+ accountGroups: o = {},
11
11
  accountSearch: s,
12
12
  onSelectAccount: t,
13
13
  currentAccount: d
14
14
  }) => {
15
- var m;
15
+ var g;
16
16
  const p = r.map((e) => ({
17
17
  id: e.id || e.name,
18
18
  groupId: e.groupId || "search",
@@ -23,34 +23,35 @@ const v = (r) => `${r} hits`, k = ({
23
23
  name: e.name
24
24
  },
25
25
  onClick: () => t == null ? void 0 : t(e.id || e.name)
26
- })), [i, o] = M(""), l = i ? p.filter((e) => {
27
- var g;
28
- return (g = e == null ? void 0 : e.title) == null ? void 0 : g.toLowerCase().includes(i.toLowerCase());
26
+ })), [i, m] = M(""), l = i ? p.filter((e) => {
27
+ var f;
28
+ return (f = e == null ? void 0 : e.title) == null ? void 0 : f.toLowerCase().includes(i.toLowerCase());
29
29
  }).map((e) => ({
30
30
  ...e,
31
31
  groupId: "search"
32
- })) : p, I = i ? {
32
+ })) : p, C = i ? {
33
33
  search: {
34
- title: ((m = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : m.call(s, l.length)) ?? v(l.length)
34
+ title: ((g = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : g.call(s, l.length)) ?? v(l.length)
35
35
  }
36
- } : f, h = {
36
+ } : o, I = {
37
37
  name: "account-search",
38
38
  value: i,
39
39
  placeholder: (s == null ? void 0 : s.placeholder) ?? "Find account",
40
- onChange: (e) => o(e.target.value)
41
- }, C = [
40
+ onChange: (e) => m(e.target.value),
41
+ onClear: () => m("")
42
+ }, h = [
42
43
  ...l.length > 0 ? l : [{ id: "search", groupId: "search", hidden: !0 }]
43
44
  ];
44
45
  return /* @__PURE__ */ L(
45
46
  b,
46
47
  {
47
48
  theme: "global",
48
- search: s && h,
49
- groups: I,
50
- items: C
49
+ search: s && I,
50
+ groups: C,
51
+ items: h
51
52
  }
52
53
  );
53
54
  };
54
55
  export {
55
- k as AccountMenu
56
+ a as AccountMenu
56
57
  };
@@ -1,3 +1,4 @@
1
+ import { BadgeProps } from '../Badge';
1
2
  import { GlobalMenuProps, Account } from '../GlobalMenu';
2
3
  import { SearchbarProps } from '../Searchbar';
3
4
  import { HeaderLogoProps } from './HeaderLogo';
@@ -5,6 +6,7 @@ export interface HeaderProps {
5
6
  menu: GlobalMenuProps;
6
7
  search?: SearchbarProps;
7
8
  currentAccount?: Account;
9
+ badge?: BadgeProps;
8
10
  logo?: HeaderLogoProps;
9
11
  }
10
- export declare const Header: ({ search, menu, currentAccount, logo }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Header: ({ search, menu, currentAccount, logo, badge }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,53 +1,54 @@
1
1
  "use client";
2
2
  import { jsxs as p, jsx as o } from "react/jsx-runtime";
3
3
  import "react";
4
- import { useEscapeKey as w } from "../../hooks/useEscapeKey.js";
5
- import { DropdownBase as g } from "../Dropdown/DropdownBase.js";
4
+ import { useEscapeKey as g } from "../../hooks/useEscapeKey.js";
5
+ import { DropdownBase as x } from "../Dropdown/DropdownBase.js";
6
6
  import "../../index-L8X2o7IH.js";
7
- import { DrawerBase as x } from "../Dropdown/DrawerBase.js";
7
+ import { DrawerBase as H } from "../Dropdown/DrawerBase.js";
8
8
  import "../Icon/SvgIcon.js";
9
- import { useRootContext as H } from "../RootProvider/RootProvider.js";
9
+ import { useRootContext as _ } from "../RootProvider/RootProvider.js";
10
10
  import { GlobalMenu as t } from "../GlobalMenu/GlobalMenu.js";
11
- import { HeaderBase as _ } from "./HeaderBase.js";
12
- import { HeaderLogo as C } from "./HeaderLogo.js";
13
- import { HeaderButton as b } from "./HeaderButton.js";
14
- import { Searchbar as y } from "../Searchbar/Searchbar.js";
15
- import { HeaderMenu as B } from "./HeaderMenu.js";
16
- import { HeaderSearch as N } from "./HeaderSearch.js";
17
- import '../../assets/Header.css';const S = "_drawer_1wgf5_1", I = "_dropdown_1wgf5_5", d = {
18
- drawer: S,
19
- dropdown: I
20
- }, J = ({ search: s, menu: r, currentAccount: a, logo: l = {} }) => {
21
- const { currentId: e, toggleId: n, openId: i, closeAll: m } = H();
22
- w(m);
23
- const c = () => {
24
- i("search");
25
- }, f = () => {
26
- n("search");
11
+ import { HeaderBase as C } from "./HeaderBase.js";
12
+ import { HeaderLogo as b } from "./HeaderLogo.js";
13
+ import { HeaderButton as y } from "./HeaderButton.js";
14
+ import { Searchbar as B } from "../Searchbar/Searchbar.js";
15
+ import { HeaderMenu as N } from "./HeaderMenu.js";
16
+ import { HeaderSearch as S } from "./HeaderSearch.js";
17
+ import '../../assets/Header.css';const I = "_drawer_1wgf5_1", M = "_dropdown_1wgf5_5", d = {
18
+ drawer: I,
19
+ dropdown: M
20
+ }, O = ({ search: s, menu: r, currentAccount: a, logo: l = {}, badge: i }) => {
21
+ const { currentId: e, toggleId: n, openId: c, closeAll: m } = _();
22
+ g(m);
23
+ const f = () => {
24
+ c("search");
27
25
  }, h = () => {
26
+ n("search");
27
+ }, w = () => {
28
28
  n("menu");
29
29
  };
30
- return /* @__PURE__ */ p(_, { currentId: e, open: e === "search" || e === "menu", onClose: m, children: [
31
- /* @__PURE__ */ o(C, { ...l, className: d.logo }),
32
- /* @__PURE__ */ p(B, { className: d.menu, children: [
30
+ return /* @__PURE__ */ p(C, { currentId: e, open: e === "search" || e === "menu", onClose: m, children: [
31
+ /* @__PURE__ */ o(b, { ...l, className: d.logo }),
32
+ /* @__PURE__ */ p(N, { className: d.menu, children: [
33
33
  /* @__PURE__ */ o(
34
- b,
34
+ y,
35
35
  {
36
+ badge: i,
36
37
  avatar: a && {
37
38
  type: a.type,
38
39
  name: a.name
39
40
  },
40
- onClick: h,
41
+ onClick: w,
41
42
  expanded: e === "menu",
42
43
  label: r == null ? void 0 : r.menuLabel
43
44
  }
44
45
  ),
45
- r && /* @__PURE__ */ o(g, { padding: !1, placement: "right", expanded: e === "menu", className: d.dropdown, children: /* @__PURE__ */ o(t, { ...r, currentAccount: a }) })
46
+ r && /* @__PURE__ */ o(x, { padding: !1, placement: "right", expanded: e === "menu", className: d.dropdown, children: /* @__PURE__ */ o(t, { ...r, currentAccount: a }) })
46
47
  ] }),
47
- s && /* @__PURE__ */ o(N, { expanded: e === "search", children: /* @__PURE__ */ o(y, { ...s, expanded: e === "search", onClose: f, onFocus: c }) }),
48
- r && /* @__PURE__ */ o(x, { expanded: e === "menu", className: d.drawer, children: /* @__PURE__ */ o(t, { ...r, currentAccount: a }) })
48
+ s && /* @__PURE__ */ o(S, { expanded: e === "search", children: /* @__PURE__ */ o(B, { ...s, expanded: e === "search", onClose: h, onFocus: f }) }),
49
+ r && /* @__PURE__ */ o(H, { expanded: e === "menu", className: d.drawer, children: /* @__PURE__ */ o(t, { ...r, currentAccount: a }) })
49
50
  ] });
50
51
  };
51
52
  export {
52
- J as Header
53
+ O as Header
53
54
  };
@@ -1,5 +1,6 @@
1
1
  import { ElementType } from 'react';
2
2
  import { AvatarProps, AvatarGroupProps } from '../Avatar';
3
+ import { BadgeProps } from '../Badge';
3
4
  import { ButtonProps } from '../Button';
4
5
  import { IconName } from '../Icon';
5
6
  export interface HeaderButtonProps extends ButtonProps {
@@ -10,6 +11,7 @@ export interface HeaderButtonProps extends ButtonProps {
10
11
  className?: string;
11
12
  expanded?: boolean;
12
13
  icon?: IconName;
14
+ badge?: BadgeProps;
13
15
  tabIndex?: number;
14
16
  }
15
- export declare const HeaderButton: ({ className, as, avatar, avatarGroup, icon, expanded, label, ...buttonProps }: HeaderButtonProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const HeaderButton: ({ className, as, avatar, avatarGroup, icon, expanded, label, badge, ...buttonProps }: HeaderButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,38 +1,46 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { c as e } from "../../index-L8X2o7IH.js";
3
- import { Avatar as u } from "../Avatar/Avatar.js";
4
- import { AvatarGroup as h } from "../Avatar/AvatarGroup.js";
5
- import { ButtonBase as r } from "../Button/ButtonBase.js";
6
- import { Icon as b } from "../Icon/Icon.js";
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { c as s } from "../../index-L8X2o7IH.js";
3
+ import { Avatar as N } from "../Avatar/Avatar.js";
4
+ import { AvatarGroup as f } from "../Avatar/AvatarGroup.js";
5
+ import { Badge as a } from "../Badge/Badge.js";
6
+ import { ButtonBase as u } from "../Button/ButtonBase.js";
7
+ import { Icon as p } from "../Icon/Icon.js";
7
8
  import "../Icon/SvgIcon.js";
8
- import '../../assets/HeaderButton.css';const f = "_button_t01b4_1", I = "_label_t01b4_14", N = "_icon_t01b4_20", g = "_loginIcon_t01b4_30", x = "_closeIcon_t01b4_35", n = {
9
- button: f,
10
- label: I,
11
- icon: N,
12
- loginIcon: g,
13
- closeIcon: x
14
- }, H = ({
9
+ import '../../assets/HeaderButton.css';const h = "_button_buvev_1", v = "_label_buvev_14", I = "_icon_buvev_20", g = "_avatarGroup_buvev_30", x = "_loginIcon_buvev_39", B = "_closeIcon_buvev_44", G = "_badge_buvev_48", n = {
10
+ button: h,
11
+ label: v,
12
+ icon: I,
13
+ avatarGroup: g,
14
+ loginIcon: x,
15
+ closeIcon: B,
16
+ badge: G
17
+ }, w = ({
15
18
  className: l,
16
- as: s = "button",
19
+ as: t = "button",
17
20
  avatar: c,
18
21
  avatarGroup: _,
19
- icon: p = "padlock-locked",
22
+ icon: b = "padlock-locked",
20
23
  expanded: d,
21
- label: t = "Menu",
24
+ label: m = "Menu",
25
+ badge: o,
22
26
  ...i
23
- }) => d ? /* @__PURE__ */ m(r, { ...i, as: s, className: e(n.button, l), children: [
24
- /* @__PURE__ */ o("span", { className: n.label, children: t }),
25
- /* @__PURE__ */ o("span", { className: e(n.icon, n.closeIcon), children: /* @__PURE__ */ o(b, { name: "x-mark" }) })
26
- ] }) : _ ? /* @__PURE__ */ m(r, { ...i, as: s, className: e(n.button, l), children: [
27
- /* @__PURE__ */ o("span", { className: n.label, children: t }),
28
- /* @__PURE__ */ o(h, { ..._, size: "sm" })
29
- ] }) : c ? /* @__PURE__ */ m(r, { ...i, as: s, className: e(n.button, l), children: [
30
- /* @__PURE__ */ o("span", { className: n.label, children: t }),
31
- /* @__PURE__ */ o(u, { type: c == null ? void 0 : c.type, name: c == null ? void 0 : c.name, size: "lg" })
32
- ] }) : /* @__PURE__ */ m(r, { ...i, as: s, className: e(n.button, l), children: [
33
- /* @__PURE__ */ o("span", { className: n.label, children: t }),
34
- /* @__PURE__ */ o("span", { className: e(n.icon, n.loginIcon), children: /* @__PURE__ */ o(b, { name: p }) })
27
+ }) => d ? /* @__PURE__ */ r(u, { ...i, as: t, className: s(n.button, l), children: [
28
+ /* @__PURE__ */ e("span", { className: n.label, children: m }),
29
+ /* @__PURE__ */ e("span", { className: s(n.icon, n.closeIcon), children: /* @__PURE__ */ e(p, { name: "x-mark" }) }),
30
+ o && /* @__PURE__ */ e(a, { ...o, className: n.badge })
31
+ ] }) : _ ? /* @__PURE__ */ r(u, { ...i, as: t, className: s(n.button, l), children: [
32
+ /* @__PURE__ */ e("span", { className: n.label, children: m }),
33
+ /* @__PURE__ */ e(f, { ..._, size: "sm", className: n.avatarGroup }),
34
+ o && /* @__PURE__ */ e(a, { ...o, className: n.badge })
35
+ ] }) : c ? /* @__PURE__ */ r(u, { ...i, as: t, className: s(n.button, l), children: [
36
+ /* @__PURE__ */ e("span", { className: n.label, children: m }),
37
+ /* @__PURE__ */ e(N, { type: c == null ? void 0 : c.type, name: c == null ? void 0 : c.name, size: "lg" }),
38
+ o && /* @__PURE__ */ e(a, { ...o, className: n.badge })
39
+ ] }) : /* @__PURE__ */ r(u, { ...i, as: t, className: s(n.button, l), children: [
40
+ /* @__PURE__ */ e("span", { className: n.label, children: m }),
41
+ /* @__PURE__ */ e("span", { className: s(n.icon, n.loginIcon), children: /* @__PURE__ */ e(p, { name: b }) }),
42
+ o && /* @__PURE__ */ e(a, { ...o, className: n.badge })
35
43
  ] });
36
44
  export {
37
- H as HeaderButton
45
+ w as HeaderButton
38
46
  };
@@ -1,5 +1,5 @@
1
1
  import { HeaderButton as a } from "./HeaderButton.js";
2
- const n = {
2
+ const r = {
3
3
  title: "Header/HeaderButton",
4
4
  component: a,
5
5
  tags: ["autodocs"],
@@ -7,7 +7,7 @@ const n = {
7
7
  layout: "centered"
8
8
  },
9
9
  args: {}
10
- }, r = {
10
+ }, n = {
11
11
  args: {}
12
12
  }, t = {
13
13
  args: {
@@ -25,6 +25,10 @@ const n = {
25
25
  avatar: {
26
26
  type: "company",
27
27
  name: "Bergen bar"
28
+ },
29
+ badge: {
30
+ color: "alert",
31
+ label: "2"
28
32
  }
29
33
  }
30
34
  }, p = {
@@ -41,7 +45,7 @@ const n = {
41
45
  ]
42
46
  }
43
47
  }
44
- }, m = {
48
+ }, c = {
45
49
  args: {
46
50
  expanded: !0,
47
51
  avatar: {
@@ -53,9 +57,9 @@ const n = {
53
57
  export {
54
58
  s as Company,
55
59
  p as CompanyGroup,
56
- r as Default,
57
- m as Expanded,
60
+ n as Default,
61
+ c as Expanded,
58
62
  t as Icon,
59
63
  o as Person,
60
- n as default
64
+ r as default
61
65
  };
@@ -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, size, icon, avatar, avatarGroup, title, description, children, collapsible, expanded, badge, linkText, linkIcon, menu, select, controls, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const ListItem: ({ as, color, loading, size, icon, avatar, avatarGroup, title, description, collapsible, expanded, badge, linkText, linkIcon, menu, select, controls, children, ...rest }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,45 +1,41 @@
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,
11
- size: t = "sm",
12
- icon: e,
13
- avatar: s,
14
- avatarGroup: c,
15
- title: p,
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { ListItemBase as v } from "./ListItemBase.js";
3
+ import { ListItemControls as x } from "./ListItemControls.js";
4
+ import { ListItemHeader as j } from "./ListItemHeader.js";
5
+ import { ListItemLabel as w } from "./ListItemLabel.js";
6
+ const D = ({
7
+ as: e = "a",
8
+ color: n,
9
+ loading: o,
10
+ size: r = "sm",
11
+ icon: i,
12
+ avatar: c,
13
+ avatarGroup: p,
14
+ title: s,
16
15
  description: I,
17
- children: L,
18
16
  collapsible: m,
19
- expanded: i,
17
+ expanded: L,
20
18
  badge: a,
21
- linkText: l,
22
- linkIcon: f,
23
- menu: d,
24
- select: h,
25
- controls: k,
26
- ...b
27
- }) => /* @__PURE__ */ o(
28
- u,
19
+ linkText: f,
20
+ linkIcon: l,
21
+ menu: h,
22
+ select: k,
23
+ controls: b,
24
+ children: d,
25
+ ...u
26
+ }) => /* @__PURE__ */ t(
27
+ v,
29
28
  {
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
- ] })
29
+ as: e,
30
+ size: r,
31
+ color: n,
32
+ loading: o,
33
+ select: k,
34
+ controls: b || /* @__PURE__ */ t(x, { linkIcon: m && L ? "chevron-up" : m ? "chevron-down" : l, linkText: f, menu: h, badge: a }),
35
+ ...u,
36
+ children: /* @__PURE__ */ t(j, { loading: o, size: r, icon: i, avatar: c, avatarGroup: p, children: /* @__PURE__ */ t(w, { loading: o, title: s, description: I, size: r, children: d }) })
41
37
  }
42
38
  );
43
39
  export {
44
- E as ListItem
40
+ D as ListItem
45
41
  };