@sanity/ui 4.0.7 → 4.1.1

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.
Files changed (66) hide show
  1. package/dist/{arrow-CL8xmdbg.js → arrow-DKn5YKdy.js} +6 -5
  2. package/dist/arrow-DKn5YKdy.js.map +1 -0
  3. package/dist/autocomplete.d.ts +2 -2
  4. package/dist/autocomplete.d.ts.map +1 -1
  5. package/dist/autocomplete.js +37 -41
  6. package/dist/autocomplete.js.map +1 -1
  7. package/dist/breadcrumbs.d.ts +2 -2
  8. package/dist/breadcrumbs.d.ts.map +1 -1
  9. package/dist/breadcrumbs.js +30 -32
  10. package/dist/breadcrumbs.js.map +1 -1
  11. package/dist/{button-DQH2KIbq.js → button-Dh_M2fYx.js} +10 -10
  12. package/dist/button-Dh_M2fYx.js.map +1 -0
  13. package/dist/button-dnqMFkWg.d.ts.map +1 -1
  14. package/dist/code.d.ts +2 -2
  15. package/dist/code.d.ts.map +1 -1
  16. package/dist/{factory-BA3gEfyI.js → factory-BzXTX8_Q.js} +2 -2
  17. package/dist/{factory-BA3gEfyI.js.map → factory-BzXTX8_Q.js.map} +1 -1
  18. package/dist/{flex-CySCBzQm.js → flex-DmbDG2ks.js} +2 -2
  19. package/dist/{flex-CySCBzQm.js.map → flex-DmbDG2ks.js.map} +1 -1
  20. package/dist/{getElementRef-5HZQ-Owu.js → getElementRef-Jw7gY0eV.js} +13 -2
  21. package/dist/getElementRef-Jw7gY0eV.js.map +1 -0
  22. package/dist/{grid-I2TNptX-.js → grid-6JSgMj1O.js} +2 -2
  23. package/dist/{grid-I2TNptX-.js.map → grid-6JSgMj1O.js.map} +1 -1
  24. package/dist/{hotkeys-BPlacpG8.js → hotkeys-uSArGPzR.js} +28 -28
  25. package/dist/hotkeys-uSArGPzR.js.map +1 -0
  26. package/dist/index.d.ts +156 -156
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +317 -351
  29. package/dist/index.js.map +1 -1
  30. package/dist/layer-BfwisMR6.js +61 -0
  31. package/dist/layer-BfwisMR6.js.map +1 -0
  32. package/dist/layer-ChlP9Ik6.d.ts.map +1 -1
  33. package/dist/menu.d.ts +6 -6
  34. package/dist/menu.d.ts.map +1 -1
  35. package/dist/menu.js +50 -38
  36. package/dist/menu.js.map +1 -1
  37. package/dist/{popover-CEbjxiPx.js → popover-myCXZV_F.js} +34 -33
  38. package/dist/popover-myCXZV_F.js.map +1 -0
  39. package/dist/popover.js +1 -1
  40. package/dist/{stack-BGFEokua.js → stack-rsNFPq2-.js} +2 -2
  41. package/dist/{stack-BGFEokua.js.map → stack-rsNFPq2-.js.map} +1 -1
  42. package/dist/styles.css +408 -0
  43. package/dist/{textInput-B6ZZJSOj.js → textInput-DAaORuky.js} +38 -50
  44. package/dist/textInput-DAaORuky.js.map +1 -0
  45. package/dist/theme.d.ts +33 -33
  46. package/dist/theme.d.ts.map +1 -1
  47. package/dist/theme.js +1 -1
  48. package/dist/toast.d.ts +4 -4
  49. package/dist/toast.d.ts.map +1 -1
  50. package/dist/toast.js +80 -76
  51. package/dist/toast.js.map +1 -1
  52. package/dist/tooltip.d.ts +5 -5
  53. package/dist/tooltip.d.ts.map +1 -1
  54. package/dist/tooltip.js +97 -99
  55. package/dist/tooltip.js.map +1 -1
  56. package/dist/{useLayer-jUJIz8mh.js → useLayer-D1usxIE0.js} +2 -2
  57. package/dist/{useLayer-jUJIz8mh.js.map → useLayer-D1usxIE0.js.map} +1 -1
  58. package/package.json +10 -9
  59. package/dist/arrow-CL8xmdbg.js.map +0 -1
  60. package/dist/button-DQH2KIbq.js.map +0 -1
  61. package/dist/getElementRef-5HZQ-Owu.js.map +0 -1
  62. package/dist/hotkeys-BPlacpG8.js.map +0 -1
  63. package/dist/layer-DGn7KJIB.js +0 -61
  64. package/dist/layer-DGn7KJIB.js.map +0 -1
  65. package/dist/popover-CEbjxiPx.js.map +0 -1
  66. package/dist/textInput-B6ZZJSOj.js.map +0 -1
package/dist/tooltip.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { c as POPOVER_MOTION_PROPS, n as _getArrayProp } from "./helpers-C8xxXAQC.js";
3
- import { _ as useTheme_v2, d as createGlobalScopedContext, i as usePrefersReducedMotion, s as Card } from "./useLayer-jUJIz8mh.js";
4
- import { n as AnimateActivity, r as origin, t as getElementRef } from "./getElementRef-5HZQ-Owu.js";
5
- import { a as useBoundaryElement, n as Portal, r as usePortal, t as Arrow } from "./arrow-CL8xmdbg.js";
6
- import { t as Layer } from "./layer-DGn7KJIB.js";
3
+ import { _ as useTheme_v2, d as createGlobalScopedContext, i as usePrefersReducedMotion, s as Card } from "./useLayer-D1usxIE0.js";
4
+ import { i as origin, n as AnimateActivity, r as getTransformOrigin, t as getElementRef } from "./getElementRef-Jw7gY0eV.js";
5
+ import { a as useBoundaryElement, n as Portal, r as usePortal, t as Arrow } from "./arrow-DKn5YKdy.js";
6
+ import { t as Layer } from "./layer-BfwisMR6.js";
7
7
  import { c } from "react/compiler-runtime";
8
+ import { clsx } from "clsx/lite";
8
9
  import { Activity, cloneElement, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
9
- import { styled } from "styled-components";
10
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
11
  import { arrow, autoUpdate, flip, offset, shift, useFloating } from "@floating-ui/react-dom";
12
12
  import { motion } from "motion/react";
@@ -115,40 +115,43 @@ const DEFAULT_FALLBACK_PLACEMENTS = {
115
115
  "top-end",
116
116
  "bottom-end"
117
117
  ]
118
- }, MotionCard = styled(motion.create(Card)).withConfig({
119
- displayName: "MotionCard",
120
- componentId: "sc-0hzi5o-0"
121
- })`will-change:transform;`;
118
+ };
119
+ var tooltipCard = "_54iwec1", tooltipLayer = "_54iwec0";
120
+ const MotionCard = motion.create(Card);
122
121
  /**
123
122
  * @internal
124
123
  */
125
124
  function TooltipCard(props) {
126
- let $ = c(41), animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, ref, restProps, scheme, shadow, style;
127
- $[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], ref = $[12], restProps = $[13], scheme = $[14], shadow = $[15], style = $[16]) : ({animate, arrow, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, ref, scheme, shadow, style, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = ref, $[13] = restProps, $[14] = scheme, $[15] = shadow, $[16] = style);
128
- let t0 = animate ? "transform" : void 0, t1;
129
- $[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t0 ? (t1 = {
130
- originX,
131
- originY,
132
- willChange: t0,
125
+ let $ = c(47), animate, arrow, arrowRef, arrowX, arrowY, children, className, originX, originY, padding, placement, radius, ref, restProps, scheme, shadow, style;
126
+ $[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], className = $[7], originX = $[8], originY = $[9], padding = $[10], placement = $[11], radius = $[12], ref = $[13], restProps = $[14], scheme = $[15], shadow = $[16], style = $[17]) : ({animate, arrow, arrowRef, arrowX, arrowY, children, className, originX, originY, padding, placement, radius, ref, scheme, shadow, style, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = className, $[8] = originX, $[9] = originY, $[10] = padding, $[11] = placement, $[12] = radius, $[13] = ref, $[14] = restProps, $[15] = scheme, $[16] = shadow, $[17] = style);
127
+ let t0;
128
+ $[18] !== originX || $[19] !== originY ? (t0 = getTransformOrigin(originX, originY), $[18] = originX, $[19] = originY, $[20] = t0) : t0 = $[20];
129
+ let t1 = animate ? "transform" : void 0, t2;
130
+ $[21] !== style || $[22] !== t0 || $[23] !== t1 ? (t2 = {
131
+ transformOrigin: t0,
132
+ willChange: t1,
133
133
  ...style
134
- }, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t0, $[21] = t1) : t1 = $[21];
135
- let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
136
- $[22] !== t2 || $[23] !== t3 ? (t4 = {
137
- left: t2,
138
- top: t3,
134
+ }, $[21] = style, $[22] = t0, $[23] = t1, $[24] = t2) : t2 = $[24];
135
+ let rootStyle = t2, t3 = arrowX === null ? void 0 : arrowX, t4 = arrowY === null ? void 0 : arrowY, t5;
136
+ $[25] !== t3 || $[26] !== t4 ? (t5 = {
137
+ left: t3,
138
+ top: t4,
139
139
  right: void 0,
140
140
  bottom: void 0
141
- }, $[22] = t2, $[23] = t3, $[24] = t4) : t4 = $[24];
142
- let arrowStyle = t4, t5 = animate ? POPOVER_MOTION_PROPS : void 0, t6;
143
- $[25] !== arrow || $[26] !== arrowRef || $[27] !== arrowStyle ? (t6 = arrow && /* @__PURE__ */ jsx(Arrow, {
141
+ }, $[25] = t3, $[26] = t4, $[27] = t5) : t5 = $[27];
142
+ let arrowStyle = t5, t6;
143
+ $[28] === className ? t6 = $[29] : (t6 = clsx(tooltipCard, className), $[28] = className, $[29] = t6);
144
+ let t7 = animate ? POPOVER_MOTION_PROPS : void 0, t8;
145
+ $[30] !== arrow || $[31] !== arrowRef || $[32] !== arrowStyle ? (t8 = arrow && /* @__PURE__ */ jsx(Arrow, {
144
146
  ref: arrowRef,
145
147
  style: arrowStyle,
146
148
  width: 15,
147
149
  height: 6,
148
150
  radius: 2
149
- }), $[25] = arrow, $[26] = arrowRef, $[27] = arrowStyle, $[28] = t6) : t6 = $[28];
150
- let t7;
151
- return $[29] !== children || $[30] !== padding || $[31] !== placement || $[32] !== radius || $[33] !== ref || $[34] !== restProps || $[35] !== rootStyle || $[36] !== scheme || $[37] !== shadow || $[38] !== t5 || $[39] !== t6 ? (t7 = /* @__PURE__ */ jsxs(MotionCard, {
151
+ }), $[30] = arrow, $[31] = arrowRef, $[32] = arrowStyle, $[33] = t8) : t8 = $[33];
152
+ let t9;
153
+ return $[34] !== children || $[35] !== padding || $[36] !== placement || $[37] !== radius || $[38] !== ref || $[39] !== restProps || $[40] !== rootStyle || $[41] !== scheme || $[42] !== shadow || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 ? (t9 = /* @__PURE__ */ jsxs(MotionCard, {
154
+ className: t6,
152
155
  "data-ui": "Tooltip__card",
153
156
  ...restProps,
154
157
  "data-placement": placement,
@@ -158,9 +161,9 @@ function TooltipCard(props) {
158
161
  scheme,
159
162
  shadow,
160
163
  style: rootStyle,
161
- ...t5,
162
- children: [children, t6]
163
- }), $[29] = children, $[30] = padding, $[31] = placement, $[32] = radius, $[33] = ref, $[34] = restProps, $[35] = rootStyle, $[36] = scheme, $[37] = shadow, $[38] = t5, $[39] = t6, $[40] = t7) : t7 = $[40], t7;
164
+ ...t7,
165
+ children: [children, t8]
166
+ }), $[34] = children, $[35] = padding, $[36] = placement, $[37] = radius, $[38] = ref, $[39] = restProps, $[40] = rootStyle, $[41] = scheme, $[42] = shadow, $[43] = t6, $[44] = t7, $[45] = t8, $[46] = t9) : t9 = $[46], t9;
164
167
  }
165
168
  /**
166
169
  * @beta
@@ -172,100 +175,94 @@ const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/t
172
175
  function useTooltipDelayGroup() {
173
176
  return useContext(TooltipDelayGroupContext);
174
177
  }
175
- const StyledTooltip = styled(Layer).withConfig({
176
- displayName: "StyledTooltip",
177
- componentId: "sc-nx2p4f-0"
178
- })`pointer-events:none;`;
179
178
  /**
180
179
  * Tooltips display information when hovering, focusing or tapping.
181
180
  *
182
181
  * @public
183
182
  */
184
183
  function Tooltip(props) {
185
- let $ = c(138), boundaryElementContext = useBoundaryElement(), { layer } = useTheme_v2(), _boundaryElement, _fallbackPlacementsProp, _zOffset, childProp, content, delay, disabled, forwardedRef, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5;
186
- $[0] === props ? (_boundaryElement = $[1], _fallbackPlacementsProp = $[2], _zOffset = $[3], childProp = $[4], content = $[5], delay = $[6], disabled = $[7], forwardedRef = $[8], portalProp = $[9], restProps = $[10], scheme = $[11], t0 = $[12], t1 = $[13], t2 = $[14], t3 = $[15], t4 = $[16], t5 = $[17]) : ({animate: t0, arrow: t1, boundaryElement: _boundaryElement, children: childProp, content, disabled, fallbackPlacements: _fallbackPlacementsProp, padding: t2, placement: t3, portal: portalProp, radius: t4, ref: forwardedRef, scheme, shadow: t5, zOffset: _zOffset, delay, ...restProps} = props, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacementsProp, $[3] = _zOffset, $[4] = childProp, $[5] = content, $[6] = delay, $[7] = disabled, $[8] = forwardedRef, $[9] = portalProp, $[10] = restProps, $[11] = scheme, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5);
187
- let _animate = t0 !== void 0 && t0, arrowProp = t1 !== void 0 && t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = !usePrefersReducedMotion() && _animate, t6;
188
- $[18] === fallbackPlacementsProp ? t6 = $[19] : (t6 = _getArrayProp(fallbackPlacementsProp), $[18] = fallbackPlacementsProp, $[19] = t6);
184
+ let $ = c(122), boundaryElementContext = useBoundaryElement(), { layer } = useTheme_v2(), { animate: t0, arrow: t1, boundaryElement: _boundaryElement, children: childProp, content, disabled, fallbackPlacements: _fallbackPlacementsProp, padding: t2, placement: t3, portal: portalProp, radius: t4, ref: forwardedRef, scheme, shadow: t5, zOffset: _zOffset, delay, ...restProps } = props, _animate = t0 !== void 0 && t0, arrowProp = t1 !== void 0 && t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = !usePrefersReducedMotion() && _animate, t6;
185
+ $[0] === fallbackPlacementsProp ? t6 = $[1] : (t6 = _getArrayProp(fallbackPlacementsProp), $[0] = fallbackPlacementsProp, $[1] = t6);
189
186
  let fallbackPlacements = t6, ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = useState(0), t7;
190
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[20] = t7) : t7 = $[20], useImperativeHandle(forwardedRef, t7);
187
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[2] = t7) : t7 = $[2], useImperativeHandle(forwardedRef, t7);
191
188
  let portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, t8;
192
- $[21] !== animate || $[22] !== arrowProp || $[23] !== boundaryElement || $[24] !== fallbackPlacements ? (t8 = {
189
+ $[3] !== animate || $[4] !== arrowProp || $[5] !== boundaryElement || $[6] !== fallbackPlacements ? (t8 = {
193
190
  animate,
194
191
  arrowProp,
195
192
  arrowRef,
196
193
  boundaryElement,
197
194
  fallbackPlacements,
198
195
  rootBoundary: "viewport"
199
- }, $[21] = animate, $[22] = arrowProp, $[23] = boundaryElement, $[24] = fallbackPlacements, $[25] = t8) : t8 = $[25];
196
+ }, $[3] = animate, $[4] = arrowProp, $[5] = boundaryElement, $[6] = fallbackPlacements, $[7] = t8) : t8 = $[7];
200
197
  let middleware = useMiddleware(t8), t9;
201
- $[26] === referenceElement ? t9 = $[27] : (t9 = { reference: referenceElement }, $[26] = referenceElement, $[27] = t9);
198
+ $[8] === referenceElement ? t9 = $[9] : (t9 = { reference: referenceElement }, $[8] = referenceElement, $[9] = t9);
202
199
  let t10;
203
- $[28] !== middleware || $[29] !== placementProp || $[30] !== t9 ? (t10 = {
200
+ $[10] !== middleware || $[11] !== placementProp || $[12] !== t9 ? (t10 = {
204
201
  middleware,
205
202
  placement: placementProp,
206
203
  whileElementsMounted: autoUpdate,
207
204
  elements: t9
208
- }, $[28] = middleware, $[29] = placementProp, $[30] = t9, $[31] = t10) : t10 = $[31];
205
+ }, $[10] = middleware, $[11] = placementProp, $[12] = t9, $[13] = t10) : t10 = $[13];
209
206
  let { floatingStyles, placement, middlewareData, refs, update } = useFloating(t10), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), t11;
210
- $[32] === delayGroupContext ? t11 = $[33] : (t11 = delayGroupContext || {}, $[32] = delayGroupContext, $[33] = t11);
207
+ $[14] === delayGroupContext ? t11 = $[15] : (t11 = delayGroupContext || {}, $[14] = delayGroupContext, $[15] = t11);
211
208
  let { setIsGroupActive, setOpenTooltipId } = t11, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, t12;
212
- $[34] !== closeDelay || $[35] !== isInsideGroup || $[36] !== openDelay || $[37] !== setIsGroupActive || $[38] !== setIsOpen || $[39] !== setOpenTooltipId || $[40] !== tooltipId ? (t12 = (open, immediate) => {
209
+ $[16] !== closeDelay || $[17] !== isInsideGroup || $[18] !== openDelay || $[19] !== setIsGroupActive || $[20] !== setIsOpen || $[21] !== setOpenTooltipId || $[22] !== tooltipId ? (t12 = (open, immediate) => {
213
210
  if (isInsideGroup) {
214
211
  if (open) {
215
212
  let groupedOpenDelay = immediate ? 0 : openDelay;
216
213
  setIsGroupActive?.(open, groupedOpenDelay), setOpenTooltipId?.(tooltipId, groupedOpenDelay);
217
214
  } else setIsGroupActive?.(open, closeDelay > 200 ? closeDelay : 200), setOpenTooltipId?.(null, immediate ? 0 : closeDelay);
218
215
  } else setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
219
- }, $[34] = closeDelay, $[35] = isInsideGroup, $[36] = openDelay, $[37] = setIsGroupActive, $[38] = setIsOpen, $[39] = setOpenTooltipId, $[40] = tooltipId, $[41] = t12) : t12 = $[41];
216
+ }, $[16] = closeDelay, $[17] = isInsideGroup, $[18] = openDelay, $[19] = setIsGroupActive, $[20] = setIsOpen, $[21] = setOpenTooltipId, $[22] = tooltipId, $[23] = t12) : t12 = $[23];
220
217
  let handleIsOpenChange = t12, t13;
221
- $[42] !== childProp?.props || $[43] !== handleIsOpenChange ? (t13 = (e) => {
218
+ $[24] !== childProp?.props || $[25] !== handleIsOpenChange ? (t13 = (e) => {
222
219
  handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
223
- }, $[42] = childProp?.props, $[43] = handleIsOpenChange, $[44] = t13) : t13 = $[44], childProp?.props;
220
+ }, $[24] = childProp?.props, $[25] = handleIsOpenChange, $[26] = t13) : t13 = $[26], childProp?.props;
224
221
  let handleBlur = t13, t14;
225
- $[45] !== childProp?.props || $[46] !== handleIsOpenChange ? (t14 = (e_0) => {
222
+ $[27] !== childProp?.props || $[28] !== handleIsOpenChange ? (t14 = (e_0) => {
226
223
  handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
227
- }, $[45] = childProp?.props, $[46] = handleIsOpenChange, $[47] = t14) : t14 = $[47], childProp?.props;
224
+ }, $[27] = childProp?.props, $[28] = handleIsOpenChange, $[29] = t14) : t14 = $[29], childProp?.props;
228
225
  let handleClick = t14, t15;
229
- $[48] !== childProp?.props || $[49] !== handleIsOpenChange ? (t15 = (e_1) => {
226
+ $[30] !== childProp?.props || $[31] !== handleIsOpenChange ? (t15 = (e_1) => {
230
227
  handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
231
- }, $[48] = childProp?.props, $[49] = handleIsOpenChange, $[50] = t15) : t15 = $[50], childProp?.props;
228
+ }, $[30] = childProp?.props, $[31] = handleIsOpenChange, $[32] = t15) : t15 = $[32], childProp?.props;
232
229
  let handleContextMenu = t15, t16;
233
- $[51] !== childProp?.props || $[52] !== handleIsOpenChange ? (t16 = (e_2) => {
230
+ $[33] !== childProp?.props || $[34] !== handleIsOpenChange ? (t16 = (e_2) => {
234
231
  handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
235
- }, $[51] = childProp?.props, $[52] = handleIsOpenChange, $[53] = t16) : t16 = $[53], childProp?.props;
232
+ }, $[33] = childProp?.props, $[34] = handleIsOpenChange, $[35] = t16) : t16 = $[35], childProp?.props;
236
233
  let handleFocus = t16, t17;
237
- $[54] !== childProp?.props || $[55] !== handleIsOpenChange ? (t17 = (e_3) => {
234
+ $[36] !== childProp?.props || $[37] !== handleIsOpenChange ? (t17 = (e_3) => {
238
235
  handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
239
- }, $[54] = childProp?.props, $[55] = handleIsOpenChange, $[56] = t17) : t17 = $[56], childProp?.props;
236
+ }, $[36] = childProp?.props, $[37] = handleIsOpenChange, $[38] = t17) : t17 = $[38], childProp?.props;
240
237
  let handleMouseEnter = t17, t18;
241
- $[57] !== childProp?.props || $[58] !== handleIsOpenChange ? (t18 = (e_4) => {
238
+ $[39] !== childProp?.props || $[40] !== handleIsOpenChange ? (t18 = (e_4) => {
242
239
  handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
243
- }, $[57] = childProp?.props, $[58] = handleIsOpenChange, $[59] = t18) : t18 = $[59], childProp?.props;
240
+ }, $[39] = childProp?.props, $[40] = handleIsOpenChange, $[41] = t18) : t18 = $[41], childProp?.props;
244
241
  let handleMouseLeave = t18, t19;
245
- $[60] !== handleIsOpenChange || $[61] !== isInsideGroup || $[62] !== referenceElement || $[63] !== showTooltip ? (t19 = {
242
+ $[42] !== handleIsOpenChange || $[43] !== isInsideGroup || $[44] !== referenceElement || $[45] !== showTooltip ? (t19 = {
246
243
  handleIsOpenChange,
247
244
  referenceElement,
248
245
  showTooltip,
249
246
  isInsideGroup
250
- }, $[60] = handleIsOpenChange, $[61] = isInsideGroup, $[62] = referenceElement, $[63] = showTooltip, $[64] = t19) : t19 = $[64], useCloseOnMouseLeave(t19);
247
+ }, $[42] = handleIsOpenChange, $[43] = isInsideGroup, $[44] = referenceElement, $[45] = showTooltip, $[46] = t19) : t19 = $[46], useCloseOnMouseLeave(t19);
251
248
  let t20, t21;
252
- $[65] !== disabled || $[66] !== handleIsOpenChange || $[67] !== showTooltip ? (t20 = () => {
249
+ $[47] !== disabled || $[48] !== handleIsOpenChange || $[49] !== showTooltip ? (t20 = () => {
253
250
  disabled && showTooltip && handleIsOpenChange(!1);
254
251
  }, t21 = [
255
252
  disabled,
256
253
  handleIsOpenChange,
257
254
  showTooltip
258
- ], $[65] = disabled, $[66] = handleIsOpenChange, $[67] = showTooltip, $[68] = t20, $[69] = t21) : (t20 = $[68], t21 = $[69]), useEffect(t20, t21);
255
+ ], $[47] = disabled, $[48] = handleIsOpenChange, $[49] = showTooltip, $[50] = t20, $[51] = t21) : (t20 = $[50], t21 = $[51]), useEffect(t20, t21);
259
256
  let t22, t23;
260
- $[70] !== content || $[71] !== handleIsOpenChange || $[72] !== showTooltip ? (t22 = () => {
257
+ $[52] !== content || $[53] !== handleIsOpenChange || $[54] !== showTooltip ? (t22 = () => {
261
258
  !content && showTooltip && handleIsOpenChange(!1);
262
259
  }, t23 = [
263
260
  content,
264
261
  handleIsOpenChange,
265
262
  showTooltip
266
- ], $[70] = content, $[71] = handleIsOpenChange, $[72] = showTooltip, $[73] = t22, $[74] = t23) : (t22 = $[73], t23 = $[74]), useEffect(t22, t23);
263
+ ], $[52] = content, $[53] = handleIsOpenChange, $[54] = showTooltip, $[55] = t22, $[56] = t23) : (t22 = $[55], t23 = $[56]), useEffect(t22, t23);
267
264
  let t24, t25;
268
- $[75] !== handleIsOpenChange || $[76] !== showTooltip ? (t24 = () => {
265
+ $[57] !== handleIsOpenChange || $[58] !== showTooltip ? (t24 = () => {
269
266
  if (!showTooltip) return;
270
267
  let handleWindowKeyDown = function handleWindowKeyDown(event) {
271
268
  event.key === "Escape" && handleIsOpenChange(!1, !0);
@@ -273,22 +270,22 @@ function Tooltip(props) {
273
270
  return window.addEventListener("keydown", handleWindowKeyDown), () => {
274
271
  window.removeEventListener("keydown", handleWindowKeyDown);
275
272
  };
276
- }, t25 = [handleIsOpenChange, showTooltip], $[75] = handleIsOpenChange, $[76] = showTooltip, $[77] = t24, $[78] = t25) : (t24 = $[77], t25 = $[78]), useEffect(t24, t25);
273
+ }, t25 = [handleIsOpenChange, showTooltip], $[57] = handleIsOpenChange, $[58] = showTooltip, $[59] = t24, $[60] = t25) : (t24 = $[59], t25 = $[60]), useEffect(t24, t25);
277
274
  let t26;
278
- $[79] !== boundaryElement || $[80] !== portalElement?.offsetWidth ? (t26 = () => {
275
+ $[61] !== boundaryElement || $[62] !== portalElement?.offsetWidth ? (t26 = () => {
279
276
  let availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
280
277
  setTooltipMaxWidth(Math.min(...availableWidths) - 8);
281
- }, $[79] = boundaryElement, $[80] = portalElement?.offsetWidth, $[81] = t26) : t26 = $[81];
278
+ }, $[61] = boundaryElement, $[62] = portalElement?.offsetWidth, $[63] = t26) : t26 = $[63];
282
279
  let t27;
283
- $[82] !== boundaryElement || $[83] !== portalElement ? (t27 = [boundaryElement, portalElement], $[82] = boundaryElement, $[83] = portalElement, $[84] = t27) : t27 = $[84], useLayoutEffect(t26, t27);
280
+ $[64] !== boundaryElement || $[65] !== portalElement ? (t27 = [boundaryElement, portalElement], $[64] = boundaryElement, $[65] = portalElement, $[66] = t27) : t27 = $[66], useLayoutEffect(t26, t27);
284
281
  let t28;
285
- $[85] === update ? t28 = $[86] : (t28 = (arrowEl) => {
282
+ $[67] === update ? t28 = $[68] : (t28 = (arrowEl) => {
286
283
  arrowRef.current = arrowEl, update();
287
- }, $[85] = update, $[86] = t28);
284
+ }, $[67] = update, $[68] = t28);
288
285
  let setArrow = t28, t29;
289
- $[87] === refs ? t29 = $[88] : (t29 = (node) => {
286
+ $[69] === refs ? t29 = $[70] : (t29 = (node) => {
290
287
  ref.current = node, refs.setFloating(node);
291
- }, $[87] = refs, $[88] = t29);
288
+ }, $[69] = refs, $[70] = t29);
292
289
  let setFloating = t29, t30;
293
290
  bb0: {
294
291
  if (!childProp) {
@@ -296,7 +293,7 @@ function Tooltip(props) {
296
293
  break bb0;
297
294
  }
298
295
  let t31;
299
- $[89] !== childProp || $[90] !== handleBlur || $[91] !== handleClick || $[92] !== handleContextMenu || $[93] !== handleFocus || $[94] !== handleMouseEnter || $[95] !== handleMouseLeave ? (t31 = cloneElement(childProp, {
296
+ $[71] !== childProp || $[72] !== handleBlur || $[73] !== handleClick || $[74] !== handleContextMenu || $[75] !== handleFocus || $[76] !== handleMouseEnter || $[77] !== handleMouseLeave ? (t31 = cloneElement(childProp, {
300
297
  onBlur: handleBlur,
301
298
  onFocus: handleFocus,
302
299
  onMouseEnter: handleMouseEnter,
@@ -304,23 +301,23 @@ function Tooltip(props) {
304
301
  onClick: handleClick,
305
302
  onContextMenu: handleContextMenu,
306
303
  ref: setReferenceElement
307
- }), $[89] = childProp, $[90] = handleBlur, $[91] = handleClick, $[92] = handleContextMenu, $[93] = handleFocus, $[94] = handleMouseEnter, $[95] = handleMouseLeave, $[96] = t31) : t31 = $[96], t30 = t31;
304
+ }), $[71] = childProp, $[72] = handleBlur, $[73] = handleClick, $[74] = handleContextMenu, $[75] = handleFocus, $[76] = handleMouseEnter, $[77] = handleMouseLeave, $[78] = t31) : t31 = $[78], t30 = t31;
308
305
  }
309
306
  let child = t30, t31;
310
- $[97] === childProp ? t31 = $[98] : (t31 = childProp ? getElementRef(childProp) : null, $[97] = childProp, $[98] = t31);
307
+ $[79] === childProp ? t31 = $[80] : (t31 = childProp ? getElementRef(childProp) : null, $[79] = childProp, $[80] = t31);
311
308
  let t32, t33;
312
- if ($[99] === referenceElement ? (t32 = $[100], t33 = $[101]) : (t32 = () => referenceElement, t33 = [referenceElement], $[99] = referenceElement, $[100] = t32, $[101] = t33), useImperativeHandle(t31, t32, t33), !child) {
309
+ if ($[81] === referenceElement ? (t32 = $[82], t33 = $[83]) : (t32 = () => referenceElement, t33 = [referenceElement], $[81] = referenceElement, $[82] = t32, $[83] = t33), useImperativeHandle(t31, t32, t33), !child) {
313
310
  let t34;
314
- return $[102] === Symbol.for("react.memo_cache_sentinel") ? (t34 = /* @__PURE__ */ jsx(Fragment$1, {}), $[102] = t34) : t34 = $[102], t34;
311
+ return $[84] === Symbol.for("react.memo_cache_sentinel") ? (t34 = /* @__PURE__ */ jsx(Fragment$1, {}), $[84] = t34) : t34 = $[84], t34;
315
312
  }
316
313
  if (disabled) return child;
317
- let t34 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0, t35;
318
- $[103] !== floatingStyles || $[104] !== t34 ? (t35 = {
314
+ let T0 = Layer, t35 = clsx(tooltipLayer, restProps.className), t36 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0, t37;
315
+ $[85] !== floatingStyles || $[86] !== t36 ? (t37 = {
319
316
  ...floatingStyles,
320
- maxWidth: t34
321
- }, $[103] = floatingStyles, $[104] = t34, $[105] = t35) : t35 = $[105];
322
- let t36;
323
- $[106] !== animate || $[107] !== arrowProp || $[108] !== arrowX || $[109] !== arrowY || $[110] !== content || $[111] !== originX || $[112] !== originY || $[113] !== padding || $[114] !== placement || $[115] !== radius || $[116] !== restProps || $[117] !== scheme || $[118] !== setArrow || $[119] !== setFloating || $[120] !== shadow ? (t36 = /* @__PURE__ */ jsx(TooltipCard, {
317
+ maxWidth: t36
318
+ }, $[85] = floatingStyles, $[86] = t36, $[87] = t37) : t37 = $[87];
319
+ let t38;
320
+ $[88] !== animate || $[89] !== arrowProp || $[90] !== arrowX || $[91] !== arrowY || $[92] !== content || $[93] !== originX || $[94] !== originY || $[95] !== padding || $[96] !== placement || $[97] !== radius || $[98] !== restProps || $[99] !== scheme || $[100] !== setArrow || $[101] !== setFloating || $[102] !== shadow ? (t38 = /* @__PURE__ */ jsx(TooltipCard, {
324
321
  ...restProps,
325
322
  animate,
326
323
  arrow: arrowProp,
@@ -336,32 +333,33 @@ function Tooltip(props) {
336
333
  scheme,
337
334
  shadow,
338
335
  children: content
339
- }), $[106] = animate, $[107] = arrowProp, $[108] = arrowX, $[109] = arrowY, $[110] = content, $[111] = originX, $[112] = originY, $[113] = padding, $[114] = placement, $[115] = radius, $[116] = restProps, $[117] = scheme, $[118] = setArrow, $[119] = setFloating, $[120] = shadow, $[121] = t36) : t36 = $[121];
340
- let t37;
341
- $[122] !== restProps || $[123] !== setFloating || $[124] !== t35 || $[125] !== t36 || $[126] !== zOffset ? (t37 = /* @__PURE__ */ jsx(StyledTooltip, {
336
+ }), $[88] = animate, $[89] = arrowProp, $[90] = arrowX, $[91] = arrowY, $[92] = content, $[93] = originX, $[94] = originY, $[95] = padding, $[96] = placement, $[97] = radius, $[98] = restProps, $[99] = scheme, $[100] = setArrow, $[101] = setFloating, $[102] = shadow, $[103] = t38) : t38 = $[103];
337
+ let t39;
338
+ $[104] !== T0 || $[105] !== restProps || $[106] !== setFloating || $[107] !== t35 || $[108] !== t37 || $[109] !== t38 || $[110] !== zOffset ? (t39 = /* @__PURE__ */ jsx(T0, {
342
339
  "data-ui": "Tooltip",
343
340
  ...restProps,
341
+ className: t35,
344
342
  ref: setFloating,
345
- style: t35,
343
+ style: t37,
346
344
  zOffset,
347
- children: t36
348
- }), $[122] = restProps, $[123] = setFloating, $[124] = t35, $[125] = t36, $[126] = zOffset, $[127] = t37) : t37 = $[127];
349
- let tooltip = t37, t38;
350
- $[128] !== portalProp || $[129] !== tooltip ? (t38 = portalProp ? /* @__PURE__ */ jsx(Portal, {
345
+ children: t38
346
+ }), $[104] = T0, $[105] = restProps, $[106] = setFloating, $[107] = t35, $[108] = t37, $[109] = t38, $[110] = zOffset, $[111] = t39) : t39 = $[111];
347
+ let tooltip = t39, t40;
348
+ $[112] !== portalProp || $[113] !== tooltip ? (t40 = portalProp ? /* @__PURE__ */ jsx(Portal, {
351
349
  __unstable_name: typeof portalProp == "string" ? portalProp : void 0,
352
350
  children: tooltip
353
- }) : tooltip, $[128] = portalProp, $[129] = tooltip, $[130] = t38) : t38 = $[130];
354
- let tooltipNode = t38, t39;
355
- $[131] !== animate || $[132] !== showTooltip || $[133] !== tooltipNode ? (t39 = animate ? /* @__PURE__ */ jsx(AnimateActivity, {
351
+ }) : tooltip, $[112] = portalProp, $[113] = tooltip, $[114] = t40) : t40 = $[114];
352
+ let tooltipNode = t40, t41;
353
+ $[115] !== animate || $[116] !== showTooltip || $[117] !== tooltipNode ? (t41 = animate ? /* @__PURE__ */ jsx(AnimateActivity, {
356
354
  layoutMode: "default",
357
355
  mode: showTooltip ? "visible" : "hidden",
358
356
  children: tooltipNode
359
357
  }) : /* @__PURE__ */ jsx(Activity, {
360
358
  mode: showTooltip ? "visible" : "hidden",
361
359
  children: tooltipNode
362
- }), $[131] = animate, $[132] = showTooltip, $[133] = tooltipNode, $[134] = t39) : t39 = $[134];
363
- let t40;
364
- return $[135] !== child || $[136] !== t39 ? (t40 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t39, child] }), $[135] = child, $[136] = t39, $[137] = t40) : t40 = $[137], t40;
360
+ }), $[115] = animate, $[116] = showTooltip, $[117] = tooltipNode, $[118] = t41) : t41 = $[118];
361
+ let t42;
362
+ return $[119] !== child || $[120] !== t41 ? (t42 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t41, child] }), $[119] = child, $[120] = t41, $[121] = t42) : t42 = $[121], t42;
365
363
  }
366
364
  function useMiddleware(t0) {
367
365
  let $ = c(17), { animate, arrowProp, arrowRef, boundaryElement, fallbackPlacements, rootBoundary } = t0, ret;