@altinn/altinn-components 0.38.0 → 0.38.2
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/Byline.css +1 -1
- package/dist/assets/FloatingActionButton.css +1 -0
- package/dist/assets/ListItemLabel.css +1 -1
- package/dist/assets/MenuItemLabel.css +1 -1
- package/dist/assets/ModalBase.css +1 -1
- package/dist/components/Account/AccountMenu.js +39 -35
- package/dist/components/Button/FloatingActionButton.js +36 -0
- package/dist/components/Button/index.js +6 -4
- package/dist/components/Byline/Byline.js +18 -18
- package/dist/components/Dashboard/DashboardHeader.js +6 -6
- package/dist/components/Dialog/DialogListItem.js +113 -126
- package/dist/components/List/ListItemHeader.js +55 -53
- package/dist/components/List/ListItemLabel.js +32 -31
- package/dist/components/Menu/MenuItem.js +22 -21
- package/dist/components/Menu/MenuItemLabel.js +41 -25
- package/dist/components/Modal/ModalBase.js +5 -5
- package/dist/components/Typography/Heading.js +26 -24
- package/dist/components/Typography/useHighlightedText.js +28 -21
- package/dist/components/index.js +402 -400
- package/dist/index.js +408 -406
- package/dist/types/lib/components/Account/AccountListItem.stories.d.ts +1 -0
- package/dist/types/lib/components/Button/FloatingActionButton.d.ts +14 -0
- package/dist/types/lib/components/Button/index.d.ts +1 -0
- package/dist/types/lib/components/Dashboard/DashboardHeader.stories.d.ts +1 -0
- package/dist/types/lib/components/List/ListItemHeader.d.ts +3 -1
- package/dist/types/lib/components/List/ListItemLabel.d.ts +2 -1
- package/dist/types/lib/components/Menu/MenuItem.d.ts +2 -1
- package/dist/types/lib/components/Menu/MenuItemLabel.d.ts +2 -1
- package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +1 -0
- package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +1 -0
- package/dist/types/lib/stories/InboxBeta.stories.d.ts +15 -0
- package/dist/types/lib/stories/Profile.stories.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/lib/stories/Beta.stories.d.ts +0 -11
|
@@ -1,97 +1,99 @@
|
|
|
1
1
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Badge as
|
|
2
|
+
import { c as E } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { useId as w, isValidElement as z } from "react";
|
|
4
|
+
import { Icon as A } from "../Icon/Icon.js";
|
|
5
|
+
import { Badge as D } from "../Badge/Badge.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { ListItemLink as
|
|
8
|
-
import { ListItemLabel as
|
|
9
|
-
import { ListItemIcon as
|
|
10
|
-
import { ListItemControls as
|
|
11
|
-
import { ListItemSelect as
|
|
7
|
+
import { ListItemLink as H } from "./ListItemLink.js";
|
|
8
|
+
import { ListItemLabel as R } from "./ListItemLabel.js";
|
|
9
|
+
import { ListItemIcon as U } from "./ListItemIcon.js";
|
|
10
|
+
import { ListItemControls as V } from "./ListItemControls.js";
|
|
11
|
+
import { ListItemSelect as q } from "./ListItemSelect.js";
|
|
12
12
|
import "../Snackbar/useSnackbar.js";
|
|
13
|
-
import { S as
|
|
14
|
-
import { S as
|
|
15
|
-
import '../../assets/ListItemHeader.css';const
|
|
16
|
-
header:
|
|
17
|
-
label:
|
|
18
|
-
link:
|
|
19
|
-
badge:
|
|
20
|
-
linkIcon:
|
|
21
|
-
linkFocus:
|
|
22
|
-
controls:
|
|
23
|
-
},
|
|
13
|
+
import { S as G, a as J } from "../../ChevronUp-DR4Lz2Jb.js";
|
|
14
|
+
import { S as K } from "../../ChevronRight-BbelnTke.js";
|
|
15
|
+
import '../../assets/ListItemHeader.css';const M = "_header_1v1u9_1", O = "_label_1v1u9_27", P = "_link_1v1u9_39", Q = "_badge_1v1u9_43", T = "_linkIcon_1v1u9_47", W = "_linkFocus_1v1u9_57", X = "_controls_1v1u9_65", o = {
|
|
16
|
+
header: M,
|
|
17
|
+
label: O,
|
|
18
|
+
link: P,
|
|
19
|
+
badge: Q,
|
|
20
|
+
linkIcon: T,
|
|
21
|
+
linkFocus: W,
|
|
22
|
+
controls: X
|
|
23
|
+
}, po = ({
|
|
24
24
|
as: _,
|
|
25
|
+
highlightWords: u,
|
|
25
26
|
interactive: i = !0,
|
|
26
|
-
color:
|
|
27
|
+
color: v,
|
|
27
28
|
loading: s,
|
|
28
|
-
disabled:
|
|
29
|
-
collapsible:
|
|
30
|
-
linkIcon:
|
|
31
|
-
expanded:
|
|
29
|
+
disabled: f,
|
|
30
|
+
collapsible: h,
|
|
31
|
+
linkIcon: I,
|
|
32
|
+
expanded: k,
|
|
32
33
|
select: l,
|
|
33
|
-
href:
|
|
34
|
-
onClick:
|
|
35
|
-
onKeyPress:
|
|
36
|
-
tabIndex:
|
|
34
|
+
href: b,
|
|
35
|
+
onClick: L,
|
|
36
|
+
onKeyPress: N,
|
|
37
|
+
tabIndex: S,
|
|
37
38
|
size: a,
|
|
38
39
|
title: r,
|
|
39
|
-
description:
|
|
40
|
-
icon:
|
|
40
|
+
description: C,
|
|
41
|
+
icon: x,
|
|
41
42
|
active: c,
|
|
42
43
|
badge: t,
|
|
43
44
|
controls: m,
|
|
44
|
-
className:
|
|
45
|
-
children:
|
|
45
|
+
className: y,
|
|
46
|
+
children: F,
|
|
46
47
|
ariaLabel: d
|
|
47
48
|
}) => {
|
|
48
|
-
const p =
|
|
49
|
+
const p = h ? k ? G : J : I ? K : void 0, j = () => t && !s && typeof t == "object" && "label" in t ? /* @__PURE__ */ e(D, { ...t, className: o.badge }) : z(t) ? t : null, g = d !== void 0 ? d : typeof r == "string" ? r : void 0, B = w();
|
|
49
50
|
return /* @__PURE__ */ n(
|
|
50
51
|
"div",
|
|
51
52
|
{
|
|
52
|
-
className:
|
|
53
|
-
"data-color":
|
|
53
|
+
className: E(o.header, y),
|
|
54
|
+
"data-color": v,
|
|
54
55
|
"data-interactive": i,
|
|
55
56
|
"data-size": a,
|
|
56
57
|
"data-has-active-child": c,
|
|
57
58
|
children: [
|
|
58
59
|
/* @__PURE__ */ n(
|
|
59
|
-
|
|
60
|
+
H,
|
|
60
61
|
{
|
|
61
62
|
as: _,
|
|
62
|
-
href:
|
|
63
|
-
onClick:
|
|
64
|
-
onKeyPress:
|
|
65
|
-
tabIndex:
|
|
63
|
+
href: b,
|
|
64
|
+
onClick: L,
|
|
65
|
+
onKeyPress: N,
|
|
66
|
+
tabIndex: S,
|
|
66
67
|
loading: s,
|
|
67
|
-
disabled:
|
|
68
|
+
disabled: f || s,
|
|
68
69
|
active: c,
|
|
69
|
-
ariaLabel:
|
|
70
|
+
ariaLabel: g,
|
|
70
71
|
className: o.link,
|
|
71
72
|
children: [
|
|
72
73
|
i && /* @__PURE__ */ e("div", { className: o.linkFocus, "aria-hidden": "true" }),
|
|
73
|
-
l && /* @__PURE__ */ e(
|
|
74
|
-
/* @__PURE__ */ e(
|
|
74
|
+
l && /* @__PURE__ */ e(q, { ...l, className: o.select }),
|
|
75
|
+
/* @__PURE__ */ e(U, { loading: s, icon: x }),
|
|
75
76
|
/* @__PURE__ */ e(
|
|
76
|
-
|
|
77
|
+
R,
|
|
77
78
|
{
|
|
78
79
|
size: a,
|
|
79
80
|
loading: s,
|
|
81
|
+
highlightWords: u,
|
|
80
82
|
title: r,
|
|
81
|
-
description:
|
|
82
|
-
id:
|
|
83
|
+
description: C,
|
|
84
|
+
id: B,
|
|
83
85
|
className: o.label,
|
|
84
|
-
children:
|
|
86
|
+
children: F
|
|
85
87
|
}
|
|
86
88
|
)
|
|
87
89
|
]
|
|
88
90
|
}
|
|
89
91
|
),
|
|
90
|
-
/* @__PURE__ */ n(
|
|
92
|
+
/* @__PURE__ */ n(V, { className: o.controls, children: [
|
|
91
93
|
m && !s && /* @__PURE__ */ e("span", { className: o.customControls, children: m }),
|
|
92
|
-
|
|
94
|
+
j(),
|
|
93
95
|
p && /* @__PURE__ */ e("span", { className: o.linkIcon, children: /* @__PURE__ */ e(
|
|
94
|
-
|
|
96
|
+
A,
|
|
95
97
|
{
|
|
96
98
|
svgElement: p,
|
|
97
99
|
style: {
|
|
@@ -105,5 +107,5 @@ import '../../assets/ListItemHeader.css';const K = "_header_1v1u9_1", M = "_labe
|
|
|
105
107
|
);
|
|
106
108
|
};
|
|
107
109
|
export {
|
|
108
|
-
|
|
110
|
+
po as ListItemHeader
|
|
109
111
|
};
|
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { isValidElement as
|
|
1
|
+
import { jsx as n, jsxs as P, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { isValidElement as N } from "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
|
-
import { Heading as
|
|
5
|
+
import { Heading as o } from "../Typography/Heading.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
|
-
import '../../assets/ListItemLabel.css';const
|
|
8
|
-
label:
|
|
9
|
-
},
|
|
10
|
-
function
|
|
11
|
-
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null ||
|
|
7
|
+
import '../../assets/ListItemLabel.css';const d = "_label_1cju7_1", j = {
|
|
8
|
+
label: d
|
|
9
|
+
}, H = (r) => typeof r == "object" && r !== null && "children" in r;
|
|
10
|
+
function L(r) {
|
|
11
|
+
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null || N(r);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const z = (r) => {
|
|
14
14
|
const s = {
|
|
15
15
|
as: "h3",
|
|
16
16
|
size: "sm"
|
|
17
17
|
};
|
|
18
|
-
return
|
|
18
|
+
return H(r) ? { ...s, ...r } : L(r) ? {
|
|
19
19
|
...s,
|
|
20
20
|
children: r
|
|
21
21
|
} : null;
|
|
22
|
-
},
|
|
22
|
+
}, _ = (r) => {
|
|
23
23
|
const s = {
|
|
24
24
|
as: "span",
|
|
25
25
|
size: "xs",
|
|
26
26
|
weight: "normal",
|
|
27
27
|
variant: "subtle"
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return H(r) ? { ...s, ...r } : L(r) ? {
|
|
30
30
|
...s,
|
|
31
31
|
children: r
|
|
32
32
|
} : null;
|
|
33
|
-
},
|
|
33
|
+
}, T = ({
|
|
34
34
|
loading: r = !1,
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
highlightWords: s,
|
|
36
|
+
size: p,
|
|
37
|
+
title: t,
|
|
37
38
|
value: c,
|
|
38
|
-
description:
|
|
39
|
-
children:
|
|
40
|
-
id:
|
|
41
|
-
className:
|
|
39
|
+
description: a,
|
|
40
|
+
children: e,
|
|
41
|
+
id: f,
|
|
42
|
+
className: l
|
|
42
43
|
}) => {
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
if (t && c) {
|
|
45
|
+
const i = t && z(t), b = c && _(c);
|
|
46
|
+
return /* @__PURE__ */ n("span", { className: y(j.label, l), id: f, "data-size": p, children: e || /* @__PURE__ */ P(x, { children: [
|
|
47
|
+
i && /* @__PURE__ */ n(o, { ...i, loading: r, highlightWords: s }),
|
|
48
|
+
b && /* @__PURE__ */ n(o, { ...b, loading: r, highlightWords: s })
|
|
48
49
|
] }) });
|
|
49
50
|
}
|
|
50
|
-
const
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const m = t && z(t), u = a && _(a);
|
|
52
|
+
return /* @__PURE__ */ n("span", { className: y(j.label, l), id: f, "data-size": p, children: e || /* @__PURE__ */ P(x, { children: [
|
|
53
|
+
m && /* @__PURE__ */ n(o, { ...m, loading: r, highlightWords: s }),
|
|
54
|
+
u && /* @__PURE__ */ n(o, { ...u, loading: r, highlightWords: s })
|
|
54
55
|
] }) });
|
|
55
56
|
};
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
T as ListItemLabel,
|
|
59
|
+
H as isHeadingProps
|
|
59
60
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Icon as
|
|
1
|
+
import { jsxs as k, jsx as o, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as b } from "../Icon/Icon.js";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { MenuItemBase as
|
|
7
|
-
import { MenuItemLabel as
|
|
8
|
-
import { MenuItemIcon as
|
|
6
|
+
import { MenuItemBase as y } from "./MenuItemBase.js";
|
|
7
|
+
import { MenuItemLabel as C } from "./MenuItemLabel.js";
|
|
8
|
+
import { MenuItemIcon as _ } from "./MenuItemIcon.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/MenuItem.css';const
|
|
13
|
-
linkIcon:
|
|
14
|
-
},
|
|
10
|
+
import { S as j, a as w } from "../../ChevronUp-DR4Lz2Jb.js";
|
|
11
|
+
import { S as x } from "../../ChevronRight-BbelnTke.js";
|
|
12
|
+
import '../../assets/MenuItem.css';const N = "_linkIcon_1owl4_57", m = {
|
|
13
|
+
linkIcon: N
|
|
14
|
+
}, J = ({
|
|
15
15
|
as: i = "a",
|
|
16
16
|
size: n = "md",
|
|
17
17
|
color: s,
|
|
@@ -23,18 +23,19 @@ import '../../assets/MenuItem.css';const x = "_linkIcon_1owl4_57", m = {
|
|
|
23
23
|
iconBadge: h,
|
|
24
24
|
title: I,
|
|
25
25
|
description: v,
|
|
26
|
-
|
|
26
|
+
highlightWords: f,
|
|
27
|
+
badge: d,
|
|
27
28
|
controls: r,
|
|
28
|
-
linkIcon:
|
|
29
|
-
label:
|
|
30
|
-
...
|
|
29
|
+
linkIcon: g,
|
|
30
|
+
label: S,
|
|
31
|
+
...u
|
|
31
32
|
}) => {
|
|
32
|
-
const t = c ? e ?
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ o(
|
|
35
|
-
/* @__PURE__ */ o(
|
|
36
|
-
/* @__PURE__ */ o("span", { className: m.controls, children: r ? /* @__PURE__ */ o("span", { style: { position: "relative" }, children: r }) : /* @__PURE__ */ o(
|
|
37
|
-
|
|
33
|
+
const t = c ? e ? j : w : g ? x : void 0;
|
|
34
|
+
return /* @__PURE__ */ k(y, { as: i, size: n, theme: l, color: s, expanded: e, ...u, children: [
|
|
35
|
+
/* @__PURE__ */ o(_, { size: n, icon: a, theme: p, badge: h }),
|
|
36
|
+
/* @__PURE__ */ o(C, { title: I, description: v, highlightWords: f, size: n, badge: d, children: S }),
|
|
37
|
+
/* @__PURE__ */ o("span", { className: m.controls, children: r ? /* @__PURE__ */ o("span", { style: { position: "relative" }, children: r }) : /* @__PURE__ */ o(M, { children: t && /* @__PURE__ */ o("span", { className: m.linkIcon, children: /* @__PURE__ */ o(
|
|
38
|
+
b,
|
|
38
39
|
{
|
|
39
40
|
svgElement: t,
|
|
40
41
|
style: {
|
|
@@ -45,5 +46,5 @@ import '../../assets/MenuItem.css';const x = "_linkIcon_1owl4_57", m = {
|
|
|
45
46
|
] });
|
|
46
47
|
};
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
J as MenuItem
|
|
49
50
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as t, jsxs as f, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import { isValidElement as h } from "react";
|
|
4
|
-
import { Badge as
|
|
4
|
+
import { Badge as x } from "../Badge/Badge.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { Heading as
|
|
7
|
-
import { isHeadingProps as
|
|
6
|
+
import { Heading as p } from "../Typography/Heading.js";
|
|
7
|
+
import { isHeadingProps as o } from "../List/ListItemLabel.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import '../../assets/MenuItemLabel.css';const
|
|
10
|
-
label:
|
|
11
|
-
title:
|
|
9
|
+
import '../../assets/MenuItemLabel.css';const _ = "_label_k9qsn_1", y = "_title_k9qsn_20", u = {
|
|
10
|
+
label: _,
|
|
11
|
+
title: y
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function d(r) {
|
|
14
14
|
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null || h(r);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const P = (r) => {
|
|
17
17
|
const n = {
|
|
18
18
|
as: "span"
|
|
19
19
|
};
|
|
20
|
-
return
|
|
20
|
+
return o(r) ? { ...n, ...r } : d(r) ? {
|
|
21
21
|
...n,
|
|
22
22
|
children: r
|
|
23
23
|
} : null;
|
|
24
|
-
},
|
|
24
|
+
}, w = (r) => {
|
|
25
25
|
const n = {
|
|
26
26
|
as: "span",
|
|
27
27
|
weight: "normal",
|
|
28
28
|
variant: "subtle"
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return o(r) ? { ...n, ...r } : d(r) ? {
|
|
31
31
|
...n,
|
|
32
32
|
children: r
|
|
33
33
|
} : null;
|
|
@@ -35,25 +35,41 @@ const y = (r) => {
|
|
|
35
35
|
function z(r) {
|
|
36
36
|
if (typeof r == "string")
|
|
37
37
|
return r;
|
|
38
|
-
if (
|
|
38
|
+
if (o(r))
|
|
39
39
|
return r.children;
|
|
40
40
|
}
|
|
41
|
-
const A = ({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
const A = ({
|
|
42
|
+
className: r,
|
|
43
|
+
size: n = "sm",
|
|
44
|
+
title: i,
|
|
45
|
+
badge: l,
|
|
46
|
+
description: a,
|
|
47
|
+
highlightWords: m,
|
|
48
|
+
children: c
|
|
49
|
+
}) => {
|
|
50
|
+
const e = i && P(i), s = a && w(a);
|
|
51
|
+
return /* @__PURE__ */ t("span", { className: b(u.label, r), "data-size": n, children: c || /* @__PURE__ */ f(g, { children: [
|
|
52
|
+
e && /* @__PURE__ */ f(
|
|
53
|
+
p,
|
|
46
54
|
{
|
|
47
|
-
...
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
...e,
|
|
56
|
+
highlightWords: m,
|
|
57
|
+
className: u.title,
|
|
58
|
+
weight: e != null && e.weight || n === "lg" ? "medium" : "normal",
|
|
50
59
|
children: [
|
|
51
|
-
t.children,
|
|
52
|
-
l && /* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ t("span", { children: e.children }),
|
|
61
|
+
l && /* @__PURE__ */ t(x, { ...l })
|
|
53
62
|
]
|
|
54
63
|
}
|
|
55
64
|
),
|
|
56
|
-
|
|
65
|
+
s && /* @__PURE__ */ t(
|
|
66
|
+
p,
|
|
67
|
+
{
|
|
68
|
+
...s,
|
|
69
|
+
highlightWords: m,
|
|
70
|
+
size: s.size || n === "lg" ? "xs" : "xxs"
|
|
71
|
+
}
|
|
72
|
+
)
|
|
57
73
|
] }) });
|
|
58
74
|
};
|
|
59
75
|
export {
|
|
@@ -5,15 +5,15 @@ import "../../index-L8X2o7IH.js";
|
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
6
|
import "../Snackbar/useSnackbar.js";
|
|
7
7
|
import { Section as x } from "../Page/Section.js";
|
|
8
|
-
import '../../assets/ModalBase.css';const R = "
|
|
8
|
+
import '../../assets/ModalBase.css';const R = "_modal_4vfmr_1", I = "_content_4vfmr_35", d = {
|
|
9
9
|
modal: R,
|
|
10
10
|
content: I
|
|
11
11
|
}, Y = ({
|
|
12
12
|
open: c,
|
|
13
13
|
onClose: a,
|
|
14
14
|
closedBy: n = "any",
|
|
15
|
-
children:
|
|
16
|
-
backdropColor:
|
|
15
|
+
children: v,
|
|
16
|
+
backdropColor: p = "inherit",
|
|
17
17
|
size: E,
|
|
18
18
|
color: h,
|
|
19
19
|
padding: y = 0,
|
|
@@ -50,7 +50,7 @@ import '../../assets/ModalBase.css';const R = "_modal_1tnpv_1", I = "_content_1t
|
|
|
50
50
|
onCancel: (e) => {
|
|
51
51
|
e.preventDefault(), n === "any" && a();
|
|
52
52
|
},
|
|
53
|
-
"data-backdrop-color":
|
|
53
|
+
"data-backdrop-color": p,
|
|
54
54
|
className: d.modal,
|
|
55
55
|
"data-variant": k,
|
|
56
56
|
onClose: n !== "none" ? a : void 0,
|
|
@@ -63,7 +63,7 @@ import '../../assets/ModalBase.css';const R = "_modal_1tnpv_1", I = "_content_1t
|
|
|
63
63
|
color: h,
|
|
64
64
|
padding: y,
|
|
65
65
|
spacing: b,
|
|
66
|
-
children:
|
|
66
|
+
children: v
|
|
67
67
|
}
|
|
68
68
|
)
|
|
69
69
|
}
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { c as x } from "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Skeleton as f } from "../Skeleton/Skeleton.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import { useHighlightedText as u } from "./useHighlightedText.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import '../../assets/Heading.css';const H = "_heading_1dyne_1",
|
|
9
|
+
import '../../assets/Heading.css';const H = "_heading_1dyne_1", N = {
|
|
10
10
|
heading: H
|
|
11
|
-
},
|
|
12
|
-
loading:
|
|
13
|
-
highlightWords:
|
|
14
|
-
as:
|
|
11
|
+
}, L = ({
|
|
12
|
+
loading: i,
|
|
13
|
+
highlightWords: n = [],
|
|
14
|
+
as: r = "h2",
|
|
15
15
|
size: t,
|
|
16
|
-
leading:
|
|
17
|
-
weight:
|
|
18
|
-
color:
|
|
19
|
-
variant:
|
|
20
|
-
maxRows:
|
|
21
|
-
className:
|
|
16
|
+
leading: d = "tight",
|
|
17
|
+
weight: s = "medium",
|
|
18
|
+
color: m,
|
|
19
|
+
variant: c,
|
|
20
|
+
maxRows: l,
|
|
21
|
+
className: g,
|
|
22
22
|
style: h,
|
|
23
|
-
children:
|
|
23
|
+
children: o
|
|
24
24
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const p = r;
|
|
26
|
+
console.log("CHILDREN", o);
|
|
27
|
+
const a = u(o, n || []);
|
|
28
|
+
return console.log("CHILDREN", a), /* @__PURE__ */ e(f, { loading: i, children: /* @__PURE__ */ e(
|
|
29
|
+
p,
|
|
28
30
|
{
|
|
29
|
-
className: x(
|
|
31
|
+
className: x(N.heading, g),
|
|
30
32
|
style: h,
|
|
31
33
|
"data-size": t,
|
|
32
|
-
"data-leading":
|
|
33
|
-
"data-weight":
|
|
34
|
-
"data-color":
|
|
35
|
-
"data-variant": t === "xxs" && "default" ||
|
|
36
|
-
"data-max-rows":
|
|
37
|
-
children:
|
|
34
|
+
"data-leading": d,
|
|
35
|
+
"data-weight": s,
|
|
36
|
+
"data-color": m,
|
|
37
|
+
"data-variant": t === "xxs" && "default" || c,
|
|
38
|
+
"data-max-rows": l,
|
|
39
|
+
children: a
|
|
38
40
|
}
|
|
39
41
|
) });
|
|
40
42
|
};
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
L as Heading
|
|
43
45
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import f, { useMemo as p, isValidElement as d, cloneElement as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
2
|
+
import f, { useMemo as p, isValidElement as d, cloneElement as h } from "react";
|
|
3
|
+
const m = /* @__PURE__ */ new Set(["mark", "code", "pre", "script", "style"]);
|
|
4
|
+
function g(e) {
|
|
5
5
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
6
6
|
}
|
|
7
7
|
function y(e, t) {
|
|
@@ -9,45 +9,52 @@ function y(e, t) {
|
|
|
9
9
|
return { node: e, changed: !1 };
|
|
10
10
|
t.lastIndex = 0;
|
|
11
11
|
const n = [];
|
|
12
|
-
let s = 0,
|
|
13
|
-
for (;
|
|
14
|
-
const r =
|
|
15
|
-
r > s && n.push(e.slice(s, r)), n.push(/* @__PURE__ */ u("mark", { children:
|
|
12
|
+
let s = 0, a;
|
|
13
|
+
for (; a = t.exec(e); ) {
|
|
14
|
+
const r = a.index, c = r + a[0].length;
|
|
15
|
+
r > s && n.push(e.slice(s, r)), n.push(/* @__PURE__ */ u("mark", { children: a[0] }, n.length)), s = c;
|
|
16
16
|
}
|
|
17
17
|
return s < e.length && n.push(e.slice(s)), { node: n.length === 1 ? n[0] : n, changed: !0 };
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function l(e, t) {
|
|
20
20
|
if (typeof e == "string")
|
|
21
21
|
return y(e, t);
|
|
22
|
+
if (Array.isArray(e)) {
|
|
23
|
+
let n = !1;
|
|
24
|
+
return { node: e.map((a) => {
|
|
25
|
+
const r = l(a, t);
|
|
26
|
+
return r.changed && (n = !0), r.node;
|
|
27
|
+
}), changed: n };
|
|
28
|
+
}
|
|
22
29
|
if (d(e)) {
|
|
23
30
|
const n = e, s = typeof n.type == "string" ? n.type : void 0;
|
|
24
|
-
if (s &&
|
|
25
|
-
let
|
|
31
|
+
if (s && m.has(s)) return { node: e, changed: !1 };
|
|
32
|
+
let a = !1;
|
|
26
33
|
const r = f.Children.map(n.props.children, (o) => {
|
|
27
|
-
const
|
|
28
|
-
return
|
|
34
|
+
const i = l(o, t);
|
|
35
|
+
return i.changed && (a = !0), i.node;
|
|
29
36
|
});
|
|
30
|
-
if (!
|
|
37
|
+
if (!a)
|
|
31
38
|
return { node: e, changed: !1 };
|
|
32
|
-
const
|
|
33
|
-
return { node:
|
|
39
|
+
const c = r && r.length === 1 ? r[0] : r;
|
|
40
|
+
return { node: h(n, { children: c }), changed: !0 };
|
|
34
41
|
}
|
|
35
42
|
return { node: e, changed: !1 };
|
|
36
43
|
}
|
|
37
|
-
function
|
|
44
|
+
function A(e, t) {
|
|
38
45
|
return p(() => {
|
|
39
46
|
if (!e || !(t != null && t.length)) return e;
|
|
40
47
|
const n = Array.from(
|
|
41
48
|
new Set(
|
|
42
|
-
t.map((r) => r.trim()).filter(Boolean).map(
|
|
49
|
+
t.map((r) => r.trim()).filter(Boolean).map(g)
|
|
43
50
|
)
|
|
44
51
|
);
|
|
45
52
|
if (n.length === 0) return e;
|
|
46
|
-
n.sort((r,
|
|
47
|
-
const s = new RegExp(`(${n.join("|")})`, "gi"), { node:
|
|
48
|
-
return
|
|
53
|
+
n.sort((r, c) => c.length - r.length);
|
|
54
|
+
const s = new RegExp(`(${n.join("|")})`, "gi"), { node: a } = l(e, s);
|
|
55
|
+
return a;
|
|
49
56
|
}, [e, t]);
|
|
50
57
|
}
|
|
51
58
|
export {
|
|
52
|
-
|
|
59
|
+
A as useHighlightedText
|
|
53
60
|
};
|