@motor-hero/ui-kit 0.25.1 → 0.26.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.
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import type { ReactNode } from "react";
3
+ declare const sizeClasses: {
4
+ readonly sm: "sm:max-w-sm";
5
+ readonly md: "sm:max-w-md";
6
+ readonly lg: "sm:max-w-lg";
7
+ readonly xl: "sm:max-w-xl";
8
+ readonly "2xl": "sm:max-w-2xl";
9
+ };
10
+ export type BaseDialogSize = keyof typeof sizeClasses;
11
+ export interface BaseDialogProps {
12
+ open: boolean;
13
+ onOpenChange: (open: boolean) => void;
14
+ title: string;
15
+ description?: ReactNode;
16
+ children: ReactNode;
17
+ footer?: ReactNode;
18
+ size?: BaseDialogSize;
19
+ className?: string;
20
+ /**
21
+ * Advanced: wraps the dialog's inner content (header + body + footer) inside
22
+ * Content. Used by FormDialog to inject a <form>. Defaults to identity.
23
+ */
24
+ contentWrapper?: (content: ReactNode) => ReactNode;
25
+ }
26
+ /**
27
+ * Standardized, responsive dialog shell:
28
+ * - mobile: bottom sheet (full width, up to 92vh tall)
29
+ * - desktop: centered dialog (up to 90vh tall)
30
+ * Header and footer stay fixed; only the body scrolls.
31
+ *
32
+ * Also fixes the known Radix bug where `body { pointer-events: none }`
33
+ * can persist after closing a dialog that contained a Select/Popover,
34
+ * which would otherwise make the rest of the page unclickable.
35
+ */
36
+ export declare function BaseDialog({ open, onOpenChange, title, description, children, footer, size, className, contentWrapper, }: BaseDialogProps): React.JSX.Element;
37
+ export {};
38
+ //# sourceMappingURL=base-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-dialog.d.ts","sourceRoot":"","sources":["../../src/components/base-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,QAAA,MAAM,WAAW;;;;;;CAMP,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,WAAW,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,SAAS,CAAA;CACnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,IAAW,EACX,SAAS,EACT,cAAqC,GACtC,EAAE,eAAe,qBA8DjB"}
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { ReactNode } from "react";
3
+ import { type BaseDialogProps, type BaseDialogSize } from "./base-dialog";
3
4
  interface FormDialogLayoutProps {
4
5
  title: string;
5
6
  children: ReactNode;
@@ -11,36 +12,17 @@ interface FormDialogLayoutProps {
11
12
  isDisabled?: boolean;
12
13
  }
13
14
  export declare function FormDialogLayout({ title, children, onSubmit, submitLabel, cancelLabel, onCancel, isSubmitting, isDisabled, }: FormDialogLayoutProps): React.JSX.Element;
14
- declare const sizeClasses: {
15
- readonly sm: "sm:max-w-sm";
16
- readonly md: "sm:max-w-md";
17
- readonly lg: "sm:max-w-lg";
18
- readonly xl: "sm:max-w-xl";
19
- readonly "2xl": "sm:max-w-2xl";
20
- };
21
- export type FormDialogSize = keyof typeof sizeClasses;
22
- interface FormDialogProps {
23
- open: boolean;
24
- onOpenChange: (open: boolean) => void;
25
- title: string;
26
- description?: ReactNode;
27
- children: ReactNode;
28
- footer?: ReactNode;
15
+ export type FormDialogSize = BaseDialogSize;
16
+ export interface FormDialogProps extends Omit<BaseDialogProps, "contentWrapper"> {
29
17
  /** When provided, the dialog renders a <form> wrapping body + footer. */
30
18
  onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
31
- size?: FormDialogSize;
32
- className?: string;
33
19
  }
34
20
  /**
35
- * Standardized, responsive modal:
36
- * - mobile: bottom sheet (full width, up to 92vh tall)
37
- * - desktop: centered dialog (up to 90vh tall)
38
- * Header and footer stay fixed; only the body scrolls.
39
- *
40
- * Also fixes the known Radix bug where `body { pointer-events: none }`
41
- * can persist after closing a dialog that contained a Select/Popover,
42
- * which would otherwise make the rest of the page unclickable.
21
+ * Form-oriented specialization of {@link BaseDialog}: when `onSubmit` is
22
+ * provided, the body and footer are wrapped in a <form> (so footer submit
23
+ * buttons and Enter trigger submission). Without `onSubmit` it behaves like a
24
+ * plain BaseDialog.
43
25
  */
44
- export declare function FormDialog({ open, onOpenChange, title, description, children, footer, onSubmit, size, className, }: FormDialogProps): React.JSX.Element;
26
+ export declare function FormDialog({ onSubmit, ...rest }: FormDialogProps): React.JSX.Element;
45
27
  export {};
46
28
  //# sourceMappingURL=form-dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-dialog.d.ts","sourceRoot":"","sources":["../../src/components/form-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAA;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM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