@sanity/ui 2.12.4 → 2.13.0
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/_chunks-cjs/_visual-editing.js +13 -12
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +13 -12
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_legacy/_visual-editing.esm.js +13 -12
- package/dist/_legacy/_visual-editing.esm.js.map +1 -1
- package/dist/_visual-editing.d.mts +2 -1
- package/dist/_visual-editing.d.ts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/core/__workshop__/constants.ts +5 -4
- package/src/core/primitives/button/__workshop__/props.tsx +4 -0
- package/src/core/primitives/button/button.tsx +5 -2
|
@@ -1886,8 +1886,8 @@ const StyledButton = /* @__PURE__ */ styledComponents.styled.button.withConfig({
|
|
|
1886
1886
|
displayName: "LoadingBox",
|
|
1887
1887
|
componentId: "sc-aaekt4-1"
|
|
1888
1888
|
})`position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:var(--card-bg-color);border-radius:inherit;z-index:1;box-shadow:inherit;`, Button = react.forwardRef(function(props, ref) {
|
|
1889
|
-
const $ = reactCompilerRuntime.c(
|
|
1890
|
-
let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, width;
|
|
1889
|
+
const $ = reactCompilerRuntime.c(66);
|
|
1890
|
+
let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, textWeight, width;
|
|
1891
1891
|
$[0] !== props ? ({
|
|
1892
1892
|
children,
|
|
1893
1893
|
disabled,
|
|
@@ -1909,17 +1909,18 @@ const StyledButton = /* @__PURE__ */ styledComponents.styled.button.withConfig({
|
|
|
1909
1909
|
space: t5,
|
|
1910
1910
|
text,
|
|
1911
1911
|
textAlign,
|
|
1912
|
+
textWeight,
|
|
1912
1913
|
tone: t6,
|
|
1913
1914
|
type: t7,
|
|
1914
1915
|
muted: t8,
|
|
1915
1916
|
width,
|
|
1916
1917
|
...restProps
|
|
1917
|
-
} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24],
|
|
1918
|
+
} = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = textWeight, $[26] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24], textWeight = $[25], width = $[26]);
|
|
1918
1919
|
const fontSize2 = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, {
|
|
1919
1920
|
button
|
|
1920
1921
|
} = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp);
|
|
1921
1922
|
let t9, t10;
|
|
1922
|
-
$[
|
|
1923
|
+
$[27] !== padding || $[28] !== paddingBottom || $[29] !== paddingLeft || $[30] !== paddingRight || $[31] !== paddingTop || $[32] !== paddingX || $[33] !== paddingY ? (t10 = {
|
|
1923
1924
|
padding,
|
|
1924
1925
|
paddingX,
|
|
1925
1926
|
paddingY,
|
|
@@ -1927,30 +1928,30 @@ const StyledButton = /* @__PURE__ */ styledComponents.styled.button.withConfig({
|
|
|
1927
1928
|
paddingBottom,
|
|
1928
1929
|
paddingLeft,
|
|
1929
1930
|
paddingRight
|
|
1930
|
-
}, $[
|
|
1931
|
+
}, $[27] = padding, $[28] = paddingBottom, $[29] = paddingLeft, $[30] = paddingRight, $[31] = paddingTop, $[32] = paddingX, $[33] = paddingY, $[34] = t10) : t10 = $[34], t9 = t10;
|
|
1931
1932
|
const boxProps = t9, t11 = !!(loading || disabled), t12 = selected ? "" : void 0, t13 = !!(loading || disabled);
|
|
1932
1933
|
let t14;
|
|
1933
|
-
$[
|
|
1934
|
+
$[35] !== loading ? (t14 = !!loading && /* @__PURE__ */ jsxRuntime.jsx(LoadingBox, { children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) }), $[35] = loading, $[36] = t14) : t14 = $[36];
|
|
1934
1935
|
let t15;
|
|
1935
|
-
$[
|
|
1936
|
+
$[37] !== IconComponent || $[38] !== IconRightComponent || $[39] !== boxProps || $[40] !== button || $[41] !== fontSize2 || $[42] !== justify || $[43] !== muted || $[44] !== space || $[45] !== text || $[46] !== textAlign || $[47] !== textWeight ? (t15 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { as: "span", justify, gap: space, children: [
|
|
1936
1937
|
IconComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
|
|
1937
1938
|
react.isValidElement(IconComponent) && IconComponent,
|
|
1938
1939
|
ReactIs.isValidElementType(IconComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {})
|
|
1939
1940
|
] }),
|
|
1940
|
-
text && /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: button.textWeight, children: text }) }),
|
|
1941
|
+
text && /* @__PURE__ */ jsxRuntime.jsx(Box, { children: /* @__PURE__ */ jsxRuntime.jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: textWeight ?? button.textWeight, children: text }) }),
|
|
1941
1942
|
IconRightComponent && /* @__PURE__ */ jsxRuntime.jsxs(Text, { size: fontSize2, children: [
|
|
1942
1943
|
react.isValidElement(IconRightComponent) && IconRightComponent,
|
|
1943
1944
|
ReactIs.isValidElementType(IconRightComponent) && /* @__PURE__ */ jsxRuntime.jsx(IconRightComponent, {})
|
|
1944
1945
|
] })
|
|
1945
|
-
] }) }), $[
|
|
1946
|
+
] }) }), $[37] = IconComponent, $[38] = IconRightComponent, $[39] = boxProps, $[40] = button, $[41] = fontSize2, $[42] = justify, $[43] = muted, $[44] = space, $[45] = text, $[46] = textAlign, $[47] = textWeight, $[48] = t15) : t15 = $[48];
|
|
1946
1947
|
let t16;
|
|
1947
|
-
$[
|
|
1948
|
+
$[49] !== boxProps || $[50] !== children ? (t16 = children && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", ...boxProps, children }), $[49] = boxProps, $[50] = children, $[51] = t16) : t16 = $[51];
|
|
1948
1949
|
let t17;
|
|
1949
|
-
return $[
|
|
1950
|
+
return $[52] !== mode || $[53] !== radius || $[54] !== ref || $[55] !== restProps || $[56] !== t11 || $[57] !== t12 || $[58] !== t13 || $[59] !== t14 || $[60] !== t15 || $[61] !== t16 || $[62] !== tone || $[63] !== type || $[64] !== width ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs(StyledButton, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t11, "data-selected": t12, disabled: t13, ref, type, $width: width, children: [
|
|
1950
1951
|
t14,
|
|
1951
1952
|
t15,
|
|
1952
1953
|
t16
|
|
1953
|
-
] }), $[
|
|
1954
|
+
] }), $[52] = mode, $[53] = radius, $[54] = ref, $[55] = restProps, $[56] = t11, $[57] = t12, $[58] = t13, $[59] = t14, $[60] = t15, $[61] = t16, $[62] = tone, $[63] = type, $[64] = width, $[65] = t17) : t17 = $[65], t17;
|
|
1954
1955
|
});
|
|
1955
1956
|
Button.displayName = "ForwardRef(Button)";
|
|
1956
1957
|
function cardStyle(props) {
|