@trackunit/react-components 0.4.24 → 0.4.27
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/index.cjs.js +4 -4
- package/index.esm.js +4 -4
- package/package.json +1 -1
- package/src/components/Popover/Popover.d.ts +5 -2
package/index.cjs.js
CHANGED
|
@@ -3645,8 +3645,8 @@ const usePopover = ({ initialOpen = false, placement = "bottom", isModal, isOpen
|
|
|
3645
3645
|
react.size({
|
|
3646
3646
|
apply({ availableWidth, availableHeight, elements }) {
|
|
3647
3647
|
Object.assign(elements.floating.style, {
|
|
3648
|
-
maxWidth: `${availableWidth - PADDING}px`,
|
|
3649
|
-
maxHeight: `${availableHeight - PADDING}px`,
|
|
3648
|
+
maxWidth: `${availableWidth - PADDING * 2}px`,
|
|
3649
|
+
maxHeight: `${availableHeight - PADDING * 2}px`,
|
|
3650
3650
|
});
|
|
3651
3651
|
},
|
|
3652
3652
|
}),
|
|
@@ -3720,7 +3720,7 @@ const usePopoverContext = () => {
|
|
|
3720
3720
|
*/
|
|
3721
3721
|
const Popover = ({ children, isModal = false, ...restOptions }) => {
|
|
3722
3722
|
const popover = usePopover({ isModal, ...restOptions });
|
|
3723
|
-
return jsxRuntime.jsx(PopoverContext.Provider, { value: popover, children: children });
|
|
3723
|
+
return (jsxRuntime.jsx(PopoverContext.Provider, { value: popover, children: typeof children === "function" ? children({ isOpen: popover.isOpen, placement: popover.placement }) : children }));
|
|
3724
3724
|
};
|
|
3725
3725
|
|
|
3726
3726
|
const cvaPopoverContainer = cssClassVarianceUtilities.cvaMerge(["component-popover-border", "z-popover", "animate-fade-in-fast"]);
|
|
@@ -3775,7 +3775,7 @@ const PopoverTrigger = React.forwardRef(function PopoverTrigger({ children, rend
|
|
|
3775
3775
|
}
|
|
3776
3776
|
});
|
|
3777
3777
|
|
|
3778
|
-
const cvaTooltipFlexContainer = cssClassVarianceUtilities.cvaMerge(["
|
|
3778
|
+
const cvaTooltipFlexContainer = cssClassVarianceUtilities.cvaMerge(["flex"]);
|
|
3779
3779
|
const cvaTooltipIcon = cssClassVarianceUtilities.cvaMerge(["flex", "h-max", "w-fit", "text-slate-300", "transition", "hover:cursor-pointer", "hover:text-slate-400"], {
|
|
3780
3780
|
variants: {
|
|
3781
3781
|
color: {
|
package/index.esm.js
CHANGED
|
@@ -3625,8 +3625,8 @@ const usePopover = ({ initialOpen = false, placement = "bottom", isModal, isOpen
|
|
|
3625
3625
|
size({
|
|
3626
3626
|
apply({ availableWidth, availableHeight, elements }) {
|
|
3627
3627
|
Object.assign(elements.floating.style, {
|
|
3628
|
-
maxWidth: `${availableWidth - PADDING}px`,
|
|
3629
|
-
maxHeight: `${availableHeight - PADDING}px`,
|
|
3628
|
+
maxWidth: `${availableWidth - PADDING * 2}px`,
|
|
3629
|
+
maxHeight: `${availableHeight - PADDING * 2}px`,
|
|
3630
3630
|
});
|
|
3631
3631
|
},
|
|
3632
3632
|
}),
|
|
@@ -3700,7 +3700,7 @@ const usePopoverContext = () => {
|
|
|
3700
3700
|
*/
|
|
3701
3701
|
const Popover = ({ children, isModal = false, ...restOptions }) => {
|
|
3702
3702
|
const popover = usePopover({ isModal, ...restOptions });
|
|
3703
|
-
return jsx(PopoverContext.Provider, { value: popover, children: children });
|
|
3703
|
+
return (jsx(PopoverContext.Provider, { value: popover, children: typeof children === "function" ? children({ isOpen: popover.isOpen, placement: popover.placement }) : children }));
|
|
3704
3704
|
};
|
|
3705
3705
|
|
|
3706
3706
|
const cvaPopoverContainer = cvaMerge(["component-popover-border", "z-popover", "animate-fade-in-fast"]);
|
|
@@ -3755,7 +3755,7 @@ const PopoverTrigger = forwardRef(function PopoverTrigger({ children, renderButt
|
|
|
3755
3755
|
}
|
|
3756
3756
|
});
|
|
3757
3757
|
|
|
3758
|
-
const cvaTooltipFlexContainer = cvaMerge(["
|
|
3758
|
+
const cvaTooltipFlexContainer = cvaMerge(["flex"]);
|
|
3759
3759
|
const cvaTooltipIcon = cvaMerge(["flex", "h-max", "w-fit", "text-slate-300", "transition", "hover:cursor-pointer", "hover:text-slate-400"], {
|
|
3760
3760
|
variants: {
|
|
3761
3761
|
color: {
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PopoverProps, UsePopoverType } from "./PopoverTypes";
|
|
1
|
+
import { PopoverPlacement, PopoverProps, UsePopoverType } from "./PopoverTypes";
|
|
2
2
|
export type ContextType = UsePopoverType | null;
|
|
3
3
|
/**
|
|
4
4
|
* A hook to get the popover context.
|
|
@@ -21,5 +21,8 @@ export declare const usePopoverContext: () => UsePopoverType;
|
|
|
21
21
|
* @returns {JSX.Element} A Popover Context Provider containing the children
|
|
22
22
|
*/
|
|
23
23
|
export declare const Popover: ({ children, isModal, ...restOptions }: {
|
|
24
|
-
children: React.ReactNode
|
|
24
|
+
children: React.ReactNode | ((modalState: {
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
placement: PopoverPlacement;
|
|
27
|
+
}) => React.ReactNode);
|
|
25
28
|
} & PopoverProps) => import("react/jsx-runtime").JSX.Element;
|