@pittorica/dialog-react 0.23.2 → 0.25.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/Dialog.d.ts CHANGED
@@ -1,34 +1,48 @@
1
- import React from 'react';
2
- import { Box } from '@pittorica/box-react';
1
+ import { type ComponentProps, type ElementType } from 'react';
2
+ import { type BoxProps } from '@pittorica/box-react';
3
3
  import { Heading } from '@pittorica/heading-react';
4
- export interface DialogProps {
4
+ /**
5
+ * Appearance types for the Dialog.
6
+ */
7
+ export type DialogAppearance = 'light' | 'dark' | 'inherit';
8
+ /**
9
+ * Polymorphic props for the Dialog component.
10
+ */
11
+ export type DialogProps<E extends ElementType = 'div'> = BoxProps<E> & {
5
12
  open: boolean;
6
13
  onClose: () => void;
7
- children: React.ReactNode;
8
- className?: string;
9
- appearance?: 'light' | 'dark' | 'inherit';
14
+ appearance?: DialogAppearance;
10
15
  /** @default true */
11
16
  closeOnOverlayClick?: boolean;
12
17
  /** @default true */
13
18
  closeOnEsc?: boolean;
14
- }
19
+ };
15
20
  /**
16
- * Dialog component.
17
- * Provides a modal window with focus trap and scroll lock.
21
+ * Dialog component providing a modal window with focus trap and scroll lock.
18
22
  */
19
- export declare const Dialog: ({ open, onClose, children, className, appearance, closeOnOverlayClick, closeOnEsc, }: DialogProps) => React.ReactNode;
23
+ export declare const Dialog: {
24
+ <E extends ElementType = "div">({ open, onClose, children, className, appearance, closeOnOverlayClick, closeOnEsc, as, ...props }: DialogProps<E>): import("react/jsx-runtime").JSX.Element | null;
25
+ displayName: string;
26
+ };
20
27
  /**
21
28
  * Accessible title for the Dialog.
22
29
  */
23
- export declare const DialogTitle: ({ children, id: _id, ...props }: React.ComponentProps<typeof Heading>) => import("react/jsx-runtime").JSX.Element;
30
+ export declare const DialogTitle: {
31
+ ({ children, id: _id, ...props }: ComponentProps<typeof Heading>): import("react/jsx-runtime").JSX.Element;
32
+ displayName: string;
33
+ };
24
34
  /**
25
35
  * Accessible description for the Dialog.
26
36
  */
27
- export declare const DialogDescription: ({ children, id: _id, ...props }: React.ComponentProps<typeof Box>) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const DialogDescription: {
38
+ <E extends ElementType = "div">({ children, id: _id, ...props }: BoxProps<E>): import("react/jsx-runtime").JSX.Element;
39
+ displayName: string;
40
+ };
28
41
  /**
29
42
  * Container for Dialog actions (usually buttons).
30
43
  */
31
- export declare const DialogActions: ({ children }: {
32
- children: React.ReactNode;
33
- }) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const DialogActions: {
45
+ <E extends ElementType = "div">({ children, ...props }: BoxProps<E>): import("react/jsx-runtime").JSX.Element;
46
+ displayName: string;
47
+ };
34
48
  //# sourceMappingURL=Dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../src/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAQN,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,oBAAoB;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAqBD;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,sFAQpB,WAAW,KAAG,KAAK,CAAC,SA+EtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,iCAIzB,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,4CAOt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