@sanity/ui 1.9.1 → 1.9.2
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 +37 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +36 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/primitives/tooltip/__workshop__/index.ts +0 -10
- package/src/primitives/tooltip/constants.ts +0 -1
- package/src/primitives/tooltip/tooltip.tsx +21 -10
- package/src/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -53
- package/src/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -85
package/dist/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import styled, { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css,
|
|
|
5
5
|
import { white as white$1, black as black$1, hues } from '@sanity/color';
|
|
6
6
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, SelectIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon } from '@sanity/icons';
|
|
7
7
|
import Refractor from 'react-refractor';
|
|
8
|
-
import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from '@floating-ui/react-dom';
|
|
8
|
+
import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate, size as size$2 } from '@floating-ui/react-dom';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
10
10
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
11
11
|
const EMPTY_ARRAY = [];
|
|
@@ -6847,7 +6847,6 @@ function useDelayedState(initialState) {
|
|
|
6847
6847
|
}, []);
|
|
6848
6848
|
return [state, onStateChange];
|
|
6849
6849
|
}
|
|
6850
|
-
const DEFAULT_TOOLTIP_PADDING = 4;
|
|
6851
6850
|
const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
6852
6851
|
top: ["bottom", "left", "right"],
|
|
6853
6852
|
"top-start": ["bottom-start", "left-start", "right-start"],
|
|
@@ -6931,7 +6930,7 @@ var __template$e = (cooked, raw) => __freeze$e(__defProp$e(cooked, "raw", {
|
|
|
6931
6930
|
value: __freeze$e(raw || cooked.slice())
|
|
6932
6931
|
}));
|
|
6933
6932
|
var _a$e;
|
|
6934
|
-
const Root$a = styled(Layer)(_a$e || (_a$e = __template$e(["\n pointer-events: none;\n
|
|
6933
|
+
const Root$a = styled(Layer)(_a$e || (_a$e = __template$e(["\n pointer-events: none;\n"])));
|
|
6935
6934
|
const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
6936
6935
|
var _a2, _b, _c, _d, _e;
|
|
6937
6936
|
const boundaryElementContext = useBoundaryElement();
|
|
@@ -6959,25 +6958,42 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
6959
6958
|
const middleware = useMemo(() => {
|
|
6960
6959
|
const ret = [];
|
|
6961
6960
|
ret.push(flip({
|
|
6962
|
-
boundary:
|
|
6961
|
+
boundary: boundaryElement || void 0,
|
|
6963
6962
|
fallbackPlacements,
|
|
6964
|
-
padding:
|
|
6965
|
-
rootBoundary
|
|
6963
|
+
padding: 4,
|
|
6964
|
+
rootBoundary,
|
|
6965
|
+
mainAxis: false
|
|
6966
6966
|
}));
|
|
6967
6967
|
ret.push(offset({
|
|
6968
6968
|
mainAxis: 3
|
|
6969
6969
|
}));
|
|
6970
|
+
ret.push(size$2({
|
|
6971
|
+
apply(_ref22) {
|
|
6972
|
+
let {
|
|
6973
|
+
availableWidth,
|
|
6974
|
+
availableHeight,
|
|
6975
|
+
elements
|
|
6976
|
+
} = _ref22;
|
|
6977
|
+
Object.assign(elements.floating.style, {
|
|
6978
|
+
maxWidth: "".concat(availableWidth - 4 * 2, "px"),
|
|
6979
|
+
// the padding is `4px`
|
|
6980
|
+
maxHeight: "".concat(availableHeight - 4 * 2, "px")
|
|
6981
|
+
// the padding is `4px`
|
|
6982
|
+
});
|
|
6983
|
+
}
|
|
6984
|
+
}));
|
|
6985
|
+
|
|
6970
6986
|
ret.push(shift({
|
|
6971
|
-
boundary:
|
|
6987
|
+
boundary: boundaryElement || void 0,
|
|
6972
6988
|
rootBoundary,
|
|
6973
|
-
padding:
|
|
6989
|
+
padding: 4
|
|
6974
6990
|
}));
|
|
6975
6991
|
ret.push(arrow({
|
|
6976
6992
|
element: arrowRef,
|
|
6977
6993
|
padding: 2
|
|
6978
6994
|
}));
|
|
6979
6995
|
return ret;
|
|
6980
|
-
}, [boundaryElement, fallbackPlacements
|
|
6996
|
+
}, [boundaryElement, fallbackPlacements]);
|
|
6981
6997
|
const {
|
|
6982
6998
|
floatingStyles,
|
|
6983
6999
|
placement,
|
|
@@ -7277,10 +7293,10 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7277
7293
|
query,
|
|
7278
7294
|
value
|
|
7279
7295
|
} = state;
|
|
7280
|
-
const defaultRenderOption = useCallback(
|
|
7296
|
+
const defaultRenderOption = useCallback(_ref23 => {
|
|
7281
7297
|
let {
|
|
7282
7298
|
value: value2
|
|
7283
|
-
} =
|
|
7299
|
+
} = _ref23;
|
|
7284
7300
|
return /* @__PURE__ */jsx(Card, {
|
|
7285
7301
|
"data-as": "button",
|
|
7286
7302
|
padding: paddingProp,
|
|
@@ -7733,10 +7749,10 @@ const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
7733
7749
|
}, itemIndex))
|
|
7734
7750
|
});
|
|
7735
7751
|
});
|
|
7736
|
-
function dialogStyle(
|
|
7752
|
+
function dialogStyle(_ref24) {
|
|
7737
7753
|
let {
|
|
7738
7754
|
theme
|
|
7739
|
-
} =
|
|
7755
|
+
} = _ref24;
|
|
7740
7756
|
const color = theme.sanity.color.base;
|
|
7741
7757
|
return {
|
|
7742
7758
|
"&:not([hidden])": {
|
|
@@ -8798,15 +8814,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
8798
8814
|
var _a$6, _b$3, _c$1, _d;
|
|
8799
8815
|
const keyframe = keyframes(_a$6 || (_a$6 = __template$6(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
8800
8816
|
const animation = 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);
|
|
8801
|
-
const skeletonStyle = 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"])),
|
|
8817
|
+
const skeletonStyle = 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 => {
|
|
8802
8818
|
let {
|
|
8803
8819
|
$visible
|
|
8804
|
-
} =
|
|
8820
|
+
} = _ref25;
|
|
8805
8821
|
return $visible ? 1 : 0;
|
|
8806
|
-
},
|
|
8822
|
+
}, _ref26 => {
|
|
8807
8823
|
let {
|
|
8808
8824
|
$animated
|
|
8809
|
-
} =
|
|
8825
|
+
} = _ref26;
|
|
8810
8826
|
return $animated ? animation : css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8811
8827
|
});
|
|
8812
8828
|
const Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -8837,12 +8853,12 @@ const Skeleton = forwardRef(function Skeleton2(props, ref) {
|
|
|
8837
8853
|
ref
|
|
8838
8854
|
});
|
|
8839
8855
|
});
|
|
8840
|
-
const Root$3 = styled(Skeleton)(
|
|
8856
|
+
const Root$3 = styled(Skeleton)(_ref27 => {
|
|
8841
8857
|
let {
|
|
8842
8858
|
$size,
|
|
8843
8859
|
$style,
|
|
8844
8860
|
theme
|
|
8845
|
-
} =
|
|
8861
|
+
} = _ref27;
|
|
8846
8862
|
const {
|
|
8847
8863
|
media
|
|
8848
8864
|
} = theme.sanity;
|
|
@@ -9189,12 +9205,12 @@ function ToastProvider(props) {
|
|
|
9189
9205
|
paddingY,
|
|
9190
9206
|
children: /* @__PURE__ */jsx(AnimatePresence, {
|
|
9191
9207
|
initial: false,
|
|
9192
|
-
children: state.map(
|
|
9208
|
+
children: state.map(_ref28 => {
|
|
9193
9209
|
let {
|
|
9194
9210
|
dismiss,
|
|
9195
9211
|
id,
|
|
9196
9212
|
params
|
|
9197
|
-
} =
|
|
9213
|
+
} = _ref28;
|
|
9198
9214
|
return /* @__PURE__ */jsx(motion.div, {
|
|
9199
9215
|
animate: {
|
|
9200
9216
|
opacity: 1,
|