@altinn/altinn-components 0.10.0 → 0.10.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.
- package/dist/assets/DialogHeading.css +1 -1
- package/dist/assets/DialogListItem.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemHeader.css +1 -1
- package/dist/assets/ListItemLabel.css +1 -1
- package/dist/assets/ListItemLink.css +1 -0
- package/dist/assets/ListItemMedia.css +1 -1
- package/dist/assets/ListItemSelect.css +1 -1
- package/dist/components/AccessAreaList/AccessAreaListItem.js +6 -6
- package/dist/components/Dialog/DialogByline.d.ts +1 -1
- package/dist/components/Dialog/DialogHeading.d.ts +4 -4
- package/dist/components/Dialog/DialogHeading.js +7 -7
- package/dist/components/Dialog/DialogLabel.d.ts +3 -3
- package/dist/components/Dialog/DialogLabel.js +1 -1
- package/dist/components/Dialog/DialogListItem.d.ts +9 -20
- package/dist/components/Dialog/DialogListItem.js +76 -83
- package/dist/components/Dialog/index.d.ts +0 -1
- package/dist/components/Dialog/index.js +27 -29
- package/dist/components/List/List.d.ts +4 -3
- package/dist/components/List/List.js +12 -4
- package/dist/components/List/ListItem.d.ts +2 -0
- package/dist/components/List/ListItem.stories.js +88 -80
- package/dist/components/List/ListItemBase.d.ts +1 -1
- package/dist/components/List/ListItemBase.js +8 -8
- package/dist/components/List/ListItemHeader.d.ts +5 -13
- package/dist/components/List/ListItemHeader.js +48 -59
- package/dist/components/List/ListItemHeader.stories.js +33 -41
- package/dist/components/List/ListItemLabel.js +6 -6
- package/dist/components/List/ListItemLink.d.ts +16 -0
- package/dist/components/List/ListItemLink.js +35 -0
- package/dist/components/List/ListItemMedia.d.ts +2 -3
- package/dist/components/List/ListItemMedia.js +21 -29
- package/dist/components/List/ListItemSelect.js +9 -9
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/List/index.js +18 -16
- package/dist/components/ResourceList/ResourceList.d.ts +1 -1
- package/dist/components/ResourceList/ResourceList.js +1 -1
- package/dist/components/ResourceList/ResourceList.stories.js +2 -2
- package/dist/components/Searchbar/Searchbar.stories.js +10 -8
- package/dist/components/index.js +104 -104
- package/dist/index.js +123 -123
- package/package.json +1 -1
- package/dist/assets/DialogBorder.css +0 -1
- package/dist/components/Dialog/DialogBorder.d.ts +0 -10
- package/dist/components/Dialog/DialogBorder.js +0 -8
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment as s, useState as
|
|
2
|
+
import { Fragment as s, useState as k } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import "../Autocomplete/AutocompleteBase.js";
|
|
6
|
-
import { Button as
|
|
7
|
-
import { MetaItem as
|
|
6
|
+
import { Button as b } from "../Button/Button.js";
|
|
7
|
+
import { MetaItem as i } from "../Meta/MetaItem.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
|
-
import { ListItemBase as
|
|
10
|
-
import { ListItemHeader as
|
|
11
|
-
import { ListItem as
|
|
12
|
-
import { ListBase as
|
|
13
|
-
import { List as
|
|
14
|
-
const l = ["xl", "lg", "md", "sm", "xs"],
|
|
9
|
+
import { ListItemBase as y } from "./ListItemBase.js";
|
|
10
|
+
import { ListItemHeader as v } from "./ListItemHeader.js";
|
|
11
|
+
import { ListItem as r } from "./ListItem.js";
|
|
12
|
+
import { ListBase as c } from "./ListBase.js";
|
|
13
|
+
import { List as I } from "./List.js";
|
|
14
|
+
const f = ["neutral", "accent", "transparent"], l = ["xl", "lg", "md", "sm", "xs"], j = {
|
|
15
15
|
title: "List/ListItem",
|
|
16
|
-
component:
|
|
16
|
+
component: r,
|
|
17
17
|
tags: ["autodocs"],
|
|
18
18
|
parameters: {},
|
|
19
19
|
args: {
|
|
20
20
|
id: "id",
|
|
21
21
|
title: "Title",
|
|
22
22
|
description: "Description",
|
|
23
|
-
size: "
|
|
23
|
+
size: "sm"
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, P = {
|
|
26
26
|
args: {}
|
|
27
|
-
},
|
|
28
|
-
/* @__PURE__ */ e(
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
-
/* @__PURE__ */ e(
|
|
31
|
-
/* @__PURE__ */ e(
|
|
27
|
+
}, G = (n) => /* @__PURE__ */ a(c, { children: [
|
|
28
|
+
/* @__PURE__ */ e(r, { ...n }),
|
|
29
|
+
/* @__PURE__ */ e(i, { children: "No media" }),
|
|
30
|
+
/* @__PURE__ */ e(r, { ...n, icon: "teddy-bear" }),
|
|
31
|
+
/* @__PURE__ */ e(i, { children: "Icon" }),
|
|
32
32
|
/* @__PURE__ */ e(
|
|
33
|
-
|
|
33
|
+
r,
|
|
34
34
|
{
|
|
35
35
|
...n,
|
|
36
36
|
avatar: {
|
|
@@ -39,9 +39,9 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
|
-
/* @__PURE__ */ e(
|
|
42
|
+
/* @__PURE__ */ e(i, { children: "Person" }),
|
|
43
43
|
/* @__PURE__ */ e(
|
|
44
|
-
|
|
44
|
+
r,
|
|
45
45
|
{
|
|
46
46
|
...n,
|
|
47
47
|
avatar: {
|
|
@@ -50,9 +50,9 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
/* @__PURE__ */ e(
|
|
53
|
+
/* @__PURE__ */ e(i, { children: "Company" }),
|
|
54
54
|
/* @__PURE__ */ e(
|
|
55
|
-
|
|
55
|
+
r,
|
|
56
56
|
{
|
|
57
57
|
...n,
|
|
58
58
|
avatar: {
|
|
@@ -62,9 +62,9 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
),
|
|
65
|
-
/* @__PURE__ */ e(
|
|
65
|
+
/* @__PURE__ */ e(i, { children: "Logo" }),
|
|
66
66
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
67
|
+
r,
|
|
68
68
|
{
|
|
69
69
|
...n,
|
|
70
70
|
avatarGroup: {
|
|
@@ -85,9 +85,9 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
),
|
|
88
|
-
/* @__PURE__ */ e(
|
|
88
|
+
/* @__PURE__ */ e(i, { children: "People group" }),
|
|
89
89
|
/* @__PURE__ */ e(
|
|
90
|
-
|
|
90
|
+
r,
|
|
91
91
|
{
|
|
92
92
|
...n,
|
|
93
93
|
avatarGroup: {
|
|
@@ -108,78 +108,78 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
|
-
/* @__PURE__ */ e(
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ e(
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
-
/* @__PURE__ */ e(
|
|
116
|
-
] },
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
/* @__PURE__ */ e(
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
/* @__PURE__ */ e(
|
|
121
|
-
/* @__PURE__ */ e(
|
|
122
|
-
/* @__PURE__ */ e(
|
|
123
|
-
/* @__PURE__ */ e(
|
|
124
|
-
/* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e(i, { children: "Company group" })
|
|
112
|
+
] }), N = (n) => /* @__PURE__ */ e(c, { children: l.map((t) => /* @__PURE__ */ a(s, { children: [
|
|
113
|
+
/* @__PURE__ */ e(r, { ...n, icon: "teddy-bear", size: t, loading: !0 }),
|
|
114
|
+
/* @__PURE__ */ e(r, { ...n, icon: "teddy-bear", size: t, loading: !1 }),
|
|
115
|
+
/* @__PURE__ */ e(i, { children: t })
|
|
116
|
+
] }, t)) }), Q = (n) => /* @__PURE__ */ a(c, { children: [
|
|
117
|
+
/* @__PURE__ */ e(r, { ...n, linkIcon: "chevron-right" }),
|
|
118
|
+
/* @__PURE__ */ e(i, { children: "Link icon, emphasising that this will take you somewhere" }),
|
|
119
|
+
/* @__PURE__ */ e(r, { ...n, linkIcon: "chevron-right", linkText: "Åpne" }),
|
|
120
|
+
/* @__PURE__ */ e(i, { children: "Link icon + link text, emphasising that this will take you somewhere" }),
|
|
121
|
+
/* @__PURE__ */ e(r, { ...n, collapsible: !0, badge: { label: "Admin" } }),
|
|
122
|
+
/* @__PURE__ */ e(i, { children: "Collapsible item with badge" }),
|
|
123
|
+
/* @__PURE__ */ e(r, { ...n, collapsible: !0, expanded: !0 }),
|
|
124
|
+
/* @__PURE__ */ e(i, { children: "Collapsible and expanded item" }),
|
|
125
125
|
/* @__PURE__ */ e(
|
|
126
|
-
|
|
126
|
+
r,
|
|
127
127
|
{
|
|
128
128
|
...n,
|
|
129
129
|
badge: { label: "Admin" },
|
|
130
130
|
linkIcon: "chevron-right",
|
|
131
131
|
menu: {
|
|
132
|
+
id: "menu",
|
|
132
133
|
items: [
|
|
133
|
-
{ title: "Innstillinger", icon: "cog" },
|
|
134
|
-
{ title: "Aktivitetslogg", icon: "clock-dashed" }
|
|
134
|
+
{ id: "settings", title: "Innstillinger", icon: "cog" },
|
|
135
|
+
{ id: "log", title: "Aktivitetslogg", icon: "clock-dashed" }
|
|
135
136
|
]
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
),
|
|
139
|
-
/* @__PURE__ */ e(
|
|
140
|
+
/* @__PURE__ */ e(i, { children: "List item with badge, linkIcon and context menu" }),
|
|
140
141
|
/* @__PURE__ */ e(
|
|
141
|
-
|
|
142
|
+
r,
|
|
142
143
|
{
|
|
143
144
|
...n,
|
|
144
|
-
controls: /* @__PURE__ */ e("div", { style: { position: "absolute", right: 0, display: "flex", alignItems: "center", margin: "0.625rem" }, children: /* @__PURE__ */ e(
|
|
145
|
+
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" }) })
|
|
145
146
|
}
|
|
146
147
|
),
|
|
147
|
-
/* @__PURE__ */ e(
|
|
148
|
-
] }),
|
|
148
|
+
/* @__PURE__ */ e(i, { children: "List item with custom controls" })
|
|
149
|
+
] }), Y = (n) => /* @__PURE__ */ e(c, { children: l == null ? void 0 : l.map((t) => /* @__PURE__ */ a(s, { children: [
|
|
149
150
|
/* @__PURE__ */ e(
|
|
150
|
-
|
|
151
|
+
r,
|
|
151
152
|
{
|
|
152
153
|
...n,
|
|
153
|
-
size:
|
|
154
|
+
size: t,
|
|
154
155
|
select: {
|
|
155
156
|
checked: !1
|
|
156
157
|
}
|
|
157
158
|
}
|
|
158
159
|
),
|
|
159
160
|
/* @__PURE__ */ e(
|
|
160
|
-
|
|
161
|
+
r,
|
|
161
162
|
{
|
|
162
163
|
...n,
|
|
163
|
-
size:
|
|
164
|
+
size: t,
|
|
164
165
|
select: {
|
|
165
166
|
checked: !0
|
|
166
167
|
},
|
|
167
168
|
selected: !0
|
|
168
169
|
}
|
|
169
170
|
),
|
|
170
|
-
/* @__PURE__ */ e(
|
|
171
|
-
] },
|
|
172
|
-
/* @__PURE__ */ e(
|
|
173
|
-
/* @__PURE__ */ e(
|
|
174
|
-
|
|
175
|
-
/* @__PURE__ */ e(r, {
|
|
176
|
-
|
|
177
|
-
/* @__PURE__ */ e(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const [i, p] = g(!1), m = () => {
|
|
171
|
+
/* @__PURE__ */ e(i, { children: t })
|
|
172
|
+
] }, t)) }), F = (n) => /* @__PURE__ */ e(c, { children: f.map((t) => /* @__PURE__ */ a(s, { children: [
|
|
173
|
+
/* @__PURE__ */ e(r, { ...n, icon: "teddy-bear", color: t, linkIcon: "chevron-right" }),
|
|
174
|
+
/* @__PURE__ */ e(i, { children: t })
|
|
175
|
+
] }, t)) }), J = (n) => /* @__PURE__ */ e(c, { children: l == null ? void 0 : l.map((t) => /* @__PURE__ */ a(s, { children: [
|
|
176
|
+
/* @__PURE__ */ e(r, { ...n, icon: "teddy-bear", size: t, linkIcon: "chevron-right" }),
|
|
177
|
+
/* @__PURE__ */ e(r, { ...n, avatar: { name: "Avatar" }, size: t, linkIcon: "chevron-right" }),
|
|
178
|
+
/* @__PURE__ */ e(i, { children: t })
|
|
179
|
+
] }, t)) }), q = (n) => {
|
|
180
|
+
const [t, p] = k(!1), m = () => {
|
|
181
181
|
p((o) => !o);
|
|
182
|
-
},
|
|
182
|
+
}, d = [
|
|
183
183
|
{
|
|
184
184
|
name: "Per Ove Ludvigsen",
|
|
185
185
|
role: "Sportlig leder",
|
|
@@ -200,7 +200,7 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
200
200
|
role: "Toppspillerutvikler",
|
|
201
201
|
rights: "Ingen rettigheter"
|
|
202
202
|
}
|
|
203
|
-
], h =
|
|
203
|
+
], h = d.map((o, g) => ({
|
|
204
204
|
avatar: {
|
|
205
205
|
...o,
|
|
206
206
|
type: "person"
|
|
@@ -208,36 +208,44 @@ const l = ["xl", "lg", "md", "sm", "xs"], S = {
|
|
|
208
208
|
title: o == null ? void 0 : o.name,
|
|
209
209
|
description: o == null ? void 0 : o.role,
|
|
210
210
|
badge: { label: o == null ? void 0 : o.rights },
|
|
211
|
-
|
|
211
|
+
menu: {
|
|
212
|
+
id: "menu" + g,
|
|
213
|
+
items: [
|
|
214
|
+
{
|
|
215
|
+
id: "item1",
|
|
216
|
+
title: "Hallo"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
}
|
|
212
220
|
})), u = {
|
|
213
|
-
items:
|
|
221
|
+
items: d.map((o) => ({
|
|
214
222
|
name: o == null ? void 0 : o.name,
|
|
215
223
|
type: "person"
|
|
216
224
|
}))
|
|
217
225
|
};
|
|
218
|
-
return /* @__PURE__ */ a(
|
|
226
|
+
return /* @__PURE__ */ a(y, { children: [
|
|
219
227
|
/* @__PURE__ */ e(
|
|
220
|
-
|
|
228
|
+
v,
|
|
221
229
|
{
|
|
222
230
|
...n,
|
|
223
231
|
avatarGroup: u,
|
|
224
232
|
collapsible: !0,
|
|
225
|
-
expanded:
|
|
233
|
+
expanded: t,
|
|
226
234
|
onClick: m,
|
|
227
235
|
as: "button"
|
|
228
236
|
}
|
|
229
237
|
),
|
|
230
|
-
|
|
238
|
+
t && /* @__PURE__ */ e(I, { spacing: "none", defaultItemSize: "xs", defaultItemColor: "transparent", items: h })
|
|
231
239
|
] });
|
|
232
240
|
};
|
|
233
241
|
export {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
q as Collapsible,
|
|
243
|
+
F as Colors,
|
|
244
|
+
Q as Controls,
|
|
245
|
+
P as Default,
|
|
246
|
+
N as Loading,
|
|
247
|
+
G as MediaTypes,
|
|
248
|
+
Y as Selectable,
|
|
249
|
+
J as Sizes,
|
|
250
|
+
j as default
|
|
243
251
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
export type ListItemVariant = 'solid' | 'dotted';
|
|
4
|
-
export type ListItemColor = '
|
|
4
|
+
export type ListItemColor = 'neutral' | 'accent' | 'transparent';
|
|
5
5
|
export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
6
|
export interface ListItemBaseProps {
|
|
7
7
|
color?: ListItemColor;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import '../../assets/ListItemBase.css';const p = "
|
|
2
|
+
import '../../assets/ListItemBase.css';const p = "_item_1grve_1", x = {
|
|
3
3
|
item: p
|
|
4
|
-
},
|
|
4
|
+
}, v = ({
|
|
5
5
|
size: e,
|
|
6
6
|
variant: t = "solid",
|
|
7
|
-
color: a = "
|
|
7
|
+
color: a = "neutral",
|
|
8
8
|
shadow: s = "xs",
|
|
9
9
|
loading: i,
|
|
10
|
-
disabled:
|
|
11
|
-
hidden:
|
|
10
|
+
disabled: r,
|
|
11
|
+
hidden: d = !1,
|
|
12
12
|
active: n = !1,
|
|
13
13
|
selected: l,
|
|
14
14
|
expanded: o,
|
|
@@ -22,13 +22,13 @@ import '../../assets/ListItemBase.css';const p = "_item_19vbq_1", x = {
|
|
|
22
22
|
"data-size": e,
|
|
23
23
|
"data-shadow": a === "transparent" ? "none" : s,
|
|
24
24
|
"data-active": n,
|
|
25
|
-
"aria-hidden":
|
|
26
|
-
"aria-disabled":
|
|
25
|
+
"aria-hidden": d,
|
|
26
|
+
"aria-disabled": r || i,
|
|
27
27
|
"aria-selected": l,
|
|
28
28
|
"aria-expanded": o,
|
|
29
29
|
children: m
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
v as ListItemBase
|
|
34
34
|
};
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { AvatarGroupProps, AvatarProps } from '../Avatar';
|
|
3
3
|
import { BadgeProps } from '../Badge';
|
|
4
4
|
import { IconName } from '../Icon';
|
|
5
|
-
import {
|
|
5
|
+
import { ListItemSize } from './ListItemBase';
|
|
6
|
+
import { ListItemLinkProps } from './ListItemLink';
|
|
6
7
|
import { ListItemMenuProps } from './ListItemMenu';
|
|
7
8
|
import { ListItemSelectProps } from './ListItemSelect';
|
|
8
|
-
export interface ListItemHeaderProps {
|
|
9
|
-
as?: ElementType;
|
|
10
|
-
href?: string;
|
|
11
|
-
onClick?: () => void;
|
|
12
|
-
onKeyPress?: KeyboardEventHandler;
|
|
13
|
-
tabIndex?: number;
|
|
9
|
+
export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
14
10
|
/** Header is loading */
|
|
15
11
|
loading?: boolean;
|
|
16
|
-
/** Header is disabled */
|
|
17
|
-
disabled?: boolean;
|
|
18
12
|
/** Header size */
|
|
19
13
|
size?: ListItemSize;
|
|
20
|
-
/** Optional color */
|
|
21
|
-
color?: ListItemColor;
|
|
22
14
|
/** Optional classname */
|
|
23
15
|
className?: string;
|
|
24
16
|
/** Select controls */
|
|
@@ -50,4 +42,4 @@ export interface ListItemHeaderProps {
|
|
|
50
42
|
/** Custom label */
|
|
51
43
|
children?: ReactNode;
|
|
52
44
|
}
|
|
53
|
-
export declare const ListItemHeader: ({ as, loading, disabled, select, href, onClick, onKeyPress, tabIndex, collapsible, expanded, size,
|
|
45
|
+
export declare const ListItemHeader: ({ as, loading, disabled, select, href, onClick, onKeyPress, tabIndex, collapsible, expanded, size, title, description, icon, avatar, avatarGroup, linkIcon, linkText, badge, menu, controls, className, children, }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,75 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { ListItemControls as
|
|
4
|
-
import { ListItemLabel as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { ListItemControls as C } from "./ListItemControls.js";
|
|
4
|
+
import { ListItemLabel as H } from "./ListItemLabel.js";
|
|
5
|
+
import { ListItemLink as S } from "./ListItemLink.js";
|
|
6
|
+
import { ListItemMedia as q } from "./ListItemMedia.js";
|
|
7
|
+
import { ListItemMenu as A } from "./ListItemMenu.js";
|
|
8
|
+
import { ListItemSelect as B } from "./ListItemSelect.js";
|
|
9
|
+
import '../../assets/ListItemHeader.css';const D = "_header_16s1f_1", E = "_link_16s1f_8", a = {
|
|
10
|
+
header: D,
|
|
11
|
+
link: E
|
|
12
|
+
}, T = ({
|
|
13
|
+
as: c,
|
|
13
14
|
loading: e,
|
|
14
|
-
disabled:
|
|
15
|
-
select:
|
|
15
|
+
disabled: p,
|
|
16
|
+
select: o,
|
|
16
17
|
href: f,
|
|
17
|
-
onClick:
|
|
18
|
-
onKeyPress:
|
|
19
|
-
tabIndex:
|
|
20
|
-
collapsible:
|
|
21
|
-
expanded:
|
|
18
|
+
onClick: L,
|
|
19
|
+
onKeyPress: d,
|
|
20
|
+
tabIndex: h,
|
|
21
|
+
collapsible: m,
|
|
22
|
+
expanded: i,
|
|
22
23
|
size: t = "sm",
|
|
23
|
-
color: o,
|
|
24
24
|
title: l,
|
|
25
|
-
description:
|
|
26
|
-
icon:
|
|
27
|
-
avatar:
|
|
28
|
-
avatarGroup:
|
|
25
|
+
description: I,
|
|
26
|
+
icon: k,
|
|
27
|
+
avatar: _,
|
|
28
|
+
avatarGroup: x,
|
|
29
29
|
linkIcon: j,
|
|
30
|
-
linkText:
|
|
31
|
-
badge:
|
|
32
|
-
menu:
|
|
33
|
-
controls:
|
|
34
|
-
className:
|
|
35
|
-
children:
|
|
30
|
+
linkText: u,
|
|
31
|
+
badge: v,
|
|
32
|
+
menu: s,
|
|
33
|
+
controls: M,
|
|
34
|
+
className: N,
|
|
35
|
+
children: b
|
|
36
36
|
}) => {
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
37
|
+
const w = m && i ? "chevron-up" : m ? "chevron-down" : j;
|
|
38
|
+
return /* @__PURE__ */ n("header", { className: a.header, "data-size": t, "aria-expanded": i, children: [
|
|
39
|
+
o && /* @__PURE__ */ r(B, { ...o, size: t }),
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
|
+
S,
|
|
42
42
|
{
|
|
43
|
-
className:
|
|
43
|
+
className: y(a.link, N),
|
|
44
|
+
as: c,
|
|
44
45
|
href: f,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"data-color": o,
|
|
52
|
-
"aria-disabled": e || L,
|
|
46
|
+
onClick: L,
|
|
47
|
+
onKeyPress: d,
|
|
48
|
+
tabIndex: h,
|
|
49
|
+
loading: e,
|
|
50
|
+
disabled: p,
|
|
51
|
+
size: t,
|
|
53
52
|
children: [
|
|
54
|
-
/* @__PURE__ */ r(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
loading: e,
|
|
58
|
-
size: t,
|
|
59
|
-
color: o,
|
|
60
|
-
icon: x,
|
|
61
|
-
avatar: b,
|
|
62
|
-
avatarGroup: u
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
/* @__PURE__ */ r(B, { loading: e, size: t, title: l, description: k, children: E }),
|
|
66
|
-
/* @__PURE__ */ r(A, { linkIcon: S, linkText: v, badge: M })
|
|
53
|
+
/* @__PURE__ */ r(q, { loading: e, size: t, icon: k, avatar: _, avatarGroup: x }),
|
|
54
|
+
/* @__PURE__ */ r(H, { loading: e, size: t, title: l, description: I, children: b }),
|
|
55
|
+
/* @__PURE__ */ r(C, { linkIcon: w, linkText: u, badge: v })
|
|
67
56
|
]
|
|
68
57
|
}
|
|
69
58
|
),
|
|
70
|
-
|
|
59
|
+
s && /* @__PURE__ */ r(A, { ...s }) || M
|
|
71
60
|
] });
|
|
72
61
|
};
|
|
73
62
|
export {
|
|
74
|
-
|
|
63
|
+
T as ListItemHeader
|
|
75
64
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Fragment as
|
|
2
|
+
import { Fragment as d, useState as g } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import "../Autocomplete/AutocompleteBase.js";
|
|
@@ -7,21 +7,21 @@ import { Button as k } from "../Button/Button.js";
|
|
|
7
7
|
import { MetaItem as r } from "../Meta/MetaItem.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
9
|
import { ListItemHeader as t } from "./ListItemHeader.js";
|
|
10
|
-
import { ListBase as
|
|
11
|
-
|
|
10
|
+
import { ListBase as c } from "./ListBase.js";
|
|
11
|
+
import { List as b } from "./List.js";
|
|
12
|
+
const l = ["lg", "md", "sm", "xs"], T = {
|
|
12
13
|
title: "List/ListItemHeader",
|
|
13
14
|
component: t,
|
|
14
15
|
tags: ["autodocs"],
|
|
15
16
|
parameters: {},
|
|
16
17
|
args: {
|
|
17
|
-
id: "id",
|
|
18
18
|
title: "Title",
|
|
19
19
|
description: "Description",
|
|
20
20
|
size: "md"
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, B = {
|
|
23
23
|
args: {}
|
|
24
|
-
},
|
|
24
|
+
}, E = (n) => /* @__PURE__ */ a(c, { 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,11 +106,11 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
106
106
|
}
|
|
107
107
|
),
|
|
108
108
|
/* @__PURE__ */ e(r, { children: "Company group" })
|
|
109
|
-
] }),
|
|
109
|
+
] }), S = (n) => /* @__PURE__ */ e(c, { children: l == null ? void 0 : l.map((i) => /* @__PURE__ */ a(d, { children: [
|
|
110
110
|
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: i, loading: !0 }),
|
|
111
111
|
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", size: i, loading: !1 }),
|
|
112
112
|
/* @__PURE__ */ e(r, { children: i })
|
|
113
|
-
] }, i)) }),
|
|
113
|
+
] }, i)) }), M = (n) => /* @__PURE__ */ a(c, { children: [
|
|
114
114
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right" }),
|
|
115
115
|
/* @__PURE__ */ e(r, { children: "Link icon, emphasising that this will take you somewhere" }),
|
|
116
116
|
/* @__PURE__ */ e(t, { ...n, linkIcon: "chevron-right", linkText: "Åpne" }),
|
|
@@ -126,9 +126,10 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
126
126
|
badge: { label: "Admin" },
|
|
127
127
|
linkIcon: "chevron-right",
|
|
128
128
|
menu: {
|
|
129
|
+
id: "menu",
|
|
129
130
|
items: [
|
|
130
|
-
{ title: "Innstillinger", icon: "cog" },
|
|
131
|
-
{ title: "Aktivitetslogg", icon: "clock-dashed" }
|
|
131
|
+
{ id: "settings", title: "Innstillinger", icon: "cog" },
|
|
132
|
+
{ id: "log", title: "Aktivitetslogg", icon: "clock-dashed" }
|
|
132
133
|
]
|
|
133
134
|
}
|
|
134
135
|
}
|
|
@@ -142,7 +143,7 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
142
143
|
}
|
|
143
144
|
),
|
|
144
145
|
/* @__PURE__ */ e(r, { children: "List item with custom controls" })
|
|
145
|
-
] }),
|
|
146
|
+
] }), _ = (n) => /* @__PURE__ */ e(c, { children: l == null ? void 0 : l.map((i) => /* @__PURE__ */ a(d, { children: [
|
|
146
147
|
/* @__PURE__ */ e(
|
|
147
148
|
t,
|
|
148
149
|
{
|
|
@@ -165,27 +166,18 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
165
166
|
}
|
|
166
167
|
),
|
|
167
168
|
/* @__PURE__ */ e(r, { children: i })
|
|
168
|
-
] }, i)) }),
|
|
169
|
+
] }, i)) }), j = (n) => /* @__PURE__ */ a(c, { children: [
|
|
169
170
|
/* @__PURE__ */ e(t, { ...n }),
|
|
170
171
|
/* @__PURE__ */ e(r, { children: "Default" }),
|
|
171
|
-
/* @__PURE__ */ e(t, { ...n
|
|
172
|
+
/* @__PURE__ */ e(t, { ...n }),
|
|
172
173
|
/* @__PURE__ */ e(r, { children: "Accent" })
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ e(
|
|
175
|
-
t,
|
|
176
|
-
{
|
|
177
|
-
...n,
|
|
178
|
-
icon: "teddy-bear",
|
|
179
|
-
size: i,
|
|
180
|
-
selected: i === (n == null ? void 0 : n.size),
|
|
181
|
-
linkIcon: "chevron-right"
|
|
182
|
-
}
|
|
183
|
-
),
|
|
174
|
+
] }), P = (n) => /* @__PURE__ */ e(c, { children: l == null ? void 0 : l.map((i) => /* @__PURE__ */ a(d, { children: [
|
|
175
|
+
/* @__PURE__ */ e(t, { ...n, icon: "teddy-bear", selected: i === (n == null ? void 0 : n.size), linkIcon: "chevron-right" }),
|
|
184
176
|
/* @__PURE__ */ e(r, { children: i })
|
|
185
|
-
] }, i)) }),
|
|
186
|
-
const [i,
|
|
187
|
-
|
|
188
|
-
},
|
|
177
|
+
] }, i)) }), G = (n) => {
|
|
178
|
+
const [i, s] = g(!1), m = () => {
|
|
179
|
+
s((o) => !o);
|
|
180
|
+
}, p = [
|
|
189
181
|
{
|
|
190
182
|
name: "Per Ove Ludvigsen",
|
|
191
183
|
role: "Sportlig leder",
|
|
@@ -206,7 +198,7 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
206
198
|
role: "Toppspillerutvikler",
|
|
207
199
|
rights: "Ingen rettigheter"
|
|
208
200
|
}
|
|
209
|
-
], h =
|
|
201
|
+
], h = p.map((o) => ({
|
|
210
202
|
avatar: {
|
|
211
203
|
...o,
|
|
212
204
|
type: "person"
|
|
@@ -216,12 +208,12 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
216
208
|
badge: { label: o == null ? void 0 : o.rights },
|
|
217
209
|
linkIcon: "menu-elipsis-horizontal"
|
|
218
210
|
})), u = {
|
|
219
|
-
items:
|
|
211
|
+
items: p.map((o) => ({
|
|
220
212
|
name: o == null ? void 0 : o.name,
|
|
221
213
|
type: "person"
|
|
222
214
|
}))
|
|
223
215
|
};
|
|
224
|
-
return /* @__PURE__ */ a(
|
|
216
|
+
return /* @__PURE__ */ a(d, { children: [
|
|
225
217
|
/* @__PURE__ */ e(
|
|
226
218
|
t,
|
|
227
219
|
{
|
|
@@ -233,17 +225,17 @@ const l = ["lg", "md", "sm", "xs"], w = {
|
|
|
233
225
|
as: "button"
|
|
234
226
|
}
|
|
235
227
|
),
|
|
236
|
-
i && /* @__PURE__ */ e(
|
|
228
|
+
i && /* @__PURE__ */ e(b, { defaultItemSize: "sm", spacing: "none", items: h })
|
|
237
229
|
] });
|
|
238
230
|
};
|
|
239
231
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
232
|
+
G as Collapsible,
|
|
233
|
+
j as Colors,
|
|
234
|
+
M as Controls,
|
|
235
|
+
B as Default,
|
|
236
|
+
S as Loading,
|
|
237
|
+
E as MediaTypes,
|
|
238
|
+
_ as Selectable,
|
|
239
|
+
P as Sizes,
|
|
240
|
+
T as default
|
|
249
241
|
};
|