@sanity/ui 3.0.0-static.2 → 3.0.0-static.20
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.cjs +3152 -0
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/buildCommand.cjs +71 -0
- 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.js +3163 -0
- 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.cts +959 -0
- package/dist/_visual-editing.d.ts +545 -392
- 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.cjs +4353 -0
- package/dist/css.cjs.map +1 -0
- package/dist/css.d.cts +10251 -0
- package/dist/css.d.ts +9714 -1598
- package/dist/css.js +3460 -3818
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +1594 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +1435 -918
- package/dist/index.d.ts +1435 -918
- package/dist/index.js +622 -572
- package/dist/index.js.map +1 -1
- package/dist/{theme.mjs → theme.cjs} +2821 -2570
- package/dist/theme.cjs.map +1 -0
- package/dist/{theme.d.mts → theme.d.cts} +330 -310
- package/dist/theme.d.ts +330 -310
- package/dist/theme.js +2822 -2569
- package/dist/theme.js.map +1 -1
- package/dist/ui-system.css +24528 -0
- package/dist/ui-system.min.css +1 -0
- package/dist/ui-theme.css +1184 -0
- package/dist/ui-theme.min.css +1 -0
- package/dist/ui.css +25715 -0
- package/dist/ui.min.css +1 -0
- package/exports/_visual-editing.ts +0 -1
- package/package.json +78 -78
- package/src/cli/buildCommand.ts +77 -25
- package/src/cli/index.ts +2 -14
- package/src/core/StyleTags.tsx +8 -14
- package/src/core/_compat/helpers.ts +72 -0
- package/src/core/_compat/index.ts +1 -6
- package/src/core/_compat/styles/_responsive.ts +1 -1
- package/src/core/_compat/theme/theme.test.tsx +4 -5
- package/src/core/_compat/theme/themeColorProvider.tsx +4 -8
- package/src/core/_compat/theme/themeContext.ts +5 -5
- package/src/core/_compat/theme/themeProvider.tsx +19 -11
- package/src/core/_compat/theme/types.ts +2 -4
- package/src/core/_compat/theme/useRootTheme.ts +2 -4
- package/src/core/_compat/theme/useTheme.ts +3 -7
- package/src/core/_compat/types.ts +0 -73
- package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
- package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
- package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
- package/src/core/components/autocomplete/autocomplete.tsx +92 -126
- package/src/core/components/autocomplete/autocompleteOption.tsx +3 -1
- package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
- package/src/core/components/autocomplete/constants.ts +1 -1
- package/src/core/components/autocomplete/types.ts +4 -9
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +34 -28
- package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
- package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
- package/src/core/components/dialog/__workshop__/position.tsx +4 -4
- package/src/core/components/dialog/__workshop__/props.tsx +7 -7
- package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
- package/src/core/components/dialog/dialog.tsx +104 -300
- package/src/core/components/dialog/dialogCard.tsx +198 -0
- package/src/core/components/dialog/dialogContext.ts +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +3 -3
- package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/core/components/dialog/useDialog.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +42 -26
- package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
- package/src/core/components/menu/__workshop__/groups.tsx +2 -2
- package/src/core/components/menu/__workshop__/menuButton.tsx +4 -4
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
- package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
- package/src/core/components/menu/__workshop__/tones.tsx +3 -3
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
- package/src/core/components/menu/menu.test.tsx +6 -7
- package/src/core/components/menu/menu.tsx +28 -34
- package/src/core/components/menu/menuButton.tsx +19 -23
- package/src/core/components/menu/menuContext.ts +1 -1
- package/src/core/components/menu/menuDivider.tsx +26 -14
- package/src/core/components/menu/menuGroup.tsx +39 -31
- package/src/core/components/menu/menuItem.tsx +59 -45
- package/src/core/components/menu/useMenu.ts +1 -1
- package/src/core/components/menu/useMenuController.ts +4 -4
- package/src/core/components/skeleton/__workshop__/delay.tsx +3 -3
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
- package/src/core/components/skeleton/codeSkeleton.tsx +53 -0
- package/src/core/components/skeleton/headingSkeleton.tsx +52 -0
- package/src/core/components/skeleton/index.ts +3 -0
- package/src/core/components/skeleton/labelSkeleton.tsx +51 -0
- package/src/core/components/skeleton/skeleton.tsx +40 -17
- package/src/core/components/skeleton/textSkeleton.tsx +32 -111
- package/src/core/components/tab/__workshop__/example.tsx +2 -2
- package/src/core/components/tab/tab.tsx +29 -25
- package/src/core/components/tab/tabList.tsx +51 -28
- package/src/core/components/tab/tabPanel.tsx +30 -21
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/__workshop__/toast.tsx +5 -5
- package/src/core/components/toast/toast.test.tsx +5 -5
- package/src/core/components/toast/toast.tsx +25 -22
- package/src/core/components/toast/toastContext.ts +1 -1
- package/src/core/components/toast/toastLayer.tsx +29 -11
- package/src/core/components/toast/toastProvider.tsx +3 -7
- package/src/core/components/toast/types.ts +3 -7
- package/src/core/components/toast/useToast.ts +2 -4
- package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
- package/src/core/components/tree/__workshop__/basic.tsx +1 -1
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
- package/src/core/components/tree/helpers.ts +1 -1
- package/src/core/components/tree/tree.tsx +198 -191
- package/src/core/components/tree/treeContext.ts +1 -1
- package/src/core/components/tree/treeGroup.tsx +26 -6
- package/src/core/components/tree/treeItem.tsx +45 -33
- package/src/core/components/tree/types.ts +2 -2
- package/src/core/components/tree/useTree.ts +1 -1
- package/src/core/constants.ts +6 -0
- package/src/core/hooks/useClickOutside.test.tsx +15 -16
- package/src/core/hooks/useClickOutside.ts +2 -6
- package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
- package/src/core/hooks/useClickOutsideEvent.ts +3 -9
- package/src/core/hooks/useDelayed.test.ts +6 -7
- package/src/core/hooks/useDelayedState.ts +1 -1
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
- package/src/core/hooks/useElementSize.ts +1 -1
- package/src/core/hooks/useForwardedRef.ts +1 -1
- package/src/core/hooks/useMatchMedia.ts +13 -31
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -18
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +12 -12
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
- package/src/core/hooks/usePrefersDark.test.tsx +1 -0
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
- package/src/core/middleware/origin.ts +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +34 -21
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +33 -36
- package/src/core/primitives/avatar/avatarCounter.tsx +35 -27
- package/src/core/primitives/avatar/avatarStack.tsx +35 -28
- package/src/core/primitives/avatar/types.ts +3 -3
- package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
- package/src/core/primitives/badge/badge.test.tsx +2 -3
- package/src/core/primitives/badge/badge.tsx +34 -33
- package/src/core/primitives/badge/types.ts +2 -1
- package/src/core/primitives/box/__workshop__/props.tsx +2 -2
- package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
- package/src/core/primitives/box/box.tsx +76 -31
- package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
- package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
- package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
- package/src/core/primitives/button/__workshop__/props.tsx +19 -22
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
- package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
- package/src/core/primitives/button/button.test.tsx +3 -18
- package/src/core/primitives/button/button.tsx +75 -73
- package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
- package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
- package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
- package/src/core/primitives/card/__workshop__/index.ts +1 -1
- package/src/core/primitives/card/__workshop__/interactive.tsx +3 -4
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
- package/src/core/primitives/card/__workshop__/props.tsx +14 -17
- package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
- package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
- package/src/core/primitives/card/card.tsx +53 -43
- package/src/core/primitives/card/cardContext.ts +10 -0
- package/src/core/primitives/card/cardProvider.tsx +27 -0
- package/src/core/primitives/card/index.ts +2 -0
- package/src/core/primitives/card/types.ts +19 -3
- package/src/core/primitives/card/useCard.ts +8 -0
- package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
- package/src/core/primitives/checkbox/checkbox.tsx +30 -21
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/code/__workshop__/props.tsx +4 -7
- package/src/core/primitives/code/code.tsx +28 -26
- package/src/core/primitives/container/__workshop__/example.tsx +2 -2
- package/src/core/primitives/container/container.tsx +29 -18
- package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
- package/src/core/primitives/flex/flex.tsx +21 -19
- package/src/core/primitives/grid/grid.tsx +21 -16
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
- package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
- package/src/core/primitives/heading/heading.tsx +46 -23
- package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
- package/src/core/primitives/inline/inline.tsx +27 -24
- package/src/core/primitives/inline/types.ts +1 -0
- package/src/core/primitives/kbd/kbd.tsx +29 -27
- package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
- package/src/core/primitives/label/label.tsx +45 -30
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
- package/src/core/primitives/popover/constants.ts +1 -1
- package/src/core/primitives/popover/floating-ui/size.ts +2 -2
- package/src/core/primitives/popover/helpers.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +296 -334
- package/src/core/primitives/popover/popoverLayer.tsx +149 -0
- package/src/core/primitives/popover/types.ts +3 -2
- package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
- package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
- package/src/core/primitives/radio/radio.tsx +33 -17
- package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/select/select.tsx +29 -27
- package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -5
- package/src/core/primitives/spinner/spinner.tsx +26 -14
- package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/stack/stack.tsx +33 -19
- package/src/core/primitives/switch/switch.tsx +33 -16
- package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
- package/src/core/primitives/text/__workshop__/example.tsx +9 -20
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/text/text.tsx +48 -30
- package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
- package/src/core/primitives/textArea/textArea.tsx +48 -21
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
- package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
- package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
- package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
- package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +52 -71
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
- package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
- package/src/core/primitives/tooltip/tooltip.tsx +112 -87
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -3
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +107 -0
- package/src/core/primitives/types.ts +16 -27
- package/src/core/types/avatar.ts +3 -6
- package/src/core/types/badge.ts +2 -4
- package/src/core/types/button.ts +2 -4
- package/src/core/types/card.ts +2 -4
- package/src/core/types/dialog.ts +1 -3
- package/src/core/types/props.ts +20 -10
- package/src/core/types/selectable.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +37 -28
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +4 -8
- package/src/core/utils/boundaryElement/types.ts +1 -3
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
- package/src/core/utils/elementQuery/elementQuery.tsx +43 -19
- package/src/core/utils/errorBoundary.tsx +6 -4
- package/src/core/utils/index.ts +0 -1
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
- package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
- package/src/core/utils/layer/getLayerContext.test.ts +3 -1
- package/src/core/utils/layer/getLayerContext.ts +1 -1
- package/src/core/utils/layer/layer.test.tsx +5 -5
- package/src/core/utils/layer/layer.tsx +24 -94
- package/src/core/utils/layer/layerCard.tsx +92 -0
- package/src/core/utils/layer/layerContext.ts +1 -1
- package/src/core/utils/layer/layerProvider.tsx +13 -9
- package/src/core/utils/layer/useLayer.ts +2 -4
- package/src/core/utils/portal/__workshop__/named.tsx +3 -3
- package/src/core/utils/portal/portal.test.tsx +5 -5
- package/src/core/utils/portal/{portal.ts → portal.tsx} +17 -9
- package/src/core/utils/portal/portalContext.ts +1 -1
- package/src/core/utils/portal/portalProvider.tsx +4 -8
- package/src/core/utils/portal/types.ts +1 -3
- package/src/core/utils/portal/usePortal.ts +2 -4
- package/src/core/utils/srOnly/srOnly.tsx +27 -22
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +72 -54
- package/src/css/_assign.ts +3 -0
- package/src/css/_compileStyle.ts +156 -0
- package/src/css/_compileSystem.ts +7 -0
- package/src/css/_compileTheme.ts +13 -0
- package/src/css/_composeClassNames.ts +12 -0
- package/src/css/_fromEntries.ts +3 -0
- package/src/css/_getClassNames.ts +9 -0
- package/src/css/_hash.ts +9 -0
- package/src/css/_mergeStyles.ts +24 -0
- package/src/css/_resp.ts +2 -2
- package/src/css/_responsiveRule.ts +38 -0
- package/src/css/_scopeClassName.ts +9 -0
- package/src/css/_scopeClassNames.ts +12 -0
- package/src/css/_system.style.ts +166 -0
- package/src/css/aspects/border/border.style.ts +13 -0
- package/src/css/aspects/border/border.ts +14 -0
- package/src/css/{styles → aspects}/border/types.ts +1 -1
- package/src/css/aspects/boxSizing/boxSizing.style.ts +10 -0
- package/src/css/aspects/boxSizing/boxSizing.ts +8 -0
- package/src/css/aspects/boxSizing/index.ts +2 -0
- package/src/css/aspects/boxSizing/types.ts +9 -0
- package/src/css/aspects/display/display.style.ts +34 -0
- package/src/css/aspects/display/display.ts +8 -0
- package/src/css/{styles → aspects}/display/types.ts +3 -4
- package/src/css/aspects/flex/flex.ts +13 -0
- package/src/css/aspects/flex/flexAlign.style.ts +12 -0
- package/src/css/aspects/flex/flexDirection.style.ts +11 -0
- package/src/css/aspects/flex/flexJustify.style.ts +13 -0
- package/src/css/aspects/flex/flexWrap.style.ts +10 -0
- package/src/css/{styles → aspects}/flex/types.ts +5 -13
- package/src/css/aspects/flexItem/flex.style.ts +22 -0
- package/src/css/aspects/flexItem/flexItem.ts +8 -0
- package/src/css/aspects/flexItem/types.ts +25 -0
- package/src/css/aspects/font/font.style.ts +83 -0
- package/src/css/aspects/font/font.ts +7 -0
- package/src/css/aspects/font/types.ts +6 -0
- package/src/css/aspects/gap/gap.style.ts +21 -0
- package/src/css/aspects/gap/gap.ts +8 -0
- package/src/css/{styles → aspects}/gap/types.ts +2 -2
- package/src/css/{styles → aspects}/grid/grid.ts +6 -5
- package/src/css/aspects/grid/gridAutoColumns.style.ts +11 -0
- package/src/css/aspects/grid/gridAutoFlow.style.ts +11 -0
- package/src/css/aspects/grid/gridAutoRows.style.ts +11 -0
- package/src/css/aspects/grid/gridColumns.style.ts +18 -0
- package/src/css/aspects/grid/gridRows.style.ts +18 -0
- package/src/css/{styles → aspects}/grid/types.ts +8 -12
- package/src/css/aspects/gridItem/gridColumn.style.ts +20 -0
- package/src/css/aspects/gridItem/gridColumnEnd.style.ts +20 -0
- package/src/css/aspects/gridItem/gridColumnStart.style.ts +20 -0
- package/src/css/{styles → aspects}/gridItem/gridItem.ts +4 -4
- package/src/css/aspects/gridItem/gridRow.style.ts +20 -0
- package/src/css/aspects/gridItem/gridRowEnd.style.ts +20 -0
- package/src/css/aspects/gridItem/gridRowStart.style.ts +20 -0
- package/src/css/{styles → aspects}/gridItem/types.ts +8 -19
- package/src/css/aspects/height/height.style.ts +9 -0
- package/src/css/aspects/height/height.ts +16 -0
- package/src/css/aspects/height/index.ts +1 -0
- package/src/css/{styles → aspects}/index.ts +5 -0
- package/src/css/aspects/inset/inset.style.ts +12 -0
- package/src/css/{styles → aspects}/inset/inset.ts +4 -3
- package/src/css/{styles → aspects}/inset/types.ts +1 -1
- package/src/css/aspects/margin/margin.style.ts +56 -0
- package/src/css/{styles → aspects}/margin/margin.ts +4 -3
- package/src/css/aspects/margin/types.ts +17 -0
- package/src/css/aspects/maxWidth/maxWidth.style.ts +16 -0
- package/src/css/aspects/maxWidth/maxWidth.ts +8 -0
- package/src/css/aspects/maxWidth/types.ts +8 -0
- package/src/css/aspects/minHeight/index.ts +2 -0
- package/src/css/aspects/minHeight/minHeight.style.ts +9 -0
- package/src/css/aspects/minHeight/minHeight.ts +8 -0
- package/src/css/aspects/minHeight/types.ts +9 -0
- package/src/css/aspects/minWidth/index.ts +2 -0
- package/src/css/aspects/minWidth/minWidth.style.ts +13 -0
- package/src/css/aspects/minWidth/minWidth.ts +8 -0
- package/src/css/aspects/minWidth/types.ts +9 -0
- package/src/css/aspects/outline/outline.style.ts +9 -0
- package/src/css/aspects/overflow/overflow.style.ts +11 -0
- package/src/css/{styles → aspects}/overflow/overflow.ts +4 -3
- package/src/css/{styles → aspects}/overflow/types.ts +1 -1
- package/src/css/aspects/padding/padding.style.ts +43 -0
- package/src/css/{styles → aspects}/padding/padding.ts +4 -3
- package/src/css/{styles → aspects}/padding/types.ts +2 -2
- package/src/css/aspects/pointerEvents/pointerEvents.style.ts +13 -0
- package/src/css/aspects/pointerEvents/pointerEvents.ts +7 -0
- package/src/css/aspects/position/position.style.ts +12 -0
- package/src/css/aspects/position/position.ts +8 -0
- package/src/css/{styles → aspects}/position/types.ts +1 -1
- package/src/css/aspects/radius/radius.style.ts +16 -0
- package/src/css/aspects/radius/radius.ts +8 -0
- package/src/css/aspects/radius/types.ts +8 -0
- package/src/css/aspects/shadow/shadow.style.ts +24 -0
- package/src/css/aspects/shadow/shadow.ts +8 -0
- package/src/css/aspects/shadow/types.ts +8 -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/aspects/textOverflow/textOverflow.style.ts +21 -0
- package/src/css/aspects/textOverflow/textOverflow.ts +7 -0
- package/src/css/{styles → aspects}/textOverflow/types.ts +1 -0
- package/src/css/aspects/width/types.ts +11 -0
- package/src/css/aspects/width/width.style.ts +11 -0
- package/src/css/aspects/width/width.ts +8 -0
- package/src/css/components/breadcrumbs/breadcrumbs.style.ts +9 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +3 -2
- package/src/css/components/dialog/dialog.style.ts +77 -0
- package/src/css/components/dialog/dialog.ts +17 -8
- package/src/css/components/menu/menu.style.ts +17 -0
- package/src/css/components/menu/menu.ts +5 -3
- package/src/css/components/skeleton/skeleton.style.ts +104 -0
- package/src/css/components/skeleton/skeleton.ts +13 -8
- package/src/css/components/skeleton/types.ts +8 -6
- package/src/css/components/toast/toast.style.ts +20 -0
- package/src/css/components/toast/toast.ts +11 -6
- package/src/css/components/tree/tree.style.ts +39 -0
- package/src/css/components/tree/tree.ts +3 -2
- package/src/css/constants.ts +10 -0
- package/src/css/index.ts +8 -8
- package/src/css/prefix/constants.ts +6 -0
- package/src/css/prefix/types.ts +1 -0
- package/src/css/primitives/_arrow/{rules.ts → _arrow.style.ts} +23 -25
- package/src/css/primitives/_arrow/_arrow.ts +13 -6
- package/src/css/primitives/_input/_input.style.ts +235 -0
- package/src/css/primitives/_input/input.ts +18 -13
- package/src/css/primitives/_input/types.ts +3 -3
- package/src/css/primitives/_selectable/{rules.ts → _selectable.style.ts} +36 -36
- package/src/css/primitives/_selectable/selectable.ts +5 -5
- package/src/css/primitives/_selectable/types.ts +2 -2
- package/src/css/primitives/avatar/{rules.ts → avatar.style.ts} +62 -67
- package/src/css/primitives/avatar/avatar.ts +14 -8
- package/src/css/primitives/avatar/types.ts +4 -3
- package/src/css/primitives/badge/badge.style.ts +21 -0
- package/src/css/primitives/badge/badge.ts +8 -4
- package/src/css/primitives/badge/types.ts +2 -2
- package/src/css/primitives/box/box.style.ts +22 -0
- package/src/css/primitives/box/box.ts +16 -10
- package/src/css/primitives/box/types.ts +12 -15
- package/src/css/primitives/button/button.style.ts +275 -0
- package/src/css/primitives/button/button.ts +9 -30
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +13 -0
- package/src/css/primitives/card/card.style.ts +295 -0
- package/src/css/primitives/card/card.ts +7 -11
- package/src/css/primitives/card/types.ts +4 -5
- package/src/css/primitives/checkbox/checkbox.style.ts +178 -0
- package/src/css/primitives/checkbox/checkbox.ts +5 -3
- package/src/css/primitives/code/code.style.ts +61 -0
- package/src/css/primitives/code/code.ts +8 -4
- package/src/css/primitives/code/types.ts +2 -2
- package/src/css/primitives/container/container.style.ts +10 -0
- package/src/css/primitives/container/container.ts +6 -4
- package/src/css/primitives/container/types.ts +3 -2
- package/src/css/primitives/heading/heading.style.ts +56 -0
- package/src/css/primitives/heading/heading.ts +13 -10
- package/src/css/primitives/heading/types.ts +4 -2
- package/src/css/primitives/kbd/kbd.style.ts +19 -0
- package/src/css/primitives/kbd/kbd.ts +6 -4
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.style.ts +52 -0
- package/src/css/primitives/label/label.ts +7 -9
- package/src/css/primitives/label/types.ts +11 -4
- package/src/css/primitives/popover/popover.style.ts +9 -0
- package/src/css/primitives/popover/popover.ts +8 -2
- package/src/css/primitives/radio/radio.style.ts +84 -0
- package/src/css/primitives/radio/radio.ts +3 -2
- package/src/css/primitives/select/{rules.ts → select.style.ts} +8 -6
- package/src/css/primitives/select/select.ts +7 -4
- package/src/css/primitives/select/types.ts +1 -1
- package/src/css/primitives/spinner/spinner.style.ts +22 -0
- package/src/css/primitives/spinner/spinner.ts +5 -3
- package/src/css/primitives/stack/index.ts +1 -0
- package/src/css/primitives/stack/stack.style.ts +13 -0
- package/src/css/primitives/stack/stack.ts +6 -0
- package/src/css/primitives/switch/switch.style.ts +102 -0
- package/src/css/primitives/switch/switch.ts +11 -6
- package/src/css/primitives/text/text.style.ts +65 -0
- package/src/css/primitives/text/text.ts +7 -9
- package/src/css/primitives/text/types.ts +7 -2
- package/src/css/primitives/textArea/textArea.style.ts +11 -0
- package/src/css/primitives/textArea/textArea.ts +5 -3
- package/src/css/primitives/textArea/types.ts +1 -1
- package/src/css/primitives/textInput/textInput.style.ts +46 -0
- package/src/css/primitives/textInput/textInput.ts +20 -4
- package/src/css/primitives/textInput/types.ts +2 -8
- package/src/css/primitives/token/token.style.ts +50 -0
- package/src/css/primitives/tooltip/tooltip.style.ts +9 -0
- package/src/css/primitives/tooltip/tooltip.ts +3 -6
- package/src/css/renderColor.ts +31 -0
- package/src/css/responsiveRules.ts +12 -19
- package/src/css/theme/index.ts +14 -0
- package/src/css/theme/lib/contract/buildVarContract.ts +76 -0
- package/src/css/theme/lib/contract/index.ts +2 -0
- package/src/css/theme/lib/contract/types.ts +15 -0
- package/src/css/theme/resolveTheme.ts +863 -0
- package/src/css/types.ts +29 -755
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.style.ts +14 -0
- package/src/css/utils/srOnly/srOnly.ts +4 -2
- package/src/theme/getScopedTheme.ts +4 -4
- package/src/theme/index.ts +0 -5
- package/src/theme/types.ts +6 -10
- package/src/theme/v0/color/_generic.ts +1 -1
- package/src/theme/v0/color/button.ts +1 -1
- package/src/theme/v0/color/card.ts +1 -1
- package/src/theme/v0/color/color.ts +11 -11
- package/src/theme/v0/color/input.ts +1 -1
- package/src/theme/v0/color/muted.ts +1 -1
- package/src/theme/v0/color/selectable.ts +1 -1
- package/src/theme/v0/color/solid.ts +1 -1
- package/src/theme/v0/color/spot.ts +1 -1
- package/src/theme/v0/focusRing.ts +1 -3
- package/src/theme/v0/font.ts +6 -19
- package/src/theme/v0/layer.ts +1 -3
- package/src/theme/v0/shadow.ts +2 -6
- package/src/theme/v0/styles.ts +1 -1
- package/src/theme/v0/theme.ts +7 -7
- package/src/theme/v2/avatar.ts +2 -4
- package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
- package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
- package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
- package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
- package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
- package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
- package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
- package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
- package/src/theme/v2/build/buildTheme.ts +12 -0
- package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
- package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
- package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
- package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
- package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
- package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
- package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
- package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
- package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
- package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
- package/src/theme/v2/color/_helpers.ts +2 -2
- package/src/theme/v2/color/_system.ts +2 -4
- package/src/theme/v2/color/avatar.ts +3 -7
- package/src/theme/v2/color/badge.ts +3 -7
- package/src/theme/v2/color/button.ts +5 -11
- package/src/theme/v2/color/color.ts +10 -16
- package/src/theme/v2/color/input.ts +8 -10
- package/src/theme/v2/color/kbd.ts +1 -3
- package/src/theme/v2/color/selectable.ts +4 -8
- package/src/theme/v2/color/state.ts +5 -7
- package/src/theme/v2/color/syntax.ts +1 -3
- package/src/theme/{config → v2/config}/helpers.ts +6 -13
- package/src/theme/{config → v2/config}/system.ts +11 -12
- package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
- package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
- package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
- package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
- package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
- package/src/theme/{config → v2/config}/types.ts +8 -6
- package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/colorTokens.ts +3 -3
- package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
- package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
- package/src/theme/v2/index.ts +2 -0
- package/src/theme/v2/input.ts +2 -4
- package/src/theme/v2/theme.ts +10 -14
- package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
- package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
- package/src/theme/v3/buildTheme_v3.ts +14 -10
- package/src/theme/v3/color/_constants.ts +15 -0
- package/src/theme/v3/color/avatar.ts +14 -0
- package/src/theme/v3/color/card.ts +58 -95
- package/src/theme/v3/color/color.ts +75 -71
- package/src/theme/v3/color/element.ts +8 -8
- package/src/theme/v3/color/index.ts +2 -2
- package/src/theme/v3/color/token.ts +19 -4
- package/src/theme/v3/color/tokens.ts +2 -2
- package/src/theme/v3/defaultFonts.ts +250 -0
- package/src/theme/v3/defaultTokens.ts +199 -0
- package/src/theme/v3/index.ts +4 -1
- package/src/theme/{palette → v3/palette}/constants.ts +3 -3
- package/src/theme/v3/palette/index.ts +2 -0
- package/src/theme/v3/palette/types.ts +7 -0
- package/src/theme/v3/resolveTokens.ts +70 -65
- package/src/theme/v3/tokens.ts +2 -2
- package/src/theme/v3/types.ts +95 -11
- package/src/theme/versioning/getTheme_v2.ts +3 -3
- package/src/theme/versioning/is_v0.ts +2 -2
- package/src/theme/versioning/is_v2.ts +2 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
- package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
- package/src/theme/versioning/v0_v2.ts +3 -3
- package/src/theme/versioning/v2_v0.ts +4 -4
- package/src/theme/versioning/v3_v2.ts +39 -38
- package/dist/_chunks-cjs/_visual-editing.js +0 -3059
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/buildCommand.js +0 -32
- package/dist/_chunks-cjs/buildCommand.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-cjs/v3_v2.js +0 -251
- package/dist/_chunks-cjs/v3_v2.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs +0 -3066
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_chunks-es/v3_v2.mjs +0 -252
- package/dist/_chunks-es/v3_v2.mjs.map +0 -1
- package/dist/_visual-editing.d.mts +0 -806
- 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.d.mts +0 -2135
- package/dist/css.mjs +0 -4713
- package/dist/css.mjs.map +0 -1
- package/dist/index.mjs +0 -1542
- package/dist/index.mjs.map +0 -1
- package/dist/sanity-palette.css +0 -9
- package/dist/sanity-theme.css +0 -1
- package/dist/system.css +0 -3577
- package/dist/theme.mjs.map +0 -1
- package/src/core/primitives/popover/popoverCard.tsx +0 -148
- package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
- package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/core/utils/conditionalWrapper/index.ts +0 -1
- package/src/css/compile/compilePalette.ts +0 -60
- package/src/css/compile/compileRule.ts +0 -90
- package/src/css/compile/compileRules.test.ts +0 -35
- package/src/css/compile/compileRules.ts +0 -40
- package/src/css/compile/compileSystem.ts +0 -7
- package/src/css/compile/compileTheme.ts +0 -15
- package/src/css/compile/compileTheme_v3.ts +0 -410
- package/src/css/compile/types.ts +0 -6
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/rules.ts +0 -76
- package/src/css/components/menu/rules.ts +0 -15
- package/src/css/components/skeleton/rules.ts +0 -112
- package/src/css/components/toast/rules.ts +0 -17
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/composeClassNames.ts +0 -13
- package/src/css/primitives/_input/rules.ts +0 -163
- package/src/css/primitives/_selectable/__style.ts +0 -117
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/badge/rules.ts +0 -22
- package/src/css/primitives/box/rules.ts +0 -28
- package/src/css/primitives/button/_constants.ts +0 -17
- package/src/css/primitives/button/rules.ts +0 -293
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/css/primitives/card/rules.ts +0 -471
- package/src/css/primitives/checkbox/__styles.ts +0 -129
- package/src/css/primitives/checkbox/rules.ts +0 -152
- package/src/css/primitives/code/rules.ts +0 -96
- package/src/css/primitives/container/rules.ts +0 -8
- package/src/css/primitives/heading/rules.ts +0 -155
- package/src/css/primitives/kbd/rules.ts +0 -20
- package/src/css/primitives/label/rules.ts +0 -137
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/radio/rules.ts +0 -121
- package/src/css/primitives/spinner/rules.ts +0 -20
- package/src/css/primitives/switch/rules.ts +0 -340
- package/src/css/primitives/text/rules.ts +0 -164
- package/src/css/primitives/textArea/rules.ts +0 -7
- package/src/css/primitives/textInput/rules.ts +0 -224
- package/src/css/primitives/token/rules.ts +0 -45
- package/src/css/primitives/tooltip/rules.ts +0 -19
- package/src/css/rules.ts +0 -113
- package/src/css/styles/border/border.ts +0 -22
- package/src/css/styles/border/rules.ts +0 -24
- package/src/css/styles/display/display.ts +0 -7
- package/src/css/styles/display/rules.ts +0 -62
- package/src/css/styles/flex/flex.ts +0 -20
- package/src/css/styles/flex/rules.ts +0 -28
- package/src/css/styles/flexItem/flexItem.ts +0 -8
- package/src/css/styles/flexItem/rules.ts +0 -12
- package/src/css/styles/flexItem/types.ts +0 -11
- package/src/css/styles/font/font.ts +0 -17
- package/src/css/styles/font/rules.ts +0 -148
- package/src/css/styles/font/types.ts +0 -12
- package/src/css/styles/gap/gap.ts +0 -8
- package/src/css/styles/gap/rules.ts +0 -34
- package/src/css/styles/grid/rules.ts +0 -146
- package/src/css/styles/gridItem/rules.ts +0 -96
- package/src/css/styles/height/rules.ts +0 -7
- package/src/css/styles/inset/rules.ts +0 -16
- package/src/css/styles/margin/rules.ts +0 -64
- package/src/css/styles/margin/types.ts +0 -11
- package/src/css/styles/maxWidth/maxWidth.ts +0 -6
- package/src/css/styles/maxWidth/rules.ts +0 -13
- package/src/css/styles/maxWidth/types.ts +0 -7
- package/src/css/styles/outline/rules.ts +0 -7
- package/src/css/styles/overflow/rules.ts +0 -9
- package/src/css/styles/padding/rules.ts +0 -62
- package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
- package/src/css/styles/pointerEvents/rules.ts +0 -11
- package/src/css/styles/position/position.ts +0 -7
- package/src/css/styles/position/rules.ts +0 -24
- package/src/css/styles/radius/radius.ts +0 -8
- package/src/css/styles/radius/rules.ts +0 -13
- package/src/css/styles/radius/types.ts +0 -8
- package/src/css/styles/shadow/rules.ts +0 -53
- package/src/css/styles/shadow/shadow.ts +0 -7
- package/src/css/styles/shadow/types.ts +0 -8
- package/src/css/styles/textOverflow/rules.ts +0 -17
- package/src/css/styles/textOverflow/textOverflow.ts +0 -6
- package/src/css/styles/width/rules.ts +0 -7
- package/src/css/styles/width/types.ts +0 -9
- package/src/css/styles/width/width.ts +0 -6
- package/src/css/utils/srOnly/rules.ts +0 -11
- package/src/css/varNames.ts +0 -473
- package/src/css/vars.ts +0 -443
- package/src/theme/_types.ts +0 -41
- package/src/theme/build/buildTheme.ts +0 -12
- package/src/theme/build/theme.test.ts +0 -27
- package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
- package/src/theme/config/tokens/parseTokenKey.ts +0 -67
- package/src/theme/palette/types.ts +0 -16
- package/src/theme/v3/buildTheme_v3.test.ts +0 -40
- package/src/theme/v3/color/buildColor_v3.ts +0 -193
- package/src/theme/v3/color/parseColor.test.ts +0 -79
- package/src/theme/v3/color/renderColor.test.ts +0 -19
- package/src/theme/v3/color/renderColor.ts +0 -33
- package/src/theme/v3/defaults.ts +0 -205
- /package/dist/{cli.d.ts → cli.d.cts} +0 -0
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
- /package/src/css/{styles → aspects}/border/index.ts +0 -0
- /package/src/css/{styles → aspects}/display/index.ts +0 -0
- /package/src/css/{styles → aspects}/flex/index.ts +0 -0
- /package/src/css/{styles → aspects}/flexItem/index.ts +0 -0
- /package/src/css/{styles → aspects}/font/index.ts +0 -0
- /package/src/css/{styles → aspects}/gap/index.ts +0 -0
- /package/src/css/{styles → aspects}/grid/index.ts +0 -0
- /package/src/css/{styles → aspects}/gridItem/index.ts +0 -0
- /package/src/css/{styles → aspects}/inset/index.ts +0 -0
- /package/src/css/{styles → aspects}/margin/index.ts +0 -0
- /package/src/css/{styles → aspects}/maxWidth/index.ts +0 -0
- /package/src/css/{styles → aspects}/overflow/index.ts +0 -0
- /package/src/css/{styles → aspects}/padding/index.ts +0 -0
- /package/src/css/{styles → aspects}/pointerEvents/index.ts +0 -0
- /package/src/css/{styles → aspects}/pointerEvents/types.ts +0 -0
- /package/src/css/{styles → aspects}/position/index.ts +0 -0
- /package/src/css/{styles → aspects}/radius/index.ts +0 -0
- /package/src/css/{styles → aspects}/shadow/index.ts +0 -0
- /package/src/css/{styles → aspects}/textOverflow/index.ts +0 -0
- /package/src/css/{styles → aspects}/width/index.ts +0 -0
- /package/src/{theme/palette → css/prefix}/index.ts +0 -0
- /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
- /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
- /package/src/theme/{build → v2/build}/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
- /package/src/theme/{build → v2/build}/merge.ts +0 -0
- /package/src/theme/{config → v2/config}/index.ts +0 -0
- /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 } 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, vars, treeItem, _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;
|
|
4
12
|
function _responsive(media, values, callback) {
|
|
5
13
|
return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
|
|
6
14
|
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
@@ -25,7 +33,7 @@ function _hasFocus(element) {
|
|
|
25
33
|
return !!document.activeElement && element.contains(document.activeElement);
|
|
26
34
|
}
|
|
27
35
|
function isFocusable(element) {
|
|
28
|
-
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;
|
|
29
37
|
}
|
|
30
38
|
function attemptFocus(element) {
|
|
31
39
|
if (!isFocusable(element))
|
|
@@ -39,7 +47,7 @@ function attemptFocus(element) {
|
|
|
39
47
|
function focusFirstDescendant(element) {
|
|
40
48
|
for (let i = 0; i < element.childNodes.length; i++) {
|
|
41
49
|
const child = element.childNodes[i];
|
|
42
|
-
if (
|
|
50
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
|
|
43
51
|
return !0;
|
|
44
52
|
}
|
|
45
53
|
return !1;
|
|
@@ -47,7 +55,7 @@ function focusFirstDescendant(element) {
|
|
|
47
55
|
function focusLastDescendant(element) {
|
|
48
56
|
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
49
57
|
const child = element.childNodes[i];
|
|
50
|
-
if (
|
|
58
|
+
if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
|
|
51
59
|
return !0;
|
|
52
60
|
}
|
|
53
61
|
return !1;
|
|
@@ -59,10 +67,10 @@ function _getElements(element, elementsArg) {
|
|
|
59
67
|
return ret.filter(Boolean);
|
|
60
68
|
}
|
|
61
69
|
function useClickOutside(listener, t0, boundaryElement) {
|
|
62
|
-
const $ =
|
|
70
|
+
const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
|
|
63
71
|
let t1;
|
|
64
72
|
$[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
|
|
65
|
-
const [elements, setElements] =
|
|
73
|
+
const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
|
|
66
74
|
let t2, t3;
|
|
67
75
|
$[3] !== element || $[4] !== elementsArg ? (t2 = () => {
|
|
68
76
|
const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
|
|
@@ -80,7 +88,7 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
80
88
|
setElements(nextElements), elementsRef.current = nextElements;
|
|
81
89
|
return;
|
|
82
90
|
}
|
|
83
|
-
}, 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);
|
|
84
92
|
let t4, t5;
|
|
85
93
|
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
86
94
|
if (!listener)
|
|
@@ -97,20 +105,21 @@ function useClickOutside(listener, t0, boundaryElement) {
|
|
|
97
105
|
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
98
106
|
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
99
107
|
};
|
|
100
|
-
}, 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;
|
|
101
109
|
}
|
|
102
110
|
function useElementRect(element) {
|
|
103
|
-
return
|
|
111
|
+
return useElementSize(element)?._contentRect || null;
|
|
104
112
|
}
|
|
105
113
|
function useForwardedRef(ref) {
|
|
106
|
-
const $ =
|
|
114
|
+
const $ = c(1), innerRef = useRef(null);
|
|
107
115
|
let t0;
|
|
108
|
-
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;
|
|
109
117
|
}
|
|
110
|
-
class ErrorBoundary extends
|
|
118
|
+
class ErrorBoundary extends Component {
|
|
111
119
|
state = {
|
|
112
120
|
error: null
|
|
113
121
|
};
|
|
122
|
+
static displayName = "ErrorBoundary";
|
|
114
123
|
static getDerivedStateFromError(error) {
|
|
115
124
|
return {
|
|
116
125
|
error
|
|
@@ -128,13 +137,13 @@ class ErrorBoundary extends react.Component {
|
|
|
128
137
|
} = this.state;
|
|
129
138
|
if (error) {
|
|
130
139
|
const message = typeof error?.message == "string" ? error.message : "Error";
|
|
131
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ jsx(Code, { children: message });
|
|
132
141
|
}
|
|
133
142
|
return this.props.children;
|
|
134
143
|
}
|
|
135
144
|
}
|
|
136
145
|
function AutocompleteOption(props) {
|
|
137
|
-
const $ =
|
|
146
|
+
const $ = c(11), {
|
|
138
147
|
children,
|
|
139
148
|
id,
|
|
140
149
|
onSelect,
|
|
@@ -150,12 +159,13 @@ function AutocompleteOption(props) {
|
|
|
150
159
|
const handleClick = t0;
|
|
151
160
|
let t1;
|
|
152
161
|
$[3] !== handleClick ? (t1 = (event) => {
|
|
153
|
-
event.key === "Enter" && !
|
|
162
|
+
event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
|
|
154
163
|
}, $[3] = handleClick, $[4] = t1) : t1 = $[4];
|
|
155
164
|
const handleKeyDown = t1;
|
|
156
165
|
let t2;
|
|
157
|
-
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;
|
|
158
167
|
}
|
|
168
|
+
AutocompleteOption.displayName = "AutocompleteOption";
|
|
159
169
|
function autocompleteReducer(state, msg) {
|
|
160
170
|
return msg.type === "input/change" ? {
|
|
161
171
|
...state,
|
|
@@ -195,16 +205,18 @@ function autocompleteReducer(state, msg) {
|
|
|
195
205
|
value: msg.value
|
|
196
206
|
} : state;
|
|
197
207
|
}
|
|
198
|
-
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1
|
|
208
|
+
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_AUTOCOMPLETE_ELEMENT = "input", DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
|
209
|
+
function Autocomplete(props) {
|
|
199
210
|
const {
|
|
211
|
+
as = DEFAULT_AUTOCOMPLETE_ELEMENT,
|
|
200
212
|
border = !0,
|
|
201
213
|
customValidity,
|
|
202
214
|
disabled,
|
|
203
215
|
filterOption: filterOptionProp,
|
|
204
|
-
fontSize =
|
|
216
|
+
fontSize = 2,
|
|
205
217
|
icon,
|
|
206
218
|
id,
|
|
207
|
-
listBox =
|
|
219
|
+
listBox = EMPTY_RECORD,
|
|
208
220
|
loading,
|
|
209
221
|
onBlur,
|
|
210
222
|
onChange,
|
|
@@ -215,18 +227,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
215
227
|
openOnFocus,
|
|
216
228
|
options: optionsProp,
|
|
217
229
|
padding: paddingProp = 3,
|
|
218
|
-
popover =
|
|
230
|
+
popover = EMPTY_RECORD,
|
|
219
231
|
prefix,
|
|
220
232
|
radius = 2,
|
|
221
233
|
readOnly,
|
|
234
|
+
ref: forwardedRef,
|
|
222
235
|
relatedElements,
|
|
223
236
|
renderOption: renderOptionProp,
|
|
224
237
|
renderPopover,
|
|
225
238
|
renderValue = DEFAULT_RENDER_VALUE,
|
|
226
239
|
suffix,
|
|
227
240
|
value: valueProp,
|
|
228
|
-
...
|
|
229
|
-
} = props, [state, dispatch] =
|
|
241
|
+
...rest
|
|
242
|
+
} = props, [state, dispatch] = useReducer(autocompleteReducer, {
|
|
230
243
|
activeValue: valueProp || null,
|
|
231
244
|
focused: !1,
|
|
232
245
|
listFocused: !1,
|
|
@@ -238,20 +251,11 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
238
251
|
listFocused,
|
|
239
252
|
query,
|
|
240
253
|
value
|
|
241
|
-
} = state, defaultRenderOption =
|
|
254
|
+
} = state, defaultRenderOption = useCallback(({
|
|
242
255
|
value: value_0
|
|
243
|
-
}) => /* @__PURE__ */
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
as: "button",
|
|
247
|
-
padding: paddingProp,
|
|
248
|
-
radius: 2,
|
|
249
|
-
tone: "inherit",
|
|
250
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 })
|
|
251
|
-
}
|
|
252
|
-
), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
|
|
253
|
-
react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
|
|
254
|
-
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.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 = react.useCallback((event) => {
|
|
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) => {
|
|
255
259
|
setTimeout(() => {
|
|
256
260
|
if (popoverMouseWithinRef.current)
|
|
257
261
|
return;
|
|
@@ -268,18 +272,18 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
268
272
|
type: "root/blur"
|
|
269
273
|
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
270
274
|
}, 0);
|
|
271
|
-
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus =
|
|
275
|
+
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
|
|
272
276
|
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
273
277
|
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
274
278
|
type: "root/setListFocused",
|
|
275
279
|
listFocused: listFocused_0
|
|
276
280
|
}));
|
|
277
|
-
}, []), handleOptionSelect =
|
|
281
|
+
}, []), handleOptionSelect = useCallback((v) => {
|
|
278
282
|
dispatch({
|
|
279
283
|
type: "value/change",
|
|
280
284
|
value: v
|
|
281
285
|
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
282
|
-
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown =
|
|
286
|
+
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
|
|
283
287
|
if (event_1.key === "ArrowDown") {
|
|
284
288
|
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
285
289
|
const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
@@ -311,35 +315,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
311
315
|
inputElementRef.current?.focus();
|
|
312
316
|
return;
|
|
313
317
|
}
|
|
314
|
-
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange =
|
|
318
|
+
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
|
|
315
319
|
const nextQuery = event_2.currentTarget.value;
|
|
316
320
|
dispatch({
|
|
317
321
|
type: "input/change",
|
|
318
322
|
query: nextQuery
|
|
319
323
|
}), onQueryChange && onQueryChange(nextQuery);
|
|
320
|
-
}, [onQueryChange]), dispatchOpen =
|
|
324
|
+
}, [onQueryChange]), dispatchOpen = useCallback(() => {
|
|
321
325
|
dispatch({
|
|
322
326
|
type: "root/open",
|
|
323
327
|
query: value ? renderValue(value, currentOption) : ""
|
|
324
328
|
});
|
|
325
|
-
}, [currentOption, renderValue, value]), handleInputFocus =
|
|
329
|
+
}, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
|
|
326
330
|
focused || (dispatch({
|
|
327
331
|
type: "input/focus"
|
|
328
332
|
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
329
|
-
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter =
|
|
333
|
+
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
|
|
330
334
|
popoverMouseWithinRef.current = !0;
|
|
331
|
-
}, []), handlePopoverMouseLeave =
|
|
335
|
+
}, []), handlePopoverMouseLeave = useCallback(() => {
|
|
332
336
|
popoverMouseWithinRef.current = !1;
|
|
333
|
-
}, []), handleClearButtonClick =
|
|
337
|
+
}, []), handleClearButtonClick = useCallback(() => {
|
|
334
338
|
dispatch({
|
|
335
339
|
type: "root/clear"
|
|
336
340
|
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
337
|
-
}, [onChange, onQueryChange]), handleClearButtonFocus =
|
|
341
|
+
}, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
|
|
338
342
|
dispatch({
|
|
339
343
|
type: "input/focus"
|
|
340
344
|
});
|
|
341
345
|
}, []);
|
|
342
|
-
|
|
346
|
+
useEffect(() => {
|
|
343
347
|
if (valueProp !== valuePropRef.current) {
|
|
344
348
|
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
345
349
|
type: "value/change",
|
|
@@ -351,12 +355,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
351
355
|
type: "value/change",
|
|
352
356
|
value: valueProp || null
|
|
353
357
|
}));
|
|
354
|
-
}, [valueProp]),
|
|
358
|
+
}, [valueProp]), useEffect(() => {
|
|
355
359
|
!focused && valueRef.current && dispatch({
|
|
356
360
|
type: "root/setActiveValue",
|
|
357
361
|
value: valueRef.current
|
|
358
362
|
});
|
|
359
|
-
}, [focused]),
|
|
363
|
+
}, [focused]), useEffect(() => {
|
|
360
364
|
const listElement = listBoxElementRef.current;
|
|
361
365
|
if (!listElement) return;
|
|
362
366
|
const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
@@ -369,41 +373,43 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
369
373
|
}
|
|
370
374
|
}
|
|
371
375
|
}, [activeValue, filteredOptions]);
|
|
372
|
-
const clearButton =
|
|
376
|
+
const clearButton = useMemo(() => {
|
|
373
377
|
if (!loading && !disabled && value)
|
|
374
378
|
return {
|
|
375
379
|
"aria-label": "Clear",
|
|
376
380
|
onFocus: handleClearButtonFocus
|
|
377
381
|
};
|
|
378
|
-
}, [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) => {
|
|
379
383
|
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
380
|
-
}, [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) => {
|
|
381
385
|
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
382
|
-
}, [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", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: filteredOptions.map((option_0) => {
|
|
383
387
|
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
384
|
-
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), {
|
|
385
389
|
disabled: loading,
|
|
386
390
|
selected: active,
|
|
387
391
|
tabIndex: listFocused && active ? 0 : -1
|
|
388
392
|
}) }, option_0.value);
|
|
389
|
-
}) }) }), [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({
|
|
390
394
|
content: content2,
|
|
391
395
|
hidden: !expanded,
|
|
392
396
|
inputElement: inputElementRef.current,
|
|
393
397
|
onMouseEnter: handlePopoverMouseEnter,
|
|
394
398
|
onMouseLeave: handlePopoverMouseLeave
|
|
395
|
-
}, 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]);
|
|
396
400
|
return (
|
|
397
401
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
398
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
399
403
|
input,
|
|
400
404
|
results
|
|
401
405
|
] })
|
|
402
406
|
);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
const
|
|
407
|
+
}
|
|
408
|
+
Autocomplete.displayName = "Autocomplete";
|
|
409
|
+
const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
|
|
410
|
+
function Breadcrumbs(props) {
|
|
406
411
|
const {
|
|
412
|
+
as = DEFAULT_BREADCRUMBS_ELEMENT,
|
|
407
413
|
children,
|
|
408
414
|
className,
|
|
409
415
|
expandButton: expandButtonProps,
|
|
@@ -415,36 +421,34 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(
|
|
|
415
421
|
separator,
|
|
416
422
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
417
423
|
space: _spaceProp,
|
|
418
|
-
...
|
|
419
|
-
} = props, [open, setOpen] =
|
|
420
|
-
|
|
421
|
-
const rawItems =
|
|
424
|
+
...rest
|
|
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(() => {
|
|
422
428
|
const len = rawItems.length;
|
|
423
429
|
if (maxLength && len > maxLength) {
|
|
424
430
|
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
425
|
-
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", gap: gapY, overflow: "auto", 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)];
|
|
426
432
|
}
|
|
427
433
|
return rawItems;
|
|
428
434
|
}, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
|
|
429
|
-
return /* @__PURE__ */
|
|
430
|
-
itemIndex > 0 && /* @__PURE__ */
|
|
431
|
-
/* @__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 })
|
|
432
438
|
] }, itemIndex)) });
|
|
433
|
-
});
|
|
434
|
-
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
435
|
-
const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
436
|
-
version: 0
|
|
437
|
-
});
|
|
438
|
-
function useDialog() {
|
|
439
|
-
return react.useContext(DialogContext);
|
|
440
439
|
}
|
|
440
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
441
441
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
442
|
-
return !boundaryElement || !portalElement ? !0 :
|
|
442
|
+
return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
443
443
|
}
|
|
444
|
-
const
|
|
445
|
-
|
|
444
|
+
const DEFAULT_DIALOG_CARD_ELEMENT = "div";
|
|
445
|
+
function DialogCard(props) {
|
|
446
|
+
const $ = c(51), t0 = props;
|
|
447
|
+
let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
|
|
448
|
+
$[0] !== t0 ? ({
|
|
446
449
|
__unstable_autoFocus: autoFocus,
|
|
447
450
|
__unstable_hideCloseButton: hideCloseButton,
|
|
451
|
+
as: t1,
|
|
448
452
|
children,
|
|
449
453
|
contentRef: forwardedContentRef,
|
|
450
454
|
footer,
|
|
@@ -453,75 +457,74 @@ const DialogCard = react.forwardRef(function(props, forwardedRef) {
|
|
|
453
457
|
onClickOutside,
|
|
454
458
|
onClose,
|
|
455
459
|
portal: portalProp,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
width: widthProp
|
|
461
|
-
} = props, shadowProp = t0 === void 0 ? 4 : t0, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, radius = _visualEditing.useArrayProp(radiusProp), shadow = _visualEditing.useArrayProp(shadowProp), width = _visualEditing.useArrayProp(widthProp), ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
|
|
460
|
+
ref: forwardedRef,
|
|
461
|
+
...rest
|
|
462
|
+
} = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
|
|
463
|
+
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
|
|
462
464
|
isTopLayer
|
|
463
465
|
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
|
|
464
|
-
let t1;
|
|
465
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], react.useImperativeHandle(forwardedRef, t1);
|
|
466
466
|
let t2;
|
|
467
|
-
$[
|
|
468
|
-
let t3
|
|
469
|
-
$[
|
|
467
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
|
|
468
|
+
let t3;
|
|
469
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], useImperativeHandle(forwardedContentRef, t3);
|
|
470
|
+
let t4, t5;
|
|
471
|
+
$[16] !== autoFocus ? (t4 = () => {
|
|
470
472
|
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
471
|
-
},
|
|
472
|
-
let
|
|
473
|
-
$[
|
|
473
|
+
}, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), useEffect(t4, t5);
|
|
474
|
+
let t6;
|
|
475
|
+
$[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
|
|
474
476
|
if (!isTopLayer || !onClose)
|
|
475
477
|
return;
|
|
476
478
|
const target = document.activeElement;
|
|
477
479
|
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
478
|
-
}, $[
|
|
479
|
-
let
|
|
480
|
-
$[
|
|
480
|
+
}, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], useGlobalKeyDown(t6);
|
|
481
|
+
let t7;
|
|
482
|
+
$[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
|
|
481
483
|
const target_0 = event_0.target;
|
|
482
484
|
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
483
|
-
}), $[
|
|
484
|
-
let t7;
|
|
485
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[15] = t7) : t7 = $[15], _visualEditing.useClickOutsideEvent(t6, t7);
|
|
485
|
+
}), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
|
|
486
486
|
let t8;
|
|
487
|
-
$[
|
|
487
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], useClickOutsideEvent(t7, t8);
|
|
488
488
|
let t9;
|
|
489
|
-
$[
|
|
489
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[30] = t9) : t9 = $[30];
|
|
490
490
|
let t10;
|
|
491
|
-
$[
|
|
491
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[31] = t10) : t10 = $[31];
|
|
492
492
|
let t11;
|
|
493
|
-
$[
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
showCloseButton && /* @__PURE__ */
|
|
496
|
-
] }) }), $[
|
|
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 }) })
|
|
496
|
+
] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
|
|
497
497
|
let t12;
|
|
498
|
-
$[
|
|
498
|
+
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[38] = t12) : t12 = $[38];
|
|
499
499
|
let t13;
|
|
500
|
-
$[
|
|
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];
|
|
501
501
|
let t14;
|
|
502
|
-
$[
|
|
502
|
+
$[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
|
|
503
503
|
let t15;
|
|
504
|
-
$[
|
|
504
|
+
$[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
|
|
505
505
|
t11,
|
|
506
506
|
t13,
|
|
507
507
|
t14
|
|
508
|
-
] }), $[
|
|
508
|
+
] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
|
|
509
509
|
let t16;
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
510
|
+
return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsx(Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
|
|
511
|
+
}
|
|
512
|
+
DialogCard.displayName = "DialogCard";
|
|
513
|
+
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
514
|
+
version: 0
|
|
513
515
|
});
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
516
|
+
function useDialog() {
|
|
517
|
+
return useContext(DialogContext);
|
|
518
|
+
}
|
|
519
|
+
const DEFAULT_DIALOG_ELEMENT = "div";
|
|
520
|
+
function Dialog(props) {
|
|
521
|
+
const $ = c(69), context = useDialog(), t0 = props;
|
|
522
|
+
let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
|
|
523
|
+
$[0] !== t0 ? ({
|
|
524
|
+
__unstable_autoFocus: t1,
|
|
525
|
+
__unstable_hideCloseButton: t2,
|
|
526
|
+
animate: t3,
|
|
527
|
+
cardRadius: t4,
|
|
525
528
|
children,
|
|
526
529
|
className,
|
|
527
530
|
contentRef,
|
|
@@ -532,19 +535,19 @@ const Dialog = react.forwardRef(function(props, ref) {
|
|
|
532
535
|
onClickOutside,
|
|
533
536
|
onClose,
|
|
534
537
|
onFocus,
|
|
535
|
-
padding:
|
|
538
|
+
padding: t5,
|
|
536
539
|
portal: portalProp,
|
|
537
540
|
position: _positionProp,
|
|
538
541
|
scheme,
|
|
539
|
-
shadow:
|
|
540
|
-
width:
|
|
542
|
+
shadow: t6,
|
|
543
|
+
width: t7,
|
|
541
544
|
zOffset: _zOffsetProp,
|
|
542
545
|
tone,
|
|
543
|
-
...
|
|
544
|
-
} =
|
|
545
|
-
const autoFocus =
|
|
546
|
-
let
|
|
547
|
-
$[24] !== onFocus ? (
|
|
546
|
+
...rest
|
|
547
|
+
} = t0, $[0] = t0, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
|
|
548
|
+
const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
|
|
549
|
+
let t8;
|
|
550
|
+
$[24] !== onFocus ? (t8 = (event) => {
|
|
548
551
|
onFocus?.(event);
|
|
549
552
|
const target = event.target, cardElement = cardRef.current;
|
|
550
553
|
if (cardElement && target === preDivRef.current) {
|
|
@@ -555,11 +558,11 @@ const Dialog = react.forwardRef(function(props, ref) {
|
|
|
555
558
|
focusFirstDescendant(cardElement);
|
|
556
559
|
return;
|
|
557
560
|
}
|
|
558
|
-
|
|
559
|
-
}, $[24] = onFocus, $[25] =
|
|
560
|
-
const handleFocus =
|
|
561
|
-
let
|
|
562
|
-
$[26] !== boundaryElement || $[27] !== portalElement ? (
|
|
561
|
+
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
562
|
+
}, $[24] = onFocus, $[25] = t8) : t8 = $[25];
|
|
563
|
+
const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
|
|
564
|
+
let t9;
|
|
565
|
+
$[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
|
|
563
566
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
564
567
|
const activeElement = document.activeElement;
|
|
565
568
|
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
@@ -572,29 +575,33 @@ const Dialog = react.forwardRef(function(props, ref) {
|
|
|
572
575
|
target_0.focus();
|
|
573
576
|
}
|
|
574
577
|
}, 0);
|
|
575
|
-
}, $[26] = boundaryElement, $[27] = portalElement, $[28] =
|
|
576
|
-
const handleRootClick =
|
|
577
|
-
let t8;
|
|
578
|
-
$[29] !== className ? (t8 = css.composeClassNames(className, css.dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
|
|
579
|
-
const t9 = animate ? "" : void 0;
|
|
578
|
+
}, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
|
|
579
|
+
const handleRootClick = t9;
|
|
580
580
|
let t10;
|
|
581
|
-
$[
|
|
582
|
-
|
|
583
|
-
$[32] !== autoFocus || $[33] !== cardRadius || $[34] !== cardShadow || $[35] !== children || $[36] !== contentRef || $[37] !== footer || $[38] !== header || $[39] !== hideCloseButton || $[40] !== id || $[41] !== onClickOutside || $[42] !== onClose || $[43] !== portalProp || $[44] !== scheme || $[45] !== tone || $[46] !== width ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[32] = autoFocus, $[33] = cardRadius, $[34] = cardShadow, $[35] = children, $[36] = contentRef, $[37] = footer, $[38] = header, $[39] = hideCloseButton, $[40] = id, $[41] = onClickOutside, $[42] = onClose, $[43] = portalProp, $[44] = scheme, $[45] = tone, $[46] = width, $[47] = t11) : t11 = $[47];
|
|
581
|
+
$[29] !== className ? (t10 = _composeClassNames(className, dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
|
|
582
|
+
const t11 = animate ? "" : void 0;
|
|
584
583
|
let t12;
|
|
585
|
-
$[
|
|
584
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
|
|
586
585
|
let t13;
|
|
587
|
-
$[
|
|
588
|
-
t10,
|
|
589
|
-
t11,
|
|
590
|
-
t12
|
|
591
|
-
] }), $[49] = handleFocus, $[50] = handleRootClick, $[51] = id, $[52] = labelId, $[53] = onActivate, $[54] = padding, $[55] = position, $[56] = ref, $[57] = restProps, $[58] = t11, $[59] = t8, $[60] = t9, $[61] = zOffset, $[62] = t13) : t13 = $[62];
|
|
586
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
|
|
592
587
|
let t14;
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
588
|
+
$[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
|
|
589
|
+
let t15;
|
|
590
|
+
$[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsx(Container, { align: "center", className: t13, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
|
|
591
|
+
let t16;
|
|
592
|
+
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
|
|
593
|
+
let t17;
|
|
594
|
+
$[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
|
|
595
|
+
t12,
|
|
596
|
+
t15,
|
|
597
|
+
t16
|
|
598
|
+
] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
|
|
599
|
+
let t18;
|
|
600
|
+
return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
|
|
601
|
+
}
|
|
602
|
+
Dialog.displayName = "Dialog";
|
|
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
|
-
|
|
614
|
-
const $ =
|
|
620
|
+
function MenuButton(props) {
|
|
621
|
+
const $ = c(63), {
|
|
615
622
|
__unstable_disableRestoreFocusOnClose: t0,
|
|
616
623
|
boundaryElement: deprecated_boundaryElement,
|
|
617
624
|
button: buttonProp,
|
|
@@ -624,23 +631,24 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
624
631
|
portal: t1,
|
|
625
632
|
popover,
|
|
626
633
|
popoverRadius: deprecated_popoverRadius,
|
|
627
|
-
preventOverflow: deprecated_preventOverflow
|
|
628
|
-
|
|
634
|
+
preventOverflow: deprecated_preventOverflow,
|
|
635
|
+
ref: forwardedRef
|
|
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);
|
|
629
637
|
let t2;
|
|
630
638
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
631
|
-
const [menuElements, setChildMenuElements] =
|
|
639
|
+
const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
|
|
632
640
|
let t3, t4;
|
|
633
641
|
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
634
642
|
onOpen && open && !openRef.current && onOpen();
|
|
635
|
-
}, 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);
|
|
636
644
|
let t5, t6;
|
|
637
645
|
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
638
646
|
onClose && !open && openRef.current && onClose();
|
|
639
|
-
}, 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);
|
|
640
648
|
let t7, t8;
|
|
641
649
|
$[9] !== open ? (t7 = () => {
|
|
642
650
|
openRef.current = open;
|
|
643
|
-
}, 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);
|
|
644
652
|
let t9;
|
|
645
653
|
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
646
654
|
setOpen(_temp$2), setShouldFocus(null);
|
|
@@ -699,7 +707,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
699
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];
|
|
700
708
|
const registerElement = t16;
|
|
701
709
|
let t17;
|
|
702
|
-
$[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, {
|
|
703
711
|
"aria-labelledby": id,
|
|
704
712
|
onBlurCapture: handleBlur,
|
|
705
713
|
onClickOutside: handleMenuClickOutside,
|
|
@@ -718,7 +726,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
718
726
|
}
|
|
719
727
|
const t192 = buttonProp.props.selected ?? open;
|
|
720
728
|
let t202;
|
|
721
|
-
$[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, {
|
|
722
730
|
"data-ui": "MenuButton",
|
|
723
731
|
id,
|
|
724
732
|
onClick: handleButtonClick,
|
|
@@ -732,7 +740,7 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
732
740
|
}
|
|
733
741
|
const button = t18;
|
|
734
742
|
let t19, t20;
|
|
735
|
-
$[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);
|
|
736
744
|
let t21, t22;
|
|
737
745
|
$[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
|
|
738
746
|
let t23;
|
|
@@ -748,27 +756,28 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
|
|
|
748
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;
|
|
749
757
|
const popoverProps = t21;
|
|
750
758
|
let t24;
|
|
751
|
-
$[56] !== button ? (t24 = button || /* @__PURE__ */
|
|
759
|
+
$[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
|
|
752
760
|
let t25;
|
|
753
|
-
return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */
|
|
754
|
-
}
|
|
755
|
-
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
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;
|
|
762
|
+
}
|
|
756
763
|
function _temp$2(v) {
|
|
757
764
|
return !v;
|
|
758
765
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
$
|
|
763
|
-
|
|
766
|
+
MenuButton.displayName = "MenuButton";
|
|
767
|
+
const DEFAULT_SKELETON_ELEMENT = "div";
|
|
768
|
+
function Skeleton(props) {
|
|
769
|
+
const $ = c(17), t0 = props;
|
|
770
|
+
let className, delay, radius, rest, t1;
|
|
771
|
+
$[0] !== t0 ? ({
|
|
772
|
+
animated: t1,
|
|
764
773
|
className,
|
|
765
774
|
delay,
|
|
766
775
|
radius,
|
|
767
|
-
...
|
|
768
|
-
} =
|
|
769
|
-
const animated =
|
|
770
|
-
let
|
|
771
|
-
$[6] !== delay ? (
|
|
776
|
+
...rest
|
|
777
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
|
|
778
|
+
const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
|
|
779
|
+
let t2, t3;
|
|
780
|
+
$[6] !== delay ? (t2 = () => {
|
|
772
781
|
if (!delay)
|
|
773
782
|
return setVisible(!0);
|
|
774
783
|
const timeout = setTimeout(() => {
|
|
@@ -777,97 +786,104 @@ const Skeleton = react.forwardRef(function(props, ref) {
|
|
|
777
786
|
return () => {
|
|
778
787
|
clearTimeout(timeout);
|
|
779
788
|
};
|
|
780
|
-
},
|
|
781
|
-
let
|
|
782
|
-
$[9] !== className || $[10] !== radius ? (
|
|
789
|
+
}, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), useEffect(t2, t3);
|
|
790
|
+
let t4;
|
|
791
|
+
$[9] !== className || $[10] !== radius ? (t4 = _composeClassNames(className, skeleton({
|
|
783
792
|
radius
|
|
784
|
-
})), $[9] = className, $[10] = radius, $[11] =
|
|
785
|
-
const
|
|
786
|
-
let
|
|
787
|
-
return $[12] !==
|
|
788
|
-
}
|
|
789
|
-
Skeleton.displayName = "
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
793
|
+
})), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
|
|
794
|
+
const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
|
|
795
|
+
let t7;
|
|
796
|
+
return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...rest, className: t4, "data-animated": t5, "data-visible": t6 }), $[12] = rest, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7) : t7 = $[16], t7;
|
|
797
|
+
}
|
|
798
|
+
Skeleton.displayName = "Skeleton";
|
|
799
|
+
const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
800
|
+
function CodeSkeleton(props) {
|
|
801
|
+
const $ = c(10), t0 = props;
|
|
802
|
+
let className, rest, t1;
|
|
803
|
+
$[0] !== t0 ? ({
|
|
794
804
|
className,
|
|
795
|
-
size:
|
|
796
|
-
...
|
|
797
|
-
} =
|
|
798
|
-
const size =
|
|
799
|
-
let t1;
|
|
800
|
-
$[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.textSkeleton({
|
|
801
|
-
size
|
|
802
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
805
|
+
size: t1,
|
|
806
|
+
...rest
|
|
807
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
808
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
803
809
|
let t2;
|
|
804
|
-
|
|
805
|
-
});
|
|
806
|
-
TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
|
|
807
|
-
const LabelSkeleton = react.forwardRef(function(props, ref) {
|
|
808
|
-
const $ = reactCompilerRuntime.c(11);
|
|
809
|
-
let className, restProps, t0;
|
|
810
|
-
$[0] !== props ? ({
|
|
811
|
-
className,
|
|
812
|
-
size: t0,
|
|
813
|
-
...restProps
|
|
814
|
-
} = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
|
|
815
|
-
const size = t0 === void 0 ? 2 : t0;
|
|
816
|
-
let t1;
|
|
817
|
-
$[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.labelSkeleton({
|
|
810
|
+
$[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, codeSkeleton({
|
|
818
811
|
size
|
|
819
|
-
})), $[4] = className, $[5] = size, $[6] =
|
|
820
|
-
let
|
|
821
|
-
return $[7] !==
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
812
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
813
|
+
let t3;
|
|
814
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
815
|
+
}
|
|
816
|
+
CodeSkeleton.displayName = "CodeSkeleton";
|
|
817
|
+
const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
|
|
818
|
+
function HeadingSkeleton(props) {
|
|
819
|
+
const $ = c(10), t0 = props;
|
|
820
|
+
let className, rest, t1;
|
|
821
|
+
$[0] !== t0 ? ({
|
|
828
822
|
className,
|
|
829
|
-
size:
|
|
830
|
-
...
|
|
831
|
-
} =
|
|
832
|
-
const size =
|
|
833
|
-
let t1;
|
|
834
|
-
$[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.headingSkeleton({
|
|
835
|
-
size
|
|
836
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
823
|
+
size: t1,
|
|
824
|
+
...rest
|
|
825
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
826
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
837
827
|
let t2;
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
828
|
+
$[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, headingSkeleton({
|
|
829
|
+
size
|
|
830
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
831
|
+
let t3;
|
|
832
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
833
|
+
}
|
|
834
|
+
HeadingSkeleton.displayName = "HeadingSkeleton";
|
|
835
|
+
const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
|
|
836
|
+
function LabelSkeleton(props) {
|
|
837
|
+
const $ = c(10), t0 = props;
|
|
838
|
+
let className, rest, t1;
|
|
839
|
+
$[0] !== t0 ? ({
|
|
845
840
|
className,
|
|
846
|
-
size:
|
|
847
|
-
...
|
|
848
|
-
} =
|
|
849
|
-
const size =
|
|
850
|
-
let
|
|
851
|
-
$[4] !== className || $[5] !== size ? (
|
|
841
|
+
size: t1,
|
|
842
|
+
...rest
|
|
843
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
844
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
845
|
+
let t2;
|
|
846
|
+
$[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, labelSkeleton({
|
|
852
847
|
size
|
|
853
|
-
})), $[4] = className, $[5] = size, $[6] =
|
|
848
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
849
|
+
let t3;
|
|
850
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
851
|
+
}
|
|
852
|
+
LabelSkeleton.displayName = "LabelSkeleton";
|
|
853
|
+
const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
|
|
854
|
+
function TextSkeleton(props) {
|
|
855
|
+
const $ = c(10), t0 = props;
|
|
856
|
+
let className, rest, t1;
|
|
857
|
+
$[0] !== t0 ? ({
|
|
858
|
+
className,
|
|
859
|
+
size: t1,
|
|
860
|
+
...rest
|
|
861
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
862
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
854
863
|
let t2;
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
864
|
+
$[4] !== className || $[5] !== size ? (t2 = _composeClassNames(className, textSkeleton({
|
|
865
|
+
size
|
|
866
|
+
})), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
867
|
+
let t3;
|
|
868
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
869
|
+
}
|
|
870
|
+
TextSkeleton.displayName = "TextSkeleton";
|
|
871
|
+
const DEFAULT_TAB_PANEL_ELEMENT = "div";
|
|
872
|
+
function TabPanel(props) {
|
|
873
|
+
const $ = c(10), t0 = props;
|
|
874
|
+
let children, rest, t1, tabIndex;
|
|
875
|
+
$[0] !== t0 ? ({
|
|
876
|
+
as: t1,
|
|
877
|
+
children,
|
|
878
|
+
tabIndex,
|
|
879
|
+
...rest
|
|
880
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1, $[4] = tabIndex) : (children = $[1], rest = $[2], t1 = $[3], tabIndex = $[4]);
|
|
881
|
+
const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = tabIndex === void 0 ? 0 : tabIndex;
|
|
882
|
+
let t3;
|
|
883
|
+
return $[5] !== as || $[6] !== children || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children }), $[5] = as, $[6] = children, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
884
|
+
}
|
|
885
|
+
TabPanel.displayName = "TabPanel";
|
|
886
|
+
const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
|
|
871
887
|
error: "alert",
|
|
872
888
|
warning: "alert",
|
|
873
889
|
success: "alert",
|
|
@@ -884,63 +900,64 @@ const ROLES = {
|
|
|
884
900
|
info: "neutral"
|
|
885
901
|
}, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
|
|
886
902
|
function Toast(props) {
|
|
887
|
-
const $ =
|
|
888
|
-
let closable, description, duration, onClose,
|
|
889
|
-
$[0] !==
|
|
903
|
+
const $ = c(53), t0 = props;
|
|
904
|
+
let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
|
|
905
|
+
$[0] !== t0 ? ({
|
|
906
|
+
as: t1,
|
|
890
907
|
closable,
|
|
891
908
|
description,
|
|
892
909
|
duration,
|
|
893
910
|
onClose,
|
|
894
|
-
radius:
|
|
911
|
+
radius: t2,
|
|
895
912
|
title,
|
|
896
913
|
status,
|
|
897
914
|
updatedAt,
|
|
898
|
-
...
|
|
899
|
-
} =
|
|
900
|
-
const radius =
|
|
901
|
-
let
|
|
902
|
-
$[
|
|
915
|
+
...rest
|
|
916
|
+
} = 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]);
|
|
917
|
+
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;
|
|
918
|
+
let t3;
|
|
919
|
+
$[11] !== visualDuration ? (t3 = visualDuration ? {
|
|
903
920
|
type: "spring",
|
|
904
921
|
visualDuration,
|
|
905
922
|
bounce: 0.25
|
|
906
923
|
} : {
|
|
907
924
|
duration: 0
|
|
908
|
-
}, $[
|
|
909
|
-
const transition =
|
|
910
|
-
let t2;
|
|
911
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
|
|
912
|
-
const initial = t2;
|
|
913
|
-
let t3;
|
|
914
|
-
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
|
|
915
|
-
const animate = t3;
|
|
925
|
+
}, $[11] = visualDuration, $[12] = t3) : t3 = $[12];
|
|
926
|
+
const transition = t3, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
|
|
916
927
|
let t4;
|
|
917
|
-
$[
|
|
918
|
-
const
|
|
928
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[13] = t4) : t4 = $[13];
|
|
929
|
+
const initial = t4;
|
|
919
930
|
let t5;
|
|
920
|
-
$[
|
|
921
|
-
const
|
|
931
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[14] = t5) : t5 = $[14];
|
|
932
|
+
const animate = t5;
|
|
933
|
+
let t6;
|
|
934
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
|
|
935
|
+
const exit = t6;
|
|
922
936
|
let t7;
|
|
923
|
-
$[16]
|
|
924
|
-
|
|
925
|
-
$[18] !== description || $[19] !== transition ? (t8 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t8) : t8 = $[20];
|
|
937
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = toast(), $[16] = t7) : t7 = $[16];
|
|
938
|
+
const t8 = hasDuration ? "" : void 0;
|
|
926
939
|
let t9;
|
|
927
|
-
$[
|
|
928
|
-
t7,
|
|
929
|
-
t8
|
|
930
|
-
] }) }), $[21] = t7, $[22] = t8, $[23] = t9) : t9 = $[23];
|
|
940
|
+
$[17] !== title ? (t9 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
|
|
931
941
|
let t10;
|
|
932
|
-
$[
|
|
933
|
-
verticalAlign: "top"
|
|
934
|
-
} }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t10) : t10 = $[27];
|
|
942
|
+
$[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];
|
|
935
943
|
let t11;
|
|
936
|
-
$[
|
|
944
|
+
$[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { gap: 3, children: [
|
|
937
945
|
t9,
|
|
938
946
|
t10
|
|
939
|
-
] }), $[
|
|
947
|
+
] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
|
|
940
948
|
let t12;
|
|
941
|
-
$[
|
|
942
|
-
|
|
943
|
-
|
|
949
|
+
$[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: {
|
|
950
|
+
verticalAlign: "top"
|
|
951
|
+
} }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
|
|
952
|
+
let t13;
|
|
953
|
+
$[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
|
|
954
|
+
t11,
|
|
955
|
+
t12
|
|
956
|
+
] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
|
|
957
|
+
let t14;
|
|
958
|
+
$[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: [
|
|
959
|
+
/* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
|
|
960
|
+
/* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
|
|
944
961
|
scaleX: 0
|
|
945
962
|
}, animate: {
|
|
946
963
|
scaleX: 1
|
|
@@ -949,12 +966,12 @@ function Toast(props) {
|
|
|
949
966
|
duration: duration / 1e3,
|
|
950
967
|
ease: "linear"
|
|
951
968
|
}, onAnimationComplete: onClose }, `progress-${updatedAt}`)
|
|
952
|
-
] }), $[
|
|
953
|
-
let
|
|
954
|
-
return $[
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
] }), $[
|
|
969
|
+
] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
|
|
970
|
+
let t15;
|
|
971
|
+
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: [
|
|
972
|
+
t13,
|
|
973
|
+
t14
|
|
974
|
+
] }), $[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;
|
|
958
975
|
}
|
|
959
976
|
Toast.displayName = "Toast";
|
|
960
977
|
const container = {
|
|
@@ -994,9 +1011,9 @@ const container = {
|
|
|
994
1011
|
visible: {
|
|
995
1012
|
opacity: 1
|
|
996
1013
|
}
|
|
997
|
-
}, MotionCard =
|
|
1014
|
+
}, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
|
|
998
1015
|
function useMounted() {
|
|
999
|
-
return
|
|
1016
|
+
return useSyncExternalStore(subscribe, _temp$1, _temp2);
|
|
1000
1017
|
}
|
|
1001
1018
|
function _temp2() {
|
|
1002
1019
|
return !1;
|
|
@@ -1005,25 +1022,26 @@ function _temp$1() {
|
|
|
1005
1022
|
return !0;
|
|
1006
1023
|
}
|
|
1007
1024
|
const subscribe = () => () => {
|
|
1008
|
-
}, ToastContext =
|
|
1025
|
+
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
|
|
1009
1026
|
function ToastLayer(props) {
|
|
1010
|
-
const $ =
|
|
1027
|
+
const $ = c(11), {
|
|
1028
|
+
as: t0,
|
|
1011
1029
|
children,
|
|
1012
|
-
padding:
|
|
1030
|
+
padding: t1,
|
|
1013
1031
|
paddingX,
|
|
1014
1032
|
paddingY,
|
|
1015
|
-
gap:
|
|
1016
|
-
} = props,
|
|
1033
|
+
gap: t2
|
|
1034
|
+
} = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
|
|
1017
1035
|
zIndex
|
|
1018
|
-
} =
|
|
1019
|
-
let t2;
|
|
1020
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = css.toastLayer(), $[0] = t2) : t2 = $[0];
|
|
1036
|
+
} = useLayer();
|
|
1021
1037
|
let t3;
|
|
1022
|
-
$[
|
|
1023
|
-
zIndex
|
|
1024
|
-
}, $[1] = zIndex, $[2] = t3) : t3 = $[2];
|
|
1038
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
|
|
1025
1039
|
let t4;
|
|
1026
|
-
|
|
1040
|
+
$[1] !== zIndex ? (t4 = {
|
|
1041
|
+
zIndex
|
|
1042
|
+
}, $[1] = zIndex, $[2] = t4) : t4 = $[2];
|
|
1043
|
+
let t5;
|
|
1044
|
+
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;
|
|
1027
1045
|
}
|
|
1028
1046
|
ToastLayer.displayName = "ToastLayer";
|
|
1029
1047
|
let toastId = 0;
|
|
@@ -1031,7 +1049,7 @@ function generateToastId() {
|
|
|
1031
1049
|
return String(toastId++);
|
|
1032
1050
|
}
|
|
1033
1051
|
function ToastProvider(props) {
|
|
1034
|
-
const $ =
|
|
1052
|
+
const $ = c(13), {
|
|
1035
1053
|
children,
|
|
1036
1054
|
padding,
|
|
1037
1055
|
paddingX,
|
|
@@ -1041,17 +1059,17 @@ function ToastProvider(props) {
|
|
|
1041
1059
|
} = props, zOffset = t0 === void 0 ? 1 : t0;
|
|
1042
1060
|
let t1;
|
|
1043
1061
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
1044
|
-
const [state, setState] =
|
|
1062
|
+
const [state, setState] = useState(t1), mounted = useMounted();
|
|
1045
1063
|
let t2, t3;
|
|
1046
1064
|
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1047
1065
|
version: 0,
|
|
1048
1066
|
push: (params) => {
|
|
1049
1067
|
const id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
1050
|
-
return
|
|
1068
|
+
return startTransition(() => {
|
|
1051
1069
|
setState((prevState) => {
|
|
1052
1070
|
if (duration === 0.01)
|
|
1053
|
-
return prevState.filter((
|
|
1054
|
-
const dismiss = () =>
|
|
1071
|
+
return prevState.filter((toast2) => toast2.id !== id);
|
|
1072
|
+
const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
|
|
1055
1073
|
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
1056
1074
|
dismiss,
|
|
1057
1075
|
id,
|
|
@@ -1067,9 +1085,9 @@ function ToastProvider(props) {
|
|
|
1067
1085
|
}, $[1] = t3) : t3 = $[1], t2 = t3;
|
|
1068
1086
|
const value = t2;
|
|
1069
1087
|
let t4;
|
|
1070
|
-
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */
|
|
1088
|
+
$[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];
|
|
1071
1089
|
let t5;
|
|
1072
|
-
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */
|
|
1090
|
+
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
1073
1091
|
children,
|
|
1074
1092
|
t4
|
|
1075
1093
|
] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
|
|
@@ -1081,14 +1099,14 @@ function _temp(t0) {
|
|
|
1081
1099
|
params: params_0,
|
|
1082
1100
|
updatedAt
|
|
1083
1101
|
} = t0;
|
|
1084
|
-
return /* @__PURE__ */
|
|
1102
|
+
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);
|
|
1085
1103
|
}
|
|
1086
1104
|
ToastProvider.displayName = "ToastProvider";
|
|
1087
1105
|
function useToast() {
|
|
1088
|
-
const value =
|
|
1106
|
+
const value = useContext(ToastContext);
|
|
1089
1107
|
if (!value)
|
|
1090
1108
|
throw new Error("useToast(): missing context value");
|
|
1091
|
-
if (!
|
|
1109
|
+
if (!isRecord(value) || value.version !== 0)
|
|
1092
1110
|
throw new Error("useToast(): the context value is not compatible");
|
|
1093
1111
|
return value;
|
|
1094
1112
|
}
|
|
@@ -1146,38 +1164,40 @@ function _focusItemElement(el) {
|
|
|
1146
1164
|
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
1147
1165
|
}
|
|
1148
1166
|
}
|
|
1149
|
-
const TreeContext =
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1167
|
+
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
|
|
1168
|
+
function Tree(props) {
|
|
1169
|
+
const $ = c(39), t0 = props;
|
|
1170
|
+
let children, forwardedRef, gap, onFocus, rest, t1;
|
|
1171
|
+
$[0] !== t0 ? ({
|
|
1153
1172
|
children,
|
|
1154
1173
|
gap,
|
|
1155
|
-
space:
|
|
1174
|
+
space: t1,
|
|
1156
1175
|
onFocus,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
|
|
1165
|
-
const [itemElements, setItemElements] = react.useState(t3);
|
|
1176
|
+
ref: forwardedRef,
|
|
1177
|
+
...rest
|
|
1178
|
+
} = 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]);
|
|
1179
|
+
const space = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
|
|
1180
|
+
let t2, t3;
|
|
1181
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
|
|
1182
|
+
const path = t2;
|
|
1166
1183
|
let t4;
|
|
1167
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 =
|
|
1168
|
-
const [
|
|
1184
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
|
|
1185
|
+
const [itemElements, setItemElements] = useState(t4);
|
|
1169
1186
|
let t5;
|
|
1170
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 =
|
|
1171
|
-
|
|
1172
|
-
|
|
1187
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
|
|
1188
|
+
const [state, setState] = useState(t5), stateRef = useRef(state);
|
|
1189
|
+
let t6;
|
|
1190
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], useImperativeHandle(forwardedRef, t6);
|
|
1191
|
+
let t7, t8;
|
|
1192
|
+
$[11] !== focusedElement ? (t7 = () => {
|
|
1173
1193
|
focusedElementRef.current = focusedElement;
|
|
1174
|
-
},
|
|
1175
|
-
let
|
|
1176
|
-
$[
|
|
1194
|
+
}, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
|
|
1195
|
+
let t10, t9;
|
|
1196
|
+
$[14] !== state ? (t9 = () => {
|
|
1177
1197
|
stateRef.current = state;
|
|
1178
|
-
},
|
|
1179
|
-
let
|
|
1180
|
-
$[
|
|
1198
|
+
}, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), useEffect(t9, t10);
|
|
1199
|
+
let t11;
|
|
1200
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
1181
1201
|
...s,
|
|
1182
1202
|
[path_0]: {
|
|
1183
1203
|
element,
|
|
@@ -1190,10 +1210,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
|
|
|
1190
1210
|
};
|
|
1191
1211
|
return delete newState[path_0], newState;
|
|
1192
1212
|
});
|
|
1193
|
-
}), $[
|
|
1194
|
-
const registerItem =
|
|
1195
|
-
let
|
|
1196
|
-
$[
|
|
1213
|
+
}), $[17] = t11) : t11 = $[17];
|
|
1214
|
+
const registerItem = t11;
|
|
1215
|
+
let t12;
|
|
1216
|
+
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
|
|
1197
1217
|
setState((s_1) => {
|
|
1198
1218
|
const itemState = s_1[path_1];
|
|
1199
1219
|
return itemState ? {
|
|
@@ -1204,14 +1224,14 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
|
|
|
1204
1224
|
}
|
|
1205
1225
|
} : s_1;
|
|
1206
1226
|
});
|
|
1207
|
-
}, $[
|
|
1208
|
-
const setExpanded =
|
|
1209
|
-
let
|
|
1210
|
-
const
|
|
1211
|
-
let
|
|
1212
|
-
$[
|
|
1227
|
+
}, $[18] = t12) : t12 = $[18];
|
|
1228
|
+
const setExpanded = t12;
|
|
1229
|
+
let t13;
|
|
1230
|
+
const t14 = focusedElement || itemElements[0] || null;
|
|
1231
|
+
let t15;
|
|
1232
|
+
$[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
|
|
1213
1233
|
version: 0,
|
|
1214
|
-
focusedElement:
|
|
1234
|
+
focusedElement: t14,
|
|
1215
1235
|
level: 0,
|
|
1216
1236
|
path,
|
|
1217
1237
|
registerItem,
|
|
@@ -1219,10 +1239,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
|
|
|
1219
1239
|
setFocusedElement,
|
|
1220
1240
|
space,
|
|
1221
1241
|
state
|
|
1222
|
-
}, $[
|
|
1223
|
-
const contextValue =
|
|
1224
|
-
let
|
|
1225
|
-
$[
|
|
1242
|
+
}, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
|
|
1243
|
+
const contextValue = t13;
|
|
1244
|
+
let t16;
|
|
1245
|
+
$[23] !== itemElements ? (t16 = (event) => {
|
|
1226
1246
|
if (focusedElementRef.current) {
|
|
1227
1247
|
if (event.key === "ArrowDown") {
|
|
1228
1248
|
event.preventDefault();
|
|
@@ -1281,47 +1301,50 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
|
|
|
1281
1301
|
return;
|
|
1282
1302
|
}
|
|
1283
1303
|
}
|
|
1284
|
-
}, $[
|
|
1285
|
-
const handleKeyDown =
|
|
1286
|
-
let t16;
|
|
1287
|
-
$[24] !== onFocus ? (t16 = (event_0) => {
|
|
1288
|
-
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1289
|
-
}, $[24] = onFocus, $[25] = t16) : t16 = $[25];
|
|
1290
|
-
const handleFocus = t16;
|
|
1304
|
+
}, $[23] = itemElements, $[24] = t16) : t16 = $[24];
|
|
1305
|
+
const handleKeyDown = t16;
|
|
1291
1306
|
let t17;
|
|
1292
|
-
$[
|
|
1307
|
+
$[25] !== onFocus ? (t17 = (event_0) => {
|
|
1308
|
+
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1309
|
+
}, $[25] = onFocus, $[26] = t17) : t17 = $[26];
|
|
1310
|
+
const handleFocus = t17;
|
|
1311
|
+
let t18;
|
|
1312
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
|
|
1293
1313
|
if (!ref.current)
|
|
1294
1314
|
return;
|
|
1295
1315
|
const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
|
|
1296
1316
|
setItemElements(_itemElements);
|
|
1297
|
-
}, $[
|
|
1298
|
-
let
|
|
1299
|
-
$[
|
|
1300
|
-
const
|
|
1301
|
-
let t20;
|
|
1302
|
-
$[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...restProps, gap: t19, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = t19, $[34] = t20) : t20 = $[34];
|
|
1317
|
+
}, $[27] = t18) : t18 = $[27];
|
|
1318
|
+
let t19;
|
|
1319
|
+
$[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], useEffect(t18, t19);
|
|
1320
|
+
const t20 = gap ?? space;
|
|
1303
1321
|
let t21;
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1322
|
+
$[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];
|
|
1323
|
+
let t22;
|
|
1324
|
+
return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
|
|
1325
|
+
}
|
|
1326
|
+
Tree.displayName = "Tree";
|
|
1307
1327
|
function useTree() {
|
|
1308
|
-
const tree =
|
|
1328
|
+
const tree = useContext(TreeContext);
|
|
1309
1329
|
if (!tree)
|
|
1310
1330
|
throw new Error("Tree: missing context value");
|
|
1311
1331
|
return tree;
|
|
1312
1332
|
}
|
|
1313
|
-
const TreeGroup =
|
|
1314
|
-
const $ =
|
|
1315
|
-
let children,
|
|
1316
|
-
$[0] !==
|
|
1333
|
+
const TreeGroup = memo(function(props) {
|
|
1334
|
+
const $ = c(9), t0 = props;
|
|
1335
|
+
let children, rest, t1;
|
|
1336
|
+
$[0] !== t0 ? ({
|
|
1317
1337
|
children,
|
|
1318
|
-
expanded:
|
|
1319
|
-
...
|
|
1320
|
-
} =
|
|
1321
|
-
const expanded =
|
|
1322
|
-
let
|
|
1323
|
-
return $[4] !== children || $[5] !==
|
|
1324
|
-
})
|
|
1338
|
+
expanded: t1,
|
|
1339
|
+
...rest
|
|
1340
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
|
|
1341
|
+
const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
|
|
1342
|
+
let t3;
|
|
1343
|
+
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;
|
|
1344
|
+
});
|
|
1345
|
+
TreeGroup.displayName = "TreeGroup";
|
|
1346
|
+
const DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
1347
|
+
function TreeItem(props) {
|
|
1325
1348
|
const {
|
|
1326
1349
|
children,
|
|
1327
1350
|
className,
|
|
@@ -1339,205 +1362,232 @@ const TreeGroup = react.memo(function(props) {
|
|
|
1339
1362
|
space = 2,
|
|
1340
1363
|
text,
|
|
1341
1364
|
weight,
|
|
1342
|
-
...
|
|
1343
|
-
} = props, rootRef =
|
|
1365
|
+
...rest
|
|
1366
|
+
} = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
1344
1367
|
path,
|
|
1345
1368
|
registerItem,
|
|
1346
1369
|
setExpanded,
|
|
1347
1370
|
setFocusedElement
|
|
1348
|
-
} = tree, _id =
|
|
1371
|
+
} = 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(() => ({
|
|
1349
1372
|
...tree,
|
|
1350
1373
|
level: tree.level + 1,
|
|
1351
1374
|
path: itemPath
|
|
1352
|
-
}), [itemPath, tree]), handleClick =
|
|
1375
|
+
}), [itemPath, tree]), handleClick = useCallback((event) => {
|
|
1353
1376
|
onClick && onClick(event);
|
|
1354
1377
|
const target = event.target;
|
|
1355
1378
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
|
|
1356
|
-
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown =
|
|
1379
|
+
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
|
|
1357
1380
|
focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
|
|
1358
1381
|
}, [focused]);
|
|
1359
|
-
|
|
1382
|
+
useEffect(() => {
|
|
1360
1383
|
if (rootRef.current)
|
|
1361
1384
|
return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
|
|
1362
1385
|
}, [expanded, itemPath, registerItem, selected]);
|
|
1363
|
-
const content2 = /* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1386
|
+
const content2 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
|
|
1387
|
+
/* @__PURE__ */ jsxs(Box, { style: {
|
|
1365
1388
|
visibility: IconComponent || children ? "visible" : "hidden",
|
|
1366
1389
|
pointerEvents: "none"
|
|
1367
1390
|
}, children: [
|
|
1368
|
-
IconComponent && /* @__PURE__ */
|
|
1369
|
-
!IconComponent && /* @__PURE__ */
|
|
1391
|
+
IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
|
|
1392
|
+
!IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
|
|
1370
1393
|
transform: expanded ? "rotate(90deg)" : void 0
|
|
1371
1394
|
} }) })
|
|
1372
1395
|
] }),
|
|
1373
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
|
|
1374
1397
|
] });
|
|
1375
|
-
return href ? /* @__PURE__ */
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
paddingLeft: `calc(
|
|
1398
|
+
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: [
|
|
1399
|
+
/* @__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: {
|
|
1400
|
+
paddingLeft: `calc(${vars.space[2]} * ${tree.level})`
|
|
1378
1401
|
}, children: content2 }),
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
] }) : /* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
paddingLeft: `calc(
|
|
1402
|
+
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
|
|
1403
|
+
] }) : /* @__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: [
|
|
1404
|
+
/* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
|
|
1405
|
+
paddingLeft: `calc(${vars.space[2]} * ${tree.level})`
|
|
1383
1406
|
}, children: content2 }),
|
|
1384
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
|
|
1385
1408
|
] });
|
|
1386
|
-
}
|
|
1387
|
-
TreeItem.displayName = "
|
|
1388
|
-
function StyleTags(
|
|
1389
|
-
const $ =
|
|
1390
|
-
theme: themeProp
|
|
1391
|
-
} = props;
|
|
1409
|
+
}
|
|
1410
|
+
TreeItem.displayName = "TreeItem";
|
|
1411
|
+
function StyleTags() {
|
|
1412
|
+
const $ = c(2);
|
|
1392
1413
|
let t0;
|
|
1393
|
-
$[0]
|
|
1394
|
-
const theme$1 = t0;
|
|
1414
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx("style", { href: "sanity-theme", precedence: "theme", children: _compileTheme() }), $[0] = t0) : t0 = $[0];
|
|
1395
1415
|
let t1;
|
|
1396
|
-
$[
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
$[6] !== theme$1 ? (t3 = css.compileTheme({
|
|
1401
|
-
v3: theme$1
|
|
1402
|
-
}), $[6] = theme$1, $[7] = t3) : t3 = $[7];
|
|
1403
|
-
let t4;
|
|
1404
|
-
$[8] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-theme", precedence: "theme", children: t3 }), $[8] = t3, $[9] = t4) : t4 = $[9];
|
|
1405
|
-
let t5;
|
|
1406
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-system", precedence: "system", children: css.compileSystem() }), $[10] = t5) : t5 = $[10];
|
|
1407
|
-
let t6;
|
|
1408
|
-
return $[11] !== t2 || $[12] !== t4 ? (t6 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1409
|
-
t2,
|
|
1410
|
-
t4,
|
|
1411
|
-
t5
|
|
1412
|
-
] }), $[11] = t2, $[12] = t4, $[13] = t6) : t6 = $[13], t6;
|
|
1416
|
+
return $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1417
|
+
t0,
|
|
1418
|
+
/* @__PURE__ */ jsx("style", { href: "sanity-system", precedence: "system", children: _compileSystem() })
|
|
1419
|
+
] }), $[1] = t1) : t1 = $[1], t1;
|
|
1413
1420
|
}
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
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
|
-
|
|
1421
|
+
StyleTags.displayName = "StyleTags";
|
|
1422
|
+
export {
|
|
1423
|
+
Arrow,
|
|
1424
|
+
Autocomplete,
|
|
1425
|
+
Avatar,
|
|
1426
|
+
AvatarCounter,
|
|
1427
|
+
AvatarStack,
|
|
1428
|
+
Badge,
|
|
1429
|
+
BoundaryElementProvider,
|
|
1430
|
+
Box,
|
|
1431
|
+
Breadcrumbs,
|
|
1432
|
+
Button,
|
|
1433
|
+
Card,
|
|
1434
|
+
CardProvider,
|
|
1435
|
+
Checkbox,
|
|
1436
|
+
Code,
|
|
1437
|
+
CodeSkeleton,
|
|
1438
|
+
Container,
|
|
1439
|
+
DEFAULT_ARROW_ELEMENT,
|
|
1440
|
+
DEFAULT_AUTOCOMPLETE_ELEMENT,
|
|
1441
|
+
DEFAULT_AVATAR_COUNTER_ELEMENT,
|
|
1442
|
+
DEFAULT_AVATAR_ELEMENT,
|
|
1443
|
+
DEFAULT_AVATAR_STACK_ELEMENT,
|
|
1444
|
+
DEFAULT_BADGE_ELEMENT,
|
|
1445
|
+
DEFAULT_BOX_ELEMENT,
|
|
1446
|
+
DEFAULT_BREADCRUMBS_ELEMENT,
|
|
1447
|
+
DEFAULT_BUTTON_ELEMENT,
|
|
1448
|
+
DEFAULT_CARD_ELEMENT,
|
|
1449
|
+
DEFAULT_CHECKBOX_ELEMENT,
|
|
1450
|
+
DEFAULT_CODE_ELEMENT,
|
|
1451
|
+
DEFAULT_CODE_SKELETON_ELEMENT,
|
|
1452
|
+
DEFAULT_CONTAINER_ELEMENT,
|
|
1453
|
+
DEFAULT_DIALOG_ELEMENT,
|
|
1454
|
+
DEFAULT_ELEMENT_QUERY_ELEMENT,
|
|
1455
|
+
DEFAULT_FLEX_ELEMENT,
|
|
1456
|
+
DEFAULT_GRID_ELEMENT,
|
|
1457
|
+
DEFAULT_HEADING_ELEMENT,
|
|
1458
|
+
DEFAULT_HEADING_SKELETON_ELEMENT,
|
|
1459
|
+
DEFAULT_HOTKEYS_ELEMENT,
|
|
1460
|
+
DEFAULT_INLINE_ELEMENT,
|
|
1461
|
+
DEFAULT_KBD_ELEMENT,
|
|
1462
|
+
DEFAULT_LABEL_ELEMENT,
|
|
1463
|
+
DEFAULT_LABEL_SKELETON_ELEMENT,
|
|
1464
|
+
DEFAULT_LAYER_ELEMENT,
|
|
1465
|
+
DEFAULT_MENU_DIVIDER_ELEMENT,
|
|
1466
|
+
DEFAULT_MENU_ELEMENT,
|
|
1467
|
+
DEFAULT_MENU_GROUP_ELEMENT,
|
|
1468
|
+
DEFAULT_MENU_ITEM_ELEMENT,
|
|
1469
|
+
DEFAULT_POPOVER_ELEMENT,
|
|
1470
|
+
DEFAULT_RADIO_ELEMENT,
|
|
1471
|
+
DEFAULT_SELECT_ELEMENT,
|
|
1472
|
+
DEFAULT_SKELETON_ELEMENT,
|
|
1473
|
+
DEFAULT_SPINNER_ELEMENT,
|
|
1474
|
+
DEFAULT_SR_ONLY_ELEMENT,
|
|
1475
|
+
DEFAULT_STACK_ELEMENT,
|
|
1476
|
+
DEFAULT_SWITCH_ELEMENT,
|
|
1477
|
+
DEFAULT_TAB_ELEMENT,
|
|
1478
|
+
DEFAULT_TAB_LIST_ELEMENT,
|
|
1479
|
+
DEFAULT_TAB_PANEL_ELEMENT,
|
|
1480
|
+
DEFAULT_TEXT_AREA_ELEMENT,
|
|
1481
|
+
DEFAULT_TEXT_ELEMENT,
|
|
1482
|
+
DEFAULT_TEXT_INPUT_ELEMENT,
|
|
1483
|
+
DEFAULT_TEXT_SKELETON_ELEMENT,
|
|
1484
|
+
DEFAULT_TOAST_ELEMENT,
|
|
1485
|
+
DEFAULT_TOOLTIP_ELEMENT,
|
|
1486
|
+
DEFAULT_TREE_ELEMENT,
|
|
1487
|
+
DEFAULT_TREE_ITEM_ELEMENT,
|
|
1488
|
+
DEFAULT_VIRTUAL_LIST_ELEMENT,
|
|
1489
|
+
Dialog,
|
|
1490
|
+
DialogContext,
|
|
1491
|
+
DialogProvider,
|
|
1492
|
+
ElementQuery,
|
|
1493
|
+
ErrorBoundary,
|
|
1494
|
+
Flex,
|
|
1495
|
+
Grid,
|
|
1496
|
+
Heading,
|
|
1497
|
+
HeadingSkeleton,
|
|
1498
|
+
Hotkeys,
|
|
1499
|
+
Inline,
|
|
1500
|
+
KBD,
|
|
1501
|
+
Label,
|
|
1502
|
+
LabelSkeleton,
|
|
1503
|
+
Layer,
|
|
1504
|
+
LayerProvider,
|
|
1505
|
+
Menu,
|
|
1506
|
+
MenuButton,
|
|
1507
|
+
MenuDivider,
|
|
1508
|
+
MenuGroup,
|
|
1509
|
+
MenuItem,
|
|
1510
|
+
Popover,
|
|
1511
|
+
Portal,
|
|
1512
|
+
PortalProvider,
|
|
1513
|
+
Radio,
|
|
1514
|
+
Select,
|
|
1515
|
+
Skeleton,
|
|
1516
|
+
Spinner,
|
|
1517
|
+
SrOnly,
|
|
1518
|
+
Stack,
|
|
1519
|
+
StyleTags,
|
|
1520
|
+
Switch,
|
|
1521
|
+
Tab,
|
|
1522
|
+
TabList,
|
|
1523
|
+
TabPanel,
|
|
1524
|
+
Text,
|
|
1525
|
+
TextArea,
|
|
1526
|
+
TextInput,
|
|
1527
|
+
TextSkeleton,
|
|
1528
|
+
ThemeColorProvider,
|
|
1529
|
+
ThemeProvider,
|
|
1530
|
+
Toast,
|
|
1531
|
+
ToastProvider,
|
|
1532
|
+
Tooltip,
|
|
1533
|
+
TooltipDelayGroupContext,
|
|
1534
|
+
TooltipDelayGroupProvider,
|
|
1535
|
+
Tree,
|
|
1536
|
+
TreeItem,
|
|
1537
|
+
VirtualList,
|
|
1538
|
+
_ResizeObserver,
|
|
1539
|
+
_elementSizeObserver,
|
|
1540
|
+
_getArrayProp,
|
|
1541
|
+
_hasFocus,
|
|
1542
|
+
_isEnterToClickElement,
|
|
1543
|
+
_isScrollable,
|
|
1544
|
+
_raf,
|
|
1545
|
+
_raf2,
|
|
1546
|
+
_responsive,
|
|
1547
|
+
attemptFocus,
|
|
1548
|
+
containsOrEqualsElement,
|
|
1549
|
+
createColorTheme,
|
|
1550
|
+
focusFirstDescendant,
|
|
1551
|
+
focusLastDescendant,
|
|
1552
|
+
hexToRgb,
|
|
1553
|
+
hslToRgb,
|
|
1554
|
+
isFocusable,
|
|
1555
|
+
isHTMLAnchorElement,
|
|
1556
|
+
isHTMLButtonElement,
|
|
1557
|
+
isHTMLElement,
|
|
1558
|
+
isHTMLInputElement,
|
|
1559
|
+
isHTMLSelectElement,
|
|
1560
|
+
isHTMLTextAreaElement,
|
|
1561
|
+
multiply,
|
|
1562
|
+
parseColor,
|
|
1563
|
+
px,
|
|
1564
|
+
rem,
|
|
1565
|
+
rgbToHex,
|
|
1566
|
+
rgbToHsl,
|
|
1567
|
+
rgba,
|
|
1568
|
+
screen,
|
|
1569
|
+
useArrayProp,
|
|
1570
|
+
useBoundaryElement,
|
|
1571
|
+
useCard,
|
|
1572
|
+
useClickOutside,
|
|
1573
|
+
useClickOutsideEvent,
|
|
1574
|
+
useCustomValidity,
|
|
1575
|
+
useDialog,
|
|
1576
|
+
useElementRect,
|
|
1577
|
+
useElementSize,
|
|
1578
|
+
useForwardedRef,
|
|
1579
|
+
useGlobalKeyDown,
|
|
1580
|
+
useLayer,
|
|
1581
|
+
useMatchMedia,
|
|
1582
|
+
useMediaIndex,
|
|
1583
|
+
usePortal,
|
|
1584
|
+
usePrefersDark,
|
|
1585
|
+
usePrefersReducedMotion,
|
|
1586
|
+
useRootTheme,
|
|
1587
|
+
useTheme,
|
|
1588
|
+
useTheme_v2,
|
|
1589
|
+
useToast,
|
|
1590
|
+
useTooltipDelayGroup,
|
|
1591
|
+
useTree
|
|
1592
|
+
};
|
|
1543
1593
|
//# sourceMappingURL=index.js.map
|