@particle-academy/react-fancy 4.13.0 → 4.13.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/index.cjs +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -6
- package/dist/index.d.ts +15 -6
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1262,21 +1262,30 @@ interface PopoverProps {
|
|
|
1262
1262
|
/** Delay in ms before closing after hover leaves. Default: 300 */
|
|
1263
1263
|
hoverCloseDelay?: number;
|
|
1264
1264
|
}
|
|
1265
|
-
|
|
1265
|
+
/**
|
|
1266
|
+
* The trigger renders a `<span>` — it extends its attributes so consumers can
|
|
1267
|
+
* forward `aria-*`, `data-*`, `id`, `title`, etc. onto the actual anchor node
|
|
1268
|
+
* (e.g. `aria-label` for an icon-only trigger). Popover-owned props (ref,
|
|
1269
|
+
* onClick, aria-expanded/haspopup) always win over forwarded ones.
|
|
1270
|
+
*/
|
|
1271
|
+
interface PopoverTriggerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1266
1272
|
children: ReactNode;
|
|
1267
|
-
className?: string;
|
|
1268
1273
|
}
|
|
1269
|
-
|
|
1274
|
+
/**
|
|
1275
|
+
* The content renders a `<div>` — it extends its attributes so consumers can
|
|
1276
|
+
* forward `aria-*`/`data-*`/`role`/`id` onto the floating panel. Consumer
|
|
1277
|
+
* `style` is merged under the Popover's positioning (left/top always win).
|
|
1278
|
+
*/
|
|
1279
|
+
interface PopoverContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
1270
1280
|
children: ReactNode;
|
|
1271
|
-
className?: string;
|
|
1272
1281
|
}
|
|
1273
1282
|
|
|
1274
|
-
declare function PopoverTrigger({ children, className }: PopoverTriggerProps): react.JSX.Element;
|
|
1283
|
+
declare function PopoverTrigger({ children, className, ...rest }: PopoverTriggerProps): react.JSX.Element;
|
|
1275
1284
|
declare namespace PopoverTrigger {
|
|
1276
1285
|
var displayName: string;
|
|
1277
1286
|
}
|
|
1278
1287
|
|
|
1279
|
-
declare function PopoverContent({ children, className }: PopoverContentProps): react.JSX.Element | null;
|
|
1288
|
+
declare function PopoverContent({ children, className, style, ...rest }: PopoverContentProps): react.JSX.Element | null;
|
|
1280
1289
|
declare namespace PopoverContent {
|
|
1281
1290
|
var displayName: string;
|
|
1282
1291
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1262,21 +1262,30 @@ interface PopoverProps {
|
|
|
1262
1262
|
/** Delay in ms before closing after hover leaves. Default: 300 */
|
|
1263
1263
|
hoverCloseDelay?: number;
|
|
1264
1264
|
}
|
|
1265
|
-
|
|
1265
|
+
/**
|
|
1266
|
+
* The trigger renders a `<span>` — it extends its attributes so consumers can
|
|
1267
|
+
* forward `aria-*`, `data-*`, `id`, `title`, etc. onto the actual anchor node
|
|
1268
|
+
* (e.g. `aria-label` for an icon-only trigger). Popover-owned props (ref,
|
|
1269
|
+
* onClick, aria-expanded/haspopup) always win over forwarded ones.
|
|
1270
|
+
*/
|
|
1271
|
+
interface PopoverTriggerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
1266
1272
|
children: ReactNode;
|
|
1267
|
-
className?: string;
|
|
1268
1273
|
}
|
|
1269
|
-
|
|
1274
|
+
/**
|
|
1275
|
+
* The content renders a `<div>` — it extends its attributes so consumers can
|
|
1276
|
+
* forward `aria-*`/`data-*`/`role`/`id` onto the floating panel. Consumer
|
|
1277
|
+
* `style` is merged under the Popover's positioning (left/top always win).
|
|
1278
|
+
*/
|
|
1279
|
+
interface PopoverContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
1270
1280
|
children: ReactNode;
|
|
1271
|
-
className?: string;
|
|
1272
1281
|
}
|
|
1273
1282
|
|
|
1274
|
-
declare function PopoverTrigger({ children, className }: PopoverTriggerProps): react.JSX.Element;
|
|
1283
|
+
declare function PopoverTrigger({ children, className, ...rest }: PopoverTriggerProps): react.JSX.Element;
|
|
1275
1284
|
declare namespace PopoverTrigger {
|
|
1276
1285
|
var displayName: string;
|
|
1277
1286
|
}
|
|
1278
1287
|
|
|
1279
|
-
declare function PopoverContent({ children, className }: PopoverContentProps): react.JSX.Element | null;
|
|
1288
|
+
declare function PopoverContent({ children, className, style, ...rest }: PopoverContentProps): react.JSX.Element | null;
|
|
1280
1289
|
declare namespace PopoverContent {
|
|
1281
1290
|
var displayName: string;
|
|
1282
1291
|
}
|
package/dist/index.js
CHANGED
|
@@ -7882,11 +7882,12 @@ function usePopover() {
|
|
|
7882
7882
|
}
|
|
7883
7883
|
return ctx;
|
|
7884
7884
|
}
|
|
7885
|
-
function PopoverTrigger({ children, className }) {
|
|
7885
|
+
function PopoverTrigger({ children, className, ...rest }) {
|
|
7886
7886
|
const { setOpen, open, anchorRef, hover, onHoverEnter, onHoverLeave } = usePopover();
|
|
7887
7887
|
return /* @__PURE__ */ jsx(
|
|
7888
7888
|
"span",
|
|
7889
7889
|
{
|
|
7890
|
+
...rest,
|
|
7890
7891
|
ref: anchorRef,
|
|
7891
7892
|
"data-react-fancy-popover-trigger": "",
|
|
7892
7893
|
className: cn("inline-flex", className),
|
|
@@ -7900,7 +7901,7 @@ function PopoverTrigger({ children, className }) {
|
|
|
7900
7901
|
);
|
|
7901
7902
|
}
|
|
7902
7903
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
7903
|
-
function PopoverContent({ children, className }) {
|
|
7904
|
+
function PopoverContent({ children, className, style, ...rest }) {
|
|
7904
7905
|
const { open, setOpen, anchorRef, floatingRef, placement, offset, hover, onHoverEnter, onHoverLeave } = usePopover();
|
|
7905
7906
|
const outsideRef = useRef(null);
|
|
7906
7907
|
const position = useFloatingPosition(anchorRef, floatingRef, {
|
|
@@ -7916,6 +7917,7 @@ function PopoverContent({ children, className }) {
|
|
|
7916
7917
|
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
7917
7918
|
"div",
|
|
7918
7919
|
{
|
|
7920
|
+
...rest,
|
|
7919
7921
|
ref: (node) => {
|
|
7920
7922
|
outsideRef.current = node;
|
|
7921
7923
|
floatingRef.current = node;
|
|
@@ -7926,7 +7928,7 @@ function PopoverContent({ children, className }) {
|
|
|
7926
7928
|
positioned ? "fancy-scale-in" : "invisible",
|
|
7927
7929
|
className
|
|
7928
7930
|
),
|
|
7929
|
-
style: { left: position.x, top: position.y },
|
|
7931
|
+
style: { ...style, left: position.x, top: position.y },
|
|
7930
7932
|
onMouseEnter: hover ? onHoverEnter : void 0,
|
|
7931
7933
|
onMouseLeave: hover ? onHoverLeave : void 0,
|
|
7932
7934
|
children
|