@altinn/altinn-components 0.43.2 → 0.43.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/MenuOption.css +1 -1
- package/dist/components/Header/Header.js +12 -12
- package/dist/components/Menu/MenuOption.js +60 -55
- package/dist/components/Menu/MenuSearch.js +30 -26
- package/dist/components/Toolbar/ToolbarAdd.js +4 -4
- package/dist/components/Toolbar/ToolbarMenu.js +20 -12
- package/dist/types/lib/components/Toolbar/ToolbarMenu.d.ts +2 -1
- package/dist/types/lib/components/Toolbar/ToolbarMenu.stories.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._label_ggqvo_1{flex-grow:1;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 .125rem;font-size:1rem;column-gap:.5em;pointer-events:none}._title_ggqvo_13{color:var(--ds-color-text-default);display:inline;vertical-align:text-top}._titleWrapper_ggqvo_19{display:inline;line-height:1.25}._count_ggqvo_24{margin-left:.5rem;display:inline;font-size:smaller;white-space:nowrap}._radio_ggqvo_31,._checkbox_ggqvo_32{flex-shrink:0;flex-grow:0;position:relative;width:1.25em;height:1.25em;display:flex;align-items:center;justify-content:center;color:transparent}._radio_ggqvo_31{border:1px solid;border-color:var(--ds-color-border-subtle);outline:var(--ds-color-border-subtle) solid 1px;border-radius:50%}._checkbox_ggqvo_32{border:2px solid;border-color:var(--ds-color-border-subtle);border-radius:2px}._radio_ggqvo_31[data-checked=true],._checkbox_ggqvo_32[data-checked=true]{background-color:var(--ds-color-base-default);border:none;outline-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._icon_ggqvo_65{font-size:1.25em}@supports (-webkit-hyphens: none){._icon_ggqvo_65{font-size:unset;width:1.25em;height:1.25em}._icon_ggqvo_65 svg,._icon_ggqvo_65 img{width:100%;height:100%}}
|
|
@@ -5,16 +5,16 @@ import "react";
|
|
|
5
5
|
import { useRootContext as S } from "../RootProvider/RootProvider.js";
|
|
6
6
|
import { DropdownBase as k } from "../Dropdown/DropdownBase.js";
|
|
7
7
|
import { DrawerBase as B } from "../Dropdown/DrawerBase.js";
|
|
8
|
+
import { useIsDesktop as D } from "../../hooks/useIsDesktop.js";
|
|
8
9
|
import { GlobalMenu as f } from "../GlobalMenu/GlobalMenu.js";
|
|
9
|
-
import { GlobalMenuButton as
|
|
10
|
-
import { HeaderBase as
|
|
11
|
-
import { HeaderLogo as
|
|
12
|
-
import { HeaderGroup as
|
|
10
|
+
import { GlobalMenuButton as I } from "../GlobalMenu/GlobalMenuButton.js";
|
|
11
|
+
import { HeaderBase as l } from "./HeaderBase.js";
|
|
12
|
+
import { HeaderLogo as F } from "./HeaderLogo.js";
|
|
13
|
+
import { HeaderGroup as G } from "./HeaderGroup.js";
|
|
13
14
|
import { HeaderSearch as w } from "./HeaderSearch.js";
|
|
14
|
-
import { LocaleSwitcher as
|
|
15
|
+
import { LocaleSwitcher as L } from "./LocaleSwitcher.js";
|
|
15
16
|
import { Searchbar as x } from "../Searchbar/Searchbar.js";
|
|
16
17
|
import "../Snackbar/useSnackbar.js";
|
|
17
|
-
import { useIsDesktop as L } from "../../hooks/useIsDesktop.js";
|
|
18
18
|
import '../../assets/Header.css';const N = "_drawer_afyu3_1", j = "_dropdown_afyu3_6", z = "_relative_afyu3_19", n = {
|
|
19
19
|
drawer: N,
|
|
20
20
|
dropdown: j,
|
|
@@ -35,21 +35,21 @@ import '../../assets/Header.css';const N = "_drawer_afyu3_1", j = "_dropdown_afy
|
|
|
35
35
|
i("search");
|
|
36
36
|
}, H = () => {
|
|
37
37
|
i("menu");
|
|
38
|
-
}, h =
|
|
38
|
+
}, h = D();
|
|
39
39
|
return /* @__PURE__ */ d(
|
|
40
|
-
|
|
40
|
+
l,
|
|
41
41
|
{
|
|
42
42
|
currentId: r,
|
|
43
43
|
open: r === "search" || r === "menu" || r === "locale",
|
|
44
44
|
onClose: m,
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ o(
|
|
46
|
+
/* @__PURE__ */ o(F, { ...u, badge: v }),
|
|
47
47
|
s && h && /* @__PURE__ */ o(w, { expanded: r === "search", children: /* @__PURE__ */ o(x, { ...s, expanded: r === "search", onClose: a, onFocus: c }) }),
|
|
48
|
-
/* @__PURE__ */ d(
|
|
49
|
-
p && /* @__PURE__ */ o(
|
|
48
|
+
/* @__PURE__ */ d(G, { children: [
|
|
49
|
+
p && /* @__PURE__ */ o(L, { ...p }),
|
|
50
50
|
/* @__PURE__ */ d("div", { className: n.relative, children: [
|
|
51
51
|
/* @__PURE__ */ o(
|
|
52
|
-
|
|
52
|
+
I,
|
|
53
53
|
{
|
|
54
54
|
currentAccount: t,
|
|
55
55
|
onClick: H,
|
|
@@ -1,80 +1,85 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
|
-
import { MenuItem as
|
|
5
|
+
import { MenuItem as m } from "./MenuItem.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import { S as
|
|
8
|
-
import '../../assets/MenuOption.css';const
|
|
9
|
-
label:
|
|
10
|
-
title:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { S as _ } from "../../Checkmark-Byz_C9x4.js";
|
|
8
|
+
import '../../assets/MenuOption.css';const b = "_label_ggqvo_1", x = "_title_ggqvo_13", q = "_titleWrapper_ggqvo_19", f = "_count_ggqvo_24", k = "_radio_ggqvo_31", W = "_checkbox_ggqvo_32", I = "_icon_ggqvo_65", e = {
|
|
9
|
+
label: b,
|
|
10
|
+
title: x,
|
|
11
|
+
titleWrapper: q,
|
|
12
|
+
count: f,
|
|
13
|
+
radio: k,
|
|
14
|
+
checkbox: W,
|
|
15
|
+
icon: I
|
|
15
16
|
}, C = ({
|
|
16
|
-
size:
|
|
17
|
+
size: n = "md",
|
|
17
18
|
type: h,
|
|
18
|
-
name:
|
|
19
|
-
active:
|
|
20
|
-
value:
|
|
21
|
-
label:
|
|
22
|
-
title:
|
|
23
|
-
description:
|
|
24
|
-
icon:
|
|
25
|
-
count:
|
|
26
|
-
checked:
|
|
27
|
-
disabled:
|
|
28
|
-
onMouseEnter:
|
|
29
|
-
onClick:
|
|
30
|
-
role:
|
|
31
|
-
...
|
|
19
|
+
name: M,
|
|
20
|
+
active: i,
|
|
21
|
+
value: j,
|
|
22
|
+
label: c,
|
|
23
|
+
title: g,
|
|
24
|
+
description: u,
|
|
25
|
+
icon: v,
|
|
26
|
+
count: t = 0,
|
|
27
|
+
checked: s = !1,
|
|
28
|
+
disabled: o,
|
|
29
|
+
onMouseEnter: S,
|
|
30
|
+
onClick: l,
|
|
31
|
+
role: d,
|
|
32
|
+
...p
|
|
32
33
|
}) => {
|
|
33
|
-
const
|
|
34
|
+
const N = () => {
|
|
34
35
|
switch (h) {
|
|
35
36
|
case "checkbox":
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */ a("span", { className: e.checkbox, "data-checked":
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
37
|
+
return /* @__PURE__ */ r("span", { className: e.label, children: [
|
|
38
|
+
/* @__PURE__ */ a("span", { className: e.checkbox, "data-checked": s, children: /* @__PURE__ */ a(_, { className: e.icon, "aria-hidden": !0 }) }),
|
|
39
|
+
/* @__PURE__ */ r("div", { className: e.titleWrapper, children: [
|
|
40
|
+
/* @__PURE__ */ a("span", { className: e.title, children: c }),
|
|
41
|
+
t > 0 && /* @__PURE__ */ a("span", { className: e.count, "aria-hidden": "true", children: t })
|
|
42
|
+
] })
|
|
40
43
|
] });
|
|
41
44
|
case "radio":
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */ a("span", { className: e.radio, "data-checked":
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
45
|
+
return /* @__PURE__ */ r("span", { className: e.label, children: [
|
|
46
|
+
/* @__PURE__ */ a("span", { className: e.radio, "data-checked": s, children: /* @__PURE__ */ a(_, { className: e.icon, "aria-hidden": !0 }) }),
|
|
47
|
+
/* @__PURE__ */ r("div", { className: e.titleWrapper, children: [
|
|
48
|
+
/* @__PURE__ */ a("span", { className: e.title, children: c }),
|
|
49
|
+
t > 0 && /* @__PURE__ */ a("span", { className: e.count, "aria-hidden": "true", children: t })
|
|
50
|
+
] })
|
|
46
51
|
] });
|
|
47
52
|
}
|
|
48
53
|
};
|
|
49
|
-
return
|
|
50
|
-
|
|
54
|
+
return c ? /* @__PURE__ */ a(
|
|
55
|
+
m,
|
|
51
56
|
{
|
|
52
|
-
disabled:
|
|
53
|
-
selected:
|
|
54
|
-
size:
|
|
57
|
+
disabled: o,
|
|
58
|
+
selected: s,
|
|
59
|
+
size: n,
|
|
55
60
|
as: "div",
|
|
56
|
-
active:
|
|
61
|
+
active: i,
|
|
57
62
|
tabIndex: -1,
|
|
58
|
-
onClick:
|
|
59
|
-
role:
|
|
60
|
-
label: /* @__PURE__ */ a(
|
|
61
|
-
...
|
|
63
|
+
onClick: l,
|
|
64
|
+
role: d,
|
|
65
|
+
label: /* @__PURE__ */ a(N, {}),
|
|
66
|
+
...p
|
|
62
67
|
}
|
|
63
68
|
) : /* @__PURE__ */ a(
|
|
64
|
-
|
|
69
|
+
m,
|
|
65
70
|
{
|
|
66
|
-
disabled:
|
|
67
|
-
selected:
|
|
68
|
-
size:
|
|
71
|
+
disabled: o,
|
|
72
|
+
selected: s,
|
|
73
|
+
size: n,
|
|
69
74
|
as: "div",
|
|
70
|
-
active:
|
|
75
|
+
active: i,
|
|
71
76
|
tabIndex: -1,
|
|
72
|
-
onClick:
|
|
73
|
-
role:
|
|
74
|
-
icon:
|
|
75
|
-
title:
|
|
76
|
-
description:
|
|
77
|
-
...
|
|
77
|
+
onClick: l,
|
|
78
|
+
role: d,
|
|
79
|
+
icon: v,
|
|
80
|
+
title: g,
|
|
81
|
+
description: u,
|
|
82
|
+
...p
|
|
78
83
|
}
|
|
79
84
|
);
|
|
80
85
|
};
|
|
@@ -2,35 +2,39 @@ import { jsx as f } from "react/jsx-runtime";
|
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
|
+
import { useIsDesktop as a } from "../../hooks/useIsDesktop.js";
|
|
5
6
|
import "../Snackbar/useSnackbar.js";
|
|
6
|
-
import { SearchField as
|
|
7
|
-
import '../../assets/MenuSearch.css';const
|
|
8
|
-
field:
|
|
9
|
-
},
|
|
10
|
-
name:
|
|
7
|
+
import { SearchField as c } from "../Forms/SearchField.js";
|
|
8
|
+
import '../../assets/MenuSearch.css';const l = "_field_1w1s0_1", n = {
|
|
9
|
+
field: l
|
|
10
|
+
}, x = ({
|
|
11
|
+
name: e,
|
|
11
12
|
value: r,
|
|
12
13
|
placeholder: t = "Search",
|
|
13
|
-
clearButtonAltText:
|
|
14
|
-
onChange:
|
|
15
|
-
onClear:
|
|
16
|
-
}) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
clearButtonAltText: s = "Clear search",
|
|
15
|
+
onChange: i,
|
|
16
|
+
onClear: p
|
|
17
|
+
}) => {
|
|
18
|
+
const m = a();
|
|
19
|
+
return /* @__PURE__ */ f(
|
|
20
|
+
c,
|
|
21
|
+
{
|
|
22
|
+
size: "xs",
|
|
23
|
+
name: e,
|
|
24
|
+
value: r,
|
|
25
|
+
placeholder: t,
|
|
26
|
+
onChange: i,
|
|
27
|
+
onClear: p,
|
|
28
|
+
clearButtonAltText: s,
|
|
29
|
+
className: n.field,
|
|
30
|
+
autoComplete: "off",
|
|
31
|
+
autoFocus: m,
|
|
32
|
+
onKeyDown: (o) => {
|
|
33
|
+
(o.key === "ArrowUp" || o.key === "ArrowDown") && o.preventDefault();
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
);
|
|
37
|
+
};
|
|
34
38
|
export {
|
|
35
|
-
|
|
39
|
+
x as MenuSearch
|
|
36
40
|
};
|
|
@@ -3,19 +3,19 @@ import "../../index-L8X2o7IH.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import { useRootContext as u } from "../RootProvider/RootProvider.js";
|
|
5
5
|
import { DrawerOrDropdown as f } from "../Dropdown/DrawerOrDropdown.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useIsDesktop as g } from "../../hooks/useIsDesktop.js";
|
|
7
|
+
import { Menu as x } from "../Menu/Menu.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
9
|
import { ToolbarButton as T } from "./ToolbarButton.js";
|
|
10
10
|
import { ToolbarFilterBase as B } from "./ToolbarFilterBase.js";
|
|
11
11
|
const v = ({ label: t = "Legg til", items: p, id: e }) => {
|
|
12
|
-
const { currentId: i, closeAll: a, toggleId: d } = u(), o = i === e, l = () => d(e), m =
|
|
12
|
+
const { currentId: i, closeAll: a, toggleId: d } = u(), o = i === e, l = () => d(e), m = g();
|
|
13
13
|
return /* @__PURE__ */ c(B, { expanded: o, onBlurCapture: (n) => {
|
|
14
14
|
const s = n.relatedTarget;
|
|
15
15
|
(!s || !n.currentTarget.contains(s)) && a();
|
|
16
16
|
}, children: [
|
|
17
17
|
/* @__PURE__ */ r(T, { type: "add", onToggle: l, "aria-expanded": o, children: t }),
|
|
18
|
-
/* @__PURE__ */ r(f, { drawerTitle: t, open: o, children: /* @__PURE__ */ r(
|
|
18
|
+
/* @__PURE__ */ r(f, { drawerTitle: t, open: o, children: /* @__PURE__ */ r(x, { color: "neutral", items: p, keyboardEvents: o && m }) })
|
|
19
19
|
] });
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useRootContext as
|
|
5
|
-
import { DrawerOrDropdown as
|
|
6
|
-
import { Menu as
|
|
4
|
+
import { useRootContext as f } from "../RootProvider/RootProvider.js";
|
|
5
|
+
import { DrawerOrDropdown as x } from "../Dropdown/DrawerOrDropdown.js";
|
|
6
|
+
import { Menu as T } from "../Menu/Menu.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { ToolbarButton as
|
|
9
|
-
import { ToolbarFilterBase as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import { ToolbarButton as b } from "./ToolbarButton.js";
|
|
9
|
+
import { ToolbarFilterBase as g } from "./ToolbarFilterBase.js";
|
|
10
|
+
const v = ({
|
|
11
|
+
label: e,
|
|
12
|
+
value: n,
|
|
13
|
+
groups: m,
|
|
14
|
+
search: i,
|
|
15
|
+
items: l,
|
|
16
|
+
id: r = "toolbar-menu",
|
|
17
|
+
title: p = "Endre aktør"
|
|
18
|
+
}) => {
|
|
19
|
+
const { currentId: s, toggleId: c, closeAll: a } = f(), d = () => c(r), t = s === r;
|
|
20
|
+
return /* @__PURE__ */ u(g, { expanded: t, children: [
|
|
21
|
+
/* @__PURE__ */ o(b, { type: "switch", onToggle: d, active: !!n, children: e }),
|
|
22
|
+
/* @__PURE__ */ o(x, { open: t, drawerTitle: p, onClose: a, children: /* @__PURE__ */ o(T, { groups: m, search: i, items: l }) })
|
|
15
23
|
] });
|
|
16
24
|
};
|
|
17
25
|
export {
|
|
18
|
-
|
|
26
|
+
v as ToolbarMenu
|
|
19
27
|
};
|
|
@@ -2,10 +2,11 @@ import { MenuItemGroups, MenuItemProps, MenuSearchProps } from '../Menu';
|
|
|
2
2
|
export interface ToolbarMenuProps {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string | number;
|
|
5
|
+
title?: string;
|
|
5
6
|
items: MenuItemProps[];
|
|
6
7
|
groups?: MenuItemGroups;
|
|
7
8
|
search?: MenuSearchProps;
|
|
8
9
|
id?: string;
|
|
9
10
|
className?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare const ToolbarMenu: ({ label, value, groups, search, items, id }: ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const ToolbarMenu: ({ label, value, groups, search, items, id, title, }: ToolbarMenuProps) => 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: ({ label, value, groups, search, items, id }: import('./ToolbarMenu').ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ label, value, groups, search, items, id, title, }: import('./ToolbarMenu').ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: {
|