@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,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as s, useState as g } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
|
-
import { Button as
|
|
5
|
+
import { Button as b } from "../Button/Button.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import { MetaItem as r } from "../Meta/MetaItem.js";
|
|
8
8
|
import { ListItem as t } from "./ListItem.js";
|
|
9
|
-
import { ListBase as
|
|
10
|
-
import { List as
|
|
11
|
-
const
|
|
9
|
+
import { ListBase as d } from "./ListBase.js";
|
|
10
|
+
import { List as k } from "./List.js";
|
|
11
|
+
const l = ["lg", "md", "sm", "xs"], T = {
|
|
12
12
|
title: "List/ListItem",
|
|
13
13
|
component: t,
|
|
14
14
|
tags: ["autodocs"],
|
|
@@ -21,7 +21,7 @@ const a = ["lg", "md", "sm", "xs"], T = {
|
|
|
21
21
|
}
|
|
22
22
|
}, B = {
|
|
23
23
|
args: {}
|
|
24
|
-
}, E = (n) => /* @__PURE__ */
|
|
24
|
+
}, E = (n) => /* @__PURE__ */ a(d, { children: [
|
|
25
25
|
/* @__PURE__ */ e(t, { ...n }),
|
|
26
26
|
/* @__PURE__ */ e(r, { children: "No media" }),
|
|
27
27
|
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear" }),
|
|
@@ -106,7 +106,11 @@ const a = ["lg", "md", "sm", "xs"], T = {
|
|
|
106
106
|
}
|
|
107
107
|
),
|
|
108
108
|
/* @__PURE__ */ e(r, { children: "Company group" })
|
|
109
|
-
] }), H = (n) => /* @__PURE__ */
|
|
109
|
+
] }), H = (n) => /* @__PURE__ */ e(d, { children: l == null ? void 0 : l.map((i) => /* @__PURE__ */ a(s, { children: [
|
|
110
|
+
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: i, loading: !0 }),
|
|
111
|
+
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: i, loading: !1 }),
|
|
112
|
+
/* @__PURE__ */ e(r, { children: i })
|
|
113
|
+
] }, i)) }), M = (n) => /* @__PURE__ */ a(d, { children: [
|
|
110
114
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right" }),
|
|
111
115
|
/* @__PURE__ */ e(r, { children: "Link icon, emphasising that this will take you somewhere" }),
|
|
112
116
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right", linkText: "Åpne" }),
|
|
@@ -134,16 +138,16 @@ const a = ["lg", "md", "sm", "xs"], T = {
|
|
|
134
138
|
t,
|
|
135
139
|
{
|
|
136
140
|
...n,
|
|
137
|
-
controls: /* @__PURE__ */ e("div", { style: { position: "absolute", right: 0, display: "flex", alignItems: "center", margin: "0.625rem" }, children: /* @__PURE__ */ e(
|
|
141
|
+
controls: /* @__PURE__ */ e("div", { style: { position: "absolute", right: 0, display: "flex", alignItems: "center", margin: "0.625rem" }, children: /* @__PURE__ */ e(b, { icon: "pencil", size: "sm", variant: "outline", children: "Rediger" }) })
|
|
138
142
|
}
|
|
139
143
|
),
|
|
140
144
|
/* @__PURE__ */ e(r, { children: "List item with custom controls" })
|
|
141
|
-
] }),
|
|
145
|
+
] }), S = (n) => /* @__PURE__ */ e(d, { children: l == null ? void 0 : l.map((i) => /* @__PURE__ */ a(s, { children: [
|
|
142
146
|
/* @__PURE__ */ e(
|
|
143
147
|
t,
|
|
144
148
|
{
|
|
145
149
|
...n,
|
|
146
|
-
size:
|
|
150
|
+
size: i,
|
|
147
151
|
select: {
|
|
148
152
|
checked: !1
|
|
149
153
|
}
|
|
@@ -153,26 +157,26 @@ const a = ["lg", "md", "sm", "xs"], T = {
|
|
|
153
157
|
t,
|
|
154
158
|
{
|
|
155
159
|
...n,
|
|
156
|
-
size:
|
|
160
|
+
size: i,
|
|
157
161
|
select: {
|
|
158
162
|
checked: !0
|
|
159
163
|
},
|
|
160
164
|
selected: !0
|
|
161
165
|
}
|
|
162
166
|
),
|
|
163
|
-
/* @__PURE__ */ e(r, { children:
|
|
164
|
-
] },
|
|
167
|
+
/* @__PURE__ */ e(r, { children: i })
|
|
168
|
+
] }, i)) }), _ = (n) => /* @__PURE__ */ a(d, { children: [
|
|
165
169
|
/* @__PURE__ */ e(t, { ...n }),
|
|
166
170
|
/* @__PURE__ */ e(r, { children: "Default" }),
|
|
167
171
|
/* @__PURE__ */ e(t, { ...n, color: "accent" }),
|
|
168
172
|
/* @__PURE__ */ e(r, { children: "Accent" })
|
|
169
|
-
] }),
|
|
170
|
-
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size:
|
|
171
|
-
/* @__PURE__ */ e(r, { children:
|
|
172
|
-
] },
|
|
173
|
-
const [
|
|
174
|
-
p((
|
|
175
|
-
},
|
|
173
|
+
] }), j = (n) => /* @__PURE__ */ e(d, { children: l == null ? void 0 : l.map((i) => /* @__PURE__ */ a(s, { children: [
|
|
174
|
+
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: i, selected: i === (n == null ? void 0 : n.size), linkIcon: "chevron-right" }),
|
|
175
|
+
/* @__PURE__ */ e(r, { children: i })
|
|
176
|
+
] }, i)) }), P = (n) => {
|
|
177
|
+
const [i, p] = g(!1), m = () => {
|
|
178
|
+
p((o) => !o);
|
|
179
|
+
}, c = [
|
|
176
180
|
{
|
|
177
181
|
name: "Per Ove Ludvigsen",
|
|
178
182
|
role: "Sportlig leder",
|
|
@@ -193,43 +197,44 @@ const a = ["lg", "md", "sm", "xs"], T = {
|
|
|
193
197
|
role: "Toppspillerutvikler",
|
|
194
198
|
rights: "Ingen rettigheter"
|
|
195
199
|
}
|
|
196
|
-
], h =
|
|
200
|
+
], h = c == null ? void 0 : c.map((o) => ({
|
|
197
201
|
avatar: {
|
|
198
|
-
...
|
|
202
|
+
...o,
|
|
199
203
|
type: "person"
|
|
200
204
|
},
|
|
201
|
-
title:
|
|
202
|
-
description:
|
|
203
|
-
badge: { label:
|
|
205
|
+
title: o == null ? void 0 : o.name,
|
|
206
|
+
description: o == null ? void 0 : o.role,
|
|
207
|
+
badge: { label: o == null ? void 0 : o.rights },
|
|
204
208
|
linkIcon: "menu-elipsis-horizontal"
|
|
205
209
|
})), u = {
|
|
206
|
-
items:
|
|
207
|
-
name:
|
|
210
|
+
items: c == null ? void 0 : c.map((o) => ({
|
|
211
|
+
name: o == null ? void 0 : o.name,
|
|
208
212
|
type: "person"
|
|
209
213
|
}))
|
|
210
214
|
};
|
|
211
|
-
return /* @__PURE__ */
|
|
215
|
+
return /* @__PURE__ */ a(s, { children: [
|
|
212
216
|
/* @__PURE__ */ e(
|
|
213
217
|
t,
|
|
214
218
|
{
|
|
215
219
|
...n,
|
|
216
220
|
avatarGroup: u,
|
|
217
221
|
collapsible: !0,
|
|
218
|
-
expanded:
|
|
222
|
+
expanded: i,
|
|
219
223
|
onClick: m,
|
|
220
224
|
as: "button"
|
|
221
225
|
}
|
|
222
226
|
),
|
|
223
|
-
|
|
227
|
+
i && /* @__PURE__ */ e(k, { size: "sm", spacing: "none", items: h })
|
|
224
228
|
] });
|
|
225
229
|
};
|
|
226
230
|
export {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
P as Collapsible,
|
|
232
|
+
_ as Colors,
|
|
233
|
+
M as Controls,
|
|
230
234
|
B as Default,
|
|
235
|
+
H as Loading,
|
|
231
236
|
E as MediaTypes,
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
S as Selectable,
|
|
238
|
+
j as Sizes,
|
|
234
239
|
T as default
|
|
235
240
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { ListItemSelectProps } from './ListItemSelect';
|
|
3
|
-
export type ListItemColor = 'default' | 'accent';
|
|
4
3
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export type ListItemColor = 'default' | 'accent';
|
|
5
5
|
export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
6
|
export interface ListItemBaseProps {
|
|
7
7
|
as?: ElementType;
|
|
8
8
|
size?: ListItemSize;
|
|
9
|
-
shadow?: ListItemShadow;
|
|
10
9
|
color?: ListItemColor;
|
|
11
|
-
|
|
10
|
+
shadow?: ListItemShadow;
|
|
12
11
|
className?: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
href?: string;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
onKeyPress?: KeyboardEventHandler;
|
|
16
|
+
tabIndex?: number;
|
|
17
|
+
loading?: boolean;
|
|
16
18
|
disabled?: boolean;
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
active?: boolean;
|
|
17
21
|
select?: ListItemSelectProps;
|
|
18
22
|
selected?: boolean;
|
|
19
23
|
expanded?: boolean;
|
|
20
|
-
onClick?: () => void;
|
|
21
|
-
onKeyPress?: KeyboardEventHandler;
|
|
22
|
-
action?: ReactNode;
|
|
23
24
|
controls?: ReactNode;
|
|
24
25
|
children?: ReactNode;
|
|
25
|
-
style?: React.CSSProperties;
|
|
26
26
|
}
|
|
27
|
-
export declare const ListItemBase: ({ as,
|
|
27
|
+
export declare const ListItemBase: ({ as, size, color, shadow, className, style, href, onClick, onKeyPress, tabIndex, loading, disabled, hidden, active, select, selected, expanded, controls, children, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,64 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { ListItemSelect as
|
|
4
|
-
import '../../assets/ListItemBase.css';const
|
|
5
|
-
item:
|
|
6
|
-
link:
|
|
7
|
-
},
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { ListItemSelect as w } from "./ListItemSelect.js";
|
|
4
|
+
import '../../assets/ListItemBase.css';const B = "_item_i2afq_1", E = "_link_i2afq_78", d = {
|
|
5
|
+
item: B,
|
|
6
|
+
link: E
|
|
7
|
+
}, z = ({
|
|
8
8
|
as: c,
|
|
9
|
-
children: l,
|
|
10
|
-
className: n,
|
|
11
|
-
href: o,
|
|
12
9
|
size: t,
|
|
13
|
-
color:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
selected: h,
|
|
19
|
-
disabled: u,
|
|
20
|
-
expanded: i,
|
|
21
|
-
controls: I,
|
|
10
|
+
color: l,
|
|
11
|
+
shadow: o = "xs",
|
|
12
|
+
className: n,
|
|
13
|
+
style: f,
|
|
14
|
+
href: p,
|
|
22
15
|
onClick: a,
|
|
23
16
|
onKeyPress: e,
|
|
24
|
-
|
|
17
|
+
tabIndex: x,
|
|
18
|
+
loading: _,
|
|
19
|
+
disabled: h,
|
|
20
|
+
hidden: j = !1,
|
|
21
|
+
active: q = !1,
|
|
22
|
+
select: i,
|
|
23
|
+
selected: I,
|
|
24
|
+
expanded: s,
|
|
25
|
+
controls: L,
|
|
26
|
+
children: N
|
|
25
27
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
const b = c || "a";
|
|
29
|
+
return /* @__PURE__ */ u(
|
|
28
30
|
"article",
|
|
29
31
|
{
|
|
30
|
-
className:
|
|
31
|
-
"data-color":
|
|
32
|
+
className: d.item,
|
|
33
|
+
"data-color": l,
|
|
32
34
|
"data-size": t,
|
|
33
|
-
"data-shadow":
|
|
34
|
-
"data-active":
|
|
35
|
-
"aria-hidden":
|
|
36
|
-
"aria-disabled":
|
|
37
|
-
"aria-selected":
|
|
38
|
-
"aria-expanded":
|
|
35
|
+
"data-shadow": o,
|
|
36
|
+
"data-active": q,
|
|
37
|
+
"aria-hidden": j,
|
|
38
|
+
"aria-disabled": h || _,
|
|
39
|
+
"aria-selected": I,
|
|
40
|
+
"aria-expanded": s,
|
|
39
41
|
children: [
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
42
|
+
i && /* @__PURE__ */ r(w, { ...i, size: t }),
|
|
43
|
+
/* @__PURE__ */ r(
|
|
44
|
+
b,
|
|
43
45
|
{
|
|
44
|
-
className:
|
|
46
|
+
className: v(d.link, n),
|
|
45
47
|
"data-size": t,
|
|
46
|
-
"aria-expanded":
|
|
47
|
-
style:
|
|
48
|
-
href:
|
|
49
|
-
onKeyPress: (
|
|
50
|
-
|
|
48
|
+
"aria-expanded": s,
|
|
49
|
+
style: f,
|
|
50
|
+
href: p,
|
|
51
|
+
onKeyPress: (m) => {
|
|
52
|
+
m.key === "Enter" && (a == null || a()), e == null || e(m);
|
|
51
53
|
},
|
|
52
54
|
onClick: a,
|
|
53
|
-
tabIndex:
|
|
54
|
-
children:
|
|
55
|
+
tabIndex: x,
|
|
56
|
+
children: N
|
|
55
57
|
}
|
|
56
58
|
),
|
|
57
|
-
|
|
59
|
+
L
|
|
58
60
|
]
|
|
59
61
|
}
|
|
60
62
|
);
|
|
61
63
|
};
|
|
62
64
|
export {
|
|
63
|
-
|
|
65
|
+
z as ListItemBase
|
|
64
66
|
};
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AvatarGroupProps, AvatarProps } from '../Avatar';
|
|
3
|
+
import { IconName } from '../Icon';
|
|
4
|
+
import { ListItemColor, ListItemSize } from './ListItemBase';
|
|
3
5
|
export interface ListItemHeaderProps {
|
|
6
|
+
loading?: boolean;
|
|
4
7
|
size?: ListItemSize;
|
|
8
|
+
color?: ListItemColor;
|
|
5
9
|
className?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
/** List item icon */
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
/** List item avatar */
|
|
14
|
+
avatar?: AvatarProps;
|
|
15
|
+
/** List item avatarGroup */
|
|
16
|
+
avatarGroup?: AvatarGroupProps;
|
|
17
|
+
/** Optional text indicating behaviour */
|
|
6
18
|
children?: ReactNode;
|
|
7
19
|
}
|
|
8
|
-
export declare const ListItemHeader: ({ size, className, children }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const ListItemHeader: ({ loading, size, color, icon, avatar, avatarGroup, className, children, }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsxs as c, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { ListItemMedia as n } from "./ListItemMedia.js";
|
|
4
|
+
import '../../assets/ListItemHeader.css';const p = "_header_70chu_1", x = {
|
|
5
|
+
header: p
|
|
6
|
+
}, j = ({
|
|
7
|
+
loading: r,
|
|
8
|
+
size: e = "sm",
|
|
9
|
+
color: s,
|
|
10
|
+
icon: t,
|
|
11
|
+
avatar: a,
|
|
12
|
+
avatarGroup: m,
|
|
13
|
+
className: o,
|
|
14
|
+
children: d
|
|
15
|
+
}) => /* @__PURE__ */ c("header", { className: i(x.header, o), "data-size": e, children: [
|
|
16
|
+
/* @__PURE__ */ h(
|
|
17
|
+
n,
|
|
18
|
+
{
|
|
19
|
+
loading: r,
|
|
20
|
+
size: e,
|
|
21
|
+
color: s,
|
|
22
|
+
icon: t,
|
|
23
|
+
avatar: a,
|
|
24
|
+
avatarGroup: m
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
d
|
|
28
|
+
] });
|
|
6
29
|
export {
|
|
7
|
-
|
|
30
|
+
j as ListItemHeader
|
|
8
31
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ListItemSize } from './ListItemBase';
|
|
3
3
|
export interface ListItemLabelProps {
|
|
4
|
+
loading?: boolean;
|
|
4
5
|
size?: ListItemSize;
|
|
5
6
|
title?: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
}
|
|
9
|
-
export declare const ListItemLabel: ({ size, title, description, children }: ListItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ListItemLabel: ({ loading, size, title, description, children }: ListItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as o } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton as l } from "../Skeleton/Skeleton.js";
|
|
3
|
+
import '../../assets/ListItemLabel.css';const d = "_label_7jiaq_3", m = "_title_7jiaq_38", p = "_description_7jiaq_44", s = {
|
|
4
|
+
label: d,
|
|
5
|
+
title: m,
|
|
6
|
+
description: p
|
|
7
|
+
}, h = ({ loading: a = !1, size: t = "sm", title: n, description: r, children: i }) => /* @__PURE__ */ e("span", { className: s.label, "data-size": t, children: i || /* @__PURE__ */ c(o, { children: [
|
|
8
|
+
/* @__PURE__ */ e("strong", { className: s.title, "data-size": t, children: /* @__PURE__ */ e(l, { loading: a, children: n }) }),
|
|
9
|
+
/* @__PURE__ */ e("span", { className: s.description, "data-size": t, children: /* @__PURE__ */ e(l, { loading: a, children: r }) })
|
|
9
10
|
] }) });
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
h as ListItemLabel
|
|
12
13
|
};
|
|
@@ -3,6 +3,7 @@ import { AvatarGroupProps, AvatarProps } from '../Avatar';
|
|
|
3
3
|
import { IconName } from '../Icon';
|
|
4
4
|
import { ListItemColor, ListItemSize } from './ListItemBase';
|
|
5
5
|
interface ListItemMediaProps {
|
|
6
|
+
loading?: boolean;
|
|
6
7
|
color?: ListItemColor;
|
|
7
8
|
size?: ListItemSize;
|
|
8
9
|
icon?: IconName;
|
|
@@ -10,5 +11,5 @@ interface ListItemMediaProps {
|
|
|
10
11
|
avatarGroup?: AvatarGroupProps;
|
|
11
12
|
children?: ReactNode;
|
|
12
13
|
}
|
|
13
|
-
export declare const ListItemMedia: ({ size, color, icon, avatar, avatarGroup, children, }: ListItemMediaProps) => false | import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const ListItemMedia: ({ loading, size, color, icon, avatar, avatarGroup, children, }: ListItemMediaProps) => false | import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Avatar as
|
|
3
|
-
import { AvatarGroup as
|
|
4
|
-
import { Icon as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar as x } from "../Avatar/Avatar.js";
|
|
3
|
+
import { AvatarGroup as f } from "../Avatar/AvatarGroup.js";
|
|
4
|
+
import { Icon as n } from "../Icon/Icon.js";
|
|
5
5
|
import "../Icon/SvgIcon.js";
|
|
6
6
|
import "../../index-L8X2o7IH.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import { Skeleton as u } from "../Skeleton/Skeleton.js";
|
|
8
|
+
import '../../assets/ListItemMedia.css';const p = "_media_14b0z_3", v = "_icon_14b0z_24", a = {
|
|
9
|
+
media: p,
|
|
10
|
+
icon: v
|
|
11
|
+
}, m = {
|
|
11
12
|
avatar: {
|
|
12
13
|
xs: "xs",
|
|
13
14
|
sm: "sm",
|
|
@@ -22,24 +23,25 @@ import '../../assets/ListItemMedia.css';const f = "_media_14b0z_3", u = "_icon_1
|
|
|
22
23
|
lg: "md",
|
|
23
24
|
xl: "lg"
|
|
24
25
|
}
|
|
25
|
-
},
|
|
26
|
+
}, I = ({
|
|
27
|
+
loading: l,
|
|
26
28
|
size: t = "sm",
|
|
27
|
-
color:
|
|
28
|
-
icon:
|
|
29
|
+
color: c = "default",
|
|
30
|
+
icon: s,
|
|
29
31
|
avatar: o,
|
|
30
|
-
avatarGroup:
|
|
31
|
-
children:
|
|
32
|
-
}) => !
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
avatarGroup: e,
|
|
33
|
+
children: i
|
|
34
|
+
}) => !s && !o && !e && !i ? !1 : l ? /* @__PURE__ */ r(u, { loading: l, variant: "circle", size: t, className: a.media, children: /* @__PURE__ */ r(n, { name: "airplane", variant: "outline", className: a.icon }) }) : /* @__PURE__ */ d("div", { className: a.media, "data-size": t, "data-color": s ? c : null, children: [
|
|
35
|
+
s && /* @__PURE__ */ r(n, { name: s, variant: "outline", className: a.icon }) || o && /* @__PURE__ */ r(x, { ...o, size: m == null ? void 0 : m.avatar[t], className: a.avatar }) || e && /* @__PURE__ */ r(
|
|
36
|
+
f,
|
|
35
37
|
{
|
|
36
|
-
...
|
|
37
|
-
size:
|
|
38
|
-
className:
|
|
38
|
+
...e,
|
|
39
|
+
size: m == null ? void 0 : m.avatarGroup[t],
|
|
40
|
+
className: a.avatarGroup
|
|
39
41
|
}
|
|
40
42
|
),
|
|
41
|
-
|
|
43
|
+
i
|
|
42
44
|
] });
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
I as ListItemMedia
|
|
45
47
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ElementType,
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { AvatarGroupProps, AvatarProps } from '../Avatar';
|
|
3
3
|
import { BadgeProps } from '../Badge';
|
|
4
4
|
import { IconName } from '../Icon';
|
|
5
5
|
import { MenuItemColor, MenuItemSize } from './MenuItemBase';
|
|
6
6
|
export interface MenuItemProps {
|
|
7
7
|
id: string;
|
|
8
|
-
tabIndex?: number;
|
|
9
8
|
type?: string;
|
|
9
|
+
tabIndex?: number;
|
|
10
10
|
as?: ElementType;
|
|
11
11
|
color?: MenuItemColor;
|
|
12
12
|
size?: MenuItemSize;
|
|
13
13
|
href?: string;
|
|
14
|
-
onClick?:
|
|
14
|
+
onClick?: () => void;
|
|
15
15
|
hidden?: boolean;
|
|
16
16
|
active?: boolean;
|
|
17
17
|
collapsible?: boolean;
|
|
@@ -21,15 +21,14 @@ export interface MenuItemProps {
|
|
|
21
21
|
groupId?: string | number;
|
|
22
22
|
title?: string;
|
|
23
23
|
description?: string;
|
|
24
|
-
label?: string;
|
|
25
|
-
badge?: BadgeProps;
|
|
26
24
|
icon?: IconName;
|
|
27
25
|
avatar?: AvatarProps;
|
|
28
26
|
avatarGroup?: AvatarGroupProps;
|
|
29
|
-
|
|
30
|
-
items?: MenuItemProps[];
|
|
27
|
+
badge?: BadgeProps;
|
|
31
28
|
linkIcon?: IconName;
|
|
32
29
|
linkText?: string;
|
|
33
30
|
className?: string;
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
items?: MenuItemProps[];
|
|
34
33
|
}
|
|
35
|
-
export declare const MenuItem: ({ as, color, size,
|
|
34
|
+
export declare const MenuItem: ({ as, color, size, collapsible, expanded, icon, avatar, avatarGroup, title, description, badge, linkText, linkIcon, children, ...rest }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { MenuItemBase as
|
|
3
|
-
import { MenuItemLabel as
|
|
4
|
-
import { MenuItemMedia as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as h, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { MenuItemBase as k } from "./MenuItemBase.js";
|
|
3
|
+
import { MenuItemLabel as L } from "./MenuItemLabel.js";
|
|
4
|
+
import { MenuItemMedia as b } from "./MenuItemMedia.js";
|
|
5
|
+
const B = ({
|
|
6
6
|
as: t = "a",
|
|
7
|
-
color:
|
|
8
|
-
size:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
icon: a,
|
|
7
|
+
color: e = "neutral",
|
|
8
|
+
size: n = "sm",
|
|
9
|
+
collapsible: o,
|
|
10
|
+
expanded: r,
|
|
11
|
+
icon: c,
|
|
13
12
|
avatar: i,
|
|
14
13
|
avatarGroup: p,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
title: a,
|
|
15
|
+
description: u,
|
|
16
|
+
badge: I,
|
|
17
|
+
linkText: M,
|
|
18
|
+
linkIcon: f,
|
|
19
|
+
children: l,
|
|
20
|
+
...s
|
|
21
|
+
}) => /* @__PURE__ */ h(
|
|
22
|
+
k,
|
|
23
|
+
{
|
|
24
|
+
as: t,
|
|
25
|
+
size: n,
|
|
26
|
+
badge: I,
|
|
27
|
+
linkText: M,
|
|
28
|
+
linkIcon: o && r ? "chevron-up" : o ? "chevron-down" : f,
|
|
29
|
+
color: e,
|
|
30
|
+
expanded: r,
|
|
31
|
+
...s,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ m(b, { color: e, size: n, icon: c, avatar: i, avatarGroup: p }),
|
|
34
|
+
/* @__PURE__ */ m(L, { title: a, description: u, size: n, children: l })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
24
38
|
export {
|
|
25
|
-
|
|
39
|
+
B as MenuItem
|
|
26
40
|
};
|