@frontify/fondue-components 13.0.2 → 14.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-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 +71 -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 +134 -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 +43 -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 +194 -58
- package/dist/style.css +1 -1
- package/package.json +6 -5
|
@@ -1,58 +1,60 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
2
|
+
import { Accordion as t } from "./fondue-components3.js";
|
|
3
|
+
import { Box as m } from "./fondue-components4.js";
|
|
4
|
+
import { Button as f } from "./fondue-components5.js";
|
|
5
|
+
import { Checkbox as l } from "./fondue-components6.js";
|
|
6
|
+
import { ColorPicker as d } from "./fondue-components7.js";
|
|
7
|
+
import { Dialog as c } from "./fondue-components8.js";
|
|
8
|
+
import { Divider as S } from "./fondue-components9.js";
|
|
9
|
+
import { Dropdown as h } from "./fondue-components10.js";
|
|
10
|
+
import { Flex as C } from "./fondue-components11.js";
|
|
11
|
+
import { Flyout as B } from "./fondue-components12.js";
|
|
12
|
+
import { Grid as F } from "./fondue-components13.js";
|
|
13
|
+
import { Heading as k } from "./fondue-components14.js";
|
|
14
|
+
import { Label as v } from "./fondue-components15.js";
|
|
15
|
+
import { LoadingBar as A } from "./fondue-components16.js";
|
|
16
|
+
import { LoadingCircle as y } from "./fondue-components17.js";
|
|
17
|
+
import { ScrollArea as H } from "./fondue-components18.js";
|
|
18
|
+
import { Section as j } from "./fondue-components19.js";
|
|
19
|
+
import { SegmentedControl as z } from "./fondue-components20.js";
|
|
20
|
+
import { Select as J } from "./fondue-components21.js";
|
|
21
|
+
import { Slider as M } from "./fondue-components22.js";
|
|
22
|
+
import { Switch as O } from "./fondue-components23.js";
|
|
23
|
+
import { Table as R } from "./fondue-components24.js";
|
|
24
|
+
import { Tabs as V } from "./fondue-components25.js";
|
|
25
|
+
import { Text as X } from "./fondue-components26.js";
|
|
26
|
+
import { TextInput as Z } from "./fondue-components27.js";
|
|
27
|
+
import { ThemeContext as $, ThemeProvider as oo, useFondueTheme as ro } from "./fondue-components28.js";
|
|
28
|
+
import { Tooltip as to } from "./fondue-components29.js";
|
|
28
29
|
export {
|
|
29
|
-
t as
|
|
30
|
-
m as
|
|
31
|
-
f as
|
|
32
|
-
l as
|
|
33
|
-
d as
|
|
34
|
-
|
|
35
|
-
S as
|
|
36
|
-
h as
|
|
37
|
-
C as
|
|
38
|
-
B as
|
|
39
|
-
F as
|
|
40
|
-
k as
|
|
41
|
-
v as
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
H as
|
|
45
|
-
j as
|
|
46
|
-
z as
|
|
47
|
-
J as
|
|
48
|
-
M as
|
|
49
|
-
O as
|
|
50
|
-
R as
|
|
51
|
-
V as
|
|
52
|
-
X as
|
|
53
|
-
Z as
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
30
|
+
t as Accordion,
|
|
31
|
+
m as Box,
|
|
32
|
+
f as Button,
|
|
33
|
+
l as Checkbox,
|
|
34
|
+
d as ColorPicker,
|
|
35
|
+
c as Dialog,
|
|
36
|
+
S as Divider,
|
|
37
|
+
h as Dropdown,
|
|
38
|
+
C as Flex,
|
|
39
|
+
B as Flyout,
|
|
40
|
+
F as Grid,
|
|
41
|
+
k as Heading,
|
|
42
|
+
v as Label,
|
|
43
|
+
A as LoadingBar,
|
|
44
|
+
y as LoadingCircle,
|
|
45
|
+
H as ScrollArea,
|
|
46
|
+
j as Section,
|
|
47
|
+
z as SegmentedControl,
|
|
48
|
+
J as Select,
|
|
49
|
+
M as Slider,
|
|
50
|
+
O as Switch,
|
|
51
|
+
R as Table,
|
|
52
|
+
V as Tabs,
|
|
53
|
+
X as Text,
|
|
54
|
+
Z as TextInput,
|
|
55
|
+
$ as ThemeContext,
|
|
56
|
+
oo as ThemeProvider,
|
|
57
|
+
to as Tooltip,
|
|
58
|
+
ro as useFondueTheme
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=fondue-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,40 +1,130 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx as d, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretRight as I } from "@frontify/fondue-icons";
|
|
3
|
+
import * as n from "@radix-ui/react-dropdown-menu";
|
|
4
|
+
import { forwardRef as i } from "react";
|
|
5
|
+
import { useFondueTheme as w, ThemeProvider as f } from "./fondue-components28.js";
|
|
6
|
+
import { useProcessedChildren as g } from "./fondue-components47.js";
|
|
7
|
+
import a from "./fondue-components48.js";
|
|
8
|
+
const D = ({
|
|
9
|
+
children: t,
|
|
10
|
+
open: o,
|
|
11
|
+
modal: e = !1,
|
|
12
|
+
onOpenChange: r,
|
|
13
|
+
"data-test-id": s = "fondue-dropdown"
|
|
14
|
+
}) => /* @__PURE__ */ d(n.Root, { open: o, modal: e, onOpenChange: r, "data-test-id": s, children: t });
|
|
15
|
+
D.displayName = "Dropdown.Root";
|
|
16
|
+
const b = ({
|
|
17
|
+
asChild: t = !0,
|
|
18
|
+
children: o,
|
|
19
|
+
"data-test-id": e = "fondue-dropdown-trigger",
|
|
20
|
+
...r
|
|
21
|
+
}, s) => /* @__PURE__ */ d(n.Trigger, { asChild: t, "data-test-id": e, ref: s, ...r, children: o });
|
|
22
|
+
b.displayName = "Dropdown.Trigger";
|
|
23
|
+
const P = {
|
|
24
|
+
compact: 8,
|
|
25
|
+
comfortable: 12,
|
|
26
|
+
spacious: 16
|
|
27
|
+
}, S = ({
|
|
28
|
+
side: t = "bottom",
|
|
29
|
+
align: o = "start",
|
|
30
|
+
triggerOffset: e = "compact",
|
|
31
|
+
children: r,
|
|
32
|
+
preventTriggerFocusOnClose: s,
|
|
33
|
+
"data-test-id": p = "fondue-dropdown-content"
|
|
34
|
+
}, u) => {
|
|
35
|
+
const c = w();
|
|
36
|
+
return /* @__PURE__ */ d(n.Portal, { children: /* @__PURE__ */ d(f, { theme: c, children: /* @__PURE__ */ d(
|
|
37
|
+
n.Content,
|
|
20
38
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ref: f,
|
|
39
|
+
align: o,
|
|
40
|
+
collisionPadding: 8,
|
|
41
|
+
sideOffset: P[e],
|
|
42
|
+
side: t,
|
|
43
|
+
className: a.content,
|
|
44
|
+
"data-test-id": p,
|
|
45
|
+
ref: u,
|
|
46
|
+
onCloseAutoFocus: (l) => {
|
|
47
|
+
s && l.preventDefault();
|
|
48
|
+
},
|
|
32
49
|
children: r
|
|
33
50
|
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
) }) });
|
|
52
|
+
};
|
|
53
|
+
S.displayName = "Dropdown.Content";
|
|
54
|
+
const N = ({ children: t, heading: o, "data-test-id": e = "fondue-dropdown-group" }, r) => /* @__PURE__ */ m(n.Group, { className: a.group, "data-test-id": e, ref: r, children: [
|
|
55
|
+
o ? /* @__PURE__ */ d("div", { className: a.groupHeading, children: /* @__PURE__ */ d("span", { "aria-label": o, children: o }) }) : null,
|
|
56
|
+
t
|
|
57
|
+
] });
|
|
58
|
+
N.displayName = "Dropdown.Group";
|
|
59
|
+
const C = ({
|
|
60
|
+
children: t,
|
|
61
|
+
"data-test-id": o = "fondue-dropdown-submenu"
|
|
62
|
+
}) => /* @__PURE__ */ d(n.Sub, { "data-test-id": o, children: t });
|
|
63
|
+
C.displayName = "Dropdown.SubMenu";
|
|
64
|
+
const h = ({ children: t, "data-test-id": o = "fondue-dropdown-subtrigger" }, e) => {
|
|
65
|
+
const { content: r } = g(t);
|
|
66
|
+
return /* @__PURE__ */ m(n.SubTrigger, { className: a.subTrigger, "data-test-id": o, ref: e, children: [
|
|
67
|
+
r,
|
|
68
|
+
/* @__PURE__ */ d(I, { className: a.subMenuIndicator, size: 16 })
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
h.displayName = "Dropdown.SubTrigger";
|
|
72
|
+
const R = ({ children: t, "data-test-id": o = "fondue-dropdown-subcontent" }, e) => {
|
|
73
|
+
const r = w();
|
|
74
|
+
return /* @__PURE__ */ d(n.Portal, { children: /* @__PURE__ */ d(f, { theme: r, children: /* @__PURE__ */ d(n.SubContent, { className: a.subContent, "data-test-id": o, ref: e, children: t }) }) });
|
|
75
|
+
};
|
|
76
|
+
R.displayName = "Dropdown.SubContent";
|
|
77
|
+
const T = ({
|
|
78
|
+
children: t,
|
|
79
|
+
disabled: o,
|
|
80
|
+
textValue: e,
|
|
81
|
+
onSelect: r,
|
|
82
|
+
emphasis: s = "default",
|
|
83
|
+
asChild: p = !1,
|
|
84
|
+
"data-test-id": u = "fondue-dropdown-subtrigger",
|
|
85
|
+
...c
|
|
86
|
+
}, l) => {
|
|
87
|
+
const { content: F } = g(t);
|
|
88
|
+
return /* @__PURE__ */ d(
|
|
89
|
+
n.Item,
|
|
90
|
+
{
|
|
91
|
+
onSelect: r,
|
|
92
|
+
className: a.item,
|
|
93
|
+
textValue: e,
|
|
94
|
+
"data-test-id": u,
|
|
95
|
+
"data-emphasis": s,
|
|
96
|
+
ref: l,
|
|
97
|
+
disabled: o,
|
|
98
|
+
asChild: p,
|
|
99
|
+
...c,
|
|
100
|
+
children: F
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
T.displayName = "Dropdown.Item";
|
|
105
|
+
const y = ({ children: t, name: o, "data-test-id": e = "fondue-dropdown-slot" }, r) => /* @__PURE__ */ d("div", { "data-name": o, className: a.slot, "data-test-id": e, ref: r, children: t });
|
|
106
|
+
y.displayName = "Dropdown.Slot";
|
|
107
|
+
const G = i(b), M = i(S), v = i(N), x = i(h), A = i(R), j = i(T), z = i(y), E = {
|
|
108
|
+
Root: D,
|
|
109
|
+
Trigger: G,
|
|
110
|
+
Content: M,
|
|
111
|
+
Group: v,
|
|
112
|
+
SubMenu: C,
|
|
113
|
+
SubTrigger: x,
|
|
114
|
+
SubContent: A,
|
|
115
|
+
Item: j,
|
|
116
|
+
Slot: z
|
|
117
|
+
};
|
|
37
118
|
export {
|
|
38
|
-
|
|
119
|
+
E as Dropdown,
|
|
120
|
+
S as DropdownContent,
|
|
121
|
+
N as DropdownGroup,
|
|
122
|
+
T as DropdownItem,
|
|
123
|
+
D as DropdownRoot,
|
|
124
|
+
y as DropdownSlot,
|
|
125
|
+
R as DropdownSubContent,
|
|
126
|
+
C as DropdownSubMenu,
|
|
127
|
+
h as DropdownSubTrigger,
|
|
128
|
+
b as DropdownTrigger
|
|
39
129
|
};
|
|
40
130
|
//# sourceMappingURL=fondue-components10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components10.js","sources":["../src/components/Flex/Flex.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/flex.module.scss';\n\nexport type FlexProps = LayoutComponentProps & {\n /**\n * The element to render the Flex component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n /**\n * The display property.\n * @default 'flex'\n */\n display?: Responsive<'none' | 'flex' | 'inline-flex'>;\n /**\n * The direction of the children.\n * @default 'row'\n */\n direction?: Responsive<'row' | 'row-reverse' | 'column' | 'column-reverse'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;\n /**\n * The wrap property.\n */\n wrap?: Responsive<'nowrap' | 'wrap' | 'wrap-reverse'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-flex',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-content' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nFlex.displayName = 'Flex';\n"],"names":["Flex","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAuDO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACG,WAAWa,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,GAAO,EAAE,SAAS,mBAAmB;AAAA,MAChE,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EACL;AAGZ;AACAJ,EAAK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"fondue-components10.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.\n * @default false\n */\n modal?: boolean;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n modal = false,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} modal={modal} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\ntype DropdownSpacing = 'compact' | 'comfortable' | 'spacious';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: DropdownSpacing;\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nconst SPACING_MAP: Record<DropdownSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n align = 'start',\n triggerOffset = 'compact',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={side}\n className={styles.content}\n data-test-id={dataTestId}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </ThemeProvider>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; heading?: string; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, heading, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {heading ? (\n <div className={styles.groupHeading}>\n <span aria-label={heading}>{heading}</span>\n </div>\n ) : null}\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subcontent' }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixDropdown.Portal>\n <ThemeProvider theme={theme}>\n <RadixDropdown.SubContent className={styles.subContent} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.SubContent>\n </ThemeProvider>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n /**\n * If true, the item props will be passed to the child element.\n * @default false\n */\n asChild?: boolean;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n asChild = false,\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild={asChild}\n {...props}\n >\n {content}\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","modal","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","SPACING_MAP","DropdownContent","side","align","triggerOffset","preventTriggerFocusOnClose","theme","useFondueTheme","ThemeProvider","styles","event","DropdownGroup","heading","jsxs","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":"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"}
|
|
@@ -1,88 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { propsToCssVariables as y } from "./fondue-components31.js";
|
|
4
|
+
import x from "./fondue-components49.js";
|
|
5
|
+
const u = n(
|
|
6
|
+
({
|
|
7
|
+
as: a = "div",
|
|
8
|
+
"data-test-id": e = "fondue-flex",
|
|
9
|
+
children: r,
|
|
10
|
+
role: i,
|
|
11
|
+
"aria-label": d,
|
|
12
|
+
"aria-hidden": s,
|
|
13
|
+
"aria-describedby": t,
|
|
14
|
+
"aria-labelledby": o,
|
|
15
|
+
"aria-expanded": l,
|
|
16
|
+
"aria-haspopup": p,
|
|
17
|
+
...b
|
|
18
|
+
}, f) => /* @__PURE__ */ m(
|
|
19
|
+
a,
|
|
20
|
+
{
|
|
21
|
+
className: x.root,
|
|
22
|
+
"data-test-id": e,
|
|
23
|
+
style: y(b, { justify: "justify-content" }),
|
|
24
|
+
role: i,
|
|
25
|
+
"aria-label": d,
|
|
26
|
+
"aria-hidden": s,
|
|
27
|
+
"aria-describedby": t,
|
|
28
|
+
"aria-labelledby": o,
|
|
29
|
+
"aria-expanded": l,
|
|
30
|
+
"aria-haspopup": p,
|
|
31
|
+
ref: f,
|
|
32
|
+
children: r
|
|
33
|
+
}
|
|
34
|
+
)
|
|
22
35
|
);
|
|
23
|
-
|
|
24
|
-
const y = ({
|
|
25
|
-
align: t = "start",
|
|
26
|
-
maxWidth: o = "360px",
|
|
27
|
-
padding: e = "compact",
|
|
28
|
-
rounded: r = "medium",
|
|
29
|
-
width: u = "fit-content",
|
|
30
|
-
shadow: F = "medium",
|
|
31
|
-
"data-test-id": g = "fondue-flyout-content",
|
|
32
|
-
children: h,
|
|
33
|
-
...N
|
|
34
|
-
}, v) => {
|
|
35
|
-
const R = b();
|
|
36
|
-
return /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ l(T, { theme: R, children: [
|
|
37
|
-
/* @__PURE__ */ a("div", { className: d.overlay }),
|
|
38
|
-
/* @__PURE__ */ a(
|
|
39
|
-
i.Content,
|
|
40
|
-
{
|
|
41
|
-
style: {
|
|
42
|
-
"--flyout-max-width": o,
|
|
43
|
-
"--flyout-width": u
|
|
44
|
-
},
|
|
45
|
-
ref: v,
|
|
46
|
-
align: t,
|
|
47
|
-
collisionPadding: 8,
|
|
48
|
-
sideOffset: 8,
|
|
49
|
-
className: d.root,
|
|
50
|
-
"data-flyout-spacing": e,
|
|
51
|
-
"data-rounded": r,
|
|
52
|
-
"data-shadow": F,
|
|
53
|
-
"data-test-id": g,
|
|
54
|
-
onFocus: C,
|
|
55
|
-
...N,
|
|
56
|
-
children: h
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
] }) });
|
|
60
|
-
};
|
|
61
|
-
y.displayName = "Flyout.Content";
|
|
62
|
-
const c = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, r) => /* @__PURE__ */ l("div", { "data-test-id": e, ref: r, className: d.header, children: [
|
|
63
|
-
/* @__PURE__ */ a("div", { children: o }),
|
|
64
|
-
t && /* @__PURE__ */ a(i.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(w, { size: 20 }) })
|
|
65
|
-
] });
|
|
66
|
-
c.displayName = "Flyout.Header";
|
|
67
|
-
const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: d.footer, children: t });
|
|
68
|
-
f.displayName = "Flyout.Footer";
|
|
69
|
-
const p = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: d.body, children: t });
|
|
70
|
-
p.displayName = "Flyout.Body";
|
|
71
|
-
const D = {
|
|
72
|
-
Root: n,
|
|
73
|
-
Trigger: s(m),
|
|
74
|
-
Content: s(y),
|
|
75
|
-
Header: s(c),
|
|
76
|
-
Footer: s(f),
|
|
77
|
-
Body: s(p)
|
|
78
|
-
};
|
|
36
|
+
u.displayName = "Flex";
|
|
79
37
|
export {
|
|
80
|
-
|
|
81
|
-
p as FlyoutBody,
|
|
82
|
-
y as FlyoutContent,
|
|
83
|
-
f as FlyoutFooter,
|
|
84
|
-
c as FlyoutHeader,
|
|
85
|
-
n as FlyoutRoot,
|
|
86
|
-
m as FlyoutTrigger
|
|
38
|
+
u as Flex
|
|
87
39
|
};
|
|
88
40
|
//# sourceMappingURL=fondue-components11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components11.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components11.js","sources":["../src/components/Flex/Flex.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/flex.module.scss';\n\nexport type FlexProps = LayoutComponentProps & {\n /**\n * The element to render the Flex component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n /**\n * The display property.\n * @default 'flex'\n */\n display?: Responsive<'none' | 'flex' | 'inline-flex'>;\n /**\n * The direction of the children.\n * @default 'row'\n */\n direction?: Responsive<'row' | 'row-reverse' | 'column' | 'column-reverse'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;\n /**\n * The wrap property.\n */\n wrap?: Responsive<'nowrap' | 'wrap' | 'wrap-reverse'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-flex',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-content' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nFlex.displayName = 'Flex';\n"],"names":["Flex","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAuDO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACG,WAAWa,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,GAAO,EAAE,SAAS,mBAAmB;AAAA,MAChE,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EACL;AAGZ;AACAJ,EAAK,cAAc;"}
|
|
@@ -1,40 +1,93 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"data-test-id": r,
|
|
23
|
-
style: n(b, { justify: "justify-items" }),
|
|
24
|
-
role: e,
|
|
25
|
-
"aria-label": d,
|
|
26
|
-
"aria-hidden": s,
|
|
27
|
-
"aria-describedby": t,
|
|
28
|
-
"aria-labelledby": o,
|
|
29
|
-
"aria-expanded": p,
|
|
30
|
-
"aria-haspopup": l,
|
|
31
|
-
ref: m,
|
|
32
|
-
children: i
|
|
33
|
-
}
|
|
34
|
-
)
|
|
1
|
+
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as b } from "@frontify/fondue-icons";
|
|
3
|
+
import * as i from "@radix-ui/react-popover";
|
|
4
|
+
import { forwardRef as s } from "react";
|
|
5
|
+
import { addAutoFocusAttribute as w, addShowFocusRing as x } from "./fondue-components44.js";
|
|
6
|
+
import { useFondueTheme as P, ThemeProvider as T } from "./fondue-components28.js";
|
|
7
|
+
import d from "./fondue-components50.js";
|
|
8
|
+
const n = ({ children: t, ...o }) => /* @__PURE__ */ a(i.Root, { ...o, children: t });
|
|
9
|
+
n.displayName = "Flyout.Root";
|
|
10
|
+
const c = ({ asChild: t = !0, children: o, "data-test-id": e = "fondue-flyout-trigger", ...r }, u) => /* @__PURE__ */ a(
|
|
11
|
+
i.Trigger,
|
|
12
|
+
{
|
|
13
|
+
onMouseDown: w,
|
|
14
|
+
"data-auto-focus-visible": "true",
|
|
15
|
+
"data-auto-focus-trigger": !0,
|
|
16
|
+
"data-test-id": e,
|
|
17
|
+
asChild: t,
|
|
18
|
+
ref: u,
|
|
19
|
+
...r,
|
|
20
|
+
children: o
|
|
21
|
+
}
|
|
35
22
|
);
|
|
36
|
-
c.displayName = "
|
|
23
|
+
c.displayName = "Flyout.Trigger";
|
|
24
|
+
const A = {
|
|
25
|
+
compact: 8,
|
|
26
|
+
comfortable: 12,
|
|
27
|
+
spacious: 16
|
|
28
|
+
}, m = ({
|
|
29
|
+
align: t = "start",
|
|
30
|
+
maxWidth: o = "360px",
|
|
31
|
+
padding: e = "compact",
|
|
32
|
+
rounded: r = "medium",
|
|
33
|
+
width: u = "fit-content",
|
|
34
|
+
shadow: F = "medium",
|
|
35
|
+
triggerOffset: g = "compact",
|
|
36
|
+
"data-test-id": h = "fondue-flyout-content",
|
|
37
|
+
children: N,
|
|
38
|
+
...v
|
|
39
|
+
}, C) => {
|
|
40
|
+
const R = P();
|
|
41
|
+
return /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ l(T, { theme: R, children: [
|
|
42
|
+
/* @__PURE__ */ a("div", { className: d.overlay }),
|
|
43
|
+
/* @__PURE__ */ a(
|
|
44
|
+
i.Content,
|
|
45
|
+
{
|
|
46
|
+
style: {
|
|
47
|
+
"--flyout-max-width": o,
|
|
48
|
+
"--flyout-width": u
|
|
49
|
+
},
|
|
50
|
+
ref: C,
|
|
51
|
+
align: t,
|
|
52
|
+
collisionPadding: 8,
|
|
53
|
+
sideOffset: A[g],
|
|
54
|
+
className: d.root,
|
|
55
|
+
"data-flyout-spacing": e,
|
|
56
|
+
"data-rounded": r,
|
|
57
|
+
"data-shadow": F,
|
|
58
|
+
"data-test-id": h,
|
|
59
|
+
onFocus: x,
|
|
60
|
+
...v,
|
|
61
|
+
children: N
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] }) });
|
|
65
|
+
};
|
|
66
|
+
m.displayName = "Flyout.Content";
|
|
67
|
+
const y = ({ showCloseButton: t, children: o, "data-test-id": e = "fondue-flyout-header" }, r) => /* @__PURE__ */ l("div", { "data-test-id": e, ref: r, className: d.header, children: [
|
|
68
|
+
/* @__PURE__ */ a("div", { children: o }),
|
|
69
|
+
t && /* @__PURE__ */ a(i.Close, { role: "button", "data-test-id": `${e}-close`, className: d.close, children: /* @__PURE__ */ a(b, { size: 20 }) })
|
|
70
|
+
] });
|
|
71
|
+
y.displayName = "Flyout.Header";
|
|
72
|
+
const f = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, className: d.footer, children: t });
|
|
73
|
+
f.displayName = "Flyout.Footer";
|
|
74
|
+
const p = ({ children: t, "data-test-id": o = "fondue-flyout-body" }, e) => /* @__PURE__ */ a("div", { "data-test-id": o, ref: e, "data-flyout-spacing": "compact", className: d.body, children: t });
|
|
75
|
+
p.displayName = "Flyout.Body";
|
|
76
|
+
const D = {
|
|
77
|
+
Root: n,
|
|
78
|
+
Trigger: s(c),
|
|
79
|
+
Content: s(m),
|
|
80
|
+
Header: s(y),
|
|
81
|
+
Footer: s(f),
|
|
82
|
+
Body: s(p)
|
|
83
|
+
};
|
|
37
84
|
export {
|
|
38
|
-
|
|
85
|
+
D as Flyout,
|
|
86
|
+
p as FlyoutBody,
|
|
87
|
+
m as FlyoutContent,
|
|
88
|
+
f as FlyoutFooter,
|
|
89
|
+
y as FlyoutHeader,
|
|
90
|
+
n as FlyoutRoot,
|
|
91
|
+
c as FlyoutTrigger
|
|
39
92
|
};
|
|
40
93
|
//# sourceMappingURL=fondue-components12.js.map
|