@smudi/designsystem 1.4.0 → 1.5.1
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/@smudi/assets/UDI-red-logo.svg.js +1 -0
- package/@smudi/components/alert/alert.js +5 -4
- package/@smudi/components/avatar/avatar.js +1 -0
- package/@smudi/components/avatar-stack/avatar-stack.js +1 -0
- package/@smudi/components/badge/badge.js +5 -4
- package/@smudi/components/breadcrumbs/breadcrumbs.js +4 -3
- package/@smudi/components/button/button.js +5 -4
- package/@smudi/components/card/card-icon-block.js +6 -5
- package/@smudi/components/card/card.js +1 -0
- package/@smudi/components/checkbox/checkbox.js +1 -0
- package/@smudi/components/chip/chip.js +1 -0
- package/@smudi/components/details/details.js +5 -4
- package/@smudi/components/dialog/dialog-section.js +10 -9
- package/@smudi/components/dialog/dialog.js +1 -0
- package/@smudi/components/divider/divider.js +1 -0
- package/@smudi/components/dropdown/dropdown-button.js +11 -10
- package/@smudi/components/dropdown/dropdown-context.js +4 -3
- package/@smudi/components/dropdown/dropdown-item.js +8 -7
- package/@smudi/components/dropdown/dropdown-list.js +10 -9
- package/@smudi/components/dropdown/dropdown.js +15 -14
- package/@smudi/components/error-summary/error-summary.js +1 -0
- package/@smudi/components/field/field.js +1 -0
- package/@smudi/components/fieldset/fieldset.js +1 -0
- package/@smudi/components/header/header-content.js +4 -3
- package/@smudi/components/header/header-divider.js +1 -0
- package/@smudi/components/header/header-menu/header-menu-button.js +8 -7
- package/@smudi/components/header/header-menu/header-menu-content.js +5 -4
- package/@smudi/components/header/header-menu/header-menu-group.js +11 -10
- package/@smudi/components/header/header-menu/header-menu-item.js +4 -3
- package/@smudi/components/header/header-menu/header-menu.js +6 -5
- package/@smudi/components/header/header-search/header-search-button.js +1 -0
- package/@smudi/components/header/header-search/header-search.js +6 -5
- package/@smudi/components/header/header.js +1 -0
- package/@smudi/components/header/index.js +7 -6
- package/@smudi/components/input/input.js +5 -4
- package/@smudi/components/layout-components/box-layouts/box-layout.js +11 -10
- package/@smudi/components/layout-components/box-layouts/box-layout.module.css.js +2 -1
- package/@smudi/components/layout-components/center-layouts/center-layout.js +9 -8
- package/@smudi/components/layout-components/center-layouts/center-layout.module.css.js +5 -4
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.js +5 -4
- package/@smudi/components/layout-components/cluster-layouts/cluster-layout.module.css.js +2 -1
- package/@smudi/components/layout-components/grid-layouts/grid-layout.js +5 -4
- package/@smudi/components/layout-components/grid-layouts/grid-layout.module.css.js +2 -1
- package/@smudi/components/layout-components/stack-layouts/stack-layout.js +5 -4
- package/@smudi/components/layout-components/stack-layouts/stack-layout.module.css.js +2 -1
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.js +9 -8
- package/@smudi/components/layout-components/wrapper-layouts/wrapper-layout.module.css.js +4 -3
- package/@smudi/components/link/link.js +1 -0
- package/@smudi/components/list/list.js +1 -0
- package/@smudi/components/pagination/pagination.js +5 -4
- package/@smudi/components/popover/popover.js +4 -3
- package/@smudi/components/radio/radio.js +1 -0
- package/@smudi/components/search/search.js +5 -4
- package/@smudi/components/select/select.js +7 -6
- package/@smudi/components/skeleton/skeleton.js +1 -0
- package/@smudi/components/skip-link/skip-link.js +1 -0
- package/@smudi/components/spinner/spinner.js +4 -3
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-context.js +4 -3
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion-list.js +11 -10
- package/@smudi/components/suggestion/smudi-suggestion/smudi-suggestion.js +1 -0
- package/@smudi/components/suggestion/suggestion-no-chips/suggestion-no-chips.js +1 -0
- package/@smudi/components/suggestion/suggestion.js +3 -2
- package/@smudi/components/table/table.js +5 -4
- package/@smudi/components/tabs/tabs-content.js +1 -0
- package/@smudi/components/tabs/tabs-list.js +1 -0
- package/@smudi/components/tabs/tabs-trigger.js +1 -0
- package/@smudi/components/tabs/tabs.js +5 -4
- package/@smudi/components/tag/tag.js +1 -0
- package/@smudi/components/textarea/text-area.js +4 -3
- package/@smudi/components/textfield/textfield.js +1 -0
- package/@smudi/components/toast/toast.js +1 -0
- package/@smudi/components/toggle-group/toggle-group.js +1 -0
- package/@smudi/components/tooltip/tooltip.js +4 -3
- package/@smudi/components/typography/heading/heading.js +5 -4
- package/@smudi/components/typography/paragraph/paragraph.js +1 -0
- package/@smudi/components/utils/apply-inert-outside.js +1 -0
- package/@smudi/components/utils/class-names.js +1 -0
- package/@smudi/icons/generated/SmudiBiometryIcon.js +1 -0
- package/@smudi/icons/generated/SmudiFingerprintIcon.js +4 -3
- package/@smudi/icons/generated/SmudiFlagIcon.js +10 -9
- package/@smudi/icons/generated/SmudiScanIcon.js +10 -9
- package/@smudi/react.js +128 -191
- package/@smudi/smudi/react.d.ts +38 -38
- package/@smudi/smudi/react.d.ts.map +1 -1
- package/@smudi/styles.css +1 -1
- package/@smudi/utils/append-class-name.js +4 -3
- package/@smudi/utils/combine-refs.js +4 -3
- package/README.md +6 -3
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
const e = "data:image/svg+xml,%3csvg%20width='80'%20height='43'%20viewBox='0%200%2080%2043'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M26.3952%2029.56C26.3952%2036.28%2020.9452%2041.73%2014.2252%2041.73C7.50518%2041.73%202.05518%2036.28%202.05518%2029.56V2.03998H9.21518V34.26H19.2352V2.03998H26.3952V29.56ZM60.7652%2014.22C60.7652%207.49998%2055.3152%202.04998%2048.5952%202.04998H36.4252V41.46H48.5952C55.3152%2041.46%2060.7652%2036.01%2060.7652%2029.29V14.22ZM53.6052%2034.26H43.5852V9.19998H53.6052V34.26Z'%20fill='%23C8373C'/%3e%3cpath%20d='M77.9552%202.03998H70.7852V41.45H77.9552V2.03998Z'%20fill='%23C8373C'/%3e%3c/svg%3e";
|
|
2
3
|
export {
|
|
3
4
|
e as default
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Alert as e } from "@digdir/designsystemet-react";
|
|
3
|
+
const t = e;
|
|
4
|
+
t.displayName = "Alert";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
t as Alert
|
|
6
7
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Badge as e } from "@digdir/designsystemet-react";
|
|
3
|
+
const a = e;
|
|
4
|
+
a.displayName = "Badge";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
a as Badge
|
|
6
7
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
3
|
import { Button as d } from "@digdir/designsystemet-react";
|
|
3
4
|
import { forwardRef as m } from "react";
|
|
4
5
|
const u = m(
|
|
5
|
-
function({ variant: o, className: n, ...e },
|
|
6
|
-
const t = o === "secondary-tinted",
|
|
6
|
+
function({ variant: o, className: n, ...e }, s) {
|
|
7
|
+
const t = o === "secondary-tinted", r = t ? "secondary" : o, i = [
|
|
7
8
|
n,
|
|
8
9
|
"smudi-button",
|
|
9
10
|
t ? "smudi-button--secondary-tinted" : void 0
|
|
@@ -12,8 +13,8 @@ const u = m(
|
|
|
12
13
|
d,
|
|
13
14
|
{
|
|
14
15
|
...e,
|
|
15
|
-
ref:
|
|
16
|
-
variant:
|
|
16
|
+
ref: s,
|
|
17
|
+
variant: r,
|
|
17
18
|
className: i || void 0
|
|
18
19
|
}
|
|
19
20
|
);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as n } from "react";
|
|
3
|
-
import { classNames as
|
|
4
|
-
const
|
|
4
|
+
import { classNames as e } from "../utils/class-names.js";
|
|
5
|
+
const s = n(
|
|
5
6
|
function({ children: o, className: r, orientation: a = "vertical", ...c }, t) {
|
|
6
7
|
return /* @__PURE__ */ i(
|
|
7
8
|
"div",
|
|
8
9
|
{
|
|
9
|
-
className:
|
|
10
|
+
className: e("ds-card__icon-block", r),
|
|
10
11
|
"data-orientation": a,
|
|
11
12
|
ref: t,
|
|
12
13
|
...c,
|
|
@@ -15,7 +16,7 @@ const m = n(
|
|
|
15
16
|
);
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
|
-
|
|
19
|
+
s.displayName = "Card.IconBlock";
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
+
s as CardIconBlock
|
|
21
22
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Details as e } from "@digdir/designsystemet-react";
|
|
3
|
+
const t = e;
|
|
4
|
+
t.displayName = "Details";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
t as Details
|
|
6
7
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as r } from "react";
|
|
3
4
|
import { classNames as s } from "../utils/class-names.js";
|
|
4
|
-
const
|
|
5
|
-
function({ children: o, className: i, ...
|
|
6
|
-
return /* @__PURE__ */
|
|
5
|
+
const c = r(
|
|
6
|
+
function({ children: o, className: i, ...e }, t) {
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
7
8
|
"div",
|
|
8
9
|
{
|
|
9
10
|
className: s("ds-dialog__section", i),
|
|
10
|
-
ref:
|
|
11
|
-
...
|
|
11
|
+
ref: t,
|
|
12
|
+
...e,
|
|
12
13
|
children: o
|
|
13
14
|
}
|
|
14
15
|
);
|
|
15
16
|
}
|
|
16
17
|
);
|
|
17
|
-
|
|
18
|
+
c.displayName = "Dialog.Section";
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
c as DialogSection
|
|
20
21
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { useDropdown as d } from "./dropdown-context.js";
|
|
4
5
|
import { DropdownButton as u } from "@digdir/designsystemet-react";
|
|
5
|
-
const
|
|
6
|
-
const { close: o } =
|
|
7
|
-
function i(
|
|
8
|
-
n?.({ event:
|
|
6
|
+
const c = s(({ preventAutoClose: r = !1, children: t, onClick: n, ...p }, e) => {
|
|
7
|
+
const { close: o } = d();
|
|
8
|
+
function i(f) {
|
|
9
|
+
n?.({ event: f, close: o }), r || o();
|
|
9
10
|
}
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ m(u, { ...p, ref: e, onClick: i, children: t });
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
+
c.displayName = "Dropdown.Button";
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
c as DropdownButton
|
|
15
16
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { createContext as t, useContext as n } from "react";
|
|
2
|
-
const
|
|
3
|
+
const e = t(null);
|
|
3
4
|
function u() {
|
|
4
|
-
const o = n(
|
|
5
|
+
const o = n(e);
|
|
5
6
|
if (!o)
|
|
6
7
|
throw new Error("useDropdown must be used within Dropdown");
|
|
7
8
|
return o;
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
e as DropdownContext,
|
|
11
12
|
u as useDropdown
|
|
12
13
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as i } from "react";
|
|
3
|
-
import { DropdownItem as
|
|
4
|
-
const
|
|
5
|
-
({ children: o, divider: r, className: s, ...d },
|
|
6
|
-
const
|
|
7
|
-
return /* @__PURE__ */ t(
|
|
4
|
+
import { DropdownItem as n } from "@digdir/designsystemet-react";
|
|
5
|
+
const p = i(
|
|
6
|
+
({ children: o, divider: r, className: s, ...d }, e) => {
|
|
7
|
+
const m = `${r ? "smudi-dropdown-divider" : ""} ${s ?? ""}`.trim();
|
|
8
|
+
return /* @__PURE__ */ t(n, { ...d, ref: e, className: m, children: o });
|
|
8
9
|
}
|
|
9
10
|
);
|
|
10
|
-
|
|
11
|
+
p.displayName = "Dropdown.Item";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
p as DropdownItem
|
|
13
14
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownList as m } from "@digdir/designsystemet-react";
|
|
4
|
+
import { forwardRef as n } from "react";
|
|
5
|
+
const p = n(
|
|
6
|
+
({ children: o, divider: s, className: r, ...i }, d) => {
|
|
7
|
+
const t = `${s ? "smudi-dropdown-divider" : ""} ${r ?? ""}`.trim();
|
|
8
|
+
return /* @__PURE__ */ e(m, { ...i, ref: d, className: t, children: o });
|
|
8
9
|
}
|
|
9
10
|
);
|
|
10
|
-
|
|
11
|
+
p.displayName = "Dropdown.List";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
p as DropdownList
|
|
13
14
|
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
3
|
import { Dropdown as p } from "@digdir/designsystemet-react";
|
|
3
|
-
import { forwardRef as
|
|
4
|
+
import { forwardRef as w, useRef as D, useState as O } from "react";
|
|
4
5
|
import { DropdownItem as v } from "./dropdown-item.js";
|
|
5
6
|
import { DropdownButton as I } from "./dropdown-button.js";
|
|
6
7
|
import { DropdownContext as R } from "./dropdown-context.js";
|
|
7
8
|
import { combineRefs as h } from "../../utils/combine-refs.js";
|
|
8
9
|
import { DropdownList as x } from "./dropdown-list.js";
|
|
9
|
-
const B =
|
|
10
|
-
({ children: s, onOpen: i, onClose: m, onOpenChange: f, ...
|
|
11
|
-
const o = D(null), [
|
|
12
|
-
function
|
|
10
|
+
const B = w(
|
|
11
|
+
({ children: s, onOpen: i, onClose: m, onOpenChange: f, ...u }, c) => {
|
|
12
|
+
const o = D(null), [d, a] = O(!1);
|
|
13
|
+
function e() {
|
|
13
14
|
o.current.hidePopover(), m?.(), t(!1);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function l() {
|
|
16
17
|
o.current.showPopover(), i?.(), t(!0);
|
|
17
18
|
}
|
|
18
|
-
function t(
|
|
19
|
-
a(
|
|
19
|
+
function t(r) {
|
|
20
|
+
a(r), f?.(r);
|
|
20
21
|
}
|
|
21
22
|
return /* @__PURE__ */ n(
|
|
22
23
|
p,
|
|
23
24
|
{
|
|
24
|
-
...
|
|
25
|
-
onClose:
|
|
26
|
-
onOpen:
|
|
27
|
-
open:
|
|
28
|
-
ref: h(o,
|
|
29
|
-
children: /* @__PURE__ */ n(R.Provider, { value: { close:
|
|
25
|
+
...u,
|
|
26
|
+
onClose: e,
|
|
27
|
+
onOpen: l,
|
|
28
|
+
open: d,
|
|
29
|
+
ref: h(o, c),
|
|
30
|
+
children: /* @__PURE__ */ n(R.Provider, { value: { close: e }, children: s })
|
|
30
31
|
}
|
|
31
32
|
);
|
|
32
33
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as n } from "react";
|
|
3
4
|
import { classNames as a } from "../utils/class-names.js";
|
|
4
5
|
const m = n(
|
|
5
|
-
function({ className: e, ...
|
|
6
|
+
function({ className: e, ...t }, r) {
|
|
6
7
|
return /* @__PURE__ */ o(
|
|
7
8
|
"div",
|
|
8
9
|
{
|
|
9
|
-
...
|
|
10
|
-
ref:
|
|
10
|
+
...t,
|
|
11
|
+
ref: r,
|
|
11
12
|
className: a("smudi-header__content", e)
|
|
12
13
|
}
|
|
13
14
|
);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as i, useState as c, useEffect as f } from "react";
|
|
3
4
|
import { Button as l } from "../../button/button.js";
|
|
4
5
|
import { classNames as g } from "../../utils/class-names.js";
|
|
5
6
|
import { HEADER_MENU_ID as t } from "./header-menu.js";
|
|
6
|
-
const E = i(function({ className: s, children: r, ...
|
|
7
|
-
const [m,
|
|
7
|
+
const E = i(function({ className: s, children: r, ...u }, d) {
|
|
8
|
+
const [m, n] = c(!1);
|
|
8
9
|
return f(() => {
|
|
9
10
|
const e = document.getElementById(t);
|
|
10
11
|
if (!e) return;
|
|
11
|
-
const
|
|
12
|
+
const o = () => {
|
|
12
13
|
try {
|
|
13
14
|
return e.matches(":popover-open");
|
|
14
15
|
} catch {
|
|
15
16
|
return !1;
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
|
-
o(
|
|
19
|
-
const a = () => o(
|
|
19
|
+
n(o());
|
|
20
|
+
const a = () => n(o());
|
|
20
21
|
return e.addEventListener("toggle", a), () => e.removeEventListener("toggle", a);
|
|
21
22
|
}, []), /* @__PURE__ */ p(
|
|
22
23
|
l,
|
|
@@ -27,8 +28,8 @@ const E = i(function({ className: s, children: r, ...d }, u) {
|
|
|
27
28
|
"aria-haspopup": "dialog",
|
|
28
29
|
"aria-expanded": m,
|
|
29
30
|
popovertarget: t,
|
|
30
|
-
ref:
|
|
31
|
-
...
|
|
31
|
+
ref: d,
|
|
32
|
+
...u,
|
|
32
33
|
children: r || "Meny"
|
|
33
34
|
}
|
|
34
35
|
);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as o } from "react";
|
|
3
4
|
import { classNames as a } from "../../utils/class-names.js";
|
|
4
|
-
const m = o(function({ className: e, ...n },
|
|
5
|
-
return /* @__PURE__ */
|
|
5
|
+
const m = o(function({ className: e, ...n }, t) {
|
|
6
|
+
return /* @__PURE__ */ r(
|
|
6
7
|
"div",
|
|
7
8
|
{
|
|
8
9
|
className: a("smudi-header__menu-content", e),
|
|
9
|
-
ref:
|
|
10
|
+
ref: t,
|
|
10
11
|
...n
|
|
11
12
|
}
|
|
12
13
|
);
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { classNames as m } from "../../utils/class-names.js";
|
|
5
|
+
const s = a(
|
|
6
|
+
function({ className: e, ...r }, o) {
|
|
7
|
+
return /* @__PURE__ */ u(
|
|
7
8
|
"div",
|
|
8
9
|
{
|
|
9
|
-
className:
|
|
10
|
+
className: m("smudi-header__menu-group", e),
|
|
10
11
|
ref: o,
|
|
11
|
-
...
|
|
12
|
+
...r
|
|
12
13
|
}
|
|
13
14
|
);
|
|
14
15
|
}
|
|
15
16
|
);
|
|
16
|
-
|
|
17
|
+
s.displayName = "Header.Menu.Group";
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
s as HeaderMenuGroup
|
|
19
20
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
3
|
import { ChevronRightIcon as t } from "@navikt/aksel-icons";
|
|
3
4
|
import { forwardRef as o } from "react";
|
|
4
5
|
import { Link as d } from "../../link/link.js";
|
|
5
6
|
import { classNames as u } from "../../utils/class-names.js";
|
|
6
|
-
const c = o(function({ className: r, children: m, icon:
|
|
7
|
+
const c = o(function({ className: r, children: m, icon: n = /* @__PURE__ */ e(t, { "aria-hidden": !0 }), ...a }, i) {
|
|
7
8
|
return /* @__PURE__ */ s(
|
|
8
9
|
d,
|
|
9
10
|
{
|
|
10
11
|
className: u("smudi-header__menu-link", r),
|
|
11
12
|
ref: i,
|
|
12
|
-
...
|
|
13
|
+
...a,
|
|
13
14
|
children: [
|
|
14
|
-
/* @__PURE__ */ e("span", { className: "smudi-header__menu-item-icon", "aria-hidden": !0, children:
|
|
15
|
+
/* @__PURE__ */ e("span", { className: "smudi-header__menu-item-icon", "aria-hidden": !0, children: n }),
|
|
15
16
|
/* @__PURE__ */ e("span", { className: "smudi-header__menu-item-text", children: m })
|
|
16
17
|
]
|
|
17
18
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as C } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as H, useRef as p, useState as N } from "react";
|
|
3
4
|
import { Popover as O } from "../../popover/popover.js";
|
|
@@ -16,8 +17,8 @@ const $ = "smudi-header-menu", h = H(
|
|
|
16
17
|
"aria-labelledby": u,
|
|
17
18
|
...I
|
|
18
19
|
}, R) {
|
|
19
|
-
const r = $,
|
|
20
|
-
|
|
20
|
+
const r = $, t = p(null), o = p(null), [y, i] = N(!1), n = s !== void 0, M = n ? !!s : y, a = () => {
|
|
21
|
+
o.current?.(), o.current = null;
|
|
21
22
|
}, c = () => {
|
|
22
23
|
n || i(!1), a();
|
|
23
24
|
};
|
|
@@ -27,7 +28,7 @@ const $ = "smudi-header-menu", h = H(
|
|
|
27
28
|
id: r,
|
|
28
29
|
className: _("smudi-header__menu", v),
|
|
29
30
|
ref: E((e) => {
|
|
30
|
-
|
|
31
|
+
t.current = e, e || a();
|
|
31
32
|
}, R),
|
|
32
33
|
role: "dialog",
|
|
33
34
|
"aria-modal": "true",
|
|
@@ -37,12 +38,12 @@ const $ = "smudi-header-menu", h = H(
|
|
|
37
38
|
placement: "none",
|
|
38
39
|
open: M,
|
|
39
40
|
onOpen: () => {
|
|
40
|
-
if (n || i(!0),
|
|
41
|
+
if (n || i(!0), t.current) {
|
|
41
42
|
a();
|
|
42
43
|
const e = document.querySelector(
|
|
43
44
|
`[popovertarget="${r}"], [popoverTarget="${r}"]`
|
|
44
45
|
);
|
|
45
|
-
|
|
46
|
+
o.current = T(t.current, {
|
|
46
47
|
exclude: e
|
|
47
48
|
});
|
|
48
49
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef as H, useRef as f, useState as x } from "react";
|
|
3
4
|
import { Popover as y } from "../../popover/popover.js";
|
|
@@ -17,8 +18,8 @@ const T = H(
|
|
|
17
18
|
"aria-labelledby": c,
|
|
18
19
|
...S
|
|
19
20
|
}, b) {
|
|
20
|
-
const
|
|
21
|
-
|
|
21
|
+
const t = f(null), o = f(null), [I, i] = x(!1), n = s !== void 0, _ = n ? !!s : I, a = () => {
|
|
22
|
+
o.current?.(), o.current = null;
|
|
22
23
|
}, p = () => {
|
|
23
24
|
n || i(!1), a();
|
|
24
25
|
};
|
|
@@ -28,7 +29,7 @@ const T = H(
|
|
|
28
29
|
id: r,
|
|
29
30
|
className: N("smudi-header__search", v),
|
|
30
31
|
ref: O((e) => {
|
|
31
|
-
|
|
32
|
+
t.current = e, e || a();
|
|
32
33
|
}, b),
|
|
33
34
|
role: "dialog",
|
|
34
35
|
"aria-modal": "true",
|
|
@@ -38,12 +39,12 @@ const T = H(
|
|
|
38
39
|
placement: "none",
|
|
39
40
|
open: _,
|
|
40
41
|
onOpen: () => {
|
|
41
|
-
if (n || i(!0),
|
|
42
|
+
if (n || i(!0), t.current) {
|
|
42
43
|
a();
|
|
43
44
|
const e = document.querySelector(
|
|
44
45
|
`[popovertarget="${r}"], [popoverTarget="${r}"]`
|
|
45
46
|
);
|
|
46
|
-
|
|
47
|
+
o.current = E(t.current, {
|
|
47
48
|
exclude: e
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Header as e } from "./header.js";
|
|
2
3
|
import { UDILogo as D } from "./header.js";
|
|
3
4
|
import { HeaderContent as r } from "./header-content.js";
|
|
@@ -7,28 +8,28 @@ import { HeaderMenu as t } from "./header-menu/header-menu.js";
|
|
|
7
8
|
import { HeaderMenuContent as n } from "./header-menu/header-menu-content.js";
|
|
8
9
|
import { HeaderMenuGroup as a } from "./header-menu/header-menu-group.js";
|
|
9
10
|
import { HeaderMenuItem as m } from "./header-menu/header-menu-item.js";
|
|
10
|
-
import { HeaderSearch as
|
|
11
|
+
import { HeaderSearch as i } from "./header-search/header-search.js";
|
|
11
12
|
import { HeaderSearchButton as j } from "./header-search/header-search-button.js";
|
|
12
|
-
const
|
|
13
|
+
const d = Object.assign(t, {
|
|
13
14
|
Content: n,
|
|
14
15
|
Group: a,
|
|
15
16
|
Item: m
|
|
16
17
|
}), x = Object.assign(e, {
|
|
17
18
|
Content: r,
|
|
18
19
|
Divider: o,
|
|
19
|
-
Menu:
|
|
20
|
-
Search:
|
|
20
|
+
Menu: d,
|
|
21
|
+
Search: i
|
|
21
22
|
});
|
|
22
23
|
export {
|
|
23
24
|
x as Header,
|
|
24
25
|
r as HeaderContent,
|
|
25
26
|
o as HeaderDivider,
|
|
26
|
-
|
|
27
|
+
d as HeaderMenu,
|
|
27
28
|
S as HeaderMenuButton,
|
|
28
29
|
n as HeaderMenuContent,
|
|
29
30
|
a as HeaderMenuGroup,
|
|
30
31
|
m as HeaderMenuItem,
|
|
31
|
-
|
|
32
|
+
i as HeaderSearch,
|
|
32
33
|
j as HeaderSearchButton,
|
|
33
34
|
D as UDILogo
|
|
34
35
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { Input as t } from "@digdir/designsystemet-react";
|
|
3
|
+
const n = t;
|
|
4
|
+
n.displayName = "Input";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
n as Input
|
|
6
7
|
};
|