@underverse-ui/underverse 1.0.93 → 1.0.94
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/api-reference.json +1 -1
- package/dist/index.cjs +50 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +50 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -476,6 +476,8 @@ interface TooltipProps {
|
|
|
476
476
|
className?: string;
|
|
477
477
|
disabled?: boolean;
|
|
478
478
|
variant?: "default" | "info" | "warning" | "error" | "success";
|
|
479
|
+
/** When true, augment the child directly instead of adding a wrapper. Default: true */
|
|
480
|
+
asChild?: boolean;
|
|
479
481
|
}
|
|
480
482
|
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
481
483
|
|
package/dist/index.d.ts
CHANGED
|
@@ -476,6 +476,8 @@ interface TooltipProps {
|
|
|
476
476
|
className?: string;
|
|
477
477
|
disabled?: boolean;
|
|
478
478
|
variant?: "default" | "info" | "warning" | "error" | "success";
|
|
479
|
+
/** When true, augment the child directly instead of adding a wrapper. Default: true */
|
|
480
|
+
asChild?: boolean;
|
|
479
481
|
}
|
|
480
482
|
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
481
483
|
|
package/dist/index.js
CHANGED
|
@@ -481,13 +481,13 @@ var Card = React2.forwardRef(
|
|
|
481
481
|
"h3",
|
|
482
482
|
{
|
|
483
483
|
className: cn(
|
|
484
|
-
"min-w-0 text-base md:text-lg font-semibold leading-tight tracking-tight
|
|
484
|
+
"min-w-0 text-base md:text-lg font-semibold leading-tight tracking-tight wrap-anywhere transition-colors duration-200 max-md:text-sm",
|
|
485
485
|
hoverable && "group-hover:text-primary"
|
|
486
486
|
),
|
|
487
487
|
children: title
|
|
488
488
|
}
|
|
489
489
|
),
|
|
490
|
-
description && /* @__PURE__ */ jsx3("p", { className: "min-w-0 text-sm md:text-base text-muted-foreground leading-relaxed
|
|
490
|
+
description && /* @__PURE__ */ jsx3("p", { className: "min-w-0 text-sm md:text-base text-muted-foreground leading-relaxed wrap-anywhere", children: description })
|
|
491
491
|
] }),
|
|
492
492
|
children && /* @__PURE__ */ jsx3("div", { className: cn("relative", defaultPaddingX, defaultPaddingY, contentClassName), children }),
|
|
493
493
|
footer && /* @__PURE__ */ jsx3(
|
|
@@ -2755,6 +2755,25 @@ var variantStyles2 = {
|
|
|
2755
2755
|
success: "bg-success text-success-foreground border-success/20"
|
|
2756
2756
|
};
|
|
2757
2757
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2758
|
+
function composeEventHandlers(theirHandler, ourHandler) {
|
|
2759
|
+
return (event) => {
|
|
2760
|
+
theirHandler?.(event);
|
|
2761
|
+
ourHandler(event);
|
|
2762
|
+
};
|
|
2763
|
+
}
|
|
2764
|
+
function setRefValue(ref, value) {
|
|
2765
|
+
if (!ref) return;
|
|
2766
|
+
if (typeof ref === "function") {
|
|
2767
|
+
ref(value);
|
|
2768
|
+
return;
|
|
2769
|
+
}
|
|
2770
|
+
ref.current = value;
|
|
2771
|
+
}
|
|
2772
|
+
function mergeRefs(...refs) {
|
|
2773
|
+
return (value) => {
|
|
2774
|
+
refs.forEach((ref) => setRefValue(ref, value));
|
|
2775
|
+
};
|
|
2776
|
+
}
|
|
2758
2777
|
function getTransformOrigin(side) {
|
|
2759
2778
|
switch (side) {
|
|
2760
2779
|
case "top":
|
|
@@ -2806,7 +2825,8 @@ var Tooltip = ({
|
|
|
2806
2825
|
delay = { open: 200, close: 300 },
|
|
2807
2826
|
className,
|
|
2808
2827
|
disabled = false,
|
|
2809
|
-
variant = "default"
|
|
2828
|
+
variant = "default",
|
|
2829
|
+
asChild = true
|
|
2810
2830
|
}) => {
|
|
2811
2831
|
const [isOpen, setIsOpen] = React9.useState(false);
|
|
2812
2832
|
const isMounted = useHydrated();
|
|
@@ -2925,37 +2945,32 @@ var Tooltip = ({
|
|
|
2925
2945
|
if (disabled || !content) {
|
|
2926
2946
|
return children;
|
|
2927
2947
|
}
|
|
2948
|
+
const childProps = children.props;
|
|
2949
|
+
const childRef = children.ref ?? childProps.ref;
|
|
2950
|
+
const triggerProps = {
|
|
2951
|
+
ref: mergeRefs(childRef, (node) => {
|
|
2952
|
+
triggerRef.current = node;
|
|
2953
|
+
}),
|
|
2954
|
+
"data-underverse-tooltip-trigger": triggerSelector,
|
|
2955
|
+
onMouseEnter: composeEventHandlers(childProps.onMouseEnter, (e) => {
|
|
2956
|
+
triggerRef.current = e.currentTarget;
|
|
2957
|
+
handleMouseEnter();
|
|
2958
|
+
}),
|
|
2959
|
+
onMouseLeave: composeEventHandlers(childProps.onMouseLeave, (e) => {
|
|
2960
|
+
triggerRef.current = e.currentTarget;
|
|
2961
|
+
handleMouseLeave();
|
|
2962
|
+
}),
|
|
2963
|
+
onFocus: composeEventHandlers(childProps.onFocus, (e) => {
|
|
2964
|
+
triggerRef.current = e.currentTarget;
|
|
2965
|
+
handleFocus();
|
|
2966
|
+
}),
|
|
2967
|
+
onBlur: composeEventHandlers(childProps.onBlur, () => {
|
|
2968
|
+
handleBlur();
|
|
2969
|
+
})
|
|
2970
|
+
};
|
|
2971
|
+
const trigger = asChild ? React9.cloneElement(children, triggerProps) : /* @__PURE__ */ jsx10("span", { ...triggerProps, children });
|
|
2928
2972
|
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
2929
|
-
|
|
2930
|
-
const TriggerComponent = children.type;
|
|
2931
|
-
const triggerProps = children.props;
|
|
2932
|
-
return /* @__PURE__ */ jsx10(
|
|
2933
|
-
TriggerComponent,
|
|
2934
|
-
{
|
|
2935
|
-
...triggerProps,
|
|
2936
|
-
"data-underverse-tooltip-trigger": triggerSelector,
|
|
2937
|
-
onMouseEnter: (e) => {
|
|
2938
|
-
triggerRef.current = e.currentTarget;
|
|
2939
|
-
handleMouseEnter();
|
|
2940
|
-
if (typeof triggerProps.onMouseEnter === "function") triggerProps.onMouseEnter(e);
|
|
2941
|
-
},
|
|
2942
|
-
onMouseLeave: (e) => {
|
|
2943
|
-
triggerRef.current = e.currentTarget;
|
|
2944
|
-
handleMouseLeave();
|
|
2945
|
-
if (typeof triggerProps.onMouseLeave === "function") triggerProps.onMouseLeave(e);
|
|
2946
|
-
},
|
|
2947
|
-
onFocus: (e) => {
|
|
2948
|
-
triggerRef.current = e.currentTarget;
|
|
2949
|
-
handleFocus();
|
|
2950
|
-
if (typeof triggerProps.onFocus === "function") triggerProps.onFocus(e);
|
|
2951
|
-
},
|
|
2952
|
-
onBlur: (e) => {
|
|
2953
|
-
handleBlur();
|
|
2954
|
-
if (typeof triggerProps.onBlur === "function") triggerProps.onBlur(e);
|
|
2955
|
-
}
|
|
2956
|
-
}
|
|
2957
|
-
);
|
|
2958
|
-
})(),
|
|
2973
|
+
trigger,
|
|
2959
2974
|
isMounted && isOpen && createPortal(
|
|
2960
2975
|
/* @__PURE__ */ jsx10(
|
|
2961
2976
|
"div",
|
|
@@ -17052,7 +17067,7 @@ function CategoryTreeSelect(props) {
|
|
|
17052
17067
|
// View-only mode: just display the name with folder icon
|
|
17053
17068
|
/* @__PURE__ */ jsxs39("div", { className: cn("flex min-w-0 items-center", TREE_NODE_GAP_CLASS), children: [
|
|
17054
17069
|
category.icon ? /* @__PURE__ */ jsx49("div", { className: "h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground/60", children: category.icon }) : hasChildren ? /* @__PURE__ */ jsx49(FolderTree, { className: "h-4 w-4 shrink-0 text-muted-foreground/60" }) : /* @__PURE__ */ jsx49("div", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-muted-foreground/40" }),
|
|
17055
|
-
/* @__PURE__ */ jsx49("span", { className: "min-w-0 text-sm font-medium leading-snug
|
|
17070
|
+
/* @__PURE__ */ jsx49("span", { className: "min-w-0 text-sm font-medium leading-snug wrap-anywhere", children: category.name })
|
|
17056
17071
|
] })
|
|
17057
17072
|
) : (
|
|
17058
17073
|
// Single/Multi select mode: icon + text + badge
|
|
@@ -17062,7 +17077,7 @@ function CategoryTreeSelect(props) {
|
|
|
17062
17077
|
"span",
|
|
17063
17078
|
{
|
|
17064
17079
|
className: cn(
|
|
17065
|
-
"min-w-0 flex-1 text-sm leading-snug
|
|
17080
|
+
"min-w-0 flex-1 text-sm leading-snug wrap-anywhere transition-all duration-200",
|
|
17066
17081
|
isSelected ? "font-semibold text-primary" : "text-foreground/80",
|
|
17067
17082
|
!isSelectable && "text-foreground"
|
|
17068
17083
|
),
|