@frontify/fondue-components 22.0.0 → 22.1.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-components11.js +62 -47
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components13.js +71 -69
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components19.js +66 -61
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components25.js +111 -97
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components27.js +20 -18
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components29.js +56 -51
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components31.js +12 -12
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +37 -37
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components34.js +2 -2
- package/dist/fondue-components35.js +1 -1
- package/dist/fondue-components37.js +1 -1
- package/dist/fondue-components39.js +1 -1
- package/dist/fondue-components4.js +1 -1
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components42.js +1 -1
- package/dist/fondue-components44.js +1 -1
- package/dist/fondue-components50.js +4 -4
- package/dist/fondue-components52.js +1 -1
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components54.js +14 -14
- package/dist/fondue-components55.js +1 -1
- package/dist/fondue-components56.js +12 -12
- package/dist/fondue-components57.js +1 -1
- package/dist/fondue-components59.js +5 -5
- package/dist/fondue-components62.js +4 -4
- package/dist/fondue-components63.js +1 -1
- package/dist/fondue-components65.js +14 -14
- package/dist/fondue-components68.js +42 -42
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components70.js +34 -34
- package/dist/fondue-components71.js +2 -2
- package/dist/fondue-components73.js +8 -8
- package/dist/fondue-components75.js +18 -16
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components77.js +8 -8
- package/dist/fondue-components78.js +47 -35
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +10 -10
- package/dist/fondue-components81.js +16 -12
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components84.js +1 -1
- package/dist/fondue-components85.js +5 -2
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +4 -39
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +2 -6
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +15 -3
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +39 -4
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +71 -70
- package/dist/fondue-components9.js.map +1 -1
- package/dist/fondue-components90.js +6 -17
- package/dist/fondue-components90.js.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { jsxs as t, jsx as a, Fragment as f } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconDroplet as h, IconCross as I, IconCaretDown as v } from "@frontify/fondue-icons";
|
|
3
3
|
import { forwardRef as k } from "react";
|
|
4
4
|
import { Button as w } from "./fondue-components6.js";
|
|
5
|
-
import s from "./fondue-
|
|
5
|
+
import s from "./fondue-components88.js";
|
|
6
6
|
import { getColorWithName as y, colorToCss as z } from "./fondue-components47.js";
|
|
7
7
|
const c = ({
|
|
8
8
|
id: m,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_content_1h2ch_6", e = "_header_1h2ch_49", o = "_footer_1h2ch_50", n = "_body_1h2ch_51", _ = "_underlay_1h2ch_181", c = "_sideContent_1h2ch_191", h = {
|
|
2
2
|
content: t,
|
|
3
3
|
header: e,
|
|
4
4
|
footer: o,
|
|
5
5
|
body: n,
|
|
6
6
|
underlay: _,
|
|
7
|
-
sideContent:
|
|
7
|
+
sideContent: c
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
n as body,
|
|
11
11
|
t as content,
|
|
12
|
-
|
|
12
|
+
h as default,
|
|
13
13
|
o as footer,
|
|
14
14
|
e as header,
|
|
15
|
-
|
|
15
|
+
c as sideContent,
|
|
16
16
|
_ as underlay
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components50.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components52.js","sources":["../src/components/Divider/styles/dividerStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const dividerStyles = sv({\n base: 'tw-flex tw-self-stretch tw-justify-center ',\n variants: {\n direction: {\n horizontal: 'tw-flex-col tw-h-0 tw-border-t tw-w-full',\n vertical: 'tw-flex-row tw-w-0 tw-border-
|
|
1
|
+
{"version":3,"file":"fondue-components52.js","sources":["../src/components/Divider/styles/dividerStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const dividerStyles = sv({\n base: 'tw-flex tw-self-stretch tw-justify-center ',\n variants: {\n direction: {\n horizontal: 'tw-flex-col tw-h-0 tw-border-t tw-w-full',\n vertical: 'tw-flex-row tw-w-0 tw-border-e tw-h-full ',\n },\n color: {\n weak: 'tw-border-line-weak',\n default: 'tw-border-line',\n strong: 'tw-border-line-strong',\n 'x-strong': 'tw-border-x-line-strong',\n },\n variant: {\n solid: 'tw-border-solid',\n dashed: 'tw-border-dashed',\n noline: 'tw-border-none',\n },\n },\n compoundVariants: [\n {\n direction: 'horizontal',\n padding: 'small',\n class: 'tw-my-4',\n },\n {\n direction: 'horizontal',\n padding: 'medium',\n class: 'tw-my-7',\n },\n {\n direction: 'horizontal',\n padding: 'large',\n class: 'tw-my-12',\n },\n {\n direction: 'vertical',\n padding: 'small',\n class: 'tw-mx-4',\n },\n {\n direction: 'vertical',\n padding: 'medium',\n class: 'tw-mx-7',\n },\n {\n direction: 'vertical',\n padding: 'large',\n class: 'tw-mx-12',\n },\n ],\n defaultVariants: {\n padding: 'medium',\n direction: 'horizontal',\n color: 'default',\n variant: 'solid',\n },\n});\n"],"names":["dividerStyles","sv"],"mappings":";AAIO,MAAMA,IAAgBC,EAAG;AAAA,EAC5B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,WAAW;AAAA,MACP,YAAY;AAAA,MACZ,UAAU;AAAA,IAAA;AAAA,IAEd,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,YAAY;AAAA,IAAA;AAAA,IAEhB,SAAS;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,QAAQ;AAAA,IAAA;AAAA,EACZ;AAAA,EAEJ,kBAAkB;AAAA,IACd;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA,IAAA;AAAA,EACX;AAAA,EAEJ,iBAAiB;AAAA,IACb,SAAS;AAAA,IACT,WAAW;AAAA,IACX,OAAO;AAAA,IACP,SAAS;AAAA,EAAA;AAEjB,CAAC;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_content_gmjid_7", n = "_subContent_gmjid_8", o = "_item_gmjid_29", s = "_subTrigger_gmjid_30", _ = "_subMenuIndicator_gmjid_123", g = "_group_gmjid_133", e = "_groupHeading_gmjid_140", i = "_slot_gmjid_151", u = {
|
|
2
2
|
content: t,
|
|
3
|
-
subContent:
|
|
4
|
-
item:
|
|
5
|
-
subTrigger:
|
|
6
|
-
subMenuIndicator:
|
|
7
|
-
group:
|
|
3
|
+
subContent: n,
|
|
4
|
+
item: o,
|
|
5
|
+
subTrigger: s,
|
|
6
|
+
subMenuIndicator: _,
|
|
7
|
+
group: g,
|
|
8
8
|
groupHeading: e,
|
|
9
|
-
slot:
|
|
9
|
+
slot: i
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
t as content,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
u as default,
|
|
14
|
+
g as group,
|
|
15
15
|
e as groupHeading,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
o as item,
|
|
17
|
+
i as slot,
|
|
18
|
+
n as subContent,
|
|
19
|
+
_ as subMenuIndicator,
|
|
20
|
+
s as subTrigger
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=fondue-components54.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_1i0yz_6", e = "_overlay_1i0yz_51", _ = "_header_1i0yz_68", t = "_body_1i0yz_93", r = "_footer_1i0yz_122", s = "_close_1i0yz_147", y = {
|
|
2
2
|
root: o,
|
|
3
|
-
overlay:
|
|
4
|
-
header:
|
|
5
|
-
body:
|
|
6
|
-
footer:
|
|
7
|
-
close:
|
|
3
|
+
overlay: e,
|
|
4
|
+
header: _,
|
|
5
|
+
body: t,
|
|
6
|
+
footer: r,
|
|
7
|
+
close: s
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
t as body,
|
|
11
|
+
s as close,
|
|
12
|
+
y as default,
|
|
13
|
+
r as footer,
|
|
14
|
+
_ as header,
|
|
15
|
+
e as overlay,
|
|
16
16
|
o as root
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components56.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_root_kwmbr_3", e = "_contentArea_kwmbr_66", o = "_hiddenText_kwmbr_71", n = "_visibleText_kwmbr_77", _ = {
|
|
2
2
|
root: t,
|
|
3
3
|
contentArea: e,
|
|
4
|
-
hiddenText:
|
|
5
|
-
visibleText:
|
|
4
|
+
hiddenText: o,
|
|
5
|
+
visibleText: n
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
e as contentArea,
|
|
9
9
|
_ as default,
|
|
10
|
-
|
|
10
|
+
o as hiddenText,
|
|
11
11
|
t as root,
|
|
12
|
-
|
|
12
|
+
n as visibleText
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=fondue-components59.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_1bhxy_4", r = "_viewport_1bhxy_12", t = "_scrollbar_1bhxy_43", _ = "_thumb_1bhxy_75", c = "_corner_1bhxy_93", s = {
|
|
2
2
|
root: o,
|
|
3
3
|
viewport: r,
|
|
4
4
|
scrollbar: t,
|
|
5
5
|
thumb: _,
|
|
6
|
-
corner:
|
|
6
|
+
corner: c
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
c as corner,
|
|
10
|
+
s as default,
|
|
11
11
|
o as root,
|
|
12
12
|
t as scrollbar,
|
|
13
13
|
_ as thumb,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
item:
|
|
4
|
-
itemLabel:
|
|
1
|
+
const e = "_root_nerqc_5", t = "_item_nerqc_33", c = "_itemLabel_nerqc_54", a = "_itemLabelActive_nerqc_75", i = "_itemLabelInactive_nerqc_105", n = "_activeIndicator_nerqc_135", o = "_separator_nerqc_262", _ = {
|
|
2
|
+
root: e,
|
|
3
|
+
item: t,
|
|
4
|
+
itemLabel: c,
|
|
5
5
|
itemLabelActive: a,
|
|
6
|
-
itemLabelInactive:
|
|
7
|
-
activeIndicator:
|
|
8
|
-
separator:
|
|
6
|
+
itemLabelInactive: i,
|
|
7
|
+
activeIndicator: n,
|
|
8
|
+
separator: o
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
n as activeIndicator,
|
|
12
|
+
_ as default,
|
|
13
|
+
t as item,
|
|
14
|
+
c as itemLabel,
|
|
15
15
|
a as itemLabelActive,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
i as itemLabelInactive,
|
|
17
|
+
e as root,
|
|
18
|
+
o as separator
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components65.js.map
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "@radix-ui/react-popover";
|
|
3
3
|
import { Slot as V } from "@radix-ui/react-slot";
|
|
4
|
-
import { isValidElement as
|
|
5
|
-
import { useFondueTheme as
|
|
6
|
-
import
|
|
7
|
-
import { recursiveMap as
|
|
8
|
-
const
|
|
4
|
+
import { isValidElement as D } from "react";
|
|
5
|
+
import { useFondueTheme as M, ThemeProvider as T } from "./fondue-components31.js";
|
|
6
|
+
import n from "./fondue-components70.js";
|
|
7
|
+
import { recursiveMap as E, getSelectOptionValue as F } from "./fondue-components89.js";
|
|
8
|
+
const R = ({
|
|
9
9
|
highlightedIndex: p,
|
|
10
10
|
getMenuProps: c,
|
|
11
11
|
getItemProps: m,
|
|
12
|
-
children:
|
|
12
|
+
children: f,
|
|
13
13
|
filterText: d,
|
|
14
|
-
align:
|
|
15
|
-
side:
|
|
16
|
-
selectedItem:
|
|
17
|
-
hasInteractedSinceOpening:
|
|
18
|
-
viewportCollisionPadding:
|
|
14
|
+
align: h,
|
|
15
|
+
side: v,
|
|
16
|
+
selectedItem: o,
|
|
17
|
+
hasInteractedSinceOpening: P,
|
|
18
|
+
viewportCollisionPadding: S = "compact"
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
20
|
+
const g = (e) => {
|
|
21
21
|
e.preventDefault();
|
|
22
|
-
},
|
|
22
|
+
}, O = {
|
|
23
23
|
compact: 8,
|
|
24
24
|
spacious: 24
|
|
25
|
-
}, N = A();
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
25
|
+
}, { theme: N, dir: i } = M(), A = (e) => i === "ltr" ? e : e === "left" ? "right" : e === "right" ? "left" : e;
|
|
26
|
+
return /* @__PURE__ */ r(u.Portal, { children: /* @__PURE__ */ r(T, { theme: N, dir: i, children: /* @__PURE__ */ r(
|
|
27
|
+
u.Content,
|
|
28
28
|
{
|
|
29
|
-
align:
|
|
30
|
-
side:
|
|
31
|
-
collisionPadding: S
|
|
32
|
-
onOpenAutoFocus:
|
|
33
|
-
className:
|
|
34
|
-
children: /* @__PURE__ */
|
|
29
|
+
align: h,
|
|
30
|
+
side: A(v),
|
|
31
|
+
collisionPadding: O[S] + 8,
|
|
32
|
+
onOpenAutoFocus: g,
|
|
33
|
+
className: n.portal,
|
|
34
|
+
children: /* @__PURE__ */ r(
|
|
35
35
|
"ul",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
37
|
+
className: n.menu,
|
|
38
38
|
...c({}, { suppressRefError: !0 }),
|
|
39
|
-
"data-has-interacted":
|
|
39
|
+
"data-has-interacted": P ? "true" : "false",
|
|
40
40
|
"data-test-id": "fondue-select-menu",
|
|
41
|
-
children:
|
|
42
|
-
|
|
43
|
-
(e,
|
|
44
|
-
if (((
|
|
41
|
+
children: E(
|
|
42
|
+
f,
|
|
43
|
+
(e, s) => {
|
|
44
|
+
if (((t) => (
|
|
45
45
|
// @ts-expect-error - We are explicitly checking for ref
|
|
46
|
-
|
|
46
|
+
D(t) && t.ref !== void 0
|
|
47
47
|
))(e)) {
|
|
48
|
-
const
|
|
49
|
-
item:
|
|
50
|
-
index:
|
|
48
|
+
const t = F(e.props), a = m({
|
|
49
|
+
item: t,
|
|
50
|
+
index: s,
|
|
51
51
|
...e.ref ? { ref: e.ref } : {}
|
|
52
|
-
}),
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
}), l = (o == null ? void 0 : o.value) === t.value;
|
|
53
|
+
return /* @__PURE__ */ r(
|
|
54
54
|
V,
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
"data-highlighted": p ===
|
|
58
|
-
"data-selected":
|
|
56
|
+
className: n.item,
|
|
57
|
+
"data-highlighted": p === s,
|
|
58
|
+
"data-selected": l,
|
|
59
59
|
onTouchStart: (C) => {
|
|
60
60
|
a.onClick && a.onClick(C);
|
|
61
61
|
},
|
|
62
62
|
...a,
|
|
63
|
-
"aria-selected":
|
|
63
|
+
"aria-selected": l,
|
|
64
64
|
children: e
|
|
65
65
|
},
|
|
66
66
|
e.props.value
|
|
@@ -74,8 +74,8 @@ const E = ({
|
|
|
74
74
|
}
|
|
75
75
|
) }) });
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
R.displayName = "Select.Menu";
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
R as SelectMenu
|
|
80
80
|
};
|
|
81
81
|
//# sourceMappingURL=fondue-components68.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components68.js","sources":["../src/components/Select/SelectMenu.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type UseComboboxPropGetters, type UseSelectPropGetters } from 'downshift';\nimport { isValidElement, type ForwardedRef, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { type SelectItemProps } from './SelectItem';\nimport styles from './styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from './utils';\n\nexport type SelectMenuViewportCollisionPadding = 'compact' | 'spacious';\n\nexport type SelectMenuProps = {\n /**\n * @internal\n * The index of the highlighted item in the menu.\n */\n highlightedIndex: number;\n /**\n * @internal\n * Callback function to retrieve the props for a menu element.\n */\n getMenuProps: UseSelectPropGetters<unknown>['getMenuProps'] | UseComboboxPropGetters<unknown>['getMenuProps'];\n /**\n * @internal\n * Callback function to retrieve the props for a item element.\n */\n getItemProps: UseSelectPropGetters<unknown>['getItemProps'] | UseComboboxPropGetters<unknown>['getItemProps'];\n /**\n * @internal\n * The children of the menu component. This can contain multiple `Select.Item` or `Select.Group` components.\n */\n children: ReactNode;\n /**\n * @internal\n * The filter text shown in the combobox input element.\n */\n filterText?: string;\n /**\n * @internal\n * The alignment of the menu.\n */\n align: 'start' | 'center' | 'end';\n /**\n * @internal\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 * @internal\n * The type of the menu.\n */\n selectedItem?: {\n value: string;\n } | null;\n /**\n * @internal\n * A boolean to indicate if highlighted item was changed since opening the menu.\n * This is used to determine the style of the selected/highlighted item.\n */\n hasInteractedSinceOpening?: boolean;\n /**\n * Define the minimum distance between the select menu and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: SelectMenuViewportCollisionPadding;\n};\n\nexport const SelectMenu = ({\n highlightedIndex,\n getMenuProps,\n getItemProps,\n children,\n filterText,\n align,\n side,\n selectedItem,\n hasInteractedSinceOpening,\n viewportCollisionPadding = 'compact',\n}: SelectMenuProps) => {\n const handleOnOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n };\n\n const VIEWPORT_COLLISION_PADDING_MAP: Record<SelectMenuViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n };\n\n const theme = useFondueTheme();\n return (\n <RadixPopover.Portal>\n <ThemeProvider theme={theme}>\n <RadixPopover.Content\n align={align}\n side={side}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding] + 8}\n onOpenAutoFocus={handleOnOpenAutoFocus}\n className={styles.portal}\n >\n <ul\n className={styles.menu}\n // TODO: fix this accessibility issue\n // We are mounting/unmounting the menu on open/close\n // We should instead toggle its visibility for accessibility reasons\n // https://github.com/downshift-js/downshift?tab=readme-ov-file#getmenuprops\n {...getMenuProps({}, { suppressRefError: true })}\n data-has-interacted={hasInteractedSinceOpening ? 'true' : 'false'}\n data-test-id=\"fondue-select-menu\"\n >\n {\n recursiveMap(\n children,\n (child, index) => {\n const isValid = <TProps,>(\n child: ReactNode,\n ): child is ReactElement<TProps> & { ref: ForwardedRef<HTMLElement> } =>\n // @ts-expect-error - We are explicitly checking for ref\n isValidElement<TProps>(child) && child.ref !== undefined;\n\n if (isValid<SelectItemProps>(child)) {\n const optionData = getSelectOptionValue(child.props);\n const itemProps = getItemProps({\n item: optionData,\n index,\n ...(child.ref ? { ref: child.ref } : {}),\n });\n\n const isSelected = selectedItem?.value === optionData.value;\n\n return (\n <RadixSlot\n className={styles.item}\n data-highlighted={highlightedIndex === index}\n data-selected={isSelected}\n key={child.props.value}\n // Workaround for the issue where the onClick event is not fired on touch devices because of portal usage\n onTouchStart={(event) => {\n if (itemProps.onClick) {\n itemProps.onClick(event as unknown as MouseEvent<HTMLElement>);\n }\n }}\n {...itemProps}\n aria-selected={isSelected}\n >\n {child}\n </RadixSlot>\n );\n }\n },\n filterText,\n ).parsedChildren\n }\n </ul>\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nSelectMenu.displayName = 'Select.Menu';\n"],"names":["SelectMenu","highlightedIndex","getMenuProps","getItemProps","children","filterText","align","side","selectedItem","hasInteractedSinceOpening","viewportCollisionPadding","handleOnOpenAutoFocus","event","VIEWPORT_COLLISION_PADDING_MAP","theme","useFondueTheme","RadixPopover","jsx","ThemeProvider","styles","recursiveMap","child","index","isValidElement","optionData","getSelectOptionValue","itemProps","isSelected","RadixSlot"],"mappings":";;;;;;;AAwEO,MAAMA,IAAa,CAAC;AAAA,EACvB,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,0BAAAC,IAA2B;AAC/B,MAAuB;AACnB,QAAMC,IAAwB,CAACC,MAAiB;AAC5C,IAAAA,EAAM,eAAA;AAAA,EACV,GAEMC,IAAqF;AAAA,IACvF,SAAS;AAAA,IACT,UAAU;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"fondue-components68.js","sources":["../src/components/Select/SelectMenu.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { Slot as RadixSlot } from '@radix-ui/react-slot';\nimport { type UseComboboxPropGetters, type UseSelectPropGetters } from 'downshift';\nimport { isValidElement, type ForwardedRef, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { type SelectItemProps } from './SelectItem';\nimport styles from './styles/select.module.scss';\nimport { getSelectOptionValue, recursiveMap } from './utils';\n\nexport type SelectMenuViewportCollisionPadding = 'compact' | 'spacious';\n\nexport type SelectMenuProps = {\n /**\n * @internal\n * The index of the highlighted item in the menu.\n */\n highlightedIndex: number;\n /**\n * @internal\n * Callback function to retrieve the props for a menu element.\n */\n getMenuProps: UseSelectPropGetters<unknown>['getMenuProps'] | UseComboboxPropGetters<unknown>['getMenuProps'];\n /**\n * @internal\n * Callback function to retrieve the props for a item element.\n */\n getItemProps: UseSelectPropGetters<unknown>['getItemProps'] | UseComboboxPropGetters<unknown>['getItemProps'];\n /**\n * @internal\n * The children of the menu component. This can contain multiple `Select.Item` or `Select.Group` components.\n */\n children: ReactNode;\n /**\n * @internal\n * The filter text shown in the combobox input element.\n */\n filterText?: string;\n /**\n * @internal\n * The alignment of the menu.\n */\n align: 'start' | 'center' | 'end';\n /**\n * @internal\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 * @internal\n * The type of the menu.\n */\n selectedItem?: {\n value: string;\n } | null;\n /**\n * @internal\n * A boolean to indicate if highlighted item was changed since opening the menu.\n * This is used to determine the style of the selected/highlighted item.\n */\n hasInteractedSinceOpening?: boolean;\n /**\n * Define the minimum distance between the select menu and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: SelectMenuViewportCollisionPadding;\n};\n\nexport const SelectMenu = ({\n highlightedIndex,\n getMenuProps,\n getItemProps,\n children,\n filterText,\n align,\n side,\n selectedItem,\n hasInteractedSinceOpening,\n viewportCollisionPadding = 'compact',\n}: SelectMenuProps) => {\n const handleOnOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n };\n\n const VIEWPORT_COLLISION_PADDING_MAP: Record<SelectMenuViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n };\n\n const { theme, dir } = useFondueTheme();\n\n const getAdjustedSide = (side: 'left' | 'right' | 'bottom' | 'top') => {\n if (dir === 'ltr') {\n return side;\n }\n\n if (side === 'left') {\n return 'right';\n }\n if (side === 'right') {\n return 'left';\n }\n\n return side;\n };\n\n return (\n <RadixPopover.Portal>\n <ThemeProvider theme={theme} dir={dir}>\n <RadixPopover.Content\n align={align}\n side={getAdjustedSide(side)}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding] + 8}\n onOpenAutoFocus={handleOnOpenAutoFocus}\n className={styles.portal}\n >\n <ul\n className={styles.menu}\n // TODO: fix this accessibility issue\n // We are mounting/unmounting the menu on open/close\n // We should instead toggle its visibility for accessibility reasons\n // https://github.com/downshift-js/downshift?tab=readme-ov-file#getmenuprops\n {...getMenuProps({}, { suppressRefError: true })}\n data-has-interacted={hasInteractedSinceOpening ? 'true' : 'false'}\n data-test-id=\"fondue-select-menu\"\n >\n {\n recursiveMap(\n children,\n (child, index) => {\n const isValid = <TProps,>(\n child: ReactNode,\n ): child is ReactElement<TProps> & { ref: ForwardedRef<HTMLElement> } =>\n // @ts-expect-error - We are explicitly checking for ref\n isValidElement<TProps>(child) && child.ref !== undefined;\n\n if (isValid<SelectItemProps>(child)) {\n const optionData = getSelectOptionValue(child.props);\n const itemProps = getItemProps({\n item: optionData,\n index,\n ...(child.ref ? { ref: child.ref } : {}),\n });\n\n const isSelected = selectedItem?.value === optionData.value;\n\n return (\n <RadixSlot\n className={styles.item}\n data-highlighted={highlightedIndex === index}\n data-selected={isSelected}\n key={child.props.value}\n // Workaround for the issue where the onClick event is not fired on touch devices because of portal usage\n onTouchStart={(event) => {\n if (itemProps.onClick) {\n itemProps.onClick(event as unknown as MouseEvent<HTMLElement>);\n }\n }}\n {...itemProps}\n aria-selected={isSelected}\n >\n {child}\n </RadixSlot>\n );\n }\n },\n filterText,\n ).parsedChildren\n }\n </ul>\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nSelectMenu.displayName = 'Select.Menu';\n"],"names":["SelectMenu","highlightedIndex","getMenuProps","getItemProps","children","filterText","align","side","selectedItem","hasInteractedSinceOpening","viewportCollisionPadding","handleOnOpenAutoFocus","event","VIEWPORT_COLLISION_PADDING_MAP","theme","dir","useFondueTheme","getAdjustedSide","RadixPopover","jsx","ThemeProvider","styles","recursiveMap","child","index","isValidElement","optionData","getSelectOptionValue","itemProps","isSelected","RadixSlot"],"mappings":";;;;;;;AAwEO,MAAMA,IAAa,CAAC;AAAA,EACvB,kBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,0BAAAC,IAA2B;AAC/B,MAAuB;AACnB,QAAMC,IAAwB,CAACC,MAAiB;AAC5C,IAAAA,EAAM,eAAA;AAAA,EACV,GAEMC,IAAqF;AAAA,IACvF,SAAS;AAAA,IACT,UAAU;AAAA,EAAA,GAGR,EAAE,OAAAC,GAAO,KAAAC,EAAA,IAAQC,EAAA,GAEjBC,IAAkB,CAACV,MACjBQ,MAAQ,QACDR,IAGPA,MAAS,SACF,UAEPA,MAAS,UACF,SAGJA;AAGX,2BACKW,EAAa,QAAb,EACG,UAAA,gBAAAC,EAACC,GAAA,EAAc,OAAAN,GAAc,KAAAC,GACzB,UAAA,gBAAAI;AAAA,IAACD,EAAa;AAAA,IAAb;AAAA,MACG,OAAAZ;AAAA,MACA,MAAMW,EAAgBV,CAAI;AAAA,MAC1B,kBAAkBM,EAA+BH,CAAwB,IAAI;AAAA,MAC7E,iBAAiBC;AAAA,MACjB,WAAWU,EAAO;AAAA,MAElB,UAAA,gBAAAF;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAWE,EAAO;AAAA,UAKjB,GAAGnB,EAAa,CAAA,GAAI,EAAE,kBAAkB,IAAM;AAAA,UAC/C,uBAAqBO,IAA4B,SAAS;AAAA,UAC1D,gBAAa;AAAA,UAGT,UAAAa;AAAA,YACIlB;AAAA,YACA,CAACmB,GAAOC,MAAU;AAOd,mBANgB,CACZD;AAAAA;AAAAA,gBAGAE,EAAuBF,CAAK,KAAKA,EAAM,QAAQ;AAAA,iBAEtBA,CAAK,GAAG;AACjC,sBAAMG,IAAaC,EAAqBJ,EAAM,KAAK,GAC7CK,IAAYzB,EAAa;AAAA,kBAC3B,MAAMuB;AAAA,kBACN,OAAAF;AAAA,kBACA,GAAID,EAAM,MAAM,EAAE,KAAKA,EAAM,IAAA,IAAQ,CAAA;AAAA,gBAAC,CACzC,GAEKM,KAAarB,KAAA,gBAAAA,EAAc,WAAUkB,EAAW;AAEtD,uBACI,gBAAAP;AAAA,kBAACW;AAAAA,kBAAA;AAAA,oBACG,WAAWT,EAAO;AAAA,oBAClB,oBAAkBpB,MAAqBuB;AAAA,oBACvC,iBAAeK;AAAA,oBAGf,cAAc,CAACjB,MAAU;AACrB,sBAAIgB,EAAU,WACVA,EAAU,QAAQhB,CAA2C;AAAA,oBAErE;AAAA,oBACC,GAAGgB;AAAA,oBACJ,iBAAeC;AAAA,oBAEd,UAAAN;AAAA,kBAAA;AAAA,kBAVIA,EAAM,MAAM;AAAA,gBAAA;AAAA,cAa7B;AAAA,YACJ;AAAA,YACAlB;AAAA,UAAA,EACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAEV;AAAA,EAAA,GAER,EAAA,CACJ;AAER;AACAL,EAAW,cAAc;"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
selectedValue:
|
|
4
|
-
input:
|
|
5
|
-
slot:
|
|
6
|
-
clear:
|
|
7
|
-
clearIcon:
|
|
8
|
-
icons:
|
|
9
|
-
caret:
|
|
1
|
+
const n = "_root_1a48n_7", c = "_selectedValue_1a48n_57", o = "_input_1a48n_74", _ = "_slot_1a48n_100", e = "_clear_1a48n_150", t = "_clearIcon_1a48n_157", a = "_icons_1a48n_161", s = "_caret_1a48n_167", r = "_iconSuccess_1a48n_195", l = "_iconError_1a48n_201", u = "_menu_1a48n_207", i = "_portal_1a48n_230", p = "_item_1a48n_246", m = "_checkmarkIcon_1a48n_276", g = "_itemValue_1a48n_283", d = "_group_1a48n_297", k = "_groupHeading_1a48n_308", I = {
|
|
2
|
+
root: n,
|
|
3
|
+
selectedValue: c,
|
|
4
|
+
input: o,
|
|
5
|
+
slot: _,
|
|
6
|
+
clear: e,
|
|
7
|
+
clearIcon: t,
|
|
8
|
+
icons: a,
|
|
9
|
+
caret: s,
|
|
10
10
|
iconSuccess: r,
|
|
11
|
-
iconError:
|
|
12
|
-
menu:
|
|
13
|
-
portal:
|
|
14
|
-
item:
|
|
15
|
-
checkmarkIcon:
|
|
16
|
-
itemValue:
|
|
17
|
-
group:
|
|
18
|
-
groupHeading:
|
|
11
|
+
iconError: l,
|
|
12
|
+
menu: u,
|
|
13
|
+
portal: i,
|
|
14
|
+
item: p,
|
|
15
|
+
checkmarkIcon: m,
|
|
16
|
+
itemValue: g,
|
|
17
|
+
group: d,
|
|
18
|
+
groupHeading: k
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
s as caret,
|
|
22
|
+
m as checkmarkIcon,
|
|
23
|
+
e as clear,
|
|
24
|
+
t as clearIcon,
|
|
25
|
+
I as default,
|
|
26
|
+
d as group,
|
|
27
|
+
k as groupHeading,
|
|
28
|
+
l as iconError,
|
|
29
29
|
r as iconSuccess,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
a as icons,
|
|
31
|
+
o as input,
|
|
32
|
+
p as item,
|
|
33
|
+
g as itemValue,
|
|
34
|
+
u as menu,
|
|
35
|
+
i as portal,
|
|
36
|
+
n as root,
|
|
37
|
+
c as selectedValue,
|
|
38
|
+
_ as slot
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=fondue-components70.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { useState as S, useMemo as b, Children as v, isValidElement as C, cloneElement as w, useCallback as B, useEffect as x } from "react";
|
|
3
|
-
import { SelectClear as F } from "./fondue-
|
|
3
|
+
import { SelectClear as F } from "./fondue-components90.js";
|
|
4
4
|
import { ForwardedRefSelectItem as L } from "./fondue-components67.js";
|
|
5
5
|
import { ForwardedRefSelectSlot as y } from "./fondue-components69.js";
|
|
6
|
-
import { getSelectOptionValue as I } from "./fondue-
|
|
6
|
+
import { getSelectOptionValue as I } from "./fondue-components89.js";
|
|
7
7
|
const O = (n, s) => {
|
|
8
8
|
const [e, r] = S(!1), [m, i] = S(null), [l, f] = S({
|
|
9
9
|
menuComponents: [],
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
1
|
+
const s = "_root_6is9j_5", t = "_small_6is9j_16", _ = "_medium_6is9j_20", o = "_large_6is9j_24", m = "_thumb_6is9j_61", l = {
|
|
2
|
+
root: s,
|
|
3
3
|
small: t,
|
|
4
4
|
medium: _,
|
|
5
|
-
large:
|
|
6
|
-
thumb:
|
|
5
|
+
large: o,
|
|
6
|
+
thumb: m
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
l as default,
|
|
10
|
+
o as large,
|
|
11
11
|
_ as medium,
|
|
12
|
-
|
|
12
|
+
s as root,
|
|
13
13
|
t as small,
|
|
14
|
-
|
|
14
|
+
m as thumb
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=fondue-components73.js.map
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_table_n4gw5_4", n = "_headerCell_n4gw5_18", o = "_rowCell_n4gw5_19", e = "_caption_n4gw5_61", _ = "_header_n4gw5_18", l = "_cellContent_n4gw5_93", c = "_sortIndicator_n4gw5_118", r = "_body_n4gw5_122", a = "_row_n4gw5_19", s = "_buttonText_n4gw5_186", w = {
|
|
2
2
|
table: t,
|
|
3
|
-
headerCell:
|
|
4
|
-
rowCell:
|
|
5
|
-
caption:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
headerCell: n,
|
|
4
|
+
rowCell: o,
|
|
5
|
+
caption: e,
|
|
6
|
+
header: _,
|
|
7
|
+
cellContent: l,
|
|
8
|
+
sortIndicator: c,
|
|
9
|
+
body: r,
|
|
10
|
+
row: a,
|
|
10
11
|
buttonText: s
|
|
11
12
|
};
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
r as body,
|
|
14
15
|
s as buttonText,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
e as caption,
|
|
17
|
+
l as cellContent,
|
|
18
|
+
w as default,
|
|
19
|
+
_ as header,
|
|
20
|
+
n as headerCell,
|
|
21
|
+
a as row,
|
|
22
|
+
o as rowCell,
|
|
23
|
+
c as sortIndicator,
|
|
22
24
|
t as table
|
|
23
25
|
};
|
|
24
26
|
//# sourceMappingURL=fondue-components75.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components75.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components75.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
mainContent:
|
|
1
|
+
const n = "_root_1nybm_3", t = "_mainContent_1nybm_15", o = "_actionButton_1nybm_28", e = "_secondaryContent_1nybm_123", _ = {
|
|
2
|
+
root: n,
|
|
3
|
+
mainContent: t,
|
|
4
4
|
actionButton: o,
|
|
5
|
-
secondaryContent:
|
|
5
|
+
secondaryContent: e
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
o as actionButton,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
_ as default,
|
|
10
|
+
t as mainContent,
|
|
11
|
+
n as root,
|
|
12
|
+
e as secondaryContent
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=fondue-components77.js.map
|