@altinn/altinn-components 0.46.5 → 0.46.6
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/GlobalMenuButton2.css +1 -1
- package/dist/components/Footer/FooterLogo.js +8 -8
- package/dist/components/GlobalHeader/DigdirLogomark.js +10 -9
- package/dist/components/GlobalHeader/GlobalSearch.js +29 -25
- package/dist/components/GlobalHeader/GlobalSearchButton.js +5 -5
- package/dist/components/GlobalHeader/HeaderLogo.js +19 -13
- package/dist/components/GlobalMenu/GlobalMenuButton.js +64 -45
- package/dist/types/lib/components/GlobalHeader/DigdirLogomark.d.ts +2 -1
- package/dist/types/lib/components/GlobalHeader/HeaderLogo.d.ts +1 -1
- package/dist/types/lib/components/Header/Header.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_rhdbs_1{flex-shrink:0;position:relative;z-index:2;display:inline-flex;align-items:center;column-gap:.625rem;padding:.625rem;border:none;border-radius:4px}._label_rhdbs_13{font-size:1.125rem;font-weight:500;padding:.25rem}._avatar_rhdbs_19{font-size:2.25rem;width:2.25rem;height:2.25rem}._icon_rhdbs_25{font-size:1.5rem;width:1.5rem;height:1.5rem}._iconMobile_rhdbs_31{font-size:1.5rem;width:3.55rem;height:1.5rem}._badge_rhdbs_37{position:absolute;top:0;right:0;margin-top:-.75rem;margin-right:-.75rem}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { DigdirLogomark as
|
|
4
|
-
import '../../assets/FooterLogo.css';const
|
|
5
|
-
logo:
|
|
6
|
-
symbol:
|
|
7
|
-
},
|
|
8
|
-
/* @__PURE__ */ o(
|
|
2
|
+
import { c as i } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { DigdirLogomark as t } from "../Header/DigdirLogomark.js";
|
|
4
|
+
import '../../assets/FooterLogo.css';const c = "_logo_127g0_1", e = "_symbol_127g0_9", s = {
|
|
5
|
+
logo: c,
|
|
6
|
+
symbol: e
|
|
7
|
+
}, d = ({ className: r, title: l = "Digdir" }) => /* @__PURE__ */ m("div", { className: i(s.logo, r), children: [
|
|
8
|
+
/* @__PURE__ */ o(t, { className: s.symbol, "aria-hidden": !0 }),
|
|
9
9
|
/* @__PURE__ */ o("span", { children: l })
|
|
10
10
|
] });
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
d as FooterLogo
|
|
13
13
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useIsDesktop as
|
|
3
|
-
const p = ({ className:
|
|
4
|
-
const l =
|
|
5
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsxs as e, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { useIsDesktop as r } from "../../hooks/useIsDesktop.js";
|
|
3
|
+
const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) => {
|
|
4
|
+
const l = r() ? 8.5 : 7, { width: t, height: n } = { width: `${l}em`, height: `${l * 0.34}em` };
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
6
|
"svg",
|
|
7
7
|
{
|
|
8
8
|
fill: "none",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
10
|
+
width: t,
|
|
11
|
+
height: n,
|
|
12
12
|
viewBox: "0 0 113.779 38.8565",
|
|
13
13
|
version: "1.1",
|
|
14
|
-
className:
|
|
14
|
+
className: L,
|
|
15
|
+
"aria-hidden": o,
|
|
15
16
|
children: [
|
|
16
17
|
/* @__PURE__ */ C("title", { children: i }),
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ e("g", { id: "surface1", children: [
|
|
18
19
|
/* @__PURE__ */ C(
|
|
19
20
|
"path",
|
|
20
21
|
{
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as r, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as g, useEffect as b } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { useIsDesktop as
|
|
5
|
-
import { useRootContext as
|
|
4
|
+
import { useIsDesktop as k } from "../../hooks/useIsDesktop.js";
|
|
5
|
+
import { useRootContext as v } from "../RootProvider/RootProvider.js";
|
|
6
6
|
import { s as o } from "../../globalSearch.module-Ejp7X0dO.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import { S as
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
return
|
|
8
|
+
import { S as a } from "../../index-B6sKSsN9.js";
|
|
9
|
+
import { S as x } from "../../MagnifyingGlass-bwVhw07z.js";
|
|
10
|
+
const q = ({ onSearch: t }) => {
|
|
11
|
+
const u = k(), [s, i] = d(""), { languageCode: h, closeAll: m, currentId: n } = v(), { search: p, placeholder: c } = y(h), f = () => {
|
|
12
|
+
t(s), m();
|
|
13
|
+
}, l = g(null);
|
|
14
|
+
return b(() => {
|
|
15
|
+
var e;
|
|
16
|
+
n === "search" && ((e = l.current) == null || e.focus());
|
|
17
|
+
}, [n]), /* @__PURE__ */ r(
|
|
15
18
|
"form",
|
|
16
19
|
{
|
|
17
|
-
onSubmit: (
|
|
18
|
-
|
|
20
|
+
onSubmit: (e) => {
|
|
21
|
+
e.preventDefault(), f();
|
|
19
22
|
},
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
23
|
+
children: /* @__PURE__ */ S(a, { className: o.globalSearch, "data-size": u ? "lg" : "md", children: [
|
|
24
|
+
/* @__PURE__ */ r(
|
|
25
|
+
a.Input,
|
|
23
26
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
ref: l,
|
|
28
|
+
placeholder: c,
|
|
29
|
+
onChange: (e) => i(e.target.value),
|
|
30
|
+
value: s,
|
|
31
|
+
"aria-label": c,
|
|
28
32
|
className: o.searchInput
|
|
29
33
|
}
|
|
30
34
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ r(a.Clear, {}),
|
|
36
|
+
/* @__PURE__ */ r(a.Button, { variant: "secondary", icon: !0, "aria-label": p, className: o.searchInputButton, children: /* @__PURE__ */ r(x, {}) })
|
|
33
37
|
] })
|
|
34
38
|
}
|
|
35
39
|
);
|
|
36
|
-
},
|
|
37
|
-
switch (
|
|
40
|
+
}, y = (t) => {
|
|
41
|
+
switch (t) {
|
|
38
42
|
case "nn":
|
|
39
43
|
return {
|
|
40
44
|
search: "Søk",
|
|
@@ -53,5 +57,5 @@ const B = ({ onSearch: a }) => {
|
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
59
|
export {
|
|
56
|
-
|
|
60
|
+
q as GlobalSearch
|
|
57
61
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as c, jsx as
|
|
2
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { useIsDesktop as i } from "../../hooks/useIsDesktop.js";
|
|
@@ -13,19 +13,19 @@ const v = ({
|
|
|
13
13
|
onClick: t,
|
|
14
14
|
expanded: o
|
|
15
15
|
}) => {
|
|
16
|
-
const { languageCode:
|
|
16
|
+
const { languageCode: a } = l(), { search: r, close: n } = f(a), e = i();
|
|
17
17
|
return /* @__PURE__ */ c(
|
|
18
18
|
m,
|
|
19
19
|
{
|
|
20
20
|
type: "button",
|
|
21
21
|
icon: !e,
|
|
22
|
-
title: o ?
|
|
22
|
+
title: o ? n : r,
|
|
23
23
|
onClick: t,
|
|
24
24
|
"data-color": "neutral",
|
|
25
25
|
className: u.searchButton,
|
|
26
26
|
children: [
|
|
27
|
-
o ? /* @__PURE__ */
|
|
28
|
-
e ?
|
|
27
|
+
o ? /* @__PURE__ */ s(p, { "aria-hidden": "true" }) : /* @__PURE__ */ s(h, { "aria-hidden": "true" }),
|
|
28
|
+
e ? r : null
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
);
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { ButtonBase as
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as n } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { Badge as g } from "../Badge/Badge.js";
|
|
4
|
+
import { ButtonBase as l } from "../Button/ButtonBase.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import "../RootProvider/RootProvider.js";
|
|
6
|
+
import { useRootContext as c } from "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { DigdirLogomark as
|
|
9
|
-
import '../../assets/HeaderLogo2.css';const
|
|
10
|
-
logo:
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import { DigdirLogomark as p } from "./DigdirLogomark.js";
|
|
9
|
+
import '../../assets/HeaderLogo2.css';const f = "_logo_1d6ig_1", d = {
|
|
10
|
+
logo: f
|
|
11
|
+
}, x = {
|
|
12
|
+
nn: "Gå til framsida",
|
|
13
|
+
en: "Go to homepage"
|
|
14
|
+
}, C = ({ className: r, as: m = "a", href: s = "/", badge: o }) => {
|
|
15
|
+
const { languageCode: e } = c(), i = x[e ?? ""] ?? "Gå til forsiden";
|
|
16
|
+
return /* @__PURE__ */ a(l, { as: m, className: n(d.logo, r), href: s, ariaLabel: i, children: [
|
|
17
|
+
/* @__PURE__ */ t(p, {}),
|
|
18
|
+
o && /* @__PURE__ */ t(g, { ...o })
|
|
19
|
+
] });
|
|
20
|
+
};
|
|
15
21
|
export {
|
|
16
|
-
|
|
22
|
+
C as HeaderLogo
|
|
17
23
|
};
|
|
@@ -1,80 +1,99 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import
|
|
5
|
-
import { useIsDesktop as
|
|
6
|
-
import { Badge as
|
|
7
|
-
import { ButtonBase as
|
|
8
|
-
import { ButtonLabel as
|
|
9
|
-
import { ButtonIcon as
|
|
10
|
-
import "../RootProvider/RootProvider.js";
|
|
2
|
+
import { jsxs as u, jsx as r, Fragment as w } from "react/jsx-runtime";
|
|
3
|
+
import { c as p } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import m, { forwardRef as x } from "react";
|
|
5
|
+
import { useIsDesktop as M } from "../../hooks/useIsDesktop.js";
|
|
6
|
+
import { Badge as h } from "../Badge/Badge.js";
|
|
7
|
+
import { ButtonBase as g } from "../Button/ButtonBase.js";
|
|
8
|
+
import { ButtonLabel as _ } from "../Button/ButtonLabel.js";
|
|
9
|
+
import { ButtonIcon as d } from "../Button/ButtonIcon.js";
|
|
10
|
+
import { useRootContext as O } from "../RootProvider/RootProvider.js";
|
|
11
11
|
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { S as
|
|
13
|
-
import { u as
|
|
14
|
-
import '../../assets/GlobalMenuButton2.css';var
|
|
12
|
+
import { S as y } from "../../XMark-tKk6aExO.js";
|
|
13
|
+
import { u as I } from "../../useId-BVFxCjkq.js";
|
|
14
|
+
import '../../assets/GlobalMenuButton2.css';var j = function(t, l) {
|
|
15
15
|
var o = {};
|
|
16
16
|
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && l.indexOf(e) < 0 && (o[e] = t[e]);
|
|
17
17
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
-
for (var
|
|
19
|
-
l.indexOf(e[
|
|
18
|
+
for (var n = 0, e = Object.getOwnPropertySymbols(t); n < e.length; n++)
|
|
19
|
+
l.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[n]) && (o[e[n]] = t[e[n]]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
const
|
|
23
|
-
var { title: o, titleId: e } = t,
|
|
24
|
-
let
|
|
25
|
-
return
|
|
22
|
+
const k = x((t, l) => {
|
|
23
|
+
var { title: o, titleId: e } = t, n = j(t, ["title", "titleId"]);
|
|
24
|
+
let i = I();
|
|
25
|
+
return i = o ? e || "title-" + i : void 0, m.createElement(
|
|
26
26
|
"svg",
|
|
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":
|
|
28
|
-
o ?
|
|
29
|
-
|
|
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": i }, n),
|
|
28
|
+
o ? m.createElement("title", { id: i }, o) : null,
|
|
29
|
+
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.75 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17A.75.75 0 0 1 2.75 6m0 6a.75.75 0 0 1 .75-.75h17a.75.75 0 0 1 0 1.5h-17a.75.75 0 0 1-.75-.75m.75 5.25a.75.75 0 0 0 0 1.5h17a.75.75 0 0 0 0-1.5z", clipRule: "evenodd" })
|
|
30
30
|
);
|
|
31
|
-
}),
|
|
32
|
-
button:
|
|
33
|
-
icon:
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
}), B = "_button_rhdbs_1", N = "_icon_rhdbs_25", R = "_iconMobile_rhdbs_31", S = "_badge_rhdbs_37", a = {
|
|
32
|
+
button: B,
|
|
33
|
+
icon: N,
|
|
34
|
+
iconMobile: R,
|
|
35
|
+
badge: S
|
|
36
|
+
}, C = (t) => {
|
|
37
|
+
switch (t) {
|
|
38
|
+
case "nn":
|
|
39
|
+
return {
|
|
40
|
+
close: "Lukk meny"
|
|
41
|
+
};
|
|
42
|
+
case "en":
|
|
43
|
+
return {
|
|
44
|
+
close: "Close menu"
|
|
45
|
+
};
|
|
46
|
+
default:
|
|
47
|
+
return {
|
|
48
|
+
close: "Lukk Meny"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}, J = ({
|
|
36
52
|
className: t,
|
|
37
53
|
as: l = "button",
|
|
38
54
|
color: o = "accent",
|
|
39
55
|
variant: e = "solid",
|
|
40
|
-
expanded:
|
|
41
|
-
label:
|
|
56
|
+
expanded: n,
|
|
57
|
+
label: i = "Menu",
|
|
42
58
|
badge: c,
|
|
43
|
-
...
|
|
59
|
+
...f
|
|
44
60
|
}) => {
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
|
|
61
|
+
const s = M(), { languageCode: v } = O(), { close: b } = C(v);
|
|
62
|
+
return n ? /* @__PURE__ */ u(
|
|
63
|
+
g,
|
|
48
64
|
{
|
|
49
|
-
...
|
|
65
|
+
...f,
|
|
50
66
|
as: l,
|
|
51
67
|
type: "button",
|
|
52
68
|
variant: e,
|
|
53
69
|
color: o,
|
|
54
|
-
className:
|
|
70
|
+
className: p(a.button, t),
|
|
55
71
|
children: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
s && /* @__PURE__ */ u(w, { children: [
|
|
73
|
+
/* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(y, { className: a.icon, "aria-label": b }) }),
|
|
74
|
+
/* @__PURE__ */ r(_, { children: i })
|
|
75
|
+
] }),
|
|
76
|
+
!s && /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(y, { className: a.iconMobile, "aria-label": b }) }),
|
|
77
|
+
c && /* @__PURE__ */ r(h, { ...c, className: a.badge })
|
|
59
78
|
]
|
|
60
79
|
}
|
|
61
|
-
) : /* @__PURE__ */
|
|
62
|
-
|
|
80
|
+
) : /* @__PURE__ */ u(
|
|
81
|
+
g,
|
|
63
82
|
{
|
|
64
|
-
...
|
|
83
|
+
...f,
|
|
65
84
|
as: l,
|
|
66
85
|
type: "button",
|
|
67
86
|
variant: e,
|
|
68
87
|
color: o,
|
|
69
|
-
className:
|
|
88
|
+
className: p(a.button, t),
|
|
70
89
|
children: [
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
c && /* @__PURE__ */
|
|
90
|
+
s && /* @__PURE__ */ r(d, { icon: /* @__PURE__ */ r(k, { className: a.icon, "aria-hidden": !0 }) }),
|
|
91
|
+
/* @__PURE__ */ r(_, { children: i }),
|
|
92
|
+
c && /* @__PURE__ */ r(h, { ...c, className: a.badge })
|
|
74
93
|
]
|
|
75
94
|
}
|
|
76
95
|
);
|
|
77
96
|
};
|
|
78
97
|
export {
|
|
79
|
-
|
|
98
|
+
J as GlobalMenuButton
|
|
80
99
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface SymbolProps {
|
|
2
2
|
className?: string;
|
|
3
3
|
title?: string;
|
|
4
|
+
'aria-hidden'?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const DigdirLogomark: ({ className, title }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DigdirLogomark: ({ className, title, "aria-hidden": ariaHidden }: SymbolProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HeaderLogoProps, MenuProps } from '../';
|
|
2
2
|
import { BadgeProps } from '../Badge';
|
|
3
|
-
import { GlobalMenuProps_old, Account } from '../GlobalMenu_old
|
|
3
|
+
import { GlobalMenuProps_old, Account } from '../GlobalMenu_old';
|
|
4
4
|
import { SearchbarProps } from '../Searchbar';
|
|
5
5
|
import { LocaleSwitcherProps } from './';
|
|
6
6
|
export interface HeaderProps {
|