@mirror-physics/fractal-ui 0.2.0-next.80 → 0.2.0-next.82

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/README.md CHANGED
@@ -111,3 +111,20 @@ A user preference can update these properties at runtime without remounting
111
111
  components. Supply a contrasting foreground (at least 4.5:1 against every
112
112
  state). An explicit `color="pink"` preset takes precedence over the inherited
113
113
  theme. Disabled and danger styles remain independent.
114
+
115
+ ### Tooltip
116
+
117
+ Use `Tooltip` for supplementary, non-interactive help on hover or keyboard focus.
118
+ Pass one focusable trigger that forwards its props and ref, such as `Button`.
119
+ Essential instructions belong in visible page text; interactive content belongs in a popover.
120
+
121
+ ```tsx
122
+ <Tooltip content="Organization agents share context between their members." placement="bottom" maxWidth={360}>
123
+ <Button buttonType="ghost" aria-label="About organization agents" hasIconOnly icon={<CircleInfo size={20} />} />
124
+ </Tooltip>
125
+ ```
126
+
127
+ Supports `placement`, `maxWidth`, hover `delay` (default 0), `disabled`, and content `className`.
128
+ The trigger keeps its accessible name and receives `aria-describedby` while open.
129
+ Tooltips close on Escape, remain hoverable, flip at viewport edges, render in a portal,
130
+ and respect reduced motion. Run `npm run test:tooltip` for browser interaction checks.
package/dist/index.cjs CHANGED
@@ -107,6 +107,7 @@ __export(src_exports, {
107
107
  ToastViewport: () => ToastViewport,
108
108
  Toggle: () => Toggle,
109
109
  ToggleGhost: () => ToggleGhost,
110
+ Tooltip: () => Tooltip,
110
111
  UILoader: () => UILoader,
111
112
  cn: () => cn,
112
113
  useEscapeDismiss: () => useEscapeDismiss
@@ -3406,6 +3407,35 @@ function ColumnEditor({ items, value, onChange, label = "Edit columns", hiddenLa
3406
3407
  ] }) : null
3407
3408
  ] });
3408
3409
  }
3410
+
3411
+ // src/components/Tooltip/Tooltip.tsx
3412
+ var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
3413
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3414
+ function Tooltip({
3415
+ content,
3416
+ children,
3417
+ placement = "bottom",
3418
+ maxWidth = 320,
3419
+ delay = 0,
3420
+ disabled = false,
3421
+ className
3422
+ }) {
3423
+ if (disabled || content == null || content === "") return children;
3424
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TooltipPrimitive.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(TooltipPrimitive.Root, { children: [
3425
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TooltipPrimitive.Trigger, { asChild: true, children }),
3426
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3427
+ TooltipPrimitive.Content,
3428
+ {
3429
+ side: placement,
3430
+ sideOffset: 8,
3431
+ collisionPadding: 8,
3432
+ className: cn("fractal-tooltip", className),
3433
+ style: { "--tooltip-max-width": typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth },
3434
+ children: content
3435
+ }
3436
+ ) })
3437
+ ] }) });
3438
+ }
3409
3439
  // Annotate the CommonJS export names for ESM import in node:
3410
3440
  0 && (module.exports = {
3411
3441
  Alert,
@@ -3485,6 +3515,7 @@ function ColumnEditor({ items, value, onChange, label = "Edit columns", hiddenLa
3485
3515
  ToastViewport,
3486
3516
  Toggle,
3487
3517
  ToggleGhost,
3518
+ Tooltip,
3488
3519
  UILoader,
3489
3520
  cn,
3490
3521
  useEscapeDismiss