@frontify/fondue-components 13.0.2 → 14.0.0
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/fondue-components.js +56 -54
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +124 -34
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +36 -84
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +89 -36
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components13.js +30 -40
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +47 -24
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components15.js +28 -39
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components16.js +34 -16
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +21 -68
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +68 -36
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +34 -45
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +53 -130
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +133 -53
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +54 -28
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +28 -153
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +151 -116
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +117 -31
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +32 -65
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +66 -7
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +10 -55
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +56 -32
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +89 -36
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components30.js +18 -4
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +32 -12
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +5 -155
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +10 -116
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +59 -22
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +112 -15
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +116 -30
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +21 -37
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +31 -129
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +37 -21
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +32 -38
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +130 -45
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +20 -7
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +45 -13
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +7 -14
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +13 -60
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +15 -18
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +60 -19
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +18 -5
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +18 -14
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +1 -1
- package/dist/fondue-components5.js +42 -45
- package/dist/fondue-components5.js.map +1 -1
- package/dist/fondue-components50.js +12 -16
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +5 -35
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +18 -6
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +35 -13
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +6 -4
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +12 -24
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +4 -16
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +23 -140
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +17 -16
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +142 -70
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +46 -48
- package/dist/fondue-components6.js.map +1 -1
- package/dist/fondue-components60.js +16 -8
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +72 -32
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +8 -49
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +32 -10
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +48 -12
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +10 -12
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +11 -19
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +13 -15
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +20 -52
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +15 -15
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +43 -144
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +52 -25
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +14 -17
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +24 -5
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +16 -5
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +7 -2
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +4 -12
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +2 -39
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +18 -0
- package/dist/fondue-components77.js.map +1 -0
- package/dist/fondue-components78.js +42 -0
- package/dist/fondue-components78.js.map +1 -0
- package/dist/fondue-components8.js +146 -27
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components9.js +28 -125
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +183 -57
- package/dist/style.css +1 -1
- package/package.json +6 -5
|
@@ -1,16 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
import { sv as t } from "./fondue-components33.js";
|
|
2
|
+
const i = t({
|
|
3
|
+
base: "tw-relative tw-w-full tw-overflow-hidden",
|
|
4
|
+
variants: {
|
|
5
|
+
rounded: {
|
|
6
|
+
true: "tw-rounded"
|
|
7
|
+
},
|
|
8
|
+
size: {
|
|
9
|
+
small: "tw-h-1",
|
|
10
|
+
medium: "tw-h-2",
|
|
11
|
+
large: "tw-h-3",
|
|
12
|
+
"x-large": "tw-h-4"
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
default: "tw-bg-box-selected",
|
|
16
|
+
positive: "tw-bg-box-positive",
|
|
17
|
+
negative: "tw-bg-box-negative"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}), a = t({
|
|
21
|
+
base: "tw-h-full tw-w-full",
|
|
22
|
+
variants: {
|
|
23
|
+
variant: {
|
|
24
|
+
default: "tw-bg-text-interactive",
|
|
25
|
+
positive: "tw-bg-text-positive",
|
|
26
|
+
negative: "tw-bg-text-negative"
|
|
27
|
+
},
|
|
28
|
+
indeterminateState: {
|
|
29
|
+
true: "tw-animate-loading-bar-infinite tw-origin-left-right",
|
|
30
|
+
false: "tw-transition-all tw-origin-left tw-scale-x-[--loading-bar-proportion]"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
8
34
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o as root,
|
|
12
|
-
t as scrollbar,
|
|
13
|
-
_ as thumb,
|
|
14
|
-
r as viewport
|
|
35
|
+
i as loadingBarContainerStyles,
|
|
36
|
+
a as loadingBarStyles
|
|
15
37
|
};
|
|
16
38
|
//# sourceMappingURL=fondue-components53.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components53.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components53.js","sources":["../src/components/LoadingBar/styles/loadingBarStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const loadingBarContainerStyles = sv({\n base: 'tw-relative tw-w-full tw-overflow-hidden',\n variants: {\n rounded: {\n true: 'tw-rounded',\n },\n size: {\n small: 'tw-h-1',\n medium: 'tw-h-2',\n large: 'tw-h-3',\n 'x-large': 'tw-h-4',\n },\n variant: {\n default: 'tw-bg-box-selected',\n positive: 'tw-bg-box-positive',\n negative: 'tw-bg-box-negative',\n },\n },\n});\n\nexport const loadingBarStyles = sv({\n base: 'tw-h-full tw-w-full',\n variants: {\n variant: {\n default: 'tw-bg-text-interactive',\n positive: 'tw-bg-text-positive',\n negative: 'tw-bg-text-negative',\n },\n indeterminateState: {\n true: 'tw-animate-loading-bar-infinite tw-origin-left-right',\n false: 'tw-transition-all tw-origin-left tw-scale-x-[--loading-bar-proportion]',\n },\n },\n});\n"],"names":["loadingBarContainerStyles","sv","loadingBarStyles"],"mappings":";AAIO,MAAMA,IAA4BC,EAAG;AAAA,EACxC,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,MAAM;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACF,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,WAAW;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,EACd;AAER,CAAC,GAEYC,IAAmBD,EAAG;AAAA,EAC/B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IACd;AAAA,IACA,oBAAoB;AAAA,MAChB,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EACX;AAER,CAAC;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
const o = "
|
|
2
|
-
root:
|
|
1
|
+
const t = "_root_t4a4t_8", o = "_spin_t4a4t_1", s = {
|
|
2
|
+
root: t,
|
|
3
|
+
spin: o
|
|
3
4
|
};
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
s as default,
|
|
7
|
+
t as root,
|
|
8
|
+
o as spin
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=fondue-components54.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components54.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components54.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}) => {
|
|
8
|
-
const [o, c] = b({ defaultProp: n, onChange: s }), t = e !== void 0, d = t ? e : o, r = f(() => s, [s]), i = a(
|
|
9
|
-
(l) => {
|
|
10
|
-
if (t) {
|
|
11
|
-
const u = typeof l == "function" ? l(e) : l;
|
|
12
|
-
u !== e && r(u);
|
|
13
|
-
} else
|
|
14
|
-
c(l);
|
|
15
|
-
},
|
|
16
|
-
[t, e, c, r]
|
|
17
|
-
);
|
|
18
|
-
return [d, i];
|
|
19
|
-
}, b = ({ defaultProp: e, onChange: n }) => {
|
|
20
|
-
const s = v(e), [o] = s, c = S(o), t = f(() => n, [n]);
|
|
21
|
-
return m(() => {
|
|
22
|
-
c.current !== o && (t == null || t(o), c.current = o);
|
|
23
|
-
}, [o, c, t]), s;
|
|
1
|
+
const o = "_root_4gn3w_4", r = "_viewport_4gn3w_12", t = "_scrollbar_4gn3w_34", _ = "_thumb_4gn3w_66", n = "_corner_4gn3w_84", c = {
|
|
2
|
+
root: o,
|
|
3
|
+
viewport: r,
|
|
4
|
+
scrollbar: t,
|
|
5
|
+
thumb: _,
|
|
6
|
+
corner: n
|
|
24
7
|
};
|
|
25
8
|
export {
|
|
26
|
-
|
|
9
|
+
n as corner,
|
|
10
|
+
c as default,
|
|
11
|
+
o as root,
|
|
12
|
+
t as scrollbar,
|
|
13
|
+
_ as thumb,
|
|
14
|
+
r as viewport
|
|
27
15
|
};
|
|
28
16
|
//# sourceMappingURL=fondue-components55.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components55.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components55.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
item: e,
|
|
4
|
-
itemLabel: i,
|
|
5
|
-
itemLabelActive: o,
|
|
6
|
-
itemLabelInactive: a,
|
|
7
|
-
activeIndicator: _,
|
|
8
|
-
separator: c
|
|
1
|
+
const o = "_root_yrjuz_5", t = {
|
|
2
|
+
root: o
|
|
9
3
|
};
|
|
10
4
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
e as item,
|
|
14
|
-
i as itemLabel,
|
|
15
|
-
o as itemLabelActive,
|
|
16
|
-
a as itemLabelInactive,
|
|
17
|
-
t as root,
|
|
18
|
-
c as separator
|
|
5
|
+
t as default,
|
|
6
|
+
o as root
|
|
19
7
|
};
|
|
20
8
|
//# sourceMappingURL=fondue-components56.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components56.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components56.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,145 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
placeholder: R = "",
|
|
16
|
-
status: s = "neutral",
|
|
17
|
-
disabled: m,
|
|
18
|
-
"aria-label": B,
|
|
19
|
-
"data-test-id": l = "fondue-select-combobox",
|
|
20
|
-
alignMenu: M = "start",
|
|
21
|
-
side: F = "bottom"
|
|
22
|
-
}, L) => {
|
|
23
|
-
const { inputSlots: P, menuSlots: k, items: i, filterText: v, clearButton: g, getItemByValue: p, setFilterText: y } = Y(N), [D, f] = Q(!1), {
|
|
24
|
-
getInputProps: c,
|
|
25
|
-
getToggleButtonProps: H,
|
|
26
|
-
getMenuProps: T,
|
|
27
|
-
getItemProps: V,
|
|
28
|
-
reset: h,
|
|
29
|
-
selectedItem: r,
|
|
30
|
-
isOpen: z,
|
|
31
|
-
highlightedIndex: j,
|
|
32
|
-
inputValue: u
|
|
33
|
-
} = J({
|
|
34
|
-
items: i,
|
|
35
|
-
selectedItem: p(S),
|
|
36
|
-
defaultSelectedItem: p(O),
|
|
37
|
-
defaultHighlightedIndex: 0,
|
|
38
|
-
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
39
|
-
n == null || n((e == null ? void 0 : e.value) ?? null);
|
|
1
|
+
import { useMemo as f, useCallback as a, useState as v, useRef as S, useEffect as m } from "react";
|
|
2
|
+
const U = ({
|
|
3
|
+
prop: e,
|
|
4
|
+
defaultProp: n,
|
|
5
|
+
onChange: s = () => {
|
|
6
|
+
}
|
|
7
|
+
}) => {
|
|
8
|
+
const [o, c] = b({ defaultProp: n, onChange: s }), t = e !== void 0, d = t ? e : o, r = f(() => s, [s]), i = a(
|
|
9
|
+
(l) => {
|
|
10
|
+
if (t) {
|
|
11
|
+
const u = typeof l == "function" ? l(e) : l;
|
|
12
|
+
u !== e && r(u);
|
|
13
|
+
} else
|
|
14
|
+
c(l);
|
|
40
15
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
itemToString: (e) => e ? e.label : ""
|
|
51
|
-
}), a = U(!1), b = W(
|
|
52
|
-
() => !i.find((e) => e.label.toLowerCase().includes(u.toLowerCase())),
|
|
53
|
-
[u, i]
|
|
54
|
-
), $ = (e) => {
|
|
55
|
-
var C, x;
|
|
56
|
-
e.target.dataset.showFocusRing = "false", a.current = !1, (r == null ? void 0 : r.label.toLocaleLowerCase()) !== u.toLocaleLowerCase() && h(), c().onBlur && ((x = (C = c()).onBlur) == null || x.call(C, e));
|
|
57
|
-
};
|
|
58
|
-
return /* @__PURE__ */ d(w.Root, { open: z, children: [
|
|
59
|
-
/* @__PURE__ */ t(w.Anchor, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: L, className: o.root, "data-status": b ? "error" : s, children: [
|
|
60
|
-
/* @__PURE__ */ t(
|
|
61
|
-
"input",
|
|
62
|
-
{
|
|
63
|
-
...c({
|
|
64
|
-
"aria-label": B
|
|
65
|
-
}),
|
|
66
|
-
"data-test-id": l,
|
|
67
|
-
placeholder: R,
|
|
68
|
-
className: o.input,
|
|
69
|
-
disabled: m,
|
|
70
|
-
onMouseDown: (e) => {
|
|
71
|
-
a.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
72
|
-
},
|
|
73
|
-
onFocus: (e) => {
|
|
74
|
-
a.current || (e.target.dataset.showFocusRing = "true");
|
|
75
|
-
},
|
|
76
|
-
onBlur: $
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
P,
|
|
80
|
-
g && /* @__PURE__ */ t(
|
|
81
|
-
G,
|
|
82
|
-
{
|
|
83
|
-
onClick: (e) => {
|
|
84
|
-
e.stopPropagation(), h();
|
|
85
|
-
},
|
|
86
|
-
className: o.clear,
|
|
87
|
-
role: "button",
|
|
88
|
-
children: g
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
/* @__PURE__ */ d("div", { className: o.icons, children: [
|
|
92
|
-
/* @__PURE__ */ t(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
...H(),
|
|
96
|
-
type: "button",
|
|
97
|
-
"aria-label": "toggle menu",
|
|
98
|
-
disabled: m,
|
|
99
|
-
onMouseDown: () => {
|
|
100
|
-
a.current = !0;
|
|
101
|
-
},
|
|
102
|
-
children: /* @__PURE__ */ t(A, { size: 16, className: o.caret })
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
s === "success" ? /* @__PURE__ */ t(
|
|
106
|
-
E,
|
|
107
|
-
{
|
|
108
|
-
size: 16,
|
|
109
|
-
className: o.iconSuccess,
|
|
110
|
-
"data-test-id": `${l}-success-icon`
|
|
111
|
-
}
|
|
112
|
-
) : null,
|
|
113
|
-
b || s === "error" ? /* @__PURE__ */ t(
|
|
114
|
-
q,
|
|
115
|
-
{
|
|
116
|
-
size: 16,
|
|
117
|
-
className: o.iconError,
|
|
118
|
-
"data-test-id": `${l}-error-icon`
|
|
119
|
-
}
|
|
120
|
-
) : null
|
|
121
|
-
] })
|
|
122
|
-
] }) }),
|
|
123
|
-
/* @__PURE__ */ t(
|
|
124
|
-
X,
|
|
125
|
-
{
|
|
126
|
-
align: M,
|
|
127
|
-
side: F,
|
|
128
|
-
highlightedIndex: j,
|
|
129
|
-
filterText: v,
|
|
130
|
-
getMenuProps: T,
|
|
131
|
-
getItemProps: V,
|
|
132
|
-
selectedItem: r,
|
|
133
|
-
hasInteractedSinceOpening: D,
|
|
134
|
-
children: k
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
] });
|
|
16
|
+
[t, e, c, r]
|
|
17
|
+
);
|
|
18
|
+
return [d, i];
|
|
19
|
+
}, b = ({ defaultProp: e, onChange: n }) => {
|
|
20
|
+
const s = v(e), [o] = s, c = S(o), t = f(() => n, [n]);
|
|
21
|
+
return m(() => {
|
|
22
|
+
c.current !== o && (t == null || t(o), c.current = o);
|
|
23
|
+
}, [o, c, t]), s;
|
|
138
24
|
};
|
|
139
|
-
I.displayName = "Select.Combobox";
|
|
140
|
-
const le = K(I);
|
|
141
25
|
export {
|
|
142
|
-
|
|
143
|
-
I as SelectCombobox
|
|
26
|
+
U as useControllableState
|
|
144
27
|
};
|
|
145
28
|
//# sourceMappingURL=fondue-components57.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components57.js","sources":["../src/components/Select/Combobox.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown, IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { useCombobox } from 'downshift';\nimport { forwardRef, useMemo, useRef, useState, type FocusEvent, type ForwardedRef, type ReactNode } from 'react';\n\nimport { SelectMenu } from './SelectMenu';\nimport styles from './styles/select.module.scss';\nimport { useSelectData } from './useSelectData';\n\nexport type ComboboxProps = {\n /**\n * Children of the Combobox component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu.\n */\n children?: ReactNode;\n /**\n * Callback function that is called when an item is selected.\n */\n onSelect?: (selectedValue: string | null) => void;\n /**\n * The active value in the combobox component. This is used to control the combobox externally.\n */\n value?: string | null;\n /**\n * The default value of the combobox component. Used for uncontrolled usages.\n */\n defaultValue?: string;\n /**\n * The placeholder in the combobox component.\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the combobox component.\n */\n disabled?: boolean;\n /**\n * The alignment of the menu.\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end' /**\n * Defines the preferred side of the select. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */;\n side?: 'left' | 'right' | 'bottom' | 'top';\n /**\n * The aria label of the combobox component.\n */\n 'aria-label'?: string;\n /**\n * The data test id of the select component.\n */\n 'data-test-id'?: string;\n};\n\nexport const SelectCombobox = (\n {\n children,\n onSelect,\n value,\n defaultValue,\n placeholder = '',\n status = 'neutral',\n disabled,\n 'aria-label': ariaLabel,\n 'data-test-id': dataTestId = 'fondue-select-combobox',\n alignMenu = 'start',\n side = 'bottom',\n }: ComboboxProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n const { inputSlots, menuSlots, items, filterText, clearButton, getItemByValue, setFilterText } =\n useSelectData(children);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const {\n getInputProps,\n getToggleButtonProps,\n getMenuProps,\n getItemProps,\n reset,\n selectedItem,\n isOpen,\n highlightedIndex,\n inputValue,\n } = useCombobox({\n items,\n selectedItem: getItemByValue(value),\n defaultSelectedItem: getItemByValue(defaultValue),\n defaultHighlightedIndex: 0,\n onSelectedItemChange: ({ selectedItem }) => {\n onSelect?.(selectedItem?.value ?? null);\n },\n onInputValueChange: ({ inputValue }) => {\n setFilterText(inputValue);\n },\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n itemToString: (item) => (item ? item.label : ''),\n });\n\n const wasClicked = useRef(false);\n\n const valueInvalid = useMemo(\n () => !items.find((item) => item.label.toLowerCase().includes(inputValue.toLowerCase())),\n [inputValue, items],\n );\n\n const onBlurHandler = (blurEvent: FocusEvent<HTMLInputElement, Element>) => {\n blurEvent.target.dataset.showFocusRing = 'false';\n wasClicked.current = false;\n\n const selectedItemNullOrOutdated = selectedItem?.label.toLocaleLowerCase() !== inputValue.toLocaleLowerCase();\n\n if (selectedItemNullOrOutdated) {\n // if there is no selection or\n // the existing selected value is not the same as the input value (old),\n // reset the input\n reset();\n }\n\n if (getInputProps().onBlur) {\n getInputProps().onBlur?.(blurEvent);\n }\n };\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild>\n <div ref={forwardedRef} className={styles.root} data-status={valueInvalid ? 'error' : status}>\n <input\n {...getInputProps({\n 'aria-label': ariaLabel,\n })}\n data-test-id={dataTestId}\n placeholder={placeholder}\n className={styles.input}\n disabled={disabled}\n onMouseDown={(mouseEvent) => {\n wasClicked.current = true;\n mouseEvent.currentTarget.dataset.showFocusRing = 'false';\n }}\n onFocus={(focusEvent) => {\n if (!wasClicked.current) {\n focusEvent.target.dataset.showFocusRing = 'true';\n }\n }}\n onBlur={onBlurHandler}\n />\n {inputSlots}\n {clearButton && (\n <RadixSlot\n onClick={(event) => {\n event.stopPropagation();\n reset();\n }}\n className={styles.clear}\n role=\"button\"\n >\n {clearButton}\n </RadixSlot>\n )}\n <div className={styles.icons}>\n <button\n {...getToggleButtonProps()}\n type=\"button\"\n aria-label=\"toggle menu\"\n disabled={disabled}\n onMouseDown={() => {\n wasClicked.current = true;\n }}\n >\n <IconCaretDown size={16} className={styles.caret} />\n </button>\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className={styles.iconSuccess}\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n {valueInvalid || status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className={styles.iconError}\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n align={alignMenu}\n side={side}\n highlightedIndex={highlightedIndex}\n filterText={filterText}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItem={selectedItem}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectCombobox.displayName = 'Select.Combobox';\n\nexport const ForwardedRefCombobox = forwardRef<HTMLDivElement, ComboboxProps>(SelectCombobox);\n"],"names":["SelectCombobox","children","onSelect","value","defaultValue","placeholder","status","disabled","ariaLabel","dataTestId","alignMenu","side","forwardedRef","inputSlots","menuSlots","items","filterText","clearButton","getItemByValue","setFilterText","useSelectData","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getInputProps","getToggleButtonProps","getMenuProps","getItemProps","reset","selectedItem","isOpen","highlightedIndex","inputValue","useCombobox","item","wasClicked","useRef","valueInvalid","useMemo","onBlurHandler","blurEvent","_b","_a","jsxs","RadixPopover","jsx","styles","mouseEvent","focusEvent","RadixSlot","event","IconCaretDown","IconCheckMark","IconExclamationMarkTriangle","SelectMenu","ForwardedRefCombobox","forwardRef"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components57.js","sources":["../src/hooks/useControllableState.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type Dispatch, type SetStateAction, useCallback, useMemo, useState, useRef, useEffect } from 'react';\n\n// Radix UI handy hook for handling controlled and uncontrolled state\n// Source: https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx\n\ntype UseControllableStateParams<TValue> = {\n prop?: TValue;\n defaultProp?: TValue;\n onChange?: (state: TValue) => void;\n};\n\ntype SetStateFn<T> = (prevState?: T) => T;\n\nexport const useControllableState = <TValue>({\n prop,\n defaultProp,\n onChange = () => {},\n}: UseControllableStateParams<TValue>) => {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useMemo(() => onChange, [onChange]);\n\n const setValue: Dispatch<SetStateAction<TValue | undefined>> = useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue as SetStateFn<TValue>;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) {\n handleChange(value as TValue);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange],\n );\n\n return [value, setValue] as const;\n};\n\nconst useUncontrolledState = <TValue>({ defaultProp, onChange }: Omit<UseControllableStateParams<TValue>, 'prop'>) => {\n const uncontrolledState = useState<TValue | undefined>(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = useRef(value);\n const handleChange = useMemo(() => onChange, [onChange]);\n\n useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange?.(value as TValue);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n\n return uncontrolledState;\n};\n"],"names":["useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","value","handleChange","useMemo","setValue","useCallback","nextValue","uncontrolledState","useState","prevValueRef","useRef","useEffect"],"mappings":";AAeO,MAAMA,IAAuB,CAAS;AAAA,EACzC,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAA;AACrB,MAA0C;AAChC,QAAA,CAACC,GAAkBC,CAAmB,IAAIC,EAAqB,EAAE,aAAAJ,GAAa,UAAAC,GAAU,GACxFI,IAAeN,MAAS,QACxBO,IAAQD,IAAeN,IAAOG,GAC9BK,IAAeC,EAAQ,MAAMP,GAAU,CAACA,CAAQ,CAAC,GAEjDQ,IAAyDC;AAAA,IAC3D,CAACC,MAAc;AACX,UAAIN,GAAc;AAEd,cAAMC,IAAQ,OAAOK,KAAc,aADpBA,EACwCZ,CAAI,IAAIY;AAC/D,QAAIL,MAAUP,KACVQ,EAAaD,CAAe;AAAA,MAChC;AAEA,QAAAH,EAAoBQ,CAAS;AAAA,IAErC;AAAA,IACA,CAACN,GAAcN,GAAMI,GAAqBI,CAAY;AAAA,EAC1D;AAEO,SAAA,CAACD,GAAOG,CAAQ;AAC3B,GAEML,IAAuB,CAAS,EAAE,aAAAJ,GAAa,UAAAC,QAAiE;AAC5G,QAAAW,IAAoBC,EAA6Bb,CAAW,GAC5D,CAACM,CAAK,IAAIM,GACVE,IAAeC,EAAOT,CAAK,GAC3BC,IAAeC,EAAQ,MAAMP,GAAU,CAACA,CAAQ,CAAC;AAEvD,SAAAe,EAAU,MAAM;AACR,IAAAF,EAAa,YAAYR,MACzBC,KAAA,QAAAA,EAAeD,IACfQ,EAAa,UAAUR;AAAA,EAE5B,GAAA,CAACA,GAAOQ,GAAcP,CAAY,CAAC,GAE/BK;AACX;"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const I = c(d), m = ({ children: t, groupId: e, "data-test-id": r = "fondue-select-item-group" }, s) => /* @__PURE__ */ a("div", { "data-test-id": r, className: o.group, ref: s, children: t }, e);
|
|
11
|
-
m.displayName = "Select.Group";
|
|
12
|
-
const S = c(m);
|
|
1
|
+
const t = "_root_o1xgk_5", e = "_item_o1xgk_30", o = "_itemLabel_o1xgk_50", a = "_itemLabelActive_o1xgk_70", i = "_itemLabelInactive_o1xgk_100", _ = "_activeIndicator_o1xgk_130", c = "_separator_o1xgk_227", n = {
|
|
2
|
+
root: t,
|
|
3
|
+
item: e,
|
|
4
|
+
itemLabel: o,
|
|
5
|
+
itemLabelActive: a,
|
|
6
|
+
itemLabelInactive: i,
|
|
7
|
+
activeIndicator: _,
|
|
8
|
+
separator: c
|
|
9
|
+
};
|
|
13
10
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
_ as activeIndicator,
|
|
12
|
+
n as default,
|
|
13
|
+
e as item,
|
|
14
|
+
o as itemLabel,
|
|
15
|
+
a as itemLabelActive,
|
|
16
|
+
i as itemLabelInactive,
|
|
17
|
+
t as root,
|
|
18
|
+
c as separator
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=fondue-components58.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components58.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components58.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,76 +1,148 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretDown as E, IconCheckMark as q, IconExclamationMarkTriangle as G } from "@frontify/fondue-icons";
|
|
3
|
+
import * as w from "@radix-ui/react-popover";
|
|
4
|
+
import { Slot as J } from "@radix-ui/react-slot";
|
|
5
|
+
import { useCombobox as K } from "downshift";
|
|
6
|
+
import { forwardRef as Q, useState as U, useRef as W, useMemo as X } from "react";
|
|
7
|
+
import { SelectMenu as Y } from "./fondue-components61.js";
|
|
8
|
+
import o from "./fondue-components63.js";
|
|
9
|
+
import { useSelectData as Z } from "./fondue-components64.js";
|
|
10
|
+
const N = ({
|
|
11
|
+
children: S,
|
|
12
|
+
onSelect: l,
|
|
13
|
+
value: B,
|
|
14
|
+
defaultValue: O,
|
|
15
|
+
placeholder: R = "",
|
|
16
|
+
status: s = "neutral",
|
|
17
|
+
disabled: g,
|
|
18
|
+
"data-test-id": i = "fondue-select-combobox",
|
|
19
|
+
alignMenu: M = "start",
|
|
20
|
+
side: y = "bottom",
|
|
21
|
+
id: F,
|
|
22
|
+
...a
|
|
23
|
+
}, L) => {
|
|
24
|
+
const { inputSlots: P, menuSlots: k, items: c, filterText: v, clearButton: f, getItemByValue: h, setFilterText: D } = Z(S), [H, p] = U(!1), {
|
|
25
|
+
getInputProps: u,
|
|
26
|
+
getToggleButtonProps: T,
|
|
27
|
+
getMenuProps: V,
|
|
28
|
+
getItemProps: z,
|
|
29
|
+
reset: b,
|
|
30
|
+
selectedItem: r,
|
|
31
|
+
isOpen: j,
|
|
32
|
+
highlightedIndex: $,
|
|
33
|
+
inputValue: d
|
|
34
|
+
} = K({
|
|
35
|
+
items: c,
|
|
36
|
+
selectedItem: h(B),
|
|
37
|
+
defaultSelectedItem: h(O),
|
|
38
|
+
defaultHighlightedIndex: 0,
|
|
39
|
+
toggleButtonId: F,
|
|
40
|
+
labelId: "aria-labelledby" in a ? a["aria-labelledby"] : void 0,
|
|
41
|
+
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
42
|
+
l == null || l((e == null ? void 0 : e.value) ?? null);
|
|
43
|
+
},
|
|
44
|
+
onInputValueChange: ({ inputValue: e }) => {
|
|
45
|
+
D(e);
|
|
46
|
+
},
|
|
47
|
+
onIsOpenChange: () => {
|
|
48
|
+
p(!1);
|
|
49
|
+
},
|
|
50
|
+
onHighlightedIndexChange: () => {
|
|
51
|
+
p(!0);
|
|
52
|
+
},
|
|
53
|
+
itemToString: (e) => e ? e.label : ""
|
|
54
|
+
}), n = W(!1), C = X(
|
|
55
|
+
() => !c.find((e) => e.label.toLowerCase().includes(d.toLowerCase())),
|
|
56
|
+
[d, c]
|
|
57
|
+
), A = (e) => {
|
|
58
|
+
var x, I;
|
|
59
|
+
e.target.dataset.showFocusRing = "false", n.current = !1, (r == null ? void 0 : r.label.toLocaleLowerCase()) !== d.toLocaleLowerCase() && b(), u().onBlur && ((I = (x = u()).onBlur) == null || I.call(x, e));
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ m(w.Root, { open: j, children: [
|
|
62
|
+
/* @__PURE__ */ t(w.Anchor, { asChild: !0, children: /* @__PURE__ */ m("div", { ref: L, className: o.root, "data-status": C ? "error" : s, children: [
|
|
63
|
+
/* @__PURE__ */ t(
|
|
64
|
+
"input",
|
|
32
65
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"data-test-id":
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
children: e
|
|
60
|
-
},
|
|
61
|
-
e.props.value
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
c
|
|
66
|
-
).parsedChildren
|
|
66
|
+
...u({
|
|
67
|
+
"aria-label": "aria-label" in a ? a["aria-label"] : void 0
|
|
68
|
+
}),
|
|
69
|
+
"data-test-id": i,
|
|
70
|
+
placeholder: R,
|
|
71
|
+
className: o.input,
|
|
72
|
+
disabled: g,
|
|
73
|
+
onMouseDown: (e) => {
|
|
74
|
+
n.current = !0, e.currentTarget.dataset.showFocusRing = "false";
|
|
75
|
+
},
|
|
76
|
+
onFocus: (e) => {
|
|
77
|
+
n.current || (e.target.dataset.showFocusRing = "true");
|
|
78
|
+
},
|
|
79
|
+
onBlur: A
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
P,
|
|
83
|
+
f && /* @__PURE__ */ t(
|
|
84
|
+
J,
|
|
85
|
+
{
|
|
86
|
+
onClick: (e) => {
|
|
87
|
+
e.stopPropagation(), b();
|
|
88
|
+
},
|
|
89
|
+
className: o.clear,
|
|
90
|
+
role: "button",
|
|
91
|
+
children: f
|
|
67
92
|
}
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ m("div", { className: o.icons, children: [
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
"aria-label": "toggle menu",
|
|
99
|
+
...T(),
|
|
100
|
+
type: "button",
|
|
101
|
+
disabled: g,
|
|
102
|
+
onMouseDown: () => {
|
|
103
|
+
n.current = !0;
|
|
104
|
+
},
|
|
105
|
+
children: /* @__PURE__ */ t(E, { size: 16, className: o.caret })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
s === "success" ? /* @__PURE__ */ t(
|
|
109
|
+
q,
|
|
110
|
+
{
|
|
111
|
+
size: 16,
|
|
112
|
+
className: o.iconSuccess,
|
|
113
|
+
"data-test-id": `${i}-success-icon`
|
|
114
|
+
}
|
|
115
|
+
) : null,
|
|
116
|
+
C || s === "error" ? /* @__PURE__ */ t(
|
|
117
|
+
G,
|
|
118
|
+
{
|
|
119
|
+
size: 16,
|
|
120
|
+
className: o.iconError,
|
|
121
|
+
"data-test-id": `${i}-error-icon`
|
|
122
|
+
}
|
|
123
|
+
) : null
|
|
124
|
+
] })
|
|
125
|
+
] }) }),
|
|
126
|
+
/* @__PURE__ */ t(
|
|
127
|
+
Y,
|
|
128
|
+
{
|
|
129
|
+
align: M,
|
|
130
|
+
side: y,
|
|
131
|
+
highlightedIndex: $,
|
|
132
|
+
filterText: v,
|
|
133
|
+
getMenuProps: V,
|
|
134
|
+
getItemProps: z,
|
|
135
|
+
selectedItem: r,
|
|
136
|
+
hasInteractedSinceOpening: H,
|
|
137
|
+
children: k
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] });
|
|
71
141
|
};
|
|
72
|
-
|
|
142
|
+
N.displayName = "Select.Combobox";
|
|
143
|
+
const ie = Q(N);
|
|
73
144
|
export {
|
|
74
|
-
|
|
145
|
+
ie as ForwardedRefCombobox,
|
|
146
|
+
N as SelectCombobox
|
|
75
147
|
};
|
|
76
148
|
//# sourceMappingURL=fondue-components59.js.map
|