@sanity/ui 3.0.0-static.11 → 3.0.0-static.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/_chunks-cjs/_visual-editing.js +1293 -1215
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/buildCommand.js +28 -10
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +1284 -1202
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +528 -358
- package/dist/_visual-editing.d.ts +528 -358
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +143 -73
- package/dist/css.d.ts +143 -73
- package/dist/css.js +329 -472
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +330 -473
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +1362 -869
- package/dist/index.d.ts +1362 -869
- package/dist/index.js +383 -308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +387 -312
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-palette.css +105 -1
- package/dist/sanity-palette.min.css +1 -0
- package/dist/sanity-theme.css +4571 -1
- package/dist/sanity-theme.min.css +1 -0
- package/dist/system.css +22053 -21946
- package/dist/system.min.css +1 -0
- package/dist/theme.d.mts +51 -106
- package/dist/theme.d.ts +51 -106
- package/dist/theme.js +9 -9
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +9 -9
- package/dist/theme.mjs.map +1 -1
- package/package.json +10 -5
- package/src/cli/buildCommand.ts +46 -19
- package/src/css/_comp.ts +2 -2
- package/src/css/{compile/compileStyle.ts → _compileStyle.ts} +7 -7
- package/src/css/{system.style.ts → _system.style.ts} +3 -2
- package/src/css/aspects/display/display.ts +1 -0
- package/src/css/aspects/display/types.ts +2 -3
- package/src/css/aspects/flex/types.ts +4 -12
- package/src/css/aspects/flexItem/types.ts +1 -3
- package/src/css/aspects/font/types.ts +1 -3
- package/src/css/aspects/grid/grid.ts +1 -0
- package/src/css/aspects/grid/types.ts +5 -9
- package/src/css/aspects/gridItem/gridItem.ts +1 -1
- package/src/css/aspects/gridItem/types.ts +7 -18
- package/src/css/aspects/height/height.ts +3 -4
- package/src/css/aspects/inset/inset.ts +1 -0
- package/src/css/aspects/margin/margin.ts +1 -0
- package/src/css/aspects/margin/types.ts +1 -0
- package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
- package/src/css/aspects/maxWidth/types.ts +1 -0
- package/src/css/aspects/minWidth/minWidth.ts +1 -0
- package/src/css/aspects/minWidth/types.ts +2 -0
- package/src/css/aspects/overflow/overflow.ts +1 -0
- package/src/css/aspects/padding/padding.ts +1 -0
- package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
- package/src/css/aspects/position/position.ts +1 -0
- package/src/css/aspects/shadow/shadow.ts +1 -0
- package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
- package/src/css/aspects/textOverflow/types.ts +1 -0
- package/src/css/aspects/width/types.ts +2 -0
- package/src/css/aspects/width/width.ts +1 -0
- package/src/css/{compile/compilePalette.ts → compilePalette.ts} +14 -10
- package/src/css/compileSystem.ts +7 -0
- package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
- package/src/css/{compile/compileTheme_v3.ts → compileTheme_v3.ts} +123 -104
- package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
- package/src/css/components/dialog/dialog.ts +7 -0
- package/src/css/components/menu/menu.ts +2 -0
- package/src/css/components/skeleton/skeleton.ts +4 -0
- package/src/css/components/skeleton/types.ts +4 -0
- package/src/css/components/toast/toast.ts +5 -0
- package/src/css/components/tree/tree.ts +1 -0
- package/src/css/composeClassNames.ts +4 -2
- package/src/css/constants.ts +2 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/_arrow/_arrow.ts +3 -0
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +1 -2
- package/src/css/primitives/_selectable/selectable.ts +1 -2
- package/src/css/primitives/avatar/avatar.style.ts +5 -8
- package/src/css/primitives/avatar/avatar.ts +6 -0
- package/src/css/primitives/avatar/types.ts +1 -0
- package/src/css/primitives/box/types.ts +1 -3
- package/src/css/primitives/button/button.ts +4 -21
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +18 -0
- package/src/css/primitives/card/card.style.ts +3 -6
- package/src/css/primitives/card/card.ts +2 -2
- package/src/css/primitives/card/types.ts +2 -2
- package/src/css/primitives/checkbox/checkbox.ts +2 -0
- package/src/css/primitives/container/container.ts +1 -0
- package/src/css/primitives/container/types.ts +1 -0
- package/src/css/primitives/kbd/kbd.ts +1 -0
- package/src/css/primitives/label/types.ts +7 -2
- package/src/css/primitives/popover/popover.ts +2 -0
- package/src/css/primitives/radio/radio.ts +1 -0
- package/src/css/primitives/select/select.ts +2 -0
- package/src/css/primitives/spinner/spinner.ts +2 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/types.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +1 -0
- package/src/css/primitives/textInput/textInput.ts +1 -0
- package/src/css/primitives/tooltip/tooltip.ts +2 -0
- package/src/css/scopeClassName.ts +1 -0
- package/src/css/types.ts +9 -12
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.ts +3 -1
- package/src/css/varNames.ts +131 -141
- package/src/css/vars.ts +1 -6
- package/src/theme/palette/constants.ts +2 -0
- package/src/theme/palette/types.ts +3 -0
- package/src/theme/types.ts +2 -6
- package/src/theme/v0/focusRing.ts +1 -3
- package/src/theme/v0/font.ts +6 -18
- package/src/theme/v0/layer.ts +1 -3
- package/src/theme/v0/shadow.ts +2 -6
- package/src/theme/v2/avatar.ts +1 -3
- package/src/theme/v2/color/_system.ts +1 -3
- package/src/theme/v2/color/avatar.ts +2 -6
- package/src/theme/v2/color/badge.ts +2 -6
- package/src/theme/v2/color/button.ts +3 -9
- package/src/theme/v2/color/color.ts +3 -9
- package/src/theme/v2/color/input.ts +3 -9
- package/src/theme/v2/color/kbd.ts +1 -3
- package/src/theme/v2/color/selectable.ts +2 -6
- package/src/theme/v2/color/state.ts +1 -3
- package/src/theme/v2/color/syntax.ts +1 -3
- package/src/theme/v2/input.ts +1 -3
- package/src/theme/v2/theme.ts +2 -6
- package/src/theme/v3/buildTheme_v3.ts +1 -0
- package/src/theme/v3/color/color.ts +6 -4
- package/src/theme/v3/color/renderColor.ts +4 -1
- package/src/theme/v3/defaultTokens.ts +1 -0
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +3 -0
- package/src/ui/StyleTags.tsx +3 -1
- package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
- package/src/ui/_compat/theme/themeProvider.tsx +2 -6
- package/src/ui/_compat/theme/types.ts +1 -3
- package/src/ui/_compat/theme/useRootTheme.ts +1 -3
- package/src/ui/_compat/theme/useTheme.ts +2 -6
- package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
- package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
- package/src/ui/components/autocomplete/types.ts +3 -8
- package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
- package/src/ui/components/dialog/dialog.tsx +89 -291
- package/src/ui/components/dialog/dialogCard.tsx +183 -0
- package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
- package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
- package/src/ui/components/menu/menu.tsx +27 -33
- package/src/ui/components/menu/menuButton.tsx +10 -14
- package/src/ui/components/menu/menuDivider.tsx +25 -13
- package/src/ui/components/menu/menuGroup.tsx +34 -26
- package/src/ui/components/menu/menuItem.tsx +51 -40
- package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
- package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
- package/src/ui/components/skeleton/index.ts +3 -0
- package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
- package/src/ui/components/skeleton/skeleton.tsx +39 -16
- package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
- package/src/ui/components/tab/tab.tsx +23 -19
- package/src/ui/components/tab/tabList.tsx +34 -33
- package/src/ui/components/tab/tabPanel.tsx +25 -19
- package/src/ui/components/toast/toast.tsx +21 -16
- package/src/ui/components/toast/toastLayer.tsx +28 -10
- package/src/ui/components/toast/toastProvider.tsx +2 -6
- package/src/ui/components/toast/types.ts +2 -6
- package/src/ui/components/toast/useToast.ts +1 -3
- package/src/ui/components/tree/tree.tsx +194 -187
- package/src/ui/components/tree/treeGroup.tsx +25 -5
- package/src/ui/components/tree/treeItem.tsx +35 -23
- package/src/ui/hooks/useClickOutside.ts +2 -6
- package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
- package/src/ui/primitives/_selectable/selectable.tsx +33 -20
- package/src/ui/primitives/avatar/avatar.tsx +28 -31
- package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
- package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
- package/src/ui/primitives/avatar/types.ts +2 -0
- package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
- package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
- package/src/ui/primitives/badge/badge.tsx +33 -32
- package/src/ui/primitives/badge/types.ts +2 -1
- package/src/ui/primitives/box/box.tsx +59 -29
- package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
- package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
- package/src/ui/primitives/button/button.test.tsx +1 -15
- package/src/ui/primitives/button/button.tsx +64 -70
- package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
- package/src/ui/primitives/card/card.tsx +22 -22
- package/src/ui/primitives/card/cardProvider.tsx +2 -0
- package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
- package/src/ui/primitives/code/code.tsx +24 -22
- package/src/ui/primitives/container/container.tsx +26 -15
- package/src/ui/primitives/flex/flex.tsx +21 -19
- package/src/ui/primitives/grid/grid.tsx +21 -16
- package/src/ui/primitives/heading/heading.tsx +42 -19
- package/src/ui/primitives/inline/inline.tsx +26 -23
- package/src/ui/primitives/kbd/kbd.tsx +25 -23
- package/src/ui/primitives/label/label.tsx +41 -26
- package/src/ui/primitives/popover/popover.tsx +281 -277
- package/src/ui/primitives/popover/popoverCard.tsx +119 -118
- package/src/ui/primitives/radio/radio.tsx +30 -14
- package/src/ui/primitives/select/select.tsx +24 -16
- package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
- package/src/ui/primitives/spinner/spinner.tsx +24 -12
- package/src/ui/primitives/stack/stack.tsx +27 -18
- package/src/ui/primitives/switch/switch.tsx +31 -14
- package/src/ui/primitives/text/text.tsx +42 -24
- package/src/ui/primitives/textArea/textArea.tsx +33 -18
- package/src/ui/primitives/textInput/textInput.tsx +28 -40
- package/src/ui/primitives/tooltip/constants.ts +1 -1
- package/src/ui/primitives/tooltip/tooltip.tsx +76 -59
- package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
- package/src/ui/primitives/types.ts +1 -3
- package/src/ui/types/avatar.ts +3 -6
- package/src/ui/types/badge.ts +1 -3
- package/src/ui/types/button.ts +1 -3
- package/src/ui/types/card.ts +1 -3
- package/src/ui/types/dialog.ts +1 -3
- package/src/ui/types/props.ts +20 -10
- package/src/ui/utils/arrow/arrow.tsx +40 -14
- package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
- package/src/ui/utils/boundaryElement/types.ts +1 -3
- package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
- package/src/ui/utils/elementQuery/elementQuery.tsx +36 -14
- package/src/ui/utils/errorBoundary.tsx +2 -0
- package/src/ui/utils/index.ts +0 -1
- package/src/ui/utils/layer/layer.tsx +23 -93
- package/src/ui/utils/layer/layerCard.tsx +92 -0
- package/src/ui/utils/layer/layerProvider.tsx +2 -6
- package/src/ui/utils/layer/useLayer.ts +1 -3
- package/src/ui/utils/portal/portal.ts +2 -6
- package/src/ui/utils/portal/portalProvider.tsx +2 -6
- package/src/ui/utils/portal/types.ts +1 -3
- package/src/ui/utils/portal/usePortal.ts +1 -3
- package/src/ui/utils/srOnly/srOnly.tsx +25 -20
- package/src/ui/utils/virtualList/virtualList.tsx +36 -24
- package/src/css/compile/compileRule.ts +0 -97
- package/src/css/compile/compileRules.test.ts +0 -36
- package/src/css/compile/compileRules.ts +0 -43
- package/src/css/compile/compileSystem.ts +0 -7
- package/src/css/compile/types.ts +0 -6
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/ui/utils/conditionalWrapper/index.ts +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, buildTheme_v3 } from "@sanity/ui/theme";
|
|
2
|
-
import {
|
|
3
|
-
import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox,
|
|
2
|
+
import { isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, isHTMLElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, containsOrEqualsElement, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, createGlobalScopedContext, usePrefersReducedMotion, Portal, Z_OFFSETS, Container, Layer, Grid, LayerProvider, isRecord, Selectable, useCard } from "./_chunks-es/_visual-editing.mjs";
|
|
3
|
+
import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox, DEFAULT_ARROW_ELEMENT, DEFAULT_AVATAR_COUNTER_ELEMENT, DEFAULT_AVATAR_ELEMENT, DEFAULT_AVATAR_STACK_ELEMENT, DEFAULT_BADGE_ELEMENT, DEFAULT_BOX_ELEMENT, DEFAULT_BUTTON_ELEMENT, DEFAULT_CARD_ELEMENT, DEFAULT_CHECKBOX_ELEMENT, DEFAULT_CODE_ELEMENT, DEFAULT_CONTAINER_ELEMENT, DEFAULT_ELEMENT_QUERY_ELEMENT, DEFAULT_FLEX_ELEMENT, DEFAULT_GRID_ELEMENT, DEFAULT_HEADING_ELEMENT, DEFAULT_HOTKEYS_ELEMENT, DEFAULT_INLINE_ELEMENT, DEFAULT_KBD_ELEMENT, DEFAULT_LABEL_ELEMENT, DEFAULT_LAYER_ELEMENT, DEFAULT_MENU_DIVIDER_ELEMENT, DEFAULT_MENU_ELEMENT, DEFAULT_MENU_GROUP_ELEMENT, DEFAULT_MENU_ITEM_ELEMENT, DEFAULT_POPOVER_ELEMENT, DEFAULT_RADIO_ELEMENT, DEFAULT_SELECT_ELEMENT, DEFAULT_SPINNER_ELEMENT, DEFAULT_SR_ONLY_ELEMENT, DEFAULT_STACK_ELEMENT, DEFAULT_SWITCH_ELEMENT, DEFAULT_TAB_ELEMENT, DEFAULT_TAB_LIST_ELEMENT, DEFAULT_TEXT_AREA_ELEMENT, DEFAULT_TEXT_ELEMENT, DEFAULT_TEXT_INPUT_ELEMENT, DEFAULT_TOOLTIP_ELEMENT, DEFAULT_VIRTUAL_LIST_ELEMENT, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _getArrayProp, _isScrollable, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
|
|
4
4
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
6
|
-
import { useState, useRef, useEffect, useImperativeHandle, Component,
|
|
6
|
+
import { useState, useRef, useEffect, useImperativeHandle, Component, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
|
|
7
7
|
import { c } from "react-compiler-runtime";
|
|
8
|
-
import { composeClassNames, breadcrumbs,
|
|
8
|
+
import { composeClassNames, breadcrumbs, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, dialogContainer, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, scopeClassName, card, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
|
|
9
9
|
import { px, rem } from "@sanity/ui/css";
|
|
10
10
|
import { motion, AnimatePresence } from "framer-motion";
|
|
11
11
|
const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1;
|
|
@@ -119,6 +119,7 @@ class ErrorBoundary extends Component {
|
|
|
119
119
|
state = {
|
|
120
120
|
error: null
|
|
121
121
|
};
|
|
122
|
+
static displayName = "ErrorBoundary";
|
|
122
123
|
static getDerivedStateFromError(error) {
|
|
123
124
|
return {
|
|
124
125
|
error
|
|
@@ -164,6 +165,7 @@ function AutocompleteOption(props) {
|
|
|
164
165
|
let t2;
|
|
165
166
|
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
|
|
166
167
|
}
|
|
168
|
+
AutocompleteOption.displayName = "AutocompleteOption";
|
|
167
169
|
function autocompleteReducer(state, msg) {
|
|
168
170
|
return msg.type === "input/change" ? {
|
|
169
171
|
...state,
|
|
@@ -203,8 +205,10 @@ function autocompleteReducer(state, msg) {
|
|
|
203
205
|
value: msg.value
|
|
204
206
|
} : state;
|
|
205
207
|
}
|
|
206
|
-
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1
|
|
208
|
+
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_AUTOCOMPLETE_ELEMENT = "input", DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
|
209
|
+
function Autocomplete(props) {
|
|
207
210
|
const {
|
|
211
|
+
as = DEFAULT_AUTOCOMPLETE_ELEMENT,
|
|
208
212
|
border = !0,
|
|
209
213
|
customValidity,
|
|
210
214
|
disabled,
|
|
@@ -227,13 +231,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
227
231
|
prefix,
|
|
228
232
|
radius = 2,
|
|
229
233
|
readOnly,
|
|
234
|
+
ref: forwardedRef,
|
|
230
235
|
relatedElements,
|
|
231
236
|
renderOption: renderOptionProp,
|
|
232
237
|
renderPopover,
|
|
233
238
|
renderValue = DEFAULT_RENDER_VALUE,
|
|
234
239
|
suffix,
|
|
235
240
|
value: valueProp,
|
|
236
|
-
...
|
|
241
|
+
...rest
|
|
237
242
|
} = props, [state, dispatch] = useReducer(autocompleteReducer, {
|
|
238
243
|
activeValue: valueProp || null,
|
|
239
244
|
focused: !1,
|
|
@@ -376,7 +381,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
376
381
|
};
|
|
377
382
|
}, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
|
|
378
383
|
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
379
|
-
}, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...
|
|
384
|
+
}, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
|
|
380
385
|
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
381
386
|
}, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
|
|
382
387
|
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
@@ -399,10 +404,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
399
404
|
results
|
|
400
405
|
] })
|
|
401
406
|
);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
const
|
|
407
|
+
}
|
|
408
|
+
Autocomplete.displayName = "Autocomplete";
|
|
409
|
+
const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
|
|
410
|
+
function Breadcrumbs(props) {
|
|
405
411
|
const {
|
|
412
|
+
as = DEFAULT_BREADCRUMBS_ELEMENT,
|
|
406
413
|
children,
|
|
407
414
|
className,
|
|
408
415
|
expandButton: expandButtonProps,
|
|
@@ -414,7 +421,7 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props,
|
|
|
414
421
|
separator,
|
|
415
422
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
416
423
|
space: _spaceProp,
|
|
417
|
-
...
|
|
424
|
+
...rest
|
|
418
425
|
} = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
|
|
419
426
|
useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
|
|
420
427
|
const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
|
|
@@ -425,25 +432,23 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props,
|
|
|
425
432
|
}
|
|
426
433
|
return rawItems;
|
|
427
434
|
}, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
|
|
428
|
-
return /* @__PURE__ */ jsx(Flex, { as
|
|
435
|
+
return /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: composeClassNames(className, breadcrumbs()), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
429
436
|
itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
|
|
430
437
|
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
431
438
|
] }, itemIndex)) });
|
|
432
|
-
});
|
|
433
|
-
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
434
|
-
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
435
|
-
version: 0
|
|
436
|
-
});
|
|
437
|
-
function useDialog() {
|
|
438
|
-
return useContext(DialogContext);
|
|
439
439
|
}
|
|
440
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
440
441
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
441
442
|
return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
442
443
|
}
|
|
443
|
-
const
|
|
444
|
-
|
|
444
|
+
const DEFAULT_DIALOG_CARD_ELEMENT = "div";
|
|
445
|
+
function DialogCard(props) {
|
|
446
|
+
const $ = c(51), t0 = props;
|
|
447
|
+
let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
|
|
448
|
+
$[0] !== t0 ? ({
|
|
445
449
|
__unstable_autoFocus: autoFocus,
|
|
446
450
|
__unstable_hideCloseButton: hideCloseButton,
|
|
451
|
+
as: t1,
|
|
447
452
|
children,
|
|
448
453
|
contentRef: forwardedContentRef,
|
|
449
454
|
footer,
|
|
@@ -452,73 +457,74 @@ const DialogCard = forwardRef(function(props, forwardedRef) {
|
|
|
452
457
|
onClickOutside,
|
|
453
458
|
onClose,
|
|
454
459
|
portal: portalProp,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
width: widthProp
|
|
460
|
-
} = props, shadowProp = t0 === void 0 ? 4 : t0, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), width = useArrayProp(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
|
|
460
|
+
ref: forwardedRef,
|
|
461
|
+
...rest
|
|
462
|
+
} = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
|
|
463
|
+
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
|
|
461
464
|
isTopLayer
|
|
462
465
|
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
|
|
463
|
-
let t1;
|
|
464
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], useImperativeHandle(forwardedRef, t1);
|
|
465
466
|
let t2;
|
|
466
|
-
$[
|
|
467
|
-
let t3
|
|
468
|
-
$[
|
|
467
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
|
|
468
|
+
let t3;
|
|
469
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], useImperativeHandle(forwardedContentRef, t3);
|
|
470
|
+
let t4, t5;
|
|
471
|
+
$[16] !== autoFocus ? (t4 = () => {
|
|
469
472
|
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
470
|
-
},
|
|
471
|
-
let
|
|
472
|
-
$[
|
|
473
|
+
}, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), useEffect(t4, t5);
|
|
474
|
+
let t6;
|
|
475
|
+
$[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
|
|
473
476
|
if (!isTopLayer || !onClose)
|
|
474
477
|
return;
|
|
475
478
|
const target = document.activeElement;
|
|
476
479
|
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
477
|
-
}, $[
|
|
478
|
-
let
|
|
479
|
-
$[
|
|
480
|
+
}, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], useGlobalKeyDown(t6);
|
|
481
|
+
let t7;
|
|
482
|
+
$[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
|
|
480
483
|
const target_0 = event_0.target;
|
|
481
484
|
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
482
|
-
}), $[
|
|
483
|
-
let t7;
|
|
484
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[15] = t7) : t7 = $[15], useClickOutsideEvent(t6, t7);
|
|
485
|
+
}), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
|
|
485
486
|
let t8;
|
|
486
|
-
$[
|
|
487
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], useClickOutsideEvent(t7, t8);
|
|
487
488
|
let t9;
|
|
488
|
-
$[
|
|
489
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[30] = t9) : t9 = $[30];
|
|
489
490
|
let t10;
|
|
490
|
-
$[
|
|
491
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[31] = t10) : t10 = $[31];
|
|
491
492
|
let t11;
|
|
492
|
-
$[
|
|
493
|
+
$[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsx(Box, { className: dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
|
|
493
494
|
/* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
|
|
494
495
|
showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
|
|
495
|
-
] }) }), $[
|
|
496
|
+
] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
|
|
496
497
|
let t12;
|
|
497
|
-
$[
|
|
498
|
+
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[38] = t12) : t12 = $[38];
|
|
498
499
|
let t13;
|
|
499
|
-
$[
|
|
500
|
+
$[39] !== children ? (t13 = /* @__PURE__ */ jsx(Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[39] = children, $[40] = t13) : t13 = $[40];
|
|
500
501
|
let t14;
|
|
501
|
-
$[
|
|
502
|
+
$[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
|
|
502
503
|
let t15;
|
|
503
|
-
$[
|
|
504
|
+
$[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
|
|
504
505
|
t11,
|
|
505
506
|
t13,
|
|
506
507
|
t14
|
|
507
|
-
] }), $[
|
|
508
|
+
] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
|
|
508
509
|
let t16;
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
510
|
+
return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsx(Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
|
|
511
|
+
}
|
|
512
|
+
DialogCard.displayName = "DialogCard";
|
|
513
|
+
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
514
|
+
version: 0
|
|
512
515
|
});
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
516
|
+
function useDialog() {
|
|
517
|
+
return useContext(DialogContext);
|
|
518
|
+
}
|
|
519
|
+
const DEFAULT_DIALOG_ELEMENT = "div";
|
|
520
|
+
function Dialog(props) {
|
|
521
|
+
const $ = c(69), context = useDialog(), t0 = props;
|
|
522
|
+
let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
|
|
523
|
+
$[0] !== t0 ? ({
|
|
524
|
+
__unstable_autoFocus: t1,
|
|
525
|
+
__unstable_hideCloseButton: t2,
|
|
526
|
+
animate: t3,
|
|
527
|
+
cardRadius: t4,
|
|
522
528
|
children,
|
|
523
529
|
className,
|
|
524
530
|
contentRef,
|
|
@@ -529,19 +535,19 @@ const Dialog = forwardRef(function(props, ref) {
|
|
|
529
535
|
onClickOutside,
|
|
530
536
|
onClose,
|
|
531
537
|
onFocus,
|
|
532
|
-
padding:
|
|
538
|
+
padding: t5,
|
|
533
539
|
portal: portalProp,
|
|
534
540
|
position: _positionProp,
|
|
535
541
|
scheme,
|
|
536
|
-
shadow:
|
|
537
|
-
width:
|
|
542
|
+
shadow: t6,
|
|
543
|
+
width: t7,
|
|
538
544
|
zOffset: _zOffsetProp,
|
|
539
545
|
tone,
|
|
540
|
-
...
|
|
541
|
-
} =
|
|
542
|
-
const autoFocus =
|
|
543
|
-
let
|
|
544
|
-
$[24] !== onFocus ? (
|
|
546
|
+
...rest
|
|
547
|
+
} = t0, $[0] = t0, $[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] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_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], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
|
|
548
|
+
const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
|
|
549
|
+
let t8;
|
|
550
|
+
$[24] !== onFocus ? (t8 = (event) => {
|
|
545
551
|
onFocus?.(event);
|
|
546
552
|
const target = event.target, cardElement = cardRef.current;
|
|
547
553
|
if (cardElement && target === preDivRef.current) {
|
|
@@ -553,10 +559,10 @@ const Dialog = forwardRef(function(props, ref) {
|
|
|
553
559
|
return;
|
|
554
560
|
}
|
|
555
561
|
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
556
|
-
}, $[24] = onFocus, $[25] =
|
|
557
|
-
const handleFocus =
|
|
558
|
-
let
|
|
559
|
-
$[26] !== boundaryElement || $[27] !== portalElement ? (
|
|
562
|
+
}, $[24] = onFocus, $[25] = t8) : t8 = $[25];
|
|
563
|
+
const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
|
|
564
|
+
let t9;
|
|
565
|
+
$[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
|
|
560
566
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
561
567
|
const activeElement = document.activeElement;
|
|
562
568
|
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
@@ -569,27 +575,31 @@ const Dialog = forwardRef(function(props, ref) {
|
|
|
569
575
|
target_0.focus();
|
|
570
576
|
}
|
|
571
577
|
}, 0);
|
|
572
|
-
}, $[26] = boundaryElement, $[27] = portalElement, $[28] =
|
|
573
|
-
const handleRootClick =
|
|
574
|
-
let t8;
|
|
575
|
-
$[29] !== className ? (t8 = composeClassNames(className, dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
|
|
576
|
-
const t9 = animate ? "" : void 0;
|
|
578
|
+
}, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
|
|
579
|
+
const handleRootClick = t9;
|
|
577
580
|
let t10;
|
|
578
|
-
$[
|
|
579
|
-
|
|
580
|
-
$[32] !== autoFocus || $[33] !== cardRadius || $[34] !== cardShadow || $[35] !== children || $[36] !== contentRef || $[37] !== footer || $[38] !== header || $[39] !== hideCloseButton || $[40] !== id || $[41] !== onClickOutside || $[42] !== onClose || $[43] !== portalProp || $[44] !== scheme || $[45] !== tone || $[46] !== width ? (t11 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[32] = autoFocus, $[33] = cardRadius, $[34] = cardShadow, $[35] = children, $[36] = contentRef, $[37] = footer, $[38] = header, $[39] = hideCloseButton, $[40] = id, $[41] = onClickOutside, $[42] = onClose, $[43] = portalProp, $[44] = scheme, $[45] = tone, $[46] = width, $[47] = t11) : t11 = $[47];
|
|
581
|
+
$[29] !== className ? (t10 = composeClassNames(className, dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
|
|
582
|
+
const t11 = animate ? "" : void 0;
|
|
581
583
|
let t12;
|
|
582
|
-
$[
|
|
584
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
|
|
583
585
|
let t13;
|
|
584
|
-
$[
|
|
585
|
-
t10,
|
|
586
|
-
t11,
|
|
587
|
-
t12
|
|
588
|
-
] }), $[49] = handleFocus, $[50] = handleRootClick, $[51] = id, $[52] = labelId, $[53] = onActivate, $[54] = padding, $[55] = position, $[56] = ref, $[57] = restProps, $[58] = t11, $[59] = t8, $[60] = t9, $[61] = zOffset, $[62] = t13) : t13 = $[62];
|
|
586
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
|
|
589
587
|
let t14;
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
588
|
+
$[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
|
|
589
|
+
let t15;
|
|
590
|
+
$[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsx(Container, { align: "center", className: t13, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
|
|
591
|
+
let t16;
|
|
592
|
+
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
|
|
593
|
+
let t17;
|
|
594
|
+
$[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
|
|
595
|
+
t12,
|
|
596
|
+
t15,
|
|
597
|
+
t16
|
|
598
|
+
] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
|
|
599
|
+
let t18;
|
|
600
|
+
return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
|
|
601
|
+
}
|
|
602
|
+
Dialog.displayName = "Dialog";
|
|
593
603
|
function DialogProvider(props) {
|
|
594
604
|
const $ = c(6), {
|
|
595
605
|
children,
|
|
@@ -607,7 +617,7 @@ function DialogProvider(props) {
|
|
|
607
617
|
return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
|
|
608
618
|
}
|
|
609
619
|
DialogProvider.displayName = "DialogProvider";
|
|
610
|
-
|
|
620
|
+
function MenuButton(props) {
|
|
611
621
|
const $ = c(63), {
|
|
612
622
|
__unstable_disableRestoreFocusOnClose: t0,
|
|
613
623
|
boundaryElement: deprecated_boundaryElement,
|
|
@@ -621,7 +631,8 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
621
631
|
portal: t1,
|
|
622
632
|
popover,
|
|
623
633
|
popoverRadius: deprecated_popoverRadius,
|
|
624
|
-
preventOverflow: deprecated_preventOverflow
|
|
634
|
+
preventOverflow: deprecated_preventOverflow,
|
|
635
|
+
ref: forwardedRef
|
|
625
636
|
} = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
|
|
626
637
|
let t2;
|
|
627
638
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
@@ -748,24 +759,25 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
|
748
759
|
$[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
|
|
749
760
|
let t25;
|
|
750
761
|
return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
|
|
751
|
-
}
|
|
752
|
-
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
762
|
+
}
|
|
753
763
|
function _temp$3(v) {
|
|
754
764
|
return !v;
|
|
755
765
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
$
|
|
760
|
-
|
|
766
|
+
MenuButton.displayName = "MenuButton";
|
|
767
|
+
const DEFAULT_SKELETON_ELEMENT = "div";
|
|
768
|
+
function Skeleton(props) {
|
|
769
|
+
const $ = c(17), t0 = props;
|
|
770
|
+
let className, delay, radius, rest, t1;
|
|
771
|
+
$[0] !== t0 ? ({
|
|
772
|
+
animated: t1,
|
|
761
773
|
className,
|
|
762
774
|
delay,
|
|
763
775
|
radius,
|
|
764
|
-
...
|
|
765
|
-
} =
|
|
766
|
-
const animated =
|
|
767
|
-
let
|
|
768
|
-
$[6] !== delay ? (
|
|
776
|
+
...rest
|
|
777
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
|
|
778
|
+
const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
|
|
779
|
+
let t2, t3;
|
|
780
|
+
$[6] !== delay ? (t2 = () => {
|
|
769
781
|
if (!delay)
|
|
770
782
|
return setVisible(!0);
|
|
771
783
|
const timeout = setTimeout(() => {
|
|
@@ -774,97 +786,102 @@ const Skeleton = forwardRef(function(props, ref) {
|
|
|
774
786
|
return () => {
|
|
775
787
|
clearTimeout(timeout);
|
|
776
788
|
};
|
|
777
|
-
},
|
|
778
|
-
let
|
|
779
|
-
$[9] !== className || $[10] !== radius ? (
|
|
789
|
+
}, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), useEffect(t2, t3);
|
|
790
|
+
let t4;
|
|
791
|
+
$[9] !== className || $[10] !== radius ? (t4 = composeClassNames(className, skeleton({
|
|
780
792
|
radius
|
|
781
|
-
})), $[9] = className, $[10] = radius, $[11] =
|
|
782
|
-
const
|
|
783
|
-
let
|
|
784
|
-
return $[12] !==
|
|
785
|
-
}
|
|
786
|
-
Skeleton.displayName = "
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
793
|
+
})), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
|
|
794
|
+
const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
|
|
795
|
+
let t7;
|
|
796
|
+
return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...rest, className: t4, "data-animated": t5, "data-visible": t6 }), $[12] = rest, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7) : t7 = $[16], t7;
|
|
797
|
+
}
|
|
798
|
+
Skeleton.displayName = "Skeleton";
|
|
799
|
+
const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
800
|
+
function CodeSkeleton(props) {
|
|
801
|
+
const $ = c(10), t0 = props;
|
|
802
|
+
let className, rest, t1;
|
|
803
|
+
$[0] !== t0 ? ({
|
|
791
804
|
className,
|
|
792
|
-
size:
|
|
793
|
-
...
|
|
794
|
-
} =
|
|
795
|
-
const size =
|
|
796
|
-
let t1;
|
|
797
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, textSkeleton({
|
|
798
|
-
size
|
|
799
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
805
|
+
size: t1,
|
|
806
|
+
...rest
|
|
807
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
808
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
800
809
|
let t2;
|
|
801
|
-
|
|
802
|
-
});
|
|
803
|
-
TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
|
|
804
|
-
const LabelSkeleton = forwardRef(function(props, ref) {
|
|
805
|
-
const $ = c(11);
|
|
806
|
-
let className, restProps, t0;
|
|
807
|
-
$[0] !== props ? ({
|
|
808
|
-
className,
|
|
809
|
-
size: t0,
|
|
810
|
-
...restProps
|
|
811
|
-
} = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
|
|
812
|
-
const size = t0 === void 0 ? 2 : t0;
|
|
813
|
-
let t1;
|
|
814
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, labelSkeleton({
|
|
810
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, codeSkeleton({
|
|
815
811
|
size
|
|
816
|
-
})), $[4] = className, $[5] = size, $[6] =
|
|
817
|
-
let
|
|
818
|
-
return $[7] !==
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
812
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
813
|
+
let t3;
|
|
814
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
815
|
+
}
|
|
816
|
+
CodeSkeleton.displayName = "CodeSkeleton";
|
|
817
|
+
const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
|
|
818
|
+
function HeadingSkeleton(props) {
|
|
819
|
+
const $ = c(10), t0 = props;
|
|
820
|
+
let className, rest, t1;
|
|
821
|
+
$[0] !== t0 ? ({
|
|
825
822
|
className,
|
|
826
|
-
size:
|
|
827
|
-
...
|
|
828
|
-
} =
|
|
829
|
-
const size =
|
|
830
|
-
let t1;
|
|
831
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, headingSkeleton({
|
|
832
|
-
size
|
|
833
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
823
|
+
size: t1,
|
|
824
|
+
...rest
|
|
825
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
826
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
834
827
|
let t2;
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
828
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, headingSkeleton({
|
|
829
|
+
size
|
|
830
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
831
|
+
let t3;
|
|
832
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
833
|
+
}
|
|
834
|
+
HeadingSkeleton.displayName = "HeadingSkeleton";
|
|
835
|
+
const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
|
|
836
|
+
function LabelSkeleton(props) {
|
|
837
|
+
const $ = c(10), t0 = props;
|
|
838
|
+
let className, rest, t1;
|
|
839
|
+
$[0] !== t0 ? ({
|
|
842
840
|
className,
|
|
843
|
-
size:
|
|
844
|
-
...
|
|
845
|
-
} =
|
|
846
|
-
const size =
|
|
847
|
-
let
|
|
848
|
-
$[4] !== className || $[5] !== size ? (
|
|
841
|
+
size: t1,
|
|
842
|
+
...rest
|
|
843
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
844
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
845
|
+
let t2;
|
|
846
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, labelSkeleton({
|
|
849
847
|
size
|
|
850
|
-
})), $[4] = className, $[5] = size, $[6] =
|
|
848
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
849
|
+
let t3;
|
|
850
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
851
|
+
}
|
|
852
|
+
LabelSkeleton.displayName = "LabelSkeleton";
|
|
853
|
+
const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
|
|
854
|
+
function TextSkeleton(props) {
|
|
855
|
+
const $ = c(10), t0 = props;
|
|
856
|
+
let className, rest, t1;
|
|
857
|
+
$[0] !== t0 ? ({
|
|
858
|
+
className,
|
|
859
|
+
size: t1,
|
|
860
|
+
...rest
|
|
861
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
862
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
851
863
|
let t2;
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
const
|
|
864
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, textSkeleton({
|
|
865
|
+
size
|
|
866
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
867
|
+
let t3;
|
|
868
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
869
|
+
}
|
|
870
|
+
TextSkeleton.displayName = "TextSkeleton";
|
|
871
|
+
const DEFAULT_TAB_PANEL_ELEMENT = "div";
|
|
872
|
+
function TabPanel(props) {
|
|
873
|
+
const $ = c(8), t0 = props;
|
|
874
|
+
let rest, t1;
|
|
875
|
+
$[0] !== t0 ? ({
|
|
876
|
+
as: t1,
|
|
877
|
+
...rest
|
|
878
|
+
} = t0, $[0] = t0, $[1] = rest, $[2] = t1) : (rest = $[1], t1 = $[2]);
|
|
879
|
+
const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = props.tabIndex === void 0 ? 0 : props.tabIndex;
|
|
880
|
+
let t3;
|
|
881
|
+
return $[3] !== as || $[4] !== props.children || $[5] !== rest || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children: props.children }), $[3] = as, $[4] = props.children, $[5] = rest, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
|
|
882
|
+
}
|
|
883
|
+
TabPanel.displayName = "TabPanel";
|
|
884
|
+
const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
|
|
868
885
|
error: "alert",
|
|
869
886
|
warning: "alert",
|
|
870
887
|
success: "alert",
|
|
@@ -881,61 +898,62 @@ const ROLES = {
|
|
|
881
898
|
info: "neutral"
|
|
882
899
|
}, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
|
|
883
900
|
function Toast(props) {
|
|
884
|
-
const $ = c(
|
|
885
|
-
let closable, description, duration, onClose,
|
|
886
|
-
$[0] !==
|
|
901
|
+
const $ = c(53), t0 = props;
|
|
902
|
+
let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
|
|
903
|
+
$[0] !== t0 ? ({
|
|
904
|
+
as: t1,
|
|
887
905
|
closable,
|
|
888
906
|
description,
|
|
889
907
|
duration,
|
|
890
908
|
onClose,
|
|
891
|
-
radius:
|
|
909
|
+
radius: t2,
|
|
892
910
|
title,
|
|
893
911
|
status,
|
|
894
912
|
updatedAt,
|
|
895
|
-
...
|
|
896
|
-
} =
|
|
897
|
-
const radius =
|
|
898
|
-
let
|
|
899
|
-
$[
|
|
913
|
+
...rest
|
|
914
|
+
} = t0, $[0] = t0, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = rest, $[6] = status, $[7] = t1, $[8] = t2, $[9] = title, $[10] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], rest = $[5], status = $[6], t1 = $[7], t2 = $[8], title = $[9], updatedAt = $[10]);
|
|
915
|
+
const as = t1 === void 0 ? DEFAULT_TOAST_ELEMENT : t1, radius = t2 === void 0 ? 3 : t2, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
|
|
916
|
+
let t3;
|
|
917
|
+
$[11] !== visualDuration ? (t3 = visualDuration ? {
|
|
900
918
|
type: "spring",
|
|
901
919
|
visualDuration,
|
|
902
920
|
bounce: 0.25
|
|
903
921
|
} : {
|
|
904
922
|
duration: 0
|
|
905
|
-
}, $[
|
|
906
|
-
const transition =
|
|
907
|
-
let t2;
|
|
908
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
|
|
909
|
-
const initial = t2;
|
|
910
|
-
let t3;
|
|
911
|
-
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
|
|
912
|
-
const animate = t3;
|
|
923
|
+
}, $[11] = visualDuration, $[12] = t3) : t3 = $[12];
|
|
924
|
+
const transition = t3, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
|
|
913
925
|
let t4;
|
|
914
|
-
$[
|
|
915
|
-
const
|
|
926
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[13] = t4) : t4 = $[13];
|
|
927
|
+
const initial = t4;
|
|
916
928
|
let t5;
|
|
917
|
-
$[
|
|
918
|
-
const
|
|
929
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[14] = t5) : t5 = $[14];
|
|
930
|
+
const animate = t5;
|
|
931
|
+
let t6;
|
|
932
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
|
|
933
|
+
const exit = t6;
|
|
919
934
|
let t7;
|
|
920
|
-
$[16]
|
|
921
|
-
|
|
922
|
-
$[18] !== description || $[19] !== transition ? (t8 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t8) : t8 = $[20];
|
|
935
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = toast(), $[16] = t7) : t7 = $[16];
|
|
936
|
+
const t8 = hasDuration ? "" : void 0;
|
|
923
937
|
let t9;
|
|
924
|
-
$[
|
|
925
|
-
t7,
|
|
926
|
-
t8
|
|
927
|
-
] }) }), $[21] = t7, $[22] = t8, $[23] = t9) : t9 = $[23];
|
|
938
|
+
$[17] !== title ? (t9 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
|
|
928
939
|
let t10;
|
|
929
|
-
$[
|
|
930
|
-
verticalAlign: "top"
|
|
931
|
-
} }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t10) : t10 = $[27];
|
|
940
|
+
$[19] !== description || $[20] !== transition ? (t10 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t10) : t10 = $[21];
|
|
932
941
|
let t11;
|
|
933
|
-
$[
|
|
942
|
+
$[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
|
|
934
943
|
t9,
|
|
935
944
|
t10
|
|
936
|
-
] }), $[
|
|
945
|
+
] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
|
|
937
946
|
let t12;
|
|
938
|
-
$[
|
|
947
|
+
$[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t12 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
|
|
948
|
+
verticalAlign: "top"
|
|
949
|
+
} }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
|
|
950
|
+
let t13;
|
|
951
|
+
$[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
|
|
952
|
+
t11,
|
|
953
|
+
t12
|
|
954
|
+
] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
|
|
955
|
+
let t14;
|
|
956
|
+
$[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t14 = hasDuration && /* @__PURE__ */ jsxs(MotionBox, { className: toastLoadingBar(), variants: content, transition, children: [
|
|
939
957
|
/* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
|
|
940
958
|
/* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
|
|
941
959
|
scaleX: 0
|
|
@@ -946,12 +964,12 @@ function Toast(props) {
|
|
|
946
964
|
duration: duration / 1e3,
|
|
947
965
|
ease: "linear"
|
|
948
966
|
}, onAnimationComplete: onClose }, `progress-${updatedAt}`)
|
|
949
|
-
] }), $[
|
|
950
|
-
let
|
|
951
|
-
return $[
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
] }), $[
|
|
967
|
+
] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
|
|
968
|
+
let t15;
|
|
969
|
+
return $[42] !== as || $[43] !== cardTone || $[44] !== radius || $[45] !== rest || $[46] !== role || $[47] !== t13 || $[48] !== t14 || $[49] !== t8 || $[50] !== transition || $[51] !== visualDuration ? (t15 = /* @__PURE__ */ jsxs(MotionCard, { as, className: t7, "data-ui": "Toast", role, ...rest, "data-has-duration": t8, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: [
|
|
970
|
+
t13,
|
|
971
|
+
t14
|
|
972
|
+
] }), $[42] = as, $[43] = cardTone, $[44] = radius, $[45] = rest, $[46] = role, $[47] = t13, $[48] = t14, $[49] = t8, $[50] = transition, $[51] = visualDuration, $[52] = t15) : t15 = $[52], t15;
|
|
955
973
|
}
|
|
956
974
|
Toast.displayName = "Toast";
|
|
957
975
|
const container = {
|
|
@@ -1002,25 +1020,26 @@ function _temp$2() {
|
|
|
1002
1020
|
return !0;
|
|
1003
1021
|
}
|
|
1004
1022
|
const subscribe = () => () => {
|
|
1005
|
-
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
|
|
1023
|
+
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
|
|
1006
1024
|
function ToastLayer(props) {
|
|
1007
|
-
const $ = c(
|
|
1025
|
+
const $ = c(11), {
|
|
1026
|
+
as: t0,
|
|
1008
1027
|
children,
|
|
1009
|
-
padding:
|
|
1028
|
+
padding: t1,
|
|
1010
1029
|
paddingX,
|
|
1011
1030
|
paddingY,
|
|
1012
|
-
gap:
|
|
1013
|
-
} = props,
|
|
1031
|
+
gap: t2
|
|
1032
|
+
} = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
|
|
1014
1033
|
zIndex
|
|
1015
1034
|
} = useLayer();
|
|
1016
|
-
let t2;
|
|
1017
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = toastLayer(), $[0] = t2) : t2 = $[0];
|
|
1018
1035
|
let t3;
|
|
1019
|
-
$[
|
|
1020
|
-
zIndex
|
|
1021
|
-
}, $[1] = zIndex, $[2] = t3) : t3 = $[2];
|
|
1036
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
|
|
1022
1037
|
let t4;
|
|
1023
|
-
|
|
1038
|
+
$[1] !== zIndex ? (t4 = {
|
|
1039
|
+
zIndex
|
|
1040
|
+
}, $[1] = zIndex, $[2] = t4) : t4 = $[2];
|
|
1041
|
+
let t5;
|
|
1042
|
+
return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsx(Grid, { as, className: t3, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t4, children }), $[3] = as, $[4] = children, $[5] = gap, $[6] = padding, $[7] = paddingX, $[8] = paddingY, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
|
|
1024
1043
|
}
|
|
1025
1044
|
ToastLayer.displayName = "ToastLayer";
|
|
1026
1045
|
let toastId = 0;
|
|
@@ -1143,38 +1162,40 @@ function _focusItemElement(el) {
|
|
|
1143
1162
|
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
1144
1163
|
}
|
|
1145
1164
|
}
|
|
1146
|
-
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1165
|
+
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
|
|
1166
|
+
function Tree(props) {
|
|
1167
|
+
const $ = c(39), t0 = props;
|
|
1168
|
+
let children, forwardedRef, gap, onFocus, rest, t1;
|
|
1169
|
+
$[0] !== t0 ? ({
|
|
1150
1170
|
children,
|
|
1151
1171
|
gap,
|
|
1152
|
-
space:
|
|
1172
|
+
space: t1,
|
|
1153
1173
|
onFocus,
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
|
|
1162
|
-
const [itemElements, setItemElements] = useState(t3);
|
|
1174
|
+
ref: forwardedRef,
|
|
1175
|
+
...rest
|
|
1176
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = gap, $[4] = onFocus, $[5] = rest, $[6] = t1) : (children = $[1], forwardedRef = $[2], gap = $[3], onFocus = $[4], rest = $[5], t1 = $[6]);
|
|
1177
|
+
const space = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
|
|
1178
|
+
let t2, t3;
|
|
1179
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
|
|
1180
|
+
const path = t2;
|
|
1163
1181
|
let t4;
|
|
1164
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 =
|
|
1165
|
-
const [
|
|
1182
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
|
|
1183
|
+
const [itemElements, setItemElements] = useState(t4);
|
|
1166
1184
|
let t5;
|
|
1167
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 =
|
|
1168
|
-
|
|
1169
|
-
|
|
1185
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
|
|
1186
|
+
const [state, setState] = useState(t5), stateRef = useRef(state);
|
|
1187
|
+
let t6;
|
|
1188
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], useImperativeHandle(forwardedRef, t6);
|
|
1189
|
+
let t7, t8;
|
|
1190
|
+
$[11] !== focusedElement ? (t7 = () => {
|
|
1170
1191
|
focusedElementRef.current = focusedElement;
|
|
1171
|
-
},
|
|
1172
|
-
let
|
|
1173
|
-
$[
|
|
1192
|
+
}, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
|
|
1193
|
+
let t10, t9;
|
|
1194
|
+
$[14] !== state ? (t9 = () => {
|
|
1174
1195
|
stateRef.current = state;
|
|
1175
|
-
},
|
|
1176
|
-
let
|
|
1177
|
-
$[
|
|
1196
|
+
}, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), useEffect(t9, t10);
|
|
1197
|
+
let t11;
|
|
1198
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
1178
1199
|
...s,
|
|
1179
1200
|
[path_0]: {
|
|
1180
1201
|
element,
|
|
@@ -1187,10 +1208,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
1187
1208
|
};
|
|
1188
1209
|
return delete newState[path_0], newState;
|
|
1189
1210
|
});
|
|
1190
|
-
}), $[
|
|
1191
|
-
const registerItem =
|
|
1192
|
-
let
|
|
1193
|
-
$[
|
|
1211
|
+
}), $[17] = t11) : t11 = $[17];
|
|
1212
|
+
const registerItem = t11;
|
|
1213
|
+
let t12;
|
|
1214
|
+
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
|
|
1194
1215
|
setState((s_1) => {
|
|
1195
1216
|
const itemState = s_1[path_1];
|
|
1196
1217
|
return itemState ? {
|
|
@@ -1201,14 +1222,14 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
1201
1222
|
}
|
|
1202
1223
|
} : s_1;
|
|
1203
1224
|
});
|
|
1204
|
-
}, $[
|
|
1205
|
-
const setExpanded =
|
|
1206
|
-
let
|
|
1207
|
-
const
|
|
1208
|
-
let
|
|
1209
|
-
$[
|
|
1225
|
+
}, $[18] = t12) : t12 = $[18];
|
|
1226
|
+
const setExpanded = t12;
|
|
1227
|
+
let t13;
|
|
1228
|
+
const t14 = focusedElement || itemElements[0] || null;
|
|
1229
|
+
let t15;
|
|
1230
|
+
$[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
|
|
1210
1231
|
version: 0,
|
|
1211
|
-
focusedElement:
|
|
1232
|
+
focusedElement: t14,
|
|
1212
1233
|
level: 0,
|
|
1213
1234
|
path,
|
|
1214
1235
|
registerItem,
|
|
@@ -1216,10 +1237,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
1216
1237
|
setFocusedElement,
|
|
1217
1238
|
space,
|
|
1218
1239
|
state
|
|
1219
|
-
}, $[
|
|
1220
|
-
const contextValue =
|
|
1221
|
-
let
|
|
1222
|
-
$[
|
|
1240
|
+
}, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
|
|
1241
|
+
const contextValue = t13;
|
|
1242
|
+
let t16;
|
|
1243
|
+
$[23] !== itemElements ? (t16 = (event) => {
|
|
1223
1244
|
if (focusedElementRef.current) {
|
|
1224
1245
|
if (event.key === "ArrowDown") {
|
|
1225
1246
|
event.preventDefault();
|
|
@@ -1278,29 +1299,29 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
|
|
|
1278
1299
|
return;
|
|
1279
1300
|
}
|
|
1280
1301
|
}
|
|
1281
|
-
}, $[
|
|
1282
|
-
const handleKeyDown =
|
|
1283
|
-
let t16;
|
|
1284
|
-
$[24] !== onFocus ? (t16 = (event_0) => {
|
|
1285
|
-
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1286
|
-
}, $[24] = onFocus, $[25] = t16) : t16 = $[25];
|
|
1287
|
-
const handleFocus = t16;
|
|
1302
|
+
}, $[23] = itemElements, $[24] = t16) : t16 = $[24];
|
|
1303
|
+
const handleKeyDown = t16;
|
|
1288
1304
|
let t17;
|
|
1289
|
-
$[
|
|
1305
|
+
$[25] !== onFocus ? (t17 = (event_0) => {
|
|
1306
|
+
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1307
|
+
}, $[25] = onFocus, $[26] = t17) : t17 = $[26];
|
|
1308
|
+
const handleFocus = t17;
|
|
1309
|
+
let t18;
|
|
1310
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
|
|
1290
1311
|
if (!ref.current)
|
|
1291
1312
|
return;
|
|
1292
1313
|
const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
|
|
1293
1314
|
setItemElements(_itemElements);
|
|
1294
|
-
}, $[
|
|
1295
|
-
let
|
|
1296
|
-
$[
|
|
1297
|
-
const
|
|
1298
|
-
let t20;
|
|
1299
|
-
$[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== t19 ? (t20 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, gap: t19, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = t19, $[34] = t20) : t20 = $[34];
|
|
1315
|
+
}, $[27] = t18) : t18 = $[27];
|
|
1316
|
+
let t19;
|
|
1317
|
+
$[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], useEffect(t18, t19);
|
|
1318
|
+
const t20 = gap ?? space;
|
|
1300
1319
|
let t21;
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1320
|
+
$[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap: t20, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[30] = children, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20, $[35] = t21) : t21 = $[35];
|
|
1321
|
+
let t22;
|
|
1322
|
+
return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
|
|
1323
|
+
}
|
|
1324
|
+
Tree.displayName = "Tree";
|
|
1304
1325
|
function useTree() {
|
|
1305
1326
|
const tree = useContext(TreeContext);
|
|
1306
1327
|
if (!tree)
|
|
@@ -1308,17 +1329,20 @@ function useTree() {
|
|
|
1308
1329
|
return tree;
|
|
1309
1330
|
}
|
|
1310
1331
|
const TreeGroup = memo(function(props) {
|
|
1311
|
-
const $ = c(9);
|
|
1312
|
-
let children,
|
|
1313
|
-
$[0] !==
|
|
1332
|
+
const $ = c(9), t0 = props;
|
|
1333
|
+
let children, rest, t1;
|
|
1334
|
+
$[0] !== t0 ? ({
|
|
1314
1335
|
children,
|
|
1315
|
-
expanded:
|
|
1316
|
-
...
|
|
1317
|
-
} =
|
|
1318
|
-
const expanded =
|
|
1319
|
-
let
|
|
1320
|
-
return $[4] !== children || $[5] !==
|
|
1321
|
-
})
|
|
1336
|
+
expanded: t1,
|
|
1337
|
+
...rest
|
|
1338
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
|
|
1339
|
+
const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
|
|
1340
|
+
let t3;
|
|
1341
|
+
return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.space, role: "group", gap: tree.space, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.space, $[8] = t3) : t3 = $[8], t3;
|
|
1342
|
+
});
|
|
1343
|
+
TreeGroup.displayName = "TreeGroup";
|
|
1344
|
+
const DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
1345
|
+
function TreeItem(props) {
|
|
1322
1346
|
const {
|
|
1323
1347
|
children,
|
|
1324
1348
|
className,
|
|
@@ -1336,7 +1360,7 @@ const TreeGroup = memo(function(props) {
|
|
|
1336
1360
|
space = 2,
|
|
1337
1361
|
text,
|
|
1338
1362
|
weight,
|
|
1339
|
-
...
|
|
1363
|
+
...rest
|
|
1340
1364
|
} = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
1341
1365
|
path,
|
|
1342
1366
|
registerItem,
|
|
@@ -1369,19 +1393,19 @@ const TreeGroup = memo(function(props) {
|
|
|
1369
1393
|
] }),
|
|
1370
1394
|
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
|
|
1371
1395
|
] });
|
|
1372
|
-
return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...
|
|
1396
|
+
return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: composeClassNames(className, treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
|
|
1373
1397
|
/* @__PURE__ */ jsx(Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
|
|
1374
1398
|
paddingLeft: `calc(var(--space-2) * ${tree.level})`
|
|
1375
1399
|
}, children: content2 }),
|
|
1376
1400
|
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
|
|
1377
|
-
] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...
|
|
1401
|
+
] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: composeClassNames(className, treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
|
|
1378
1402
|
/* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
|
|
1379
1403
|
paddingLeft: `calc(var(--space-2) * ${tree.level})`
|
|
1380
1404
|
}, children: content2 }),
|
|
1381
1405
|
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
|
|
1382
1406
|
] });
|
|
1383
|
-
}
|
|
1384
|
-
TreeItem.displayName = "
|
|
1407
|
+
}
|
|
1408
|
+
TreeItem.displayName = "TreeItem";
|
|
1385
1409
|
function RootClassNames(props) {
|
|
1386
1410
|
const $ = c(7), {
|
|
1387
1411
|
element
|
|
@@ -1413,6 +1437,7 @@ function _temp2() {
|
|
|
1413
1437
|
function _temp(n) {
|
|
1414
1438
|
return `.${n}`;
|
|
1415
1439
|
}
|
|
1440
|
+
RootClassNames.displayName = "RootClassNames";
|
|
1416
1441
|
function StyleTags(props) {
|
|
1417
1442
|
const $ = c(10), {
|
|
1418
1443
|
theme: themeProp
|
|
@@ -1437,6 +1462,7 @@ function StyleTags(props) {
|
|
|
1437
1462
|
t4
|
|
1438
1463
|
] }), $[8] = t3, $[9] = t5) : t5 = $[9], t5;
|
|
1439
1464
|
}
|
|
1465
|
+
StyleTags.displayName = "StyleTags";
|
|
1440
1466
|
export {
|
|
1441
1467
|
Arrow,
|
|
1442
1468
|
Autocomplete,
|
|
@@ -1453,8 +1479,57 @@ export {
|
|
|
1453
1479
|
Checkbox,
|
|
1454
1480
|
Code,
|
|
1455
1481
|
CodeSkeleton,
|
|
1456
|
-
ConditionalWrapper,
|
|
1457
1482
|
Container,
|
|
1483
|
+
DEFAULT_ARROW_ELEMENT,
|
|
1484
|
+
DEFAULT_AUTOCOMPLETE_ELEMENT,
|
|
1485
|
+
DEFAULT_AVATAR_COUNTER_ELEMENT,
|
|
1486
|
+
DEFAULT_AVATAR_ELEMENT,
|
|
1487
|
+
DEFAULT_AVATAR_STACK_ELEMENT,
|
|
1488
|
+
DEFAULT_BADGE_ELEMENT,
|
|
1489
|
+
DEFAULT_BOX_ELEMENT,
|
|
1490
|
+
DEFAULT_BREADCRUMBS_ELEMENT,
|
|
1491
|
+
DEFAULT_BUTTON_ELEMENT,
|
|
1492
|
+
DEFAULT_CARD_ELEMENT,
|
|
1493
|
+
DEFAULT_CHECKBOX_ELEMENT,
|
|
1494
|
+
DEFAULT_CODE_ELEMENT,
|
|
1495
|
+
DEFAULT_CODE_SKELETON_ELEMENT,
|
|
1496
|
+
DEFAULT_CONTAINER_ELEMENT,
|
|
1497
|
+
DEFAULT_DIALOG_ELEMENT,
|
|
1498
|
+
DEFAULT_ELEMENT_QUERY_ELEMENT,
|
|
1499
|
+
DEFAULT_FLEX_ELEMENT,
|
|
1500
|
+
DEFAULT_GRID_ELEMENT,
|
|
1501
|
+
DEFAULT_HEADING_ELEMENT,
|
|
1502
|
+
DEFAULT_HEADING_SKELETON_ELEMENT,
|
|
1503
|
+
DEFAULT_HOTKEYS_ELEMENT,
|
|
1504
|
+
DEFAULT_INLINE_ELEMENT,
|
|
1505
|
+
DEFAULT_KBD_ELEMENT,
|
|
1506
|
+
DEFAULT_LABEL_ELEMENT,
|
|
1507
|
+
DEFAULT_LABEL_SKELETON_ELEMENT,
|
|
1508
|
+
DEFAULT_LAYER_ELEMENT,
|
|
1509
|
+
DEFAULT_MENU_DIVIDER_ELEMENT,
|
|
1510
|
+
DEFAULT_MENU_ELEMENT,
|
|
1511
|
+
DEFAULT_MENU_GROUP_ELEMENT,
|
|
1512
|
+
DEFAULT_MENU_ITEM_ELEMENT,
|
|
1513
|
+
DEFAULT_POPOVER_ELEMENT,
|
|
1514
|
+
DEFAULT_RADIO_ELEMENT,
|
|
1515
|
+
DEFAULT_SELECT_ELEMENT,
|
|
1516
|
+
DEFAULT_SKELETON_ELEMENT,
|
|
1517
|
+
DEFAULT_SPINNER_ELEMENT,
|
|
1518
|
+
DEFAULT_SR_ONLY_ELEMENT,
|
|
1519
|
+
DEFAULT_STACK_ELEMENT,
|
|
1520
|
+
DEFAULT_SWITCH_ELEMENT,
|
|
1521
|
+
DEFAULT_TAB_ELEMENT,
|
|
1522
|
+
DEFAULT_TAB_LIST_ELEMENT,
|
|
1523
|
+
DEFAULT_TAB_PANEL_ELEMENT,
|
|
1524
|
+
DEFAULT_TEXT_AREA_ELEMENT,
|
|
1525
|
+
DEFAULT_TEXT_ELEMENT,
|
|
1526
|
+
DEFAULT_TEXT_INPUT_ELEMENT,
|
|
1527
|
+
DEFAULT_TEXT_SKELETON_ELEMENT,
|
|
1528
|
+
DEFAULT_TOAST_ELEMENT,
|
|
1529
|
+
DEFAULT_TOOLTIP_ELEMENT,
|
|
1530
|
+
DEFAULT_TREE_ELEMENT,
|
|
1531
|
+
DEFAULT_TREE_ITEM_ELEMENT,
|
|
1532
|
+
DEFAULT_VIRTUAL_LIST_ELEMENT,
|
|
1458
1533
|
Dialog,
|
|
1459
1534
|
DialogContext,
|
|
1460
1535
|
DialogProvider,
|