@telegraph/tooltip 0.3.0 → 0.4.0

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.
@@ -3471,28 +3471,36 @@ var xs = /* @__PURE__ */ bs("div"), Ss = s.createContext({
3471
3471
  },
3472
3472
  children: e
3473
3473
  });
3474
- }, Ts = ({ delayDuration: c = 400, skipDelayDuration: l, disableHoverableContent: u, defaultOpen: d, open: f, onOpenChange: p, "aria-label": m, onEscapeKeyDown: h, onPointerDownOutside: g, forceMount: _, side: v = "bottom", sideOffset: y = 4, align: b = "center", alignOffset: x, avoidCollisions: S, collisionBoundary: C, collisionPadding: w, arrowPadding: T, sticky: ee, hideWhenDetached: te, skipAnimation: ne, label: re, labelProps: ie, enabled: ae = !0, triggerRef: oe, children: se }) => {
3475
- let [E, ce] = t({
3474
+ }, Ts = ({ delayDuration: c = 400, skipDelayDuration: l, disableHoverableContent: u, defaultOpen: d, open: f, onOpenChange: p, "aria-label": m, onEscapeKeyDown: h, onPointerDownOutside: g, forceMount: _, side: v = "bottom", sideOffset: y = 4, align: b = "center", alignOffset: x, avoidCollisions: S, collisionBoundary: C, collisionPadding: w, arrowPadding: T, sticky: ee, hideWhenDetached: te, skipAnimation: ne, label: re, labelProps: ie, enabled: ae = !0, disableFocusOpen: oe = !1, triggerRef: se, children: E }) => {
3475
+ let [ce, D] = t({
3476
3476
  prop: f,
3477
3477
  onChange: p,
3478
3478
  defaultProp: d ?? !1
3479
- }), { groupOpen: D } = Cs({
3480
- open: !!E,
3479
+ }), { groupOpen: O } = Cs({
3480
+ open: !!ce,
3481
3481
  delay: c
3482
- }), O = s.Children.toArray(se).some((e) => s.isValidElement(e) ? e.props.disabled : !1), k = D || O ? 0 : c, le = !D;
3482
+ }), k = s.Children.toArray(E).some((e) => s.isValidElement(e) ? e.props.disabled : !1), le = O || k ? 0 : c, ue = !O, de = (e) => {
3483
+ if (e === "top") return { y: -5 };
3484
+ if (e === "bottom") return { y: 5 };
3485
+ if (e === "left") return { x: -5 };
3486
+ if (e === "right") return { x: 5 };
3487
+ };
3483
3488
  return /* @__PURE__ */ a(po, {
3484
3489
  features: ys,
3485
3490
  children: /* @__PURE__ */ a(e.Provider, {
3486
- delayDuration: k,
3491
+ delayDuration: le,
3487
3492
  skipDelayDuration: l,
3488
3493
  disableHoverableContent: u,
3489
3494
  children: /* @__PURE__ */ o(e.Root, {
3490
- open: ae === !1 ? !1 : E,
3491
- onOpenChange: ce,
3495
+ open: ae === !1 ? !1 : ce,
3496
+ onOpenChange: D,
3492
3497
  children: [/* @__PURE__ */ a(e.Trigger, {
3493
3498
  asChild: !0,
3494
- ref: oe,
3495
- children: /* @__PURE__ */ a(n, { children: se })
3499
+ ref: se,
3500
+ children: /* @__PURE__ */ a(n, {
3501
+ ...oe ? { onFocus: (e) => e.preventDefault() } : {},
3502
+ children: E
3503
+ })
3496
3504
  }), /* @__PURE__ */ a(e.Portal, { children: /* @__PURE__ */ a(e.Content, {
3497
3505
  "aria-label": m,
3498
3506
  onEscapeKeyDown: h,
@@ -3512,15 +3520,10 @@ var xs = /* @__PURE__ */ bs("div"), Ss = s.createContext({
3512
3520
  children: /* @__PURE__ */ a(r, {
3513
3521
  as: xs,
3514
3522
  className: "tgph",
3515
- initial: le && !ne ? {
3523
+ initial: ue && !ne ? {
3516
3524
  opacity: 0,
3517
3525
  scale: .8,
3518
- ...((e) => {
3519
- if (e === "top") return { y: -5 };
3520
- if (e === "bottom") return { y: 5 };
3521
- if (e === "left") return { x: -5 };
3522
- if (e === "right") return { x: 5 };
3523
- })(v)
3526
+ ...de(v)
3524
3527
  } : {},
3525
3528
  animate: {
3526
3529
  opacity: 1,
@@ -3541,7 +3544,7 @@ var xs = /* @__PURE__ */ bs("div"), Ss = s.createContext({
3541
3544
  align: "center",
3542
3545
  justify: "center",
3543
3546
  style: { transformOrigin: "var(--radix-tooltip-content-transform-origin)" },
3544
- ...ie ? { labelProps: ie } : {},
3547
+ ...ie ?? {},
3545
3548
  children: typeof re == "string" ? /* @__PURE__ */ a(i, {
3546
3549
  as: "span",
3547
3550
  size: "1",