@texturehq/edges 1.18.1 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FileUpload-DXTcfLIh.d.cts +348 -0
- package/dist/FileUpload-DXTcfLIh.d.ts +348 -0
- package/dist/TimeField-B4J8gA8E.d.ts +393 -0
- package/dist/TimeField-D2AOjQ1K.d.cts +393 -0
- package/dist/{colors-Kck1-4Zq.d.cts → colors-BUEmaPXY.d.ts} +4 -122
- package/dist/{colors-Kck1-4Zq.d.ts → colors-BniWNyzj.d.cts} +4 -122
- package/dist/components.manifest.json +13 -9
- package/dist/form/index.cjs +2 -0
- package/dist/form/index.cjs.map +1 -0
- package/dist/form/index.d.cts +3 -0
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.js +2 -0
- package/dist/form/index.js.map +1 -0
- package/dist/generated/tailwind-tokens-dark.css +1 -0
- package/dist/generated/tailwind-tokens-light.css +1 -0
- package/dist/index-DKA9NMRw.d.cts +311 -0
- package/dist/index-DKA9NMRw.d.ts +311 -0
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -794
- package/dist/index.d.ts +24 -794
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/rhf/index.cjs +2 -0
- package/dist/rhf/index.cjs.map +1 -0
- package/dist/rhf/index.d.cts +147 -0
- package/dist/rhf/index.d.ts +147 -0
- package/dist/rhf/index.js +2 -0
- package/dist/rhf/index.js.map +1 -0
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +2 -1
- package/dist/server.d.ts +2 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/styles.css +92 -27
- package/dist/utilities.manifest.json +2 -2
- package/package.json +30 -3
- package/scripts/generate-edges-docs.js +43 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shared action type for Dialog and Drawer footer buttons
|
|
7
|
+
*/
|
|
8
|
+
interface DialogAction {
|
|
9
|
+
label: string;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
variant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
12
|
+
size?: "sm" | "md" | "lg";
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Shared header props for Dialog and Drawer
|
|
18
|
+
*/
|
|
19
|
+
interface DialogHeaderConfig {
|
|
20
|
+
/**
|
|
21
|
+
* Title text for the header
|
|
22
|
+
*/
|
|
23
|
+
title?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Custom header content (overrides title)
|
|
26
|
+
*/
|
|
27
|
+
headerContent?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Alignment of the title
|
|
30
|
+
* @default "left"
|
|
31
|
+
*/
|
|
32
|
+
titleAlign?: "left" | "center";
|
|
33
|
+
/**
|
|
34
|
+
* Whether to hide the close button
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
hideCloseIcon?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to show a back arrow
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
hasBackArrow?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Callback when back arrow is clicked (required if hasBackArrow is true)
|
|
45
|
+
*/
|
|
46
|
+
onBack?: () => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Shared footer props for Dialog and Drawer
|
|
50
|
+
*/
|
|
51
|
+
interface DialogFooterConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Primary action button configuration
|
|
54
|
+
*/
|
|
55
|
+
primaryAction?: DialogAction;
|
|
56
|
+
/**
|
|
57
|
+
* Secondary action button configuration
|
|
58
|
+
*/
|
|
59
|
+
secondaryAction?: DialogAction;
|
|
60
|
+
/**
|
|
61
|
+
* Custom footer content above the action buttons
|
|
62
|
+
*/
|
|
63
|
+
footerContent?: ReactNode;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface DialogProps extends Omit<DialogHeaderConfig, "onClose">, DialogFooterConfig {
|
|
67
|
+
/**
|
|
68
|
+
* Whether the dialog is open (controlled mode)
|
|
69
|
+
* When using DialogTrigger, leave this undefined for automatic state management
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
isOpen?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Callback when the dialog is closed (controlled mode)
|
|
75
|
+
* When using DialogTrigger, leave this undefined for automatic state management
|
|
76
|
+
* @default undefined
|
|
77
|
+
*/
|
|
78
|
+
onClose?: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Dialog content
|
|
81
|
+
*/
|
|
82
|
+
children: React__default.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to use a transparent backdrop
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
transparentOverlay?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Maximum width of the dialog
|
|
90
|
+
* @default "600px"
|
|
91
|
+
*/
|
|
92
|
+
maxWidth?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Minimum width of the dialog (desktop only, mobile uses full width)
|
|
95
|
+
* @default "400px"
|
|
96
|
+
*/
|
|
97
|
+
minWidth?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Maximum height of the dialog on desktop
|
|
100
|
+
* @default "85vh"
|
|
101
|
+
*/
|
|
102
|
+
maxHeight?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Explicit height of the dialog on desktop (overrides maxHeight if set)
|
|
105
|
+
* Content will scroll within this fixed height
|
|
106
|
+
* @default undefined
|
|
107
|
+
*/
|
|
108
|
+
height?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Maximum height of the dialog on mobile (tray version)
|
|
111
|
+
* @default "90vh"
|
|
112
|
+
*/
|
|
113
|
+
mobileMaxHeight?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Explicit height of the dialog on mobile (overrides mobileMaxHeight if set)
|
|
116
|
+
* Content will scroll within this fixed height
|
|
117
|
+
* @default undefined
|
|
118
|
+
*/
|
|
119
|
+
mobileHeight?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Whether to include padding inside the content area
|
|
122
|
+
* @default true
|
|
123
|
+
*/
|
|
124
|
+
contentPadding?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Additional CSS classes
|
|
127
|
+
*/
|
|
128
|
+
className?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Dialog
|
|
132
|
+
*
|
|
133
|
+
* Responsive modal dialog component with backdrop.
|
|
134
|
+
*
|
|
135
|
+
* **Desktop (≥768px):** Centered modal with scale and fade animation
|
|
136
|
+
* **Mobile (<768px):** Uses Tray component for native bottom sheet experience with drag handle
|
|
137
|
+
*
|
|
138
|
+
* Includes optional header with title/back button and footer with action buttons.
|
|
139
|
+
*
|
|
140
|
+
* ## Usage Patterns
|
|
141
|
+
*
|
|
142
|
+
* ### Uncontrolled with DialogTrigger (Recommended)
|
|
143
|
+
* ```tsx
|
|
144
|
+
* import { DialogTrigger, Dialog, Button } from "@texturehq/edges";
|
|
145
|
+
*
|
|
146
|
+
* <DialogTrigger>
|
|
147
|
+
* <Button>Open Dialog</Button>
|
|
148
|
+
* <Dialog title="My Dialog">
|
|
149
|
+
* <p>Dialog content</p>
|
|
150
|
+
* </Dialog>
|
|
151
|
+
* </DialogTrigger>
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* ### Controlled (Advanced)
|
|
155
|
+
* ```tsx
|
|
156
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
157
|
+
*
|
|
158
|
+
* <Dialog isOpen={isOpen} onClose={() => setIsOpen(false)} title="My Dialog">
|
|
159
|
+
* <p>Dialog content</p>
|
|
160
|
+
* </Dialog>
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
declare function Dialog({ isOpen, onClose, title, headerContent, titleAlign, hideCloseIcon, hasBackArrow, onBack, children, primaryAction, secondaryAction, footerContent, transparentOverlay, maxWidth, minWidth, maxHeight, height, mobileMaxHeight, mobileHeight, contentPadding, className, }: DialogProps): react_jsx_runtime.JSX.Element | null;
|
|
164
|
+
|
|
165
|
+
interface DrawerProps extends DialogHeaderConfig, DialogFooterConfig {
|
|
166
|
+
/**
|
|
167
|
+
* Drawer content
|
|
168
|
+
*/
|
|
169
|
+
children?: React__default.ReactNode;
|
|
170
|
+
/**
|
|
171
|
+
* Whether the drawer is open
|
|
172
|
+
*/
|
|
173
|
+
isOpen: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Side to slide in from
|
|
176
|
+
* @default "right"
|
|
177
|
+
*/
|
|
178
|
+
slideInFrom?: "left" | "right";
|
|
179
|
+
/**
|
|
180
|
+
* Whether to use a transparent backdrop
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
transparentOverlay?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Callback when the drawer is closed
|
|
186
|
+
*/
|
|
187
|
+
onClose?: () => void;
|
|
188
|
+
/**
|
|
189
|
+
* Additional CSS classes
|
|
190
|
+
*/
|
|
191
|
+
className?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Whether to include padding inside the content area
|
|
194
|
+
* @default true
|
|
195
|
+
*/
|
|
196
|
+
contentPadding?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Maximum width of the drawer
|
|
199
|
+
* @default "400px"
|
|
200
|
+
*/
|
|
201
|
+
maxWidth?: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Drawer
|
|
205
|
+
*
|
|
206
|
+
* Sliding panel that anchors to screen edges.
|
|
207
|
+
*/
|
|
208
|
+
declare function Drawer({ children, title, headerContent, titleAlign, hideCloseIcon, hasBackArrow, onBack, isOpen, slideInFrom, transparentOverlay, onClose, className, primaryAction, secondaryAction, footerContent, contentPadding, maxWidth, }: DrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
209
|
+
declare namespace Drawer {
|
|
210
|
+
var displayName: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface DialogFormProps extends Omit<DialogProps, "children" | "footerContent"> {
|
|
214
|
+
formId?: string;
|
|
215
|
+
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
216
|
+
primaryLabel?: string;
|
|
217
|
+
secondaryLabel?: string;
|
|
218
|
+
onCancel?: () => void;
|
|
219
|
+
primaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
220
|
+
secondaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
221
|
+
children?: React.ReactNode;
|
|
222
|
+
}
|
|
223
|
+
declare function DialogForm({ formId, onSubmit, primaryLabel, secondaryLabel, onCancel, primaryVariant, secondaryVariant, children, title, ...dialogProps }: DialogFormProps): react_jsx_runtime.JSX.Element;
|
|
224
|
+
|
|
225
|
+
interface DrawerFormProps extends Omit<DrawerProps, "children" | "footerContent"> {
|
|
226
|
+
formId?: string;
|
|
227
|
+
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
228
|
+
primaryLabel?: string;
|
|
229
|
+
secondaryLabel?: string;
|
|
230
|
+
onCancel?: () => void;
|
|
231
|
+
primaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
232
|
+
secondaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
233
|
+
children?: React.ReactNode;
|
|
234
|
+
}
|
|
235
|
+
declare function DrawerForm({ formId, onSubmit, primaryLabel, secondaryLabel, onCancel, primaryVariant, secondaryVariant, children, ...drawerProps }: DrawerFormProps): react_jsx_runtime.JSX.Element;
|
|
236
|
+
|
|
237
|
+
interface FormActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
238
|
+
align?: "start" | "end" | "between";
|
|
239
|
+
}
|
|
240
|
+
declare function FormActions({ align, className, ...rest }: FormActionsProps): react_jsx_runtime.JSX.Element;
|
|
241
|
+
|
|
242
|
+
interface FormGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
243
|
+
cols?: {
|
|
244
|
+
base?: 1 | 2 | 3 | 4;
|
|
245
|
+
md?: 1 | 2 | 3 | 4;
|
|
246
|
+
lg?: 1 | 2 | 3 | 4;
|
|
247
|
+
};
|
|
248
|
+
gap?: "sm" | "md" | "lg";
|
|
249
|
+
}
|
|
250
|
+
declare function FormGrid({ cols, gap, className, ...rest }: FormGridProps): react_jsx_runtime.JSX.Element;
|
|
251
|
+
|
|
252
|
+
interface FormSectionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
253
|
+
title?: string | React.ReactNode;
|
|
254
|
+
description?: string | React.ReactNode;
|
|
255
|
+
showDivider?: boolean;
|
|
256
|
+
}
|
|
257
|
+
declare function FormSection({ title, description, showDivider, className, children, ...rest }: FormSectionProps): react_jsx_runtime.JSX.Element;
|
|
258
|
+
declare function FormDivider(): react_jsx_runtime.JSX.Element;
|
|
259
|
+
|
|
260
|
+
interface Step {
|
|
261
|
+
id: string;
|
|
262
|
+
title: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
}
|
|
265
|
+
interface FormStepperProps {
|
|
266
|
+
steps: Step[];
|
|
267
|
+
currentStepId: string;
|
|
268
|
+
onStepClick?: (id: string) => void;
|
|
269
|
+
className?: string;
|
|
270
|
+
}
|
|
271
|
+
declare function FormStepper({ steps, currentStepId, onStepClick, className }: FormStepperProps): react_jsx_runtime.JSX.Element;
|
|
272
|
+
|
|
273
|
+
interface SaveBarProps {
|
|
274
|
+
formId?: string;
|
|
275
|
+
show: boolean;
|
|
276
|
+
isSubmitting?: boolean;
|
|
277
|
+
onCancel?: () => void;
|
|
278
|
+
primaryLabel?: string;
|
|
279
|
+
secondaryLabel?: string;
|
|
280
|
+
className?: string;
|
|
281
|
+
}
|
|
282
|
+
declare function SaveBar({ formId, show, isSubmitting, onCancel, primaryLabel, secondaryLabel, className, }: SaveBarProps): react_jsx_runtime.JSX.Element | null;
|
|
283
|
+
|
|
284
|
+
interface UnsavedChangesPromptProps {
|
|
285
|
+
when: boolean;
|
|
286
|
+
message?: string;
|
|
287
|
+
}
|
|
288
|
+
declare function UnsavedChangesPrompt({ when, message, }: UnsavedChangesPromptProps): null;
|
|
289
|
+
|
|
290
|
+
interface WizardStep {
|
|
291
|
+
id: string;
|
|
292
|
+
title: string;
|
|
293
|
+
description?: string;
|
|
294
|
+
}
|
|
295
|
+
interface UseWizardOptions {
|
|
296
|
+
steps: WizardStep[];
|
|
297
|
+
initialStepId?: string;
|
|
298
|
+
canNavigate?: (fromId: string, toId: string) => Promise<boolean> | boolean;
|
|
299
|
+
}
|
|
300
|
+
declare function useWizard({ steps, initialStepId, canNavigate }: UseWizardOptions): {
|
|
301
|
+
steps: WizardStep[];
|
|
302
|
+
currentStepId: string;
|
|
303
|
+
setCurrentStepId: (id: string) => Promise<boolean>;
|
|
304
|
+
next: () => Promise<boolean>;
|
|
305
|
+
prev: () => Promise<boolean>;
|
|
306
|
+
hasNext: boolean;
|
|
307
|
+
hasPrev: boolean;
|
|
308
|
+
stepIndex: number;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export { type DialogAction as D, FormActions as F, SaveBar as S, UnsavedChangesPrompt as U, type WizardStep as W, type DialogHeaderConfig as a, type DialogFooterConfig as b, type DialogProps as c, Dialog as d, type DrawerProps as e, Drawer as f, DialogForm as g, DrawerForm as h, FormGrid as i, FormDivider as j, FormSection as k, FormStepper as l, type DialogFormProps as m, type DrawerFormProps as n, type FormActionsProps as o, type FormGridProps as p, type FormSectionProps as q, type Step as r, type FormStepperProps as s, type SaveBarProps as t, useWizard as u, type UnsavedChangesPromptProps as v, type UseWizardOptions as w };
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shared action type for Dialog and Drawer footer buttons
|
|
7
|
+
*/
|
|
8
|
+
interface DialogAction {
|
|
9
|
+
label: string;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
variant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
12
|
+
size?: "sm" | "md" | "lg";
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Shared header props for Dialog and Drawer
|
|
18
|
+
*/
|
|
19
|
+
interface DialogHeaderConfig {
|
|
20
|
+
/**
|
|
21
|
+
* Title text for the header
|
|
22
|
+
*/
|
|
23
|
+
title?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Custom header content (overrides title)
|
|
26
|
+
*/
|
|
27
|
+
headerContent?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Alignment of the title
|
|
30
|
+
* @default "left"
|
|
31
|
+
*/
|
|
32
|
+
titleAlign?: "left" | "center";
|
|
33
|
+
/**
|
|
34
|
+
* Whether to hide the close button
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
hideCloseIcon?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to show a back arrow
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
hasBackArrow?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Callback when back arrow is clicked (required if hasBackArrow is true)
|
|
45
|
+
*/
|
|
46
|
+
onBack?: () => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Shared footer props for Dialog and Drawer
|
|
50
|
+
*/
|
|
51
|
+
interface DialogFooterConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Primary action button configuration
|
|
54
|
+
*/
|
|
55
|
+
primaryAction?: DialogAction;
|
|
56
|
+
/**
|
|
57
|
+
* Secondary action button configuration
|
|
58
|
+
*/
|
|
59
|
+
secondaryAction?: DialogAction;
|
|
60
|
+
/**
|
|
61
|
+
* Custom footer content above the action buttons
|
|
62
|
+
*/
|
|
63
|
+
footerContent?: ReactNode;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface DialogProps extends Omit<DialogHeaderConfig, "onClose">, DialogFooterConfig {
|
|
67
|
+
/**
|
|
68
|
+
* Whether the dialog is open (controlled mode)
|
|
69
|
+
* When using DialogTrigger, leave this undefined for automatic state management
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
isOpen?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Callback when the dialog is closed (controlled mode)
|
|
75
|
+
* When using DialogTrigger, leave this undefined for automatic state management
|
|
76
|
+
* @default undefined
|
|
77
|
+
*/
|
|
78
|
+
onClose?: () => void;
|
|
79
|
+
/**
|
|
80
|
+
* Dialog content
|
|
81
|
+
*/
|
|
82
|
+
children: React__default.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Whether to use a transparent backdrop
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
transparentOverlay?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Maximum width of the dialog
|
|
90
|
+
* @default "600px"
|
|
91
|
+
*/
|
|
92
|
+
maxWidth?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Minimum width of the dialog (desktop only, mobile uses full width)
|
|
95
|
+
* @default "400px"
|
|
96
|
+
*/
|
|
97
|
+
minWidth?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Maximum height of the dialog on desktop
|
|
100
|
+
* @default "85vh"
|
|
101
|
+
*/
|
|
102
|
+
maxHeight?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Explicit height of the dialog on desktop (overrides maxHeight if set)
|
|
105
|
+
* Content will scroll within this fixed height
|
|
106
|
+
* @default undefined
|
|
107
|
+
*/
|
|
108
|
+
height?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Maximum height of the dialog on mobile (tray version)
|
|
111
|
+
* @default "90vh"
|
|
112
|
+
*/
|
|
113
|
+
mobileMaxHeight?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Explicit height of the dialog on mobile (overrides mobileMaxHeight if set)
|
|
116
|
+
* Content will scroll within this fixed height
|
|
117
|
+
* @default undefined
|
|
118
|
+
*/
|
|
119
|
+
mobileHeight?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Whether to include padding inside the content area
|
|
122
|
+
* @default true
|
|
123
|
+
*/
|
|
124
|
+
contentPadding?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Additional CSS classes
|
|
127
|
+
*/
|
|
128
|
+
className?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Dialog
|
|
132
|
+
*
|
|
133
|
+
* Responsive modal dialog component with backdrop.
|
|
134
|
+
*
|
|
135
|
+
* **Desktop (≥768px):** Centered modal with scale and fade animation
|
|
136
|
+
* **Mobile (<768px):** Uses Tray component for native bottom sheet experience with drag handle
|
|
137
|
+
*
|
|
138
|
+
* Includes optional header with title/back button and footer with action buttons.
|
|
139
|
+
*
|
|
140
|
+
* ## Usage Patterns
|
|
141
|
+
*
|
|
142
|
+
* ### Uncontrolled with DialogTrigger (Recommended)
|
|
143
|
+
* ```tsx
|
|
144
|
+
* import { DialogTrigger, Dialog, Button } from "@texturehq/edges";
|
|
145
|
+
*
|
|
146
|
+
* <DialogTrigger>
|
|
147
|
+
* <Button>Open Dialog</Button>
|
|
148
|
+
* <Dialog title="My Dialog">
|
|
149
|
+
* <p>Dialog content</p>
|
|
150
|
+
* </Dialog>
|
|
151
|
+
* </DialogTrigger>
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* ### Controlled (Advanced)
|
|
155
|
+
* ```tsx
|
|
156
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
157
|
+
*
|
|
158
|
+
* <Dialog isOpen={isOpen} onClose={() => setIsOpen(false)} title="My Dialog">
|
|
159
|
+
* <p>Dialog content</p>
|
|
160
|
+
* </Dialog>
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
declare function Dialog({ isOpen, onClose, title, headerContent, titleAlign, hideCloseIcon, hasBackArrow, onBack, children, primaryAction, secondaryAction, footerContent, transparentOverlay, maxWidth, minWidth, maxHeight, height, mobileMaxHeight, mobileHeight, contentPadding, className, }: DialogProps): react_jsx_runtime.JSX.Element | null;
|
|
164
|
+
|
|
165
|
+
interface DrawerProps extends DialogHeaderConfig, DialogFooterConfig {
|
|
166
|
+
/**
|
|
167
|
+
* Drawer content
|
|
168
|
+
*/
|
|
169
|
+
children?: React__default.ReactNode;
|
|
170
|
+
/**
|
|
171
|
+
* Whether the drawer is open
|
|
172
|
+
*/
|
|
173
|
+
isOpen: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Side to slide in from
|
|
176
|
+
* @default "right"
|
|
177
|
+
*/
|
|
178
|
+
slideInFrom?: "left" | "right";
|
|
179
|
+
/**
|
|
180
|
+
* Whether to use a transparent backdrop
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
transparentOverlay?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Callback when the drawer is closed
|
|
186
|
+
*/
|
|
187
|
+
onClose?: () => void;
|
|
188
|
+
/**
|
|
189
|
+
* Additional CSS classes
|
|
190
|
+
*/
|
|
191
|
+
className?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Whether to include padding inside the content area
|
|
194
|
+
* @default true
|
|
195
|
+
*/
|
|
196
|
+
contentPadding?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Maximum width of the drawer
|
|
199
|
+
* @default "400px"
|
|
200
|
+
*/
|
|
201
|
+
maxWidth?: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Drawer
|
|
205
|
+
*
|
|
206
|
+
* Sliding panel that anchors to screen edges.
|
|
207
|
+
*/
|
|
208
|
+
declare function Drawer({ children, title, headerContent, titleAlign, hideCloseIcon, hasBackArrow, onBack, isOpen, slideInFrom, transparentOverlay, onClose, className, primaryAction, secondaryAction, footerContent, contentPadding, maxWidth, }: DrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
209
|
+
declare namespace Drawer {
|
|
210
|
+
var displayName: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface DialogFormProps extends Omit<DialogProps, "children" | "footerContent"> {
|
|
214
|
+
formId?: string;
|
|
215
|
+
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
216
|
+
primaryLabel?: string;
|
|
217
|
+
secondaryLabel?: string;
|
|
218
|
+
onCancel?: () => void;
|
|
219
|
+
primaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
220
|
+
secondaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
221
|
+
children?: React.ReactNode;
|
|
222
|
+
}
|
|
223
|
+
declare function DialogForm({ formId, onSubmit, primaryLabel, secondaryLabel, onCancel, primaryVariant, secondaryVariant, children, title, ...dialogProps }: DialogFormProps): react_jsx_runtime.JSX.Element;
|
|
224
|
+
|
|
225
|
+
interface DrawerFormProps extends Omit<DrawerProps, "children" | "footerContent"> {
|
|
226
|
+
formId?: string;
|
|
227
|
+
onSubmit?: React.FormEventHandler<HTMLFormElement>;
|
|
228
|
+
primaryLabel?: string;
|
|
229
|
+
secondaryLabel?: string;
|
|
230
|
+
onCancel?: () => void;
|
|
231
|
+
primaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
232
|
+
secondaryVariant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
|
|
233
|
+
children?: React.ReactNode;
|
|
234
|
+
}
|
|
235
|
+
declare function DrawerForm({ formId, onSubmit, primaryLabel, secondaryLabel, onCancel, primaryVariant, secondaryVariant, children, ...drawerProps }: DrawerFormProps): react_jsx_runtime.JSX.Element;
|
|
236
|
+
|
|
237
|
+
interface FormActionsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
238
|
+
align?: "start" | "end" | "between";
|
|
239
|
+
}
|
|
240
|
+
declare function FormActions({ align, className, ...rest }: FormActionsProps): react_jsx_runtime.JSX.Element;
|
|
241
|
+
|
|
242
|
+
interface FormGridProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
243
|
+
cols?: {
|
|
244
|
+
base?: 1 | 2 | 3 | 4;
|
|
245
|
+
md?: 1 | 2 | 3 | 4;
|
|
246
|
+
lg?: 1 | 2 | 3 | 4;
|
|
247
|
+
};
|
|
248
|
+
gap?: "sm" | "md" | "lg";
|
|
249
|
+
}
|
|
250
|
+
declare function FormGrid({ cols, gap, className, ...rest }: FormGridProps): react_jsx_runtime.JSX.Element;
|
|
251
|
+
|
|
252
|
+
interface FormSectionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
253
|
+
title?: string | React.ReactNode;
|
|
254
|
+
description?: string | React.ReactNode;
|
|
255
|
+
showDivider?: boolean;
|
|
256
|
+
}
|
|
257
|
+
declare function FormSection({ title, description, showDivider, className, children, ...rest }: FormSectionProps): react_jsx_runtime.JSX.Element;
|
|
258
|
+
declare function FormDivider(): react_jsx_runtime.JSX.Element;
|
|
259
|
+
|
|
260
|
+
interface Step {
|
|
261
|
+
id: string;
|
|
262
|
+
title: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
}
|
|
265
|
+
interface FormStepperProps {
|
|
266
|
+
steps: Step[];
|
|
267
|
+
currentStepId: string;
|
|
268
|
+
onStepClick?: (id: string) => void;
|
|
269
|
+
className?: string;
|
|
270
|
+
}
|
|
271
|
+
declare function FormStepper({ steps, currentStepId, onStepClick, className }: FormStepperProps): react_jsx_runtime.JSX.Element;
|
|
272
|
+
|
|
273
|
+
interface SaveBarProps {
|
|
274
|
+
formId?: string;
|
|
275
|
+
show: boolean;
|
|
276
|
+
isSubmitting?: boolean;
|
|
277
|
+
onCancel?: () => void;
|
|
278
|
+
primaryLabel?: string;
|
|
279
|
+
secondaryLabel?: string;
|
|
280
|
+
className?: string;
|
|
281
|
+
}
|
|
282
|
+
declare function SaveBar({ formId, show, isSubmitting, onCancel, primaryLabel, secondaryLabel, className, }: SaveBarProps): react_jsx_runtime.JSX.Element | null;
|
|
283
|
+
|
|
284
|
+
interface UnsavedChangesPromptProps {
|
|
285
|
+
when: boolean;
|
|
286
|
+
message?: string;
|
|
287
|
+
}
|
|
288
|
+
declare function UnsavedChangesPrompt({ when, message, }: UnsavedChangesPromptProps): null;
|
|
289
|
+
|
|
290
|
+
interface WizardStep {
|
|
291
|
+
id: string;
|
|
292
|
+
title: string;
|
|
293
|
+
description?: string;
|
|
294
|
+
}
|
|
295
|
+
interface UseWizardOptions {
|
|
296
|
+
steps: WizardStep[];
|
|
297
|
+
initialStepId?: string;
|
|
298
|
+
canNavigate?: (fromId: string, toId: string) => Promise<boolean> | boolean;
|
|
299
|
+
}
|
|
300
|
+
declare function useWizard({ steps, initialStepId, canNavigate }: UseWizardOptions): {
|
|
301
|
+
steps: WizardStep[];
|
|
302
|
+
currentStepId: string;
|
|
303
|
+
setCurrentStepId: (id: string) => Promise<boolean>;
|
|
304
|
+
next: () => Promise<boolean>;
|
|
305
|
+
prev: () => Promise<boolean>;
|
|
306
|
+
hasNext: boolean;
|
|
307
|
+
hasPrev: boolean;
|
|
308
|
+
stepIndex: number;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export { type DialogAction as D, FormActions as F, SaveBar as S, UnsavedChangesPrompt as U, type WizardStep as W, type DialogHeaderConfig as a, type DialogFooterConfig as b, type DialogProps as c, Dialog as d, type DrawerProps as e, Drawer as f, DialogForm as g, DrawerForm as h, FormGrid as i, FormDivider as j, FormSection as k, FormStepper as l, type DialogFormProps as m, type DrawerFormProps as n, type FormActionsProps as o, type FormGridProps as p, type FormSectionProps as q, type Step as r, type FormStepperProps as s, type SaveBarProps as t, useWizard as u, type UnsavedChangesPromptProps as v, type UseWizardOptions as w };
|