@sanity/ui 1.7.9 → 1.7.11
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.d.ts +351 -15
- package/dist/index.esm.js +44 -47
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +43 -46
- package/dist/index.js.map +1 -1
- package/package.json +20 -19
- package/src/components/dialog/styles.ts +1 -1
- package/src/components/menu/__workshop__/shouldFocus.tsx +1 -1
- package/src/components/menu/menuDivider.ts +2 -3
- package/src/components/menu/menuGroup.tsx +1 -1
- package/src/components/tree/style.ts +4 -4
- package/src/primitives/_selectable/style.ts +3 -3
- package/src/primitives/avatar/styles.ts +6 -3
- package/src/primitives/badge/styles.ts +1 -1
- package/src/primitives/box/box.tsx +1 -0
- package/src/primitives/button/styles.ts +3 -2
- package/src/primitives/card/styles.ts +4 -4
- package/src/primitives/checkbox/styles.ts +3 -3
- package/src/primitives/code/styles.ts +3 -5
- package/src/primitives/container/styles.ts +1 -1
- package/src/primitives/flex/flex.tsx +1 -0
- package/src/primitives/heading/styles.ts +2 -4
- package/src/primitives/inline/inline.tsx +8 -1
- package/src/primitives/inline/styles.ts +1 -1
- package/src/primitives/label/styles.ts +2 -2
- package/src/primitives/popover/popover.tsx +2 -0
- package/src/primitives/radio/styles.ts +3 -3
- package/src/primitives/select/styles.ts +6 -5
- package/src/primitives/stack/styles.ts +1 -1
- package/src/primitives/switch/styles.ts +6 -6
- package/src/primitives/text/styles.ts +2 -2
- package/src/primitives/tooltip/tooltip.tsx +11 -22
- package/src/styles/border/borderStyle.ts +1 -1
- package/src/styles/box/boxStyle.ts +1 -1
- package/src/styles/colorVars/colorVarsStyle.ts +1 -1
- package/src/styles/flex/flexItemStyle.ts +1 -1
- package/src/styles/flex/flexStyle.ts +1 -1
- package/src/styles/font/codeFontStyle.ts +1 -1
- package/src/styles/font/headingFontStyle.ts +1 -1
- package/src/styles/font/labelFontStyle.ts +1 -1
- package/src/styles/font/responsiveFont.ts +1 -1
- package/src/styles/font/textAlignStyle.ts +1 -1
- package/src/styles/font/textFontStyle.ts +1 -1
- package/src/styles/grid/gridItemStyle.ts +1 -1
- package/src/styles/grid/gridStyle.ts +1 -1
- package/src/styles/helpers.ts +1 -1
- package/src/styles/input/responsiveInputPaddingStyle.ts +1 -1
- package/src/styles/input/textInputStyle.ts +5 -4
- package/src/styles/margin/marginStyle.ts +1 -1
- package/src/styles/padding/paddingStyle.ts +1 -1
- package/src/styles/radius/radiusStyle.ts +1 -1
- package/src/styles/shadow/shadowStyle.ts +1 -1
- package/src/theme/types.ts +1 -1
- package/src/types/index.ts +1 -0
- package/src/types/styled.ts +9 -0
package/dist/index.js
CHANGED
|
@@ -3996,6 +3996,7 @@ function avatarArrowStyle() {
|
|
|
3996
3996
|
top: "-5px",
|
|
3997
3997
|
left: "50%",
|
|
3998
3998
|
transform: "translateX(-6px)",
|
|
3999
|
+
// @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
|
|
3999
4000
|
"&:not([hidden])": {
|
|
4000
4001
|
display: "block"
|
|
4001
4002
|
}
|
|
@@ -4032,13 +4033,14 @@ function avatarRootStyle(props) {
|
|
|
4032
4033
|
opacity: 0.5
|
|
4033
4034
|
},
|
|
4034
4035
|
"&>svg": {
|
|
4036
|
+
// @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
|
|
4035
4037
|
"&:not([hidden])": {
|
|
4036
4038
|
display: "block"
|
|
4037
4039
|
}
|
|
4038
4040
|
},
|
|
4039
4041
|
/* &:is(button) */
|
|
4040
4042
|
'&[data-as="button"]': {
|
|
4041
|
-
|
|
4043
|
+
WebkitFontSmoothing: "inherit",
|
|
4042
4044
|
appearance: "none",
|
|
4043
4045
|
margin: 0,
|
|
4044
4046
|
padding: 0,
|
|
@@ -4046,6 +4048,7 @@ function avatarRootStyle(props) {
|
|
|
4046
4048
|
font: "inherit",
|
|
4047
4049
|
color: "inherit",
|
|
4048
4050
|
outline: "none",
|
|
4051
|
+
// @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
|
|
4049
4052
|
"&:focus": {
|
|
4050
4053
|
boxShadow: focusRingStyle({
|
|
4051
4054
|
focusRing
|
|
@@ -4110,7 +4113,7 @@ function avatarStrokeStyle() {
|
|
|
4110
4113
|
return {
|
|
4111
4114
|
strokeWidth: "3px",
|
|
4112
4115
|
'[data-status="editing"] &': {
|
|
4113
|
-
|
|
4116
|
+
strokeDasharray: "2 4",
|
|
4114
4117
|
strokeLinecap: "round"
|
|
4115
4118
|
}
|
|
4116
4119
|
};
|
|
@@ -4527,17 +4530,21 @@ const Flex = react.forwardRef(function Flex2(props, ref) {
|
|
|
4527
4530
|
wrap,
|
|
4528
4531
|
...restProps
|
|
4529
4532
|
} = props;
|
|
4530
|
-
return
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
$
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4533
|
+
return (
|
|
4534
|
+
// @ts-expect-error -- some dollar prefixed typings aren't inferred correctly https://github.com/styled-components/styled-components/issues/4062
|
|
4535
|
+
/* @__PURE__ */
|
|
4536
|
+
jsxRuntime.jsx(Root$x, {
|
|
4537
|
+
"data-ui": "Flex",
|
|
4538
|
+
...restProps,
|
|
4539
|
+
$align: useArrayProp(align),
|
|
4540
|
+
$direction: useArrayProp(direction),
|
|
4541
|
+
$gap: useArrayProp(gap),
|
|
4542
|
+
$justify: useArrayProp(justify),
|
|
4543
|
+
$wrap: useArrayProp(wrap),
|
|
4544
|
+
forwardedAs: as,
|
|
4545
|
+
ref
|
|
4546
|
+
})
|
|
4547
|
+
);
|
|
4541
4548
|
});
|
|
4542
4549
|
var __freeze$w = Object.freeze;
|
|
4543
4550
|
var __defProp$x = Object.defineProperty;
|
|
@@ -6883,28 +6890,11 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6883
6890
|
boundary: boundaryElement || void 0,
|
|
6884
6891
|
fallbackPlacements,
|
|
6885
6892
|
padding: 4,
|
|
6886
|
-
rootBoundary
|
|
6887
|
-
mainAxis: false
|
|
6893
|
+
rootBoundary
|
|
6888
6894
|
}));
|
|
6889
6895
|
ret.push(reactDom$1.offset({
|
|
6890
6896
|
mainAxis: 3
|
|
6891
6897
|
}));
|
|
6892
|
-
ret.push(reactDom$1.size({
|
|
6893
|
-
apply(_ref22) {
|
|
6894
|
-
let {
|
|
6895
|
-
availableWidth,
|
|
6896
|
-
availableHeight,
|
|
6897
|
-
elements
|
|
6898
|
-
} = _ref22;
|
|
6899
|
-
Object.assign(elements.floating.style, {
|
|
6900
|
-
maxWidth: "".concat(availableWidth - 4 * 2, "px"),
|
|
6901
|
-
// the padding is `4px`
|
|
6902
|
-
maxHeight: "".concat(availableHeight - 4 * 2, "px")
|
|
6903
|
-
// the padding is `4px`
|
|
6904
|
-
});
|
|
6905
|
-
}
|
|
6906
|
-
}));
|
|
6907
|
-
|
|
6908
6898
|
ret.push(reactDom$1.shift({
|
|
6909
6899
|
boundary: boundaryElement || void 0,
|
|
6910
6900
|
rootBoundary,
|
|
@@ -6917,16 +6907,23 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
6917
6907
|
return ret;
|
|
6918
6908
|
}, [boundaryElement, fallbackPlacements]);
|
|
6919
6909
|
const {
|
|
6920
|
-
|
|
6910
|
+
x,
|
|
6911
|
+
y,
|
|
6921
6912
|
placement,
|
|
6922
6913
|
middlewareData,
|
|
6923
6914
|
refs,
|
|
6924
|
-
update
|
|
6915
|
+
update,
|
|
6916
|
+
strategy
|
|
6925
6917
|
} = reactDom$1.useFloating({
|
|
6926
6918
|
middleware,
|
|
6927
6919
|
placement: placementProp,
|
|
6928
6920
|
whileElementsMounted: reactDom$1.autoUpdate
|
|
6929
6921
|
});
|
|
6922
|
+
const rootStyle = react.useMemo(() => ({
|
|
6923
|
+
position: strategy,
|
|
6924
|
+
top: y != null ? y : 0,
|
|
6925
|
+
left: x != null ? x : 0
|
|
6926
|
+
}), [strategy, x, y]);
|
|
6930
6927
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
6931
6928
|
const arrowX = (_b = middlewareData.arrow) == null ? void 0 : _b.x;
|
|
6932
6929
|
const arrowY = (_c = middlewareData.arrow) == null ? void 0 : _c.y;
|
|
@@ -7000,7 +6997,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
7000
6997
|
"data-ui": "Tooltip",
|
|
7001
6998
|
...restProps,
|
|
7002
6999
|
ref: setFloating,
|
|
7003
|
-
style:
|
|
7000
|
+
style: rootStyle,
|
|
7004
7001
|
zOffset,
|
|
7005
7002
|
children: /* @__PURE__ */jsxRuntime.jsxs(Card, {
|
|
7006
7003
|
"data-ui": "Tooltip__card",
|
|
@@ -7178,10 +7175,10 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
7178
7175
|
query,
|
|
7179
7176
|
value
|
|
7180
7177
|
} = state;
|
|
7181
|
-
const defaultRenderOption = react.useCallback(
|
|
7178
|
+
const defaultRenderOption = react.useCallback(_ref22 => {
|
|
7182
7179
|
let {
|
|
7183
7180
|
value: value2
|
|
7184
|
-
} =
|
|
7181
|
+
} = _ref22;
|
|
7185
7182
|
return /* @__PURE__ */jsxRuntime.jsx(Card, {
|
|
7186
7183
|
"data-as": "button",
|
|
7187
7184
|
padding: paddingProp,
|
|
@@ -7634,10 +7631,10 @@ const Breadcrumbs = react.forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
7634
7631
|
}, itemIndex))
|
|
7635
7632
|
});
|
|
7636
7633
|
});
|
|
7637
|
-
function dialogStyle(
|
|
7634
|
+
function dialogStyle(_ref23) {
|
|
7638
7635
|
let {
|
|
7639
7636
|
theme
|
|
7640
|
-
} =
|
|
7637
|
+
} = _ref23;
|
|
7641
7638
|
const color = theme.sanity.color.base;
|
|
7642
7639
|
return {
|
|
7643
7640
|
"&:not([hidden])": {
|
|
@@ -8699,15 +8696,15 @@ var __template$6 = (cooked, raw) => __freeze$6(__defProp$6(cooked, "raw", {
|
|
|
8699
8696
|
var _a$6, _b$3, _c$1, _d;
|
|
8700
8697
|
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"])));
|
|
8701
8698
|
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);
|
|
8702
|
-
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"])),
|
|
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"])), _ref24 => {
|
|
8703
8700
|
let {
|
|
8704
8701
|
$visible
|
|
8705
|
-
} =
|
|
8702
|
+
} = _ref24;
|
|
8706
8703
|
return $visible ? 1 : 0;
|
|
8707
|
-
},
|
|
8704
|
+
}, _ref25 => {
|
|
8708
8705
|
let {
|
|
8709
8706
|
$animated
|
|
8710
|
-
} =
|
|
8707
|
+
} = _ref25;
|
|
8711
8708
|
return $animated ? animation : styled.css(_c$1 || (_c$1 = __template$6(["\n background-color: var(--card-skeleton-color-from);\n "])));
|
|
8712
8709
|
});
|
|
8713
8710
|
const Root$4 = styled__default.default(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
@@ -8738,12 +8735,12 @@ const Skeleton = react.forwardRef(function Skeleton2(props, ref) {
|
|
|
8738
8735
|
ref
|
|
8739
8736
|
});
|
|
8740
8737
|
});
|
|
8741
|
-
const Root$3 = styled__default.default(Skeleton)(
|
|
8738
|
+
const Root$3 = styled__default.default(Skeleton)(_ref26 => {
|
|
8742
8739
|
let {
|
|
8743
8740
|
$size,
|
|
8744
8741
|
$style,
|
|
8745
8742
|
theme
|
|
8746
|
-
} =
|
|
8743
|
+
} = _ref26;
|
|
8747
8744
|
const {
|
|
8748
8745
|
media
|
|
8749
8746
|
} = theme.sanity;
|
|
@@ -9090,12 +9087,12 @@ function ToastProvider(props) {
|
|
|
9090
9087
|
paddingY,
|
|
9091
9088
|
children: /* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
|
|
9092
9089
|
initial: false,
|
|
9093
|
-
children: state.map(
|
|
9090
|
+
children: state.map(_ref27 => {
|
|
9094
9091
|
let {
|
|
9095
9092
|
dismiss,
|
|
9096
9093
|
id,
|
|
9097
9094
|
params
|
|
9098
|
-
} =
|
|
9095
|
+
} = _ref27;
|
|
9099
9096
|
return /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.div, {
|
|
9100
9097
|
animate: {
|
|
9101
9098
|
opacity: 1,
|