@altinn/altinn-components 0.16.0 → 0.18.0
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/README.md +39 -31
- package/dist/ListItemBase-BVx5MDhO.js +83 -0
- package/dist/assets/Flex.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemIcon.css +1 -1
- package/dist/components/AccessAreaList/AccessAreaListItem.js +26 -21
- package/dist/components/AccessPackageList/AccessPackageListItem.js +8 -16
- package/dist/components/Bookmarks/BookmarksSection.js +19 -19
- package/dist/components/Dialog/DialogListItem.js +12 -13
- package/dist/components/Dialog/SeenByLog.js +0 -1
- package/dist/components/List/List.js +3 -3
- package/dist/components/List/ListBase.js +2 -2
- package/dist/components/List/ListItem.js +62 -62
- package/dist/components/List/ListItemBase.js +4 -78
- package/dist/components/List/ListItemHeader.js +48 -48
- package/dist/components/List/ListItemIcon.js +6 -6
- package/dist/components/List/index.js +1 -1
- package/dist/components/Page/Flex.js +7 -7
- package/dist/components/Search/Autocomplete.js +27 -24
- package/dist/components/Transmission/TransmissionItem.js +55 -58
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/lib/components/AccessAreaList/AccessAreaListItem.d.ts +11 -2
- package/dist/types/lib/components/AccessAreaList/AccessAreaListItem.stories.d.ts +11 -2
- package/dist/types/lib/components/AccessPackageList/AccessPackageList.stories.d.ts +11 -9
- package/dist/types/lib/components/AccessPackageList/AccessPackageListItem.d.ts +2 -3
- package/dist/types/lib/components/Dialog/DialogListItem.stories.d.ts +4 -3
- package/dist/types/lib/components/List/ListBase.stories.d.ts +3 -4
- package/dist/types/lib/components/List/ListItem.d.ts +2 -0
- package/dist/types/lib/components/List/ListItemBase.d.ts +24 -2
- package/dist/types/lib/components/List/ListItemHeader.d.ts +6 -5
- package/dist/types/lib/components/List/Patterns.stories.d.ts +0 -1
- package/dist/types/lib/components/List/Specimens.stories.d.ts +2 -2
- package/dist/types/lib/components/Page/Flex.d.ts +1 -1
- package/dist/types/lib/components/ResourceList/ResourceList.stories.d.ts +0 -7
- package/dist/types/lib/components/ResourceList/ResourceListItem.d.ts +9 -1
- package/dist/types/lib/components/ResourceList/ResourceListItem.stories.d.ts +1 -0
- package/dist/types/lib/components/Transmission/TransmissionItem.stories.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,96 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import * as c from "react";
|
|
4
4
|
import { forwardRef as h, useState as w } from "react";
|
|
5
5
|
import "../../index-L8X2o7IH.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
|
-
import { ListItem as
|
|
8
|
+
import { ListItem as s } from "../List/ListItem.js";
|
|
9
9
|
import { MetaTimestamp as x } from "../Meta/MetaTimestamp.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { Typography as
|
|
12
|
-
import { DialogAttachments as
|
|
13
|
-
import { u as
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
for (var i = 0, t = Object.getOwnPropertySymbols(l); i < t.length; i++)
|
|
22
|
-
o.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(l, t[i]) && (r[t[i]] = l[t[i]]);
|
|
23
|
-
return r;
|
|
11
|
+
import { Typography as O } from "../Typography/Typography.js";
|
|
12
|
+
import { DialogAttachments as I } from "../Dialog/DialogAttachments.js";
|
|
13
|
+
import { u as j } from "../../useId-CsCRkvK3.js";
|
|
14
|
+
import '../../assets/TransmissionItem.css';var _ = function(o, l) {
|
|
15
|
+
var e = {};
|
|
16
|
+
for (var t in o) Object.prototype.hasOwnProperty.call(o, t) && l.indexOf(t) < 0 && (e[t] = o[t]);
|
|
17
|
+
if (o != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
+
for (var i = 0, t = Object.getOwnPropertySymbols(o); i < t.length; i++)
|
|
19
|
+
l.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(o, t[i]) && (e[t[i]] = o[t[i]]);
|
|
20
|
+
return e;
|
|
24
21
|
};
|
|
25
|
-
const
|
|
26
|
-
var { title:
|
|
27
|
-
let a =
|
|
28
|
-
return a =
|
|
22
|
+
const z = h((o, l) => {
|
|
23
|
+
var { title: e, titleId: t } = o, i = _(o, ["title", "titleId"]);
|
|
24
|
+
let a = j();
|
|
25
|
+
return a = e ? t || "title-" + a : void 0, c.createElement(
|
|
29
26
|
"svg",
|
|
30
|
-
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref:
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: l, "aria-labelledby": a }, i),
|
|
28
|
+
e ? c.createElement("title", { id: a }, e) : null,
|
|
29
|
+
c.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M19.638 4.417a3.25 3.25 0 0 0-4.608-.008l-9.378 9.379a.75.75 0 0 0-.191.324l-1.414 4.95a.75.75 0 0 0 .925.927l4.94-1.398a.75.75 0 0 0 .327-.191l9.39-9.391a3.25 3.25 0 0 0 .01-4.592M16.091 5.47a1.752 1.752 0 1 1 2.478 2.478l-.23.23-2.477-2.479zM14.8 6.76 6.85 14.71l-.991 3.47 3.457-.979 7.963-7.963z", clipRule: "evenodd" })
|
|
33
30
|
);
|
|
34
|
-
}),
|
|
35
|
-
body:
|
|
36
|
-
},
|
|
37
|
-
theme:
|
|
38
|
-
type:
|
|
39
|
-
loading:
|
|
31
|
+
}), y = "_body_1m345_1", E = {
|
|
32
|
+
body: y
|
|
33
|
+
}, N = ({
|
|
34
|
+
theme: o,
|
|
35
|
+
type: l,
|
|
36
|
+
loading: e,
|
|
40
37
|
sender: t,
|
|
41
38
|
createdAt: i,
|
|
42
39
|
createdAtLabel: a,
|
|
43
|
-
title:
|
|
44
|
-
description:
|
|
45
|
-
summary:
|
|
46
|
-
attachments:
|
|
40
|
+
title: f,
|
|
41
|
+
description: u,
|
|
42
|
+
summary: d,
|
|
43
|
+
attachments: b
|
|
47
44
|
}) => {
|
|
48
|
-
const [m,
|
|
49
|
-
|
|
45
|
+
const [m, p] = w(!1), g = () => {
|
|
46
|
+
p((v) => !v);
|
|
50
47
|
};
|
|
51
|
-
return (
|
|
52
|
-
|
|
48
|
+
return (l == null ? void 0 : l.value) === "draft" ? /* @__PURE__ */ r(
|
|
49
|
+
s,
|
|
53
50
|
{
|
|
54
51
|
as: "button",
|
|
55
|
-
theme:
|
|
52
|
+
theme: o,
|
|
56
53
|
variant: "dotted",
|
|
57
54
|
size: "sm",
|
|
58
|
-
icon:
|
|
59
|
-
title:
|
|
60
|
-
description:
|
|
61
|
-
badge: { label:
|
|
62
|
-
linkIcon:
|
|
55
|
+
icon: z,
|
|
56
|
+
title: f,
|
|
57
|
+
description: u,
|
|
58
|
+
badge: { label: l == null ? void 0 : l.label },
|
|
59
|
+
linkIcon: !0
|
|
63
60
|
}
|
|
64
|
-
) : /* @__PURE__ */
|
|
65
|
-
|
|
61
|
+
) : /* @__PURE__ */ r(
|
|
62
|
+
s,
|
|
66
63
|
{
|
|
67
64
|
as: "button",
|
|
68
|
-
theme:
|
|
65
|
+
theme: o,
|
|
69
66
|
expanded: m,
|
|
70
|
-
|
|
67
|
+
collapsible: !0,
|
|
68
|
+
onClick: g,
|
|
71
69
|
size: "sm",
|
|
72
70
|
avatar: {
|
|
73
71
|
type: t == null ? void 0 : t.type,
|
|
74
72
|
imageUrl: t == null ? void 0 : t.imageUrl,
|
|
75
73
|
name: t == null ? void 0 : t.name
|
|
76
74
|
},
|
|
77
|
-
title:
|
|
78
|
-
description: m ? "" :
|
|
79
|
-
badge: { label:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
t && /* @__PURE__ */ e("strong", { children: (t == null ? void 0 : t.name) + ", " }),
|
|
75
|
+
title: f,
|
|
76
|
+
description: m ? "" : u,
|
|
77
|
+
badge: { label: l == null ? void 0 : l.label },
|
|
78
|
+
children: m && /* @__PURE__ */ n("div", { className: E.body, children: [
|
|
79
|
+
i && /* @__PURE__ */ n(x, { loading: e, datetime: i, size: "xs", children: [
|
|
80
|
+
t && /* @__PURE__ */ r("strong", { children: (t == null ? void 0 : t.name) + ", " }),
|
|
84
81
|
a
|
|
85
82
|
] }),
|
|
86
|
-
/* @__PURE__ */ n(
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
83
|
+
/* @__PURE__ */ n(O, { size: "lg", children: [
|
|
84
|
+
/* @__PURE__ */ r("p", { children: d }),
|
|
85
|
+
b && /* @__PURE__ */ r(I, { ...b })
|
|
89
86
|
] })
|
|
90
87
|
] })
|
|
91
88
|
}
|
|
92
89
|
);
|
|
93
90
|
};
|
|
94
91
|
export {
|
|
95
|
-
|
|
92
|
+
N as TransmissionItem
|
|
96
93
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import { Layout as Rr } from "./Layout/Layout.js";
|
|
|
72
72
|
import { ActionHeader as Or } from "./LayoutAction/ActionHeader.js";
|
|
73
73
|
import { ActionFooter as zr } from "./LayoutAction/ActionFooter.js";
|
|
74
74
|
import { LayoutAction as jr } from "./LayoutAction/LayoutAction.js";
|
|
75
|
-
import {
|
|
75
|
+
import { L as Jr } from "../ListItemBase-BVx5MDhO.js";
|
|
76
76
|
import { ListItemLink as Ur } from "./List/ListItemLink.js";
|
|
77
77
|
import { ListItemHeader as Wr } from "./List/ListItemHeader.js";
|
|
78
78
|
import { ListItemLabel as Yr } from "./List/ListItemLabel.js";
|
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import { Layout as Gr } from "./components/Layout/Layout.js";
|
|
|
72
72
|
import { ActionHeader as Or } from "./components/LayoutAction/ActionHeader.js";
|
|
73
73
|
import { ActionFooter as zr } from "./components/LayoutAction/ActionFooter.js";
|
|
74
74
|
import { LayoutAction as Nr } from "./components/LayoutAction/LayoutAction.js";
|
|
75
|
-
import {
|
|
75
|
+
import { L as qr } from "./ListItemBase-BVx5MDhO.js";
|
|
76
76
|
import { ListItemLink as Ur } from "./components/List/ListItemLink.js";
|
|
77
77
|
import { ListItemHeader as Wr } from "./components/List/ListItemHeader.js";
|
|
78
78
|
import { ListItemLabel as Yr } from "./components/List/ListItemLabel.js";
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { Color } from '../../types';
|
|
1
2
|
import { SvgElement } from '../Icon';
|
|
2
3
|
import { ListItemProps } from '../List';
|
|
3
|
-
export interface AccessAreaListItemProps extends Pick<ListItemProps, 'size' | 'onClick' | 'expanded'> {
|
|
4
|
+
export interface AccessAreaListItemProps extends Pick<ListItemProps, 'size' | 'onClick' | 'expanded' | 'loading'> {
|
|
5
|
+
/** Id of the item */
|
|
4
6
|
id: string;
|
|
7
|
+
/** Name of the Access Area */
|
|
5
8
|
name: string;
|
|
9
|
+
/** The icon associated with the Access Area */
|
|
6
10
|
icon: SvgElement;
|
|
11
|
+
/** Color theme of the Access Area */
|
|
12
|
+
colorTheme?: Color;
|
|
13
|
+
/** Optional Badge to display things like the number of packages a user has in the area */
|
|
14
|
+
badgeText?: string;
|
|
15
|
+
/** Children to render when the item is expanded */
|
|
7
16
|
children?: React.ReactNode;
|
|
8
17
|
}
|
|
9
|
-
export declare const AccessAreaListItem: ({ name, icon, size, children, expanded, onClick, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const AccessAreaListItem: ({ name, icon, size, children, expanded, onClick, badgeText, colorTheme, loading, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,14 +3,16 @@ import { default as React } from 'react';
|
|
|
3
3
|
import { AccessAreaListItemProps } from './AccessAreaListItem';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: ({ name, icon, size, children, expanded, onClick, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
component: ({ name, icon, size, children, expanded, onClick, badgeText, colorTheme, loading, ...props }: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
tags: string[];
|
|
8
8
|
args: {
|
|
9
9
|
id: string;
|
|
10
10
|
size: "md";
|
|
11
11
|
name: string;
|
|
12
12
|
icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
13
|
-
|
|
13
|
+
badgeText: string;
|
|
14
|
+
colorTheme: "company";
|
|
15
|
+
loading: false;
|
|
14
16
|
};
|
|
15
17
|
argTypes: {
|
|
16
18
|
expanded: {
|
|
@@ -29,9 +31,16 @@ declare const meta: {
|
|
|
29
31
|
disable: true;
|
|
30
32
|
};
|
|
31
33
|
};
|
|
34
|
+
colorTheme: {
|
|
35
|
+
options: string[];
|
|
36
|
+
control: {
|
|
37
|
+
type: "select";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
32
40
|
};
|
|
33
41
|
};
|
|
34
42
|
export default meta;
|
|
35
43
|
type Story = StoryObj<typeof meta>;
|
|
36
44
|
export declare const AreaListItemStory: Story;
|
|
45
|
+
export declare const AreaWithPackages: (args: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
46
|
export declare const AllAreas: (args: AccessAreaListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AccessPackageListProps } from './AccessPackageList';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ items, spacing, ...props }:
|
|
4
|
+
component: ({ items, spacing, ...props }: AccessPackageListProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
args: {};
|
|
7
|
+
argTypes: {
|
|
8
|
+
spacing: {
|
|
9
|
+
options: string[];
|
|
10
|
+
control: {
|
|
11
|
+
type: "inline-radio";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
15
|
};
|
|
13
16
|
export default meta;
|
|
14
|
-
|
|
15
|
-
export declare const AccessPackageListStory: Story;
|
|
17
|
+
export declare const AccessPackageListStory: (args: AccessPackageListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ListItemProps } from '../List';
|
|
2
|
-
export interface AccessPackageListItemProps extends Pick<ListItemProps, 'onClick' | 'as' | 'title' | 'description' | 'size' | 'controls'> {
|
|
2
|
+
export interface AccessPackageListItemProps extends Pick<ListItemProps, 'color' | 'onClick' | 'as' | 'title' | 'description' | 'size' | 'controls' | 'loading'> {
|
|
3
3
|
id: string;
|
|
4
|
-
icon?: string;
|
|
5
4
|
}
|
|
6
|
-
export declare const AccessPackageListItem: ({ as,
|
|
5
|
+
export declare const AccessPackageListItem: ({ as, title, color, ...props }: AccessPackageListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,6 +3,7 @@ import { DialogListItem, DialogListItemProps } from './DialogListItem';
|
|
|
3
3
|
declare const meta: Meta<typeof DialogListItem>;
|
|
4
4
|
export default meta;
|
|
5
5
|
export declare const Default: {
|
|
6
|
+
render: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
args: {};
|
|
7
8
|
};
|
|
8
9
|
export declare const GroupedAvatars: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,7 +12,7 @@ export declare const SeenBy: (args: DialogListItemProps) => import("react/jsx-ru
|
|
|
11
12
|
export declare const InboxStatuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare const DraftAndSent: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export declare const ArchivedAndTrashed: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const Statuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Statuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
15
16
|
declare const Loading: {
|
|
16
17
|
(args: DialogListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
parameters: {
|
|
@@ -24,5 +25,5 @@ export declare const DueAt: (args: DialogListItemProps) => import("react/jsx-run
|
|
|
24
25
|
export declare const Attachments: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export declare const TouchedBy: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export declare const TextLength: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export declare const Selectable: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const Sizes: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const Selectable: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
29
|
+
export declare const Sizes: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
@@ -4,10 +4,9 @@ declare const meta: {
|
|
|
4
4
|
component: ({ spacing, children, ...rest }: import('./ListBase').ListBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
|
-
args: {
|
|
8
|
-
children: import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
};
|
|
7
|
+
args: {};
|
|
10
8
|
};
|
|
11
9
|
export default meta;
|
|
12
10
|
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const
|
|
11
|
+
export declare const Interactive: Story;
|
|
12
|
+
export declare const NonIteractive: Story;
|
|
@@ -25,6 +25,8 @@ export interface ListItemProps extends ListItemBaseProps, ListItemHeaderProps {
|
|
|
25
25
|
label?: ReactNode | (() => ReactElement);
|
|
26
26
|
/** Optional badge */
|
|
27
27
|
badge?: BadgeProps | ReactNode | undefined;
|
|
28
|
+
/** Whether to display the item with a link icon */
|
|
29
|
+
linkIcon?: boolean;
|
|
28
30
|
}
|
|
29
31
|
export interface ListItemInputProps extends ListItemProps {
|
|
30
32
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementType, KeyboardEventHandler, ReactNode } from 'react';
|
|
1
|
+
import { ElementType, HTMLProps, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { Color } from '..';
|
|
3
3
|
export type ListItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
export type ListItemVariant = 'solid' | 'dotted';
|
|
@@ -6,25 +6,47 @@ export type ListItemShadow = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
6
6
|
export type ListItemColor = Color;
|
|
7
7
|
export type ListItemTheme = 'transparent' | 'default' | 'subtle' | 'surface' | 'base';
|
|
8
8
|
export interface ListItemBaseProps {
|
|
9
|
+
/** The title of the list item. */
|
|
9
10
|
title?: string;
|
|
11
|
+
/** If true, the list item is interactive and has a hover state. */
|
|
10
12
|
interactive?: boolean;
|
|
13
|
+
/** The element type to render as. */
|
|
11
14
|
as?: ElementType;
|
|
15
|
+
/** The URL to link to if the list item is a link. */
|
|
12
16
|
href?: string;
|
|
17
|
+
/** Click event handler. */
|
|
13
18
|
onClick?: () => void;
|
|
19
|
+
/** Key press event handler. */
|
|
14
20
|
onKeyPress?: KeyboardEventHandler;
|
|
21
|
+
/** The tab index of the list item. */
|
|
15
22
|
tabIndex?: number;
|
|
23
|
+
/** The color of the list item. */
|
|
16
24
|
color?: ListItemColor;
|
|
25
|
+
/** The theme of the list item. */
|
|
17
26
|
theme?: ListItemTheme;
|
|
27
|
+
/** The variant of the list item. */
|
|
18
28
|
variant?: ListItemVariant;
|
|
29
|
+
/** The size of the list item. */
|
|
19
30
|
size?: ListItemSize;
|
|
31
|
+
/** The shadow style of the list item. */
|
|
20
32
|
shadow?: ListItemShadow;
|
|
33
|
+
/** Additional class names for the list item. */
|
|
21
34
|
className?: string;
|
|
35
|
+
/** If true, the list item shows a loading state. */
|
|
22
36
|
loading?: boolean;
|
|
37
|
+
/** If true, the list item is disabled. */
|
|
23
38
|
disabled?: boolean;
|
|
39
|
+
/** If true, the list item is hidden. */
|
|
24
40
|
hidden?: boolean;
|
|
41
|
+
/** If true, the list item is active. */
|
|
25
42
|
active?: boolean;
|
|
43
|
+
/** If true, the list item is selected. */
|
|
26
44
|
selected?: boolean;
|
|
45
|
+
/** If true, the list item is expanded. */
|
|
27
46
|
expanded?: boolean;
|
|
47
|
+
/** Mouse enter event handler. */
|
|
48
|
+
onMouseEnter?: HTMLProps<HTMLDivElement>['onMouseEnter'];
|
|
49
|
+
/** The children elements of the list item. */
|
|
28
50
|
children?: ReactNode;
|
|
29
51
|
}
|
|
30
|
-
export declare const ListItemBase: ({ title, interactive, as, href, onClick, onKeyPress, tabIndex, size, variant, color, theme, shadow, loading, disabled, hidden, active, selected, className, children, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const ListItemBase: ({ title, interactive, as, href, onClick, onKeyPress, tabIndex, size, variant, color, theme, shadow, loading, disabled, hidden, active, selected, className, onMouseEnter, children, }: ListItemBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChevronDownIcon } from '@navikt/aksel-icons';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { AvatarGroupProps, AvatarProps, BadgeProps, IconProps, ListItemLinkProps, ListItemSelectProps, ListItemSize, SvgElement } from '..';
|
|
3
4
|
export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
@@ -9,9 +10,9 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
|
9
10
|
className?: string;
|
|
10
11
|
/** Select controls */
|
|
11
12
|
select?: ListItemSelectProps;
|
|
12
|
-
/** Collapsible item
|
|
13
|
+
/** Collapsible item */
|
|
13
14
|
collapsible?: boolean;
|
|
14
|
-
/** Item is expanded
|
|
15
|
+
/** Item is expanded */
|
|
15
16
|
expanded?: boolean;
|
|
16
17
|
/** Title */
|
|
17
18
|
title?: string;
|
|
@@ -23,8 +24,8 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
|
23
24
|
avatar?: AvatarProps;
|
|
24
25
|
/** List item avatarGroup */
|
|
25
26
|
avatarGroup?: AvatarGroupProps;
|
|
26
|
-
/** Optional icon indicating behaviour */
|
|
27
|
-
|
|
27
|
+
/** Optional chevron icon indicating behaviour */
|
|
28
|
+
chevron?: typeof ChevronDownIcon;
|
|
28
29
|
/** Optional badge */
|
|
29
30
|
badge?: BadgeProps | ReactNode | undefined;
|
|
30
31
|
/** Custom controls */
|
|
@@ -32,4 +33,4 @@ export interface ListItemHeaderProps extends ListItemLinkProps {
|
|
|
32
33
|
/** Custom label */
|
|
33
34
|
children?: ReactNode;
|
|
34
35
|
}
|
|
35
|
-
export declare const ListItemHeader: ({ as, loading, disabled, select, href, onClick, onKeyPress, tabIndex, size, title, description, icon, avatar, avatarGroup,
|
|
36
|
+
export declare const ListItemHeader: ({ as, loading, disabled, select, href, onClick, onKeyPress, tabIndex, size, title, description, icon, avatar, avatarGroup, chevron, badge, controls, className, children, }: ListItemHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,5 +5,4 @@ export default meta;
|
|
|
5
5
|
export declare const ListOfPeople: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const ListOfServices: () => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare const ListOfCategories: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare const CategoryGrid: () => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export declare const MultilevelList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,5 +9,5 @@ declare const meta: {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export default meta;
|
|
12
|
-
export declare const Theme: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const Size: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Theme: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
13
|
+
export declare const Size: (args: ListItemProps) => import("react/jsx-runtime").JSX.Element[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Color, Range, Shadow, Theme } from '..';
|
|
3
|
-
export type FlexElement = 'div' | 'section' | 'article' | 'header' | 'footer' | 'nav';
|
|
3
|
+
export type FlexElement = 'div' | 'section' | 'article' | 'header' | 'footer' | 'nav' | 'ul';
|
|
4
4
|
export type FlexDirection = 'col' | 'row';
|
|
5
5
|
export type FlexAlign = 'initial' | 'start' | 'end' | 'center' | 'stretch';
|
|
6
6
|
export type FlexJustify = 'initial' | 'start' | 'end' | 'center' | 'between';
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { BadgeProps } from '../Badge';
|
|
1
2
|
import { ListItemProps } from '../List';
|
|
2
|
-
export interface ResourceListItemProps extends Pick<ListItemProps, 'size' | 'controls' | 'as' | 'onClick'> {
|
|
3
|
+
export interface ResourceListItemProps extends Pick<ListItemProps, 'size' | 'controls' | 'as' | 'onClick' | 'loading'> {
|
|
4
|
+
/** Unique identifier for the resource item */
|
|
3
5
|
id: string;
|
|
6
|
+
/** Name of the owner of the resource */
|
|
4
7
|
ownerName: string;
|
|
8
|
+
/** Name of the resource */
|
|
5
9
|
resourceName: string;
|
|
10
|
+
/** URL of the owner's logo (optional) */
|
|
6
11
|
ownerLogoUrl?: string;
|
|
12
|
+
/** Alternative text for the owner's logo (optional) */
|
|
7
13
|
ownerLogoUrlAlt?: string;
|
|
14
|
+
/** Badge properties for the resource item (optional) */
|
|
15
|
+
badge?: BadgeProps;
|
|
8
16
|
}
|
|
9
17
|
export declare const ResourceListItem: ({ ownerName, resourceName, ownerLogoUrlAlt, ownerLogoUrl, ...props }: ResourceListItemProps) => import("react/jsx-runtime").JSX.Element;
|