@sanity/ui 2.0.0-alpha.21 → 2.0.0-alpha.22
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 +2 -0
- package/dist/index.esm.js +18 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/autocomplete/autocomplete.tsx +1 -1
- package/src/components/toast/toast.tsx +8 -3
- package/src/primitives/badge/styles.ts +3 -1
- package/src/primitives/tooltip/constants.ts +1 -0
- package/src/primitives/tooltip/tooltip.tsx +13 -5
package/dist/index.js
CHANGED
|
@@ -5333,7 +5333,8 @@ function badgeStyle(props) {
|
|
|
5333
5333
|
const palette = theme.sanity.color[$mode === "outline" ? "muted" : "solid"];
|
|
5334
5334
|
const color = palette[$tone] || palette.default;
|
|
5335
5335
|
return {
|
|
5336
|
-
|
|
5336
|
+
"--card-fg-color": color.enabled.fg,
|
|
5337
|
+
backgroundColor: color.enabled.bg2,
|
|
5337
5338
|
color: color.enabled.fg,
|
|
5338
5339
|
boxShadow: "inset 0 0 0 1px ".concat(color.enabled.border),
|
|
5339
5340
|
cursor: "default",
|
|
@@ -7816,6 +7817,7 @@ function useDelayedState(initialState) {
|
|
|
7816
7817
|
}, []);
|
|
7817
7818
|
return [state, onStateChange];
|
|
7818
7819
|
}
|
|
7820
|
+
const DEFAULT_TOOLTIP_DISTANCE = 4;
|
|
7819
7821
|
const DEFAULT_TOOLTIP_PADDING = 4;
|
|
7820
7822
|
const DEFAULT_FALLBACK_PLACEMENTS = {
|
|
7821
7823
|
top: ["bottom", "left", "right"],
|
|
@@ -7911,6 +7913,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
7911
7913
|
const boundaryElementContext = useBoundaryElement();
|
|
7912
7914
|
const theme = useTheme();
|
|
7913
7915
|
const {
|
|
7916
|
+
arrow: arrowProp = true,
|
|
7914
7917
|
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
7915
7918
|
children: childProp,
|
|
7916
7919
|
content,
|
|
@@ -7945,19 +7948,21 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
7945
7948
|
rootBoundary
|
|
7946
7949
|
}));
|
|
7947
7950
|
ret.push(reactDom$1.offset({
|
|
7948
|
-
mainAxis:
|
|
7951
|
+
mainAxis: DEFAULT_TOOLTIP_DISTANCE
|
|
7949
7952
|
}));
|
|
7950
7953
|
ret.push(reactDom$1.shift({
|
|
7951
7954
|
boundary: boundaryElement || void 0,
|
|
7952
7955
|
rootBoundary,
|
|
7953
7956
|
padding: DEFAULT_TOOLTIP_PADDING
|
|
7954
7957
|
}));
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7958
|
+
if (arrowProp) {
|
|
7959
|
+
ret.push(reactDom$1.arrow({
|
|
7960
|
+
element: arrowRef,
|
|
7961
|
+
padding: 2
|
|
7962
|
+
}));
|
|
7963
|
+
}
|
|
7959
7964
|
return ret;
|
|
7960
|
-
}, [boundaryElement, fallbackPlacements]);
|
|
7965
|
+
}, [arrowProp, boundaryElement, fallbackPlacements]);
|
|
7961
7966
|
const {
|
|
7962
7967
|
floatingStyles,
|
|
7963
7968
|
placement,
|
|
@@ -8117,7 +8122,7 @@ const Tooltip = react.forwardRef(function Tooltip2(props, ref) {
|
|
|
8117
8122
|
radius: 3,
|
|
8118
8123
|
scheme,
|
|
8119
8124
|
shadow,
|
|
8120
|
-
children: [content, /* @__PURE__ */jsxRuntime.jsx(TooltipArrow, {
|
|
8125
|
+
children: [content, arrowProp && /* @__PURE__ */jsxRuntime.jsx(TooltipArrow, {
|
|
8121
8126
|
ref: setArrow,
|
|
8122
8127
|
style: arrowStyle
|
|
8123
8128
|
})]
|
|
@@ -8262,7 +8267,7 @@ const InnerAutocomplete = react.forwardRef(function InnerAutocomplete2(props, re
|
|
|
8262
8267
|
padding: paddingProp = 3,
|
|
8263
8268
|
popover = EMPTY_RECORD,
|
|
8264
8269
|
prefix,
|
|
8265
|
-
radius =
|
|
8270
|
+
radius = 2,
|
|
8266
8271
|
readOnly,
|
|
8267
8272
|
relatedElements,
|
|
8268
8273
|
renderOption: renderOptionProp,
|
|
@@ -10087,6 +10092,7 @@ function Toast(props) {
|
|
|
10087
10092
|
closable,
|
|
10088
10093
|
description,
|
|
10089
10094
|
onClose,
|
|
10095
|
+
radius = 3,
|
|
10090
10096
|
title,
|
|
10091
10097
|
status,
|
|
10092
10098
|
...restProps
|
|
@@ -10098,7 +10104,7 @@ function Toast(props) {
|
|
|
10098
10104
|
role,
|
|
10099
10105
|
...restProps,
|
|
10100
10106
|
marginTop: 3,
|
|
10101
|
-
radius
|
|
10107
|
+
radius,
|
|
10102
10108
|
shadow: 2,
|
|
10103
10109
|
tone: cardTone,
|
|
10104
10110
|
children: /* @__PURE__ */jsxRuntime.jsxs(Flex, {
|
|
@@ -10109,7 +10115,8 @@ function Toast(props) {
|
|
|
10109
10115
|
children: /* @__PURE__ */jsxRuntime.jsxs(Stack, {
|
|
10110
10116
|
space: 3,
|
|
10111
10117
|
children: [title && /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
10112
|
-
|
|
10118
|
+
size: 1,
|
|
10119
|
+
weight: "medium",
|
|
10113
10120
|
children: title
|
|
10114
10121
|
}), description && /* @__PURE__ */jsxRuntime.jsx(Text, {
|
|
10115
10122
|
muted: true,
|