@sanity/ui 3.0.0-static.15 → 3.0.0-static.17
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/README.md +6 -6
- package/bin/{ui.js → sanity-ui.cjs} +1 -1
- package/dist/_chunks-cjs/{_visual-editing.js → _visual-editing.cjs} +67 -77
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/{buildCommand.js → buildCommand.cjs} +26 -10
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
- package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
- package/dist/_chunks-cjs/refractor.cjs.map +1 -0
- package/dist/_chunks-es/{_visual-editing.mjs → _visual-editing.js} +68 -78
- package/dist/_chunks-es/_visual-editing.js.map +1 -0
- package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
- package/dist/_chunks-es/refractor.js.map +1 -0
- package/dist/_visual-editing.cjs +30 -0
- package/dist/_visual-editing.cjs.map +1 -0
- package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +5 -15
- package/dist/_visual-editing.d.ts +5 -15
- package/dist/_visual-editing.js +29 -30
- package/dist/_visual-editing.js.map +1 -1
- package/dist/{cli.js → cli.cjs} +4 -4
- package/dist/cli.cjs.map +1 -0
- package/dist/{css.mjs → css.cjs} +809 -923
- package/dist/css.cjs.map +1 -0
- package/dist/{css.d.mts → css.d.cts} +31 -24
- package/dist/css.d.ts +31 -24
- package/dist/css.js +809 -921
- package/dist/css.js.map +1 -1
- package/dist/{index.mjs → index.cjs} +373 -406
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +10 -20
- package/dist/index.d.ts +10 -20
- package/dist/index.js +371 -406
- package/dist/index.js.map +1 -1
- package/dist/{theme.mjs → theme.cjs} +219 -196
- package/dist/theme.cjs.map +1 -0
- package/dist/{theme.d.mts → theme.d.cts} +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +218 -195
- package/dist/theme.js.map +1 -1
- package/dist/{sanity-palette.css → ui-palette.css} +1 -1
- package/dist/ui-palette.min.css +1 -0
- package/dist/{system.css → ui-system.css} +1135 -245
- package/dist/ui-system.min.css +1 -0
- package/dist/{sanity-theme.css → ui-theme.css} +199 -199
- package/dist/ui-theme.min.css +1 -0
- package/dist/ui.css +29152 -0
- package/dist/ui.min.css +1 -0
- package/exports/_visual-editing.ts +27 -27
- package/exports/index.ts +1 -1
- package/package.json +24 -24
- package/src/cli/buildCommand.ts +55 -20
- package/src/cli/index.ts +2 -14
- package/src/{ui → core}/StyleTags.tsx +4 -4
- package/src/{ui → core}/_compat/index.ts +0 -1
- package/src/{ui → core}/_compat/theme/themeProvider.tsx +3 -3
- package/src/{ui → core}/components/autocomplete/__workshop__/async.tsx +2 -2
- package/src/{ui → core}/components/autocomplete/__workshop__/custom.tsx +2 -2
- package/src/{ui → core}/components/autocomplete/__workshop__/focusAndBlur.tsx +3 -3
- package/src/{ui → core}/components/tab/tabList.tsx +19 -4
- package/src/{ui → core}/index.ts +0 -1
- package/src/{ui → core}/primitives/box/box.tsx +3 -0
- package/src/core/primitives/button/__workshop__/custom.tsx +27 -0
- package/src/{ui → core}/primitives/button/button.tsx +3 -1
- package/src/{ui → core}/primitives/card/__workshop__/asButton.tsx +0 -9
- package/src/{ui → core}/primitives/card/__workshop__/interactive.tsx +0 -1
- package/src/{ui → core}/primitives/card/__workshop__/props.tsx +0 -3
- package/src/{ui → core}/primitives/card/__workshop__/selected.tsx +6 -37
- package/src/{ui → core}/primitives/card/card.tsx +15 -21
- package/src/core/primitives/card/cardProvider.tsx +27 -0
- package/src/{ui → core}/primitives/card/types.ts +5 -4
- package/src/{ui → core}/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/{ui → core}/primitives/heading/__workshop__/plain.tsx +1 -8
- package/src/{ui → core}/primitives/label/__workshop__/plain.tsx +1 -9
- package/src/{ui → core}/primitives/popover/popover.tsx +1 -1
- package/src/{ui → core}/primitives/text/__workshop__/example.tsx +1 -9
- package/src/{ui → core}/primitives/tooltip/tooltip.tsx +1 -1
- package/src/{ui/utils/portal/portal.ts → core/utils/portal/portal.tsx} +8 -10
- package/src/css/{compilePalette.ts → _compilePalette.ts} +2 -2
- package/src/css/{compileSystem.ts → _compileSystem.ts} +1 -1
- package/src/css/{compileTheme.ts → _compileTheme.ts} +3 -3
- package/src/css/{compileTheme_v3.ts → _compileTheme_v3.ts} +7 -1
- package/src/css/_mergeStyles.ts +0 -7
- package/src/css/_system.style.ts +3 -0
- package/src/css/aspects/font/font.style.ts +0 -21
- package/src/css/aspects/font/font.ts +1 -6
- package/src/css/aspects/font/types.ts +0 -4
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/textAlign/index.ts +2 -0
- package/src/css/aspects/textAlign/textAlign.style.ts +26 -0
- package/src/css/aspects/textAlign/textAlign.ts +8 -0
- package/src/css/aspects/textAlign/types.ts +7 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/_input/_input.style.ts +9 -11
- package/src/css/primitives/box/box.style.ts +5 -1
- package/src/css/primitives/box/box.ts +2 -0
- package/src/css/primitives/box/types.ts +2 -0
- package/src/css/primitives/button/button.style.ts +23 -9
- package/src/css/primitives/button/button.ts +1 -12
- package/src/css/primitives/button/types.ts +1 -6
- package/src/css/primitives/card/card.style.ts +12 -21
- package/src/css/primitives/heading/heading.ts +2 -1
- package/src/css/primitives/heading/types.ts +2 -1
- package/src/css/primitives/kbd/kbd.style.ts +3 -6
- package/src/css/primitives/label/label.ts +2 -1
- package/src/css/primitives/label/types.ts +2 -1
- package/src/css/primitives/text/text.style.ts +0 -5
- package/src/css/primitives/text/text.ts +2 -1
- package/src/css/primitives/text/types.ts +2 -1
- package/src/css/primitives/textInput/textInput.style.ts +1 -120
- package/src/css/types.ts +9 -9
- package/src/theme/v3/color/buildColor_v3.ts +53 -25
- package/src/theme/v3/color/card.ts +0 -42
- package/src/theme/v3/color/renderColor.test.ts +1 -0
- package/src/theme/v3/color/renderColor.ts +9 -2
- package/src/theme/v3/color/token.ts +1 -0
- package/src/theme/v3/defaultTokens.ts +7 -2
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/buildCommand.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_visual-editing.mjs +0 -31
- package/dist/_visual-editing.mjs.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/css.mjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/sanity-palette.min.css +0 -1
- package/dist/sanity-theme.min.css +0 -1
- package/dist/system.min.css +0 -1
- package/dist/theme.mjs.map +0 -1
- package/src/css/primitives/button/_constants.ts +0 -17
- package/src/ui/RootClassNames.tsx +0 -44
- package/src/ui/_compat/studioTheme.ts +0 -7
- package/src/ui/primitives/button/__workshop__/custom.tsx +0 -50
- package/src/ui/primitives/card/cardProvider.tsx +0 -21
- /package/dist/{cli.d.ts → cli.d.cts} +0 -0
- /package/src/{ui → core}/_compat/helpers.ts +0 -0
- /package/src/{ui → core}/_compat/styles/_responsive.ts +0 -0
- /package/src/{ui → core}/_compat/styles/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/theme.test.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeColorProvider.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeContext.ts +0 -0
- /package/src/{ui → core}/_compat/theme/types.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useRootTheme.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useTheme.ts +0 -0
- /package/src/{ui → core}/_compat/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/apiStore.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/countries.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/fullscreen.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/autocomplete.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteOption.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteReducer.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/constants.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/types.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/breadcrumbs.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/activate.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/autoFocus.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/onScroll.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/panes.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/position.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/wrapped.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialog.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogCard.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogContext.ts +0 -0
- /package/src/{ui → core}/components/dialog/dialogProvider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/isTargetWithinScope.ts +0 -0
- /package/src/{ui → core}/components/dialog/useDialog.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/hotkeys.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/index.ts +0 -0
- /package/src/{ui → core}/components/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/avatarMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/closableMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/constrainedInBoundary.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customMenuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customSelectedState.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/disableFocusOnClose.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/groups.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuGroupRight.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/nestedMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/onCloseMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/selectedItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/shouldFocus.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/withoutArrow.tsx +0 -0
- /package/src/{ui → core}/components/menu/helpers.ts +0 -0
- /package/src/{ui → core}/components/menu/index.ts +0 -0
- /package/src/{ui → core}/components/menu/menu.test.tsx +0 -0
- /package/src/{ui → core}/components/menu/menu.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuContext.ts +0 -0
- /package/src/{ui → core}/components/menu/menuDivider.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuGroup.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/useMenu.ts +0 -0
- /package/src/{ui → core}/components/menu/useMenuController.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/codeSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/headingSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/labelSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/textSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tab/index.ts +0 -0
- /package/src/{ui → core}/components/tab/tab.tsx +0 -0
- /package/src/{ui → core}/components/tab/tabPanel.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/hook.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/index.ts +0 -0
- /package/src/{ui → core}/components/toast/toast.test.tsx +0 -0
- /package/src/{ui → core}/components/toast/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastContext.ts +0 -0
- /package/src/{ui → core}/components/toast/toastLayer.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastProvider.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastState.ts +0 -0
- /package/src/{ui → core}/components/toast/types.ts +0 -0
- /package/src/{ui → core}/components/toast/useToast.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.perf.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.tsx +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/tabFromElement.tsx +0 -0
- /package/src/{ui → core}/components/tree/helpers.ts +0 -0
- /package/src/{ui → core}/components/tree/index.ts +0 -0
- /package/src/{ui → core}/components/tree/tree.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeContext.ts +0 -0
- /package/src/{ui → core}/components/tree/treeGroup.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeItem.tsx +0 -0
- /package/src/{ui → core}/components/tree/types.ts +0 -0
- /package/src/{ui → core}/components/tree/useTree.ts +0 -0
- /package/src/{ui → core}/constants.ts +0 -0
- /package/src/{ui → core}/global.ts +0 -0
- /package/src/{ui → core}/helpers/animation.ts +0 -0
- /package/src/{ui → core}/helpers/element.ts +0 -0
- /package/src/{ui → core}/helpers/focus.ts +0 -0
- /package/src/{ui → core}/helpers/index.ts +0 -0
- /package/src/{ui → core}/helpers/props.ts +0 -0
- /package/src/{ui → core}/helpers/scroll.ts +0 -0
- /package/src/{ui → core}/hooks/index.ts +0 -0
- /package/src/{ui → core}/hooks/useArrayProp.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.ts +0 -0
- /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayed.test.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayedState.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
- /package/src/{ui → core}/hooks/useElementSize.ts +0 -0
- /package/src/{ui → core}/hooks/useForwardedRef.ts +0 -0
- /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
- /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
- /package/src/{ui → core}/hooks/useMatchMedia.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.ts +0 -0
- /package/src/{ui → core}/hooks/useMounted.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
- /package/src/{ui → core}/lib/createGlobalScopedContext.ts +0 -0
- /package/src/{ui → core}/lib/globalScope.ts +0 -0
- /package/src/{ui → core}/lib/isRecord.ts +0 -0
- /package/src/{ui → core}/middleware/origin.ts +0 -0
- /package/src/{ui → core}/observers/elementSizeObserver.ts +0 -0
- /package/src/{ui → core}/observers/index.ts +0 -0
- /package/src/{ui → core}/observers/resizeObserver.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/index.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/selectable.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/asButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatar.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarCounter.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarStack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/types.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.test.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/types.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/box/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/customIcons.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/disabled.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/sanityUploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/stacked.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/uploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/button.test.tsx +0 -0
- /package/src/{ui → core}/primitives/button/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/allTones.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/checkered.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/listNavigation.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
- /package/src/{ui → core}/primitives/card/cardContext.ts +0 -0
- /package/src/{ui → core}/primitives/card/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/useCard.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/checkbox.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/code/code.tsx +0 -0
- /package/src/{ui → core}/primitives/code/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/refractor.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/container.tsx +0 -0
- /package/src/{ui → core}/primitives/container/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/types.ts +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/flex/flex.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/grid.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/heading.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/index.ts +0 -0
- /package/src/{ui → core}/primitives/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/inline.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/types.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/kbd/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/kbd.tsx +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/label/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/label.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/AlignedStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/PlainStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/RecursiveStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/SidePanelStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/TestStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/constants.ts +0 -0
- /package/src/{ui → core}/primitives/popover/floating-ui/size.ts +0 -0
- /package/src/{ui → core}/primitives/popover/helpers.ts +0 -0
- /package/src/{ui → core}/primitives/popover/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/popoverLayer.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/types.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/radio.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/select/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/select.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/Props.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/animatedSpinnerIcon.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/spinner.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/switch.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/colored.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/text/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/text.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/textArea.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/customValidity.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/states.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/typed.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/textInput.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/customPortal.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/constants.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltip.test.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipLayer.tsx +0 -0
- /package/src/{ui → core}/primitives/types.ts +0 -0
- /package/src/{ui → core}/types/avatar.ts +0 -0
- /package/src/{ui → core}/types/badge.ts +0 -0
- /package/src/{ui → core}/types/box.ts +0 -0
- /package/src/{ui → core}/types/button.ts +0 -0
- /package/src/{ui → core}/types/card.ts +0 -0
- /package/src/{ui → core}/types/dialog.ts +0 -0
- /package/src/{ui → core}/types/flex.ts +0 -0
- /package/src/{ui → core}/types/grid.ts +0 -0
- /package/src/{ui → core}/types/gridItem.ts +0 -0
- /package/src/{ui → core}/types/index.ts +0 -0
- /package/src/{ui → core}/types/placement.ts +0 -0
- /package/src/{ui → core}/types/popover.ts +0 -0
- /package/src/{ui → core}/types/props.ts +0 -0
- /package/src/{ui → core}/types/radius.ts +0 -0
- /package/src/{ui → core}/types/selectable.ts +0 -0
- /package/src/{ui → core}/types/text.ts +0 -0
- /package/src/{ui → core}/utils/arrow/arrow.tsx +0 -0
- /package/src/{ui → core}/utils/arrow/cmds.ts +0 -0
- /package/src/{ui → core}/utils/arrow/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElement.test.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementContext.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementProvider.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/types.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/useBoundaryElement.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/customMedia.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/elementQuery.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/index.ts +0 -0
- /package/src/{ui → core}/utils/errorBoundary.tsx +0 -0
- /package/src/{ui → core}/utils/getElementRef.ts +0 -0
- /package/src/{ui → core}/utils/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/_debug.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.test.ts +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/layer.test.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layer.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerCard.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/layerProvider.tsx +0 -0
- /package/src/{ui → core}/utils/layer/types.ts +0 -0
- /package/src/{ui → core}/utils/layer/useLayer.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/named.tsx +0 -0
- /package/src/{ui → core}/utils/portal/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/portal.test.tsx +0 -0
- /package/src/{ui → core}/utils/portal/portalContext.ts +0 -0
- /package/src/{ui → core}/utils/portal/portalProvider.tsx +0 -0
- /package/src/{ui → core}/utils/portal/types.ts +0 -0
- /package/src/{ui → core}/utils/portal/usePortal.ts +0 -0
- /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
- /package/src/{ui → core}/utils/srOnly/index.ts +0 -0
- /package/src/{ui → core}/utils/srOnly/srOnly.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/virtualList.tsx +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 { 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 } from "./_chunks-es/_visual-editing.js";
|
|
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, useCard, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.js";
|
|
4
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
6
|
+
import { useState, useRef, useEffect, useImperativeHandle, Component, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
|
|
7
|
+
import { c } from "react-compiler-runtime";
|
|
8
|
+
import { composeClassNames, breadcrumbs, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, dialogContainer, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, _compilePalette, _compileTheme, _compileSystem } from "@sanity/ui/css";
|
|
9
|
+
import { px, rem } from "@sanity/ui/css";
|
|
10
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
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;
|
|
5
12
|
function _responsive(media, values, callback) {
|
|
6
13
|
return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
|
|
7
14
|
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
@@ -26,7 +33,7 @@ function _hasFocus(element) {
|
|
|
26
33
|
return !!document.activeElement && element.contains(document.activeElement);
|
|
27
34
|
}
|
|
28
35
|
function isFocusable(element) {
|
|
29
|
-
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 :
|
|
36
|
+
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
|
|
30
37
|
}
|
|
31
38
|
function attemptFocus(element) {
|
|
32
39
|
if (!isFocusable(element))
|
|
@@ -40,7 +47,7 @@ function attemptFocus(element) {
|
|
|
40
47
|
function focusFirstDescendant(element) {
|
|
41
48
|
for (let i = 0; i < element.childNodes.length; i++) {
|
|
42
49
|
const child = element.childNodes[i];
|
|
43
|
-
if (
|
|
50
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
|
|
44
51
|
return !0;
|
|
45
52
|
}
|
|
46
53
|
return !1;
|
|
@@ -48,7 +55,7 @@ function focusFirstDescendant(element) {
|
|
|
48
55
|
function focusLastDescendant(element) {
|
|
49
56
|
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
50
57
|
const child = element.childNodes[i];
|
|
51
|
-
if (
|
|
58
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
|
|
52
59
|
return !0;
|
|
53
60
|
}
|
|
54
61
|
return !1;
|
|
@@ -60,10 +67,10 @@ function _getElements(element, elementsArg) {
|
|
|
60
67
|
return ret.filter(Boolean);
|
|
61
68
|
}
|
|
62
69
|
function useClickOutside(listener, t0, boundaryElement) {
|
|
63
|
-
const $ =
|
|
70
|
+
const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
|
|
64
71
|
let t1;
|
|
65
72
|
$[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
|
|
66
|
-
const [elements, setElements] =
|
|
73
|
+
const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
|
|
67
74
|
let t2, t3;
|
|
68
75
|
$[3] !== element || $[4] !== elementsArg ? (t2 = () => {
|
|
69
76
|
const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
|
|
@@ -81,7 +88,7 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
81
88
|
setElements(nextElements), elementsRef.current = nextElements;
|
|
82
89
|
return;
|
|
83
90
|
}
|
|
84
|
-
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]),
|
|
91
|
+
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
|
|
85
92
|
let t4, t5;
|
|
86
93
|
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
87
94
|
if (!listener)
|
|
@@ -98,17 +105,17 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
98
105
|
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
99
106
|
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
100
107
|
};
|
|
101
|
-
}, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]),
|
|
108
|
+
}, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
|
|
102
109
|
}
|
|
103
110
|
function useElementRect(element) {
|
|
104
|
-
return
|
|
111
|
+
return useElementSize(element)?._contentRect || null;
|
|
105
112
|
}
|
|
106
113
|
function useForwardedRef(ref) {
|
|
107
|
-
const $ =
|
|
114
|
+
const $ = c(1), innerRef = useRef(null);
|
|
108
115
|
let t0;
|
|
109
|
-
return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0],
|
|
116
|
+
return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
|
|
110
117
|
}
|
|
111
|
-
class ErrorBoundary extends
|
|
118
|
+
class ErrorBoundary extends Component {
|
|
112
119
|
state = {
|
|
113
120
|
error: null
|
|
114
121
|
};
|
|
@@ -130,13 +137,13 @@ class ErrorBoundary extends react.Component {
|
|
|
130
137
|
} = this.state;
|
|
131
138
|
if (error) {
|
|
132
139
|
const message = typeof error?.message == "string" ? error.message : "Error";
|
|
133
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ jsx(Code, { children: message });
|
|
134
141
|
}
|
|
135
142
|
return this.props.children;
|
|
136
143
|
}
|
|
137
144
|
}
|
|
138
145
|
function AutocompleteOption(props) {
|
|
139
|
-
const $ =
|
|
146
|
+
const $ = c(11), {
|
|
140
147
|
children,
|
|
141
148
|
id,
|
|
142
149
|
onSelect,
|
|
@@ -152,11 +159,11 @@ function AutocompleteOption(props) {
|
|
|
152
159
|
const handleClick = t0;
|
|
153
160
|
let t1;
|
|
154
161
|
$[3] !== handleClick ? (t1 = (event) => {
|
|
155
|
-
event.key === "Enter" && !
|
|
162
|
+
event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
|
|
156
163
|
}, $[3] = handleClick, $[4] = t1) : t1 = $[4];
|
|
157
164
|
const handleKeyDown = t1;
|
|
158
165
|
let t2;
|
|
159
|
-
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */
|
|
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;
|
|
160
167
|
}
|
|
161
168
|
AutocompleteOption.displayName = "AutocompleteOption";
|
|
162
169
|
function autocompleteReducer(state, msg) {
|
|
@@ -209,7 +216,7 @@ function Autocomplete(props) {
|
|
|
209
216
|
fontSize = 2,
|
|
210
217
|
icon,
|
|
211
218
|
id,
|
|
212
|
-
listBox =
|
|
219
|
+
listBox = EMPTY_RECORD,
|
|
213
220
|
loading,
|
|
214
221
|
onBlur,
|
|
215
222
|
onChange,
|
|
@@ -220,7 +227,7 @@ function Autocomplete(props) {
|
|
|
220
227
|
openOnFocus,
|
|
221
228
|
options: optionsProp,
|
|
222
229
|
padding: paddingProp = 3,
|
|
223
|
-
popover =
|
|
230
|
+
popover = EMPTY_RECORD,
|
|
224
231
|
prefix,
|
|
225
232
|
radius = 2,
|
|
226
233
|
readOnly,
|
|
@@ -232,7 +239,7 @@ function Autocomplete(props) {
|
|
|
232
239
|
suffix,
|
|
233
240
|
value: valueProp,
|
|
234
241
|
...rest
|
|
235
|
-
} = props, [state, dispatch] =
|
|
242
|
+
} = props, [state, dispatch] = useReducer(autocompleteReducer, {
|
|
236
243
|
activeValue: valueProp || null,
|
|
237
244
|
focused: !1,
|
|
238
245
|
listFocused: !1,
|
|
@@ -244,11 +251,11 @@ function Autocomplete(props) {
|
|
|
244
251
|
listFocused,
|
|
245
252
|
query,
|
|
246
253
|
value
|
|
247
|
-
} = state, defaultRenderOption =
|
|
254
|
+
} = state, defaultRenderOption = useCallback(({
|
|
248
255
|
value: value_0
|
|
249
|
-
}) => /* @__PURE__ */
|
|
250
|
-
|
|
251
|
-
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp :
|
|
256
|
+
}) => /* @__PURE__ */ jsx(Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
|
|
257
|
+
useImperativeHandle(forwardedRef, () => inputElementRef.current);
|
|
258
|
+
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
|
|
252
259
|
setTimeout(() => {
|
|
253
260
|
if (popoverMouseWithinRef.current)
|
|
254
261
|
return;
|
|
@@ -265,18 +272,18 @@ function Autocomplete(props) {
|
|
|
265
272
|
type: "root/blur"
|
|
266
273
|
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
267
274
|
}, 0);
|
|
268
|
-
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus =
|
|
275
|
+
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
|
|
269
276
|
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
270
277
|
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
271
278
|
type: "root/setListFocused",
|
|
272
279
|
listFocused: listFocused_0
|
|
273
280
|
}));
|
|
274
|
-
}, []), handleOptionSelect =
|
|
281
|
+
}, []), handleOptionSelect = useCallback((v) => {
|
|
275
282
|
dispatch({
|
|
276
283
|
type: "value/change",
|
|
277
284
|
value: v
|
|
278
285
|
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
279
|
-
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown =
|
|
286
|
+
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
|
|
280
287
|
if (event_1.key === "ArrowDown") {
|
|
281
288
|
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
282
289
|
const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
@@ -308,35 +315,35 @@ function Autocomplete(props) {
|
|
|
308
315
|
inputElementRef.current?.focus();
|
|
309
316
|
return;
|
|
310
317
|
}
|
|
311
|
-
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange =
|
|
318
|
+
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
|
|
312
319
|
const nextQuery = event_2.currentTarget.value;
|
|
313
320
|
dispatch({
|
|
314
321
|
type: "input/change",
|
|
315
322
|
query: nextQuery
|
|
316
323
|
}), onQueryChange && onQueryChange(nextQuery);
|
|
317
|
-
}, [onQueryChange]), dispatchOpen =
|
|
324
|
+
}, [onQueryChange]), dispatchOpen = useCallback(() => {
|
|
318
325
|
dispatch({
|
|
319
326
|
type: "root/open",
|
|
320
327
|
query: value ? renderValue(value, currentOption) : ""
|
|
321
328
|
});
|
|
322
|
-
}, [currentOption, renderValue, value]), handleInputFocus =
|
|
329
|
+
}, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
|
|
323
330
|
focused || (dispatch({
|
|
324
331
|
type: "input/focus"
|
|
325
332
|
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
326
|
-
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter =
|
|
333
|
+
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
|
|
327
334
|
popoverMouseWithinRef.current = !0;
|
|
328
|
-
}, []), handlePopoverMouseLeave =
|
|
335
|
+
}, []), handlePopoverMouseLeave = useCallback(() => {
|
|
329
336
|
popoverMouseWithinRef.current = !1;
|
|
330
|
-
}, []), handleClearButtonClick =
|
|
337
|
+
}, []), handleClearButtonClick = useCallback(() => {
|
|
331
338
|
dispatch({
|
|
332
339
|
type: "root/clear"
|
|
333
340
|
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
334
|
-
}, [onChange, onQueryChange]), handleClearButtonFocus =
|
|
341
|
+
}, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
|
|
335
342
|
dispatch({
|
|
336
343
|
type: "input/focus"
|
|
337
344
|
});
|
|
338
345
|
}, []);
|
|
339
|
-
|
|
346
|
+
useEffect(() => {
|
|
340
347
|
if (valueProp !== valuePropRef.current) {
|
|
341
348
|
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
342
349
|
type: "value/change",
|
|
@@ -348,12 +355,12 @@ function Autocomplete(props) {
|
|
|
348
355
|
type: "value/change",
|
|
349
356
|
value: valueProp || null
|
|
350
357
|
}));
|
|
351
|
-
}, [valueProp]),
|
|
358
|
+
}, [valueProp]), useEffect(() => {
|
|
352
359
|
!focused && valueRef.current && dispatch({
|
|
353
360
|
type: "root/setActiveValue",
|
|
354
361
|
value: valueRef.current
|
|
355
362
|
});
|
|
356
|
-
}, [focused]),
|
|
363
|
+
}, [focused]), useEffect(() => {
|
|
357
364
|
const listElement = listBoxElementRef.current;
|
|
358
365
|
if (!listElement) return;
|
|
359
366
|
const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
@@ -366,33 +373,33 @@ function Autocomplete(props) {
|
|
|
366
373
|
}
|
|
367
374
|
}
|
|
368
375
|
}, [activeValue, filteredOptions]);
|
|
369
|
-
const clearButton =
|
|
376
|
+
const clearButton = useMemo(() => {
|
|
370
377
|
if (!loading && !disabled && value)
|
|
371
378
|
return {
|
|
372
379
|
"aria-label": "Clear",
|
|
373
380
|
onFocus: handleClearButtonFocus
|
|
374
381
|
};
|
|
375
|
-
}, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding =
|
|
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) => {
|
|
376
383
|
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
377
|
-
}, [openButtonProps, dispatchOpen]), openButtonNode =
|
|
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) => {
|
|
378
385
|
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
379
|
-
}, [listFocused]), content2 =
|
|
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) => {
|
|
380
387
|
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
381
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
|
|
382
389
|
disabled: loading,
|
|
383
390
|
selected: active,
|
|
384
391
|
tabIndex: listFocused && active ? 0 : -1
|
|
385
392
|
}) }, option_0.value);
|
|
386
|
-
}) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results =
|
|
393
|
+
}) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
|
|
387
394
|
content: content2,
|
|
388
395
|
hidden: !expanded,
|
|
389
396
|
inputElement: inputElementRef.current,
|
|
390
397
|
onMouseEnter: handlePopoverMouseEnter,
|
|
391
398
|
onMouseLeave: handlePopoverMouseLeave
|
|
392
|
-
}, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */
|
|
399
|
+
}, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
|
|
393
400
|
return (
|
|
394
401
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
395
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
396
403
|
input,
|
|
397
404
|
results
|
|
398
405
|
] })
|
|
@@ -415,28 +422,28 @@ function Breadcrumbs(props) {
|
|
|
415
422
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
416
423
|
space: _spaceProp,
|
|
417
424
|
...rest
|
|
418
|
-
} = props, [open, setOpen] =
|
|
419
|
-
|
|
420
|
-
const rawItems =
|
|
425
|
+
} = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
|
|
426
|
+
useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
|
|
427
|
+
const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
|
|
421
428
|
const len = rawItems.length;
|
|
422
429
|
if (maxLength && len > maxLength) {
|
|
423
430
|
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
424
|
-
return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */
|
|
431
|
+
return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", space: gapY, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
|
|
425
432
|
}
|
|
426
433
|
return rawItems;
|
|
427
434
|
}, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
|
|
428
|
-
return /* @__PURE__ */
|
|
429
|
-
itemIndex > 0 && /* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
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: [
|
|
436
|
+
itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
|
|
437
|
+
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
431
438
|
] }, itemIndex)) });
|
|
432
439
|
}
|
|
433
440
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
434
441
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
435
|
-
return !boundaryElement || !portalElement ? !0 :
|
|
442
|
+
return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
436
443
|
}
|
|
437
444
|
const DEFAULT_DIALOG_CARD_ELEMENT = "div";
|
|
438
445
|
function DialogCard(props) {
|
|
439
|
-
const $ =
|
|
446
|
+
const $ = c(51), t0 = props;
|
|
440
447
|
let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
|
|
441
448
|
$[0] !== t0 ? ({
|
|
442
449
|
__unstable_autoFocus: autoFocus,
|
|
@@ -453,65 +460,65 @@ function DialogCard(props) {
|
|
|
453
460
|
ref: forwardedRef,
|
|
454
461
|
...rest
|
|
455
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]);
|
|
456
|
-
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal =
|
|
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(), {
|
|
457
464
|
isTopLayer
|
|
458
465
|
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
|
|
459
466
|
let t2;
|
|
460
|
-
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14],
|
|
467
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
|
|
461
468
|
let t3;
|
|
462
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15],
|
|
469
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], useImperativeHandle(forwardedContentRef, t3);
|
|
463
470
|
let t4, t5;
|
|
464
471
|
$[16] !== autoFocus ? (t4 = () => {
|
|
465
472
|
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
466
|
-
}, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]),
|
|
473
|
+
}, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), useEffect(t4, t5);
|
|
467
474
|
let t6;
|
|
468
475
|
$[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
|
|
469
476
|
if (!isTopLayer || !onClose)
|
|
470
477
|
return;
|
|
471
478
|
const target = document.activeElement;
|
|
472
479
|
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
473
|
-
}, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23],
|
|
480
|
+
}, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], useGlobalKeyDown(t6);
|
|
474
481
|
let t7;
|
|
475
482
|
$[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
|
|
476
483
|
const target_0 = event_0.target;
|
|
477
484
|
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
478
485
|
}), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
|
|
479
486
|
let t8;
|
|
480
|
-
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29],
|
|
487
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], useClickOutsideEvent(t7, t8);
|
|
481
488
|
let t9;
|
|
482
|
-
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 =
|
|
489
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[30] = t9) : t9 = $[30];
|
|
483
490
|
let t10;
|
|
484
|
-
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 =
|
|
491
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[31] = t10) : t10 = $[31];
|
|
485
492
|
let t11;
|
|
486
|
-
$[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
showCloseButton && /* @__PURE__ */
|
|
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: [
|
|
494
|
+
/* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
|
|
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 }) })
|
|
489
496
|
] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
|
|
490
497
|
let t12;
|
|
491
|
-
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 =
|
|
498
|
+
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[38] = t12) : t12 = $[38];
|
|
492
499
|
let t13;
|
|
493
|
-
$[39] !== children ? (t13 = /* @__PURE__ */
|
|
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];
|
|
494
501
|
let t14;
|
|
495
|
-
$[41] !== footer ? (t14 = footer && /* @__PURE__ */
|
|
502
|
+
$[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
|
|
496
503
|
let t15;
|
|
497
|
-
$[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */
|
|
504
|
+
$[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
|
|
498
505
|
t11,
|
|
499
506
|
t13,
|
|
500
507
|
t14
|
|
501
508
|
] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
|
|
502
509
|
let t16;
|
|
503
|
-
return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */
|
|
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;
|
|
504
511
|
}
|
|
505
512
|
DialogCard.displayName = "DialogCard";
|
|
506
|
-
const DialogContext =
|
|
513
|
+
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
507
514
|
version: 0
|
|
508
515
|
});
|
|
509
516
|
function useDialog() {
|
|
510
|
-
return
|
|
517
|
+
return useContext(DialogContext);
|
|
511
518
|
}
|
|
512
519
|
const DEFAULT_DIALOG_ELEMENT = "div";
|
|
513
520
|
function Dialog(props) {
|
|
514
|
-
const $ =
|
|
521
|
+
const $ = c(69), context = useDialog(), t0 = props;
|
|
515
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;
|
|
516
523
|
$[0] !== t0 ? ({
|
|
517
524
|
__unstable_autoFocus: t1,
|
|
@@ -538,7 +545,7 @@ function Dialog(props) {
|
|
|
538
545
|
tone,
|
|
539
546
|
...rest
|
|
540
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]);
|
|
541
|
-
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 ??
|
|
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);
|
|
542
549
|
let t8;
|
|
543
550
|
$[24] !== onFocus ? (t8 = (event) => {
|
|
544
551
|
onFocus?.(event);
|
|
@@ -551,9 +558,9 @@ function Dialog(props) {
|
|
|
551
558
|
focusFirstDescendant(cardElement);
|
|
552
559
|
return;
|
|
553
560
|
}
|
|
554
|
-
|
|
561
|
+
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
555
562
|
}, $[24] = onFocus, $[25] = t8) : t8 = $[25];
|
|
556
|
-
const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef =
|
|
563
|
+
const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
|
|
557
564
|
let t9;
|
|
558
565
|
$[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
|
|
559
566
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
@@ -571,30 +578,30 @@ function Dialog(props) {
|
|
|
571
578
|
}, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
|
|
572
579
|
const handleRootClick = t9;
|
|
573
580
|
let t10;
|
|
574
|
-
$[29] !== className ? (t10 =
|
|
581
|
+
$[29] !== className ? (t10 = composeClassNames(className, dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
|
|
575
582
|
const t11 = animate ? "" : void 0;
|
|
576
583
|
let t12;
|
|
577
|
-
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */
|
|
584
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
|
|
578
585
|
let t13;
|
|
579
|
-
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 =
|
|
586
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
|
|
580
587
|
let t14;
|
|
581
|
-
$[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__ */
|
|
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];
|
|
582
589
|
let t15;
|
|
583
|
-
$[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */
|
|
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];
|
|
584
591
|
let t16;
|
|
585
|
-
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */
|
|
592
|
+
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
|
|
586
593
|
let t17;
|
|
587
|
-
$[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__ */
|
|
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: [
|
|
588
595
|
t12,
|
|
589
596
|
t15,
|
|
590
597
|
t16
|
|
591
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];
|
|
592
599
|
let t18;
|
|
593
|
-
return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */
|
|
600
|
+
return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
|
|
594
601
|
}
|
|
595
602
|
Dialog.displayName = "Dialog";
|
|
596
603
|
function DialogProvider(props) {
|
|
597
|
-
const $ =
|
|
604
|
+
const $ = c(6), {
|
|
598
605
|
children,
|
|
599
606
|
position,
|
|
600
607
|
zOffset
|
|
@@ -607,11 +614,11 @@ function DialogProvider(props) {
|
|
|
607
614
|
}, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
|
|
608
615
|
const contextValue = t0;
|
|
609
616
|
let t2;
|
|
610
|
-
return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */
|
|
617
|
+
return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
|
|
611
618
|
}
|
|
612
619
|
DialogProvider.displayName = "DialogProvider";
|
|
613
620
|
function MenuButton(props) {
|
|
614
|
-
const $ =
|
|
621
|
+
const $ = c(63), {
|
|
615
622
|
__unstable_disableRestoreFocusOnClose: t0,
|
|
616
623
|
boundaryElement: deprecated_boundaryElement,
|
|
617
624
|
button: buttonProp,
|
|
@@ -626,25 +633,25 @@ function MenuButton(props) {
|
|
|
626
633
|
popoverRadius: deprecated_popoverRadius,
|
|
627
634
|
preventOverflow: deprecated_preventOverflow,
|
|
628
635
|
ref: forwardedRef
|
|
629
|
-
} = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] =
|
|
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);
|
|
630
637
|
let t2;
|
|
631
638
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
632
|
-
const [menuElements, setChildMenuElements] =
|
|
639
|
+
const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
|
|
633
640
|
let t3, t4;
|
|
634
641
|
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
635
642
|
onOpen && open && !openRef.current && onOpen();
|
|
636
|
-
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]),
|
|
643
|
+
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
|
|
637
644
|
let t5, t6;
|
|
638
645
|
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
639
646
|
onClose && !open && openRef.current && onClose();
|
|
640
|
-
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]),
|
|
647
|
+
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
|
|
641
648
|
let t7, t8;
|
|
642
649
|
$[9] !== open ? (t7 = () => {
|
|
643
650
|
openRef.current = open;
|
|
644
|
-
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]),
|
|
651
|
+
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
|
|
645
652
|
let t9;
|
|
646
653
|
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
647
|
-
setOpen(_temp$
|
|
654
|
+
setOpen(_temp$2), setShouldFocus(null);
|
|
648
655
|
}, $[12] = t9) : t9 = $[12];
|
|
649
656
|
const handleButtonClick = t9;
|
|
650
657
|
let t10;
|
|
@@ -700,7 +707,7 @@ function MenuButton(props) {
|
|
|
700
707
|
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
|
|
701
708
|
const registerElement = t16;
|
|
702
709
|
let t17;
|
|
703
|
-
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp &&
|
|
710
|
+
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
|
|
704
711
|
"aria-labelledby": id,
|
|
705
712
|
onBlurCapture: handleBlur,
|
|
706
713
|
onClickOutside: handleMenuClickOutside,
|
|
@@ -719,7 +726,7 @@ function MenuButton(props) {
|
|
|
719
726
|
}
|
|
720
727
|
const t192 = buttonProp.props.selected ?? open;
|
|
721
728
|
let t202;
|
|
722
|
-
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 =
|
|
729
|
+
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = cloneElement(buttonProp, {
|
|
723
730
|
"data-ui": "MenuButton",
|
|
724
731
|
id,
|
|
725
732
|
onClick: handleButtonClick,
|
|
@@ -733,7 +740,7 @@ function MenuButton(props) {
|
|
|
733
740
|
}
|
|
734
741
|
const button = t18;
|
|
735
742
|
let t19, t20;
|
|
736
|
-
$[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]),
|
|
743
|
+
$[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), useImperativeHandle(forwardedRef, t19, t20);
|
|
737
744
|
let t21, t22;
|
|
738
745
|
$[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
|
|
739
746
|
let t23;
|
|
@@ -749,17 +756,17 @@ function MenuButton(props) {
|
|
|
749
756
|
}, $[48] = deprecated_boundaryElement, $[49] = deprecated_placement, $[50] = deprecated_popoverRadius, $[51] = deprecated_popoverScheme, $[52] = deprecated_portal, $[53] = deprecated_preventOverflow, $[54] = t22, $[55] = t23) : t23 = $[55], t21 = t23;
|
|
750
757
|
const popoverProps = t21;
|
|
751
758
|
let t24;
|
|
752
|
-
$[56] !== button ? (t24 = button || /* @__PURE__ */
|
|
759
|
+
$[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
|
|
753
760
|
let t25;
|
|
754
|
-
return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */
|
|
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;
|
|
755
762
|
}
|
|
756
|
-
function _temp$
|
|
763
|
+
function _temp$2(v) {
|
|
757
764
|
return !v;
|
|
758
765
|
}
|
|
759
766
|
MenuButton.displayName = "MenuButton";
|
|
760
767
|
const DEFAULT_SKELETON_ELEMENT = "div";
|
|
761
768
|
function Skeleton(props) {
|
|
762
|
-
const $ =
|
|
769
|
+
const $ = c(17), t0 = props;
|
|
763
770
|
let className, delay, radius, rest, t1;
|
|
764
771
|
$[0] !== t0 ? ({
|
|
765
772
|
animated: t1,
|
|
@@ -768,7 +775,7 @@ function Skeleton(props) {
|
|
|
768
775
|
radius,
|
|
769
776
|
...rest
|
|
770
777
|
} = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
|
|
771
|
-
const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] =
|
|
778
|
+
const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
|
|
772
779
|
let t2, t3;
|
|
773
780
|
$[6] !== delay ? (t2 = () => {
|
|
774
781
|
if (!delay)
|
|
@@ -779,19 +786,19 @@ function Skeleton(props) {
|
|
|
779
786
|
return () => {
|
|
780
787
|
clearTimeout(timeout);
|
|
781
788
|
};
|
|
782
|
-
}, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]),
|
|
789
|
+
}, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), useEffect(t2, t3);
|
|
783
790
|
let t4;
|
|
784
|
-
$[9] !== className || $[10] !== radius ? (t4 =
|
|
791
|
+
$[9] !== className || $[10] !== radius ? (t4 = composeClassNames(className, skeleton({
|
|
785
792
|
radius
|
|
786
793
|
})), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
|
|
787
794
|
const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
|
|
788
795
|
let t7;
|
|
789
|
-
return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */
|
|
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;
|
|
790
797
|
}
|
|
791
798
|
Skeleton.displayName = "Skeleton";
|
|
792
799
|
const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
793
800
|
function CodeSkeleton(props) {
|
|
794
|
-
const $ =
|
|
801
|
+
const $ = c(10), t0 = props;
|
|
795
802
|
let className, rest, t1;
|
|
796
803
|
$[0] !== t0 ? ({
|
|
797
804
|
className,
|
|
@@ -800,16 +807,16 @@ function CodeSkeleton(props) {
|
|
|
800
807
|
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
801
808
|
const size = t1 === void 0 ? 2 : t1;
|
|
802
809
|
let t2;
|
|
803
|
-
$[4] !== className || $[5] !== size ? (t2 =
|
|
810
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, codeSkeleton({
|
|
804
811
|
size
|
|
805
812
|
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
806
813
|
let t3;
|
|
807
|
-
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */
|
|
814
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
808
815
|
}
|
|
809
816
|
CodeSkeleton.displayName = "CodeSkeleton";
|
|
810
817
|
const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
|
|
811
818
|
function HeadingSkeleton(props) {
|
|
812
|
-
const $ =
|
|
819
|
+
const $ = c(10), t0 = props;
|
|
813
820
|
let className, rest, t1;
|
|
814
821
|
$[0] !== t0 ? ({
|
|
815
822
|
className,
|
|
@@ -818,16 +825,16 @@ function HeadingSkeleton(props) {
|
|
|
818
825
|
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
819
826
|
const size = t1 === void 0 ? 2 : t1;
|
|
820
827
|
let t2;
|
|
821
|
-
$[4] !== className || $[5] !== size ? (t2 =
|
|
828
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, headingSkeleton({
|
|
822
829
|
size
|
|
823
830
|
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
824
831
|
let t3;
|
|
825
|
-
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */
|
|
832
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
826
833
|
}
|
|
827
834
|
HeadingSkeleton.displayName = "HeadingSkeleton";
|
|
828
835
|
const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
|
|
829
836
|
function LabelSkeleton(props) {
|
|
830
|
-
const $ =
|
|
837
|
+
const $ = c(10), t0 = props;
|
|
831
838
|
let className, rest, t1;
|
|
832
839
|
$[0] !== t0 ? ({
|
|
833
840
|
className,
|
|
@@ -836,16 +843,16 @@ function LabelSkeleton(props) {
|
|
|
836
843
|
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
837
844
|
const size = t1 === void 0 ? 2 : t1;
|
|
838
845
|
let t2;
|
|
839
|
-
$[4] !== className || $[5] !== size ? (t2 =
|
|
846
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, labelSkeleton({
|
|
840
847
|
size
|
|
841
848
|
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
842
849
|
let t3;
|
|
843
|
-
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */
|
|
850
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
844
851
|
}
|
|
845
852
|
LabelSkeleton.displayName = "LabelSkeleton";
|
|
846
853
|
const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
|
|
847
854
|
function TextSkeleton(props) {
|
|
848
|
-
const $ =
|
|
855
|
+
const $ = c(10), t0 = props;
|
|
849
856
|
let className, rest, t1;
|
|
850
857
|
$[0] !== t0 ? ({
|
|
851
858
|
className,
|
|
@@ -854,16 +861,16 @@ function TextSkeleton(props) {
|
|
|
854
861
|
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
855
862
|
const size = t1 === void 0 ? 2 : t1;
|
|
856
863
|
let t2;
|
|
857
|
-
$[4] !== className || $[5] !== size ? (t2 =
|
|
864
|
+
$[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, textSkeleton({
|
|
858
865
|
size
|
|
859
866
|
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
860
867
|
let t3;
|
|
861
|
-
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */
|
|
868
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
862
869
|
}
|
|
863
870
|
TextSkeleton.displayName = "TextSkeleton";
|
|
864
871
|
const DEFAULT_TAB_PANEL_ELEMENT = "div";
|
|
865
872
|
function TabPanel(props) {
|
|
866
|
-
const $ =
|
|
873
|
+
const $ = c(8), t0 = props;
|
|
867
874
|
let rest, t1;
|
|
868
875
|
$[0] !== t0 ? ({
|
|
869
876
|
as: t1,
|
|
@@ -871,7 +878,7 @@ function TabPanel(props) {
|
|
|
871
878
|
} = t0, $[0] = t0, $[1] = rest, $[2] = t1) : (rest = $[1], t1 = $[2]);
|
|
872
879
|
const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = props.tabIndex === void 0 ? 0 : props.tabIndex;
|
|
873
880
|
let t3;
|
|
874
|
-
return $[3] !== as || $[4] !== props.children || $[5] !== rest || $[6] !== t2 ? (t3 = /* @__PURE__ */
|
|
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;
|
|
875
882
|
}
|
|
876
883
|
TabPanel.displayName = "TabPanel";
|
|
877
884
|
const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
|
|
@@ -891,7 +898,7 @@ const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
|
|
|
891
898
|
info: "neutral"
|
|
892
899
|
}, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
|
|
893
900
|
function Toast(props) {
|
|
894
|
-
const $ =
|
|
901
|
+
const $ = c(53), t0 = props;
|
|
895
902
|
let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
|
|
896
903
|
$[0] !== t0 ? ({
|
|
897
904
|
as: t1,
|
|
@@ -905,7 +912,7 @@ function Toast(props) {
|
|
|
905
912
|
updatedAt,
|
|
906
913
|
...rest
|
|
907
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]);
|
|
908
|
-
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 =
|
|
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;
|
|
909
916
|
let t3;
|
|
910
917
|
$[11] !== visualDuration ? (t3 = visualDuration ? {
|
|
911
918
|
type: "spring",
|
|
@@ -925,30 +932,30 @@ function Toast(props) {
|
|
|
925
932
|
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
|
|
926
933
|
const exit = t6;
|
|
927
934
|
let t7;
|
|
928
|
-
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 =
|
|
935
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = toast(), $[16] = t7) : t7 = $[16];
|
|
929
936
|
const t8 = hasDuration ? "" : void 0;
|
|
930
937
|
let t9;
|
|
931
|
-
$[17] !== title ? (t9 = title && /* @__PURE__ */
|
|
938
|
+
$[17] !== title ? (t9 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
|
|
932
939
|
let t10;
|
|
933
|
-
$[19] !== description || $[20] !== transition ? (t10 = description && /* @__PURE__ */
|
|
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];
|
|
934
941
|
let t11;
|
|
935
|
-
$[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */
|
|
942
|
+
$[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
|
|
936
943
|
t9,
|
|
937
944
|
t10
|
|
938
945
|
] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
|
|
939
946
|
let t12;
|
|
940
|
-
$[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t12 = closable && /* @__PURE__ */
|
|
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: {
|
|
941
948
|
verticalAlign: "top"
|
|
942
949
|
} }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
|
|
943
950
|
let t13;
|
|
944
|
-
$[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */
|
|
951
|
+
$[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
|
|
945
952
|
t11,
|
|
946
953
|
t12
|
|
947
954
|
] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
|
|
948
955
|
let t14;
|
|
949
|
-
$[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t14 = hasDuration && /* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
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: [
|
|
957
|
+
/* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
|
|
958
|
+
/* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
|
|
952
959
|
scaleX: 0
|
|
953
960
|
}, animate: {
|
|
954
961
|
scaleX: 1
|
|
@@ -959,7 +966,7 @@ function Toast(props) {
|
|
|
959
966
|
}, onAnimationComplete: onClose }, `progress-${updatedAt}`)
|
|
960
967
|
] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
|
|
961
968
|
let t15;
|
|
962
|
-
return $[42] !== as || $[43] !== cardTone || $[44] !== radius || $[45] !== rest || $[46] !== role || $[47] !== t13 || $[48] !== t14 || $[49] !== t8 || $[50] !== transition || $[51] !== visualDuration ? (t15 = /* @__PURE__ */
|
|
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: [
|
|
963
970
|
t13,
|
|
964
971
|
t14
|
|
965
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;
|
|
@@ -1002,20 +1009,20 @@ const container = {
|
|
|
1002
1009
|
visible: {
|
|
1003
1010
|
opacity: 1
|
|
1004
1011
|
}
|
|
1005
|
-
}, MotionCard =
|
|
1012
|
+
}, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
|
|
1006
1013
|
function useMounted() {
|
|
1007
|
-
return
|
|
1014
|
+
return useSyncExternalStore(subscribe, _temp$1, _temp2);
|
|
1008
1015
|
}
|
|
1009
|
-
function _temp2
|
|
1016
|
+
function _temp2() {
|
|
1010
1017
|
return !1;
|
|
1011
1018
|
}
|
|
1012
|
-
function _temp$
|
|
1019
|
+
function _temp$1() {
|
|
1013
1020
|
return !0;
|
|
1014
1021
|
}
|
|
1015
1022
|
const subscribe = () => () => {
|
|
1016
|
-
}, ToastContext =
|
|
1023
|
+
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
|
|
1017
1024
|
function ToastLayer(props) {
|
|
1018
|
-
const $ =
|
|
1025
|
+
const $ = c(11), {
|
|
1019
1026
|
as: t0,
|
|
1020
1027
|
children,
|
|
1021
1028
|
padding: t1,
|
|
@@ -1024,15 +1031,15 @@ function ToastLayer(props) {
|
|
|
1024
1031
|
gap: t2
|
|
1025
1032
|
} = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
|
|
1026
1033
|
zIndex
|
|
1027
|
-
} =
|
|
1034
|
+
} = useLayer();
|
|
1028
1035
|
let t3;
|
|
1029
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 =
|
|
1036
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
|
|
1030
1037
|
let t4;
|
|
1031
1038
|
$[1] !== zIndex ? (t4 = {
|
|
1032
1039
|
zIndex
|
|
1033
1040
|
}, $[1] = zIndex, $[2] = t4) : t4 = $[2];
|
|
1034
1041
|
let t5;
|
|
1035
|
-
return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */
|
|
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;
|
|
1036
1043
|
}
|
|
1037
1044
|
ToastLayer.displayName = "ToastLayer";
|
|
1038
1045
|
let toastId = 0;
|
|
@@ -1040,7 +1047,7 @@ function generateToastId() {
|
|
|
1040
1047
|
return String(toastId++);
|
|
1041
1048
|
}
|
|
1042
1049
|
function ToastProvider(props) {
|
|
1043
|
-
const $ =
|
|
1050
|
+
const $ = c(13), {
|
|
1044
1051
|
children,
|
|
1045
1052
|
padding,
|
|
1046
1053
|
paddingX,
|
|
@@ -1050,17 +1057,17 @@ function ToastProvider(props) {
|
|
|
1050
1057
|
} = props, zOffset = t0 === void 0 ? 1 : t0;
|
|
1051
1058
|
let t1;
|
|
1052
1059
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
1053
|
-
const [state, setState] =
|
|
1060
|
+
const [state, setState] = useState(t1), mounted = useMounted();
|
|
1054
1061
|
let t2, t3;
|
|
1055
1062
|
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1056
1063
|
version: 0,
|
|
1057
1064
|
push: (params) => {
|
|
1058
1065
|
const id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
1059
|
-
return
|
|
1066
|
+
return startTransition(() => {
|
|
1060
1067
|
setState((prevState) => {
|
|
1061
1068
|
if (duration === 0.01)
|
|
1062
|
-
return prevState.filter((
|
|
1063
|
-
const dismiss = () =>
|
|
1069
|
+
return prevState.filter((toast2) => toast2.id !== id);
|
|
1070
|
+
const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
|
|
1064
1071
|
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
1065
1072
|
dismiss,
|
|
1066
1073
|
id,
|
|
@@ -1076,28 +1083,28 @@ function ToastProvider(props) {
|
|
|
1076
1083
|
}, $[1] = t3) : t3 = $[1], t2 = t3;
|
|
1077
1084
|
const value = t2;
|
|
1078
1085
|
let t4;
|
|
1079
|
-
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */
|
|
1086
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
|
|
1080
1087
|
let t5;
|
|
1081
|
-
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */
|
|
1088
|
+
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
1082
1089
|
children,
|
|
1083
1090
|
t4
|
|
1084
1091
|
] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
|
|
1085
1092
|
}
|
|
1086
|
-
function _temp
|
|
1093
|
+
function _temp(t0) {
|
|
1087
1094
|
const {
|
|
1088
1095
|
dismiss: dismiss_0,
|
|
1089
1096
|
id: id_0,
|
|
1090
1097
|
params: params_0,
|
|
1091
1098
|
updatedAt
|
|
1092
1099
|
} = t0;
|
|
1093
|
-
return /* @__PURE__ */
|
|
1100
|
+
return /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
|
|
1094
1101
|
}
|
|
1095
1102
|
ToastProvider.displayName = "ToastProvider";
|
|
1096
1103
|
function useToast() {
|
|
1097
|
-
const value =
|
|
1104
|
+
const value = useContext(ToastContext);
|
|
1098
1105
|
if (!value)
|
|
1099
1106
|
throw new Error("useToast(): missing context value");
|
|
1100
|
-
if (!
|
|
1107
|
+
if (!isRecord(value) || value.version !== 0)
|
|
1101
1108
|
throw new Error("useToast(): the context value is not compatible");
|
|
1102
1109
|
return value;
|
|
1103
1110
|
}
|
|
@@ -1155,9 +1162,9 @@ function _focusItemElement(el) {
|
|
|
1155
1162
|
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
1156
1163
|
}
|
|
1157
1164
|
}
|
|
1158
|
-
const TreeContext =
|
|
1165
|
+
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
|
|
1159
1166
|
function Tree(props) {
|
|
1160
|
-
const $ =
|
|
1167
|
+
const $ = c(39), t0 = props;
|
|
1161
1168
|
let children, forwardedRef, gap, onFocus, rest, t1;
|
|
1162
1169
|
$[0] !== t0 ? ({
|
|
1163
1170
|
children,
|
|
@@ -1167,26 +1174,26 @@ function Tree(props) {
|
|
|
1167
1174
|
ref: forwardedRef,
|
|
1168
1175
|
...rest
|
|
1169
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]);
|
|
1170
|
-
const space = t1 === void 0 ? 1 : t1, ref =
|
|
1177
|
+
const space = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
|
|
1171
1178
|
let t2, t3;
|
|
1172
1179
|
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
|
|
1173
1180
|
const path = t2;
|
|
1174
1181
|
let t4;
|
|
1175
1182
|
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
|
|
1176
|
-
const [itemElements, setItemElements] =
|
|
1183
|
+
const [itemElements, setItemElements] = useState(t4);
|
|
1177
1184
|
let t5;
|
|
1178
1185
|
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
|
|
1179
|
-
const [state, setState] =
|
|
1186
|
+
const [state, setState] = useState(t5), stateRef = useRef(state);
|
|
1180
1187
|
let t6;
|
|
1181
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10],
|
|
1188
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], useImperativeHandle(forwardedRef, t6);
|
|
1182
1189
|
let t7, t8;
|
|
1183
1190
|
$[11] !== focusedElement ? (t7 = () => {
|
|
1184
1191
|
focusedElementRef.current = focusedElement;
|
|
1185
|
-
}, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]),
|
|
1192
|
+
}, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
|
|
1186
1193
|
let t10, t9;
|
|
1187
1194
|
$[14] !== state ? (t9 = () => {
|
|
1188
1195
|
stateRef.current = state;
|
|
1189
|
-
}, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]),
|
|
1196
|
+
}, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), useEffect(t9, t10);
|
|
1190
1197
|
let t11;
|
|
1191
1198
|
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
1192
1199
|
...s,
|
|
@@ -1307,22 +1314,22 @@ function Tree(props) {
|
|
|
1307
1314
|
setItemElements(_itemElements);
|
|
1308
1315
|
}, $[27] = t18) : t18 = $[27];
|
|
1309
1316
|
let t19;
|
|
1310
|
-
$[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29],
|
|
1317
|
+
$[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], useEffect(t18, t19);
|
|
1311
1318
|
const t20 = gap ?? space;
|
|
1312
1319
|
let t21;
|
|
1313
|
-
$[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */
|
|
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];
|
|
1314
1321
|
let t22;
|
|
1315
|
-
return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */
|
|
1322
|
+
return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
|
|
1316
1323
|
}
|
|
1317
1324
|
Tree.displayName = "Tree";
|
|
1318
1325
|
function useTree() {
|
|
1319
|
-
const tree =
|
|
1326
|
+
const tree = useContext(TreeContext);
|
|
1320
1327
|
if (!tree)
|
|
1321
1328
|
throw new Error("Tree: missing context value");
|
|
1322
1329
|
return tree;
|
|
1323
1330
|
}
|
|
1324
|
-
const TreeGroup =
|
|
1325
|
-
const $ =
|
|
1331
|
+
const TreeGroup = memo(function(props) {
|
|
1332
|
+
const $ = c(9), t0 = props;
|
|
1326
1333
|
let children, rest, t1;
|
|
1327
1334
|
$[0] !== t0 ? ({
|
|
1328
1335
|
children,
|
|
@@ -1331,7 +1338,7 @@ const TreeGroup = react.memo(function(props) {
|
|
|
1331
1338
|
} = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
|
|
1332
1339
|
const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
|
|
1333
1340
|
let t3;
|
|
1334
|
-
return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */
|
|
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;
|
|
1335
1342
|
});
|
|
1336
1343
|
TreeGroup.displayName = "TreeGroup";
|
|
1337
1344
|
const DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
@@ -1354,287 +1361,245 @@ function TreeItem(props) {
|
|
|
1354
1361
|
text,
|
|
1355
1362
|
weight,
|
|
1356
1363
|
...rest
|
|
1357
|
-
} = props, rootRef =
|
|
1364
|
+
} = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
1358
1365
|
path,
|
|
1359
1366
|
registerItem,
|
|
1360
1367
|
setExpanded,
|
|
1361
1368
|
setFocusedElement
|
|
1362
|
-
} = tree, _id =
|
|
1369
|
+
} = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
|
|
1363
1370
|
...tree,
|
|
1364
1371
|
level: tree.level + 1,
|
|
1365
1372
|
path: itemPath
|
|
1366
|
-
}), [itemPath, tree]), handleClick =
|
|
1373
|
+
}), [itemPath, tree]), handleClick = useCallback((event) => {
|
|
1367
1374
|
onClick && onClick(event);
|
|
1368
1375
|
const target = event.target;
|
|
1369
1376
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
|
|
1370
|
-
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown =
|
|
1377
|
+
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
|
|
1371
1378
|
focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
|
|
1372
1379
|
}, [focused]);
|
|
1373
|
-
|
|
1380
|
+
useEffect(() => {
|
|
1374
1381
|
if (rootRef.current)
|
|
1375
1382
|
return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
|
|
1376
1383
|
}, [expanded, itemPath, registerItem, selected]);
|
|
1377
|
-
const content2 = /* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1384
|
+
const content2 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
|
|
1385
|
+
/* @__PURE__ */ jsxs(Box, { style: {
|
|
1379
1386
|
visibility: IconComponent || children ? "visible" : "hidden",
|
|
1380
1387
|
pointerEvents: "none"
|
|
1381
1388
|
}, children: [
|
|
1382
|
-
IconComponent && /* @__PURE__ */
|
|
1383
|
-
!IconComponent && /* @__PURE__ */
|
|
1389
|
+
IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
|
|
1390
|
+
!IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
|
|
1384
1391
|
transform: expanded ? "rotate(90deg)" : void 0
|
|
1385
1392
|
} }) })
|
|
1386
1393
|
] }),
|
|
1387
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
|
|
1388
1395
|
] });
|
|
1389
|
-
return href ? /* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
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: [
|
|
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: {
|
|
1391
1398
|
paddingLeft: `calc(var(--space-2) * ${tree.level})`
|
|
1392
1399
|
}, children: content2 }),
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
] }) : /* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
|
|
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: [
|
|
1402
|
+
/* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
|
|
1396
1403
|
paddingLeft: `calc(var(--space-2) * ${tree.level})`
|
|
1397
1404
|
}, children: content2 }),
|
|
1398
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
|
|
1399
1406
|
] });
|
|
1400
1407
|
}
|
|
1401
1408
|
TreeItem.displayName = "TreeItem";
|
|
1402
|
-
function RootClassNames(props) {
|
|
1403
|
-
const $ = reactCompilerRuntime.c(7), {
|
|
1404
|
-
element
|
|
1405
|
-
} = props, {
|
|
1406
|
-
scheme,
|
|
1407
|
-
tone
|
|
1408
|
-
} = _visualEditing.useCard() ?? {};
|
|
1409
|
-
let t0;
|
|
1410
|
-
$[0] !== scheme || $[1] !== tone ? (t0 = () => {
|
|
1411
|
-
const els = document.querySelectorAll([css.scopeClassName("button"), css.scopeClassName("card"), css.scopeClassName("font")].map(_temp).join(", "));
|
|
1412
|
-
for (const el of els)
|
|
1413
|
-
el instanceof HTMLElement && (el.style.transition = "none");
|
|
1414
|
-
return _raf2(() => {
|
|
1415
|
-
document.documentElement.className = css.card({
|
|
1416
|
-
scheme,
|
|
1417
|
-
tone
|
|
1418
|
-
}) ?? "", _raf2(() => {
|
|
1419
|
-
for (const el_0 of els)
|
|
1420
|
-
el_0 instanceof HTMLElement && (el_0.style.transition = "");
|
|
1421
|
-
});
|
|
1422
|
-
}), _temp2;
|
|
1423
|
-
}, $[0] = scheme, $[1] = tone, $[2] = t0) : t0 = $[2];
|
|
1424
|
-
let t1;
|
|
1425
|
-
return $[3] !== element || $[4] !== scheme || $[5] !== tone ? (t1 = [element, scheme, tone], $[3] = element, $[4] = scheme, $[5] = tone, $[6] = t1) : t1 = $[6], react.useEffect(t0, t1), null;
|
|
1426
|
-
}
|
|
1427
|
-
function _temp2() {
|
|
1428
|
-
document.documentElement.className = "";
|
|
1429
|
-
}
|
|
1430
|
-
function _temp(n) {
|
|
1431
|
-
return `.${n}`;
|
|
1432
|
-
}
|
|
1433
|
-
RootClassNames.displayName = "RootClassNames";
|
|
1434
1409
|
function StyleTags(props) {
|
|
1435
|
-
const $ =
|
|
1410
|
+
const $ = c(10), {
|
|
1436
1411
|
theme: themeProp
|
|
1437
1412
|
} = props;
|
|
1438
1413
|
let t0;
|
|
1439
|
-
$[0] !== themeProp ? (t0 = themeProp ??
|
|
1440
|
-
const theme
|
|
1414
|
+
$[0] !== themeProp ? (t0 = themeProp ?? buildTheme_v3(), $[0] = themeProp, $[1] = t0) : t0 = $[1];
|
|
1415
|
+
const theme = t0;
|
|
1441
1416
|
let t1;
|
|
1442
|
-
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */
|
|
1417
|
+
$[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsx("style", { href: "sanity-palette", precedence: "palette", children: _compilePalette() }), $[2] = t1) : t1 = $[2];
|
|
1443
1418
|
let t2;
|
|
1444
|
-
$[3] !== theme
|
|
1445
|
-
v3: theme
|
|
1446
|
-
}), $[3] = theme
|
|
1419
|
+
$[3] !== theme ? (t2 = _compileTheme({
|
|
1420
|
+
v3: theme
|
|
1421
|
+
}), $[3] = theme, $[4] = t2) : t2 = $[4];
|
|
1447
1422
|
let t3;
|
|
1448
|
-
$[5] !== t2 ? (t3 = /* @__PURE__ */
|
|
1423
|
+
$[5] !== t2 ? (t3 = /* @__PURE__ */ jsx("style", { href: "sanity-theme", precedence: "theme", children: t2 }), $[5] = t2, $[6] = t3) : t3 = $[6];
|
|
1449
1424
|
let t4;
|
|
1450
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */
|
|
1425
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */ jsx("style", { href: "sanity-system", precedence: "system", children: _compileSystem() }), $[7] = t4) : t4 = $[7];
|
|
1451
1426
|
let t5;
|
|
1452
|
-
return $[8] !== t3 ? (t5 = /* @__PURE__ */
|
|
1427
|
+
return $[8] !== t3 ? (t5 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1453
1428
|
t1,
|
|
1454
1429
|
t3,
|
|
1455
1430
|
t4
|
|
1456
1431
|
] }), $[8] = t3, $[9] = t5) : t5 = $[9], t5;
|
|
1457
1432
|
}
|
|
1458
1433
|
StyleTags.displayName = "StyleTags";
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
exports.rgbToHex = rgbToHex;
|
|
1631
|
-
exports.rgbToHsl = rgbToHsl;
|
|
1632
|
-
exports.rgba = rgba;
|
|
1633
|
-
exports.screen = screen;
|
|
1634
|
-
exports.useClickOutside = useClickOutside;
|
|
1635
|
-
exports.useDialog = useDialog;
|
|
1636
|
-
exports.useElementRect = useElementRect;
|
|
1637
|
-
exports.useForwardedRef = useForwardedRef;
|
|
1638
|
-
exports.useToast = useToast;
|
|
1639
|
-
exports.useTree = useTree;
|
|
1434
|
+
export {
|
|
1435
|
+
Arrow,
|
|
1436
|
+
Autocomplete,
|
|
1437
|
+
Avatar,
|
|
1438
|
+
AvatarCounter,
|
|
1439
|
+
AvatarStack,
|
|
1440
|
+
Badge,
|
|
1441
|
+
BoundaryElementProvider,
|
|
1442
|
+
Box,
|
|
1443
|
+
Breadcrumbs,
|
|
1444
|
+
Button,
|
|
1445
|
+
Card,
|
|
1446
|
+
CardProvider,
|
|
1447
|
+
Checkbox,
|
|
1448
|
+
Code,
|
|
1449
|
+
CodeSkeleton,
|
|
1450
|
+
Container,
|
|
1451
|
+
DEFAULT_ARROW_ELEMENT,
|
|
1452
|
+
DEFAULT_AUTOCOMPLETE_ELEMENT,
|
|
1453
|
+
DEFAULT_AVATAR_COUNTER_ELEMENT,
|
|
1454
|
+
DEFAULT_AVATAR_ELEMENT,
|
|
1455
|
+
DEFAULT_AVATAR_STACK_ELEMENT,
|
|
1456
|
+
DEFAULT_BADGE_ELEMENT,
|
|
1457
|
+
DEFAULT_BOX_ELEMENT,
|
|
1458
|
+
DEFAULT_BREADCRUMBS_ELEMENT,
|
|
1459
|
+
DEFAULT_BUTTON_ELEMENT,
|
|
1460
|
+
DEFAULT_CARD_ELEMENT,
|
|
1461
|
+
DEFAULT_CHECKBOX_ELEMENT,
|
|
1462
|
+
DEFAULT_CODE_ELEMENT,
|
|
1463
|
+
DEFAULT_CODE_SKELETON_ELEMENT,
|
|
1464
|
+
DEFAULT_CONTAINER_ELEMENT,
|
|
1465
|
+
DEFAULT_DIALOG_ELEMENT,
|
|
1466
|
+
DEFAULT_ELEMENT_QUERY_ELEMENT,
|
|
1467
|
+
DEFAULT_FLEX_ELEMENT,
|
|
1468
|
+
DEFAULT_GRID_ELEMENT,
|
|
1469
|
+
DEFAULT_HEADING_ELEMENT,
|
|
1470
|
+
DEFAULT_HEADING_SKELETON_ELEMENT,
|
|
1471
|
+
DEFAULT_HOTKEYS_ELEMENT,
|
|
1472
|
+
DEFAULT_INLINE_ELEMENT,
|
|
1473
|
+
DEFAULT_KBD_ELEMENT,
|
|
1474
|
+
DEFAULT_LABEL_ELEMENT,
|
|
1475
|
+
DEFAULT_LABEL_SKELETON_ELEMENT,
|
|
1476
|
+
DEFAULT_LAYER_ELEMENT,
|
|
1477
|
+
DEFAULT_MENU_DIVIDER_ELEMENT,
|
|
1478
|
+
DEFAULT_MENU_ELEMENT,
|
|
1479
|
+
DEFAULT_MENU_GROUP_ELEMENT,
|
|
1480
|
+
DEFAULT_MENU_ITEM_ELEMENT,
|
|
1481
|
+
DEFAULT_POPOVER_ELEMENT,
|
|
1482
|
+
DEFAULT_RADIO_ELEMENT,
|
|
1483
|
+
DEFAULT_SELECT_ELEMENT,
|
|
1484
|
+
DEFAULT_SKELETON_ELEMENT,
|
|
1485
|
+
DEFAULT_SPINNER_ELEMENT,
|
|
1486
|
+
DEFAULT_SR_ONLY_ELEMENT,
|
|
1487
|
+
DEFAULT_STACK_ELEMENT,
|
|
1488
|
+
DEFAULT_SWITCH_ELEMENT,
|
|
1489
|
+
DEFAULT_TAB_ELEMENT,
|
|
1490
|
+
DEFAULT_TAB_LIST_ELEMENT,
|
|
1491
|
+
DEFAULT_TAB_PANEL_ELEMENT,
|
|
1492
|
+
DEFAULT_TEXT_AREA_ELEMENT,
|
|
1493
|
+
DEFAULT_TEXT_ELEMENT,
|
|
1494
|
+
DEFAULT_TEXT_INPUT_ELEMENT,
|
|
1495
|
+
DEFAULT_TEXT_SKELETON_ELEMENT,
|
|
1496
|
+
DEFAULT_TOAST_ELEMENT,
|
|
1497
|
+
DEFAULT_TOOLTIP_ELEMENT,
|
|
1498
|
+
DEFAULT_TREE_ELEMENT,
|
|
1499
|
+
DEFAULT_TREE_ITEM_ELEMENT,
|
|
1500
|
+
DEFAULT_VIRTUAL_LIST_ELEMENT,
|
|
1501
|
+
Dialog,
|
|
1502
|
+
DialogContext,
|
|
1503
|
+
DialogProvider,
|
|
1504
|
+
ElementQuery,
|
|
1505
|
+
ErrorBoundary,
|
|
1506
|
+
Flex,
|
|
1507
|
+
Grid,
|
|
1508
|
+
Heading,
|
|
1509
|
+
HeadingSkeleton,
|
|
1510
|
+
Hotkeys,
|
|
1511
|
+
Inline,
|
|
1512
|
+
KBD,
|
|
1513
|
+
Label,
|
|
1514
|
+
LabelSkeleton,
|
|
1515
|
+
Layer,
|
|
1516
|
+
LayerProvider,
|
|
1517
|
+
Menu,
|
|
1518
|
+
MenuButton,
|
|
1519
|
+
MenuDivider,
|
|
1520
|
+
MenuGroup,
|
|
1521
|
+
MenuItem,
|
|
1522
|
+
Popover,
|
|
1523
|
+
Portal,
|
|
1524
|
+
PortalProvider,
|
|
1525
|
+
Radio,
|
|
1526
|
+
Select,
|
|
1527
|
+
Skeleton,
|
|
1528
|
+
Spinner,
|
|
1529
|
+
SrOnly,
|
|
1530
|
+
Stack,
|
|
1531
|
+
StyleTags,
|
|
1532
|
+
Switch,
|
|
1533
|
+
Tab,
|
|
1534
|
+
TabList,
|
|
1535
|
+
TabPanel,
|
|
1536
|
+
Text,
|
|
1537
|
+
TextArea,
|
|
1538
|
+
TextInput,
|
|
1539
|
+
TextSkeleton,
|
|
1540
|
+
ThemeColorProvider,
|
|
1541
|
+
ThemeProvider,
|
|
1542
|
+
Toast,
|
|
1543
|
+
ToastProvider,
|
|
1544
|
+
Tooltip,
|
|
1545
|
+
TooltipDelayGroupContext,
|
|
1546
|
+
TooltipDelayGroupProvider,
|
|
1547
|
+
Tree,
|
|
1548
|
+
TreeItem,
|
|
1549
|
+
VirtualList,
|
|
1550
|
+
_ResizeObserver,
|
|
1551
|
+
_elementSizeObserver,
|
|
1552
|
+
_getArrayProp,
|
|
1553
|
+
_hasFocus,
|
|
1554
|
+
_isEnterToClickElement,
|
|
1555
|
+
_isScrollable,
|
|
1556
|
+
_raf,
|
|
1557
|
+
_raf2,
|
|
1558
|
+
_responsive,
|
|
1559
|
+
attemptFocus,
|
|
1560
|
+
containsOrEqualsElement,
|
|
1561
|
+
createColorTheme,
|
|
1562
|
+
focusFirstDescendant,
|
|
1563
|
+
focusLastDescendant,
|
|
1564
|
+
hexToRgb,
|
|
1565
|
+
hslToRgb,
|
|
1566
|
+
isFocusable,
|
|
1567
|
+
isHTMLAnchorElement,
|
|
1568
|
+
isHTMLButtonElement,
|
|
1569
|
+
isHTMLElement,
|
|
1570
|
+
isHTMLInputElement,
|
|
1571
|
+
isHTMLSelectElement,
|
|
1572
|
+
isHTMLTextAreaElement,
|
|
1573
|
+
multiply,
|
|
1574
|
+
parseColor,
|
|
1575
|
+
px,
|
|
1576
|
+
rem,
|
|
1577
|
+
rgbToHex,
|
|
1578
|
+
rgbToHsl,
|
|
1579
|
+
rgba,
|
|
1580
|
+
screen,
|
|
1581
|
+
useArrayProp,
|
|
1582
|
+
useBoundaryElement,
|
|
1583
|
+
useCard,
|
|
1584
|
+
useClickOutside,
|
|
1585
|
+
useClickOutsideEvent,
|
|
1586
|
+
useCustomValidity,
|
|
1587
|
+
useDialog,
|
|
1588
|
+
useElementRect,
|
|
1589
|
+
useElementSize,
|
|
1590
|
+
useForwardedRef,
|
|
1591
|
+
useGlobalKeyDown,
|
|
1592
|
+
useLayer,
|
|
1593
|
+
useMatchMedia,
|
|
1594
|
+
useMediaIndex,
|
|
1595
|
+
usePortal,
|
|
1596
|
+
usePrefersDark,
|
|
1597
|
+
usePrefersReducedMotion,
|
|
1598
|
+
useRootTheme,
|
|
1599
|
+
useTheme,
|
|
1600
|
+
useTheme_v2,
|
|
1601
|
+
useToast,
|
|
1602
|
+
useTooltipDelayGroup,
|
|
1603
|
+
useTree
|
|
1604
|
+
};
|
|
1640
1605
|
//# sourceMappingURL=index.js.map
|