@altinn/altinn-components 0.41.4 → 0.41.5
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/MenuOption.css +1 -1
- package/dist/components/Menu/MenuItem.js +47 -46
- package/dist/components/Menu/MenuItemLabel.js +36 -42
- package/dist/components/Menu/MenuOption.js +46 -46
- package/dist/components/Settings/SettingsItem.js +46 -29
- package/dist/components/Toolbar/ToolbarOptions.js +9 -9
- package/dist/components/Typography/Heading.js +30 -28
- package/dist/types/lib/components/Menu/MenuItem.d.ts +1 -1
- package/dist/types/lib/components/Menu/MenuItemLabel.d.ts +2 -3
- package/dist/types/lib/components/Menu/MenuOption.d.ts +3 -3
- package/dist/types/lib/components/Settings/SettingsItem.d.ts +6 -1
- package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +2 -1
- package/dist/types/lib/components/Settings/SettingsModal.stories.d.ts +9 -1
- package/dist/types/lib/components/Toolbar/ToolbarFilter.stories.d.ts +1 -3
- package/dist/types/lib/components/Typography/Heading.d.ts +3 -2
- package/dist/types/lib/components/Typography/Heading.stories.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._label_sfsij_1{flex-grow:1;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 .125rem;font-size:1rem;column-gap:.5em;pointer-events:none}._title_sfsij_13{color:var(--ds-color-text-default);display:inline-flex;align-items:center;column-gap:.5em}._count_sfsij_20{vertical-align:super;font-size:smaller}._radio_sfsij_25,._checkbox_sfsij_26{flex-shrink:0;flex-grow:0;position:relative;width:1.25em;height:1.25em;display:flex;align-items:center;justify-content:center;color:transparent}._radio_sfsij_25{border:1px solid;border-color:var(--ds-color-border-subtle);outline:var(--ds-color-border-subtle) solid 1px;border-radius:50%}._checkbox_sfsij_26{border:2px solid;border-color:var(--ds-color-border-subtle);border-radius:2px}._radio_sfsij_25[data-checked=true],._checkbox_sfsij_26[data-checked=true]{background-color:var(--ds-color-base-default);border:none;outline-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._icon_sfsij_59{font-size:1.25em}@supports (-webkit-hyphens: none){._icon_sfsij_59{font-size:unset;width:1.25em;height:1.25em}._icon_sfsij_59 svg,._icon_sfsij_59 img{width:100%;height:100%}}
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as C } from "react";
|
|
3
|
+
import { Icon as N } from "../Icon/Icon.js";
|
|
3
4
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import "
|
|
5
|
+
import { Badge as d } from "../Badge/Badge.js";
|
|
5
6
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { MenuItemBase as
|
|
7
|
-
import { MenuItemLabel as
|
|
8
|
-
import { MenuItemIcon as
|
|
7
|
+
import { MenuItemBase as q } from "./MenuItemBase.js";
|
|
8
|
+
import { MenuItemLabel as x } from "./MenuItemLabel.js";
|
|
9
|
+
import { MenuItemIcon as E } from "./MenuItemIcon.js";
|
|
9
10
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/MenuItem.css';const
|
|
13
|
-
controls:
|
|
14
|
-
linkIcon:
|
|
15
|
-
},
|
|
16
|
-
as:
|
|
11
|
+
import { S as L, a as b } from "../../ChevronUp-_BBfEirx.js";
|
|
12
|
+
import { S as D } from "../../ChevronRight-ANFWmIs1.js";
|
|
13
|
+
import '../../assets/MenuItem.css';const R = "_controls_w98qm_46", U = "_linkIcon_w98qm_59", m = {
|
|
14
|
+
controls: R,
|
|
15
|
+
linkIcon: U
|
|
16
|
+
}, X = ({
|
|
17
|
+
as: l = "a",
|
|
17
18
|
size: t = "md",
|
|
18
19
|
color: p,
|
|
19
|
-
variant:
|
|
20
|
+
variant: f,
|
|
20
21
|
collapsible: a,
|
|
21
|
-
expanded:
|
|
22
|
+
expanded: c,
|
|
22
23
|
icon: I,
|
|
23
|
-
iconTheme:
|
|
24
|
-
iconBadge:
|
|
24
|
+
iconTheme: h,
|
|
25
|
+
iconBadge: u,
|
|
25
26
|
title: v,
|
|
26
|
-
description:
|
|
27
|
-
highlightWords:
|
|
28
|
-
badge:
|
|
29
|
-
controls:
|
|
30
|
-
loading:
|
|
31
|
-
linkIcon:
|
|
32
|
-
label:
|
|
27
|
+
description: S,
|
|
28
|
+
highlightWords: _,
|
|
29
|
+
badge: o,
|
|
30
|
+
controls: k,
|
|
31
|
+
loading: r,
|
|
32
|
+
linkIcon: y,
|
|
33
|
+
label: e,
|
|
33
34
|
ariaLabel: M,
|
|
34
|
-
...
|
|
35
|
+
...j
|
|
35
36
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
|
|
37
|
+
const w = typeof e == "function" ? e() : e, s = a ? c ? L : b : y ? D : void 0, B = () => o && !r && typeof o == "object" && "label" in o ? /* @__PURE__ */ n(d, { ...o, className: m.badge }) : C(o) ? o : null;
|
|
38
|
+
return /* @__PURE__ */ i(
|
|
39
|
+
q,
|
|
39
40
|
{
|
|
40
|
-
as:
|
|
41
|
+
as: l,
|
|
41
42
|
size: t,
|
|
42
|
-
variant:
|
|
43
|
+
variant: f,
|
|
43
44
|
color: p,
|
|
44
|
-
expanded:
|
|
45
|
+
expanded: c,
|
|
45
46
|
ariaLabel: M,
|
|
46
|
-
hidden:
|
|
47
|
-
...
|
|
47
|
+
hidden: r,
|
|
48
|
+
...j,
|
|
48
49
|
children: [
|
|
49
|
-
/* @__PURE__ */ n(
|
|
50
|
+
/* @__PURE__ */ n(E, { loading: r, size: t, icon: I, theme: h, badge: u }),
|
|
50
51
|
/* @__PURE__ */ n(
|
|
51
|
-
|
|
52
|
+
x,
|
|
52
53
|
{
|
|
53
|
-
loading:
|
|
54
|
+
loading: r,
|
|
54
55
|
title: v,
|
|
55
|
-
description:
|
|
56
|
-
highlightWords:
|
|
56
|
+
description: S,
|
|
57
|
+
highlightWords: _,
|
|
57
58
|
size: t,
|
|
58
|
-
|
|
59
|
-
children: g
|
|
59
|
+
children: w
|
|
60
60
|
}
|
|
61
61
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
!
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
/* @__PURE__ */ i("span", { className: m.controls, children: [
|
|
63
|
+
!r && k,
|
|
64
|
+
!r && B(),
|
|
65
|
+
s && /* @__PURE__ */ n("span", { className: m.linkIcon, children: /* @__PURE__ */ n(
|
|
66
|
+
N,
|
|
66
67
|
{
|
|
67
|
-
svgElement:
|
|
68
|
+
svgElement: s,
|
|
68
69
|
style: {
|
|
69
70
|
fontSize: "1.5rem"
|
|
70
71
|
}
|
|
@@ -76,5 +77,5 @@ import '../../assets/MenuItem.css';const N = "_controls_w98qm_46", B = "_linkIco
|
|
|
76
77
|
);
|
|
77
78
|
};
|
|
78
79
|
export {
|
|
79
|
-
|
|
80
|
+
X as MenuItem
|
|
80
81
|
};
|
|
@@ -1,81 +1,75 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as s, jsxs as g, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "../../index-L8X2o7IH.js";
|
|
3
3
|
import { isValidElement as x } from "react";
|
|
4
|
-
import { Heading as
|
|
5
|
-
import { Badge as _ } from "../Badge/Badge.js";
|
|
4
|
+
import { Heading as c } from "../Typography/Heading.js";
|
|
6
5
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { isHeadingProps as
|
|
6
|
+
import { isHeadingProps as o } from "../List/ListItemLabel.js";
|
|
8
7
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import '../../assets/MenuItemLabel.css';const
|
|
10
|
-
label:
|
|
11
|
-
title:
|
|
8
|
+
import '../../assets/MenuItemLabel.css';const h = "_label_1gf5h_1", _ = "_title_1gf5h_22", p = {
|
|
9
|
+
label: h,
|
|
10
|
+
title: _
|
|
12
11
|
};
|
|
13
|
-
function
|
|
12
|
+
function u(r) {
|
|
14
13
|
return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null || x(r);
|
|
15
14
|
}
|
|
16
|
-
const
|
|
15
|
+
const y = (r) => {
|
|
17
16
|
const n = {
|
|
18
17
|
as: "span"
|
|
19
18
|
};
|
|
20
|
-
return
|
|
19
|
+
return o(r) ? { ...n, ...r } : u(r) ? {
|
|
21
20
|
...n,
|
|
22
21
|
children: r
|
|
23
22
|
} : null;
|
|
24
|
-
},
|
|
23
|
+
}, P = (r) => {
|
|
25
24
|
const n = {
|
|
26
25
|
as: "span",
|
|
27
26
|
weight: "normal",
|
|
28
27
|
variant: "subtle"
|
|
29
28
|
};
|
|
30
|
-
return
|
|
29
|
+
return o(r) ? { ...n, ...r } : u(r) ? {
|
|
31
30
|
...n,
|
|
32
31
|
children: r
|
|
33
32
|
} : null;
|
|
34
33
|
};
|
|
35
|
-
function
|
|
34
|
+
function z(r) {
|
|
36
35
|
if (typeof r == "string")
|
|
37
36
|
return r;
|
|
38
|
-
if (
|
|
37
|
+
if (o(r))
|
|
39
38
|
return r.children;
|
|
40
39
|
}
|
|
41
|
-
const
|
|
40
|
+
const A = ({
|
|
42
41
|
className: r,
|
|
43
42
|
size: n = "sm",
|
|
44
|
-
title:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
loading: c,
|
|
43
|
+
title: a,
|
|
44
|
+
description: i,
|
|
45
|
+
highlightWords: l,
|
|
46
|
+
loading: m,
|
|
49
47
|
children: f
|
|
50
48
|
}) => {
|
|
51
|
-
const
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
const t = a && y(a), e = i && P(i);
|
|
50
|
+
return /* @__PURE__ */ s("span", { className: d(p.label, r), "data-size": n, children: f || /* @__PURE__ */ g(b, { children: [
|
|
51
|
+
t && /* @__PURE__ */ s(
|
|
52
|
+
c,
|
|
55
53
|
{
|
|
56
|
-
...
|
|
57
|
-
loading:
|
|
58
|
-
highlightWords:
|
|
59
|
-
className:
|
|
60
|
-
weight:
|
|
61
|
-
children: [
|
|
62
|
-
/* @__PURE__ */ t("span", { children: e.children }),
|
|
63
|
-
l && /* @__PURE__ */ t(_, { ...l })
|
|
64
|
-
]
|
|
54
|
+
...t,
|
|
55
|
+
loading: m,
|
|
56
|
+
highlightWords: l,
|
|
57
|
+
className: p.title,
|
|
58
|
+
weight: t != null && t.weight || n === "lg" ? "medium" : "normal"
|
|
65
59
|
}
|
|
66
60
|
),
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
e && /* @__PURE__ */ s(
|
|
62
|
+
c,
|
|
69
63
|
{
|
|
70
|
-
...
|
|
71
|
-
loading:
|
|
72
|
-
highlightWords:
|
|
73
|
-
size:
|
|
64
|
+
...e,
|
|
65
|
+
loading: m,
|
|
66
|
+
highlightWords: l,
|
|
67
|
+
size: e.size || n === "lg" ? "xs" : "xxs"
|
|
74
68
|
}
|
|
75
69
|
)
|
|
76
70
|
] }) });
|
|
77
71
|
};
|
|
78
72
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
A as MenuItemLabel,
|
|
74
|
+
z as getAriaLabelFromTitle
|
|
81
75
|
};
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { Badge as p } from "../Badge/Badge.js";
|
|
5
4
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { MenuItem as
|
|
5
|
+
import { MenuItem as _ } from "./MenuItem.js";
|
|
7
6
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { S as
|
|
9
|
-
import '../../assets/MenuOption.css';const
|
|
10
|
-
label:
|
|
11
|
-
title:
|
|
7
|
+
import { S as p } from "../../Checkmark-Byz_C9x4.js";
|
|
8
|
+
import '../../assets/MenuOption.css';const N = "_label_sfsij_1", j = "_title_sfsij_13", k = "_count_sfsij_20", v = "_radio_sfsij_25", I = "_checkbox_sfsij_26", M = "_icon_sfsij_59", a = {
|
|
9
|
+
label: N,
|
|
10
|
+
title: j,
|
|
11
|
+
count: k,
|
|
12
12
|
radio: v,
|
|
13
13
|
checkbox: I,
|
|
14
14
|
icon: M
|
|
15
|
-
},
|
|
16
|
-
size:
|
|
17
|
-
type:
|
|
18
|
-
name:
|
|
19
|
-
active:
|
|
20
|
-
value:
|
|
21
|
-
label:
|
|
22
|
-
title:
|
|
15
|
+
}, C = ({
|
|
16
|
+
size: t = "md",
|
|
17
|
+
type: h,
|
|
18
|
+
name: S,
|
|
19
|
+
active: i,
|
|
20
|
+
value: g,
|
|
21
|
+
label: n,
|
|
22
|
+
title: u,
|
|
23
23
|
description: b,
|
|
24
|
-
icon:
|
|
25
|
-
|
|
26
|
-
checked:
|
|
27
|
-
disabled:
|
|
24
|
+
icon: f,
|
|
25
|
+
count: e = 0,
|
|
26
|
+
checked: c = !1,
|
|
27
|
+
disabled: o,
|
|
28
28
|
onMouseEnter: w,
|
|
29
|
-
onClick:
|
|
29
|
+
onClick: r,
|
|
30
30
|
role: l,
|
|
31
31
|
...m
|
|
32
32
|
}) => {
|
|
33
|
-
const
|
|
34
|
-
switch (
|
|
33
|
+
const x = () => {
|
|
34
|
+
switch (h) {
|
|
35
35
|
case "checkbox":
|
|
36
36
|
return /* @__PURE__ */ d("span", { className: a.label, children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ s("span", { className: a.checkbox, "data-checked": c, children: /* @__PURE__ */ s(p, { className: a.icon, "aria-hidden": !0 }) }),
|
|
38
|
+
/* @__PURE__ */ s("span", { className: a.title, children: n }),
|
|
39
|
+
e > 0 && /* @__PURE__ */ s("span", { className: a.count, children: e })
|
|
39
40
|
] });
|
|
40
41
|
case "radio":
|
|
41
42
|
return /* @__PURE__ */ d("span", { className: a.label, children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ s("span", { className: a.radio, "data-checked": c, children: /* @__PURE__ */ s(p, { className: a.icon, "aria-hidden": !0 }) }),
|
|
44
|
+
/* @__PURE__ */ s("span", { className: a.title, children: n }),
|
|
45
|
+
e > 0 && /* @__PURE__ */ s("span", { className: a.count, children: e })
|
|
44
46
|
] });
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
+
return n ? /* @__PURE__ */ s(
|
|
50
|
+
_,
|
|
49
51
|
{
|
|
50
|
-
disabled:
|
|
51
|
-
selected:
|
|
52
|
-
size:
|
|
52
|
+
disabled: o,
|
|
53
|
+
selected: c,
|
|
54
|
+
size: t,
|
|
53
55
|
as: "div",
|
|
54
|
-
active:
|
|
56
|
+
active: i,
|
|
55
57
|
tabIndex: -1,
|
|
56
|
-
onClick:
|
|
58
|
+
onClick: r,
|
|
57
59
|
role: l,
|
|
58
|
-
label: /* @__PURE__ */
|
|
59
|
-
controls: s && /* @__PURE__ */ e(p, { ...s }),
|
|
60
|
+
label: /* @__PURE__ */ s(x, {}),
|
|
60
61
|
...m
|
|
61
62
|
}
|
|
62
|
-
) : /* @__PURE__ */
|
|
63
|
-
|
|
63
|
+
) : /* @__PURE__ */ s(
|
|
64
|
+
_,
|
|
64
65
|
{
|
|
65
|
-
disabled:
|
|
66
|
-
selected:
|
|
67
|
-
size:
|
|
66
|
+
disabled: o,
|
|
67
|
+
selected: c,
|
|
68
|
+
size: t,
|
|
68
69
|
as: "div",
|
|
69
|
-
active:
|
|
70
|
+
active: i,
|
|
70
71
|
tabIndex: -1,
|
|
71
|
-
onClick:
|
|
72
|
+
onClick: r,
|
|
72
73
|
role: l,
|
|
73
|
-
icon:
|
|
74
|
-
title:
|
|
74
|
+
icon: f,
|
|
75
|
+
title: u,
|
|
75
76
|
description: b,
|
|
76
|
-
controls: s && /* @__PURE__ */ e(p, { ...s }),
|
|
77
77
|
...m
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
};
|
|
81
81
|
export {
|
|
82
|
-
|
|
82
|
+
C as MenuOption
|
|
83
83
|
};
|
|
@@ -1,54 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as b } from "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
5
|
import "../Snackbar/useSnackbar.js";
|
|
6
|
-
import { Input as
|
|
7
|
-
import { SettingsItemBase as
|
|
8
|
-
import { SettingsModal as
|
|
9
|
-
const
|
|
10
|
-
loading:
|
|
11
|
-
variant:
|
|
12
|
-
id:
|
|
13
|
-
name:
|
|
14
|
-
checked:
|
|
15
|
-
onChange:
|
|
16
|
-
|
|
6
|
+
import { Input as x } from "../Forms/Input.js";
|
|
7
|
+
import { SettingsItemBase as n } from "./SettingsItemBase.js";
|
|
8
|
+
import { SettingsModal as I } from "./SettingsModal.js";
|
|
9
|
+
const M = ({
|
|
10
|
+
loading: u,
|
|
11
|
+
variant: f = "default",
|
|
12
|
+
id: c = "settings",
|
|
13
|
+
name: m,
|
|
14
|
+
checked: g,
|
|
15
|
+
onChange: h,
|
|
16
|
+
modalProps: e,
|
|
17
|
+
children: v,
|
|
17
18
|
...t
|
|
18
19
|
}) => {
|
|
19
|
-
const [
|
|
20
|
-
if (
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
switch (
|
|
20
|
+
const [l, a] = b(!1);
|
|
21
|
+
if (u)
|
|
22
|
+
return /* @__PURE__ */ i(n, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, loading: !0 });
|
|
23
|
+
switch (f) {
|
|
23
24
|
case "switch":
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
25
|
+
return /* @__PURE__ */ i(
|
|
26
|
+
n,
|
|
26
27
|
{
|
|
27
28
|
...t,
|
|
28
|
-
title:
|
|
29
|
+
title: {
|
|
30
|
+
id: c,
|
|
31
|
+
as: "label",
|
|
32
|
+
children: [t == null ? void 0 : t.title, t == null ? void 0 : t.value].join(": ")
|
|
33
|
+
},
|
|
29
34
|
value: void 0,
|
|
30
35
|
interactive: !1,
|
|
31
|
-
controls: /* @__PURE__ */
|
|
32
|
-
|
|
36
|
+
controls: /* @__PURE__ */ i(
|
|
37
|
+
x,
|
|
33
38
|
{
|
|
34
39
|
type: "checkbox",
|
|
35
40
|
role: "switch",
|
|
36
|
-
"aria-labelledby":
|
|
37
|
-
name:
|
|
41
|
+
"aria-labelledby": c,
|
|
42
|
+
name: m,
|
|
38
43
|
value: t == null ? void 0 : t.value,
|
|
39
|
-
checked:
|
|
40
|
-
onChange:
|
|
44
|
+
checked: g,
|
|
45
|
+
onChange: h,
|
|
41
46
|
style: { marginRight: "0.5em" }
|
|
42
47
|
}
|
|
43
48
|
)
|
|
44
49
|
}
|
|
45
50
|
);
|
|
46
51
|
case "modal":
|
|
47
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ i(
|
|
53
|
+
n,
|
|
54
|
+
{
|
|
55
|
+
...t,
|
|
56
|
+
title: (e == null ? void 0 : e.title) || (t == null ? void 0 : t.title),
|
|
57
|
+
description: e == null ? void 0 : e.description,
|
|
58
|
+
as: "button",
|
|
59
|
+
linkIcon: !0,
|
|
60
|
+
onClick: () => a(!0),
|
|
61
|
+
expanded: l,
|
|
62
|
+
children: l && /* @__PURE__ */ i(I, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, open: l, onClose: () => a(!1), children: v })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
48
65
|
default:
|
|
49
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ i(n, { ...t });
|
|
50
67
|
}
|
|
51
68
|
};
|
|
52
69
|
export {
|
|
53
|
-
|
|
70
|
+
M as SettingsItem
|
|
54
71
|
};
|
|
@@ -10,23 +10,23 @@ import { MenuHeader as w } from "../Menu/MenuHeader.js";
|
|
|
10
10
|
import { MenuBase as z, MenuList as D, MenuListItem as m } from "../Menu/MenuBase.js";
|
|
11
11
|
const G = ({
|
|
12
12
|
name: k,
|
|
13
|
-
search:
|
|
14
|
-
optionGroups:
|
|
13
|
+
search: c,
|
|
14
|
+
optionGroups: s = {},
|
|
15
15
|
options: I,
|
|
16
16
|
onChange: n,
|
|
17
17
|
optionType: L,
|
|
18
18
|
keyboardEvents: p,
|
|
19
19
|
onBlurCapture: T
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
21
|
+
const a = K(null), { menu: j, setActiveIndex: B } = R({
|
|
22
22
|
items: I,
|
|
23
|
-
groups:
|
|
23
|
+
groups: s,
|
|
24
24
|
groupByKey: "groupId",
|
|
25
25
|
keyboardEvents: p,
|
|
26
|
-
ref:
|
|
26
|
+
ref: a
|
|
27
27
|
});
|
|
28
|
-
return /* @__PURE__ */ v(z, { variant: "default", ref:
|
|
29
|
-
|
|
28
|
+
return /* @__PURE__ */ v(z, { variant: "default", ref: a, children: [
|
|
29
|
+
c && /* @__PURE__ */ e(q, { ...c }),
|
|
30
30
|
/* @__PURE__ */ e(D, { role: "menu", onBlurCapture: T, children: j.map((t, l) => {
|
|
31
31
|
const O = (t == null ? void 0 : t.props) || {}, { title: d, divider: P = !0 } = O;
|
|
32
32
|
return /* @__PURE__ */ v(N, { children: [
|
|
@@ -37,7 +37,7 @@ const G = ({
|
|
|
37
37
|
return !((i = o.props) != null && i.hidden);
|
|
38
38
|
}).map((o, i) => {
|
|
39
39
|
var h;
|
|
40
|
-
const { active: A, onMouseEnter: F } = o, { groupId: u, onClick: E, value: f, checked: M, type: b, ...r } = o.props || {}, { expanded: H } = r, x = r.name || k, y = b || u && ((h =
|
|
40
|
+
const { active: A, onMouseEnter: F } = o, { groupId: u, onClick: E, value: f, checked: M, type: b, ...r } = o.props || {}, { expanded: H } = r, x = r.name || k, y = b || u && ((h = s[u]) == null ? void 0 : h.optionType) || L;
|
|
41
41
|
return /* @__PURE__ */ e(
|
|
42
42
|
m,
|
|
43
43
|
{
|
|
@@ -53,7 +53,7 @@ const G = ({
|
|
|
53
53
|
active: A,
|
|
54
54
|
tabIndex: p ? -1 : 0,
|
|
55
55
|
label: r.label,
|
|
56
|
-
|
|
56
|
+
count: r.count,
|
|
57
57
|
name: x,
|
|
58
58
|
type: y,
|
|
59
59
|
value: f,
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as f } from "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { useHighlightedText as
|
|
5
|
+
import { Skeleton as u } from "../Skeleton/Skeleton.js";
|
|
6
|
+
import { useHighlightedText as H } from "./useHighlightedText.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import '../../assets/Heading.css';const
|
|
10
|
-
heading:
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import '../../assets/Heading.css';const _ = "_heading_1dyne_1", w = {
|
|
10
|
+
heading: _
|
|
11
|
+
}, b = ({
|
|
12
|
+
id: e,
|
|
13
|
+
loading: i,
|
|
14
|
+
highlightWords: o = [],
|
|
15
|
+
as: n = "h2",
|
|
15
16
|
size: t,
|
|
16
|
-
leading:
|
|
17
|
-
weight:
|
|
18
|
-
color:
|
|
19
|
-
variant:
|
|
20
|
-
maxRows:
|
|
21
|
-
className:
|
|
22
|
-
style:
|
|
23
|
-
children:
|
|
17
|
+
leading: r = "tight",
|
|
18
|
+
weight: d = "medium",
|
|
19
|
+
color: m,
|
|
20
|
+
variant: s,
|
|
21
|
+
maxRows: c,
|
|
22
|
+
className: h,
|
|
23
|
+
style: g,
|
|
24
|
+
children: l
|
|
24
25
|
}) => {
|
|
25
|
-
const
|
|
26
|
+
const p = n, x = H(l, o || []);
|
|
26
27
|
return /* @__PURE__ */ a(
|
|
27
|
-
|
|
28
|
+
p,
|
|
28
29
|
{
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
id: e,
|
|
31
|
+
className: f(w.heading, h),
|
|
32
|
+
style: g,
|
|
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: /* @__PURE__ */ a(
|
|
34
|
+
"data-leading": r,
|
|
35
|
+
"data-weight": d,
|
|
36
|
+
"data-color": m,
|
|
37
|
+
"data-variant": t === "xxs" && "default" || s,
|
|
38
|
+
"data-max-rows": c,
|
|
39
|
+
children: /* @__PURE__ */ a(u, { loading: i, children: x })
|
|
38
40
|
}
|
|
39
41
|
);
|
|
40
42
|
};
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
b as Heading
|
|
43
45
|
};
|
|
@@ -15,7 +15,7 @@ export interface MenuItemProps extends MenuItemBaseProps {
|
|
|
15
15
|
icon?: MenuItemIconProps['icon'];
|
|
16
16
|
iconTheme?: MenuItemIconProps['theme'];
|
|
17
17
|
iconBadge?: MenuItemIconProps['badge'];
|
|
18
|
-
badge?: BadgeProps | undefined;
|
|
18
|
+
badge?: BadgeProps | ReactNode | undefined;
|
|
19
19
|
/** Custom controls */
|
|
20
20
|
controls?: ReactNode;
|
|
21
21
|
linkIcon?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { HeadingProps } from '..';
|
|
3
3
|
import { MenuItemSize } from './MenuItemBase';
|
|
4
4
|
export interface MenuItemLabelProps {
|
|
5
5
|
className?: string;
|
|
@@ -9,8 +9,7 @@ export interface MenuItemLabelProps {
|
|
|
9
9
|
highlightWords?: string[];
|
|
10
10
|
title?: HeadingProps | ReactNode | string;
|
|
11
11
|
description?: HeadingProps | ReactNode | string;
|
|
12
|
-
badge?: BadgeProps;
|
|
13
12
|
children?: ReactNode;
|
|
14
13
|
}
|
|
15
14
|
export declare function getAriaLabelFromTitle(title: HeadingProps | ReactNode | string): string | undefined;
|
|
16
|
-
export declare const MenuItemLabel: ({ className, size, title,
|
|
15
|
+
export declare const MenuItemLabel: ({ className, size, title, description, highlightWords, loading, children, }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MenuItemProps } from '..';
|
|
2
2
|
import { MenuItemBaseProps, MenuItemSize } from './MenuItemBase';
|
|
3
3
|
export type MenuOptionType = 'checkbox' | 'radio';
|
|
4
4
|
export interface MenuOptionProps extends MenuItemBaseProps {
|
|
@@ -10,11 +10,11 @@ export interface MenuOptionProps extends MenuItemBaseProps {
|
|
|
10
10
|
groupId?: string;
|
|
11
11
|
size?: MenuItemSize;
|
|
12
12
|
name?: string;
|
|
13
|
-
|
|
13
|
+
count?: number;
|
|
14
14
|
checked?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
type?: MenuOptionType;
|
|
17
17
|
hidden?: boolean;
|
|
18
18
|
role?: string;
|
|
19
19
|
}
|
|
20
|
-
export declare const MenuOption: ({ size, type, name, active, value, label, title, description, icon,
|
|
20
|
+
export declare const MenuOption: ({ size, type, name, active, value, label, title, description, icon, count, checked, disabled, onMouseEnter, onClick, role, ...rest }: MenuOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { InputProps, SettingsItemBaseProps } from '..';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export type SettingsItemVariant = 'default' | 'modal' | 'switch';
|
|
4
|
+
export interface SettingsItemModalProps {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
4
8
|
export interface SettingsItemProps extends SettingsItemBaseProps {
|
|
5
9
|
variant?: SettingsItemVariant;
|
|
6
10
|
id: string;
|
|
@@ -10,6 +14,7 @@ export interface SettingsItemProps extends SettingsItemBaseProps {
|
|
|
10
14
|
name?: InputProps['name'];
|
|
11
15
|
checked?: InputProps['checked'];
|
|
12
16
|
onChange?: InputProps['onChange'];
|
|
17
|
+
modalProps?: SettingsItemModalProps;
|
|
13
18
|
children?: ReactNode;
|
|
14
19
|
}
|
|
15
|
-
export declare const SettingsItem: ({ loading, variant, id, name, checked, onChange, children, ...props }: SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const SettingsItem: ({ loading, variant, id, name, checked, onChange, modalProps, children, ...props }: SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ loading, variant, id, name, checked, onChange, children, ...props }: import('./SettingsItem').SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ loading, variant, id, name, checked, onChange, modalProps, children, ...props }: import('./SettingsItem').SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: {
|
|
@@ -19,6 +19,7 @@ declare const meta: {
|
|
|
19
19
|
name?: string | undefined;
|
|
20
20
|
checked?: boolean | undefined;
|
|
21
21
|
onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
22
|
+
modalProps?: import('./SettingsItem').SettingsItemModalProps | undefined;
|
|
22
23
|
children?: React.ReactNode;
|
|
23
24
|
groupId?: string | undefined;
|
|
24
25
|
collapsible?: boolean | undefined;
|
|
@@ -28,9 +28,17 @@ export interface AccountAlertsModalProps extends SettingsModalProps {
|
|
|
28
28
|
emailLabel?: string;
|
|
29
29
|
smsAlerts?: boolean;
|
|
30
30
|
emailAlerts?: boolean;
|
|
31
|
+
readOnly?: boolean;
|
|
31
32
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
32
33
|
}
|
|
33
|
-
export declare const AccountAlertsModal: ({ open, onClose, icon, title, description, phone, phoneLabel, email, emailLabel, smsAlerts, emailAlerts, onChange, }: AccountAlertsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const AccountAlertsModal: ({ open, onClose, icon, title, description, phone, phoneLabel, email, emailLabel, smsAlerts, emailAlerts, readOnly, onChange, }: AccountAlertsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const UserAccountAlertsModal: ({ open, onClose, phone, email, ...props }: {
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
open?: boolean | undefined;
|
|
38
|
+
onClose?: (() => void) | undefined;
|
|
39
|
+
phone?: string | undefined;
|
|
40
|
+
email?: string | undefined;
|
|
41
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
34
42
|
interface AccountGroupsModalProps extends SettingsModalProps {
|
|
35
43
|
items?: AccountListItemProps[];
|
|
36
44
|
}
|
|
@@ -3,8 +3,9 @@ import { TypographyProps } from '..';
|
|
|
3
3
|
export type HeadingSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'inherit';
|
|
4
4
|
export type HeadingWeight = 'normal' | 'medium' | 'bold';
|
|
5
5
|
export type HeadingLeading = 'none' | 'tight' | 'normal';
|
|
6
|
-
export type HeadingComponent = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
|
|
6
|
+
export type HeadingComponent = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span' | 'label';
|
|
7
7
|
export interface HeadingProps {
|
|
8
|
+
id?: string;
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
highlightWords?: string[];
|
|
10
11
|
as?: HeadingComponent;
|
|
@@ -18,4 +19,4 @@ export interface HeadingProps {
|
|
|
18
19
|
style?: CSSProperties;
|
|
19
20
|
children?: ReactNode;
|
|
20
21
|
}
|
|
21
|
-
export declare const Heading: ({ loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const Heading: ({ id, loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: import('./Heading').HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
component: ({ id, loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: import('./Heading').HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
parameters: {};
|
|
7
7
|
args: {
|