@sanity/ui 3.0.0-static.3 → 3.0.0-static.30
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 -9
- package/dist/_chunks-cjs/_visual-editing.cjs +2358 -0
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/refractor.cjs +26 -0
- package/dist/_chunks-cjs/refractor.cjs.map +1 -0
- package/dist/_chunks-es/_visual-editing.js +2371 -0
- package/dist/_chunks-es/_visual-editing.js.map +1 -0
- package/dist/_chunks-es/refractor.js +25 -0
- 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 +894 -0
- package/dist/_visual-editing.d.ts +504 -418
- package/dist/_visual-editing.js +29 -30
- package/dist/_visual-editing.js.map +1 -1
- package/dist/css/index.cjs +617 -0
- package/dist/css/index.cjs.map +1 -0
- package/dist/css/index.css +1 -0
- package/dist/css/index.d.cts +14902 -0
- package/dist/css/index.d.ts +14902 -0
- package/dist/css/index.js +617 -0
- package/dist/css/index.js.map +1 -0
- package/dist/css/layers.css +4 -0
- package/dist/css/primitives/popover/popover.css +4 -0
- package/dist/index.cjs +2470 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3212 -0
- package/dist/index.d.ts +1325 -982
- package/dist/index.js +1614 -692
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +4791 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +1903 -0
- package/dist/theme.d.ts +329 -309
- package/dist/theme.js +3188 -1384
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +26 -27
- package/exports/index.ts +1 -1
- package/package.json +67 -79
- package/src/core/_compat/helpers.ts +72 -0
- package/src/core/_compat/styles/_responsive.ts +19 -0
- package/src/core/_compat/theme/theme.test.tsx +72 -0
- package/src/core/_compat/theme/themeColorProvider.tsx +24 -0
- package/src/core/_compat/theme/themeContext.ts +10 -0
- package/src/core/_compat/theme/themeProvider.tsx +68 -0
- package/src/core/_compat/theme/types.ts +10 -0
- package/src/core/_compat/theme/useRootTheme.ts +15 -0
- package/src/core/_compat/theme/useTheme.ts +12 -0
- package/src/core/_compat/types.ts +191 -0
- package/src/core/components/autocomplete/__workshop__/async.tsx +156 -0
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +131 -0
- package/src/core/components/autocomplete/__workshop__/custom.tsx +91 -0
- package/src/core/components/autocomplete/__workshop__/example.tsx +80 -0
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +36 -0
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +292 -0
- package/src/core/components/autocomplete/__workshop__/index.ts +39 -0
- package/src/core/components/autocomplete/autocomplete.tsx +690 -0
- package/src/core/components/autocomplete/autocompleteOption.tsx +45 -0
- package/src/core/components/autocomplete/autocompleteReducer.ts +47 -0
- package/src/core/components/autocomplete/constants.ts +28 -0
- package/src/core/components/autocomplete/types.ts +103 -0
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +61 -0
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +136 -0
- package/src/core/components/dialog/__workshop__/activate.tsx +141 -0
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +29 -0
- package/src/core/components/dialog/__workshop__/onScroll.tsx +51 -0
- package/src/core/components/dialog/__workshop__/panes.tsx +89 -0
- package/src/core/components/dialog/__workshop__/position.tsx +30 -0
- package/src/core/components/dialog/__workshop__/props.tsx +77 -0
- package/src/core/components/dialog/__workshop__/wrapped.tsx +76 -0
- package/src/core/components/dialog/dialog.tsx +233 -0
- package/src/core/components/dialog/dialogCard.tsx +226 -0
- package/src/core/components/dialog/dialogContext.ts +22 -0
- package/src/core/components/dialog/dialogProvider.tsx +34 -0
- package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/core/components/dialog/types.ts +2 -0
- package/src/core/components/dialog/useDialog.ts +11 -0
- package/src/core/components/hotkeys/hotkeys.tsx +71 -0
- package/src/core/components/menu/__workshop__/asComponent.tsx +45 -0
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +57 -0
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +47 -0
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +133 -0
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +45 -0
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +35 -0
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +40 -0
- package/src/core/components/menu/__workshop__/groups.tsx +156 -0
- package/src/core/components/menu/__workshop__/menuButton.tsx +80 -0
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +65 -0
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +22 -0
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +50 -0
- package/src/core/components/menu/__workshop__/selectedItem.tsx +69 -0
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +42 -0
- package/src/core/components/menu/__workshop__/tones.tsx +25 -0
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +32 -0
- package/src/core/components/menu/helpers.ts +82 -0
- package/src/core/components/menu/menu.test.tsx +127 -0
- package/src/core/components/menu/menu.tsx +194 -0
- package/src/core/components/menu/menuButton.tsx +271 -0
- package/src/core/components/menu/menuContext.ts +31 -0
- package/src/core/components/menu/menuDivider.tsx +32 -0
- package/src/core/components/menu/menuGroup.tsx +238 -0
- package/src/core/components/menu/menuItem.tsx +194 -0
- package/src/core/components/menu/useMenu.ts +21 -0
- package/src/core/components/menu/useMenuController.ts +241 -0
- package/src/core/components/tab/__workshop__/example.tsx +79 -0
- package/src/core/components/tab/tab.tsx +107 -0
- package/src/core/components/tab/tabList.tsx +95 -0
- package/src/core/components/tab/tabPanel.tsx +47 -0
- package/src/core/components/toast/__workshop__/hook.tsx +71 -0
- package/src/core/components/toast/__workshop__/toast.tsx +26 -0
- package/src/core/components/toast/toast.test.tsx +101 -0
- package/src/core/components/toast/toast.tsx +189 -0
- package/src/core/components/toast/toastContext.ts +7 -0
- package/src/core/components/toast/toastLayer.tsx +54 -0
- package/src/core/components/toast/toastProvider.tsx +112 -0
- package/src/core/components/toast/types.ts +24 -0
- package/src/core/components/toast/useToast.ts +23 -0
- package/src/core/components/tree/__workshop__/basic.perf.ts +19 -0
- package/src/core/components/tree/__workshop__/basic.tsx +105 -0
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +84 -0
- package/src/core/components/tree/helpers.ts +105 -0
- package/src/core/components/tree/tree.tsx +249 -0
- package/src/core/components/tree/treeContext.ts +10 -0
- package/src/core/components/tree/treeGroup.tsx +48 -0
- package/src/core/components/tree/treeItem.tsx +237 -0
- package/src/core/components/tree/types.ts +24 -0
- package/src/core/components/tree/useTree.ts +17 -0
- package/src/core/components/virtualList/__workshop__/index.ts +29 -0
- package/src/core/components/virtualList/__workshop__/infiniteList.tsx +48 -0
- package/src/core/components/virtualList/virtualList.tsx +209 -0
- package/src/core/constants.ts +85 -0
- package/src/core/helpers/focus.ts +92 -0
- package/src/core/helpers/props.ts +28 -0
- package/src/core/hooks/useArrayProp.ts +26 -0
- package/src/core/hooks/useClickOutside.test.tsx +481 -0
- package/src/core/hooks/useClickOutside.ts +113 -0
- package/src/core/hooks/useClickOutsideEvent.test.tsx +114 -0
- package/src/core/hooks/useClickOutsideEvent.ts +67 -0
- package/src/core/hooks/useDelayed.test.ts +67 -0
- package/src/core/hooks/useDelayedState.ts +28 -0
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +30 -0
- package/src/core/hooks/useElementSize.ts +19 -0
- package/src/core/hooks/useForwardedRef.ts +19 -0
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +14 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +21 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +102 -0
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +56 -0
- package/src/core/hooks/usePrefersDark.test.tsx +20 -0
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +56 -0
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +20 -0
- package/src/core/hooks/useResponsiveProp.ts +28 -0
- package/src/core/index.ts +136 -0
- package/src/core/lib/isArray.ts +3 -0
- package/src/core/middleware/origin.ts +47 -0
- package/src/core/observers/elementSize.ts +116 -0
- package/src/core/primitives/arrow/arrow.tsx +74 -0
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +14 -0
- package/src/core/primitives/avatar/__workshop__/stack.tsx +25 -0
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +55 -0
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +72 -0
- package/src/core/primitives/avatar/avatar.tsx +154 -0
- package/src/core/primitives/avatar/avatarCounter.tsx +69 -0
- package/src/core/primitives/avatar/avatarStack.tsx +81 -0
- package/src/core/primitives/avatar/types.ts +34 -0
- package/src/core/primitives/badge/__workshop__/props.tsx +19 -0
- package/src/core/primitives/badge/__workshop__/tones.tsx +16 -0
- package/src/core/primitives/badge/badge.test.tsx +15 -0
- package/src/core/primitives/badge/badge.tsx +60 -0
- package/src/core/primitives/badge/types.ts +18 -0
- package/src/core/primitives/box/__workshop__/props.tsx +20 -0
- package/src/core/primitives/box/__workshop__/responsive.tsx +20 -0
- package/src/core/primitives/box/box.tsx +219 -0
- package/src/core/primitives/button/__workshop__/custom.tsx +27 -0
- package/src/core/primitives/button/__workshop__/customIcons.tsx +30 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +54 -0
- package/src/core/primitives/button/__workshop__/index.ts +64 -0
- package/src/core/primitives/button/__workshop__/props.tsx +55 -0
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +36 -0
- package/src/core/primitives/button/__workshop__/stacked.tsx +58 -0
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +13 -0
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +29 -0
- package/src/core/primitives/button/button.test.tsx +29 -0
- package/src/core/primitives/button/button.tsx +196 -0
- package/src/core/primitives/button/types.ts +22 -0
- package/src/core/primitives/card/__workshop__/asButton.tsx +107 -0
- package/src/core/primitives/card/__workshop__/asComponent.tsx +27 -0
- package/src/core/primitives/card/__workshop__/checkered.tsx +26 -0
- package/src/core/primitives/card/__workshop__/index.ts +18 -0
- package/src/core/primitives/card/__workshop__/interactive.tsx +29 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +78 -0
- package/src/core/primitives/card/__workshop__/props.tsx +52 -0
- package/src/core/primitives/card/__workshop__/selected.tsx +62 -0
- package/src/core/primitives/card/__workshop__/tones.tsx +27 -0
- package/src/core/primitives/card/card.tsx +106 -0
- package/src/core/primitives/card/cardContext.ts +10 -0
- package/src/core/primitives/card/cardProvider.tsx +27 -0
- package/src/core/primitives/card/types.ts +31 -0
- package/src/core/primitives/card/useCard.ts +9 -0
- package/src/core/primitives/checkbox/__workshop__/props.tsx +35 -0
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +27 -0
- package/src/core/primitives/checkbox/checkbox.tsx +80 -0
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +23 -0
- package/src/core/primitives/code/__workshop__/props.tsx +18 -0
- package/src/core/primitives/code/code.tsx +46 -0
- package/src/core/primitives/code/refractor.tsx +18 -0
- package/src/core/primitives/container/__workshop__/example.tsx +20 -0
- package/src/core/primitives/container/container.tsx +37 -0
- package/src/core/primitives/flex/__workshop__/example.tsx +34 -0
- package/src/core/primitives/flex/flex.tsx +56 -0
- package/src/core/primitives/flex/types.ts +27 -0
- package/src/core/primitives/grid/grid.tsx +33 -0
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +54 -0
- package/src/core/primitives/heading/__workshop__/plain.tsx +29 -0
- package/src/core/primitives/heading/heading.tsx +80 -0
- package/src/core/primitives/inline/__workshop__/plain.tsx +24 -0
- package/src/core/primitives/inline/inline.tsx +69 -0
- package/src/core/primitives/kbd/kbd.tsx +55 -0
- package/src/core/primitives/label/__workshop__/plain.tsx +28 -0
- package/src/core/primitives/label/label.tsx +77 -0
- package/src/core/primitives/layer/__workshop__/index.ts +24 -0
- package/src/core/primitives/layer/__workshop__/multipleRoots.tsx +49 -0
- package/src/core/primitives/layer/__workshop__/nested.tsx +98 -0
- package/src/core/primitives/layer/__workshop__/responsiveZOffset.tsx +17 -0
- package/src/core/primitives/layer/getLayerContext.test.ts +32 -0
- package/src/core/primitives/layer/getLayerContext.ts +21 -0
- package/src/core/primitives/layer/layer.test.tsx +108 -0
- package/src/core/primitives/layer/layer.tsx +42 -0
- package/src/core/primitives/layer/layerCard.tsx +90 -0
- package/src/core/primitives/layer/layerContext.ts +7 -0
- package/src/core/primitives/layer/layerProvider.tsx +114 -0
- package/src/core/primitives/layer/useLayer.ts +24 -0
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +77 -0
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +32 -0
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +71 -0
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +69 -0
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +96 -0
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +100 -0
- package/src/core/primitives/popover/constants.ts +22 -0
- package/src/core/primitives/popover/floating-ui/size.ts +83 -0
- package/src/core/primitives/popover/helpers.ts +32 -0
- package/src/core/primitives/popover/popover.tsx +453 -0
- package/src/core/primitives/popover/popoverLayer.tsx +149 -0
- package/src/core/primitives/popover/types.ts +12 -0
- package/src/core/primitives/radio/__workshop__/example.tsx +63 -0
- package/src/core/primitives/radio/__workshop__/plain.tsx +28 -0
- package/src/core/primitives/radio/radio.tsx +64 -0
- package/src/core/primitives/root/Root.tsx +84 -0
- package/src/core/primitives/root/RootProvider.tsx +40 -0
- package/src/core/primitives/root/__workshop__/boundary.tsx +5 -0
- package/src/core/primitives/root/__workshop__/index.ts +8 -0
- package/src/core/primitives/select/__workshop__/plain.tsx +39 -0
- package/src/core/primitives/select/__workshop__/readOnly.tsx +23 -0
- package/src/core/primitives/select/select.tsx +85 -0
- package/src/core/primitives/selectable/selectable.tsx +50 -0
- package/src/core/primitives/selectable/types.ts +7 -0
- package/src/core/primitives/skeleton/__workshop__/delay.tsx +70 -0
- package/src/core/primitives/skeleton/__workshop__/index.ts +11 -0
- package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +64 -0
- package/src/core/primitives/skeleton/codeSkeleton.tsx +49 -0
- package/src/core/primitives/skeleton/headingSkeleton.tsx +48 -0
- package/src/core/primitives/skeleton/labelSkeleton.tsx +47 -0
- package/src/core/primitives/skeleton/skeleton.tsx +71 -0
- package/src/core/primitives/skeleton/textSkeleton.tsx +49 -0
- package/src/core/primitives/spinner/__workshop__/Props.tsx +15 -0
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +14 -0
- package/src/core/primitives/spinner/spinner.tsx +45 -0
- package/src/core/primitives/srOnly/srOnly.tsx +33 -0
- package/src/core/primitives/stack/__workshop__/plain.tsx +32 -0
- package/src/core/primitives/stack/stack.tsx +65 -0
- package/src/core/primitives/switch/switch.tsx +84 -0
- package/src/core/primitives/text/__workshop__/colored.tsx +23 -0
- package/src/core/primitives/text/__workshop__/example.tsx +28 -0
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +23 -0
- package/src/core/primitives/text/text.tsx +74 -0
- package/src/core/primitives/textArea/__workshop__/plain.tsx +61 -0
- package/src/core/primitives/textArea/textArea.tsx +96 -0
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +17 -0
- package/src/core/primitives/textInput/__workshop__/plain.tsx +110 -0
- package/src/core/primitives/textInput/__workshop__/states.tsx +53 -0
- package/src/core/primitives/textInput/__workshop__/tones.tsx +277 -0
- package/src/core/primitives/textInput/__workshop__/typed.tsx +23 -0
- package/src/core/primitives/textInput/textInput.tsx +261 -0
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +102 -0
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +74 -0
- package/src/core/primitives/tooltip/__workshop__/props.tsx +112 -0
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +86 -0
- package/src/core/primitives/tooltip/constants.ts +23 -0
- package/src/core/primitives/tooltip/tooltip.test.tsx +454 -0
- package/src/core/primitives/tooltip/tooltip.tsx +489 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +11 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +53 -0
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +13 -0
- package/src/core/primitives/tooltip/tooltipLayer.tsx +106 -0
- package/src/core/primitives/types.ts +153 -0
- package/src/core/types/props.ts +28 -0
- package/src/core/types/radius.ts +7 -0
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +100 -0
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +7 -0
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +18 -0
- package/src/core/utils/boundaryElement/types.ts +5 -0
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +24 -0
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +41 -0
- package/src/core/utils/elementQuery/elementQuery.tsx +75 -0
- package/src/core/utils/errorBoundary.tsx +50 -0
- package/src/core/utils/getElementRef.ts +27 -0
- package/src/core/utils/portal/__workshop__/named.tsx +63 -0
- package/src/core/utils/portal/portal.test.tsx +103 -0
- package/src/core/utils/portal/portal.tsx +40 -0
- package/src/core/utils/portal/portalContext.ts +31 -0
- package/src/core/utils/portal/portalProvider.tsx +73 -0
- package/src/core/utils/portal/types.ts +7 -0
- package/src/core/utils/portal/usePortal.ts +23 -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 +106 -0
- package/src/css/components/dialog/dialog.ts +42 -14
- 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 +16 -9
- package/src/css/components/skeleton/types.ts +16 -6
- package/src/css/components/toast/toast.css.ts +17 -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 -1
- package/src/css/defaultTheme.css.ts +521 -0
- package/src/css/index.ts +141 -39
- 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 +16 -4
- package/src/css/primitives/_input/_input.css.ts +261 -0
- package/src/css/primitives/_input/input.ts +16 -12
- package/src/css/primitives/_input/types.ts +4 -3
- package/src/css/primitives/_selectable/_selectable.css.ts +131 -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 +198 -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 +27 -0
- package/src/css/primitives/badge/badge.ts +4 -4
- package/src/css/primitives/badge/types.ts +4 -5
- package/src/css/primitives/box/box.css.ts +19 -0
- package/src/css/primitives/box/box.ts +63 -31
- package/src/css/primitives/box/types.ts +56 -30
- package/src/css/primitives/button/button.css.ts +289 -0
- package/src/css/primitives/button/button.ts +19 -34
- package/src/css/primitives/button/types.ts +12 -0
- package/src/css/primitives/card/__workshop__/color.tsx +75 -0
- package/src/css/primitives/card/__workshop__/index.ts +14 -0
- package/src/css/primitives/card/card.css.ts +370 -0
- package/src/css/primitives/card/card.ts +9 -10
- 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 +15 -5
- package/src/css/primitives/code/types.ts +5 -3
- package/src/css/primitives/container/container.css.ts +4 -0
- package/src/css/primitives/container/container.ts +14 -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 +16 -11
- package/src/css/primitives/heading/types.ts +8 -3
- 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 +86 -0
- package/src/css/primitives/label/label.ts +16 -10
- package/src/css/primitives/label/types.ts +15 -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/root/root.css.ts +15 -0
- package/src/css/primitives/root/root.ts +17 -0
- package/src/css/primitives/root/types.ts +10 -0
- package/src/css/primitives/select/select.css.ts +24 -0
- package/src/css/primitives/select/select.ts +8 -6
- package/src/css/primitives/select/types.ts +1 -1
- 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/srOnly/srOnly.css.ts +10 -0
- package/src/css/primitives/srOnly/srOnly.ts +7 -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 +18 -11
- package/src/css/primitives/text/types.ts +12 -3
- package/src/css/primitives/textArea/textArea.css.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +6 -5
- 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 +21 -5
- package/src/css/primitives/textInput/types.ts +3 -7
- package/src/css/primitives/tooltip/tooltip.css.ts +4 -0
- package/src/css/primitives/tooltip/tooltip.ts +6 -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/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/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/props/display/types.ts +16 -0
- 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/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/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/props/gap/types.ts +10 -0
- package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
- package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -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/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/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/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/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/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/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/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/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/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/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/types.ts +15 -0
- package/src/css/props/inset/inset.css.ts +37 -0
- package/src/css/props/inset/inset.ts +21 -0
- package/src/css/props/inset/types.ts +13 -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/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/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/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/props/position/types.ts +9 -0
- 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/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 +19 -0
- package/src/css/props/textOverflow/textOverflow.ts +8 -0
- package/src/css/props/textOverflow/types.ts +12 -0
- package/src/css/props/width/types.ts +11 -0
- package/src/css/props/width/width.css.ts +31 -0
- package/src/css/props/width/width.ts +8 -0
- package/src/css/types.ts +221 -810
- package/src/css/util.ts +3 -8
- 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/v2/build/_deprecated/color/_selectable/createSelectableTones.ts +76 -0
- package/src/theme/v2/build/_deprecated/color/_solid/createSolidTones.ts +54 -0
- package/src/theme/v2/build/_deprecated/color/button/createButtonModes.ts +22 -0
- package/src/theme/v2/build/_deprecated/color/button/createButtonTones.ts +55 -0
- package/src/theme/v2/build/_deprecated/color/card/createCardStates.ts +60 -0
- package/src/theme/v2/build/_deprecated/color/color.test.ts +63 -0
- package/src/theme/v2/build/_deprecated/color/defaults.ts +390 -0
- package/src/theme/v2/build/_deprecated/color/factory.ts +141 -0
- package/src/theme/v2/build/_deprecated/color/input/createInputModes.ts +86 -0
- package/src/theme/v2/build/_deprecated/color/muted/createMuted.ts +54 -0
- package/src/theme/v2/build/_deprecated/color/spot/createSpot.ts +20 -0
- package/src/theme/v2/build/buildColorTheme.test.ts +185 -0
- package/src/theme/v2/build/buildColorTheme.ts +494 -0
- package/src/theme/v2/build/buildTheme.test.ts +89 -0
- package/src/theme/v2/build/buildTheme.ts +37 -0
- package/src/theme/v2/build/colorToken/colorToken.ts +19 -0
- package/src/theme/v2/build/colorToken/compileColorToken.ts +21 -0
- package/src/theme/v2/build/colorToken/types.ts +6 -0
- package/src/theme/v2/build/lib/color-fns/blend/mix.ts +21 -0
- package/src/theme/v2/build/lib/color-fns/blend/multiply.ts +18 -0
- package/src/theme/v2/build/lib/color-fns/blend/screen.ts +18 -0
- package/src/theme/v2/build/lib/color-fns/color-fns.test.ts +68 -0
- package/src/theme/v2/build/lib/color-fns/contrastRatio.ts +34 -0
- package/src/theme/v2/build/lib/color-fns/convert.ts +150 -0
- package/src/theme/v2/build/lib/color-fns/parse.ts +60 -0
- package/src/theme/v2/build/mixThemeColor.test.ts +23 -0
- package/src/theme/v2/build/mixThemeColor.ts +53 -0
- package/src/theme/v2/build/renderColorTheme.ts +532 -0
- package/src/theme/v2/build/renderColorValue.ts +85 -0
- package/src/theme/v2/build/resolveColorTokens.ts +268 -0
- 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/v2/config/helpers.ts +48 -0
- package/src/theme/v2/config/system.ts +114 -0
- package/src/theme/v2/config/tokens/color/types.ts +137 -0
- package/src/theme/v2/config/tokens/index.ts +3 -0
- package/src/theme/v2/config/tokens/parseTokenValue.test.ts +44 -0
- package/src/theme/v2/config/tokens/parseTokenValue.ts +133 -0
- package/src/theme/v2/config/tokens/types.ts +53 -0
- package/src/theme/v2/config/types.ts +47 -0
- package/src/theme/v2/defaults/colorPalette.ts +5 -0
- package/src/theme/v2/defaults/colorTokens.ts +648 -0
- package/src/theme/v2/defaults/config.ts +84 -0
- package/src/theme/v2/defaults/fonts.ts +227 -0
- 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/v3/_constants.ts +29 -0
- package/src/theme/v3/_parseColorToken.ts +180 -0
- 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/v3/palette/constants.ts +15 -0
- package/src/theme/v3/palette/types.ts +7 -0
- package/src/theme/v3/resolveTokens.ts +70 -65
- package/src/theme/v3/tokens.ts +2 -2
- package/src/theme/v3/types.ts +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/bin/ui.js +0 -5
- package/dist/_chunks-cjs/_visual-editing.js +0 -3100
- 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 +0 -27
- 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 -3107
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs +0 -26
- 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 -808
- 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 -2197
- package/dist/css.d.ts +0 -2197
- package/dist/css.js +0 -4769
- package/dist/css.js.map +0 -1
- package/dist/css.mjs +0 -4770
- package/dist/css.mjs.map +0 -1
- package/dist/index.d.mts +0 -2869
- package/dist/index.mjs +0 -1545
- 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 -22813
- package/dist/theme.d.mts +0 -1883
- package/dist/theme.mjs +0 -2989
- package/dist/theme.mjs.map +0 -1
- package/src/cli/buildCommand.ts +0 -48
- package/src/cli/index.ts +0 -38
- package/src/css/_comp.test.ts +0 -7
- package/src/css/_comp.ts +0 -10
- package/src/css/_mergeStyles.ts +0 -31
- package/src/css/_resp.ts +0 -38
- package/src/css/_responsiveRule.ts +0 -38
- package/src/css/aspects/border/border.style.ts +0 -13
- package/src/css/aspects/border/border.ts +0 -14
- package/src/css/aspects/border/index.ts +0 -2
- package/src/css/aspects/border/types.ts +0 -10
- package/src/css/aspects/display/display.style.ts +0 -34
- package/src/css/aspects/display/display.ts +0 -7
- package/src/css/aspects/display/index.ts +0 -2
- package/src/css/aspects/display/types.ts +0 -17
- package/src/css/aspects/flex/flex.style.ts +0 -30
- package/src/css/aspects/flex/flex.ts +0 -13
- package/src/css/aspects/flex/flexAlign.style.ts +0 -12
- package/src/css/aspects/flex/flexDirection.style.ts +0 -11
- package/src/css/aspects/flex/flexJustify.style.ts +0 -13
- package/src/css/aspects/flex/flexWrap.style.ts +0 -10
- package/src/css/aspects/flex/index.ts +0 -2
- package/src/css/aspects/flex/types.ts +0 -35
- package/src/css/aspects/flexItem/flex.style.ts +0 -22
- package/src/css/aspects/flexItem/flexItem.ts +0 -8
- package/src/css/aspects/flexItem/index.ts +0 -2
- package/src/css/aspects/flexItem/types.ts +0 -27
- package/src/css/aspects/font/font.style.ts +0 -151
- package/src/css/aspects/font/font.ts +0 -12
- package/src/css/aspects/font/index.ts +0 -2
- package/src/css/aspects/font/types.ts +0 -12
- package/src/css/aspects/gap/gap.style.ts +0 -21
- package/src/css/aspects/gap/gap.ts +0 -8
- package/src/css/aspects/gap/index.ts +0 -2
- package/src/css/aspects/gap/types.ts +0 -10
- package/src/css/aspects/grid/grid.ts +0 -13
- package/src/css/aspects/grid/gridAutoColumns.style.ts +0 -11
- package/src/css/aspects/grid/gridAutoFlow.style.ts +0 -11
- package/src/css/aspects/grid/gridAutoRows.style.ts +0 -11
- package/src/css/aspects/grid/gridColumns.style.ts +0 -18
- package/src/css/aspects/grid/gridRows.style.ts +0 -18
- package/src/css/aspects/grid/index.ts +0 -2
- package/src/css/aspects/grid/types.ts +0 -29
- package/src/css/aspects/gridItem/gridColumn.style.ts +0 -20
- package/src/css/aspects/gridItem/gridColumnEnd.style.ts +0 -20
- package/src/css/aspects/gridItem/gridColumnStart.style.ts +0 -20
- package/src/css/aspects/gridItem/gridItem.ts +0 -15
- package/src/css/aspects/gridItem/gridRow.style.ts +0 -20
- package/src/css/aspects/gridItem/gridRowEnd.style.ts +0 -20
- package/src/css/aspects/gridItem/gridRowStart.style.ts +0 -20
- package/src/css/aspects/gridItem/index.ts +0 -2
- package/src/css/aspects/gridItem/types.ts +0 -41
- package/src/css/aspects/height/height.style.ts +0 -9
- package/src/css/aspects/height/height.ts +0 -17
- package/src/css/aspects/height/index.ts +0 -1
- package/src/css/aspects/height/rules.ts +0 -7
- package/src/css/aspects/index.ts +0 -20
- package/src/css/aspects/inset/index.ts +0 -2
- package/src/css/aspects/inset/inset.style.ts +0 -12
- package/src/css/aspects/inset/inset.ts +0 -13
- package/src/css/aspects/inset/types.ts +0 -13
- package/src/css/aspects/margin/index.ts +0 -2
- package/src/css/aspects/margin/margin.style.ts +0 -46
- package/src/css/aspects/margin/margin.ts +0 -15
- package/src/css/aspects/margin/types.ts +0 -11
- package/src/css/aspects/maxWidth/index.ts +0 -2
- package/src/css/aspects/maxWidth/maxWidth.style.ts +0 -16
- package/src/css/aspects/maxWidth/maxWidth.ts +0 -6
- package/src/css/aspects/maxWidth/types.ts +0 -7
- package/src/css/aspects/outline/outline.style.ts +0 -9
- package/src/css/aspects/overflow/index.ts +0 -2
- package/src/css/aspects/overflow/overflow.style.ts +0 -11
- package/src/css/aspects/overflow/overflow.ts +0 -11
- package/src/css/aspects/overflow/types.ts +0 -11
- package/src/css/aspects/padding/index.ts +0 -2
- package/src/css/aspects/padding/padding.style.ts +0 -46
- package/src/css/aspects/padding/padding.ts +0 -15
- package/src/css/aspects/padding/types.ts +0 -14
- package/src/css/aspects/pointerEvents/index.ts +0 -2
- package/src/css/aspects/pointerEvents/pointerEvents.style.ts +0 -13
- package/src/css/aspects/pointerEvents/pointerEvents.ts +0 -6
- package/src/css/aspects/position/index.ts +0 -2
- package/src/css/aspects/position/position.style.ts +0 -12
- package/src/css/aspects/position/position.ts +0 -7
- package/src/css/aspects/position/types.ts +0 -9
- package/src/css/aspects/radius/index.ts +0 -2
- package/src/css/aspects/radius/radius.style.ts +0 -16
- package/src/css/aspects/radius/radius.ts +0 -8
- package/src/css/aspects/radius/types.ts +0 -8
- package/src/css/aspects/shadow/index.ts +0 -2
- package/src/css/aspects/shadow/shadow.style.ts +0 -49
- package/src/css/aspects/shadow/shadow.ts +0 -7
- package/src/css/aspects/shadow/types.ts +0 -8
- package/src/css/aspects/textOverflow/index.ts +0 -2
- package/src/css/aspects/textOverflow/textOverflow.style.ts +0 -21
- package/src/css/aspects/textOverflow/textOverflow.ts +0 -6
- package/src/css/aspects/textOverflow/types.ts +0 -8
- package/src/css/aspects/width/index.ts +0 -2
- package/src/css/aspects/width/rules.ts +0 -8
- package/src/css/aspects/width/types.ts +0 -9
- package/src/css/aspects/width/width.style.ts +0 -11
- package/src/css/aspects/width/width.ts +0 -6
- package/src/css/compile/compilePalette.ts +0 -60
- package/src/css/compile/compileRule.ts +0 -96
- package/src/css/compile/compileRules.test.ts +0 -36
- package/src/css/compile/compileRules.ts +0 -43
- package/src/css/compile/compileStyle.ts +0 -148
- package/src/css/compile/compileSystem.ts +0 -10
- 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/breadcrumbs.style.ts +0 -9
- package/src/css/components/breadcrumbs/index.ts +0 -1
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/dialog.style.ts +0 -79
- package/src/css/components/dialog/index.ts +0 -1
- package/src/css/components/dialog/rules.ts +0 -78
- package/src/css/components/menu/index.ts +0 -1
- package/src/css/components/menu/menu.style.ts +0 -17
- package/src/css/components/menu/rules.ts +0 -15
- package/src/css/components/skeleton/index.ts +0 -2
- package/src/css/components/skeleton/rules.ts +0 -113
- package/src/css/components/skeleton/skeleton.style.ts +0 -96
- package/src/css/components/toast/index.ts +0 -1
- package/src/css/components/toast/rules.ts +0 -18
- package/src/css/components/toast/toast.style.ts +0 -20
- package/src/css/components/tree/index.ts +0 -1
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/components/tree/tree.style.ts +0 -55
- package/src/css/composeClassNames.ts +0 -17
- package/src/css/primitives/_arrow/_arrow.style.ts +0 -73
- package/src/css/primitives/_arrow/index.ts +0 -1
- package/src/css/primitives/_input/__workshop__/customInput.tsx +0 -16
- package/src/css/primitives/_input/__workshop__/index.ts +0 -14
- package/src/css/primitives/_input/_input.style.ts +0 -162
- package/src/css/primitives/_input/index.ts +0 -2
- package/src/css/primitives/_selectable/__style.ts +0 -117
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/_selectable/_selectable.style.ts +0 -132
- package/src/css/primitives/_selectable/index.ts +0 -2
- package/src/css/primitives/avatar/avatar.style.ts +0 -175
- package/src/css/primitives/avatar/index.ts +0 -2
- package/src/css/primitives/avatar/rules.ts +0 -176
- package/src/css/primitives/badge/badge.style.ts +0 -22
- package/src/css/primitives/badge/index.ts +0 -2
- package/src/css/primitives/box/box.style.ts +0 -31
- package/src/css/primitives/box/index.ts +0 -2
- package/src/css/primitives/button/_constants.ts +0 -17
- package/src/css/primitives/button/button.style.ts +0 -182
- package/src/css/primitives/button/index.ts +0 -1
- package/src/css/primitives/button/rules.ts +0 -302
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/css/primitives/card/card.style.ts +0 -198
- package/src/css/primitives/card/index.ts +0 -2
- package/src/css/primitives/card/rules.ts +0 -473
- package/src/css/primitives/checkbox/__styles.ts +0 -129
- package/src/css/primitives/checkbox/checkbox.style.ts +0 -154
- package/src/css/primitives/checkbox/index.ts +0 -1
- package/src/css/primitives/checkbox/rules.ts +0 -152
- package/src/css/primitives/code/code.style.ts +0 -62
- package/src/css/primitives/code/index.ts +0 -2
- package/src/css/primitives/code/rules.ts +0 -96
- package/src/css/primitives/container/container.style.ts +0 -10
- package/src/css/primitives/container/index.ts +0 -2
- package/src/css/primitives/container/rules.ts +0 -8
- package/src/css/primitives/heading/heading.style.ts +0 -47
- package/src/css/primitives/heading/index.ts +0 -2
- package/src/css/primitives/heading/rules.ts +0 -155
- package/src/css/primitives/kbd/index.ts +0 -2
- package/src/css/primitives/kbd/kbd.style.ts +0 -22
- package/src/css/primitives/kbd/rules.ts +0 -20
- package/src/css/primitives/label/index.ts +0 -2
- package/src/css/primitives/label/label.style.ts +0 -48
- package/src/css/primitives/label/rules.ts +0 -137
- package/src/css/primitives/popover/index.ts +0 -1
- package/src/css/primitives/popover/popover.style.ts +0 -5
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/radio/index.ts +0 -1
- package/src/css/primitives/radio/radio.style.ts +0 -123
- package/src/css/primitives/radio/rules.ts +0 -121
- package/src/css/primitives/select/index.ts +0 -2
- package/src/css/primitives/select/rules.ts +0 -22
- package/src/css/primitives/select/select.style.ts +0 -24
- package/src/css/primitives/spinner/index.ts +0 -1
- package/src/css/primitives/spinner/rules.ts +0 -21
- package/src/css/primitives/spinner/spinner.style.ts +0 -22
- package/src/css/primitives/switch/index.ts +0 -1
- package/src/css/primitives/switch/rules.ts +0 -340
- package/src/css/primitives/switch/switch.style.ts +0 -169
- package/src/css/primitives/text/index.ts +0 -2
- package/src/css/primitives/text/rules.ts +0 -164
- package/src/css/primitives/text/text.style.ts +0 -56
- package/src/css/primitives/textArea/index.ts +0 -2
- package/src/css/primitives/textArea/rules.ts +0 -7
- package/src/css/primitives/textArea/textArea.style.ts +0 -9
- package/src/css/primitives/textInput/index.ts +0 -2
- package/src/css/primitives/textInput/rules.ts +0 -224
- package/src/css/primitives/textInput/textInput.style.ts +0 -167
- package/src/css/primitives/token/rules.ts +0 -45
- package/src/css/primitives/token/token.style.ts +0 -49
- package/src/css/primitives/tooltip/index.ts +0 -1
- package/src/css/primitives/tooltip/rules.ts +0 -19
- package/src/css/primitives/tooltip/tooltip.style.ts +0 -21
- package/src/css/responsiveRules.ts +0 -25
- package/src/css/scopeClassName.ts +0 -6
- package/src/css/system.style.ts +0 -154
- package/src/css/utils/srOnly/index.ts +0 -1
- package/src/css/utils/srOnly/srOnly.style.ts +0 -14
- package/src/css/utils/srOnly/srOnly.ts +0 -5
- package/src/css/varNames.ts +0 -486
- package/src/css/vars.ts +0 -456
- package/src/theme/_constants.ts +0 -26
- package/src/theme/_types.ts +0 -41
- package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
- package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
- package/src/theme/build/_deprecated/color/button/createButtonModes.ts +0 -17
- package/src/theme/build/_deprecated/color/button/createButtonTones.ts +0 -55
- package/src/theme/build/_deprecated/color/card/createCardStates.ts +0 -60
- package/src/theme/build/_deprecated/color/color.test.ts +0 -63
- package/src/theme/build/_deprecated/color/defaults.ts +0 -390
- package/src/theme/build/_deprecated/color/factory.ts +0 -141
- package/src/theme/build/_deprecated/color/input/createInputModes.ts +0 -81
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +0 -54
- package/src/theme/build/_deprecated/color/spot/createSpot.ts +0 -20
- package/src/theme/build/buildColorTheme.test.ts +0 -183
- package/src/theme/build/buildColorTheme.ts +0 -494
- package/src/theme/build/buildTheme.test.ts +0 -87
- package/src/theme/build/buildTheme.ts +0 -12
- package/src/theme/build/colorToken/colorToken.ts +0 -19
- package/src/theme/build/colorToken/compileColorToken.ts +0 -21
- package/src/theme/build/colorToken/types.ts +0 -6
- package/src/theme/build/lib/color-fns/blend/mix.ts +0 -21
- package/src/theme/build/lib/color-fns/blend/multiply.ts +0 -18
- package/src/theme/build/lib/color-fns/blend/screen.ts +0 -18
- package/src/theme/build/lib/color-fns/color-fns.test.ts +0 -68
- package/src/theme/build/lib/color-fns/contrastRatio.ts +0 -31
- package/src/theme/build/lib/color-fns/convert.ts +0 -150
- package/src/theme/build/lib/color-fns/parse.ts +0 -60
- package/src/theme/build/mixThemeColor.test.ts +0 -21
- package/src/theme/build/mixThemeColor.ts +0 -53
- package/src/theme/build/renderColorTheme.ts +0 -532
- package/src/theme/build/renderColorValue.ts +0 -85
- package/src/theme/build/resolveColorTokens.ts +0 -268
- package/src/theme/build/theme.test.ts +0 -27
- package/src/theme/config/helpers.ts +0 -55
- package/src/theme/config/system.ts +0 -115
- package/src/theme/config/tokens/color/types.ts +0 -133
- package/src/theme/config/tokens/index.ts +0 -4
- package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
- package/src/theme/config/tokens/parseTokenKey.ts +0 -67
- package/src/theme/config/tokens/parseTokenValue.test.ts +0 -42
- package/src/theme/config/tokens/parseTokenValue.ts +0 -133
- package/src/theme/config/tokens/types.ts +0 -53
- package/src/theme/config/types.ts +0 -45
- package/src/theme/defaults/colorPalette.ts +0 -5
- package/src/theme/defaults/colorTokens.ts +0 -648
- package/src/theme/defaults/config.ts +0 -84
- package/src/theme/defaults/fonts.ts +0 -228
- package/src/theme/palette/constants.ts +0 -15
- 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/parseColor.ts +0 -167
- 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/ui/StyleTags.tsx +0 -24
- package/src/ui/_compat/index.ts +0 -9
- package/src/ui/_compat/styles/_responsive.ts +0 -19
- package/src/ui/_compat/styles/index.ts +0 -1
- package/src/ui/_compat/theme/index.ts +0 -5
- package/src/ui/_compat/theme/theme.test.tsx +0 -73
- package/src/ui/_compat/theme/themeColorProvider.tsx +0 -30
- package/src/ui/_compat/theme/themeContext.ts +0 -10
- package/src/ui/_compat/theme/themeProvider.tsx +0 -74
- package/src/ui/_compat/theme/types.ts +0 -12
- package/src/ui/_compat/theme/useRootTheme.ts +0 -17
- package/src/ui/_compat/theme/useTheme.ts +0 -16
- package/src/ui/_compat/types.ts +0 -274
- package/src/ui/components/autocomplete/__workshop__/async.tsx +0 -157
- package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -131
- package/src/ui/components/autocomplete/__workshop__/custom.tsx +0 -90
- package/src/ui/components/autocomplete/__workshop__/example.tsx +0 -80
- package/src/ui/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/ui/components/autocomplete/__workshop__/fullscreen.tsx +0 -293
- package/src/ui/components/autocomplete/__workshop__/index.ts +0 -39
- package/src/ui/components/autocomplete/autocomplete.tsx +0 -731
- package/src/ui/components/autocomplete/autocompleteOption.tsx +0 -45
- package/src/ui/components/autocomplete/autocompleteReducer.ts +0 -47
- package/src/ui/components/autocomplete/constants.ts +0 -28
- package/src/ui/components/autocomplete/index.ts +0 -2
- package/src/ui/components/autocomplete/types.ts +0 -108
- package/src/ui/components/breadcrumbs/__workshop__/example.tsx +0 -62
- package/src/ui/components/breadcrumbs/breadcrumbs.tsx +0 -127
- package/src/ui/components/breadcrumbs/index.ts +0 -1
- package/src/ui/components/dialog/__workshop__/activate.tsx +0 -134
- package/src/ui/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/ui/components/dialog/__workshop__/onScroll.tsx +0 -39
- package/src/ui/components/dialog/__workshop__/panes.tsx +0 -82
- package/src/ui/components/dialog/__workshop__/position.tsx +0 -30
- package/src/ui/components/dialog/__workshop__/props.tsx +0 -77
- package/src/ui/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/ui/components/dialog/dialog.tsx +0 -433
- package/src/ui/components/dialog/dialogContext.ts +0 -20
- package/src/ui/components/dialog/dialogProvider.tsx +0 -35
- package/src/ui/components/dialog/index.ts +0 -4
- package/src/ui/components/dialog/useDialog.ts +0 -11
- package/src/ui/components/hotkeys/hotkeys.tsx +0 -54
- package/src/ui/components/hotkeys/index.ts +0 -1
- package/src/ui/components/index.ts +0 -9
- package/src/ui/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/ui/components/menu/__workshop__/avatarMenu.tsx +0 -51
- package/src/ui/components/menu/__workshop__/closableMenuButton.tsx +0 -46
- package/src/ui/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
- package/src/ui/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/ui/components/menu/__workshop__/customSelectedState.tsx +0 -39
- package/src/ui/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/ui/components/menu/__workshop__/groups.tsx +0 -156
- package/src/ui/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/ui/components/menu/__workshop__/menuGroupRight.tsx +0 -65
- package/src/ui/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/ui/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
- package/src/ui/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/ui/components/menu/__workshop__/shouldFocus.tsx +0 -47
- package/src/ui/components/menu/__workshop__/tones.tsx +0 -25
- package/src/ui/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/ui/components/menu/helpers.ts +0 -82
- package/src/ui/components/menu/index.ts +0 -5
- package/src/ui/components/menu/menu.test.tsx +0 -128
- package/src/ui/components/menu/menu.tsx +0 -200
- package/src/ui/components/menu/menuButton.tsx +0 -275
- package/src/ui/components/menu/menuContext.ts +0 -31
- package/src/ui/components/menu/menuDivider.tsx +0 -22
- package/src/ui/components/menu/menuGroup.tsx +0 -228
- package/src/ui/components/menu/menuItem.tsx +0 -180
- package/src/ui/components/menu/useMenu.ts +0 -21
- package/src/ui/components/menu/useMenuController.ts +0 -241
- package/src/ui/components/skeleton/__workshop__/delay.tsx +0 -70
- package/src/ui/components/skeleton/__workshop__/index.ts +0 -11
- package/src/ui/components/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/ui/components/skeleton/index.ts +0 -2
- package/src/ui/components/skeleton/skeleton.tsx +0 -53
- package/src/ui/components/skeleton/textSkeleton.tsx +0 -132
- package/src/ui/components/tab/__workshop__/example.tsx +0 -79
- package/src/ui/components/tab/index.ts +0 -3
- package/src/ui/components/tab/tab.tsx +0 -105
- package/src/ui/components/tab/tabList.tsx +0 -74
- package/src/ui/components/tab/tabPanel.tsx +0 -40
- package/src/ui/components/toast/__workshop__/hook.tsx +0 -71
- package/src/ui/components/toast/__workshop__/toast.tsx +0 -26
- package/src/ui/components/toast/index.ts +0 -4
- package/src/ui/components/toast/toast.test.tsx +0 -101
- package/src/ui/components/toast/toast.tsx +0 -211
- package/src/ui/components/toast/toastContext.ts +0 -7
- package/src/ui/components/toast/toastLayer.tsx +0 -38
- package/src/ui/components/toast/toastProvider.tsx +0 -113
- package/src/ui/components/toast/types.ts +0 -28
- package/src/ui/components/toast/useToast.ts +0 -25
- package/src/ui/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/ui/components/tree/__workshop__/basic.tsx +0 -105
- package/src/ui/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/ui/components/tree/helpers.ts +0 -105
- package/src/ui/components/tree/index.ts +0 -4
- package/src/ui/components/tree/tree.tsx +0 -244
- package/src/ui/components/tree/treeContext.ts +0 -10
- package/src/ui/components/tree/treeGroup.tsx +0 -30
- package/src/ui/components/tree/treeItem.tsx +0 -220
- package/src/ui/components/tree/types.ts +0 -25
- package/src/ui/components/tree/useTree.ts +0 -17
- package/src/ui/constants.ts +0 -79
- package/src/ui/helpers/focus.ts +0 -100
- package/src/ui/helpers/index.ts +0 -5
- package/src/ui/helpers/props.ts +0 -10
- package/src/ui/hooks/index.ts +0 -12
- package/src/ui/hooks/useArrayProp.ts +0 -29
- package/src/ui/hooks/useClickOutside.test.tsx +0 -482
- package/src/ui/hooks/useClickOutside.ts +0 -117
- package/src/ui/hooks/useClickOutsideEvent.test.tsx +0 -115
- package/src/ui/hooks/useClickOutsideEvent.ts +0 -73
- package/src/ui/hooks/useDelayed.test.ts +0 -68
- package/src/ui/hooks/useDelayedState.ts +0 -28
- package/src/ui/hooks/useElementRect/__workshop__/example.tsx +0 -32
- package/src/ui/hooks/useElementRect/index.ts +0 -1
- package/src/ui/hooks/useElementSize.ts +0 -19
- package/src/ui/hooks/useForwardedRef.ts +0 -19
- package/src/ui/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/ui/hooks/useMediaIndex/index.ts +0 -1
- package/src/ui/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -36
- package/src/ui/hooks/useMediaIndex/useMediaIndex.ts +0 -104
- package/src/ui/hooks/usePrefersDark.hydration.test.tsx +0 -56
- package/src/ui/hooks/usePrefersDark.test.tsx +0 -19
- package/src/ui/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
- package/src/ui/hooks/usePrefersReducedMotion.test.tsx +0 -19
- package/src/ui/index.ts +0 -9
- package/src/ui/middleware/origin.ts +0 -47
- package/src/ui/observers/elementSizeObserver.ts +0 -116
- package/src/ui/observers/index.ts +0 -2
- package/src/ui/primitives/_selectable/index.ts +0 -1
- package/src/ui/primitives/_selectable/selectable.tsx +0 -31
- package/src/ui/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/ui/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/ui/primitives/avatar/__workshop__/withinButton.tsx +0 -63
- package/src/ui/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -72
- package/src/ui/primitives/avatar/avatar.tsx +0 -158
- package/src/ui/primitives/avatar/avatarCounter.tsx +0 -62
- package/src/ui/primitives/avatar/avatarStack.tsx +0 -82
- package/src/ui/primitives/avatar/index.ts +0 -4
- package/src/ui/primitives/avatar/types.ts +0 -17
- package/src/ui/primitives/badge/__workshop__/props.tsx +0 -30
- package/src/ui/primitives/badge/__workshop__/tones.tsx +0 -21
- package/src/ui/primitives/badge/badge.test.tsx +0 -16
- package/src/ui/primitives/badge/badge.tsx +0 -64
- package/src/ui/primitives/badge/index.ts +0 -1
- package/src/ui/primitives/badge/types.ts +0 -8
- package/src/ui/primitives/box/__workshop__/props.tsx +0 -20
- package/src/ui/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/ui/primitives/box/box.tsx +0 -155
- package/src/ui/primitives/box/index.ts +0 -1
- package/src/ui/primitives/button/__workshop__/custom.tsx +0 -50
- package/src/ui/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/ui/primitives/button/__workshop__/disabled.tsx +0 -74
- package/src/ui/primitives/button/__workshop__/index.ts +0 -59
- package/src/ui/primitives/button/__workshop__/props.tsx +0 -58
- package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/ui/primitives/button/__workshop__/stacked.tsx +0 -59
- package/src/ui/primitives/button/__workshop__/uploadButton.tsx +0 -28
- package/src/ui/primitives/button/button.test.tsx +0 -44
- package/src/ui/primitives/button/button.tsx +0 -206
- package/src/ui/primitives/button/index.ts +0 -1
- package/src/ui/primitives/card/__workshop__/allTones.tsx +0 -27
- package/src/ui/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/ui/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/ui/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/ui/primitives/card/__workshop__/index.ts +0 -18
- package/src/ui/primitives/card/__workshop__/interactive.tsx +0 -30
- package/src/ui/primitives/card/__workshop__/listNavigation.tsx +0 -80
- package/src/ui/primitives/card/__workshop__/props.tsx +0 -55
- package/src/ui/primitives/card/__workshop__/selected.tsx +0 -93
- package/src/ui/primitives/card/card.tsx +0 -119
- package/src/ui/primitives/card/cardContext.ts +0 -10
- package/src/ui/primitives/card/cardProvider.tsx +0 -19
- package/src/ui/primitives/card/index.ts +0 -4
- package/src/ui/primitives/card/types.ts +0 -27
- package/src/ui/primitives/card/useCard.ts +0 -7
- package/src/ui/primitives/checkbox/__workshop__/props.tsx +0 -33
- package/src/ui/primitives/checkbox/__workshop__/tones.tsx +0 -28
- package/src/ui/primitives/checkbox/checkbox.tsx +0 -74
- package/src/ui/primitives/checkbox/index.ts +0 -1
- package/src/ui/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
- package/src/ui/primitives/code/__workshop__/props.tsx +0 -21
- package/src/ui/primitives/code/code.tsx +0 -49
- package/src/ui/primitives/code/index.ts +0 -1
- package/src/ui/primitives/code/refractor.tsx +0 -20
- package/src/ui/primitives/container/__workshop__/example.tsx +0 -20
- package/src/ui/primitives/container/container.tsx +0 -35
- package/src/ui/primitives/container/index.ts +0 -2
- package/src/ui/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/ui/primitives/flex/flex.tsx +0 -29
- package/src/ui/primitives/flex/index.ts +0 -1
- package/src/ui/primitives/grid/grid.tsx +0 -30
- package/src/ui/primitives/grid/index.ts +0 -1
- package/src/ui/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/ui/primitives/heading/__workshop__/plain.tsx +0 -32
- package/src/ui/primitives/heading/heading.tsx +0 -62
- package/src/ui/primitives/heading/index.ts +0 -1
- package/src/ui/primitives/index.ts +0 -27
- package/src/ui/primitives/inline/__workshop__/plain.tsx +0 -27
- package/src/ui/primitives/inline/index.ts +0 -1
- package/src/ui/primitives/inline/inline.tsx +0 -50
- package/src/ui/primitives/inline/types.ts +0 -6
- package/src/ui/primitives/kbd/index.ts +0 -1
- package/src/ui/primitives/kbd/kbd.tsx +0 -55
- package/src/ui/primitives/label/__workshop__/plain.tsx +0 -37
- package/src/ui/primitives/label/index.ts +0 -1
- package/src/ui/primitives/label/label.tsx +0 -67
- package/src/ui/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/ui/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/ui/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/ui/primitives/popover/__workshop__/RecursiveStory.tsx +0 -70
- package/src/ui/primitives/popover/__workshop__/SidePanelStory.tsx +0 -93
- package/src/ui/primitives/popover/__workshop__/TestStory.tsx +0 -98
- package/src/ui/primitives/popover/constants.ts +0 -22
- package/src/ui/primitives/popover/floating-ui/size.ts +0 -83
- package/src/ui/primitives/popover/helpers.ts +0 -32
- package/src/ui/primitives/popover/index.ts +0 -2
- package/src/ui/primitives/popover/popover.tsx +0 -492
- package/src/ui/primitives/popover/popoverCard.tsx +0 -155
- package/src/ui/primitives/popover/types.ts +0 -6
- package/src/ui/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/ui/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/ui/primitives/radio/index.ts +0 -1
- package/src/ui/primitives/radio/radio.tsx +0 -49
- package/src/ui/primitives/select/__workshop__/plain.tsx +0 -30
- package/src/ui/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/ui/primitives/select/index.ts +0 -1
- package/src/ui/primitives/select/select.tsx +0 -85
- package/src/ui/primitives/spinner/__workshop__/Props.tsx +0 -16
- package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +0 -16
- package/src/ui/primitives/spinner/index.ts +0 -1
- package/src/ui/primitives/spinner/spinner.tsx +0 -33
- package/src/ui/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/ui/primitives/stack/index.ts +0 -1
- package/src/ui/primitives/stack/stack.tsx +0 -40
- package/src/ui/primitives/switch/index.ts +0 -1
- package/src/ui/primitives/switch/switch.tsx +0 -75
- package/src/ui/primitives/text/__workshop__/colored.tsx +0 -23
- package/src/ui/primitives/text/__workshop__/example.tsx +0 -39
- package/src/ui/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
- package/src/ui/primitives/text/index.ts +0 -1
- package/src/ui/primitives/text/text.tsx +0 -64
- package/src/ui/primitives/textArea/__workshop__/plain.tsx +0 -50
- package/src/ui/primitives/textArea/index.ts +0 -1
- package/src/ui/primitives/textArea/textArea.tsx +0 -71
- package/src/ui/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/ui/primitives/textInput/__workshop__/plain.tsx +0 -104
- package/src/ui/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/ui/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/ui/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/ui/primitives/textInput/index.ts +0 -1
- package/src/ui/primitives/textInput/textInput.tsx +0 -286
- package/src/ui/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/ui/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/ui/primitives/tooltip/__workshop__/props.tsx +0 -111
- package/src/ui/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/ui/primitives/tooltip/constants.ts +0 -23
- package/src/ui/primitives/tooltip/index.ts +0 -2
- package/src/ui/primitives/tooltip/tooltip.test.tsx +0 -453
- package/src/ui/primitives/tooltip/tooltip.tsx +0 -467
- package/src/ui/primitives/tooltip/tooltipCard.tsx +0 -115
- package/src/ui/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -11
- package/src/ui/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -55
- package/src/ui/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
- package/src/ui/primitives/types.ts +0 -166
- package/src/ui/types/avatar.ts +0 -19
- package/src/ui/types/badge.ts +0 -12
- package/src/ui/types/button.ts +0 -24
- package/src/ui/types/card.ts +0 -6
- package/src/ui/types/dialog.ts +0 -4
- package/src/ui/types/flex.ts +0 -27
- package/src/ui/types/index.ts +0 -15
- package/src/ui/types/popover.ts +0 -4
- package/src/ui/types/props.ts +0 -18
- package/src/ui/types/radius.ts +0 -7
- package/src/ui/types/selectable.ts +0 -7
- package/src/ui/utils/arrow/arrow.tsx +0 -59
- package/src/ui/utils/arrow/index.ts +0 -1
- package/src/ui/utils/boundaryElement/boundaryElement.test.tsx +0 -100
- package/src/ui/utils/boundaryElement/boundaryElementContext.ts +0 -7
- package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +0 -24
- package/src/ui/utils/boundaryElement/index.ts +0 -3
- package/src/ui/utils/boundaryElement/types.ts +0 -7
- package/src/ui/utils/boundaryElement/useBoundaryElement.ts +0 -26
- package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/ui/utils/conditionalWrapper/index.ts +0 -1
- package/src/ui/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
- package/src/ui/utils/elementQuery/elementQuery.tsx +0 -53
- package/src/ui/utils/elementQuery/index.ts +0 -1
- package/src/ui/utils/errorBoundary.tsx +0 -48
- package/src/ui/utils/getElementRef.ts +0 -26
- package/src/ui/utils/index.ts +0 -9
- package/src/ui/utils/layer/__workshop__/index.ts +0 -24
- package/src/ui/utils/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/ui/utils/layer/__workshop__/nested.tsx +0 -98
- package/src/ui/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
- package/src/ui/utils/layer/getLayerContext.test.ts +0 -30
- package/src/ui/utils/layer/getLayerContext.ts +0 -21
- package/src/ui/utils/layer/index.ts +0 -4
- package/src/ui/utils/layer/layer.test.tsx +0 -108
- package/src/ui/utils/layer/layer.tsx +0 -112
- package/src/ui/utils/layer/layerContext.ts +0 -7
- package/src/ui/utils/layer/layerProvider.tsx +0 -110
- package/src/ui/utils/layer/useLayer.ts +0 -26
- package/src/ui/utils/portal/__workshop__/named.tsx +0 -63
- package/src/ui/utils/portal/index.ts +0 -4
- package/src/ui/utils/portal/portal.test.tsx +0 -103
- package/src/ui/utils/portal/portal.ts +0 -46
- package/src/ui/utils/portal/portalContext.ts +0 -31
- package/src/ui/utils/portal/portalProvider.tsx +0 -79
- package/src/ui/utils/portal/types.ts +0 -9
- package/src/ui/utils/portal/usePortal.ts +0 -25
- package/src/ui/utils/srOnly/index.ts +0 -1
- package/src/ui/utils/srOnly/srOnly.tsx +0 -35
- package/src/ui/utils/virtualList/__workshop__/index.ts +0 -29
- package/src/ui/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/ui/utils/virtualList/index.ts +0 -1
- package/src/ui/utils/virtualList/virtualList.tsx +0 -189
- /package/src/{ui/global.ts → core/__DEV__.ts} +0 -0
- /package/src/{ui/components/autocomplete/__mocks__ → core/components/autocomplete/__workshop__/mock}/apiStore.ts +0 -0
- /package/src/{ui/components/autocomplete/__mocks__ → core/components/autocomplete/__workshop__/mock}/countries.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/toast/toastState.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
- /package/src/{ui/utils → core/components}/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/{ui/utils → core/components}/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/{ui/utils → core/components}/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/{ui → core}/helpers/animation.ts +0 -0
- /package/src/{ui → core}/helpers/element.ts +0 -0
- /package/src/{ui → core}/helpers/scroll.ts +0 -0
- /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
- /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
- /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
- /package/src/{ui → core}/hooks/useMatchMedia.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMounted.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
- /package/src/{ui → core}/lib/createGlobalScopedContext.ts +0 -0
- /package/src/{ui → core}/lib/globalScope.ts +0 -0
- /package/src/{theme/build → core}/lib/isRecord.ts +0 -0
- /package/src/{ui/observers/resizeObserver.ts → core/observers/resize.ts} +0 -0
- /package/src/{ui/utils → core/primitives}/arrow/cmds.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
- /package/src/{ui/types/box.ts → core/primitives/box/types.ts} +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/types.ts +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
- /package/src/{ui/types/grid.ts → core/primitives/grid/types.ts} +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui/utils → core/primitives}/layer/__workshop__/_debug.tsx +0 -0
- /package/src/{ui/utils → core/primitives}/layer/types.ts +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
- /package/src/{ui → core}/types/gridItem.ts +0 -0
- /package/src/{ui → core}/types/placement.ts +0 -0
- /package/src/{ui/types/text.ts → core/types/textAlign.ts} +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
- /package/src/css/{aspects → props}/pointerEvents/types.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/{ui → theme/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.cjs
ADDED
|
@@ -0,0 +1,2470 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
+
var theme = require("@sanity/ui/theme"), _visualEditing = require("./_chunks-cjs/_visual-editing.cjs"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), compilerRuntime = require("react/compiler-runtime"), css = require("@sanity/ui/css"), framerMotion = require("framer-motion"), resizeObserver = require("@juggle/resize-observer");
|
|
4
|
+
const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen;
|
|
5
|
+
function _responsive(media, values, callback) {
|
|
6
|
+
return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
|
|
7
|
+
[`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function _raf(fn) {
|
|
11
|
+
const frameId = requestAnimationFrame(fn);
|
|
12
|
+
return () => {
|
|
13
|
+
cancelAnimationFrame(frameId);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function _raf2(fn) {
|
|
17
|
+
let innerDispose = null;
|
|
18
|
+
const outerDispose = _raf(() => {
|
|
19
|
+
innerDispose = _raf(fn);
|
|
20
|
+
});
|
|
21
|
+
return () => {
|
|
22
|
+
innerDispose && innerDispose(), outerDispose();
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function _hasFocus(element) {
|
|
26
|
+
return !!document.activeElement && element.contains(document.activeElement);
|
|
27
|
+
}
|
|
28
|
+
function isFocusable(element) {
|
|
29
|
+
return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : _visualEditing.isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : _visualEditing.isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : _visualEditing.isHTMLButtonElement(element) || _visualEditing.isHTMLSelectElement(element) || _visualEditing.isHTMLTextAreaElement(element) ? !element.disabled : !1;
|
|
30
|
+
}
|
|
31
|
+
function attemptFocus(element) {
|
|
32
|
+
if (!isFocusable(element))
|
|
33
|
+
return !1;
|
|
34
|
+
try {
|
|
35
|
+
element.focus();
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
return document.activeElement === element;
|
|
39
|
+
}
|
|
40
|
+
function focusFirstDescendant(element) {
|
|
41
|
+
for (let i = 0; i < element.childNodes.length; i++) {
|
|
42
|
+
const child = element.childNodes[i];
|
|
43
|
+
if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
|
|
44
|
+
return !0;
|
|
45
|
+
}
|
|
46
|
+
return !1;
|
|
47
|
+
}
|
|
48
|
+
function focusLastDescendant(element) {
|
|
49
|
+
for (let i = element.childNodes.length - 1; i >= 0; i--) {
|
|
50
|
+
const child = element.childNodes[i];
|
|
51
|
+
if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
|
|
52
|
+
return !0;
|
|
53
|
+
}
|
|
54
|
+
return !1;
|
|
55
|
+
}
|
|
56
|
+
function AutocompleteOption(props) {
|
|
57
|
+
const $ = compilerRuntime.c(11), {
|
|
58
|
+
children,
|
|
59
|
+
id,
|
|
60
|
+
onSelect,
|
|
61
|
+
selected,
|
|
62
|
+
value
|
|
63
|
+
} = props;
|
|
64
|
+
let t0;
|
|
65
|
+
$[0] !== onSelect || $[1] !== value ? (t0 = () => {
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
onSelect(value);
|
|
68
|
+
}, 0);
|
|
69
|
+
}, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
|
|
70
|
+
const handleClick = t0;
|
|
71
|
+
let t1;
|
|
72
|
+
$[3] !== handleClick ? (t1 = (event) => {
|
|
73
|
+
event.key === "Enter" && !_visualEditing._isEnterToClickElement(event.currentTarget) && handleClick();
|
|
74
|
+
}, $[3] = handleClick, $[4] = t1) : t1 = $[4];
|
|
75
|
+
const handleKeyDown = t1;
|
|
76
|
+
let t2;
|
|
77
|
+
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsxRuntime.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;
|
|
78
|
+
}
|
|
79
|
+
function autocompleteReducer(state, msg) {
|
|
80
|
+
return msg.type === "input/change" ? {
|
|
81
|
+
...state,
|
|
82
|
+
activeValue: null,
|
|
83
|
+
focused: !0,
|
|
84
|
+
query: msg.query
|
|
85
|
+
} : msg.type === "input/focus" ? {
|
|
86
|
+
...state,
|
|
87
|
+
focused: !0
|
|
88
|
+
} : msg.type === "root/blur" ? {
|
|
89
|
+
...state,
|
|
90
|
+
focused: !1,
|
|
91
|
+
query: null
|
|
92
|
+
} : msg.type === "root/clear" ? {
|
|
93
|
+
...state,
|
|
94
|
+
activeValue: null,
|
|
95
|
+
query: null,
|
|
96
|
+
value: null
|
|
97
|
+
} : msg.type === "root/escape" ? {
|
|
98
|
+
...state,
|
|
99
|
+
focused: !1,
|
|
100
|
+
query: null
|
|
101
|
+
} : msg.type === "root/open" ? {
|
|
102
|
+
...state,
|
|
103
|
+
query: state.query || msg.query
|
|
104
|
+
} : msg.type === "root/setActiveValue" ? {
|
|
105
|
+
...state,
|
|
106
|
+
activeValue: msg.value,
|
|
107
|
+
listFocused: msg.listFocused || state.listFocused
|
|
108
|
+
} : msg.type === "root/setListFocused" ? {
|
|
109
|
+
...state,
|
|
110
|
+
listFocused: msg.listFocused
|
|
111
|
+
} : msg.type === "value/change" ? {
|
|
112
|
+
...state,
|
|
113
|
+
activeValue: msg.value,
|
|
114
|
+
query: null,
|
|
115
|
+
value: msg.value
|
|
116
|
+
} : state;
|
|
117
|
+
}
|
|
118
|
+
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_AUTOCOMPLETE_ELEMENT = "input", DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
|
119
|
+
function Autocomplete(props) {
|
|
120
|
+
const {
|
|
121
|
+
as = DEFAULT_AUTOCOMPLETE_ELEMENT,
|
|
122
|
+
border = !0,
|
|
123
|
+
customValidity,
|
|
124
|
+
disabled,
|
|
125
|
+
filterOption: filterOptionProp,
|
|
126
|
+
fontSize = 2,
|
|
127
|
+
icon,
|
|
128
|
+
id,
|
|
129
|
+
listBox = _visualEditing.EMPTY_RECORD,
|
|
130
|
+
loading,
|
|
131
|
+
onBlur,
|
|
132
|
+
onChange,
|
|
133
|
+
onFocus,
|
|
134
|
+
onQueryChange,
|
|
135
|
+
onSelect,
|
|
136
|
+
openButton,
|
|
137
|
+
openOnFocus,
|
|
138
|
+
options: optionsProp,
|
|
139
|
+
padding: paddingProp = 3,
|
|
140
|
+
popover = _visualEditing.EMPTY_RECORD,
|
|
141
|
+
prefix,
|
|
142
|
+
radius = 2,
|
|
143
|
+
readOnly,
|
|
144
|
+
ref: forwardedRef,
|
|
145
|
+
relatedElements,
|
|
146
|
+
renderOption: renderOptionProp,
|
|
147
|
+
renderPopover,
|
|
148
|
+
renderValue = DEFAULT_RENDER_VALUE,
|
|
149
|
+
suffix,
|
|
150
|
+
value: valueProp,
|
|
151
|
+
...rest
|
|
152
|
+
} = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
|
|
153
|
+
activeValue: valueProp || null,
|
|
154
|
+
focused: !1,
|
|
155
|
+
listFocused: !1,
|
|
156
|
+
query: null,
|
|
157
|
+
value: valueProp || null
|
|
158
|
+
}), {
|
|
159
|
+
activeValue,
|
|
160
|
+
focused,
|
|
161
|
+
listFocused,
|
|
162
|
+
query,
|
|
163
|
+
value
|
|
164
|
+
} = state, defaultRenderOption = react.useCallback(({
|
|
165
|
+
value: value_0
|
|
166
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { as: "button", padding: paddingProp, radius: 2, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
|
|
167
|
+
react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
|
|
168
|
+
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useResponsiveProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = react.useCallback((event) => {
|
|
169
|
+
setTimeout(() => {
|
|
170
|
+
if (popoverMouseWithinRef.current)
|
|
171
|
+
return;
|
|
172
|
+
const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
|
|
173
|
+
let focusInside = !1;
|
|
174
|
+
if (document.activeElement) {
|
|
175
|
+
for (const e of elements)
|
|
176
|
+
if (e === document.activeElement || e.contains(document.activeElement)) {
|
|
177
|
+
focusInside = !0;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
focusInside === !1 && (dispatch({
|
|
182
|
+
type: "root/blur"
|
|
183
|
+
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
184
|
+
}, 0);
|
|
185
|
+
}, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
|
|
186
|
+
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
187
|
+
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
188
|
+
type: "root/setListFocused",
|
|
189
|
+
listFocused: listFocused_0
|
|
190
|
+
}));
|
|
191
|
+
}, []), handleOptionSelect = react.useCallback((v) => {
|
|
192
|
+
dispatch({
|
|
193
|
+
type: "value/change",
|
|
194
|
+
value: v
|
|
195
|
+
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
196
|
+
}, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
|
|
197
|
+
if (event_1.key === "ArrowDown") {
|
|
198
|
+
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
199
|
+
const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
200
|
+
nextActiveOption && dispatch({
|
|
201
|
+
type: "root/setActiveValue",
|
|
202
|
+
value: nextActiveOption.value,
|
|
203
|
+
listFocused: !0
|
|
204
|
+
});
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (event_1.key === "ArrowUp") {
|
|
208
|
+
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
209
|
+
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];
|
|
210
|
+
nextActiveOption_0 && dispatch({
|
|
211
|
+
type: "root/setActiveValue",
|
|
212
|
+
value: nextActiveOption_0.value,
|
|
213
|
+
listFocused: !0
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
if (event_1.key === "Escape") {
|
|
218
|
+
dispatch({
|
|
219
|
+
type: "root/escape"
|
|
220
|
+
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const target = event_1.target, listEl = listBoxElementRef.current;
|
|
224
|
+
if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
|
|
225
|
+
inputElementRef.current?.focus();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
|
|
229
|
+
const nextQuery = event_2.currentTarget.value;
|
|
230
|
+
dispatch({
|
|
231
|
+
type: "input/change",
|
|
232
|
+
query: nextQuery
|
|
233
|
+
}), onQueryChange && onQueryChange(nextQuery);
|
|
234
|
+
}, [onQueryChange]), dispatchOpen = react.useCallback(() => {
|
|
235
|
+
dispatch({
|
|
236
|
+
type: "root/open",
|
|
237
|
+
query: value ? renderValue(value, currentOption) : ""
|
|
238
|
+
});
|
|
239
|
+
}, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
|
|
240
|
+
focused || (dispatch({
|
|
241
|
+
type: "input/focus"
|
|
242
|
+
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
243
|
+
}, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
|
|
244
|
+
popoverMouseWithinRef.current = !0;
|
|
245
|
+
}, []), handlePopoverMouseLeave = react.useCallback(() => {
|
|
246
|
+
popoverMouseWithinRef.current = !1;
|
|
247
|
+
}, []), handleClearButtonClick = react.useCallback(() => {
|
|
248
|
+
dispatch({
|
|
249
|
+
type: "root/clear"
|
|
250
|
+
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
251
|
+
}, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
|
|
252
|
+
dispatch({
|
|
253
|
+
type: "input/focus"
|
|
254
|
+
});
|
|
255
|
+
}, []);
|
|
256
|
+
react.useEffect(() => {
|
|
257
|
+
if (valueProp !== valuePropRef.current) {
|
|
258
|
+
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
259
|
+
type: "value/change",
|
|
260
|
+
value: valueProp
|
|
261
|
+
}), valueRef.current = valueProp);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
|
|
265
|
+
type: "value/change",
|
|
266
|
+
value: valueProp || null
|
|
267
|
+
}));
|
|
268
|
+
}, [valueProp]), react.useEffect(() => {
|
|
269
|
+
!focused && valueRef.current && dispatch({
|
|
270
|
+
type: "root/setActiveValue",
|
|
271
|
+
value: valueRef.current
|
|
272
|
+
});
|
|
273
|
+
}, [focused]), react.useEffect(() => {
|
|
274
|
+
const listElement = listBoxElementRef.current;
|
|
275
|
+
if (!listElement) return;
|
|
276
|
+
const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
277
|
+
if (activeOption_1) {
|
|
278
|
+
const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
|
|
279
|
+
if (activeItemElement) {
|
|
280
|
+
if (_hasFocus(activeItemElement))
|
|
281
|
+
return;
|
|
282
|
+
focusFirstDescendant(activeItemElement);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}, [activeValue, filteredOptions]);
|
|
286
|
+
const clearButton = react.useMemo(() => {
|
|
287
|
+
if (!loading && !disabled && value)
|
|
288
|
+
return {
|
|
289
|
+
"aria-label": "Clear",
|
|
290
|
+
onFocus: handleClearButtonFocus
|
|
291
|
+
};
|
|
292
|
+
}, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => Object.fromEntries(Object.entries(padding).map(([key, value_1]) => value_1 === 0 ? [key, 0] : value_1 === 1 ? [key, 1] : value_1 === 2 ? [key, 1] : [key, value_1 - 2])), [padding]), openButtonPadding = react.useMemo(() => Object.values(padding).map((v_0) => Math.max(v_0 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
|
|
293
|
+
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
294
|
+
}, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && _visualEditing.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 = react.useCallback((event_5) => {
|
|
295
|
+
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
296
|
+
}, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: filteredOptions.map((option_0) => {
|
|
297
|
+
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
298
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
|
|
299
|
+
disabled: loading,
|
|
300
|
+
selected: active,
|
|
301
|
+
tabIndex: listFocused && active ? 0 : -1
|
|
302
|
+
}) }, option_0.value);
|
|
303
|
+
}) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
|
|
304
|
+
content: content2,
|
|
305
|
+
hidden: !expanded,
|
|
306
|
+
inputElement: inputElementRef.current,
|
|
307
|
+
onMouseEnter: handlePopoverMouseEnter,
|
|
308
|
+
onMouseLeave: handlePopoverMouseLeave
|
|
309
|
+
}, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
|
|
310
|
+
return (
|
|
311
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
312
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
313
|
+
input,
|
|
314
|
+
results
|
|
315
|
+
] })
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
|
|
319
|
+
function Breadcrumbs(props) {
|
|
320
|
+
const {
|
|
321
|
+
as = DEFAULT_BREADCRUMBS_ELEMENT,
|
|
322
|
+
children,
|
|
323
|
+
className,
|
|
324
|
+
expandButton: expandButtonProps,
|
|
325
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
326
|
+
gap: _gapProp,
|
|
327
|
+
gapX = props.gap ?? props.space ?? 2,
|
|
328
|
+
gapY = props.gap ?? props.space ?? 2,
|
|
329
|
+
maxLength,
|
|
330
|
+
separator,
|
|
331
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
332
|
+
space: _spaceProp,
|
|
333
|
+
...rest
|
|
334
|
+
} = props, [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
|
|
335
|
+
_visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
|
|
336
|
+
const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
|
|
337
|
+
const len = rawItems.length;
|
|
338
|
+
if (maxLength && len > maxLength) {
|
|
339
|
+
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
340
|
+
return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", gap: gapY, overflow: "auto", children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
|
|
341
|
+
}
|
|
342
|
+
return rawItems;
|
|
343
|
+
}, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
|
|
344
|
+
return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: css.breadcrumbs({
|
|
345
|
+
className
|
|
346
|
+
}), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
347
|
+
itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
|
|
348
|
+
/* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
|
|
349
|
+
] }, itemIndex)) });
|
|
350
|
+
}
|
|
351
|
+
const DEFAULT_CONTAINER_ELEMENT = "div";
|
|
352
|
+
function Container(props) {
|
|
353
|
+
const $ = compilerRuntime.c(12), t0 = props;
|
|
354
|
+
let className, rest, t1, t2;
|
|
355
|
+
$[0] !== t0 ? ({
|
|
356
|
+
as: t1,
|
|
357
|
+
className,
|
|
358
|
+
width: t2,
|
|
359
|
+
...rest
|
|
360
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1, $[4] = t2) : (className = $[1], rest = $[2], t1 = $[3], t2 = $[4]);
|
|
361
|
+
const as = t1 === void 0 ? DEFAULT_CONTAINER_ELEMENT : t1, width = t2 === void 0 ? 2 : t2;
|
|
362
|
+
let t3;
|
|
363
|
+
$[5] !== className || $[6] !== width ? (t3 = css.container({
|
|
364
|
+
className,
|
|
365
|
+
width
|
|
366
|
+
}), $[5] = className, $[6] = width, $[7] = t3) : t3 = $[7];
|
|
367
|
+
let t4;
|
|
368
|
+
return $[8] !== as || $[9] !== rest || $[10] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Container", ...rest, as, className: t3 }), $[8] = as, $[9] = rest, $[10] = t3, $[11] = t4) : t4 = $[11], t4;
|
|
369
|
+
}
|
|
370
|
+
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
371
|
+
return !boundaryElement || !portalElement ? !0 : _visualEditing.containsOrEqualsElement(boundaryElement, target) || _visualEditing.containsOrEqualsElement(portalElement, target);
|
|
372
|
+
}
|
|
373
|
+
const DEFAULT_DIALOG_CARD_ELEMENT = "div";
|
|
374
|
+
function DialogCard(props) {
|
|
375
|
+
const $ = compilerRuntime.c(60), t0 = props;
|
|
376
|
+
let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
|
|
377
|
+
$[0] !== t0 ? ({
|
|
378
|
+
__unstable_autoFocus: autoFocus,
|
|
379
|
+
__unstable_hideCloseButton: hideCloseButton,
|
|
380
|
+
as: t1,
|
|
381
|
+
children,
|
|
382
|
+
contentRef: forwardedContentRef,
|
|
383
|
+
footer,
|
|
384
|
+
header,
|
|
385
|
+
id,
|
|
386
|
+
onClickOutside,
|
|
387
|
+
onClose,
|
|
388
|
+
portal: portalProp,
|
|
389
|
+
ref: forwardedRef,
|
|
390
|
+
...rest
|
|
391
|
+
} = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
|
|
392
|
+
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
|
|
393
|
+
isTopLayer
|
|
394
|
+
} = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = react.useState(0);
|
|
395
|
+
let t2;
|
|
396
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], react.useImperativeHandle(forwardedRef, t2);
|
|
397
|
+
let t3;
|
|
398
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], react.useImperativeHandle(forwardedContentRef, t3);
|
|
399
|
+
let t4, t5;
|
|
400
|
+
$[16] !== autoFocus ? (t4 = () => {
|
|
401
|
+
autoFocus && ref.current && focusFirstDescendant(ref.current);
|
|
402
|
+
}, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), react.useEffect(t4, t5);
|
|
403
|
+
let t6;
|
|
404
|
+
$[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
|
|
405
|
+
if (!isTopLayer || !onClose)
|
|
406
|
+
return;
|
|
407
|
+
const target = document.activeElement;
|
|
408
|
+
target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
|
|
409
|
+
}, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], _visualEditing.useGlobalKeyDown(t6);
|
|
410
|
+
let t7;
|
|
411
|
+
$[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
|
|
412
|
+
const target_0 = event_0.target;
|
|
413
|
+
target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
|
|
414
|
+
}), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
|
|
415
|
+
let t8;
|
|
416
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], _visualEditing.useClickOutsideEvent(t7, t8);
|
|
417
|
+
let t10, t9;
|
|
418
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
419
|
+
const el = contentRef.current;
|
|
420
|
+
if (!el)
|
|
421
|
+
return;
|
|
422
|
+
const handleScroll = () => {
|
|
423
|
+
setScrollTop(el.scrollTop);
|
|
424
|
+
};
|
|
425
|
+
return el.addEventListener("scroll", handleScroll, {
|
|
426
|
+
passive: !0
|
|
427
|
+
}), () => {
|
|
428
|
+
el.removeEventListener("scroll", handleScroll);
|
|
429
|
+
};
|
|
430
|
+
}, t10 = [], $[30] = t10, $[31] = t9) : (t10 = $[30], t9 = $[31]), react.useEffect(t9, t10);
|
|
431
|
+
let t11;
|
|
432
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t11 = css.dialogCard(), $[32] = t11) : t11 = $[32];
|
|
433
|
+
let t12;
|
|
434
|
+
$[33] !== header || $[34] !== labelId || $[35] !== onClose || $[36] !== showCloseButton || $[37] !== showHeader ? (t12 = showHeader && /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", className: css.dialogHeader(), padding: 3, position: "relative", children: [
|
|
435
|
+
/* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
|
|
436
|
+
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Close dialog", disabled: !onClose, icon: icons.CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
|
|
437
|
+
] }), $[33] = header, $[34] = labelId, $[35] = onClose, $[36] = showCloseButton, $[37] = showHeader, $[38] = t12) : t12 = $[38];
|
|
438
|
+
let t13;
|
|
439
|
+
$[39] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.dialogContent(), $[39] = t13) : t13 = $[39];
|
|
440
|
+
let t14;
|
|
441
|
+
$[40] !== scrollTop || $[41] !== showHeader ? (t14 = showHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { className: css.dialogScrollerShadowTop(), style: {
|
|
442
|
+
opacity: Math.min(scrollTop, 32) / 32
|
|
443
|
+
} }), $[40] = scrollTop, $[41] = showHeader, $[42] = t14) : t14 = $[42];
|
|
444
|
+
let t15;
|
|
445
|
+
$[43] === Symbol.for("react.memo_cache_sentinel") ? (t15 = css.dialogScroller(), $[43] = t15) : t15 = $[43];
|
|
446
|
+
let t16;
|
|
447
|
+
$[44] !== children ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: t15, overflow: "auto", ref: contentRef, children }), $[44] = children, $[45] = t16) : t16 = $[45];
|
|
448
|
+
let t17;
|
|
449
|
+
$[46] !== footer ? (t17 = footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: css.dialogScrollerShadowBottom() }), $[46] = footer, $[47] = t17) : t17 = $[47];
|
|
450
|
+
let t18;
|
|
451
|
+
$[48] !== t14 || $[49] !== t16 || $[50] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: t13, flex: 1, position: "relative", tabIndex: -1, children: [
|
|
452
|
+
t14,
|
|
453
|
+
t16,
|
|
454
|
+
t17
|
|
455
|
+
] }), $[48] = t14, $[49] = t16, $[50] = t17, $[51] = t18) : t18 = $[51];
|
|
456
|
+
let t19;
|
|
457
|
+
$[52] !== footer ? (t19 = footer && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogFooter(), position: "relative", children: footer }), $[52] = footer, $[53] = t19) : t19 = $[53];
|
|
458
|
+
let t20;
|
|
459
|
+
return $[54] !== as || $[55] !== rest || $[56] !== t12 || $[57] !== t18 || $[58] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Card, { ...rest, as, className: t11, display: "flex", flexDirection: "column", ref, children: [
|
|
460
|
+
t12,
|
|
461
|
+
t18,
|
|
462
|
+
t19
|
|
463
|
+
] }), $[54] = as, $[55] = rest, $[56] = t12, $[57] = t18, $[58] = t19, $[59] = t20) : t20 = $[59], t20;
|
|
464
|
+
}
|
|
465
|
+
const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
|
|
466
|
+
version: 0
|
|
467
|
+
});
|
|
468
|
+
function useDialog() {
|
|
469
|
+
return react.useContext(DialogContext);
|
|
470
|
+
}
|
|
471
|
+
const DEFAULT_DIALOG_ELEMENT = "div";
|
|
472
|
+
function Dialog(props) {
|
|
473
|
+
const $ = compilerRuntime.c(69), context = useDialog(), t0 = props;
|
|
474
|
+
let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
|
|
475
|
+
$[0] !== t0 ? ({
|
|
476
|
+
__unstable_autoFocus: t1,
|
|
477
|
+
__unstable_hideCloseButton: t2,
|
|
478
|
+
animate: t3,
|
|
479
|
+
cardRadius: t4,
|
|
480
|
+
children,
|
|
481
|
+
className,
|
|
482
|
+
contentRef,
|
|
483
|
+
footer,
|
|
484
|
+
header,
|
|
485
|
+
id,
|
|
486
|
+
onActivate,
|
|
487
|
+
onClickOutside,
|
|
488
|
+
onClose,
|
|
489
|
+
onFocus,
|
|
490
|
+
padding: t5,
|
|
491
|
+
portal: portalProp,
|
|
492
|
+
position: _positionProp,
|
|
493
|
+
scheme,
|
|
494
|
+
shadow: t6,
|
|
495
|
+
width: t7,
|
|
496
|
+
zOffset: _zOffsetProp,
|
|
497
|
+
tone,
|
|
498
|
+
...rest
|
|
499
|
+
} = t0, $[0] = t0, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
|
|
500
|
+
const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? _visualEditing.Z_OFFSETS.dialog, animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing.useResponsiveProp(cardRadiusProp), position = _visualEditing.useResponsiveProp(positionProp), zOffset = _visualEditing.useResponsiveProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
|
|
501
|
+
let t8;
|
|
502
|
+
$[24] !== onFocus ? (t8 = (event) => {
|
|
503
|
+
onFocus?.(event);
|
|
504
|
+
const target = event.target, cardElement = cardRef.current;
|
|
505
|
+
if (cardElement && target === preDivRef.current) {
|
|
506
|
+
focusLastDescendant(cardElement);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (cardElement && target === postDivRef.current) {
|
|
510
|
+
focusFirstDescendant(cardElement);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
_visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
514
|
+
}, $[24] = onFocus, $[25] = t8) : t8 = $[25];
|
|
515
|
+
const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
|
|
516
|
+
let t9;
|
|
517
|
+
$[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
|
|
518
|
+
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
519
|
+
const activeElement = document.activeElement;
|
|
520
|
+
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
521
|
+
const target_0 = focusedElementRef.current;
|
|
522
|
+
if (!target_0 || !document.body.contains(target_0)) {
|
|
523
|
+
const cardElement_0 = cardRef.current;
|
|
524
|
+
cardElement_0 && focusFirstDescendant(cardElement_0);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
target_0.focus();
|
|
528
|
+
}
|
|
529
|
+
}, 0);
|
|
530
|
+
}, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
|
|
531
|
+
const handleRootClick = t9;
|
|
532
|
+
let t10;
|
|
533
|
+
$[29] !== className ? (t10 = css.dialog({
|
|
534
|
+
className
|
|
535
|
+
}), $[29] = className, $[30] = t10) : t10 = $[30];
|
|
536
|
+
const t11 = animate ? "" : void 0;
|
|
537
|
+
let t12;
|
|
538
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
|
|
539
|
+
let t13;
|
|
540
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.dialogContainer(), $[32] = t13) : t13 = $[32];
|
|
541
|
+
let t14;
|
|
542
|
+
$[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
|
|
543
|
+
let t15;
|
|
544
|
+
$[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Container, { alignItems: "center", className: t13, "data-ui": "DialogCard", flexDirection: "column", display: "flex", justifyContent: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
|
|
545
|
+
let t16;
|
|
546
|
+
$[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
|
|
547
|
+
let t17;
|
|
548
|
+
$[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
|
|
549
|
+
t12,
|
|
550
|
+
t15,
|
|
551
|
+
t16
|
|
552
|
+
] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
|
|
553
|
+
let t18;
|
|
554
|
+
return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
|
|
555
|
+
}
|
|
556
|
+
function DialogProvider(props) {
|
|
557
|
+
const $ = compilerRuntime.c(6), {
|
|
558
|
+
children,
|
|
559
|
+
position,
|
|
560
|
+
zOffset
|
|
561
|
+
} = props;
|
|
562
|
+
let t0, t1;
|
|
563
|
+
$[0] !== position || $[1] !== zOffset ? (t1 = {
|
|
564
|
+
version: 0,
|
|
565
|
+
position,
|
|
566
|
+
zOffset
|
|
567
|
+
}, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
|
|
568
|
+
const contextValue = t0;
|
|
569
|
+
let t2;
|
|
570
|
+
return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
|
|
571
|
+
}
|
|
572
|
+
function MenuButton(props) {
|
|
573
|
+
const $ = compilerRuntime.c(63), {
|
|
574
|
+
__unstable_disableRestoreFocusOnClose: t0,
|
|
575
|
+
boundaryElement: deprecated_boundaryElement,
|
|
576
|
+
button: buttonProp,
|
|
577
|
+
id,
|
|
578
|
+
menu: menuProp,
|
|
579
|
+
onClose,
|
|
580
|
+
onOpen,
|
|
581
|
+
placement: deprecated_placement,
|
|
582
|
+
popoverScheme: deprecated_popoverScheme,
|
|
583
|
+
portal: t1,
|
|
584
|
+
popover,
|
|
585
|
+
popoverRadius: deprecated_popoverRadius,
|
|
586
|
+
preventOverflow: deprecated_preventOverflow,
|
|
587
|
+
ref: forwardedRef
|
|
588
|
+
} = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
|
|
589
|
+
let t2;
|
|
590
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
|
|
591
|
+
const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
|
|
592
|
+
let t3, t4;
|
|
593
|
+
$[1] !== onOpen || $[2] !== open ? (t3 = () => {
|
|
594
|
+
onOpen && open && !openRef.current && onOpen();
|
|
595
|
+
}, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
|
|
596
|
+
let t5, t6;
|
|
597
|
+
$[5] !== onClose || $[6] !== open ? (t5 = () => {
|
|
598
|
+
onClose && !open && openRef.current && onClose();
|
|
599
|
+
}, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
|
|
600
|
+
let t7, t8;
|
|
601
|
+
$[9] !== open ? (t7 = () => {
|
|
602
|
+
openRef.current = open;
|
|
603
|
+
}, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
|
|
604
|
+
let t9;
|
|
605
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
|
|
606
|
+
setOpen(_temp$4), setShouldFocus(null);
|
|
607
|
+
}, $[12] = t9) : t9 = $[12];
|
|
608
|
+
const handleButtonClick = t9;
|
|
609
|
+
let t10;
|
|
610
|
+
$[13] !== open ? (t10 = (event) => {
|
|
611
|
+
open && event.preventDefault();
|
|
612
|
+
}, $[13] = open, $[14] = t10) : t10 = $[14];
|
|
613
|
+
const handleMouseDown = t10;
|
|
614
|
+
let t11;
|
|
615
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
|
|
616
|
+
if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
|
|
617
|
+
event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
if (event_0.key === "ArrowUp") {
|
|
621
|
+
event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
}, $[15] = t11) : t11 = $[15];
|
|
625
|
+
const handleButtonKeyDown = t11;
|
|
626
|
+
let t12;
|
|
627
|
+
$[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
|
|
628
|
+
const target = event_1.target;
|
|
629
|
+
if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
|
|
630
|
+
for (const el of menuElements)
|
|
631
|
+
if (target === el || el.contains(target))
|
|
632
|
+
return;
|
|
633
|
+
setOpen(!1);
|
|
634
|
+
}
|
|
635
|
+
}, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
|
|
636
|
+
const handleMenuClickOutside = t12;
|
|
637
|
+
let t13;
|
|
638
|
+
$[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
|
|
639
|
+
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
640
|
+
}, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
|
|
641
|
+
const handleMenuEscape = t13;
|
|
642
|
+
let t14;
|
|
643
|
+
$[22] !== menuElements ? (t14 = (event_2) => {
|
|
644
|
+
const target_0 = event_2.relatedTarget;
|
|
645
|
+
if (target_0 instanceof Node) {
|
|
646
|
+
for (const el_0 of menuElements)
|
|
647
|
+
if (el_0 === target_0 || el_0.contains(target_0))
|
|
648
|
+
return;
|
|
649
|
+
setOpen(!1);
|
|
650
|
+
}
|
|
651
|
+
}, $[22] = menuElements, $[23] = t14) : t14 = $[23];
|
|
652
|
+
const handleBlur = t14;
|
|
653
|
+
let t15;
|
|
654
|
+
$[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
|
|
655
|
+
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
656
|
+
}, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
|
|
657
|
+
const handleItemClick = t15;
|
|
658
|
+
let t16;
|
|
659
|
+
$[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];
|
|
660
|
+
const registerElement = t16;
|
|
661
|
+
let t17;
|
|
662
|
+
$[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && react.cloneElement(menuProp, {
|
|
663
|
+
"aria-labelledby": id,
|
|
664
|
+
onBlurCapture: handleBlur,
|
|
665
|
+
onClickOutside: handleMenuClickOutside,
|
|
666
|
+
onEscape: handleMenuEscape,
|
|
667
|
+
onItemClick: handleItemClick,
|
|
668
|
+
originElement: buttonElement,
|
|
669
|
+
registerElement,
|
|
670
|
+
shouldFocus
|
|
671
|
+
}), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
|
|
672
|
+
const menu = t17;
|
|
673
|
+
let t18;
|
|
674
|
+
bb0: {
|
|
675
|
+
if (!buttonProp) {
|
|
676
|
+
t18 = null;
|
|
677
|
+
break bb0;
|
|
678
|
+
}
|
|
679
|
+
const t192 = buttonProp.props.selected ?? open;
|
|
680
|
+
let t202;
|
|
681
|
+
$[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = react.cloneElement(buttonProp, {
|
|
682
|
+
"data-ui": "MenuButton",
|
|
683
|
+
id,
|
|
684
|
+
onClick: handleButtonClick,
|
|
685
|
+
onKeyDown: handleButtonKeyDown,
|
|
686
|
+
onMouseDown: handleMouseDown,
|
|
687
|
+
"aria-haspopup": !0,
|
|
688
|
+
"aria-expanded": open,
|
|
689
|
+
ref: setButtonElement,
|
|
690
|
+
selected: t192
|
|
691
|
+
}), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t192, $[42] = t202) : t202 = $[42], t18 = t202;
|
|
692
|
+
}
|
|
693
|
+
const button = t18;
|
|
694
|
+
let t19, t20;
|
|
695
|
+
$[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), react.useImperativeHandle(forwardedRef, t19, t20);
|
|
696
|
+
let t21, t22;
|
|
697
|
+
$[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
|
|
698
|
+
let t23;
|
|
699
|
+
$[48] !== deprecated_boundaryElement || $[49] !== deprecated_placement || $[50] !== deprecated_popoverRadius || $[51] !== deprecated_popoverScheme || $[52] !== deprecated_portal || $[53] !== deprecated_preventOverflow || $[54] !== t22 ? (t23 = {
|
|
700
|
+
boundaryElement: deprecated_boundaryElement,
|
|
701
|
+
overflow: "auto",
|
|
702
|
+
placement: deprecated_placement,
|
|
703
|
+
portal: deprecated_portal,
|
|
704
|
+
preventOverflow: deprecated_preventOverflow,
|
|
705
|
+
radius: deprecated_popoverRadius,
|
|
706
|
+
scheme: deprecated_popoverScheme,
|
|
707
|
+
...t22
|
|
708
|
+
}, $[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;
|
|
709
|
+
const popoverProps = t21;
|
|
710
|
+
let t24;
|
|
711
|
+
$[56] !== button ? (t24 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[56] = button, $[57] = t24) : t24 = $[57];
|
|
712
|
+
let t25;
|
|
713
|
+
return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
|
|
714
|
+
}
|
|
715
|
+
function _temp$4(v) {
|
|
716
|
+
return !v;
|
|
717
|
+
}
|
|
718
|
+
const DEFAULT_TAB_PANEL_ELEMENT = "div";
|
|
719
|
+
function TabPanel(props) {
|
|
720
|
+
const $ = compilerRuntime.c(10), t0 = props;
|
|
721
|
+
let children, rest, t1, tabIndex;
|
|
722
|
+
$[0] !== t0 ? ({
|
|
723
|
+
as: t1,
|
|
724
|
+
children,
|
|
725
|
+
tabIndex,
|
|
726
|
+
...rest
|
|
727
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1, $[4] = tabIndex) : (children = $[1], rest = $[2], t1 = $[3], tabIndex = $[4]);
|
|
728
|
+
const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = tabIndex === void 0 ? 0 : tabIndex;
|
|
729
|
+
let t3;
|
|
730
|
+
return $[5] !== as || $[6] !== children || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children }), $[5] = as, $[6] = children, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
731
|
+
}
|
|
732
|
+
const DEFAULT_TOAST_ELEMENT = "li", LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24, ROLES = {
|
|
733
|
+
error: "alert",
|
|
734
|
+
warning: "alert",
|
|
735
|
+
success: "alert",
|
|
736
|
+
info: "alert"
|
|
737
|
+
}, STATUS_CARD_TONE = {
|
|
738
|
+
error: "critical",
|
|
739
|
+
warning: "caution",
|
|
740
|
+
success: "positive",
|
|
741
|
+
info: "neutral"
|
|
742
|
+
}, BUTTON_TONE = {
|
|
743
|
+
error: "critical",
|
|
744
|
+
warning: "caution",
|
|
745
|
+
success: "positive",
|
|
746
|
+
info: "neutral"
|
|
747
|
+
};
|
|
748
|
+
function Toast(props) {
|
|
749
|
+
const $ = compilerRuntime.c(42), t0 = props;
|
|
750
|
+
let closable, description, duration, onClose, rest, status, t1, t2, title;
|
|
751
|
+
$[0] !== t0 ? ({
|
|
752
|
+
as: t1,
|
|
753
|
+
closable,
|
|
754
|
+
description,
|
|
755
|
+
duration,
|
|
756
|
+
onClose,
|
|
757
|
+
radius: t2,
|
|
758
|
+
title,
|
|
759
|
+
status,
|
|
760
|
+
...rest
|
|
761
|
+
} = t0, $[0] = t0, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = rest, $[6] = status, $[7] = t1, $[8] = t2, $[9] = title) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], rest = $[5], status = $[6], t1 = $[7], t2 = $[8], title = $[9]);
|
|
762
|
+
const as = t1 === void 0 ? DEFAULT_TOAST_ELEMENT : t1, radius = t2 === void 0 ? 3 : t2, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26;
|
|
763
|
+
let t3;
|
|
764
|
+
$[10] !== visualDuration ? (t3 = visualDuration ? {
|
|
765
|
+
type: "spring",
|
|
766
|
+
visualDuration,
|
|
767
|
+
bounce: 0.25
|
|
768
|
+
} : {
|
|
769
|
+
duration: 0
|
|
770
|
+
}, $[10] = visualDuration, $[11] = t3) : t3 = $[11];
|
|
771
|
+
const transition = t3, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
|
|
772
|
+
let t4;
|
|
773
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[12] = t4) : t4 = $[12];
|
|
774
|
+
const initial = t4;
|
|
775
|
+
let t5;
|
|
776
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[13] = t5) : t5 = $[13];
|
|
777
|
+
const animate = t5;
|
|
778
|
+
let t6;
|
|
779
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[14] = t6) : t6 = $[14];
|
|
780
|
+
const exit = t6;
|
|
781
|
+
let t7;
|
|
782
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = css.toast(), $[15] = t7) : t7 = $[15];
|
|
783
|
+
const t8 = hasDuration ? "" : void 0;
|
|
784
|
+
let t9;
|
|
785
|
+
$[16] !== title ? (t9 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[16] = title, $[17] = t9) : t9 = $[17];
|
|
786
|
+
let t10;
|
|
787
|
+
$[18] !== description || $[19] !== transition ? (t10 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t10) : t10 = $[20];
|
|
788
|
+
let t11;
|
|
789
|
+
$[21] !== t10 || $[22] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { gap: 3, children: [
|
|
790
|
+
t9,
|
|
791
|
+
t10
|
|
792
|
+
] }) }), $[21] = t10, $[22] = t9, $[23] = t11) : t11 = $[23];
|
|
793
|
+
let t12;
|
|
794
|
+
$[24] !== buttonTone || $[25] !== closable || $[26] !== onClose ? (t12 = closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
|
|
795
|
+
verticalAlign: "top"
|
|
796
|
+
} }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t12) : t12 = $[27];
|
|
797
|
+
let t13;
|
|
798
|
+
$[28] !== t11 || $[29] !== t12 || $[30] !== transition ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
|
|
799
|
+
t11,
|
|
800
|
+
t12
|
|
801
|
+
] }), $[28] = t11, $[29] = t12, $[30] = transition, $[31] = t13) : t13 = $[31];
|
|
802
|
+
let t14;
|
|
803
|
+
return $[32] !== as || $[33] !== cardTone || $[34] !== radius || $[35] !== rest || $[36] !== role || $[37] !== t13 || $[38] !== t8 || $[39] !== transition || $[40] !== visualDuration ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(MotionCard, { as, className: t7, "data-ui": "Toast", role, ...rest, custom: visualDuration, "data-has-duration": t8, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: t13 }), $[32] = as, $[33] = cardTone, $[34] = radius, $[35] = rest, $[36] = role, $[37] = t13, $[38] = t8, $[39] = transition, $[40] = visualDuration, $[41] = t14) : t14 = $[41], t14;
|
|
804
|
+
}
|
|
805
|
+
const container = {
|
|
806
|
+
initial: {
|
|
807
|
+
y: 32,
|
|
808
|
+
scale: 0.5,
|
|
809
|
+
zIndex: 1
|
|
810
|
+
},
|
|
811
|
+
hidden: {
|
|
812
|
+
opacity: 0
|
|
813
|
+
},
|
|
814
|
+
visible: (visualDuration) => visualDuration ? {
|
|
815
|
+
opacity: 1,
|
|
816
|
+
transition: {
|
|
817
|
+
when: "beforeChildren",
|
|
818
|
+
staggerChildren: visualDuration / 3,
|
|
819
|
+
duration: visualDuration / 3
|
|
820
|
+
}
|
|
821
|
+
} : {
|
|
822
|
+
opacity: 1
|
|
823
|
+
},
|
|
824
|
+
slideIn: {
|
|
825
|
+
y: 0,
|
|
826
|
+
scale: 1
|
|
827
|
+
},
|
|
828
|
+
slideOut: {
|
|
829
|
+
zIndex: 0,
|
|
830
|
+
scale: 0.75
|
|
831
|
+
}
|
|
832
|
+
}, content = {
|
|
833
|
+
initial: {
|
|
834
|
+
willChange: "transform"
|
|
835
|
+
},
|
|
836
|
+
hidden: {
|
|
837
|
+
opacity: 0
|
|
838
|
+
},
|
|
839
|
+
visible: {
|
|
840
|
+
opacity: 1
|
|
841
|
+
}
|
|
842
|
+
}, MotionCard = framerMotion.motion.create(_visualEditing.Card), MotionFlex = framerMotion.motion.create(_visualEditing.Flex), MotionText = framerMotion.motion.create(_visualEditing.Text);
|
|
843
|
+
function useMounted() {
|
|
844
|
+
return react.useSyncExternalStore(subscribe, _temp$3, _temp2);
|
|
845
|
+
}
|
|
846
|
+
function _temp2() {
|
|
847
|
+
return !1;
|
|
848
|
+
}
|
|
849
|
+
function _temp$3() {
|
|
850
|
+
return !0;
|
|
851
|
+
}
|
|
852
|
+
const subscribe = () => () => {
|
|
853
|
+
}, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
|
|
854
|
+
function ToastLayer(props) {
|
|
855
|
+
const $ = compilerRuntime.c(11), {
|
|
856
|
+
as: t0,
|
|
857
|
+
children,
|
|
858
|
+
padding: t1,
|
|
859
|
+
paddingX,
|
|
860
|
+
paddingY,
|
|
861
|
+
gap: t2
|
|
862
|
+
} = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
|
|
863
|
+
zIndex
|
|
864
|
+
} = _visualEditing.useLayer();
|
|
865
|
+
let t3;
|
|
866
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = css.toastLayer(), $[0] = t3) : t3 = $[0];
|
|
867
|
+
let t4;
|
|
868
|
+
$[1] !== zIndex ? (t4 = {
|
|
869
|
+
zIndex
|
|
870
|
+
}, $[1] = zIndex, $[2] = t4) : t4 = $[2];
|
|
871
|
+
let t5;
|
|
872
|
+
return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Grid, { as, className: t3, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t4, children }), $[3] = as, $[4] = children, $[5] = gap, $[6] = padding, $[7] = paddingX, $[8] = paddingY, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
|
|
873
|
+
}
|
|
874
|
+
let toastId = 0;
|
|
875
|
+
function generateToastId() {
|
|
876
|
+
return String(toastId++);
|
|
877
|
+
}
|
|
878
|
+
function ToastProvider(props) {
|
|
879
|
+
const $ = compilerRuntime.c(13), {
|
|
880
|
+
children,
|
|
881
|
+
padding,
|
|
882
|
+
paddingX,
|
|
883
|
+
paddingY,
|
|
884
|
+
gap,
|
|
885
|
+
zOffset: t0
|
|
886
|
+
} = props, zOffset = t0 === void 0 ? 1 : t0;
|
|
887
|
+
let t1;
|
|
888
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
889
|
+
const [state, setState] = react.useState(t1), mounted = useMounted();
|
|
890
|
+
let t2, t3;
|
|
891
|
+
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
892
|
+
version: 0,
|
|
893
|
+
push: (params) => {
|
|
894
|
+
const id = params.id ?? generateToastId(), duration = params.duration ?? 5e3;
|
|
895
|
+
return react.startTransition(() => {
|
|
896
|
+
setState((prevState) => {
|
|
897
|
+
if (duration === 0.01)
|
|
898
|
+
return prevState.filter((toast) => toast.id !== id);
|
|
899
|
+
const dismiss = () => {
|
|
900
|
+
react.startTransition(() => {
|
|
901
|
+
timeoutId && clearTimeout(timeoutId), setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id));
|
|
902
|
+
});
|
|
903
|
+
}, timeoutId = setTimeout(dismiss, duration);
|
|
904
|
+
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
905
|
+
dismiss,
|
|
906
|
+
id,
|
|
907
|
+
params: {
|
|
908
|
+
...params,
|
|
909
|
+
duration
|
|
910
|
+
}
|
|
911
|
+
}];
|
|
912
|
+
});
|
|
913
|
+
}), id;
|
|
914
|
+
}
|
|
915
|
+
}, $[1] = t3) : t3 = $[1], t2 = t3;
|
|
916
|
+
const value = t2;
|
|
917
|
+
let t4;
|
|
918
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp$2) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
|
|
919
|
+
let t5;
|
|
920
|
+
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
|
|
921
|
+
children,
|
|
922
|
+
t4
|
|
923
|
+
] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
|
|
924
|
+
}
|
|
925
|
+
function _temp$2(t0) {
|
|
926
|
+
const {
|
|
927
|
+
dismiss: dismiss_0,
|
|
928
|
+
id: id_0,
|
|
929
|
+
params: params_0
|
|
930
|
+
} = t0;
|
|
931
|
+
return /* @__PURE__ */ jsxRuntime.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 }, id_0);
|
|
932
|
+
}
|
|
933
|
+
function useToast() {
|
|
934
|
+
const value = react.useContext(ToastContext);
|
|
935
|
+
if (!value)
|
|
936
|
+
throw new Error("useToast(): missing context value");
|
|
937
|
+
if (!_visualEditing.isRecord(value) || value.version !== 0)
|
|
938
|
+
throw new Error("useToast(): the context value is not compatible");
|
|
939
|
+
return value;
|
|
940
|
+
}
|
|
941
|
+
function _findPrevItemElement(state, itemElements, focusedElement) {
|
|
942
|
+
const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(0, idx), len = els.length;
|
|
943
|
+
for (let i = len - 1; i >= 0; i -= 1) {
|
|
944
|
+
const itemKey = els[i].getAttribute("data-tree-key");
|
|
945
|
+
if (!itemKey)
|
|
946
|
+
continue;
|
|
947
|
+
const segments = itemKey.split("/");
|
|
948
|
+
segments.pop();
|
|
949
|
+
const p = [];
|
|
950
|
+
let expanded = !0;
|
|
951
|
+
for (let j = 0; j < segments.length; j += 1) {
|
|
952
|
+
p.push(segments[j]);
|
|
953
|
+
const k = p.join("/");
|
|
954
|
+
if (!state[k]?.expanded) {
|
|
955
|
+
expanded = !1;
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
if (expanded)
|
|
960
|
+
return els[i];
|
|
961
|
+
}
|
|
962
|
+
return null;
|
|
963
|
+
}
|
|
964
|
+
function _findNextItemElement(state, itemElements, focusedElement) {
|
|
965
|
+
const idx = itemElements.indexOf(focusedElement), els = itemElements.slice(idx), len = itemElements.length;
|
|
966
|
+
for (let i = 1; i < len; i += 1) {
|
|
967
|
+
if (!els[i])
|
|
968
|
+
continue;
|
|
969
|
+
const itemKey = els[i].getAttribute("data-tree-key");
|
|
970
|
+
if (!itemKey)
|
|
971
|
+
continue;
|
|
972
|
+
const segments = itemKey.split("/");
|
|
973
|
+
segments.pop();
|
|
974
|
+
const p = [];
|
|
975
|
+
let expanded = !0;
|
|
976
|
+
for (let j = 0; j < segments.length; j += 1) {
|
|
977
|
+
p.push(segments[j]);
|
|
978
|
+
const k = p.join("/");
|
|
979
|
+
if (!state[k]?.expanded) {
|
|
980
|
+
expanded = !1;
|
|
981
|
+
break;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
if (expanded)
|
|
985
|
+
return els[i];
|
|
986
|
+
}
|
|
987
|
+
return null;
|
|
988
|
+
}
|
|
989
|
+
function _focusItemElement(el) {
|
|
990
|
+
if (el.getAttribute("role") === "treeitem" && el.focus(), el.getAttribute("role") === "none") {
|
|
991
|
+
const firstChild = el.firstChild;
|
|
992
|
+
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
|
|
996
|
+
function Tree(props) {
|
|
997
|
+
const $ = compilerRuntime.c(39), t0 = props;
|
|
998
|
+
let children, forwardedRef, gap, onFocus, rest, t1;
|
|
999
|
+
$[0] !== t0 ? ({
|
|
1000
|
+
children,
|
|
1001
|
+
gap,
|
|
1002
|
+
space: t1,
|
|
1003
|
+
onFocus,
|
|
1004
|
+
ref: forwardedRef,
|
|
1005
|
+
...rest
|
|
1006
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = gap, $[4] = onFocus, $[5] = rest, $[6] = t1) : (children = $[1], forwardedRef = $[2], gap = $[3], onFocus = $[4], rest = $[5], t1 = $[6]);
|
|
1007
|
+
const space = t1 === void 0 ? 1 : t1, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
|
|
1008
|
+
let t2, t3;
|
|
1009
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
|
|
1010
|
+
const path = t2;
|
|
1011
|
+
let t4;
|
|
1012
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
|
|
1013
|
+
const [itemElements, setItemElements] = react.useState(t4);
|
|
1014
|
+
let t5;
|
|
1015
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
|
|
1016
|
+
const [state, setState] = react.useState(t5), stateRef = react.useRef(state);
|
|
1017
|
+
let t6;
|
|
1018
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], react.useImperativeHandle(forwardedRef, t6);
|
|
1019
|
+
let t7, t8;
|
|
1020
|
+
$[11] !== focusedElement ? (t7 = () => {
|
|
1021
|
+
focusedElementRef.current = focusedElement;
|
|
1022
|
+
}, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), react.useEffect(t7, t8);
|
|
1023
|
+
let t10, t9;
|
|
1024
|
+
$[14] !== state ? (t9 = () => {
|
|
1025
|
+
stateRef.current = state;
|
|
1026
|
+
}, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), react.useEffect(t9, t10);
|
|
1027
|
+
let t11;
|
|
1028
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
1029
|
+
...s,
|
|
1030
|
+
[path_0]: {
|
|
1031
|
+
element,
|
|
1032
|
+
expanded
|
|
1033
|
+
}
|
|
1034
|
+
})), selected && setFocusedElement(element), () => {
|
|
1035
|
+
setState((s_0) => {
|
|
1036
|
+
const newState = {
|
|
1037
|
+
...s_0
|
|
1038
|
+
};
|
|
1039
|
+
return delete newState[path_0], newState;
|
|
1040
|
+
});
|
|
1041
|
+
}), $[17] = t11) : t11 = $[17];
|
|
1042
|
+
const registerItem = t11;
|
|
1043
|
+
let t12;
|
|
1044
|
+
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
|
|
1045
|
+
setState((s_1) => {
|
|
1046
|
+
const itemState = s_1[path_1];
|
|
1047
|
+
return itemState ? {
|
|
1048
|
+
...s_1,
|
|
1049
|
+
[path_1]: {
|
|
1050
|
+
...itemState,
|
|
1051
|
+
expanded: expanded_0
|
|
1052
|
+
}
|
|
1053
|
+
} : s_1;
|
|
1054
|
+
});
|
|
1055
|
+
}, $[18] = t12) : t12 = $[18];
|
|
1056
|
+
const setExpanded = t12;
|
|
1057
|
+
let t13;
|
|
1058
|
+
const t14 = focusedElement || itemElements[0] || null;
|
|
1059
|
+
let t15;
|
|
1060
|
+
$[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
|
|
1061
|
+
version: 0,
|
|
1062
|
+
focusedElement: t14,
|
|
1063
|
+
level: 0,
|
|
1064
|
+
path,
|
|
1065
|
+
registerItem,
|
|
1066
|
+
setExpanded,
|
|
1067
|
+
setFocusedElement,
|
|
1068
|
+
space,
|
|
1069
|
+
state
|
|
1070
|
+
}, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
|
|
1071
|
+
const contextValue = t13;
|
|
1072
|
+
let t16;
|
|
1073
|
+
$[23] !== itemElements ? (t16 = (event) => {
|
|
1074
|
+
if (focusedElementRef.current) {
|
|
1075
|
+
if (event.key === "ArrowDown") {
|
|
1076
|
+
event.preventDefault();
|
|
1077
|
+
const nextEl = _findNextItemElement(stateRef.current, itemElements, focusedElementRef.current);
|
|
1078
|
+
nextEl && (_focusItemElement(nextEl), setFocusedElement(nextEl));
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
if (event.key === "ArrowUp") {
|
|
1082
|
+
event.preventDefault();
|
|
1083
|
+
const prevEl = _findPrevItemElement(stateRef.current, itemElements, focusedElementRef.current);
|
|
1084
|
+
prevEl && (_focusItemElement(prevEl), setFocusedElement(prevEl));
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
if (event.key === "ArrowLeft") {
|
|
1088
|
+
event.preventDefault();
|
|
1089
|
+
const itemKey = focusedElementRef.current.getAttribute("data-tree-key");
|
|
1090
|
+
if (!itemKey)
|
|
1091
|
+
return;
|
|
1092
|
+
const itemState_0 = stateRef.current[itemKey];
|
|
1093
|
+
if (!itemState_0)
|
|
1094
|
+
return;
|
|
1095
|
+
if (itemState_0.expanded)
|
|
1096
|
+
setState((s_2) => {
|
|
1097
|
+
const itemState_1 = s_2[itemKey];
|
|
1098
|
+
return itemState_1 ? {
|
|
1099
|
+
...s_2,
|
|
1100
|
+
[itemKey]: {
|
|
1101
|
+
...itemState_1,
|
|
1102
|
+
expanded: !1
|
|
1103
|
+
}
|
|
1104
|
+
} : s_2;
|
|
1105
|
+
});
|
|
1106
|
+
else {
|
|
1107
|
+
const itemPath = itemKey.split("/");
|
|
1108
|
+
itemPath.pop();
|
|
1109
|
+
const parentKey = itemPath.join("/"), parentState = parentKey && stateRef.current[parentKey];
|
|
1110
|
+
parentState && (parentState.element.focus(), setFocusedElement(parentState.element));
|
|
1111
|
+
}
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
if (event.key === "ArrowRight") {
|
|
1115
|
+
event.preventDefault();
|
|
1116
|
+
const focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
|
|
1117
|
+
if (!focusedKey)
|
|
1118
|
+
return;
|
|
1119
|
+
stateRef.current[focusedKey]?.expanded || setState((s_3) => {
|
|
1120
|
+
const itemState_2 = s_3[focusedKey];
|
|
1121
|
+
return itemState_2 ? {
|
|
1122
|
+
...s_3,
|
|
1123
|
+
[focusedKey]: {
|
|
1124
|
+
...itemState_2,
|
|
1125
|
+
expanded: !0
|
|
1126
|
+
}
|
|
1127
|
+
} : s_3;
|
|
1128
|
+
});
|
|
1129
|
+
return;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}, $[23] = itemElements, $[24] = t16) : t16 = $[24];
|
|
1133
|
+
const handleKeyDown = t16;
|
|
1134
|
+
let t17;
|
|
1135
|
+
$[25] !== onFocus ? (t17 = (event_0) => {
|
|
1136
|
+
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
1137
|
+
}, $[25] = onFocus, $[26] = t17) : t17 = $[26];
|
|
1138
|
+
const handleFocus = t17;
|
|
1139
|
+
let t18;
|
|
1140
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
|
|
1141
|
+
if (!ref.current)
|
|
1142
|
+
return;
|
|
1143
|
+
const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
|
|
1144
|
+
setItemElements(_itemElements);
|
|
1145
|
+
}, $[27] = t18) : t18 = $[27];
|
|
1146
|
+
let t19;
|
|
1147
|
+
$[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], react.useEffect(t18, t19);
|
|
1148
|
+
const t20 = gap ?? space;
|
|
1149
|
+
let t21;
|
|
1150
|
+
$[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...rest, gap: t20, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[30] = children, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20, $[35] = t21) : t21 = $[35];
|
|
1151
|
+
let t22;
|
|
1152
|
+
return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
|
|
1153
|
+
}
|
|
1154
|
+
function useTree() {
|
|
1155
|
+
const tree = react.useContext(TreeContext);
|
|
1156
|
+
if (!tree)
|
|
1157
|
+
throw new Error("Tree: missing context value");
|
|
1158
|
+
return tree;
|
|
1159
|
+
}
|
|
1160
|
+
const TreeGroup = react.memo(function(props) {
|
|
1161
|
+
const $ = compilerRuntime.c(9), t0 = props;
|
|
1162
|
+
let children, rest, t1;
|
|
1163
|
+
$[0] !== t0 ? ({
|
|
1164
|
+
children,
|
|
1165
|
+
expanded: t1,
|
|
1166
|
+
...rest
|
|
1167
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
|
|
1168
|
+
const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
|
|
1169
|
+
let t3;
|
|
1170
|
+
return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.space, role: "group", gap: tree.space, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.space, $[8] = t3) : t3 = $[8], t3;
|
|
1171
|
+
}), DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
1172
|
+
function TreeItem(props) {
|
|
1173
|
+
const {
|
|
1174
|
+
children,
|
|
1175
|
+
className,
|
|
1176
|
+
expanded: expandedProp = !1,
|
|
1177
|
+
fontSize = 1,
|
|
1178
|
+
href,
|
|
1179
|
+
icon: IconComponent,
|
|
1180
|
+
id: idProp,
|
|
1181
|
+
linkAs = "a",
|
|
1182
|
+
muted,
|
|
1183
|
+
onClick,
|
|
1184
|
+
padding = 2,
|
|
1185
|
+
radius = 2,
|
|
1186
|
+
selected = !1,
|
|
1187
|
+
space = 2,
|
|
1188
|
+
text,
|
|
1189
|
+
weight,
|
|
1190
|
+
...rest
|
|
1191
|
+
} = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), {
|
|
1192
|
+
path,
|
|
1193
|
+
registerItem,
|
|
1194
|
+
setExpanded,
|
|
1195
|
+
setFocusedElement
|
|
1196
|
+
} = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, focused = tree.focusedElement && tree.focusedElement === rootRef.current, tabIndex = focused ? 0 : -1, contextValue = react.useMemo(() => ({
|
|
1197
|
+
...tree,
|
|
1198
|
+
level: tree.level + 1,
|
|
1199
|
+
path: itemPath
|
|
1200
|
+
}), [itemPath, tree]), handleClick = react.useCallback((event) => {
|
|
1201
|
+
onClick && onClick(event);
|
|
1202
|
+
const target = event.target;
|
|
1203
|
+
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
|
|
1204
|
+
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = react.useCallback((event_0) => {
|
|
1205
|
+
focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
|
|
1206
|
+
}, [focused]);
|
|
1207
|
+
react.useEffect(() => {
|
|
1208
|
+
if (rootRef.current)
|
|
1209
|
+
return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
|
|
1210
|
+
}, [expanded, itemPath, registerItem, selected]);
|
|
1211
|
+
const content2 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { gap: space, padding, children: [
|
|
1212
|
+
/* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { style: {
|
|
1213
|
+
visibility: IconComponent || children ? "visible" : "hidden",
|
|
1214
|
+
pointerEvents: "none"
|
|
1215
|
+
}, children: [
|
|
1216
|
+
IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
|
|
1217
|
+
!IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
|
|
1218
|
+
transform: expanded ? "rotate(90deg)" : void 0
|
|
1219
|
+
} }) })
|
|
1220
|
+
] }),
|
|
1221
|
+
/* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
|
|
1222
|
+
] });
|
|
1223
|
+
return href ? /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: css.treeItem({
|
|
1224
|
+
className
|
|
1225
|
+
}), onClick: handleClick, ref: rootRef, role: "none", children: [
|
|
1226
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1227
|
+
_visualEditing.Selectable,
|
|
1228
|
+
{
|
|
1229
|
+
"aria-expanded": expanded,
|
|
1230
|
+
as: linkAs,
|
|
1231
|
+
"data-ui": "TreeItem__box",
|
|
1232
|
+
href,
|
|
1233
|
+
radius,
|
|
1234
|
+
ref: treeitemRef,
|
|
1235
|
+
role: "treeitem",
|
|
1236
|
+
selected,
|
|
1237
|
+
tabIndex,
|
|
1238
|
+
style: {
|
|
1239
|
+
paddingLeft: `calc(${css.vars.space[2]} * ${tree.level})`
|
|
1240
|
+
},
|
|
1241
|
+
children: content2
|
|
1242
|
+
}
|
|
1243
|
+
),
|
|
1244
|
+
/* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }) })
|
|
1245
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: css.treeItem({
|
|
1246
|
+
className
|
|
1247
|
+
}), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
|
|
1248
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1249
|
+
_visualEditing.Selectable,
|
|
1250
|
+
{
|
|
1251
|
+
as: "button",
|
|
1252
|
+
"data-focused": focused ? "" : void 0,
|
|
1253
|
+
"data-ui": "TreeItem__box",
|
|
1254
|
+
radius,
|
|
1255
|
+
selected,
|
|
1256
|
+
style: {
|
|
1257
|
+
paddingLeft: `calc(${css.vars.space[2]} * ${tree.level})`
|
|
1258
|
+
},
|
|
1259
|
+
children: content2
|
|
1260
|
+
}
|
|
1261
|
+
),
|
|
1262
|
+
/* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
|
|
1263
|
+
] });
|
|
1264
|
+
}
|
|
1265
|
+
function _isScrollable(el) {
|
|
1266
|
+
if (!(el instanceof Element)) return !1;
|
|
1267
|
+
const style = window.getComputedStyle(el);
|
|
1268
|
+
return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
|
|
1269
|
+
}
|
|
1270
|
+
const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : resizeObserver.ResizeObserver, DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
|
|
1271
|
+
function VirtualList(props) {
|
|
1272
|
+
const $ = compilerRuntime.c(61), t0 = props;
|
|
1273
|
+
let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
|
|
1274
|
+
$[0] !== t0 ? ({
|
|
1275
|
+
as: t1,
|
|
1276
|
+
gap: t2,
|
|
1277
|
+
getItemKey,
|
|
1278
|
+
items: t3,
|
|
1279
|
+
onChange,
|
|
1280
|
+
renderItem,
|
|
1281
|
+
ref: forwardedRef,
|
|
1282
|
+
...rest
|
|
1283
|
+
} = t0, $[0] = t0, $[1] = forwardedRef, $[2] = getItemKey, $[3] = onChange, $[4] = renderItem, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3) : (forwardedRef = $[1], getItemKey = $[2], onChange = $[3], renderItem = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8]);
|
|
1284
|
+
const as = t1 === void 0 ? DEFAULT_VIRTUAL_LIST_ELEMENT : t1, gap = t2 === void 0 ? 0 : t2;
|
|
1285
|
+
let t4;
|
|
1286
|
+
$[9] !== t3 ? (t4 = t3 === void 0 ? [] : t3, $[9] = t3, $[10] = t4) : t4 = $[10];
|
|
1287
|
+
const items = t4, ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1), [gapValue, setGapValue] = react.useState(0);
|
|
1288
|
+
let t5;
|
|
1289
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[11] = t5) : t5 = $[11], react.useImperativeHandle(forwardedRef, t5);
|
|
1290
|
+
let t6, t7;
|
|
1291
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => {
|
|
1292
|
+
if (!ref.current)
|
|
1293
|
+
return;
|
|
1294
|
+
const scrollEl = findScrollable(ref.current.parentNode);
|
|
1295
|
+
if (scrollEl) {
|
|
1296
|
+
if (!(scrollEl instanceof HTMLElement))
|
|
1297
|
+
return;
|
|
1298
|
+
const handleScroll = () => {
|
|
1299
|
+
setScrollTop(scrollEl.scrollTop);
|
|
1300
|
+
};
|
|
1301
|
+
scrollEl.addEventListener("scroll", handleScroll, {
|
|
1302
|
+
passive: !0
|
|
1303
|
+
});
|
|
1304
|
+
const ro = new _ResizeObserver((entries) => {
|
|
1305
|
+
setScrollHeight(entries[0].contentRect.height);
|
|
1306
|
+
});
|
|
1307
|
+
return ro.observe(scrollEl), handleScroll(), () => {
|
|
1308
|
+
scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
const handleScroll_0 = () => {
|
|
1312
|
+
setScrollTop(window.scrollY);
|
|
1313
|
+
}, handleResize = () => {
|
|
1314
|
+
setScrollHeight(window.innerHeight);
|
|
1315
|
+
};
|
|
1316
|
+
return window.addEventListener("scroll", handleScroll_0, {
|
|
1317
|
+
passive: !0
|
|
1318
|
+
}), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
|
|
1319
|
+
window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
|
|
1320
|
+
};
|
|
1321
|
+
}, t7 = [], $[12] = t6, $[13] = t7) : (t6 = $[12], t7 = $[13]), react.useEffect(t6, t7);
|
|
1322
|
+
const len = items.length, height = itemHeight ? len * (itemHeight + gapValue) - gapValue : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
|
|
1323
|
+
let t8, t9;
|
|
1324
|
+
$[14] !== fromIndex || $[15] !== gapValue || $[16] !== itemHeight || $[17] !== onChange || $[18] !== scrollHeight || $[19] !== scrollTop || $[20] !== toIndex ? (t8 = () => {
|
|
1325
|
+
onChange?.({
|
|
1326
|
+
fromIndex,
|
|
1327
|
+
gap: gapValue,
|
|
1328
|
+
itemHeight,
|
|
1329
|
+
scrollHeight,
|
|
1330
|
+
scrollTop,
|
|
1331
|
+
toIndex
|
|
1332
|
+
});
|
|
1333
|
+
}, t9 = [fromIndex, gapValue, itemHeight, onChange, scrollHeight, scrollTop, toIndex], $[14] = fromIndex, $[15] = gapValue, $[16] = itemHeight, $[17] = onChange, $[18] = scrollHeight, $[19] = scrollTop, $[20] = toIndex, $[21] = t8, $[22] = t9) : (t8 = $[21], t9 = $[22]), react.useEffect(t8, t9);
|
|
1334
|
+
let t10;
|
|
1335
|
+
$[23] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => {
|
|
1336
|
+
setItemHeight(-1);
|
|
1337
|
+
}, $[23] = t10) : t10 = $[23];
|
|
1338
|
+
let t11;
|
|
1339
|
+
$[24] !== renderItem ? (t11 = [renderItem], $[24] = renderItem, $[25] = t11) : t11 = $[25], react.useEffect(t10, t11);
|
|
1340
|
+
let t12;
|
|
1341
|
+
bb0: {
|
|
1342
|
+
if (!renderItem || items.length === 0) {
|
|
1343
|
+
t12 = null;
|
|
1344
|
+
break bb0;
|
|
1345
|
+
}
|
|
1346
|
+
if (itemHeight === -1) {
|
|
1347
|
+
let t133;
|
|
1348
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t133 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[26] = t133) : t133 = $[26];
|
|
1349
|
+
let t142;
|
|
1350
|
+
$[27] !== items[0] || $[28] !== renderItem ? (t142 = renderItem(items[0]), $[27] = items[0], $[28] = renderItem, $[29] = t142) : t142 = $[29];
|
|
1351
|
+
let t152;
|
|
1352
|
+
$[30] !== t142 ? (t152 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { ref: t133, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t142 }, 0), $[30] = t142, $[31] = t152) : t152 = $[31];
|
|
1353
|
+
let t162;
|
|
1354
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t162 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[32] = t162) : t162 = $[32];
|
|
1355
|
+
const t17 = css.vars.space[gap];
|
|
1356
|
+
let t18;
|
|
1357
|
+
$[33] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: t162, style: {
|
|
1358
|
+
height: t17
|
|
1359
|
+
} }), $[33] = t17, $[34] = t18) : t18 = $[34];
|
|
1360
|
+
let t19;
|
|
1361
|
+
$[35] !== t152 || $[36] !== t18 ? (t19 = [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1362
|
+
t152,
|
|
1363
|
+
t18
|
|
1364
|
+
] })], $[35] = t152, $[36] = t18, $[37] = t19) : t19 = $[37], t12 = t19;
|
|
1365
|
+
break bb0;
|
|
1366
|
+
}
|
|
1367
|
+
let t132;
|
|
1368
|
+
if ($[38] !== fromIndex || $[39] !== gapValue || $[40] !== getItemKey || $[41] !== itemHeight || $[42] !== items || $[43] !== renderItem || $[44] !== toIndex) {
|
|
1369
|
+
let t142;
|
|
1370
|
+
$[46] !== fromIndex || $[47] !== gapValue || $[48] !== getItemKey || $[49] !== itemHeight || $[50] !== renderItem ? (t142 = (item, _itemIndex) => {
|
|
1371
|
+
const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
1372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
|
|
1373
|
+
top: itemIndex * (itemHeight + gapValue)
|
|
1374
|
+
}, children: node }, key);
|
|
1375
|
+
}, $[46] = fromIndex, $[47] = gapValue, $[48] = getItemKey, $[49] = itemHeight, $[50] = renderItem, $[51] = t142) : t142 = $[51], t132 = items.slice(fromIndex, toIndex).map(t142), $[38] = fromIndex, $[39] = gapValue, $[40] = getItemKey, $[41] = itemHeight, $[42] = items, $[43] = renderItem, $[44] = toIndex, $[45] = t132;
|
|
1376
|
+
} else
|
|
1377
|
+
t132 = $[45];
|
|
1378
|
+
t12 = t132;
|
|
1379
|
+
}
|
|
1380
|
+
const children = t12;
|
|
1381
|
+
let t13, t14;
|
|
1382
|
+
$[52] !== height ? (t14 = {
|
|
1383
|
+
height
|
|
1384
|
+
}, $[52] = height, $[53] = t14) : t14 = $[53], t13 = t14;
|
|
1385
|
+
const wrapperStyle = t13;
|
|
1386
|
+
let t15;
|
|
1387
|
+
$[54] !== children || $[55] !== wrapperStyle ? (t15 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[54] = children, $[55] = wrapperStyle, $[56] = t15) : t15 = $[56];
|
|
1388
|
+
let t16;
|
|
1389
|
+
return $[57] !== as || $[58] !== rest || $[59] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t15 }), $[57] = as, $[58] = rest, $[59] = t15, $[60] = t16) : t16 = $[60], t16;
|
|
1390
|
+
}
|
|
1391
|
+
function findScrollable(parentNode) {
|
|
1392
|
+
let _scrollEl = parentNode;
|
|
1393
|
+
for (; _scrollEl && !_isScrollable(_scrollEl); )
|
|
1394
|
+
_scrollEl = _scrollEl.parentNode;
|
|
1395
|
+
return _scrollEl;
|
|
1396
|
+
}
|
|
1397
|
+
function useArrayProp(val, defaultVal) {
|
|
1398
|
+
const $ = compilerRuntime.c(3);
|
|
1399
|
+
let t0;
|
|
1400
|
+
$[0] !== defaultVal || $[1] !== val ? (t0 = () => [_visualEditing._getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
|
|
1401
|
+
const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
|
|
1402
|
+
return hash !== cachedHash && setCache([_visualEditing._getArrayProp(val, defaultVal), hash]), cachedVal;
|
|
1403
|
+
}
|
|
1404
|
+
function _getElements(element, elementsArg) {
|
|
1405
|
+
const ret = [element];
|
|
1406
|
+
for (const el of elementsArg)
|
|
1407
|
+
Array.isArray(el) ? ret.push(...el) : ret.push(el);
|
|
1408
|
+
return ret.filter(Boolean);
|
|
1409
|
+
}
|
|
1410
|
+
function useClickOutside(listener, t0, boundaryElement) {
|
|
1411
|
+
const $ = compilerRuntime.c(12), elementsArg = t0 === void 0 ? _visualEditing.EMPTY_ARRAY : t0, [element, setElement] = react.useState(null);
|
|
1412
|
+
let t1;
|
|
1413
|
+
$[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
|
|
1414
|
+
const [elements, setElements] = react.useState(t1), elementsRef = react.useRef(elements);
|
|
1415
|
+
let t2, t3;
|
|
1416
|
+
$[3] !== element || $[4] !== elementsArg ? (t2 = () => {
|
|
1417
|
+
const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
|
|
1418
|
+
if (prevElements.length !== nextElements.length) {
|
|
1419
|
+
setElements(nextElements), elementsRef.current = nextElements;
|
|
1420
|
+
return;
|
|
1421
|
+
}
|
|
1422
|
+
for (const el of prevElements)
|
|
1423
|
+
if (!nextElements.includes(el)) {
|
|
1424
|
+
setElements(nextElements), elementsRef.current = nextElements;
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
for (const el_0 of nextElements)
|
|
1428
|
+
if (!prevElements.includes(el_0)) {
|
|
1429
|
+
setElements(nextElements), elementsRef.current = nextElements;
|
|
1430
|
+
return;
|
|
1431
|
+
}
|
|
1432
|
+
}, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
|
|
1433
|
+
let t4, t5;
|
|
1434
|
+
return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
|
|
1435
|
+
if (!listener)
|
|
1436
|
+
return;
|
|
1437
|
+
const handleWindowMouseDown = (evt) => {
|
|
1438
|
+
const target = evt.target;
|
|
1439
|
+
if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
|
|
1440
|
+
for (const el_1 of elements)
|
|
1441
|
+
if (target === el_1 || el_1.contains(target))
|
|
1442
|
+
return;
|
|
1443
|
+
listener(evt);
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
return window.addEventListener("mousedown", handleWindowMouseDown), () => {
|
|
1447
|
+
window.removeEventListener("mousedown", handleWindowMouseDown);
|
|
1448
|
+
};
|
|
1449
|
+
}, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
|
|
1450
|
+
}
|
|
1451
|
+
const _elementSizeObserver = _createElementSizeObserver();
|
|
1452
|
+
function _createElementRectValueListener() {
|
|
1453
|
+
return {
|
|
1454
|
+
subscribe(element, subscriber) {
|
|
1455
|
+
const resizeObserver2 = new _ResizeObserver(([entry]) => {
|
|
1456
|
+
subscriber({
|
|
1457
|
+
_contentRect: entry.contentRect,
|
|
1458
|
+
border: {
|
|
1459
|
+
width: entry.borderBoxSize[0].inlineSize,
|
|
1460
|
+
height: entry.borderBoxSize[0].blockSize
|
|
1461
|
+
},
|
|
1462
|
+
content: {
|
|
1463
|
+
width: entry.contentRect.width,
|
|
1464
|
+
height: entry.contentRect.height
|
|
1465
|
+
}
|
|
1466
|
+
});
|
|
1467
|
+
});
|
|
1468
|
+
return resizeObserver2.observe(element), () => {
|
|
1469
|
+
resizeObserver2.unobserve(element), resizeObserver2.disconnect();
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
function _createElementSizeObserver() {
|
|
1475
|
+
const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
|
|
1476
|
+
return {
|
|
1477
|
+
subscribe(element, subscriber) {
|
|
1478
|
+
const subscribers = subscribersCache.get(element) || [];
|
|
1479
|
+
let dispose = disposeCache.get(element);
|
|
1480
|
+
return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
|
|
1481
|
+
for (const sub of subscribers)
|
|
1482
|
+
sub(elementRect);
|
|
1483
|
+
})), subscribers.push(subscriber), () => {
|
|
1484
|
+
const idx = subscribers.indexOf(subscriber);
|
|
1485
|
+
idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
function useElementSize(element) {
|
|
1491
|
+
const $ = compilerRuntime.c(3), [size, setSize] = react.useState(null);
|
|
1492
|
+
let t0, t1;
|
|
1493
|
+
return $[0] !== element ? (t0 = () => {
|
|
1494
|
+
if (element)
|
|
1495
|
+
return _elementSizeObserver.subscribe(element, setSize);
|
|
1496
|
+
}, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), react.useEffect(t0, t1), size;
|
|
1497
|
+
}
|
|
1498
|
+
function useElementRect(element) {
|
|
1499
|
+
return useElementSize(element)?._contentRect || null;
|
|
1500
|
+
}
|
|
1501
|
+
function useForwardedRef(ref) {
|
|
1502
|
+
const $ = compilerRuntime.c(1), innerRef = react.useRef(null);
|
|
1503
|
+
let t0;
|
|
1504
|
+
return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], react.useImperativeHandle(ref, t0), innerRef;
|
|
1505
|
+
}
|
|
1506
|
+
const DEFAULT_LABEL_ELEMENT = "div";
|
|
1507
|
+
function Label(props) {
|
|
1508
|
+
const $ = compilerRuntime.c(28);
|
|
1509
|
+
let accent, align, children, className, rest, t0, t1, t2, t3, textOverflowProp;
|
|
1510
|
+
$[0] !== props ? ({
|
|
1511
|
+
accent,
|
|
1512
|
+
align,
|
|
1513
|
+
as: t0,
|
|
1514
|
+
children,
|
|
1515
|
+
className,
|
|
1516
|
+
muted: t1,
|
|
1517
|
+
size: t2,
|
|
1518
|
+
textOverflow: textOverflowProp,
|
|
1519
|
+
weight: t3,
|
|
1520
|
+
...rest
|
|
1521
|
+
} = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = children, $[4] = className, $[5] = rest, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = textOverflowProp) : (accent = $[1], align = $[2], children = $[3], className = $[4], rest = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9], textOverflowProp = $[10]);
|
|
1522
|
+
const Element2 = t0 === void 0 ? DEFAULT_LABEL_ELEMENT : t0, muted = t1 === void 0 ? !1 : t1, size = t2 === void 0 ? 1 : t2, weight = t3 === void 0 ? "regular" : t3;
|
|
1523
|
+
let t4;
|
|
1524
|
+
$[11] !== accent || $[12] !== align || $[13] !== className || $[14] !== muted || $[15] !== size || $[16] !== weight ? (t4 = css.label({
|
|
1525
|
+
className,
|
|
1526
|
+
accent,
|
|
1527
|
+
align,
|
|
1528
|
+
muted,
|
|
1529
|
+
size,
|
|
1530
|
+
weight
|
|
1531
|
+
}), $[11] = accent, $[12] = align, $[13] = className, $[14] = muted, $[15] = size, $[16] = weight, $[17] = t4) : t4 = $[17];
|
|
1532
|
+
let t5;
|
|
1533
|
+
$[18] !== textOverflowProp ? (t5 = css.textOverflow({
|
|
1534
|
+
textOverflow: textOverflowProp
|
|
1535
|
+
}), $[18] = textOverflowProp, $[19] = t5) : t5 = $[19];
|
|
1536
|
+
let t6;
|
|
1537
|
+
$[20] !== children || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t5, children }), $[20] = children, $[21] = t5, $[22] = t6) : t6 = $[22];
|
|
1538
|
+
let t7;
|
|
1539
|
+
return $[23] !== Element2 || $[24] !== rest || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Label", ...rest, className: t4, children: t6 }), $[23] = Element2, $[24] = rest, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t7;
|
|
1540
|
+
}
|
|
1541
|
+
const DEFAULT_AVATAR_ELEMENT = "span";
|
|
1542
|
+
function Avatar(props) {
|
|
1543
|
+
const $ = compilerRuntime.c(51), t0 = props;
|
|
1544
|
+
let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, className, initials, onImageLoadError, rest, src, t1, t2, t3, t4, title;
|
|
1545
|
+
$[0] !== t0 ? ({
|
|
1546
|
+
__unstable_hideInnerStroke,
|
|
1547
|
+
as: t1,
|
|
1548
|
+
className,
|
|
1549
|
+
color: t2,
|
|
1550
|
+
src,
|
|
1551
|
+
title,
|
|
1552
|
+
initials,
|
|
1553
|
+
onImageLoadError,
|
|
1554
|
+
arrowPosition: arrowPositionProp,
|
|
1555
|
+
animateArrowFrom,
|
|
1556
|
+
status: t3,
|
|
1557
|
+
size: t4,
|
|
1558
|
+
...rest
|
|
1559
|
+
} = t0, $[0] = t0, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = className, $[5] = initials, $[6] = onImageLoadError, $[7] = rest, $[8] = src, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = t4, $[13] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], className = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], title = $[13]);
|
|
1560
|
+
const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t4 === void 0 ? 1 : t4, size = _visualEditing.useResponsiveProp(sizeProp), [arrowPosition, setArrowPosition] = react.useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = react.useState(!1);
|
|
1561
|
+
let t5, t6;
|
|
1562
|
+
$[14] !== arrowPosition || $[15] !== arrowPositionProp ? (t5 = () => {
|
|
1563
|
+
if (arrowPosition === arrowPositionProp)
|
|
1564
|
+
return;
|
|
1565
|
+
const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
|
|
1566
|
+
return () => cancelAnimationFrame(raf);
|
|
1567
|
+
}, t6 = [arrowPosition, arrowPositionProp], $[14] = arrowPosition, $[15] = arrowPositionProp, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), react.useEffect(t5, t6);
|
|
1568
|
+
let t7, t8;
|
|
1569
|
+
$[18] !== src ? (t7 = () => {
|
|
1570
|
+
src && setImageError(!1);
|
|
1571
|
+
}, t8 = [src], $[18] = src, $[19] = t7, $[20] = t8) : (t7 = $[19], t8 = $[20]), react.useEffect(t7, t8);
|
|
1572
|
+
let t9;
|
|
1573
|
+
$[21] !== onImageLoadError ? (t9 = () => {
|
|
1574
|
+
setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
1575
|
+
}, $[21] = onImageLoadError, $[22] = t9) : t9 = $[22];
|
|
1576
|
+
const handleImageError = t9;
|
|
1577
|
+
let t10, t11;
|
|
1578
|
+
$[23] !== size ? (t11 = Object.values(size).map(_temp$1), $[23] = size, $[24] = t11) : t11 = $[24], t10 = t11;
|
|
1579
|
+
const initialsSize = t10, t12 = __unstable_hideInnerStroke ? "" : void 0;
|
|
1580
|
+
let t13;
|
|
1581
|
+
$[25] !== className || $[26] !== color || $[27] !== sizeProp ? (t13 = css.avatar({
|
|
1582
|
+
className,
|
|
1583
|
+
color,
|
|
1584
|
+
size: sizeProp
|
|
1585
|
+
}), $[25] = className, $[26] = color, $[27] = sizeProp, $[28] = t13) : t13 = $[28];
|
|
1586
|
+
const t14 = imageError ? "" : void 0;
|
|
1587
|
+
let t15;
|
|
1588
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t15 = css.avatarArrow(), $[29] = t15) : t15 = $[29];
|
|
1589
|
+
let t16;
|
|
1590
|
+
$[30] !== color ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t15, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[30] = color, $[31] = t16) : t16 = $[31];
|
|
1591
|
+
let t17;
|
|
1592
|
+
$[32] === Symbol.for("react.memo_cache_sentinel") ? (t17 = css.avatarInitials(), $[32] = t17) : t17 = $[32];
|
|
1593
|
+
let t18;
|
|
1594
|
+
$[33] !== initials || $[34] !== initialsSize ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { alignItems: "center", as: "span", className: t17, display: "flex", justifyContent: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[33] = initials, $[34] = initialsSize, $[35] = t18) : t18 = $[35];
|
|
1595
|
+
let t19;
|
|
1596
|
+
$[36] !== handleImageError || $[37] !== initials || $[38] !== src ? (t19 = src && /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: css.avatarImage(), inset: 0, position: "absolute", children: [
|
|
1597
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { alt: initials, onError: handleImageError, src }),
|
|
1598
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: css.avatarImageOutline() })
|
|
1599
|
+
] }), $[36] = handleImageError, $[37] = initials, $[38] = src, $[39] = t19) : t19 = $[39];
|
|
1600
|
+
let t20;
|
|
1601
|
+
return $[40] !== Element2 || $[41] !== arrowPosition || $[42] !== rest || $[43] !== t12 || $[44] !== t13 || $[45] !== t14 || $[46] !== t16 || $[47] !== t18 || $[48] !== t19 || $[49] !== title ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(Element2, { "data-hide-inner-stroke": t12, "data-ui": "Avatar", ...rest, "aria-label": title, className: t13, "data-arrow-position": arrowPosition, "data-image-error": t14, title, children: [
|
|
1602
|
+
t16,
|
|
1603
|
+
t18,
|
|
1604
|
+
t19
|
|
1605
|
+
] }), $[40] = Element2, $[41] = arrowPosition, $[42] = rest, $[43] = t12, $[44] = t13, $[45] = t14, $[46] = t16, $[47] = t18, $[48] = t19, $[49] = title, $[50] = t20) : t20 = $[50], t20;
|
|
1606
|
+
}
|
|
1607
|
+
function _temp$1(s) {
|
|
1608
|
+
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
1609
|
+
}
|
|
1610
|
+
const DEFAULT_AVATAR_COUNTER_ELEMENT = "span";
|
|
1611
|
+
function AvatarCounter(props) {
|
|
1612
|
+
const $ = compilerRuntime.c(19), t0 = props;
|
|
1613
|
+
let className, count, rest, t1, t2;
|
|
1614
|
+
$[0] !== t0 ? ({
|
|
1615
|
+
as: t1,
|
|
1616
|
+
className,
|
|
1617
|
+
count,
|
|
1618
|
+
size: t2,
|
|
1619
|
+
...rest
|
|
1620
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = count, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], count = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
|
|
1621
|
+
const as = t1 === void 0 ? DEFAULT_AVATAR_COUNTER_ELEMENT : t1, size = _visualEditing.useResponsiveProp(t2 === void 0 ? 1 : t2);
|
|
1622
|
+
let t3, t4;
|
|
1623
|
+
$[6] !== size ? (t4 = Object.values(size).map(_temp), $[6] = size, $[7] = t4) : t4 = $[7], t3 = t4;
|
|
1624
|
+
const labelSize = t3;
|
|
1625
|
+
let t5;
|
|
1626
|
+
$[8] !== className || $[9] !== size ? (t5 = css.avatarCounter({
|
|
1627
|
+
className,
|
|
1628
|
+
size
|
|
1629
|
+
}), $[8] = className, $[9] = size, $[10] = t5) : t5 = $[10];
|
|
1630
|
+
let t6;
|
|
1631
|
+
$[11] !== count || $[12] !== labelSize ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(Label, { align: "center", as: "span", size: labelSize, weight: "medium", children: count }), $[11] = count, $[12] = labelSize, $[13] = t6) : t6 = $[13];
|
|
1632
|
+
let t7;
|
|
1633
|
+
return $[14] !== as || $[15] !== rest || $[16] !== t5 || $[17] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "AvatarCounter", ...rest, alignItems: "center", as, className: t5, display: "flex", flex: "none", justifyContent: "center", paddingX: 2, sizing: "border", children: t6 }), $[14] = as, $[15] = rest, $[16] = t5, $[17] = t6, $[18] = t7) : t7 = $[18], t7;
|
|
1634
|
+
}
|
|
1635
|
+
function _temp(s) {
|
|
1636
|
+
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
1637
|
+
}
|
|
1638
|
+
const DEFAULT_AVATAR_STACK_ELEMENT = "span";
|
|
1639
|
+
function AvatarStack(props) {
|
|
1640
|
+
const $ = compilerRuntime.c(20), t0 = props;
|
|
1641
|
+
let childrenProp, className, rest, t1, t2, t3;
|
|
1642
|
+
$[0] !== t0 ? ({
|
|
1643
|
+
as: t1,
|
|
1644
|
+
children: childrenProp,
|
|
1645
|
+
className,
|
|
1646
|
+
maxLength: t2,
|
|
1647
|
+
size: t3,
|
|
1648
|
+
...rest
|
|
1649
|
+
} = t0, $[0] = t0, $[1] = childrenProp, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3) : (childrenProp = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6]);
|
|
1650
|
+
const as = t1 === void 0 ? DEFAULT_AVATAR_STACK_ELEMENT : t1, maxLengthProp = t2 === void 0 ? 4 : t2, sizeProp = t3 === void 0 ? 1 : t3, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size = _visualEditing.useResponsiveProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = _visualEditing.Box, t4 = "AvatarStack", t5 = "center";
|
|
1651
|
+
let t6;
|
|
1652
|
+
$[7] !== className || $[8] !== size ? (t6 = css.avatarStack({
|
|
1653
|
+
className,
|
|
1654
|
+
size
|
|
1655
|
+
}), $[7] = className, $[8] = size, $[9] = t6) : t6 = $[9];
|
|
1656
|
+
const t7 = "flex", t8 = "flex-start", t9 = len === 0 && /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size }), t10 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size });
|
|
1657
|
+
let t11;
|
|
1658
|
+
$[10] !== size ? (t11 = (child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: react.cloneElement(child, {
|
|
1659
|
+
size
|
|
1660
|
+
}) }, String(childIndex)), $[10] = size, $[11] = t11) : t11 = $[11];
|
|
1661
|
+
const t12 = visibleChildren.map(t11);
|
|
1662
|
+
let t13;
|
|
1663
|
+
return $[12] !== T0 || $[13] !== as || $[14] !== rest || $[15] !== t10 || $[16] !== t12 || $[17] !== t6 || $[18] !== t9 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { "data-ui": t4, ...rest, alignItems: t5, as, className: t6, display: t7, justifyContent: t8, children: [
|
|
1664
|
+
t9,
|
|
1665
|
+
t10,
|
|
1666
|
+
t12
|
|
1667
|
+
] }), $[12] = T0, $[13] = as, $[14] = rest, $[15] = t10, $[16] = t12, $[17] = t6, $[18] = t9, $[19] = t13) : t13 = $[19], t13;
|
|
1668
|
+
}
|
|
1669
|
+
const DEFAULT_BADGE_ELEMENT = "span";
|
|
1670
|
+
function Badge(props) {
|
|
1671
|
+
const $ = compilerRuntime.c(22), t0 = props;
|
|
1672
|
+
let children, className, rest, t1, t2, t3, t4, t5;
|
|
1673
|
+
$[0] !== t0 ? ({
|
|
1674
|
+
as: t1,
|
|
1675
|
+
children,
|
|
1676
|
+
className,
|
|
1677
|
+
fontSize: t2,
|
|
1678
|
+
padding: t3,
|
|
1679
|
+
radius: t4,
|
|
1680
|
+
tone: t5,
|
|
1681
|
+
...rest
|
|
1682
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5) : (children = $[1], className = $[2], rest = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8]);
|
|
1683
|
+
const as = t1 === void 0 ? DEFAULT_BADGE_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, padding = t3 === void 0 ? 1 : t3, radius = t4 === void 0 ? 2 : t4, tone = t5 === void 0 ? "default" : t5;
|
|
1684
|
+
let t6;
|
|
1685
|
+
$[9] !== className || $[10] !== tone ? (t6 = css.badge({
|
|
1686
|
+
className,
|
|
1687
|
+
tone
|
|
1688
|
+
}), $[9] = className, $[10] = tone, $[11] = t6) : t6 = $[11];
|
|
1689
|
+
let t7;
|
|
1690
|
+
$[12] !== children || $[13] !== fontSize ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, children }), $[12] = children, $[13] = fontSize, $[14] = t7) : t7 = $[14];
|
|
1691
|
+
let t8;
|
|
1692
|
+
return $[15] !== as || $[16] !== padding || $[17] !== radius || $[18] !== rest || $[19] !== t6 || $[20] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Badge", ...rest, as, className: t6, display: "flex", maxWidth: "fill", padding, radius, width: "min", children: t7 }), $[15] = as, $[16] = padding, $[17] = radius, $[18] = rest, $[19] = t6, $[20] = t7, $[21] = t8) : t8 = $[21], t8;
|
|
1693
|
+
}
|
|
1694
|
+
const DEFAULT_CHECKBOX_ELEMENT = "input";
|
|
1695
|
+
function Checkbox(props) {
|
|
1696
|
+
const $ = compilerRuntime.c(29), t0 = props;
|
|
1697
|
+
let className, customValidity, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
|
|
1698
|
+
$[0] !== t0 ? ({
|
|
1699
|
+
as: t1,
|
|
1700
|
+
className,
|
|
1701
|
+
disabled,
|
|
1702
|
+
indeterminate,
|
|
1703
|
+
customValidity,
|
|
1704
|
+
readOnly,
|
|
1705
|
+
ref: forwardedRef,
|
|
1706
|
+
style,
|
|
1707
|
+
...rest
|
|
1708
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = indeterminate, $[6] = readOnly, $[7] = rest, $[8] = style, $[9] = t1) : (className = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], indeterminate = $[5], readOnly = $[6], rest = $[7], style = $[8], t1 = $[9]);
|
|
1709
|
+
const Element2 = t1 === void 0 ? DEFAULT_CHECKBOX_ELEMENT : t1, ref = react.useRef(null);
|
|
1710
|
+
let t2;
|
|
1711
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[10] = t2) : t2 = $[10], react.useImperativeHandle(forwardedRef, t2);
|
|
1712
|
+
let t3, t4;
|
|
1713
|
+
$[11] !== indeterminate ? (t3 = () => {
|
|
1714
|
+
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
1715
|
+
}, t4 = [indeterminate], $[11] = indeterminate, $[12] = t3, $[13] = t4) : (t3 = $[12], t4 = $[13]), react.useEffect(t3, t4), _visualEditing.useCustomValidity(ref, customValidity);
|
|
1716
|
+
let t5;
|
|
1717
|
+
$[14] !== className ? (t5 = css.checkbox({
|
|
1718
|
+
className
|
|
1719
|
+
}), $[14] = className, $[15] = t5) : t5 = $[15];
|
|
1720
|
+
let t6;
|
|
1721
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t6 = css.checkboxInput(), $[16] = t6) : t6 = $[16];
|
|
1722
|
+
const t7 = customValidity ? "" : void 0, t8 = !disabled && readOnly ? "" : void 0, t9 = disabled || readOnly;
|
|
1723
|
+
let t10;
|
|
1724
|
+
$[17] !== Element2 || $[18] !== readOnly || $[19] !== rest || $[20] !== t7 || $[21] !== t8 || $[22] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t6, "data-invalid": t7, "data-read-only": t8, disabled: t9, type: "checkbox", readOnly, ref }), $[17] = Element2, $[18] = readOnly, $[19] = rest, $[20] = t7, $[21] = t8, $[22] = t9, $[23] = t10) : t10 = $[23];
|
|
1725
|
+
let t11;
|
|
1726
|
+
$[24] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: css.checkboxPresentation(), children: [
|
|
1727
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckmarkIcon, {}),
|
|
1728
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.RemoveIcon, {})
|
|
1729
|
+
] }), $[24] = t11) : t11 = $[24];
|
|
1730
|
+
let t12;
|
|
1731
|
+
return $[25] !== style || $[26] !== t10 || $[27] !== t5 ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t5, "data-ui": "Checkbox", style, children: [
|
|
1732
|
+
t10,
|
|
1733
|
+
t11
|
|
1734
|
+
] }), $[25] = style, $[26] = t10, $[27] = t5, $[28] = t12) : t12 = $[28], t12;
|
|
1735
|
+
}
|
|
1736
|
+
const LazyRefractor = react.lazy(() => Promise.resolve().then(function() {
|
|
1737
|
+
return require("./_chunks-cjs/refractor.cjs");
|
|
1738
|
+
})), DEFAULT_CODE_ELEMENT = "pre";
|
|
1739
|
+
function Code(props) {
|
|
1740
|
+
const $ = compilerRuntime.c(25), t0 = props;
|
|
1741
|
+
let children, className, languageProp, rest, t1, t2, t3;
|
|
1742
|
+
$[0] !== t0 ? ({
|
|
1743
|
+
as: t1,
|
|
1744
|
+
children,
|
|
1745
|
+
className,
|
|
1746
|
+
language: languageProp,
|
|
1747
|
+
size: t2,
|
|
1748
|
+
weight: t3,
|
|
1749
|
+
...rest
|
|
1750
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = rest, $[5] = t1, $[6] = t2, $[7] = t3) : (children = $[1], className = $[2], languageProp = $[3], rest = $[4], t1 = $[5], t2 = $[6], t3 = $[7]);
|
|
1751
|
+
const Element2 = t1 === void 0 ? DEFAULT_CODE_ELEMENT : t1, size = t2 === void 0 ? 2 : t2, weight = t3 === void 0 ? "regular" : t3, language = typeof languageProp == "string" ? languageProp : void 0;
|
|
1752
|
+
let t4;
|
|
1753
|
+
$[8] !== className || $[9] !== size || $[10] !== weight ? (t4 = css.code({
|
|
1754
|
+
className,
|
|
1755
|
+
size,
|
|
1756
|
+
weight
|
|
1757
|
+
}), $[8] = className, $[9] = size, $[10] = weight, $[11] = t4) : t4 = $[11];
|
|
1758
|
+
let t5;
|
|
1759
|
+
$[12] !== children ? (t5 = /* @__PURE__ */ jsxRuntime.jsx("code", { children }), $[12] = children, $[13] = t5) : t5 = $[13];
|
|
1760
|
+
let t6;
|
|
1761
|
+
$[14] !== children || $[15] !== language ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(LazyRefractor, { language, value: children }), $[14] = children, $[15] = language, $[16] = t6) : t6 = $[16];
|
|
1762
|
+
let t7;
|
|
1763
|
+
$[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: t5, children: t6 }), $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19];
|
|
1764
|
+
let t8;
|
|
1765
|
+
return $[20] !== Element2 || $[21] !== rest || $[22] !== t4 || $[23] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Code", ...rest, className: t4, children: t7 }), $[20] = Element2, $[21] = rest, $[22] = t4, $[23] = t7, $[24] = t8) : t8 = $[24], t8;
|
|
1766
|
+
}
|
|
1767
|
+
const DEFAULT_HEADING_ELEMENT = "div";
|
|
1768
|
+
function Heading(props) {
|
|
1769
|
+
const $ = compilerRuntime.c(30), t0 = props;
|
|
1770
|
+
let align, children, className, flex, rest, t1, t2, t3, t4, t5, textOverflowProp;
|
|
1771
|
+
$[0] !== t0 ? ({
|
|
1772
|
+
accent: t1,
|
|
1773
|
+
align,
|
|
1774
|
+
as: t2,
|
|
1775
|
+
children,
|
|
1776
|
+
className,
|
|
1777
|
+
flex,
|
|
1778
|
+
muted: t3,
|
|
1779
|
+
size: t4,
|
|
1780
|
+
textOverflow: textOverflowProp,
|
|
1781
|
+
weight: t5,
|
|
1782
|
+
...rest
|
|
1783
|
+
} = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3, $[9] = t4, $[10] = t5, $[11] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8], t4 = $[9], t5 = $[10], textOverflowProp = $[11]);
|
|
1784
|
+
const accent = t1 === void 0 ? !1 : t1, Element2 = t2 === void 0 ? DEFAULT_HEADING_ELEMENT : t2, muted = t3 === void 0 ? !1 : t3, size = t4 === void 0 ? 2 : t4, weight = t5 === void 0 ? "regular" : t5;
|
|
1785
|
+
let t6;
|
|
1786
|
+
$[12] !== accent || $[13] !== align || $[14] !== className || $[15] !== flex || $[16] !== muted || $[17] !== size || $[18] !== weight ? (t6 = css.heading({
|
|
1787
|
+
className,
|
|
1788
|
+
accent,
|
|
1789
|
+
align,
|
|
1790
|
+
flex,
|
|
1791
|
+
muted,
|
|
1792
|
+
size,
|
|
1793
|
+
weight
|
|
1794
|
+
}), $[12] = accent, $[13] = align, $[14] = className, $[15] = flex, $[16] = muted, $[17] = size, $[18] = weight, $[19] = t6) : t6 = $[19];
|
|
1795
|
+
let t7;
|
|
1796
|
+
$[20] !== textOverflowProp ? (t7 = css.textOverflow({
|
|
1797
|
+
textOverflow: textOverflowProp
|
|
1798
|
+
}), $[20] = textOverflowProp, $[21] = t7) : t7 = $[21];
|
|
1799
|
+
let t8;
|
|
1800
|
+
$[22] !== children || $[23] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t7, children }), $[22] = children, $[23] = t7, $[24] = t8) : t8 = $[24];
|
|
1801
|
+
let t9;
|
|
1802
|
+
return $[25] !== Element2 || $[26] !== rest || $[27] !== t6 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "Heading", ...rest, className: t6, children: t8 }), $[25] = Element2, $[26] = rest, $[27] = t6, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
|
|
1803
|
+
}
|
|
1804
|
+
const DEFAULT_INLINE_ELEMENT = "div";
|
|
1805
|
+
function Inline(props) {
|
|
1806
|
+
const $ = compilerRuntime.c(11), t0 = props;
|
|
1807
|
+
let children, gap, rest, space, t1;
|
|
1808
|
+
$[0] !== t0 ? ({
|
|
1809
|
+
as: t1,
|
|
1810
|
+
children,
|
|
1811
|
+
gap,
|
|
1812
|
+
space,
|
|
1813
|
+
...rest
|
|
1814
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = gap, $[3] = rest, $[4] = space, $[5] = t1) : (children = $[1], gap = $[2], rest = $[3], space = $[4], t1 = $[5]);
|
|
1815
|
+
const as = t1 === void 0 ? DEFAULT_INLINE_ELEMENT : t1, t2 = gap ?? space;
|
|
1816
|
+
let t3;
|
|
1817
|
+
return $[6] !== as || $[7] !== children || $[8] !== rest || $[9] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Inline", ...rest, alignItems: "center", as, display: "flex", gap: t2, flexWrap: "wrap", children }), $[6] = as, $[7] = children, $[8] = rest, $[9] = t2, $[10] = t3) : t3 = $[10], t3;
|
|
1818
|
+
}
|
|
1819
|
+
const DEFAULT_RADIO_ELEMENT = "input";
|
|
1820
|
+
function Radio(props) {
|
|
1821
|
+
const $ = compilerRuntime.c(25), t0 = props;
|
|
1822
|
+
let className, customValidity, disabled, forwardedRef, readOnly, rest, style, t1;
|
|
1823
|
+
$[0] !== t0 ? ({
|
|
1824
|
+
as: t1,
|
|
1825
|
+
className,
|
|
1826
|
+
disabled,
|
|
1827
|
+
style,
|
|
1828
|
+
customValidity,
|
|
1829
|
+
readOnly,
|
|
1830
|
+
ref: forwardedRef,
|
|
1831
|
+
...rest
|
|
1832
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = readOnly, $[6] = rest, $[7] = style, $[8] = t1) : (className = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], readOnly = $[5], rest = $[6], style = $[7], t1 = $[8]);
|
|
1833
|
+
const Element2 = t1 === void 0 ? DEFAULT_RADIO_ELEMENT : t1, ref = react.useRef(null);
|
|
1834
|
+
let t2;
|
|
1835
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[9] = t2) : t2 = $[9], react.useImperativeHandle(forwardedRef, t2), _visualEditing.useCustomValidity(ref, customValidity);
|
|
1836
|
+
let t3;
|
|
1837
|
+
$[10] !== className ? (t3 = css.radio({
|
|
1838
|
+
className
|
|
1839
|
+
}), $[10] = className, $[11] = t3) : t3 = $[11];
|
|
1840
|
+
let t4;
|
|
1841
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = css.radioInput(), $[12] = t4) : t4 = $[12];
|
|
1842
|
+
const t5 = customValidity ? "" : void 0, t6 = !disabled && readOnly ? "" : void 0, t7 = disabled || readOnly;
|
|
1843
|
+
let t8;
|
|
1844
|
+
$[13] !== Element2 || $[14] !== readOnly || $[15] !== rest || $[16] !== t5 || $[17] !== t6 || $[18] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t4, "data-invalid": t5, "data-read-only": t6, disabled: t7, readOnly, ref, type: "radio" }), $[13] = Element2, $[14] = readOnly, $[15] = rest, $[16] = t5, $[17] = t6, $[18] = t7, $[19] = t8) : t8 = $[19];
|
|
1845
|
+
let t9;
|
|
1846
|
+
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: css.radioPresentation() }), $[20] = t9) : t9 = $[20];
|
|
1847
|
+
let t10;
|
|
1848
|
+
return $[21] !== style || $[22] !== t3 || $[23] !== t8 ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t3, "data-ui": "Radio", style, children: [
|
|
1849
|
+
t8,
|
|
1850
|
+
t9
|
|
1851
|
+
] }), $[21] = style, $[22] = t3, $[23] = t8, $[24] = t10) : t10 = $[24], t10;
|
|
1852
|
+
}
|
|
1853
|
+
function BoundaryElementProvider(props) {
|
|
1854
|
+
const $ = compilerRuntime.c(5), {
|
|
1855
|
+
children,
|
|
1856
|
+
element
|
|
1857
|
+
} = props;
|
|
1858
|
+
let t0, t1;
|
|
1859
|
+
$[0] !== element ? (t1 = {
|
|
1860
|
+
version: 0,
|
|
1861
|
+
element
|
|
1862
|
+
}, $[0] = element, $[1] = t1) : t1 = $[1], t0 = t1;
|
|
1863
|
+
const value = t0;
|
|
1864
|
+
let t2;
|
|
1865
|
+
return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
|
|
1866
|
+
}
|
|
1867
|
+
function RootProvider(props) {
|
|
1868
|
+
const $ = compilerRuntime.c(10), {
|
|
1869
|
+
boundaryElement: t0,
|
|
1870
|
+
children,
|
|
1871
|
+
portalElement: t1,
|
|
1872
|
+
scheme: t2,
|
|
1873
|
+
tone: t3
|
|
1874
|
+
} = props, boundaryElement = t0 === void 0 ? null : t0, portalElement = t1 === void 0 ? null : t1, scheme = t2 === void 0 ? "light" : t2, tone = t3 === void 0 ? "transparent" : t3;
|
|
1875
|
+
let t4;
|
|
1876
|
+
$[0] !== children || $[1] !== portalElement ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.PortalProvider, { element: portalElement, children }), $[0] = children, $[1] = portalElement, $[2] = t4) : t4 = $[2];
|
|
1877
|
+
let t5;
|
|
1878
|
+
$[3] !== boundaryElement || $[4] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(ToastProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(BoundaryElementProvider, { element: boundaryElement, children: t4 }) }), $[3] = boundaryElement, $[4] = t4, $[5] = t5) : t5 = $[5];
|
|
1879
|
+
let t6;
|
|
1880
|
+
return $[6] !== scheme || $[7] !== t5 || $[8] !== tone ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.CardProvider, { scheme, tone, children: t5 }) }), $[6] = scheme, $[7] = t5, $[8] = tone, $[9] = t6) : t6 = $[9], t6;
|
|
1881
|
+
}
|
|
1882
|
+
const DEFAULT_ROOT_ELEMENT = "html";
|
|
1883
|
+
function Root(props) {
|
|
1884
|
+
const $ = compilerRuntime.c(33), t0 = props;
|
|
1885
|
+
let children, className, forwardedRef, rest, t1, t2, t3, t4;
|
|
1886
|
+
$[0] !== t0 ? ({
|
|
1887
|
+
as: t1,
|
|
1888
|
+
children,
|
|
1889
|
+
className,
|
|
1890
|
+
height: t2,
|
|
1891
|
+
ref: forwardedRef,
|
|
1892
|
+
scheme: t3,
|
|
1893
|
+
tone: t4,
|
|
1894
|
+
...rest
|
|
1895
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = forwardedRef, $[4] = rest, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4) : (children = $[1], className = $[2], forwardedRef = $[3], rest = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8]);
|
|
1896
|
+
const as = t1 === void 0 ? DEFAULT_ROOT_ELEMENT : t1, height = t2 === void 0 ? "fill" : t2, scheme = t3 === void 0 ? "light" : t3, tone = t4 === void 0 ? "transparent" : t4, ref = react.useRef(null);
|
|
1897
|
+
let t5;
|
|
1898
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], react.useImperativeHandle(forwardedRef, t5);
|
|
1899
|
+
const [portalElement, setPortalElement] = react.useState(null), [boundaryElement, setBoundaryElement] = react.useState(null);
|
|
1900
|
+
let t6;
|
|
1901
|
+
$[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = (el) => {
|
|
1902
|
+
setBoundaryElement(el), ref.current = el;
|
|
1903
|
+
}, $[10] = t6) : t6 = $[10];
|
|
1904
|
+
const handleRef = t6;
|
|
1905
|
+
let t7;
|
|
1906
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { "data-portal": "", ref: setPortalElement }), $[11] = t7) : t7 = $[11];
|
|
1907
|
+
let t8;
|
|
1908
|
+
$[12] !== boundaryElement || $[13] !== children || $[14] !== portalElement || $[15] !== scheme || $[16] !== tone ? (t8 = /* @__PURE__ */ jsxRuntime.jsxs(RootProvider, { boundaryElement, portalElement, scheme, tone, children: [
|
|
1909
|
+
children,
|
|
1910
|
+
t7
|
|
1911
|
+
] }), $[12] = boundaryElement, $[13] = children, $[14] = portalElement, $[15] = scheme, $[16] = tone, $[17] = t8) : t8 = $[17];
|
|
1912
|
+
let node = t8;
|
|
1913
|
+
if (as === "html") {
|
|
1914
|
+
let t92;
|
|
1915
|
+
$[18] !== height ? (t92 = css.box({
|
|
1916
|
+
height,
|
|
1917
|
+
margin: 0
|
|
1918
|
+
}), $[18] = height, $[19] = t92) : t92 = $[19];
|
|
1919
|
+
let t102;
|
|
1920
|
+
$[20] !== node || $[21] !== t92 ? (t102 = /* @__PURE__ */ jsxRuntime.jsx("body", { className: t92, children: node }), $[20] = node, $[21] = t92, $[22] = t102) : t102 = $[22], node = t102;
|
|
1921
|
+
}
|
|
1922
|
+
let t9;
|
|
1923
|
+
$[23] !== className || $[24] !== height || $[25] !== scheme || $[26] !== tone ? (t9 = css.root({
|
|
1924
|
+
className,
|
|
1925
|
+
height,
|
|
1926
|
+
scheme,
|
|
1927
|
+
tone
|
|
1928
|
+
}), $[23] = className, $[24] = height, $[25] = scheme, $[26] = tone, $[27] = t9) : t9 = $[27];
|
|
1929
|
+
let t10;
|
|
1930
|
+
return $[28] !== as || $[29] !== node || $[30] !== rest || $[31] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as, "data-ui": "Root", ...rest, className: t9, ref: handleRef, children: node }), $[28] = as, $[29] = node, $[30] = rest, $[31] = t9, $[32] = t10) : t10 = $[32], t10;
|
|
1931
|
+
}
|
|
1932
|
+
const DEFAULT_SELECT_ELEMENT = "select";
|
|
1933
|
+
function Select(props) {
|
|
1934
|
+
const $ = compilerRuntime.c(38), t0 = props;
|
|
1935
|
+
let children, customValidity, disabled, forwardedRef, gap, readOnly, rest, t1, t2, t3, t4, t5, t6;
|
|
1936
|
+
$[0] !== t0 ? ({
|
|
1937
|
+
as: t1,
|
|
1938
|
+
border: t2,
|
|
1939
|
+
children,
|
|
1940
|
+
customValidity,
|
|
1941
|
+
disabled,
|
|
1942
|
+
fontSize: t3,
|
|
1943
|
+
gap,
|
|
1944
|
+
padding: t4,
|
|
1945
|
+
radius: t5,
|
|
1946
|
+
readOnly,
|
|
1947
|
+
ref: forwardedRef,
|
|
1948
|
+
space: t6,
|
|
1949
|
+
...rest
|
|
1950
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = forwardedRef, $[5] = gap, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6) : (children = $[1], customValidity = $[2], disabled = $[3], forwardedRef = $[4], gap = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13]);
|
|
1951
|
+
const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 1 : t5, space = t6 === void 0 ? 2 : t6, ref = react.useRef(null);
|
|
1952
|
+
let t7;
|
|
1953
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[14] = t7) : t7 = $[14], react.useImperativeHandle(forwardedRef, t7), _visualEditing.useCustomValidity(ref, customValidity);
|
|
1954
|
+
const t8 = gap ?? space;
|
|
1955
|
+
let t9;
|
|
1956
|
+
$[15] !== border || $[16] !== fontSize || $[17] !== padding || $[18] !== radius || $[19] !== t8 ? (t9 = css.select({
|
|
1957
|
+
border,
|
|
1958
|
+
fontSize,
|
|
1959
|
+
padding,
|
|
1960
|
+
radius,
|
|
1961
|
+
gap: t8
|
|
1962
|
+
}), $[15] = border, $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t8, $[20] = t9) : t9 = $[20];
|
|
1963
|
+
let t10;
|
|
1964
|
+
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css._inputElement(), $[21] = t10) : t10 = $[21];
|
|
1965
|
+
const t11 = disabled || readOnly;
|
|
1966
|
+
let t12;
|
|
1967
|
+
$[22] !== Element2 || $[23] !== children || $[24] !== rest || $[25] !== t11 ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t10, disabled: t11, ref, children }), $[22] = Element2, $[23] = children, $[24] = rest, $[25] = t11, $[26] = t12) : t12 = $[26];
|
|
1968
|
+
let t13;
|
|
1969
|
+
$[27] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.selectPresentation(), $[27] = t13) : t13 = $[27];
|
|
1970
|
+
let t14;
|
|
1971
|
+
$[28] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}), $[28] = t14) : t14 = $[28];
|
|
1972
|
+
let t15;
|
|
1973
|
+
$[29] !== fontSize ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, children: t14 }), $[29] = fontSize, $[30] = t15) : t15 = $[30];
|
|
1974
|
+
let t16;
|
|
1975
|
+
$[31] !== padding || $[32] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: t13, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "span", display: "inline-block", padding, children: t15 }) }), $[31] = padding, $[32] = t15, $[33] = t16) : t16 = $[33];
|
|
1976
|
+
let t17;
|
|
1977
|
+
return $[34] !== t12 || $[35] !== t16 || $[36] !== t9 ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Select", className: t9, "data-icon-right": "", children: [
|
|
1978
|
+
t12,
|
|
1979
|
+
t16
|
|
1980
|
+
] }), $[34] = t12, $[35] = t16, $[36] = t9, $[37] = t17) : t17 = $[37], t17;
|
|
1981
|
+
}
|
|
1982
|
+
const DEFAULT_SKELETON_ELEMENT = "div";
|
|
1983
|
+
function Skeleton(props) {
|
|
1984
|
+
const $ = compilerRuntime.c(19), t0 = props;
|
|
1985
|
+
let className, delay, radius, rest, t1, t2;
|
|
1986
|
+
$[0] !== t0 ? ({
|
|
1987
|
+
as: t1,
|
|
1988
|
+
animated: t2,
|
|
1989
|
+
className,
|
|
1990
|
+
delay,
|
|
1991
|
+
radius,
|
|
1992
|
+
...rest
|
|
1993
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1, $[6] = t2) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5], t2 = $[6]);
|
|
1994
|
+
const As = t1 === void 0 ? DEFAULT_SKELETON_ELEMENT : t1, animated = t2 === void 0 ? !1 : t2, [visible, setVisible] = react.useState(!delay);
|
|
1995
|
+
let t3, t4;
|
|
1996
|
+
$[7] !== delay ? (t3 = () => {
|
|
1997
|
+
if (!delay)
|
|
1998
|
+
return setVisible(!0);
|
|
1999
|
+
const timeout = setTimeout(() => {
|
|
2000
|
+
setVisible(!0);
|
|
2001
|
+
}, delay);
|
|
2002
|
+
return () => {
|
|
2003
|
+
clearTimeout(timeout);
|
|
2004
|
+
};
|
|
2005
|
+
}, t4 = [delay], $[7] = delay, $[8] = t3, $[9] = t4) : (t3 = $[8], t4 = $[9]), react.useEffect(t3, t4);
|
|
2006
|
+
let t5;
|
|
2007
|
+
$[10] !== className || $[11] !== radius ? (t5 = css.skeleton({
|
|
2008
|
+
className,
|
|
2009
|
+
radius
|
|
2010
|
+
}), $[10] = className, $[11] = radius, $[12] = t5) : t5 = $[12];
|
|
2011
|
+
const t6 = animated ? "" : void 0, t7 = visible ? "" : void 0;
|
|
2012
|
+
let t8;
|
|
2013
|
+
return $[13] !== As || $[14] !== rest || $[15] !== t5 || $[16] !== t6 || $[17] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(As, { "data-ui": "Skeleton", ...rest, className: t5, "data-animated": t6, "data-visible": t7 }), $[13] = As, $[14] = rest, $[15] = t5, $[16] = t6, $[17] = t7, $[18] = t8) : t8 = $[18], t8;
|
|
2014
|
+
}
|
|
2015
|
+
const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
2016
|
+
function CodeSkeleton(props) {
|
|
2017
|
+
const $ = compilerRuntime.c(10), t0 = props;
|
|
2018
|
+
let className, rest, t1;
|
|
2019
|
+
$[0] !== t0 ? ({
|
|
2020
|
+
className,
|
|
2021
|
+
size: t1,
|
|
2022
|
+
...rest
|
|
2023
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
2024
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
2025
|
+
let t2;
|
|
2026
|
+
$[4] !== className || $[5] !== size ? (t2 = css.codeSkeleton({
|
|
2027
|
+
className,
|
|
2028
|
+
size
|
|
2029
|
+
}), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
2030
|
+
let t3;
|
|
2031
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
2032
|
+
}
|
|
2033
|
+
const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
|
|
2034
|
+
function HeadingSkeleton(props) {
|
|
2035
|
+
const $ = compilerRuntime.c(10), t0 = props;
|
|
2036
|
+
let className, rest, t1;
|
|
2037
|
+
$[0] !== t0 ? ({
|
|
2038
|
+
className,
|
|
2039
|
+
size: t1,
|
|
2040
|
+
...rest
|
|
2041
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
2042
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
2043
|
+
let t2;
|
|
2044
|
+
$[4] !== className || $[5] !== size ? (t2 = css.headingSkeleton({
|
|
2045
|
+
className,
|
|
2046
|
+
size
|
|
2047
|
+
}), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
2048
|
+
let t3;
|
|
2049
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
2050
|
+
}
|
|
2051
|
+
const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
|
|
2052
|
+
function LabelSkeleton(props) {
|
|
2053
|
+
const $ = compilerRuntime.c(10), t0 = props;
|
|
2054
|
+
let className, rest, t1;
|
|
2055
|
+
$[0] !== t0 ? ({
|
|
2056
|
+
className,
|
|
2057
|
+
size: t1,
|
|
2058
|
+
...rest
|
|
2059
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
2060
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
2061
|
+
let t2;
|
|
2062
|
+
$[4] !== className || $[5] !== size ? (t2 = css.labelSkeleton({
|
|
2063
|
+
className,
|
|
2064
|
+
size
|
|
2065
|
+
}), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
2066
|
+
let t3;
|
|
2067
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
2068
|
+
}
|
|
2069
|
+
const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
|
|
2070
|
+
function TextSkeleton(props) {
|
|
2071
|
+
const $ = compilerRuntime.c(10), t0 = props;
|
|
2072
|
+
let className, rest, t1;
|
|
2073
|
+
$[0] !== t0 ? ({
|
|
2074
|
+
className,
|
|
2075
|
+
size: t1,
|
|
2076
|
+
...rest
|
|
2077
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
|
|
2078
|
+
const size = t1 === void 0 ? 2 : t1;
|
|
2079
|
+
let t2;
|
|
2080
|
+
$[4] !== className || $[5] !== size ? (t2 = css.textSkeleton({
|
|
2081
|
+
className,
|
|
2082
|
+
size
|
|
2083
|
+
}), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
|
|
2084
|
+
let t3;
|
|
2085
|
+
return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
2086
|
+
}
|
|
2087
|
+
const DEFAULT_SR_ONLY_ELEMENT = "span";
|
|
2088
|
+
function SrOnly(props) {
|
|
2089
|
+
const $ = compilerRuntime.c(12), t0 = props;
|
|
2090
|
+
let children, className, rest, t1;
|
|
2091
|
+
$[0] !== t0 ? ({
|
|
2092
|
+
as: t1,
|
|
2093
|
+
children,
|
|
2094
|
+
className,
|
|
2095
|
+
...rest
|
|
2096
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1) : (children = $[1], className = $[2], rest = $[3], t1 = $[4]);
|
|
2097
|
+
const Element2 = t1 === void 0 ? DEFAULT_SR_ONLY_ELEMENT : t1;
|
|
2098
|
+
let t2;
|
|
2099
|
+
$[5] !== className ? (t2 = css.srOnly({
|
|
2100
|
+
className
|
|
2101
|
+
}), $[5] = className, $[6] = t2) : t2 = $[6];
|
|
2102
|
+
let t3;
|
|
2103
|
+
return $[7] !== Element2 || $[8] !== children || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "SrOnly", ...rest, "aria-hidden": !0, className: t2, children }), $[7] = Element2, $[8] = children, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
2104
|
+
}
|
|
2105
|
+
const DEFAULT_SWITCH_ELEMENT = "input";
|
|
2106
|
+
function Switch(props) {
|
|
2107
|
+
const $ = compilerRuntime.c(26), t0 = props;
|
|
2108
|
+
let className, disabled, forwardedRef, indeterminate, readOnly, rest, style, t1;
|
|
2109
|
+
$[0] !== t0 ? ({
|
|
2110
|
+
as: t1,
|
|
2111
|
+
className,
|
|
2112
|
+
disabled,
|
|
2113
|
+
indeterminate,
|
|
2114
|
+
readOnly,
|
|
2115
|
+
ref: forwardedRef,
|
|
2116
|
+
style,
|
|
2117
|
+
...rest
|
|
2118
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = forwardedRef, $[4] = indeterminate, $[5] = readOnly, $[6] = rest, $[7] = style, $[8] = t1) : (className = $[1], disabled = $[2], forwardedRef = $[3], indeterminate = $[4], readOnly = $[5], rest = $[6], style = $[7], t1 = $[8]);
|
|
2119
|
+
const Element2 = t1 === void 0 ? DEFAULT_SWITCH_ELEMENT : t1, ref = react.useRef(null);
|
|
2120
|
+
let t2;
|
|
2121
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[9] = t2) : t2 = $[9], react.useImperativeHandle(forwardedRef, t2);
|
|
2122
|
+
let t3, t4;
|
|
2123
|
+
$[10] !== indeterminate ? (t3 = () => {
|
|
2124
|
+
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
2125
|
+
}, t4 = [indeterminate], $[10] = indeterminate, $[11] = t3, $[12] = t4) : (t3 = $[11], t4 = $[12]), react.useEffect(t3, t4);
|
|
2126
|
+
let t5;
|
|
2127
|
+
$[13] !== className ? (t5 = css._switch({
|
|
2128
|
+
className
|
|
2129
|
+
}), $[13] = className, $[14] = t5) : t5 = $[14];
|
|
2130
|
+
let t6;
|
|
2131
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = css._switchElement(), $[15] = t6) : t6 = $[15];
|
|
2132
|
+
const t7 = !disabled && readOnly ? "" : void 0, t8 = disabled || readOnly;
|
|
2133
|
+
let t9;
|
|
2134
|
+
$[16] !== Element2 || $[17] !== rest || $[18] !== t7 || $[19] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t6, "data-read-only": t7, disabled: t8, type: "checkbox", ref }), $[16] = Element2, $[17] = rest, $[18] = t7, $[19] = t8, $[20] = t9) : t9 = $[20];
|
|
2135
|
+
let t10;
|
|
2136
|
+
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": !0, className: css._switchPresentation(), children: [
|
|
2137
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchTrack() }),
|
|
2138
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchThumb() })
|
|
2139
|
+
] }), $[21] = t10) : t10 = $[21];
|
|
2140
|
+
let t11;
|
|
2141
|
+
return $[22] !== style || $[23] !== t5 || $[24] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: t5, "data-ui": "Switch", display: "block", position: "relative", style, children: [
|
|
2142
|
+
t9,
|
|
2143
|
+
t10
|
|
2144
|
+
] }), $[22] = style, $[23] = t5, $[24] = t9, $[25] = t11) : t11 = $[25], t11;
|
|
2145
|
+
}
|
|
2146
|
+
const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
|
|
2147
|
+
function TextArea(props) {
|
|
2148
|
+
const $ = compilerRuntime.c(34), t0 = props;
|
|
2149
|
+
let __unstable_disableFocusRing, customValidity, forwardedRef, gap, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
|
|
2150
|
+
$[0] !== t0 ? ({
|
|
2151
|
+
__unstable_disableFocusRing,
|
|
2152
|
+
as: t1,
|
|
2153
|
+
border: t2,
|
|
2154
|
+
customValidity,
|
|
2155
|
+
disabled: t3,
|
|
2156
|
+
fontSize: t4,
|
|
2157
|
+
gap,
|
|
2158
|
+
padding: t5,
|
|
2159
|
+
radius: t6,
|
|
2160
|
+
readOnly,
|
|
2161
|
+
ref: forwardedRef,
|
|
2162
|
+
space: t7,
|
|
2163
|
+
...rest
|
|
2164
|
+
} = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = forwardedRef, $[4] = gap, $[5] = readOnly, $[6] = rest, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = t7) : (__unstable_disableFocusRing = $[1], customValidity = $[2], forwardedRef = $[3], gap = $[4], readOnly = $[5], rest = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11], t6 = $[12], t7 = $[13]);
|
|
2165
|
+
const Element2 = t1 === void 0 ? DEFAULT_TEXT_AREA_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 2 : t6, space = t7 === void 0 ? 3 : t7, ref = react.useRef(null);
|
|
2166
|
+
let t8;
|
|
2167
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[14] = t8) : t8 = $[14], react.useImperativeHandle(forwardedRef, t8), _visualEditing.useCustomValidity(ref, customValidity);
|
|
2168
|
+
const t9 = gap ?? space;
|
|
2169
|
+
let t10;
|
|
2170
|
+
$[15] !== border || $[16] !== fontSize || $[17] !== padding || $[18] !== radius || $[19] !== t9 ? (t10 = css.textArea({
|
|
2171
|
+
border,
|
|
2172
|
+
fontSize,
|
|
2173
|
+
padding,
|
|
2174
|
+
radius,
|
|
2175
|
+
gap: t9
|
|
2176
|
+
}), $[15] = border, $[16] = fontSize, $[17] = padding, $[18] = radius, $[19] = t9, $[20] = t10) : t10 = $[20];
|
|
2177
|
+
const t11 = customValidity ? "" : void 0, t12 = !disabled && readOnly ? "" : void 0;
|
|
2178
|
+
let t13;
|
|
2179
|
+
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css._inputElement(), $[21] = t13) : t13 = $[21];
|
|
2180
|
+
const t14 = __unstable_disableFocusRing ? "" : void 0;
|
|
2181
|
+
let t15;
|
|
2182
|
+
$[22] !== Element2 || $[23] !== disabled || $[24] !== readOnly || $[25] !== rest || $[26] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { ...rest, className: t13, "data-no-focus-ring": t14, disabled, readOnly, ref }), $[22] = Element2, $[23] = disabled, $[24] = readOnly, $[25] = rest, $[26] = t14, $[27] = t15) : t15 = $[27];
|
|
2183
|
+
let t16;
|
|
2184
|
+
$[28] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("span", { className: css._inputPresentation() }), $[28] = t16) : t16 = $[28];
|
|
2185
|
+
let t17;
|
|
2186
|
+
return $[29] !== t10 || $[30] !== t11 || $[31] !== t12 || $[32] !== t15 ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: t10, "data-invalid": t11, "data-read-only": t12, "data-ui": "TextArea", children: [
|
|
2187
|
+
t15,
|
|
2188
|
+
t16
|
|
2189
|
+
] }), $[29] = t10, $[30] = t11, $[31] = t12, $[32] = t15, $[33] = t17) : t17 = $[33], t17;
|
|
2190
|
+
}
|
|
2191
|
+
function TooltipDelayGroupProvider(props) {
|
|
2192
|
+
const $ = compilerRuntime.c(9), {
|
|
2193
|
+
children,
|
|
2194
|
+
delay
|
|
2195
|
+
} = props, [isGroupActive, setIsGroupActive] = _visualEditing.useDelayedState(!1), [openTooltipId, setOpenTooltipId] = _visualEditing.useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0;
|
|
2196
|
+
let t0;
|
|
2197
|
+
const t1 = isGroupActive ? 1 : openDelay;
|
|
2198
|
+
let t2;
|
|
2199
|
+
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
|
|
2200
|
+
setIsGroupActive,
|
|
2201
|
+
openTooltipId,
|
|
2202
|
+
setOpenTooltipId,
|
|
2203
|
+
openDelay: t1,
|
|
2204
|
+
closeDelay
|
|
2205
|
+
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
|
|
2206
|
+
const value = t0;
|
|
2207
|
+
let t3;
|
|
2208
|
+
return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
|
|
2209
|
+
}
|
|
2210
|
+
function findMaxBreakpoints(media, width) {
|
|
2211
|
+
const ret = [];
|
|
2212
|
+
for (let i = 0; i < media.length; i += 1)
|
|
2213
|
+
media[i] > width && ret.push(i);
|
|
2214
|
+
return ret;
|
|
2215
|
+
}
|
|
2216
|
+
function findMinBreakpoints(media, width) {
|
|
2217
|
+
const ret = [];
|
|
2218
|
+
for (let i = 0; i < media.length; i += 1)
|
|
2219
|
+
media[i] <= width && ret.push(i);
|
|
2220
|
+
return ret;
|
|
2221
|
+
}
|
|
2222
|
+
const DEFAULT_ELEMENT_QUERY_ELEMENT = "div", DEFAULT_BREAKPOINTS = Object.values(css.BREAKPOINTS);
|
|
2223
|
+
function ElementQuery(props) {
|
|
2224
|
+
const $ = compilerRuntime.c(21), t0 = props;
|
|
2225
|
+
let children, forwardedRef, mediaProp, rest, t1;
|
|
2226
|
+
$[0] !== t0 ? ({
|
|
2227
|
+
as: t1,
|
|
2228
|
+
children,
|
|
2229
|
+
media: mediaProp,
|
|
2230
|
+
ref: forwardedRef,
|
|
2231
|
+
...rest
|
|
2232
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = mediaProp, $[4] = rest, $[5] = t1) : (children = $[1], forwardedRef = $[2], mediaProp = $[3], rest = $[4], t1 = $[5]);
|
|
2233
|
+
const Element2 = t1 === void 0 ? DEFAULT_ELEMENT_QUERY_ELEMENT : t1, breakpoints = mediaProp ?? DEFAULT_BREAKPOINTS, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
|
|
2234
|
+
let t2;
|
|
2235
|
+
t2 = elementSize?.border.width ?? window.innerWidth;
|
|
2236
|
+
const width = t2;
|
|
2237
|
+
let t3, t4;
|
|
2238
|
+
if ($[6] !== breakpoints || $[7] !== width) {
|
|
2239
|
+
const eq = findMaxBreakpoints(breakpoints, width);
|
|
2240
|
+
t4 = eq.length ? eq.join(" ") : void 0, $[6] = breakpoints, $[7] = width, $[8] = t4;
|
|
2241
|
+
} else
|
|
2242
|
+
t4 = $[8];
|
|
2243
|
+
t3 = t4;
|
|
2244
|
+
const max = t3;
|
|
2245
|
+
let t5, t6;
|
|
2246
|
+
if ($[9] !== breakpoints || $[10] !== width) {
|
|
2247
|
+
const eq_0 = findMinBreakpoints(breakpoints, width);
|
|
2248
|
+
t6 = eq_0.length ? eq_0.join(" ") : void 0, $[9] = breakpoints, $[10] = width, $[11] = t6;
|
|
2249
|
+
} else
|
|
2250
|
+
t6 = $[11];
|
|
2251
|
+
t5 = t6;
|
|
2252
|
+
const min = t5;
|
|
2253
|
+
let t7, t8;
|
|
2254
|
+
$[12] !== element ? (t7 = () => element, t8 = [element], $[12] = element, $[13] = t7, $[14] = t8) : (t7 = $[13], t8 = $[14]), react.useImperativeHandle(forwardedRef, t7, t8);
|
|
2255
|
+
let t9;
|
|
2256
|
+
return $[15] !== Element2 || $[16] !== children || $[17] !== max || $[18] !== min || $[19] !== rest ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "ElementQuery", ...rest, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[15] = Element2, $[16] = children, $[17] = max, $[18] = min, $[19] = rest, $[20] = t9) : t9 = $[20], t9;
|
|
2257
|
+
}
|
|
2258
|
+
class ErrorBoundary extends react.Component {
|
|
2259
|
+
state = {
|
|
2260
|
+
error: null
|
|
2261
|
+
};
|
|
2262
|
+
static displayName = "ErrorBoundary";
|
|
2263
|
+
static getDerivedStateFromError(error) {
|
|
2264
|
+
return {
|
|
2265
|
+
error
|
|
2266
|
+
};
|
|
2267
|
+
}
|
|
2268
|
+
componentDidCatch(error, info) {
|
|
2269
|
+
this.props.onCatch({
|
|
2270
|
+
error,
|
|
2271
|
+
info
|
|
2272
|
+
});
|
|
2273
|
+
}
|
|
2274
|
+
render() {
|
|
2275
|
+
const {
|
|
2276
|
+
error
|
|
2277
|
+
} = this.state;
|
|
2278
|
+
if (error) {
|
|
2279
|
+
const message = typeof error?.message == "string" ? error.message : "Error";
|
|
2280
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Code, { children: message });
|
|
2281
|
+
}
|
|
2282
|
+
return this.props.children;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
exports.Arrow = _visualEditing.Arrow;
|
|
2286
|
+
exports.Box = _visualEditing.Box;
|
|
2287
|
+
exports.Button = _visualEditing.Button;
|
|
2288
|
+
exports.Card = _visualEditing.Card;
|
|
2289
|
+
exports.CardProvider = _visualEditing.CardProvider;
|
|
2290
|
+
exports.DEFAULT_ARROW_ELEMENT = _visualEditing.DEFAULT_ARROW_ELEMENT;
|
|
2291
|
+
exports.DEFAULT_BOX_ELEMENT = _visualEditing.DEFAULT_BOX_ELEMENT;
|
|
2292
|
+
exports.DEFAULT_BUTTON_ELEMENT = _visualEditing.DEFAULT_BUTTON_ELEMENT;
|
|
2293
|
+
exports.DEFAULT_CARD_ELEMENT = _visualEditing.DEFAULT_CARD_ELEMENT;
|
|
2294
|
+
exports.DEFAULT_FLEX_ELEMENT = _visualEditing.DEFAULT_FLEX_ELEMENT;
|
|
2295
|
+
exports.DEFAULT_GRID_ELEMENT = _visualEditing.DEFAULT_GRID_ELEMENT;
|
|
2296
|
+
exports.DEFAULT_HOTKEYS_ELEMENT = _visualEditing.DEFAULT_HOTKEYS_ELEMENT;
|
|
2297
|
+
exports.DEFAULT_KBD_ELEMENT = _visualEditing.DEFAULT_KBD_ELEMENT;
|
|
2298
|
+
exports.DEFAULT_LAYER_ELEMENT = _visualEditing.DEFAULT_LAYER_ELEMENT;
|
|
2299
|
+
exports.DEFAULT_MENU_DIVIDER_ELEMENT = _visualEditing.DEFAULT_MENU_DIVIDER_ELEMENT;
|
|
2300
|
+
exports.DEFAULT_MENU_ELEMENT = _visualEditing.DEFAULT_MENU_ELEMENT;
|
|
2301
|
+
exports.DEFAULT_MENU_GROUP_ELEMENT = _visualEditing.DEFAULT_MENU_GROUP_ELEMENT;
|
|
2302
|
+
exports.DEFAULT_MENU_ITEM_ELEMENT = _visualEditing.DEFAULT_MENU_ITEM_ELEMENT;
|
|
2303
|
+
exports.DEFAULT_POPOVER_ELEMENT = _visualEditing.DEFAULT_POPOVER_ELEMENT;
|
|
2304
|
+
exports.DEFAULT_SELECTABLE_ELEMENT = _visualEditing.DEFAULT_SELECTABLE_ELEMENT;
|
|
2305
|
+
exports.DEFAULT_SPINNER_ELEMENT = _visualEditing.DEFAULT_SPINNER_ELEMENT;
|
|
2306
|
+
exports.DEFAULT_STACK_ELEMENT = _visualEditing.DEFAULT_STACK_ELEMENT;
|
|
2307
|
+
exports.DEFAULT_TAB_ELEMENT = _visualEditing.DEFAULT_TAB_ELEMENT;
|
|
2308
|
+
exports.DEFAULT_TAB_LIST_ELEMENT = _visualEditing.DEFAULT_TAB_LIST_ELEMENT;
|
|
2309
|
+
exports.DEFAULT_TEXT_ELEMENT = _visualEditing.DEFAULT_TEXT_ELEMENT;
|
|
2310
|
+
exports.DEFAULT_TEXT_INPUT_ELEMENT = _visualEditing.DEFAULT_TEXT_INPUT_ELEMENT;
|
|
2311
|
+
exports.DEFAULT_TOOLTIP_ELEMENT = _visualEditing.DEFAULT_TOOLTIP_ELEMENT;
|
|
2312
|
+
exports.Flex = _visualEditing.Flex;
|
|
2313
|
+
exports.Grid = _visualEditing.Grid;
|
|
2314
|
+
exports.Hotkeys = _visualEditing.Hotkeys;
|
|
2315
|
+
exports.KBD = _visualEditing.KBD;
|
|
2316
|
+
exports.Layer = _visualEditing.Layer;
|
|
2317
|
+
exports.LayerProvider = _visualEditing.LayerProvider;
|
|
2318
|
+
exports.Menu = _visualEditing.Menu;
|
|
2319
|
+
exports.MenuDivider = _visualEditing.MenuDivider;
|
|
2320
|
+
exports.MenuGroup = _visualEditing.MenuGroup;
|
|
2321
|
+
exports.MenuItem = _visualEditing.MenuItem;
|
|
2322
|
+
exports.Popover = _visualEditing.Popover;
|
|
2323
|
+
exports.Portal = _visualEditing.Portal;
|
|
2324
|
+
exports.PortalProvider = _visualEditing.PortalProvider;
|
|
2325
|
+
exports.Selectable = _visualEditing.Selectable;
|
|
2326
|
+
exports.Spinner = _visualEditing.Spinner;
|
|
2327
|
+
exports.Stack = _visualEditing.Stack;
|
|
2328
|
+
exports.Tab = _visualEditing.Tab;
|
|
2329
|
+
exports.TabList = _visualEditing.TabList;
|
|
2330
|
+
exports.Text = _visualEditing.Text;
|
|
2331
|
+
exports.TextInput = _visualEditing.TextInput;
|
|
2332
|
+
exports.ThemeColorProvider = _visualEditing.ThemeColorProvider;
|
|
2333
|
+
exports.ThemeProvider = _visualEditing.ThemeProvider;
|
|
2334
|
+
exports.Tooltip = _visualEditing.Tooltip;
|
|
2335
|
+
exports.TooltipDelayGroupContext = _visualEditing.TooltipDelayGroupContext;
|
|
2336
|
+
exports._getArrayProp = _visualEditing._getArrayProp;
|
|
2337
|
+
exports._getResponsiveProp = _visualEditing._getResponsiveProp;
|
|
2338
|
+
exports._isEnterToClickElement = _visualEditing._isEnterToClickElement;
|
|
2339
|
+
exports.containsOrEqualsElement = _visualEditing.containsOrEqualsElement;
|
|
2340
|
+
exports.isHTMLAnchorElement = _visualEditing.isHTMLAnchorElement;
|
|
2341
|
+
exports.isHTMLButtonElement = _visualEditing.isHTMLButtonElement;
|
|
2342
|
+
exports.isHTMLElement = _visualEditing.isHTMLElement;
|
|
2343
|
+
exports.isHTMLInputElement = _visualEditing.isHTMLInputElement;
|
|
2344
|
+
exports.isHTMLSelectElement = _visualEditing.isHTMLSelectElement;
|
|
2345
|
+
exports.isHTMLTextAreaElement = _visualEditing.isHTMLTextAreaElement;
|
|
2346
|
+
exports.useBoundaryElement = _visualEditing.useBoundaryElement;
|
|
2347
|
+
exports.useCard = _visualEditing.useCard;
|
|
2348
|
+
exports.useClickOutsideEvent = _visualEditing.useClickOutsideEvent;
|
|
2349
|
+
exports.useCustomValidity = _visualEditing.useCustomValidity;
|
|
2350
|
+
exports.useGlobalKeyDown = _visualEditing.useGlobalKeyDown;
|
|
2351
|
+
exports.useLayer = _visualEditing.useLayer;
|
|
2352
|
+
exports.useMatchMedia = _visualEditing.useMatchMedia;
|
|
2353
|
+
exports.useMediaIndex = _visualEditing.useMediaIndex;
|
|
2354
|
+
exports.usePortal = _visualEditing.usePortal;
|
|
2355
|
+
exports.usePrefersDark = _visualEditing.usePrefersDark;
|
|
2356
|
+
exports.usePrefersReducedMotion = _visualEditing.usePrefersReducedMotion;
|
|
2357
|
+
exports.useResponsiveProp = _visualEditing.useResponsiveProp;
|
|
2358
|
+
exports.useRootTheme = _visualEditing.useRootTheme;
|
|
2359
|
+
exports.useTheme = _visualEditing.useTheme;
|
|
2360
|
+
exports.useTheme_v2 = _visualEditing.useTheme_v2;
|
|
2361
|
+
exports.useTooltipDelayGroup = _visualEditing.useTooltipDelayGroup;
|
|
2362
|
+
Object.defineProperty(exports, "px", {
|
|
2363
|
+
enumerable: !0,
|
|
2364
|
+
get: function() {
|
|
2365
|
+
return css.px;
|
|
2366
|
+
}
|
|
2367
|
+
});
|
|
2368
|
+
Object.defineProperty(exports, "rem", {
|
|
2369
|
+
enumerable: !0,
|
|
2370
|
+
get: function() {
|
|
2371
|
+
return css.rem;
|
|
2372
|
+
}
|
|
2373
|
+
});
|
|
2374
|
+
exports.Autocomplete = Autocomplete;
|
|
2375
|
+
exports.Avatar = Avatar;
|
|
2376
|
+
exports.AvatarCounter = AvatarCounter;
|
|
2377
|
+
exports.AvatarStack = AvatarStack;
|
|
2378
|
+
exports.Badge = Badge;
|
|
2379
|
+
exports.BoundaryElementProvider = BoundaryElementProvider;
|
|
2380
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
2381
|
+
exports.Checkbox = Checkbox;
|
|
2382
|
+
exports.Code = Code;
|
|
2383
|
+
exports.CodeSkeleton = CodeSkeleton;
|
|
2384
|
+
exports.Container = Container;
|
|
2385
|
+
exports.DEFAULT_AUTOCOMPLETE_ELEMENT = DEFAULT_AUTOCOMPLETE_ELEMENT;
|
|
2386
|
+
exports.DEFAULT_AVATAR_COUNTER_ELEMENT = DEFAULT_AVATAR_COUNTER_ELEMENT;
|
|
2387
|
+
exports.DEFAULT_AVATAR_ELEMENT = DEFAULT_AVATAR_ELEMENT;
|
|
2388
|
+
exports.DEFAULT_AVATAR_STACK_ELEMENT = DEFAULT_AVATAR_STACK_ELEMENT;
|
|
2389
|
+
exports.DEFAULT_BADGE_ELEMENT = DEFAULT_BADGE_ELEMENT;
|
|
2390
|
+
exports.DEFAULT_BREADCRUMBS_ELEMENT = DEFAULT_BREADCRUMBS_ELEMENT;
|
|
2391
|
+
exports.DEFAULT_CHECKBOX_ELEMENT = DEFAULT_CHECKBOX_ELEMENT;
|
|
2392
|
+
exports.DEFAULT_CODE_ELEMENT = DEFAULT_CODE_ELEMENT;
|
|
2393
|
+
exports.DEFAULT_CODE_SKELETON_ELEMENT = DEFAULT_CODE_SKELETON_ELEMENT;
|
|
2394
|
+
exports.DEFAULT_CONTAINER_ELEMENT = DEFAULT_CONTAINER_ELEMENT;
|
|
2395
|
+
exports.DEFAULT_DIALOG_ELEMENT = DEFAULT_DIALOG_ELEMENT;
|
|
2396
|
+
exports.DEFAULT_ELEMENT_QUERY_ELEMENT = DEFAULT_ELEMENT_QUERY_ELEMENT;
|
|
2397
|
+
exports.DEFAULT_HEADING_ELEMENT = DEFAULT_HEADING_ELEMENT;
|
|
2398
|
+
exports.DEFAULT_HEADING_SKELETON_ELEMENT = DEFAULT_HEADING_SKELETON_ELEMENT;
|
|
2399
|
+
exports.DEFAULT_INLINE_ELEMENT = DEFAULT_INLINE_ELEMENT;
|
|
2400
|
+
exports.DEFAULT_LABEL_ELEMENT = DEFAULT_LABEL_ELEMENT;
|
|
2401
|
+
exports.DEFAULT_LABEL_SKELETON_ELEMENT = DEFAULT_LABEL_SKELETON_ELEMENT;
|
|
2402
|
+
exports.DEFAULT_RADIO_ELEMENT = DEFAULT_RADIO_ELEMENT;
|
|
2403
|
+
exports.DEFAULT_ROOT_ELEMENT = DEFAULT_ROOT_ELEMENT;
|
|
2404
|
+
exports.DEFAULT_SELECT_ELEMENT = DEFAULT_SELECT_ELEMENT;
|
|
2405
|
+
exports.DEFAULT_SKELETON_ELEMENT = DEFAULT_SKELETON_ELEMENT;
|
|
2406
|
+
exports.DEFAULT_SR_ONLY_ELEMENT = DEFAULT_SR_ONLY_ELEMENT;
|
|
2407
|
+
exports.DEFAULT_SWITCH_ELEMENT = DEFAULT_SWITCH_ELEMENT;
|
|
2408
|
+
exports.DEFAULT_TAB_PANEL_ELEMENT = DEFAULT_TAB_PANEL_ELEMENT;
|
|
2409
|
+
exports.DEFAULT_TEXT_AREA_ELEMENT = DEFAULT_TEXT_AREA_ELEMENT;
|
|
2410
|
+
exports.DEFAULT_TEXT_SKELETON_ELEMENT = DEFAULT_TEXT_SKELETON_ELEMENT;
|
|
2411
|
+
exports.DEFAULT_TOAST_ELEMENT = DEFAULT_TOAST_ELEMENT;
|
|
2412
|
+
exports.DEFAULT_TREE_ELEMENT = DEFAULT_TREE_ELEMENT;
|
|
2413
|
+
exports.DEFAULT_TREE_ITEM_ELEMENT = DEFAULT_TREE_ITEM_ELEMENT;
|
|
2414
|
+
exports.DEFAULT_VIRTUAL_LIST_ELEMENT = DEFAULT_VIRTUAL_LIST_ELEMENT;
|
|
2415
|
+
exports.Dialog = Dialog;
|
|
2416
|
+
exports.DialogContext = DialogContext;
|
|
2417
|
+
exports.DialogProvider = DialogProvider;
|
|
2418
|
+
exports.ElementQuery = ElementQuery;
|
|
2419
|
+
exports.ErrorBoundary = ErrorBoundary;
|
|
2420
|
+
exports.Heading = Heading;
|
|
2421
|
+
exports.HeadingSkeleton = HeadingSkeleton;
|
|
2422
|
+
exports.Inline = Inline;
|
|
2423
|
+
exports.Label = Label;
|
|
2424
|
+
exports.LabelSkeleton = LabelSkeleton;
|
|
2425
|
+
exports.MenuButton = MenuButton;
|
|
2426
|
+
exports.Radio = Radio;
|
|
2427
|
+
exports.Root = Root;
|
|
2428
|
+
exports.RootProvider = RootProvider;
|
|
2429
|
+
exports.Select = Select;
|
|
2430
|
+
exports.Skeleton = Skeleton;
|
|
2431
|
+
exports.SrOnly = SrOnly;
|
|
2432
|
+
exports.Switch = Switch;
|
|
2433
|
+
exports.TabPanel = TabPanel;
|
|
2434
|
+
exports.TextArea = TextArea;
|
|
2435
|
+
exports.TextSkeleton = TextSkeleton;
|
|
2436
|
+
exports.Toast = Toast;
|
|
2437
|
+
exports.ToastProvider = ToastProvider;
|
|
2438
|
+
exports.TooltipDelayGroupProvider = TooltipDelayGroupProvider;
|
|
2439
|
+
exports.Tree = Tree;
|
|
2440
|
+
exports.TreeItem = TreeItem;
|
|
2441
|
+
exports.VirtualList = VirtualList;
|
|
2442
|
+
exports._ResizeObserver = _ResizeObserver;
|
|
2443
|
+
exports._elementSizeObserver = _elementSizeObserver;
|
|
2444
|
+
exports._hasFocus = _hasFocus;
|
|
2445
|
+
exports._isScrollable = _isScrollable;
|
|
2446
|
+
exports._raf = _raf;
|
|
2447
|
+
exports._raf2 = _raf2;
|
|
2448
|
+
exports._responsive = _responsive;
|
|
2449
|
+
exports.attemptFocus = attemptFocus;
|
|
2450
|
+
exports.createColorTheme = createColorTheme;
|
|
2451
|
+
exports.focusFirstDescendant = focusFirstDescendant;
|
|
2452
|
+
exports.focusLastDescendant = focusLastDescendant;
|
|
2453
|
+
exports.hexToRgb = hexToRgb;
|
|
2454
|
+
exports.hslToRgb = hslToRgb;
|
|
2455
|
+
exports.isFocusable = isFocusable;
|
|
2456
|
+
exports.multiply = multiply;
|
|
2457
|
+
exports.parseColor = parseColor;
|
|
2458
|
+
exports.rgbToHex = rgbToHex;
|
|
2459
|
+
exports.rgbToHsl = rgbToHsl;
|
|
2460
|
+
exports.rgba = rgba;
|
|
2461
|
+
exports.screen = screen;
|
|
2462
|
+
exports.useArrayProp = useArrayProp;
|
|
2463
|
+
exports.useClickOutside = useClickOutside;
|
|
2464
|
+
exports.useDialog = useDialog;
|
|
2465
|
+
exports.useElementRect = useElementRect;
|
|
2466
|
+
exports.useElementSize = useElementSize;
|
|
2467
|
+
exports.useForwardedRef = useForwardedRef;
|
|
2468
|
+
exports.useToast = useToast;
|
|
2469
|
+
exports.useTree = useTree;
|
|
2470
|
+
//# sourceMappingURL=index.cjs.map
|