@ox0/ui 1.1.0 → 1.1.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from "react";
|
|
1
|
+
import { type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
export type PopoverPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
3
3
|
export interface PopoverProps {
|
|
4
4
|
/** Children: a PopoverTrigger and a PopoverContent. */
|
|
@@ -21,9 +21,11 @@ export interface PopoverContentProps {
|
|
|
21
21
|
/** Content rendered inside the popover panel. May include interactive elements. */
|
|
22
22
|
readonly children: ReactNode;
|
|
23
23
|
/** Optional additional class name. */
|
|
24
|
-
readonly className?: string;
|
|
24
|
+
readonly className?: string | undefined;
|
|
25
|
+
/** Optional inline styles. */
|
|
26
|
+
readonly style?: CSSProperties | undefined;
|
|
25
27
|
}
|
|
26
28
|
export declare function Popover({ children, placement, isOpen: controlledOpen, onOpenChange, }: PopoverProps): ReactElement;
|
|
27
29
|
export declare function PopoverTrigger({ children }: PopoverTriggerProps): ReactElement;
|
|
28
|
-
export declare function PopoverContent({ children, className }: PopoverContentProps): ReactElement | null;
|
|
30
|
+
export declare function PopoverContent({ children, className, style, }: PopoverContentProps): ReactElement | null;
|
|
29
31
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAcA,OAAO,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAA;AAId,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,GACV,OAAO,GACP,aAAa,GACb,WAAW,CAAA;AAwBf,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,mGAAmG;IACnG,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IACrC,yDAAyD;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CAChD;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvC,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;CAC3C;AAID,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,SAA0B,EAC1B,MAAM,EAAE,cAAc,EACtB,YAAY,GACb,EAAE,YAAY,GAAG,YAAY,CAqC7B;AAID,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAc9E;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAmB3C"}
|
|
@@ -19,7 +19,7 @@ export interface TooltipContentProps {
|
|
|
19
19
|
/** Tooltip content. Keep it brief — use a Popover for rich content. */
|
|
20
20
|
readonly children: ReactNode;
|
|
21
21
|
/** Optional additional class name. */
|
|
22
|
-
readonly className?: string;
|
|
22
|
+
readonly className?: string | undefined;
|
|
23
23
|
}
|
|
24
24
|
export declare function Tooltip({ children, placement, isDisabled, }: TooltipProps): ReactElement;
|
|
25
25
|
export declare function TooltipTrigger({ children }: TooltipTriggerProps): ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAQf,MAAM,OAAO,CAAA;AAMd,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,GACV,OAAO,GACP,aAAa,GACb,WAAW,CAAA;AAwBf,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAQf,MAAM,OAAO,CAAA;AAMd,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,GACV,OAAO,GACP,aAAa,GACb,WAAW,CAAA;AAwBf,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxC;AAID,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,SAAiB,EACjB,UAAkB,GACnB,EAAE,YAAY,GAAG,YAAY,CAyF7B;AAID,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAgB9E;AAID,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAiBhG"}
|
package/dist/index.js
CHANGED
|
@@ -2891,14 +2891,14 @@ function Tooltip({ children, placement = "top", isDisabled = false }) {
|
|
|
2891
2891
|
function TooltipTrigger({ children }) {
|
|
2892
2892
|
const { isDisabled, referenceRef, getReferenceProps } = useTooltipContext();
|
|
2893
2893
|
if (isDisabled) return children;
|
|
2894
|
-
const childRef = children.props
|
|
2894
|
+
const { ref: childRef, ...childProps } = children.props;
|
|
2895
2895
|
const composedRef = (0, __WEBPACK_EXTERNAL_MODULE__floating_ui_react_3ddd630a__.useMergeRefs)([
|
|
2896
2896
|
referenceRef,
|
|
2897
|
-
childRef
|
|
2897
|
+
childRef ?? null
|
|
2898
2898
|
]);
|
|
2899
2899
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.cloneElement)(children, {
|
|
2900
|
-
|
|
2901
|
-
|
|
2900
|
+
...getReferenceProps(childProps),
|
|
2901
|
+
ref: composedRef
|
|
2902
2902
|
});
|
|
2903
2903
|
}
|
|
2904
2904
|
function TooltipContent({ children, className }) {
|
|
@@ -3598,17 +3598,17 @@ function Popover({ children, placement = "bottom-start", isOpen: controlledOpen,
|
|
|
3598
3598
|
}
|
|
3599
3599
|
function PopoverTrigger({ children }) {
|
|
3600
3600
|
const { referenceRef, getReferenceProps } = usePopoverContext();
|
|
3601
|
-
const childRef = children.props
|
|
3601
|
+
const { ref: childRef, ...childProps } = children.props;
|
|
3602
3602
|
const composedRef = (0, __WEBPACK_EXTERNAL_MODULE__floating_ui_react_3ddd630a__.useMergeRefs)([
|
|
3603
3603
|
referenceRef,
|
|
3604
|
-
childRef
|
|
3604
|
+
childRef ?? null
|
|
3605
3605
|
]);
|
|
3606
3606
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.cloneElement)(children, {
|
|
3607
|
-
|
|
3608
|
-
|
|
3607
|
+
...getReferenceProps(childProps),
|
|
3608
|
+
ref: composedRef
|
|
3609
3609
|
});
|
|
3610
3610
|
}
|
|
3611
|
-
function PopoverContent({ children, className }) {
|
|
3611
|
+
function PopoverContent({ children, className, style }) {
|
|
3612
3612
|
const { open, context, floatingRef, floatingStyles, getFloatingProps } = usePopoverContext();
|
|
3613
3613
|
if (!open) return null;
|
|
3614
3614
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__floating_ui_react_3ddd630a__.FloatingPortal, {
|
|
@@ -3617,7 +3617,10 @@ function PopoverContent({ children, className }) {
|
|
|
3617
3617
|
modal: false,
|
|
3618
3618
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
|
|
3619
3619
|
ref: floatingRef,
|
|
3620
|
-
style:
|
|
3620
|
+
style: {
|
|
3621
|
+
...floatingStyles,
|
|
3622
|
+
...style
|
|
3623
|
+
},
|
|
3621
3624
|
className: null != className ? `${components_popover_module.popover} ${className}` : components_popover_module.popover,
|
|
3622
3625
|
...getFloatingProps(),
|
|
3623
3626
|
children: children
|