@sanity/ui 1.0.11 → 1.0.13
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.cjs.mjs +2 -0
- package/dist/index.esm.js +856 -835
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +856 -835
- package/dist/index.js.map +1 -1
- package/package.json +19 -19
package/dist/index.esm.js
CHANGED
|
@@ -1,63 +1,5 @@
|
|
|
1
1
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47, _templateObject48, _templateObject49, _templateObject50, _templateObject51, _templateObject52, _templateObject53, _templateObject54, _templateObject55, _templateObject56, _templateObject57, _templateObject58, _templateObject59, _templateObject60, _templateObject61, _templateObject62, _templateObject63, _templateObject64, _templateObject65, _templateObject66, _templateObject67, _templateObject68, _templateObject69, _templateObject70, _templateObject71, _templateObject72, _templateObject73, _templateObject74, _templateObject75, _templateObject76, _templateObject77, _templateObject78, _templateObject79, _templateObject80, _templateObject81, _templateObject82, _templateObject83, _templateObject84, _templateObject85, _templateObject86, _templateObject87, _templateObject88, _templateObject89, _templateObject90;
|
|
2
|
-
const _excluded = ["color", "layer"],
|
|
3
|
-
_excluded2 = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"],
|
|
4
|
-
_excluded3 = ["as", "color", "src", "title", "initials", "onImageLoadError", "arrowPosition", "animateArrowFrom", "status", "size"],
|
|
5
|
-
_excluded4 = ["children", "maxLength", "size"],
|
|
6
|
-
_excluded5 = ["as", "column", "columnStart", "columnEnd", "display", "flex", "height", "margin", "marginX", "marginY", "marginTop", "marginRight", "marginBottom", "marginLeft", "overflow", "padding", "paddingX", "paddingY", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "row", "rowStart", "rowEnd", "sizing"],
|
|
7
|
-
_excluded6 = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"],
|
|
8
|
-
_excluded7 = ["children", "fontSize", "mode", "padding", "radius", "tone"],
|
|
9
|
-
_excluded8 = ["align", "as", "direction", "gap", "justify", "wrap"],
|
|
10
|
-
_excluded9 = ["children", "disabled", "fontSize", "icon", "iconRight", "justify", "loading", "mode", "padding", "paddingX", "paddingY", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "radius", "selected", "space", "text", "textAlign", "tone", "type"],
|
|
11
|
-
_excluded10 = ["__unstable_checkered", "__unstable_focusRing", "as", "border", "borderTop", "borderRight", "borderBottom", "borderLeft", "pressed", "radius", "scheme", "selected", "shadow", "tone"],
|
|
12
|
-
_excluded11 = ["checked", "className", "disabled", "indeterminate", "customValidity", "readOnly", "style"],
|
|
13
|
-
_excluded12 = ["children", "language", "size", "weight"],
|
|
14
|
-
_excluded13 = ["as", "width"],
|
|
15
|
-
_excluded14 = ["as", "autoRows", "autoCols", "autoFlow", "columns", "gap", "gapX", "gapY", "rows", "children"],
|
|
16
|
-
_excluded15 = ["accent", "align", "children", "muted", "size", "textOverflow", "weight"],
|
|
17
|
-
_excluded16 = ["as", "children", "space"],
|
|
18
|
-
_excluded17 = ["children", "fontSize", "padding", "radius"],
|
|
19
|
-
_excluded18 = ["children", "media"],
|
|
20
|
-
_excluded19 = ["children", "style"],
|
|
21
|
-
_excluded20 = ["children", "zOffset"],
|
|
22
|
-
_excluded21 = ["as", "gap", "getItemKey", "items", "onChange", "renderItem"],
|
|
23
|
-
_excluded22 = ["__unstable_margins", "arrow", "arrowRef", "arrowX", "arrowY", "boundaryWidth", "children", "padding", "placement", "overflow", "radius", "scheme", "shadow", "strategy", "style", "tone", "width", "x", "y"],
|
|
24
|
-
_excluded23 = ["__unstable_margins", "arrow", "boundaryElement", "children", "constrainSize", "content", "disabled", "fallbackPlacements", "matchReferenceWidth", "open", "overflow", "padding", "placement", "portal", "preventOverflow", "radius", "referenceElement", "scheme", "shadow", "tone", "width", "zOffset"],
|
|
25
|
-
_excluded24 = ["className", "disabled", "style", "customValidity", "readOnly"],
|
|
26
|
-
_excluded25 = ["children", "customValidity", "disabled", "fontSize", "padding", "radius", "readOnly", "space"],
|
|
27
|
-
_excluded26 = ["as", "space"],
|
|
28
|
-
_excluded27 = ["checked", "className", "disabled", "indeterminate", "readOnly", "style"],
|
|
29
|
-
_excluded28 = ["border", "customValidity", "disabled", "fontSize", "padding", "radius", "weight"],
|
|
30
|
-
_excluded29 = ["border", "clearButton", "disabled", "fontSize", "icon", "iconRight", "onClear", "padding", "prefix", "radius", "readOnly", "space", "suffix", "customValidity", "type", "weight"],
|
|
31
|
-
_excluded30 = ["boundaryElement", "children", "content", "disabled", "fallbackPlacements", "padding", "placement", "portal", "scheme", "shadow", "zOffset"],
|
|
32
|
-
_excluded31 = ["border", "customValidity", "disabled", "filterOption", "fontSize", "icon", "id", "listBox", "loading", "onBlur", "onChange", "onFocus", "onQueryChange", "onSelect", "openButton", "options", "padding", "popover", "prefix", "radius", "readOnly", "relatedElements", "renderOption", "renderPopover", "renderValue", "suffix", "value"],
|
|
33
|
-
_excluded32 = ["children", "maxLength", "separator", "space"],
|
|
34
|
-
_excluded33 = ["__unstable_autoFocus", "__unstable_hideCloseButton", "cardRadius", "cardShadow", "children", "contentRef", "footer", "header", "id", "onClickOutside", "onClose", "padding", "portal", "position", "scheme", "width", "zOffset"],
|
|
35
|
-
_excluded34 = ["fontSize", "keys", "padding", "radius", "space"],
|
|
36
|
-
_excluded35 = ["children", "focusFirst", "focusLast", "onClickOutside", "onEscape", "onItemClick", "onItemSelect", "onKeyDown", "originElement", "padding", "registerElement", "shouldFocus", "space"],
|
|
37
|
-
_excluded36 = ["as", "children", "fontSize", "icon", "onClick", "padding", "popover", "radius", "space", "text", "tone"],
|
|
38
|
-
_excluded37 = ["as", "children", "disabled", "fontSize", "hotkeys", "icon", "iconRight", "onClick", "padding", "paddingX", "paddingY", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "pressed", "radius", "selected", "space", "text", "tone"],
|
|
39
|
-
_excluded38 = ["animated", "delay", "radius"],
|
|
40
|
-
_excluded39 = ["size"],
|
|
41
|
-
_excluded40 = ["size"],
|
|
42
|
-
_excluded41 = ["size"],
|
|
43
|
-
_excluded42 = ["size"],
|
|
44
|
-
_excluded43 = ["icon", "id", "focused", "fontSize", "label", "onClick", "onFocus", "padding", "selected"],
|
|
45
|
-
_excluded44 = ["children"],
|
|
46
|
-
_excluded45 = ["flex"],
|
|
47
|
-
_excluded46 = ["closable", "description", "onClose", "title", "status"],
|
|
48
|
-
_excluded47 = ["children", "space"],
|
|
49
|
-
_excluded48 = ["children", "expanded"],
|
|
50
|
-
_excluded49 = ["children", "expanded", "fontSize", "href", "icon", "id", "muted", "onClick", "padding", "selected", "space", "text", "weight"];
|
|
51
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
52
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
53
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
54
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
55
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
56
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
57
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
58
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
59
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
60
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
61
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
62
4
|
import { useMemo, useState, useRef, useEffect, createContext, useContext, useSyncExternalStore, useLayoutEffect, forwardRef, useId, useCallback, cloneElement, isValidElement, createElement, Component, memo, useReducer, Children, Fragment as Fragment$1, startTransition } from 'react';
|
|
63
5
|
import ReactIs, { isElement as isElement$1, isFragment, isValidElementType } from 'react-is';
|
|
@@ -223,7 +165,10 @@ function responsiveTextFont(props) {
|
|
|
223
165
|
}
|
|
224
166
|
function useArrayProp(val, defaultVal) {
|
|
225
167
|
const __perf_hash__ = useMemo(() => JSON.stringify(val != null ? val : defaultVal), [defaultVal, val]);
|
|
226
|
-
return useMemo(() => _getArrayProp(val, defaultVal),
|
|
168
|
+
return useMemo(() => _getArrayProp(val, defaultVal),
|
|
169
|
+
// Improve performance: Keep object identify for a given hash of the value
|
|
170
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
171
|
+
[__perf_hash__]);
|
|
227
172
|
}
|
|
228
173
|
function _getElements(element, elementsArg) {
|
|
229
174
|
const ret = [element];
|
|
@@ -1396,7 +1341,8 @@ const defaultOpts = {
|
|
|
1396
1341
|
solid
|
|
1397
1342
|
} = _ref7;
|
|
1398
1343
|
if (mode === "bleed") {
|
|
1399
|
-
return
|
|
1344
|
+
return {
|
|
1345
|
+
...muted,
|
|
1400
1346
|
enabled: {
|
|
1401
1347
|
bg: "transparent",
|
|
1402
1348
|
bg2: "transparent",
|
|
@@ -1437,11 +1383,12 @@ const defaultOpts = {
|
|
|
1437
1383
|
},
|
|
1438
1384
|
skeleton: base.skeleton
|
|
1439
1385
|
}
|
|
1440
|
-
}
|
|
1386
|
+
};
|
|
1441
1387
|
}
|
|
1442
|
-
if (mode === "ghost") return
|
|
1388
|
+
if (mode === "ghost") return {
|
|
1389
|
+
...solid,
|
|
1443
1390
|
enabled: muted.enabled
|
|
1444
|
-
}
|
|
1391
|
+
};
|
|
1445
1392
|
return solid;
|
|
1446
1393
|
},
|
|
1447
1394
|
card: _ref8 => {
|
|
@@ -2158,7 +2105,10 @@ function createSpot(opts, base, dark) {
|
|
|
2158
2105
|
}
|
|
2159
2106
|
function createColorTheme() {
|
|
2160
2107
|
let partialOpts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2161
|
-
const builders =
|
|
2108
|
+
const builders = {
|
|
2109
|
+
...defaultOpts,
|
|
2110
|
+
...partialOpts
|
|
2111
|
+
};
|
|
2162
2112
|
return {
|
|
2163
2113
|
light: _createColorScheme(builders, false),
|
|
2164
2114
|
dark: _createColorScheme(builders, true)
|
|
@@ -2596,30 +2546,37 @@ const color = createColorTheme({
|
|
|
2596
2546
|
} = _ref14;
|
|
2597
2547
|
if (mode === "bleed") {
|
|
2598
2548
|
return {
|
|
2599
|
-
enabled:
|
|
2549
|
+
enabled: {
|
|
2550
|
+
...muted.enabled,
|
|
2600
2551
|
border: muted.enabled.bg
|
|
2601
|
-
}
|
|
2602
|
-
hovered:
|
|
2552
|
+
},
|
|
2553
|
+
hovered: {
|
|
2554
|
+
...muted.hovered,
|
|
2603
2555
|
border: muted.hovered.bg
|
|
2604
|
-
}
|
|
2605
|
-
pressed:
|
|
2556
|
+
},
|
|
2557
|
+
pressed: {
|
|
2558
|
+
...muted.pressed,
|
|
2606
2559
|
border: muted.pressed.bg
|
|
2607
|
-
}
|
|
2608
|
-
selected:
|
|
2560
|
+
},
|
|
2561
|
+
selected: {
|
|
2562
|
+
...muted.selected,
|
|
2609
2563
|
border: muted.selected.bg
|
|
2610
|
-
}
|
|
2611
|
-
disabled:
|
|
2564
|
+
},
|
|
2565
|
+
disabled: {
|
|
2566
|
+
...muted.disabled,
|
|
2612
2567
|
border: muted.disabled.bg
|
|
2613
|
-
}
|
|
2568
|
+
}
|
|
2614
2569
|
};
|
|
2615
2570
|
}
|
|
2616
2571
|
if (mode === "ghost") {
|
|
2617
|
-
return
|
|
2618
|
-
|
|
2572
|
+
return {
|
|
2573
|
+
...solid,
|
|
2574
|
+
enabled: {
|
|
2575
|
+
...muted.enabled,
|
|
2619
2576
|
border: base.border
|
|
2620
|
-
}
|
|
2577
|
+
},
|
|
2621
2578
|
disabled: muted.disabled
|
|
2622
|
-
}
|
|
2579
|
+
};
|
|
2623
2580
|
}
|
|
2624
2581
|
return solid;
|
|
2625
2582
|
},
|
|
@@ -2736,9 +2693,10 @@ const color = createColorTheme({
|
|
|
2736
2693
|
state
|
|
2737
2694
|
} = _ref17;
|
|
2738
2695
|
if (state === "enabled") {
|
|
2739
|
-
return
|
|
2696
|
+
return {
|
|
2697
|
+
...muted[tone].enabled,
|
|
2740
2698
|
bg: base.bg
|
|
2741
|
-
}
|
|
2699
|
+
};
|
|
2742
2700
|
}
|
|
2743
2701
|
if (state === "pressed") {
|
|
2744
2702
|
if (tone === "default") {
|
|
@@ -2753,9 +2711,10 @@ const color = createColorTheme({
|
|
|
2753
2711
|
return solid[tone].enabled;
|
|
2754
2712
|
}
|
|
2755
2713
|
if (state === "disabled") {
|
|
2756
|
-
return
|
|
2714
|
+
return {
|
|
2715
|
+
...muted[tone].disabled,
|
|
2757
2716
|
bg: base.bg
|
|
2758
|
-
}
|
|
2717
|
+
};
|
|
2759
2718
|
}
|
|
2760
2719
|
return muted[tone][state];
|
|
2761
2720
|
},
|
|
@@ -3071,7 +3030,20 @@ const studioTheme = {
|
|
|
3071
3030
|
width: 1
|
|
3072
3031
|
}
|
|
3073
3032
|
}
|
|
3033
|
+
// styles: {
|
|
3034
|
+
// button: {
|
|
3035
|
+
// root: {
|
|
3036
|
+
// transition: 'background-color 100ms,border-color 100ms,color 100ms',
|
|
3037
|
+
// },
|
|
3038
|
+
// },
|
|
3039
|
+
// card: {
|
|
3040
|
+
// root: {
|
|
3041
|
+
// transition: 'background-color 100ms,border-color 100ms,color 100ms',
|
|
3042
|
+
// },
|
|
3043
|
+
// },
|
|
3044
|
+
// },
|
|
3074
3045
|
};
|
|
3046
|
+
|
|
3075
3047
|
const DEFAULT_THEME_LAYER = {
|
|
3076
3048
|
dialog: {
|
|
3077
3049
|
zOffset: 600
|
|
@@ -3105,18 +3077,19 @@ function ThemeProvider(props) {
|
|
|
3105
3077
|
const theme = useMemo(() => {
|
|
3106
3078
|
if (!themeProp) return null;
|
|
3107
3079
|
const {
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3080
|
+
color: rootColor,
|
|
3081
|
+
layer: rootLayer,
|
|
3082
|
+
...restTheme
|
|
3083
|
+
} = themeProp;
|
|
3112
3084
|
const colorScheme = rootColor[scheme] || rootColor.light;
|
|
3113
3085
|
const color = colorScheme[tone] || colorScheme.default;
|
|
3114
3086
|
const layer = rootLayer || DEFAULT_THEME_LAYER;
|
|
3115
3087
|
return {
|
|
3116
|
-
sanity:
|
|
3088
|
+
sanity: {
|
|
3089
|
+
...restTheme,
|
|
3117
3090
|
color,
|
|
3118
3091
|
layer
|
|
3119
|
-
}
|
|
3092
|
+
}
|
|
3120
3093
|
};
|
|
3121
3094
|
}, [scheme, themeProp, tone]);
|
|
3122
3095
|
const value = useMemo(() => themeProp && {
|
|
@@ -3785,9 +3758,10 @@ function responsiveInputPaddingStyle(props) {
|
|
|
3785
3758
|
});
|
|
3786
3759
|
}
|
|
3787
3760
|
function responsiveInputPaddingIconRightStyle(props) {
|
|
3788
|
-
return responsiveInputPaddingStyle(
|
|
3761
|
+
return responsiveInputPaddingStyle({
|
|
3762
|
+
...props,
|
|
3789
3763
|
$iconRight: true
|
|
3790
|
-
})
|
|
3764
|
+
});
|
|
3791
3765
|
}
|
|
3792
3766
|
const ROOT_STYLE = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));
|
|
3793
3767
|
function textInputRootStyle() {
|
|
@@ -3917,24 +3891,24 @@ const Root$E = styled.div(responsiveTextFont, responsiveTextAlignStyle, textBase
|
|
|
3917
3891
|
const SpanWithTextOverflow$2 = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
3918
3892
|
const Text = forwardRef(function Text2(props, ref) {
|
|
3919
3893
|
const {
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3894
|
+
accent = false,
|
|
3895
|
+
align,
|
|
3896
|
+
children: childrenProp,
|
|
3897
|
+
muted = false,
|
|
3898
|
+
size = 2,
|
|
3899
|
+
textOverflow,
|
|
3900
|
+
weight,
|
|
3901
|
+
...restProps
|
|
3902
|
+
} = props;
|
|
3929
3903
|
let children = childrenProp;
|
|
3930
3904
|
if (textOverflow === "ellipsis") {
|
|
3931
3905
|
children = /* @__PURE__ */jsx(SpanWithTextOverflow$2, {
|
|
3932
3906
|
children
|
|
3933
3907
|
});
|
|
3934
3908
|
}
|
|
3935
|
-
return /* @__PURE__ */jsx(Root$E,
|
|
3936
|
-
"data-ui": "Text"
|
|
3937
|
-
|
|
3909
|
+
return /* @__PURE__ */jsx(Root$E, {
|
|
3910
|
+
"data-ui": "Text",
|
|
3911
|
+
...restProps,
|
|
3938
3912
|
$accent: accent,
|
|
3939
3913
|
$align: useArrayProp(align),
|
|
3940
3914
|
$muted: muted,
|
|
@@ -3944,7 +3918,7 @@ const Text = forwardRef(function Text2(props, ref) {
|
|
|
3944
3918
|
children: /* @__PURE__ */jsx("span", {
|
|
3945
3919
|
children
|
|
3946
3920
|
})
|
|
3947
|
-
})
|
|
3921
|
+
});
|
|
3948
3922
|
});
|
|
3949
3923
|
const avatarStyle = {
|
|
3950
3924
|
root: avatarRootStyle,
|
|
@@ -4012,6 +3986,7 @@ function avatarRootStyle(props) {
|
|
|
4012
3986
|
display: "block"
|
|
4013
3987
|
}
|
|
4014
3988
|
},
|
|
3989
|
+
/* &:is(button) */
|
|
4015
3990
|
'&[data-as="button"]': {
|
|
4016
3991
|
"-webkit-font-smoothing": "inherit",
|
|
4017
3992
|
appearance: "none",
|
|
@@ -4097,18 +4072,18 @@ const Stroke = styled.ellipse(avatarStyle.stroke);
|
|
|
4097
4072
|
const Initials = styled.div(avatarStyle.initials);
|
|
4098
4073
|
const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
4099
4074
|
const {
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4075
|
+
as: asProp,
|
|
4076
|
+
color: colorKey = "gray",
|
|
4077
|
+
src,
|
|
4078
|
+
title,
|
|
4079
|
+
initials,
|
|
4080
|
+
onImageLoadError,
|
|
4081
|
+
arrowPosition: arrowPositionProp,
|
|
4082
|
+
animateArrowFrom,
|
|
4083
|
+
status = "online",
|
|
4084
|
+
size: sizeProp = 0,
|
|
4085
|
+
...restProps
|
|
4086
|
+
} = props;
|
|
4112
4087
|
const as = ReactIs.isValidElementType(asProp) ? asProp : "div";
|
|
4113
4088
|
const size = useArrayProp(sizeProp);
|
|
4114
4089
|
const theme = useTheme();
|
|
@@ -4135,11 +4110,11 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
4135
4110
|
}
|
|
4136
4111
|
}, [onImageLoadError]);
|
|
4137
4112
|
const initialsSize = useMemo(() => size.map(s => s === 0 ? 0 : s + 1), [size]);
|
|
4138
|
-
return /* @__PURE__ */jsxs(Root$D,
|
|
4113
|
+
return /* @__PURE__ */jsxs(Root$D, {
|
|
4139
4114
|
as,
|
|
4140
4115
|
"data-as": typeof as === "string" ? as : void 0,
|
|
4141
|
-
"data-ui": "Avatar"
|
|
4142
|
-
|
|
4116
|
+
"data-ui": "Avatar",
|
|
4117
|
+
...restProps,
|
|
4143
4118
|
$size: size,
|
|
4144
4119
|
$color: color,
|
|
4145
4120
|
"aria-label": title,
|
|
@@ -4204,7 +4179,7 @@ const Avatar = forwardRef(function Avatar2(props, ref) {
|
|
|
4204
4179
|
})
|
|
4205
4180
|
})
|
|
4206
4181
|
})]
|
|
4207
|
-
})
|
|
4182
|
+
});
|
|
4208
4183
|
});
|
|
4209
4184
|
function _responsiveAvatarCounterSizeStyle(props) {
|
|
4210
4185
|
const {
|
|
@@ -4280,11 +4255,11 @@ function responsiveAvatarStackSizeStyle(props) {
|
|
|
4280
4255
|
const Root$B = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle);
|
|
4281
4256
|
const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
4282
4257
|
const {
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4258
|
+
children: childrenProp,
|
|
4259
|
+
maxLength: maxLengthProp = 4,
|
|
4260
|
+
size: sizeProp = 0,
|
|
4261
|
+
...restProps
|
|
4262
|
+
} = props;
|
|
4288
4263
|
const children = childrenToElementArray(childrenProp).filter(child => typeof child !== "string");
|
|
4289
4264
|
const maxLength = Math.max(maxLengthProp, 0);
|
|
4290
4265
|
const size = useArrayProp(sizeProp);
|
|
@@ -4292,9 +4267,9 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
4292
4267
|
const visibleCount = maxLength - 1;
|
|
4293
4268
|
const extraCount = len - visibleCount;
|
|
4294
4269
|
const visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
|
|
4295
|
-
return /* @__PURE__ */jsxs(Root$B,
|
|
4296
|
-
"data-ui": "AvatarStack"
|
|
4297
|
-
|
|
4270
|
+
return /* @__PURE__ */jsxs(Root$B, {
|
|
4271
|
+
"data-ui": "AvatarStack",
|
|
4272
|
+
...restProps,
|
|
4298
4273
|
ref,
|
|
4299
4274
|
$size: size,
|
|
4300
4275
|
children: [len === 0 && /* @__PURE__ */jsx("div", {
|
|
@@ -4311,43 +4286,43 @@ const AvatarStack = forwardRef(function AvatarStack2(props, ref) {
|
|
|
4311
4286
|
size
|
|
4312
4287
|
})
|
|
4313
4288
|
}, String(childIndex)))]
|
|
4314
|
-
})
|
|
4289
|
+
});
|
|
4315
4290
|
});
|
|
4316
4291
|
const Root$A = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle);
|
|
4317
4292
|
const Box = forwardRef(function Box2(props, ref) {
|
|
4318
4293
|
const {
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
return /* @__PURE__ */jsx(Root$A,
|
|
4294
|
+
as: asProp = "div",
|
|
4295
|
+
column,
|
|
4296
|
+
columnStart,
|
|
4297
|
+
columnEnd,
|
|
4298
|
+
display = "block",
|
|
4299
|
+
flex,
|
|
4300
|
+
height,
|
|
4301
|
+
margin = 0,
|
|
4302
|
+
marginX,
|
|
4303
|
+
marginY,
|
|
4304
|
+
marginTop,
|
|
4305
|
+
marginRight,
|
|
4306
|
+
marginBottom,
|
|
4307
|
+
marginLeft,
|
|
4308
|
+
overflow,
|
|
4309
|
+
padding = 0,
|
|
4310
|
+
paddingX,
|
|
4311
|
+
paddingY,
|
|
4312
|
+
paddingTop,
|
|
4313
|
+
paddingRight,
|
|
4314
|
+
paddingBottom,
|
|
4315
|
+
paddingLeft,
|
|
4316
|
+
row,
|
|
4317
|
+
rowStart,
|
|
4318
|
+
rowEnd,
|
|
4319
|
+
sizing,
|
|
4320
|
+
...restProps
|
|
4321
|
+
} = props;
|
|
4322
|
+
return /* @__PURE__ */jsx(Root$A, {
|
|
4348
4323
|
"data-as": typeof asProp === "string" ? asProp : void 0,
|
|
4349
|
-
"data-ui": "Box"
|
|
4350
|
-
|
|
4324
|
+
"data-ui": "Box",
|
|
4325
|
+
...restProps,
|
|
4351
4326
|
$column: useArrayProp(column),
|
|
4352
4327
|
$columnStart: useArrayProp(columnStart),
|
|
4353
4328
|
$columnEnd: useArrayProp(columnEnd),
|
|
@@ -4376,7 +4351,7 @@ const Box = forwardRef(function Box2(props, ref) {
|
|
|
4376
4351
|
as: asProp,
|
|
4377
4352
|
ref,
|
|
4378
4353
|
children: props.children
|
|
4379
|
-
})
|
|
4354
|
+
});
|
|
4380
4355
|
});
|
|
4381
4356
|
function labelBaseStyle(props) {
|
|
4382
4357
|
const {
|
|
@@ -4393,15 +4368,15 @@ const Root$z = styled.div(responsiveLabelFont, responsiveTextAlignStyle, labelBa
|
|
|
4393
4368
|
const SpanWithTextOverflow$1 = styled.span(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
4394
4369
|
const Label = forwardRef(function Label2(props, ref) {
|
|
4395
4370
|
const {
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4371
|
+
accent,
|
|
4372
|
+
align,
|
|
4373
|
+
children: childrenProp,
|
|
4374
|
+
muted = false,
|
|
4375
|
+
size = 2,
|
|
4376
|
+
textOverflow,
|
|
4377
|
+
weight,
|
|
4378
|
+
...restProps
|
|
4379
|
+
} = props;
|
|
4405
4380
|
let children = childrenProp;
|
|
4406
4381
|
if (textOverflow === "ellipsis") {
|
|
4407
4382
|
children = /* @__PURE__ */jsx(SpanWithTextOverflow$1, {
|
|
@@ -4412,9 +4387,9 @@ const Label = forwardRef(function Label2(props, ref) {
|
|
|
4412
4387
|
children
|
|
4413
4388
|
});
|
|
4414
4389
|
}
|
|
4415
|
-
return /* @__PURE__ */jsx(Root$z,
|
|
4416
|
-
"data-ui": "Label"
|
|
4417
|
-
|
|
4390
|
+
return /* @__PURE__ */jsx(Root$z, {
|
|
4391
|
+
"data-ui": "Label",
|
|
4392
|
+
...restProps,
|
|
4418
4393
|
$accent: accent,
|
|
4419
4394
|
$align: useArrayProp(align),
|
|
4420
4395
|
$muted: muted,
|
|
@@ -4422,7 +4397,7 @@ const Label = forwardRef(function Label2(props, ref) {
|
|
|
4422
4397
|
$weight: weight,
|
|
4423
4398
|
ref,
|
|
4424
4399
|
children
|
|
4425
|
-
})
|
|
4400
|
+
});
|
|
4426
4401
|
});
|
|
4427
4402
|
function badgeStyle(props) {
|
|
4428
4403
|
const {
|
|
@@ -4445,17 +4420,17 @@ function badgeStyle(props) {
|
|
|
4445
4420
|
const Root$y = styled(Box)(responsiveRadiusStyle, badgeStyle);
|
|
4446
4421
|
const Badge = forwardRef(function Badge2(props, ref) {
|
|
4447
4422
|
const {
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
return /* @__PURE__ */jsx(Root$y,
|
|
4457
|
-
"data-ui": "Badge"
|
|
4458
|
-
|
|
4423
|
+
children,
|
|
4424
|
+
fontSize,
|
|
4425
|
+
mode = "default",
|
|
4426
|
+
padding = 1,
|
|
4427
|
+
radius = 2,
|
|
4428
|
+
tone = "default",
|
|
4429
|
+
...restProps
|
|
4430
|
+
} = props;
|
|
4431
|
+
return /* @__PURE__ */jsx(Root$y, {
|
|
4432
|
+
"data-ui": "Badge",
|
|
4433
|
+
...restProps,
|
|
4459
4434
|
$mode: mode,
|
|
4460
4435
|
$tone: tone,
|
|
4461
4436
|
$radius: useArrayProp(radius),
|
|
@@ -4465,22 +4440,22 @@ const Badge = forwardRef(function Badge2(props, ref) {
|
|
|
4465
4440
|
size: fontSize,
|
|
4466
4441
|
children
|
|
4467
4442
|
})
|
|
4468
|
-
})
|
|
4443
|
+
});
|
|
4469
4444
|
});
|
|
4470
4445
|
const Root$x = styled(Box)(flexItemStyle, responsiveFlexStyle);
|
|
4471
4446
|
const Flex = forwardRef(function Flex2(props, ref) {
|
|
4472
4447
|
const {
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
return /* @__PURE__ */jsx(Root$x,
|
|
4482
|
-
"data-ui": "Flex"
|
|
4483
|
-
|
|
4448
|
+
align,
|
|
4449
|
+
as,
|
|
4450
|
+
direction = "row",
|
|
4451
|
+
gap,
|
|
4452
|
+
justify,
|
|
4453
|
+
wrap,
|
|
4454
|
+
...restProps
|
|
4455
|
+
} = props;
|
|
4456
|
+
return /* @__PURE__ */jsx(Root$x, {
|
|
4457
|
+
"data-ui": "Flex",
|
|
4458
|
+
...restProps,
|
|
4484
4459
|
$align: useArrayProp(align),
|
|
4485
4460
|
$direction: useArrayProp(direction),
|
|
4486
4461
|
$gap: useArrayProp(gap),
|
|
@@ -4488,27 +4463,30 @@ const Flex = forwardRef(function Flex2(props, ref) {
|
|
|
4488
4463
|
$wrap: useArrayProp(wrap),
|
|
4489
4464
|
forwardedAs: as,
|
|
4490
4465
|
ref
|
|
4491
|
-
})
|
|
4466
|
+
});
|
|
4492
4467
|
});
|
|
4493
4468
|
const rotate$1 = keyframes(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
4494
4469
|
const Root$w = styled(Text)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n & > span > svg {\n animation: ", " 500ms linear infinite;\n }\n"])), rotate$1);
|
|
4495
4470
|
const Spinner = forwardRef(function Spinner2(props, ref) {
|
|
4496
|
-
return /* @__PURE__ */jsx(Root$w,
|
|
4497
|
-
"data-ui": "Spinner"
|
|
4498
|
-
|
|
4471
|
+
return /* @__PURE__ */jsx(Root$w, {
|
|
4472
|
+
"data-ui": "Spinner",
|
|
4473
|
+
...props,
|
|
4499
4474
|
ref,
|
|
4500
4475
|
children: /* @__PURE__ */jsx(SpinnerIcon, {})
|
|
4501
|
-
})
|
|
4476
|
+
});
|
|
4502
4477
|
});
|
|
4503
4478
|
function _colorVarsStyle(base, color) {
|
|
4504
4479
|
let checkered = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
4505
4480
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4506
4481
|
return {
|
|
4482
|
+
// Base
|
|
4483
|
+
// @todo: rename to "--base-"?
|
|
4507
4484
|
"--card-shadow-outline-color": base.shadow.outline,
|
|
4508
4485
|
"--card-shadow-umbra-color": base.shadow.umbra,
|
|
4509
4486
|
"--card-shadow-penumbra-color": base.shadow.penumbra,
|
|
4510
4487
|
"--card-shadow-ambient-color": base.shadow.ambient,
|
|
4511
4488
|
"--card-focus-ring-color": base.focusRing,
|
|
4489
|
+
// Card
|
|
4512
4490
|
"--card-bg-color": color.bg,
|
|
4513
4491
|
"--card-bg-image": checkered ? "repeating-conic-gradient(".concat(color.bg, " 0% 25%, ").concat(color.bg2 || color.bg, " 0% 50%)") : void 0,
|
|
4514
4492
|
"--card-fg-color": color.fg,
|
|
@@ -4520,6 +4498,7 @@ function _colorVarsStyle(base, color) {
|
|
|
4520
4498
|
"--card-code-fg-color": (_e = color.code) == null ? void 0 : _e.fg,
|
|
4521
4499
|
"--card-skeleton-color-from": (_f = color.skeleton) == null ? void 0 : _f.from,
|
|
4522
4500
|
"--card-skeleton-color-to": (_g = color.skeleton) == null ? void 0 : _g.to,
|
|
4501
|
+
// @todo: deprecate
|
|
4523
4502
|
"--card-link-color": (_h = color.link) == null ? void 0 : _h.fg,
|
|
4524
4503
|
"--card-hairline-soft-color": color.border,
|
|
4525
4504
|
"--card-hairline-hard-color": color.border
|
|
@@ -4577,30 +4556,30 @@ const Root$v = styled.button(responsiveRadiusStyle, buttonBaseStyles, buttonColo
|
|
|
4577
4556
|
const LoadingBox = styled.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--card-bg-color);\n border-radius: inherit;\n z-index: 1;\n box-shadow: inherit;\n"])));
|
|
4578
4557
|
const Button = forwardRef(function Button2(props, ref) {
|
|
4579
4558
|
const {
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4559
|
+
children,
|
|
4560
|
+
disabled,
|
|
4561
|
+
fontSize,
|
|
4562
|
+
icon,
|
|
4563
|
+
iconRight,
|
|
4564
|
+
justify: justifyProp = "center",
|
|
4565
|
+
loading,
|
|
4566
|
+
mode = "default",
|
|
4567
|
+
padding: paddingProp = 3,
|
|
4568
|
+
paddingX: paddingXProp,
|
|
4569
|
+
paddingY: paddingYProp,
|
|
4570
|
+
paddingTop: paddingTopProp,
|
|
4571
|
+
paddingBottom: paddingBottomProp,
|
|
4572
|
+
paddingLeft: paddingLeftProp,
|
|
4573
|
+
paddingRight: paddingRightProp,
|
|
4574
|
+
radius: radiusProp = 2,
|
|
4575
|
+
selected,
|
|
4576
|
+
space: spaceProp = 3,
|
|
4577
|
+
text,
|
|
4578
|
+
textAlign,
|
|
4579
|
+
tone = "default",
|
|
4580
|
+
type = "button",
|
|
4581
|
+
...restProps
|
|
4582
|
+
} = props;
|
|
4604
4583
|
const justify = useArrayProp(justifyProp);
|
|
4605
4584
|
const padding = useArrayProp(paddingProp);
|
|
4606
4585
|
const paddingX = useArrayProp(paddingXProp);
|
|
@@ -4613,6 +4592,7 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
4613
4592
|
const space = useArrayProp(spaceProp);
|
|
4614
4593
|
const theme = useTheme();
|
|
4615
4594
|
const boxProps = useMemo(() => ({
|
|
4595
|
+
// flex: 1,
|
|
4616
4596
|
padding,
|
|
4617
4597
|
paddingX,
|
|
4618
4598
|
paddingY,
|
|
@@ -4621,9 +4601,9 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
4621
4601
|
paddingLeft,
|
|
4622
4602
|
paddingRight
|
|
4623
4603
|
}), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
|
|
4624
|
-
return /* @__PURE__ */jsxs(Root$v,
|
|
4625
|
-
"data-ui": "Button"
|
|
4626
|
-
|
|
4604
|
+
return /* @__PURE__ */jsxs(Root$v, {
|
|
4605
|
+
"data-ui": "Button",
|
|
4606
|
+
...restProps,
|
|
4627
4607
|
$mode: mode,
|
|
4628
4608
|
$radius: radius,
|
|
4629
4609
|
$tone: tone,
|
|
@@ -4634,9 +4614,9 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
4634
4614
|
type,
|
|
4635
4615
|
children: [Boolean(loading) && /* @__PURE__ */jsx(LoadingBox, {
|
|
4636
4616
|
children: /* @__PURE__ */jsx(Spinner, {})
|
|
4637
|
-
}), (icon || text || iconRight) && /* @__PURE__ */jsx(Box,
|
|
4638
|
-
as: "span"
|
|
4639
|
-
|
|
4617
|
+
}), (icon || text || iconRight) && /* @__PURE__ */jsx(Box, {
|
|
4618
|
+
as: "span",
|
|
4619
|
+
...boxProps,
|
|
4640
4620
|
children: /* @__PURE__ */jsxs(Flex, {
|
|
4641
4621
|
as: "span",
|
|
4642
4622
|
justify,
|
|
@@ -4659,12 +4639,12 @@ const Button = forwardRef(function Button2(props, ref) {
|
|
|
4659
4639
|
children: [isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && createElement(iconRight)]
|
|
4660
4640
|
})]
|
|
4661
4641
|
})
|
|
4662
|
-
})
|
|
4663
|
-
as: "span"
|
|
4664
|
-
|
|
4642
|
+
}), children && /* @__PURE__ */jsx(Box, {
|
|
4643
|
+
as: "span",
|
|
4644
|
+
...boxProps,
|
|
4665
4645
|
children
|
|
4666
|
-
})
|
|
4667
|
-
})
|
|
4646
|
+
})]
|
|
4647
|
+
});
|
|
4668
4648
|
});
|
|
4669
4649
|
function cardStyle(props) {
|
|
4670
4650
|
return [cardBaseStyle(props), cardColorStyle(props)];
|
|
@@ -4709,34 +4689,34 @@ function cardColorStyle(props) {
|
|
|
4709
4689
|
const Root$u = styled(Box)(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle);
|
|
4710
4690
|
const Card = forwardRef(function Card2(props, ref) {
|
|
4711
4691
|
const {
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4692
|
+
__unstable_checkered: checkered = false,
|
|
4693
|
+
__unstable_focusRing: focusRing = false,
|
|
4694
|
+
as: asProp,
|
|
4695
|
+
border,
|
|
4696
|
+
borderTop,
|
|
4697
|
+
borderRight,
|
|
4698
|
+
borderBottom,
|
|
4699
|
+
borderLeft,
|
|
4700
|
+
pressed,
|
|
4701
|
+
radius = 0,
|
|
4702
|
+
scheme,
|
|
4703
|
+
selected,
|
|
4704
|
+
shadow,
|
|
4705
|
+
tone: toneProp = "default",
|
|
4706
|
+
...restProps
|
|
4707
|
+
} = props;
|
|
4728
4708
|
const as = isValidElementType(asProp) ? asProp : "div";
|
|
4729
4709
|
const rootTheme = useRootTheme();
|
|
4730
4710
|
const tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
|
|
4731
4711
|
return /* @__PURE__ */jsx(ThemeColorProvider, {
|
|
4732
4712
|
scheme,
|
|
4733
4713
|
tone,
|
|
4734
|
-
children: /* @__PURE__ */jsx(Root$u,
|
|
4714
|
+
children: /* @__PURE__ */jsx(Root$u, {
|
|
4735
4715
|
"data-as": typeof as === "string" ? as : void 0,
|
|
4736
4716
|
"data-scheme": rootTheme.scheme,
|
|
4737
4717
|
"data-ui": "Card",
|
|
4738
|
-
"data-tone": tone
|
|
4739
|
-
|
|
4718
|
+
"data-tone": tone,
|
|
4719
|
+
...restProps,
|
|
4740
4720
|
$border: useArrayProp(border),
|
|
4741
4721
|
$borderTop: useArrayProp(borderTop),
|
|
4742
4722
|
$borderRight: useArrayProp(borderRight),
|
|
@@ -4753,7 +4733,7 @@ const Card = forwardRef(function Card2(props, ref) {
|
|
|
4753
4733
|
forwardedAs: as,
|
|
4754
4734
|
ref,
|
|
4755
4735
|
selected
|
|
4756
|
-
})
|
|
4736
|
+
})
|
|
4757
4737
|
});
|
|
4758
4738
|
});
|
|
4759
4739
|
function checkboxBaseStyles() {
|
|
@@ -4793,15 +4773,15 @@ const Root$t = styled.div(checkboxBaseStyles);
|
|
|
4793
4773
|
const Input$5 = styled.input(inputElementStyles);
|
|
4794
4774
|
const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
4795
4775
|
const {
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4776
|
+
checked,
|
|
4777
|
+
className,
|
|
4778
|
+
disabled,
|
|
4779
|
+
indeterminate,
|
|
4780
|
+
customValidity,
|
|
4781
|
+
readOnly,
|
|
4782
|
+
style,
|
|
4783
|
+
...restProps
|
|
4784
|
+
} = props;
|
|
4805
4785
|
const ref = useForwardedRef(forwardedRef);
|
|
4806
4786
|
useCustomValidity(ref, customValidity);
|
|
4807
4787
|
useEffect(() => {
|
|
@@ -4813,15 +4793,15 @@ const Checkbox = forwardRef(function Checkbox2(props, forwardedRef) {
|
|
|
4813
4793
|
className,
|
|
4814
4794
|
"data-ui": "Checkbox",
|
|
4815
4795
|
style,
|
|
4816
|
-
children: [/* @__PURE__ */jsx(Input$5,
|
|
4817
|
-
"data-read-only": !disabled && readOnly ? "" : void 0
|
|
4818
|
-
|
|
4796
|
+
children: [/* @__PURE__ */jsx(Input$5, {
|
|
4797
|
+
"data-read-only": !disabled && readOnly ? "" : void 0,
|
|
4798
|
+
...restProps,
|
|
4819
4799
|
checked,
|
|
4820
4800
|
disabled: disabled || readOnly,
|
|
4821
4801
|
type: "checkbox",
|
|
4822
4802
|
readOnly,
|
|
4823
4803
|
ref
|
|
4824
|
-
})
|
|
4804
|
+
}), /* @__PURE__ */jsxs("span", {
|
|
4825
4805
|
children: [/* @__PURE__ */jsx(CheckmarkIcon, {}), /* @__PURE__ */jsx(RemoveIcon, {})]
|
|
4826
4806
|
})]
|
|
4827
4807
|
});
|
|
@@ -4948,17 +4928,17 @@ function codeBaseStyle() {
|
|
|
4948
4928
|
const Root$s = styled.pre(codeBaseStyle, responsiveCodeFontStyle);
|
|
4949
4929
|
const Code = forwardRef(function Code2(props, ref) {
|
|
4950
4930
|
const {
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4931
|
+
children,
|
|
4932
|
+
language: languageProp,
|
|
4933
|
+
size = 2,
|
|
4934
|
+
weight,
|
|
4935
|
+
...restProps
|
|
4936
|
+
} = props;
|
|
4957
4937
|
const language = typeof languageProp === "string" ? languageProp : void 0;
|
|
4958
4938
|
const registered = language ? Refractor.hasLanguage(language) : false;
|
|
4959
|
-
return /* @__PURE__ */jsxs(Root$s,
|
|
4960
|
-
"data-ui": "Code"
|
|
4961
|
-
|
|
4939
|
+
return /* @__PURE__ */jsxs(Root$s, {
|
|
4940
|
+
"data-ui": "Code",
|
|
4941
|
+
...restProps,
|
|
4962
4942
|
$size: useArrayProp(size),
|
|
4963
4943
|
$weight: weight,
|
|
4964
4944
|
ref,
|
|
@@ -4969,7 +4949,7 @@ const Code = forwardRef(function Code2(props, ref) {
|
|
|
4969
4949
|
language,
|
|
4970
4950
|
value: String(children)
|
|
4971
4951
|
})]
|
|
4972
|
-
})
|
|
4952
|
+
});
|
|
4973
4953
|
});
|
|
4974
4954
|
const BASE_STYLE$1 = {
|
|
4975
4955
|
width: "100%",
|
|
@@ -4993,37 +4973,37 @@ function responsiveContainerWidthStyle(props) {
|
|
|
4993
4973
|
const Root$r = styled(Box)(containerBaseStyle, responsiveContainerWidthStyle);
|
|
4994
4974
|
const Container = forwardRef(function Container2(props, ref) {
|
|
4995
4975
|
const {
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
return /* @__PURE__ */jsx(Root$r,
|
|
5001
|
-
"data-ui": "Container"
|
|
5002
|
-
|
|
4976
|
+
as,
|
|
4977
|
+
width = 2,
|
|
4978
|
+
...restProps
|
|
4979
|
+
} = props;
|
|
4980
|
+
return /* @__PURE__ */jsx(Root$r, {
|
|
4981
|
+
"data-ui": "Container",
|
|
4982
|
+
...restProps,
|
|
5003
4983
|
$width: useArrayProp(width),
|
|
5004
4984
|
forwardedAs: as,
|
|
5005
4985
|
ref
|
|
5006
|
-
})
|
|
4986
|
+
});
|
|
5007
4987
|
});
|
|
5008
4988
|
const Root$q = styled(Box)(responsiveGridStyle);
|
|
5009
4989
|
const Grid = forwardRef(function Grid2(props, ref) {
|
|
5010
4990
|
const {
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
return /* @__PURE__ */jsx(Root$q,
|
|
4991
|
+
as,
|
|
4992
|
+
autoRows,
|
|
4993
|
+
autoCols,
|
|
4994
|
+
autoFlow,
|
|
4995
|
+
columns,
|
|
4996
|
+
gap,
|
|
4997
|
+
gapX,
|
|
4998
|
+
gapY,
|
|
4999
|
+
rows,
|
|
5000
|
+
children,
|
|
5001
|
+
...restProps
|
|
5002
|
+
} = props;
|
|
5003
|
+
return /* @__PURE__ */jsx(Root$q, {
|
|
5024
5004
|
"data-as": typeof as === "string" ? as : void 0,
|
|
5025
|
-
"data-ui": "Grid"
|
|
5026
|
-
|
|
5005
|
+
"data-ui": "Grid",
|
|
5006
|
+
...restProps,
|
|
5027
5007
|
$autoRows: useArrayProp(autoRows),
|
|
5028
5008
|
$autoCols: useArrayProp(autoCols),
|
|
5029
5009
|
$autoFlow: useArrayProp(autoFlow),
|
|
@@ -5035,7 +5015,7 @@ const Grid = forwardRef(function Grid2(props, ref) {
|
|
|
5035
5015
|
forwardedAs: as,
|
|
5036
5016
|
ref,
|
|
5037
5017
|
children
|
|
5038
|
-
})
|
|
5018
|
+
});
|
|
5039
5019
|
});
|
|
5040
5020
|
function headingBaseStyle(props) {
|
|
5041
5021
|
const {
|
|
@@ -5049,24 +5029,24 @@ const Root$p = styled.div(headingBaseStyle, responsiveTextAlignStyle, responsive
|
|
|
5049
5029
|
const SpanWithTextOverflow = styled.span(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
|
|
5050
5030
|
const Heading = forwardRef(function Heading2(props, ref) {
|
|
5051
5031
|
const {
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5032
|
+
accent = false,
|
|
5033
|
+
align,
|
|
5034
|
+
children: childrenProp,
|
|
5035
|
+
muted = false,
|
|
5036
|
+
size = 2,
|
|
5037
|
+
textOverflow,
|
|
5038
|
+
weight,
|
|
5039
|
+
...restProps
|
|
5040
|
+
} = props;
|
|
5061
5041
|
let children = childrenProp;
|
|
5062
5042
|
if (textOverflow === "ellipsis") {
|
|
5063
5043
|
children = /* @__PURE__ */jsx(SpanWithTextOverflow, {
|
|
5064
5044
|
children
|
|
5065
5045
|
});
|
|
5066
5046
|
}
|
|
5067
|
-
return /* @__PURE__ */jsx(Root$p,
|
|
5068
|
-
"data-ui": "Heading"
|
|
5069
|
-
|
|
5047
|
+
return /* @__PURE__ */jsx(Root$p, {
|
|
5048
|
+
"data-ui": "Heading",
|
|
5049
|
+
...restProps,
|
|
5070
5050
|
$accent: accent,
|
|
5071
5051
|
$align: useArrayProp(align),
|
|
5072
5052
|
$muted: muted,
|
|
@@ -5076,7 +5056,7 @@ const Heading = forwardRef(function Heading2(props, ref) {
|
|
|
5076
5056
|
children: /* @__PURE__ */jsx("span", {
|
|
5077
5057
|
children
|
|
5078
5058
|
})
|
|
5079
|
-
})
|
|
5059
|
+
});
|
|
5080
5060
|
});
|
|
5081
5061
|
function inlineBaseStyle() {
|
|
5082
5062
|
return {
|
|
@@ -5107,22 +5087,22 @@ function inlineSpaceStyle(props) {
|
|
|
5107
5087
|
const Root$o = styled(Box)(inlineBaseStyle, inlineSpaceStyle);
|
|
5108
5088
|
const Inline = forwardRef(function Inline2(props, ref) {
|
|
5109
5089
|
const {
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5090
|
+
as,
|
|
5091
|
+
children: childrenProp,
|
|
5092
|
+
space,
|
|
5093
|
+
...restProps
|
|
5094
|
+
} = props;
|
|
5115
5095
|
const children = useMemo(() => childrenToElementArray(childrenProp).filter(Boolean).map((child, idx) => /* @__PURE__ */jsx("div", {
|
|
5116
5096
|
children: child
|
|
5117
5097
|
}, idx)), [childrenProp]);
|
|
5118
|
-
return /* @__PURE__ */jsx(Root$o,
|
|
5119
|
-
"data-ui": "Inline"
|
|
5120
|
-
|
|
5098
|
+
return /* @__PURE__ */jsx(Root$o, {
|
|
5099
|
+
"data-ui": "Inline",
|
|
5100
|
+
...restProps,
|
|
5121
5101
|
$space: useArrayProp(space),
|
|
5122
5102
|
forwardedAs: as,
|
|
5123
5103
|
ref,
|
|
5124
5104
|
children
|
|
5125
|
-
})
|
|
5105
|
+
});
|
|
5126
5106
|
});
|
|
5127
5107
|
function kbdStyle() {
|
|
5128
5108
|
return css(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n background: var(--card-bg-color);\n font: inherit;\n box-shadow: inset 0 0 0 1px var(--card-hairline-hard-color);\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
@@ -5130,15 +5110,15 @@ function kbdStyle() {
|
|
|
5130
5110
|
const Root$n = styled.kbd(responsiveRadiusStyle, kbdStyle);
|
|
5131
5111
|
const KBD = forwardRef(function KBD2(props, ref) {
|
|
5132
5112
|
const {
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
return /* @__PURE__ */jsx(Root$n,
|
|
5140
|
-
"data-ui": "KBD"
|
|
5141
|
-
|
|
5113
|
+
children,
|
|
5114
|
+
fontSize = 1,
|
|
5115
|
+
padding = 1,
|
|
5116
|
+
radius = 2,
|
|
5117
|
+
...restProps
|
|
5118
|
+
} = props;
|
|
5119
|
+
return /* @__PURE__ */jsx(Root$n, {
|
|
5120
|
+
"data-ui": "KBD",
|
|
5121
|
+
...restProps,
|
|
5142
5122
|
$radius: useArrayProp(radius),
|
|
5143
5123
|
ref,
|
|
5144
5124
|
children: /* @__PURE__ */jsx(Box, {
|
|
@@ -5151,7 +5131,7 @@ const KBD = forwardRef(function KBD2(props, ref) {
|
|
|
5151
5131
|
children
|
|
5152
5132
|
})
|
|
5153
5133
|
})
|
|
5154
|
-
})
|
|
5134
|
+
});
|
|
5155
5135
|
});
|
|
5156
5136
|
const key$6 = Symbol.for("@sanity/ui/context/boundaryElement");
|
|
5157
5137
|
globalScope[key$6] = globalScope[key$6] || createContext(null);
|
|
@@ -5204,10 +5184,10 @@ function findMinBreakpoints(media, width) {
|
|
|
5204
5184
|
const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
5205
5185
|
const theme = useTheme();
|
|
5206
5186
|
const {
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5187
|
+
children,
|
|
5188
|
+
media = theme.sanity.media,
|
|
5189
|
+
...restProps
|
|
5190
|
+
} = props;
|
|
5211
5191
|
const forwardedRef = useForwardedRef(ref);
|
|
5212
5192
|
const [element, setElement] = useState(null);
|
|
5213
5193
|
const elementSize = useElementSize(element);
|
|
@@ -5221,14 +5201,14 @@ const ElementQuery = forwardRef(function ElementQuery2(props, ref) {
|
|
|
5221
5201
|
forwardedRef.current = el;
|
|
5222
5202
|
setElement(el);
|
|
5223
5203
|
}, [forwardedRef]);
|
|
5224
|
-
return /* @__PURE__ */jsx("div",
|
|
5225
|
-
"data-ui": "ElementQuery"
|
|
5226
|
-
|
|
5204
|
+
return /* @__PURE__ */jsx("div", {
|
|
5205
|
+
"data-ui": "ElementQuery",
|
|
5206
|
+
...restProps,
|
|
5227
5207
|
"data-eq-max": max.length ? max.join(" ") : void 0,
|
|
5228
5208
|
"data-eq-min": min.length ? min.join(" ") : void 0,
|
|
5229
5209
|
ref: setRef,
|
|
5230
5210
|
children
|
|
5231
|
-
})
|
|
5211
|
+
});
|
|
5232
5212
|
});
|
|
5233
5213
|
class ErrorBoundary extends Component {
|
|
5234
5214
|
constructor() {
|
|
@@ -5309,34 +5289,37 @@ function LayerProvider(props) {
|
|
|
5309
5289
|
const Root$m = styled.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
5310
5290
|
const LayerChildren = forwardRef(function LayerChildren2(props, ref) {
|
|
5311
5291
|
const {
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5292
|
+
children,
|
|
5293
|
+
style = EMPTY_RECORD,
|
|
5294
|
+
...restProps
|
|
5295
|
+
} = props;
|
|
5316
5296
|
const {
|
|
5317
5297
|
zIndex
|
|
5318
5298
|
} = useLayer();
|
|
5319
|
-
return /* @__PURE__ */jsx(Root$m,
|
|
5299
|
+
return /* @__PURE__ */jsx(Root$m, {
|
|
5300
|
+
...restProps,
|
|
5320
5301
|
"data-ui": "Layer",
|
|
5321
5302
|
ref,
|
|
5322
|
-
style:
|
|
5303
|
+
style: {
|
|
5304
|
+
...style,
|
|
5323
5305
|
zIndex
|
|
5324
|
-
}
|
|
5306
|
+
},
|
|
5325
5307
|
children
|
|
5326
|
-
})
|
|
5308
|
+
});
|
|
5327
5309
|
});
|
|
5328
5310
|
const Layer = forwardRef(function Layer2(props, ref) {
|
|
5329
5311
|
const {
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5312
|
+
children,
|
|
5313
|
+
zOffset = 1,
|
|
5314
|
+
...restProps
|
|
5315
|
+
} = props;
|
|
5334
5316
|
return /* @__PURE__ */jsx(LayerProvider, {
|
|
5335
5317
|
zOffset,
|
|
5336
|
-
children: /* @__PURE__ */jsx(LayerChildren,
|
|
5318
|
+
children: /* @__PURE__ */jsx(LayerChildren, {
|
|
5319
|
+
...restProps,
|
|
5337
5320
|
ref,
|
|
5338
5321
|
children
|
|
5339
|
-
})
|
|
5322
|
+
})
|
|
5340
5323
|
});
|
|
5341
5324
|
});
|
|
5342
5325
|
const key$4 = Symbol.for("@sanity/ui/context/portal");
|
|
@@ -5528,14 +5511,14 @@ const Root$k = styled.div(_templateObject31 || (_templateObject31 = _taggedTempl
|
|
|
5528
5511
|
const ItemWrapper = styled.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n position: absolute;\n left: 0;\n right: 0;\n"])));
|
|
5529
5512
|
const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
5530
5513
|
const {
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5514
|
+
as = "div",
|
|
5515
|
+
gap = 0,
|
|
5516
|
+
getItemKey,
|
|
5517
|
+
items = [],
|
|
5518
|
+
onChange,
|
|
5519
|
+
renderItem,
|
|
5520
|
+
...restProps
|
|
5521
|
+
} = props;
|
|
5539
5522
|
const {
|
|
5540
5523
|
space
|
|
5541
5524
|
} = useTheme().sanity;
|
|
@@ -5631,17 +5614,17 @@ const VirtualList = forwardRef(function VirtualList2(props, ref) {
|
|
|
5631
5614
|
const wrapperStyle = useMemo(() => ({
|
|
5632
5615
|
height
|
|
5633
5616
|
}), [height]);
|
|
5634
|
-
return /* @__PURE__ */jsx(Root$k,
|
|
5617
|
+
return /* @__PURE__ */jsx(Root$k, {
|
|
5635
5618
|
as,
|
|
5636
|
-
"data-ui": "VirtualList"
|
|
5637
|
-
|
|
5619
|
+
"data-ui": "VirtualList",
|
|
5620
|
+
...restProps,
|
|
5638
5621
|
ref: forwardedRef,
|
|
5639
5622
|
children: /* @__PURE__ */jsx("div", {
|
|
5640
5623
|
ref: wrapperRef,
|
|
5641
5624
|
style: wrapperStyle,
|
|
5642
5625
|
children
|
|
5643
5626
|
})
|
|
5644
|
-
})
|
|
5627
|
+
});
|
|
5645
5628
|
});
|
|
5646
5629
|
const DEFAULT_POPOVER_DISTANCE = 4;
|
|
5647
5630
|
const DEFAULT_POPOVER_PADDING = 4;
|
|
@@ -5718,9 +5701,9 @@ const Root$j = styled.div(_templateObject33 || (_templateObject33 = _taggedTempl
|
|
|
5718
5701
|
const BorderPath = styled.path(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
5719
5702
|
const ShapePath = styled.path(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["\n fill: var(--card-bg-color);\n"])));
|
|
5720
5703
|
const PopoverArrow = forwardRef(function PopoverArrow2(props, ref) {
|
|
5721
|
-
return /* @__PURE__ */jsx(Root$j,
|
|
5722
|
-
"data-ui": "Popover__arrow"
|
|
5723
|
-
|
|
5704
|
+
return /* @__PURE__ */jsx(Root$j, {
|
|
5705
|
+
"data-ui": "Popover__arrow",
|
|
5706
|
+
...props,
|
|
5724
5707
|
ref,
|
|
5725
5708
|
children: /* @__PURE__ */jsxs("svg", {
|
|
5726
5709
|
width: DEFAULT_POPOVER_ARROW_WIDTH,
|
|
@@ -5734,7 +5717,7 @@ const PopoverArrow = forwardRef(function PopoverArrow2(props, ref) {
|
|
|
5734
5717
|
d: "M1.18342 0C3.59749 0 5.88246 1.0901 7.40138 2.96642L11.9455 8.57975C12.746 9.56855 14.254 9.56855 15.0545 8.57975L19.5986 2.96641C21.1175 1.0901 23.4025 0 25.8166 0H27H0H1.18342Z"
|
|
5735
5718
|
})]
|
|
5736
5719
|
})
|
|
5737
|
-
})
|
|
5720
|
+
});
|
|
5738
5721
|
});
|
|
5739
5722
|
function popoverCardStyle(props) {
|
|
5740
5723
|
const {
|
|
@@ -5754,39 +5737,40 @@ const Root$i = memo(styled(Card)(popoverCardStyle));
|
|
|
5754
5737
|
const PopoverContainer = memo(styled(Container)(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["\n max-height: inherit;\n max-width: inherit;\n"]))));
|
|
5755
5738
|
const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
5756
5739
|
const {
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5740
|
+
__unstable_margins: marginsProp,
|
|
5741
|
+
arrow,
|
|
5742
|
+
arrowRef,
|
|
5743
|
+
arrowX,
|
|
5744
|
+
arrowY,
|
|
5745
|
+
boundaryWidth,
|
|
5746
|
+
children,
|
|
5747
|
+
padding,
|
|
5748
|
+
placement,
|
|
5749
|
+
overflow,
|
|
5750
|
+
radius,
|
|
5751
|
+
scheme,
|
|
5752
|
+
shadow,
|
|
5753
|
+
strategy,
|
|
5754
|
+
style,
|
|
5755
|
+
tone,
|
|
5756
|
+
width = "auto",
|
|
5757
|
+
x: xProp,
|
|
5758
|
+
y: yProp,
|
|
5759
|
+
...restProps
|
|
5760
|
+
} = props;
|
|
5778
5761
|
const {
|
|
5779
5762
|
zIndex
|
|
5780
5763
|
} = useLayer();
|
|
5781
5764
|
const margins = useMemo(() => marginsProp || DEFAULT_POPOVER_MARGINS, [marginsProp]);
|
|
5782
5765
|
const x = (xProp != null ? xProp : 0) + margins[3];
|
|
5783
5766
|
const y = (yProp != null ? yProp : 0) + margins[0];
|
|
5784
|
-
const rootStyle = useMemo(() =>
|
|
5767
|
+
const rootStyle = useMemo(() => ({
|
|
5785
5768
|
position: strategy,
|
|
5786
5769
|
top: y,
|
|
5787
5770
|
left: x,
|
|
5788
|
-
zIndex
|
|
5789
|
-
|
|
5771
|
+
zIndex,
|
|
5772
|
+
...style
|
|
5773
|
+
}), [strategy, style, x, y, zIndex]);
|
|
5790
5774
|
const staticSide = placement && FLOATING_STATIC_SIDES[placement.split("-")[0]];
|
|
5791
5775
|
const arrowStyle = useMemo(() => {
|
|
5792
5776
|
const style2 = {
|
|
@@ -5798,7 +5782,8 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
5798
5782
|
if (staticSide) style2[staticSide] = 0 - DEFAULT_POPOVER_ARROW_WIDTH;
|
|
5799
5783
|
return style2;
|
|
5800
5784
|
}, [arrowX, arrowY, staticSide]);
|
|
5801
|
-
return /* @__PURE__ */jsxs(Root$i,
|
|
5785
|
+
return /* @__PURE__ */jsxs(Root$i, {
|
|
5786
|
+
...restProps,
|
|
5802
5787
|
$boundaryWidth: boundaryWidth,
|
|
5803
5788
|
"data-placement": placement,
|
|
5804
5789
|
"data-ui": "Popover",
|
|
@@ -5821,7 +5806,7 @@ const PopoverCard = memo(forwardRef(function PopoverCard2(props, ref) {
|
|
|
5821
5806
|
ref: arrowRef,
|
|
5822
5807
|
style: arrowStyle
|
|
5823
5808
|
})]
|
|
5824
|
-
})
|
|
5809
|
+
});
|
|
5825
5810
|
}));
|
|
5826
5811
|
PopoverCard.displayName = "PopoverCard";
|
|
5827
5812
|
const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
@@ -5829,30 +5814,30 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
5829
5814
|
const theme = useTheme();
|
|
5830
5815
|
const boundaryElementContext = useBoundaryElement();
|
|
5831
5816
|
const {
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5817
|
+
__unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
|
|
5818
|
+
arrow: arrowProp = true,
|
|
5819
|
+
boundaryElement = boundaryElementContext.element,
|
|
5820
|
+
children: childProp,
|
|
5821
|
+
constrainSize = false,
|
|
5822
|
+
content,
|
|
5823
|
+
disabled,
|
|
5824
|
+
fallbackPlacements,
|
|
5825
|
+
matchReferenceWidth: matchReferenceWidthProp,
|
|
5826
|
+
open,
|
|
5827
|
+
overflow = "hidden",
|
|
5828
|
+
padding: paddingProp,
|
|
5829
|
+
placement: placementProp = "bottom",
|
|
5830
|
+
portal,
|
|
5831
|
+
preventOverflow = true,
|
|
5832
|
+
radius: radiusProp = 3,
|
|
5833
|
+
referenceElement,
|
|
5834
|
+
scheme,
|
|
5835
|
+
shadow: shadowProp = 3,
|
|
5836
|
+
tone = "inherit",
|
|
5837
|
+
width: widthProp = "auto",
|
|
5838
|
+
zOffset: zOffsetProp = (_a = theme.sanity.layer) == null ? void 0 : _a.popover.zOffset,
|
|
5839
|
+
...restProps
|
|
5840
|
+
} = props;
|
|
5856
5841
|
const boundarySize = (_b = useElementSize(boundaryElement)) == null ? void 0 : _b.border;
|
|
5857
5842
|
const padding = useArrayProp(paddingProp);
|
|
5858
5843
|
const radius = useArrayProp(radiusProp);
|
|
@@ -5966,7 +5951,8 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
5966
5951
|
}
|
|
5967
5952
|
const popover = /* @__PURE__ */jsx(LayerProvider, {
|
|
5968
5953
|
zOffset,
|
|
5969
|
-
children: /* @__PURE__ */jsx(PopoverCard,
|
|
5954
|
+
children: /* @__PURE__ */jsx(PopoverCard, {
|
|
5955
|
+
...restProps,
|
|
5970
5956
|
__unstable_margins: margins,
|
|
5971
5957
|
arrow: arrowProp,
|
|
5972
5958
|
arrowRef: setArrow,
|
|
@@ -5987,7 +5973,7 @@ const Popover = memo(forwardRef(function Popover2(props, ref) {
|
|
|
5987
5973
|
y,
|
|
5988
5974
|
width,
|
|
5989
5975
|
children: content
|
|
5990
|
-
})
|
|
5976
|
+
})
|
|
5991
5977
|
});
|
|
5992
5978
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
5993
5979
|
children: [open && /* @__PURE__ */jsx(Fragment, {
|
|
@@ -6030,27 +6016,27 @@ const Root$h = styled.div(radioBaseStyle);
|
|
|
6030
6016
|
const Input$4 = styled.input(inputElementStyle);
|
|
6031
6017
|
const Radio = forwardRef(function Radio2(props, forwardedRef) {
|
|
6032
6018
|
const {
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6019
|
+
className,
|
|
6020
|
+
disabled,
|
|
6021
|
+
style,
|
|
6022
|
+
customValidity,
|
|
6023
|
+
readOnly,
|
|
6024
|
+
...restProps
|
|
6025
|
+
} = props;
|
|
6040
6026
|
const ref = useForwardedRef(forwardedRef);
|
|
6041
6027
|
useCustomValidity(ref, customValidity);
|
|
6042
6028
|
return /* @__PURE__ */jsxs(Root$h, {
|
|
6043
6029
|
className,
|
|
6044
6030
|
"data-ui": "Radio",
|
|
6045
6031
|
style,
|
|
6046
|
-
children: [/* @__PURE__ */jsx(Input$4,
|
|
6047
|
-
"data-read-only": !disabled && readOnly ? "" : void 0
|
|
6048
|
-
|
|
6032
|
+
children: [/* @__PURE__ */jsx(Input$4, {
|
|
6033
|
+
"data-read-only": !disabled && readOnly ? "" : void 0,
|
|
6034
|
+
...restProps,
|
|
6049
6035
|
disabled: disabled || readOnly,
|
|
6050
6036
|
readOnly,
|
|
6051
6037
|
ref,
|
|
6052
6038
|
type: "radio"
|
|
6053
|
-
})
|
|
6039
|
+
}), /* @__PURE__ */jsx("span", {})]
|
|
6054
6040
|
});
|
|
6055
6041
|
});
|
|
6056
6042
|
function rootStyle() {
|
|
@@ -6128,24 +6114,24 @@ const Input$3 = styled.select(selectStyle.input);
|
|
|
6128
6114
|
const IconBox = styled(Box)(selectStyle.iconBox);
|
|
6129
6115
|
const Select = forwardRef(function Select2(props, forwardedRef) {
|
|
6130
6116
|
const {
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6117
|
+
children,
|
|
6118
|
+
customValidity,
|
|
6119
|
+
disabled,
|
|
6120
|
+
fontSize = 2,
|
|
6121
|
+
padding = 3,
|
|
6122
|
+
radius = 1,
|
|
6123
|
+
readOnly,
|
|
6124
|
+
space = 3,
|
|
6125
|
+
...restProps
|
|
6126
|
+
} = props;
|
|
6141
6127
|
const ref = useForwardedRef(forwardedRef);
|
|
6142
6128
|
useCustomValidity(ref, customValidity);
|
|
6143
6129
|
return /* @__PURE__ */jsxs(Root$g, {
|
|
6144
6130
|
"data-ui": "Select",
|
|
6145
|
-
children: [/* @__PURE__ */jsx(Input$3,
|
|
6131
|
+
children: [/* @__PURE__ */jsx(Input$3, {
|
|
6146
6132
|
"data-read-only": !disabled && readOnly ? "" : void 0,
|
|
6147
|
-
"data-ui": "Select"
|
|
6148
|
-
|
|
6133
|
+
"data-ui": "Select",
|
|
6134
|
+
...restProps,
|
|
6149
6135
|
$fontSize: useArrayProp(fontSize),
|
|
6150
6136
|
$padding: useArrayProp(padding),
|
|
6151
6137
|
$radius: useArrayProp(radius),
|
|
@@ -6153,7 +6139,7 @@ const Select = forwardRef(function Select2(props, forwardedRef) {
|
|
|
6153
6139
|
disabled: disabled || readOnly,
|
|
6154
6140
|
ref,
|
|
6155
6141
|
children
|
|
6156
|
-
})
|
|
6142
|
+
}), /* @__PURE__ */jsx(IconBox, {
|
|
6157
6143
|
padding,
|
|
6158
6144
|
children: /* @__PURE__ */jsx(Text, {
|
|
6159
6145
|
size: fontSize,
|
|
@@ -6190,18 +6176,18 @@ function responsiveStackSpaceStyle(props) {
|
|
|
6190
6176
|
const Root$f = styled(Box)(stackBaseStyle, responsiveStackSpaceStyle);
|
|
6191
6177
|
const Stack = forwardRef(function Stack2(props, ref) {
|
|
6192
6178
|
const {
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
return /* @__PURE__ */jsx(Root$f,
|
|
6179
|
+
as,
|
|
6180
|
+
space,
|
|
6181
|
+
...restProps
|
|
6182
|
+
} = props;
|
|
6183
|
+
return /* @__PURE__ */jsx(Root$f, {
|
|
6198
6184
|
"data-as": typeof as === "string" ? as : void 0,
|
|
6199
|
-
"data-ui": "Stack"
|
|
6200
|
-
|
|
6185
|
+
"data-ui": "Stack",
|
|
6186
|
+
...restProps,
|
|
6201
6187
|
$space: useArrayProp(space),
|
|
6202
6188
|
forwardedAs: as,
|
|
6203
6189
|
ref
|
|
6204
|
-
})
|
|
6190
|
+
});
|
|
6205
6191
|
});
|
|
6206
6192
|
function switchBaseStyles() {
|
|
6207
6193
|
return css(_templateObject43 || (_templateObject43 = _taggedTemplateLiteral(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));
|
|
@@ -6255,14 +6241,14 @@ const Track = styled.span(switchTrackStyles);
|
|
|
6255
6241
|
const Thumb = styled.span(switchThumbStyles);
|
|
6256
6242
|
const Switch = forwardRef(function Switch2(props, forwardedRef) {
|
|
6257
6243
|
const {
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6244
|
+
checked,
|
|
6245
|
+
className,
|
|
6246
|
+
disabled,
|
|
6247
|
+
indeterminate,
|
|
6248
|
+
readOnly,
|
|
6249
|
+
style,
|
|
6250
|
+
...restProps
|
|
6251
|
+
} = props;
|
|
6266
6252
|
const ref = useForwardedRef(forwardedRef);
|
|
6267
6253
|
useEffect(() => {
|
|
6268
6254
|
if (ref.current) {
|
|
@@ -6273,14 +6259,14 @@ const Switch = forwardRef(function Switch2(props, forwardedRef) {
|
|
|
6273
6259
|
className,
|
|
6274
6260
|
"data-ui": "Switch",
|
|
6275
6261
|
style,
|
|
6276
|
-
children: [/* @__PURE__ */jsx(Input$2,
|
|
6277
|
-
"data-read-only": !disabled && readOnly ? "" : void 0
|
|
6278
|
-
|
|
6262
|
+
children: [/* @__PURE__ */jsx(Input$2, {
|
|
6263
|
+
"data-read-only": !disabled && readOnly ? "" : void 0,
|
|
6264
|
+
...restProps,
|
|
6279
6265
|
checked: indeterminate !== true && checked,
|
|
6280
6266
|
disabled: disabled || readOnly,
|
|
6281
6267
|
type: "checkbox",
|
|
6282
6268
|
ref
|
|
6283
|
-
})
|
|
6269
|
+
}), /* @__PURE__ */jsxs(Representation, {
|
|
6284
6270
|
"aria-hidden": true,
|
|
6285
6271
|
"data-name": "representation",
|
|
6286
6272
|
children: [/* @__PURE__ */jsx(Track, {}), /* @__PURE__ */jsx(Thumb, {
|
|
@@ -6296,26 +6282,26 @@ const Input$1 = styled.textarea(responsiveInputPaddingStyle, textInputBaseStyle,
|
|
|
6296
6282
|
const Presentation$1 = styled.div(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
6297
6283
|
const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
6298
6284
|
const {
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6285
|
+
border = true,
|
|
6286
|
+
customValidity,
|
|
6287
|
+
disabled = false,
|
|
6288
|
+
fontSize = 2,
|
|
6289
|
+
padding = 3,
|
|
6290
|
+
radius = 1,
|
|
6291
|
+
weight,
|
|
6292
|
+
...restProps
|
|
6293
|
+
} = props;
|
|
6308
6294
|
const ref = useForwardedRef(forwardedRef);
|
|
6309
6295
|
const rootTheme = useRootTheme();
|
|
6310
6296
|
useCustomValidity(ref, customValidity);
|
|
6311
6297
|
return /* @__PURE__ */jsx(Root$d, {
|
|
6312
6298
|
"data-ui": "TextArea",
|
|
6313
6299
|
children: /* @__PURE__ */jsxs(InputRoot$1, {
|
|
6314
|
-
children: [/* @__PURE__ */jsx(Input$1,
|
|
6300
|
+
children: [/* @__PURE__ */jsx(Input$1, {
|
|
6315
6301
|
"data-as": "textarea",
|
|
6316
6302
|
"data-scheme": rootTheme.scheme,
|
|
6317
|
-
"data-tone": rootTheme.tone
|
|
6318
|
-
|
|
6303
|
+
"data-tone": rootTheme.tone,
|
|
6304
|
+
...restProps,
|
|
6319
6305
|
$fontSize: useArrayProp(fontSize),
|
|
6320
6306
|
$padding: useArrayProp(padding),
|
|
6321
6307
|
$scheme: rootTheme.scheme,
|
|
@@ -6324,7 +6310,7 @@ const TextArea = forwardRef(function TextArea2(props, forwardedRef) {
|
|
|
6324
6310
|
$weight: weight,
|
|
6325
6311
|
disabled,
|
|
6326
6312
|
ref
|
|
6327
|
-
})
|
|
6313
|
+
}), /* @__PURE__ */jsx(Presentation$1, {
|
|
6328
6314
|
$radius: useArrayProp(radius),
|
|
6329
6315
|
$scheme: rootTheme.scheme,
|
|
6330
6316
|
$tone: rootTheme.tone,
|
|
@@ -6355,24 +6341,24 @@ const RightBox = styled(Box)(_templateObject55 || (_templateObject55 = _taggedTe
|
|
|
6355
6341
|
const RightCard = styled(Card)(_templateObject56 || (_templateObject56 = _taggedTemplateLiteral(["\n background-color: transparent;\n position: absolute;\n top: 0;\n right: 0;\n"])));
|
|
6356
6342
|
const TextInput = forwardRef(function TextInput2(props, forwardedRef) {
|
|
6357
6343
|
const {
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6344
|
+
border = true,
|
|
6345
|
+
clearButton,
|
|
6346
|
+
disabled = false,
|
|
6347
|
+
fontSize: fontSizeProp = 2,
|
|
6348
|
+
icon,
|
|
6349
|
+
iconRight,
|
|
6350
|
+
onClear,
|
|
6351
|
+
padding: paddingProp = 3,
|
|
6352
|
+
prefix,
|
|
6353
|
+
radius: radiusProp = 1,
|
|
6354
|
+
readOnly,
|
|
6355
|
+
space: spaceProp = 3,
|
|
6356
|
+
suffix,
|
|
6357
|
+
customValidity,
|
|
6358
|
+
type = "text",
|
|
6359
|
+
weight,
|
|
6360
|
+
...restProps
|
|
6361
|
+
} = props;
|
|
6376
6362
|
const ref = useForwardedRef(forwardedRef);
|
|
6377
6363
|
const rootTheme = useRootTheme();
|
|
6378
6364
|
const fontSize = useArrayProp(fontSizeProp);
|
|
@@ -6448,18 +6434,18 @@ const TextInput = forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
6448
6434
|
padding: clearButtonBoxPadding,
|
|
6449
6435
|
style: CLEAR_BUTTON_BOX_STYLE,
|
|
6450
6436
|
tone: customValidity ? "critical" : "inherit",
|
|
6451
|
-
children: /* @__PURE__ */jsx(Button,
|
|
6437
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
6452
6438
|
"aria-label": "Clear",
|
|
6453
6439
|
"data-qa": "clear-button",
|
|
6454
6440
|
fontSize,
|
|
6455
6441
|
icon: CloseIcon,
|
|
6456
6442
|
mode: "bleed",
|
|
6457
6443
|
padding: clearButtonPadding,
|
|
6458
|
-
radius
|
|
6459
|
-
|
|
6444
|
+
radius,
|
|
6445
|
+
...clearButtonProps,
|
|
6460
6446
|
onClick: handleClearClick,
|
|
6461
6447
|
onMouseDown: handleClearMouseDown
|
|
6462
|
-
})
|
|
6448
|
+
})
|
|
6463
6449
|
}), [clearButton, clearButtonBoxPadding, clearButtonPadding, clearButtonProps, customValidity, disabled, fontSize, handleClearClick, handleClearMouseDown, radius, readOnly]);
|
|
6464
6450
|
const suffixNode = useMemo(() => suffix && /* @__PURE__ */jsx(Suffix, {
|
|
6465
6451
|
borderTop: true,
|
|
@@ -6476,11 +6462,11 @@ const TextInput = forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
6476
6462
|
"data-ui": "TextInput",
|
|
6477
6463
|
tone: rootTheme.tone,
|
|
6478
6464
|
children: [prefixNode, /* @__PURE__ */jsxs(InputRoot, {
|
|
6479
|
-
children: [/* @__PURE__ */jsx(Input,
|
|
6465
|
+
children: [/* @__PURE__ */jsx(Input, {
|
|
6480
6466
|
"data-as": "input",
|
|
6481
6467
|
"data-scheme": rootTheme.scheme,
|
|
6482
|
-
"data-tone": rootTheme.tone
|
|
6483
|
-
|
|
6468
|
+
"data-tone": rootTheme.tone,
|
|
6469
|
+
...restProps,
|
|
6484
6470
|
$fontSize: fontSize,
|
|
6485
6471
|
$iconLeft: $hasIcon,
|
|
6486
6472
|
$iconRight: $hasIconRight || $hasClearButton,
|
|
@@ -6493,7 +6479,7 @@ const TextInput = forwardRef(function TextInput2(props, forwardedRef) {
|
|
|
6493
6479
|
readOnly,
|
|
6494
6480
|
ref,
|
|
6495
6481
|
type
|
|
6496
|
-
})
|
|
6482
|
+
}), presentationNode, clearButtonNode]
|
|
6497
6483
|
}), suffixNode]
|
|
6498
6484
|
});
|
|
6499
6485
|
});
|
|
@@ -6501,10 +6487,12 @@ const Root$b = styled.div(_templateObject57 || (_templateObject57 = _taggedTempl
|
|
|
6501
6487
|
const Border = styled.path(_templateObject58 || (_templateObject58 = _taggedTemplateLiteral(["\n fill: var(--card-shadow-outline-color);\n"])));
|
|
6502
6488
|
const Shape = styled.path(_templateObject59 || (_templateObject59 = _taggedTemplateLiteral(["\n fill: var(--card-bg-color);\n"])));
|
|
6503
6489
|
const TooltipArrow = forwardRef(function TooltipArrow2(props, ref) {
|
|
6504
|
-
const
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6490
|
+
const {
|
|
6491
|
+
...restProps
|
|
6492
|
+
} = props;
|
|
6493
|
+
return /* @__PURE__ */jsx(Root$b, {
|
|
6494
|
+
"data-ui": "Tooltip__arrow",
|
|
6495
|
+
...restProps,
|
|
6508
6496
|
ref,
|
|
6509
6497
|
children: /* @__PURE__ */jsxs("svg", {
|
|
6510
6498
|
width: "15",
|
|
@@ -6516,7 +6504,7 @@ const TooltipArrow = forwardRef(function TooltipArrow2(props, ref) {
|
|
|
6516
6504
|
d: "M0.156725 0C1.95632 0 3.66089 0.80776 4.80047 2.20057L5.95209 3.6081C6.75229 4.58614 8.24771 4.58614 9.04791 3.6081L10.1995 2.20057C11.3391 0.80776 13.0437 0 14.8433 0H15H0H0.156725Z"
|
|
6517
6505
|
})]
|
|
6518
6506
|
})
|
|
6519
|
-
})
|
|
6507
|
+
});
|
|
6520
6508
|
});
|
|
6521
6509
|
const Root$a = styled(Layer)(_templateObject60 || (_templateObject60 = _taggedTemplateLiteral(["\n pointer-events: none;\n"])));
|
|
6522
6510
|
const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
@@ -6524,19 +6512,19 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
6524
6512
|
const boundaryElementContext = useBoundaryElement();
|
|
6525
6513
|
const theme = useTheme();
|
|
6526
6514
|
const {
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6515
|
+
boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
|
|
6516
|
+
children: childProp,
|
|
6517
|
+
content,
|
|
6518
|
+
disabled,
|
|
6519
|
+
fallbackPlacements: fallbackPlacementsProp,
|
|
6520
|
+
padding,
|
|
6521
|
+
placement: placementProp = "bottom",
|
|
6522
|
+
portal,
|
|
6523
|
+
scheme,
|
|
6524
|
+
shadow = 2,
|
|
6525
|
+
zOffset = (_a = theme.sanity.layer) == null ? void 0 : _a.tooltip.zOffset,
|
|
6526
|
+
...restProps
|
|
6527
|
+
} = props;
|
|
6540
6528
|
const fallbackPlacements = useArrayProp(fallbackPlacementsProp);
|
|
6541
6529
|
const forwardedRef = useForwardedRef(ref);
|
|
6542
6530
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
@@ -6652,9 +6640,9 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
6652
6640
|
}, [childProp, handleBlur, handleFocus, handleMouseEnter, handleMouseLeave, setReference]);
|
|
6653
6641
|
if (!child) return /* @__PURE__ */jsx(Fragment, {});
|
|
6654
6642
|
if (disabled) return child;
|
|
6655
|
-
const root = /* @__PURE__ */jsx(Root$a,
|
|
6656
|
-
"data-ui": "Tooltip"
|
|
6657
|
-
|
|
6643
|
+
const root = /* @__PURE__ */jsx(Root$a, {
|
|
6644
|
+
"data-ui": "Tooltip",
|
|
6645
|
+
...restProps,
|
|
6658
6646
|
ref: setFloating,
|
|
6659
6647
|
style: rootStyle,
|
|
6660
6648
|
zOffset,
|
|
@@ -6670,7 +6658,7 @@ const Tooltip = forwardRef(function Tooltip2(props, ref) {
|
|
|
6670
6658
|
style: arrowStyle
|
|
6671
6659
|
})]
|
|
6672
6660
|
})
|
|
6673
|
-
})
|
|
6661
|
+
});
|
|
6674
6662
|
return /* @__PURE__ */jsxs(Fragment, {
|
|
6675
6663
|
children: [child, isOpen && /* @__PURE__ */jsx(Fragment, {
|
|
6676
6664
|
children: portal ? /* @__PURE__ */jsx(Portal, {
|
|
@@ -6714,58 +6702,67 @@ function AutocompleteOption(props) {
|
|
|
6714
6702
|
}
|
|
6715
6703
|
function autocompleteReducer(state, msg) {
|
|
6716
6704
|
if (msg.type === "input/change") {
|
|
6717
|
-
return
|
|
6705
|
+
return {
|
|
6706
|
+
...state,
|
|
6718
6707
|
activeValue: null,
|
|
6719
6708
|
focused: true,
|
|
6720
6709
|
query: msg.query
|
|
6721
|
-
}
|
|
6710
|
+
};
|
|
6722
6711
|
}
|
|
6723
6712
|
if (msg.type === "input/focus") {
|
|
6724
|
-
return
|
|
6713
|
+
return {
|
|
6714
|
+
...state,
|
|
6725
6715
|
focused: true
|
|
6726
|
-
}
|
|
6716
|
+
};
|
|
6727
6717
|
}
|
|
6728
6718
|
if (msg.type === "root/blur") {
|
|
6729
|
-
return
|
|
6719
|
+
return {
|
|
6720
|
+
...state,
|
|
6730
6721
|
focused: false,
|
|
6731
6722
|
query: null
|
|
6732
|
-
}
|
|
6723
|
+
};
|
|
6733
6724
|
}
|
|
6734
6725
|
if (msg.type === "root/clear") {
|
|
6735
|
-
return
|
|
6726
|
+
return {
|
|
6727
|
+
...state,
|
|
6736
6728
|
activeValue: null,
|
|
6737
6729
|
query: null,
|
|
6738
6730
|
value: null
|
|
6739
|
-
}
|
|
6731
|
+
};
|
|
6740
6732
|
}
|
|
6741
6733
|
if (msg.type === "root/escape") {
|
|
6742
|
-
return
|
|
6734
|
+
return {
|
|
6735
|
+
...state,
|
|
6743
6736
|
focused: false,
|
|
6744
6737
|
query: null
|
|
6745
|
-
}
|
|
6738
|
+
};
|
|
6746
6739
|
}
|
|
6747
6740
|
if (msg.type === "root/open") {
|
|
6748
|
-
return
|
|
6741
|
+
return {
|
|
6742
|
+
...state,
|
|
6749
6743
|
query: state.query || msg.query
|
|
6750
|
-
}
|
|
6744
|
+
};
|
|
6751
6745
|
}
|
|
6752
6746
|
if (msg.type === "root/setActiveValue") {
|
|
6753
|
-
return
|
|
6747
|
+
return {
|
|
6748
|
+
...state,
|
|
6754
6749
|
activeValue: msg.value,
|
|
6755
6750
|
listFocused: msg.listFocused || state.listFocused
|
|
6756
|
-
}
|
|
6751
|
+
};
|
|
6757
6752
|
}
|
|
6758
6753
|
if (msg.type === "root/setListFocused") {
|
|
6759
|
-
return
|
|
6754
|
+
return {
|
|
6755
|
+
...state,
|
|
6760
6756
|
listFocused: msg.listFocused
|
|
6761
|
-
}
|
|
6757
|
+
};
|
|
6762
6758
|
}
|
|
6763
6759
|
if (msg.type === "value/change") {
|
|
6764
|
-
return
|
|
6760
|
+
return {
|
|
6761
|
+
...state,
|
|
6765
6762
|
activeValue: msg.value,
|
|
6766
6763
|
query: null,
|
|
6767
6764
|
value: msg.value
|
|
6768
|
-
}
|
|
6765
|
+
};
|
|
6769
6766
|
}
|
|
6770
6767
|
return state;
|
|
6771
6768
|
}
|
|
@@ -6776,35 +6773,35 @@ const DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value;
|
|
|
6776
6773
|
const DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
|
6777
6774
|
const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
6778
6775
|
const {
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6776
|
+
border = true,
|
|
6777
|
+
customValidity,
|
|
6778
|
+
disabled,
|
|
6779
|
+
filterOption: filterOptionProp,
|
|
6780
|
+
fontSize = 2,
|
|
6781
|
+
icon,
|
|
6782
|
+
id,
|
|
6783
|
+
listBox = EMPTY_RECORD,
|
|
6784
|
+
loading,
|
|
6785
|
+
onBlur,
|
|
6786
|
+
onChange,
|
|
6787
|
+
onFocus,
|
|
6788
|
+
onQueryChange,
|
|
6789
|
+
onSelect,
|
|
6790
|
+
openButton,
|
|
6791
|
+
options: optionsProp,
|
|
6792
|
+
padding: paddingProp = 3,
|
|
6793
|
+
popover = EMPTY_RECORD,
|
|
6794
|
+
prefix,
|
|
6795
|
+
radius = 3,
|
|
6796
|
+
readOnly,
|
|
6797
|
+
relatedElements,
|
|
6798
|
+
renderOption: renderOptionProp,
|
|
6799
|
+
renderPopover,
|
|
6800
|
+
renderValue = DEFAULT_RENDER_VALUE,
|
|
6801
|
+
suffix,
|
|
6802
|
+
value: valueProp,
|
|
6803
|
+
...restProps
|
|
6804
|
+
} = props;
|
|
6808
6805
|
const [state, dispatch] = useReducer(autocompleteReducer, {
|
|
6809
6806
|
activeValue: valueProp || null,
|
|
6810
6807
|
focused: false,
|
|
@@ -7067,16 +7064,16 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7067
7064
|
const openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */jsx(Box, {
|
|
7068
7065
|
"aria-hidden": expanded,
|
|
7069
7066
|
padding: openButtonBoxPadding,
|
|
7070
|
-
children: /* @__PURE__ */jsx(Button,
|
|
7067
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
7071
7068
|
"aria-label": "Open",
|
|
7072
7069
|
disabled: expanded,
|
|
7073
7070
|
fontSize,
|
|
7074
7071
|
icon: ChevronDownIcon,
|
|
7075
7072
|
mode: "bleed",
|
|
7076
|
-
padding: openButtonPadding
|
|
7077
|
-
|
|
7073
|
+
padding: openButtonPadding,
|
|
7074
|
+
...openButtonProps,
|
|
7078
7075
|
onClick: handleOpenClick
|
|
7079
|
-
})
|
|
7076
|
+
})
|
|
7080
7077
|
}) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]);
|
|
7081
7078
|
const inputValue = useMemo(() => {
|
|
7082
7079
|
if (query === null) {
|
|
@@ -7087,7 +7084,8 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7087
7084
|
}
|
|
7088
7085
|
return query;
|
|
7089
7086
|
}, [currentOption, query, renderValue, value]);
|
|
7090
|
-
const input = /* @__PURE__ */jsx(TextInput,
|
|
7087
|
+
const input = /* @__PURE__ */jsx(TextInput, {
|
|
7088
|
+
...restProps,
|
|
7091
7089
|
"aria-activedescendant": activeItemId,
|
|
7092
7090
|
"aria-autocomplete": "list",
|
|
7093
7091
|
"aria-expanded": expanded,
|
|
@@ -7116,7 +7114,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7116
7114
|
spellCheck: false,
|
|
7117
7115
|
suffix: suffix || openButtonNode,
|
|
7118
7116
|
value: inputValue
|
|
7119
|
-
})
|
|
7117
|
+
});
|
|
7120
7118
|
const handleListBoxKeyDown = useCallback(event => {
|
|
7121
7119
|
var _a;
|
|
7122
7120
|
if (event.key === "Tab") {
|
|
@@ -7125,11 +7123,11 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7125
7123
|
}, [listFocused]);
|
|
7126
7124
|
const content = useMemo(() => {
|
|
7127
7125
|
if (filteredOptions.length === 0) return null;
|
|
7128
|
-
return /* @__PURE__ */jsx(ListBox,
|
|
7126
|
+
return /* @__PURE__ */jsx(ListBox, {
|
|
7129
7127
|
"data-ui": "AutoComplete__results",
|
|
7130
7128
|
onKeyDown: handleListBoxKeyDown,
|
|
7131
|
-
padding: 1
|
|
7132
|
-
|
|
7129
|
+
padding: 1,
|
|
7130
|
+
...listBox,
|
|
7133
7131
|
tabIndex: -1,
|
|
7134
7132
|
children: /* @__PURE__ */jsx(Stack, {
|
|
7135
7133
|
as: "ul",
|
|
@@ -7154,7 +7152,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7154
7152
|
}, option.value);
|
|
7155
7153
|
})
|
|
7156
7154
|
})
|
|
7157
|
-
})
|
|
7155
|
+
});
|
|
7158
7156
|
}, [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]);
|
|
7159
7157
|
const results = useMemo(() => {
|
|
7160
7158
|
if (renderPopover) {
|
|
@@ -7169,7 +7167,7 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7169
7167
|
if (filteredOptionsLen === 0) {
|
|
7170
7168
|
return null;
|
|
7171
7169
|
}
|
|
7172
|
-
return /* @__PURE__ */jsx(Popover,
|
|
7170
|
+
return /* @__PURE__ */jsx(Popover, {
|
|
7173
7171
|
arrow: false,
|
|
7174
7172
|
constrainSize: true,
|
|
7175
7173
|
content,
|
|
@@ -7183,8 +7181,9 @@ const InnerAutocomplete = forwardRef(function InnerAutocomplete2(props, ref) {
|
|
|
7183
7181
|
portal: true,
|
|
7184
7182
|
radius,
|
|
7185
7183
|
ref: resultsPopoverElementRef,
|
|
7186
|
-
referenceElement: inputElementRef.current
|
|
7187
|
-
|
|
7184
|
+
referenceElement: inputElementRef.current,
|
|
7185
|
+
...popover
|
|
7186
|
+
});
|
|
7188
7187
|
}, [content, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
|
|
7189
7188
|
return /* @__PURE__ */jsxs(Root$9, {
|
|
7190
7189
|
"data-ui": "Autocomplete",
|
|
@@ -7200,12 +7199,12 @@ const Root$8 = styled.ol(_templateObject65 || (_templateObject65 = _taggedTempla
|
|
|
7200
7199
|
const ExpandButton = styled(Button)(_templateObject66 || (_templateObject66 = _taggedTemplateLiteral(["\n appearance: none;\n margin: -4px;\n"])));
|
|
7201
7200
|
const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
|
|
7202
7201
|
const {
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7202
|
+
children,
|
|
7203
|
+
maxLength,
|
|
7204
|
+
separator,
|
|
7205
|
+
space: spaceRaw = 2,
|
|
7206
|
+
...restProps
|
|
7207
|
+
} = props;
|
|
7209
7208
|
const space = useArrayProp(spaceRaw);
|
|
7210
7209
|
const [open, setOpen] = useState(false);
|
|
7211
7210
|
const [expandElement, setExpandElement] = useState(null);
|
|
@@ -7247,9 +7246,9 @@ const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
7247
7246
|
}
|
|
7248
7247
|
return rawItems;
|
|
7249
7248
|
}, [collapse, expand, maxLength, open, rawItems, space]);
|
|
7250
|
-
return /* @__PURE__ */jsx(Root$8,
|
|
7251
|
-
"data-ui": "Breadcrumbs"
|
|
7252
|
-
|
|
7249
|
+
return /* @__PURE__ */jsx(Root$8, {
|
|
7250
|
+
"data-ui": "Breadcrumbs",
|
|
7251
|
+
...restProps,
|
|
7253
7252
|
ref,
|
|
7254
7253
|
children: items.map((item, itemIndex) => /* @__PURE__ */jsxs(Fragment$1, {
|
|
7255
7254
|
children: [itemIndex > 0 && /* @__PURE__ */jsx(Box, {
|
|
@@ -7265,7 +7264,7 @@ const Breadcrumbs = forwardRef(function Breadcrumbs2(props, ref) {
|
|
|
7265
7264
|
children: item
|
|
7266
7265
|
})]
|
|
7267
7266
|
}, itemIndex))
|
|
7268
|
-
})
|
|
7267
|
+
});
|
|
7269
7268
|
});
|
|
7270
7269
|
function dialogStyle(_ref23) {
|
|
7271
7270
|
let {
|
|
@@ -7418,25 +7417,25 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
7418
7417
|
const dialog = useDialog();
|
|
7419
7418
|
const theme = useTheme();
|
|
7420
7419
|
const {
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7420
|
+
__unstable_autoFocus: autoFocus = true,
|
|
7421
|
+
__unstable_hideCloseButton: hideCloseButton = false,
|
|
7422
|
+
cardRadius: cardRadiusProp = 3,
|
|
7423
|
+
cardShadow = 4,
|
|
7424
|
+
children,
|
|
7425
|
+
contentRef,
|
|
7426
|
+
footer,
|
|
7427
|
+
header,
|
|
7428
|
+
id,
|
|
7429
|
+
onClickOutside,
|
|
7430
|
+
onClose,
|
|
7431
|
+
padding: paddingProp = 4,
|
|
7432
|
+
portal,
|
|
7433
|
+
position: positionProp = dialog.position || "fixed",
|
|
7434
|
+
scheme,
|
|
7435
|
+
width: widthProp = 0,
|
|
7436
|
+
zOffset: zOffsetProp = dialog.zOffset || ((_a = theme.sanity.layer) == null ? void 0 : _a.dialog.zOffset),
|
|
7437
|
+
...restProps
|
|
7438
|
+
} = props;
|
|
7440
7439
|
const cardRadius = useArrayProp(cardRadiusProp);
|
|
7441
7440
|
const padding = useArrayProp(paddingProp);
|
|
7442
7441
|
const position = useArrayProp(positionProp);
|
|
@@ -7463,7 +7462,8 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
7463
7462
|
const labelId = "".concat(id, "_label");
|
|
7464
7463
|
return /* @__PURE__ */jsx(Portal, {
|
|
7465
7464
|
__unstable_name: portal,
|
|
7466
|
-
children: /* @__PURE__ */jsxs(Root$7,
|
|
7465
|
+
children: /* @__PURE__ */jsxs(Root$7, {
|
|
7466
|
+
...restProps,
|
|
7467
7467
|
$padding: padding,
|
|
7468
7468
|
$position: position,
|
|
7469
7469
|
"aria-labelledby": labelId,
|
|
@@ -7496,7 +7496,7 @@ const Dialog = forwardRef(function Dialog2(props, ref) {
|
|
|
7496
7496
|
ref: postDivRef,
|
|
7497
7497
|
tabIndex: 0
|
|
7498
7498
|
})]
|
|
7499
|
-
})
|
|
7499
|
+
})
|
|
7500
7500
|
});
|
|
7501
7501
|
});
|
|
7502
7502
|
function DialogProvider(props) {
|
|
@@ -7519,20 +7519,20 @@ const Root$6 = styled.kbd(_templateObject73 || (_templateObject73 = _taggedTempl
|
|
|
7519
7519
|
const Key = styled(KBD)(_templateObject74 || (_templateObject74 = _taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n"])));
|
|
7520
7520
|
const Hotkeys = forwardRef(function Hotkeys2(props, ref) {
|
|
7521
7521
|
const {
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7522
|
+
fontSize,
|
|
7523
|
+
keys,
|
|
7524
|
+
padding,
|
|
7525
|
+
radius,
|
|
7526
|
+
space: spaceProp = 1,
|
|
7527
|
+
...restProps
|
|
7528
|
+
} = props;
|
|
7529
7529
|
const space = useArrayProp(spaceProp);
|
|
7530
7530
|
if (!keys || keys.length === 0) {
|
|
7531
7531
|
return /* @__PURE__ */jsx(Fragment, {});
|
|
7532
7532
|
}
|
|
7533
|
-
return /* @__PURE__ */jsx(Root$6,
|
|
7534
|
-
"data-ui": "Hotkeys"
|
|
7535
|
-
|
|
7533
|
+
return /* @__PURE__ */jsx(Root$6, {
|
|
7534
|
+
"data-ui": "Hotkeys",
|
|
7535
|
+
...restProps,
|
|
7536
7536
|
ref,
|
|
7537
7537
|
children: /* @__PURE__ */jsx(Inline, {
|
|
7538
7538
|
as: "span",
|
|
@@ -7544,7 +7544,7 @@ const Hotkeys = forwardRef(function Hotkeys2(props, ref) {
|
|
|
7544
7544
|
children: key
|
|
7545
7545
|
}, i))
|
|
7546
7546
|
})
|
|
7547
|
-
})
|
|
7547
|
+
});
|
|
7548
7548
|
});
|
|
7549
7549
|
const key$2 = Symbol.for("@sanity/ui/context/menu");
|
|
7550
7550
|
globalScope[key$2] = globalScope[key$2] || createContext(null);
|
|
@@ -7740,21 +7740,23 @@ function useMenuController(props) {
|
|
|
7740
7740
|
const Root$5 = styled(Box)(_templateObject75 || (_templateObject75 = _taggedTemplateLiteral(["\n outline: none;\n overflow: auto;\n"])));
|
|
7741
7741
|
const Menu = forwardRef(function Menu2(props, ref) {
|
|
7742
7742
|
const {
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7743
|
+
children,
|
|
7744
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7745
|
+
focusFirst,
|
|
7746
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7747
|
+
focusLast,
|
|
7748
|
+
onClickOutside,
|
|
7749
|
+
onEscape,
|
|
7750
|
+
onItemClick,
|
|
7751
|
+
onItemSelect,
|
|
7752
|
+
onKeyDown,
|
|
7753
|
+
originElement,
|
|
7754
|
+
padding = 1,
|
|
7755
|
+
registerElement,
|
|
7756
|
+
shouldFocus = props.focusFirst && "first" || props.focusLast && "last" || null,
|
|
7757
|
+
space = 1,
|
|
7758
|
+
...restProps
|
|
7759
|
+
} = props;
|
|
7758
7760
|
const forwardedRef = useForwardedRef(ref);
|
|
7759
7761
|
const {
|
|
7760
7762
|
isTopLayer
|
|
@@ -7803,14 +7805,15 @@ const Menu = forwardRef(function Menu2(props, ref) {
|
|
|
7803
7805
|
onItemMouseEnter: handleItemMouseEnter,
|
|
7804
7806
|
onItemMouseLeave: handleItemMouseLeave,
|
|
7805
7807
|
registerElement,
|
|
7808
|
+
// deprecated
|
|
7806
7809
|
onMouseEnter: handleItemMouseEnter,
|
|
7807
7810
|
onMouseLeave: handleItemMouseLeave
|
|
7808
7811
|
}), [activeElement, activeIndex, mount, handleItemMouseEnter, handleItemMouseLeave, onClickOutside, onEscape, onItemClick, registerElement]);
|
|
7809
7812
|
return /* @__PURE__ */jsx(MenuContext.Provider, {
|
|
7810
7813
|
value,
|
|
7811
|
-
children: /* @__PURE__ */jsx(Root$5,
|
|
7812
|
-
"data-ui": "Menu"
|
|
7813
|
-
|
|
7814
|
+
children: /* @__PURE__ */jsx(Root$5, {
|
|
7815
|
+
"data-ui": "Menu",
|
|
7816
|
+
...restProps,
|
|
7814
7817
|
onKeyDown: handleKeyDown,
|
|
7815
7818
|
padding,
|
|
7816
7819
|
ref: handleRefChange,
|
|
@@ -7820,7 +7823,7 @@ const Menu = forwardRef(function Menu2(props, ref) {
|
|
|
7820
7823
|
space,
|
|
7821
7824
|
children
|
|
7822
7825
|
})
|
|
7823
|
-
})
|
|
7826
|
+
})
|
|
7824
7827
|
});
|
|
7825
7828
|
});
|
|
7826
7829
|
const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
@@ -7943,22 +7946,23 @@ const MenuButton = forwardRef(function MenuButton2(props, ref) {
|
|
|
7943
7946
|
ref: setButtonRef,
|
|
7944
7947
|
selected: open
|
|
7945
7948
|
}) : null, [buttonProp, handleButtonClick, handleButtonKeyDown, id, open, setButtonRef]);
|
|
7946
|
-
const popoverProps = useMemo(() =>
|
|
7949
|
+
const popoverProps = useMemo(() => ({
|
|
7947
7950
|
boundaryElement: deprecated_boundaryElement,
|
|
7948
7951
|
overflow: "auto",
|
|
7949
7952
|
placement: deprecated_placement,
|
|
7950
7953
|
portal: deprecated_portal,
|
|
7951
7954
|
preventOverflow: deprecated_preventOverflow,
|
|
7952
7955
|
radius: deprecated_popoverRadius,
|
|
7953
|
-
scheme: deprecated_popoverScheme
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7956
|
+
scheme: deprecated_popoverScheme,
|
|
7957
|
+
...(popover || {})
|
|
7958
|
+
}), [deprecated_boundaryElement, deprecated_placement, deprecated_popoverRadius, deprecated_popoverScheme, deprecated_portal, deprecated_preventOverflow, popover]);
|
|
7959
|
+
return /* @__PURE__ */jsx(Popover, {
|
|
7960
|
+
"data-ui": "MenuButton__popover",
|
|
7961
|
+
...popoverProps,
|
|
7958
7962
|
content: menu,
|
|
7959
7963
|
open,
|
|
7960
7964
|
children: button || /* @__PURE__ */jsx(Fragment, {})
|
|
7961
|
-
})
|
|
7965
|
+
});
|
|
7962
7966
|
});
|
|
7963
7967
|
const MenuDivider = styled.hr(_templateObject76 || (_templateObject76 = _taggedTemplateLiteral(["\n height: 1px;\n border: 0;\n background: var(--card-hairline-soft-color);\n margin: 0;\n"])));
|
|
7964
7968
|
function selectableBaseStyle() {
|
|
@@ -7991,19 +7995,19 @@ function useMenu() {
|
|
|
7991
7995
|
}
|
|
7992
7996
|
function MenuGroup(props) {
|
|
7993
7997
|
const {
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
7998
|
+
as = "button",
|
|
7999
|
+
children,
|
|
8000
|
+
fontSize,
|
|
8001
|
+
icon,
|
|
8002
|
+
onClick,
|
|
8003
|
+
padding = 3,
|
|
8004
|
+
popover,
|
|
8005
|
+
radius = 2,
|
|
8006
|
+
space = 3,
|
|
8007
|
+
text,
|
|
8008
|
+
tone = "default",
|
|
8009
|
+
...restProps
|
|
8010
|
+
} = props;
|
|
8007
8011
|
const menu = useMenu();
|
|
8008
8012
|
const {
|
|
8009
8013
|
activeElement,
|
|
@@ -8078,15 +8082,16 @@ function MenuGroup(props) {
|
|
|
8078
8082
|
return;
|
|
8079
8083
|
}
|
|
8080
8084
|
}, []);
|
|
8081
|
-
return /* @__PURE__ */jsx(Popover,
|
|
8085
|
+
return /* @__PURE__ */jsx(Popover, {
|
|
8086
|
+
...popover,
|
|
8082
8087
|
content: childMenu,
|
|
8083
8088
|
"data-ui": "MenuGroup__popover",
|
|
8084
8089
|
open,
|
|
8085
|
-
children: /* @__PURE__ */jsx(Selectable,
|
|
8090
|
+
children: /* @__PURE__ */jsx(Selectable, {
|
|
8086
8091
|
"data-as": as,
|
|
8087
8092
|
"data-ui": "MenuGroup",
|
|
8088
|
-
forwardedAs: as
|
|
8089
|
-
|
|
8093
|
+
forwardedAs: as,
|
|
8094
|
+
...restProps,
|
|
8090
8095
|
"aria-pressed": as === "button" ? withinMenu : void 0,
|
|
8091
8096
|
"data-pressed": as !== "button" ? withinMenu : void 0,
|
|
8092
8097
|
"data-selected": !withinMenu && active ? "" : void 0,
|
|
@@ -8121,34 +8126,34 @@ function MenuGroup(props) {
|
|
|
8121
8126
|
})]
|
|
8122
8127
|
})
|
|
8123
8128
|
})
|
|
8124
|
-
})
|
|
8125
|
-
})
|
|
8129
|
+
})
|
|
8130
|
+
});
|
|
8126
8131
|
}
|
|
8127
8132
|
const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
|
|
8128
8133
|
const {
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8134
|
+
as = "button",
|
|
8135
|
+
children,
|
|
8136
|
+
disabled,
|
|
8137
|
+
fontSize = 2,
|
|
8138
|
+
hotkeys,
|
|
8139
|
+
icon,
|
|
8140
|
+
iconRight,
|
|
8141
|
+
onClick,
|
|
8142
|
+
padding = 3,
|
|
8143
|
+
paddingX,
|
|
8144
|
+
paddingY,
|
|
8145
|
+
paddingTop,
|
|
8146
|
+
paddingRight,
|
|
8147
|
+
paddingBottom,
|
|
8148
|
+
paddingLeft,
|
|
8149
|
+
pressed,
|
|
8150
|
+
radius = 2,
|
|
8151
|
+
selected: selectedProp,
|
|
8152
|
+
space = 3,
|
|
8153
|
+
text,
|
|
8154
|
+
tone = "default",
|
|
8155
|
+
...restProps
|
|
8156
|
+
} = props;
|
|
8152
8157
|
const menu = useMenu();
|
|
8153
8158
|
const {
|
|
8154
8159
|
activeElement,
|
|
@@ -8179,9 +8184,9 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8179
8184
|
ref.current = el;
|
|
8180
8185
|
setRootElement(el);
|
|
8181
8186
|
}, [ref]);
|
|
8182
|
-
return /* @__PURE__ */jsxs(Selectable,
|
|
8183
|
-
"data-ui": "MenuItem"
|
|
8184
|
-
|
|
8187
|
+
return /* @__PURE__ */jsxs(Selectable, {
|
|
8188
|
+
"data-ui": "MenuItem",
|
|
8189
|
+
...restProps,
|
|
8185
8190
|
"aria-pressed": as === "button" && pressed,
|
|
8186
8191
|
"data-pressed": as !== "button" && pressed ? "" : void 0,
|
|
8187
8192
|
"data-selected": active ? "" : void 0,
|
|
@@ -8198,9 +8203,9 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8198
8203
|
role: "menuitem",
|
|
8199
8204
|
tabIndex: -1,
|
|
8200
8205
|
type: as === "button" ? "button" : void 0,
|
|
8201
|
-
children: [(icon || text || iconRight) && /* @__PURE__ */jsx(Box,
|
|
8202
|
-
as: "span"
|
|
8203
|
-
|
|
8206
|
+
children: [(icon || text || iconRight) && /* @__PURE__ */jsx(Box, {
|
|
8207
|
+
as: "span",
|
|
8208
|
+
...paddingProps,
|
|
8204
8209
|
children: /* @__PURE__ */jsxs(Flex, {
|
|
8205
8210
|
as: "span",
|
|
8206
8211
|
children: [icon && /* @__PURE__ */jsxs(Text, {
|
|
@@ -8230,12 +8235,12 @@ const MenuItem = forwardRef(function MenuItem2(props, forwardedRef) {
|
|
|
8230
8235
|
children: [isValidElement(iconRight) && iconRight, isValidElementType(iconRight) && createElement(iconRight)]
|
|
8231
8236
|
})]
|
|
8232
8237
|
})
|
|
8233
|
-
})
|
|
8234
|
-
as: "span"
|
|
8235
|
-
|
|
8238
|
+
}), children && /* @__PURE__ */jsx(Box, {
|
|
8239
|
+
as: "span",
|
|
8240
|
+
...paddingProps,
|
|
8236
8241
|
children
|
|
8237
|
-
})
|
|
8238
|
-
})
|
|
8242
|
+
})]
|
|
8243
|
+
});
|
|
8239
8244
|
});
|
|
8240
8245
|
const keyframe = keyframes(_templateObject79 || (_templateObject79 = _taggedTemplateLiteral(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"])));
|
|
8241
8246
|
const animation = css(_templateObject80 || (_templateObject80 = _taggedTemplateLiteral(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ", ";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])), keyframe);
|
|
@@ -8253,11 +8258,11 @@ const skeletonStyle = css(_templateObject81 || (_templateObject81 = _taggedTempl
|
|
|
8253
8258
|
const Root$4 = styled(Box)(responsiveRadiusStyle, skeletonStyle);
|
|
8254
8259
|
const Skeleton = forwardRef(function Skeleton2(props, ref) {
|
|
8255
8260
|
const {
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
+
animated = false,
|
|
8262
|
+
delay,
|
|
8263
|
+
radius,
|
|
8264
|
+
...restProps
|
|
8265
|
+
} = props;
|
|
8261
8266
|
const [visible, setVisible] = useState(delay ? false : true);
|
|
8262
8267
|
useEffect(() => {
|
|
8263
8268
|
if (!delay) {
|
|
@@ -8270,12 +8275,13 @@ const Skeleton = forwardRef(function Skeleton2(props, ref) {
|
|
|
8270
8275
|
clearTimeout(timeout);
|
|
8271
8276
|
};
|
|
8272
8277
|
}, [delay]);
|
|
8273
|
-
return /* @__PURE__ */jsx(Root$4,
|
|
8278
|
+
return /* @__PURE__ */jsx(Root$4, {
|
|
8279
|
+
...restProps,
|
|
8274
8280
|
$animated: animated,
|
|
8275
8281
|
$radius: useArrayProp(radius),
|
|
8276
8282
|
$visible: visible,
|
|
8277
8283
|
ref
|
|
8278
|
-
})
|
|
8284
|
+
});
|
|
8279
8285
|
});
|
|
8280
8286
|
const Root$3 = styled(Skeleton)(_ref26 => {
|
|
8281
8287
|
let {
|
|
@@ -8298,65 +8304,69 @@ const Root$3 = styled(Skeleton)(_ref26 => {
|
|
|
8298
8304
|
});
|
|
8299
8305
|
const TextSkeleton = forwardRef(function TextSkeleton2(props, ref) {
|
|
8300
8306
|
const {
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8307
|
+
size = 2,
|
|
8308
|
+
...restProps
|
|
8309
|
+
} = props;
|
|
8304
8310
|
const $size = useArrayProp(size);
|
|
8305
|
-
return /* @__PURE__ */jsx(Root$3,
|
|
8311
|
+
return /* @__PURE__ */jsx(Root$3, {
|
|
8312
|
+
...restProps,
|
|
8306
8313
|
$size,
|
|
8307
8314
|
ref,
|
|
8308
8315
|
$style: "text"
|
|
8309
|
-
})
|
|
8316
|
+
});
|
|
8310
8317
|
});
|
|
8311
8318
|
const LabelSkeleton = forwardRef(function TextSkeleton3(props, ref) {
|
|
8312
8319
|
const {
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8320
|
+
size = 2,
|
|
8321
|
+
...restProps
|
|
8322
|
+
} = props;
|
|
8316
8323
|
const $size = useArrayProp(size);
|
|
8317
|
-
return /* @__PURE__ */jsx(Root$3,
|
|
8324
|
+
return /* @__PURE__ */jsx(Root$3, {
|
|
8325
|
+
...restProps,
|
|
8318
8326
|
$size,
|
|
8319
8327
|
ref,
|
|
8320
8328
|
$style: "label"
|
|
8321
|
-
})
|
|
8329
|
+
});
|
|
8322
8330
|
});
|
|
8323
8331
|
const HeadingSkeleton = forwardRef(function TextSkeleton4(props, ref) {
|
|
8324
8332
|
const {
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8333
|
+
size = 2,
|
|
8334
|
+
...restProps
|
|
8335
|
+
} = props;
|
|
8328
8336
|
const $size = useArrayProp(size);
|
|
8329
|
-
return /* @__PURE__ */jsx(Root$3,
|
|
8337
|
+
return /* @__PURE__ */jsx(Root$3, {
|
|
8338
|
+
...restProps,
|
|
8330
8339
|
$size,
|
|
8331
8340
|
ref,
|
|
8332
8341
|
$style: "heading"
|
|
8333
|
-
})
|
|
8342
|
+
});
|
|
8334
8343
|
});
|
|
8335
8344
|
const CodeSkeleton = forwardRef(function TextSkeleton5(props, ref) {
|
|
8336
8345
|
const {
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8346
|
+
size = 2,
|
|
8347
|
+
...restProps
|
|
8348
|
+
} = props;
|
|
8340
8349
|
const $size = useArrayProp(size);
|
|
8341
|
-
return /* @__PURE__ */jsx(Root$3,
|
|
8350
|
+
return /* @__PURE__ */jsx(Root$3, {
|
|
8351
|
+
...restProps,
|
|
8342
8352
|
$size,
|
|
8343
8353
|
ref,
|
|
8344
8354
|
$style: "code"
|
|
8345
|
-
})
|
|
8355
|
+
});
|
|
8346
8356
|
});
|
|
8347
8357
|
const Tab = forwardRef(function Tab2(props, forwardedRef) {
|
|
8348
8358
|
const {
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8359
|
+
icon,
|
|
8360
|
+
id,
|
|
8361
|
+
focused,
|
|
8362
|
+
fontSize,
|
|
8363
|
+
label,
|
|
8364
|
+
onClick,
|
|
8365
|
+
onFocus,
|
|
8366
|
+
padding = 2,
|
|
8367
|
+
selected,
|
|
8368
|
+
...restProps
|
|
8369
|
+
} = props;
|
|
8360
8370
|
const elementRef = useRef(null);
|
|
8361
8371
|
const focusedRef = useRef(false);
|
|
8362
8372
|
const handleBlur = useCallback(() => {
|
|
@@ -8377,9 +8387,9 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
|
|
|
8377
8387
|
elementRef.current = el;
|
|
8378
8388
|
ref.current = el;
|
|
8379
8389
|
};
|
|
8380
|
-
return /* @__PURE__ */jsx(Button,
|
|
8381
|
-
"data-ui": "Tab"
|
|
8382
|
-
|
|
8390
|
+
return /* @__PURE__ */jsx(Button, {
|
|
8391
|
+
"data-ui": "Tab",
|
|
8392
|
+
...restProps,
|
|
8383
8393
|
"aria-selected": selected ? "true" : "false",
|
|
8384
8394
|
fontSize,
|
|
8385
8395
|
icon,
|
|
@@ -8395,16 +8405,16 @@ const Tab = forwardRef(function Tab2(props, forwardedRef) {
|
|
|
8395
8405
|
tabIndex: selected ? 0 : -1,
|
|
8396
8406
|
text: label,
|
|
8397
8407
|
type: "button"
|
|
8398
|
-
})
|
|
8408
|
+
});
|
|
8399
8409
|
});
|
|
8400
8410
|
function _isReactElement(node) {
|
|
8401
8411
|
return Boolean(node);
|
|
8402
8412
|
}
|
|
8403
8413
|
const TabList = forwardRef(function TabList2(props, ref) {
|
|
8404
8414
|
const {
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8415
|
+
children: childrenProp,
|
|
8416
|
+
...restProps
|
|
8417
|
+
} = props;
|
|
8408
8418
|
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
8409
8419
|
const children = useMemo(() => childrenProp.filter(_isReactElement), [childrenProp]);
|
|
8410
8420
|
const tabs = children.map((child, childIndex) => cloneElement(child, {
|
|
@@ -8424,29 +8434,29 @@ const TabList = forwardRef(function TabList2(props, ref) {
|
|
|
8424
8434
|
setFocusedIndex(prevIndex => (prevIndex + 1) % numTabs);
|
|
8425
8435
|
}
|
|
8426
8436
|
}, [numTabs]);
|
|
8427
|
-
return /* @__PURE__ */jsx(Inline,
|
|
8428
|
-
"data-ui": "TabList"
|
|
8429
|
-
|
|
8437
|
+
return /* @__PURE__ */jsx(Inline, {
|
|
8438
|
+
"data-ui": "TabList",
|
|
8439
|
+
...restProps,
|
|
8430
8440
|
onKeyDown: handleKeyDown,
|
|
8431
8441
|
ref,
|
|
8432
8442
|
role: "tablist",
|
|
8433
8443
|
children: tabs
|
|
8434
|
-
})
|
|
8444
|
+
});
|
|
8435
8445
|
});
|
|
8436
8446
|
const TabPanel = forwardRef(function TabPanel2(props, ref) {
|
|
8437
8447
|
const {
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
return /* @__PURE__ */jsx(Box,
|
|
8442
|
-
"data-ui": "TabPanel"
|
|
8443
|
-
|
|
8448
|
+
flex,
|
|
8449
|
+
...restProps
|
|
8450
|
+
} = props;
|
|
8451
|
+
return /* @__PURE__ */jsx(Box, {
|
|
8452
|
+
"data-ui": "TabPanel",
|
|
8453
|
+
...restProps,
|
|
8444
8454
|
flex,
|
|
8445
8455
|
ref,
|
|
8446
8456
|
role: "tabpanel",
|
|
8447
8457
|
tabIndex: props.tabIndex === void 0 ? 0 : props.tabIndex,
|
|
8448
8458
|
children: props.children
|
|
8449
|
-
})
|
|
8459
|
+
});
|
|
8450
8460
|
});
|
|
8451
8461
|
const STATUS_CARD_TONE = {
|
|
8452
8462
|
error: "critical",
|
|
@@ -8464,19 +8474,19 @@ const Root$2 = styled(Card)(_templateObject83 || (_templateObject83 = _taggedTem
|
|
|
8464
8474
|
const TextBox = styled(Flex)(_templateObject84 || (_templateObject84 = _taggedTemplateLiteral(["\n overflow-x: auto;\n"])));
|
|
8465
8475
|
function Toast(props) {
|
|
8466
8476
|
const {
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8477
|
+
closable,
|
|
8478
|
+
description,
|
|
8479
|
+
onClose,
|
|
8480
|
+
title,
|
|
8481
|
+
status,
|
|
8482
|
+
...restProps
|
|
8483
|
+
} = props;
|
|
8474
8484
|
const cardTone = status ? STATUS_CARD_TONE[status] : "default";
|
|
8475
8485
|
const role = status ? ROLES[status] : "status";
|
|
8476
|
-
return /* @__PURE__ */jsx(Root$2,
|
|
8486
|
+
return /* @__PURE__ */jsx(Root$2, {
|
|
8477
8487
|
"data-ui": "Toast",
|
|
8478
|
-
role
|
|
8479
|
-
|
|
8488
|
+
role,
|
|
8489
|
+
...restProps,
|
|
8480
8490
|
marginTop: 3,
|
|
8481
8491
|
radius: 2,
|
|
8482
8492
|
shadow: 2,
|
|
@@ -8511,7 +8521,7 @@ function Toast(props) {
|
|
|
8511
8521
|
})
|
|
8512
8522
|
})]
|
|
8513
8523
|
})
|
|
8514
|
-
})
|
|
8524
|
+
});
|
|
8515
8525
|
}
|
|
8516
8526
|
function useMounted() {
|
|
8517
8527
|
const [mounted, mount] = useReducer(() => true, false);
|
|
@@ -8559,9 +8569,10 @@ function ToastProvider(props) {
|
|
|
8559
8569
|
return prevState.filter(t => t.id !== id).concat([{
|
|
8560
8570
|
dismiss,
|
|
8561
8571
|
id,
|
|
8562
|
-
params:
|
|
8572
|
+
params: {
|
|
8573
|
+
...params,
|
|
8563
8574
|
duration
|
|
8564
|
-
}
|
|
8575
|
+
}
|
|
8565
8576
|
}]);
|
|
8566
8577
|
});
|
|
8567
8578
|
if (toastsRef.current[id]) {
|
|
@@ -8728,10 +8739,10 @@ globalScope[key] = globalScope[key] || createContext(null);
|
|
|
8728
8739
|
const TreeContext = globalScope[key];
|
|
8729
8740
|
const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
8730
8741
|
const {
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8742
|
+
children,
|
|
8743
|
+
space = 1,
|
|
8744
|
+
...restProps
|
|
8745
|
+
} = props;
|
|
8735
8746
|
const forwardedRef = useForwardedRef(ref);
|
|
8736
8747
|
const [focusedElement, setFocusedElement] = useState(null);
|
|
8737
8748
|
const focusedElementRef = useRef(focusedElement);
|
|
@@ -8746,7 +8757,8 @@ const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
|
8746
8757
|
stateRef.current = state;
|
|
8747
8758
|
}, [state]);
|
|
8748
8759
|
const registerItem = useCallback((element, path2, expanded, selected) => {
|
|
8749
|
-
setState(s =>
|
|
8760
|
+
setState(s => ({
|
|
8761
|
+
...s,
|
|
8750
8762
|
[path2]: {
|
|
8751
8763
|
element,
|
|
8752
8764
|
expanded
|
|
@@ -8757,7 +8769,9 @@ const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
|
8757
8769
|
}
|
|
8758
8770
|
return () => {
|
|
8759
8771
|
setState(s => {
|
|
8760
|
-
const newState =
|
|
8772
|
+
const newState = {
|
|
8773
|
+
...s
|
|
8774
|
+
};
|
|
8761
8775
|
delete newState[path2];
|
|
8762
8776
|
return newState;
|
|
8763
8777
|
});
|
|
@@ -8767,11 +8781,13 @@ const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
|
8767
8781
|
setState(s => {
|
|
8768
8782
|
const itemState = s[path2];
|
|
8769
8783
|
if (!itemState) return s;
|
|
8770
|
-
return
|
|
8771
|
-
|
|
8784
|
+
return {
|
|
8785
|
+
...s,
|
|
8786
|
+
[path2]: {
|
|
8787
|
+
...itemState,
|
|
8772
8788
|
expanded
|
|
8773
|
-
}
|
|
8774
|
-
}
|
|
8789
|
+
}
|
|
8790
|
+
};
|
|
8775
8791
|
});
|
|
8776
8792
|
}, []);
|
|
8777
8793
|
const contextValue = useMemo(() => ({
|
|
@@ -8816,11 +8832,13 @@ const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
|
8816
8832
|
setState(s => {
|
|
8817
8833
|
const itemState2 = s[itemKey];
|
|
8818
8834
|
if (!itemState2) return s;
|
|
8819
|
-
return
|
|
8820
|
-
|
|
8835
|
+
return {
|
|
8836
|
+
...s,
|
|
8837
|
+
[itemKey]: {
|
|
8838
|
+
...itemState2,
|
|
8821
8839
|
expanded: false
|
|
8822
|
-
}
|
|
8823
|
-
}
|
|
8840
|
+
}
|
|
8841
|
+
};
|
|
8824
8842
|
});
|
|
8825
8843
|
} else {
|
|
8826
8844
|
const itemPath = itemKey.split("/");
|
|
@@ -8842,11 +8860,13 @@ const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
|
8842
8860
|
setState(s => {
|
|
8843
8861
|
const itemState = s[focusedKey];
|
|
8844
8862
|
if (!itemState) return s;
|
|
8845
|
-
return
|
|
8846
|
-
|
|
8863
|
+
return {
|
|
8864
|
+
...s,
|
|
8865
|
+
[focusedKey]: {
|
|
8866
|
+
...itemState,
|
|
8847
8867
|
expanded: true
|
|
8848
|
-
}
|
|
8849
|
-
}
|
|
8868
|
+
}
|
|
8869
|
+
};
|
|
8850
8870
|
});
|
|
8851
8871
|
}
|
|
8852
8872
|
return;
|
|
@@ -8859,16 +8879,16 @@ const Tree = memo(forwardRef(function Tree2(props, ref) {
|
|
|
8859
8879
|
}, [children, forwardedRef]);
|
|
8860
8880
|
return /* @__PURE__ */jsx(TreeContext.Provider, {
|
|
8861
8881
|
value: contextValue,
|
|
8862
|
-
children: /* @__PURE__ */jsx(Stack,
|
|
8882
|
+
children: /* @__PURE__ */jsx(Stack, {
|
|
8863
8883
|
as: "ul",
|
|
8864
|
-
"data-ui": "Tree"
|
|
8865
|
-
|
|
8884
|
+
"data-ui": "Tree",
|
|
8885
|
+
...restProps,
|
|
8866
8886
|
onKeyDown: handleKeyDown,
|
|
8867
8887
|
ref: forwardedRef,
|
|
8868
8888
|
role: "tree",
|
|
8869
8889
|
space,
|
|
8870
8890
|
children
|
|
8871
|
-
})
|
|
8891
|
+
})
|
|
8872
8892
|
});
|
|
8873
8893
|
}));
|
|
8874
8894
|
Tree.displayName = "Tree";
|
|
@@ -8907,21 +8927,21 @@ function useTree() {
|
|
|
8907
8927
|
}
|
|
8908
8928
|
const TreeGroup = memo(function TreeGroup2(props) {
|
|
8909
8929
|
const {
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8930
|
+
children,
|
|
8931
|
+
expanded = false,
|
|
8932
|
+
...restProps
|
|
8933
|
+
} = props;
|
|
8914
8934
|
const tree = useTree();
|
|
8915
|
-
return /* @__PURE__ */jsx(Stack,
|
|
8935
|
+
return /* @__PURE__ */jsx(Stack, {
|
|
8916
8936
|
as: "ul",
|
|
8917
|
-
"data-ui": "TreeGroup"
|
|
8918
|
-
|
|
8937
|
+
"data-ui": "TreeGroup",
|
|
8938
|
+
...restProps,
|
|
8919
8939
|
hidden: !expanded,
|
|
8920
8940
|
marginTop: tree.space,
|
|
8921
8941
|
role: "group",
|
|
8922
8942
|
space: tree.space,
|
|
8923
8943
|
children
|
|
8924
|
-
})
|
|
8944
|
+
});
|
|
8925
8945
|
});
|
|
8926
8946
|
const Root = memo(styled.li(treeItemRootStyle, treeItemRootColorStyle));
|
|
8927
8947
|
const TreeItemBox = styled(Box).attrs({
|
|
@@ -8930,21 +8950,21 @@ const TreeItemBox = styled(Box).attrs({
|
|
|
8930
8950
|
const ToggleArrowText = styled(Text)(_templateObject90 || (_templateObject90 = _taggedTemplateLiteral(["\n & > svg {\n transition: transform 100ms;\n }\n"])));
|
|
8931
8951
|
const TreeItem = memo(function TreeItem2(props) {
|
|
8932
8952
|
const {
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8953
|
+
children,
|
|
8954
|
+
expanded: expandedProp = false,
|
|
8955
|
+
fontSize,
|
|
8956
|
+
href,
|
|
8957
|
+
icon,
|
|
8958
|
+
id: idProp,
|
|
8959
|
+
muted,
|
|
8960
|
+
onClick,
|
|
8961
|
+
padding = 3,
|
|
8962
|
+
selected = false,
|
|
8963
|
+
space = 2,
|
|
8964
|
+
text,
|
|
8965
|
+
weight,
|
|
8966
|
+
...restProps
|
|
8967
|
+
} = props;
|
|
8948
8968
|
const rootRef = useRef(null);
|
|
8949
8969
|
const treeitemRef = useRef(null);
|
|
8950
8970
|
const tree = useTree();
|
|
@@ -8962,7 +8982,8 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
8962
8982
|
const focused = tree.focusedElement === rootRef.current;
|
|
8963
8983
|
const expanded = (itemState == null ? void 0 : itemState.expanded) === void 0 ? expandedProp : (itemState == null ? void 0 : itemState.expanded) || false;
|
|
8964
8984
|
const tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1;
|
|
8965
|
-
const contextValue = useMemo(() =>
|
|
8985
|
+
const contextValue = useMemo(() => ({
|
|
8986
|
+
...tree,
|
|
8966
8987
|
level: tree.level + 1,
|
|
8967
8988
|
path: itemPath
|
|
8968
8989
|
}), [itemPath, tree]);
|
|
@@ -9020,12 +9041,12 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
9020
9041
|
})]
|
|
9021
9042
|
});
|
|
9022
9043
|
if (href) {
|
|
9023
|
-
return /* @__PURE__ */jsxs(Root,
|
|
9044
|
+
return /* @__PURE__ */jsxs(Root, {
|
|
9024
9045
|
"data-selected": selected ? "" : void 0,
|
|
9025
9046
|
"data-tree-id": id,
|
|
9026
9047
|
"data-tree-key": itemKey,
|
|
9027
|
-
"data-ui": "TreeItem"
|
|
9028
|
-
|
|
9048
|
+
"data-ui": "TreeItem",
|
|
9049
|
+
...restProps,
|
|
9029
9050
|
onClick: handleClick,
|
|
9030
9051
|
ref: rootRef,
|
|
9031
9052
|
role: "none",
|
|
@@ -9045,14 +9066,14 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
9045
9066
|
children
|
|
9046
9067
|
})
|
|
9047
9068
|
})]
|
|
9048
|
-
})
|
|
9069
|
+
});
|
|
9049
9070
|
}
|
|
9050
|
-
return /* @__PURE__ */jsxs(Root,
|
|
9071
|
+
return /* @__PURE__ */jsxs(Root, {
|
|
9051
9072
|
"data-selected": selected ? "" : void 0,
|
|
9052
9073
|
"data-ui": "TreeItem",
|
|
9053
9074
|
"data-tree-id": id,
|
|
9054
|
-
"data-tree-key": itemKey
|
|
9055
|
-
|
|
9075
|
+
"data-tree-key": itemKey,
|
|
9076
|
+
...restProps,
|
|
9056
9077
|
"aria-expanded": expanded,
|
|
9057
9078
|
onClick: handleClick,
|
|
9058
9079
|
onKeyDown: handleKeyDown,
|
|
@@ -9071,7 +9092,7 @@ const TreeItem = memo(function TreeItem2(props) {
|
|
|
9071
9092
|
children
|
|
9072
9093
|
})
|
|
9073
9094
|
})]
|
|
9074
|
-
})
|
|
9095
|
+
});
|
|
9075
9096
|
});
|
|
9076
9097
|
export { Autocomplete, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Box, Breadcrumbs, Button, Card, Checkbox, Code, CodeSkeleton, Container, Dialog, DialogContext, DialogProvider, ElementQuery, ErrorBoundary, Flex, Grid, Heading, HeadingSkeleton, Hotkeys, Inline, KBD, Label, LabelSkeleton, Layer, LayerProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem, Popover, Portal, PortalProvider, Radio, Select, Skeleton, Spinner, SrOnly, Stack, Switch, Tab, TabList, TabPanel, Text, TextArea, TextInput, TextSkeleton, ThemeColorProvider, ThemeProvider, Toast, ToastProvider, Tooltip, Tree, TreeItem, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _hasFocus, _isEnterToClickElement, _isScrollable, _raf, _raf2, _responsive, attemptFocus, createColorTheme, focusFirstDescendant, focusLastDescendant, hexToRgb, hslToRgb, isFocusable, isHTMLAnchorElement, isHTMLButtonElement, isHTMLElement, isHTMLInputElement, isHTMLSelectElement, isHTMLTextAreaElement, multiply$1 as multiply, parseColor, rem, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen$1 as screen, studioTheme, useArrayProp, useBoundaryElement, useClickOutside, useCustomValidity, useDialog, useElementRect, useElementSize, useForwardedRef, useGlobalKeyDown, useLayer, useMediaIndex, usePortal, usePrefersDark, useRootTheme, useTheme, useToast, useTree };
|
|
9077
9098
|
//# sourceMappingURL=index.esm.js.map
|