@sanity/ui 1.7.11 → 1.7.12
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/dist/index.esm.js +34 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +33 -23
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/primitives/tooltip/tooltip.tsx +22 -11
package/dist/index.js
CHANGED
|
@@ -6890,11 +6890,28 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6890
6890
|
boundary: boundaryElement || void 0,
|
|
6891
6891
|
fallbackPlacements,
|
|
6892
6892
|
padding: 4,
|
|
6893
|
-
rootBoundary
|
|
6893
|
+
rootBoundary,
|
|
6894
|
+
mainAxis: false
|
|
6894
6895
|
}));
|
|
6895
6896
|
ret.push(reactDom$1.offset({
|
|
6896
6897
|
mainAxis: 3
|
|
6897
6898
|
}));
|
|
6899
|
+
ret.push(reactDom$1.size({
|
|
6900
|
+
apply(_ref22) {
|
|
6901
|
+
let {
|
|
6902
|
+
availableWidth,
|
|
6903
|
+
availableHeight,
|
|
6904
|
+
elements
|
|
6905
|
+
} = _ref22;
|
|
6906
|
+
Object.assign(elements.floating.style, {
|
|
6907
|
+
maxWidth: "".concat(availableWidth - 4 * 2, "px"),
|
|
6908
|
+
// the padding is `4px`
|
|
6909
|
+
maxHeight: "".concat(availableHeight - 4 * 2, "px")
|
|
6910
|
+
// the padding is `4px`
|
|
6911
|
+
});
|
|
6912
|
+
}
|
|
6913
|
+
}));
|
|
6914
|
+
|
|
6898
6915
|
ret.push(reactDom$1.shift({
|
|
6899
6916
|
boundary: boundaryElement || void 0,
|
|
6900
6917
|
rootBoundary,
|
|
@@ -6907,23 +6924,16 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6907
6924
|
return ret;
|
|
6908
6925
|
}, [boundaryElement, fallbackPlacements]);
|
|
6909
6926
|
const {
|
|
6910
|
-
|
|
6911
|
-
y,
|
|
6927
|
+
floatingStyles,
|
|
6912
6928
|
placement,
|
|
6913
6929
|
middlewareData,
|
|
6914
6930
|
refs,
|
|
6915
|
-
update
|
|
6916
|
-
strategy
|
|
6931
|
+
update
|
|
6917
6932
|
} = reactDom$1.useFloating({
|
|
6918
6933
|
middleware,
|
|
6919
6934
|
placement: placementProp,
|
|
6920
6935
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
6921
6936
|
});
|
|
6922
|
-
const rootStyle = react.useMemo(() => ({
|
|
6923
|
-
position: strategy,
|
|
6924
|
-
top: y != null ? y : 0,
|
|
6925
|
-
left: x != null ? x : 0
|
|
6926
|
-
}), [strategy, x, y]);
|
|
6927
6937
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
6928
6938
|
const arrowX = (_b = middlewareData.arrow) == null ? void 0 : _b.x;
|
|
6929
6939
|
const arrowY = (_c = middlewareData.arrow) == null ? void 0 : _c.y;
|
|
@@ -6997,7 +7007,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6997
7007
|
"data-ui": "Tooltip",
|
|
6998
7008
|
...restProps,
|
|
6999
7009
|
ref: setFloating,
|
|
7000
|
-
style:
|
|
7010
|
+
style: floatingStyles,
|
|
7001
7011
|
zOffset,
|
|
7002
7012
|
children: /* @__PURE__ */jsxRuntime.jsxs(Card, {
|
|
7003
7013
|
"data-ui": "Tooltip__card",
|
|
@@ -7175,10 +7185,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7175
7185
|
query,
|
|
7176
7186
|
value
|
|
7177
7187
|
} = state;
|
|
7178
|
-
const defaultRenderOption = react.useCallback(
|
|
7188
|
+
const defaultRenderOption = react.useCallback(_ref23 => {
|
|
7179
7189
|
let {
|
|
7180
7190
|
value: value2
|
|
7181
|
-
} =
|
|
7191
|
+
} = _ref23;
|
|
7182
7192
|
return /* @__PURE__ */jsxRuntime.jsx(Card, {
|
|
7183
7193
|
"data-as": "button",
|
|
7184
7194
|
padding: paddingProp,
|
|
@@ -7631,10 +7641,10 @@ const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
7631
7641
|
}, itemIndex))
|
|
7632
7642
|
});
|
|
7633
7643
|
});
|
|
7634
|
-
function dialogStyle(
|
|
7644
|
+
function dialogStyle(_ref24) {
|
|
7635
7645
|
let {
|
|
7636
7646
|
theme
|
|
7637
|
-
} =
|
|
7647
|
+
} = _ref24;
|
|
7638
7648
|
const color = theme.sanity.color.base;
|
|
7639
7649
|
return {
|
|
7640
7650
|
"&:not([hidden])": {
|
|
@@ -8696,15 +8706,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
8696
8706
|
var _a$6, _b$3, _c$1, _d;
|
|
8697
8707
|
const keyframe = styled.keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
8698
8708
|
const animation = styled.css(_b$3 || (_b$3 = __template$6(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
|
|
8699
|
-
const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])),
|
|
8709
|
+
const skeletonStyle = styled.css(_d || (_d = __template$6(["\n opacity: ", ";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ", "\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])), _ref25 => {
|
|
8700
8710
|
let {
|
|
8701
8711
|
$visible
|
|
8702
|
-
} =
|
|
8712
|
+
} = _ref25;
|
|
8703
8713
|
return $visible ? 1 : 0;
|
|
8704
|
-
},
|
|
8714
|
+
}, _ref26 => {
|
|
8705
8715
|
let {
|
|
8706
8716
|
$animated
|
|
8707
|
-
} =
|
|
8717
|
+
} = _ref26;
|
|
8708
8718
|
return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8709
8719
|
});
|
|
8710
8720
|
const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -8735,12 +8745,12 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
|
8735
8745
|
ref
|
|
8736
8746
|
});
|
|
8737
8747
|
});
|
|
8738
|
-
const Root$3 = styled__default.default(Skeleton)(
|
|
8748
|
+
const Root$3 = styled__default.default(Skeleton)(_ref27 => {
|
|
8739
8749
|
let {
|
|
8740
8750
|
$size,
|
|
8741
8751
|
$style,
|
|
8742
8752
|
theme
|
|
8743
|
-
} =
|
|
8753
|
+
} = _ref27;
|
|
8744
8754
|
const {
|
|
8745
8755
|
media
|
|
8746
8756
|
} = theme.sanity;
|
|
@@ -9087,12 +9097,12 @@ function ToastProvider(props) {
|
|
|
9087
9097
|
paddingY,
|
|
9088
9098
|
children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
|
|
9089
9099
|
initial: false,
|
|
9090
|
-
children: state.map(
|
|
9100
|
+
children: state.map(_ref28 => {
|
|
9091
9101
|
let {
|
|
9092
9102
|
dismiss,
|
|
9093
9103
|
id,
|
|
9094
9104
|
params
|
|
9095
|
-
} =
|
|
9105
|
+
} = _ref28;
|
|
9096
9106
|
return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
|
|
9097
9107
|
animate: {
|
|
9098
9108
|
opacity: 1,
|