@sanity/ui 4.2.0 → 4.2.2
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/{arrow-BmX6qbAS.js → arrow-CZ-Lw1QO.js} +2 -2
- package/dist/{arrow-BmX6qbAS.js.map → arrow-CZ-Lw1QO.js.map} +1 -1
- package/dist/autocomplete.d.ts.map +1 -1
- package/dist/autocomplete.js +119 -123
- package/dist/autocomplete.js.map +1 -1
- package/dist/breadcrumbs.js +4 -4
- package/dist/{button-BNyKSDyA.js → button-Wii-24Xu.js} +6 -6
- package/dist/button-Wii-24Xu.js.map +1 -0
- package/dist/button-dnqMFkWg.d.ts.map +1 -1
- package/dist/code.d.ts.map +1 -1
- package/dist/code.js +1 -1
- package/dist/code.js.map +1 -1
- package/dist/{flex-DmbDG2ks.js → flex-CpiAc-4D.js} +2 -2
- package/dist/{flex-DmbDG2ks.js.map → flex-CpiAc-4D.js.map} +1 -1
- package/dist/getScopedTheme-C-sZsyAz.js.map +1 -1
- package/dist/{grid-6JSgMj1O.js → grid-BVZEj_Xe.js} +3 -3
- package/dist/{grid-6JSgMj1O.js.map → grid-BVZEj_Xe.js.map} +1 -1
- package/dist/{hotkeys-CaHsQlsO.js → hotkeys-DEMStMQ5.js} +4 -4
- package/dist/hotkeys-DEMStMQ5.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +109 -115
- package/dist/index.js.map +1 -1
- package/dist/{layer-Bl5R3uNR.js → layer-B0tlPeLT.js} +2 -2
- package/dist/{layer-Bl5R3uNR.js.map → layer-B0tlPeLT.js.map} +1 -1
- package/dist/menu.d.ts.map +1 -1
- package/dist/menu.js +5 -5
- package/dist/menu.js.map +1 -1
- package/dist/{popover-B7-28L8y.js → popover-DR6UQQvq.js} +4 -4
- package/dist/{popover-B7-28L8y.js.map → popover-DR6UQQvq.js.map} +1 -1
- package/dist/popover.js +1 -1
- package/dist/{stack-rsNFPq2-.js → stack-SbGBZ0x3.js} +3 -3
- package/dist/{stack-rsNFPq2-.js.map → stack-SbGBZ0x3.js.map} +1 -1
- package/dist/styles.css +21 -12
- package/dist/{textInput-pSfQjkmx.js → textInput-fGZVEKGs.js} +4 -4
- package/dist/{textInput-pSfQjkmx.js.map → textInput-fGZVEKGs.js.map} +1 -1
- package/dist/toast.js +37 -43
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.js +53 -49
- package/dist/tooltip.js.map +1 -1
- package/dist/useClickOutsideEvent-wGLGWBZN.js.map +1 -1
- package/dist/{useLayer-D1usxIE0.js → useLayer-CUKYjJYq.js} +56 -35
- package/dist/useLayer-CUKYjJYq.js.map +1 -0
- package/package.json +18 -17
- package/dist/button-BNyKSDyA.js.map +0 -1
- package/dist/hotkeys-CaHsQlsO.js.map +0 -1
- package/dist/useLayer-D1usxIE0.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as rem, i as _responsive, n as _getArrayProp, r as _getResponsiveSpace, s as EMPTY_RECORD, t as _fillCSSObject } from "./helpers-C8xxXAQC.js";
|
|
3
|
-
import { a as textInputFontSizeStyle, c as responsiveInputPaddingStyle, d as attemptFocus, f as focusFirstDescendant, g as _raf2, h as _raf, i as textInputBaseStyle, l as useCustomValidity, m as isFocusable, n as inputRoot, o as textInputRepresentationStyle, p as focusLastDescendant, r as textAreaRoot, s as responsiveInputPaddingIconRightStyle, t as TextInput, u as _hasFocus } from "./textInput-
|
|
3
|
+
import { a as textInputFontSizeStyle, c as responsiveInputPaddingStyle, d as attemptFocus, f as focusFirstDescendant, g as _raf2, h as _raf, i as textInputBaseStyle, l as useCustomValidity, m as isFocusable, n as inputRoot, o as textInputRepresentationStyle, p as focusLastDescendant, r as textAreaRoot, s as responsiveInputPaddingIconRightStyle, t as TextInput, u as _hasFocus } from "./textInput-fGZVEKGs.js";
|
|
4
4
|
import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, n as containsOrEqualsElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement, t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
|
|
5
5
|
import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
|
|
6
|
-
import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-
|
|
7
|
-
import { t as Flex } from "./flex-
|
|
8
|
-
import { a as responsiveTextAlignStyle, i as responsiveTextFont, n as Text, r as SpanWithTextOverflow, t as Stack } from "./stack-
|
|
6
|
+
import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-CUKYjJYq.js";
|
|
7
|
+
import { t as Flex } from "./flex-CpiAc-4D.js";
|
|
8
|
+
import { a as responsiveTextAlignStyle, i as responsiveTextFont, n as Text, r as SpanWithTextOverflow, t as Stack } from "./stack-SbGBZ0x3.js";
|
|
9
9
|
import { t as responsiveFont } from "./responsiveFont-CilwaORG.js";
|
|
10
|
-
import { n as Spinner, t as Button } from "./button-
|
|
10
|
+
import { n as Spinner, t as Button } from "./button-Wii-24Xu.js";
|
|
11
11
|
import { n as _elementSizeObserver, t as useElementSize } from "./useElementSize-BJvbGHq8.js";
|
|
12
|
-
import { a as useBoundaryElement, i as PortalContext, n as Portal, o as BoundaryElementContext, r as usePortal, t as Arrow } from "./arrow-
|
|
12
|
+
import { a as useBoundaryElement, i as PortalContext, n as Portal, o as BoundaryElementContext, r as usePortal, t as Arrow } from "./arrow-CZ-Lw1QO.js";
|
|
13
13
|
import { t as useClickOutsideEvent } from "./useClickOutsideEvent-wGLGWBZN.js";
|
|
14
14
|
import { t as responsiveCodeFontStyle } from "./codeFontStyle-84SMhFtI.js";
|
|
15
15
|
import { a as rgba$1, c as hslToRgb$1, i as multiply$1, l as rgbToHex$1, n as buildTheme, o as parseColor$1, r as screen$1, s as hexToRgb$1, t as createColorTheme$1, u as rgbToHsl$1 } from "./factory-BzXTX8_Q.js";
|
|
16
|
-
import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-
|
|
17
|
-
import { t as Layer } from "./layer-
|
|
18
|
-
import { t as Grid } from "./grid-
|
|
16
|
+
import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-DEMStMQ5.js";
|
|
17
|
+
import { t as Layer } from "./layer-B0tlPeLT.js";
|
|
18
|
+
import { t as Grid } from "./grid-BVZEj_Xe.js";
|
|
19
19
|
import { c } from "react/compiler-runtime";
|
|
20
20
|
import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
|
|
21
21
|
import { clsx } from "clsx/lite";
|
|
22
|
-
import { Children, Component, cloneElement, isValidElement,
|
|
22
|
+
import { Children, Component, cloneElement, isValidElement, useContext, useEffect, useId, useImperativeHandle, useRef, useState, useSyncExternalStore } from "react";
|
|
23
23
|
import { css, styled } from "styled-components";
|
|
24
24
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
25
25
|
import ReactIs from "react-is";
|
|
@@ -44,7 +44,7 @@ function responsiveContainerWidthStyle(props) {
|
|
|
44
44
|
}
|
|
45
45
|
const StyledContainer = /* @__PURE__ */ styled(Box).withConfig({
|
|
46
46
|
displayName: "StyledContainer",
|
|
47
|
-
componentId: "sc-
|
|
47
|
+
componentId: "sc-c2h24p-0"
|
|
48
48
|
})(containerBaseStyle, responsiveContainerWidthStyle);
|
|
49
49
|
function ContainerComponent(props) {
|
|
50
50
|
let $ = c(12), as, ref, restProps, t0;
|
|
@@ -749,67 +749,63 @@ function TreeGroup(props) {
|
|
|
749
749
|
var treeItem = "_14vatmh0";
|
|
750
750
|
const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
|
|
751
751
|
displayName: "StyledTreeItem",
|
|
752
|
-
componentId: "sc-
|
|
752
|
+
componentId: "sc-mgt2q1-0"
|
|
753
753
|
})(treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled.a.withConfig({
|
|
754
754
|
displayName: "TreeItemBox",
|
|
755
|
-
componentId: "sc-
|
|
755
|
+
componentId: "sc-mgt2q1-1"
|
|
756
756
|
})(treeItemBoxStyle);
|
|
757
757
|
/**
|
|
758
758
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
759
759
|
* @beta
|
|
760
760
|
*/
|
|
761
761
|
function TreeItem(props) {
|
|
762
|
-
let $ = c(
|
|
763
|
-
$[0]
|
|
764
|
-
startTransition(() => _setRootElement(node));
|
|
765
|
-
}, $[0] = t5) : t5 = $[0];
|
|
766
|
-
let setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = useId(), id = idProp || _id, t6, t7;
|
|
767
|
-
if ($[1] !== id || $[2] !== path) {
|
|
762
|
+
let $ = c(93), { children, expanded: t0, fontSize: t1, href, icon: IconComponent, id: idProp, linkAs, linkProps, muted, onClick, padding: t2, selected: t3, gap: t4, text, weight, ...restProps } = props, expandedProp = t0 !== void 0 && t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 !== void 0 && t3, gap = t4 === void 0 ? 2 : t4, [rootElement, setRootElement] = useState(null), treeitemRef = useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = useId(), id = idProp || _id, t5, t6;
|
|
763
|
+
if ($[0] !== id || $[1] !== path) {
|
|
768
764
|
let itemPath = path.concat([id || ""]);
|
|
769
|
-
|
|
770
|
-
} else
|
|
771
|
-
let
|
|
772
|
-
$[
|
|
773
|
-
let [itemPath_0, itemKey] =
|
|
774
|
-
$[
|
|
765
|
+
t5 = itemPath, t6 = itemPath.join("/"), $[0] = id, $[1] = path, $[2] = t5, $[3] = t6;
|
|
766
|
+
} else t5 = $[2], t6 = $[3];
|
|
767
|
+
let t7;
|
|
768
|
+
$[4] !== t5 || $[5] !== t6 ? (t7 = [t5, t6], $[4] = t5, $[5] = t6, $[6] = t7) : t7 = $[6];
|
|
769
|
+
let [itemPath_0, itemKey] = t7, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t8 = tree.level + 1, t9;
|
|
770
|
+
$[7] !== itemPath_0 || $[8] !== t8 || $[9] !== tree ? (t9 = {
|
|
775
771
|
...tree,
|
|
776
|
-
level:
|
|
772
|
+
level: t8,
|
|
777
773
|
path: itemPath_0
|
|
778
|
-
}, $[
|
|
779
|
-
let contextValue =
|
|
780
|
-
$[
|
|
774
|
+
}, $[7] = itemPath_0, $[8] = t8, $[9] = tree, $[10] = t9) : t9 = $[10];
|
|
775
|
+
let contextValue = t9, t10;
|
|
776
|
+
$[11] !== expanded || $[12] !== itemKey || $[13] !== onClick || $[14] !== rootElement || $[15] !== setExpanded || $[16] !== setFocusedElement ? (t10 = (event) => {
|
|
781
777
|
onClick && onClick(event);
|
|
782
778
|
let target = event.target;
|
|
783
779
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest("[data-ui=\"TreeItem__box\"]")) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
|
|
784
|
-
}, $[
|
|
785
|
-
let handleClick =
|
|
786
|
-
$[
|
|
780
|
+
}, $[11] = expanded, $[12] = itemKey, $[13] = onClick, $[14] = rootElement, $[15] = setExpanded, $[16] = setFocusedElement, $[17] = t10) : t10 = $[17];
|
|
781
|
+
let handleClick = t10, t11;
|
|
782
|
+
$[18] !== focused || $[19] !== rootElement ? (t11 = (event_0) => {
|
|
787
783
|
focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
|
|
788
|
-
}, $[
|
|
789
|
-
let handleKeyDown = t12, t13
|
|
790
|
-
$[
|
|
784
|
+
}, $[18] = focused, $[19] = rootElement, $[20] = t11) : t11 = $[20];
|
|
785
|
+
let handleKeyDown = t11, t12, t13;
|
|
786
|
+
$[21] !== expanded || $[22] !== itemKey || $[23] !== registerItem || $[24] !== rootElement || $[25] !== selected ? (t12 = () => {
|
|
791
787
|
if (rootElement) return registerItem(rootElement, itemKey, expanded, selected);
|
|
792
|
-
},
|
|
788
|
+
}, t13 = [
|
|
793
789
|
expanded,
|
|
794
790
|
itemKey,
|
|
795
791
|
registerItem,
|
|
796
792
|
rootElement,
|
|
797
793
|
selected
|
|
798
|
-
], $[
|
|
799
|
-
let
|
|
800
|
-
$[
|
|
801
|
-
visibility:
|
|
794
|
+
], $[21] = expanded, $[22] = itemKey, $[23] = registerItem, $[24] = rootElement, $[25] = selected, $[26] = t12, $[27] = t13) : (t12 = $[26], t13 = $[27]), useEffect(t12, t13);
|
|
795
|
+
let t14 = IconComponent || children ? "visible" : "hidden", t15;
|
|
796
|
+
$[28] === t14 ? t15 = $[29] : (t15 = {
|
|
797
|
+
visibility: t14,
|
|
802
798
|
pointerEvents: "none"
|
|
803
|
-
}, $[
|
|
804
|
-
let
|
|
805
|
-
$[
|
|
799
|
+
}, $[28] = t14, $[29] = t15);
|
|
800
|
+
let t16;
|
|
801
|
+
$[30] !== IconComponent || $[31] !== fontSize || $[32] !== muted || $[33] !== weight ? (t16 = IconComponent && /* @__PURE__ */ jsx(Text, {
|
|
806
802
|
muted,
|
|
807
803
|
size: fontSize,
|
|
808
804
|
weight,
|
|
809
805
|
children: /* @__PURE__ */ jsx(IconComponent, {})
|
|
810
|
-
}), $[
|
|
811
|
-
let
|
|
812
|
-
$[
|
|
806
|
+
}), $[30] = IconComponent, $[31] = fontSize, $[32] = muted, $[33] = weight, $[34] = t16) : t16 = $[34];
|
|
807
|
+
let t17;
|
|
808
|
+
$[35] !== IconComponent || $[36] !== expanded || $[37] !== fontSize || $[38] !== muted || $[39] !== weight ? (t17 = !IconComponent && /* @__PURE__ */ jsx(Text, {
|
|
813
809
|
muted,
|
|
814
810
|
size: fontSize,
|
|
815
811
|
weight,
|
|
@@ -817,15 +813,15 @@ function TreeItem(props) {
|
|
|
817
813
|
className: "_14vatmh1",
|
|
818
814
|
style: { transform: expanded ? "rotate(90deg)" : void 0 }
|
|
819
815
|
})
|
|
820
|
-
}), $[
|
|
821
|
-
let
|
|
822
|
-
$[
|
|
816
|
+
}), $[35] = IconComponent, $[36] = expanded, $[37] = fontSize, $[38] = muted, $[39] = weight, $[40] = t17) : t17 = $[40];
|
|
817
|
+
let t18;
|
|
818
|
+
$[41] !== gap || $[42] !== t15 || $[43] !== t16 || $[44] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Box, {
|
|
823
819
|
marginRight: gap,
|
|
824
|
-
style:
|
|
825
|
-
children: [
|
|
826
|
-
}), $[
|
|
827
|
-
let
|
|
828
|
-
$[
|
|
820
|
+
style: t15,
|
|
821
|
+
children: [t16, t17]
|
|
822
|
+
}), $[41] = gap, $[42] = t15, $[43] = t16, $[44] = t17, $[45] = t18) : t18 = $[45];
|
|
823
|
+
let t19;
|
|
824
|
+
$[46] !== fontSize || $[47] !== muted || $[48] !== text || $[49] !== weight ? (t19 = /* @__PURE__ */ jsx(Box, {
|
|
829
825
|
flex: 1,
|
|
830
826
|
children: /* @__PURE__ */ jsx(Text, {
|
|
831
827
|
muted,
|
|
@@ -834,38 +830,38 @@ function TreeItem(props) {
|
|
|
834
830
|
weight,
|
|
835
831
|
children: text
|
|
836
832
|
})
|
|
837
|
-
}), $[
|
|
838
|
-
let
|
|
839
|
-
$[
|
|
833
|
+
}), $[46] = fontSize, $[47] = muted, $[48] = text, $[49] = weight, $[50] = t19) : t19 = $[50];
|
|
834
|
+
let t20;
|
|
835
|
+
$[51] !== padding || $[52] !== t18 || $[53] !== t19 ? (t20 = /* @__PURE__ */ jsxs(Flex, {
|
|
840
836
|
padding,
|
|
841
|
-
children: [
|
|
842
|
-
}), $[
|
|
843
|
-
let content =
|
|
837
|
+
children: [t18, t19]
|
|
838
|
+
}), $[51] = padding, $[52] = t18, $[53] = t19, $[54] = t20) : t20 = $[54];
|
|
839
|
+
let content = t20;
|
|
844
840
|
if (href) {
|
|
845
|
-
let
|
|
846
|
-
$[
|
|
841
|
+
let t21 = typeof linkAs == "string" ? linkAs : "a", t22;
|
|
842
|
+
$[55] !== content || $[56] !== expanded || $[57] !== href || $[58] !== linkAs || $[59] !== linkProps || $[60] !== t21 || $[61] !== tabIndex || $[62] !== tree.level ? (t22 = /* @__PURE__ */ jsx(TreeItemBox, {
|
|
847
843
|
...linkProps,
|
|
848
844
|
$level: tree.level,
|
|
849
845
|
"aria-expanded": expanded,
|
|
850
846
|
as: linkAs,
|
|
851
|
-
"data-as":
|
|
847
|
+
"data-as": t21,
|
|
852
848
|
"data-ui": "TreeItem__box",
|
|
853
849
|
href,
|
|
854
850
|
ref: treeitemRef,
|
|
855
851
|
role: "treeitem",
|
|
856
852
|
tabIndex,
|
|
857
853
|
children: content
|
|
858
|
-
}), $[
|
|
859
|
-
let
|
|
860
|
-
$[
|
|
854
|
+
}), $[55] = content, $[56] = expanded, $[57] = href, $[58] = linkAs, $[59] = linkProps, $[60] = t21, $[61] = tabIndex, $[62] = tree.level, $[63] = t22) : t22 = $[63];
|
|
855
|
+
let t23;
|
|
856
|
+
$[64] !== children || $[65] !== expanded ? (t23 = children && /* @__PURE__ */ jsx(TreeGroup, {
|
|
861
857
|
hidden: !expanded,
|
|
862
858
|
children
|
|
863
|
-
}), $[
|
|
864
|
-
let
|
|
865
|
-
return $[
|
|
859
|
+
}), $[64] = children, $[65] = expanded, $[66] = t23) : t23 = $[66];
|
|
860
|
+
let t24;
|
|
861
|
+
return $[67] !== contextValue || $[68] !== t23 ? (t24 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
866
862
|
value: contextValue,
|
|
867
|
-
children:
|
|
868
|
-
}), $[
|
|
863
|
+
children: t23
|
|
864
|
+
}), $[67] = contextValue, $[68] = t23, $[69] = t24) : t24 = $[69], /* @__PURE__ */ jsxs(StyledTreeItem, {
|
|
869
865
|
"data-selected": selected ? "" : void 0,
|
|
870
866
|
"data-tree-id": id,
|
|
871
867
|
"data-tree-key": itemKey,
|
|
@@ -875,42 +871,42 @@ function TreeItem(props) {
|
|
|
875
871
|
onClick: handleClick,
|
|
876
872
|
ref: setRootElement,
|
|
877
873
|
role: "none",
|
|
878
|
-
children: [
|
|
874
|
+
children: [t22, t24]
|
|
879
875
|
});
|
|
880
876
|
}
|
|
881
|
-
let T0 = StyledTreeItem,
|
|
882
|
-
$[
|
|
877
|
+
let T0 = StyledTreeItem, t21 = selected ? "" : void 0, t23 = clsx(treeItem, restProps.className), t24;
|
|
878
|
+
$[70] !== content || $[71] !== tree.level ? (t24 = /* @__PURE__ */ jsx(TreeItemBox, {
|
|
883
879
|
$level: tree.level,
|
|
884
880
|
as: "div",
|
|
885
881
|
"data-ui": "TreeItem__box",
|
|
886
882
|
children: content
|
|
887
|
-
}), $[
|
|
888
|
-
let
|
|
889
|
-
$[
|
|
883
|
+
}), $[70] = content, $[71] = tree.level, $[72] = t24) : t24 = $[72];
|
|
884
|
+
let t25;
|
|
885
|
+
$[73] !== children || $[74] !== expanded ? (t25 = children && /* @__PURE__ */ jsx(TreeGroup, {
|
|
890
886
|
expanded,
|
|
891
887
|
children
|
|
892
|
-
}), $[
|
|
893
|
-
let
|
|
894
|
-
$[
|
|
888
|
+
}), $[73] = children, $[74] = expanded, $[75] = t25) : t25 = $[75];
|
|
889
|
+
let t26;
|
|
890
|
+
$[76] !== contextValue || $[77] !== t25 ? (t26 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
895
891
|
value: contextValue,
|
|
896
|
-
children:
|
|
897
|
-
}), $[
|
|
898
|
-
let
|
|
899
|
-
return $[
|
|
900
|
-
"data-selected":
|
|
892
|
+
children: t25
|
|
893
|
+
}), $[76] = contextValue, $[77] = t25, $[78] = t26) : t26 = $[78];
|
|
894
|
+
let t27;
|
|
895
|
+
return $[79] !== T0 || $[80] !== expanded || $[81] !== handleClick || $[82] !== handleKeyDown || $[83] !== id || $[84] !== itemKey || $[85] !== restProps || $[86] !== setRootElement || $[87] !== t21 || $[88] !== t23 || $[89] !== t24 || $[90] !== t26 || $[91] !== tabIndex ? (t27 = /* @__PURE__ */ jsxs(T0, {
|
|
896
|
+
"data-selected": t21,
|
|
901
897
|
"data-ui": "TreeItem",
|
|
902
898
|
"data-tree-id": id,
|
|
903
899
|
"data-tree-key": itemKey,
|
|
904
900
|
...restProps,
|
|
905
901
|
"aria-expanded": expanded,
|
|
906
|
-
className:
|
|
902
|
+
className: t23,
|
|
907
903
|
onClick: handleClick,
|
|
908
904
|
onKeyDown: handleKeyDown,
|
|
909
905
|
ref: setRootElement,
|
|
910
906
|
role: "treeitem",
|
|
911
907
|
tabIndex,
|
|
912
|
-
children: [
|
|
913
|
-
}), $[
|
|
908
|
+
children: [t24, t26]
|
|
909
|
+
}), $[79] = T0, $[80] = expanded, $[81] = handleClick, $[82] = handleKeyDown, $[83] = id, $[84] = itemKey, $[85] = restProps, $[86] = setRootElement, $[87] = t21, $[88] = t23, $[89] = t24, $[90] = t26, $[91] = tabIndex, $[92] = t27) : t27 = $[92], t27;
|
|
914
910
|
}
|
|
915
911
|
/**
|
|
916
912
|
* @internal
|
|
@@ -997,7 +993,7 @@ function labelBaseStyle(props) {
|
|
|
997
993
|
}
|
|
998
994
|
const StyledLabel = /* @__PURE__ */ styled.div.withConfig({
|
|
999
995
|
displayName: "StyledLabel",
|
|
1000
|
-
componentId: "sc-
|
|
996
|
+
componentId: "sc-ws9v9t-0"
|
|
1001
997
|
})(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle);
|
|
1002
998
|
function LabelComponent(props) {
|
|
1003
999
|
let $ = c(27), accent, align, childrenProp, ref, restProps, t0, t1, textOverflow, weight;
|
|
@@ -1078,30 +1074,28 @@ function responsiveAvatarSizeStyle(props) {
|
|
|
1078
1074
|
var avatarArrow = "_1jezl1b0", avatarStack = "_1jezl1b4";
|
|
1079
1075
|
const StyledAvatar = /* @__PURE__ */ styled.div.withConfig({
|
|
1080
1076
|
displayName: "StyledAvatar",
|
|
1081
|
-
componentId: "sc-
|
|
1077
|
+
componentId: "sc-2lyi68-0"
|
|
1082
1078
|
})(responsiveAvatarSizeStyle, avatarRootStyle), InitialsLabel = /* @__PURE__ */ styled(Label).withConfig({
|
|
1083
1079
|
displayName: "InitialsLabel",
|
|
1084
|
-
componentId: "sc-
|
|
1080
|
+
componentId: "sc-2lyi68-1"
|
|
1085
1081
|
})({ color: "inherit" });
|
|
1086
1082
|
function AvatarComponent(props) {
|
|
1087
|
-
let $ = c(
|
|
1083
|
+
let $ = c(44), __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, ref, restProps, src, t0, t1, t2, title;
|
|
1088
1084
|
$[0] === props ? (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], ref = $[7], restProps = $[8], src = $[9], t0 = $[10], t1 = $[11], t2 = $[12], title = $[13]) : ({__unstable_hideInnerStroke, as: asProp, color: t0, src, title, initials, onImageLoadError, arrowPosition: arrowPositionProp, animateArrowFrom, ref, status: t1, size: t2, ...restProps} = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = ref, $[8] = restProps, $[9] = src, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = title);
|
|
1089
|
-
let color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, { avatar } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1),
|
|
1085
|
+
let color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, { avatar } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), [prevSrc, setPrevSrc] = useState(src);
|
|
1086
|
+
prevSrc !== src && (setPrevSrc(src), src && setImageFailed(!1));
|
|
1087
|
+
let imageId = `avatar-image-${elementId}`, t3, t4;
|
|
1090
1088
|
$[14] !== arrowPosition || $[15] !== arrowPositionProp ? (t3 = () => {
|
|
1091
1089
|
if (arrowPosition === arrowPositionProp) return;
|
|
1092
1090
|
let raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
|
|
1093
1091
|
return () => cancelAnimationFrame(raf);
|
|
1094
1092
|
}, t4 = [arrowPosition, arrowPositionProp], $[14] = arrowPosition, $[15] = arrowPositionProp, $[16] = t3, $[17] = t4) : (t3 = $[16], t4 = $[17]), useEffect(t3, t4);
|
|
1095
|
-
let t5
|
|
1096
|
-
$[18] ===
|
|
1097
|
-
src && setImageFailed(!1);
|
|
1098
|
-
}, t6 = [src], $[18] = src, $[19] = t5, $[20] = t6), useEffect(t5, t6);
|
|
1099
|
-
let t7;
|
|
1100
|
-
$[21] === onImageLoadError ? t7 = $[22] : (t7 = () => {
|
|
1093
|
+
let t5;
|
|
1094
|
+
$[18] === onImageLoadError ? t5 = $[19] : (t5 = () => {
|
|
1101
1095
|
setImageFailed(!0), onImageLoadError && onImageLoadError(/* @__PURE__ */ Error("Avatar: the image failed to load"));
|
|
1102
|
-
}, $[
|
|
1103
|
-
let handleImageError =
|
|
1104
|
-
$[
|
|
1096
|
+
}, $[18] = onImageLoadError, $[19] = t5);
|
|
1097
|
+
let handleImageError = t5, T0 = StyledAvatar, t6 = typeof as == "string" ? as : void 0, t8;
|
|
1098
|
+
$[20] === color ? t8 = $[21] : (t8 = /* @__PURE__ */ jsx("div", {
|
|
1105
1099
|
className: avatarArrow,
|
|
1106
1100
|
children: /* @__PURE__ */ jsx("svg", {
|
|
1107
1101
|
width: "11",
|
|
@@ -1113,9 +1107,9 @@ function AvatarComponent(props) {
|
|
|
1113
1107
|
fill: color
|
|
1114
1108
|
})
|
|
1115
1109
|
})
|
|
1116
|
-
}), $[
|
|
1117
|
-
let
|
|
1118
|
-
$[
|
|
1110
|
+
}), $[20] = color, $[21] = t8);
|
|
1111
|
+
let t9;
|
|
1112
|
+
$[22] !== __unstable_hideInnerStroke || $[23] !== _radius || $[24] !== _sizeRem || $[25] !== handleImageError || $[26] !== imageFailed || $[27] !== imageId || $[28] !== src ? (t9 = !imageFailed && src && /* @__PURE__ */ jsxs("svg", {
|
|
1119
1113
|
className: "_1jezl1b1",
|
|
1120
1114
|
viewBox: `0 0 ${_sizeRem} ${_sizeRem}`,
|
|
1121
1115
|
fill: "none",
|
|
@@ -1155,8 +1149,8 @@ function AvatarComponent(props) {
|
|
|
1155
1149
|
vectorEffect: "non-scaling-stroke"
|
|
1156
1150
|
})
|
|
1157
1151
|
]
|
|
1158
|
-
}), $[
|
|
1159
|
-
let
|
|
1152
|
+
}), $[22] = __unstable_hideInnerStroke, $[23] = _radius, $[24] = _sizeRem, $[25] = handleImageError, $[26] = imageFailed, $[27] = imageId, $[28] = src, $[29] = t9) : t9 = $[29];
|
|
1153
|
+
let t10 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("div", {
|
|
1160
1154
|
className: "_1jezl1b5",
|
|
1161
1155
|
children: /* @__PURE__ */ jsx(InitialsLabel, {
|
|
1162
1156
|
forwardedAs: "span",
|
|
@@ -1164,10 +1158,10 @@ function AvatarComponent(props) {
|
|
|
1164
1158
|
weight: "medium",
|
|
1165
1159
|
children: initials
|
|
1166
1160
|
})
|
|
1167
|
-
}) }),
|
|
1168
|
-
return $[
|
|
1161
|
+
}) }), t11;
|
|
1162
|
+
return $[30] !== T0 || $[31] !== arrowPosition || $[32] !== as || $[33] !== color || $[34] !== ref || $[35] !== restProps || $[36] !== size || $[37] !== status || $[38] !== t10 || $[39] !== t6 || $[40] !== t8 || $[41] !== t9 || $[42] !== title ? (t11 = /* @__PURE__ */ jsxs(T0, {
|
|
1169
1163
|
as,
|
|
1170
|
-
"data-as":
|
|
1164
|
+
"data-as": t6,
|
|
1171
1165
|
"data-ui": "Avatar",
|
|
1172
1166
|
...restProps,
|
|
1173
1167
|
$color: color,
|
|
@@ -1178,11 +1172,11 @@ function AvatarComponent(props) {
|
|
|
1178
1172
|
ref,
|
|
1179
1173
|
title,
|
|
1180
1174
|
children: [
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1175
|
+
t8,
|
|
1176
|
+
t9,
|
|
1177
|
+
t10
|
|
1184
1178
|
]
|
|
1185
|
-
}), $[
|
|
1179
|
+
}), $[30] = T0, $[31] = arrowPosition, $[32] = as, $[33] = color, $[34] = ref, $[35] = restProps, $[36] = size, $[37] = status, $[38] = t10, $[39] = t6, $[40] = t8, $[41] = t9, $[42] = title, $[43] = t11) : t11 = $[43], t11;
|
|
1186
1180
|
}
|
|
1187
1181
|
function _temp$2(s) {
|
|
1188
1182
|
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
@@ -1410,7 +1404,7 @@ function headingBaseStyle(props) {
|
|
|
1410
1404
|
}
|
|
1411
1405
|
const StyledHeading = /* @__PURE__ */ styled.div.withConfig({
|
|
1412
1406
|
displayName: "StyledHeading",
|
|
1413
|
-
componentId: "sc-
|
|
1407
|
+
componentId: "sc-r76jut-0"
|
|
1414
1408
|
})(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont);
|
|
1415
1409
|
function HeadingComponent(props) {
|
|
1416
1410
|
let $ = c(27), align, childrenProp, ref, restProps, t0, t1, t2, textOverflow, weight;
|