@altinn/altinn-components 0.15.3 → 0.15.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/README.md +38 -1
- package/dist/altinn-ds-overrides.css +1 -0
- package/dist/assets/ButtonBase.css +1 -1
- package/dist/assets/DialogSelect.css +1 -1
- package/dist/assets/DrawerBase.css +1 -1
- package/dist/assets/DropdownBase.css +1 -1
- package/dist/assets/HeaderSearch.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemLabel.css +1 -1
- package/dist/assets/ListItemSelect.css +1 -1
- package/dist/assets/MenuSearch.css +1 -1
- package/dist/assets/SearchbarBase.css +1 -1
- package/dist/assets/ToolbarFilterBase.css +1 -1
- package/dist/components/Button/ButtonBase.js +13 -14
- package/dist/components/Byline/Byline.js +1 -1
- package/dist/components/Dialog/DialogHeading.js +1 -1
- package/dist/components/Dialog/DialogListItem.js +25 -23
- package/dist/components/Dialog/DialogSelect.js +10 -10
- package/dist/components/Dropdown/DrawerBase.js +20 -16
- package/dist/components/Dropdown/DropdownBase.js +21 -19
- package/dist/components/Header/HeaderMenu.js +5 -5
- package/dist/components/Header/HeaderSearch.js +10 -6
- package/dist/components/Icon/Icon.js +8 -8
- package/dist/components/List/ListItem.js +83 -68
- package/dist/components/List/ListItemBase.js +61 -56
- package/dist/components/List/ListItemLabel.js +6 -6
- package/dist/components/List/ListItemLink.js +5 -7
- package/dist/components/List/ListItemSelect.js +7 -7
- package/dist/components/Menu/MenuBase.js +6 -12
- package/dist/components/Menu/MenuItemBase.js +41 -48
- package/dist/components/Menu/MenuItems.js +26 -26
- package/dist/components/Menu/MenuSearch.js +11 -11
- package/dist/components/Meta/MetaItem.js +1 -1
- package/dist/components/Meta/MetaTimestamp.js +1 -1
- package/dist/components/Search/SearchField.js +15 -16
- package/dist/components/Search/SearchbarBase.js +10 -15
- package/dist/components/Skeleton/Skeleton.js +15 -5
- package/dist/components/Toolbar/ToolbarFilterBase.js +10 -5
- package/dist/components/Typography/Heading.js +1 -1
- package/dist/types/lib/components/Dialog/DialogListItem.stories.d.ts +7 -1
- package/dist/types/lib/components/Header/HeaderMenu.d.ts +1 -1
- package/dist/types/lib/components/List/ListItemBase.d.ts +2 -1
- package/dist/types/lib/components/List/ListItemLink.d.ts +1 -1
- package/dist/types/lib/components/Menu/MenuBase.d.ts +2 -2
- package/dist/types/lib/components/Menu/MenuItemBase.d.ts +1 -1
- package/package.json +3 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Icon as
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as m } from "../Icon/Icon.js";
|
|
3
3
|
import "../Icon/SvgIcon.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { IconButton as
|
|
6
|
+
import { IconButton as a } from "../Button/IconButton.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Search/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import '../../assets/MenuSearch.css';const l = "
|
|
10
|
+
import '../../assets/MenuSearch.css';const l = "_field_8g6tu_1", p = "_icon_8g6tu_6", u = "_input_8g6tu_15", _ = "_clear_8g6tu_31", t = {
|
|
11
11
|
field: l,
|
|
12
12
|
icon: p,
|
|
13
13
|
input: u,
|
|
14
14
|
clear: _
|
|
15
|
-
}, v = ({ value:
|
|
16
|
-
/* @__PURE__ */
|
|
15
|
+
}, v = ({ value: c, name: n, placeholder: s = "Søk", onChange: e, onClear: i }) => /* @__PURE__ */ r("div", { className: t.field, children: [
|
|
16
|
+
/* @__PURE__ */ o(
|
|
17
17
|
"input",
|
|
18
18
|
{
|
|
19
19
|
type: "search",
|
|
20
|
-
value:
|
|
20
|
+
value: c,
|
|
21
21
|
name: n,
|
|
22
22
|
placeholder: s,
|
|
23
|
-
className:
|
|
24
|
-
onChange:
|
|
23
|
+
className: t.input,
|
|
24
|
+
onChange: e,
|
|
25
25
|
autoComplete: "off"
|
|
26
26
|
}
|
|
27
27
|
),
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
28
|
+
/* @__PURE__ */ o(m, { name: "magnifying-glass", className: t.icon }),
|
|
29
|
+
i && /* @__PURE__ */ o(a, { icon: "x-mark", variant: "solid", size: "custom", className: t.clear, onClick: i })
|
|
30
30
|
] });
|
|
31
31
|
export {
|
|
32
32
|
v as MenuSearch
|
|
@@ -11,7 +11,7 @@ const n = ({
|
|
|
11
11
|
icon: o,
|
|
12
12
|
children: f,
|
|
13
13
|
...x
|
|
14
|
-
}) => /* @__PURE__ */ e(
|
|
14
|
+
}) => /* @__PURE__ */ e(a, { loading: m, children: /* @__PURE__ */ M(s, { reverse: p, variant: r, size: t, ...x, children: [
|
|
15
15
|
!m && o && /* @__PURE__ */ e(i, { size: t, icon: o }),
|
|
16
16
|
/* @__PURE__ */ e(I, { variant: r, size: t, children: f })
|
|
17
17
|
] }) });
|
|
@@ -10,7 +10,7 @@ const j = ({
|
|
|
10
10
|
datetime: p,
|
|
11
11
|
icon: o,
|
|
12
12
|
children: a
|
|
13
|
-
}) => /* @__PURE__ */ e(i, { as: "time", variant: r, datetime: p, size: t, children:
|
|
13
|
+
}) => /* @__PURE__ */ e(f, { loading: m, children: /* @__PURE__ */ s(i, { as: "time", variant: r, datetime: p, size: t, children: [
|
|
14
14
|
!m && o && /* @__PURE__ */ e(M, { size: t, icon: o }),
|
|
15
15
|
/* @__PURE__ */ e(x, { variant: r, size: t, children: a })
|
|
16
16
|
] }) });
|
|
@@ -4,7 +4,7 @@ import { c as I } from "../../index-L8X2o7IH.js";
|
|
|
4
4
|
import { useRef as N } from "react";
|
|
5
5
|
import { Icon as g } from "../Icon/Icon.js";
|
|
6
6
|
import "../Icon/SvgIcon.js";
|
|
7
|
-
import { IconButton as
|
|
7
|
+
import { IconButton as n } from "../Button/IconButton.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
9
|
import "./AutocompleteBase.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
@@ -15,32 +15,32 @@ import '../../assets/SearchField.css';const C = "_field_1y3oc_1", j = "_icon_1y3
|
|
|
15
15
|
dismiss: S,
|
|
16
16
|
clear: T
|
|
17
17
|
}, A = ({
|
|
18
|
-
className:
|
|
19
|
-
expanded:
|
|
18
|
+
className: l,
|
|
19
|
+
expanded: m,
|
|
20
20
|
name: p = "q",
|
|
21
|
-
value:
|
|
21
|
+
value: t,
|
|
22
22
|
placeholder: u = "Søk",
|
|
23
23
|
onFocus: d,
|
|
24
24
|
onBlur: f,
|
|
25
25
|
onChange: _,
|
|
26
26
|
onClear: y,
|
|
27
27
|
onClose: x,
|
|
28
|
-
onEnter:
|
|
28
|
+
onEnter: c,
|
|
29
29
|
tabIndex: h
|
|
30
30
|
}) => {
|
|
31
|
-
const
|
|
32
|
-
var
|
|
33
|
-
e.key === "Escape" && ((
|
|
31
|
+
const o = N(null), k = (e) => {
|
|
32
|
+
var a, r;
|
|
33
|
+
e.key === "Escape" && ((a = o.current) == null || a.blur()), e.key === "Enter" && ((r = o.current) == null || r.blur(), c == null || c());
|
|
34
34
|
};
|
|
35
|
-
return /* @__PURE__ */ b("div", { className: I(s.field,
|
|
35
|
+
return /* @__PURE__ */ b("div", { className: I(s.field, l), children: [
|
|
36
36
|
/* @__PURE__ */ i(
|
|
37
37
|
"input",
|
|
38
38
|
{
|
|
39
|
-
ref:
|
|
39
|
+
ref: o,
|
|
40
40
|
onFocus: d,
|
|
41
41
|
onBlur: f,
|
|
42
42
|
name: p,
|
|
43
|
-
value:
|
|
43
|
+
value: t,
|
|
44
44
|
onChange: _,
|
|
45
45
|
placeholder: u,
|
|
46
46
|
className: s.input,
|
|
@@ -49,13 +49,12 @@ import '../../assets/SearchField.css';const C = "_field_1y3oc_1", j = "_icon_1y3
|
|
|
49
49
|
"aria-haspopup": !0,
|
|
50
50
|
autoComplete: "off",
|
|
51
51
|
"aria-autocomplete": "list",
|
|
52
|
-
"aria-expanded": c,
|
|
53
52
|
tabIndex: h ?? 0
|
|
54
53
|
}
|
|
55
54
|
),
|
|
56
55
|
/* @__PURE__ */ i(g, { name: "magnifying-glass", className: s.icon }),
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
t && /* @__PURE__ */ i(
|
|
57
|
+
n,
|
|
59
58
|
{
|
|
60
59
|
icon: "x-mark",
|
|
61
60
|
variant: "solid",
|
|
@@ -64,8 +63,8 @@ import '../../assets/SearchField.css';const C = "_field_1y3oc_1", j = "_icon_1y3
|
|
|
64
63
|
onClick: y,
|
|
65
64
|
dataTestId: "search-button-clear"
|
|
66
65
|
}
|
|
67
|
-
) ||
|
|
68
|
-
|
|
66
|
+
) || m && /* @__PURE__ */ i(
|
|
67
|
+
n,
|
|
69
68
|
{
|
|
70
69
|
icon: "x-mark",
|
|
71
70
|
variant: "text",
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/SearchbarBase.css';const
|
|
4
|
-
searchbar:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"data-autocomplete": s,
|
|
11
|
-
"data-color": "neutral",
|
|
12
|
-
children: r
|
|
13
|
-
}
|
|
14
|
-
);
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/SearchbarBase.css';const b = "_searchbar_1qnvb_1", d = "_searchbarExpanded_1qnvb_14", a = {
|
|
4
|
+
searchbar: b,
|
|
5
|
+
searchbarExpanded: d
|
|
6
|
+
}, p = ({ className: r, children: e, expanded: s = !1, autocomplete: c = !1 }) => {
|
|
7
|
+
const t = n(a.searchbar, r, s && a.searchbarExpanded);
|
|
8
|
+
return /* @__PURE__ */ o("div", { className: t, "data-autocomplete": c, "data-color": "neutral", children: e });
|
|
9
|
+
};
|
|
15
10
|
export {
|
|
16
|
-
|
|
11
|
+
p as SearchbarBase
|
|
17
12
|
};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { c as r } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import '../../assets/Skeleton.css';const
|
|
4
|
-
skelaton:
|
|
5
|
-
fade:
|
|
6
|
-
},
|
|
3
|
+
import '../../assets/Skeleton.css';const d = "_skelaton_10sb8_1", f = "_fade_10sb8_1", l = {
|
|
4
|
+
skelaton: d,
|
|
5
|
+
fade: f
|
|
6
|
+
}, _ = ({ loading: a = !1, size: s, variant: e = "text", className: o, children: t }) => a ? /* @__PURE__ */ n(
|
|
7
|
+
"span",
|
|
8
|
+
{
|
|
9
|
+
className: r(l.skelaton, o),
|
|
10
|
+
"data-size": s,
|
|
11
|
+
"data-loading": a,
|
|
12
|
+
"data-variant": e,
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: t
|
|
15
|
+
}
|
|
16
|
+
) : t;
|
|
7
17
|
export {
|
|
8
|
-
|
|
18
|
+
_ as Skeleton
|
|
9
19
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as o } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/ToolbarFilterBase.css';const r = "_base_4n04w_1", d = "_expanded_4n04w_5", e = {
|
|
4
|
+
base: r,
|
|
5
|
+
expanded: d
|
|
6
|
+
}, p = ({ expanded: s = !1, children: a }) => {
|
|
7
|
+
const t = o(e.base, s && e.expanded);
|
|
8
|
+
return /* @__PURE__ */ n("div", { className: t, children: a });
|
|
9
|
+
};
|
|
5
10
|
export {
|
|
6
|
-
|
|
11
|
+
p as ToolbarFilterBase
|
|
7
12
|
};
|
|
@@ -3,7 +3,7 @@ import { c as s } from "../../index-L8X2o7IH.js";
|
|
|
3
3
|
import { Skeleton as d } from "../Skeleton/Skeleton.js";
|
|
4
4
|
import '../../assets/Heading.css';const r = "_heading_mt0g8_1", c = {
|
|
5
5
|
heading: r
|
|
6
|
-
}, f = ({ loading: t, as: a = "h2", size: i = "md", weight: n = "medium", className: o, children: m }) => /* @__PURE__ */ e(a, { className: s(c.heading, o), "data-size": i, "data-weight": n, children:
|
|
6
|
+
}, f = ({ loading: t, as: a = "h2", size: i = "md", weight: n = "medium", className: o, children: m }) => /* @__PURE__ */ e(d, { loading: t, children: /* @__PURE__ */ e(a, { className: s(c.heading, o), "data-size": i, "data-weight": n, children: m }) });
|
|
7
7
|
export {
|
|
8
8
|
f as Heading
|
|
9
9
|
};
|
|
@@ -12,7 +12,13 @@ export declare const InboxStatuses: (args: DialogListItemProps) => import("react
|
|
|
12
12
|
export declare const DraftAndSent: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const ArchivedAndTrashed: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const Statuses: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
|
|
15
|
+
declare const Loading: {
|
|
16
|
+
(args: DialogListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
parameters: {
|
|
18
|
+
tags: string[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export { Loading };
|
|
16
22
|
export declare const Variants: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
23
|
export declare const DueAt: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
24
|
export declare const Attachments: (args: DialogListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,4 +4,4 @@ export interface HeaderMenuProps {
|
|
|
4
4
|
expanded?: boolean;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}
|
|
7
|
-
export declare const HeaderMenu: ({
|
|
7
|
+
export declare const HeaderMenu: ({ className, children }: HeaderMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,7 @@ 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
|
+
title?: string;
|
|
9
10
|
interactive?: boolean;
|
|
10
11
|
as?: ElementType;
|
|
11
12
|
href?: string;
|
|
@@ -26,4 +27,4 @@ export interface ListItemBaseProps {
|
|
|
26
27
|
expanded?: boolean;
|
|
27
28
|
children?: ReactNode;
|
|
28
29
|
}
|
|
29
|
-
export declare const ListItemBase: ({ interactive, as, href, onClick, onKeyPress, tabIndex, size, variant, color, theme, shadow, loading, disabled, hidden, active, selected,
|
|
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;
|
|
@@ -14,4 +14,4 @@ export interface ListItemLinkProps {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
children?: ReactNode;
|
|
16
16
|
}
|
|
17
|
-
export declare const ListItemLink: ({ interactive, size, as, loading, disabled, selected, href, onClick, onKeyPress,
|
|
17
|
+
export declare const ListItemLink: ({ interactive, size, as, loading, disabled, selected, href, onClick, onKeyPress, className, children, }: ListItemLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,5 +26,5 @@ export interface MenuListItemProps {
|
|
|
26
26
|
children?: ReactNode;
|
|
27
27
|
}
|
|
28
28
|
export declare const MenuBase: ({ as, color, theme, className, children }: MenuBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export declare const MenuList: ({ as, role,
|
|
30
|
-
export declare const MenuListItem: ({ as, role,
|
|
29
|
+
export declare const MenuList: ({ as, role, className, children }: MenuListProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const MenuListItem: ({ as, role, className, children }: MenuListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,4 +23,4 @@ export interface MenuItemBaseProps {
|
|
|
23
23
|
linkIcon?: IconName;
|
|
24
24
|
linkText?: string;
|
|
25
25
|
}
|
|
26
|
-
export declare const MenuItemBase: ({ as, color, theme, size, className, href, onClick, onKeyPress, tabIndex, hidden, disabled,
|
|
26
|
+
export declare const MenuItemBase: ({ as, color, theme, size, className, href, onClick, onKeyPress, tabIndex, hidden, disabled, linkIcon, linkText, badge, children, }: MenuItemBaseProps) => 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.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@biomejs/biome": "1.9.4",
|
|
30
30
|
"@chromatic-com/storybook": "^3.2.4",
|
|
31
|
-
"@storybook/addon-mdx-gfm": "^8.5.0",
|
|
32
31
|
"@storybook/addon-a11y": "^8.5.0",
|
|
33
32
|
"@storybook/addon-essentials": "^8.5.0",
|
|
34
33
|
"@storybook/addon-interactions": "^8.5.0",
|
|
35
34
|
"@storybook/addon-links": "^8.5.0",
|
|
35
|
+
"@storybook/addon-mdx-gfm": "^8.5.0",
|
|
36
36
|
"@storybook/addon-themes": "^8.5.0",
|
|
37
37
|
"@storybook/blocks": "^8.5.0",
|
|
38
38
|
"@storybook/react": "^8.5.0",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@types/react-dom": "^18.3.5",
|
|
44
44
|
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
45
45
|
"axe-core": "^4.10.2",
|
|
46
|
+
"axe-playwright": "^2.0.3",
|
|
46
47
|
"glob": "^11.0.1",
|
|
47
48
|
"lint-staged": "^15.4.1",
|
|
48
49
|
"playwright": "^1.49.1",
|