@altinn/altinn-components 0.37.0 → 0.38.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/dist/assets/DrawerOrDropdown.css +1 -1
- package/dist/assets/Header.css +1 -1
- package/dist/assets/MenuItemBase.css +1 -1
- package/dist/components/Button/IconButton.js +9 -7
- package/dist/components/ContextMenu/ContextMenu.js +58 -43
- package/dist/components/Dropdown/DrawerOrDropdown.js +4 -4
- package/dist/components/Header/Header.js +42 -57
- package/dist/components/Header/LocaleButton.js +3 -2
- package/dist/components/Header/LocaleSwitcher.js +38 -23
- package/dist/components/Layout/Layout.js +27 -16
- package/dist/components/Layout/LayoutContent.js +4 -4
- package/dist/components/Menu/MenuBase.js +9 -9
- package/dist/components/Menu/MenuItemBase.js +31 -27
- package/dist/components/Menu/MenuItems.js +43 -37
- package/dist/components/Searchbar/Autocomplete.js +23 -30
- package/dist/components/Searchbar/Searchbar.js +4 -4
- package/dist/components/SkipLink/SkipLink.js +18 -0
- package/dist/components/SkipLink/index.js +4 -0
- package/dist/hooks/useEnterKey.js +8 -8
- package/dist/hooks/useMenu.js +43 -28
- package/dist/types/lib/components/Button/IconButton.d.ts +2 -1
- package/dist/types/lib/components/Dropdown/DrawerOrDropdown.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +1 -0
- package/dist/types/lib/components/Header/LocaleButton.d.ts +2 -1
- package/dist/types/lib/components/Header/LocaleSwitcher.d.ts +2 -5
- package/dist/types/lib/components/Layout/Layout.d.ts +3 -1
- package/dist/types/lib/components/Layout/Layout.stories.d.ts +7 -1
- package/dist/types/lib/components/Layout/LayoutContent.d.ts +9 -2
- package/dist/types/lib/components/Menu/MenuBase.d.ts +4 -2
- package/dist/types/lib/components/Menu/MenuItem.d.ts +2 -1
- package/dist/types/lib/components/Menu/MenuItemBase.d.ts +3 -2
- package/dist/types/lib/components/Menu/MenuItems.d.ts +3 -1
- package/dist/types/lib/components/SkipLink/SkipLink.d.ts +9 -0
- package/dist/types/lib/components/SkipLink/SkipLink.stories.d.ts +15 -0
- package/dist/types/lib/components/SkipLink/index.d.ts +1 -0
- package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +1 -1
- package/dist/types/lib/hooks/useEnterKey.d.ts +1 -1
- package/dist/types/lib/hooks/useMenu.d.ts +6 -2
- package/dist/types/lib/stories/Beta.stories.d.ts +11 -0
- package/package.json +1 -1
- package/dist/types/lib/components/Header/LocaleSwitcher.stories.d.ts +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawerOrDropdown_2swxb_1{background-color:var(--ds-color-background-default);display:none}._drawerOrDropdown_2swxb_1[data-expanded=true]{position:fixed;top:5.5rem;right:0;bottom:0;left:0;display:block;z-index:2}@media (min-width: 1024px){._header_2swxb_17,._footer_2swxb_18{display:none}._drawerOrDropdown_2swxb_1[data-expanded=true]{position:absolute;top:auto;right:auto;bottom:auto;left:0;min-width:16rem;max-width:24rem;margin-top:.5rem;border-radius:.375rem;overflow:hidden}}
|
package/dist/assets/Header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawer_1tael_1[data-expanded=true]{display:block;width:100%}._dropdown_1tael_6[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1tael_6[data-expanded=true]{width:320px;display:block}._drawer_1tael_1[data-expanded=true]{display:none}}._relative_1tael_20{position:relative}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._item_1qmxq_1{font:inherit;color:inherit;padding:0;border:0;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center;column-gap:.25rem;margin:.5rem 0;border-radius:2px}._item_1qmxq_1[aria-disabled=true]{opacity:.5;pointer-events:none}._item_1qmxq_1[data-size=md]{min-height:56px}._item_1qmxq_1[data-size=md]{min-height:44px}._item_1qmxq_1[data-size=sm]{min-height:40px}._content_1qmxq_45{display:flex;width:100%;align-items:center;column-gap:6px;padding:6px}._item_1qmxq_1,._item_1qmxq_1[data-theme]{background-color:transparent}._item_1qmxq_1{pointer-events:none}._item_1qmxq_1[data-interactive=true]{pointer-events:all}[data-theme=subtle] ._item_1qmxq_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=subtle] ._item_1qmxq_1:active{background-color:var(--ds-color-surface-active)}[data-theme=subtle] ._item_1qmxq_1[data-selected=true]{background-color:var(--ds-color-background-default)}[data-theme=default] ._item_1qmxq_1:hover,[data-theme=default] [data-active=true]{background-color:var(--ds-color-surface-hover)}[data-theme=default] ._item_1qmxq_1:active{background-color:var(--ds-color-surface-active)}[data-theme=default] ._item_1qmxq_1[data-selected=true]{background-color:var(--ds-color-background-tinted)}._content_1qmxq_45{display:flex;width:100%;align-items:center;column-gap:.5em}._item_1qmxq_1:focus-visible{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._item_1qmxq_1:focus-visible *{--_ds--focus: }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { ButtonBase as
|
|
5
|
-
import { ButtonIcon as
|
|
4
|
+
import { ButtonBase as u } from "./ButtonBase.js";
|
|
5
|
+
import { ButtonIcon as B } from "./ButtonIcon.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
const
|
|
8
|
+
const g = ({
|
|
9
9
|
variant: r = "solid",
|
|
10
10
|
rounded: i = !1,
|
|
11
11
|
size: m,
|
|
@@ -16,9 +16,10 @@ const z = ({
|
|
|
16
16
|
className: n,
|
|
17
17
|
selected: s,
|
|
18
18
|
onClick: l,
|
|
19
|
-
dataTestId: d
|
|
19
|
+
dataTestId: d,
|
|
20
|
+
onBlurCapture: f
|
|
20
21
|
}) => /* @__PURE__ */ o(
|
|
21
|
-
|
|
22
|
+
u,
|
|
22
23
|
{
|
|
23
24
|
variant: r,
|
|
24
25
|
rounded: i,
|
|
@@ -29,9 +30,10 @@ const z = ({
|
|
|
29
30
|
selected: s,
|
|
30
31
|
"data-testid": d,
|
|
31
32
|
"aria-label": p,
|
|
32
|
-
|
|
33
|
+
onBlurCapture: f,
|
|
34
|
+
children: t && /* @__PURE__ */ o(B, { icon: t, size: e })
|
|
33
35
|
}
|
|
34
36
|
);
|
|
35
37
|
export {
|
|
36
|
-
|
|
38
|
+
g as IconButton
|
|
37
39
|
};
|
|
@@ -1,68 +1,83 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import * as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { IconButton as
|
|
7
|
-
import { useClickOutside as
|
|
2
|
+
import { jsxs as y, jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { c as I } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import * as m from "react";
|
|
5
|
+
import { forwardRef as w, useRef as O, useMemo as k } from "react";
|
|
6
|
+
import { IconButton as E } from "../Button/IconButton.js";
|
|
7
|
+
import { useClickOutside as C } from "../../hooks/useClickOutside.js";
|
|
8
|
+
import { useEnterKey as M } from "../../hooks/useEnterKey.js";
|
|
8
9
|
import { DropdownBase as j } from "../Dropdown/DropdownBase.js";
|
|
9
|
-
import { MenuItems as
|
|
10
|
-
import { useRootContext as
|
|
10
|
+
import { MenuItems as _ } from "../Menu/MenuItems.js";
|
|
11
|
+
import { useRootContext as R } from "../RootProvider/RootProvider.js";
|
|
11
12
|
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { u as
|
|
13
|
-
import '../../assets/ContextMenu.css';var
|
|
14
|
-
var
|
|
15
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) &&
|
|
13
|
+
import { u as P } from "../../useId-BVFxCjkq.js";
|
|
14
|
+
import '../../assets/ContextMenu.css';var T = function(e, s) {
|
|
15
|
+
var n = {};
|
|
16
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && s.indexOf(t) < 0 && (n[t] = e[t]);
|
|
16
17
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
17
18
|
for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
|
|
18
|
-
|
|
19
|
-
return
|
|
19
|
+
s.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (n[t[o]] = e[t[o]]);
|
|
20
|
+
return n;
|
|
20
21
|
};
|
|
21
|
-
const
|
|
22
|
-
var { title:
|
|
23
|
-
let
|
|
24
|
-
return
|
|
22
|
+
const A = w((e, s) => {
|
|
23
|
+
var { title: n, titleId: t } = e, o = T(e, ["title", "titleId"]);
|
|
24
|
+
let i = P();
|
|
25
|
+
return i = n ? t || "title-" + i : void 0, m.createElement(
|
|
25
26
|
"svg",
|
|
26
|
-
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:
|
|
27
|
-
|
|
28
|
-
|
|
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: s, "aria-labelledby": i }, o),
|
|
28
|
+
n ? m.createElement("title", { id: i }, n) : null,
|
|
29
|
+
m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M6 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m4.5 1.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0m6 0a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0", clipRule: "evenodd" })
|
|
29
30
|
);
|
|
30
|
-
}),
|
|
31
|
-
toggle:
|
|
32
|
-
},
|
|
31
|
+
}), B = "_toggle_nol5i_1", S = {
|
|
32
|
+
toggle: B
|
|
33
|
+
}, Q = ({
|
|
33
34
|
id: e = "context-menu",
|
|
34
|
-
ariaLabel:
|
|
35
|
-
placement:
|
|
35
|
+
ariaLabel: s,
|
|
36
|
+
placement: n = "right",
|
|
36
37
|
groups: t = {},
|
|
37
38
|
className: o,
|
|
38
|
-
items:
|
|
39
|
+
items: i
|
|
39
40
|
}) => {
|
|
40
|
-
const { currentId:
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const { currentId: v, toggleId: p, closeAll: a } = R(), d = O(null), g = "context-menu-" + e, x = () => p(e), u = v === e;
|
|
42
|
+
C(d, () => {
|
|
43
|
+
u && p(e);
|
|
43
44
|
});
|
|
44
|
-
const
|
|
45
|
-
...
|
|
45
|
+
const b = k(() => i.map((r) => ({
|
|
46
|
+
...r,
|
|
47
|
+
tabIndex: -1,
|
|
46
48
|
onClick: () => {
|
|
47
|
-
var
|
|
48
|
-
(
|
|
49
|
+
var c;
|
|
50
|
+
(c = r.onClick) == null || c.call(r), a();
|
|
49
51
|
}
|
|
50
|
-
})), [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
})), [i, a]);
|
|
53
|
+
M((r) => {
|
|
54
|
+
var c;
|
|
55
|
+
if (u) {
|
|
56
|
+
r.preventDefault();
|
|
57
|
+
const l = (c = d.current) == null ? void 0 : c.querySelector('[data-active="true"]');
|
|
58
|
+
l && (l.tagName === "A" && l.hasAttribute("href") ? l.click() : l.dispatchEvent(new MouseEvent("click", { bubbles: !0 }))), a();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const h = (r) => {
|
|
62
|
+
var l;
|
|
63
|
+
((l = r == null ? void 0 : r.relatedTarget) == null ? void 0 : l.closest(`[data-testid="${g}"]`)) || a();
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ y("div", { className: I(S.toggle, o), "data-color": "neutral", ref: d, "data-testid": g, children: [
|
|
66
|
+
/* @__PURE__ */ f(
|
|
67
|
+
E,
|
|
54
68
|
{
|
|
55
69
|
size: "xs",
|
|
56
70
|
rounded: !0,
|
|
57
|
-
icon:
|
|
71
|
+
icon: A,
|
|
58
72
|
variant: "text",
|
|
59
|
-
onClick:
|
|
60
|
-
iconAltText:
|
|
73
|
+
onClick: x,
|
|
74
|
+
iconAltText: s || `Open ${e}`,
|
|
75
|
+
onBlurCapture: h
|
|
61
76
|
}
|
|
62
77
|
),
|
|
63
|
-
|
|
78
|
+
u && /* @__PURE__ */ f(j, { placement: n, open: u, children: /* @__PURE__ */ f(_, { groups: t, items: b, keyboardEvents: !0 }) })
|
|
64
79
|
] });
|
|
65
80
|
};
|
|
66
81
|
export {
|
|
67
|
-
|
|
82
|
+
Q as ContextMenu
|
|
68
83
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, Fragment as c, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
@@ -8,7 +8,7 @@ import { DrawerFooter as f } from "./DrawerFooter.js";
|
|
|
8
8
|
import { DrawerButton as D } from "./DrawerButton.js";
|
|
9
9
|
import { DrawerBody as n } from "./DrawerBody.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import '../../assets/DrawerOrDropdown.css';const t = "
|
|
11
|
+
import '../../assets/DrawerOrDropdown.css';const t = "_drawerOrDropdown_2swxb_1", _ = "_header_2swxb_17", h = "_footer_2swxb_18", e = {
|
|
12
12
|
drawerOrDropdown: t,
|
|
13
13
|
header: _,
|
|
14
14
|
footer: h
|
|
@@ -18,9 +18,9 @@ import '../../assets/DrawerOrDropdown.css';const t = "_drawerOrDropdown_ijmwc_1"
|
|
|
18
18
|
drawerButton: r,
|
|
19
19
|
children: a,
|
|
20
20
|
drawerTitle: p
|
|
21
|
-
}) => /* @__PURE__ */ c
|
|
21
|
+
}) => /* @__PURE__ */ s(c, { children: [
|
|
22
22
|
m && /* @__PURE__ */ o(d, { onClick: i }),
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ s("div", { className: e.drawerOrDropdown, "data-expanded": m, children: [
|
|
24
24
|
/* @__PURE__ */ o(l, { className: e.header, title: p, onClose: i }),
|
|
25
25
|
/* @__PURE__ */ o(n, { children: a }),
|
|
26
26
|
/* @__PURE__ */ o(f, { className: e.footer, children: r && /* @__PURE__ */ o(D, { onClick: r == null ? void 0 : r.onClick, children: r == null ? void 0 : r.label }) })
|
|
@@ -1,88 +1,73 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { DropdownBase as
|
|
2
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownBase as C } from "../Dropdown/DropdownBase.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
|
-
import { DrawerBase as
|
|
5
|
+
import { DrawerBase as b } from "../Dropdown/DrawerBase.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { useRootContext as
|
|
8
|
-
import { GlobalMenu as
|
|
9
|
-
import { GlobalMenuButton as
|
|
10
|
-
import { HeaderBase as
|
|
11
|
-
import { HeaderLogo as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { Searchbar as u } from "../Searchbar/Searchbar.js";
|
|
7
|
+
import { useRootContext as v } from "../RootProvider/RootProvider.js";
|
|
8
|
+
import { GlobalMenu as h } from "../GlobalMenu/GlobalMenu.js";
|
|
9
|
+
import { GlobalMenuButton as H } from "../GlobalMenu/GlobalMenuButton.js";
|
|
10
|
+
import { HeaderBase as S } from "./HeaderBase.js";
|
|
11
|
+
import { HeaderLogo as k } from "./HeaderLogo.js";
|
|
12
|
+
import { LocaleSwitcher as B } from "./LocaleSwitcher.js";
|
|
13
|
+
import { Searchbar as f } from "../Searchbar/Searchbar.js";
|
|
15
14
|
import "../Snackbar/useSnackbar.js";
|
|
16
|
-
import { HeaderGroup as
|
|
17
|
-
import { HeaderSearch as
|
|
18
|
-
import { useIsDesktop as
|
|
19
|
-
import '../../assets/Header.css';const
|
|
20
|
-
drawer:
|
|
21
|
-
dropdown:
|
|
22
|
-
relative:
|
|
23
|
-
},
|
|
24
|
-
const { currentId: o, toggleId:
|
|
15
|
+
import { HeaderGroup as D } from "./HeaderGroup.js";
|
|
16
|
+
import { HeaderSearch as w } from "./HeaderSearch.js";
|
|
17
|
+
import { useIsDesktop as I } from "../../hooks/useIsDesktop.js";
|
|
18
|
+
import '../../assets/Header.css';const N = "_drawer_1tael_1", F = "_dropdown_1tael_6", G = "_relative_1tael_20", s = {
|
|
19
|
+
drawer: N,
|
|
20
|
+
dropdown: F,
|
|
21
|
+
relative: G
|
|
22
|
+
}, W = ({ menu: r, locale: d, search: a, currentAccount: t, logo: u = {}, badge: x }) => {
|
|
23
|
+
const { currentId: o, toggleId: p, openId: _, closeAll: n } = v(), i = () => {
|
|
25
24
|
_("search");
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return /* @__PURE__ */ c(
|
|
34
|
-
B,
|
|
25
|
+
}, c = () => {
|
|
26
|
+
p("search");
|
|
27
|
+
}, g = () => {
|
|
28
|
+
p("menu");
|
|
29
|
+
}, m = I();
|
|
30
|
+
return /* @__PURE__ */ l(
|
|
31
|
+
S,
|
|
35
32
|
{
|
|
36
33
|
currentId: o,
|
|
37
34
|
open: o === "search" || o === "menu" || o === "locale",
|
|
38
|
-
onClose:
|
|
35
|
+
onClose: n,
|
|
39
36
|
children: [
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ e(k, { ...u, className: s.logo }),
|
|
38
|
+
a && m && /* @__PURE__ */ e(w, { expanded: o === "search", children: /* @__PURE__ */ e(f, { ...a, expanded: o === "search", onClose: c, onFocus: i }) }),
|
|
39
|
+
/* @__PURE__ */ l(D, { children: [
|
|
40
|
+
d && /* @__PURE__ */ e(B, { ...d }),
|
|
41
|
+
/* @__PURE__ */ l("div", { className: s.relative, children: [
|
|
45
42
|
/* @__PURE__ */ e(
|
|
46
|
-
|
|
43
|
+
H,
|
|
47
44
|
{
|
|
48
|
-
badge:
|
|
49
|
-
currentAccount:
|
|
50
|
-
onClick:
|
|
45
|
+
badge: x,
|
|
46
|
+
currentAccount: t,
|
|
47
|
+
onClick: g,
|
|
51
48
|
expanded: o === "menu",
|
|
52
49
|
label: r == null ? void 0 : r.menuLabel
|
|
53
50
|
}
|
|
54
51
|
),
|
|
55
|
-
n && /* @__PURE__ */ e(
|
|
56
|
-
h,
|
|
57
|
-
{
|
|
58
|
-
layout: "desktop",
|
|
59
|
-
padding: !0,
|
|
60
|
-
placement: "right",
|
|
61
|
-
open: o === "locale",
|
|
62
|
-
className: a.dropdown,
|
|
63
|
-
children: /* @__PURE__ */ e(g, { ...n })
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
52
|
r && /* @__PURE__ */ e(
|
|
67
|
-
|
|
53
|
+
C,
|
|
68
54
|
{
|
|
69
55
|
layout: "desktop",
|
|
70
56
|
padding: !0,
|
|
71
57
|
placement: "right",
|
|
72
58
|
open: o === "menu",
|
|
73
|
-
className:
|
|
74
|
-
children: /* @__PURE__ */ e(
|
|
59
|
+
className: s.dropdown,
|
|
60
|
+
children: /* @__PURE__ */ e(h, { ...r, currentAccount: t, onClose: n })
|
|
75
61
|
}
|
|
76
62
|
)
|
|
77
63
|
] })
|
|
78
64
|
] }),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
r && /* @__PURE__ */ e(f, { open: o === "menu", className: a.drawer, children: /* @__PURE__ */ e(w, { ...r, currentAccount: l, onClose: d }) })
|
|
65
|
+
a && !m && /* @__PURE__ */ e(w, { expanded: o === "search", children: /* @__PURE__ */ e(f, { ...a, expanded: o === "search", onClose: c, onFocus: i }) }),
|
|
66
|
+
r && /* @__PURE__ */ e(b, { open: o === "menu", className: s.drawer, children: /* @__PURE__ */ e(h, { ...r, currentAccount: t, onClose: n }) })
|
|
82
67
|
]
|
|
83
68
|
}
|
|
84
69
|
);
|
|
85
70
|
};
|
|
86
71
|
export {
|
|
87
|
-
|
|
72
|
+
W as Header
|
|
88
73
|
};
|
|
@@ -26,7 +26,7 @@ const d = c((e, n) => {
|
|
|
26
26
|
);
|
|
27
27
|
}), s = "_button_utwi0_1", p = {
|
|
28
28
|
button: s
|
|
29
|
-
}, x = ({ id: e = "language-switcher", expanded: n, onClick: o }) => /* @__PURE__ */ i(
|
|
29
|
+
}, x = ({ id: e = "language-switcher", expanded: n, onClick: o, onBlurCapture: t }) => /* @__PURE__ */ i(
|
|
30
30
|
m,
|
|
31
31
|
{
|
|
32
32
|
className: p.button,
|
|
@@ -37,7 +37,8 @@ const d = c((e, n) => {
|
|
|
37
37
|
selected: n,
|
|
38
38
|
color: "company",
|
|
39
39
|
onClick: o,
|
|
40
|
-
iconAltText: `Open ${e}
|
|
40
|
+
iconAltText: `Open ${e}`,
|
|
41
|
+
onBlurCapture: t
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
44
|
export {
|
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as r, jsxs as k } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as h, useMemo as v } from "react";
|
|
4
|
+
import { useEnterKey as b } from "../../hooks/useEnterKey.js";
|
|
5
|
+
import { useIsDesktop as x } from "../../hooks/useIsDesktop.js";
|
|
6
|
+
import { DropdownBase as I } from "../Dropdown/DropdownBase.js";
|
|
3
7
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import "
|
|
5
|
-
import { useRootContext as
|
|
8
|
+
import { DrawerBase as w } from "../Dropdown/DrawerBase.js";
|
|
9
|
+
import { useRootContext as C } from "../RootProvider/RootProvider.js";
|
|
10
|
+
import { MenuItems as m } from "../Menu/MenuItems.js";
|
|
11
|
+
import { LocaleButton as y } from "./LocaleButton.js";
|
|
6
12
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
import { S as B } from "../../Checkmark-D17Nyv_u.js";
|
|
14
|
+
const z = ({ title: d = "Select language", options: i, onSelect: o }) => {
|
|
15
|
+
const c = h(null), u = x(), { currentId: g, toggleId: f, closeAll: s } = C(), n = g === "locale", l = v(() => i.map((e) => ({
|
|
16
|
+
...e,
|
|
17
|
+
id: String(e.value),
|
|
18
|
+
tabIndex: -1,
|
|
19
|
+
groupId: "locales",
|
|
20
|
+
icon: e.checked ? B : /* @__PURE__ */ r("span", { "aria-hidden": "true" }),
|
|
21
|
+
onClick: () => {
|
|
22
|
+
o == null || o(String(e.value)), s();
|
|
23
|
+
}
|
|
24
|
+
})), [i, o]), p = {
|
|
25
|
+
locales: { title: d || "Språk/language" }
|
|
13
26
|
};
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
return b((e) => {
|
|
28
|
+
var a;
|
|
29
|
+
if (n) {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
const t = (a = c.current) == null ? void 0 : a.querySelector('[data-active="true"]');
|
|
32
|
+
t && (t.tagName === "A" && t.hasAttribute("href") ? t.click() : t.dispatchEvent(new MouseEvent("click", { bubbles: !0 }))), s();
|
|
33
|
+
}
|
|
34
|
+
}), /* @__PURE__ */ k("div", { ref: c, "data-testid": "locale-switcher", children: [
|
|
35
|
+
/* @__PURE__ */ r(y, { onClick: () => f("locale"), expanded: n, onBlurCapture: (e) => {
|
|
36
|
+
var t;
|
|
37
|
+
((t = e == null ? void 0 : e.relatedTarget) == null ? void 0 : t.closest('[data-testid="locale-switcher"]')) || s();
|
|
38
|
+
} }),
|
|
39
|
+
n && u && /* @__PURE__ */ r(I, { layout: "desktop", padding: !0, placement: "right", open: !0, children: /* @__PURE__ */ r(m, { groups: p, items: l, keyboardEvents: !0 }) }),
|
|
40
|
+
n && !u && /* @__PURE__ */ r(w, { open: !0, placement: "bottom", children: /* @__PURE__ */ r(m, { groups: p, items: l, keyboardEvents: !0 }) })
|
|
41
|
+
] });
|
|
27
42
|
};
|
|
28
43
|
export {
|
|
29
|
-
|
|
44
|
+
z as LocaleSwitcher
|
|
30
45
|
};
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as p, jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { LayoutBase as
|
|
4
|
-
import { LayoutBody as
|
|
5
|
-
import { LayoutContent as
|
|
6
|
-
import { LayoutSidebar as
|
|
7
|
-
import { Footer as
|
|
8
|
-
import { Header as
|
|
3
|
+
import { LayoutBase as h } from "./LayoutBase.js";
|
|
4
|
+
import { LayoutBody as L } from "./LayoutBody.js";
|
|
5
|
+
import { LayoutContent as x } from "./LayoutContent.js";
|
|
6
|
+
import { LayoutSidebar as j } from "./LayoutSidebar.js";
|
|
7
|
+
import { Footer as B } from "../Footer/Footer.js";
|
|
8
|
+
import { Header as C } from "../Header/Header.js";
|
|
9
9
|
import "../../index-L8X2o7IH.js";
|
|
10
10
|
import "react";
|
|
11
|
-
import { useRootContext as
|
|
11
|
+
import { useRootContext as S } from "../RootProvider/RootProvider.js";
|
|
12
12
|
import { Menu as F } from "../Menu/Menu.js";
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
import { SkipLink as H } from "../SkipLink/SkipLink.js";
|
|
15
|
+
const J = ({
|
|
16
|
+
color: c,
|
|
17
|
+
theme: f = "subtle",
|
|
18
|
+
header: u,
|
|
19
|
+
footer: n,
|
|
20
|
+
sidebar: o,
|
|
21
|
+
content: t = {},
|
|
22
|
+
children: y,
|
|
23
|
+
skipLink: r
|
|
24
|
+
}) => {
|
|
25
|
+
const { currentId: l } = S();
|
|
26
|
+
return /* @__PURE__ */ p(h, { color: c, theme: f, currentId: l, children: [
|
|
27
|
+
r && /* @__PURE__ */ m(H, { ...r }),
|
|
28
|
+
u && /* @__PURE__ */ m(C, { ...u }),
|
|
29
|
+
/* @__PURE__ */ p(L, { currentId: l, children: [
|
|
30
|
+
o && /* @__PURE__ */ p(j, { hidden: o == null ? void 0 : o.hidden, color: o == null ? void 0 : o.color, ...o, children: [
|
|
20
31
|
(o == null ? void 0 : o.menu) && /* @__PURE__ */ m(F, { ...o == null ? void 0 : o.menu }),
|
|
21
32
|
o == null ? void 0 : o.children
|
|
22
33
|
] }),
|
|
23
|
-
/* @__PURE__ */ m(
|
|
34
|
+
/* @__PURE__ */ m(x, { color: t == null ? void 0 : t.color, id: "main-content", children: y })
|
|
24
35
|
] }),
|
|
25
|
-
|
|
36
|
+
n && /* @__PURE__ */ m(B, { ...n })
|
|
26
37
|
] });
|
|
27
38
|
};
|
|
28
39
|
export {
|
|
29
|
-
|
|
40
|
+
J as Layout
|
|
30
41
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../assets/LayoutContent.css';const
|
|
3
|
-
content:
|
|
4
|
-
}, r = ({ color: t, children: n }) => /* @__PURE__ */
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/LayoutContent.css';const e = "_content_1wkbr_1", s = {
|
|
3
|
+
content: e
|
|
4
|
+
}, r = ({ color: t, children: n, id: o = "main-content" }) => /* @__PURE__ */ c("main", { className: s.content, "data-color": t, id: o, children: n });
|
|
5
5
|
export {
|
|
6
6
|
r as LayoutContent
|
|
7
7
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c
|
|
3
|
-
import '../../assets/MenuBase.css';const
|
|
4
|
-
menu:
|
|
5
|
-
list:
|
|
6
|
-
item:
|
|
7
|
-
}, C = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/MenuBase.css';const r = "_menu_sxyub_1", l = "_list_sxyub_16", p = "_item_sxyub_22", i = {
|
|
4
|
+
menu: r,
|
|
5
|
+
list: l,
|
|
6
|
+
item: p
|
|
7
|
+
}, C = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ a(t, { className: c(i.menu, o), "data-color": n, "data-theme": e, children: s }), d = ({ as: t = "ul", role: n = "group", className: e, children: o, ref: s, onMouseEnter: m }) => /* @__PURE__ */ a(t, { className: c(i.list, e), role: n, ref: s, onMouseEnter: m, children: o }), y = ({
|
|
8
8
|
as: t = "li",
|
|
9
9
|
role: n = "presentation",
|
|
10
10
|
className: e,
|
|
11
11
|
children: o,
|
|
12
12
|
style: s,
|
|
13
|
-
dataIndex:
|
|
14
|
-
}) => /* @__PURE__ */
|
|
13
|
+
dataIndex: m
|
|
14
|
+
}) => /* @__PURE__ */ a(t, { className: c(i.item, e), role: n, style: s, "data-index": m, children: o });
|
|
15
15
|
export {
|
|
16
16
|
C as MenuBase,
|
|
17
17
|
d as MenuList,
|
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/MenuItemBase.css';const
|
|
4
|
-
item:
|
|
5
|
-
content:
|
|
6
|
-
},
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/MenuItemBase.css';const I = "_item_1qmxq_1", N = "_content_1qmxq_45", c = {
|
|
4
|
+
item: I,
|
|
5
|
+
content: N
|
|
6
|
+
}, B = ({
|
|
7
7
|
interactive: o = !0,
|
|
8
8
|
as: s,
|
|
9
|
-
color:
|
|
10
|
-
theme:
|
|
9
|
+
color: d,
|
|
10
|
+
theme: r,
|
|
11
11
|
size: i,
|
|
12
12
|
className: p,
|
|
13
|
-
href:
|
|
13
|
+
href: x,
|
|
14
14
|
onClick: t,
|
|
15
|
-
onKeyPress:
|
|
16
|
-
tabIndex:
|
|
17
|
-
hidden:
|
|
18
|
-
selected:
|
|
19
|
-
disabled:
|
|
20
|
-
children:
|
|
21
|
-
|
|
15
|
+
onKeyPress: a,
|
|
16
|
+
tabIndex: _ = 0,
|
|
17
|
+
hidden: q,
|
|
18
|
+
selected: f,
|
|
19
|
+
disabled: e = !1,
|
|
20
|
+
children: h,
|
|
21
|
+
active: u,
|
|
22
|
+
onMouseEnter: l
|
|
23
|
+
}) => /* @__PURE__ */ m(
|
|
22
24
|
s || "a",
|
|
23
25
|
{
|
|
24
|
-
tabIndex:
|
|
25
|
-
className:
|
|
26
|
+
tabIndex: e ? "-1" : _ ?? 0,
|
|
27
|
+
className: v(c.item, p),
|
|
26
28
|
"data-interactive": o,
|
|
29
|
+
"data-active": u,
|
|
27
30
|
"data-size": i,
|
|
28
|
-
"data-color":
|
|
29
|
-
"data-theme":
|
|
30
|
-
"aria-hidden":
|
|
31
|
-
"aria-disabled":
|
|
32
|
-
"data-selected":
|
|
33
|
-
href:
|
|
31
|
+
"data-color": d,
|
|
32
|
+
"data-theme": r,
|
|
33
|
+
"aria-hidden": q,
|
|
34
|
+
"aria-disabled": e,
|
|
35
|
+
"data-selected": f,
|
|
36
|
+
href: x,
|
|
34
37
|
onKeyPress: (n) => {
|
|
35
|
-
n.key === "Enter" && (t == null || t()),
|
|
38
|
+
n.key === "Enter" && (t == null || t()), a == null || a(n);
|
|
36
39
|
},
|
|
37
40
|
onClick: t,
|
|
38
|
-
|
|
41
|
+
onMouseEnter: l,
|
|
42
|
+
children: /* @__PURE__ */ m("span", { className: c.content, children: h })
|
|
39
43
|
}
|
|
40
44
|
);
|
|
41
45
|
export {
|
|
42
|
-
|
|
46
|
+
B as MenuItemBase
|
|
43
47
|
};
|