@sanity/ui 3.0.0-static.2 → 3.0.0-static.21
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 +7 -6
- package/bin/{ui.js → sanity-ui.cjs} +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +2488 -0
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -2
- package/dist/_chunks-cjs/refractor.cjs.map +1 -0
- package/dist/_chunks-es/_visual-editing.js +2500 -0
- package/dist/_chunks-es/_visual-editing.js.map +1 -0
- package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -2
- 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 +893 -0
- package/dist/_visual-editing.d.ts +503 -416
- package/dist/_visual-editing.js +29 -30
- package/dist/_visual-editing.js.map +1 -1
- package/dist/css.cjs +598 -0
- package/dist/css.cjs.map +1 -0
- package/dist/css.d.cts +14884 -0
- package/dist/css.d.ts +14379 -1630
- package/dist/css.js +480 -4594
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +2222 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +1284 -961
- package/dist/index.d.ts +1284 -961
- package/dist/index.js +1270 -592
- package/dist/index.js.map +1 -1
- package/dist/{theme.mjs → theme.cjs} +2843 -2571
- package/dist/theme.cjs.map +1 -0
- package/dist/{theme.d.mts → theme.d.cts} +331 -311
- package/dist/theme.d.ts +331 -311
- package/dist/theme.js +2843 -2569
- package/dist/theme.js.map +1 -1
- package/dist/ui.css +22564 -0
- package/exports/_visual-editing.ts +0 -1
- package/package.json +84 -79
- package/src/cli/buildCommand.ts +3 -41
- package/src/cli/index.ts +2 -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 -10
- package/src/core/_compat/theme/themeContext.ts +5 -5
- package/src/core/_compat/theme/themeProvider.tsx +19 -13
- 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 +106 -140
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -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 +32 -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 -304
- package/src/core/components/dialog/dialogCard.tsx +190 -0
- package/src/core/components/dialog/dialogContext.ts +5 -3
- package/src/core/components/dialog/dialogProvider.tsx +6 -7
- 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 +41 -27
- 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 +27 -35
- package/src/core/components/menu/menuButton.tsx +18 -24
- package/src/core/components/menu/menuContext.ts +1 -1
- package/src/core/components/menu/menuDivider.tsx +25 -15
- package/src/core/components/menu/menuGroup.tsx +39 -33
- package/src/core/components/menu/menuItem.tsx +58 -46
- 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 +49 -0
- package/src/core/components/skeleton/headingSkeleton.tsx +48 -0
- package/src/core/components/skeleton/index.ts +3 -0
- package/src/core/components/skeleton/labelSkeleton.tsx +47 -0
- package/src/core/components/skeleton/skeleton.tsx +37 -18
- package/src/core/components/skeleton/textSkeleton.tsx +29 -112
- package/src/core/components/tab/__workshop__/example.tsx +2 -2
- package/src/core/components/tab/tab.tsx +28 -26
- package/src/core/components/tab/tabList.tsx +49 -28
- package/src/core/components/tab/tabPanel.tsx +29 -22
- 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 +30 -57
- package/src/core/components/toast/toastContext.ts +1 -1
- package/src/core/components/toast/toastLayer.tsx +29 -13
- package/src/core/components/toast/toastProvider.tsx +5 -10
- 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 +196 -191
- package/src/core/components/tree/treeContext.ts +1 -1
- package/src/core/components/tree/treeGroup.tsx +24 -6
- package/src/core/components/tree/treeItem.tsx +44 -34
- 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/helpers/props.ts +18 -0
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useArrayProp.ts +1 -4
- 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/hooks/useResponsiveProp.ts +28 -0
- package/src/core/index.ts +0 -1
- package/src/core/lib/isArray.ts +3 -0
- package/src/core/middleware/origin.ts +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +33 -24
- 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 +43 -48
- package/src/core/primitives/avatar/avatarCounter.tsx +46 -39
- package/src/core/primitives/avatar/avatarStack.tsx +44 -45
- 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 -40
- 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 +153 -88
- 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 +67 -76
- 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 +52 -48
- 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 +9 -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 -23
- 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 +27 -30
- package/src/core/primitives/code/refractor.tsx +0 -2
- package/src/core/primitives/container/__workshop__/example.tsx +2 -2
- package/src/core/primitives/container/container.tsx +27 -25
- package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
- package/src/core/primitives/flex/flex.tsx +44 -17
- package/src/core/primitives/grid/grid.tsx +20 -17
- 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 +51 -33
- package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
- package/src/core/primitives/inline/inline.tsx +46 -27
- package/src/core/primitives/inline/types.ts +1 -0
- package/src/core/primitives/kbd/kbd.tsx +28 -28
- package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
- package/src/core/primitives/label/label.tsx +49 -39
- 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 +299 -335
- package/src/core/primitives/popover/popoverLayer.tsx +147 -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 +34 -19
- 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 +28 -28
- package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -9
- package/src/core/primitives/spinner/spinner.tsx +27 -15
- package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/stack/stack.tsx +44 -20
- package/src/core/primitives/switch/switch.tsx +31 -17
- 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 +52 -44
- package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
- package/src/core/primitives/textArea/textArea.tsx +47 -22
- 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 +80 -106
- 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 +107 -90
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -5
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +105 -0
- package/src/core/primitives/types.ts +19 -30
- 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/flex.ts +3 -3
- package/src/core/types/props.ts +20 -10
- package/src/core/types/selectable.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +43 -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 -10
- 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 +41 -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 +25 -95
- package/src/core/utils/layer/layerCard.tsx +90 -0
- package/src/core/utils/layer/layerContext.ts +1 -1
- package/src/core/utils/layer/layerProvider.tsx +20 -17
- 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 -11
- package/src/core/utils/portal/portalContext.ts +1 -1
- package/src/core/utils/portal/portalProvider.tsx +4 -10
- 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 +25 -27
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +71 -55
- package/src/css/__theme/index.ts +16 -0
- package/src/css/__theme/lib/contract/buildVarContract.ts +78 -0
- package/src/css/__theme/lib/contract/index.ts +4 -0
- package/src/css/__theme/lib/contract/types.ts +17 -0
- package/src/css/__theme/resolveTheme.ts +865 -0
- package/src/css/_assign.ts +3 -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/_responsiveClassName.ts +45 -0
- package/src/css/_responsiveStyle.css.ts +34 -0
- package/src/css/_style.css.ts +9 -0
- package/src/css/components/breadcrumbs/breadcrumbs.css.ts +6 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -3
- package/src/css/components/dialog/dialog.css.ts +81 -0
- package/src/css/components/dialog/dialog.ts +20 -11
- package/src/css/components/index.ts +6 -0
- package/src/css/components/menu/menu.css.ts +14 -0
- package/src/css/components/menu/menu.ts +8 -5
- package/src/css/components/skeleton/skeleton.css.ts +132 -0
- package/src/css/components/skeleton/skeleton.ts +14 -9
- package/src/css/components/skeleton/types.ts +13 -5
- package/src/css/components/toast/toast.css.ts +16 -0
- package/src/css/components/toast/toast.ts +5 -15
- package/src/css/components/tree/tree.css.ts +65 -0
- package/src/css/components/tree/tree.ts +5 -3
- package/src/css/constants.ts +10 -0
- package/src/css/defaultTheme.css.ts +468 -0
- package/src/css/index.ts +12 -38
- package/src/css/layers.css.ts +9 -0
- package/src/css/primitives/_arrow/_arrow.css.ts +68 -0
- package/src/css/primitives/_arrow/_arrow.ts +18 -6
- package/src/css/primitives/_input/_input.css.ts +258 -0
- package/src/css/primitives/_input/input.ts +17 -14
- package/src/css/primitives/_input/types.ts +3 -3
- package/src/css/primitives/_selectable/_selectable.css.ts +121 -0
- package/src/css/primitives/_selectable/selectable.ts +5 -5
- package/src/css/primitives/_selectable/types.ts +3 -2
- package/src/css/primitives/avatar/avatar.css.ts +175 -0
- package/src/css/primitives/avatar/avatar.ts +52 -11
- package/src/css/primitives/avatar/types.ts +5 -3
- package/src/css/primitives/badge/badge.css.ts +26 -0
- package/src/css/primitives/badge/badge.ts +4 -4
- package/src/css/primitives/badge/types.ts +5 -4
- package/src/css/primitives/box/box.css.ts +19 -0
- package/src/css/primitives/box/box.ts +52 -16
- package/src/css/primitives/box/types.ts +46 -22
- package/src/css/primitives/button/button.css.ts +285 -0
- package/src/css/primitives/button/button.ts +15 -33
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +19 -0
- package/src/css/primitives/card/card.css.ts +365 -0
- package/src/css/primitives/card/card.ts +9 -12
- package/src/css/primitives/card/types.ts +4 -6
- package/src/css/primitives/checkbox/checkbox.css.ts +193 -0
- package/src/css/primitives/checkbox/checkbox.ts +13 -5
- package/src/css/primitives/code/code.css.ts +271 -0
- package/src/css/primitives/code/code.ts +13 -5
- package/src/css/primitives/code/types.ts +4 -3
- package/src/css/primitives/container/container.css.ts +4 -0
- package/src/css/primitives/container/container.ts +12 -4
- package/src/css/primitives/container/types.ts +4 -2
- package/src/css/primitives/heading/heading.css.ts +85 -0
- package/src/css/primitives/heading/heading.ts +13 -11
- package/src/css/primitives/heading/types.ts +6 -3
- package/src/css/primitives/index.ts +24 -0
- package/src/css/primitives/kbd/kbd.css.ts +16 -0
- package/src/css/primitives/kbd/kbd.ts +6 -4
- package/src/css/primitives/kbd/types.ts +2 -3
- package/src/css/primitives/label/label.css.ts +85 -0
- package/src/css/primitives/label/label.ts +13 -10
- package/src/css/primitives/label/types.ts +13 -5
- package/src/css/primitives/popover/popover.css.ts +6 -0
- package/src/css/primitives/popover/popover.ts +10 -3
- package/src/css/primitives/radio/radio.css.ts +78 -0
- package/src/css/primitives/radio/radio.ts +15 -3
- package/src/css/primitives/select/select.css.ts +24 -0
- package/src/css/primitives/select/select.ts +7 -4
- package/src/css/primitives/select/types.ts +1 -1
- package/src/css/primitives/spinner/index.ts +1 -0
- package/src/css/primitives/spinner/spinner.css.ts +23 -0
- package/src/css/primitives/spinner/spinner.ts +9 -5
- package/src/css/primitives/spinner/types.ts +4 -0
- package/src/css/primitives/stack/index.ts +1 -0
- package/src/css/primitives/stack/stack.css.ts +6 -0
- package/src/css/primitives/stack/stack.ts +7 -0
- package/src/css/primitives/switch/switch.css.ts +98 -0
- package/src/css/primitives/switch/switch.ts +13 -7
- package/src/css/primitives/text/text.css.ts +85 -0
- package/src/css/primitives/text/text.ts +13 -11
- package/src/css/primitives/text/types.ts +9 -3
- package/src/css/primitives/textArea/textArea.css.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +5 -3
- package/src/css/primitives/textArea/types.ts +5 -3
- package/src/css/primitives/textInput/textInput.css.ts +41 -0
- package/src/css/primitives/textInput/textInput.ts +20 -4
- package/src/css/primitives/textInput/types.ts +3 -7
- package/src/css/primitives/tooltip/index.ts +1 -0
- package/src/css/primitives/tooltip/tooltip.css.ts +6 -0
- package/src/css/primitives/tooltip/tooltip.ts +8 -7
- package/src/css/primitives/tooltip/types.ts +4 -0
- package/src/css/props/alignItems/alignItems.css.ts +22 -0
- package/src/css/props/alignItems/alignItems.ts +8 -0
- package/src/css/props/alignItems/index.ts +2 -0
- package/src/css/props/alignItems/types.ts +9 -0
- package/src/css/props/border/border.css.ts +65 -0
- package/src/css/props/border/border.ts +36 -0
- package/src/css/props/border/types.ts +13 -0
- package/src/css/props/boxSizing/boxSizing.css.ts +11 -0
- package/src/css/props/boxSizing/boxSizing.ts +10 -0
- package/src/css/props/boxSizing/index.ts +2 -0
- package/src/css/props/boxSizing/types.ts +7 -0
- package/src/css/props/display/display.css.ts +56 -0
- package/src/css/props/display/display.ts +17 -0
- package/src/css/{styles → props}/display/types.ts +3 -4
- package/src/css/props/flex/flex.css.ts +52 -0
- package/src/css/props/flex/flex.ts +8 -0
- package/src/css/props/flex/types.ts +9 -0
- package/src/css/props/flexDirection/flexDirection.css.ts +19 -0
- package/src/css/props/flexDirection/flexDirection.ts +8 -0
- package/src/css/props/flexDirection/index.ts +2 -0
- package/src/css/props/flexDirection/types.ts +9 -0
- package/src/css/props/flexWrap/flexWrap.css.ts +16 -0
- package/src/css/props/flexWrap/flexWrap.ts +8 -0
- package/src/css/props/flexWrap/index.ts +2 -0
- package/src/css/props/flexWrap/types.ts +9 -0
- package/src/css/props/font/font.css.ts +93 -0
- package/src/css/props/font/font.ts +8 -0
- package/src/css/props/font/types.ts +6 -0
- package/src/css/props/gap/gap.css.ts +40 -0
- package/src/css/props/gap/gap.ts +13 -0
- package/src/css/{styles → props}/gap/types.ts +2 -2
- package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
- package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -0
- package/src/css/props/gridAutoColumns/index.ts +2 -0
- package/src/css/props/gridAutoColumns/types.ts +19 -0
- package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +19 -0
- package/src/css/props/gridAutoFlow/gridAutoFlow.ts +8 -0
- package/src/css/props/gridAutoFlow/index.ts +2 -0
- package/src/css/props/gridAutoFlow/types.ts +13 -0
- package/src/css/props/gridAutoRows/gridAutoRows.css.ts +19 -0
- package/src/css/props/gridAutoRows/gridAutoRows.ts +8 -0
- package/src/css/props/gridAutoRows/index.ts +2 -0
- package/src/css/props/gridAutoRows/types.ts +13 -0
- package/src/css/props/gridColumn/gridColumn.css.ts +49 -0
- package/src/css/props/gridColumn/gridColumn.ts +8 -0
- package/src/css/props/gridColumn/index.ts +2 -0
- package/src/css/props/gridColumn/types.ts +19 -0
- package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +46 -0
- package/src/css/props/gridColumnEnd/gridColumnEnd.ts +8 -0
- package/src/css/props/gridColumnEnd/index.ts +2 -0
- package/src/css/props/gridColumnEnd/types.ts +19 -0
- package/src/css/props/gridColumnStart/gridColumnStart.css.ts +46 -0
- package/src/css/props/gridColumnStart/gridColumnStart.ts +11 -0
- package/src/css/props/gridColumnStart/index.ts +2 -0
- package/src/css/props/gridColumnStart/types.ts +19 -0
- package/src/css/props/gridRow/gridRow.css.ts +49 -0
- package/src/css/props/gridRow/gridRow.ts +8 -0
- package/src/css/props/gridRow/index.ts +2 -0
- package/src/css/props/gridRow/types.ts +19 -0
- package/src/css/props/gridRowEnd/gridRowEnd.css.ts +46 -0
- package/src/css/props/gridRowEnd/gridRowEnd.ts +8 -0
- package/src/css/props/gridRowEnd/index.ts +2 -0
- package/src/css/props/gridRowEnd/types.ts +19 -0
- package/src/css/props/gridRowStart/gridRowStart.css.ts +46 -0
- package/src/css/props/gridRowStart/gridRowStart.ts +8 -0
- package/src/css/props/gridRowStart/index.ts +2 -0
- package/src/css/props/gridRowStart/types.ts +19 -0
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +43 -0
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +8 -0
- package/src/css/props/gridTemplateColumns/index.ts +2 -0
- package/src/css/props/gridTemplateColumns/types.ts +19 -0
- package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +43 -0
- package/src/css/props/gridTemplateRows/gridTemplateRows.ts +8 -0
- package/src/css/props/gridTemplateRows/index.ts +2 -0
- package/src/css/props/gridTemplateRows/types.ts +19 -0
- package/src/css/props/height/height.css.ts +25 -0
- package/src/css/props/height/height.ts +8 -0
- package/src/css/props/height/index.ts +2 -0
- package/src/css/props/height/types.ts +15 -0
- package/src/css/props/index.ts +37 -0
- package/src/css/props/inset/inset.css.ts +37 -0
- package/src/css/props/inset/inset.ts +21 -0
- package/src/css/{styles → props}/inset/types.ts +1 -1
- package/src/css/props/justifyContent/index.ts +2 -0
- package/src/css/props/justifyContent/justifyContent.css.ts +25 -0
- package/src/css/props/justifyContent/justifyContent.ts +8 -0
- package/src/css/props/justifyContent/types.ts +15 -0
- package/src/css/props/margin/margin.css.ts +117 -0
- package/src/css/props/margin/margin.ts +25 -0
- package/src/css/props/margin/types.ts +17 -0
- package/src/css/props/maxWidth/maxWidth.css.ts +32 -0
- package/src/css/props/maxWidth/maxWidth.ts +8 -0
- package/src/css/props/maxWidth/types.ts +11 -0
- package/src/css/props/minHeight/index.ts +2 -0
- package/src/css/props/minHeight/minHeight.css.ts +13 -0
- package/src/css/props/minHeight/minHeight.ts +8 -0
- package/src/css/props/minHeight/types.ts +9 -0
- package/src/css/props/minWidth/index.ts +2 -0
- package/src/css/props/minWidth/minWidth.css.ts +25 -0
- package/src/css/props/minWidth/minWidth.ts +8 -0
- package/src/css/props/minWidth/types.ts +9 -0
- package/src/css/props/outline/index.ts +2 -0
- package/src/css/props/outline/outline.css.ts +10 -0
- package/src/css/props/outline/outline.ts +8 -0
- package/src/css/props/outline/types.ts +7 -0
- package/src/css/props/overflow/overflow.css.ts +16 -0
- package/src/css/props/overflow/overflow.ts +8 -0
- package/src/css/props/overflow/types.ts +17 -0
- package/src/css/props/padding/padding.css.ts +87 -0
- package/src/css/props/padding/padding.ts +25 -0
- package/src/css/props/padding/types.ts +17 -0
- package/src/css/props/pointerEvents/pointerEvents.css.ts +13 -0
- package/src/css/props/pointerEvents/pointerEvents.ts +8 -0
- package/src/css/props/position/position.css.ts +22 -0
- package/src/css/props/position/position.ts +8 -0
- package/src/css/{styles → props}/position/types.ts +1 -1
- package/src/css/props/radius/radius.css.ts +21 -0
- package/src/css/props/radius/radius.ts +8 -0
- package/src/css/props/radius/types.ts +8 -0
- package/src/css/props/shadow/shadow.css.ts +23 -0
- package/src/css/props/shadow/shadow.ts +8 -0
- package/src/css/props/shadow/types.ts +8 -0
- package/src/css/props/textAlign/index.ts +2 -0
- package/src/css/props/textAlign/textAlign.css.ts +22 -0
- package/src/css/props/textAlign/textAlign.ts +8 -0
- package/src/css/props/textAlign/types.ts +7 -0
- package/src/css/props/textOverflow/textOverflow.css.ts +13 -0
- package/src/css/props/textOverflow/textOverflow.ts +8 -0
- package/src/css/{styles → props}/textOverflow/types.ts +5 -1
- package/src/css/props/width/types.ts +11 -0
- package/src/css/props/width/width.css.ts +28 -0
- package/src/css/props/width/width.ts +8 -0
- package/src/css/types.ts +221 -766
- package/src/css/util.ts +3 -8
- package/src/css/utils/index.ts +1 -0
- package/src/css/utils/srOnly/srOnly.css.ts +10 -0
- package/src/css/utils/srOnly/srOnly.ts +5 -3
- package/src/css/vars.css.ts +676 -0
- 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 +20 -11
- 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/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 +97 -12
- 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 +62 -40
- 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.d.ts +0 -1
- package/dist/cli.js +0 -357
- 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/StyleTags.tsx +0 -24
- 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/_resp.ts +0 -31
- 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/_arrow/rules.ts +0 -71
- 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/_selectable/rules.ts +0 -129
- package/src/css/primitives/avatar/rules.ts +0 -176
- 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/select/rules.ts +0 -22
- 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/responsiveRules.ts +0 -25
- 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/border/types.ts +0 -10
- 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/flex/types.ts +0 -35
- package/src/css/styles/flexItem/flexItem.ts +0 -8
- package/src/css/styles/flexItem/index.ts +0 -2
- 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/grid.ts +0 -13
- package/src/css/styles/grid/index.ts +0 -2
- package/src/css/styles/grid/rules.ts +0 -146
- package/src/css/styles/grid/types.ts +0 -29
- package/src/css/styles/gridItem/gridItem.ts +0 -15
- package/src/css/styles/gridItem/index.ts +0 -2
- package/src/css/styles/gridItem/rules.ts +0 -96
- package/src/css/styles/gridItem/types.ts +0 -41
- package/src/css/styles/height/rules.ts +0 -7
- package/src/css/styles/index.ts +0 -19
- package/src/css/styles/inset/inset.ts +0 -13
- package/src/css/styles/inset/rules.ts +0 -16
- package/src/css/styles/margin/margin.ts +0 -15
- 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/overflow.ts +0 -11
- package/src/css/styles/overflow/rules.ts +0 -9
- package/src/css/styles/overflow/types.ts +0 -11
- package/src/css/styles/padding/padding.ts +0 -15
- package/src/css/styles/padding/rules.ts +0 -62
- package/src/css/styles/padding/types.ts +0 -14
- 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/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 → props}/border/index.ts +0 -0
- /package/src/css/{styles → props}/display/index.ts +0 -0
- /package/src/css/{styles → props}/flex/index.ts +0 -0
- /package/src/css/{styles → props}/font/index.ts +0 -0
- /package/src/css/{styles → props}/gap/index.ts +0 -0
- /package/src/css/{styles → props}/inset/index.ts +0 -0
- /package/src/css/{styles → props}/margin/index.ts +0 -0
- /package/src/css/{styles → props}/maxWidth/index.ts +0 -0
- /package/src/css/{styles → props}/overflow/index.ts +0 -0
- /package/src/css/{styles → props}/padding/index.ts +0 -0
- /package/src/css/{styles → props}/pointerEvents/index.ts +0 -0
- /package/src/css/{styles → props}/pointerEvents/types.ts +0 -0
- /package/src/css/{styles → props}/position/index.ts +0 -0
- /package/src/css/{styles → props}/radius/index.ts +0 -0
- /package/src/css/{styles → props}/shadow/index.ts +0 -0
- /package/src/css/{styles → props}/textOverflow/index.ts +0 -0
- /package/src/css/{styles → props}/width/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/src/theme/{palette → v3/palette}/index.ts +0 -0
package/dist/index.mjs
DELETED
|
@@ -1,1542 +0,0 @@
|
|
|
1
|
-
import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, createGlobalScopedContext, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, Container, useTheme_v2, usePrefersReducedMotion, Portal, Layer, containsOrEqualsElement, Grid, LayerProvider, isRecord, Selectable } from "./_chunks-es/_visual-editing.mjs";
|
|
2
|
-
import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Checkbox, ConditionalWrapper, 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, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
|
|
3
|
-
import { composeClassNames, breadcrumbs, dialogContainer, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, skeleton, textSkeleton, labelSkeleton, headingSkeleton, codeSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
|
|
4
|
-
import { px, rem } from "@sanity/ui/css";
|
|
5
|
-
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
6
|
-
import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
7
|
-
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
|
|
8
|
-
import { c } from "react-compiler-runtime";
|
|
9
|
-
import { motion, AnimatePresence } from "framer-motion";
|
|
10
|
-
import { buildTheme_v3 } from "@sanity/ui/theme";
|
|
11
|
-
function _responsive(media, values, callback) {
|
|
12
|
-
return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
|
|
13
|
-
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function _raf(fn) {
|
|
17
|
-
const frameId = requestAnimationFrame(fn);
|
|
18
|
-
return () => {
|
|
19
|
-
cancelAnimationFrame(frameId);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function _raf2(fn) {
|
|
23
|
-
let innerDispose = null;
|
|
24
|
-
const outerDispose = _raf(() => {
|
|
25
|
-
innerDispose = _raf(fn);
|
|
26
|
-
});
|
|
27
|
-
return () => {
|
|
28
|
-
innerDispose && innerDispose(), outerDispose();
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function _hasFocus(element) {
|
|
32
|
-
return !!document.activeElement && element.contains(document.activeElement);
|
|
33
|
-
}
|
|
34
|
-
function isFocusable(element) {
|
|
35
|
-
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;
|
|
36
|
-
}
|
|
37
|
-
function attemptFocus(element) {
|
|
38
|
-
if (!isFocusable(element))
|
|
39
|
-
return !1;
|
|
40
|
-
try {
|
|
41
|
-
element.focus();
|
|
42
|
-
} catch {
|
|
43
|
-
}
|
|
44
|
-
return document.activeElement === element;
|
|
45
|
-
}
|
|
46
|
-
function focusFirstDescendant(element) {
|
|
47
|
-
for (let i = 0; i < element.childNodes.length; i++) {
|
|
48
|
-
const child = element.childNodes[i];
|
|
49
|
-
if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
|
|
50
|
-
return !0;
|
|
51
|
-
}
|
|
52
|
-
return !1;
|
|
53
|
-
}
|
|
54
|
-
function focusLastDescendant(element) {
|
|
55
|
-
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
56
|
-
const child = element.childNodes[i];
|
|
57
|
-
if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
|
|
58
|
-
return !0;
|
|
59
|
-
}
|
|
60
|
-
return !1;
|
|
61
|
-
}
|
|
62
|
-
function _getElements(element, elementsArg) {
|
|
63
|
-
const ret = [element];
|
|
64
|
-
for (const el of elementsArg)
|
|
65
|
-
Array.isArray(el) ? ret.push(...el) : ret.push(el);
|
|
66
|
-
return ret.filter(Boolean);
|
|
67
|
-
}
|
|
68
|
-
function useClickOutside(listener, t0, boundaryElement) {
|
|
69
|
-
const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
|
|
70
|
-
let t1;
|
|
71
|
-
$[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
|
|
72
|
-
const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
|
|
73
|
-
let t2, t3;
|
|
74
|
-
$[3] !== element || $[4] !== elementsArg ? (t2 = () => {
|
|
75
|
-
const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
|
|
76
|
-
if (prevElements.length !== nextElements.length) {
|
|
77
|
-
setElements(nextElements), elementsRef.current = nextElements;
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
for (const el of prevElements)
|
|
81
|
-
if (!nextElements.includes(el)) {
|
|
82
|
-
setElements(nextElements), elementsRef.current = nextElements;
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
for (const el_0 of nextElements)
|
|
86
|
-
if (!prevElements.includes(el_0)) {
|
|
87
|
-
setElements(nextElements), elementsRef.current = nextElements;
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
|
|
91
|
-
let t4, t5;
|
|
92
|
-
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
93
|
-
if (!listener)
|
|
94
|
-
return;
|
|
95
|
-
const handleWindowMouseDown = (evt) => {
|
|
96
|
-
const target = evt.target;
|
|
97
|
-
if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
|
|
98
|
-
for (const el_1 of elements)
|
|
99
|
-
if (target === el_1 || el_1.contains(target))
|
|
100
|
-
return;
|
|
101
|
-
listener(evt);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
105
|
-
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
106
|
-
};
|
|
107
|
-
}, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
|
|
108
|
-
}
|
|
109
|
-
function useElementRect(element) {
|
|
110
|
-
return useElementSize(element)?._contentRect || null;
|
|
111
|
-
}
|
|
112
|
-
function useForwardedRef(ref) {
|
|
113
|
-
const $ = c(1), innerRef = useRef(null);
|
|
114
|
-
let t0;
|
|
115
|
-
return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
|
|
116
|
-
}
|
|
117
|
-
class ErrorBoundary extends Component {
|
|
118
|
-
state = {
|
|
119
|
-
error: null
|
|
120
|
-
};
|
|
121
|
-
static getDerivedStateFromError(error) {
|
|
122
|
-
return {
|
|
123
|
-
error
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
componentDidCatch(error, info) {
|
|
127
|
-
this.props.onCatch({
|
|
128
|
-
error,
|
|
129
|
-
info
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
render() {
|
|
133
|
-
const {
|
|
134
|
-
error
|
|
135
|
-
} = this.state;
|
|
136
|
-
if (error) {
|
|
137
|
-
const message = typeof error?.message == "string" ? error.message : "Error";
|
|
138
|
-
return /* @__PURE__ */ jsx(Code, { children: message });
|
|
139
|
-
}
|
|
140
|
-
return this.props.children;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function AutocompleteOption(props) {
|
|
144
|
-
const $ = c(11), {
|
|
145
|
-
children,
|
|
146
|
-
id,
|
|
147
|
-
onSelect,
|
|
148
|
-
selected,
|
|
149
|
-
value
|
|
150
|
-
} = props;
|
|
151
|
-
let t0;
|
|
152
|
-
$[0] !== onSelect || $[1] !== value ? (t0 = () => {
|
|
153
|
-
setTimeout(() => {
|
|
154
|
-
onSelect(value);
|
|
155
|
-
}, 0);
|
|
156
|
-
}, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
|
|
157
|
-
const handleClick = t0;
|
|
158
|
-
let t1;
|
|
159
|
-
$[3] !== handleClick ? (t1 = (event) => {
|
|
160
|
-
event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
|
|
161
|
-
}, $[3] = handleClick, $[4] = t1) : t1 = $[4];
|
|
162
|
-
const handleKeyDown = t1;
|
|
163
|
-
let t2;
|
|
164
|
-
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;
|
|
165
|
-
}
|
|
166
|
-
function autocompleteReducer(state, msg) {
|
|
167
|
-
return msg.type === "input/change" ? {
|
|
168
|
-
...state,
|
|
169
|
-
activeValue: null,
|
|
170
|
-
focused: !0,
|
|
171
|
-
query: msg.query
|
|
172
|
-
} : msg.type === "input/focus" ? {
|
|
173
|
-
...state,
|
|
174
|
-
focused: !0
|
|
175
|
-
} : msg.type === "root/blur" ? {
|
|
176
|
-
...state,
|
|
177
|
-
focused: !1,
|
|
178
|
-
query: null
|
|
179
|
-
} : msg.type === "root/clear" ? {
|
|
180
|
-
...state,
|
|
181
|
-
activeValue: null,
|
|
182
|
-
query: null,
|
|
183
|
-
value: null
|
|
184
|
-
} : msg.type === "root/escape" ? {
|
|
185
|
-
...state,
|
|
186
|
-
focused: !1,
|
|
187
|
-
query: null
|
|
188
|
-
} : msg.type === "root/open" ? {
|
|
189
|
-
...state,
|
|
190
|
-
query: state.query || msg.query
|
|
191
|
-
} : msg.type === "root/setActiveValue" ? {
|
|
192
|
-
...state,
|
|
193
|
-
activeValue: msg.value,
|
|
194
|
-
listFocused: msg.listFocused || state.listFocused
|
|
195
|
-
} : msg.type === "root/setListFocused" ? {
|
|
196
|
-
...state,
|
|
197
|
-
listFocused: msg.listFocused
|
|
198
|
-
} : msg.type === "value/change" ? {
|
|
199
|
-
...state,
|
|
200
|
-
activeValue: msg.value,
|
|
201
|
-
query: null,
|
|
202
|
-
value: msg.value
|
|
203
|
-
} : state;
|
|
204
|
-
}
|
|
205
|
-
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, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
|
|
206
|
-
const {
|
|
207
|
-
border = !0,
|
|
208
|
-
customValidity,
|
|
209
|
-
disabled,
|
|
210
|
-
filterOption: filterOptionProp,
|
|
211
|
-
fontSize = 1,
|
|
212
|
-
icon,
|
|
213
|
-
id,
|
|
214
|
-
listBox = EMPTY_RECORD,
|
|
215
|
-
loading,
|
|
216
|
-
onBlur,
|
|
217
|
-
onChange,
|
|
218
|
-
onFocus,
|
|
219
|
-
onQueryChange,
|
|
220
|
-
onSelect,
|
|
221
|
-
openButton,
|
|
222
|
-
openOnFocus,
|
|
223
|
-
options: optionsProp,
|
|
224
|
-
padding: paddingProp = 3,
|
|
225
|
-
popover = EMPTY_RECORD,
|
|
226
|
-
prefix,
|
|
227
|
-
radius = 2,
|
|
228
|
-
readOnly,
|
|
229
|
-
relatedElements,
|
|
230
|
-
renderOption: renderOptionProp,
|
|
231
|
-
renderPopover,
|
|
232
|
-
renderValue = DEFAULT_RENDER_VALUE,
|
|
233
|
-
suffix,
|
|
234
|
-
value: valueProp,
|
|
235
|
-
...restProps
|
|
236
|
-
} = props, [state, dispatch] = useReducer(autocompleteReducer, {
|
|
237
|
-
activeValue: valueProp || null,
|
|
238
|
-
focused: !1,
|
|
239
|
-
listFocused: !1,
|
|
240
|
-
query: null,
|
|
241
|
-
value: valueProp || null
|
|
242
|
-
}), {
|
|
243
|
-
activeValue,
|
|
244
|
-
focused,
|
|
245
|
-
listFocused,
|
|
246
|
-
query,
|
|
247
|
-
value
|
|
248
|
-
} = state, defaultRenderOption = useCallback(({
|
|
249
|
-
value: value_0
|
|
250
|
-
}) => /* @__PURE__ */ jsx(
|
|
251
|
-
Card,
|
|
252
|
-
{
|
|
253
|
-
as: "button",
|
|
254
|
-
padding: paddingProp,
|
|
255
|
-
radius: 2,
|
|
256
|
-
tone: "inherit",
|
|
257
|
-
children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 })
|
|
258
|
-
}
|
|
259
|
-
), [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);
|
|
260
|
-
useImperativeHandle(forwardedRef, () => inputElementRef.current);
|
|
261
|
-
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) => {
|
|
262
|
-
setTimeout(() => {
|
|
263
|
-
if (popoverMouseWithinRef.current)
|
|
264
|
-
return;
|
|
265
|
-
const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
|
|
266
|
-
let focusInside = !1;
|
|
267
|
-
if (document.activeElement) {
|
|
268
|
-
for (const e of elements)
|
|
269
|
-
if (e === document.activeElement || e.contains(document.activeElement)) {
|
|
270
|
-
focusInside = !0;
|
|
271
|
-
break;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
focusInside === !1 && (dispatch({
|
|
275
|
-
type: "root/blur"
|
|
276
|
-
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
277
|
-
}, 0);
|
|
278
|
-
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
|
|
279
|
-
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
280
|
-
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
281
|
-
type: "root/setListFocused",
|
|
282
|
-
listFocused: listFocused_0
|
|
283
|
-
}));
|
|
284
|
-
}, []), handleOptionSelect = useCallback((v) => {
|
|
285
|
-
dispatch({
|
|
286
|
-
type: "value/change",
|
|
287
|
-
value: v
|
|
288
|
-
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
289
|
-
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
|
|
290
|
-
if (event_1.key === "ArrowDown") {
|
|
291
|
-
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
292
|
-
const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
293
|
-
nextActiveOption && dispatch({
|
|
294
|
-
type: "root/setActiveValue",
|
|
295
|
-
value: nextActiveOption.value,
|
|
296
|
-
listFocused: !0
|
|
297
|
-
});
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (event_1.key === "ArrowUp") {
|
|
301
|
-
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
302
|
-
const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
|
|
303
|
-
nextActiveOption_0 && dispatch({
|
|
304
|
-
type: "root/setActiveValue",
|
|
305
|
-
value: nextActiveOption_0.value,
|
|
306
|
-
listFocused: !0
|
|
307
|
-
});
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
if (event_1.key === "Escape") {
|
|
311
|
-
dispatch({
|
|
312
|
-
type: "root/escape"
|
|
313
|
-
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
const target = event_1.target, listEl = listBoxElementRef.current;
|
|
317
|
-
if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
|
|
318
|
-
inputElementRef.current?.focus();
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
|
|
322
|
-
const nextQuery = event_2.currentTarget.value;
|
|
323
|
-
dispatch({
|
|
324
|
-
type: "input/change",
|
|
325
|
-
query: nextQuery
|
|
326
|
-
}), onQueryChange && onQueryChange(nextQuery);
|
|
327
|
-
}, [onQueryChange]), dispatchOpen = useCallback(() => {
|
|
328
|
-
dispatch({
|
|
329
|
-
type: "root/open",
|
|
330
|
-
query: value ? renderValue(value, currentOption) : ""
|
|
331
|
-
});
|
|
332
|
-
}, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
|
|
333
|
-
focused || (dispatch({
|
|
334
|
-
type: "input/focus"
|
|
335
|
-
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
336
|
-
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
|
|
337
|
-
popoverMouseWithinRef.current = !0;
|
|
338
|
-
}, []), handlePopoverMouseLeave = useCallback(() => {
|
|
339
|
-
popoverMouseWithinRef.current = !1;
|
|
340
|
-
}, []), handleClearButtonClick = useCallback(() => {
|
|
341
|
-
dispatch({
|
|
342
|
-
type: "root/clear"
|
|
343
|
-
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
344
|
-
}, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
|
|
345
|
-
dispatch({
|
|
346
|
-
type: "input/focus"
|
|
347
|
-
});
|
|
348
|
-
}, []);
|
|
349
|
-
useEffect(() => {
|
|
350
|
-
if (valueProp !== valuePropRef.current) {
|
|
351
|
-
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
352
|
-
type: "value/change",
|
|
353
|
-
value: valueProp
|
|
354
|
-
}), valueRef.current = valueProp);
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
|
|
358
|
-
type: "value/change",
|
|
359
|
-
value: valueProp || null
|
|
360
|
-
}));
|
|
361
|
-
}, [valueProp]), useEffect(() => {
|
|
362
|
-
!focused && valueRef.current && dispatch({
|
|
363
|
-
type: "root/setActiveValue",
|
|
364
|
-
value: valueRef.current
|
|
365
|
-
});
|
|
366
|
-
}, [focused]), useEffect(() => {
|
|
367
|
-
const listElement = listBoxElementRef.current;
|
|
368
|
-
if (!listElement) return;
|
|
369
|
-
const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
370
|
-
if (activeOption_1) {
|
|
371
|
-
const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
|
|
372
|
-
if (activeItemElement) {
|
|
373
|
-
if (_hasFocus(activeItemElement))
|
|
374
|
-
return;
|
|
375
|
-
focusFirstDescendant(activeItemElement);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}, [activeValue, filteredOptions]);
|
|
379
|
-
const clearButton = useMemo(() => {
|
|
380
|
-
if (!loading && !disabled && value)
|
|
381
|
-
return {
|
|
382
|
-
"aria-label": "Clear",
|
|
383
|
-
onFocus: handleClearButtonFocus
|
|
384
|
-
};
|
|
385
|
-
}, [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) => {
|
|
386
|
-
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
387
|
-
}, [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, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", 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) => {
|
|
388
|
-
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
389
|
-
}, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
|
|
390
|
-
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
391
|
-
return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
|
|
392
|
-
disabled: loading,
|
|
393
|
-
selected: active,
|
|
394
|
-
tabIndex: listFocused && active ? 0 : -1
|
|
395
|
-
}) }, option_0.value);
|
|
396
|
-
}) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
|
|
397
|
-
content: content2,
|
|
398
|
-
hidden: !expanded,
|
|
399
|
-
inputElement: inputElementRef.current,
|
|
400
|
-
onMouseEnter: handlePopoverMouseEnter,
|
|
401
|
-
onMouseLeave: handlePopoverMouseLeave
|
|
402
|
-
}, 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, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
|
|
403
|
-
return (
|
|
404
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
405
|
-
/* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
406
|
-
input,
|
|
407
|
-
results
|
|
408
|
-
] })
|
|
409
|
-
);
|
|
410
|
-
});
|
|
411
|
-
InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
|
|
412
|
-
const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props, ref) {
|
|
413
|
-
const {
|
|
414
|
-
children,
|
|
415
|
-
className,
|
|
416
|
-
expandButton: expandButtonProps,
|
|
417
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
418
|
-
gap: _gapProp,
|
|
419
|
-
gapX = props.gap ?? props.space ?? 2,
|
|
420
|
-
gapY = props.gap ?? props.space ?? 2,
|
|
421
|
-
maxLength,
|
|
422
|
-
separator,
|
|
423
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
424
|
-
space: _spaceProp,
|
|
425
|
-
...restProps
|
|
426
|
-
} = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
|
|
427
|
-
useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
|
|
428
|
-
const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
|
|
429
|
-
const len = rawItems.length;
|
|
430
|
-
if (maxLength && len > maxLength) {
|
|
431
|
-
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
432
|
-
return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", space: gapY, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
|
|
433
|
-
}
|
|
434
|
-
return rawItems;
|
|
435
|
-
}, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
|
|
436
|
-
return /* @__PURE__ */ jsx(Flex, { as: "nav", "data-ui": "Breadcrumbs", ...restProps, className: composeClassNames(className, breadcrumbs()), gapX, gapY, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
437
|
-
itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
|
|
438
|
-
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
439
|
-
] }, itemIndex)) });
|
|
440
|
-
});
|
|
441
|
-
Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
|
|
442
|
-
const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
443
|
-
version: 0
|
|
444
|
-
});
|
|
445
|
-
function useDialog() {
|
|
446
|
-
return useContext(DialogContext);
|
|
447
|
-
}
|
|
448
|
-
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
449
|
-
return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
450
|
-
}
|
|
451
|
-
const DialogCard = forwardRef(function(props, forwardedRef) {
|
|
452
|
-
const $ = c(43), {
|
|
453
|
-
__unstable_autoFocus: autoFocus,
|
|
454
|
-
__unstable_hideCloseButton: hideCloseButton,
|
|
455
|
-
children,
|
|
456
|
-
contentRef: forwardedContentRef,
|
|
457
|
-
footer,
|
|
458
|
-
header,
|
|
459
|
-
id,
|
|
460
|
-
onClickOutside,
|
|
461
|
-
onClose,
|
|
462
|
-
portal: portalProp,
|
|
463
|
-
radius: radiusProp,
|
|
464
|
-
scheme,
|
|
465
|
-
shadow: t0,
|
|
466
|
-
tone,
|
|
467
|
-
width: widthProp
|
|
468
|
-
} = props, shadowProp = t0 === void 0 ? 4 : t0, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), width = useArrayProp(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
|
|
469
|
-
isTopLayer
|
|
470
|
-
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
|
|
471
|
-
let t1;
|
|
472
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], useImperativeHandle(forwardedRef, t1);
|
|
473
|
-
let t2;
|
|
474
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => contentRef.current, $[1] = t2) : t2 = $[1], useImperativeHandle(forwardedContentRef, t2);
|
|
475
|
-
let t3, t4;
|
|
476
|
-
$[2] !== autoFocus ? (t3 = () => {
|
|
477
|
-
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
478
|
-
}, t4 = [autoFocus, ref], $[2] = autoFocus, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
|
|
479
|
-
let t5;
|
|
480
|
-
$[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t5 = (event) => {
|
|
481
|
-
if (!isTopLayer || !onClose)
|
|
482
|
-
return;
|
|
483
|
-
const target = document.activeElement;
|
|
484
|
-
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
485
|
-
}, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t5) : t5 = $[9], useGlobalKeyDown(t5);
|
|
486
|
-
let t6;
|
|
487
|
-
$[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t6 = isTopLayer && onClickOutside && ((event_0) => {
|
|
488
|
-
const target_0 = event_0.target;
|
|
489
|
-
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
490
|
-
}), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t6) : t6 = $[14];
|
|
491
|
-
let t7;
|
|
492
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[15] = t7) : t7 = $[15], useClickOutsideEvent(t6, t7);
|
|
493
|
-
let t8;
|
|
494
|
-
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t8 = dialogContainer(), $[16] = t8) : t8 = $[16];
|
|
495
|
-
let t9;
|
|
496
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[17] = t9) : t9 = $[17];
|
|
497
|
-
let t10;
|
|
498
|
-
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[18] = t10) : t10 = $[18];
|
|
499
|
-
let t11;
|
|
500
|
-
$[19] !== header || $[20] !== labelId || $[21] !== onClose || $[22] !== showCloseButton || $[23] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsx(Box, { className: dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
|
|
501
|
-
/* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
|
|
502
|
-
showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
|
|
503
|
-
] }) }), $[19] = header, $[20] = labelId, $[21] = onClose, $[22] = showCloseButton, $[23] = showHeader, $[24] = t11) : t11 = $[24];
|
|
504
|
-
let t12;
|
|
505
|
-
$[25] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[25] = t12) : t12 = $[25];
|
|
506
|
-
let t13;
|
|
507
|
-
$[26] !== children ? (t13 = /* @__PURE__ */ jsx(Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[26] = children, $[27] = t13) : t13 = $[27];
|
|
508
|
-
let t14;
|
|
509
|
-
$[28] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[28] = footer, $[29] = t14) : t14 = $[29];
|
|
510
|
-
let t15;
|
|
511
|
-
$[30] !== t11 || $[31] !== t13 || $[32] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
|
|
512
|
-
t11,
|
|
513
|
-
t13,
|
|
514
|
-
t14
|
|
515
|
-
] }), $[30] = t11, $[31] = t13, $[32] = t14, $[33] = t15) : t15 = $[33];
|
|
516
|
-
let t16;
|
|
517
|
-
$[34] !== radius || $[35] !== scheme || $[36] !== shadow || $[37] !== t15 || $[38] !== tone ? (t16 = /* @__PURE__ */ jsx(Card, { className: t9, display: "flex", radius, ref, scheme, shadow, tone, children: t15 }), $[34] = radius, $[35] = scheme, $[36] = shadow, $[37] = t15, $[38] = tone, $[39] = t16) : t16 = $[39];
|
|
518
|
-
let t17;
|
|
519
|
-
return $[40] !== t16 || $[41] !== width ? (t17 = /* @__PURE__ */ jsx(Container, { align: "center", className: t8, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t16 }), $[40] = t16, $[41] = width, $[42] = t17) : t17 = $[42], t17;
|
|
520
|
-
});
|
|
521
|
-
DialogCard.displayName = "ForwardRef(DialogCard)";
|
|
522
|
-
const Dialog = forwardRef(function(props, ref) {
|
|
523
|
-
const $ = c(66), context = useDialog(), {
|
|
524
|
-
layer
|
|
525
|
-
} = useTheme_v2();
|
|
526
|
-
let _positionProp, _zOffsetProp, cardShadow, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, tone;
|
|
527
|
-
$[0] !== props ? ({
|
|
528
|
-
__unstable_autoFocus: t0,
|
|
529
|
-
__unstable_hideCloseButton: t1,
|
|
530
|
-
animate: t2,
|
|
531
|
-
cardRadius: t3,
|
|
532
|
-
children,
|
|
533
|
-
className,
|
|
534
|
-
contentRef,
|
|
535
|
-
footer,
|
|
536
|
-
header,
|
|
537
|
-
id,
|
|
538
|
-
onActivate,
|
|
539
|
-
onClickOutside,
|
|
540
|
-
onClose,
|
|
541
|
-
onFocus,
|
|
542
|
-
padding: t4,
|
|
543
|
-
portal: portalProp,
|
|
544
|
-
position: _positionProp,
|
|
545
|
-
scheme,
|
|
546
|
-
shadow: cardShadow,
|
|
547
|
-
width: t5,
|
|
548
|
-
zOffset: _zOffsetProp,
|
|
549
|
-
tone,
|
|
550
|
-
...restProps
|
|
551
|
-
} = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = cardShadow, $[4] = children, $[5] = className, $[6] = contentRef, $[7] = footer, $[8] = header, $[9] = id, $[10] = onActivate, $[11] = onClickOutside, $[12] = onClose, $[13] = onFocus, $[14] = portalProp, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], cardShadow = $[3], children = $[4], className = $[5], contentRef = $[6], footer = $[7], header = $[8], id = $[9], onActivate = $[10], onClickOutside = $[11], onClose = $[12], onFocus = $[13], portalProp = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], tone = $[23]);
|
|
552
|
-
const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, _animate = t2 === void 0 ? !1 : t2, cardRadiusProp = t3 === void 0 ? 4 : t3, padding = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, positionProp = _positionProp ?? (context.position || "fixed"), zOffsetProp = _zOffsetProp ?? (context.zOffset || layer.dialog.zOffset), animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
|
|
553
|
-
let t6;
|
|
554
|
-
$[24] !== onFocus ? (t6 = (event) => {
|
|
555
|
-
onFocus?.(event);
|
|
556
|
-
const target = event.target, cardElement = cardRef.current;
|
|
557
|
-
if (cardElement && target === preDivRef.current) {
|
|
558
|
-
focusLastDescendant(cardElement);
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
if (cardElement && target === postDivRef.current) {
|
|
562
|
-
focusFirstDescendant(cardElement);
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
566
|
-
}, $[24] = onFocus, $[25] = t6) : t6 = $[25];
|
|
567
|
-
const handleFocus = t6, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
|
|
568
|
-
let t7;
|
|
569
|
-
$[26] !== boundaryElement || $[27] !== portalElement ? (t7 = () => {
|
|
570
|
-
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
571
|
-
const activeElement = document.activeElement;
|
|
572
|
-
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
573
|
-
const target_0 = focusedElementRef.current;
|
|
574
|
-
if (!target_0 || !document.body.contains(target_0)) {
|
|
575
|
-
const cardElement_0 = cardRef.current;
|
|
576
|
-
cardElement_0 && focusFirstDescendant(cardElement_0);
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
target_0.focus();
|
|
580
|
-
}
|
|
581
|
-
}, 0);
|
|
582
|
-
}, $[26] = boundaryElement, $[27] = portalElement, $[28] = t7) : t7 = $[28];
|
|
583
|
-
const handleRootClick = t7;
|
|
584
|
-
let t8;
|
|
585
|
-
$[29] !== className ? (t8 = composeClassNames(className, dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
|
|
586
|
-
const t9 = animate ? "" : void 0;
|
|
587
|
-
let t10;
|
|
588
|
-
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t10) : t10 = $[31];
|
|
589
|
-
let t11;
|
|
590
|
-
$[32] !== autoFocus || $[33] !== cardRadius || $[34] !== cardShadow || $[35] !== children || $[36] !== contentRef || $[37] !== footer || $[38] !== header || $[39] !== hideCloseButton || $[40] !== id || $[41] !== onClickOutside || $[42] !== onClose || $[43] !== portalProp || $[44] !== scheme || $[45] !== tone || $[46] !== width ? (t11 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[32] = autoFocus, $[33] = cardRadius, $[34] = cardShadow, $[35] = children, $[36] = contentRef, $[37] = footer, $[38] = header, $[39] = hideCloseButton, $[40] = id, $[41] = onClickOutside, $[42] = onClose, $[43] = portalProp, $[44] = scheme, $[45] = tone, $[46] = width, $[47] = t11) : t11 = $[47];
|
|
591
|
-
let t12;
|
|
592
|
-
$[48] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[48] = t12) : t12 = $[48];
|
|
593
|
-
let t13;
|
|
594
|
-
$[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 ? (t13 = /* @__PURE__ */ jsxs(Layer, { ...restProps, "aria-labelledby": labelId, "aria-modal": !0, className: t8, "data-animate": t9, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, ref, role: "dialog", zOffset, children: [
|
|
595
|
-
t10,
|
|
596
|
-
t11,
|
|
597
|
-
t12
|
|
598
|
-
] }), $[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];
|
|
599
|
-
let t14;
|
|
600
|
-
return $[63] !== portalProp || $[64] !== t13 ? (t14 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t13 }), $[63] = portalProp, $[64] = t13, $[65] = t14) : t14 = $[65], t14;
|
|
601
|
-
});
|
|
602
|
-
Dialog.displayName = "ForwardRef(Dialog)";
|
|
603
|
-
function DialogProvider(props) {
|
|
604
|
-
const $ = c(6), {
|
|
605
|
-
children,
|
|
606
|
-
position,
|
|
607
|
-
zOffset
|
|
608
|
-
} = props;
|
|
609
|
-
let t0, t1;
|
|
610
|
-
$[0] !== position || $[1] !== zOffset ? (t1 = {
|
|
611
|
-
version: 0,
|
|
612
|
-
position,
|
|
613
|
-
zOffset
|
|
614
|
-
}, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
|
|
615
|
-
const contextValue = t0;
|
|
616
|
-
let t2;
|
|
617
|
-
return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
|
|
618
|
-
}
|
|
619
|
-
DialogProvider.displayName = "DialogProvider";
|
|
620
|
-
const MenuButton = forwardRef(function(props, forwardedRef) {
|
|
621
|
-
const $ = c(63), {
|
|
622
|
-
__unstable_disableRestoreFocusOnClose: t0,
|
|
623
|
-
boundaryElement: deprecated_boundaryElement,
|
|
624
|
-
button: buttonProp,
|
|
625
|
-
id,
|
|
626
|
-
menu: menuProp,
|
|
627
|
-
onClose,
|
|
628
|
-
onOpen,
|
|
629
|
-
placement: deprecated_placement,
|
|
630
|
-
popoverScheme: deprecated_popoverScheme,
|
|
631
|
-
portal: t1,
|
|
632
|
-
popover,
|
|
633
|
-
popoverRadius: deprecated_popoverRadius,
|
|
634
|
-
preventOverflow: deprecated_preventOverflow
|
|
635
|
-
} = 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);
|
|
636
|
-
let t2;
|
|
637
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
638
|
-
const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
|
|
639
|
-
let t3, t4;
|
|
640
|
-
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
641
|
-
onOpen && open && !openRef.current && onOpen();
|
|
642
|
-
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
|
|
643
|
-
let t5, t6;
|
|
644
|
-
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
645
|
-
onClose && !open && openRef.current && onClose();
|
|
646
|
-
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
|
|
647
|
-
let t7, t8;
|
|
648
|
-
$[9] !== open ? (t7 = () => {
|
|
649
|
-
openRef.current = open;
|
|
650
|
-
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
|
|
651
|
-
let t9;
|
|
652
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
653
|
-
setOpen(_temp$2), setShouldFocus(null);
|
|
654
|
-
}, $[12] = t9) : t9 = $[12];
|
|
655
|
-
const handleButtonClick = t9;
|
|
656
|
-
let t10;
|
|
657
|
-
$[13] !== open ? (t10 = (event) => {
|
|
658
|
-
open && event.preventDefault();
|
|
659
|
-
}, $[13] = open, $[14] = t10) : t10 = $[14];
|
|
660
|
-
const handleMouseDown = t10;
|
|
661
|
-
let t11;
|
|
662
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
|
|
663
|
-
if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
|
|
664
|
-
event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
if (event_0.key === "ArrowUp") {
|
|
668
|
-
event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
}, $[15] = t11) : t11 = $[15];
|
|
672
|
-
const handleButtonKeyDown = t11;
|
|
673
|
-
let t12;
|
|
674
|
-
$[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
|
|
675
|
-
const target = event_1.target;
|
|
676
|
-
if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
|
|
677
|
-
for (const el of menuElements)
|
|
678
|
-
if (target === el || el.contains(target))
|
|
679
|
-
return;
|
|
680
|
-
setOpen(!1);
|
|
681
|
-
}
|
|
682
|
-
}, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
|
|
683
|
-
const handleMenuClickOutside = t12;
|
|
684
|
-
let t13;
|
|
685
|
-
$[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
|
|
686
|
-
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
687
|
-
}, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
|
|
688
|
-
const handleMenuEscape = t13;
|
|
689
|
-
let t14;
|
|
690
|
-
$[22] !== menuElements ? (t14 = (event_2) => {
|
|
691
|
-
const target_0 = event_2.relatedTarget;
|
|
692
|
-
if (target_0 instanceof Node) {
|
|
693
|
-
for (const el_0 of menuElements)
|
|
694
|
-
if (el_0 === target_0 || el_0.contains(target_0))
|
|
695
|
-
return;
|
|
696
|
-
setOpen(!1);
|
|
697
|
-
}
|
|
698
|
-
}, $[22] = menuElements, $[23] = t14) : t14 = $[23];
|
|
699
|
-
const handleBlur = t14;
|
|
700
|
-
let t15;
|
|
701
|
-
$[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
|
|
702
|
-
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
703
|
-
}, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
|
|
704
|
-
const handleItemClick = t15;
|
|
705
|
-
let t16;
|
|
706
|
-
$[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];
|
|
707
|
-
const registerElement = t16;
|
|
708
|
-
let t17;
|
|
709
|
-
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
|
|
710
|
-
"aria-labelledby": id,
|
|
711
|
-
onBlurCapture: handleBlur,
|
|
712
|
-
onClickOutside: handleMenuClickOutside,
|
|
713
|
-
onEscape: handleMenuEscape,
|
|
714
|
-
onItemClick: handleItemClick,
|
|
715
|
-
originElement: buttonElement,
|
|
716
|
-
registerElement,
|
|
717
|
-
shouldFocus
|
|
718
|
-
}), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
|
|
719
|
-
const menu = t17;
|
|
720
|
-
let t18;
|
|
721
|
-
bb0: {
|
|
722
|
-
if (!buttonProp) {
|
|
723
|
-
t18 = null;
|
|
724
|
-
break bb0;
|
|
725
|
-
}
|
|
726
|
-
const t192 = buttonProp.props.selected ?? open;
|
|
727
|
-
let t202;
|
|
728
|
-
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = cloneElement(buttonProp, {
|
|
729
|
-
"data-ui": "MenuButton",
|
|
730
|
-
id,
|
|
731
|
-
onClick: handleButtonClick,
|
|
732
|
-
onKeyDown: handleButtonKeyDown,
|
|
733
|
-
onMouseDown: handleMouseDown,
|
|
734
|
-
"aria-haspopup": !0,
|
|
735
|
-
"aria-expanded": open,
|
|
736
|
-
ref: setButtonElement,
|
|
737
|
-
selected: t192
|
|
738
|
-
}), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t192, $[42] = t202) : t202 = $[42], t18 = t202;
|
|
739
|
-
}
|
|
740
|
-
const button = t18;
|
|
741
|
-
let t19, t20;
|
|
742
|
-
$[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), useImperativeHandle(forwardedRef, t19, t20);
|
|
743
|
-
let t21, t22;
|
|
744
|
-
$[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
|
|
745
|
-
let t23;
|
|
746
|
-
$[48] !== deprecated_boundaryElement || $[49] !== deprecated_placement || $[50] !== deprecated_popoverRadius || $[51] !== deprecated_popoverScheme || $[52] !== deprecated_portal || $[53] !== deprecated_preventOverflow || $[54] !== t22 ? (t23 = {
|
|
747
|
-
boundaryElement: deprecated_boundaryElement,
|
|
748
|
-
overflow: "auto",
|
|
749
|
-
placement: deprecated_placement,
|
|
750
|
-
portal: deprecated_portal,
|
|
751
|
-
preventOverflow: deprecated_preventOverflow,
|
|
752
|
-
radius: deprecated_popoverRadius,
|
|
753
|
-
scheme: deprecated_popoverScheme,
|
|
754
|
-
...t22
|
|
755
|
-
}, $[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;
|
|
756
|
-
const popoverProps = t21;
|
|
757
|
-
let t24;
|
|
758
|
-
$[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
|
|
759
|
-
let t25;
|
|
760
|
-
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;
|
|
761
|
-
});
|
|
762
|
-
MenuButton.displayName = "ForwardRef(MenuButton)";
|
|
763
|
-
function _temp$2(v) {
|
|
764
|
-
return !v;
|
|
765
|
-
}
|
|
766
|
-
const Skeleton = forwardRef(function(props, ref) {
|
|
767
|
-
const $ = c(18);
|
|
768
|
-
let className, delay, radius, restProps, t0;
|
|
769
|
-
$[0] !== props ? ({
|
|
770
|
-
animated: t0,
|
|
771
|
-
className,
|
|
772
|
-
delay,
|
|
773
|
-
radius,
|
|
774
|
-
...restProps
|
|
775
|
-
} = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = restProps, $[5] = t0) : (className = $[1], delay = $[2], radius = $[3], restProps = $[4], t0 = $[5]);
|
|
776
|
-
const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = useState(!delay);
|
|
777
|
-
let t1, t2;
|
|
778
|
-
$[6] !== delay ? (t1 = () => {
|
|
779
|
-
if (!delay)
|
|
780
|
-
return setVisible(!0);
|
|
781
|
-
const timeout = setTimeout(() => {
|
|
782
|
-
setVisible(!0);
|
|
783
|
-
}, delay);
|
|
784
|
-
return () => {
|
|
785
|
-
clearTimeout(timeout);
|
|
786
|
-
};
|
|
787
|
-
}, t2 = [delay], $[6] = delay, $[7] = t1, $[8] = t2) : (t1 = $[7], t2 = $[8]), useEffect(t1, t2);
|
|
788
|
-
let t3;
|
|
789
|
-
$[9] !== className || $[10] !== radius ? (t3 = composeClassNames(className, skeleton({
|
|
790
|
-
radius
|
|
791
|
-
})), $[9] = className, $[10] = radius, $[11] = t3) : t3 = $[11];
|
|
792
|
-
const t4 = animated ? "" : void 0, t5 = visible ? "" : void 0;
|
|
793
|
-
let t6;
|
|
794
|
-
return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t4 || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...restProps, className: t3, "data-animated": t4, "data-visible": t5, ref }), $[12] = ref, $[13] = restProps, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6) : t6 = $[17], t6;
|
|
795
|
-
});
|
|
796
|
-
Skeleton.displayName = "ForwardRef(Skeleton)";
|
|
797
|
-
const TextSkeleton = forwardRef(function(props, ref) {
|
|
798
|
-
const $ = c(11);
|
|
799
|
-
let className, restProps, t0;
|
|
800
|
-
$[0] !== props ? ({
|
|
801
|
-
className,
|
|
802
|
-
size: t0,
|
|
803
|
-
...restProps
|
|
804
|
-
} = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
|
|
805
|
-
const size = t0 === void 0 ? 2 : t0;
|
|
806
|
-
let t1;
|
|
807
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, textSkeleton({
|
|
808
|
-
size
|
|
809
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
810
|
-
let t2;
|
|
811
|
-
return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { "data-ui": "TextSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
|
|
812
|
-
});
|
|
813
|
-
TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
|
|
814
|
-
const LabelSkeleton = forwardRef(function(props, ref) {
|
|
815
|
-
const $ = c(11);
|
|
816
|
-
let className, restProps, t0;
|
|
817
|
-
$[0] !== props ? ({
|
|
818
|
-
className,
|
|
819
|
-
size: t0,
|
|
820
|
-
...restProps
|
|
821
|
-
} = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
|
|
822
|
-
const size = t0 === void 0 ? 2 : t0;
|
|
823
|
-
let t1;
|
|
824
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, labelSkeleton({
|
|
825
|
-
size
|
|
826
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
827
|
-
let t2;
|
|
828
|
-
return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { "data-ui": "LabelSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
|
|
829
|
-
});
|
|
830
|
-
LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
|
|
831
|
-
const HeadingSkeleton = forwardRef(function(props, ref) {
|
|
832
|
-
const $ = c(11);
|
|
833
|
-
let className, restProps, t0;
|
|
834
|
-
$[0] !== props ? ({
|
|
835
|
-
className,
|
|
836
|
-
size: t0,
|
|
837
|
-
...restProps
|
|
838
|
-
} = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
|
|
839
|
-
const size = t0 === void 0 ? 2 : t0;
|
|
840
|
-
let t1;
|
|
841
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, headingSkeleton({
|
|
842
|
-
size
|
|
843
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
844
|
-
let t2;
|
|
845
|
-
return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
|
|
846
|
-
});
|
|
847
|
-
HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
|
|
848
|
-
const CodeSkeleton = forwardRef(function(props, ref) {
|
|
849
|
-
const $ = c(11);
|
|
850
|
-
let className, restProps, t0;
|
|
851
|
-
$[0] !== props ? ({
|
|
852
|
-
className,
|
|
853
|
-
size: t0,
|
|
854
|
-
...restProps
|
|
855
|
-
} = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
|
|
856
|
-
const size = t0 === void 0 ? 2 : t0;
|
|
857
|
-
let t1;
|
|
858
|
-
$[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, codeSkeleton({
|
|
859
|
-
size
|
|
860
|
-
})), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
|
|
861
|
-
let t2;
|
|
862
|
-
return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
|
|
863
|
-
});
|
|
864
|
-
CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
|
|
865
|
-
const TabPanel = forwardRef(function(props, ref) {
|
|
866
|
-
const $ = c(9);
|
|
867
|
-
let flex, restProps;
|
|
868
|
-
$[0] !== props ? ({
|
|
869
|
-
flex,
|
|
870
|
-
...restProps
|
|
871
|
-
} = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
|
|
872
|
-
const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
|
|
873
|
-
let t1;
|
|
874
|
-
return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
|
|
875
|
-
});
|
|
876
|
-
TabPanel.displayName = "ForwardRef(TabPanel)";
|
|
877
|
-
const ROLES = {
|
|
878
|
-
error: "alert",
|
|
879
|
-
warning: "alert",
|
|
880
|
-
success: "alert",
|
|
881
|
-
info: "alert"
|
|
882
|
-
}, STATUS_CARD_TONE = {
|
|
883
|
-
error: "critical",
|
|
884
|
-
warning: "caution",
|
|
885
|
-
success: "positive",
|
|
886
|
-
info: "neutral"
|
|
887
|
-
}, BUTTON_TONE = {
|
|
888
|
-
error: "critical",
|
|
889
|
-
warning: "caution",
|
|
890
|
-
success: "positive",
|
|
891
|
-
info: "neutral"
|
|
892
|
-
}, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
|
|
893
|
-
function Toast(props) {
|
|
894
|
-
const $ = c(51);
|
|
895
|
-
let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
|
|
896
|
-
$[0] !== props ? ({
|
|
897
|
-
closable,
|
|
898
|
-
description,
|
|
899
|
-
duration,
|
|
900
|
-
onClose,
|
|
901
|
-
radius: t0,
|
|
902
|
-
title,
|
|
903
|
-
status,
|
|
904
|
-
updatedAt,
|
|
905
|
-
...restProps
|
|
906
|
-
} = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]);
|
|
907
|
-
const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
|
|
908
|
-
let t1;
|
|
909
|
-
$[10] !== visualDuration ? (t1 = visualDuration ? {
|
|
910
|
-
type: "spring",
|
|
911
|
-
visualDuration,
|
|
912
|
-
bounce: 0.25
|
|
913
|
-
} : {
|
|
914
|
-
duration: 0
|
|
915
|
-
}, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
|
|
916
|
-
const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
|
|
917
|
-
let t2;
|
|
918
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
|
|
919
|
-
const initial = t2;
|
|
920
|
-
let t3;
|
|
921
|
-
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
|
|
922
|
-
const animate = t3;
|
|
923
|
-
let t4;
|
|
924
|
-
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
|
|
925
|
-
const exit = t4;
|
|
926
|
-
let t5;
|
|
927
|
-
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t5 = toast(), $[15] = t5) : t5 = $[15];
|
|
928
|
-
const t6 = hasDuration ? "" : void 0;
|
|
929
|
-
let t7;
|
|
930
|
-
$[16] !== title ? (t7 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[16] = title, $[17] = t7) : t7 = $[17];
|
|
931
|
-
let t8;
|
|
932
|
-
$[18] !== description || $[19] !== transition ? (t8 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t8) : t8 = $[20];
|
|
933
|
-
let t9;
|
|
934
|
-
$[21] !== t7 || $[22] !== t8 ? (t9 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
|
|
935
|
-
t7,
|
|
936
|
-
t8
|
|
937
|
-
] }) }), $[21] = t7, $[22] = t8, $[23] = t9) : t9 = $[23];
|
|
938
|
-
let t10;
|
|
939
|
-
$[24] !== buttonTone || $[25] !== closable || $[26] !== onClose ? (t10 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
|
|
940
|
-
verticalAlign: "top"
|
|
941
|
-
} }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t10) : t10 = $[27];
|
|
942
|
-
let t11;
|
|
943
|
-
$[28] !== t10 || $[29] !== t9 || $[30] !== transition ? (t11 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
|
|
944
|
-
t9,
|
|
945
|
-
t10
|
|
946
|
-
] }), $[28] = t10, $[29] = t9, $[30] = transition, $[31] = t11) : t11 = $[31];
|
|
947
|
-
let t12;
|
|
948
|
-
$[32] !== cardTone || $[33] !== duration || $[34] !== hasDuration || $[35] !== onClose || $[36] !== radius || $[37] !== transition || $[38] !== updatedAt || $[39] !== visualDuration ? (t12 = hasDuration && /* @__PURE__ */ jsxs(MotionBox, { className: toastLoadingBar(), variants: content, transition, children: [
|
|
949
|
-
/* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
|
|
950
|
-
/* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
|
|
951
|
-
scaleX: 0
|
|
952
|
-
}, animate: {
|
|
953
|
-
scaleX: 1
|
|
954
|
-
}, transition: {
|
|
955
|
-
delay: visualDuration,
|
|
956
|
-
duration: duration / 1e3,
|
|
957
|
-
ease: "linear"
|
|
958
|
-
}, onAnimationComplete: onClose }, `progress-${updatedAt}`)
|
|
959
|
-
] }), $[32] = cardTone, $[33] = duration, $[34] = hasDuration, $[35] = onClose, $[36] = radius, $[37] = transition, $[38] = updatedAt, $[39] = visualDuration, $[40] = t12) : t12 = $[40];
|
|
960
|
-
let t13;
|
|
961
|
-
return $[41] !== cardTone || $[42] !== radius || $[43] !== restProps || $[44] !== role || $[45] !== t11 || $[46] !== t12 || $[47] !== t6 || $[48] !== transition || $[49] !== visualDuration ? (t13 = /* @__PURE__ */ jsxs(MotionCard, { as: "li", className: t5, "data-ui": "Toast", role, ...restProps, "data-has-duration": t6, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, width: "fill", position: "relative", children: [
|
|
962
|
-
t11,
|
|
963
|
-
t12
|
|
964
|
-
] }), $[41] = cardTone, $[42] = radius, $[43] = restProps, $[44] = role, $[45] = t11, $[46] = t12, $[47] = t6, $[48] = transition, $[49] = visualDuration, $[50] = t13) : t13 = $[50], t13;
|
|
965
|
-
}
|
|
966
|
-
Toast.displayName = "Toast";
|
|
967
|
-
const container = {
|
|
968
|
-
initial: {
|
|
969
|
-
y: 32,
|
|
970
|
-
scale: 0.5,
|
|
971
|
-
zIndex: 1
|
|
972
|
-
},
|
|
973
|
-
hidden: {
|
|
974
|
-
opacity: 0
|
|
975
|
-
},
|
|
976
|
-
visible: (visualDuration) => visualDuration ? {
|
|
977
|
-
opacity: 1,
|
|
978
|
-
transition: {
|
|
979
|
-
when: "beforeChildren",
|
|
980
|
-
staggerChildren: visualDuration / 3,
|
|
981
|
-
duration: visualDuration / 3
|
|
982
|
-
}
|
|
983
|
-
} : {
|
|
984
|
-
opacity: 1
|
|
985
|
-
},
|
|
986
|
-
slideIn: {
|
|
987
|
-
y: 0,
|
|
988
|
-
scale: 1
|
|
989
|
-
},
|
|
990
|
-
slideOut: {
|
|
991
|
-
zIndex: 0,
|
|
992
|
-
scale: 0.75
|
|
993
|
-
}
|
|
994
|
-
}, content = {
|
|
995
|
-
initial: {
|
|
996
|
-
willChange: "transform"
|
|
997
|
-
},
|
|
998
|
-
hidden: {
|
|
999
|
-
opacity: 0
|
|
1000
|
-
},
|
|
1001
|
-
visible: {
|
|
1002
|
-
opacity: 1
|
|
1003
|
-
}
|
|
1004
|
-
}, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
|
|
1005
|
-
function useMounted() {
|
|
1006
|
-
return useSyncExternalStore(subscribe, _temp$1, _temp2);
|
|
1007
|
-
}
|
|
1008
|
-
function _temp2() {
|
|
1009
|
-
return !1;
|
|
1010
|
-
}
|
|
1011
|
-
function _temp$1() {
|
|
1012
|
-
return !0;
|
|
1013
|
-
}
|
|
1014
|
-
const subscribe = () => () => {
|
|
1015
|
-
}, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
|
|
1016
|
-
function ToastLayer(props) {
|
|
1017
|
-
const $ = c(10), {
|
|
1018
|
-
children,
|
|
1019
|
-
padding: t0,
|
|
1020
|
-
paddingX,
|
|
1021
|
-
paddingY,
|
|
1022
|
-
gap: t1
|
|
1023
|
-
} = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
|
|
1024
|
-
zIndex
|
|
1025
|
-
} = useLayer();
|
|
1026
|
-
let t2;
|
|
1027
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = toastLayer(), $[0] = t2) : t2 = $[0];
|
|
1028
|
-
let t3;
|
|
1029
|
-
$[1] !== zIndex ? (t3 = {
|
|
1030
|
-
zIndex
|
|
1031
|
-
}, $[1] = zIndex, $[2] = t3) : t3 = $[2];
|
|
1032
|
-
let t4;
|
|
1033
|
-
return $[3] !== children || $[4] !== gap || $[5] !== padding || $[6] !== paddingX || $[7] !== paddingY || $[8] !== t3 ? (t4 = /* @__PURE__ */ jsx(Grid, { as: "ul", className: t2, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t3, children }), $[3] = children, $[4] = gap, $[5] = padding, $[6] = paddingX, $[7] = paddingY, $[8] = t3, $[9] = t4) : t4 = $[9], t4;
|
|
1034
|
-
}
|
|
1035
|
-
ToastLayer.displayName = "ToastLayer";
|
|
1036
|
-
let toastId = 0;
|
|
1037
|
-
function generateToastId() {
|
|
1038
|
-
return String(toastId++);
|
|
1039
|
-
}
|
|
1040
|
-
function ToastProvider(props) {
|
|
1041
|
-
const $ = c(13), {
|
|
1042
|
-
children,
|
|
1043
|
-
padding,
|
|
1044
|
-
paddingX,
|
|
1045
|
-
paddingY,
|
|
1046
|
-
gap,
|
|
1047
|
-
zOffset: t0
|
|
1048
|
-
} = props, zOffset = t0 === void 0 ? 1 : t0;
|
|
1049
|
-
let t1;
|
|
1050
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
1051
|
-
const [state, setState] = useState(t1), mounted = useMounted();
|
|
1052
|
-
let t2, t3;
|
|
1053
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1054
|
-
version: 0,
|
|
1055
|
-
push: (params) => {
|
|
1056
|
-
const id = params.id || generateToastId(), duration = params.duration || 5e3;
|
|
1057
|
-
return startTransition(() => {
|
|
1058
|
-
setState((prevState) => {
|
|
1059
|
-
if (duration === 0.01)
|
|
1060
|
-
return prevState.filter((toast2) => toast2.id !== id);
|
|
1061
|
-
const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
|
|
1062
|
-
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
1063
|
-
dismiss,
|
|
1064
|
-
id,
|
|
1065
|
-
updatedAt: Date.now(),
|
|
1066
|
-
params: {
|
|
1067
|
-
...params,
|
|
1068
|
-
duration
|
|
1069
|
-
}
|
|
1070
|
-
}];
|
|
1071
|
-
});
|
|
1072
|
-
}), id;
|
|
1073
|
-
}
|
|
1074
|
-
}, $[1] = t3) : t3 = $[1], t2 = t3;
|
|
1075
|
-
const value = t2;
|
|
1076
|
-
let t4;
|
|
1077
|
-
$[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];
|
|
1078
|
-
let t5;
|
|
1079
|
-
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
1080
|
-
children,
|
|
1081
|
-
t4
|
|
1082
|
-
] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
|
|
1083
|
-
}
|
|
1084
|
-
function _temp(t0) {
|
|
1085
|
-
const {
|
|
1086
|
-
dismiss: dismiss_0,
|
|
1087
|
-
id: id_0,
|
|
1088
|
-
params: params_0,
|
|
1089
|
-
updatedAt
|
|
1090
|
-
} = t0;
|
|
1091
|
-
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);
|
|
1092
|
-
}
|
|
1093
|
-
ToastProvider.displayName = "ToastProvider";
|
|
1094
|
-
function useToast() {
|
|
1095
|
-
const value = useContext(ToastContext);
|
|
1096
|
-
if (!value)
|
|
1097
|
-
throw new Error("useToast(): missing context value");
|
|
1098
|
-
if (!isRecord(value) || value.version !== 0)
|
|
1099
|
-
throw new Error("useToast(): the context value is not compatible");
|
|
1100
|
-
return value;
|
|
1101
|
-
}
|
|
1102
|
-
function _findPrevItemElement(state, itemElements, focusedElement) {
|
|
1103
|
-
const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
|
|
1104
|
-
for (let i = len - 1; i >= 0; i -= 1) {
|
|
1105
|
-
const itemKey = els[i].getAttribute("data-tree-key");
|
|
1106
|
-
if (!itemKey)
|
|
1107
|
-
continue;
|
|
1108
|
-
const segments = itemKey.split("/");
|
|
1109
|
-
segments.pop();
|
|
1110
|
-
const p = [];
|
|
1111
|
-
let expanded = !0;
|
|
1112
|
-
for (let j = 0; j < segments.length; j += 1) {
|
|
1113
|
-
p.push(segments[j]);
|
|
1114
|
-
const k = p.join("/");
|
|
1115
|
-
if (!state[k]?.expanded) {
|
|
1116
|
-
expanded = !1;
|
|
1117
|
-
break;
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
if (expanded)
|
|
1121
|
-
return els[i];
|
|
1122
|
-
}
|
|
1123
|
-
return null;
|
|
1124
|
-
}
|
|
1125
|
-
function _findNextItemElement(state, itemElements, focusedElement) {
|
|
1126
|
-
const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
|
|
1127
|
-
for (let i = 1; i < len; i += 1) {
|
|
1128
|
-
if (!els[i])
|
|
1129
|
-
continue;
|
|
1130
|
-
const itemKey = els[i].getAttribute("data-tree-key");
|
|
1131
|
-
if (!itemKey)
|
|
1132
|
-
continue;
|
|
1133
|
-
const segments = itemKey.split("/");
|
|
1134
|
-
segments.pop();
|
|
1135
|
-
const p = [];
|
|
1136
|
-
let expanded = !0;
|
|
1137
|
-
for (let j = 0; j < segments.length; j += 1) {
|
|
1138
|
-
p.push(segments[j]);
|
|
1139
|
-
const k = p.join("/");
|
|
1140
|
-
if (!state[k]?.expanded) {
|
|
1141
|
-
expanded = !1;
|
|
1142
|
-
break;
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
if (expanded)
|
|
1146
|
-
return els[i];
|
|
1147
|
-
}
|
|
1148
|
-
return null;
|
|
1149
|
-
}
|
|
1150
|
-
function _focusItemElement(el) {
|
|
1151
|
-
if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
|
|
1152
|
-
const firstChild = el.firstChild;
|
|
1153
|
-
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = memo(forwardRef(function(props, forwardedRef) {
|
|
1157
|
-
const $ = c(38);
|
|
1158
|
-
let children, gap, onFocus, restProps, t0;
|
|
1159
|
-
$[0] !== props ? ({
|
|
1160
|
-
children,
|
|
1161
|
-
gap,
|
|
1162
|
-
space: t0,
|
|
1163
|
-
onFocus,
|
|
1164
|
-
...restProps
|
|
1165
|
-
} = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
|
|
1166
|
-
const space = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
|
|
1167
|
-
let t1, t2;
|
|
1168
|
-
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6], t1 = t2;
|
|
1169
|
-
const path = t1;
|
|
1170
|
-
let t3;
|
|
1171
|
-
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
|
|
1172
|
-
const [itemElements, setItemElements] = useState(t3);
|
|
1173
|
-
let t4;
|
|
1174
|
-
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
|
|
1175
|
-
const [state, setState] = useState(t4), stateRef = useRef(state);
|
|
1176
|
-
let t5;
|
|
1177
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], useImperativeHandle(forwardedRef, t5);
|
|
1178
|
-
let t6, t7;
|
|
1179
|
-
$[10] !== focusedElement ? (t6 = () => {
|
|
1180
|
-
focusedElementRef.current = focusedElement;
|
|
1181
|
-
}, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), useEffect(t6, t7);
|
|
1182
|
-
let t8, t9;
|
|
1183
|
-
$[13] !== state ? (t8 = () => {
|
|
1184
|
-
stateRef.current = state;
|
|
1185
|
-
}, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), useEffect(t8, t9);
|
|
1186
|
-
let t10;
|
|
1187
|
-
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
1188
|
-
...s,
|
|
1189
|
-
[path_0]: {
|
|
1190
|
-
element,
|
|
1191
|
-
expanded
|
|
1192
|
-
}
|
|
1193
|
-
})), selected && setFocusedElement(element), () => {
|
|
1194
|
-
setState((s_0) => {
|
|
1195
|
-
const newState = {
|
|
1196
|
-
...s_0
|
|
1197
|
-
};
|
|
1198
|
-
return delete newState[path_0], newState;
|
|
1199
|
-
});
|
|
1200
|
-
}), $[16] = t10) : t10 = $[16];
|
|
1201
|
-
const registerItem = t10;
|
|
1202
|
-
let t11;
|
|
1203
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
|
|
1204
|
-
setState((s_1) => {
|
|
1205
|
-
const itemState = s_1[path_1];
|
|
1206
|
-
return itemState ? {
|
|
1207
|
-
...s_1,
|
|
1208
|
-
[path_1]: {
|
|
1209
|
-
...itemState,
|
|
1210
|
-
expanded: expanded_0
|
|
1211
|
-
}
|
|
1212
|
-
} : s_1;
|
|
1213
|
-
});
|
|
1214
|
-
}, $[17] = t11) : t11 = $[17];
|
|
1215
|
-
const setExpanded = t11;
|
|
1216
|
-
let t12;
|
|
1217
|
-
const t13 = focusedElement || itemElements[0] || null;
|
|
1218
|
-
let t14;
|
|
1219
|
-
$[18] !== space || $[19] !== state || $[20] !== t13 ? (t14 = {
|
|
1220
|
-
version: 0,
|
|
1221
|
-
focusedElement: t13,
|
|
1222
|
-
level: 0,
|
|
1223
|
-
path,
|
|
1224
|
-
registerItem,
|
|
1225
|
-
setExpanded,
|
|
1226
|
-
setFocusedElement,
|
|
1227
|
-
space,
|
|
1228
|
-
state
|
|
1229
|
-
}, $[18] = space, $[19] = state, $[20] = t13, $[21] = t14) : t14 = $[21], t12 = t14;
|
|
1230
|
-
const contextValue = t12;
|
|
1231
|
-
let t15;
|
|
1232
|
-
$[22] !== itemElements ? (t15 = (event) => {
|
|
1233
|
-
if (focusedElementRef.current) {
|
|
1234
|
-
if (event.key === "ArrowDown") {
|
|
1235
|
-
event.preventDefault();
|
|
1236
|
-
const nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
|
|
1237
|
-
nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
|
|
1238
|
-
return;
|
|
1239
|
-
}
|
|
1240
|
-
if (event.key === "ArrowUp") {
|
|
1241
|
-
event.preventDefault();
|
|
1242
|
-
const prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
|
|
1243
|
-
prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
|
|
1244
|
-
return;
|
|
1245
|
-
}
|
|
1246
|
-
if (event.key === "ArrowLeft") {
|
|
1247
|
-
event.preventDefault();
|
|
1248
|
-
const itemKey = focusedElementRef.current.getAttribute("data-tree-key");
|
|
1249
|
-
if (!itemKey)
|
|
1250
|
-
return;
|
|
1251
|
-
const itemState_0 = stateRef.current[itemKey];
|
|
1252
|
-
if (!itemState_0)
|
|
1253
|
-
return;
|
|
1254
|
-
if (itemState_0.expanded)
|
|
1255
|
-
setState((s_2) => {
|
|
1256
|
-
const itemState_1 = s_2[itemKey];
|
|
1257
|
-
return itemState_1 ? {
|
|
1258
|
-
...s_2,
|
|
1259
|
-
[itemKey]: {
|
|
1260
|
-
...itemState_1,
|
|
1261
|
-
expanded: !1
|
|
1262
|
-
}
|
|
1263
|
-
} : s_2;
|
|
1264
|
-
});
|
|
1265
|
-
else {
|
|
1266
|
-
const itemPath = itemKey.split("/");
|
|
1267
|
-
itemPath.pop();
|
|
1268
|
-
const parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
|
|
1269
|
-
parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
|
|
1270
|
-
}
|
|
1271
|
-
return;
|
|
1272
|
-
}
|
|
1273
|
-
if (event.key === "ArrowRight") {
|
|
1274
|
-
event.preventDefault();
|
|
1275
|
-
const focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
|
|
1276
|
-
if (!focusedKey)
|
|
1277
|
-
return;
|
|
1278
|
-
stateRef.current[focusedKey]?.expanded || setState((s_3) => {
|
|
1279
|
-
const itemState_2 = s_3[focusedKey];
|
|
1280
|
-
return itemState_2 ? {
|
|
1281
|
-
...s_3,
|
|
1282
|
-
[focusedKey]: {
|
|
1283
|
-
...itemState_2,
|
|
1284
|
-
expanded: !0
|
|
1285
|
-
}
|
|
1286
|
-
} : s_3;
|
|
1287
|
-
});
|
|
1288
|
-
return;
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
}, $[22] = itemElements, $[23] = t15) : t15 = $[23];
|
|
1292
|
-
const handleKeyDown = t15;
|
|
1293
|
-
let t16;
|
|
1294
|
-
$[24] !== onFocus ? (t16 = (event_0) => {
|
|
1295
|
-
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1296
|
-
}, $[24] = onFocus, $[25] = t16) : t16 = $[25];
|
|
1297
|
-
const handleFocus = t16;
|
|
1298
|
-
let t17;
|
|
1299
|
-
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t17 = () => {
|
|
1300
|
-
if (!ref.current)
|
|
1301
|
-
return;
|
|
1302
|
-
const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
|
|
1303
|
-
setItemElements(_itemElements);
|
|
1304
|
-
}, $[26] = t17) : t17 = $[26];
|
|
1305
|
-
let t18;
|
|
1306
|
-
$[27] !== children ? (t18 = [children], $[27] = children, $[28] = t18) : t18 = $[28], useEffect(t17, t18);
|
|
1307
|
-
const t19 = gap ?? space;
|
|
1308
|
-
let t20;
|
|
1309
|
-
$[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== t19 ? (t20 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, gap: t19, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = t19, $[34] = t20) : t20 = $[34];
|
|
1310
|
-
let t21;
|
|
1311
|
-
return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
|
|
1312
|
-
}));
|
|
1313
|
-
Tree.displayName = "Memo(ForwardRef(Tree))";
|
|
1314
|
-
function useTree() {
|
|
1315
|
-
const tree = useContext(TreeContext);
|
|
1316
|
-
if (!tree)
|
|
1317
|
-
throw new Error("Tree: missing context value");
|
|
1318
|
-
return tree;
|
|
1319
|
-
}
|
|
1320
|
-
const TreeGroup = memo(function(props) {
|
|
1321
|
-
const $ = c(9);
|
|
1322
|
-
let children, restProps, t0;
|
|
1323
|
-
$[0] !== props ? ({
|
|
1324
|
-
children,
|
|
1325
|
-
expanded: t0,
|
|
1326
|
-
...restProps
|
|
1327
|
-
} = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
|
|
1328
|
-
const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
|
|
1329
|
-
let t2;
|
|
1330
|
-
return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
|
|
1331
|
-
}), TreeItem = memo(function(props) {
|
|
1332
|
-
const {
|
|
1333
|
-
children,
|
|
1334
|
-
className,
|
|
1335
|
-
expanded: expandedProp = !1,
|
|
1336
|
-
fontSize = 1,
|
|
1337
|
-
href,
|
|
1338
|
-
icon: IconComponent,
|
|
1339
|
-
id: idProp,
|
|
1340
|
-
linkAs = "a",
|
|
1341
|
-
muted,
|
|
1342
|
-
onClick,
|
|
1343
|
-
padding = 2,
|
|
1344
|
-
radius = 2,
|
|
1345
|
-
selected = !1,
|
|
1346
|
-
space = 2,
|
|
1347
|
-
text,
|
|
1348
|
-
weight,
|
|
1349
|
-
...restProps
|
|
1350
|
-
} = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
1351
|
-
path,
|
|
1352
|
-
registerItem,
|
|
1353
|
-
setExpanded,
|
|
1354
|
-
setFocusedElement
|
|
1355
|
-
} = 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(() => ({
|
|
1356
|
-
...tree,
|
|
1357
|
-
level: tree.level + 1,
|
|
1358
|
-
path: itemPath
|
|
1359
|
-
}), [itemPath, tree]), handleClick = useCallback((event) => {
|
|
1360
|
-
onClick && onClick(event);
|
|
1361
|
-
const target = event.target;
|
|
1362
|
-
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
|
|
1363
|
-
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
|
|
1364
|
-
focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
|
|
1365
|
-
}, [focused]);
|
|
1366
|
-
useEffect(() => {
|
|
1367
|
-
if (rootRef.current)
|
|
1368
|
-
return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
|
|
1369
|
-
}, [expanded, itemPath, registerItem, selected]);
|
|
1370
|
-
const content2 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
|
|
1371
|
-
/* @__PURE__ */ jsxs(Box, { style: {
|
|
1372
|
-
visibility: IconComponent || children ? "visible" : "hidden",
|
|
1373
|
-
pointerEvents: "none"
|
|
1374
|
-
}, children: [
|
|
1375
|
-
IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
|
|
1376
|
-
!IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
|
|
1377
|
-
transform: expanded ? "rotate(90deg)" : void 0
|
|
1378
|
-
} }) })
|
|
1379
|
-
] }),
|
|
1380
|
-
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
|
|
1381
|
-
] });
|
|
1382
|
-
return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, as: "li", className: composeClassNames(className, treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
|
|
1383
|
-
/* @__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: {
|
|
1384
|
-
paddingLeft: `calc(var(--space-2) * ${tree.level})`
|
|
1385
|
-
}, children: content2 }),
|
|
1386
|
-
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
|
|
1387
|
-
] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, className: composeClassNames(className, treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
|
|
1388
|
-
/* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
|
|
1389
|
-
paddingLeft: `calc(var(--space-2) * ${tree.level})`
|
|
1390
|
-
}, children: content2 }),
|
|
1391
|
-
/* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
|
|
1392
|
-
] });
|
|
1393
|
-
});
|
|
1394
|
-
TreeItem.displayName = "Memo(TreeItem)";
|
|
1395
|
-
function StyleTags(props) {
|
|
1396
|
-
const $ = c(14), {
|
|
1397
|
-
theme: themeProp
|
|
1398
|
-
} = props;
|
|
1399
|
-
let t0;
|
|
1400
|
-
$[0] !== themeProp ? (t0 = themeProp ?? buildTheme_v3(), $[0] = themeProp, $[1] = t0) : t0 = $[1];
|
|
1401
|
-
const theme = t0;
|
|
1402
|
-
let t1;
|
|
1403
|
-
$[2] !== theme._palette ? (t1 = compilePalette(theme._palette), $[2] = theme._palette, $[3] = t1) : t1 = $[3];
|
|
1404
|
-
let t2;
|
|
1405
|
-
$[4] !== t1 ? (t2 = /* @__PURE__ */ jsx("style", { href: "sanity-palette", precedence: "palette", children: t1 }), $[4] = t1, $[5] = t2) : t2 = $[5];
|
|
1406
|
-
let t3;
|
|
1407
|
-
$[6] !== theme ? (t3 = compileTheme({
|
|
1408
|
-
v3: theme
|
|
1409
|
-
}), $[6] = theme, $[7] = t3) : t3 = $[7];
|
|
1410
|
-
let t4;
|
|
1411
|
-
$[8] !== t3 ? (t4 = /* @__PURE__ */ jsx("style", { href: "sanity-theme", precedence: "theme", children: t3 }), $[8] = t3, $[9] = t4) : t4 = $[9];
|
|
1412
|
-
let t5;
|
|
1413
|
-
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsx("style", { href: "sanity-system", precedence: "system", children: compileSystem() }), $[10] = t5) : t5 = $[10];
|
|
1414
|
-
let t6;
|
|
1415
|
-
return $[11] !== t2 || $[12] !== t4 ? (t6 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1416
|
-
t2,
|
|
1417
|
-
t4,
|
|
1418
|
-
t5
|
|
1419
|
-
] }), $[11] = t2, $[12] = t4, $[13] = t6) : t6 = $[13], t6;
|
|
1420
|
-
}
|
|
1421
|
-
export {
|
|
1422
|
-
Arrow,
|
|
1423
|
-
Autocomplete,
|
|
1424
|
-
Avatar,
|
|
1425
|
-
AvatarCounter,
|
|
1426
|
-
AvatarStack,
|
|
1427
|
-
Badge,
|
|
1428
|
-
BoundaryElementProvider,
|
|
1429
|
-
Box,
|
|
1430
|
-
Breadcrumbs,
|
|
1431
|
-
Button,
|
|
1432
|
-
Card,
|
|
1433
|
-
Checkbox,
|
|
1434
|
-
Code,
|
|
1435
|
-
CodeSkeleton,
|
|
1436
|
-
ConditionalWrapper,
|
|
1437
|
-
Container,
|
|
1438
|
-
Dialog,
|
|
1439
|
-
DialogContext,
|
|
1440
|
-
DialogProvider,
|
|
1441
|
-
ElementQuery,
|
|
1442
|
-
ErrorBoundary,
|
|
1443
|
-
Flex,
|
|
1444
|
-
Grid,
|
|
1445
|
-
Heading,
|
|
1446
|
-
HeadingSkeleton,
|
|
1447
|
-
Hotkeys,
|
|
1448
|
-
Inline,
|
|
1449
|
-
KBD,
|
|
1450
|
-
Label,
|
|
1451
|
-
LabelSkeleton,
|
|
1452
|
-
Layer,
|
|
1453
|
-
LayerProvider,
|
|
1454
|
-
Menu,
|
|
1455
|
-
MenuButton,
|
|
1456
|
-
MenuDivider,
|
|
1457
|
-
MenuGroup,
|
|
1458
|
-
MenuItem,
|
|
1459
|
-
Popover,
|
|
1460
|
-
Portal,
|
|
1461
|
-
PortalProvider,
|
|
1462
|
-
Radio,
|
|
1463
|
-
Select,
|
|
1464
|
-
Skeleton,
|
|
1465
|
-
Spinner,
|
|
1466
|
-
SrOnly,
|
|
1467
|
-
Stack,
|
|
1468
|
-
StyleTags,
|
|
1469
|
-
Switch,
|
|
1470
|
-
Tab,
|
|
1471
|
-
TabList,
|
|
1472
|
-
TabPanel,
|
|
1473
|
-
Text,
|
|
1474
|
-
TextArea,
|
|
1475
|
-
TextInput,
|
|
1476
|
-
TextSkeleton,
|
|
1477
|
-
ThemeColorProvider,
|
|
1478
|
-
ThemeProvider,
|
|
1479
|
-
Toast,
|
|
1480
|
-
ToastProvider,
|
|
1481
|
-
Tooltip,
|
|
1482
|
-
TooltipDelayGroupContext,
|
|
1483
|
-
TooltipDelayGroupProvider,
|
|
1484
|
-
Tree,
|
|
1485
|
-
TreeItem,
|
|
1486
|
-
VirtualList,
|
|
1487
|
-
_ResizeObserver,
|
|
1488
|
-
_elementSizeObserver,
|
|
1489
|
-
_getArrayProp,
|
|
1490
|
-
_hasFocus,
|
|
1491
|
-
_isEnterToClickElement,
|
|
1492
|
-
_isScrollable,
|
|
1493
|
-
_raf,
|
|
1494
|
-
_raf2,
|
|
1495
|
-
_responsive,
|
|
1496
|
-
attemptFocus,
|
|
1497
|
-
containsOrEqualsElement,
|
|
1498
|
-
createColorTheme,
|
|
1499
|
-
focusFirstDescendant,
|
|
1500
|
-
focusLastDescendant,
|
|
1501
|
-
hexToRgb,
|
|
1502
|
-
hslToRgb,
|
|
1503
|
-
isFocusable,
|
|
1504
|
-
isHTMLAnchorElement,
|
|
1505
|
-
isHTMLButtonElement,
|
|
1506
|
-
isHTMLElement,
|
|
1507
|
-
isHTMLInputElement,
|
|
1508
|
-
isHTMLSelectElement,
|
|
1509
|
-
isHTMLTextAreaElement,
|
|
1510
|
-
multiply,
|
|
1511
|
-
parseColor,
|
|
1512
|
-
px,
|
|
1513
|
-
rem,
|
|
1514
|
-
rgbToHex,
|
|
1515
|
-
rgbToHsl,
|
|
1516
|
-
rgba,
|
|
1517
|
-
screen,
|
|
1518
|
-
studioTheme,
|
|
1519
|
-
useArrayProp,
|
|
1520
|
-
useBoundaryElement,
|
|
1521
|
-
useClickOutside,
|
|
1522
|
-
useClickOutsideEvent,
|
|
1523
|
-
useCustomValidity,
|
|
1524
|
-
useDialog,
|
|
1525
|
-
useElementRect,
|
|
1526
|
-
useElementSize,
|
|
1527
|
-
useForwardedRef,
|
|
1528
|
-
useGlobalKeyDown,
|
|
1529
|
-
useLayer,
|
|
1530
|
-
useMatchMedia,
|
|
1531
|
-
useMediaIndex,
|
|
1532
|
-
usePortal,
|
|
1533
|
-
usePrefersDark,
|
|
1534
|
-
usePrefersReducedMotion,
|
|
1535
|
-
useRootTheme,
|
|
1536
|
-
useTheme,
|
|
1537
|
-
useTheme_v2,
|
|
1538
|
-
useToast,
|
|
1539
|
-
useTooltipDelayGroup,
|
|
1540
|
-
useTree
|
|
1541
|
-
};
|
|
1542
|
-
//# sourceMappingURL=index.mjs.map
|