@altinn/altinn-components 0.67.1 → 0.67.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/Tooltip.css +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +60 -50
- package/dist/components/GlobalHeader/HeaderDrawer.js +53 -60
- package/dist/components/Modal/ModalBase.js +41 -48
- package/dist/components/Settings/SettingsModal.js +9 -9
- package/dist/components/Tooltip/Tooltip.js +5 -5
- package/dist/types/lib/components/Tooltip/Tooltip.d.ts +1 -2
- package/dist/types/lib/components/Tooltip/Tooltip.stories.d.ts +1 -1
- package/package.json +1 -1
package/dist/assets/Tooltip.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tooltip_t2itc_1{padding:.5em}
|
|
@@ -1,81 +1,91 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
3
|
+
import s, { forwardRef as v, useRef as O, useEffect as h, useMemo as w } from "react";
|
|
4
|
+
import { Button as y } from "../Button/Button.js";
|
|
5
5
|
import "../../index-p1eeF8LQ.js";
|
|
6
6
|
import "../../tooltip-Ct39-719.js";
|
|
7
|
-
import { w as
|
|
7
|
+
import { w as x, g as C, M as R } from "../../ToolbarSearch-bv2opbAj.js";
|
|
8
8
|
import "../Typography/Link.js";
|
|
9
|
-
import { Tooltip as
|
|
9
|
+
import { Tooltip as I } from "../Tooltip/Tooltip.js";
|
|
10
10
|
import "../GlobalMenu/GlobalMenuBase.js";
|
|
11
11
|
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { useDropdownMenuController as
|
|
13
|
-
import { u as
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
for (var
|
|
17
|
-
if (
|
|
18
|
-
for (var
|
|
19
|
-
i.indexOf(
|
|
20
|
-
return
|
|
12
|
+
import { useDropdownMenuController as M } from "../Menu/useDropdownMenuController.js";
|
|
13
|
+
import { u as A } from "../../useId-BVFxCjkq.js";
|
|
14
|
+
var E = function(r, i) {
|
|
15
|
+
var o = {};
|
|
16
|
+
for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && i.indexOf(t) < 0 && (o[t] = r[t]);
|
|
17
|
+
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
18
|
+
for (var n = 0, t = Object.getOwnPropertySymbols(r); n < t.length; n++)
|
|
19
|
+
i.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(r, t[n]) && (o[t[n]] = r[t[n]]);
|
|
20
|
+
return o;
|
|
21
21
|
};
|
|
22
|
-
const
|
|
23
|
-
var { title:
|
|
24
|
-
let l =
|
|
25
|
-
return l =
|
|
22
|
+
const j = v((r, i) => {
|
|
23
|
+
var { title: o, titleId: t } = r, n = E(r, ["title", "titleId"]);
|
|
24
|
+
let l = A();
|
|
25
|
+
return l = o ? t || "title-" + l : void 0, s.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: i, "aria-labelledby": l },
|
|
28
|
-
|
|
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: i, "aria-labelledby": l }, n),
|
|
28
|
+
o ? s.createElement("title", { id: l }, o) : null,
|
|
29
|
+
s.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" })
|
|
30
30
|
);
|
|
31
|
-
}),
|
|
32
|
-
groups:
|
|
31
|
+
}), G = ({
|
|
32
|
+
groups: r = {},
|
|
33
33
|
items: i,
|
|
34
|
-
title:
|
|
35
|
-
color:
|
|
36
|
-
id:
|
|
34
|
+
title: o,
|
|
35
|
+
color: t,
|
|
36
|
+
id: n = "context-menu",
|
|
37
37
|
placement: l = "right",
|
|
38
|
-
"aria-label":
|
|
38
|
+
"aria-label": m
|
|
39
39
|
}) => {
|
|
40
|
-
const
|
|
41
|
-
|
|
40
|
+
const e = M({ id: n, returnFocusOnClose: !0 }), { languageCode: f } = x(), c = O(e.open);
|
|
41
|
+
h(() => {
|
|
42
|
+
const u = c.current;
|
|
43
|
+
if (c.current = e.open, !u || e.open) return;
|
|
44
|
+
const p = e.triggerRef.current, d = p?.getAttribute("data-tooltip");
|
|
45
|
+
if (!p || d == null) return;
|
|
46
|
+
p.removeAttribute("data-tooltip");
|
|
47
|
+
const b = requestAnimationFrame(() => p.setAttribute("data-tooltip", d));
|
|
48
|
+
return () => cancelAnimationFrame(b);
|
|
49
|
+
}, [e.open, e.triggerRef]);
|
|
50
|
+
const g = w(() => i.map((u) => ({
|
|
51
|
+
...u,
|
|
42
52
|
onClick: () => {
|
|
43
|
-
|
|
53
|
+
e.setOpen(!1), u.onClick?.();
|
|
44
54
|
}
|
|
45
|
-
})), [i,
|
|
55
|
+
})), [i, e]);
|
|
46
56
|
return /* @__PURE__ */ a(
|
|
47
|
-
|
|
57
|
+
C,
|
|
48
58
|
{
|
|
49
59
|
backdrop: !1,
|
|
50
|
-
color:
|
|
51
|
-
trigger: /* @__PURE__ */ a(
|
|
52
|
-
|
|
60
|
+
color: t,
|
|
61
|
+
trigger: /* @__PURE__ */ a(I, { content: e.open ? "" : o || P(f).title, children: /* @__PURE__ */ a(
|
|
62
|
+
y,
|
|
53
63
|
{
|
|
54
|
-
ref:
|
|
64
|
+
ref: e.triggerRef,
|
|
55
65
|
icon: !0,
|
|
56
66
|
variant: "ghost",
|
|
57
67
|
rounded: !0,
|
|
58
68
|
size: "xs",
|
|
59
|
-
"aria-label":
|
|
60
|
-
onClick: () =>
|
|
69
|
+
"aria-label": m,
|
|
70
|
+
onClick: () => e.toggleMenu(),
|
|
61
71
|
"aria-haspopup": "menu",
|
|
62
|
-
"aria-expanded":
|
|
63
|
-
"aria-controls":
|
|
64
|
-
color:
|
|
65
|
-
children: /* @__PURE__ */ a(
|
|
72
|
+
"aria-expanded": e.open,
|
|
73
|
+
"aria-controls": e.open ? e.menuId : void 0,
|
|
74
|
+
color: t,
|
|
75
|
+
children: /* @__PURE__ */ a(j, { "aria-hidden": "true" })
|
|
66
76
|
}
|
|
67
|
-
) }),
|
|
68
|
-
open:
|
|
69
|
-
onClose: () =>
|
|
70
|
-
id:
|
|
77
|
+
) }),
|
|
78
|
+
open: e.open,
|
|
79
|
+
onClose: () => e.setOpen(!1),
|
|
80
|
+
id: e.menuId,
|
|
71
81
|
placement: l,
|
|
72
82
|
useFixedPosition: !0,
|
|
73
|
-
...
|
|
74
|
-
children: /* @__PURE__ */ a(
|
|
83
|
+
...e.dropdownA11yProps,
|
|
84
|
+
children: /* @__PURE__ */ a(R, { groups: r, items: g, maxLevels: 1, keyboardEvents: e.open, ...e.menuA11yProps })
|
|
75
85
|
}
|
|
76
86
|
);
|
|
77
|
-
},
|
|
78
|
-
switch (
|
|
87
|
+
}, P = (r) => {
|
|
88
|
+
switch (r) {
|
|
79
89
|
case "nb":
|
|
80
90
|
return {
|
|
81
91
|
title: "Åpne meny"
|
|
@@ -91,5 +101,5 @@ const C = c((t, i) => {
|
|
|
91
101
|
}
|
|
92
102
|
};
|
|
93
103
|
export {
|
|
94
|
-
|
|
104
|
+
G as ContextMenu
|
|
95
105
|
};
|
|
@@ -1,90 +1,83 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as a, Fragment as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as E, useEffect as h } from "react";
|
|
3
3
|
import { Button as D } from "../Button/Button.js";
|
|
4
4
|
import "../../index-p1eeF8LQ.js";
|
|
5
5
|
import "../../tooltip-Ct39-719.js";
|
|
6
|
-
import { w as
|
|
6
|
+
import { w as j } from "../../ToolbarSearch-bv2opbAj.js";
|
|
7
7
|
import "../Typography/Link.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "../GlobalMenu/GlobalMenuBase.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { S as
|
|
12
|
-
import { S as
|
|
13
|
-
import '../../assets/HeaderDrawer.css';const M = "_backdrop_yn0zc_11", R = "_drawer_yn0zc_28",
|
|
11
|
+
import { S as I } from "../../ChevronUp-hn05LboH.js";
|
|
12
|
+
import { S as L } from "../../ChevronDown-D_a7nb-G.js";
|
|
13
|
+
import '../../assets/HeaderDrawer.css';const M = "_backdrop_yn0zc_11", R = "_drawer_yn0zc_28", B = "_footer_yn0zc_60", F = "_body_yn0zc_64", V = "_toggleButton_yn0zc_104", n = {
|
|
14
14
|
backdrop: M,
|
|
15
15
|
drawer: R,
|
|
16
|
-
footer:
|
|
17
|
-
body:
|
|
18
|
-
toggleButton:
|
|
16
|
+
footer: B,
|
|
17
|
+
body: F,
|
|
18
|
+
toggleButton: V
|
|
19
19
|
}, Z = ({
|
|
20
|
-
id:
|
|
21
|
-
open:
|
|
22
|
-
onClose:
|
|
20
|
+
id: c,
|
|
21
|
+
open: r,
|
|
22
|
+
onClose: v,
|
|
23
23
|
closedBy: o = "any",
|
|
24
|
-
expanded:
|
|
25
|
-
expandable:
|
|
24
|
+
expanded: d,
|
|
25
|
+
expandable: _ = !0,
|
|
26
26
|
onToggle: b,
|
|
27
|
-
children:
|
|
27
|
+
children: w
|
|
28
28
|
}) => {
|
|
29
|
-
const { languageCode:
|
|
30
|
-
|
|
31
|
-
const e =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
a();
|
|
39
|
-
return;
|
|
29
|
+
const { languageCode: k } = j(), m = q(k), s = E(null);
|
|
30
|
+
h(() => {
|
|
31
|
+
const e = s.current, u = (i) => {
|
|
32
|
+
if (window.getSelection()?.toString()) return;
|
|
33
|
+
const { clientY: g, clientX: p, target: z } = i;
|
|
34
|
+
if (e && z === e && o === "any") {
|
|
35
|
+
const { top: C, left: x, right: S, bottom: N } = e.getBoundingClientRect();
|
|
36
|
+
C <= g && g <= N && x <= p && p <= S || e.close();
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}, g = () => {
|
|
46
|
-
const n = e?.querySelector("[autofocus]");
|
|
47
|
-
document.activeElement !== n && n?.focus();
|
|
38
|
+
}, f = () => {
|
|
39
|
+
const i = e?.querySelector("[autofocus]");
|
|
40
|
+
document.activeElement !== i && i?.focus();
|
|
48
41
|
};
|
|
49
|
-
return e?.addEventListener("animationend",
|
|
50
|
-
e?.removeEventListener("animationend",
|
|
42
|
+
return e?.addEventListener("animationend", f), e?.addEventListener("click", u), () => {
|
|
43
|
+
e?.removeEventListener("animationend", f), e?.removeEventListener("click", u);
|
|
51
44
|
};
|
|
52
|
-
}, [o
|
|
53
|
-
const e =
|
|
54
|
-
e && (
|
|
55
|
-
}, [
|
|
56
|
-
const
|
|
57
|
-
|
|
45
|
+
}, [o]), h(() => {
|
|
46
|
+
const e = s.current;
|
|
47
|
+
e && (r ? e.open || e.showModal() : e.open && e.close());
|
|
48
|
+
}, [r]);
|
|
49
|
+
const y = (e) => {
|
|
50
|
+
o === "none" && e.preventDefault();
|
|
58
51
|
};
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ a(l, { children: [
|
|
53
|
+
/* @__PURE__ */ t("div", { className: n.backdrop, "aria-hidden": !r }),
|
|
54
|
+
/* @__PURE__ */ a(
|
|
62
55
|
"dialog",
|
|
63
56
|
{
|
|
64
|
-
id:
|
|
65
|
-
ref:
|
|
57
|
+
id: c,
|
|
58
|
+
ref: s,
|
|
66
59
|
"aria-modal": "true",
|
|
67
60
|
"aria-labelledby": "modal-title",
|
|
68
|
-
"data-open":
|
|
69
|
-
"data-expanded":
|
|
70
|
-
onCancel:
|
|
71
|
-
className:
|
|
72
|
-
onClose: o !== "none" ?
|
|
61
|
+
"data-open": r,
|
|
62
|
+
"data-expanded": d,
|
|
63
|
+
onCancel: y,
|
|
64
|
+
className: n.drawer,
|
|
65
|
+
onClose: o !== "none" ? v : void 0,
|
|
73
66
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
o !== "none" &&
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
78
|
-
] }) : /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
67
|
+
/* @__PURE__ */ t("div", { className: n.body, children: w }),
|
|
68
|
+
o !== "none" && _ && /* @__PURE__ */ t("footer", { className: n.footer, children: /* @__PURE__ */ t(D, { className: n.toggleButton, size: "xs", variant: "outline", onClick: b, children: d ? /* @__PURE__ */ a(l, { children: [
|
|
69
|
+
/* @__PURE__ */ t(I, { className: n.btnIcon, "aria-hidden": "true" }),
|
|
70
|
+
m.minimize
|
|
71
|
+
] }) : /* @__PURE__ */ a(l, { children: [
|
|
72
|
+
/* @__PURE__ */ t(L, { className: n.btnIcon, "aria-hidden": "true" }),
|
|
73
|
+
m.fullscreen
|
|
81
74
|
] }) }) })
|
|
82
75
|
]
|
|
83
76
|
}
|
|
84
77
|
)
|
|
85
78
|
] });
|
|
86
|
-
},
|
|
87
|
-
switch (
|
|
79
|
+
}, q = (c) => {
|
|
80
|
+
switch (c) {
|
|
88
81
|
case "nn":
|
|
89
82
|
return {
|
|
90
83
|
minimize: "Minimer",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import { useRef as
|
|
3
|
+
import { useRef as w, useEffect as d } from "react";
|
|
4
4
|
import "../../index-p1eeF8LQ.js";
|
|
5
5
|
import "../../tooltip-Ct39-719.js";
|
|
6
6
|
import "../../ToolbarSearch-bv2opbAj.js";
|
|
@@ -9,73 +9,66 @@ import "../Button/Button.js";
|
|
|
9
9
|
import "react-dom";
|
|
10
10
|
import "../GlobalMenu/GlobalMenuBase.js";
|
|
11
11
|
import "../Snackbar/useSnackbar.js";
|
|
12
|
-
import { Section as
|
|
13
|
-
import '../../assets/ModalBase.css';const
|
|
14
|
-
modal:
|
|
12
|
+
import { Section as y } from "../Page/Section.js";
|
|
13
|
+
import '../../assets/ModalBase.css';const D = "_modal_3d5cx_1", R = "_content_3d5cx_41", m = {
|
|
14
|
+
modal: D,
|
|
15
15
|
content: R
|
|
16
16
|
}, J = ({
|
|
17
|
-
open:
|
|
18
|
-
onClose:
|
|
19
|
-
closedBy:
|
|
20
|
-
children:
|
|
17
|
+
open: a,
|
|
18
|
+
onClose: u,
|
|
19
|
+
closedBy: e = "any",
|
|
20
|
+
children: f,
|
|
21
21
|
backdropColor: p = "inherit",
|
|
22
22
|
size: g,
|
|
23
|
-
color:
|
|
24
|
-
padding:
|
|
25
|
-
spacing:
|
|
26
|
-
height:
|
|
27
|
-
variant:
|
|
23
|
+
color: h,
|
|
24
|
+
padding: v = 0,
|
|
25
|
+
spacing: C = 0,
|
|
26
|
+
height: E = "auto",
|
|
27
|
+
variant: _ = "default"
|
|
28
28
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
const t =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
o();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (!window.getSelection()?.toString() && t && k === t && n === "any") {
|
|
42
|
-
const { top: L, left: _, right: w, bottom: x } = t.getBoundingClientRect();
|
|
43
|
-
L <= l && l <= x && _ <= d && d <= w || t?.close();
|
|
29
|
+
const n = w(null);
|
|
30
|
+
return d(() => {
|
|
31
|
+
const t = n.current, i = (o) => {
|
|
32
|
+
if (window.getSelection()?.toString()) return;
|
|
33
|
+
const { clientY: r, clientX: l, target: b } = o;
|
|
34
|
+
if (t && b === t && e === "any") {
|
|
35
|
+
const { top: k, left: x, right: L, bottom: S } = t.getBoundingClientRect();
|
|
36
|
+
k <= r && r <= S && x <= l && l <= L || t.close();
|
|
44
37
|
}
|
|
45
38
|
}, c = () => {
|
|
46
|
-
const
|
|
47
|
-
document.activeElement !==
|
|
39
|
+
const o = t?.querySelector("[autofocus]");
|
|
40
|
+
document.activeElement !== o && o?.focus();
|
|
48
41
|
};
|
|
49
|
-
return t?.addEventListener("animationend", c), t?.addEventListener("click",
|
|
50
|
-
t?.removeEventListener("animationend", c), t?.removeEventListener("click",
|
|
42
|
+
return t?.addEventListener("animationend", c), t?.addEventListener("click", i), () => {
|
|
43
|
+
t?.removeEventListener("animationend", c), t?.removeEventListener("click", i);
|
|
51
44
|
};
|
|
52
|
-
}, [
|
|
53
|
-
const t =
|
|
54
|
-
t && (
|
|
55
|
-
}, [
|
|
45
|
+
}, [e]), d(() => {
|
|
46
|
+
const t = n.current;
|
|
47
|
+
t && (a ? t.open || t.showModal() : t.open && t.close());
|
|
48
|
+
}, [a]), /* @__PURE__ */ s(
|
|
56
49
|
"dialog",
|
|
57
50
|
{
|
|
58
|
-
ref:
|
|
51
|
+
ref: n,
|
|
59
52
|
"aria-modal": "true",
|
|
60
53
|
"aria-labelledby": "modal-title",
|
|
61
54
|
onCancel: (t) => {
|
|
62
|
-
|
|
55
|
+
e === "none" && t.preventDefault();
|
|
63
56
|
},
|
|
64
57
|
"data-backdrop-color": p,
|
|
65
|
-
className:
|
|
66
|
-
"data-variant":
|
|
67
|
-
"data-height":
|
|
68
|
-
onClose:
|
|
58
|
+
className: m.modal,
|
|
59
|
+
"data-variant": _,
|
|
60
|
+
"data-height": E,
|
|
61
|
+
onClose: e !== "none" ? u : void 0,
|
|
69
62
|
children: /* @__PURE__ */ s(
|
|
70
|
-
|
|
63
|
+
y,
|
|
71
64
|
{
|
|
72
|
-
className:
|
|
65
|
+
className: m.content,
|
|
73
66
|
"aria-label": "modal content",
|
|
74
67
|
size: g,
|
|
75
|
-
color:
|
|
76
|
-
padding:
|
|
77
|
-
spacing:
|
|
78
|
-
children:
|
|
68
|
+
color: h,
|
|
69
|
+
padding: v,
|
|
70
|
+
spacing: C,
|
|
71
|
+
children: f
|
|
79
72
|
}
|
|
80
73
|
)
|
|
81
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { createElement as
|
|
2
|
+
import { createElement as h } from "react";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
4
|
import "../../tooltip-Ct39-719.js";
|
|
5
5
|
import "../../ToolbarSearch-bv2opbAj.js";
|
|
@@ -13,7 +13,7 @@ import "../GlobalMenu/GlobalMenuBase.js";
|
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
14
|
import { ModalBase as j } from "../Modal/ModalBase.js";
|
|
15
15
|
import { ModalHeader as y } from "../Modal/ModalHeader.js";
|
|
16
|
-
import { ModalBody as
|
|
16
|
+
import { ModalBody as w } from "../Modal/ModalBody.js";
|
|
17
17
|
const K = ({
|
|
18
18
|
icon: e,
|
|
19
19
|
title: n,
|
|
@@ -25,17 +25,17 @@ const K = ({
|
|
|
25
25
|
...d
|
|
26
26
|
}) => /* @__PURE__ */ p(j, { ...d, open: l, onClose: r, children: [
|
|
27
27
|
/* @__PURE__ */ o(y, { icon: e, title: n, description: c, onClose: r }),
|
|
28
|
-
/* @__PURE__ */ p(
|
|
28
|
+
/* @__PURE__ */ p(w, { children: [
|
|
29
29
|
a,
|
|
30
|
-
m?.length && /* @__PURE__ */ o(g, { children: m?.map((t, f) => {
|
|
31
|
-
const { icon: i, label: s, ...
|
|
32
|
-
return /* @__PURE__ */
|
|
30
|
+
m?.length && /* @__PURE__ */ o(g, { wrap: !0, children: m?.map((t, f) => {
|
|
31
|
+
const { icon: i, label: s, ...u } = t;
|
|
32
|
+
return /* @__PURE__ */ h(
|
|
33
33
|
M,
|
|
34
34
|
{
|
|
35
|
-
...
|
|
35
|
+
...u,
|
|
36
36
|
key: f,
|
|
37
|
-
onClick: (
|
|
38
|
-
t?.onClick?.(
|
|
37
|
+
onClick: (B) => {
|
|
38
|
+
t?.onClick?.(B), t?.close && r?.();
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
i && /* @__PURE__ */ o(k, { icon: i }),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { v as
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { v as r } from "../../tooltip-Ct39-719.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import '../../assets/Tooltip.css';const l = "
|
|
4
|
+
import '../../assets/Tooltip.css';const l = "_tooltip_t2itc_1", m = {
|
|
5
5
|
tooltip: l
|
|
6
|
-
},
|
|
6
|
+
}, f = ({ size: i = "xs", placement: s, children: t, content: o }) => o ? /* @__PURE__ */ p(r, { "data-size": i, content: o, placement: s, className: m.tooltip, children: t }) : t;
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
f as Tooltip
|
|
9
9
|
};
|
|
@@ -2,7 +2,6 @@ import { TooltipProps as DsTooltipProps, Size } from '@digdir/designsystemet-rea
|
|
|
2
2
|
export type TooltipProps = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
content: string;
|
|
5
|
-
hidden?: boolean;
|
|
6
5
|
size?: Size;
|
|
7
6
|
} & Omit<DsTooltipProps, 'content | children'>;
|
|
8
|
-
export declare const Tooltip: ({ size, placement, children, content
|
|
7
|
+
export declare const Tooltip: ({ size, placement, children, content }: TooltipProps) => string | import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const meta: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ size, placement, children, content
|
|
3
|
+
component: ({ size, placement, children, content }: import('./Tooltip').TooltipProps) => string | import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
tags: string[];
|
|
5
5
|
parameters: {};
|
|
6
6
|
args: {};
|