@sanity/ui 2.8.24-canary.1 → 2.8.24
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.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +75 -85
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +75 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -85
- package/dist/index.mjs.map +1 -1
- package/package.json +39 -31
- package/src/core/hooks/useArrayProp.ts +6 -8
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/utils/portal/portalProvider.tsx +8 -10
package/dist/index.d.mts
CHANGED
|
@@ -983,7 +983,7 @@ export declare interface FontWeightStyleProps {
|
|
|
983
983
|
/**
|
|
984
984
|
* @internal
|
|
985
985
|
*/
|
|
986
|
-
export declare function _getArrayProp<T = number>(val: T | T[] | undefined): T[]
|
|
986
|
+
export declare function _getArrayProp<T = number>(val: T | T[] | undefined, defaultVal?: T[]): T[]
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* @internal
|
|
@@ -2706,6 +2706,7 @@ export declare interface TreeState {
|
|
|
2706
2706
|
*/
|
|
2707
2707
|
export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(
|
|
2708
2708
|
val: T | T[] | undefined,
|
|
2709
|
+
defaultVal?: T[],
|
|
2709
2710
|
): T[]
|
|
2710
2711
|
|
|
2711
2712
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -983,7 +983,7 @@ export declare interface FontWeightStyleProps {
|
|
|
983
983
|
/**
|
|
984
984
|
* @internal
|
|
985
985
|
*/
|
|
986
|
-
export declare function _getArrayProp<T = number>(val: T | T[] | undefined): T[]
|
|
986
|
+
export declare function _getArrayProp<T = number>(val: T | T[] | undefined, defaultVal?: T[]): T[]
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* @internal
|
|
@@ -2706,6 +2706,7 @@ export declare interface TreeState {
|
|
|
2706
2706
|
*/
|
|
2707
2707
|
export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(
|
|
2708
2708
|
val: T | T[] | undefined,
|
|
2709
|
+
defaultVal?: T[],
|
|
2709
2710
|
): T[]
|
|
2710
2711
|
|
|
2711
2712
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -45,8 +45,8 @@ function _responsive(media, values, callback) {
|
|
|
45
45
|
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function _getArrayProp(val) {
|
|
49
|
-
return val === void 0 ? EMPTY_ARRAY : Array.isArray(val) ? val : [val];
|
|
48
|
+
function _getArrayProp(val, defaultVal) {
|
|
49
|
+
return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
|
|
50
50
|
}
|
|
51
51
|
function _getResponsiveSpace(theme, props, spaceIndexes = EMPTY_ARRAY) {
|
|
52
52
|
if (!Array.isArray(spaceIndexes))
|
|
@@ -153,21 +153,12 @@ function responsiveTextAlignStyle(props) {
|
|
|
153
153
|
function responsiveTextFont(props) {
|
|
154
154
|
return responsiveFont("text", props);
|
|
155
155
|
}
|
|
156
|
-
function useArrayProp(val) {
|
|
157
|
-
const $ = c(
|
|
156
|
+
function useArrayProp(val, defaultVal) {
|
|
157
|
+
const $ = c(3);
|
|
158
158
|
let t0;
|
|
159
|
-
$[0] !== val ? (t0 = () => [_getArrayProp(val), JSON.stringify(val)], $[0] =
|
|
160
|
-
const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1;
|
|
161
|
-
|
|
162
|
-
$[2] !== val ? (t2 = JSON.stringify(val), $[2] = val, $[3] = t2) : t2 = $[3];
|
|
163
|
-
const hash = t2;
|
|
164
|
-
if (hash !== cachedHash) {
|
|
165
|
-
let t3;
|
|
166
|
-
$[4] !== val ? (t3 = _getArrayProp(val), $[4] = val, $[5] = t3) : t3 = $[5];
|
|
167
|
-
const current = t3;
|
|
168
|
-
setCache([current, hash]), result = current;
|
|
169
|
-
}
|
|
170
|
-
return result;
|
|
159
|
+
$[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
|
|
160
|
+
const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
|
|
161
|
+
return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
|
|
171
162
|
}
|
|
172
163
|
function _getElements(element, elementsArg) {
|
|
173
164
|
const ret = [element];
|
|
@@ -217,7 +208,7 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
217
208
|
}, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
|
|
218
209
|
}
|
|
219
210
|
function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
220
|
-
const $ = c(8), elementsArg = t0 === void 0 ? _temp$
|
|
211
|
+
const $ = c(8), elementsArg = t0 === void 0 ? _temp$b : t0;
|
|
221
212
|
let t1;
|
|
222
213
|
$[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
|
|
223
214
|
if (!listener)
|
|
@@ -245,7 +236,7 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
|
245
236
|
};
|
|
246
237
|
}, t3 = [hasListener, onEvent], $[4] = hasListener, $[5] = onEvent, $[6] = t2, $[7] = t3) : (t2 = $[6], t3 = $[7]), useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
|
|
247
238
|
}
|
|
248
|
-
function _temp$
|
|
239
|
+
function _temp$b() {
|
|
249
240
|
return EMPTY_ARRAY;
|
|
250
241
|
}
|
|
251
242
|
function useCustomValidity(ref, customValidity) {
|
|
@@ -752,15 +743,15 @@ function useMediaIndex() {
|
|
|
752
743
|
return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
|
|
753
744
|
}
|
|
754
745
|
function usePrefersDark(t0) {
|
|
755
|
-
return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$
|
|
746
|
+
return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$a : t0);
|
|
756
747
|
}
|
|
757
|
-
function _temp$
|
|
748
|
+
function _temp$a() {
|
|
758
749
|
return !1;
|
|
759
750
|
}
|
|
760
751
|
function usePrefersReducedMotion(t0) {
|
|
761
|
-
return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$
|
|
752
|
+
return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$9 : t0);
|
|
762
753
|
}
|
|
763
|
-
function _temp$
|
|
754
|
+
function _temp$9() {
|
|
764
755
|
return !1;
|
|
765
756
|
}
|
|
766
757
|
function responsiveBorderStyle() {
|
|
@@ -1647,7 +1638,7 @@ function avatarStrokeStyle() {
|
|
|
1647
1638
|
const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = styled.div(avatarStyle.arrow), BgStroke = styled.ellipse(avatarStyle.bgStroke), Stroke = styled.ellipse(avatarStyle.stroke), Initials = styled.div(avatarStyle.initials), InitialsLabel = styled(Label)({
|
|
1648
1639
|
color: "inherit"
|
|
1649
1640
|
}), Image = styled.svg(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
|
|
1650
|
-
const $ = c(
|
|
1641
|
+
const $ = c(52);
|
|
1651
1642
|
let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
|
|
1652
1643
|
$[0] !== props ? ({
|
|
1653
1644
|
__unstable_hideInnerStroke,
|
|
@@ -1683,32 +1674,30 @@ const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1
|
|
|
1683
1674
|
}, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
|
|
1684
1675
|
const handleImageError = t7;
|
|
1685
1676
|
let t8, t9;
|
|
1686
|
-
|
|
1687
|
-
let t102;
|
|
1688
|
-
$[24] === Symbol.for("react.memo_cache_sentinel") ? (t102 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[24] = t102) : t102 = $[24], t9 = size2.map(t102), $[22] = size2, $[23] = t9;
|
|
1689
|
-
} else
|
|
1690
|
-
t9 = $[23];
|
|
1691
|
-
t8 = t9;
|
|
1677
|
+
$[22] !== size2 ? (t9 = size2.map(_temp$8), $[22] = size2, $[23] = t9) : t9 = $[23], t8 = t9;
|
|
1692
1678
|
const initialsSize = t8, t10 = typeof as == "string" ? as : void 0;
|
|
1693
1679
|
let t11;
|
|
1694
|
-
$[
|
|
1680
|
+
$[24] !== color ? (t11 = /* @__PURE__ */ jsx(Arrow$1, { children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[24] = color, $[25] = t11) : t11 = $[25];
|
|
1695
1681
|
let t12;
|
|
1696
|
-
$[
|
|
1682
|
+
$[26] !== __unstable_hideInnerStroke || $[27] !== _radius || $[28] !== _sizeRem || $[29] !== handleImageError || $[30] !== imageFailed || $[31] !== imageId || $[32] !== src ? (t12 = !imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
|
|
1697
1683
|
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
|
|
1698
1684
|
/* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
|
|
1699
1685
|
!__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
|
|
1700
1686
|
/* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
|
|
1701
|
-
] }), $[
|
|
1687
|
+
] }), $[26] = __unstable_hideInnerStroke, $[27] = _radius, $[28] = _sizeRem, $[29] = handleImageError, $[30] = imageFailed, $[31] = imageId, $[32] = src, $[33] = t12) : t12 = $[33];
|
|
1702
1688
|
let t13;
|
|
1703
|
-
$[
|
|
1689
|
+
$[34] !== imageFailed || $[35] !== initials || $[36] !== initialsSize || $[37] !== src ? (t13 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[34] = imageFailed, $[35] = initials, $[36] = initialsSize, $[37] = src, $[38] = t13) : t13 = $[38];
|
|
1704
1690
|
let t14;
|
|
1705
|
-
return $[
|
|
1691
|
+
return $[39] !== arrowPosition || $[40] !== as || $[41] !== color || $[42] !== ref || $[43] !== restProps || $[44] !== size2 || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t13 || $[50] !== title ? (t14 = /* @__PURE__ */ jsxs(Root$B, { as, "data-as": t10, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
|
|
1706
1692
|
t11,
|
|
1707
1693
|
t12,
|
|
1708
1694
|
t13
|
|
1709
|
-
] }), $[
|
|
1695
|
+
] }), $[39] = arrowPosition, $[40] = as, $[41] = color, $[42] = ref, $[43] = restProps, $[44] = size2, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t13, $[50] = title, $[51] = t14) : t14 = $[51], t14;
|
|
1710
1696
|
});
|
|
1711
1697
|
Avatar.displayName = "ForwardRef(Avatar)";
|
|
1698
|
+
function _temp$8(s) {
|
|
1699
|
+
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
1700
|
+
}
|
|
1712
1701
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
1713
1702
|
const {
|
|
1714
1703
|
avatar,
|
|
@@ -1746,24 +1735,22 @@ function _avatarCounterBaseStyle(props) {
|
|
|
1746
1735
|
`;
|
|
1747
1736
|
}
|
|
1748
1737
|
const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
|
|
1749
|
-
const $ = c(
|
|
1738
|
+
const $ = c(9), {
|
|
1750
1739
|
count,
|
|
1751
1740
|
size: t0
|
|
1752
1741
|
} = props, size2 = useArrayProp(t0 === void 0 ? 1 : t0);
|
|
1753
1742
|
let t1, t2;
|
|
1754
|
-
|
|
1755
|
-
let t32;
|
|
1756
|
-
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t32 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[2] = t32) : t32 = $[2], t2 = size2.map(t32), $[0] = size2, $[1] = t2;
|
|
1757
|
-
} else
|
|
1758
|
-
t2 = $[1];
|
|
1759
|
-
t1 = t2;
|
|
1743
|
+
$[0] !== size2 ? (t2 = size2.map(_temp$7), $[0] = size2, $[1] = t2) : t2 = $[1], t1 = t2;
|
|
1760
1744
|
const fontSize2 = t1;
|
|
1761
1745
|
let t3;
|
|
1762
|
-
$[
|
|
1746
|
+
$[2] !== count || $[3] !== fontSize2 ? (t3 = /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[2] = count, $[3] = fontSize2, $[4] = t3) : t3 = $[4];
|
|
1763
1747
|
let t4;
|
|
1764
|
-
return $[
|
|
1748
|
+
return $[5] !== ref || $[6] !== size2 || $[7] !== t3 ? (t4 = /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: t3 }), $[5] = ref, $[6] = size2, $[7] = t3, $[8] = t4) : t4 = $[8], t4;
|
|
1765
1749
|
});
|
|
1766
1750
|
AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
|
|
1751
|
+
function _temp$7(s) {
|
|
1752
|
+
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
1753
|
+
}
|
|
1767
1754
|
const BASE_STYLES = css`
|
|
1768
1755
|
white-space: nowrap;
|
|
1769
1756
|
|
|
@@ -2959,7 +2946,7 @@ function inlineSpaceStyle(props) {
|
|
|
2959
2946
|
});
|
|
2960
2947
|
}
|
|
2961
2948
|
const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardRef(function(props, ref) {
|
|
2962
|
-
const $ = c(
|
|
2949
|
+
const $ = c(12);
|
|
2963
2950
|
let as, childrenProp, restProps, space;
|
|
2964
2951
|
$[0] !== props ? ({
|
|
2965
2952
|
as,
|
|
@@ -2968,17 +2955,15 @@ const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardR
|
|
|
2968
2955
|
...restProps
|
|
2969
2956
|
} = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
|
|
2970
2957
|
let t0, t1;
|
|
2971
|
-
|
|
2972
|
-
let t22;
|
|
2973
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t22 = (child) => child && /* @__PURE__ */ jsx("div", { children: child }), $[7] = t22) : t22 = $[7], t1 = Children.map(childrenProp, t22), $[5] = childrenProp, $[6] = t1;
|
|
2974
|
-
} else
|
|
2975
|
-
t1 = $[6];
|
|
2976
|
-
t0 = t1;
|
|
2958
|
+
$[5] !== childrenProp ? (t1 = Children.map(childrenProp, _temp$6), $[5] = childrenProp, $[6] = t1) : t1 = $[6], t0 = t1;
|
|
2977
2959
|
const children = t0, t2 = useArrayProp(space);
|
|
2978
2960
|
let t3;
|
|
2979
|
-
return $[
|
|
2961
|
+
return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(Root$m, { "data-ui": "Inline", ...restProps, $space: t2, forwardedAs: as, ref, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
2980
2962
|
});
|
|
2981
2963
|
Inline.displayName = "ForwardRef(Inline)";
|
|
2964
|
+
function _temp$6(child) {
|
|
2965
|
+
return child && /* @__PURE__ */ jsx("div", { children: child });
|
|
2966
|
+
}
|
|
2982
2967
|
function kbdStyle() {
|
|
2983
2968
|
return css`
|
|
2984
2969
|
--card-bg-color: var(--card-kbd-bg-color);
|
|
@@ -3407,13 +3392,13 @@ function LayerProvider(props) {
|
|
|
3407
3392
|
[childLevel]: prevLen + 1
|
|
3408
3393
|
};
|
|
3409
3394
|
return setSize(Object.keys(nextState).length), nextState;
|
|
3410
|
-
}) : setSize(
|
|
3395
|
+
}) : setSize(_temp$5), () => {
|
|
3411
3396
|
childLevel !== void 0 ? setChildLayers((state_0) => {
|
|
3412
3397
|
const nextState_0 = {
|
|
3413
3398
|
...state_0
|
|
3414
3399
|
};
|
|
3415
3400
|
return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
|
|
3416
|
-
}) : setSize(
|
|
3401
|
+
}) : setSize(_temp2$3), parentDispose?.();
|
|
3417
3402
|
};
|
|
3418
3403
|
}, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
|
|
3419
3404
|
const registerChild = t3;
|
|
@@ -3432,6 +3417,12 @@ function LayerProvider(props) {
|
|
|
3432
3417
|
let t8;
|
|
3433
3418
|
return $[16] !== children || $[17] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t8) : t8 = $[18], t8;
|
|
3434
3419
|
}
|
|
3420
|
+
function _temp2$3(v_0) {
|
|
3421
|
+
return v_0 - 1;
|
|
3422
|
+
}
|
|
3423
|
+
function _temp$5(v) {
|
|
3424
|
+
return v + 1;
|
|
3425
|
+
}
|
|
3435
3426
|
LayerProvider.displayName = "LayerProvider";
|
|
3436
3427
|
const Root$j = styled.div({
|
|
3437
3428
|
position: "relative"
|
|
@@ -3518,8 +3509,9 @@ function PortalProvider(props) {
|
|
|
3518
3509
|
const $ = c(7), {
|
|
3519
3510
|
boundaryElement,
|
|
3520
3511
|
children,
|
|
3521
|
-
element
|
|
3522
|
-
|
|
3512
|
+
element,
|
|
3513
|
+
__unstable_elements: elementsProp
|
|
3514
|
+
} = props, elements = useUnique(elementsProp), fallbackElement = useSyncExternalStore(emptySubscribe, _temp$4, _temp2$2);
|
|
3523
3515
|
let t0;
|
|
3524
3516
|
const t1 = boundaryElement || null, t2 = element || fallbackElement;
|
|
3525
3517
|
let t3;
|
|
@@ -3533,21 +3525,20 @@ function PortalProvider(props) {
|
|
|
3533
3525
|
let t4;
|
|
3534
3526
|
return $[4] !== children || $[5] !== value ? (t4 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t4) : t4 = $[6], t4;
|
|
3535
3527
|
}
|
|
3536
|
-
function _temp2$
|
|
3528
|
+
function _temp2$2() {
|
|
3537
3529
|
return null;
|
|
3538
3530
|
}
|
|
3539
|
-
function _temp$
|
|
3531
|
+
function _temp$4() {
|
|
3540
3532
|
return document.body;
|
|
3541
3533
|
}
|
|
3542
3534
|
PortalProvider.displayName = "PortalProvider";
|
|
3543
3535
|
const emptySubscribe = () => () => {
|
|
3544
3536
|
};
|
|
3545
3537
|
function useUnique(value) {
|
|
3546
|
-
const
|
|
3547
|
-
|
|
3548
|
-
return isEqual(cachedValue, value) || (setCachedValue(value), result = value), result;
|
|
3538
|
+
const valueRef = useRef(value);
|
|
3539
|
+
return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
|
|
3549
3540
|
}
|
|
3550
|
-
function
|
|
3541
|
+
function _isEqual(objA, objB) {
|
|
3551
3542
|
if (!objA || !objB)
|
|
3552
3543
|
return objA === objB;
|
|
3553
3544
|
const keysA = Object.keys(objA), keysB = Object.keys(objB);
|
|
@@ -4601,7 +4592,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
4601
4592
|
display: "block"
|
|
4602
4593
|
}
|
|
4603
4594
|
}), TextInput = forwardRef(function(props, forwardedRef) {
|
|
4604
|
-
const $ = c(
|
|
4595
|
+
const $ = c(84);
|
|
4605
4596
|
let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
|
|
4606
4597
|
$[0] !== props ? ({
|
|
4607
4598
|
__unstable_disableFocusRing,
|
|
@@ -4626,7 +4617,7 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
4626
4617
|
const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = useRef(null), rootTheme = useRootTheme(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
|
|
4627
4618
|
let t7;
|
|
4628
4619
|
$[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
|
|
4629
|
-
const handleClearMouseDown = _temp$
|
|
4620
|
+
const handleClearMouseDown = _temp$3;
|
|
4630
4621
|
let t8;
|
|
4631
4622
|
$[20] !== onClear ? (t8 = (event_0) => {
|
|
4632
4623
|
event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
|
|
@@ -4654,49 +4645,45 @@ const CLEAR_BUTTON_BOX_STYLE = {
|
|
|
4654
4645
|
] }), $[34] = $hasPrefix, $[35] = $hasSuffix, $[36] = __unstable_disableFocusRing, $[37] = radius, $[38] = rootTheme.scheme, $[39] = rootTheme.tone, $[40] = t12, $[41] = t13, $[42] = t14, $[43] = t15) : t15 = $[43], t11 = t15;
|
|
4655
4646
|
const presentationNode = t11;
|
|
4656
4647
|
let t16, t17;
|
|
4657
|
-
|
|
4658
|
-
let t182;
|
|
4659
|
-
$[46] === Symbol.for("react.memo_cache_sentinel") ? (t182 = (v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2, $[46] = t182) : t182 = $[46], t17 = padding.map(t182), $[44] = padding, $[45] = t17;
|
|
4660
|
-
} else
|
|
4661
|
-
t17 = $[45];
|
|
4662
|
-
t16 = t17;
|
|
4648
|
+
$[44] !== padding ? (t17 = padding.map(_temp2$1), $[44] = padding, $[45] = t17) : t17 = $[45], t16 = t17;
|
|
4663
4649
|
const clearButtonBoxPadding = t16;
|
|
4664
4650
|
let t18, t19;
|
|
4665
|
-
|
|
4666
|
-
let t202;
|
|
4667
|
-
$[49] === Symbol.for("react.memo_cache_sentinel") ? (t202 = (v_0) => v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1, $[49] = t202) : t202 = $[49], t19 = padding.map(t202), $[47] = padding, $[48] = t19;
|
|
4668
|
-
} else
|
|
4669
|
-
t19 = $[48];
|
|
4670
|
-
t18 = t19;
|
|
4651
|
+
$[46] !== padding ? (t19 = padding.map(_temp3), $[46] = padding, $[47] = t19) : t19 = $[47], t18 = t19;
|
|
4671
4652
|
const clearButtonPadding = t18;
|
|
4672
4653
|
let t20;
|
|
4673
4654
|
t20 = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
|
|
4674
4655
|
const clearButtonProps = t20;
|
|
4675
4656
|
let t21, t22;
|
|
4676
|
-
$[
|
|
4657
|
+
$[48] !== clearButton || $[49] !== clearButtonBoxPadding || $[50] !== clearButtonPadding || $[51] !== clearButtonProps || $[52] !== customValidity || $[53] !== disabled || $[54] !== fontSize2 || $[55] !== handleClearClick || $[56] !== radius || $[57] !== readOnly ? (t22 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[48] = clearButton, $[49] = clearButtonBoxPadding, $[50] = clearButtonPadding, $[51] = clearButtonProps, $[52] = customValidity, $[53] = disabled, $[54] = fontSize2, $[55] = handleClearClick, $[56] = radius, $[57] = readOnly, $[58] = t22) : t22 = $[58], t21 = t22;
|
|
4677
4658
|
const clearButtonNode = t21;
|
|
4678
4659
|
let t23, t24;
|
|
4679
|
-
$[
|
|
4660
|
+
$[59] !== radius || $[60] !== suffix ? (t24 = suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[59] = radius, $[60] = suffix, $[61] = t24) : t24 = $[61], t23 = t24;
|
|
4680
4661
|
const suffixNode = t23, t25 = $hasIconRight || $hasClearButton;
|
|
4681
4662
|
let t26;
|
|
4682
|
-
$[
|
|
4663
|
+
$[62] !== $hasIcon || $[63] !== disabled || $[64] !== fontSize2 || $[65] !== padding || $[66] !== readOnly || $[67] !== restProps || $[68] !== rootTheme.scheme || $[69] !== rootTheme.tone || $[70] !== space || $[71] !== t25 || $[72] !== type || $[73] !== weight ? (t26 = /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t25, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[62] = $hasIcon, $[63] = disabled, $[64] = fontSize2, $[65] = padding, $[66] = readOnly, $[67] = restProps, $[68] = rootTheme.scheme, $[69] = rootTheme.tone, $[70] = space, $[71] = t25, $[72] = type, $[73] = weight, $[74] = t26) : t26 = $[74];
|
|
4683
4664
|
let t27;
|
|
4684
|
-
$[
|
|
4665
|
+
$[75] !== clearButtonNode || $[76] !== presentationNode || $[77] !== t26 ? (t27 = /* @__PURE__ */ jsxs(InputRoot, { children: [
|
|
4685
4666
|
t26,
|
|
4686
4667
|
presentationNode,
|
|
4687
4668
|
clearButtonNode
|
|
4688
|
-
] }), $[
|
|
4669
|
+
] }), $[75] = clearButtonNode, $[76] = presentationNode, $[77] = t26, $[78] = t27) : t27 = $[78];
|
|
4689
4670
|
let t28;
|
|
4690
|
-
return $[
|
|
4671
|
+
return $[79] !== prefixNode || $[80] !== rootTheme.tone || $[81] !== suffixNode || $[82] !== t27 ? (t28 = /* @__PURE__ */ jsxs(Root$b, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
|
|
4691
4672
|
prefixNode,
|
|
4692
4673
|
t27,
|
|
4693
4674
|
suffixNode
|
|
4694
|
-
] }), $[
|
|
4675
|
+
] }), $[79] = prefixNode, $[80] = rootTheme.tone, $[81] = suffixNode, $[82] = t27, $[83] = t28) : t28 = $[83], t28;
|
|
4695
4676
|
});
|
|
4696
4677
|
TextInput.displayName = "ForwardRef(TextInput)";
|
|
4697
|
-
function _temp$
|
|
4678
|
+
function _temp$3(event) {
|
|
4698
4679
|
event.preventDefault(), event.stopPropagation();
|
|
4699
4680
|
}
|
|
4681
|
+
function _temp2$1(v) {
|
|
4682
|
+
return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
|
|
4683
|
+
}
|
|
4684
|
+
function _temp3(v_0) {
|
|
4685
|
+
return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
|
|
4686
|
+
}
|
|
4700
4687
|
function useDelayedState(initialState) {
|
|
4701
4688
|
const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef();
|
|
4702
4689
|
let t0;
|
|
@@ -5813,7 +5800,7 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
5813
5800
|
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
|
|
5814
5801
|
let t9;
|
|
5815
5802
|
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
5816
|
-
setOpen(
|
|
5803
|
+
setOpen(_temp$2), setShouldFocus(null);
|
|
5817
5804
|
}, $[12] = t9) : t9 = $[12];
|
|
5818
5805
|
const handleButtonClick = t9;
|
|
5819
5806
|
let t10;
|
|
@@ -5915,6 +5902,9 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
5915
5902
|
return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
|
|
5916
5903
|
});
|
|
5917
5904
|
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
5905
|
+
function _temp$2(v) {
|
|
5906
|
+
return !v;
|
|
5907
|
+
}
|
|
5918
5908
|
const MenuDivider = styled.hr`
|
|
5919
5909
|
height: 1px;
|
|
5920
5910
|
border: 0;
|