@sanity/ui 3.0.0-static.5 → 3.0.0-static.6

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.
@@ -135,6 +135,10 @@ const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslT
135
135
  visualDuration: 0.2,
136
136
  bounce: 0.25
137
137
  }
138
+ }, Z_OFFSETS = {
139
+ dialog: 600,
140
+ popover: 400,
141
+ tooltip: 200
138
142
  };
139
143
  function _isEnterToClickElement(element) {
140
144
  return isHTMLAnchorElement(element) || isHTMLButtonElement(element);
@@ -945,7 +949,7 @@ const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
945
949
  weight,
946
950
  ...restProps
947
951
  } = props, $[0] = props, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = weight) : (children = $[1], className = $[2], languageProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], weight = $[7]);
948
- const As = t0 === void 0 ? "pre" : t0, size2 = t1 === void 0 ? 1 : t1, language = typeof languageProp == "string" ? languageProp : void 0;
952
+ const As = t0 === void 0 ? "pre" : t0, size2 = t1 === void 0 ? 2 : t1, language = typeof languageProp == "string" ? languageProp : void 0;
949
953
  let t2;
950
954
  $[8] !== className || $[9] !== size2 || $[10] !== weight ? (t2 = css.composeClassNames(className, css.code({
951
955
  size: size2,
@@ -1781,6 +1785,7 @@ const ViewportOverlay = () => {
1781
1785
  __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
1782
1786
  animate: _animate = !1,
1783
1787
  arrow: arrowProp = !1,
1788
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1784
1789
  boundaryElement = boundaryElementContext.element,
1785
1790
  children: childProp,
1786
1791
  constrainSize = !1,
@@ -1806,7 +1811,7 @@ const ViewportOverlay = () => {
1806
1811
  tone = "inherit",
1807
1812
  width: widthProp = "auto",
1808
1813
  // zOffset: zOffsetProp = layer.popover.zOffset,
1809
- zOffset: zOffsetProp,
1814
+ zOffset: zOffsetProp = Z_OFFSETS.popover,
1810
1815
  updateRef,
1811
1816
  ...restProps
1812
1817
  } = props, animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useArrayProp(zOffsetProp), ref = react.useRef(null), arrowRef = react.useRef(null), rootBoundary = "viewport";
@@ -2122,7 +2127,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
2122
2127
  __unstable_disableFocusRing = t72, t0 = t82, className = t92, clearButton = t102, t1 = t112, t2 = t122, gap = t132, IconComponent = t142, IconRightComponent = t152, onClear = t162, t3 = t172, prefix = t182, t4 = t192, readOnly = t202, t5 = t212, suffix = t222, customValidity = t232, t6 = t242, width = t252, restProps = t262, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = gap, $[8] = onClear, $[9] = prefix, $[10] = readOnly, $[11] = restProps, $[12] = suffix, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = width;
2123
2128
  } else
2124
2129
  IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], gap = $[7], onClear = $[8], prefix = $[9], readOnly = $[10], restProps = $[11], suffix = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], width = $[20];
2125
- const border = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, space = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = react.useRef(null), paddingArray = useArrayProp(padding), withClearButton = !!clearButton;
2130
+ const border = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, space = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = react.useRef(null), paddingArray = useArrayProp(padding), withClearButton = !!clearButton;
2126
2131
  let t7;
2127
2132
  $[21] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[21] = t7) : t7 = $[21], react.useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
2128
2133
  const handleClearMouseDown = _temp;
@@ -2323,8 +2328,6 @@ function useTooltipDelayGroup() {
2323
2328
  }
2324
2329
  const Tooltip = react.forwardRef(function(props, forwardedRef) {
2325
2330
  const boundaryElementContext = useBoundaryElement(), {
2326
- layer
2327
- } = useTheme_v2(), {
2328
2331
  animate: _animate = !1,
2329
2332
  arrow: arrowProp = !1,
2330
2333
  boundaryElement = boundaryElementContext?.element,
@@ -2340,7 +2343,7 @@ const Tooltip = react.forwardRef(function(props, forwardedRef) {
2340
2343
  radius = 3,
2341
2344
  scheme,
2342
2345
  shadow = 2,
2343
- zOffset = layer.tooltip.zOffset,
2346
+ zOffset = Z_OFFSETS.tooltip,
2344
2347
  tone,
2345
2348
  ...restProps
2346
2349
  } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = react.useRef(null), [referenceElement, setReferenceElement] = react.useState(null), arrowRef = react.useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = react.useState(0);
@@ -3090,6 +3093,7 @@ exports.Tooltip = Tooltip;
3090
3093
  exports.TooltipDelayGroupContext = TooltipDelayGroupContext;
3091
3094
  exports.TooltipDelayGroupProvider = TooltipDelayGroupProvider;
3092
3095
  exports.VirtualList = VirtualList;
3096
+ exports.Z_OFFSETS = Z_OFFSETS;
3093
3097
  exports._ResizeObserver = _ResizeObserver;
3094
3098
  exports._elementSizeObserver = _elementSizeObserver;
3095
3099
  exports._getArrayProp = _getArrayProp;