@frontify/fondue-components 22.0.0 → 22.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fondue-components11.js +62 -47
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components13.js +71 -69
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components19.js +66 -61
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components25.js +111 -97
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components27.js +20 -18
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components29.js +56 -51
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components31.js +12 -12
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +37 -37
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components34.js +2 -2
- package/dist/fondue-components35.js +1 -1
- package/dist/fondue-components37.js +1 -1
- package/dist/fondue-components39.js +1 -1
- package/dist/fondue-components4.js +1 -1
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components42.js +1 -1
- package/dist/fondue-components44.js +1 -1
- package/dist/fondue-components50.js +4 -4
- package/dist/fondue-components52.js +1 -1
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components54.js +14 -14
- package/dist/fondue-components55.js +1 -1
- package/dist/fondue-components56.js +12 -12
- package/dist/fondue-components57.js +1 -1
- package/dist/fondue-components59.js +5 -5
- package/dist/fondue-components62.js +4 -4
- package/dist/fondue-components63.js +1 -1
- package/dist/fondue-components65.js +14 -14
- package/dist/fondue-components68.js +42 -42
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components70.js +34 -34
- package/dist/fondue-components71.js +2 -2
- package/dist/fondue-components73.js +8 -8
- package/dist/fondue-components75.js +18 -16
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components77.js +8 -8
- package/dist/fondue-components78.js +47 -35
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +10 -10
- package/dist/fondue-components81.js +16 -12
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components84.js +1 -1
- package/dist/fondue-components85.js +5 -2
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +4 -39
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +2 -6
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +15 -3
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +39 -4
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +71 -70
- package/dist/fondue-components9.js.map +1 -1
- package/dist/fondue-components90.js +6 -17
- package/dist/fondue-components90.js.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { IconCross as
|
|
1
|
+
import { jsx as o, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as j } 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
|
|
4
|
+
import { createContext as q, forwardRef as l, useRef as B, useContext as z, useMemo as E } from "react";
|
|
5
|
+
import { useSyncRefs as L } from "./fondue-components48.js";
|
|
6
|
+
import { addShowFocusRing as $, addAutoFocusAttribute as k } from "./fondue-components49.js";
|
|
7
|
+
import { useFondueTheme as G, ThemeProvider as I } from "./fondue-components31.js";
|
|
8
8
|
import n from "./fondue-components50.js";
|
|
9
|
-
const m =
|
|
9
|
+
const m = q({ isModal: !1 });
|
|
10
10
|
m.displayName = "DialogContext";
|
|
11
|
-
const
|
|
12
|
-
const r =
|
|
11
|
+
const D = ({ children: t, modal: e, onOpenChange: a, open: i }) => {
|
|
12
|
+
const r = E(() => ({ isModal: e ?? !1 }), [e]);
|
|
13
13
|
return /* @__PURE__ */ o(m.Provider, { value: r, children: /* @__PURE__ */ o(d.Root, { open: i, onOpenChange: a, modal: e, children: t }) });
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
D.displayName = "Dialog.Root";
|
|
16
|
+
const h = ({ 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: k,
|
|
20
20
|
"data-auto-focus-visible": "true",
|
|
21
21
|
"data-auto-focus-trigger": !0,
|
|
22
22
|
"data-test-id": a,
|
|
@@ -25,11 +25,11 @@ const D = ({ asChild: t = !0, children: e, "data-test-id": a = "fondue-dialog-tr
|
|
|
25
25
|
children: e
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const { isModal: a } =
|
|
28
|
+
h.displayName = "Dialog.Trigger";
|
|
29
|
+
const J = ({ children: t, showUnderlay: e }) => {
|
|
30
|
+
const { isModal: a } = z(m);
|
|
31
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 });
|
|
32
|
-
},
|
|
32
|
+
}, C = ({
|
|
33
33
|
maxWidth: t = "800px",
|
|
34
34
|
minWidth: e = "400px",
|
|
35
35
|
minHeight: a = "200px",
|
|
@@ -37,20 +37,20 @@ const I = ({ children: t, showUnderlay: e }) => {
|
|
|
37
37
|
verticalAlign: r = "center",
|
|
38
38
|
"data-test-id": s = "fondue-dialog-content",
|
|
39
39
|
showUnderlay: c = !1,
|
|
40
|
-
rounded:
|
|
41
|
-
children:
|
|
42
|
-
},
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
const g = (
|
|
40
|
+
rounded: w = !0,
|
|
41
|
+
children: S
|
|
42
|
+
}, M) => {
|
|
43
|
+
const { theme: A, dir: p } = G(), u = B(null);
|
|
44
|
+
L(u, M);
|
|
45
|
+
const H = (O) => {
|
|
46
|
+
var y;
|
|
47
|
+
O.preventDefault();
|
|
48
|
+
const g = (y = u.current) == null ? void 0 : y.querySelector('[data-dialog-layout-component="body"]'), f = g == null ? void 0 : g.querySelector(
|
|
49
49
|
'button:not([data-tooltip-trigger="true"]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
f instanceof HTMLElement && f.focus();
|
|
52
52
|
};
|
|
53
|
-
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(
|
|
53
|
+
return /* @__PURE__ */ o(d.Portal, { children: /* @__PURE__ */ o(I, { theme: A, dir: p, children: /* @__PURE__ */ o(J, { showUnderlay: c, children: /* @__PURE__ */ o(
|
|
54
54
|
d.Content,
|
|
55
55
|
{
|
|
56
56
|
style: {
|
|
@@ -60,25 +60,26 @@ const I = ({ children: t, showUnderlay: e }) => {
|
|
|
60
60
|
},
|
|
61
61
|
ref: u,
|
|
62
62
|
className: n.content,
|
|
63
|
-
onFocus:
|
|
64
|
-
onOpenAutoFocus:
|
|
63
|
+
onFocus: $,
|
|
64
|
+
onOpenAutoFocus: H,
|
|
65
65
|
"data-dialog-padding": i,
|
|
66
|
-
"data-dialog-rounded":
|
|
66
|
+
"data-dialog-rounded": w,
|
|
67
67
|
"data-test-id": s,
|
|
68
68
|
"data-dialog-vertical-align": r,
|
|
69
|
-
|
|
69
|
+
dir: p,
|
|
70
|
+
children: S
|
|
70
71
|
}
|
|
71
72
|
) }) }) });
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
-
const
|
|
74
|
+
C.displayName = "Dialog.Content";
|
|
75
|
+
const N = ({
|
|
75
76
|
padding: t,
|
|
76
77
|
showBorder: e = !0,
|
|
77
78
|
showCloseButton: a = !0,
|
|
78
79
|
closeProps: i,
|
|
79
80
|
children: r,
|
|
80
81
|
"data-test-id": s = "fondue-dialog-header"
|
|
81
|
-
}, c) => /* @__PURE__ */
|
|
82
|
+
}, c) => /* @__PURE__ */ P(
|
|
82
83
|
"div",
|
|
83
84
|
{
|
|
84
85
|
"data-test-id": s,
|
|
@@ -97,14 +98,14 @@ const C = ({
|
|
|
97
98
|
className: "tw-cursor-pointer",
|
|
98
99
|
"aria-label": "Close",
|
|
99
100
|
...i,
|
|
100
|
-
children: /* @__PURE__ */ o(
|
|
101
|
+
children: /* @__PURE__ */ o(j, { size: 20 })
|
|
101
102
|
}
|
|
102
103
|
)
|
|
103
104
|
]
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
|
-
|
|
107
|
-
const
|
|
107
|
+
N.displayName = "Dialog.Header";
|
|
108
|
+
const b = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "fondue-dialog-footer" }, r) => /* @__PURE__ */ o(
|
|
108
109
|
"div",
|
|
109
110
|
{
|
|
110
111
|
"data-test-id": i,
|
|
@@ -116,8 +117,8 @@ const N = ({ padding: t, showBorder: e = !0, children: a, "data-test-id": i = "f
|
|
|
116
117
|
children: a
|
|
117
118
|
}
|
|
118
119
|
);
|
|
119
|
-
|
|
120
|
-
const
|
|
120
|
+
b.displayName = "Dialog.Footer";
|
|
121
|
+
const v = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }, i) => /* @__PURE__ */ o(
|
|
121
122
|
"div",
|
|
122
123
|
{
|
|
123
124
|
"data-test-id": a,
|
|
@@ -128,38 +129,38 @@ const b = ({ padding: t, children: e, "data-test-id": a = "fondue-dialog-body" }
|
|
|
128
129
|
children: e
|
|
129
130
|
}
|
|
130
131
|
);
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
Root:
|
|
142
|
-
Title:
|
|
143
|
-
Description:
|
|
144
|
-
Close:
|
|
145
|
-
Trigger: l(
|
|
146
|
-
Content: l(
|
|
147
|
-
Header: l(
|
|
148
|
-
Footer: l(
|
|
149
|
-
Body: l(
|
|
150
|
-
SideContent: l(
|
|
132
|
+
v.displayName = "Dialog.Body";
|
|
133
|
+
const x = ({ 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 });
|
|
134
|
+
x.displayName = "Dialog.SideContent";
|
|
135
|
+
const F = ({ children: t }) => /* @__PURE__ */ o(d.Close, { asChild: !0, children: t });
|
|
136
|
+
F.displayName = "Dialog.Close";
|
|
137
|
+
const R = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Title, { asChild: e, children: t });
|
|
138
|
+
R.displayName = "Dialog.Title";
|
|
139
|
+
const T = ({ children: t, asChild: e }) => /* @__PURE__ */ o(d.Description, { asChild: e, children: t });
|
|
140
|
+
T.displayName = "Dialog.Description";
|
|
141
|
+
const Z = {
|
|
142
|
+
Root: D,
|
|
143
|
+
Title: R,
|
|
144
|
+
Description: T,
|
|
145
|
+
Close: F,
|
|
146
|
+
Trigger: l(h),
|
|
147
|
+
Content: l(C),
|
|
148
|
+
Header: l(N),
|
|
149
|
+
Footer: l(b),
|
|
150
|
+
Body: l(v),
|
|
151
|
+
SideContent: l(x)
|
|
151
152
|
};
|
|
152
153
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
Z as Dialog,
|
|
155
|
+
v as DialogBody,
|
|
156
|
+
F as DialogClose,
|
|
157
|
+
C as DialogContent,
|
|
158
|
+
T as DialogDescription,
|
|
159
|
+
b as DialogFooter,
|
|
160
|
+
N as DialogHeader,
|
|
161
|
+
D as DialogRoot,
|
|
162
|
+
x as DialogSideContent,
|
|
163
|
+
R as DialogTitle,
|
|
164
|
+
h as DialogTrigger
|
|
164
165
|
};
|
|
165
166
|
//# 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 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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,EAAE,UAAA9C,0BAClBO,EAAY,OAAZ,EAAkB,SAAO,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
|
+
{"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, dir } = 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} dir={dir}>\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 dir={dir}\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","dir","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,OAAAC,GAAO,cAAAC,GAAc,MAAAC,QAA4B;AACpF,QAAMC,IAAQC,EAAQ,OAAO,EAAE,SAASJ,KAAS,GAAA,IAAU,CAACA,CAAK,CAAC;AAElE,SACI,gBAAAK,EAACT,EAAc,UAAd,EAAuB,OAAAO,GACpB,UAAA,gBAAAE,EAACC,EAAY,MAAZ,EAAiB,MAAAJ,GAAY,cAAAD,GAA4B,OAAAD,GACrD,UAAAD,GACL,GACJ;AAER;AACAD,EAAW,cAAc;AAElB,MAAMS,IAAgB,CACzB,EAAE,SAAAC,IAAU,IAAM,UAAAT,GAAU,gBAAgBU,IAAa,wBAAA,GACzDC,MAGI,gBAAAL;AAAA,EAACC,EAAY;AAAA,EAAZ;AAAA,IACG,aAAaK;AAAA,IACb,2BAAwB;AAAA,IACxB,2BAAuB;AAAA,IACvB,gBAAcF;AAAA,IACd,SAAAD;AAAA,IACA,KAAAE;AAAA,IAEC,U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;AAAA,EAClE,QAAQa,EAA8CP,CAAY;AAAA,EAClE,MAAMO,EAA4CN,CAAU;AAAA,EAC5D,aAAaM,EAAmDL,CAAiB;AACrF;"}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
button: n,
|
|
7
|
-
colorIndicator: r,
|
|
8
|
-
actions: a
|
|
9
|
-
};
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as s } from "@frontify/fondue-icons";
|
|
3
|
+
import { Button as o } from "./fondue-components6.js";
|
|
4
|
+
import t from "./fondue-components70.js";
|
|
5
|
+
const c = ({ onClear: r }) => /* @__PURE__ */ e(o, { "aria-label": "clear input", type: "button", size: "small", emphasis: "weak", aspect: "square", onPress: r, children: /* @__PURE__ */ e(s, { className: t.clearIcon, size: 16 }) });
|
|
10
6
|
export {
|
|
11
|
-
|
|
12
|
-
n as button,
|
|
13
|
-
t as caret,
|
|
14
|
-
c as clearIcon,
|
|
15
|
-
r as colorIndicator,
|
|
16
|
-
_ as colorName,
|
|
17
|
-
x as default,
|
|
18
|
-
o as root
|
|
7
|
+
c as SelectClear
|
|
19
8
|
};
|
|
20
9
|
//# sourceMappingURL=fondue-components90.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components90.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components90.js","sources":["../src/components/Select/SelectClear.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\n\nimport { Button } from '../Button/Button';\n\nimport styles from './styles/select.module.scss';\n\nexport const SelectClear = ({ onClear }: { onClear?: () => void }) => {\n return (\n <Button aria-label=\"clear input\" type=\"button\" size=\"small\" emphasis=\"weak\" aspect=\"square\" onPress={onClear}>\n <IconCross className={styles.clearIcon} size={16} />\n </Button>\n );\n};\n"],"names":["SelectClear","onClear","jsx","Button","IconCross","styles"],"mappings":";;;;AAQO,MAAMA,IAAc,CAAC,EAAE,SAAAC,QAEtB,gBAAAC,EAACC,KAAO,cAAW,eAAc,MAAK,UAAS,MAAK,SAAQ,UAAS,QAAO,QAAO,UAAS,SAASF,GACjG,UAAA,gBAAAC,EAACE,GAAA,EAAU,WAAWC,EAAO,WAAW,MAAM,GAAA,CAAI,EAAA,CACtD;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -687,6 +687,11 @@ declare type DropdownContentProps = {
|
|
|
687
687
|
* @default 'compact'
|
|
688
688
|
*/
|
|
689
689
|
viewportCollisionPadding?: DropdownViewportCollisionPadding;
|
|
690
|
+
/**
|
|
691
|
+
* When true, the content will always be mounted in the DOM. Before enabling, make sure you really need it.
|
|
692
|
+
* @default false
|
|
693
|
+
*/
|
|
694
|
+
forceMount?: boolean;
|
|
690
695
|
};
|
|
691
696
|
|
|
692
697
|
declare type DropdownGroupProps = {
|
|
@@ -1659,6 +1664,16 @@ export declare const Table: {
|
|
|
1659
1664
|
};
|
|
1660
1665
|
|
|
1661
1666
|
declare type TableBodyProps = {
|
|
1667
|
+
/**
|
|
1668
|
+
* Whether the first column should stick to the left when scrolling horizontally
|
|
1669
|
+
* @default false
|
|
1670
|
+
*/
|
|
1671
|
+
firstColumnSticky?: boolean;
|
|
1672
|
+
/**
|
|
1673
|
+
* Whether the last column should stick to the right when scrolling horizontally
|
|
1674
|
+
* @default false
|
|
1675
|
+
*/
|
|
1676
|
+
lastColumnSticky?: boolean;
|
|
1662
1677
|
children: ReactNode;
|
|
1663
1678
|
'aria-busy'?: boolean;
|
|
1664
1679
|
};
|
|
@@ -1722,6 +1737,11 @@ declare type TableHeaderCellProps = {
|
|
|
1722
1737
|
};
|
|
1723
1738
|
|
|
1724
1739
|
declare type TableHeaderProps = {
|
|
1740
|
+
/**
|
|
1741
|
+
* Whether the header should stick to the top when scrolling
|
|
1742
|
+
* @default false
|
|
1743
|
+
*/
|
|
1744
|
+
sticky?: boolean;
|
|
1725
1745
|
children: ReactNode;
|
|
1726
1746
|
'aria-label'?: string;
|
|
1727
1747
|
'aria-busy'?: boolean;
|
|
@@ -1740,6 +1760,7 @@ declare type TableRootProps = {
|
|
|
1740
1760
|
fontSize?: 'small' | 'medium';
|
|
1741
1761
|
/**
|
|
1742
1762
|
* Whether header should stick to the top when scrolling
|
|
1763
|
+
* @deprecated Use `Table.Header sticky` prop instead. For sticky columns, use `Table.Body firstColumnSticky` or `lastColumnSticky` props
|
|
1743
1764
|
*/
|
|
1744
1765
|
sticky?: 'head' | 'col' | 'both';
|
|
1745
1766
|
children: ReactNode;
|
|
@@ -2066,7 +2087,7 @@ declare type TextElementMap = {
|
|
|
2066
2087
|
declare type TextElementType<TTag extends TagType_2> = TextElementMap[TTag];
|
|
2067
2088
|
|
|
2068
2089
|
declare const TextFieldRoot: {
|
|
2069
|
-
({ children, className, status, "data-test-id": dataTestId, "aria-errormessage": ariaErrormessage, ...inputProps }: TextInputProps, ref: ForwardedRef<HTMLInputElement>): JSX_2.Element;
|
|
2090
|
+
({ children, className, status, "data-test-id": dataTestId, "aria-errormessage": ariaErrormessage, placeholder, ...inputProps }: TextInputProps, ref: ForwardedRef<HTMLInputElement>): JSX_2.Element;
|
|
2070
2091
|
displayName: string;
|
|
2071
2092
|
};
|
|
2072
2093
|
|
|
@@ -2215,9 +2236,9 @@ declare type TextSize = 'x-small' | 'small' | 'medium' | 'large';
|
|
|
2215
2236
|
|
|
2216
2237
|
declare type TextWeight = 'default' | 'strong' | 'x-strong';
|
|
2217
2238
|
|
|
2218
|
-
export declare const ThemeContext: Context<"
|
|
2239
|
+
export declare const ThemeContext: Context<Pick<ThemeProviderProps, "dir" | "theme">>;
|
|
2219
2240
|
|
|
2220
|
-
export declare const ThemeProvider: ({ children, theme, asChild }: ThemeProviderProps) => JSX_2.Element;
|
|
2241
|
+
export declare const ThemeProvider: ({ children, theme, dir, asChild }: ThemeProviderProps) => JSX_2.Element;
|
|
2221
2242
|
|
|
2222
2243
|
declare type ThemeProviderProps = {
|
|
2223
2244
|
children: ReactNode;
|
|
@@ -2226,6 +2247,11 @@ declare type ThemeProviderProps = {
|
|
|
2226
2247
|
* @default "light"
|
|
2227
2248
|
* */
|
|
2228
2249
|
theme: AvailableTheme;
|
|
2250
|
+
/**
|
|
2251
|
+
* Direction to apply to the theme
|
|
2252
|
+
* @default "ltr"
|
|
2253
|
+
*/
|
|
2254
|
+
dir: 'ltr' | 'rtl';
|
|
2229
2255
|
/**
|
|
2230
2256
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
2231
2257
|
* @default false
|
|
@@ -2284,7 +2310,7 @@ declare type TooltipTriggerProps = {
|
|
|
2284
2310
|
'data-test-id'?: string;
|
|
2285
2311
|
};
|
|
2286
2312
|
|
|
2287
|
-
export declare const useFondueTheme: () => "
|
|
2313
|
+
export declare const useFondueTheme: () => Pick<ThemeProviderProps, "dir" | "theme">;
|
|
2288
2314
|
|
|
2289
2315
|
export { }
|
|
2290
2316
|
|