@sanity/ui 4.0.7 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{arrow-CL8xmdbg.js → arrow-C6TlkggA.js} +5 -4
- package/dist/arrow-C6TlkggA.js.map +1 -0
- package/dist/autocomplete.d.ts.map +1 -1
- package/dist/autocomplete.js +35 -39
- package/dist/autocomplete.js.map +1 -1
- package/dist/breadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs.js +28 -30
- package/dist/breadcrumbs.js.map +1 -1
- package/dist/{button-DQH2KIbq.js → button-D3iEd7Je.js} +7 -7
- package/dist/button-D3iEd7Je.js.map +1 -0
- package/dist/button-dnqMFkWg.d.ts.map +1 -1
- package/dist/{hotkeys-BPlacpG8.js → hotkeys-Bi6Q5963.js} +26 -26
- package/dist/hotkeys-Bi6Q5963.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +310 -344
- package/dist/index.js.map +1 -1
- package/dist/layer-BK7xWHcE.js +61 -0
- package/dist/layer-BK7xWHcE.js.map +1 -0
- package/dist/layer-ChlP9Ik6.d.ts.map +1 -1
- package/dist/menu.d.ts.map +1 -1
- package/dist/menu.js +46 -34
- package/dist/menu.js.map +1 -1
- package/dist/{popover-CEbjxiPx.js → popover-CdBTZDvj.js} +2 -2
- package/dist/{popover-CEbjxiPx.js.map → popover-CdBTZDvj.js.map} +1 -1
- package/dist/popover.js +1 -1
- package/dist/styles.css +408 -0
- package/dist/{textInput-B6ZZJSOj.js → textInput-Bu3QuADZ.js} +36 -48
- package/dist/textInput-Bu3QuADZ.js.map +1 -0
- package/dist/toast.d.ts.map +1 -1
- package/dist/toast.js +77 -73
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +87 -90
- package/dist/tooltip.js.map +1 -1
- package/package.json +6 -5
- package/dist/arrow-CL8xmdbg.js.map +0 -1
- package/dist/button-DQH2KIbq.js.map +0 -1
- package/dist/hotkeys-BPlacpG8.js.map +0 -1
- package/dist/layer-DGn7KJIB.js +0 -61
- package/dist/layer-DGn7KJIB.js.map +0 -1
- package/dist/textInput-B6ZZJSOj.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as rem, i as _responsive, n as _getArrayProp, r as _getResponsiveSpace, s as EMPTY_RECORD, t as _fillCSSObject } from "./helpers-C8xxXAQC.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as textInputFontSizeStyle, c as responsiveInputPaddingStyle, d as attemptFocus, f as focusFirstDescendant, g as _raf2, h as _raf, i as textInputBaseStyle, l as useCustomValidity, m as isFocusable, n as inputRoot, o as textInputRepresentationStyle, p as focusLastDescendant, r as textInputRoot, s as responsiveInputPaddingIconRightStyle, t as TextInput, u as _hasFocus } from "./textInput-Bu3QuADZ.js";
|
|
4
4
|
import { a as isHTMLElement, c as isHTMLTextAreaElement, i as isHTMLButtonElement, n as containsOrEqualsElement, o as isHTMLInputElement, r as isHTMLAnchorElement, s as isHTMLSelectElement, t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
|
|
5
5
|
import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
|
|
6
6
|
import { _ as useTheme_v2, a as useMatchMedia, b as responsivePaddingStyle, c as ThemeColorProvider, d as createGlobalScopedContext, g as useTheme, h as _cardColorStyle, i as usePrefersReducedMotion, l as useRootTheme, m as focusRingStyle, n as LayerProvider, o as useMediaIndex, p as focusRingBorderStyle, s as Card, t as useLayer, u as ThemeProvider, v as responsiveRadiusStyle, y as Box } from "./useLayer-jUJIz8mh.js";
|
|
7
7
|
import { t as Flex } from "./flex-CySCBzQm.js";
|
|
8
8
|
import { a as responsiveTextAlignStyle, i as responsiveTextFont, n as Text, r as SpanWithTextOverflow, t as Stack } from "./stack-BGFEokua.js";
|
|
9
9
|
import { t as responsiveFont } from "./responsiveFont-CilwaORG.js";
|
|
10
|
-
import { n as Spinner, t as Button } from "./button-
|
|
10
|
+
import { n as Spinner, t as Button } from "./button-D3iEd7Je.js";
|
|
11
11
|
import { n as _elementSizeObserver, t as useElementSize } from "./useElementSize-BJvbGHq8.js";
|
|
12
|
-
import { a as useBoundaryElement, i as PortalContext, n as Portal, o as BoundaryElementContext, r as usePortal, t as Arrow } from "./arrow-
|
|
12
|
+
import { a as useBoundaryElement, i as PortalContext, n as Portal, o as BoundaryElementContext, r as usePortal, t as Arrow } from "./arrow-C6TlkggA.js";
|
|
13
13
|
import { t as useClickOutsideEvent } from "./useClickOutsideEvent-wGLGWBZN.js";
|
|
14
14
|
import { t as responsiveCodeFontStyle } from "./codeFontStyle-84SMhFtI.js";
|
|
15
15
|
import { a as rgba$1, c as hslToRgb$1, i as multiply$1, l as rgbToHex$1, n as buildTheme, o as parseColor$1, r as screen$1, s as hexToRgb$1, t as createColorTheme$1, u as rgbToHsl$1 } from "./factory-BA3gEfyI.js";
|
|
16
|
-
import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-
|
|
17
|
-
import { t as Layer } from "./layer-
|
|
16
|
+
import { i as useGlobalKeyDown, n as KBD, r as Inline, t as Hotkeys } from "./hotkeys-Bi6Q5963.js";
|
|
17
|
+
import { t as Layer } from "./layer-BK7xWHcE.js";
|
|
18
18
|
import { t as Grid } from "./grid-I2TNptX-.js";
|
|
19
19
|
import { c } from "react/compiler-runtime";
|
|
20
20
|
import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
|
|
21
|
+
import { clsx } from "clsx/lite";
|
|
21
22
|
import { Children, Component, cloneElement, isValidElement, startTransition, useContext, useEffect, useId, useImperativeHandle, useRef, useState, useSyncExternalStore } from "react";
|
|
22
|
-
import { css,
|
|
23
|
+
import { css, styled } from "styled-components";
|
|
23
24
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
24
25
|
import ReactIs from "react-is";
|
|
25
26
|
import { CloseIcon } from "@sanity/icons/Close";
|
|
@@ -67,25 +68,12 @@ function ContainerComponent(props) {
|
|
|
67
68
|
const Container = ContainerComponent;
|
|
68
69
|
function dialogStyle({ theme }) {
|
|
69
70
|
let { color } = getTheme_v2(theme);
|
|
70
|
-
return {
|
|
71
|
-
"&:not([hidden])": { display: "flex" },
|
|
72
|
-
top: 0,
|
|
73
|
-
left: 0,
|
|
74
|
-
right: 0,
|
|
75
|
-
bottom: 0,
|
|
76
|
-
alignItems: "center",
|
|
77
|
-
justifyContent: "center",
|
|
78
|
-
outline: "none",
|
|
79
|
-
background: color.backdrop
|
|
80
|
-
};
|
|
71
|
+
return { background: color.backdrop };
|
|
81
72
|
}
|
|
82
73
|
function responsiveDialogPositionStyle(props) {
|
|
83
74
|
let { media } = getTheme_v2(props.theme);
|
|
84
75
|
return _responsive(media, props.$position, (position) => ({ "&&": { position } }));
|
|
85
76
|
}
|
|
86
|
-
function animationDialogStyle(props) {
|
|
87
|
-
return props.$animate ? css`@keyframes zoomIn{from{opacity:0;transform:scale(0.95);}to{opacity:1;transform:scale(1);}}@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}animation:fadeIn 200ms ease-out;& > [data-ui='DialogCard']{animation:zoomIn 200ms ease-out;}` : css``;
|
|
88
|
-
}
|
|
89
77
|
/**
|
|
90
78
|
* @internal
|
|
91
79
|
*/
|
|
@@ -97,31 +85,14 @@ const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", { v
|
|
|
97
85
|
function useDialog() {
|
|
98
86
|
return useContext(DialogContext);
|
|
99
87
|
}
|
|
88
|
+
var dialogCard = "_1a85unk5", dialogContainer = "_1a85unk4", dialogContent = "_1a85unk8", dialogLayer = "_1a85unk0", dialogLayout = "_1a85unk6";
|
|
100
89
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
101
90
|
return !boundaryElement || !portalElement || containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
102
91
|
}
|
|
103
92
|
const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
|
|
104
93
|
displayName: "StyledDialog",
|
|
105
|
-
componentId: "sc-
|
|
106
|
-
})(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle
|
|
107
|
-
displayName: "DialogContainer",
|
|
108
|
-
componentId: "sc-1shthr-1"
|
|
109
|
-
})`&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;`, DialogCardRoot = styled(Card).withConfig({
|
|
110
|
-
displayName: "DialogCardRoot",
|
|
111
|
-
componentId: "sc-1shthr-2"
|
|
112
|
-
})`&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;`, DialogLayout = styled(Flex).withConfig({
|
|
113
|
-
displayName: "DialogLayout",
|
|
114
|
-
componentId: "sc-1shthr-3"
|
|
115
|
-
})`flex:1;min-height:0;width:100%;`, DialogHeader = styled(Box).withConfig({
|
|
116
|
-
displayName: "DialogHeader",
|
|
117
|
-
componentId: "sc-1shthr-4"
|
|
118
|
-
})`position:relative;z-index:2;`, DialogContent = styled(Box).withConfig({
|
|
119
|
-
displayName: "DialogContent",
|
|
120
|
-
componentId: "sc-1shthr-5"
|
|
121
|
-
})`position:relative;z-index:1;overflow:auto;outline:none;`, DialogFooter = styled(Box).withConfig({
|
|
122
|
-
displayName: "DialogFooter",
|
|
123
|
-
componentId: "sc-1shthr-6"
|
|
124
|
-
})`position:relative;z-index:3;`;
|
|
94
|
+
componentId: "sc-pe1n4l-0"
|
|
95
|
+
})(responsivePaddingStyle, dialogStyle, responsiveDialogPositionStyle);
|
|
125
96
|
function DialogCard(props) {
|
|
126
97
|
let $ = c(44), { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, children, contentRef: forwardedContentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: radiusProp, ref: forwardedRef, scheme, shadow: shadowProp, width: widthProp } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, t0;
|
|
127
98
|
$[0] === radiusProp ? t0 = $[1] : (t0 = _getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0);
|
|
@@ -151,42 +122,51 @@ function DialogCard(props) {
|
|
|
151
122
|
let t9;
|
|
152
123
|
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], useClickOutsideEvent(t8, t9);
|
|
153
124
|
let t10;
|
|
154
|
-
$[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsx(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
125
|
+
$[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsx(Box, {
|
|
126
|
+
className: "_1a85unk7",
|
|
127
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
128
|
+
align: "flex-start",
|
|
129
|
+
padding: 3,
|
|
130
|
+
children: [/* @__PURE__ */ jsx(Box, {
|
|
131
|
+
flex: 1,
|
|
132
|
+
padding: 2,
|
|
133
|
+
children: header && /* @__PURE__ */ jsx(Text, {
|
|
134
|
+
id: labelId,
|
|
135
|
+
size: 1,
|
|
136
|
+
weight: "semibold",
|
|
137
|
+
children: header
|
|
138
|
+
})
|
|
139
|
+
}), showCloseButton && /* @__PURE__ */ jsx(Box, {
|
|
140
|
+
flex: "none",
|
|
141
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
142
|
+
"aria-label": "Close dialog",
|
|
143
|
+
disabled: !onClose,
|
|
144
|
+
icon: CloseIcon,
|
|
145
|
+
mode: "bleed",
|
|
146
|
+
onClick: onClose,
|
|
147
|
+
padding: 2
|
|
148
|
+
})
|
|
149
|
+
})]
|
|
150
|
+
})
|
|
151
|
+
}), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
|
|
178
152
|
let t11;
|
|
179
|
-
$[28] === children ? t11 = $[29] : (t11 = /* @__PURE__ */ jsx(
|
|
153
|
+
$[28] === children ? t11 = $[29] : (t11 = /* @__PURE__ */ jsx(Box, {
|
|
154
|
+
className: dialogContent,
|
|
180
155
|
flex: 1,
|
|
181
156
|
ref: contentRef,
|
|
182
157
|
tabIndex: -1,
|
|
183
158
|
children
|
|
184
159
|
}), $[28] = children, $[29] = t11);
|
|
185
160
|
let t12;
|
|
186
|
-
$[30] === footer ? t12 = $[31] : (t12 = footer && /* @__PURE__ */ jsx(
|
|
161
|
+
$[30] === footer ? t12 = $[31] : (t12 = footer && /* @__PURE__ */ jsx(Box, {
|
|
162
|
+
className: "_1a85unk9",
|
|
163
|
+
children: footer
|
|
164
|
+
}), $[30] = footer, $[31] = t12);
|
|
187
165
|
let t13;
|
|
188
|
-
$[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxs(
|
|
166
|
+
$[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxs(Flex, {
|
|
167
|
+
className: dialogLayout,
|
|
189
168
|
direction: "column",
|
|
169
|
+
flex: 1,
|
|
190
170
|
children: [
|
|
191
171
|
t10,
|
|
192
172
|
t11,
|
|
@@ -194,7 +174,9 @@ function DialogCard(props) {
|
|
|
194
174
|
]
|
|
195
175
|
}), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
|
|
196
176
|
let t14;
|
|
197
|
-
$[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsx(
|
|
177
|
+
$[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsx(Card, {
|
|
178
|
+
className: dialogCard,
|
|
179
|
+
display: "flex",
|
|
198
180
|
radius,
|
|
199
181
|
ref,
|
|
200
182
|
scheme,
|
|
@@ -202,8 +184,10 @@ function DialogCard(props) {
|
|
|
202
184
|
children: t13
|
|
203
185
|
}), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
|
|
204
186
|
let t15;
|
|
205
|
-
return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsx(
|
|
187
|
+
return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsx(Container, {
|
|
188
|
+
className: dialogContainer,
|
|
206
189
|
"data-ui": "DialogCard",
|
|
190
|
+
display: "flex",
|
|
207
191
|
width,
|
|
208
192
|
children: t14
|
|
209
193
|
}), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
|
|
@@ -214,20 +198,20 @@ function DialogCard(props) {
|
|
|
214
198
|
* @public
|
|
215
199
|
*/
|
|
216
200
|
function Dialog(props) {
|
|
217
|
-
let $ = c(
|
|
218
|
-
$[0] === props ? (_positionProp = $[1], _zOffsetProp = $[2], children = $[3],
|
|
201
|
+
let $ = c(75), dialog = useDialog(), { layer } = useTheme_v2(), _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, ref, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
|
|
202
|
+
$[0] === props ? (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], ref = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], t6 = $[23]) : ({__unstable_autoFocus: t0, __unstable_hideCloseButton: t1, cardRadius: t2, cardShadow: t3, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, padding: t4, portal: portalProp, position: _positionProp, ref, scheme, width: t5, zOffset: _zOffsetProp, animate: t6, className, ...restProps} = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = ref, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = t6);
|
|
219
203
|
let autoFocus = t0 === void 0 || t0, hideCloseButton = t1 !== void 0 && t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 !== void 0 && t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = !usePrefersReducedMotion() && _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, t7;
|
|
220
|
-
$[
|
|
204
|
+
$[24] === cardRadiusProp ? t7 = $[25] : (t7 = _getArrayProp(cardRadiusProp), $[24] = cardRadiusProp, $[25] = t7);
|
|
221
205
|
let cardRadius = t7, t8;
|
|
222
|
-
$[
|
|
206
|
+
$[26] === paddingProp ? t8 = $[27] : (t8 = _getArrayProp(paddingProp), $[26] = paddingProp, $[27] = t8);
|
|
223
207
|
let padding = t8, t9;
|
|
224
|
-
$[
|
|
208
|
+
$[28] === positionProp ? t9 = $[29] : (t9 = _getArrayProp(positionProp), $[28] = positionProp, $[29] = t9);
|
|
225
209
|
let position = t9, t10;
|
|
226
|
-
$[
|
|
210
|
+
$[30] === widthProp ? t10 = $[31] : (t10 = _getArrayProp(widthProp), $[30] = widthProp, $[31] = t10);
|
|
227
211
|
let width = t10, t11;
|
|
228
|
-
$[
|
|
212
|
+
$[32] === zOffsetProp ? t11 = $[33] : (t11 = _getArrayProp(zOffsetProp), $[32] = zOffsetProp, $[33] = t11);
|
|
229
213
|
let zOffset = t11, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null), t12;
|
|
230
|
-
$[
|
|
214
|
+
$[34] === onFocus ? t12 = $[35] : (t12 = (event) => {
|
|
231
215
|
onFocus?.(event);
|
|
232
216
|
let target = event.target, cardElement = cardRef.current;
|
|
233
217
|
if (cardElement && target === preDivRef.current) {
|
|
@@ -239,9 +223,9 @@ function Dialog(props) {
|
|
|
239
223
|
return;
|
|
240
224
|
}
|
|
241
225
|
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
242
|
-
}, $[
|
|
226
|
+
}, $[34] = onFocus, $[35] = t12);
|
|
243
227
|
let handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0), t13;
|
|
244
|
-
$[
|
|
228
|
+
$[36] !== boundaryElement || $[37] !== portalElement ? (t13 = () => {
|
|
245
229
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
246
230
|
let activeElement = document.activeElement;
|
|
247
231
|
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
@@ -254,14 +238,16 @@ function Dialog(props) {
|
|
|
254
238
|
target_0.focus();
|
|
255
239
|
}
|
|
256
240
|
}, 0);
|
|
257
|
-
}, $[
|
|
258
|
-
let handleRootClick = t13, t14;
|
|
259
|
-
$[
|
|
241
|
+
}, $[36] = boundaryElement, $[37] = portalElement, $[38] = t13) : t13 = $[38];
|
|
242
|
+
let handleRootClick = t13, t14 = animate && "_1a85unk3", t15;
|
|
243
|
+
$[39] !== className || $[40] !== t14 ? (t15 = clsx(dialogLayer, t14, className), $[39] = className, $[40] = t14, $[41] = t15) : t15 = $[41];
|
|
244
|
+
let t16;
|
|
245
|
+
$[42] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", {
|
|
260
246
|
ref: preDivRef,
|
|
261
247
|
tabIndex: 0
|
|
262
|
-
}), $[
|
|
263
|
-
let
|
|
264
|
-
$[
|
|
248
|
+
}), $[42] = t16) : t16 = $[42];
|
|
249
|
+
let t17;
|
|
250
|
+
$[43] !== autoFocus || $[44] !== cardRadius || $[45] !== cardShadow || $[46] !== children || $[47] !== contentRef || $[48] !== footer || $[49] !== header || $[50] !== hideCloseButton || $[51] !== id || $[52] !== onClickOutside || $[53] !== onClose || $[54] !== portalProp || $[55] !== scheme || $[56] !== width ? (t17 = /* @__PURE__ */ jsx(DialogCard, {
|
|
265
251
|
__unstable_autoFocus: autoFocus,
|
|
266
252
|
__unstable_hideCloseButton: hideCloseButton,
|
|
267
253
|
contentRef,
|
|
@@ -277,19 +263,19 @@ function Dialog(props) {
|
|
|
277
263
|
shadow: cardShadow,
|
|
278
264
|
width,
|
|
279
265
|
children
|
|
280
|
-
}), $[
|
|
281
|
-
let
|
|
282
|
-
$[
|
|
266
|
+
}), $[43] = autoFocus, $[44] = cardRadius, $[45] = cardShadow, $[46] = children, $[47] = contentRef, $[48] = footer, $[49] = header, $[50] = hideCloseButton, $[51] = id, $[52] = onClickOutside, $[53] = onClose, $[54] = portalProp, $[55] = scheme, $[56] = width, $[57] = t17) : t17 = $[57];
|
|
267
|
+
let t18;
|
|
268
|
+
$[58] === Symbol.for("react.memo_cache_sentinel") ? (t18 = /* @__PURE__ */ jsx("div", {
|
|
283
269
|
ref: postDivRef,
|
|
284
270
|
tabIndex: 0
|
|
285
|
-
}), $[
|
|
286
|
-
let
|
|
287
|
-
$[
|
|
271
|
+
}), $[58] = t18) : t18 = $[58];
|
|
272
|
+
let t19;
|
|
273
|
+
$[59] !== handleFocus || $[60] !== handleRootClick || $[61] !== id || $[62] !== labelId || $[63] !== onActivate || $[64] !== padding || $[65] !== position || $[66] !== ref || $[67] !== restProps || $[68] !== t15 || $[69] !== t17 || $[70] !== zOffset ? (t19 = /* @__PURE__ */ jsxs(StyledDialog, {
|
|
288
274
|
...restProps,
|
|
289
|
-
$animate: animate,
|
|
290
275
|
$padding: padding,
|
|
291
276
|
$position: position,
|
|
292
277
|
"aria-labelledby": labelId,
|
|
278
|
+
className: t15,
|
|
293
279
|
"aria-modal": !0,
|
|
294
280
|
"data-ui": "Dialog",
|
|
295
281
|
id,
|
|
@@ -300,16 +286,16 @@ function Dialog(props) {
|
|
|
300
286
|
role: "dialog",
|
|
301
287
|
zOffset,
|
|
302
288
|
children: [
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
289
|
+
t16,
|
|
290
|
+
t17,
|
|
291
|
+
t18
|
|
306
292
|
]
|
|
307
|
-
}), $[
|
|
308
|
-
let
|
|
309
|
-
return $[
|
|
293
|
+
}), $[59] = handleFocus, $[60] = handleRootClick, $[61] = id, $[62] = labelId, $[63] = onActivate, $[64] = padding, $[65] = position, $[66] = ref, $[67] = restProps, $[68] = t15, $[69] = t17, $[70] = zOffset, $[71] = t19) : t19 = $[71];
|
|
294
|
+
let t20;
|
|
295
|
+
return $[72] !== portalProp || $[73] !== t19 ? (t20 = /* @__PURE__ */ jsx(Portal, {
|
|
310
296
|
__unstable_name: portalProp,
|
|
311
|
-
children:
|
|
312
|
-
}), $[
|
|
297
|
+
children: t19
|
|
298
|
+
}), $[72] = portalProp, $[73] = t19, $[74] = t20) : t20 = $[74], t20;
|
|
313
299
|
}
|
|
314
300
|
/**
|
|
315
301
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
@@ -328,19 +314,20 @@ function DialogProvider(props) {
|
|
|
328
314
|
children
|
|
329
315
|
}), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
|
|
330
316
|
}
|
|
331
|
-
|
|
317
|
+
var skeleton = "fnwpv81", skeletonAnimated = "fnwpv84", skeletonHidden = "fnwpv83", skeletonStatic = "fnwpv85", skeletonVisible = "fnwpv82";
|
|
318
|
+
const StyledSkeleton$1 = /* @__PURE__ */ styled(Box).withConfig({
|
|
332
319
|
displayName: "StyledSkeleton",
|
|
333
|
-
componentId: "sc-
|
|
334
|
-
})(responsiveRadiusStyle
|
|
320
|
+
componentId: "sc-qq1bsx-0"
|
|
321
|
+
})(responsiveRadiusStyle);
|
|
335
322
|
/**
|
|
336
323
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
337
324
|
* @beta
|
|
338
325
|
*/
|
|
339
326
|
function Skeleton(props) {
|
|
340
|
-
let $ = c(
|
|
341
|
-
$[0] === props ? (
|
|
327
|
+
let $ = c(21), className, delay, radius, ref, restProps, t0;
|
|
328
|
+
$[0] === props ? (className = $[1], delay = $[2], radius = $[3], ref = $[4], restProps = $[5], t0 = $[6]) : ({animated: t0, className, delay, radius, ref, ...restProps} = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = ref, $[5] = restProps, $[6] = t0);
|
|
342
329
|
let animated = t0 !== void 0 && t0, [visible, setVisible] = useState(!delay), t1, t2;
|
|
343
|
-
$[
|
|
330
|
+
$[7] === delay ? (t1 = $[8], t2 = $[9]) : (t1 = () => {
|
|
344
331
|
if (!delay) return;
|
|
345
332
|
let timeout = setTimeout(() => {
|
|
346
333
|
setVisible(!0);
|
|
@@ -348,21 +335,23 @@ function Skeleton(props) {
|
|
|
348
335
|
return () => {
|
|
349
336
|
clearTimeout(timeout);
|
|
350
337
|
};
|
|
351
|
-
}, t2 = [delay], $[
|
|
338
|
+
}, t2 = [delay], $[7] = delay, $[8] = t1, $[9] = t2), useEffect(t1, t2);
|
|
352
339
|
let t3;
|
|
353
|
-
$[
|
|
354
|
-
let t4 = !delay || visible, t5;
|
|
355
|
-
|
|
340
|
+
$[10] === radius ? t3 = $[11] : (t3 = _getArrayProp(radius), $[10] = radius, $[11] = t3);
|
|
341
|
+
let t4 = !delay || visible ? skeletonVisible : skeletonHidden, t5 = animated ? skeletonAnimated : skeletonStatic, t6;
|
|
342
|
+
$[12] !== className || $[13] !== t4 || $[14] !== t5 ? (t6 = clsx(skeleton, t4, t5, className), $[12] = className, $[13] = t4, $[14] = t5, $[15] = t6) : t6 = $[15];
|
|
343
|
+
let t7;
|
|
344
|
+
return $[16] !== ref || $[17] !== restProps || $[18] !== t3 || $[19] !== t6 ? (t7 = /* @__PURE__ */ jsx(StyledSkeleton$1, {
|
|
345
|
+
"data-ui": "Skeleton",
|
|
356
346
|
...restProps,
|
|
357
|
-
$animated: animated,
|
|
358
347
|
$radius: t3,
|
|
359
|
-
|
|
348
|
+
className: t6,
|
|
360
349
|
ref
|
|
361
|
-
}), $[
|
|
350
|
+
}), $[16] = ref, $[17] = restProps, $[18] = t3, $[19] = t6, $[20] = t7) : t7 = $[20], t7;
|
|
362
351
|
}
|
|
363
352
|
const StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
|
|
364
353
|
displayName: "StyledSkeleton",
|
|
365
|
-
componentId: "sc-
|
|
354
|
+
componentId: "sc-pe7hmi-0"
|
|
366
355
|
})((props) => {
|
|
367
356
|
let { $size, $style } = props, { font, media } = getTheme_v2(props.theme), fontStyle = font[$style];
|
|
368
357
|
return _responsive(media, $size, (sizeIndex) => {
|
|
@@ -381,6 +370,7 @@ function TextSkeleton(props) {
|
|
|
381
370
|
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
382
371
|
let $size = t1, t2;
|
|
383
372
|
return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
373
|
+
"data-ui": "TextSkeleton",
|
|
384
374
|
...restProps,
|
|
385
375
|
$size,
|
|
386
376
|
$style: "text"
|
|
@@ -397,6 +387,7 @@ function LabelSkeleton(props) {
|
|
|
397
387
|
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
398
388
|
let $size = t1, t2;
|
|
399
389
|
return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
390
|
+
"data-ui": "LabelSkeleton",
|
|
400
391
|
...restProps,
|
|
401
392
|
$size,
|
|
402
393
|
$style: "label"
|
|
@@ -413,6 +404,7 @@ function HeadingSkeleton(props) {
|
|
|
413
404
|
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
414
405
|
let $size = t1, t2;
|
|
415
406
|
return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
407
|
+
"data-ui": "HeadingSkeleton",
|
|
416
408
|
...restProps,
|
|
417
409
|
$size,
|
|
418
410
|
$style: "heading"
|
|
@@ -429,40 +421,41 @@ function CodeSkeleton(props) {
|
|
|
429
421
|
$[3] === size ? t1 = $[4] : (t1 = _getArrayProp(size), $[3] = size, $[4] = t1);
|
|
430
422
|
let $size = t1, t2;
|
|
431
423
|
return $[5] !== $size || $[6] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, {
|
|
424
|
+
"data-ui": "CodeSkeleton",
|
|
432
425
|
...restProps,
|
|
433
426
|
$size,
|
|
434
427
|
$style: "code"
|
|
435
428
|
}), $[5] = $size, $[6] = restProps, $[7] = t2) : t2 = $[7], t2;
|
|
436
429
|
}
|
|
437
|
-
|
|
438
|
-
displayName: "CustomButton",
|
|
439
|
-
componentId: "sc-6g1gey-0"
|
|
440
|
-
})`max-width:100%;`;
|
|
430
|
+
var tab = "gpfraw0";
|
|
441
431
|
/**
|
|
442
432
|
* @public
|
|
443
433
|
*/
|
|
444
434
|
function Tab(props) {
|
|
445
|
-
let $ = c(
|
|
446
|
-
$[0] === props ? (
|
|
435
|
+
let $ = c(35), className, focused, forwardedRef, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
|
|
436
|
+
$[0] === props ? (className = $[1], focused = $[2], forwardedRef = $[3], icon = $[4], id = $[5], label = $[6], onClick = $[7], onFocus = $[8], restProps = $[9], selected = $[10], t0 = $[11], t1 = $[12]) : ({className, icon, id, focused, fontSize: t0, label, onClick, onFocus, padding: t1, ref: forwardedRef, selected, ...restProps} = props, $[0] = props, $[1] = className, $[2] = focused, $[3] = forwardedRef, $[4] = icon, $[5] = id, $[6] = label, $[7] = onClick, $[8] = onFocus, $[9] = restProps, $[10] = selected, $[11] = t0, $[12] = t1);
|
|
447
437
|
let fontSize = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = useRef(null), focusedRef = useRef(!1), t2;
|
|
448
|
-
$[
|
|
438
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
|
|
449
439
|
let t3;
|
|
450
|
-
$[
|
|
440
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
|
|
451
441
|
focusedRef.current = !1;
|
|
452
|
-
}, $[
|
|
442
|
+
}, $[14] = t3) : t3 = $[14];
|
|
453
443
|
let handleBlur = t3, t4;
|
|
454
|
-
$[
|
|
444
|
+
$[15] === onFocus ? t4 = $[16] : (t4 = (event) => {
|
|
455
445
|
focusedRef.current = !0, onFocus && onFocus(event);
|
|
456
|
-
}, $[
|
|
446
|
+
}, $[15] = onFocus, $[16] = t4);
|
|
457
447
|
let handleFocus = t4, t5, t6;
|
|
458
|
-
$[
|
|
448
|
+
$[17] === focused ? (t5 = $[18], t6 = $[19]) : (t5 = () => {
|
|
459
449
|
focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
|
|
460
|
-
}, t6 = [focused], $[
|
|
461
|
-
let t7
|
|
462
|
-
|
|
450
|
+
}, t6 = [focused], $[17] = focused, $[18] = t5, $[19] = t6), useEffect(t5, t6);
|
|
451
|
+
let t7;
|
|
452
|
+
$[20] === className ? t7 = $[21] : (t7 = clsx(tab, className), $[20] = className, $[21] = t7);
|
|
453
|
+
let t8 = selected ? "true" : "false", t9 = selected ? 0 : -1, t10;
|
|
454
|
+
return $[22] !== fontSize || $[23] !== handleFocus || $[24] !== icon || $[25] !== id || $[26] !== label || $[27] !== onClick || $[28] !== padding || $[29] !== restProps || $[30] !== selected || $[31] !== t7 || $[32] !== t8 || $[33] !== t9 ? (t10 = /* @__PURE__ */ jsx(Button, {
|
|
455
|
+
className: t7,
|
|
463
456
|
"data-ui": "Tab",
|
|
464
457
|
...restProps,
|
|
465
|
-
"aria-selected":
|
|
458
|
+
"aria-selected": t8,
|
|
466
459
|
fontSize,
|
|
467
460
|
icon,
|
|
468
461
|
id,
|
|
@@ -474,43 +467,43 @@ function Tab(props) {
|
|
|
474
467
|
ref,
|
|
475
468
|
role: "tab",
|
|
476
469
|
selected,
|
|
477
|
-
tabIndex:
|
|
470
|
+
tabIndex: t9,
|
|
478
471
|
text: label,
|
|
479
472
|
type: "button"
|
|
480
|
-
}), $[
|
|
473
|
+
}), $[22] = fontSize, $[23] = handleFocus, $[24] = icon, $[25] = id, $[26] = label, $[27] = onClick, $[28] = padding, $[29] = restProps, $[30] = selected, $[31] = t7, $[32] = t8, $[33] = t9, $[34] = t10) : t10 = $[34], t10;
|
|
481
474
|
}
|
|
482
|
-
|
|
483
|
-
displayName: "CustomInline",
|
|
484
|
-
componentId: "sc-m22lpv-0"
|
|
485
|
-
})`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`;
|
|
475
|
+
var tabList = "_11igkzi0";
|
|
486
476
|
/**
|
|
487
477
|
* @public
|
|
488
478
|
*/
|
|
489
479
|
function TabList(props) {
|
|
490
|
-
let $ = c(
|
|
491
|
-
$[0] === props ? (childrenProp = $[1],
|
|
480
|
+
let $ = c(20), childrenProp, className, ref, restProps;
|
|
481
|
+
$[0] === props ? (childrenProp = $[1], className = $[2], ref = $[3], restProps = $[4]) : ({children: childrenProp, className, ref, ...restProps} = props, $[0] = props, $[1] = childrenProp, $[2] = className, $[3] = ref, $[4] = restProps);
|
|
492
482
|
let [focusedIndex, setFocusedIndex] = useState(-1), t0;
|
|
493
|
-
if ($[
|
|
483
|
+
if ($[5] !== childrenProp || $[6] !== focusedIndex) {
|
|
494
484
|
let children = Children.toArray(childrenProp).filter(isValidElement), t1;
|
|
495
|
-
$[
|
|
485
|
+
$[8] === focusedIndex ? t1 = $[9] : (t1 = (child, childIndex) => cloneElement(child, {
|
|
496
486
|
focused: focusedIndex === childIndex,
|
|
497
487
|
key: childIndex,
|
|
498
488
|
onFocus: () => setFocusedIndex(childIndex)
|
|
499
|
-
}), $[
|
|
500
|
-
} else t0 = $[
|
|
489
|
+
}), $[8] = focusedIndex, $[9] = t1), t0 = children.map(t1), $[5] = childrenProp, $[6] = focusedIndex, $[7] = t0;
|
|
490
|
+
} else t0 = $[7];
|
|
501
491
|
let tabs = t0, numTabs = tabs.length, t1;
|
|
502
|
-
$[
|
|
492
|
+
$[10] === numTabs ? t1 = $[11] : (t1 = (event) => {
|
|
503
493
|
event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
|
|
504
|
-
}, $[
|
|
494
|
+
}, $[10] = numTabs, $[11] = t1);
|
|
505
495
|
let handleKeyDown = t1, t2;
|
|
506
|
-
|
|
496
|
+
$[12] === className ? t2 = $[13] : (t2 = clsx(tabList, className), $[12] = className, $[13] = t2);
|
|
497
|
+
let t3;
|
|
498
|
+
return $[14] !== handleKeyDown || $[15] !== ref || $[16] !== restProps || $[17] !== t2 || $[18] !== tabs ? (t3 = /* @__PURE__ */ jsx(Inline, {
|
|
499
|
+
className: t2,
|
|
507
500
|
"data-ui": "TabList",
|
|
508
501
|
...restProps,
|
|
509
502
|
onKeyDown: handleKeyDown,
|
|
510
503
|
ref,
|
|
511
504
|
role: "tablist",
|
|
512
505
|
children: tabs
|
|
513
|
-
}), $[
|
|
506
|
+
}), $[14] = handleKeyDown, $[15] = ref, $[16] = restProps, $[17] = t2, $[18] = tabs, $[19] = t3) : t3 = $[19], t3;
|
|
514
507
|
}
|
|
515
508
|
/**
|
|
516
509
|
* @public
|
|
@@ -719,9 +712,6 @@ function Tree(props) {
|
|
|
719
712
|
children: t17
|
|
720
713
|
}), $[35] = contextValue, $[36] = t17, $[37] = t18) : t18 = $[37], t18;
|
|
721
714
|
}
|
|
722
|
-
function treeItemRootStyle() {
|
|
723
|
-
return css`&[role='none'] > [role='treeitem']{outline:none;cursor:default;border-radius:3px;background-color:var(--card-bg-color);color:var(--treeitem-fg-color);&:focus{position:relative;}}&[role='treeitem']{outline:none;& > div{cursor:default;border-radius:3px;background-color:var(--card-bg-color);color:var(--treeitem-fg-color);}&:focus > div{position:relative;}}`;
|
|
724
|
-
}
|
|
725
715
|
function treeItemRootColorStyle(props) {
|
|
726
716
|
let { color } = getTheme_v2(props.theme), tone = color.selectable.default;
|
|
727
717
|
return css`&[role='none']{& > [role='treeitem']{${_cardColorStyle(color, tone.enabled)}}&[data-selected] > [role='treeitem']{${_cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]) > [role='treeitem']:not(:focus):hover{${_cardColorStyle(color, tone.hovered)}}& > [role='treeitem']:focus{${_cardColorStyle(color, tone.selected)}}}}&[role='treeitem']{& > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.enabled)}}&[data-selected] > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.pressed)}}@media (hover:hover){&:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover{${_cardColorStyle(color, tone.hovered)}}&:focus > [data-ui='TreeItem__box']{${_cardColorStyle(color, tone.selected)}}}}`;
|
|
@@ -753,52 +743,48 @@ function TreeGroup(props) {
|
|
|
753
743
|
children
|
|
754
744
|
}), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.gap, $[8] = t2) : t2 = $[8], t2;
|
|
755
745
|
}
|
|
746
|
+
var treeItem = "_14vatmh0";
|
|
756
747
|
const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
|
|
757
748
|
displayName: "StyledTreeItem",
|
|
758
|
-
componentId: "sc-
|
|
759
|
-
})(
|
|
749
|
+
componentId: "sc-9k6ukt-0"
|
|
750
|
+
})(treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled.a.withConfig({
|
|
760
751
|
displayName: "TreeItemBox",
|
|
761
|
-
componentId: "sc-
|
|
762
|
-
})(treeItemBoxStyle)
|
|
763
|
-
displayName: "ToggleArrowText",
|
|
764
|
-
componentId: "sc-8603jr-2"
|
|
765
|
-
})`& > svg{transition:transform 100ms;}`;
|
|
752
|
+
componentId: "sc-9k6ukt-1"
|
|
753
|
+
})(treeItemBoxStyle);
|
|
766
754
|
/**
|
|
767
755
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
768
756
|
* @beta
|
|
769
757
|
*/
|
|
770
758
|
function TreeItem(props) {
|
|
771
|
-
let $ = c(
|
|
772
|
-
$[0] ===
|
|
773
|
-
let expandedProp = t0 !== void 0 && t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 !== void 0 && t3, gap = t4 === void 0 ? 2 : t4, [rootElement, _setRootElement] = useState(null), t5;
|
|
774
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
|
|
759
|
+
let $ = c(94), { children, expanded: t0, fontSize: t1, href, icon: IconComponent, id: idProp, linkAs, linkProps, muted, onClick, padding: t2, selected: t3, gap: t4, text, weight, ...restProps } = props, expandedProp = t0 !== void 0 && t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 !== void 0 && t3, gap = t4 === void 0 ? 2 : t4, [rootElement, _setRootElement] = useState(null), t5;
|
|
760
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
|
|
775
761
|
startTransition(() => _setRootElement(node));
|
|
776
|
-
}, $[
|
|
762
|
+
}, $[0] = t5) : t5 = $[0];
|
|
777
763
|
let setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), { path, registerItem, setExpanded, setFocusedElement } = tree, _id = useId(), id = idProp || _id, t6, t7;
|
|
778
|
-
if ($[
|
|
764
|
+
if ($[1] !== id || $[2] !== path) {
|
|
779
765
|
let itemPath = path.concat([id || ""]);
|
|
780
|
-
t6 = itemPath, t7 = itemPath.join("/"), $[
|
|
781
|
-
} else t6 = $[
|
|
766
|
+
t6 = itemPath, t7 = itemPath.join("/"), $[1] = id, $[2] = path, $[3] = t6, $[4] = t7;
|
|
767
|
+
} else t6 = $[3], t7 = $[4];
|
|
782
768
|
let t8;
|
|
783
|
-
$[
|
|
769
|
+
$[5] !== t6 || $[6] !== t7 ? (t8 = [t6, t7], $[5] = t6, $[6] = t7, $[7] = t8) : t8 = $[7];
|
|
784
770
|
let [itemPath_0, itemKey] = t8, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t9 = tree.level + 1, t10;
|
|
785
|
-
$[
|
|
771
|
+
$[8] !== itemPath_0 || $[9] !== t9 || $[10] !== tree ? (t10 = {
|
|
786
772
|
...tree,
|
|
787
773
|
level: t9,
|
|
788
774
|
path: itemPath_0
|
|
789
|
-
}, $[
|
|
775
|
+
}, $[8] = itemPath_0, $[9] = t9, $[10] = tree, $[11] = t10) : t10 = $[11];
|
|
790
776
|
let contextValue = t10, t11;
|
|
791
|
-
$[
|
|
777
|
+
$[12] !== expanded || $[13] !== itemKey || $[14] !== onClick || $[15] !== rootElement || $[16] !== setExpanded || $[17] !== setFocusedElement ? (t11 = (event) => {
|
|
792
778
|
onClick && onClick(event);
|
|
793
779
|
let target = event.target;
|
|
794
780
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest("[data-ui=\"TreeItem__box\"]")) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
|
|
795
|
-
}, $[
|
|
781
|
+
}, $[12] = expanded, $[13] = itemKey, $[14] = onClick, $[15] = rootElement, $[16] = setExpanded, $[17] = setFocusedElement, $[18] = t11) : t11 = $[18];
|
|
796
782
|
let handleClick = t11, t12;
|
|
797
|
-
$[
|
|
783
|
+
$[19] !== focused || $[20] !== rootElement ? (t12 = (event_0) => {
|
|
798
784
|
focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
|
|
799
|
-
}, $[
|
|
785
|
+
}, $[19] = focused, $[20] = rootElement, $[21] = t12) : t12 = $[21];
|
|
800
786
|
let handleKeyDown = t12, t13, t14;
|
|
801
|
-
$[
|
|
787
|
+
$[22] !== expanded || $[23] !== itemKey || $[24] !== registerItem || $[25] !== rootElement || $[26] !== selected ? (t13 = () => {
|
|
802
788
|
if (rootElement) return registerItem(rootElement, itemKey, expanded, selected);
|
|
803
789
|
}, t14 = [
|
|
804
790
|
expanded,
|
|
@@ -806,34 +792,34 @@ function TreeItem(props) {
|
|
|
806
792
|
registerItem,
|
|
807
793
|
rootElement,
|
|
808
794
|
selected
|
|
809
|
-
], $[
|
|
795
|
+
], $[22] = expanded, $[23] = itemKey, $[24] = registerItem, $[25] = rootElement, $[26] = selected, $[27] = t13, $[28] = t14) : (t13 = $[27], t14 = $[28]), useEffect(t13, t14);
|
|
810
796
|
let t15 = IconComponent || children ? "visible" : "hidden", t16;
|
|
811
|
-
$[
|
|
797
|
+
$[29] === t15 ? t16 = $[30] : (t16 = {
|
|
812
798
|
visibility: t15,
|
|
813
799
|
pointerEvents: "none"
|
|
814
|
-
}, $[
|
|
800
|
+
}, $[29] = t15, $[30] = t16);
|
|
815
801
|
let t17;
|
|
816
|
-
$[
|
|
802
|
+
$[31] !== IconComponent || $[32] !== fontSize || $[33] !== muted || $[34] !== weight ? (t17 = IconComponent && /* @__PURE__ */ jsx(Text, {
|
|
817
803
|
muted,
|
|
818
804
|
size: fontSize,
|
|
819
805
|
weight,
|
|
820
806
|
children: /* @__PURE__ */ jsx(IconComponent, {})
|
|
821
|
-
}), $[
|
|
807
|
+
}), $[31] = IconComponent, $[32] = fontSize, $[33] = muted, $[34] = weight, $[35] = t17) : t17 = $[35];
|
|
822
808
|
let t18;
|
|
823
|
-
$[
|
|
809
|
+
$[36] !== IconComponent || $[37] !== expanded || $[38] !== fontSize || $[39] !== muted || $[40] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ jsx(Text, {
|
|
824
810
|
muted,
|
|
825
811
|
size: fontSize,
|
|
826
812
|
weight,
|
|
827
813
|
children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: { transform: expanded ? "rotate(90deg)" : void 0 } })
|
|
828
|
-
}), $[
|
|
814
|
+
}), $[36] = IconComponent, $[37] = expanded, $[38] = fontSize, $[39] = muted, $[40] = weight, $[41] = t18) : t18 = $[41];
|
|
829
815
|
let t19;
|
|
830
|
-
$[
|
|
816
|
+
$[42] !== gap || $[43] !== t16 || $[44] !== t17 || $[45] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, {
|
|
831
817
|
marginRight: gap,
|
|
832
818
|
style: t16,
|
|
833
819
|
children: [t17, t18]
|
|
834
|
-
}), $[
|
|
820
|
+
}), $[42] = gap, $[43] = t16, $[44] = t17, $[45] = t18, $[46] = t19) : t19 = $[46];
|
|
835
821
|
let t20;
|
|
836
|
-
$[
|
|
822
|
+
$[47] !== fontSize || $[48] !== muted || $[49] !== text || $[50] !== weight ? (t20 = /* @__PURE__ */ jsx(Box, {
|
|
837
823
|
flex: 1,
|
|
838
824
|
children: /* @__PURE__ */ jsx(Text, {
|
|
839
825
|
muted,
|
|
@@ -842,83 +828,83 @@ function TreeItem(props) {
|
|
|
842
828
|
weight,
|
|
843
829
|
children: text
|
|
844
830
|
})
|
|
845
|
-
}), $[
|
|
831
|
+
}), $[47] = fontSize, $[48] = muted, $[49] = text, $[50] = weight, $[51] = t20) : t20 = $[51];
|
|
846
832
|
let t21;
|
|
847
|
-
$[
|
|
833
|
+
$[52] !== padding || $[53] !== t19 || $[54] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, {
|
|
848
834
|
padding,
|
|
849
835
|
children: [t19, t20]
|
|
850
|
-
}), $[
|
|
836
|
+
}), $[52] = padding, $[53] = t19, $[54] = t20, $[55] = t21) : t21 = $[55];
|
|
851
837
|
let content = t21;
|
|
852
838
|
if (href) {
|
|
853
|
-
let t22 =
|
|
854
|
-
$[
|
|
839
|
+
let t22 = typeof linkAs == "string" ? linkAs : "a", t23;
|
|
840
|
+
$[56] !== content || $[57] !== expanded || $[58] !== href || $[59] !== linkAs || $[60] !== linkProps || $[61] !== t22 || $[62] !== tabIndex || $[63] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, {
|
|
855
841
|
...linkProps,
|
|
856
842
|
$level: tree.level,
|
|
857
843
|
"aria-expanded": expanded,
|
|
858
844
|
as: linkAs,
|
|
859
|
-
"data-as":
|
|
845
|
+
"data-as": t22,
|
|
860
846
|
"data-ui": "TreeItem__box",
|
|
861
847
|
href,
|
|
862
848
|
ref: treeitemRef,
|
|
863
849
|
role: "treeitem",
|
|
864
850
|
tabIndex,
|
|
865
851
|
children: content
|
|
866
|
-
}), $[
|
|
867
|
-
let
|
|
868
|
-
$[
|
|
852
|
+
}), $[56] = content, $[57] = expanded, $[58] = href, $[59] = linkAs, $[60] = linkProps, $[61] = t22, $[62] = tabIndex, $[63] = tree.level, $[64] = t23) : t23 = $[64];
|
|
853
|
+
let t24;
|
|
854
|
+
$[65] !== children || $[66] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, {
|
|
869
855
|
hidden: !expanded,
|
|
870
856
|
children
|
|
871
|
-
}), $[
|
|
872
|
-
let
|
|
873
|
-
$[
|
|
857
|
+
}), $[65] = children, $[66] = expanded, $[67] = t24) : t24 = $[67];
|
|
858
|
+
let t25;
|
|
859
|
+
return $[68] !== contextValue || $[69] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
874
860
|
value: contextValue,
|
|
875
|
-
children:
|
|
876
|
-
}), $[
|
|
877
|
-
|
|
878
|
-
return $[88] !== handleClick || $[89] !== id || $[90] !== itemKey || $[91] !== restProps || $[92] !== t22 || $[93] !== t24 || $[94] !== t26 ? (t27 = /* @__PURE__ */ jsxs(StyledTreeItem, {
|
|
879
|
-
"data-selected": t22,
|
|
861
|
+
children: t24
|
|
862
|
+
}), $[68] = contextValue, $[69] = t24, $[70] = t25) : t25 = $[70], /* @__PURE__ */ jsxs(StyledTreeItem, {
|
|
863
|
+
"data-selected": selected ? "" : void 0,
|
|
880
864
|
"data-tree-id": id,
|
|
881
865
|
"data-tree-key": itemKey,
|
|
882
866
|
"data-ui": "TreeItem",
|
|
883
867
|
...restProps,
|
|
868
|
+
className: clsx(treeItem, restProps.className),
|
|
884
869
|
onClick: handleClick,
|
|
885
870
|
ref: setRootElement,
|
|
886
871
|
role: "none",
|
|
887
|
-
children: [
|
|
888
|
-
})
|
|
872
|
+
children: [t23, t25]
|
|
873
|
+
});
|
|
889
874
|
}
|
|
890
|
-
let t22 = selected ? "" : void 0,
|
|
891
|
-
$[
|
|
875
|
+
let T0 = StyledTreeItem, t22 = selected ? "" : void 0, t24 = clsx(treeItem, restProps.className), t25;
|
|
876
|
+
$[71] !== content || $[72] !== tree.level ? (t25 = /* @__PURE__ */ jsx(TreeItemBox, {
|
|
892
877
|
$level: tree.level,
|
|
893
878
|
as: "div",
|
|
894
879
|
"data-ui": "TreeItem__box",
|
|
895
880
|
children: content
|
|
896
|
-
}), $[
|
|
897
|
-
let
|
|
898
|
-
$[
|
|
881
|
+
}), $[71] = content, $[72] = tree.level, $[73] = t25) : t25 = $[73];
|
|
882
|
+
let t26;
|
|
883
|
+
$[74] !== children || $[75] !== expanded ? (t26 = children && /* @__PURE__ */ jsx(TreeGroup, {
|
|
899
884
|
expanded,
|
|
900
885
|
children
|
|
901
|
-
}), $[
|
|
902
|
-
let
|
|
903
|
-
$[
|
|
886
|
+
}), $[74] = children, $[75] = expanded, $[76] = t26) : t26 = $[76];
|
|
887
|
+
let t27;
|
|
888
|
+
$[77] !== contextValue || $[78] !== t26 ? (t27 = /* @__PURE__ */ jsx(TreeContext.Provider, {
|
|
904
889
|
value: contextValue,
|
|
905
|
-
children:
|
|
906
|
-
}), $[
|
|
907
|
-
let
|
|
908
|
-
return $[
|
|
890
|
+
children: t26
|
|
891
|
+
}), $[77] = contextValue, $[78] = t26, $[79] = t27) : t27 = $[79];
|
|
892
|
+
let t28;
|
|
893
|
+
return $[80] !== T0 || $[81] !== expanded || $[82] !== handleClick || $[83] !== handleKeyDown || $[84] !== id || $[85] !== itemKey || $[86] !== restProps || $[87] !== setRootElement || $[88] !== t22 || $[89] !== t24 || $[90] !== t25 || $[91] !== t27 || $[92] !== tabIndex ? (t28 = /* @__PURE__ */ jsxs(T0, {
|
|
909
894
|
"data-selected": t22,
|
|
910
895
|
"data-ui": "TreeItem",
|
|
911
896
|
"data-tree-id": id,
|
|
912
897
|
"data-tree-key": itemKey,
|
|
913
898
|
...restProps,
|
|
914
899
|
"aria-expanded": expanded,
|
|
900
|
+
className: t24,
|
|
915
901
|
onClick: handleClick,
|
|
916
902
|
onKeyDown: handleKeyDown,
|
|
917
903
|
ref: setRootElement,
|
|
918
904
|
role: "treeitem",
|
|
919
905
|
tabIndex,
|
|
920
|
-
children: [
|
|
921
|
-
}), $[
|
|
906
|
+
children: [t25, t27]
|
|
907
|
+
}), $[80] = T0, $[81] = expanded, $[82] = handleClick, $[83] = handleKeyDown, $[84] = id, $[85] = itemKey, $[86] = restProps, $[87] = setRootElement, $[88] = t22, $[89] = t24, $[90] = t25, $[91] = t27, $[92] = tabIndex, $[93] = t28) : t28 = $[93], t28;
|
|
922
908
|
}
|
|
923
909
|
/**
|
|
924
910
|
* @internal
|
|
@@ -1414,9 +1400,6 @@ const StyledBadge = /* @__PURE__ */ styled(Box).withConfig({
|
|
|
1414
1400
|
children: t6
|
|
1415
1401
|
}), $[15] = ref, $[16] = restProps, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = tone, $[21] = t7) : t7 = $[21], t7;
|
|
1416
1402
|
};
|
|
1417
|
-
function checkboxBaseStyles() {
|
|
1418
|
-
return css`position:relative;display:inline-block;`;
|
|
1419
|
-
}
|
|
1420
1403
|
function inputElementStyles(props) {
|
|
1421
1404
|
let { color, input, radius } = getTheme_v2(props.theme), { focusRing } = input.checkbox;
|
|
1422
1405
|
return css`position:absolute;top:0;left:0;width:100%;height:100%;outline:none;opacity:0;z-index:1;padding:0;margin:0;& + span{position:relative;display:block;height:${rem(input.checkbox.size)};width:${rem(input.checkbox.size)};box-sizing:border-box;box-shadow:${focusRingBorderStyle({
|
|
@@ -1448,12 +1431,10 @@ function inputElementStyles(props) {
|
|
|
1448
1431
|
color: color.input.default.readOnly.border
|
|
1449
1432
|
})};color:${color.input.default.readOnly.fg};}&[data-read-only]&:checked + span{background-color:${color.input.default.readOnly.muted.bg};}&:checked + span > svg:first-child{opacity:1;}&:indeterminate + span > svg:last-child{opacity:1;}`;
|
|
1450
1433
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
componentId: "sc-kbhc49-0"
|
|
1454
|
-
})(checkboxBaseStyles), Input$4 = /* @__PURE__ */ styled.input.withConfig({
|
|
1434
|
+
var checkbox = "ycv36y0";
|
|
1435
|
+
const Input$3 = /* @__PURE__ */ styled.input.withConfig({
|
|
1455
1436
|
displayName: "Input",
|
|
1456
|
-
componentId: "sc-
|
|
1437
|
+
componentId: "sc-ng4gkf-0"
|
|
1457
1438
|
})(inputElementStyles);
|
|
1458
1439
|
/**
|
|
1459
1440
|
* Checkboxes allow the user to select one or more items from a set.
|
|
@@ -1461,7 +1442,7 @@ const StyledCheckbox = /* @__PURE__ */ styled.div.withConfig({
|
|
|
1461
1442
|
* @public
|
|
1462
1443
|
*/
|
|
1463
1444
|
function Checkbox(props) {
|
|
1464
|
-
let $ = c(
|
|
1445
|
+
let $ = c(28), checked, className, customValidity, disabled, forwardedRef, indeterminate, readOnly, restProps, style;
|
|
1465
1446
|
$[0] === props ? (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], forwardedRef = $[5], indeterminate = $[6], readOnly = $[7], restProps = $[8], style = $[9]) : ({checked, className, disabled, indeterminate, customValidity, readOnly, ref: forwardedRef, style, ...restProps} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = forwardedRef, $[6] = indeterminate, $[7] = readOnly, $[8] = restProps, $[9] = style);
|
|
1466
1447
|
let ref = useRef(null), t0;
|
|
1467
1448
|
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[10] = t0) : t0 = $[10], useImperativeHandle(forwardedRef, t0);
|
|
@@ -1469,26 +1450,28 @@ function Checkbox(props) {
|
|
|
1469
1450
|
$[11] === indeterminate ? (t1 = $[12], t2 = $[13]) : (t1 = () => {
|
|
1470
1451
|
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
1471
1452
|
}, t2 = [indeterminate], $[11] = indeterminate, $[12] = t1, $[13] = t2), useEffect(t1, t2), useCustomValidity(ref, customValidity);
|
|
1472
|
-
let t3
|
|
1473
|
-
$[14]
|
|
1474
|
-
|
|
1475
|
-
|
|
1453
|
+
let t3;
|
|
1454
|
+
$[14] === className ? t3 = $[15] : (t3 = clsx(checkbox, className), $[14] = className, $[15] = t3);
|
|
1455
|
+
let t4 = !disabled && readOnly ? "" : void 0, t5 = customValidity ? "" : void 0, t6 = disabled || readOnly, t7;
|
|
1456
|
+
$[16] !== checked || $[17] !== readOnly || $[18] !== restProps || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 ? (t7 = /* @__PURE__ */ jsx(Input$3, {
|
|
1457
|
+
"data-read-only": t4,
|
|
1458
|
+
"data-error": t5,
|
|
1476
1459
|
...restProps,
|
|
1477
1460
|
checked,
|
|
1478
|
-
disabled:
|
|
1461
|
+
disabled: t6,
|
|
1479
1462
|
type: "checkbox",
|
|
1480
1463
|
readOnly,
|
|
1481
1464
|
ref
|
|
1482
|
-
}), $[
|
|
1483
|
-
let t7;
|
|
1484
|
-
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(CheckmarkIcon, {}), /* @__PURE__ */ jsx(RemoveIcon, {})] }), $[21] = t7) : t7 = $[21];
|
|
1465
|
+
}), $[16] = checked, $[17] = readOnly, $[18] = restProps, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7) : t7 = $[22];
|
|
1485
1466
|
let t8;
|
|
1486
|
-
|
|
1487
|
-
|
|
1467
|
+
$[23] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(CheckmarkIcon, {}), /* @__PURE__ */ jsx(RemoveIcon, {})] }), $[23] = t8) : t8 = $[23];
|
|
1468
|
+
let t9;
|
|
1469
|
+
return $[24] !== style || $[25] !== t3 || $[26] !== t7 ? (t9 = /* @__PURE__ */ jsxs("div", {
|
|
1470
|
+
className: t3,
|
|
1488
1471
|
"data-ui": "Checkbox",
|
|
1489
1472
|
style,
|
|
1490
|
-
children: [
|
|
1491
|
-
}), $[
|
|
1473
|
+
children: [t7, t8]
|
|
1474
|
+
}), $[24] = style, $[25] = t3, $[26] = t7, $[27] = t9) : t9 = $[27], t9;
|
|
1492
1475
|
}
|
|
1493
1476
|
/**
|
|
1494
1477
|
* Get responsive CSS for the `heading` font style.
|
|
@@ -1538,9 +1521,6 @@ function HeadingComponent(props) {
|
|
|
1538
1521
|
* @public
|
|
1539
1522
|
*/
|
|
1540
1523
|
const Heading = HeadingComponent;
|
|
1541
|
-
function radioBaseStyle() {
|
|
1542
|
-
return css`position:relative;&:not([hidden]){display:inline-block;}&[data-read-only]{outline:1px solid red;}`;
|
|
1543
|
-
}
|
|
1544
1524
|
function inputElementStyle(props) {
|
|
1545
1525
|
let { color, input } = getTheme_v2(props.theme), dist = (input.radio.size - input.radio.markSize) / 2;
|
|
1546
1526
|
return css`appearance:none;position:absolute;top:0;left:0;opacity:0;height:100%;width:100%;outline:none;z-index:1;padding:0;margin:0;border-radius:${rem(input.radio.size / 2)};border:none;& + span{display:block;position:relative;height:${rem(input.radio.size)};width:${rem(input.radio.size)};border-radius:${rem(input.radio.size / 2)};background:${color.input.default.enabled.bg};box-shadow:${focusRingBorderStyle({
|
|
@@ -1560,12 +1540,10 @@ function inputElementStyle(props) {
|
|
|
1560
1540
|
color: color.input.invalid.enabled.muted.bg
|
|
1561
1541
|
})};&::after{background:${color.input.invalid.enabled.muted.bg};}}&[data-read-only] + span{box-shadow:0 0 0 1px ${color.input.default.readOnly.border};background:${color.input.default.readOnly.bg};&::after{background:${color.input.default.readOnly.border};}}&:not([data-read-only]):disabled + span{box-shadow:0 0 0 1px ${color.input.default.disabled.border};background:${color.input.default.disabled.bg};&::after{background:${color.input.default.disabled.border};}}`;
|
|
1562
1542
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
componentId: "sc-4nk2uw-0"
|
|
1566
|
-
})(radioBaseStyle), Input$3 = /* @__PURE__ */ styled.input.withConfig({
|
|
1543
|
+
var radio = "xgt72i0";
|
|
1544
|
+
const Input$2 = /* @__PURE__ */ styled.input.withConfig({
|
|
1567
1545
|
displayName: "Input",
|
|
1568
|
-
componentId: "sc-
|
|
1546
|
+
componentId: "sc-u4kfaz-0"
|
|
1569
1547
|
})(inputElementStyle);
|
|
1570
1548
|
/**
|
|
1571
1549
|
* The `Radio` component allows the user to select one option from a set.
|
|
@@ -1573,32 +1551,31 @@ const StyledRadio = /* @__PURE__ */ styled.div.withConfig({
|
|
|
1573
1551
|
* @public
|
|
1574
1552
|
*/
|
|
1575
1553
|
function Radio(props) {
|
|
1576
|
-
let $ = c(
|
|
1554
|
+
let $ = c(22), className, customValidity, disabled, forwardedRef, readOnly, restProps, style;
|
|
1577
1555
|
$[0] === props ? (className = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], restProps = $[6], style = $[7]) : ({className, disabled, style, customValidity, readOnly, ref: forwardedRef, ...restProps} = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = restProps, $[7] = style);
|
|
1578
1556
|
let ref = useRef(null), t0;
|
|
1579
1557
|
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
|
|
1580
|
-
let t1
|
|
1581
|
-
$[9]
|
|
1582
|
-
|
|
1583
|
-
|
|
1558
|
+
let t1;
|
|
1559
|
+
$[9] === className ? t1 = $[10] : (t1 = clsx(radio, className), $[9] = className, $[10] = t1);
|
|
1560
|
+
let t2 = !disabled && readOnly ? "" : void 0, t3 = customValidity ? "" : void 0, t4 = disabled || readOnly, t5;
|
|
1561
|
+
$[11] !== readOnly || $[12] !== restProps || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 ? (t5 = /* @__PURE__ */ jsx(Input$2, {
|
|
1562
|
+
"data-read-only": t2,
|
|
1563
|
+
"data-error": t3,
|
|
1584
1564
|
...restProps,
|
|
1585
|
-
disabled:
|
|
1565
|
+
disabled: t4,
|
|
1586
1566
|
readOnly,
|
|
1587
1567
|
ref,
|
|
1588
1568
|
type: "radio"
|
|
1589
|
-
}), $[
|
|
1590
|
-
let t5;
|
|
1591
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsx("span", {}), $[15] = t5) : t5 = $[15];
|
|
1569
|
+
}), $[11] = readOnly, $[12] = restProps, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5) : t5 = $[16];
|
|
1592
1570
|
let t6;
|
|
1593
|
-
|
|
1594
|
-
|
|
1571
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = /* @__PURE__ */ jsx("span", {}), $[17] = t6) : t6 = $[17];
|
|
1572
|
+
let t7;
|
|
1573
|
+
return $[18] !== style || $[19] !== t1 || $[20] !== t5 ? (t7 = /* @__PURE__ */ jsxs("div", {
|
|
1574
|
+
className: t1,
|
|
1595
1575
|
"data-ui": "Radio",
|
|
1596
1576
|
style,
|
|
1597
|
-
children: [
|
|
1598
|
-
}), $[
|
|
1599
|
-
}
|
|
1600
|
-
function rootStyle() {
|
|
1601
|
-
return css`position:relative;width:-moz-available;width:-webkit-fill-available;width:stretch;&:not([hidden]){display:inline-block;}`;
|
|
1577
|
+
children: [t5, t6]
|
|
1578
|
+
}), $[18] = style, $[19] = t1, $[20] = t5, $[21] = t7) : t7 = $[21], t7;
|
|
1602
1579
|
}
|
|
1603
1580
|
function inputBaseStyle(props) {
|
|
1604
1581
|
let { font } = getTheme_v2(props.theme);
|
|
@@ -1650,18 +1627,16 @@ function iconBoxStyle(props) {
|
|
|
1650
1627
|
return css`pointer-events:none;position:absolute;top:0;right:0;--card-fg-color:${color.input.default.enabled.fg};@media (hover:hover){select:not(disabled):not(:read-only):hover + &&{--card-fg-color:${color.input.default.hovered.fg};}}select:disabled + &&{--card-fg-color:${color.input.default.disabled.fg};}select[data-read-only] + &&{--card-fg-color:${color.input.default.readOnly.fg};}`;
|
|
1651
1628
|
}
|
|
1652
1629
|
const selectStyle = {
|
|
1653
|
-
root: rootStyle,
|
|
1654
1630
|
input: inputStyle,
|
|
1655
1631
|
iconBox: iconBoxStyle
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
})(selectStyle.root), Input$2 = /* @__PURE__ */ styled.select.withConfig({
|
|
1632
|
+
};
|
|
1633
|
+
var select = "_14ngdrn0";
|
|
1634
|
+
const Input$1 = /* @__PURE__ */ styled.select.withConfig({
|
|
1660
1635
|
displayName: "Input",
|
|
1661
|
-
componentId: "sc-
|
|
1636
|
+
componentId: "sc-af8su9-0"
|
|
1662
1637
|
})(selectStyle.input), IconBox = /* @__PURE__ */ styled(Box).withConfig({
|
|
1663
1638
|
displayName: "IconBox",
|
|
1664
|
-
componentId: "sc-
|
|
1639
|
+
componentId: "sc-af8su9-1"
|
|
1665
1640
|
})(selectStyle.iconBox);
|
|
1666
1641
|
/**
|
|
1667
1642
|
* The `Select` component provides control of options.
|
|
@@ -1682,7 +1657,7 @@ function Select(props) {
|
|
|
1682
1657
|
let t9;
|
|
1683
1658
|
$[18] === gap ? t9 = $[19] : (t9 = _getArrayProp(gap), $[18] = gap, $[19] = t9);
|
|
1684
1659
|
let t10 = disabled || readOnly, t11;
|
|
1685
|
-
$[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$
|
|
1660
|
+
$[20] !== children || $[21] !== restProps || $[22] !== t10 || $[23] !== t5 || $[24] !== t6 || $[25] !== t7 || $[26] !== t8 || $[27] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$1, {
|
|
1686
1661
|
"data-read-only": t5,
|
|
1687
1662
|
"data-ui": "Select",
|
|
1688
1663
|
...restProps,
|
|
@@ -1707,17 +1682,12 @@ function Select(props) {
|
|
|
1707
1682
|
children: t13
|
|
1708
1683
|
}), $[32] = padding, $[33] = t13, $[34] = t14) : t14 = $[34];
|
|
1709
1684
|
let t15;
|
|
1710
|
-
return $[35] !== t11 || $[36] !== t14 ? (t15 = /* @__PURE__ */ jsxs(
|
|
1685
|
+
return $[35] !== t11 || $[36] !== t14 ? (t15 = /* @__PURE__ */ jsxs("div", {
|
|
1686
|
+
className: select,
|
|
1711
1687
|
"data-ui": "Select",
|
|
1712
1688
|
children: [t11, t14]
|
|
1713
1689
|
}), $[35] = t11, $[36] = t14, $[37] = t15) : t15 = $[37], t15;
|
|
1714
1690
|
}
|
|
1715
|
-
function switchBaseStyles() {
|
|
1716
|
-
return css`position:relative;&:not([hidden]){display:inline-block;}`;
|
|
1717
|
-
}
|
|
1718
|
-
function switchInputStyles() {
|
|
1719
|
-
return css`position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;height:100%;width:100%;outline:none;padding:0;margin:0;z-index:1;`;
|
|
1720
|
-
}
|
|
1721
1691
|
function switchRepresentationStyles(props) {
|
|
1722
1692
|
let { color, input } = getTheme_v2(props.theme);
|
|
1723
1693
|
return css`--switch-bg-color:${color.input.default.enabled.border};--switch-fg-color:${color.input.default.enabled.bg};--switch-box-shadow:none;&:not([hidden]){display:block;}position:relative;width:${rem(input.switch.width)};height:${rem(input.switch.height)};border-radius:${rem(input.switch.height / 2)};pointer-events:none;&:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;box-shadow:var(--switch-box-shadow);border-radius:inherit;}input:focus + &&{--switch-box-shadow:${focusRingStyle({ focusRing: input.switch.focusRing })};}input:focus:not(:focus-visible) + &&{--switch-box-shadow:none;}input:checked + &&{--switch-bg-color:${color.input.default.enabled.fg};--switch-fg-color:${color.input.default.enabled.bg};}@media (hover:hover){input:not(:disabled):hover + &&{--switch-bg-color:${color.input.default.hovered.border};--switch-fg-color:${color.input.default.hovered.bg};}input:not(:disabled):checked:hover + &&{--switch-bg-color:${color.input.default.enabled.fg};--switch-fg-color:${color.input.default.enabled.bg};}}input:not([data-read-only]):disabled + &&{--switch-bg-color:${color.input.default.disabled.border};--switch-fg-color:${color.input.default.disabled.bg};}input[data-read-only]:disabled + &&{--switch-bg-color:${color.input.default.readOnly.border};--switch-fg-color:${color.input.default.readOnly.bg};}input:checked[data-read-only]:disabled + &&{--switch-bg-color:${color.input.default.readOnly.fg};--switch-fg-color:${color.input.default.readOnly.bg};}`;
|
|
@@ -1730,21 +1700,16 @@ function switchThumbStyles(props) {
|
|
|
1730
1700
|
let { $indeterminate } = props, { input } = getTheme_v2(props.theme), trackWidth = input.switch.width, trackHeight = input.switch.height, trackPadding = input.switch.padding, size = trackHeight - input.switch.padding * 2, checkedOffset = trackWidth - trackPadding * 2 - size, indeterminateOffset = trackWidth / 2 - size / 2 - trackPadding, checked = $indeterminate !== !0 && props.$checked === !0;
|
|
1731
1701
|
return css`&:not([hidden]){display:block;}position:absolute;left:${rem(trackPadding)};top:${rem(trackPadding)};height:${rem(size)};width:${rem(size)};border-radius:${rem(size / 2)};transition-property:transform;transition-duration:${input.switch.transitionDurationMs}ms;transition-timing-function:${input.switch.transitionTimingFunction};background:var(--switch-fg-color);transform:translate3d(0,0,0);box-shadow:0px 1px 0px 0px rgba(0,0,0,0.05);${checked && css`transform:translate3d(${checkedOffset}px,0,0);`} ${$indeterminate && css`transform:translate3d(${indeterminateOffset}px,0,0);`}`;
|
|
1732
1702
|
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
componentId: "sc-fsy8ck-0"
|
|
1736
|
-
})(switchBaseStyles), Input$1 = /* @__PURE__ */ styled.input.withConfig({
|
|
1737
|
-
displayName: "Input",
|
|
1738
|
-
componentId: "sc-fsy8ck-1"
|
|
1739
|
-
})(switchInputStyles), Representation = /* @__PURE__ */ styled.span.withConfig({
|
|
1703
|
+
var switchInput = "cn60s71", switchRoot = "cn60s70";
|
|
1704
|
+
const Representation = /* @__PURE__ */ styled.span.withConfig({
|
|
1740
1705
|
displayName: "Representation",
|
|
1741
|
-
componentId: "sc-
|
|
1706
|
+
componentId: "sc-ymdgpc-0"
|
|
1742
1707
|
})(switchRepresentationStyles), Track = /* @__PURE__ */ styled.span.withConfig({
|
|
1743
1708
|
displayName: "Track",
|
|
1744
|
-
componentId: "sc-
|
|
1709
|
+
componentId: "sc-ymdgpc-1"
|
|
1745
1710
|
})(switchTrackStyles), Thumb = /* @__PURE__ */ styled.span.withConfig({
|
|
1746
1711
|
displayName: "Thumb",
|
|
1747
|
-
componentId: "sc-
|
|
1712
|
+
componentId: "sc-ymdgpc-2"
|
|
1748
1713
|
})(switchThumbStyles);
|
|
1749
1714
|
/**
|
|
1750
1715
|
* The `Switch` component allows the user to toggle a setting on and off.
|
|
@@ -1754,7 +1719,7 @@ const StyledSwitch = /* @__PURE__ */ styled.span.withConfig({
|
|
|
1754
1719
|
* @public
|
|
1755
1720
|
*/
|
|
1756
1721
|
function Switch(props) {
|
|
1757
|
-
let $ = c(
|
|
1722
|
+
let $ = c(29), checked, className, disabled, forwardedRef, indeterminate, readOnly, restProps, style;
|
|
1758
1723
|
$[0] === props ? (checked = $[1], className = $[2], disabled = $[3], forwardedRef = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]) : ({checked, className, disabled, indeterminate, readOnly, ref: forwardedRef, style, ...restProps} = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = forwardedRef, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style);
|
|
1759
1724
|
let ref = useRef(null), t0;
|
|
1760
1725
|
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], useImperativeHandle(forwardedRef, t0);
|
|
@@ -1762,46 +1727,43 @@ function Switch(props) {
|
|
|
1762
1727
|
$[10] === indeterminate ? (t1 = $[11], t2 = $[12]) : (t1 = () => {
|
|
1763
1728
|
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
1764
1729
|
}, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2), useEffect(t1, t2);
|
|
1765
|
-
let t3
|
|
1766
|
-
$[13]
|
|
1767
|
-
|
|
1730
|
+
let t3;
|
|
1731
|
+
$[13] === className ? t3 = $[14] : (t3 = clsx(switchRoot, className), $[13] = className, $[14] = t3);
|
|
1732
|
+
let t4 = !disabled && readOnly ? "" : void 0, t5 = indeterminate !== !0 && checked, t6 = disabled || readOnly, t7;
|
|
1733
|
+
$[15] !== restProps || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsx("input", {
|
|
1734
|
+
className: switchInput,
|
|
1735
|
+
"data-read-only": t4,
|
|
1768
1736
|
...restProps,
|
|
1769
|
-
checked:
|
|
1770
|
-
disabled:
|
|
1737
|
+
checked: t5,
|
|
1738
|
+
disabled: t6,
|
|
1771
1739
|
type: "checkbox",
|
|
1772
1740
|
ref
|
|
1773
|
-
}), $[
|
|
1774
|
-
let t7;
|
|
1775
|
-
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Track, {}), $[18] = t7) : t7 = $[18];
|
|
1741
|
+
}), $[15] = restProps, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19];
|
|
1776
1742
|
let t8;
|
|
1777
|
-
$[
|
|
1743
|
+
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t8 = /* @__PURE__ */ jsx(Track, {}), $[20] = t8) : t8 = $[20];
|
|
1744
|
+
let t9;
|
|
1745
|
+
$[21] !== checked || $[22] !== indeterminate ? (t9 = /* @__PURE__ */ jsxs(Representation, {
|
|
1778
1746
|
"aria-hidden": !0,
|
|
1779
1747
|
"data-name": "representation",
|
|
1780
|
-
children: [
|
|
1748
|
+
children: [t8, /* @__PURE__ */ jsx(Thumb, {
|
|
1781
1749
|
$checked: checked,
|
|
1782
1750
|
$indeterminate: indeterminate
|
|
1783
1751
|
})]
|
|
1784
|
-
}), $[
|
|
1785
|
-
let
|
|
1786
|
-
return $[
|
|
1787
|
-
className,
|
|
1752
|
+
}), $[21] = checked, $[22] = indeterminate, $[23] = t9) : t9 = $[23];
|
|
1753
|
+
let t10;
|
|
1754
|
+
return $[24] !== style || $[25] !== t3 || $[26] !== t7 || $[27] !== t9 ? (t10 = /* @__PURE__ */ jsxs("span", {
|
|
1755
|
+
className: t3,
|
|
1788
1756
|
"data-ui": "Switch",
|
|
1789
1757
|
style,
|
|
1790
|
-
children: [
|
|
1791
|
-
}), $[
|
|
1792
|
-
}
|
|
1793
|
-
const
|
|
1794
|
-
displayName: "StyledTextArea",
|
|
1795
|
-
componentId: "sc-9kktem-0"
|
|
1796
|
-
})(textInputRootStyle), InputRoot = styled.span.withConfig({
|
|
1797
|
-
displayName: "InputRoot",
|
|
1798
|
-
componentId: "sc-9kktem-1"
|
|
1799
|
-
})`flex:1;min-width:0;display:block;position:relative;`, Input = /* @__PURE__ */ styled.textarea.withConfig({
|
|
1758
|
+
children: [t7, t9]
|
|
1759
|
+
}), $[24] = style, $[25] = t3, $[26] = t7, $[27] = t9, $[28] = t10) : t10 = $[28], t10;
|
|
1760
|
+
}
|
|
1761
|
+
const Input = /* @__PURE__ */ styled.textarea.withConfig({
|
|
1800
1762
|
displayName: "Input",
|
|
1801
|
-
componentId: "sc-
|
|
1763
|
+
componentId: "sc-w1fqhn-0"
|
|
1802
1764
|
})(responsiveInputPaddingStyle, textInputBaseStyle, textInputFontSizeStyle), Presentation = /* @__PURE__ */ styled.div.withConfig({
|
|
1803
1765
|
displayName: "Presentation",
|
|
1804
|
-
componentId: "sc-
|
|
1766
|
+
componentId: "sc-w1fqhn-1"
|
|
1805
1767
|
})(responsiveRadiusStyle, textInputRepresentationStyle);
|
|
1806
1768
|
/**
|
|
1807
1769
|
* A multiline text input.
|
|
@@ -1848,9 +1810,13 @@ function TextArea(props) {
|
|
|
1848
1810
|
"data-tone": rootTheme.tone
|
|
1849
1811
|
}), $[27] = __unstable_disableFocusRing, $[28] = rootTheme.scheme, $[29] = rootTheme.tone, $[30] = t13, $[31] = t14, $[32] = t15) : t15 = $[32];
|
|
1850
1812
|
let t16;
|
|
1851
|
-
return $[33] !== t12 || $[34] !== t15 ? (t16 = /* @__PURE__ */ jsx(
|
|
1813
|
+
return $[33] !== t12 || $[34] !== t15 ? (t16 = /* @__PURE__ */ jsx("span", {
|
|
1814
|
+
className: textInputRoot,
|
|
1852
1815
|
"data-ui": "TextArea",
|
|
1853
|
-
children: /* @__PURE__ */ jsxs(
|
|
1816
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
1817
|
+
className: inputRoot,
|
|
1818
|
+
children: [t12, t15]
|
|
1819
|
+
})
|
|
1854
1820
|
}), $[33] = t12, $[34] = t15, $[35] = t16) : t16 = $[35], t16;
|
|
1855
1821
|
}
|
|
1856
1822
|
/**
|
|
@@ -1979,33 +1945,27 @@ function SrOnly(props) {
|
|
|
1979
1945
|
children
|
|
1980
1946
|
}), $[0] = Component, $[1] = children, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
|
|
1981
1947
|
}
|
|
1982
|
-
|
|
1983
|
-
displayName: "StyledVirtualList",
|
|
1984
|
-
componentId: "sc-50axpm-0"
|
|
1985
|
-
})`position:relative;`, ItemWrapper = styled.div.withConfig({
|
|
1986
|
-
displayName: "ItemWrapper",
|
|
1987
|
-
componentId: "sc-50axpm-1"
|
|
1988
|
-
})`position:absolute;left:0;right:0;`;
|
|
1948
|
+
var virtualList = "woi5yn0", virtualListItem = "woi5yn1";
|
|
1989
1949
|
/**
|
|
1990
1950
|
* @beta
|
|
1991
1951
|
*/
|
|
1992
1952
|
function VirtualList(props) {
|
|
1993
|
-
let $ = c(
|
|
1994
|
-
$[0] === props ? (
|
|
1953
|
+
let $ = c(49), className, forwardedRef, getItemKey, onChange, renderItem, restProps, t0, t1, t2;
|
|
1954
|
+
$[0] === props ? (className = $[1], forwardedRef = $[2], getItemKey = $[3], onChange = $[4], renderItem = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9]) : ({as: t0, className, gap: t1, getItemKey, items: t2, onChange, ref: forwardedRef, renderItem, ...restProps} = props, $[0] = props, $[1] = className, $[2] = forwardedRef, $[3] = getItemKey, $[4] = onChange, $[5] = renderItem, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2);
|
|
1995
1955
|
let as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1, t3;
|
|
1996
|
-
$[
|
|
1956
|
+
$[10] === t2 ? t3 = $[11] : (t3 = t2 === void 0 ? [] : t2, $[10] = t2, $[11] = t3);
|
|
1997
1957
|
let items = t3, { space } = useTheme_v2(), ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1), t4;
|
|
1998
|
-
$[
|
|
1958
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[12] = t4) : t4 = $[12], useImperativeHandle(forwardedRef, t4);
|
|
1999
1959
|
let t5;
|
|
2000
|
-
$[
|
|
1960
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
|
|
2001
1961
|
if (!wrapperRef.current) return;
|
|
2002
1962
|
let firstElement = wrapperRef.current.firstChild;
|
|
2003
1963
|
firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
|
|
2004
|
-
}, $[
|
|
1964
|
+
}, $[13] = t5) : t5 = $[13];
|
|
2005
1965
|
let t6;
|
|
2006
|
-
$[
|
|
1966
|
+
$[14] === renderItem ? t6 = $[15] : (t6 = [renderItem], $[14] = renderItem, $[15] = t6), useEffect(t5, t6);
|
|
2007
1967
|
let t7, t8;
|
|
2008
|
-
$[
|
|
1968
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
|
|
2009
1969
|
if (!ref.current) return;
|
|
2010
1970
|
let scrollEl = findScrollable(ref.current.parentNode);
|
|
2011
1971
|
if (scrollEl) {
|
|
@@ -2029,9 +1989,9 @@ function VirtualList(props) {
|
|
|
2029
1989
|
return window.addEventListener("scroll", handleScroll_0, { passive: !0 }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
|
|
2030
1990
|
window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
|
|
2031
1991
|
};
|
|
2032
|
-
}, t8 = [], $[
|
|
1992
|
+
}, t8 = [], $[16] = t7, $[17] = t8) : (t7 = $[16], t8 = $[17]), useEffect(t7, t8);
|
|
2033
1993
|
let len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0, t10, t9;
|
|
2034
|
-
$[
|
|
1994
|
+
$[18] !== fromIndex || $[19] !== gap || $[20] !== itemHeight || $[21] !== onChange || $[22] !== scrollHeight || $[23] !== scrollTop || $[24] !== space || $[25] !== toIndex ? (t9 = () => {
|
|
2035
1995
|
onChange && onChange({
|
|
2036
1996
|
fromIndex,
|
|
2037
1997
|
gap: space[gap],
|
|
@@ -2049,9 +2009,9 @@ function VirtualList(props) {
|
|
|
2049
2009
|
scrollTop,
|
|
2050
2010
|
space,
|
|
2051
2011
|
toIndex
|
|
2052
|
-
], $[
|
|
2012
|
+
], $[18] = fromIndex, $[19] = gap, $[20] = itemHeight, $[21] = onChange, $[22] = scrollHeight, $[23] = scrollTop, $[24] = space, $[25] = toIndex, $[26] = t10, $[27] = t9) : (t10 = $[26], t9 = $[27]), useEffect(t9, t10);
|
|
2053
2013
|
let t11;
|
|
2054
|
-
$[
|
|
2014
|
+
$[28] !== fromIndex || $[29] !== gap || $[30] !== getItemKey || $[31] !== itemHeight || $[32] !== items || $[33] !== renderItem || $[34] !== space || $[35] !== toIndex ? (t11 = {
|
|
2055
2015
|
fromIndex,
|
|
2056
2016
|
gap,
|
|
2057
2017
|
itemHeight,
|
|
@@ -2060,23 +2020,25 @@ function VirtualList(props) {
|
|
|
2060
2020
|
getItemKey,
|
|
2061
2021
|
items,
|
|
2062
2022
|
renderItem
|
|
2063
|
-
}, $[
|
|
2064
|
-
let children = useChildren(t11),
|
|
2065
|
-
$[
|
|
2023
|
+
}, $[28] = fromIndex, $[29] = gap, $[30] = getItemKey, $[31] = itemHeight, $[32] = items, $[33] = renderItem, $[34] = space, $[35] = toIndex, $[36] = t11) : t11 = $[36];
|
|
2024
|
+
let children = useChildren(t11), Component = as, t12;
|
|
2025
|
+
$[37] === className ? t12 = $[38] : (t12 = clsx(virtualList, className), $[37] = className, $[38] = t12);
|
|
2026
|
+
let t13;
|
|
2027
|
+
$[39] === height ? t13 = $[40] : (t13 = { height }, $[39] = height, $[40] = t13);
|
|
2066
2028
|
let t14;
|
|
2067
|
-
$[
|
|
2029
|
+
$[41] !== children || $[42] !== t13 ? (t14 = /* @__PURE__ */ jsx("div", {
|
|
2068
2030
|
ref: wrapperRef,
|
|
2069
2031
|
style: t13,
|
|
2070
2032
|
children
|
|
2071
|
-
}), $[
|
|
2033
|
+
}), $[41] = children, $[42] = t13, $[43] = t14) : t14 = $[43];
|
|
2072
2034
|
let t15;
|
|
2073
|
-
return $[
|
|
2074
|
-
|
|
2035
|
+
return $[44] !== Component || $[45] !== restProps || $[46] !== t12 || $[47] !== t14 ? (t15 = /* @__PURE__ */ jsx(Component, {
|
|
2036
|
+
className: t12,
|
|
2075
2037
|
"data-ui": "VirtualList",
|
|
2076
|
-
...restProps,
|
|
2077
2038
|
ref,
|
|
2039
|
+
...restProps,
|
|
2078
2040
|
children: t14
|
|
2079
|
-
}), $[
|
|
2041
|
+
}), $[44] = Component, $[45] = restProps, $[46] = t12, $[47] = t14, $[48] = t15) : t15 = $[48], t15;
|
|
2080
2042
|
}
|
|
2081
2043
|
function useChildren(t0) {
|
|
2082
2044
|
let $ = c(21), { fromIndex, gap, getItemKey, itemHeight, items, renderItem, space, toIndex } = t0;
|
|
@@ -2085,14 +2047,18 @@ function useChildren(t0) {
|
|
|
2085
2047
|
let t1;
|
|
2086
2048
|
$[0] !== items[0] || $[1] !== renderItem ? (t1 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t1) : t1 = $[2];
|
|
2087
2049
|
let t2;
|
|
2088
|
-
return $[3] === t1 ? t2 = $[4] : (t2 = [/* @__PURE__ */ jsx(
|
|
2050
|
+
return $[3] === t1 ? t2 = $[4] : (t2 = [/* @__PURE__ */ jsx("div", {
|
|
2051
|
+
className: virtualListItem,
|
|
2052
|
+
children: t1
|
|
2053
|
+
}, 0)], $[3] = t1, $[4] = t2), t2;
|
|
2089
2054
|
}
|
|
2090
2055
|
let t1;
|
|
2091
2056
|
if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
|
|
2092
2057
|
let t2;
|
|
2093
2058
|
$[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
|
|
2094
2059
|
let itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
2095
|
-
return /* @__PURE__ */ jsx(
|
|
2060
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2061
|
+
className: virtualListItem,
|
|
2096
2062
|
style: { top: itemIndex * (itemHeight + space[gap]) },
|
|
2097
2063
|
children: node
|
|
2098
2064
|
}, key);
|