@sanity/ui 2.3.3 → 2.3.4-canary.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/index.esm.js +5 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +26 -34
- package/src/core/primitives/avatar/avatarStack.tsx +2 -3
- package/src/core/primitives/inline/inline.tsx +2 -6
- package/src/core/primitives/helpers.ts +0 -11
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildTheme, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, getTheme_v2, getScopedTheme } from "@sanity/ui/theme";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useImperativeHandle, forwardRef, useId, useCallback, cloneElement, isValidElement, Component, memo, useReducer,
|
|
4
|
-
import ReactIs, {
|
|
3
|
+
import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useImperativeHandle, forwardRef, useId, useCallback, Children, cloneElement, isValidElement, Component, memo, useReducer, Fragment as Fragment$1, startTransition } from "react";
|
|
4
|
+
import ReactIs, { isValidElementType } from "react-is";
|
|
5
5
|
import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled, keyframes } from "styled-components";
|
|
6
6
|
import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
7
7
|
import Refractor from "react-refractor";
|
|
@@ -1528,13 +1528,7 @@ const Root$A = styled.div(
|
|
|
1528
1528
|
[size2]
|
|
1529
1529
|
);
|
|
1530
1530
|
return /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
|
|
1531
|
-
})
|
|
1532
|
-
function childrenToElementArray(children) {
|
|
1533
|
-
return (Array.isArray(children) ? children : [children]).filter(
|
|
1534
|
-
(node) => isElement$1(node) || isFragment(node) || typeof node == "string"
|
|
1535
|
-
);
|
|
1536
|
-
}
|
|
1537
|
-
const BASE_STYLES = css`
|
|
1531
|
+
}), BASE_STYLES = css`
|
|
1538
1532
|
white-space: nowrap;
|
|
1539
1533
|
|
|
1540
1534
|
& > div {
|
|
@@ -1565,7 +1559,7 @@ const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), Ava
|
|
|
1565
1559
|
maxLength: maxLengthProp = 4,
|
|
1566
1560
|
size: sizeProp = 1,
|
|
1567
1561
|
...restProps
|
|
1568
|
-
} = props, children =
|
|
1562
|
+
} = props, children = Children.toArray(childrenProp).filter(
|
|
1569
1563
|
(child) => typeof child != "string"
|
|
1570
1564
|
), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
1571
1565
|
return /* @__PURE__ */ jsxs(Root$z, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
|
|
@@ -2640,7 +2634,7 @@ function inlineSpaceStyle(props) {
|
|
|
2640
2634
|
}
|
|
2641
2635
|
const Root$m = styled(Box)(inlineBaseStyle, inlineSpaceStyle), Inline = forwardRef(function(props, ref) {
|
|
2642
2636
|
const { as, children: childrenProp, space, ...restProps } = props, children = useMemo(
|
|
2643
|
-
() =>
|
|
2637
|
+
() => Children.map(childrenProp, (child) => /* @__PURE__ */ jsx("div", { children: child })),
|
|
2644
2638
|
[childrenProp]
|
|
2645
2639
|
);
|
|
2646
2640
|
return /* @__PURE__ */ jsx(
|