@pittorica/popover-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/Popover.d.ts CHANGED
@@ -1,28 +1,29 @@
1
- import { type ReactNode, type Ref } from 'react';
1
+ import { type ElementType, type ReactNode } from 'react';
2
2
  import { type Placement } from '@floating-ui/react';
3
3
  import { type BoxProps } from '@pittorica/box-react';
4
- export interface PopoverProps {
4
+ export type PopoverProps = {
5
5
  children: ReactNode;
6
6
  /** @default 'bottom' */
7
7
  placement?: Placement;
8
- }
8
+ };
9
9
  export declare const Popover: {
10
10
  ({ children, placement }: PopoverProps): import("react/jsx-runtime").JSX.Element;
11
11
  displayName: string;
12
12
  };
13
- export interface PopoverTriggerProps {
14
- children: ReactNode;
15
- ref?: Ref<HTMLElement>;
16
- }
13
+ /**
14
+ * Fix TS2314: Use 'type' and generic E for polymorphic BoxProps.
15
+ */
16
+ export type PopoverTriggerProps<E extends ElementType = 'span'> = BoxProps<E>;
17
17
  export declare const PopoverTrigger: {
18
- ({ children, ref: externalRef, }: PopoverTriggerProps): import("react/jsx-runtime").JSX.Element;
18
+ <E extends ElementType = "span">({ children, as, ref: externalRef, ...props }: PopoverTriggerProps<E>): import("react/jsx-runtime").JSX.Element;
19
19
  displayName: string;
20
20
  };
21
- export interface PopoverContentProps extends BoxProps {
22
- ref?: Ref<HTMLElement>;
23
- }
21
+ /**
22
+ * Fix TS2314: Use 'type' and generic E for polymorphic BoxProps.
23
+ */
24
+ export type PopoverContentProps<E extends ElementType = 'div'> = BoxProps<E>;
24
25
  export declare const PopoverContent: {
25
- ({ children, className, ref: externalRef, ...props }: PopoverContentProps): import("react/jsx-runtime").JSX.Element | null;
26
+ <E extends ElementType = "div">({ children, className, as, ref: externalRef, ...props }: PopoverContentProps<E>): import("react/jsx-runtime").JSX.Element | null;
26
27
  displayName: string;
27
28
  };
28
29
  //# sourceMappingURL=Popover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,GAAG,EAKT,MAAM,OAAO,CAAC;AAIf,OAAO,EAML,KAAK,SAAS,EAOf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwB1D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,wBAAwB;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,OAAO;8BAAwC,YAAY;;CAkCvE,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,cAAc;sCAGxB,mBAAmB;;CAuBrB,CAAC;AAEF,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,cAAc;0DAKxB,mBAAmB;;CA6BrB,CAAC"}
1
+ {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAIf,OAAO,EAML,KAAK,SAAS,EAOf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AA4B1D,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,wBAAwB;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,OAAO;8BAAwC,YAAY;;CAkCvE,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,mBAA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