@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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 225,
6
6
  "exports": [
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 break-words [overflow-wrap:anywhere] transition-colors duration-200 max-md:text-sm",
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 break-words [overflow-wrap:anywhere]", children: description })
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)(
@@ -2940,6 +2940,25 @@ var variantStyles2 = {
2940
2940
  success: "bg-success text-success-foreground border-success/20"
2941
2941
  };
2942
2942
  var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
2943
+ function composeEventHandlers(theirHandler, ourHandler) {
2944
+ return (event) => {
2945
+ theirHandler?.(event);
2946
+ ourHandler(event);
2947
+ };
2948
+ }
2949
+ function setRefValue(ref, value) {
2950
+ if (!ref) return;
2951
+ if (typeof ref === "function") {
2952
+ ref(value);
2953
+ return;
2954
+ }
2955
+ ref.current = value;
2956
+ }
2957
+ function mergeRefs(...refs) {
2958
+ return (value) => {
2959
+ refs.forEach((ref) => setRefValue(ref, value));
2960
+ };
2961
+ }
2943
2962
  function getTransformOrigin(side) {
2944
2963
  switch (side) {
2945
2964
  case "top":
@@ -2991,7 +3010,8 @@ var Tooltip = ({
2991
3010
  delay = { open: 200, close: 300 },
2992
3011
  className,
2993
3012
  disabled = false,
2994
- variant = "default"
3013
+ variant = "default",
3014
+ asChild = true
2995
3015
  }) => {
2996
3016
  const [isOpen, setIsOpen] = React9.useState(false);
2997
3017
  const isMounted = useHydrated();
@@ -3110,37 +3130,32 @@ var Tooltip = ({
3110
3130
  if (disabled || !content) {
3111
3131
  return children;
3112
3132
  }
3133
+ const childProps = children.props;
3134
+ const childRef = children.ref ?? childProps.ref;
3135
+ const triggerProps = {
3136
+ ref: mergeRefs(childRef, (node) => {
3137
+ triggerRef.current = node;
3138
+ }),
3139
+ "data-underverse-tooltip-trigger": triggerSelector,
3140
+ onMouseEnter: composeEventHandlers(childProps.onMouseEnter, (e) => {
3141
+ triggerRef.current = e.currentTarget;
3142
+ handleMouseEnter();
3143
+ }),
3144
+ onMouseLeave: composeEventHandlers(childProps.onMouseLeave, (e) => {
3145
+ triggerRef.current = e.currentTarget;
3146
+ handleMouseLeave();
3147
+ }),
3148
+ onFocus: composeEventHandlers(childProps.onFocus, (e) => {
3149
+ triggerRef.current = e.currentTarget;
3150
+ handleFocus();
3151
+ }),
3152
+ onBlur: composeEventHandlers(childProps.onBlur, () => {
3153
+ handleBlur();
3154
+ })
3155
+ };
3156
+ const trigger = asChild ? React9.cloneElement(children, triggerProps) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { ...triggerProps, children });
3113
3157
  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
- })(),
3158
+ trigger,
3144
3159
  isMounted && isOpen && (0, import_react_dom.createPortal)(
3145
3160
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3146
3161
  "div",
@@ -17237,7 +17252,7 @@ function CategoryTreeSelect(props) {
17237
17252
  // View-only mode: just display the name with folder icon
17238
17253
  /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex min-w-0 items-center", TREE_NODE_GAP_CLASS), children: [
17239
17254
  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 break-words [overflow-wrap:anywhere]", children: category.name })
17255
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "min-w-0 text-sm font-medium leading-snug wrap-anywhere", children: category.name })
17241
17256
  ] })
17242
17257
  ) : (
17243
17258
  // Single/Multi select mode: icon + text + badge
@@ -17247,7 +17262,7 @@ function CategoryTreeSelect(props) {
17247
17262
  "span",
17248
17263
  {
17249
17264
  className: cn(
17250
- "min-w-0 flex-1 text-sm leading-snug break-words [overflow-wrap:anywhere] transition-all duration-200",
17265
+ "min-w-0 flex-1 text-sm leading-snug wrap-anywhere transition-all duration-200",
17251
17266
  isSelected ? "font-semibold text-primary" : "text-foreground/80",
17252
17267
  !isSelectable && "text-foreground"
17253
17268
  ),