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