@frontify/fondue-components 20.0.0-beta.8 → 20.0.0-rc.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-components34.js +28 -27
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components41.js +1 -1
- package/dist/fondue-components44.js +1 -1
- package/dist/fondue-components61.js +4 -4
- package/dist/fondue-components71.js +1 -1
- package/dist/fondue-components73.js +36 -36
- package/dist/fondue-components74.js +2 -2
- package/dist/fondue-components82.js +8 -8
- package/dist/fondue-components9.js +42 -45
- package/dist/fondue-components9.js.map +1 -1
- package/dist/fondue-components90.js +9 -9
- package/dist/fondue-components91.js +40 -2
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +6 -40
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +2 -6
- package/dist/fondue-components93.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +5 -5
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import * as e from "@radix-ui/react-tooltip";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
4
|
import { cn as u } from "./fondue-components40.js";
|
|
5
5
|
import { useFondueTheme as h, ThemeProvider as y } from "./fondue-components33.js";
|
|
6
6
|
import d from "./fondue-components87.js";
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
7
|
+
const s = ({ children: t, enterDelay: r = 700, open: i, onOpenChange: a }) => /* @__PURE__ */ o(e.Provider, { children: /* @__PURE__ */ o(e.Root, { delayDuration: r, open: i, onOpenChange: a, children: t }) });
|
|
8
|
+
s.displayName = "Tooltip.Root";
|
|
9
|
+
const l = ({ asChild: t = !1, children: r, "data-test-id": i = "fondue-tooltip-trigger" }, a) => /* @__PURE__ */ o(
|
|
10
10
|
e.Trigger,
|
|
11
11
|
{
|
|
12
|
+
"data-tooltip-trigger": !0,
|
|
12
13
|
"data-test-id": i,
|
|
13
|
-
type:
|
|
14
|
-
asChild:
|
|
14
|
+
type: t ? void 0 : "button",
|
|
15
|
+
asChild: t,
|
|
15
16
|
ref: a,
|
|
16
17
|
children: r
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
children:
|
|
20
|
+
l.displayName = "Tooltip.Trigger";
|
|
21
|
+
const p = ({
|
|
22
|
+
children: t,
|
|
22
23
|
className: r,
|
|
23
24
|
maxWidth: i,
|
|
24
25
|
"data-test-id": a = "fondue-tooltip-content",
|
|
25
|
-
padding:
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
26
|
+
padding: m = "spacious",
|
|
27
|
+
side: c
|
|
28
|
+
}, g) => {
|
|
29
|
+
const T = h();
|
|
30
|
+
return /* @__PURE__ */ o(e.Portal, { children: /* @__PURE__ */ o(y, { theme: T, children: /* @__PURE__ */ f(
|
|
30
31
|
e.Content,
|
|
31
32
|
{
|
|
32
33
|
"data-test-id": a,
|
|
33
|
-
"data-tooltip-spacing":
|
|
34
|
+
"data-tooltip-spacing": m,
|
|
34
35
|
className: u(d.root, r),
|
|
35
36
|
style: { maxWidth: i },
|
|
36
37
|
collisionPadding: 16,
|
|
37
38
|
sideOffset: 8,
|
|
38
|
-
ref:
|
|
39
|
-
|
|
39
|
+
ref: g,
|
|
40
|
+
side: c,
|
|
40
41
|
children: [
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
t,
|
|
43
|
+
/* @__PURE__ */ o(e.Arrow, { "aria-hidden": "true", className: d.arrow })
|
|
43
44
|
]
|
|
44
45
|
}
|
|
45
46
|
) }) });
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
p.displayName = "Tooltip.Content";
|
|
48
49
|
const w = {
|
|
49
|
-
Root:
|
|
50
|
-
Trigger:
|
|
51
|
-
Content:
|
|
50
|
+
Root: s,
|
|
51
|
+
Trigger: n(l),
|
|
52
|
+
Content: n(p)
|
|
52
53
|
};
|
|
53
54
|
export {
|
|
54
55
|
w as Tooltip,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
p as TooltipContent,
|
|
57
|
+
s as TooltipRoot,
|
|
58
|
+
l as TooltipTrigger
|
|
58
59
|
};
|
|
59
60
|
//# sourceMappingURL=fondue-components34.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components34.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange
|
|
1
|
+
{"version":3,"file":"fondue-components34.js","sources":["../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixTooltip from '@radix-ui/react-tooltip';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/tooltip.module.scss';\n\nexport type TooltipRootProps = {\n /**\n * Sets the open state of the tooltip.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the tooltip changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The delay in milliseconds before the tooltip appears.\n * @default 700\n */\n enterDelay?: number;\n children: Array<ReactElement<TooltipTriggerProps | TooltipContentProps>>;\n};\n\nexport const TooltipRoot = ({ children, enterDelay = 700, open, onOpenChange }: TooltipRootProps) => {\n return (\n <RadixTooltip.Provider>\n <RadixTooltip.Root delayDuration={enterDelay} open={open} onOpenChange={onOpenChange}>\n {children}\n </RadixTooltip.Root>\n </RadixTooltip.Provider>\n );\n};\nTooltipRoot.displayName = 'Tooltip.Root';\n\nexport type TooltipTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipTrigger = (\n { asChild = false, children, 'data-test-id': dataTestId = 'fondue-tooltip-trigger' }: TooltipTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixTooltip.Trigger\n data-tooltip-trigger\n data-test-id={dataTestId}\n type={!asChild ? 'button' : undefined}\n asChild={asChild}\n ref={ref}\n >\n {children}\n </RadixTooltip.Trigger>\n );\n};\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nexport type TooltipContentProps = {\n /**\n * @default \"spacious\"\n */\n padding?: 'spacious' | 'compact';\n /**\n * Defines the preferred side of the tooltip. It will not be respected if there are collisions with the viewport.\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n maxWidth?: string;\n className?: string;\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const TooltipContent = (\n {\n children,\n className,\n maxWidth,\n 'data-test-id': dataTestId = 'fondue-tooltip-content',\n padding = 'spacious',\n side,\n }: TooltipContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n return (\n <RadixTooltip.Portal>\n <ThemeProvider theme={theme}>\n <RadixTooltip.Content\n data-test-id={dataTestId}\n data-tooltip-spacing={padding}\n className={cn(styles.root, className)}\n style={{ maxWidth }}\n collisionPadding={16}\n sideOffset={8}\n ref={ref}\n side={side}\n >\n {children}\n <RadixTooltip.Arrow aria-hidden=\"true\" className={styles.arrow} />\n </RadixTooltip.Content>\n </ThemeProvider>\n </RadixTooltip.Portal>\n );\n};\nTooltipContent.displayName = 'Tooltip.Content';\n\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: forwardRef<HTMLButtonElement, TooltipTriggerProps>(TooltipTrigger),\n Content: forwardRef<HTMLDivElement, TooltipContentProps>(TooltipContent),\n};\n"],"names":["TooltipRoot","children","enterDelay","open","onOpenChange","jsx","RadixTooltip","TooltipTrigger","asChild","dataTestId","ref","TooltipContent","className","maxWidth","padding","side","theme","useFondueTheme","ThemeProvider","jsxs","cn","styles","Tooltip","forwardRef"],"mappings":";;;;;;AA4BO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,YAAAC,IAAa,KAAK,MAAAC,GAAM,cAAAC,QAExD,gBAAAC,EAACC,EAAa,UAAb,EACG,UAAA,gBAAAD,EAACC,EAAa,MAAb,EAAkB,eAAeJ,GAAY,MAAAC,GAAY,cAAAC,GACrD,UAAAH,GACL,GACJ;AAGRD,EAAY,cAAc;AAYnB,MAAMO,IAAiB,CAC1B,EAAE,SAAAC,IAAU,IAAO,UAAAP,GAAU,gBAAgBQ,IAAa,yBAAA,GAC1DC,MAGI,gBAAAL;AAAA,EAACC,EAAa;AAAA,EAAb;AAAA,IACG,wBAAoB;AAAA,IACpB,gBAAcG;AAAA,IACd,MAAOD,IAAqB,SAAX;AAAA,IACjB,SAAAA;AAAA,IACA,KAAAE;AAAA,IAEC,UAAAT;AAAA,EAAA;AAAA;AAIbM,EAAe,cAAc;AAiBtB,MAAMI,IAAiB,CAC1B;AAAA,EACI,UAAAV;AAAA,EACA,WAAAW;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBJ,IAAa;AAAA,EAC7B,SAAAK,IAAU;AAAA,EACV,MAAAC;AACJ,GACAL,MACC;AACD,QAAMM,IAAQC,EAAA;AACd,2BACKX,EAAa,QAAb,EACG,UAAA,gBAAAD,EAACa,KAAc,OAAAF,GACX,UAAA,gBAAAG;AAAA,IAACb,EAAa;AAAA,IAAb;AAAA,MACG,gBAAcG;AAAA,MACd,wBAAsBK;AAAA,MACtB,WAAWM,EAAGC,EAAO,MAAMT,CAAS;AAAA,MACpC,OAAO,EAAE,UAAAC,EAAA;AAAA,MACT,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,KAAAH;AAAA,MACA,MAAAK;AAAA,MAEC,UAAA;AAAA,QAAAd;AAAA,QACD,gBAAAI,EAACC,EAAa,OAAb,EAAmB,eAAY,QAAO,WAAWe,EAAO,MAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAExE,EAAA,CACJ;AAER;AACAV,EAAe,cAAc;AAEtB,MAAMW,IAAU;AAAA,EACnB,MAAMtB;AAAA,EACN,SAASuB,EAAmDhB,CAAc;AAAA,EAC1E,SAASgB,EAAgDZ,CAAc;AAC3E;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as e } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as e } from "./fondue-components93.js";
|
|
2
2
|
import { sv as a } from "./fondue-components40.js";
|
|
3
3
|
const s = a({
|
|
4
4
|
base: `tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-primary tw-font-medium tw-box-border tw-whitespace-nowrap tw-transition-colors ${e}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components93.js";
|
|
2
2
|
import { sv as e } from "./fondue-components40.js";
|
|
3
3
|
const r = e({
|
|
4
4
|
base: `tw-peer tw-relative tw-inline-flex tw-bg-surface tw-text-white tw-shrink-0 tw-rounded-medium tw-border tw-border-line-strong group-hover:tw-border-line-strong hover:tw-border-line-strong tw-transition-colors data-[state="checked"]:tw-border-transparent data-[state="indeterminate"]:tw-border-transparent disabled:tw-border-line-strong disabled:tw-bg-surface disabled:tw-cursor-not-allowed data-[state="checked"]:disabled:tw-bg-disabled data-[readonly="true"]:tw-pointer-events-none ${t}`,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_root_12b82_3", e = "_contentArea_12b82_71", o = "_hiddenText_12b82_76", n = "_visibleText_12b82_82", _ = {
|
|
2
2
|
root: t,
|
|
3
3
|
contentArea: e,
|
|
4
4
|
hiddenText: o,
|
|
5
|
-
visibleText:
|
|
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-components61.js.map
|
|
@@ -4,7 +4,7 @@ import { Slot as V } from "@radix-ui/react-slot";
|
|
|
4
4
|
import { isValidElement as g } from "react";
|
|
5
5
|
import { useFondueTheme as A, ThemeProvider as D } from "./fondue-components33.js";
|
|
6
6
|
import s from "./fondue-components73.js";
|
|
7
|
-
import { recursiveMap as M, getSelectOptionValue as T } from "./fondue-
|
|
7
|
+
import { recursiveMap as M, getSelectOptionValue as T } from "./fondue-components91.js";
|
|
8
8
|
const E = ({
|
|
9
9
|
highlightedIndex: p,
|
|
10
10
|
getMenuProps: c,
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
selectedValue:
|
|
4
|
-
input:
|
|
5
|
-
slot:
|
|
6
|
-
clear:
|
|
7
|
-
clearIcon:
|
|
8
|
-
icons:
|
|
9
|
-
caret:
|
|
10
|
-
iconSuccess:
|
|
11
|
-
iconError:
|
|
12
|
-
menu:
|
|
13
|
-
portal:
|
|
14
|
-
item:
|
|
15
|
-
checkmarkIcon:
|
|
16
|
-
itemValue:
|
|
17
|
-
group:
|
|
18
|
-
groupHeading:
|
|
1
|
+
const c = "_root_1m7fk_7", o = "_selectedValue_1m7fk_57", _ = "_input_1m7fk_75", e = "_slot_1m7fk_101", t = "_clear_1m7fk_153", n = "_clearIcon_1m7fk_160", s = "_icons_1m7fk_164", r = "_caret_1m7fk_170", m = "_iconSuccess_1m7fk_198", a = "_iconError_1m7fk_204", k = "_menu_1m7fk_210", l = "_portal_1m7fk_233", u = "_item_1m7fk_249", i = "_checkmarkIcon_1m7fk_277", f = "_itemValue_1m7fk_283", p = "_group_1m7fk_297", g = "_groupHeading_1m7fk_308", d = {
|
|
2
|
+
root: c,
|
|
3
|
+
selectedValue: o,
|
|
4
|
+
input: _,
|
|
5
|
+
slot: e,
|
|
6
|
+
clear: t,
|
|
7
|
+
clearIcon: n,
|
|
8
|
+
icons: s,
|
|
9
|
+
caret: r,
|
|
10
|
+
iconSuccess: m,
|
|
11
|
+
iconError: a,
|
|
12
|
+
menu: k,
|
|
13
|
+
portal: l,
|
|
14
|
+
item: u,
|
|
15
|
+
checkmarkIcon: i,
|
|
16
|
+
itemValue: f,
|
|
17
|
+
group: p,
|
|
18
|
+
groupHeading: g
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
r as caret,
|
|
22
|
+
i as checkmarkIcon,
|
|
23
|
+
t as clear,
|
|
24
|
+
n as clearIcon,
|
|
25
|
+
d as default,
|
|
26
|
+
p as group,
|
|
27
|
+
g as groupHeading,
|
|
28
|
+
a as iconError,
|
|
29
|
+
m as iconSuccess,
|
|
30
|
+
s as icons,
|
|
31
|
+
_ as input,
|
|
32
|
+
u as item,
|
|
33
|
+
f as itemValue,
|
|
34
|
+
k as menu,
|
|
35
|
+
l as portal,
|
|
36
|
+
c as root,
|
|
37
|
+
o as selectedValue,
|
|
38
|
+
e as slot
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=fondue-components73.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-components92.js";
|
|
4
4
|
import { ForwardedRefSelectItem as L } from "./fondue-components70.js";
|
|
5
5
|
import { ForwardedRefSelectSlot as y } from "./fondue-components72.js";
|
|
6
|
-
import { getSelectOptionValue as I } from "./fondue-
|
|
6
|
+
import { getSelectOptionValue as I } from "./fondue-components91.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,18 +1,18 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_root_1ra7u_5", r = "_triggerListWrapper_1ra7u_13", e = "_trigger_1ra7u_13", i = "_activeIndicator_1ra7u_61", o = "_triggerList_1ra7u_13", g = "_content_1ra7u_149", _ = {
|
|
2
2
|
root: t,
|
|
3
3
|
triggerListWrapper: r,
|
|
4
4
|
trigger: e,
|
|
5
|
-
activeIndicator:
|
|
6
|
-
triggerList:
|
|
7
|
-
content:
|
|
5
|
+
activeIndicator: i,
|
|
6
|
+
triggerList: o,
|
|
7
|
+
content: g
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
i as activeIndicator,
|
|
11
|
+
g as content,
|
|
12
|
+
_ as default,
|
|
13
13
|
t as root,
|
|
14
14
|
e as trigger,
|
|
15
|
-
|
|
15
|
+
o as triggerList,
|
|
16
16
|
r as triggerListWrapper
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=fondue-components82.js.map
|
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { IconCross as
|
|
1
|
+
import { jsx as o, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as P } from "@frontify/fondue-icons";
|
|
3
3
|
import * as d from "@radix-ui/react-dialog";
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { useSyncRefs as
|
|
6
|
-
import { addShowFocusRing as
|
|
7
|
-
import { useFondueTheme as
|
|
8
|
-
import
|
|
9
|
-
const m =
|
|
4
|
+
import { createContext as j, forwardRef as l, useRef as q, useContext as B, useMemo as z } from "react";
|
|
5
|
+
import { useSyncRefs as E } from "./fondue-components50.js";
|
|
6
|
+
import { addShowFocusRing as L, addAutoFocusAttribute as $ } from "./fondue-components51.js";
|
|
7
|
+
import { useFondueTheme as k, ThemeProvider as G } from "./fondue-components33.js";
|
|
8
|
+
import n from "./fondue-components52.js";
|
|
9
|
+
const m = j({ isModal: !1 });
|
|
10
10
|
m.displayName = "DialogContext";
|
|
11
|
-
const y = ({ children: t,
|
|
12
|
-
const
|
|
13
|
-
return /* @__PURE__ */ o(m.Provider, { value:
|
|
11
|
+
const y = ({ children: t, modal: e, onOpenChange: a, open: i }) => {
|
|
12
|
+
const r = z(() => ({ isModal: e ?? !1 }), [e]);
|
|
13
|
+
return /* @__PURE__ */ o(m.Provider, { value: r, children: /* @__PURE__ */ o(d.Root, { open: i, onOpenChange: a, modal: e, children: t }) });
|
|
14
14
|
};
|
|
15
15
|
y.displayName = "Dialog.Root";
|
|
16
|
-
const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger"
|
|
16
|
+
const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger" }, i) => /* @__PURE__ */ o(
|
|
17
17
|
d.Trigger,
|
|
18
18
|
{
|
|
19
|
-
onMouseDown:
|
|
19
|
+
onMouseDown: $,
|
|
20
20
|
"data-auto-focus-visible": "true",
|
|
21
21
|
"data-auto-focus-trigger": !0,
|
|
22
22
|
"data-test-id": a,
|
|
23
23
|
asChild: t,
|
|
24
|
-
ref:
|
|
25
|
-
...i,
|
|
24
|
+
ref: i,
|
|
26
25
|
children: e
|
|
27
26
|
}
|
|
28
27
|
);
|
|
29
28
|
D.displayName = "Dialog.Trigger";
|
|
30
|
-
const
|
|
31
|
-
const { isModal: a } =
|
|
32
|
-
return a ? /* @__PURE__ */ o(d.Overlay, { "data-visible": e, className:
|
|
29
|
+
const I = ({ children: t, showUnderlay: e }) => {
|
|
30
|
+
const { isModal: a } = B(m);
|
|
31
|
+
return a ? /* @__PURE__ */ o(d.Overlay, { "data-visible": e, className: n.underlay, children: t }) : /* @__PURE__ */ o("div", { className: n.underlay, "data-visible": e, children: t });
|
|
33
32
|
}, h = ({
|
|
34
33
|
maxWidth: t = "800px",
|
|
35
34
|
minWidth: e = "400px",
|
|
36
35
|
minHeight: a = "200px",
|
|
37
36
|
padding: i = "compact",
|
|
38
|
-
verticalAlign:
|
|
37
|
+
verticalAlign: r = "center",
|
|
39
38
|
"data-test-id": s = "fondue-dialog-content",
|
|
40
39
|
showUnderlay: c = !1,
|
|
41
40
|
rounded: T = !0,
|
|
42
|
-
children: w
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const H = (O) => {
|
|
41
|
+
children: w
|
|
42
|
+
}, S) => {
|
|
43
|
+
const M = k(), u = q(null);
|
|
44
|
+
E(u, S);
|
|
45
|
+
const A = (H) => {
|
|
48
46
|
var f;
|
|
49
|
-
|
|
47
|
+
H.preventDefault();
|
|
50
48
|
const g = (f = u.current) == null ? void 0 : f.querySelector('[data-dialog-layout-component="body"]'), p = g == null ? void 0 : g.querySelector(
|
|
51
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
49
|
+
'button:not([data-tooltip-trigger="true"]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
52
50
|
);
|
|
53
51
|
p instanceof HTMLElement && p.focus();
|
|
54
52
|
};
|
|
55
|
-
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(
|
|
53
|
+
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(G, { theme: M, children: /* @__PURE__ */ o(I, { showUnderlay: c, children: /* @__PURE__ */ o(
|
|
56
54
|
d.Content,
|
|
57
55
|
{
|
|
58
56
|
style: {
|
|
@@ -61,14 +59,13 @@ const J = ({ children: t, showUnderlay: e }) => {
|
|
|
61
59
|
"--dialog-min-height": a
|
|
62
60
|
},
|
|
63
61
|
ref: u,
|
|
64
|
-
className:
|
|
65
|
-
onFocus:
|
|
66
|
-
onOpenAutoFocus:
|
|
62
|
+
className: n.content,
|
|
63
|
+
onFocus: L,
|
|
64
|
+
onOpenAutoFocus: A,
|
|
67
65
|
"data-dialog-padding": i,
|
|
68
66
|
"data-dialog-rounded": T,
|
|
69
67
|
"data-test-id": s,
|
|
70
|
-
"data-dialog-vertical-align":
|
|
71
|
-
...S,
|
|
68
|
+
"data-dialog-vertical-align": r,
|
|
72
69
|
children: w
|
|
73
70
|
}
|
|
74
71
|
) }) }) });
|
|
@@ -79,19 +76,19 @@ const C = ({
|
|
|
79
76
|
showBorder: e = !0,
|
|
80
77
|
showCloseButton: a = !0,
|
|
81
78
|
closeProps: i,
|
|
82
|
-
children:
|
|
79
|
+
children: r,
|
|
83
80
|
"data-test-id": s = "fondue-dialog-header"
|
|
84
|
-
}, c) => /* @__PURE__ */
|
|
81
|
+
}, c) => /* @__PURE__ */ O(
|
|
85
82
|
"div",
|
|
86
83
|
{
|
|
87
84
|
"data-test-id": s,
|
|
88
85
|
ref: c,
|
|
89
|
-
className:
|
|
86
|
+
className: n.header,
|
|
90
87
|
"data-dialog-header-padding": t,
|
|
91
88
|
"data-show-border": e,
|
|
92
89
|
"data-dialog-layout-component": "header",
|
|
93
90
|
children: [
|
|
94
|
-
/* @__PURE__ */ o("div", { children:
|
|
91
|
+
/* @__PURE__ */ o("div", { children: r }),
|
|
95
92
|
a && /* @__PURE__ */ o(
|
|
96
93
|
d.Close,
|
|
97
94
|
{
|
|
@@ -100,19 +97,19 @@ const C = ({
|
|
|
100
97
|
className: "tw-cursor-pointer",
|
|
101
98
|
"aria-label": "Close",
|
|
102
99
|
...i,
|
|
103
|
-
children: /* @__PURE__ */ o(
|
|
100
|
+
children: /* @__PURE__ */ o(P, { size: 20 })
|
|
104
101
|
}
|
|
105
102
|
)
|
|
106
103
|
]
|
|
107
104
|
}
|
|
108
105
|
);
|
|
109
106
|
C.displayName = "Dialog.Header";
|
|
110
|
-
const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" },
|
|
107
|
+
const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, r) => /* @__PURE__ */ o(
|
|
111
108
|
"div",
|
|
112
109
|
{
|
|
113
110
|
"data-test-id": i,
|
|
114
|
-
ref:
|
|
115
|
-
className:
|
|
111
|
+
ref: r,
|
|
112
|
+
className: n.footer,
|
|
116
113
|
"data-dialog-footer-padding": t,
|
|
117
114
|
"data-show-border": e,
|
|
118
115
|
"data-dialog-layout-component": "footer",
|
|
@@ -125,14 +122,14 @@ const b = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }
|
|
|
125
122
|
{
|
|
126
123
|
"data-test-id": a,
|
|
127
124
|
ref: i,
|
|
128
|
-
className:
|
|
125
|
+
className: n.body,
|
|
129
126
|
"data-dialog-body-padding": t,
|
|
130
127
|
"data-dialog-layout-component": "body",
|
|
131
128
|
children: e
|
|
132
129
|
}
|
|
133
130
|
);
|
|
134
131
|
b.displayName = "Dialog.Body";
|
|
135
|
-
const v = ({ children: t, "data-test-id": e = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ o("div", { "data-test-id": e, ref: a, className:
|
|
132
|
+
const v = ({ children: t, "data-test-id": e = "fondue-dialog-side-content" }, a) => /* @__PURE__ */ o("div", { "data-test-id": e, ref: a, className: n.sideContent, "data-dialog-layout-component": !0, children: t });
|
|
136
133
|
v.displayName = "Dialog.SideContent";
|
|
137
134
|
const x = ({ children: t }) => /* @__PURE__ */ o(d.Close, { asChild: !0, children: t });
|
|
138
135
|
x.displayName = "Dialog.Close";
|
|
@@ -140,7 +137,7 @@ const F = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Title, { asChild:
|
|
|
140
137
|
F.displayName = "Dialog.Title";
|
|
141
138
|
const R = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Description, { asChild: e, children: t });
|
|
142
139
|
R.displayName = "Dialog.Description";
|
|
143
|
-
const
|
|
140
|
+
const Y = {
|
|
144
141
|
Root: y,
|
|
145
142
|
Title: F,
|
|
146
143
|
Description: R,
|
|
@@ -153,7 +150,7 @@ const Z = {
|
|
|
153
150
|
SideContent: l(v)
|
|
154
151
|
};
|
|
155
152
|
export {
|
|
156
|
-
|
|
153
|
+
Y as Dialog,
|
|
157
154
|
b as DialogBody,
|
|
158
155
|
x as DialogClose,
|
|
159
156
|
h as DialogContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n useRef,\n type CSSProperties,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/dialog.module.scss';\n\nexport type DialogRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The vertical alignment of the divider\n * @default \"center\"\n */\n verticalAlign?: 'top' | 'center';\n\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a minimum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = {\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 type DialogHeaderProps = {\n /**\n * Define the padding for the dialog header\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the bottom of the header\n * @default true\n */\n showBorder?: boolean;\n /**\n * Show a close button in the header\n * @default true\n */\n showCloseButton?: boolean;\n closeProps?: CommonAriaProps;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = {\n /**\n * Define the padding for the dialog footer\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the top of the footer\n * @default true\n */\n showBorder?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogBodyProps = {\n /**\n * Define the padding for the dialog body\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\ntype DialogContextType = {\n isModal: boolean;\n};\n\nconst DialogContext = createContext<DialogContextType>({ isModal: false });\nDialogContext.displayName = 'DialogContext';\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n const value = useMemo(() => ({ isModal: props.modal ?? false }), [props.modal]);\n return (\n <DialogContext.Provider value={value}>\n <RadixDialog.Root {...props}>{children}</RadixDialog.Root>\n </DialogContext.Provider>\n );\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dialog-trigger', ...props }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nconst DialogUnderlay = ({ children, showUnderlay }: { children: ReactNode; showUnderlay: boolean }) => {\n const { isModal } = useContext(DialogContext);\n if (isModal) {\n return (\n <RadixDialog.Overlay data-visible={showUnderlay} className={styles.underlay}>\n {children}\n </RadixDialog.Overlay>\n );\n }\n return (\n <div className={styles.underlay} data-visible={showUnderlay}>\n {children}\n </div>\n );\n};\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n verticalAlign = 'center',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n rounded = true,\n children,\n ...props\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n const contentRef = useRef<HTMLDivElement>(null);\n\n useSyncRefs<HTMLDivElement>(contentRef, ref);\n\n const handleOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n\n const dialogBody = contentRef.current?.querySelector('[data-dialog-layout-component=\"body\"]');\n\n const firstFocusable = dialogBody?.querySelector(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (firstFocusable instanceof HTMLElement) {\n firstFocusable.focus();\n }\n };\n\n return (\n <RadixDialog.Portal>\n <ThemeProvider theme={theme}>\n <DialogUnderlay showUnderlay={showUnderlay}>\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={contentRef}\n className={styles.content}\n onFocus={addShowFocusRing}\n onOpenAutoFocus={handleOpenAutoFocus}\n data-dialog-padding={padding}\n data-dialog-rounded={rounded}\n data-test-id={dataTestId}\n data-dialog-vertical-align={verticalAlign}\n {...props}\n >\n {children}\n </RadixDialog.Content>\n </DialogUnderlay>\n </ThemeProvider>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n {\n padding,\n showBorder = true,\n showCloseButton = true,\n closeProps,\n children,\n 'data-test-id': dataTestId = 'fondue-dialog-header',\n }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.header}\n data-dialog-header-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component=\"header\"\n >\n <div>{children}</div>\n {showCloseButton && (\n <RadixDialog.Close\n role=\"button\"\n data-test-id={`${dataTestId}-close`}\n className=\"tw-cursor-pointer\"\n aria-label=\"Close\"\n {...closeProps}\n >\n <IconCross size={20} />\n </RadixDialog.Close>\n )}\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { padding, showBorder = true, children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.footer}\n data-dialog-footer-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component=\"footer\"\n >\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { padding, children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.body}\n data-dialog-body-padding={padding}\n data-dialog-layout-component=\"body\"\n >\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.sideContent} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogContext","createContext","DialogRoot","children","props","value","useMemo","jsx","RadixDialog","DialogTrigger","asChild","dataTestId","ref","addAutoFocusAttribute","DialogUnderlay","showUnderlay","isModal","useContext","styles","DialogContent","maxWidth","minWidth","minHeight","padding","verticalAlign","rounded","theme","useFondueTheme","contentRef","useRef","useSyncRefs","handleOpenAutoFocus","event","dialogBody","_a","firstFocusable","ThemeProvider","addShowFocusRing","DialogHeader","showBorder","showCloseButton","closeProps","jsxs","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;;;;AAiJA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO;AACzED,EAAc,cAAc;AAErB,MAAME,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,QAA6B;AACnE,QAAMC,IAAQC,EAAQ,OAAO,EAAE,SAASF,EAAM,SAAS,OAAU,CAACA,EAAM,KAAK,CAAC;AAC9E,SACI,gBAAAG,EAACP,EAAc,UAAd,EAAuB,OAAAK,GACpB,UAAA,gBAAAE,EAACC,EAAY,MAAZ,EAAkB,GAAGJ,GAAQ,UAAAD,EAAA,CAAS,EAAA,CAC3C;AAER;AACAD,EAAW,cAAc;AAElB,MAAMO,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAP,GAAU,gBAAgBQ,IAAa,yBAAyB,GAAGP,EAAA,GACrFQ,MAGI,gBAAAL;AAAA,EAACC,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaK;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcF;AAAA,IACd,SAAAD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A8Cb,CAAY;AAAA,EAClE,QAAQa,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
|
|
1
|
+
{"version":3,"file":"fondue-components9.js","sources":["../src/components/Dialog/Dialog.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n useRef,\n type CSSProperties,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/dialog.module.scss';\n\nexport type DialogRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the dialog\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport type DialogContentProps = {\n /**\n * Add rounded corners to the dialog\n * @default true\n */\n rounded?: boolean;\n /**\n * Define the padding of the dialog\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * The vertical alignment of the divider\n * @default \"center\"\n */\n verticalAlign?: 'top' | 'center';\n\n /**\n * Define a maximum width for the dialog\n * @default \"800px\"\n */\n maxWidth?: string;\n /**\n * Define a minimum width for the dialog\n * @default \"400px\"\n */\n minWidth?: string;\n /**\n * Define a minimum height for the dialog\n * @default \"200px\"\n */\n minHeight?: string;\n /**\n * Show a dark underlay behind the dialog\n * @default false\n */\n showUnderlay?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogTriggerProps = {\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 type DialogHeaderProps = {\n /**\n * Define the padding for the dialog header\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the bottom of the header\n * @default true\n */\n showBorder?: boolean;\n /**\n * Show a close button in the header\n * @default true\n */\n showCloseButton?: boolean;\n closeProps?: CommonAriaProps;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogFooterProps = {\n /**\n * Define the padding for the dialog footer\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Show a border at the top of the footer\n * @default true\n */\n showBorder?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogBodyProps = {\n /**\n * Define the padding for the dialog body\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport type DialogSideContentProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport type DialogCloseProps = { children?: ReactNode };\n\nexport type DialogAnnouncementProps = { children?: ReactNode; asChild?: boolean };\n\ntype DialogContextType = {\n isModal: boolean;\n};\n\nconst DialogContext = createContext<DialogContextType>({ isModal: false });\nDialogContext.displayName = 'DialogContext';\n\nexport const DialogRoot = ({ children, modal, onOpenChange, open }: DialogRootProps) => {\n const value = useMemo(() => ({ isModal: modal ?? false }), [modal]);\n\n return (\n <DialogContext.Provider value={value}>\n <RadixDialog.Root open={open} onOpenChange={onOpenChange} modal={modal}>\n {children}\n </RadixDialog.Root>\n </DialogContext.Provider>\n );\n};\nDialogRoot.displayName = 'Dialog.Root';\n\nexport const DialogTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-dialog-trigger' }: DialogTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDialog.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n >\n {children}\n </RadixDialog.Trigger>\n );\n};\nDialogTrigger.displayName = 'Dialog.Trigger';\n\nconst DialogUnderlay = ({ children, showUnderlay }: { children: ReactNode; showUnderlay: boolean }) => {\n const { isModal } = useContext(DialogContext);\n if (isModal) {\n return (\n <RadixDialog.Overlay data-visible={showUnderlay} className={styles.underlay}>\n {children}\n </RadixDialog.Overlay>\n );\n }\n return (\n <div className={styles.underlay} data-visible={showUnderlay}>\n {children}\n </div>\n );\n};\n\nexport const DialogContent = (\n {\n maxWidth = '800px',\n minWidth = '400px',\n minHeight = '200px',\n padding = 'compact',\n verticalAlign = 'center',\n 'data-test-id': dataTestId = 'fondue-dialog-content',\n showUnderlay = false,\n rounded = true,\n children,\n }: DialogContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const theme = useFondueTheme();\n const contentRef = useRef<HTMLDivElement>(null);\n\n useSyncRefs<HTMLDivElement>(contentRef, ref);\n\n const handleOpenAutoFocus = (event: Event) => {\n event.preventDefault();\n\n const dialogBody = contentRef.current?.querySelector('[data-dialog-layout-component=\"body\"]');\n\n const firstFocusable = dialogBody?.querySelector(\n 'button:not([data-tooltip-trigger=\"true\"]), [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (firstFocusable instanceof HTMLElement) {\n firstFocusable.focus();\n }\n };\n\n return (\n <RadixDialog.Portal>\n <ThemeProvider theme={theme}>\n <DialogUnderlay showUnderlay={showUnderlay}>\n <RadixDialog.Content\n style={\n {\n '--dialog-max-width': maxWidth,\n '--dialog-min-width': minWidth,\n '--dialog-min-height': minHeight,\n } as CSSProperties\n }\n ref={contentRef}\n className={styles.content}\n onFocus={addShowFocusRing}\n onOpenAutoFocus={handleOpenAutoFocus}\n data-dialog-padding={padding}\n data-dialog-rounded={rounded}\n data-test-id={dataTestId}\n data-dialog-vertical-align={verticalAlign}\n >\n {children}\n </RadixDialog.Content>\n </DialogUnderlay>\n </ThemeProvider>\n </RadixDialog.Portal>\n );\n};\nDialogContent.displayName = 'Dialog.Content';\n\nexport const DialogHeader = (\n {\n padding,\n showBorder = true,\n showCloseButton = true,\n closeProps,\n children,\n 'data-test-id': dataTestId = 'fondue-dialog-header',\n }: DialogHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.header}\n data-dialog-header-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component=\"header\"\n >\n <div>{children}</div>\n {showCloseButton && (\n <RadixDialog.Close\n role=\"button\"\n data-test-id={`${dataTestId}-close`}\n className=\"tw-cursor-pointer\"\n aria-label=\"Close\"\n {...closeProps}\n >\n <IconCross size={20} />\n </RadixDialog.Close>\n )}\n </div>\n );\n};\nDialogHeader.displayName = 'Dialog.Header';\n\nexport const DialogFooter = (\n { padding, showBorder = true, children, 'data-test-id': dataTestId = 'fondue-dialog-footer' }: DialogFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.footer}\n data-dialog-footer-padding={padding}\n data-show-border={showBorder}\n data-dialog-layout-component=\"footer\"\n >\n {children}\n </div>\n );\n};\nDialogFooter.displayName = 'Dialog.Footer';\n\nexport const DialogBody = (\n { padding, children, 'data-test-id': dataTestId = 'fondue-dialog-body' }: DialogBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n className={styles.body}\n data-dialog-body-padding={padding}\n data-dialog-layout-component=\"body\"\n >\n {children}\n </div>\n );\n};\nDialogBody.displayName = 'Dialog.Body';\n\nexport const DialogSideContent = (\n { children, 'data-test-id': dataTestId = 'fondue-dialog-side-content' }: DialogSideContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.sideContent} data-dialog-layout-component>\n {children}\n </div>\n );\n};\nDialogSideContent.displayName = 'Dialog.SideContent';\n\nexport const DialogClose = ({ children }: DialogCloseProps) => {\n return <RadixDialog.Close asChild>{children}</RadixDialog.Close>;\n};\nDialogClose.displayName = 'Dialog.Close';\n\nexport const DialogTitle = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Title asChild={asChild}>{children}</RadixDialog.Title>;\n};\nDialogTitle.displayName = 'Dialog.Title';\n\nexport const DialogDescription = ({ children, asChild }: DialogAnnouncementProps) => {\n return <RadixDialog.Description asChild={asChild}>{children}</RadixDialog.Description>;\n};\nDialogDescription.displayName = 'Dialog.Description';\n\nexport const Dialog = {\n Root: DialogRoot,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Trigger: forwardRef<HTMLButtonElement, DialogTriggerProps>(DialogTrigger),\n Content: forwardRef<HTMLDivElement, DialogContentProps>(DialogContent),\n Header: forwardRef<HTMLDivElement, DialogHeaderProps>(DialogHeader),\n Footer: forwardRef<HTMLDivElement, DialogFooterProps>(DialogFooter),\n Body: forwardRef<HTMLDivElement, DialogBodyProps>(DialogBody),\n SideContent: forwardRef<HTMLDivElement, DialogSideContentProps>(DialogSideContent),\n};\n"],"names":["DialogContext","createContext","DialogRoot","children","modal","onOpenChange","open","value","useMemo","jsx","RadixDialog","DialogTrigger","asChild","dataTestId","ref","addAutoFocusAttribute","DialogUnderlay","showUnderlay","isModal","useContext","styles","DialogContent","maxWidth","minWidth","minHeight","padding","verticalAlign","rounded","theme","useFondueTheme","contentRef","useRef","useSyncRefs","handleOpenAutoFocus","event","dialogBody","_a","firstFocusable","ThemeProvider","addShowFocusRing","DialogHeader","showBorder","showCloseButton","closeProps","jsxs","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;;;;AAiJA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO;AACzED,EAAc,c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O,IAAE,UAAAP,GAAS;AAEhD8C,EAAY,cAAc;AAEnB,MAAMC,IAAc,CAAC,EAAE,UAAA/C,GAAU,SAAAS,QAC7B,gBAAAH,EAACC,EAAY,OAAZ,EAAkB,SAAAE,GAAmB,UAAAT,EAAA,CAAS;AAE1D+C,EAAY,cAAc;AAEnB,MAAMC,IAAoB,CAAC,EAAE,UAAAhD,GAAU,SAAAS,QACnC,gBAAAH,EAACC,EAAY,aAAZ,EAAwB,SAAAE,GAAmB,UAAAT,EAAA,CAAS;AAEhEgD,EAAkB,cAAc;AAEzB,MAAMC,IAAS;AAAA,EAClB,MAAMlD;AAAA,EACN,OAAOgD;AAAA,EACP,aAAaC;AAAA,EACb,OAAOF;AAAA,EACP,SAASI,EAAkD1C,CAAa;AAAA,EACxE,SAAS0C,EAA+ChC,CAAa;AAAA,EACrE,QAAQgC,EAA8Cb,CAAY;AAAA,EAClE,QAAQa,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_1xnv8_5", c = "_clearIcon_1xnv8_35", t = "_caret_1xnv8_52", n = "_colorName_1xnv8_70", _ = "_colorIndicator_1xnv8_73", r = "_button_1xnv8_94", a = "_actions_1xnv8_126", s = {
|
|
2
2
|
root: o,
|
|
3
|
-
clearIcon:
|
|
4
|
-
caret:
|
|
5
|
-
colorName:
|
|
6
|
-
colorIndicator:
|
|
3
|
+
clearIcon: c,
|
|
4
|
+
caret: t,
|
|
5
|
+
colorName: n,
|
|
6
|
+
colorIndicator: _,
|
|
7
7
|
button: r,
|
|
8
8
|
actions: a
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
11
|
a as actions,
|
|
12
12
|
r as button,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
t as caret,
|
|
14
|
+
c as clearIcon,
|
|
15
|
+
_ as colorIndicator,
|
|
16
|
+
n as colorName,
|
|
17
17
|
s as default,
|
|
18
18
|
o as root
|
|
19
19
|
};
|
|
@@ -1,5 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
import { Children as a, isValidElement as u, cloneElement as f } from "react";
|
|
2
|
+
import { ForwardedRefSelectItem as E } from "./fondue-components70.js";
|
|
3
|
+
const g = ({
|
|
4
|
+
children: o,
|
|
5
|
+
value: r,
|
|
6
|
+
label: s
|
|
7
|
+
}) => o && typeof o == "string" ? {
|
|
8
|
+
value: r || o,
|
|
9
|
+
label: s || o
|
|
10
|
+
} : {
|
|
11
|
+
value: r || "",
|
|
12
|
+
label: s || r || "",
|
|
13
|
+
...o ? { children: o } : null
|
|
14
|
+
}, w = (o, r) => u(o) && o.type === r, y = (o, r, s, p = 0) => {
|
|
15
|
+
const n = [];
|
|
16
|
+
let t = 0;
|
|
17
|
+
return a.forEach(o, (e) => {
|
|
18
|
+
if (w(e, E) && u(e))
|
|
19
|
+
g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
|
|
20
|
+
else if (u(e) && (e != null && e.props.children)) {
|
|
21
|
+
const { parsedChildren: m, subElementCount: C } = y(
|
|
22
|
+
e.props.children,
|
|
23
|
+
r,
|
|
24
|
+
"",
|
|
25
|
+
p + t
|
|
26
|
+
);
|
|
27
|
+
e = f(e, {
|
|
28
|
+
children: m,
|
|
29
|
+
key: `group-${p + t}`
|
|
30
|
+
}), n.push(e), t += C;
|
|
31
|
+
} else
|
|
32
|
+
n.push(e);
|
|
33
|
+
}), {
|
|
34
|
+
parsedChildren: n,
|
|
35
|
+
subElementCount: t
|
|
36
|
+
};
|
|
37
|
+
};
|
|
2
38
|
export {
|
|
3
|
-
|
|
39
|
+
g as getSelectOptionValue,
|
|
40
|
+
w as isReactLeaf,
|
|
41
|
+
y as recursiveMap
|
|
4
42
|
};
|
|
5
43
|
//# sourceMappingURL=fondue-components91.js.map
|