@altinn/altinn-components 0.43.8 → 0.44.4
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/components/Bookmarks/BookmarksListItem.js +9 -7
- package/dist/components/Bookmarks/BookmarksSection.js +23 -27
- package/dist/components/Bookmarks/EditableBookmark.js +78 -63
- package/dist/types/lib/components/Bookmarks/BookmarksListItem.d.ts +2 -1
- package/dist/types/lib/components/Bookmarks/BookmarksListItem.stories.d.ts +1 -1
- package/dist/types/lib/components/Bookmarks/BookmarksSection.d.ts +1 -3
- package/dist/types/lib/components/Bookmarks/BookmarksSection.stories.d.ts +1 -19
- package/dist/types/lib/components/Bookmarks/EditableBookmark.d.ts +3 -7
- package/package.json +5 -1
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
|
-
import { QueryLabel as
|
|
5
|
+
import { QueryLabel as i } from "../Searchbar/QueryLabel.js";
|
|
6
6
|
import { ListItem as s } from "../List/ListItem.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
const
|
|
8
|
+
const j = ({ loading: r, title: m, ariaLabel: e, params: o, icon: p, ...f }) => /* @__PURE__ */ t(
|
|
9
9
|
s,
|
|
10
10
|
{
|
|
11
|
-
...
|
|
11
|
+
...f,
|
|
12
12
|
loading: r,
|
|
13
|
+
icon: p,
|
|
13
14
|
title: m,
|
|
14
|
-
ariaLabel:
|
|
15
|
-
|
|
15
|
+
ariaLabel: e,
|
|
16
|
+
description: !r && o && /* @__PURE__ */ t(i, { params: o }),
|
|
17
|
+
label: !m && !r && !o && /* @__PURE__ */ t(i, { params: o })
|
|
16
18
|
}
|
|
17
19
|
);
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
j as BookmarksListItem
|
|
20
22
|
};
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createElement as
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as a } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { Typography as
|
|
4
|
+
import { Typography as c } from "../Typography/Typography.js";
|
|
5
5
|
import { Heading as k } from "../Typography/Heading.js";
|
|
6
6
|
import { BookmarksListItem as l } from "./BookmarksListItem.js";
|
|
7
|
-
import { EditableBookmark as
|
|
7
|
+
import { EditableBookmark as f } from "./EditableBookmark.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
|
-
import { List as
|
|
9
|
+
import { List as t } from "../List/List.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { Section as
|
|
12
|
-
const
|
|
11
|
+
import { Section as h } from "../Page/Section.js";
|
|
12
|
+
const H = ({
|
|
13
13
|
loading: o,
|
|
14
|
-
title:
|
|
15
|
-
description:
|
|
16
|
-
items:
|
|
17
|
-
untitled:
|
|
18
|
-
titleField:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
o ? /* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(l, { title: e, loading: o, size: "sm" }) }) : t.length > 0 && /* @__PURE__ */ i(p, { spacing: "xs", children: t.map((r) => /* @__PURE__ */ f(
|
|
24
|
-
x,
|
|
14
|
+
title: m,
|
|
15
|
+
description: p,
|
|
16
|
+
items: e,
|
|
17
|
+
untitled: s = "Untitled bookmark",
|
|
18
|
+
titleField: n
|
|
19
|
+
}) => /* @__PURE__ */ d(h, { padding: 6, spacing: 4, bleed: !0, children: [
|
|
20
|
+
/* @__PURE__ */ r(k, { size: "md", children: m }),
|
|
21
|
+
o ? /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(l, { title: m, loading: o, size: "sm" }) }) : e.length > 0 && /* @__PURE__ */ r(t, { spacing: "xs", children: e.map((i) => /* @__PURE__ */ a(
|
|
22
|
+
f,
|
|
25
23
|
{
|
|
26
|
-
...
|
|
27
|
-
key:
|
|
28
|
-
loading: o ||
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
untitled: d,
|
|
32
|
-
titleField: a,
|
|
24
|
+
...i,
|
|
25
|
+
key: i.id,
|
|
26
|
+
loading: o || i.loading,
|
|
27
|
+
untitled: s,
|
|
28
|
+
titleField: n,
|
|
33
29
|
size: "sm"
|
|
34
30
|
}
|
|
35
31
|
)) }),
|
|
36
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ r(c, { size: "xs", children: p })
|
|
37
33
|
] });
|
|
38
34
|
export {
|
|
39
|
-
|
|
35
|
+
H as BookmarksSection
|
|
40
36
|
};
|
|
@@ -1,74 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as s, Fragment as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { Icon as d } from "../Icon/Icon.js";
|
|
3
4
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { IconButton as
|
|
6
|
-
import { BookmarksListItem as
|
|
5
|
+
import { Button as u } from "../Button/Button.js";
|
|
6
|
+
import { IconButton as C } from "../Button/IconButton.js";
|
|
7
|
+
import { BookmarksListItem as L } from "./BookmarksListItem.js";
|
|
7
8
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { QueryLabel as
|
|
9
|
+
import { QueryLabel as j } from "../Searchbar/QueryLabel.js";
|
|
9
10
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { Flex as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { S as
|
|
14
|
-
import { S as
|
|
15
|
-
const
|
|
16
|
-
id:
|
|
17
|
-
title:
|
|
11
|
+
import { Flex as x } from "../Page/Flex.js";
|
|
12
|
+
import { TextField as F } from "../Forms/TextField.js";
|
|
13
|
+
import { SettingsModal as M } from "../Settings/SettingsModal.js";
|
|
14
|
+
import { S as O } from "../../Pencil-BVHLEoQy.js";
|
|
15
|
+
import { S as h } from "../../MagnifyingGlass-bwVhw07z.js";
|
|
16
|
+
const U = ({
|
|
17
|
+
id: k,
|
|
18
|
+
title: t,
|
|
18
19
|
untitled: e,
|
|
19
|
-
params:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
expandIconAltText: S,
|
|
28
|
-
...u
|
|
20
|
+
params: m,
|
|
21
|
+
titleField: a,
|
|
22
|
+
saveButton: i,
|
|
23
|
+
removeButton: n,
|
|
24
|
+
inputValue: l,
|
|
25
|
+
onChange: c,
|
|
26
|
+
editIconAltText: S = "Edit",
|
|
27
|
+
...v
|
|
29
28
|
}) => {
|
|
30
|
-
const [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
children: /* @__PURE__ */ f(d, { padding: 4, spacing: 4, children: [
|
|
51
|
-
/* @__PURE__ */ o(I, { params: n }),
|
|
52
|
-
s && /* @__PURE__ */ o(
|
|
53
|
-
j,
|
|
29
|
+
const [I, y] = g(""), [p, f] = g(!1), z = (r) => {
|
|
30
|
+
r.preventDefault(), r.stopPropagation(), f(!0);
|
|
31
|
+
}, E = () => {
|
|
32
|
+
f(!1);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ s(b, { children: [
|
|
35
|
+
/* @__PURE__ */ o(
|
|
36
|
+
L,
|
|
37
|
+
{
|
|
38
|
+
...v,
|
|
39
|
+
id: k,
|
|
40
|
+
title: t || e,
|
|
41
|
+
ariaLabel: t || e,
|
|
42
|
+
params: m,
|
|
43
|
+
icon: /* @__PURE__ */ o(d, { svgElement: h }),
|
|
44
|
+
linkIcon: !0,
|
|
45
|
+
controls: /* @__PURE__ */ o(
|
|
46
|
+
C,
|
|
54
47
|
{
|
|
55
|
-
|
|
56
|
-
size: "
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
typeof l == "function" ? l(c) : z(c.target.value);
|
|
61
|
-
}
|
|
48
|
+
variant: "outline",
|
|
49
|
+
size: "xs",
|
|
50
|
+
icon: O,
|
|
51
|
+
onClick: z,
|
|
52
|
+
iconAltText: S
|
|
62
53
|
}
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
p && /* @__PURE__ */ o(
|
|
58
|
+
M,
|
|
59
|
+
{
|
|
60
|
+
icon: /* @__PURE__ */ o(d, { svgElement: h }),
|
|
61
|
+
title: t || e,
|
|
62
|
+
open: p,
|
|
63
|
+
onClose: E,
|
|
64
|
+
children: /* @__PURE__ */ s(x, { direction: "col", spacing: 4, children: [
|
|
65
|
+
/* @__PURE__ */ o(j, { params: m }),
|
|
66
|
+
a && /* @__PURE__ */ o(
|
|
67
|
+
F,
|
|
68
|
+
{
|
|
69
|
+
...a,
|
|
70
|
+
size: "sm",
|
|
71
|
+
name: "title",
|
|
72
|
+
value: typeof l == "string" ? l : I,
|
|
73
|
+
onChange: (r) => {
|
|
74
|
+
typeof c == "function" ? c(r) : y(r.target.value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
(i || n) && /* @__PURE__ */ s(x, { as: "footer", direction: "row", spacing: 2, children: [
|
|
79
|
+
i && /* @__PURE__ */ o(u, { ...i, size: "sm" }),
|
|
80
|
+
n && /* @__PURE__ */ o(u, { ...n, variant: "outline", size: "sm" })
|
|
81
|
+
] })
|
|
67
82
|
] })
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] });
|
|
71
86
|
};
|
|
72
87
|
export {
|
|
73
|
-
|
|
88
|
+
U as EditableBookmark
|
|
74
89
|
};
|
|
@@ -3,5 +3,6 @@ export interface BookmarksListItemProps extends ListItemProps {
|
|
|
3
3
|
/** Query params */
|
|
4
4
|
params?: QueryItemProps[];
|
|
5
5
|
ariaLabel?: string;
|
|
6
|
+
icon?: ListItemProps['icon'];
|
|
6
7
|
}
|
|
7
|
-
export declare const BookmarksListItem: ({ loading, title, ariaLabel, params, ...rest }: BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const BookmarksListItem: ({ loading, title, ariaLabel, params, icon, ...rest }: BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ loading, title, ariaLabel, params, ...rest }: import('./BookmarksListItem').BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ loading, title, ariaLabel, params, icon, ...rest }: import('./BookmarksListItem').BookmarksListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: {
|
|
@@ -5,8 +5,6 @@ export interface BookmarksSectionProps {
|
|
|
5
5
|
items: EditableBookmarkProps[];
|
|
6
6
|
untitled?: string;
|
|
7
7
|
titleField?: TextFieldProps;
|
|
8
|
-
expandedId?: string;
|
|
9
|
-
onToggle?: (id: string) => void;
|
|
10
8
|
loading?: boolean;
|
|
11
9
|
}
|
|
12
|
-
export declare const BookmarksSection: ({ loading, title, description, items, untitled, titleField,
|
|
10
|
+
export declare const BookmarksSection: ({ loading, title, description, items, untitled, titleField, }: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { BookmarksSectionProps } from './BookmarksSection';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ loading, title, description, items, untitled, titleField,
|
|
5
|
+
component: ({ loading, title, description, items, untitled, titleField, }: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {};
|
|
8
8
|
args: {
|
|
@@ -30,7 +30,6 @@ declare const meta: {
|
|
|
30
30
|
type: "filter";
|
|
31
31
|
label: string;
|
|
32
32
|
})[];
|
|
33
|
-
expandIconAltText: string;
|
|
34
33
|
} | {
|
|
35
34
|
id: string;
|
|
36
35
|
params: ({
|
|
@@ -47,22 +46,6 @@ declare const meta: {
|
|
|
47
46
|
label: string;
|
|
48
47
|
onClick: () => void;
|
|
49
48
|
};
|
|
50
|
-
expandIconAltText: string;
|
|
51
|
-
title?: undefined;
|
|
52
|
-
} | {
|
|
53
|
-
id: string;
|
|
54
|
-
params: {
|
|
55
|
-
type: "filter";
|
|
56
|
-
label: string;
|
|
57
|
-
}[];
|
|
58
|
-
saveButton: {
|
|
59
|
-
label: string;
|
|
60
|
-
};
|
|
61
|
-
removeButton: {
|
|
62
|
-
label: string;
|
|
63
|
-
onClick?: undefined;
|
|
64
|
-
};
|
|
65
|
-
expandIconAltText: string;
|
|
66
49
|
title?: undefined;
|
|
67
50
|
})[];
|
|
68
51
|
};
|
|
@@ -70,7 +53,6 @@ declare const meta: {
|
|
|
70
53
|
export default meta;
|
|
71
54
|
type Story = StoryObj<typeof meta>;
|
|
72
55
|
export declare const Default: Story;
|
|
73
|
-
export declare const ExpandedItem: Story;
|
|
74
56
|
export declare const ControlledState: (args: BookmarksSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
75
57
|
export declare const LoadingState: Story;
|
|
76
58
|
export declare const EmptyState: Story;
|
|
@@ -2,24 +2,20 @@ import { ButtonProps, TextFieldProps, BookmarksListItemProps, QueryItemProps } f
|
|
|
2
2
|
export interface EditableBookmarkProps extends BookmarksListItemProps {
|
|
3
3
|
/** Bookmark id */
|
|
4
4
|
id: string;
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/** Accessible label for the edit button icon */
|
|
6
|
+
editIconAltText?: string;
|
|
7
7
|
/** Input value */
|
|
8
8
|
inputValue?: string;
|
|
9
9
|
/** On change */
|
|
10
10
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
11
|
/** Loading */
|
|
12
12
|
loading?: boolean;
|
|
13
|
-
/** Expanded */
|
|
14
|
-
expanded?: boolean;
|
|
15
13
|
/** Optional title */
|
|
16
14
|
title?: string;
|
|
17
15
|
/** Untitled */
|
|
18
16
|
untitled?: string;
|
|
19
17
|
/** Query params */
|
|
20
18
|
params?: QueryItemProps[];
|
|
21
|
-
/** Toggle function */
|
|
22
|
-
onToggle?: () => void;
|
|
23
19
|
/** Title field */
|
|
24
20
|
titleField?: TextFieldProps;
|
|
25
21
|
/** Save button */
|
|
@@ -29,4 +25,4 @@ export interface EditableBookmarkProps extends BookmarksListItemProps {
|
|
|
29
25
|
/** Render as **/
|
|
30
26
|
as?: React.ElementType;
|
|
31
27
|
}
|
|
32
|
-
export declare const EditableBookmark: ({ id, title, untitled, params,
|
|
28
|
+
export declare const EditableBookmark: ({ id, title, untitled, params, titleField, saveButton, removeButton, inputValue, onChange, editIconAltText, ...rest }: EditableBookmarkProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altinn/altinn-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
"lint-staged": {
|
|
67
67
|
"**/*.*": "biome check --staged --no-errors-on-unmatched --write"
|
|
68
68
|
},
|
|
69
|
+
"repository": {
|
|
70
|
+
"type": "git",
|
|
71
|
+
"url": "https://github.com/Altinn/altinn-components.git"
|
|
72
|
+
},
|
|
69
73
|
"scripts": {
|
|
70
74
|
"test": "vitest run",
|
|
71
75
|
"storybook": "storybook dev -p 6006",
|