@altinn/altinn-components 0.35.7 → 0.35.9
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/ListItemHeader.css +1 -1
- package/dist/assets/ListItemIcon.css +1 -1
- package/dist/assets/MenuItemBase.css +1 -1
- package/dist/assets/MenuItemsVirtual.css +1 -1
- package/dist/assets/SearchField.css +1 -1
- package/dist/assets/SearchbarField.css +1 -1
- package/dist/components/Forms/SearchField.js +33 -23
- package/dist/components/List/ListItemHeader.js +71 -67
- package/dist/components/List/ListItemIcon.js +9 -9
- package/dist/components/List/ListItemLink.js +33 -31
- package/dist/components/Menu/MenuItemBase.js +15 -15
- package/dist/components/Menu/MenuItemsVirtual.js +5 -5
- package/dist/components/Searchbar/Searchbar.js +29 -16
- package/dist/components/Searchbar/SearchbarBase.js +24 -9
- package/dist/components/Searchbar/SearchbarField.js +38 -36
- package/dist/types/lib/components/Account/AccountMenu.stories.d.ts +1 -0
- package/dist/types/lib/components/List/ListItemLink.d.ts +1 -1
- package/dist/types/lib/components/Searchbar/SearchbarBase.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_1689z_1{--dsc-item-spacing: .5em;position:relative;width:100%;min-height:var(--dsc-item-height);display:flex;align-items:center;justify-content:start;background:var(--dsc-item-background);column-gap:var(--dsc-item-spacing);padding-right:var(--dsc-item-px);padding-left:var(--dsc-item-px)}._header_1689z_1[data-interactive=true]{cursor:pointer}._header_1689z_1[data-interactive=true]:hover{background:var(--dsc-item-background--hover)}._header_1689z_1[data-interactive=true]:hover ._label_1689z_27 h2{text-decoration:underline}._header_1689z_1[data-has-active-child=true]{background-color:var(--ds-color-background-tinted)}._label_1689z_27{flex-grow:1}._link_1689z_39{outline:none}._badge_1689z_43{pointer-events:none}._linkIcon_1689z_47{flex-shrink:0;min-width:2em;min-height:2em;display:flex;align-items:center;justify-content:center;pointer-events:none}._linkFocus_1689z_57{position:absolute;top:0;left:0;right:0;bottom:0}._link_1689z_39:focus-visible ._linkFocus_1689z_57{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._link_1689z_39:focus-visible ._linkFocus_1689z_57 *{--_ds--focus: }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._wrapper_rcjve_1{pointer-events:none;position:relative;flex-shrink:0;font-size:2em;display:flex;align-items:center;justify-content:center}._icon_rcjve_11 svg,._icon_rcjve_11 img{display:block;width:1em;height:1em;font-size:.825em}._avatar_rcjve_19{font-size:1em}._avatarGroup_rcjve_23{font-size:.75em}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._item_1itcj_1{font:inherit;color:inherit;padding:0;border:0;text-align:inherit;text-decoration:none;line-height:normal;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;cursor:pointer;position:relative;width:100%;display:flex;align-items:center;column-gap:.25rem;margin:.5rem 0;border-radius:2px}._item_1itcj_1[aria-disabled=true]{opacity:.5;pointer-events:none}._item_1itcj_1[data-size=md]{min-height:56px}._item_1itcj_1[data-size=md]{min-height:44px}._item_1itcj_1[data-size=sm]{min-height:40px}._content_1itcj_45{display:flex;width:100%;align-items:center;column-gap:6px;padding:6px}._item_1itcj_1,._item_1itcj_1[data-theme]{background-color:transparent}._item_1itcj_1{pointer-events:none}._item_1itcj_1[data-interactive=true]{pointer-events:all}[data-theme=subtle] ._item_1itcj_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=subtle] ._item_1itcj_1:active{background-color:var(--ds-color-surface-active)}[data-theme=subtle] ._item_1itcj_1[data-selected=true]{background-color:var(--ds-color-background-default)}[data-theme=default] ._item_1itcj_1:hover{background-color:var(--ds-color-surface-hover)}[data-theme=default] ._item_1itcj_1:active{background-color:var(--ds-color-surface-active)}[data-theme=default] ._item_1itcj_1[data-selected=true]{background-color:var(--ds-color-background-tinted)}._content_1itcj_45{display:flex;width:100%;align-items:center;column-gap:.5em}._item_1itcj_1:focus-visible{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline))}._item_1itcj_1:focus-visible *{--_ds--focus: }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._virtualScrollRef_14d4s_1{max-height:400px}._virtualMenuListItem_14d4s_5{position:absolute;top:0;left:0;width:100%}._virtualMenuListItem_14d4s_5>*{margin:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._field_zk1f7_1{position:relative}._icon_zk1f7_5{position:absolute;top:1px;left:1px;font-size:1.25em;color:var(--ds-color-text-subtle);margin:.5em}._input_zk1f7_14{padding-left:2.25em;padding-right:2.25em}._input_zk1f7_14[type=search]::-webkit-search-decoration,._input_zk1f7_14[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._clear_zk1f7_24{font-size:inherit;position:absolute;top:0;right:0;margin:.375em;border:0;border-radius:100%;font-size:.75em;background-color:var(--ds-color-surface-tinted);color:var(--ds-color-base-default)}._clear_zk1f7_24:focus-visible{outline-offset:0;outline-width:2px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._field_1f56c_1{position:relative;display:flex;align-items:center;font-size:1.125rem;background-color:transparent;color:currentColor}._icon_1f56c_10{position:absolute;left:0;font-size:1.5rem;margin:0 1rem}._input_1f56c_17{height:3.5rem;background-color:transparent;font-size:inherit;flex-grow:1;padding:1rem 1rem 1rem 3rem;border:2px solid;border-radius:.25rem;outline:none}._input_1f56c_17[type=search]::-webkit-search-decoration,._input_1f56c_17[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._input_1f56c_17[data-expanded=true],._input_1f56c_17:focus,._input_1f56c_17:not(:placeholder-shown){background-color:var(--ds-color-background-default)}._clear_1f56c_39{background-color:var(--ds-color-surface-tinted);color:var(--ds-color-base-default);border:0;position:absolute;right:0;margin:.75rem;border-radius:100%;width:1.5rem;height:1.5rem}._clear_1f56c_39:focus-visible{outline-offset:0;outline-width:2px}._dismiss_1f56c_56{position:absolute;right:0;margin:.5rem}._dismiss_1f56c_56:focus-visible{outline-offset:0;outline-width:2px}
|
|
@@ -1,34 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { Icon as p } from "../Icon/Icon.js";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import { IconButton as f } from "../Button/IconButton.js";
|
|
5
6
|
import "../RootProvider/RootProvider.js";
|
|
6
7
|
import "../Searchbar/AutocompleteBase.js";
|
|
7
8
|
import "../Snackbar/useSnackbar.js";
|
|
8
9
|
import { Input as _ } from "./Input.js";
|
|
9
|
-
import { FieldBase as
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/SearchField.css';const
|
|
13
|
-
field:
|
|
10
|
+
import { FieldBase as d } from "./FieldBase.js";
|
|
11
|
+
import { S as u } from "../../MagnifyingGlass-3Ln1MufI.js";
|
|
12
|
+
import { S as k } from "../../XMark-DIqxCTTQ.js";
|
|
13
|
+
import '../../assets/SearchField.css';const g = "_field_zk1f7_1", h = "_icon_zk1f7_5", z = "_input_zk1f7_14", S = "_clear_zk1f7_24", o = {
|
|
14
|
+
field: g,
|
|
14
15
|
icon: h,
|
|
15
|
-
input:
|
|
16
|
-
clear:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
16
|
+
input: z,
|
|
17
|
+
clear: S
|
|
18
|
+
}, G = ({
|
|
19
|
+
className: s,
|
|
20
|
+
size: c,
|
|
21
|
+
color: e = "neutral",
|
|
22
|
+
label: n,
|
|
23
|
+
value: t,
|
|
24
|
+
onClear: r,
|
|
25
|
+
clearButtonAltText: m = "Clear search",
|
|
26
|
+
...a
|
|
27
|
+
}) => /* @__PURE__ */ i(d, { size: c, color: e, label: n, className: s, children: /* @__PURE__ */ l("div", { className: o.field, children: [
|
|
28
|
+
/* @__PURE__ */ i(_, { ...a, type: "search", value: t, className: o.input }),
|
|
29
|
+
/* @__PURE__ */ i(p, { svgElement: u, className: o.icon }),
|
|
30
|
+
r && !!t && /* @__PURE__ */ i(
|
|
31
|
+
f,
|
|
32
|
+
{
|
|
33
|
+
icon: k,
|
|
34
|
+
variant: "solid",
|
|
35
|
+
size: "custom",
|
|
36
|
+
className: o.clear,
|
|
37
|
+
onClick: r,
|
|
38
|
+
iconAltText: m
|
|
39
|
+
}
|
|
40
|
+
)
|
|
31
41
|
] }) });
|
|
32
42
|
export {
|
|
33
|
-
|
|
43
|
+
G as SearchField
|
|
34
44
|
};
|
|
@@ -1,105 +1,109 @@
|
|
|
1
1
|
import { jsxs as i, 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 g } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { useId as B, isValidElement as E } from "react";
|
|
4
|
+
import { Icon as w } from "../Icon/Icon.js";
|
|
5
|
+
import { Badge as A } from "../Badge/Badge.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Searchbar/AutocompleteBase.js";
|
|
8
|
-
import { ListItemLink as
|
|
9
|
-
import { ListItemLabel as
|
|
10
|
-
import { ListItemIcon as
|
|
11
|
-
import { ListItemControls as
|
|
12
|
-
import { ListItemSelect as
|
|
8
|
+
import { ListItemLink as D } from "./ListItemLink.js";
|
|
9
|
+
import { ListItemLabel as H } from "./ListItemLabel.js";
|
|
10
|
+
import { ListItemIcon as R } from "./ListItemIcon.js";
|
|
11
|
+
import { ListItemControls as U } from "./ListItemControls.js";
|
|
12
|
+
import { ListItemSelect as V } from "./ListItemSelect.js";
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
|
-
import { S as
|
|
14
|
+
import { S as q, a as G } from "../../ChevronUp-DR4Lz2Jb.js";
|
|
15
15
|
import { S as J } from "../../ChevronRight-BbelnTke.js";
|
|
16
|
-
import '../../assets/ListItemHeader.css';const K = "
|
|
16
|
+
import '../../assets/ListItemHeader.css';const K = "_header_1689z_1", M = "_label_1689z_27", O = "_link_1689z_39", P = "_badge_1689z_43", Q = "_linkIcon_1689z_47", T = "_linkFocus_1689z_57", t = {
|
|
17
17
|
header: K,
|
|
18
18
|
label: M,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
link: O,
|
|
20
|
+
badge: P,
|
|
21
|
+
linkIcon: Q,
|
|
22
|
+
linkFocus: T
|
|
23
|
+
}, ce = ({
|
|
22
24
|
as: p,
|
|
23
|
-
interactive:
|
|
25
|
+
interactive: _ = !0,
|
|
24
26
|
color: f,
|
|
25
|
-
loading:
|
|
27
|
+
loading: o,
|
|
26
28
|
disabled: h,
|
|
27
|
-
collapsible:
|
|
28
|
-
linkIcon:
|
|
29
|
-
expanded:
|
|
30
|
-
select:
|
|
31
|
-
href:
|
|
32
|
-
onClick:
|
|
33
|
-
onKeyPress:
|
|
34
|
-
tabIndex:
|
|
29
|
+
collapsible: I,
|
|
30
|
+
linkIcon: k,
|
|
31
|
+
expanded: v,
|
|
32
|
+
select: n,
|
|
33
|
+
href: u,
|
|
34
|
+
onClick: b,
|
|
35
|
+
onKeyPress: L,
|
|
36
|
+
tabIndex: N,
|
|
35
37
|
size: a,
|
|
36
|
-
title:
|
|
37
|
-
description:
|
|
38
|
-
icon:
|
|
39
|
-
active:
|
|
40
|
-
badge:
|
|
41
|
-
controls:
|
|
38
|
+
title: s,
|
|
39
|
+
description: z,
|
|
40
|
+
icon: S,
|
|
41
|
+
active: l,
|
|
42
|
+
badge: r,
|
|
43
|
+
controls: m,
|
|
42
44
|
className: x,
|
|
43
45
|
children: y,
|
|
44
|
-
ariaLabel:
|
|
46
|
+
ariaLabel: c
|
|
45
47
|
}) => {
|
|
46
|
-
const d =
|
|
48
|
+
const d = I ? v ? q : G : k ? J : void 0, C = () => r && !o && typeof r == "object" && "label" in r ? /* @__PURE__ */ e(A, { ...r, className: t.badge }) : E(r) ? r : null, F = c !== void 0 ? c : typeof s == "string" ? s : void 0, j = B();
|
|
47
49
|
return /* @__PURE__ */ i(
|
|
48
50
|
"div",
|
|
49
51
|
{
|
|
50
|
-
className:
|
|
52
|
+
className: g(t.header, x),
|
|
51
53
|
"data-color": f,
|
|
52
|
-
"data-interactive":
|
|
54
|
+
"data-interactive": _,
|
|
53
55
|
"data-size": a,
|
|
54
|
-
"data-has-active-child":
|
|
56
|
+
"data-has-active-child": l,
|
|
55
57
|
children: [
|
|
56
58
|
/* @__PURE__ */ i(
|
|
57
|
-
|
|
59
|
+
D,
|
|
58
60
|
{
|
|
59
61
|
as: p,
|
|
60
|
-
href:
|
|
61
|
-
onClick:
|
|
62
|
-
onKeyPress:
|
|
63
|
-
tabIndex:
|
|
64
|
-
loading:
|
|
65
|
-
disabled: h ||
|
|
66
|
-
active:
|
|
67
|
-
ariaLabel:
|
|
62
|
+
href: u,
|
|
63
|
+
onClick: b,
|
|
64
|
+
onKeyPress: L,
|
|
65
|
+
tabIndex: N,
|
|
66
|
+
loading: o,
|
|
67
|
+
disabled: h || o,
|
|
68
|
+
active: l,
|
|
69
|
+
ariaLabel: F,
|
|
70
|
+
className: t.link,
|
|
68
71
|
children: [
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */ e(
|
|
72
|
+
/* @__PURE__ */ e("div", { className: t.linkFocus, "aria-hidden": "true" }),
|
|
73
|
+
n && /* @__PURE__ */ e(V, { ...n, className: t.select }),
|
|
74
|
+
/* @__PURE__ */ e(R, { loading: o, icon: S }),
|
|
71
75
|
/* @__PURE__ */ e(
|
|
72
|
-
|
|
76
|
+
H,
|
|
73
77
|
{
|
|
74
78
|
size: a,
|
|
75
|
-
loading:
|
|
76
|
-
title:
|
|
77
|
-
description:
|
|
78
|
-
id:
|
|
79
|
-
className:
|
|
79
|
+
loading: o,
|
|
80
|
+
title: s,
|
|
81
|
+
description: z,
|
|
82
|
+
id: j,
|
|
83
|
+
className: t.label,
|
|
80
84
|
children: y
|
|
81
85
|
}
|
|
82
|
-
)
|
|
83
|
-
!s && !r && /* @__PURE__ */ i("div", { className: o.badgeAndIcon, children: [
|
|
84
|
-
C(),
|
|
85
|
-
d && /* @__PURE__ */ e("span", { className: o.linkIcon, children: /* @__PURE__ */ e(
|
|
86
|
-
z,
|
|
87
|
-
{
|
|
88
|
-
svgElement: d,
|
|
89
|
-
style: {
|
|
90
|
-
fontSize: "1.5rem"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
) })
|
|
94
|
-
] })
|
|
86
|
+
)
|
|
95
87
|
]
|
|
96
88
|
}
|
|
97
89
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ i(U, { className: t.controls, children: [
|
|
91
|
+
m && !o && /* @__PURE__ */ e("span", { children: m }),
|
|
92
|
+
C(),
|
|
93
|
+
d && /* @__PURE__ */ e("span", { className: t.linkIcon, children: /* @__PURE__ */ e(
|
|
94
|
+
w,
|
|
95
|
+
{
|
|
96
|
+
svgElement: d,
|
|
97
|
+
style: {
|
|
98
|
+
fontSize: "1.5rem"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
) })
|
|
102
|
+
] })
|
|
99
103
|
]
|
|
100
104
|
}
|
|
101
105
|
);
|
|
102
106
|
};
|
|
103
107
|
export {
|
|
104
|
-
|
|
108
|
+
ce as ListItemHeader
|
|
105
109
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { isValidElement as n } from "react";
|
|
3
|
-
import { Icon as s, isIconProps as
|
|
3
|
+
import { Icon as s, isIconProps as c } from "../Icon/Icon.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
|
-
import { isAvatarProps as
|
|
6
|
-
import { isAvatarGroupProps as
|
|
5
|
+
import { isAvatarProps as v, Avatar as l } from "../Avatar/Avatar.js";
|
|
6
|
+
import { isAvatarGroupProps as f, AvatarGroup as _ } from "../Avatar/AvatarGroup.js";
|
|
7
7
|
import { Badge as u } from "../Badge/Badge.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
9
|
import "../Searchbar/AutocompleteBase.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
11
|
import { S as N } from "../../XMark-DIqxCTTQ.js";
|
|
12
|
-
import '../../assets/ListItemIcon.css';const d = "
|
|
12
|
+
import '../../assets/ListItemIcon.css';const d = "_wrapper_rcjve_1", g = "_icon_rcjve_11", j = "_avatar_rcjve_19", G = "_avatarGroup_rcjve_23", t = {
|
|
13
13
|
wrapper: d,
|
|
14
|
-
icon:
|
|
15
|
-
avatar:
|
|
14
|
+
icon: g,
|
|
15
|
+
avatar: j,
|
|
16
16
|
avatarGroup: G
|
|
17
17
|
};
|
|
18
18
|
function w(a) {
|
|
19
19
|
return typeof a == "string" || typeof a == "number" || typeof a == "boolean" || a === null || n(a);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const B = ({ loading: a, size: m, icon: r, theme: e, badge: p }) => r ? a ? /* @__PURE__ */ o(s, { className: t.wrapper, svgElement: N, loading: !0 }) : /* @__PURE__ */ i("div", { className: t.wrapper, "data-size": m, children: [
|
|
22
|
+
v(r) && /* @__PURE__ */ o(l, { ...r, className: t.avatar }) || f(r) && /* @__PURE__ */ o(_, { ...r, className: t.avatarGroup }) || c(r) && /* @__PURE__ */ o(s, { ...r, theme: r.theme || e, className: t.icon }) || w(r) && r || /* @__PURE__ */ o(s, { theme: e, svgElement: r, className: t.icon }),
|
|
23
23
|
p && /* @__PURE__ */ o(u, { ...p, className: t.badge })
|
|
24
24
|
] }) : null;
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
B as ListItemIcon
|
|
27
27
|
};
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/ListItemLink.css';const
|
|
4
|
-
link:
|
|
5
|
-
},
|
|
6
|
-
as:
|
|
7
|
-
loading:
|
|
8
|
-
disabled:
|
|
9
|
-
selected:
|
|
10
|
-
href:
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/ListItemLink.css';const f = "_link_c8adz_1", l = {
|
|
4
|
+
link: f
|
|
5
|
+
}, I = ({
|
|
6
|
+
as: u,
|
|
7
|
+
loading: a,
|
|
8
|
+
disabled: e,
|
|
9
|
+
selected: x,
|
|
10
|
+
href: s,
|
|
11
11
|
onClick: t,
|
|
12
|
-
onKeyPress:
|
|
13
|
-
className:
|
|
14
|
-
active:
|
|
15
|
-
ariaLabel:
|
|
16
|
-
children:
|
|
12
|
+
onKeyPress: i,
|
|
13
|
+
className: m,
|
|
14
|
+
active: o,
|
|
15
|
+
ariaLabel: n,
|
|
16
|
+
children: c,
|
|
17
|
+
tabIndex: _ = 0
|
|
17
18
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
19
|
+
const r = u || "div";
|
|
20
|
+
if (r === "div")
|
|
21
|
+
return /* @__PURE__ */ p("div", { className: v(l.link, m), children: c });
|
|
22
|
+
const b = !a && s || r !== "a" && n;
|
|
23
|
+
return /* @__PURE__ */ p(
|
|
24
|
+
r,
|
|
24
25
|
{
|
|
25
|
-
className: l
|
|
26
|
-
href:
|
|
27
|
-
onKeyPress: (
|
|
28
|
-
|
|
26
|
+
className: v(l.link, m),
|
|
27
|
+
href: s,
|
|
28
|
+
onKeyPress: (d) => {
|
|
29
|
+
d.key === "Enter" && (t == null || t()), i == null || i(d);
|
|
29
30
|
},
|
|
30
31
|
onClick: t,
|
|
31
32
|
"data-interactive": "true",
|
|
32
|
-
"aria-disabled":
|
|
33
|
-
"aria-selected":
|
|
34
|
-
...
|
|
35
|
-
"data-active":
|
|
36
|
-
|
|
33
|
+
"aria-disabled": a || e,
|
|
34
|
+
"aria-selected": x,
|
|
35
|
+
...b && { "aria-label": n },
|
|
36
|
+
"data-active": o,
|
|
37
|
+
tabIndex: a || e ? -1 : _,
|
|
38
|
+
children: c
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
41
|
};
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
I as ListItemLink
|
|
42
44
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/MenuItemBase.css';const l = "
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { c as u } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/MenuItemBase.css';const l = "_item_1itcj_1", I = "_content_1itcj_45", m = {
|
|
4
4
|
item: l,
|
|
5
5
|
content: I
|
|
6
|
-
},
|
|
6
|
+
}, z = ({
|
|
7
7
|
interactive: o = !0,
|
|
8
8
|
as: s,
|
|
9
9
|
color: r,
|
|
@@ -13,31 +13,31 @@ import '../../assets/MenuItemBase.css';const l = "_item_3iu2g_1", I = "_content_
|
|
|
13
13
|
href: _,
|
|
14
14
|
onClick: t,
|
|
15
15
|
onKeyPress: e,
|
|
16
|
-
tabIndex:
|
|
17
|
-
hidden:
|
|
18
|
-
selected:
|
|
16
|
+
tabIndex: x = 0,
|
|
17
|
+
hidden: f,
|
|
18
|
+
selected: h,
|
|
19
19
|
disabled: a = !1,
|
|
20
|
-
children:
|
|
21
|
-
}) => /* @__PURE__ */
|
|
20
|
+
children: j
|
|
21
|
+
}) => /* @__PURE__ */ c(
|
|
22
22
|
s || "a",
|
|
23
23
|
{
|
|
24
|
-
tabIndex: a ? "-1" :
|
|
25
|
-
className:
|
|
24
|
+
tabIndex: a ? "-1" : x ?? 0,
|
|
25
|
+
className: u(m.item, p),
|
|
26
26
|
"data-interactive": o,
|
|
27
27
|
"data-size": i,
|
|
28
28
|
"data-color": r,
|
|
29
29
|
"data-theme": d,
|
|
30
|
-
"aria-hidden":
|
|
30
|
+
"aria-hidden": f,
|
|
31
31
|
"aria-disabled": a,
|
|
32
|
-
"data-selected":
|
|
32
|
+
"data-selected": h,
|
|
33
33
|
href: _,
|
|
34
34
|
onKeyPress: (n) => {
|
|
35
35
|
n.key === "Enter" && (t == null || t()), e == null || e(n);
|
|
36
36
|
},
|
|
37
37
|
onClick: t,
|
|
38
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ c("span", { className: m.content, children: j })
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
z as MenuItemBase
|
|
43
43
|
};
|
|
@@ -11,7 +11,7 @@ import { MenuHeader as k } from "./MenuHeader.js";
|
|
|
11
11
|
import { MenuList as N, MenuListItem as g } from "./MenuBase.js";
|
|
12
12
|
import "../Searchbar/AutocompleteBase.js";
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
|
-
import '../../assets/MenuItemsVirtual.css';const q = "
|
|
14
|
+
import '../../assets/MenuItemsVirtual.css';const q = "_virtualScrollRef_14d4s_1", B = "_virtualMenuListItem_14d4s_5", y = {
|
|
15
15
|
virtualScrollRef: q,
|
|
16
16
|
virtualMenuListItem: B
|
|
17
17
|
}, W = ({
|
|
@@ -32,21 +32,21 @@ import '../../assets/MenuItemsVirtual.css';const q = "_virtualScrollRef_12fdc_1"
|
|
|
32
32
|
keyboardEvents: !1
|
|
33
33
|
}), m = R(null), a = _.flatMap((t, e) => {
|
|
34
34
|
var u;
|
|
35
|
-
const E = (t == null ? void 0 : t.props) || {}, { title:
|
|
35
|
+
const E = (t == null ? void 0 : t.props) || {}, { title: p } = E, c = ((u = t == null ? void 0 : t.items) == null ? void 0 : u.filter((r) => {
|
|
36
36
|
var s;
|
|
37
37
|
return !((s = r.props) != null && s.hidden);
|
|
38
38
|
})) || [];
|
|
39
39
|
return [
|
|
40
40
|
...e > 0 || h > 0 ? [{ type: "separator" }] : [],
|
|
41
|
-
...
|
|
42
|
-
...
|
|
41
|
+
...p ? [{ type: "title", title: p }] : [],
|
|
42
|
+
...c.map((r, s) => {
|
|
43
43
|
var d, f;
|
|
44
44
|
return {
|
|
45
45
|
type: "item",
|
|
46
46
|
itemProps: r.props || {},
|
|
47
47
|
active: r.active,
|
|
48
48
|
hasChildren: ((d = r.props) == null ? void 0 : d.expanded) && ((f = r.props) == null ? void 0 : f.items),
|
|
49
|
-
isLastItem: s ===
|
|
49
|
+
isLastItem: s === c.length - 1
|
|
50
50
|
};
|
|
51
51
|
})
|
|
52
52
|
];
|
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../RootProvider/RootProvider.js";
|
|
5
|
-
import { SearchbarBase as
|
|
6
|
-
import { SearchbarField as
|
|
5
|
+
import { SearchbarBase as n } from "./SearchbarBase.js";
|
|
6
|
+
import { SearchbarField as T } from "./SearchbarField.js";
|
|
7
7
|
import "./AutocompleteBase.js";
|
|
8
|
-
import { Autocomplete as
|
|
8
|
+
import { Autocomplete as A } from "./Autocomplete.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
const
|
|
11
|
-
className:
|
|
12
|
-
autocomplete:
|
|
13
|
-
expanded:
|
|
14
|
-
onClose:
|
|
15
|
-
tabIndex:
|
|
16
|
-
...
|
|
17
|
-
}) => /* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
const k = ({
|
|
11
|
+
className: p,
|
|
12
|
+
autocomplete: e,
|
|
13
|
+
expanded: a = !1,
|
|
14
|
+
onClose: r,
|
|
15
|
+
tabIndex: g,
|
|
16
|
+
...h
|
|
17
|
+
}) => /* @__PURE__ */ f(
|
|
18
|
+
n,
|
|
19
|
+
{
|
|
20
|
+
className: p,
|
|
21
|
+
expanded: a,
|
|
22
|
+
autocomplete: !!e,
|
|
23
|
+
onBlurCapture: (t) => {
|
|
24
|
+
var u, c, s, d, m, b, l;
|
|
25
|
+
const i = (s = (c = (u = t.target) == null ? void 0 : u.attributes) == null ? void 0 : c.getNamedItem("data-testid")) == null ? void 0 : s.value;
|
|
26
|
+
t.relatedTarget !== null && (i === "search-button-clear" || i === "search-button-close" || i === "searchbar-input" && ((d = t.relatedTarget) == null ? void 0 : d.getAttribute("data-testid")) !== "searchbar-input" && ((m = t.relatedTarget) == null ? void 0 : m.getAttribute("data-testid")) !== "search-button-clear" && ((b = t.relatedTarget) == null ? void 0 : b.getAttribute("data-testid")) !== "search-button-close" && ((l = t.relatedTarget) == null ? void 0 : l.getAttribute("data-testid")) !== "autocomplete-list") && (r == null || r());
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ o(T, { ...h, expanded: a, onClose: r, tabIndex: g }),
|
|
30
|
+
e && /* @__PURE__ */ o(A, { ...e, expanded: a, onSelect: r })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
21
34
|
export {
|
|
22
|
-
|
|
35
|
+
k as Searchbar
|
|
23
36
|
};
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/SearchbarBase.css';const
|
|
4
|
-
searchbar:
|
|
5
|
-
searchbarExpanded:
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as b } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/SearchbarBase.css';const d = "_searchbar_1qnvb_1", h = "_searchbarExpanded_1qnvb_14", a = {
|
|
4
|
+
searchbar: d,
|
|
5
|
+
searchbarExpanded: h
|
|
6
|
+
}, x = ({
|
|
7
|
+
className: r,
|
|
8
|
+
children: e,
|
|
9
|
+
expanded: s = !1,
|
|
10
|
+
onBlurCapture: c,
|
|
11
|
+
autocomplete: t = !1
|
|
12
|
+
}) => {
|
|
13
|
+
const o = b(a.searchbar, r, s && a.searchbarExpanded);
|
|
14
|
+
return /* @__PURE__ */ n(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: o,
|
|
18
|
+
"data-autocomplete": t,
|
|
19
|
+
"data-color": "neutral",
|
|
20
|
+
onBlurCapture: c,
|
|
21
|
+
children: e
|
|
22
|
+
}
|
|
23
|
+
);
|
|
9
24
|
};
|
|
10
25
|
export {
|
|
11
|
-
|
|
26
|
+
x as SearchbarBase
|
|
12
27
|
};
|
|
@@ -1,82 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { IconButton as
|
|
2
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { c as I } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import { useRef as N } from "react";
|
|
5
|
+
import { Icon as v } from "../Icon/Icon.js";
|
|
6
|
+
import { IconButton as l } from "../Button/IconButton.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "./AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/SearchbarField.css';const
|
|
13
|
-
field:
|
|
14
|
-
icon:
|
|
10
|
+
import { S as T } from "../../MagnifyingGlass-3Ln1MufI.js";
|
|
11
|
+
import { S as m } from "../../XMark-DIqxCTTQ.js";
|
|
12
|
+
import '../../assets/SearchbarField.css';const j = "_field_1f56c_1", z = "_icon_1f56c_10", A = "_input_1f56c_17", K = "_clear_1f56c_39", M = "_dismiss_1f56c_56", s = {
|
|
13
|
+
field: j,
|
|
14
|
+
icon: z,
|
|
15
15
|
input: A,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
clear: K,
|
|
17
|
+
dismiss: M
|
|
18
18
|
}, H = ({
|
|
19
|
-
className:
|
|
20
|
-
expanded:
|
|
19
|
+
className: p,
|
|
20
|
+
expanded: e,
|
|
21
21
|
name: f = "q",
|
|
22
22
|
value: a,
|
|
23
|
-
placeholder:
|
|
24
|
-
closeButtonAltText:
|
|
23
|
+
placeholder: d = "Search",
|
|
24
|
+
closeButtonAltText: u = "Close search",
|
|
25
25
|
clearButtonAltText: _ = "Clear search",
|
|
26
26
|
onFocus: h,
|
|
27
27
|
onBlur: x,
|
|
28
28
|
onChange: b,
|
|
29
|
-
onClear:
|
|
30
|
-
onClose:
|
|
29
|
+
onClear: y,
|
|
30
|
+
onClose: S,
|
|
31
31
|
onEnter: i,
|
|
32
|
-
tabIndex:
|
|
32
|
+
tabIndex: g
|
|
33
33
|
}) => {
|
|
34
|
-
const
|
|
35
|
-
var
|
|
36
|
-
|
|
34
|
+
const c = N(null), k = (o) => {
|
|
35
|
+
var r, n;
|
|
36
|
+
o.key === "Escape" && ((r = c.current) == null || r.blur()), o.key === "Enter" && ((n = c.current) == null || n.blur(), i == null || i());
|
|
37
37
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ C("div", { className: I(s.field, p), children: [
|
|
39
39
|
/* @__PURE__ */ t(
|
|
40
40
|
"input",
|
|
41
41
|
{
|
|
42
|
-
ref:
|
|
42
|
+
ref: c,
|
|
43
43
|
onFocus: h,
|
|
44
44
|
onBlur: x,
|
|
45
45
|
name: f,
|
|
46
46
|
value: a,
|
|
47
47
|
onChange: b,
|
|
48
|
-
placeholder:
|
|
48
|
+
placeholder: d,
|
|
49
49
|
className: s.input,
|
|
50
|
-
onKeyUp:
|
|
50
|
+
onKeyUp: k,
|
|
51
51
|
type: "search",
|
|
52
52
|
"aria-haspopup": !0,
|
|
53
53
|
autoComplete: "off",
|
|
54
54
|
"aria-autocomplete": "list",
|
|
55
|
-
tabIndex:
|
|
55
|
+
tabIndex: g ?? 0,
|
|
56
|
+
"data-expanded": e,
|
|
56
57
|
"data-testid": "searchbar-input"
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
|
-
/* @__PURE__ */ t(
|
|
60
|
+
/* @__PURE__ */ t(v, { svgElement: T, className: s.icon }),
|
|
60
61
|
a && /* @__PURE__ */ t(
|
|
61
|
-
|
|
62
|
+
l,
|
|
62
63
|
{
|
|
63
|
-
icon:
|
|
64
|
+
icon: m,
|
|
64
65
|
variant: "solid",
|
|
65
66
|
size: "custom",
|
|
66
67
|
className: s.clear,
|
|
67
|
-
onClick:
|
|
68
|
+
onClick: y,
|
|
68
69
|
dataTestId: "search-button-clear",
|
|
69
70
|
iconAltText: _
|
|
70
71
|
}
|
|
71
|
-
) ||
|
|
72
|
-
|
|
72
|
+
) || e && /* @__PURE__ */ t(
|
|
73
|
+
l,
|
|
73
74
|
{
|
|
74
|
-
icon:
|
|
75
|
+
icon: m,
|
|
76
|
+
size: "sm",
|
|
75
77
|
variant: "text",
|
|
76
78
|
className: s.dismiss,
|
|
77
|
-
onClick:
|
|
79
|
+
onClick: S,
|
|
78
80
|
dataTestId: "search-button-close",
|
|
79
|
-
iconAltText:
|
|
81
|
+
iconAltText: u
|
|
80
82
|
}
|
|
81
83
|
)
|
|
82
84
|
] });
|
|
@@ -13,4 +13,5 @@ export declare const Default: Story;
|
|
|
13
13
|
export declare const Controlled: () => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const WithoutSubunits: Story;
|
|
15
15
|
export declare const WithGroups: Story;
|
|
16
|
+
export declare const VirtualizedMenu: Story;
|
|
16
17
|
export declare const WithToolbar: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,4 +13,4 @@ export interface ListItemLinkProps {
|
|
|
13
13
|
active?: boolean;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
|
-
export declare const ListItemLink: ({ as, loading, disabled, selected, href, onClick, onKeyPress, className, active, ariaLabel, children, }: ListItemLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const ListItemLink: ({ as, loading, disabled, selected, href, onClick, onKeyPress, className, active, ariaLabel, children, tabIndex, }: ListItemLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,5 +4,6 @@ export interface SearchbarBaseProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
expanded?: boolean;
|
|
6
6
|
autocomplete?: boolean;
|
|
7
|
+
onBlurCapture?: React.FocusEventHandler<HTMLDivElement>;
|
|
7
8
|
}
|
|
8
|
-
export declare const SearchbarBase: ({ className, children, expanded, autocomplete }: SearchbarBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const SearchbarBase: ({ className, children, expanded, onBlurCapture, autocomplete, }: SearchbarBaseProps) => import("react/jsx-runtime").JSX.Element;
|