@texturehq/edges 1.26.4 → 1.26.6

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.
@@ -7,11 +7,35 @@ import React__default, { ReactNode } from 'react';
7
7
  */
8
8
  interface DialogAction {
9
9
  label: string;
10
- onPress: () => void;
10
+ /**
11
+ * Click handler. Not required if formId is provided.
12
+ */
13
+ onPress?: () => void;
11
14
  variant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
12
15
  size?: "sm" | "md" | "lg";
13
16
  isLoading?: boolean;
14
17
  isDisabled?: boolean;
18
+ /**
19
+ * Form ID to submit when this action is triggered.
20
+ * When provided, the button becomes a submit button for the specified form.
21
+ * No `onPress` handler is needed - the form's onSubmit will be called.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <Dialog
26
+ * primaryAction={{
27
+ * label: "Save",
28
+ * formId: "my-form",
29
+ * isLoading: loading,
30
+ * }}
31
+ * >
32
+ * <FormProvider id="my-form" onSubmit={handleSubmit}>
33
+ * ...
34
+ * </FormProvider>
35
+ * </Dialog>
36
+ * ```
37
+ */
38
+ formId?: string;
15
39
  }
16
40
  /**
17
41
  * Shared header props for Dialog and Drawer
@@ -7,11 +7,35 @@ import React__default, { ReactNode } from 'react';
7
7
  */
8
8
  interface DialogAction {
9
9
  label: string;
10
- onPress: () => void;
10
+ /**
11
+ * Click handler. Not required if formId is provided.
12
+ */
13
+ onPress?: () => void;
11
14
  variant?: "default" | "primary" | "secondary" | "destructive" | "icon" | "link" | "unstyled" | "ghost";
12
15
  size?: "sm" | "md" | "lg";
13
16
  isLoading?: boolean;
14
17
  isDisabled?: boolean;
18
+ /**
19
+ * Form ID to submit when this action is triggered.
20
+ * When provided, the button becomes a submit button for the specified form.
21
+ * No `onPress` handler is needed - the form's onSubmit will be called.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * <Dialog
26
+ * primaryAction={{
27
+ * label: "Save",
28
+ * formId: "my-form",
29
+ * isLoading: loading,
30
+ * }}
31
+ * >
32
+ * <FormProvider id="my-form" onSubmit={handleSubmit}>
33
+ * ...
34
+ * </FormProvider>
35
+ * </Dialog>
36
+ * ```
37
+ */
38
+ formId?: string;
15
39
  }
16
40
  /**
17
41
  * Shared header props for Dialog and Drawer