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