@underverse-ui/underverse 1.0.93 → 1.0.95
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 +114 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +124 -97
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -666,13 +666,13 @@ var Card = import_react2.default.forwardRef(
|
|
|
666
666
|
"h3",
|
|
667
667
|
{
|
|
668
668
|
className: cn(
|
|
669
|
-
"min-w-0 text-base md:text-lg font-semibold leading-tight tracking-tight
|
|
669
|
+
"min-w-0 text-base md:text-lg font-semibold leading-tight tracking-tight wrap-anywhere transition-colors duration-200 max-md:text-sm",
|
|
670
670
|
hoverable && "group-hover:text-primary"
|
|
671
671
|
),
|
|
672
672
|
children: title
|
|
673
673
|
}
|
|
674
674
|
),
|
|
675
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "min-w-0 text-sm md:text-base text-muted-foreground leading-relaxed
|
|
675
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "min-w-0 text-sm md:text-base text-muted-foreground leading-relaxed wrap-anywhere", children: description })
|
|
676
676
|
] }),
|
|
677
677
|
children && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn("relative", defaultPaddingX, defaultPaddingY, contentClassName), children }),
|
|
678
678
|
footer && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -2930,6 +2930,26 @@ function useHydrated() {
|
|
|
2930
2930
|
return (0, import_react5.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
|
|
2931
2931
|
}
|
|
2932
2932
|
|
|
2933
|
+
// src/utils/react-compose.ts
|
|
2934
|
+
function chainEventHandlers(...handlers) {
|
|
2935
|
+
return (event) => {
|
|
2936
|
+
handlers.forEach((handler) => handler?.(event));
|
|
2937
|
+
};
|
|
2938
|
+
}
|
|
2939
|
+
function setRefValue(ref, value) {
|
|
2940
|
+
if (!ref) return;
|
|
2941
|
+
if (typeof ref === "function") {
|
|
2942
|
+
ref(value);
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
ref.current = value;
|
|
2946
|
+
}
|
|
2947
|
+
function mergeRefs(...refs) {
|
|
2948
|
+
return (value) => {
|
|
2949
|
+
refs.forEach((ref) => setRefValue(ref, value));
|
|
2950
|
+
};
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2933
2953
|
// src/components/Tooltip.tsx
|
|
2934
2954
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2935
2955
|
var variantStyles2 = {
|
|
@@ -2984,15 +3004,17 @@ function computeTooltipPosition(args) {
|
|
|
2984
3004
|
top = clamp(top, padding, viewport.height - contentSize.height - padding);
|
|
2985
3005
|
return { top, left, side };
|
|
2986
3006
|
}
|
|
2987
|
-
var Tooltip = ({
|
|
3007
|
+
var Tooltip = React9.forwardRef(({
|
|
2988
3008
|
children,
|
|
2989
3009
|
content,
|
|
2990
3010
|
placement = "top",
|
|
2991
3011
|
delay = { open: 200, close: 300 },
|
|
2992
3012
|
className,
|
|
2993
3013
|
disabled = false,
|
|
2994
|
-
variant = "default"
|
|
2995
|
-
|
|
3014
|
+
variant = "default",
|
|
3015
|
+
asChild = true,
|
|
3016
|
+
...triggerPassthroughProps
|
|
3017
|
+
}, forwardedRef) => {
|
|
2996
3018
|
const [isOpen, setIsOpen] = React9.useState(false);
|
|
2997
3019
|
const isMounted = useHydrated();
|
|
2998
3020
|
const triggerRef = React9.useRef(null);
|
|
@@ -3107,40 +3129,57 @@ var Tooltip = ({
|
|
|
3107
3129
|
if (panelRef.current) ro.observe(panelRef.current);
|
|
3108
3130
|
return () => ro.disconnect();
|
|
3109
3131
|
}, [isOpen, updatePosition]);
|
|
3132
|
+
const childProps = children.props;
|
|
3133
|
+
const childRef = childProps.ref;
|
|
3134
|
+
const passthroughRef = mergeRefs(forwardedRef, childRef, (node) => {
|
|
3135
|
+
triggerRef.current = node;
|
|
3136
|
+
});
|
|
3110
3137
|
if (disabled || !content) {
|
|
3111
|
-
return children;
|
|
3138
|
+
if (!asChild) return children;
|
|
3139
|
+
return React9.cloneElement(children, {
|
|
3140
|
+
...triggerPassthroughProps,
|
|
3141
|
+
ref: passthroughRef
|
|
3142
|
+
});
|
|
3112
3143
|
}
|
|
3144
|
+
const triggerProps = {
|
|
3145
|
+
...triggerPassthroughProps,
|
|
3146
|
+
ref: passthroughRef,
|
|
3147
|
+
"data-underverse-tooltip-trigger": triggerSelector,
|
|
3148
|
+
onMouseEnter: chainEventHandlers(
|
|
3149
|
+
triggerPassthroughProps.onMouseEnter,
|
|
3150
|
+
childProps.onMouseEnter,
|
|
3151
|
+
(e) => {
|
|
3152
|
+
triggerRef.current = e.currentTarget;
|
|
3153
|
+
handleMouseEnter();
|
|
3154
|
+
}
|
|
3155
|
+
),
|
|
3156
|
+
onMouseLeave: chainEventHandlers(
|
|
3157
|
+
triggerPassthroughProps.onMouseLeave,
|
|
3158
|
+
childProps.onMouseLeave,
|
|
3159
|
+
(e) => {
|
|
3160
|
+
triggerRef.current = e.currentTarget;
|
|
3161
|
+
handleMouseLeave();
|
|
3162
|
+
}
|
|
3163
|
+
),
|
|
3164
|
+
onFocus: chainEventHandlers(
|
|
3165
|
+
triggerPassthroughProps.onFocus,
|
|
3166
|
+
childProps.onFocus,
|
|
3167
|
+
(e) => {
|
|
3168
|
+
triggerRef.current = e.currentTarget;
|
|
3169
|
+
handleFocus();
|
|
3170
|
+
}
|
|
3171
|
+
),
|
|
3172
|
+
onBlur: chainEventHandlers(
|
|
3173
|
+
triggerPassthroughProps.onBlur,
|
|
3174
|
+
childProps.onBlur,
|
|
3175
|
+
(e) => {
|
|
3176
|
+
handleBlur();
|
|
3177
|
+
}
|
|
3178
|
+
)
|
|
3179
|
+
};
|
|
3180
|
+
const trigger = asChild ? React9.cloneElement(children, triggerProps) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { ...triggerProps, children });
|
|
3113
3181
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
3114
|
-
|
|
3115
|
-
const TriggerComponent = children.type;
|
|
3116
|
-
const triggerProps = children.props;
|
|
3117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3118
|
-
TriggerComponent,
|
|
3119
|
-
{
|
|
3120
|
-
...triggerProps,
|
|
3121
|
-
"data-underverse-tooltip-trigger": triggerSelector,
|
|
3122
|
-
onMouseEnter: (e) => {
|
|
3123
|
-
triggerRef.current = e.currentTarget;
|
|
3124
|
-
handleMouseEnter();
|
|
3125
|
-
if (typeof triggerProps.onMouseEnter === "function") triggerProps.onMouseEnter(e);
|
|
3126
|
-
},
|
|
3127
|
-
onMouseLeave: (e) => {
|
|
3128
|
-
triggerRef.current = e.currentTarget;
|
|
3129
|
-
handleMouseLeave();
|
|
3130
|
-
if (typeof triggerProps.onMouseLeave === "function") triggerProps.onMouseLeave(e);
|
|
3131
|
-
},
|
|
3132
|
-
onFocus: (e) => {
|
|
3133
|
-
triggerRef.current = e.currentTarget;
|
|
3134
|
-
handleFocus();
|
|
3135
|
-
if (typeof triggerProps.onFocus === "function") triggerProps.onFocus(e);
|
|
3136
|
-
},
|
|
3137
|
-
onBlur: (e) => {
|
|
3138
|
-
handleBlur();
|
|
3139
|
-
if (typeof triggerProps.onBlur === "function") triggerProps.onBlur(e);
|
|
3140
|
-
}
|
|
3141
|
-
}
|
|
3142
|
-
);
|
|
3143
|
-
})(),
|
|
3182
|
+
trigger,
|
|
3144
3183
|
isMounted && isOpen && (0, import_react_dom.createPortal)(
|
|
3145
3184
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3146
3185
|
"div",
|
|
@@ -3180,7 +3219,8 @@ var Tooltip = ({
|
|
|
3180
3219
|
document.body
|
|
3181
3220
|
)
|
|
3182
3221
|
] });
|
|
3183
|
-
};
|
|
3222
|
+
});
|
|
3223
|
+
Tooltip.displayName = "Tooltip";
|
|
3184
3224
|
|
|
3185
3225
|
// src/components/emoji-ui.tsx
|
|
3186
3226
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -6105,36 +6145,32 @@ var Popover = ({
|
|
|
6105
6145
|
) : null;
|
|
6106
6146
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
6107
6147
|
(() => {
|
|
6108
|
-
const TriggerComponent = trigger.type;
|
|
6109
6148
|
const triggerProps = trigger.props;
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6149
|
+
const childRef = triggerProps.ref;
|
|
6150
|
+
return React18.cloneElement(trigger, {
|
|
6151
|
+
...triggerProps,
|
|
6152
|
+
ref: mergeRefs(childRef, (node) => {
|
|
6153
|
+
triggerRef.current = node;
|
|
6154
|
+
}),
|
|
6155
|
+
"data-underverse-popover-trigger": triggerSelector,
|
|
6156
|
+
onClick: chainEventHandlers(
|
|
6157
|
+
(e) => {
|
|
6116
6158
|
triggerRef.current = e.currentTarget;
|
|
6117
6159
|
e.preventDefault();
|
|
6118
6160
|
e.stopPropagation();
|
|
6119
6161
|
handleTriggerClick();
|
|
6120
|
-
if (typeof triggerProps.onClick === "function") {
|
|
6121
|
-
triggerProps.onClick(e);
|
|
6122
|
-
}
|
|
6123
6162
|
},
|
|
6124
|
-
|
|
6163
|
+
triggerProps.onClick
|
|
6164
|
+
),
|
|
6165
|
+
onFocus: chainEventHandlers(
|
|
6166
|
+
(e) => {
|
|
6125
6167
|
triggerRef.current = e.currentTarget;
|
|
6126
|
-
if (typeof triggerProps.onFocus === "function") {
|
|
6127
|
-
triggerProps.onFocus(e);
|
|
6128
|
-
}
|
|
6129
6168
|
},
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
)
|
|
6136
|
-
}
|
|
6137
|
-
);
|
|
6169
|
+
triggerProps.onFocus
|
|
6170
|
+
),
|
|
6171
|
+
"aria-expanded": isOpen,
|
|
6172
|
+
"aria-haspopup": triggerProps["aria-haspopup"] ?? "dialog"
|
|
6173
|
+
});
|
|
6138
6174
|
})(),
|
|
6139
6175
|
popoverContent
|
|
6140
6176
|
] });
|
|
@@ -7013,17 +7049,18 @@ var DropdownMenu = ({
|
|
|
7013
7049
|
index
|
|
7014
7050
|
);
|
|
7015
7051
|
}) : children });
|
|
7016
|
-
const TriggerComponent = trigger.type;
|
|
7017
7052
|
const triggerProps = trigger.props;
|
|
7018
|
-
const
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7053
|
+
const childRef = triggerProps.ref;
|
|
7054
|
+
const enhancedTrigger = import_react14.default.cloneElement(trigger, {
|
|
7055
|
+
...triggerProps,
|
|
7056
|
+
ref: mergeRefs(childRef, (node) => {
|
|
7057
|
+
triggerRef.current = node;
|
|
7058
|
+
}),
|
|
7059
|
+
"aria-haspopup": "menu",
|
|
7060
|
+
"aria-expanded": open,
|
|
7061
|
+
onKeyDown: chainEventHandlers((e) => {
|
|
7062
|
+
triggerRef.current = e.currentTarget;
|
|
7063
|
+
if (!disabled) {
|
|
7027
7064
|
if (e.key === "ArrowDown") {
|
|
7028
7065
|
e.preventDefault();
|
|
7029
7066
|
setOpen(true);
|
|
@@ -7039,22 +7076,12 @@ var DropdownMenu = ({
|
|
|
7039
7076
|
e.preventDefault();
|
|
7040
7077
|
setOpen(false);
|
|
7041
7078
|
}
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
if (typeof triggerProps.onFocus === "function") {
|
|
7049
|
-
triggerProps.onFocus(e);
|
|
7050
|
-
}
|
|
7051
|
-
},
|
|
7052
|
-
className: cn(
|
|
7053
|
-
triggerProps.className,
|
|
7054
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
7055
|
-
)
|
|
7056
|
-
}
|
|
7057
|
-
);
|
|
7079
|
+
}
|
|
7080
|
+
}, triggerProps.onKeyDown),
|
|
7081
|
+
onFocus: chainEventHandlers((e) => {
|
|
7082
|
+
triggerRef.current = e.currentTarget;
|
|
7083
|
+
}, triggerProps.onFocus)
|
|
7084
|
+
});
|
|
7058
7085
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7059
7086
|
Popover,
|
|
7060
7087
|
{
|
|
@@ -17237,7 +17264,7 @@ function CategoryTreeSelect(props) {
|
|
|
17237
17264
|
// View-only mode: just display the name with folder icon
|
|
17238
17265
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex min-w-0 items-center", TREE_NODE_GAP_CLASS), children: [
|
|
17239
17266
|
category.icon ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground/60", children: category.icon }) : hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react26.FolderTree, { className: "h-4 w-4 shrink-0 text-muted-foreground/60" }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-muted-foreground/40" }),
|
|
17240
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "min-w-0 text-sm font-medium leading-snug
|
|
17267
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "min-w-0 text-sm font-medium leading-snug wrap-anywhere", children: category.name })
|
|
17241
17268
|
] })
|
|
17242
17269
|
) : (
|
|
17243
17270
|
// Single/Multi select mode: icon + text + badge
|
|
@@ -17247,7 +17274,7 @@ function CategoryTreeSelect(props) {
|
|
|
17247
17274
|
"span",
|
|
17248
17275
|
{
|
|
17249
17276
|
className: cn(
|
|
17250
|
-
"min-w-0 flex-1 text-sm leading-snug
|
|
17277
|
+
"min-w-0 flex-1 text-sm leading-snug wrap-anywhere transition-all duration-200",
|
|
17251
17278
|
isSelected ? "font-semibold text-primary" : "text-foreground/80",
|
|
17252
17279
|
!isSelectable && "text-foreground"
|
|
17253
17280
|
),
|