@frontify/fondue-components 7.0.0 → 7.0.1
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-components10.js +31 -27
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +75 -72
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +29 -26
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components14.js +1 -1
- package/dist/fondue-components15.js +1 -1
- package/dist/fondue-components16.js +32 -29
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +2 -2
- package/dist/fondue-components18.js +6 -6
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components20.js +1 -1
- package/dist/fondue-components21.js +4 -4
- package/dist/fondue-components22.js +3 -3
- package/dist/fondue-components23.js +1 -1
- package/dist/fondue-components24.js +1 -1
- package/dist/fondue-components28.js +1 -1
- package/dist/fondue-components3.js +28 -25
- package/dist/fondue-components3.js.map +1 -1
- package/dist/fondue-components31.js +1 -1
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components41.js +18 -19
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +16 -4
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +3 -11
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +13 -3
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +5 -35
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +35 -13
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +12 -4
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +4 -24
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +24 -16
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components50.js +16 -139
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +140 -16
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +16 -72
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +72 -8
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +8 -33
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +32 -48
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +48 -10
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +8 -10
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +12 -7
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +7 -12
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components60.js +12 -18
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +19 -15
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +14 -52
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +52 -14
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +12 -15
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +17 -6
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +7 -2
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +2 -15
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +1 -1
- package/dist/fondue-components69.js +18 -0
- package/dist/fondue-components69.js.map +1 -0
- package/dist/fondue-components8.js +28 -28
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components9.js +102 -92
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +116 -132
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components67.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components67.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = "_root_8a8rm_5", t = "_button_8a8rm_56", c = "_colorIndicator_8a8rm_69", r = "_actions_8a8rm_75", a = "_clear_8a8rm_85", _ = "_caret_8a8rm_98", n = {
|
|
2
|
+
root: o,
|
|
3
|
+
button: t,
|
|
4
|
+
colorIndicator: c,
|
|
5
|
+
actions: r,
|
|
6
|
+
clear: a,
|
|
7
|
+
caret: _
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
r as actions,
|
|
11
|
+
t as button,
|
|
12
|
+
_ as caret,
|
|
13
|
+
a as clear,
|
|
14
|
+
c as colorIndicator,
|
|
15
|
+
n as default,
|
|
16
|
+
o as root
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=fondue-components69.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fondue-components69.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "@radix-ui/react-separator";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
4
|
import { cn as f } from "./fondue-components27.js";
|
|
5
|
-
import { dividerStyles as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
import { dividerStyles as p } from "./fondue-components39.js";
|
|
6
|
+
const n = s(
|
|
7
|
+
({
|
|
8
|
+
"data-test-id": r = "fondue-divider",
|
|
9
|
+
direction: o = "horizontal",
|
|
10
|
+
className: t,
|
|
11
|
+
variant: i,
|
|
12
|
+
...e
|
|
13
|
+
}, a) => /* @__PURE__ */ d(
|
|
14
|
+
m.Root,
|
|
15
|
+
{
|
|
16
|
+
ref: a,
|
|
17
|
+
className: f(
|
|
18
|
+
p({
|
|
19
|
+
direction: o,
|
|
20
|
+
variant: i,
|
|
21
|
+
...e
|
|
22
|
+
}),
|
|
23
|
+
t
|
|
24
|
+
),
|
|
25
|
+
"data-test-id": r
|
|
26
|
+
}
|
|
27
|
+
)
|
|
26
28
|
);
|
|
27
|
-
|
|
28
|
-
const u = p(r);
|
|
29
|
+
n.displayName = "Divider";
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
-
r as DividerComponent
|
|
31
|
+
n as Divider
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=fondue-components8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components8.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n variant?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const
|
|
1
|
+
{"version":3,"file":"fondue-components8.js","sources":["../src/components/Divider/Divider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as Separator from '@radix-ui/react-separator';\nimport { forwardRef, type ForwardedRef, type ReactElement } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { dividerStyles } from './styles/dividerStyles';\n\ntype DividerStyle = 'noline' | 'dashed' | 'solid';\ntype DividerPadding = 'none' | 'small' | 'medium' | 'large';\ntype DividerDirection = 'horizontal' | 'vertical';\ntype DividerColor = 'weak' | 'default' | 'strong' | 'x-strong';\n\nexport type DividerProps = {\n /**\n * The style of the divider\n * @default \"solid\"\n */\n variant?: DividerStyle;\n /**\n * The padding of the divider\n * @default \"medium\"\n */\n padding?: DividerPadding;\n /**\n * The color of the divider\n * @default \"default\"\n */\n color?: DividerColor;\n /**\n * The direction of the divider\n * @default \"horizontal\"\n */\n direction?: DividerDirection;\n 'data-test-id'?: string;\n className?: string;\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n (\n {\n 'data-test-id': dataTestId = 'fondue-divider',\n direction = 'horizontal',\n className,\n variant,\n ...props\n }: DividerProps,\n ref: ForwardedRef<HTMLDivElement | null>,\n ): ReactElement => {\n return (\n <Separator.Root\n ref={ref}\n className={cn(\n dividerStyles({\n direction,\n variant,\n ...props,\n }),\n className,\n )}\n data-test-id={dataTestId}\n />\n );\n },\n);\n\nDivider.displayName = 'Divider';\n"],"names":["Divider","forwardRef","dataTestId","direction","className","variant","props","ref","jsx","Separator","cn","dividerStyles"],"mappings":";;;;;AAuCO,MAAMA,IAAUC;AAAA,EACnB,CACI;AAAA,IACI,gBAAgBC,IAAa;AAAA,IAC7B,WAAAC,IAAY;AAAA,IACZ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,GAAGC;AAAA,KAEPC,MAGI,gBAAAC;AAAA,IAACC,EAAU;AAAA,IAAV;AAAA,MACG,KAAAF;AAAA,MACA,WAAWG;AAAA,QACPC,EAAc;AAAA,UACV,WAAAR;AAAA,UACA,SAAAE;AAAA,UACA,GAAGC;AAAA,QAAA,CACN;AAAA,QACDF;AAAA,MACJ;AAAA,MACA,gBAAcF;AAAA,IAAA;AAAA,EAClB;AAGZ;AAEAF,EAAQ,cAAc;"}
|
|
@@ -1,129 +1,139 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { IconCaretRight as
|
|
1
|
+
import { jsx as d, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretRight as G } from "@frontify/fondue-icons";
|
|
3
3
|
import * as n from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
4
|
+
import { Slot as M } from "@radix-ui/react-slot";
|
|
5
|
+
import { forwardRef as s, useRef as f } from "react";
|
|
6
|
+
import { usePreventDropdownOverflow as P } from "./fondue-components40.js";
|
|
7
|
+
import { syncRefs as g } from "./fondue-components37.js";
|
|
8
|
+
import { useProcessedChildren as D } from "./fondue-components41.js";
|
|
9
|
+
import a from "./fondue-components42.js";
|
|
10
|
+
const b = ({
|
|
9
11
|
children: o,
|
|
10
12
|
open: t,
|
|
11
|
-
onOpenChange:
|
|
12
|
-
"data-test-id":
|
|
13
|
-
}) => /* @__PURE__ */
|
|
14
|
-
|
|
15
|
-
const
|
|
13
|
+
onOpenChange: r,
|
|
14
|
+
"data-test-id": e = "fondue-dropdown"
|
|
15
|
+
}) => /* @__PURE__ */ d(n.Root, { open: t, onOpenChange: r, "data-test-id": e, children: o });
|
|
16
|
+
b.displayName = "Dropdown.Root";
|
|
17
|
+
const S = ({
|
|
16
18
|
asChild: o = !0,
|
|
17
19
|
children: t,
|
|
18
|
-
"data-test-id":
|
|
19
|
-
...
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
const
|
|
20
|
+
"data-test-id": r = "fondue-dropdown-trigger",
|
|
21
|
+
...e
|
|
22
|
+
}, p) => /* @__PURE__ */ d(n.Trigger, { asChild: o, "data-test-id": r, ref: p, ...e, children: t });
|
|
23
|
+
S.displayName = "Dropdown.Trigger";
|
|
24
|
+
const R = ({
|
|
23
25
|
onOpen: o,
|
|
24
26
|
onClose: t,
|
|
25
|
-
side:
|
|
26
|
-
padding:
|
|
27
|
-
align:
|
|
28
|
-
children:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
side: r = "bottom",
|
|
28
|
+
padding: e = "comfortable",
|
|
29
|
+
align: p = "start",
|
|
30
|
+
children: w,
|
|
31
|
+
preventTriggerFocusOnClose: l,
|
|
32
|
+
"data-test-id": m = "fondue-dropdown-content"
|
|
33
|
+
}, c) => {
|
|
34
|
+
const i = f(null), u = f(!1), { setMaxHeight: I } = P(i);
|
|
35
|
+
return /* @__PURE__ */ d(n.Portal, { children: /* @__PURE__ */ d(
|
|
33
36
|
n.Content,
|
|
34
37
|
{
|
|
35
|
-
align:
|
|
38
|
+
align: p,
|
|
36
39
|
collisionPadding: 8,
|
|
37
40
|
sideOffset: 8,
|
|
38
|
-
side:
|
|
41
|
+
side: r,
|
|
39
42
|
className: a.content,
|
|
40
|
-
"data-padding":
|
|
41
|
-
"data-test-id":
|
|
42
|
-
ref:
|
|
43
|
-
onCloseAutoFocus: () => {
|
|
44
|
-
|
|
43
|
+
"data-padding": e,
|
|
44
|
+
"data-test-id": m,
|
|
45
|
+
ref: i,
|
|
46
|
+
onCloseAutoFocus: (v) => {
|
|
47
|
+
l && v.preventDefault(), g(i, c), t && t(), u.current = !1;
|
|
45
48
|
},
|
|
46
49
|
onFocus: () => {
|
|
47
|
-
|
|
50
|
+
u.current || (I(), g(i, c), o && o(), u.current = !0);
|
|
48
51
|
},
|
|
49
|
-
children:
|
|
52
|
+
children: w
|
|
50
53
|
}
|
|
51
54
|
) });
|
|
52
55
|
};
|
|
53
|
-
|
|
54
|
-
const N = ({ children: o, "data-test-id": t = "fondue-dropdown-group" },
|
|
56
|
+
R.displayName = "Dropdown.Content";
|
|
57
|
+
const N = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ d(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
|
|
55
58
|
N.displayName = "Dropdown.Group";
|
|
56
|
-
const
|
|
59
|
+
const C = ({
|
|
57
60
|
children: o,
|
|
58
61
|
"data-test-id": t = "fondue-dropdown-submenu"
|
|
59
|
-
}) => /* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
}) => /* @__PURE__ */ d(n.Sub, { "data-test-id": t, children: o });
|
|
63
|
+
C.displayName = "Dropdown.SubMenu";
|
|
64
|
+
const y = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
|
|
65
|
+
const { content: e } = D(o);
|
|
66
|
+
return /* @__PURE__ */ x(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
|
|
67
|
+
e,
|
|
68
|
+
/* @__PURE__ */ d(G, { className: a.subMenuIndicator, size: 16 })
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
y.displayName = "Dropdown.SubTrigger";
|
|
72
|
+
const T = ({
|
|
67
73
|
padding: o = "comfortable",
|
|
68
74
|
children: t,
|
|
69
|
-
"data-test-id":
|
|
70
|
-
},
|
|
75
|
+
"data-test-id": r = "fondue-dropdown-subcontent"
|
|
76
|
+
}, e) => /* @__PURE__ */ d(n.Portal, { children: /* @__PURE__ */ d(
|
|
71
77
|
n.SubContent,
|
|
72
78
|
{
|
|
73
79
|
className: a.subContent,
|
|
74
80
|
"data-padding": o,
|
|
75
|
-
"data-test-id":
|
|
76
|
-
ref:
|
|
81
|
+
"data-test-id": r,
|
|
82
|
+
ref: e,
|
|
77
83
|
children: t
|
|
78
84
|
}
|
|
79
85
|
) });
|
|
80
|
-
|
|
81
|
-
const
|
|
86
|
+
T.displayName = "Dropdown.SubContent";
|
|
87
|
+
const h = ({
|
|
82
88
|
children: o,
|
|
83
89
|
disabled: t,
|
|
84
|
-
textValue:
|
|
85
|
-
onSelect:
|
|
86
|
-
emphasis:
|
|
87
|
-
"data-test-id":
|
|
88
|
-
...
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
90
|
+
textValue: r,
|
|
91
|
+
onSelect: e,
|
|
92
|
+
emphasis: p = "default",
|
|
93
|
+
"data-test-id": w = "fondue-dropdown-subtrigger",
|
|
94
|
+
...l
|
|
95
|
+
}, m) => {
|
|
96
|
+
const { content: c, isLink: i } = D(o), u = i ? M : "div";
|
|
97
|
+
return /* @__PURE__ */ d(
|
|
98
|
+
n.Item,
|
|
99
|
+
{
|
|
100
|
+
onSelect: e,
|
|
101
|
+
className: a.item,
|
|
102
|
+
textValue: r,
|
|
103
|
+
"data-test-id": w,
|
|
104
|
+
"data-emphasis": p,
|
|
105
|
+
ref: m,
|
|
106
|
+
disabled: t,
|
|
107
|
+
asChild: !0,
|
|
108
|
+
...l,
|
|
109
|
+
children: /* @__PURE__ */ d(u, { children: c })
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
h.displayName = "Dropdown.Item";
|
|
114
|
+
const F = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, e) => /* @__PURE__ */ d("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: e, children: o });
|
|
115
|
+
F.displayName = "Dropdown.Slot";
|
|
116
|
+
const j = s(S), O = s(R), k = s(N), z = s(y), A = s(T), H = s(h), L = s(F), V = {
|
|
117
|
+
Root: b,
|
|
118
|
+
Trigger: j,
|
|
119
|
+
Content: O,
|
|
120
|
+
Group: k,
|
|
121
|
+
SubMenu: C,
|
|
122
|
+
SubTrigger: z,
|
|
123
|
+
SubContent: A,
|
|
124
|
+
Item: H,
|
|
125
|
+
Slot: L
|
|
116
126
|
};
|
|
117
127
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
V as Dropdown,
|
|
129
|
+
R as DropdownContent,
|
|
120
130
|
N as DropdownGroup,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
h as DropdownItem,
|
|
132
|
+
b as DropdownRoot,
|
|
133
|
+
F as DropdownSlot,
|
|
134
|
+
T as DropdownSubContent,
|
|
135
|
+
C as DropdownSubMenu,
|
|
136
|
+
y as DropdownSubTrigger,
|
|
137
|
+
S as DropdownTrigger
|
|
128
138
|
};
|
|
129
139
|
//# sourceMappingURL=fondue-components9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.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, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { syncRefs } from '#/utilities/domUtilities';\n\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\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 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} 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\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n onOpen?: () => void;\n onClose?: () => void;\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\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\nexport const DropdownContent = (\n {\n onOpen,\n onClose,\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n const dropdownIsOpen = useRef(false);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={localRef}\n onCloseAutoFocus={() => {\n syncRefs(localRef, ref);\n onClose && onClose();\n dropdownIsOpen.current = false;\n }}\n onFocus={() => {\n if (!dropdownIsOpen.current) {\n setMaxHeight();\n syncRefs(localRef, ref);\n onOpen && onOpen();\n dropdownIsOpen.current = true;\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, '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 {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 return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n <div className={styles.itemContent}>{children}</div>\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n {\n padding = 'comfortable',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-subcontent',\n }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent\n className={styles.subContent}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.SubContent>\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 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\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 {...props}\n >\n <div className={styles.itemContent}>{children}</div>\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","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","onOpen","onClose","side","padding","align","localRef","useRef","dropdownIsOpen","setMaxHeight","usePreventDropdownOverflow","styles","syncRefs","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown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AAA7B;AAAA,EACA,UAAA8B;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,gBAAgB9B,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL;AAAA,EAACC,EAAc;AAAA,EAAd;AAAA,IACG,UAAA2B;AAAA,IACA,WAAWX,EAAO;AAAA,IAClB,WAAAU;AAAA,IACA,gBAAc5B;AAAA,IACd,iBAAe8B;AAAA,IACf,KAAAxB;AAAA,IACA,UAAAqB;AAAA,IACC,GAAGtB;AAAA,IAEJ,UAAC,gBAAAJ,EAAA,OAAA,EAAI,WAAWiB,EAAO,aAAc,UAAArB,EAAS,CAAA;AAAA,EAAA;AAClD;AAGR6B,EAAa,cAAc;AAId,MAAAK,IAAe,CACxB,EAAE,UAAAlC,GAAU,MAAAmC,GAAM,gBAAgBhC,IAAa,uBAAuB,GACtEM,MAGI,gBAAAL,EAAC,OAAI,EAAA,aAAW+B,GAAM,WAAWd,EAAO,MAAM,gBAAclB,GAAY,KAAAM,GACnE,UAAAT,EACL,CAAA;AAGRkC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoD/B,CAAe,GACjGgC,IAA8BD,EAAiD3B,CAAe,GAC9F6B,IAA4BF,EAA+Cd,CAAa,GACxFiB,IAAiCH,EAAoDZ,CAAkB,GACvGgB,IAAiCJ,EAAoDT,CAAkB,GACvGc,IAA2BL,EAA8CR,CAAY,GACrFc,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM7C;AAAA,EACN,SAASqC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASf;AAAA,EACT,YAAYgB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
|
1
|
+
{"version":3,"file":"fondue-components9.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 { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { syncRefs } from '#/utilities/domUtilities';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\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 onOpenChange,\n\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} 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\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n onOpen?: () => void;\n onClose?: () => void;\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\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 * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nexport const DropdownContent = (\n {\n onOpen,\n onClose,\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n const dropdownIsOpen = useRef(false);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={localRef}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n syncRefs(localRef, ref);\n onClose && onClose();\n dropdownIsOpen.current = false;\n }}\n onFocus={() => {\n if (!dropdownIsOpen.current) {\n setMaxHeight();\n syncRefs(localRef, ref);\n onOpen && onOpen();\n dropdownIsOpen.current = true;\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, '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 {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 /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n {\n padding = 'comfortable',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-subcontent',\n }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent\n className={styles.subContent}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.SubContent>\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 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\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\n {...props}\n >\n <Wrapper>{content}</Wrapper>\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","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","onOpen","onClose","side","padding","align","preventTriggerFocusOnClose","localRef","useRef","dropdownIsOpen","setMaxHeight","usePreventDropdownOverflow","styles","event","syncRefs","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;;;AA2BO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EAEA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMO,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAP;AAAA,EACA,gBAAgBG,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAR,EACL,CAAA;AAGRM,EAAgB,cAAc;AA4BvB,MAAMI,IAAkB,CAC3B;AAAA,EACI,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,UAAAf;AAAA,EACA,4BAAAgB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