@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.
- package/dist/assets/DialogBorder.css +1 -1
- package/dist/assets/DialogDescription.css +1 -0
- package/dist/assets/DialogHeadings.css +1 -1
- package/dist/assets/DialogListItem.css +1 -1
- package/dist/assets/HeaderButton.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemLabel.css +1 -1
- package/dist/assets/MenuItemBase.css +1 -1
- package/dist/assets/MenuSearch.css +1 -1
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/ToolbarSearch.css +1 -1
- package/dist/components/Dialog/DialogActions.d.ts +1 -2
- package/dist/components/Dialog/DialogBorder.d.ts +2 -1
- package/dist/components/Dialog/DialogBorder.js +6 -6
- package/dist/components/Dialog/DialogDescription.d.ts +12 -0
- package/dist/components/Dialog/DialogDescription.js +8 -0
- package/dist/components/Dialog/DialogHeadings.d.ts +2 -1
- package/dist/components/Dialog/DialogHeadings.js +37 -32
- package/dist/components/Dialog/DialogListItem.d.ts +5 -3
- package/dist/components/Dialog/DialogListItem.js +75 -71
- package/dist/components/Dialog/DialogListItem.stories.js +40 -34
- package/dist/components/Dialog/DialogMetadata.d.ts +3 -1
- package/dist/components/Dialog/DialogMetadata.js +26 -25
- package/dist/components/Dialog/DialogStatus.d.ts +2 -1
- package/dist/components/Dialog/DialogStatus.js +11 -9
- package/dist/components/Dialog/DialogTitle.d.ts +2 -1
- package/dist/components/Dialog/DialogTitle.js +10 -9
- package/dist/components/Dialog/DialogTouchedBy.d.ts +2 -1
- package/dist/components/Dialog/DialogTouchedBy.js +4 -4
- package/dist/components/GlobalMenu/AccountButton.js +1 -1
- package/dist/components/GlobalMenu/AccountMenu.js +16 -15
- package/dist/components/Header/Header.d.ts +3 -1
- package/dist/components/Header/Header.js +30 -29
- package/dist/components/Header/HeaderButton.d.ts +3 -1
- package/dist/components/Header/HeaderButton.js +37 -29
- package/dist/components/Header/HeaderButton.stories.js +10 -6
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/List/ListItem.js +33 -37
- package/dist/components/List/ListItem.stories.js +41 -36
- package/dist/components/List/ListItemBase.d.ts +12 -12
- package/dist/components/List/ListItemBase.js +45 -43
- package/dist/components/List/ListItemHeader.d.ts +14 -2
- package/dist/components/List/ListItemHeader.js +29 -6
- package/dist/components/List/ListItemLabel.d.ts +2 -1
- package/dist/components/List/ListItemLabel.js +10 -9
- package/dist/components/List/ListItemMedia.d.ts +2 -1
- package/dist/components/List/ListItemMedia.js +23 -21
- package/dist/components/Menu/MenuItem.d.ts +7 -8
- package/dist/components/Menu/MenuItem.js +35 -21
- package/dist/components/Menu/MenuItem.stories.js +37 -35
- package/dist/components/Menu/MenuItemBase.d.ts +15 -13
- package/dist/components/Menu/MenuItemBase.js +59 -57
- package/dist/components/Menu/MenuSearch.d.ts +2 -1
- package/dist/components/Menu/MenuSearch.js +39 -19
- package/dist/components/Menu/MenuSearch.stories.js +10 -7
- package/dist/components/Meta/MetaItem.d.ts +2 -1
- package/dist/components/Meta/MetaItem.js +9 -8
- package/dist/components/Meta/MetaTimestamp.d.ts +2 -1
- package/dist/components/Meta/MetaTimestamp.js +14 -6
- package/dist/components/Searchbar/Autocomplete.d.ts +1 -0
- package/dist/components/Searchbar/Autocomplete.stories.js +88 -62
- package/dist/components/Searchbar/AutocompleteItem.js +12 -12
- package/dist/components/Searchbar/Searchbar.d.ts +1 -1
- package/dist/components/Searchbar/Searchbar.js +12 -11
- package/dist/components/Skeleton/Skeleton.d.ts +11 -0
- package/dist/components/Skeleton/Skeleton.js +9 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Skeleton/index.js +4 -0
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.d.ts +2 -1
- package/dist/components/Toolbar/ToolbarSearch.js +38 -18
- package/dist/components/Toolbar/ToolbarSearch.stories.js +8 -5
- package/package.json +1 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { MetaBase as
|
|
3
|
-
import { MetaItem as
|
|
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
|
|
7
|
-
import { DialogSeenBy as
|
|
8
|
-
import { DialogStatus as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
|
3
|
+
import { MetaProgress as s } from "../Meta/MetaProgress.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "../Icon/SvgIcon.js";
|
|
6
|
-
var
|
|
7
|
-
const
|
|
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:
|
|
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(
|
|
18
|
+
return /* @__PURE__ */ n(s, { size: i, variant: "outline", progress: 75, children: t || e });
|
|
17
19
|
case "completed":
|
|
18
|
-
return /* @__PURE__ */ n(
|
|
20
|
+
return /* @__PURE__ */ n(s, { size: i, variant: "outline", progress: 100, children: t || e });
|
|
19
21
|
default:
|
|
20
|
-
return /* @__PURE__ */ n(o, { size:
|
|
22
|
+
return /* @__PURE__ */ n(o, { size: i, variant: "outline", children: t || e });
|
|
21
23
|
}
|
|
22
24
|
};
|
|
23
25
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { AvatarGroup as
|
|
5
|
-
const
|
|
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
|
-
|
|
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: "
|
|
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`,
|
|
8
|
+
const v = (r) => `${r} hits`, a = ({
|
|
9
9
|
accounts: r = [],
|
|
10
|
-
accountGroups:
|
|
10
|
+
accountGroups: o = {},
|
|
11
11
|
accountSearch: s,
|
|
12
12
|
onSelectAccount: t,
|
|
13
13
|
currentAccount: d
|
|
14
14
|
}) => {
|
|
15
|
-
var
|
|
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,
|
|
27
|
-
var
|
|
28
|
-
return (
|
|
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,
|
|
32
|
+
})) : p, C = i ? {
|
|
33
33
|
search: {
|
|
34
|
-
title: ((
|
|
34
|
+
title: ((g = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : g.call(s, l.length)) ?? v(l.length)
|
|
35
35
|
}
|
|
36
|
-
} :
|
|
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) =>
|
|
41
|
-
|
|
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 &&
|
|
49
|
-
groups:
|
|
50
|
-
items:
|
|
49
|
+
search: s && I,
|
|
50
|
+
groups: C,
|
|
51
|
+
items: h
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
54
|
};
|
|
54
55
|
export {
|
|
55
|
-
|
|
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
|
|
5
|
-
import { DropdownBase as
|
|
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
|
|
7
|
+
import { DrawerBase as H } from "../Dropdown/DrawerBase.js";
|
|
8
8
|
import "../Icon/SvgIcon.js";
|
|
9
|
-
import { useRootContext as
|
|
9
|
+
import { useRootContext as _ } from "../RootProvider/RootProvider.js";
|
|
10
10
|
import { GlobalMenu as t } from "../GlobalMenu/GlobalMenu.js";
|
|
11
|
-
import { HeaderBase as
|
|
12
|
-
import { HeaderLogo as
|
|
13
|
-
import { HeaderButton as
|
|
14
|
-
import { Searchbar as
|
|
15
|
-
import { HeaderMenu as
|
|
16
|
-
import { HeaderSearch as
|
|
17
|
-
import '../../assets/Header.css';const
|
|
18
|
-
drawer:
|
|
19
|
-
dropdown:
|
|
20
|
-
},
|
|
21
|
-
const { currentId: e, toggleId: n, openId:
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
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(
|
|
31
|
-
/* @__PURE__ */ o(
|
|
32
|
-
/* @__PURE__ */ p(
|
|
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
|
-
|
|
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:
|
|
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(
|
|
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(
|
|
48
|
-
r && /* @__PURE__ */ o(
|
|
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
|
-
|
|
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
|
|
2
|
-
import { c as
|
|
3
|
-
import { Avatar as
|
|
4
|
-
import { AvatarGroup as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
9
|
-
button:
|
|
10
|
-
label:
|
|
11
|
-
icon:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
19
|
+
as: t = "button",
|
|
17
20
|
avatar: c,
|
|
18
21
|
avatarGroup: _,
|
|
19
|
-
icon:
|
|
22
|
+
icon: b = "padlock-locked",
|
|
20
23
|
expanded: d,
|
|
21
|
-
label:
|
|
24
|
+
label: m = "Menu",
|
|
25
|
+
badge: o,
|
|
22
26
|
...i
|
|
23
|
-
}) => d ? /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
45
|
+
w as HeaderButton
|
|
38
46
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HeaderButton as a } from "./HeaderButton.js";
|
|
2
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
|
|
57
|
-
|
|
60
|
+
n as Default,
|
|
61
|
+
c as Expanded,
|
|
58
62
|
t as Icon,
|
|
59
63
|
o as Person,
|
|
60
|
-
|
|
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,
|
|
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
|
|
2
|
-
import { ListItemBase as
|
|
3
|
-
import { ListItemControls as
|
|
4
|
-
import { ListItemHeader as
|
|
5
|
-
import { ListItemLabel as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
17
|
+
expanded: L,
|
|
20
18
|
badge: a,
|
|
21
|
-
linkText:
|
|
22
|
-
linkIcon:
|
|
23
|
-
menu:
|
|
24
|
-
select:
|
|
25
|
-
controls:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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:
|
|
31
|
-
size:
|
|
32
|
-
color:
|
|
33
|
-
|
|
34
|
-
select:
|
|
35
|
-
controls:
|
|
36
|
-
...
|
|
37
|
-
children: /* @__PURE__ */ j
|
|
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
|
-
|
|
40
|
+
D as ListItem
|
|
45
41
|
};
|