@frontify/fondue-components 19.1.0 → 19.2.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-components10.js +23 -19
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components11.js +2 -2
- package/dist/fondue-components12.js +1 -1
- package/dist/fondue-components13.js +34 -24
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components14.js +1 -1
- package/dist/fondue-components15.js +1 -1
- package/dist/fondue-components17.js +1 -1
- package/dist/fondue-components18.js +1 -1
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components20.js +1 -1
- package/dist/fondue-components21.js +2 -2
- package/dist/fondue-components22.js +6 -6
- package/dist/fondue-components23.js +1 -1
- package/dist/fondue-components24.js +1 -1
- package/dist/fondue-components25.js +3 -3
- package/dist/fondue-components26.js +3 -3
- package/dist/fondue-components27.js +1 -1
- package/dist/fondue-components28.js +31 -29
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +1 -1
- package/dist/fondue-components30.js +1 -1
- package/dist/fondue-components37.js +1 -1
- package/dist/fondue-components40.js +1 -1
- package/dist/fondue-components42.js +1 -1
- package/dist/fondue-components49.js +5 -60
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components50.js +59 -17
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +18 -19
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +18 -4
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +3 -13
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +13 -3
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +3 -17
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +19 -35
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +35 -5
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +4 -12
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +12 -4
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components60.js +4 -24
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +24 -16
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +16 -146
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +151 -19
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +19 -77
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +77 -8
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +8 -35
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +34 -48
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +70 -10
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +8 -10
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components70.js +12 -12
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +12 -20
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +21 -29
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +28 -55
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +55 -14
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +14 -25
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +24 -13
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +14 -6
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +6 -6
- package/dist/fondue-components79.js +7 -2
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components82.js +2 -17
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +16 -39
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +43 -0
- package/dist/fondue-components84.js.map +1 -0
- package/dist/fondue-components9.js +77 -66
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as P } from "react/jsx-runtime";
|
|
2
2
|
import { IconCross as j } from "@frontify/fondue-icons";
|
|
3
3
|
import * as d from "@radix-ui/react-dialog";
|
|
4
4
|
import { createContext as q, forwardRef as l, useRef as B, useContext as z } from "react";
|
|
@@ -6,9 +6,9 @@ import { useSyncRefs as E } from "./fondue-components46.js";
|
|
|
6
6
|
import { addShowFocusRing as L, addAutoFocusAttribute as $ } from "./fondue-components47.js";
|
|
7
7
|
import { useFondueTheme as k, ThemeProvider as G } from "./fondue-components29.js";
|
|
8
8
|
import n from "./fondue-components48.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
9
|
+
const f = q({ isModal: !1 }), y = ({ children: t, ...e }) => /* @__PURE__ */ o(f.Provider, { value: { isModal: e.modal ?? !1 }, children: /* @__PURE__ */ o(d.Root, { ...e, children: t }) });
|
|
10
|
+
y.displayName = "Dialog.Root";
|
|
11
|
+
const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-trigger", ...i }, r) => /* @__PURE__ */ o(
|
|
12
12
|
d.Trigger,
|
|
13
13
|
{
|
|
14
14
|
onMouseDown: $,
|
|
@@ -18,44 +18,44 @@ const y = ({ asChild: t = !0, children: o, "data-test-id": a = "fondue-dialog-tr
|
|
|
18
18
|
asChild: t,
|
|
19
19
|
ref: r,
|
|
20
20
|
...i,
|
|
21
|
-
children:
|
|
21
|
+
children: e
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
|
-
|
|
25
|
-
const I = ({ children: t, showUnderlay:
|
|
26
|
-
const { isModal: a } = z(
|
|
27
|
-
return a ? /* @__PURE__ */
|
|
28
|
-
},
|
|
24
|
+
D.displayName = "Dialog.Trigger";
|
|
25
|
+
const I = ({ children: t, showUnderlay: e }) => {
|
|
26
|
+
const { isModal: a } = z(f);
|
|
27
|
+
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 });
|
|
28
|
+
}, h = ({
|
|
29
29
|
maxWidth: t = "800px",
|
|
30
|
-
minWidth:
|
|
30
|
+
minWidth: e = "400px",
|
|
31
31
|
minHeight: a = "200px",
|
|
32
32
|
padding: i = "compact",
|
|
33
33
|
verticalAlign: r = "center",
|
|
34
34
|
"data-test-id": s = "fondue-dialog-content",
|
|
35
|
-
showUnderlay:
|
|
35
|
+
showUnderlay: c = !1,
|
|
36
36
|
rounded: T = !0,
|
|
37
37
|
children: w,
|
|
38
38
|
...S
|
|
39
39
|
}, M) => {
|
|
40
|
-
const A = k(),
|
|
41
|
-
E(
|
|
40
|
+
const A = k(), u = B(null);
|
|
41
|
+
E(u, M);
|
|
42
42
|
const H = (O) => {
|
|
43
|
-
var
|
|
43
|
+
var p;
|
|
44
44
|
O.preventDefault();
|
|
45
|
-
const
|
|
45
|
+
const g = (p = u.current) == null ? void 0 : p.querySelector('[data-dialog-layout-component="body"]'), m = g == null ? void 0 : g.querySelector(
|
|
46
46
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
47
47
|
);
|
|
48
|
-
|
|
48
|
+
m instanceof HTMLElement && m.focus();
|
|
49
49
|
};
|
|
50
|
-
return /* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(G, { theme: A, children: /* @__PURE__ */ o(I, { showUnderlay: c, children: /* @__PURE__ */ o(
|
|
51
51
|
d.Content,
|
|
52
52
|
{
|
|
53
53
|
style: {
|
|
54
54
|
"--dialog-max-width": t,
|
|
55
|
-
"--dialog-min-width":
|
|
55
|
+
"--dialog-min-width": e,
|
|
56
56
|
"--dialog-min-height": a
|
|
57
57
|
},
|
|
58
|
-
ref:
|
|
58
|
+
ref: u,
|
|
59
59
|
className: n.content,
|
|
60
60
|
onFocus: L,
|
|
61
61
|
onOpenAutoFocus: H,
|
|
@@ -68,43 +68,54 @@ const I = ({ children: t, showUnderlay: o }) => {
|
|
|
68
68
|
}
|
|
69
69
|
) }) }) });
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
const
|
|
71
|
+
h.displayName = "Dialog.Content";
|
|
72
|
+
const C = ({
|
|
73
73
|
padding: t,
|
|
74
|
-
showBorder:
|
|
74
|
+
showBorder: e = !0,
|
|
75
75
|
showCloseButton: a = !0,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
closeProps: i,
|
|
77
|
+
children: r,
|
|
78
|
+
"data-test-id": s = "fondue-dialog-header"
|
|
79
|
+
}, c) => /* @__PURE__ */ P(
|
|
79
80
|
"div",
|
|
80
81
|
{
|
|
81
|
-
"data-test-id":
|
|
82
|
-
ref:
|
|
82
|
+
"data-test-id": s,
|
|
83
|
+
ref: c,
|
|
83
84
|
className: n.header,
|
|
84
85
|
"data-dialog-header-padding": t,
|
|
85
|
-
"data-show-border":
|
|
86
|
+
"data-show-border": e,
|
|
86
87
|
"data-dialog-layout-component": "header",
|
|
87
88
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
a && /* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ o("div", { children: r }),
|
|
90
|
+
a && /* @__PURE__ */ o(
|
|
91
|
+
d.Close,
|
|
92
|
+
{
|
|
93
|
+
role: "button",
|
|
94
|
+
"data-test-id": `${s}-close`,
|
|
95
|
+
className: "tw-cursor-pointer",
|
|
96
|
+
"aria-label": "Close",
|
|
97
|
+
...i,
|
|
98
|
+
children: /* @__PURE__ */ o(j, { size: 20 })
|
|
99
|
+
}
|
|
100
|
+
)
|
|
90
101
|
]
|
|
91
102
|
}
|
|
92
103
|
);
|
|
93
|
-
|
|
94
|
-
const
|
|
104
|
+
C.displayName = "Dialog.Header";
|
|
105
|
+
const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, r) => /* @__PURE__ */ o(
|
|
95
106
|
"div",
|
|
96
107
|
{
|
|
97
108
|
"data-test-id": i,
|
|
98
109
|
ref: r,
|
|
99
110
|
className: n.footer,
|
|
100
111
|
"data-dialog-footer-padding": t,
|
|
101
|
-
"data-show-border":
|
|
112
|
+
"data-show-border": e,
|
|
102
113
|
"data-dialog-layout-component": "footer",
|
|
103
114
|
children: a
|
|
104
115
|
}
|
|
105
116
|
);
|
|
106
|
-
|
|
107
|
-
const
|
|
117
|
+
N.displayName = "Dialog.Footer";
|
|
118
|
+
const b = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }, i) => /* @__PURE__ */ o(
|
|
108
119
|
"div",
|
|
109
120
|
{
|
|
110
121
|
"data-test-id": a,
|
|
@@ -112,41 +123,41 @@ const N = ({ padding: t, children: o, "data-test-id": a = "fondue-dialog-body" }
|
|
|
112
123
|
className: n.body,
|
|
113
124
|
"data-dialog-body-padding": t,
|
|
114
125
|
"data-dialog-layout-component": "body",
|
|
115
|
-
children:
|
|
126
|
+
children: e
|
|
116
127
|
}
|
|
117
128
|
);
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
129
|
+
b.displayName = "Dialog.Body";
|
|
130
|
+
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 });
|
|
131
|
+
v.displayName = "Dialog.SideContent";
|
|
132
|
+
const x = ({ children: t }) => /* @__PURE__ */ o(d.Close, { asChild: !0, children: t });
|
|
133
|
+
x.displayName = "Dialog.Close";
|
|
134
|
+
const F = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Title, { asChild: e, children: t });
|
|
135
|
+
F.displayName = "Dialog.Title";
|
|
136
|
+
const R = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Description, { asChild: e, children: t });
|
|
137
|
+
R.displayName = "Dialog.Description";
|
|
127
138
|
const Y = {
|
|
128
|
-
Root:
|
|
129
|
-
Title:
|
|
130
|
-
Description:
|
|
131
|
-
Close:
|
|
132
|
-
Trigger: l(
|
|
133
|
-
Content: l(
|
|
134
|
-
Header: l(
|
|
135
|
-
Footer: l(
|
|
136
|
-
Body: l(
|
|
137
|
-
SideContent: l(
|
|
139
|
+
Root: y,
|
|
140
|
+
Title: F,
|
|
141
|
+
Description: R,
|
|
142
|
+
Close: x,
|
|
143
|
+
Trigger: l(D),
|
|
144
|
+
Content: l(h),
|
|
145
|
+
Header: l(C),
|
|
146
|
+
Footer: l(N),
|
|
147
|
+
Body: l(b),
|
|
148
|
+
SideContent: l(v)
|
|
138
149
|
};
|
|
139
150
|
export {
|
|
140
151
|
Y as Dialog,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
b as DialogBody,
|
|
153
|
+
x as DialogClose,
|
|
154
|
+
h as DialogContent,
|
|
155
|
+
R as DialogDescription,
|
|
156
|
+
N as DialogFooter,
|
|
157
|
+
C as DialogHeader,
|
|
158
|
+
y as DialogRoot,
|
|
159
|
+
v as DialogSideContent,
|
|
160
|
+
F as DialogTitle,
|
|
161
|
+
D as DialogTrigger
|
|
151
162
|
};
|
|
152
163
|
//# sourceMappingURL=fondue-components9.js.map
|
|
@@ -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 useRef,\n type CSSProperties,\n type ForwardedRef,\n type ReactNode,\n} from 'react';\n\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 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 });\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return (\n <DialogContext.Provider value={{ isModal: props.modal ?? false }}>\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 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 role=\"button\" data-test-id={`${dataTestId}-close`} className=\"tw-cursor-pointer\">\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","RadixDialog","DialogTrigger","asChild","dataTestId","ref","jsx","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","jsxs","IconCross","DialogFooter","DialogBody","DialogSideContent","DialogClose","DialogTitle","DialogDescription","Dialog","forwardRef"],"mappings":";;;;;;;;AA8IA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO,GAE5DC,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAEjCJ,EAAc,UAAd,EAAuB,OAAO,EAAE,SAASI,EAAM,SAAS,GAAM,GAC3D,4BAACC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA,GAC3C;AAGRD,EAAW,cAAc;AAElB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaM;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcH;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IACC,GAAGL;AAAA,IAEH,UAAAD;AAAA,EAAA;AACL;AAGRG,EAAc,cAAc;AAE5B,MAAMM,IAAiB,CAAC,EAAE,UAAAT,GAAU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AAcF;AAAA,IACd,KAAAC;AAAA,IACA,WAAWO,EAAO;AAAA,IAClB,4BAA0BK;AAAA,IAC1B,gCAA6B;AAAA,IAE5B,UAAAlB;AAAA,EAAA;AACL;AAGRuC,EAAW,cAAc;AAEZ,MAAAC,IAAoB,CAC7B,EAAE,UAAAxC,GAAU,gBAAgBK,IAAa,gCACzCC,MAGI,gBAAAC,EAAC,OAAI,EAAA,gBAAcF,GAAY,KAAAC,GAAU,WAAWO,EAAO,aAAa,gCAA4B,IAC/F,UAAAb,EACL,CAAA;AAGRwC,EAAkB,cAAc;AAEzB,MAAMC,IAAc,CAAC,EAAE,UAAAzC,0BAClBE,EAAY,OAAZ,EAAkB,SAAO,IAAE,UAAAF,GAAS;AAEhDyC,EAAY,cAAc;AAEnB,MAAMC,IAAc,CAAC,EAAE,UAAA1C,GAAU,SAAAI,QAC5B,gBAAAG,EAAAL,EAAY,OAAZ,EAAkB,SAAAE,GAAmB,UAAAJ,EAAS,CAAA;AAE1D0C,EAAY,cAAc;AAEnB,MAAMC,IAAoB,CAAC,EAAE,UAAA3C,GAAU,SAAAI,QAClC,gBAAAG,EAAAL,EAAY,aAAZ,EAAwB,SAAAE,GAAmB,UAAAJ,EAAS,CAAA;AAEhE2C,EAAkB,cAAc;AAEzB,MAAMC,IAAS;AAAA,EAClB,MAAM7C;AAAA,EACN,OAAO2C;AAAA,EACP,aAAaC;AAAA,EACb,OAAOF;AAAA,EACP,SAASI,EAAkD1C,CAAa;AAAA,EACxE,SAAS0C,EAA+C/B,CAAa;AAAA,EACrE,QAAQ+B,EAA8CZ,CAAY;AAAA,EAClE,QAAQY,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 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 });\n\nexport const DialogRoot = ({ children, ...props }: DialogRootProps) => {\n return (\n <DialogContext.Provider value={{ isModal: props.modal ?? false }}>\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","RadixDialog","DialogTrigger","asChild","dataTestId","ref","jsx","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":";;;;;;;;AAgJA,MAAMA,IAAgBC,EAAiC,EAAE,SAAS,IAAO,GAE5DC,IAAa,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAEjCJ,EAAc,UAAd,EAAuB,OAAO,EAAE,SAASI,EAAM,SAAS,GAAM,GAC3D,4BAACC,EAAY,MAAZ,EAAkB,GAAGD,GAAQ,UAAAD,EAAS,CAAA,GAC3C;AAGRD,EAAW,cAAc;AAElB,MAAMI,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAJ,GAAU,gBAAgBK,IAAa,yBAAyB,GAAGJ,EAAM,GAC3FK,MAGI,gBAAAC;AAAA,EAACL,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaM;AA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D3C,CAAa;AAAA,EACxE,SAAS2C,EAA+ChC,CAAa;AAAA,EACrE,QAAQgC,EAA8Cb,CAAY;AAAA,EAClE,QAAQa,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,14 @@ declare type AccordionTriggerProps = {
|
|
|
134
134
|
|
|
135
135
|
declare type AriaLabelAttrs = Pick<AriaAttributes, 'aria-label'> & Pick<AriaAttributes, 'aria-labelledby'>;
|
|
136
136
|
|
|
137
|
+
declare type AsyncItem = {
|
|
138
|
+
label: string;
|
|
139
|
+
value: string;
|
|
140
|
+
content?: ReactNode;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
declare type AsyncItemsFetcher = (filterText: string) => Promise<AsyncItem[]>;
|
|
144
|
+
|
|
137
145
|
declare type AtLeastOneAriaLabelAttr = AtLeastOneAttr<AriaLabelAttrs>;
|
|
138
146
|
|
|
139
147
|
declare type AtLeastOneAttr<T> = Partial<T> & {
|
|
@@ -572,6 +580,7 @@ declare type DialogHeaderProps = {
|
|
|
572
580
|
* @default true
|
|
573
581
|
*/
|
|
574
582
|
showCloseButton?: boolean;
|
|
583
|
+
closeProps?: CommonAriaProps;
|
|
575
584
|
children?: ReactNode;
|
|
576
585
|
'data-test-id'?: string;
|
|
577
586
|
};
|
|
@@ -917,6 +926,7 @@ declare type FlyoutHeaderProps = {
|
|
|
917
926
|
showCloseButton?: boolean;
|
|
918
927
|
children?: ReactNode;
|
|
919
928
|
'data-test-id'?: string;
|
|
929
|
+
closeProps?: CommonAriaProps;
|
|
920
930
|
};
|
|
921
931
|
|
|
922
932
|
declare type FlyoutRootProps = {
|
|
@@ -1003,6 +1013,10 @@ id?: string;
|
|
|
1003
1013
|
* @default 'compact'
|
|
1004
1014
|
*/
|
|
1005
1015
|
viewportCollisionPadding?: SelectMenuViewportCollisionPadding;
|
|
1016
|
+
/**
|
|
1017
|
+
* Function to fetch items asynchronously.
|
|
1018
|
+
*/
|
|
1019
|
+
getAsyncItems?: AsyncItemsFetcher;
|
|
1006
1020
|
} & CommonAriaProps & RefAttributes<HTMLDivElement>>;
|
|
1007
1021
|
|
|
1008
1022
|
declare const ForwardedRefSelectItem: ForwardRefExoticComponent<SelectItemProps & RefAttributes<HTMLLIElement>>;
|
|
@@ -1886,7 +1900,7 @@ declare type TextElementMap = {
|
|
|
1886
1900
|
declare type TextElementType<TTag extends TagType_2> = TextElementMap[TTag];
|
|
1887
1901
|
|
|
1888
1902
|
declare const TextFieldRoot: {
|
|
1889
|
-
({ children, className, status, "data-test-id": dataTestId, ...inputProps }: TextInputProps, ref: ForwardedRef<HTMLInputElement>): JSX_2.Element;
|
|
1903
|
+
({ children, className, status, "data-test-id": dataTestId, "aria-errormessage": ariaErrormessage, ...inputProps }: TextInputProps, ref: ForwardedRef<HTMLInputElement>): JSX_2.Element;
|
|
1890
1904
|
displayName: string;
|
|
1891
1905
|
};
|
|
1892
1906
|
|
|
@@ -1989,6 +2003,7 @@ declare type TextInputProps = {
|
|
|
1989
2003
|
'aria-label'?: string;
|
|
1990
2004
|
'aria-labelledby'?: string;
|
|
1991
2005
|
'aria-describedby'?: string;
|
|
2006
|
+
'aria-errormessage'?: string;
|
|
1992
2007
|
};
|
|
1993
2008
|
|
|
1994
2009
|
declare type TextProps<TTag extends TagType_2 = 'span'> = CommonAriaProps & TagProps<TTag> & {
|