@sanity/ui 4.0.0-static.4 → 4.0.0-static.40
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/dist/_chunks-es/{refractor.js → Refractor.js} +1 -1
- package/dist/_chunks-es/{refractor.js.map → Refractor.js.map} +1 -1
- package/dist/css/index.css +2 -1
- package/dist/css/index.css.map +1 -0
- package/dist/css/index.d.ts +51 -7
- package/dist/css/index.js +17979 -55
- package/dist/css/index.js.map +1 -1
- package/dist/index.d.ts +26 -38
- package/dist/index.js +1744 -1127
- package/dist/index.js.map +1 -1
- package/exports/css/index.css +1 -0
- package/package.json +39 -51
- package/src/core/Root.tsx +1 -1
- package/src/core/RootProvider.tsx +5 -5
- package/src/core/__workshop__/index.ts +1 -1
- package/src/core/components/autocomplete/{autocomplete.tsx → Autocomplete.tsx} +90 -58
- package/src/core/components/autocomplete/__workshop__/{custom.tsx → Custom.tsx} +14 -1
- package/src/core/components/autocomplete/__workshop__/{example.tsx → Example.tsx} +12 -1
- package/src/core/components/autocomplete/__workshop__/index.ts +6 -6
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/{breadcrumbs.tsx → Breadcrumbs.tsx} +80 -47
- package/src/core/components/breadcrumbs/__workshop__/index.ts +1 -1
- package/src/core/components/dialog/{dialog.tsx → Dialog.tsx} +20 -11
- package/src/core/components/dialog/{dialogCard.tsx → DialogCard.tsx} +9 -9
- package/src/core/components/dialog/{dialogContext.ts → DialogContext.ts} +1 -1
- package/src/core/components/dialog/{dialogProvider.tsx → DialogProvider.tsx} +2 -2
- package/src/core/components/dialog/__workshop__/{panes.tsx → Panes.tsx} +9 -21
- package/src/core/components/dialog/__workshop__/{position.tsx → Position.tsx} +9 -1
- package/src/core/components/dialog/__workshop__/{props.tsx → Props.tsx} +2 -0
- package/src/core/components/dialog/__workshop__/index.ts +10 -10
- package/src/core/components/dialog/__workshop__/styles.css.ts +18 -0
- package/src/core/components/dialog/useDialog.ts +3 -3
- package/src/core/components/hotkeys/{hotkeys.tsx → Hotkeys.tsx} +2 -2
- package/src/core/components/hotkeys/__workshop__/index.ts +1 -1
- package/src/core/components/menu/{menu.test.tsx → Menu.test.tsx} +9 -13
- package/src/core/components/menu/{menu.tsx → Menu.tsx} +19 -24
- package/src/core/components/menu/{menuButton.tsx → MenuButton.tsx} +14 -9
- package/src/core/components/menu/{menuContext.ts → MenuContext.ts} +3 -4
- package/src/core/components/menu/{menuGroup.tsx → MenuGroup.tsx} +16 -11
- package/src/core/components/menu/{menuItem.tsx → MenuItem.tsx} +7 -9
- package/src/core/components/menu/__workshop__/DataProps.tsx +27 -0
- package/src/core/components/menu/__workshop__/{menuButton.tsx → MenuButton.tsx} +6 -1
- package/src/core/components/menu/__workshop__/{tones.tsx → Tones.tsx} +7 -1
- package/src/core/components/menu/__workshop__/index.ts +22 -17
- package/src/core/components/menu/useMenu.ts +5 -5
- package/src/core/components/menu/useMenuController.ts +5 -5
- package/src/core/components/tab/{tab.tsx → Tab.tsx} +1 -1
- package/src/core/components/tab/{tabList.tsx → TabList.tsx} +2 -2
- package/src/core/components/tab/{tabPanel.tsx → TabPanel.tsx} +1 -1
- package/src/core/components/tab/__workshop__/index.ts +1 -1
- package/src/core/components/toast/{toast.test.tsx → Toast.test.tsx} +7 -7
- package/src/core/components/toast/{toast.tsx → Toast.tsx} +6 -6
- package/src/core/components/toast/{toastContext.ts → ToastContext.ts} +1 -1
- package/src/core/components/toast/{toastLayer.tsx → ToastLayer.tsx} +1 -1
- package/src/core/components/toast/{toastProvider.tsx → ToastProvider.tsx} +7 -7
- package/src/core/components/toast/__workshop__/{toast.tsx → Toast.tsx} +2 -0
- package/src/core/components/toast/__workshop__/index.ts +2 -2
- package/src/core/components/toast/useToast.ts +3 -3
- package/src/core/components/tree/{tree.tsx → Tree.tsx} +4 -4
- package/src/core/components/tree/{treeContext.ts → TreeContext.ts} +1 -1
- package/src/core/components/tree/{treeGroup.tsx → TreeGroup.tsx} +1 -1
- package/src/core/components/tree/{treeItem.tsx → TreeItem.tsx} +28 -25
- package/src/core/components/tree/__workshop__/index.ts +4 -4
- package/src/core/components/tree/useTree.ts +3 -3
- package/src/core/components/virtualList/{virtualList.tsx → VirtualList.tsx} +87 -45
- package/src/core/components/virtualList/__workshop__/index.ts +4 -4
- package/src/core/helpers/props.ts +0 -9
- package/src/core/hooks/useGlobalKeyDown.ts +11 -4
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +1 -1
- package/src/core/hooks/useResponsiveProp.ts +4 -17
- package/src/core/index.ts +68 -66
- package/src/core/lib/createGlobalScopedContext.ts +5 -3
- package/src/core/primitives/avatar/{avatar.tsx → Avatar.tsx} +7 -6
- package/src/core/primitives/avatar/{avatarCounter.tsx → AvatarCounter.tsx} +2 -2
- package/src/core/primitives/avatar/{avatarStack.tsx → AvatarStack.tsx} +3 -3
- package/src/core/primitives/avatar/__workshop__/{asButton.tsx → AsButton.tsx} +8 -1
- package/src/core/primitives/avatar/__workshop__/PropsStory.tsx +22 -0
- package/src/core/primitives/avatar/__workshop__/{stack.tsx → Stack.tsx} +5 -1
- package/src/core/primitives/avatar/__workshop__/index.ts +9 -4
- package/src/core/primitives/badge/{badge.test.tsx → Badge.test.tsx} +1 -1
- package/src/core/primitives/badge/{badge.tsx → Badge.tsx} +2 -2
- package/src/core/primitives/badge/__workshop__/{props.tsx → Props.tsx} +12 -1
- package/src/core/primitives/badge/__workshop__/index.ts +2 -2
- package/src/core/primitives/box/__workshop__/{props.tsx → Props.tsx} +6 -1
- package/src/core/primitives/box/__workshop__/index.ts +2 -2
- package/src/core/primitives/button/{button.test.tsx → Button.test.tsx} +1 -1
- package/src/core/primitives/button/{button.tsx → Button.tsx} +12 -11
- package/src/core/primitives/button/__workshop__/DataProps.tsx +22 -0
- package/src/core/primitives/button/__workshop__/{props.tsx → Props.tsx} +22 -0
- package/src/core/primitives/button/__workshop__/SanityUploadButton.tsx +21 -0
- package/src/core/primitives/button/__workshop__/{stacked.tsx → Stacked.tsx} +16 -0
- package/src/core/primitives/button/__workshop__/Styled1.tsx +11 -0
- package/src/core/primitives/button/__workshop__/index.ts +15 -15
- package/src/core/primitives/button/__workshop__/styles.css.ts +30 -0
- package/src/core/primitives/card/{card.tsx → Card.tsx} +10 -10
- package/src/core/primitives/card/{cardContext.ts → CardContext.ts} +1 -1
- package/src/core/primitives/card/{cardProvider.tsx → CardProvider.tsx} +3 -12
- package/src/core/primitives/card/__workshop__/DataProps.tsx +30 -0
- package/src/core/primitives/card/__workshop__/{props.tsx → Props.tsx} +10 -0
- package/src/core/primitives/card/__workshop__/{selected.tsx → Selected.tsx} +1 -1
- package/src/core/primitives/card/__workshop__/{styled.tsx → Styled.tsx} +2 -5
- package/src/core/primitives/card/__workshop__/index.ts +10 -9
- package/src/core/primitives/card/useCard.ts +11 -6
- package/src/core/primitives/checkbox/__workshop__/index.ts +4 -4
- package/src/core/primitives/code/{code.tsx → Code.tsx} +26 -2
- package/src/core/primitives/code/__workshop__/{props.tsx → Props.tsx} +6 -1
- package/src/core/primitives/code/__workshop__/index.ts +2 -2
- package/src/core/primitives/container/{container.tsx → Container.tsx} +1 -1
- package/src/core/primitives/container/__workshop__/{example.tsx → Example.tsx} +6 -1
- package/src/core/primitives/container/__workshop__/index.ts +1 -1
- package/src/core/primitives/flex/{flex.tsx → Flex.tsx} +1 -1
- package/src/core/primitives/flex/__workshop__/{example.tsx → Example.tsx} +14 -16
- package/src/core/primitives/flex/__workshop__/index.ts +2 -2
- package/src/core/primitives/flex/__workshop__/styles.css.ts +12 -0
- package/src/core/primitives/grid/{grid.tsx → Grid.tsx} +1 -1
- package/src/core/primitives/grid/__workshop__/index.ts +1 -1
- package/src/core/primitives/heading/{heading.tsx → Heading.tsx} +16 -0
- package/src/core/primitives/heading/__workshop__/{plain.tsx → Plain.tsx} +12 -1
- package/src/core/primitives/heading/__workshop__/index.ts +2 -2
- package/src/core/primitives/inline/{inline.tsx → Inline.tsx} +2 -1
- package/src/core/primitives/inline/__workshop__/{plain.tsx → Plain.tsx} +5 -1
- package/src/core/primitives/inline/__workshop__/index.ts +1 -1
- package/src/core/primitives/kbd/{kbd.tsx → Kbd.tsx} +2 -2
- package/src/core/primitives/kbd/__workshop__/index.ts +1 -1
- package/src/core/primitives/label/{label.tsx → Label.tsx} +16 -0
- package/src/core/primitives/label/__workshop__/{plain.tsx → Plain.tsx} +15 -1
- package/src/core/primitives/label/__workshop__/index.ts +2 -2
- package/src/core/primitives/layer/{layer.test.tsx → Layer.test.tsx} +7 -7
- package/src/core/primitives/layer/{layer.tsx → Layer.tsx} +3 -3
- package/src/core/primitives/layer/{layerCard.tsx → LayerCard.tsx} +2 -2
- package/src/core/primitives/layer/{layerContext.ts → LayerContext.ts} +1 -1
- package/src/core/primitives/layer/{layerProvider.tsx → LayerProvider.tsx} +6 -6
- package/src/core/primitives/layer/__workshop__/index.ts +3 -3
- package/src/core/primitives/layer/useLayer.ts +3 -3
- package/src/core/primitives/popover/{popover.tsx → Popover.tsx} +170 -150
- package/src/core/primitives/popover/{popoverLayer.tsx → PopoverLayer.tsx} +3 -3
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +13 -1
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +2 -0
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +8 -0
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +7 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +6 -0
- package/src/core/primitives/popover/floating-ui/size.ts +17 -16
- package/src/core/primitives/radio/{radio.tsx → Radio.tsx} +2 -2
- package/src/core/primitives/radio/__workshop__/index.ts +2 -2
- package/src/core/primitives/select/{select.tsx → Select.tsx} +7 -5
- package/src/core/primitives/select/__workshop__/{plain.tsx → Plain.tsx} +4 -0
- package/src/core/primitives/select/__workshop__/index.ts +2 -2
- package/src/core/primitives/selectable/{selectable.tsx → Selectable.tsx} +2 -2
- package/src/core/primitives/selectable/__workshop__/DataProps.tsx +27 -0
- package/src/core/primitives/selectable/__workshop__/index.ts +14 -0
- package/src/core/primitives/skeleton/{codeSkeleton.tsx → CodeSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/{headingSkeleton.tsx → HeadingSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/{labelSkeleton.tsx → LabelSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/{skeleton.tsx → Skeleton.tsx} +2 -2
- package/src/core/primitives/skeleton/{textSkeleton.tsx → TextSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/__workshop__/{delay.tsx → Delay.tsx} +9 -1
- package/src/core/primitives/skeleton/__workshop__/{skeleton.tsx → Skeleton.tsx} +9 -1
- package/src/core/primitives/skeleton/__workshop__/index.ts +2 -2
- package/src/core/primitives/spinner/{spinner.tsx → Spinner.tsx} +2 -2
- package/src/core/primitives/spinner/__workshop__/Props.tsx +6 -1
- package/src/core/primitives/stack/{stack.tsx → Stack.tsx} +1 -1
- package/src/core/primitives/stack/__workshop__/{plain.tsx → Plain.tsx} +4 -1
- package/src/core/primitives/stack/__workshop__/index.ts +1 -1
- package/src/core/primitives/switch/{switch.tsx → Switch.tsx} +2 -10
- package/src/core/primitives/switch/__workshop__/index.ts +2 -2
- package/src/core/primitives/text/{text.tsx → Text.tsx} +14 -0
- package/src/core/primitives/text/__workshop__/{colored.tsx → Colored.tsx} +10 -8
- package/src/core/primitives/text/__workshop__/{example.tsx → Example.tsx} +15 -1
- package/src/core/primitives/text/__workshop__/index.ts +3 -3
- package/src/core/primitives/textArea/{textArea.tsx → TextArea.tsx} +7 -1
- package/src/core/primitives/textArea/__workshop__/{plain.tsx → Plain.tsx} +8 -0
- package/src/core/primitives/textArea/__workshop__/index.ts +1 -1
- package/src/core/primitives/textInput/{textInput.tsx → TextInput.tsx} +93 -72
- package/src/core/primitives/textInput/__workshop__/{plain.tsx → Plain.tsx} +34 -4
- package/src/core/primitives/textInput/__workshop__/{typed.tsx → Typed.tsx} +7 -1
- package/src/core/primitives/textInput/__workshop__/index.ts +7 -7
- package/src/core/primitives/tooltip/{tooltip.test.tsx → Tooltip.test.tsx} +4 -4
- package/src/core/primitives/tooltip/{tooltip.tsx → Tooltip.tsx} +102 -63
- package/src/core/primitives/tooltip/{tooltipLayer.tsx → TooltipLayer.tsx} +2 -2
- package/src/core/primitives/tooltip/__workshop__/{customPortal.tsx → CustomPortal.tsx} +2 -0
- package/src/core/primitives/tooltip/__workshop__/{overflowingBoundary.tsx → OverflowingBoundary.tsx} +2 -0
- package/src/core/primitives/tooltip/__workshop__/{props.tsx → Props.tsx} +12 -0
- package/src/core/primitives/tooltip/__workshop__/{resizableBoundary.tsx → ResizableBoundary.tsx} +5 -0
- package/src/core/primitives/tooltip/__workshop__/index.ts +4 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/{tooltipDelayGroupContext.tsx → TooltipDelayGroupContext.tsx} +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/{tooltipDelayGroupProvider.tsx → TooltipDelayGroupProvider.tsx} +2 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +3 -3
- package/src/core/types.ts +6 -5
- package/src/core/utils/{errorBoundary.tsx → ErrorBoundary.tsx} +1 -1
- package/src/core/utils/boundaryElement/{boundaryElementContext.ts → BoundaryElementContext.ts} +2 -5
- package/src/core/utils/boundaryElement/BoundaryElementProvider.tsx +16 -0
- package/src/core/utils/boundaryElement/__workshop__/index.ts +1 -1
- package/src/core/utils/boundaryElement/types.ts +1 -4
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +7 -19
- package/src/core/utils/elementQuery/__workshop__/CustomMedia.tsx +19 -0
- package/src/core/utils/elementQuery/__workshop__/index.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/styles.css.ts +31 -0
- package/src/core/utils/portal/{portal.test.tsx → Portal.test.tsx} +7 -7
- package/src/core/utils/portal/{portal.tsx → Portal.tsx} +7 -4
- package/src/core/utils/portal/{portalContext.ts → PortalContext.ts} +1 -1
- package/src/core/utils/portal/PortalProvider.tsx +38 -0
- package/src/core/utils/portal/__workshop__/index.ts +1 -1
- package/src/core/utils/portal/usePortal.ts +12 -5
- package/src/css/_responsiveStyle.css.ts +2 -2
- package/src/css/primitives/_input/_input.css.ts +13 -12
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_input/types.ts +2 -1
- package/src/css/primitives/avatar/avatar.css.ts +17 -5
- package/src/css/primitives/box/box.css.ts +19 -1
- package/src/css/primitives/button/button.css.ts +252 -183
- package/src/css/primitives/card/__workshop__/{color.tsx → Color.tsx} +9 -1
- package/src/css/primitives/card/__workshop__/index.ts +1 -1
- package/src/css/primitives/card/card.css.ts +133 -130
- package/src/css/primitives/checkbox/checkbox.css.ts +1 -0
- package/src/css/primitives/code/code.ts +4 -0
- package/src/css/primitives/code/types.ts +7 -1
- package/src/css/primitives/heading/heading.ts +4 -0
- package/src/css/primitives/heading/types.ts +7 -1
- package/src/css/primitives/label/label.ts +4 -0
- package/src/css/primitives/label/types.ts +7 -1
- package/src/css/primitives/radio/radio.css.ts +1 -1
- package/src/css/primitives/root/root.css.ts +1 -1
- package/src/css/primitives/select/select.css.ts +7 -1
- package/src/css/primitives/selectable/selectable.css.ts +79 -70
- package/src/css/primitives/switch/switch.css.ts +10 -1
- package/src/css/primitives/text/text.ts +2 -0
- package/src/css/primitives/text/types.ts +6 -1
- package/src/css/primitives/textInput/textInput.css.ts +15 -3
- package/src/css/props/width/types.ts +1 -1
- package/src/css/props/width/width.css.ts +5 -2
- package/src/css/theme/buildCSSTheme.ts +4 -0
- package/src/css/types.ts +4 -0
- package/src/css/vars.css.ts +4 -0
- package/dist/_chunks-cjs/refractor.cjs +0 -22
- package/dist/_chunks-cjs/refractor.cjs.map +0 -1
- package/dist/css/index.cjs +0 -966
- package/dist/css/index.cjs.map +0 -1
- package/dist/css/index.d.cts +0 -1370
- package/dist/index.cjs +0 -4515
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2521
- package/dist/theme.cjs +0 -870
- package/dist/theme.cjs.map +0 -1
- package/dist/theme.d.cts +0 -499
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/popover/helpers.ts +0 -32
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -102
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -18
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -41
- package/src/core/utils/portal/portalProvider.tsx +0 -70
- /package/src/core/__workshop__/{boundary.tsx → Boundary.tsx} +0 -0
- /package/src/core/components/autocomplete/{autocompleteOption.tsx → AutocompleteOption.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{async.tsx → Async.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{constrainedHeight.tsx → ConstrainedHeight.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{focusAndBlur.tsx → FocusAndBlur.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{fullscreen.tsx → Fullscreen.tsx} +0 -0
- /package/src/core/components/breadcrumbs/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{activate.tsx → Activate.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{autoFocus.tsx → AutoFocus.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{layering.tsx → Layering.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{nested.tsx → Nested.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{onScroll.tsx → OnScroll.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{provider.tsx → Provider.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{wrapped.tsx → Wrapped.tsx} +0 -0
- /package/src/core/components/hotkeys/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/components/menu/{menuDivider.tsx → MenuDivider.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{asComponent.tsx → AsComponent.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{avatarMenu.tsx → AvatarMenu.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{closableMenuButton.tsx → ClosableMenuButton.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{constrainedInBoundary.tsx → ConstrainedInBoundary.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{customMenuItem.tsx → CustomMenuItem.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{customSelectedState.tsx → CustomSelectedState.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{disableFocusOnClose.tsx → DisableFocusOnClose.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{groups.tsx → Groups.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{menuGroupRight.tsx → MenuGroupRight.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{nestedMenu.tsx → NestedMenu.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{onCloseMenuButton.tsx → OnCloseMenuButton.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{selectedItem.tsx → SelectedItem.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{shouldFocus.tsx → ShouldFocus.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{withoutArrow.tsx → WithoutArrow.tsx} +0 -0
- /package/src/core/components/tab/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/components/toast/__workshop__/{hook.tsx → Hook.tsx} +0 -0
- /package/src/core/components/tree/__workshop__/{basic.tsx → Basic.tsx} +0 -0
- /package/src/core/components/tree/__workshop__/{tabFromElement.tsx → TabFromElement.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{changingProps.tsx → ChangingProps.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{elementScroll.tsx → ElementScroll.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{infiniteList.tsx → InfiniteList.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{windowScrolll.tsx → WindowScrolll.tsx} +0 -0
- /package/src/core/hooks/useMediaIndex/__workshop__/{test.tsx → Test.tsx} +0 -0
- /package/src/core/primitives/arrow/{arrow.tsx → Arrow.tsx} +0 -0
- /package/src/core/primitives/avatar/__workshop__/{withinButton.tsx → WithinButton.tsx} +0 -0
- /package/src/core/primitives/avatar/__workshop__/{withinMenuItem.tsx → WithinMenuItem.tsx} +0 -0
- /package/src/core/primitives/badge/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/primitives/box/{box.tsx → Box.tsx} +0 -0
- /package/src/core/primitives/box/__workshop__/{responsive.tsx → Responsive.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{custom.tsx → Custom.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{customIcons.tsx → CustomIcons.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{disabled.tsx → Disabled.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{mixedChildren.tsx → MixedChildren.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{textOverflow.tsx → TextOverflow.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{uploadButton.tsx → UploadButton.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{asButton.tsx → AsButton.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{asComponent.tsx → AsComponent.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{checkered.tsx → Checkered.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{interactive.tsx → Interactive.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{listNavigation.tsx → ListNavigation.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/primitives/checkbox/{checkbox.tsx → Checkbox.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{props.tsx → Props.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/primitives/code/{refractor.tsx → Refractor.tsx} +0 -0
- /package/src/core/primitives/code/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/flex/__workshop__/{gap.tsx → Gap.tsx} +0 -0
- /package/src/core/primitives/grid/__workshop__/{responsive.tsx → Responsive.tsx} +0 -0
- /package/src/core/primitives/heading/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/kbd/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/primitives/label/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/layer/__workshop__/{multipleRoots.tsx → MultipleRoots.tsx} +0 -0
- /package/src/core/primitives/layer/__workshop__/{nested.tsx → Nested.tsx} +0 -0
- /package/src/core/primitives/layer/__workshop__/{responsiveZOffset.tsx → ResponsiveZOffset.tsx} +0 -0
- /package/src/core/primitives/radio/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/primitives/radio/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/primitives/select/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
- /package/src/core/primitives/spinner/{animatedSpinnerIcon.tsx → AnimatedSpinnerIcon.tsx} +0 -0
- /package/src/core/primitives/srOnly/{srOnly.tsx → SrOnly.tsx} +0 -0
- /package/src/core/primitives/switch/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/primitives/switch/__workshop__/{props.tsx → Props.tsx} +0 -0
- /package/src/core/primitives/text/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{clearButton.tsx → ClearButton.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{customValidity.tsx → CustomValidity.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{states.tsx → States.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/utils/boundaryElement/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/utils/elementQuery/{elementQuery.tsx → ElementQuery.tsx} +0 -0
- /package/src/core/utils/portal/__workshop__/{named.tsx → Named.tsx} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { SpinnerIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon, CheckmarkIcon, RemoveIcon } from "@sanity/icons";
|
|
3
|
-
import { useState, isValidElement, useDebugValue, useSyncExternalStore, createContext, useContext, useRef, useImperativeHandle, useEffect, useMemo, useCallback, cloneElement, useReducer, Children, Fragment as Fragment$1, startTransition, useId, lazy, Suspense, useLayoutEffect, Component } from "react";
|
|
4
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { SpinnerIcon, CloseIcon, ChevronDownIcon, ChevronRightIcon, ToggleArrowRightIcon, CheckmarkIcon, RemoveIcon } from "@sanity/icons";
|
|
4
|
+
import { isValidElement, useDebugValue, useSyncExternalStore, createContext, use, useRef, useImperativeHandle, useEffect, useState, cloneElement, useReducer, Children, Fragment as Fragment$1, startTransition, useId, lazy, Suspense, useLayoutEffect, Component } from "react";
|
|
5
5
|
import { box, text, textOverflow, animatedSpinnerIcon, spinner, button, buttonLoadingBox, _arrow, vars, _arrowSvg, _arrowStrokeMask, _arrowStroke, _arrowShape, card, BREAKPOINTS, popoverCard, popover, _selectable, stack, textInput, textInputPrefix, textInputElement, _inputElement, _inputPresentation, textInputSuffix, breadcrumbs, container as container$1, dialogCard, dialogHeader, dialogContent, dialogScrollerShadowTop, dialogScroller, dialogScrollerShadowBottom, dialogFooter, dialog, dialogContainer, kbd, menu, menuDivider, toast, toastLayer, treeItem, label, avatar, avatarArrow, avatarInitials, avatarImage, avatarImageOutline, avatarCounter, avatarStack, badge, checkbox, checkboxInput, checkboxPresentation, code, heading, radio, radioInput, radioPresentation, select, selectPresentation, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, srOnly, _switch, _switchElement, _switchPresentation, _switchTrack, _switchThumb, textArea, tooltip, root } from "@sanity/ui/css";
|
|
6
6
|
import { isValidElementType } from "react-is";
|
|
7
|
-
import { detectOverflow, autoPlacement, flip, offset, shift, arrow, hide,
|
|
7
|
+
import { detectOverflow, useFloating, autoPlacement, flip, offset, shift, arrow, hide, autoUpdate } from "@floating-ui/react-dom";
|
|
8
8
|
import { motion, AnimatePresence } from "framer-motion";
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
10
10
|
import { assignInlineVars } from "@vanilla-extract/dynamic";
|
|
@@ -119,18 +119,13 @@ function isArray(val) {
|
|
|
119
119
|
function isRecord(value) {
|
|
120
120
|
return !!(value && typeof value == "object" && !Array.isArray(value));
|
|
121
121
|
}
|
|
122
|
-
function _getArrayProp(val, defaultVal) {
|
|
123
|
-
return val === void 0 ? defaultVal || EMPTY_ARRAY : Array.isArray(val) ? val : [val];
|
|
124
|
-
}
|
|
125
122
|
function _getResponsiveProp(val, defaultVal) {
|
|
126
123
|
return val === void 0 ? defaultVal || EMPTY_ARRAY : isArray(val) || isRecord(val) ? val : [val];
|
|
127
124
|
}
|
|
128
125
|
function useResponsiveProp(val, defaultVal) {
|
|
129
126
|
const $ = c(3);
|
|
130
127
|
let t0;
|
|
131
|
-
$[0] !== defaultVal || $[1] !== val ? (t0 =
|
|
132
|
-
const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
|
|
133
|
-
return hash !== cachedHash && setCache([_getResponsiveProp(val, defaultVal), hash]), cachedVal;
|
|
128
|
+
return $[0] !== defaultVal || $[1] !== val ? (t0 = _getResponsiveProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
|
|
134
129
|
}
|
|
135
130
|
const DEFAULT_BOX_ELEMENT = "div";
|
|
136
131
|
function Box(props) {
|
|
@@ -272,40 +267,54 @@ function Box(props) {
|
|
|
272
267
|
}
|
|
273
268
|
const DEFAULT_TEXT_ELEMENT = "div";
|
|
274
269
|
function Text(props) {
|
|
275
|
-
const $ = c(
|
|
276
|
-
let align, children, className, flex, muted, rest, t1, t2, t3, t4, textOverflowProp;
|
|
270
|
+
const $ = c(44), t0 = props;
|
|
271
|
+
let align, children, className, flex, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, muted, rest, t1, t2, t3, t4, textOverflowProp;
|
|
277
272
|
$[0] !== t0 ? ({
|
|
278
273
|
align,
|
|
279
274
|
as: t1,
|
|
280
275
|
children,
|
|
281
276
|
className,
|
|
282
277
|
flex,
|
|
278
|
+
margin,
|
|
279
|
+
marginX,
|
|
280
|
+
marginY,
|
|
281
|
+
marginTop,
|
|
282
|
+
marginRight,
|
|
283
|
+
marginBottom,
|
|
284
|
+
marginLeft,
|
|
283
285
|
maxWidth: t2,
|
|
284
286
|
muted,
|
|
285
287
|
size: t3,
|
|
286
288
|
textOverflow: textOverflowProp,
|
|
287
289
|
weight: t4,
|
|
288
290
|
...rest
|
|
289
|
-
} = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] =
|
|
291
|
+
} = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = margin, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = muted, $[13] = rest, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], margin = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], muted = $[12], rest = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], textOverflowProp = $[18]);
|
|
290
292
|
const Element2 = t1 === void 0 ? DEFAULT_TEXT_ELEMENT : t1, maxWidth = t2 === void 0 ? "fill" : t2, size2 = t3 === void 0 ? 2 : t3, weight = t4 === void 0 ? "regular" : t4;
|
|
291
293
|
let t5;
|
|
292
|
-
$[
|
|
294
|
+
$[19] !== align || $[20] !== className || $[21] !== flex || $[22] !== margin || $[23] !== marginBottom || $[24] !== marginLeft || $[25] !== marginRight || $[26] !== marginTop || $[27] !== marginX || $[28] !== marginY || $[29] !== maxWidth || $[30] !== muted || $[31] !== size2 || $[32] !== weight ? (t5 = text({
|
|
293
295
|
className,
|
|
294
296
|
align,
|
|
295
297
|
flex,
|
|
298
|
+
margin,
|
|
299
|
+
marginX,
|
|
300
|
+
marginY,
|
|
301
|
+
marginTop,
|
|
302
|
+
marginRight,
|
|
303
|
+
marginBottom,
|
|
304
|
+
marginLeft,
|
|
296
305
|
maxWidth,
|
|
297
306
|
muted,
|
|
298
307
|
size: size2,
|
|
299
308
|
weight
|
|
300
|
-
}), $[
|
|
309
|
+
}), $[19] = align, $[20] = className, $[21] = flex, $[22] = margin, $[23] = marginBottom, $[24] = marginLeft, $[25] = marginRight, $[26] = marginTop, $[27] = marginX, $[28] = marginY, $[29] = maxWidth, $[30] = muted, $[31] = size2, $[32] = weight, $[33] = t5) : t5 = $[33];
|
|
301
310
|
let t6;
|
|
302
|
-
$[
|
|
311
|
+
$[34] !== textOverflowProp ? (t6 = textOverflow({
|
|
303
312
|
textOverflow: textOverflowProp
|
|
304
|
-
}), $[
|
|
313
|
+
}), $[34] = textOverflowProp, $[35] = t6) : t6 = $[35];
|
|
305
314
|
let t7;
|
|
306
|
-
$[
|
|
315
|
+
$[36] !== children || $[37] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[36] = children, $[37] = t6, $[38] = t7) : t7 = $[38];
|
|
307
316
|
let t8;
|
|
308
|
-
return $[
|
|
317
|
+
return $[39] !== Element2 || $[40] !== rest || $[41] !== t5 || $[42] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Text", ...rest, className: t5, children: t7 }), $[39] = Element2, $[40] = rest, $[41] = t5, $[42] = t7, $[43] = t8) : t8 = $[43], t8;
|
|
309
318
|
}
|
|
310
319
|
function AnimatedSpinnerIcon(props) {
|
|
311
320
|
const $ = c(5);
|
|
@@ -339,77 +348,79 @@ function Spinner(props) {
|
|
|
339
348
|
}
|
|
340
349
|
const DEFAULT_BUTTON_ELEMENT = "button";
|
|
341
350
|
function Button(props) {
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
const $ = c(88), t0 = props;
|
|
352
|
+
let Element2, IconComponent, IconRightComponent, align, children, className, disabled, flex, fontSize, gap, gapX, gapY, href, justify, loading, mode, muted, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, radius, rest, selected, text2, textAlign, textOverflow2, textWeight, tone, type, width;
|
|
353
|
+
if ($[0] !== props.padding || $[1] !== t0) {
|
|
354
|
+
const {
|
|
355
|
+
align: t12,
|
|
356
|
+
as: t22,
|
|
357
|
+
children: t32,
|
|
358
|
+
className: t42,
|
|
359
|
+
disabled: t52,
|
|
360
|
+
flex: t62,
|
|
361
|
+
fontSize: t72,
|
|
362
|
+
gap: _gap,
|
|
363
|
+
gapX: t82,
|
|
364
|
+
gapY: t92,
|
|
365
|
+
icon: t10,
|
|
366
|
+
iconRight: t11,
|
|
367
|
+
justify: t122,
|
|
368
|
+
loading: t13,
|
|
369
|
+
mode: t14,
|
|
370
|
+
muted: t15,
|
|
371
|
+
padding: t16,
|
|
372
|
+
paddingX: t17,
|
|
373
|
+
paddingY: t18,
|
|
374
|
+
paddingTop: t19,
|
|
375
|
+
paddingBottom: t20,
|
|
376
|
+
paddingLeft: t21,
|
|
377
|
+
paddingRight: t222,
|
|
378
|
+
radius: t23,
|
|
379
|
+
selected: t24,
|
|
380
|
+
text: t25,
|
|
381
|
+
textAlign: t26,
|
|
382
|
+
textOverflow: t27,
|
|
383
|
+
textWeight: t28,
|
|
384
|
+
tone: t29,
|
|
385
|
+
type: t30,
|
|
386
|
+
width: t31,
|
|
387
|
+
...t322
|
|
388
|
+
} = t0;
|
|
389
|
+
children = t32, className = t42, disabled = t52, flex = t62, gapX = t82, gapY = t92, IconComponent = t10, IconRightComponent = t11, loading = t13, paddingX = t17, paddingY = t18, paddingTop = t19, paddingBottom = t20, paddingLeft = t21, paddingRight = t222, selected = t24, text2 = t25, textAlign = t26, width = t31, rest = t322, align = t12 === void 0 ? "center" : t12, Element2 = t22 === void 0 ? DEFAULT_BUTTON_ELEMENT : t22, fontSize = t72 === void 0 ? 1 : t72, justify = t122 === void 0 ? "center" : t122, mode = t14 === void 0 ? "default" : t14, muted = t15 === void 0 ? !1 : t15, padding = t16 === void 0 ? 3 : t16, radius = t23 === void 0 ? 2 : t23, textOverflow2 = t27 === void 0 ? "ellipsis" : t27, textWeight = t28 === void 0 ? "medium" : t28, tone = t29 === void 0 ? "default" : t29, type = t30 === void 0 ? "button" : t30, gap = _gap ?? props.padding ?? 3, href = void 0, "href" in rest && (href = typeof rest.href == "string" ? rest.href : void 0, delete rest.href), $[0] = props.padding, $[1] = t0, $[2] = Element2, $[3] = IconComponent, $[4] = IconRightComponent, $[5] = align, $[6] = children, $[7] = className, $[8] = disabled, $[9] = flex, $[10] = fontSize, $[11] = gap, $[12] = gapX, $[13] = gapY, $[14] = href, $[15] = justify, $[16] = loading, $[17] = mode, $[18] = muted, $[19] = padding, $[20] = paddingBottom, $[21] = paddingLeft, $[22] = paddingRight, $[23] = paddingTop, $[24] = paddingX, $[25] = paddingY, $[26] = radius, $[27] = rest, $[28] = selected, $[29] = text2, $[30] = textAlign, $[31] = textOverflow2, $[32] = textWeight, $[33] = tone, $[34] = type, $[35] = width;
|
|
390
|
+
} else
|
|
391
|
+
Element2 = $[2], IconComponent = $[3], IconRightComponent = $[4], align = $[5], children = $[6], className = $[7], disabled = $[8], flex = $[9], fontSize = $[10], gap = $[11], gapX = $[12], gapY = $[13], href = $[14], justify = $[15], loading = $[16], mode = $[17], muted = $[18], padding = $[19], paddingBottom = $[20], paddingLeft = $[21], paddingRight = $[22], paddingTop = $[23], paddingX = $[24], paddingY = $[25], radius = $[26], rest = $[27], selected = $[28], text2 = $[29], textAlign = $[30], textOverflow2 = $[31], textWeight = $[32], tone = $[33], type = $[34], width = $[35];
|
|
392
|
+
let t1;
|
|
393
|
+
$[36] !== className || $[37] !== flex || $[38] !== mode || $[39] !== radius || $[40] !== tone || $[41] !== width ? (t1 = button({
|
|
346
394
|
className,
|
|
347
|
-
disabled,
|
|
348
395
|
flex,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
} =
|
|
377
|
-
let href;
|
|
378
|
-
return "href" in rest && (href = typeof rest.href == "string" ? rest.href : href, delete rest.href), /* @__PURE__ */ jsxs(
|
|
379
|
-
Element2,
|
|
380
|
-
{
|
|
381
|
-
"data-ui": "Button",
|
|
382
|
-
...rest,
|
|
383
|
-
className: button({
|
|
384
|
-
className,
|
|
385
|
-
flex,
|
|
386
|
-
mode,
|
|
387
|
-
radius,
|
|
388
|
-
tone,
|
|
389
|
-
width
|
|
390
|
-
}),
|
|
391
|
-
"data-disabled": loading || disabled ? "" : void 0,
|
|
392
|
-
"data-selected": selected ? "" : void 0,
|
|
393
|
-
disabled: !!(loading || disabled),
|
|
394
|
-
href: disabled ? void 0 : href,
|
|
395
|
-
type,
|
|
396
|
-
children: [
|
|
397
|
-
!!loading && /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: buttonLoadingBox(), display: "flex", flex: 1, justifyContent: "center", width: "fill", children: /* @__PURE__ */ jsx(Spinner, { size: fontSize }) }),
|
|
398
|
-
(IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Box, { alignItems: align, as: "span", display: "flex", flex: 1, gap, gapX, gapY, justifyContent: justify, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children: [
|
|
399
|
-
IconComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
|
|
400
|
-
isValidElement(IconComponent) && IconComponent,
|
|
401
|
-
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
402
|
-
] }),
|
|
403
|
-
text2 && /* @__PURE__ */ jsx(Box, { as: "span", maxWidth: "auto", children: /* @__PURE__ */ jsx(Text, { align: textAlign, as: "span", muted, size: fontSize, textOverflow: textOverflow2, weight: textWeight, children: text2 }) }),
|
|
404
|
-
IconRightComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
|
|
405
|
-
isValidElement(IconRightComponent) && IconRightComponent,
|
|
406
|
-
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
407
|
-
] })
|
|
408
|
-
] }),
|
|
409
|
-
children && /* @__PURE__ */ jsx(Box, { as: "span", flex: 1, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children })
|
|
410
|
-
]
|
|
411
|
-
}
|
|
412
|
-
);
|
|
396
|
+
mode,
|
|
397
|
+
radius,
|
|
398
|
+
tone,
|
|
399
|
+
width
|
|
400
|
+
}), $[36] = className, $[37] = flex, $[38] = mode, $[39] = radius, $[40] = tone, $[41] = width, $[42] = t1) : t1 = $[42];
|
|
401
|
+
const t2 = loading || disabled ? "" : props["data-disabled"], t3 = selected ? "" : props["data-selected"], t4 = !!(loading || disabled), t5 = disabled ? void 0 : href;
|
|
402
|
+
let t6;
|
|
403
|
+
$[43] !== fontSize || $[44] !== loading ? (t6 = !!loading && /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: buttonLoadingBox(), display: "flex", flex: 1, justifyContent: "center", width: "fill", children: /* @__PURE__ */ jsx(Spinner, { size: fontSize }) }), $[43] = fontSize, $[44] = loading, $[45] = t6) : t6 = $[45];
|
|
404
|
+
let t7;
|
|
405
|
+
$[46] !== IconComponent || $[47] !== IconRightComponent || $[48] !== align || $[49] !== fontSize || $[50] !== gap || $[51] !== gapX || $[52] !== gapY || $[53] !== justify || $[54] !== muted || $[55] !== padding || $[56] !== paddingBottom || $[57] !== paddingLeft || $[58] !== paddingRight || $[59] !== paddingTop || $[60] !== paddingX || $[61] !== paddingY || $[62] !== text2 || $[63] !== textAlign || $[64] !== textOverflow2 || $[65] !== textWeight ? (t7 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Box, { alignItems: align, as: "span", display: "flex", flex: 1, gap, gapX, gapY, justifyContent: justify, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children: [
|
|
406
|
+
IconComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
|
|
407
|
+
isValidElement(IconComponent) && IconComponent,
|
|
408
|
+
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
409
|
+
] }),
|
|
410
|
+
text2 && /* @__PURE__ */ jsx(Box, { as: "span", maxWidth: "auto", children: /* @__PURE__ */ jsx(Text, { align: textAlign, as: "span", muted, size: fontSize, textOverflow: textOverflow2, weight: textWeight, children: text2 }) }),
|
|
411
|
+
IconRightComponent && /* @__PURE__ */ jsxs(Text, { as: "span", flex: "none", muted: !0, size: fontSize, children: [
|
|
412
|
+
isValidElement(IconRightComponent) && IconRightComponent,
|
|
413
|
+
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
414
|
+
] })
|
|
415
|
+
] }), $[46] = IconComponent, $[47] = IconRightComponent, $[48] = align, $[49] = fontSize, $[50] = gap, $[51] = gapX, $[52] = gapY, $[53] = justify, $[54] = muted, $[55] = padding, $[56] = paddingBottom, $[57] = paddingLeft, $[58] = paddingRight, $[59] = paddingTop, $[60] = paddingX, $[61] = paddingY, $[62] = text2, $[63] = textAlign, $[64] = textOverflow2, $[65] = textWeight, $[66] = t7) : t7 = $[66];
|
|
416
|
+
let t8;
|
|
417
|
+
$[67] !== children || $[68] !== padding || $[69] !== paddingBottom || $[70] !== paddingLeft || $[71] !== paddingRight || $[72] !== paddingTop || $[73] !== paddingX || $[74] !== paddingY ? (t8 = children && /* @__PURE__ */ jsx(Box, { as: "span", flex: 1, padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight, children }), $[67] = children, $[68] = padding, $[69] = paddingBottom, $[70] = paddingLeft, $[71] = paddingRight, $[72] = paddingTop, $[73] = paddingX, $[74] = paddingY, $[75] = t8) : t8 = $[75];
|
|
418
|
+
let t9;
|
|
419
|
+
return $[76] !== Element2 || $[77] !== rest || $[78] !== t1 || $[79] !== t2 || $[80] !== t3 || $[81] !== t4 || $[82] !== t5 || $[83] !== t6 || $[84] !== t7 || $[85] !== t8 || $[86] !== type ? (t9 = /* @__PURE__ */ jsxs(Element2, { "data-ui": "Button", ...rest, className: t1, "data-disabled": t2, "data-selected": t3, disabled: t4, href: t5, type, children: [
|
|
420
|
+
t6,
|
|
421
|
+
t7,
|
|
422
|
+
t8
|
|
423
|
+
] }), $[76] = Element2, $[77] = rest, $[78] = t1, $[79] = t2, $[80] = t3, $[81] = t4, $[82] = t5, $[83] = t6, $[84] = t7, $[85] = t8, $[86] = type, $[87] = t9) : t9 = $[87], t9;
|
|
413
424
|
}
|
|
414
425
|
function useMatchMedia(mediaQueryString, getServerSnapshot2) {
|
|
415
426
|
const $ = c(4);
|
|
@@ -423,9 +434,9 @@ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
|
|
|
423
434
|
return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], useSyncExternalStore(t0, t1, getServerSnapshot2);
|
|
424
435
|
}
|
|
425
436
|
function usePrefersReducedMotion(t0) {
|
|
426
|
-
return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$
|
|
437
|
+
return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$c : t0);
|
|
427
438
|
}
|
|
428
|
-
function _temp$
|
|
439
|
+
function _temp$c() {
|
|
429
440
|
return !1;
|
|
430
441
|
}
|
|
431
442
|
const origin = {
|
|
@@ -469,26 +480,19 @@ function getGlobalScope() {
|
|
|
469
480
|
const globalScope = getGlobalScope();
|
|
470
481
|
function createGlobalScopedContext(key2, defaultValue) {
|
|
471
482
|
const symbol = Symbol.for(key2);
|
|
472
|
-
if (typeof document > "u")
|
|
473
|
-
|
|
483
|
+
if (typeof document > "u") {
|
|
484
|
+
const context = createContext(defaultValue);
|
|
485
|
+
return context.displayName = key2, context;
|
|
486
|
+
}
|
|
474
487
|
const symbolMap = globalScope;
|
|
475
488
|
return symbolMap[symbol] = symbolMap[symbol] || createContext(defaultValue), symbolMap[symbol];
|
|
476
489
|
}
|
|
477
|
-
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/
|
|
478
|
-
version: 0,
|
|
479
|
-
element: null
|
|
480
|
-
};
|
|
481
|
-
function useBoundaryElement() {
|
|
482
|
-
const value = useContext(BoundaryElementContext);
|
|
483
|
-
if (value && (!isRecord(value) || value.version !== 0))
|
|
484
|
-
throw new Error("useBoundaryElement(): the context value is not compatible");
|
|
485
|
-
return value || DEFAULT_VALUE;
|
|
486
|
-
}
|
|
490
|
+
const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/v4/boundaryElement", null);
|
|
487
491
|
function getElementRef(element) {
|
|
488
492
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
489
493
|
return mayWarn ? element.ref : (getter = Object.getOwnPropertyDescriptor(element, "ref")?.get, mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning, mayWarn ? element.props.ref : element.props.ref || element.ref);
|
|
490
494
|
}
|
|
491
|
-
const CardContext = createGlobalScopedContext("@sanity/ui/
|
|
495
|
+
const CardContext = createGlobalScopedContext("@sanity/ui/v4/card", null);
|
|
492
496
|
function CardProvider(props) {
|
|
493
497
|
const $ = c(7), {
|
|
494
498
|
children,
|
|
@@ -496,22 +500,26 @@ function CardProvider(props) {
|
|
|
496
500
|
scheme,
|
|
497
501
|
unstable_CompatProvider
|
|
498
502
|
} = props;
|
|
499
|
-
let t0
|
|
500
|
-
$[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (
|
|
503
|
+
let t0;
|
|
504
|
+
$[0] !== scheme || $[1] !== tone || $[2] !== unstable_CompatProvider ? (t0 = {
|
|
501
505
|
tone,
|
|
502
506
|
scheme,
|
|
503
507
|
unstable_CompatProvider
|
|
504
|
-
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] =
|
|
505
|
-
let
|
|
506
|
-
return $[4] !== children || $[5] !== t0 ? (
|
|
508
|
+
}, $[0] = scheme, $[1] = tone, $[2] = unstable_CompatProvider, $[3] = t0) : t0 = $[3];
|
|
509
|
+
let t1;
|
|
510
|
+
return $[4] !== children || $[5] !== t0 ? (t1 = /* @__PURE__ */ jsx(CardContext, { value: t0, children }), $[4] = children, $[5] = t0, $[6] = t1) : t1 = $[6], t1;
|
|
507
511
|
}
|
|
508
512
|
function useCard() {
|
|
509
|
-
const card2 =
|
|
513
|
+
const card2 = use(CardContext);
|
|
514
|
+
return assertCardContext(card2), card2;
|
|
515
|
+
}
|
|
516
|
+
function assertCardContext(card2) {
|
|
510
517
|
if (!card2)
|
|
511
|
-
throw new Error("useCard(): missing context value"
|
|
512
|
-
|
|
518
|
+
throw new Error("useCard(): missing context value", {
|
|
519
|
+
cause: card2
|
|
520
|
+
});
|
|
513
521
|
}
|
|
514
|
-
const key = "@sanity/ui/
|
|
522
|
+
const key = "@sanity/ui/v4/portal", elementKey = Symbol.for(`${key}/element`), elementMap = globalScope;
|
|
515
523
|
elementMap[elementKey] = null;
|
|
516
524
|
const defaultContextValue = {
|
|
517
525
|
version: 0,
|
|
@@ -521,20 +529,24 @@ const defaultContextValue = {
|
|
|
521
529
|
}
|
|
522
530
|
}, PortalContext = createGlobalScopedContext(key, defaultContextValue);
|
|
523
531
|
function usePortal() {
|
|
524
|
-
const value =
|
|
532
|
+
const value = use(PortalContext);
|
|
533
|
+
return assertPortalContext(value), value;
|
|
534
|
+
}
|
|
535
|
+
function assertPortalContext(value) {
|
|
525
536
|
if (!value)
|
|
526
537
|
throw new Error("usePortal(): missing context value");
|
|
527
538
|
if (!isRecord(value) || value.version !== 0)
|
|
528
539
|
throw new Error("usePortal(): the context value is not compatible");
|
|
529
|
-
return value;
|
|
530
540
|
}
|
|
531
541
|
function Portal(props) {
|
|
532
542
|
const $ = c(6), {
|
|
533
543
|
children,
|
|
534
544
|
__unstable_name: name
|
|
535
|
-
} = props,
|
|
545
|
+
} = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
|
|
536
546
|
if (!portalElement)
|
|
537
547
|
return null;
|
|
548
|
+
const card2 = use(CardContext);
|
|
549
|
+
assertCardContext(card2);
|
|
538
550
|
let t0;
|
|
539
551
|
$[0] !== card2.scheme || $[1] !== children ? (t0 = /* @__PURE__ */ jsx(CardProvider, { tone: "transparent", scheme: card2.scheme, children }), $[0] = card2.scheme, $[1] = children, $[2] = t0) : t0 = $[2];
|
|
540
552
|
let t1;
|
|
@@ -549,16 +561,14 @@ function getLayerContext(contextValue) {
|
|
|
549
561
|
return contextValue;
|
|
550
562
|
throw new Error("could not get layer context");
|
|
551
563
|
}
|
|
552
|
-
const LayerContext = createGlobalScopedContext("@sanity/ui/
|
|
564
|
+
const LayerContext = createGlobalScopedContext("@sanity/ui/v4/layer", null);
|
|
553
565
|
function useLayer() {
|
|
554
|
-
const
|
|
566
|
+
const value = use(LayerContext);
|
|
555
567
|
if (!value)
|
|
556
568
|
throw new Error("useLayer(): missing context value");
|
|
557
569
|
try {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
} catch (t0) {
|
|
561
|
-
const err = t0;
|
|
570
|
+
return getLayerContext(value);
|
|
571
|
+
} catch (err) {
|
|
562
572
|
throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
|
|
563
573
|
}
|
|
564
574
|
}
|
|
@@ -578,9 +588,11 @@ const DEFAULT_POPOVER_DISTANCE = 4, DEFAULT_POPOVER_PADDING = 4, DEFAULT_POPOVER
|
|
|
578
588
|
};
|
|
579
589
|
function size(options) {
|
|
580
590
|
const {
|
|
581
|
-
apply,
|
|
582
591
|
margins,
|
|
583
|
-
padding = 0
|
|
592
|
+
padding = 0,
|
|
593
|
+
constrainSize,
|
|
594
|
+
matchReferenceWidth,
|
|
595
|
+
referenceWidthRef
|
|
584
596
|
} = options;
|
|
585
597
|
return {
|
|
586
598
|
name: "@sanity/ui/size",
|
|
@@ -602,12 +614,9 @@ function size(options) {
|
|
|
602
614
|
});
|
|
603
615
|
let maxWidth = 1 / 0, maxHeight = 1 / 0;
|
|
604
616
|
const floatingW = floating.width, floatingH = floating.height;
|
|
605
|
-
placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom))
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
elements,
|
|
609
|
-
referenceWidth: reference.width - margins[1] - margins[3]
|
|
610
|
-
});
|
|
617
|
+
placement.includes("top") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.top), placement.includes("right") && (maxWidth = floatingW - overflow.right, maxHeight = floatingH - (overflow.top + overflow.bottom)), placement.includes("bottom") && (maxWidth = floatingW - (overflow.left + overflow.right), maxHeight = floatingH - overflow.bottom), placement.includes("left") && (maxWidth = floatingW - overflow.left, maxHeight = floatingH - (overflow.top + overflow.bottom));
|
|
618
|
+
const availableWidth = maxWidth - margins[1] - margins[3], availableHeight = maxHeight - margins[0] - margins[2], referenceWidth = reference.width - margins[1] - margins[3];
|
|
619
|
+
referenceWidthRef.current = referenceWidth, matchReferenceWidth && (elements.floating.style.width = `${referenceWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${availableWidth}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
|
|
611
620
|
const nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height, targetW = nextDimensions.width;
|
|
612
621
|
return floatingW !== targetW || floatingH !== targetH ? {
|
|
613
622
|
reset: {
|
|
@@ -655,7 +664,7 @@ function compileCommands(cmds) {
|
|
|
655
664
|
}
|
|
656
665
|
const DEFAULT_ARROW_ELEMENT = "div";
|
|
657
666
|
function Arrow(props) {
|
|
658
|
-
const $ = c(
|
|
667
|
+
const $ = c(39), t0 = props;
|
|
659
668
|
let h, rest, style, t1, t2, w;
|
|
660
669
|
$[0] !== t0 ? ({
|
|
661
670
|
as: t1,
|
|
@@ -667,62 +676,65 @@ function Arrow(props) {
|
|
|
667
676
|
} = t0, $[0] = t0, $[1] = h, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2, $[6] = w) : (h = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5], w = $[6]);
|
|
668
677
|
const Element2 = t1 === void 0 ? DEFAULT_ARROW_ELEMENT : t1, radius = t2 === void 0 ? 0 : t2, center = w / 2;
|
|
669
678
|
let t3;
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
679
|
+
if ($[7] !== center || $[8] !== h || $[9] !== radius || $[10] !== w) {
|
|
680
|
+
const points = [{
|
|
681
|
+
x: 0,
|
|
682
|
+
y: 0
|
|
683
|
+
}, {
|
|
684
|
+
x: radius,
|
|
685
|
+
y: 0,
|
|
686
|
+
radius
|
|
687
|
+
}, {
|
|
688
|
+
x: center,
|
|
689
|
+
y: h - 1,
|
|
690
|
+
radius
|
|
691
|
+
}, {
|
|
692
|
+
x: w - radius,
|
|
693
|
+
y: 0,
|
|
694
|
+
radius
|
|
695
|
+
}, {
|
|
696
|
+
x: w,
|
|
697
|
+
y: 0
|
|
698
|
+
}], cmds = getRoundedCommands(points);
|
|
699
|
+
t3 = compileCommands(cmds), $[7] = center, $[8] = h, $[9] = radius, $[10] = w, $[11] = t3;
|
|
700
|
+
} else
|
|
701
|
+
t3 = $[11];
|
|
690
702
|
const path = t3, strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
|
|
691
703
|
let t4;
|
|
692
|
-
$[
|
|
704
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t4 = _arrow(), $[12] = t4) : t4 = $[12];
|
|
693
705
|
const t5 = `${w}px`;
|
|
694
706
|
let t6;
|
|
695
|
-
$[
|
|
707
|
+
$[13] !== t5 ? (t6 = assignInlineVars({
|
|
696
708
|
[vars.arrow.size]: t5
|
|
697
|
-
}), $[
|
|
709
|
+
}), $[13] = t5, $[14] = t6) : t6 = $[14];
|
|
698
710
|
let t7;
|
|
699
|
-
$[
|
|
711
|
+
$[15] !== style || $[16] !== t6 ? (t7 = {
|
|
700
712
|
...style,
|
|
701
713
|
...t6
|
|
702
|
-
}, $[
|
|
714
|
+
}, $[15] = style, $[16] = t6, $[17] = t7) : t7 = $[17];
|
|
703
715
|
let t8;
|
|
704
|
-
$[
|
|
716
|
+
$[18] === Symbol.for("react.memo_cache_sentinel") ? (t8 = _arrowSvg(), $[18] = t8) : t8 = $[18];
|
|
705
717
|
const t9 = `0 0 ${w} ${w}`;
|
|
706
718
|
let t10;
|
|
707
|
-
$[
|
|
719
|
+
$[19] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _arrowStrokeMask(), $[19] = t10) : t10 = $[19];
|
|
708
720
|
let t11;
|
|
709
|
-
$[
|
|
721
|
+
$[20] !== w ? (t11 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { className: t10, x: 0, width: w, height: w, fill: "white" }) }), $[20] = w, $[21] = t11) : t11 = $[21];
|
|
710
722
|
let t12;
|
|
711
|
-
$[
|
|
723
|
+
$[22] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _arrowStroke(), $[22] = t12) : t12 = $[22];
|
|
712
724
|
let t13;
|
|
713
|
-
$[
|
|
725
|
+
$[23] !== strokePath ? (t13 = /* @__PURE__ */ jsx("path", { className: t12, d: strokePath, mask: "url(#stroke-mask)" }), $[23] = strokePath, $[24] = t13) : t13 = $[24];
|
|
714
726
|
let t14;
|
|
715
|
-
$[
|
|
727
|
+
$[25] === Symbol.for("react.memo_cache_sentinel") ? (t14 = _arrowShape(), $[25] = t14) : t14 = $[25];
|
|
716
728
|
let t15;
|
|
717
|
-
$[
|
|
729
|
+
$[26] !== fillPath ? (t15 = /* @__PURE__ */ jsx("path", { className: t14, d: fillPath }), $[26] = fillPath, $[27] = t15) : t15 = $[27];
|
|
718
730
|
let t16;
|
|
719
|
-
$[
|
|
731
|
+
$[28] !== t11 || $[29] !== t13 || $[30] !== t15 || $[31] !== t9 || $[32] !== w ? (t16 = /* @__PURE__ */ jsxs("svg", { className: t8, width: w, height: w, viewBox: t9, children: [
|
|
720
732
|
t11,
|
|
721
733
|
t13,
|
|
722
734
|
t15
|
|
723
|
-
] }), $[
|
|
735
|
+
] }), $[28] = t11, $[29] = t13, $[30] = t15, $[31] = t9, $[32] = w, $[33] = t16) : t16 = $[33];
|
|
724
736
|
let t17;
|
|
725
|
-
return $[
|
|
737
|
+
return $[34] !== Element2 || $[35] !== rest || $[36] !== t16 || $[37] !== t7 ? (t17 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t4, style: t7, children: t16 }), $[34] = Element2, $[35] = rest, $[36] = t16, $[37] = t7, $[38] = t17) : t17 = $[38], t17;
|
|
726
738
|
}
|
|
727
739
|
const DEFAULT_FLEX_ELEMENT = "div";
|
|
728
740
|
function Flex(props) {
|
|
@@ -742,14 +754,13 @@ function Flex(props) {
|
|
|
742
754
|
}
|
|
743
755
|
const DEFAULT_CARD_ELEMENT = "div";
|
|
744
756
|
function Card(props) {
|
|
745
|
-
const $ = c(
|
|
746
|
-
let className,
|
|
757
|
+
const $ = c(37), t0 = props;
|
|
758
|
+
let className, pressed, rest, schemeProp, selected, style, t1, t2, t3, t4, t5;
|
|
747
759
|
$[0] !== t0 ? ({
|
|
748
760
|
__unstable_checkered: t1,
|
|
749
761
|
__unstable_focusRing: t2,
|
|
750
762
|
as: t3,
|
|
751
763
|
className,
|
|
752
|
-
disabled,
|
|
753
764
|
pressed,
|
|
754
765
|
radius: t4,
|
|
755
766
|
scheme: schemeProp,
|
|
@@ -757,26 +768,26 @@ function Card(props) {
|
|
|
757
768
|
style,
|
|
758
769
|
tone: t5,
|
|
759
770
|
...rest
|
|
760
|
-
} = t0, $[0] = t0, $[1] = className, $[2] =
|
|
761
|
-
const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent =
|
|
771
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = pressed, $[3] = rest, $[4] = schemeProp, $[5] = selected, $[6] = style, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5) : (className = $[1], pressed = $[2], rest = $[3], schemeProp = $[4], selected = $[5], style = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10], t5 = $[11]);
|
|
772
|
+
const checkered = t1 === void 0 ? !1 : t1, focusRing = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_CARD_ELEMENT : t3, radius = t4 === void 0 ? 0 : t4, toneProp = t5 === void 0 ? "default" : t5, parent = use(CardContext), tone = toneProp === "inherit" ? parent?.tone : toneProp, scheme = schemeProp === void 0 ? parent?.scheme : schemeProp, t6 = scheme === parent?.scheme ? void 0 : scheme;
|
|
762
773
|
let t7;
|
|
763
|
-
$[
|
|
774
|
+
$[12] !== className || $[13] !== t6 || $[14] !== tone ? (t7 = card({
|
|
764
775
|
className,
|
|
765
776
|
scheme: t6,
|
|
766
777
|
tone
|
|
767
|
-
}), $[
|
|
768
|
-
const t8 = checkered ? "" : void 0, t9 = disabled ? "" :
|
|
778
|
+
}), $[12] = className, $[13] = t6, $[14] = tone, $[15] = t7) : t7 = $[15];
|
|
779
|
+
const t8 = checkered ? "" : void 0, t9 = props.disabled ? "" : props["data-disabled"], t10 = focusRing ? "" : props["data-focus-ring"], t11 = pressed ? "" : props["data-pressed"], t12 = selected ? "" : props["data-selected"];
|
|
769
780
|
let t13;
|
|
770
|
-
$[
|
|
781
|
+
$[16] !== as || $[17] !== radius || $[18] !== rest || $[19] !== style || $[20] !== t10 || $[21] !== t11 || $[22] !== t12 || $[23] !== t7 || $[24] !== t8 || $[25] !== t9 ? (t13 = /* @__PURE__ */ jsx(Box, { "data-ui": "Card", ...rest, as, className: t7, "data-checkered": t8, "data-disabled": t9, "data-focus-ring": t10, "data-pressed": t11, "data-selected": t12, radius, style }), $[16] = as, $[17] = radius, $[18] = rest, $[19] = style, $[20] = t10, $[21] = t11, $[22] = t12, $[23] = t7, $[24] = t8, $[25] = t9, $[26] = t13) : t13 = $[26];
|
|
771
782
|
let node = t13;
|
|
772
783
|
if (scheme === parent?.scheme && tone === parent?.tone)
|
|
773
784
|
return node;
|
|
774
785
|
const t14 = scheme ?? "light", t15 = tone ?? "default", t16 = parent?.unstable_CompatProvider;
|
|
775
786
|
let t17;
|
|
776
|
-
if ($[
|
|
787
|
+
if ($[27] !== node || $[28] !== t14 || $[29] !== t15 || $[30] !== t16 ? (t17 = /* @__PURE__ */ jsx(CardProvider, { scheme: t14, tone: t15, unstable_CompatProvider: t16, children: node }), $[27] = node, $[28] = t14, $[29] = t15, $[30] = t16, $[31] = t17) : t17 = $[31], node = t17, parent?.unstable_CompatProvider) {
|
|
777
788
|
const CompatProvider = parent.unstable_CompatProvider, t18 = scheme ?? "light", t19 = tone ?? parent.tone;
|
|
778
789
|
let t20;
|
|
779
|
-
return $[
|
|
790
|
+
return $[32] !== CompatProvider || $[33] !== node || $[34] !== t18 || $[35] !== t19 ? (t20 = /* @__PURE__ */ jsx(CompatProvider, { scheme: t18, tone: t19, children: node }), $[32] = CompatProvider, $[33] = node, $[34] = t18, $[35] = t19, $[36] = t20) : t20 = $[36], t20;
|
|
780
791
|
}
|
|
781
792
|
return node;
|
|
782
793
|
}
|
|
@@ -874,24 +885,27 @@ function getServerSnapshot() {
|
|
|
874
885
|
}
|
|
875
886
|
function useMediaIndex() {
|
|
876
887
|
const $ = c(1);
|
|
877
|
-
let t0
|
|
878
|
-
$[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
888
|
+
let t0;
|
|
889
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = _createMediaStore(), $[0] = t0) : t0 = $[0];
|
|
879
890
|
const store = t0;
|
|
880
891
|
return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
|
|
881
892
|
}
|
|
882
893
|
function LayerProvider(props) {
|
|
883
|
-
const $ = c(
|
|
894
|
+
const $ = c(21), {
|
|
884
895
|
children,
|
|
885
896
|
zOffset: t0
|
|
886
|
-
} = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue =
|
|
897
|
+
} = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = use(LayerContext);
|
|
887
898
|
let t1;
|
|
888
899
|
$[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
|
|
889
|
-
const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1
|
|
900
|
+
const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1;
|
|
890
901
|
let t2;
|
|
891
|
-
$[2]
|
|
892
|
-
const
|
|
902
|
+
$[2] !== zOffsetProp ? (t2 = _getResponsiveProp(zOffsetProp), $[2] = zOffsetProp, $[3] = t2) : t2 = $[3];
|
|
903
|
+
const zOffset = t2, maxMediaIndex = Object.values(zOffset).length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + (zOffset[mediaIndex] ?? 0) : zOffset[mediaIndex] ?? 0;
|
|
893
904
|
let t3;
|
|
894
|
-
$[
|
|
905
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[4] = t3) : t3 = $[4];
|
|
906
|
+
const [, setChildLayers] = useState(t3), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
|
|
907
|
+
let t4;
|
|
908
|
+
$[5] !== parentRegisterChild || $[6] !== setChildLayers ? (t4 = (childLevel) => {
|
|
895
909
|
const parentDispose = parentRegisterChild?.(childLevel);
|
|
896
910
|
return childLevel !== void 0 ? setChildLayers((state) => {
|
|
897
911
|
const prevLen = state[childLevel] ?? 0, nextState = {
|
|
@@ -899,35 +913,35 @@ function LayerProvider(props) {
|
|
|
899
913
|
[childLevel]: prevLen + 1
|
|
900
914
|
};
|
|
901
915
|
return setSize(Object.keys(nextState).length), nextState;
|
|
902
|
-
}) : setSize(_temp$
|
|
916
|
+
}) : setSize(_temp$b), () => {
|
|
903
917
|
childLevel !== void 0 ? setChildLayers((state_0) => {
|
|
904
918
|
const nextState_0 = {
|
|
905
919
|
...state_0
|
|
906
920
|
};
|
|
907
921
|
return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
|
|
908
|
-
}) : setSize(_temp2$
|
|
922
|
+
}) : setSize(_temp2$3), parentDispose?.();
|
|
909
923
|
};
|
|
910
|
-
}, $[
|
|
911
|
-
const registerChild =
|
|
912
|
-
let
|
|
913
|
-
$[
|
|
914
|
-
let
|
|
915
|
-
$[
|
|
924
|
+
}, $[5] = parentRegisterChild, $[6] = setChildLayers, $[7] = t4) : t4 = $[7];
|
|
925
|
+
const registerChild = t4;
|
|
926
|
+
let t5, t6;
|
|
927
|
+
$[8] !== level || $[9] !== parentRegisterChild ? (t5 = () => parentRegisterChild?.(level), t6 = [level, parentRegisterChild], $[8] = level, $[9] = parentRegisterChild, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), useEffect(t5, t6);
|
|
928
|
+
let t7;
|
|
929
|
+
$[12] !== isTopLayer || $[13] !== level || $[14] !== registerChild || $[15] !== size2 || $[16] !== zIndex ? (t7 = {
|
|
916
930
|
version: 0,
|
|
917
931
|
isTopLayer,
|
|
918
932
|
level,
|
|
919
933
|
registerChild,
|
|
920
934
|
size: size2,
|
|
921
935
|
zIndex
|
|
922
|
-
}, $[
|
|
923
|
-
const value =
|
|
936
|
+
}, $[12] = isTopLayer, $[13] = level, $[14] = registerChild, $[15] = size2, $[16] = zIndex, $[17] = t7) : t7 = $[17];
|
|
937
|
+
const value = t7;
|
|
924
938
|
let t8;
|
|
925
|
-
return $[
|
|
939
|
+
return $[18] !== children || $[19] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext, { value, children }), $[18] = children, $[19] = value, $[20] = t8) : t8 = $[20], t8;
|
|
926
940
|
}
|
|
927
|
-
function _temp2$
|
|
941
|
+
function _temp2$3(v_0) {
|
|
928
942
|
return v_0 - 1;
|
|
929
943
|
}
|
|
930
|
-
function _temp$
|
|
944
|
+
function _temp$b(v) {
|
|
931
945
|
return v + 1;
|
|
932
946
|
}
|
|
933
947
|
const DEFAULT_LAYER_ELEMENT = "div";
|
|
@@ -973,52 +987,45 @@ function PopoverLayer(props) {
|
|
|
973
987
|
y: yProp,
|
|
974
988
|
...rest
|
|
975
989
|
} = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = maxWidth, $[9] = originX, $[10] = originY, $[11] = overflow, $[12] = padding, $[13] = placement, $[14] = radius, $[15] = referenceWidth, $[16] = rest, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = t0, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], maxWidth = $[8], originX = $[9], originY = $[10], overflow = $[11], padding = $[12], placement = $[13], radius = $[14], referenceWidth = $[15], rest = $[16], shadow = $[17], strategy = $[18], style = $[19], t0 = $[20], xProp = $[21], yProp = $[22]);
|
|
976
|
-
const tone = t0 === void 0 ? "inherit" : t0;
|
|
977
|
-
let t1;
|
|
978
|
-
t1 = marginsProp || DEFAULT_POPOVER_MARGINS;
|
|
979
|
-
const margins = t1, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0];
|
|
990
|
+
const tone = t0 === void 0 ? "inherit" : t0, margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t1 = animate ? "transform" : void 0;
|
|
980
991
|
let t2;
|
|
981
|
-
|
|
982
|
-
let t4;
|
|
983
|
-
$[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t3 || $[28] !== x || $[29] !== y ? (t4 = {
|
|
992
|
+
$[23] !== originX || $[24] !== originY || $[25] !== referenceWidth || $[26] !== style || $[27] !== t1 || $[28] !== x || $[29] !== y ? (t2 = {
|
|
984
993
|
left: x,
|
|
985
994
|
originX,
|
|
986
995
|
originY,
|
|
987
996
|
top: y,
|
|
988
997
|
width: referenceWidth,
|
|
989
|
-
willChange:
|
|
998
|
+
willChange: t1,
|
|
990
999
|
...style
|
|
991
|
-
}, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] =
|
|
992
|
-
const rootStyle = t2;
|
|
1000
|
+
}, $[23] = originX, $[24] = originY, $[25] = referenceWidth, $[26] = style, $[27] = t1, $[28] = x, $[29] = y, $[30] = t2) : t2 = $[30];
|
|
1001
|
+
const rootStyle = t2, t3 = arrowX !== null ? arrowX : void 0, t4 = arrowY !== null ? arrowY : void 0;
|
|
993
1002
|
let t5;
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
left: t6,
|
|
998
|
-
top: t7,
|
|
1003
|
+
$[31] !== t3 || $[32] !== t4 ? (t5 = {
|
|
1004
|
+
left: t3,
|
|
1005
|
+
top: t4,
|
|
999
1006
|
right: void 0,
|
|
1000
1007
|
bottom: void 0
|
|
1001
|
-
}, $[31] =
|
|
1008
|
+
}, $[31] = t3, $[32] = t4, $[33] = t5) : t5 = $[33];
|
|
1002
1009
|
const arrowStyle = t5;
|
|
1010
|
+
let t6;
|
|
1011
|
+
$[34] === Symbol.for("react.memo_cache_sentinel") ? (t6 = popoverCard(), $[34] = t6) : t6 = $[34];
|
|
1012
|
+
let t7;
|
|
1013
|
+
$[35] !== animate ? (t7 = animate ? ["hidden", "initial"] : void 0, $[35] = animate, $[36] = t7) : t7 = $[36];
|
|
1014
|
+
let t8;
|
|
1015
|
+
$[37] !== animate ? (t8 = animate ? ["visible", "scaleIn"] : void 0, $[37] = animate, $[38] = t8) : t8 = $[38];
|
|
1003
1016
|
let t9;
|
|
1004
|
-
$[
|
|
1017
|
+
$[39] !== animate ? (t9 = animate ? ["hidden", "scaleOut"] : void 0, $[39] = animate, $[40] = t9) : t9 = $[40];
|
|
1005
1018
|
let t10;
|
|
1006
|
-
$[
|
|
1019
|
+
$[41] !== children || $[42] !== padding ? (t10 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[41] = children, $[42] = padding, $[43] = t10) : t10 = $[43];
|
|
1007
1020
|
let t11;
|
|
1008
|
-
$[
|
|
1021
|
+
$[44] !== maxWidth || $[45] !== overflow || $[46] !== t10 ? (t11 = /* @__PURE__ */ jsx(Flex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, maxWidth, overflow, children: t10 }), $[44] = maxWidth, $[45] = overflow, $[46] = t10, $[47] = t11) : t11 = $[47];
|
|
1009
1022
|
let t12;
|
|
1010
|
-
$[
|
|
1023
|
+
$[48] !== arrow2 || $[49] !== arrowRef || $[50] !== arrowStyle ? (t12 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow2, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t12) : t12 = $[51];
|
|
1011
1024
|
let t13;
|
|
1012
|
-
$[
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
$[48] !== arrow2 || $[49] !== arrowRef || $[50] !== arrowStyle ? (t15 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow2, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t15) : t15 = $[51];
|
|
1017
|
-
let t16;
|
|
1018
|
-
return $[52] !== placement || $[53] !== radius || $[54] !== rest || $[55] !== rootStyle || $[56] !== shadow || $[57] !== strategy || $[58] !== t10 || $[59] !== t11 || $[60] !== t12 || $[61] !== t14 || $[62] !== t15 || $[63] !== tone ? (t16 = /* @__PURE__ */ jsxs(Layer, { className: t9, "data-ui": "Popover", ...rest, as: motion.div, "data-context-tone": tone, "data-placement": placement, flexDirection: "column", display: "flex", position: strategy, radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t10, animate: t11, exit: t12, children: [
|
|
1019
|
-
t14,
|
|
1020
|
-
t15
|
|
1021
|
-
] }), $[52] = placement, $[53] = radius, $[54] = rest, $[55] = rootStyle, $[56] = shadow, $[57] = strategy, $[58] = t10, $[59] = t11, $[60] = t12, $[61] = t14, $[62] = t15, $[63] = tone, $[64] = t16) : t16 = $[64], t16;
|
|
1025
|
+
return $[52] !== placement || $[53] !== radius || $[54] !== rest || $[55] !== rootStyle || $[56] !== shadow || $[57] !== strategy || $[58] !== t11 || $[59] !== t12 || $[60] !== t7 || $[61] !== t8 || $[62] !== t9 || $[63] !== tone ? (t13 = /* @__PURE__ */ jsxs(Layer, { className: t6, "data-ui": "Popover", ...rest, as: motion.div, "data-context-tone": tone, "data-placement": placement, flexDirection: "column", display: "flex", position: strategy, radius, shadow, sizing: "border", style: rootStyle, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t7, animate: t8, exit: t9, children: [
|
|
1026
|
+
t11,
|
|
1027
|
+
t12
|
|
1028
|
+
] }), $[52] = placement, $[53] = radius, $[54] = rest, $[55] = rootStyle, $[56] = shadow, $[57] = strategy, $[58] = t11, $[59] = t12, $[60] = t7, $[61] = t8, $[62] = t9, $[63] = tone, $[64] = t13) : t13 = $[64], t13;
|
|
1022
1029
|
}
|
|
1023
1030
|
const DEFAULT_POPOVER_ELEMENT = "div";
|
|
1024
1031
|
function ViewportOverlay() {
|
|
@@ -1035,78 +1042,83 @@ function ViewportOverlay() {
|
|
|
1035
1042
|
} }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
|
|
1036
1043
|
}
|
|
1037
1044
|
function Popover(props) {
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1045
|
+
const $ = c(113), t0 = props;
|
|
1046
|
+
let _fallbackPlacements, _floatingBoundary, _referenceBoundary, childProp, className, content2, disabled, forwardedRef, matchReferenceWidth, modal, open, padding, portal, referenceElement, rest, scheme, t1, t10, t11, t12, t13, t14, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
|
|
1047
|
+
if ($[0] !== t0) {
|
|
1048
|
+
const {
|
|
1049
|
+
__unstable_margins: t152,
|
|
1050
|
+
animate: t162,
|
|
1051
|
+
arrow: t172,
|
|
1052
|
+
as: t182,
|
|
1053
|
+
children: t192,
|
|
1054
|
+
className: t202,
|
|
1055
|
+
constrainSize: t212,
|
|
1056
|
+
content: t222,
|
|
1057
|
+
disabled: t232,
|
|
1058
|
+
fallbackPlacements: t242,
|
|
1059
|
+
matchReferenceWidth: t252,
|
|
1060
|
+
floatingBoundary: t262,
|
|
1061
|
+
modal: t272,
|
|
1062
|
+
onActivate,
|
|
1063
|
+
open: t282,
|
|
1064
|
+
overflow: t292,
|
|
1065
|
+
padding: t302,
|
|
1066
|
+
placement: t312,
|
|
1067
|
+
placementStrategy: t32,
|
|
1068
|
+
portal: t33,
|
|
1069
|
+
preventOverflow: t34,
|
|
1070
|
+
radius: t35,
|
|
1071
|
+
ref: t36,
|
|
1072
|
+
referenceBoundary: t37,
|
|
1073
|
+
referenceElement: t38,
|
|
1074
|
+
scheme: t39,
|
|
1075
|
+
shadow: t40,
|
|
1076
|
+
tone: t41,
|
|
1077
|
+
width: t42,
|
|
1078
|
+
zOffset: t43,
|
|
1079
|
+
updateRef: t44,
|
|
1080
|
+
...t45
|
|
1081
|
+
} = t0;
|
|
1082
|
+
t1 = t152, t2 = t162, t3 = t172, t4 = t182, childProp = t192, className = t202, t5 = t212, content2 = t222, disabled = t232, _fallbackPlacements = t242, matchReferenceWidth = t252, _floatingBoundary = t262, modal = t272, open = t282, t6 = t292, padding = t302, t7 = t312, t8 = t32, portal = t33, t9 = t34, t10 = t35, forwardedRef = t36, _referenceBoundary = t37, referenceElement = t38, scheme = t39, t11 = t40, t12 = t41, t13 = t42, t14 = t43, updateRef = t44, rest = t45, $[0] = t0, $[1] = _fallbackPlacements, $[2] = _floatingBoundary, $[3] = _referenceBoundary, $[4] = childProp, $[5] = className, $[6] = content2, $[7] = disabled, $[8] = forwardedRef, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = padding, $[13] = portal, $[14] = referenceElement, $[15] = rest, $[16] = scheme, $[17] = t1, $[18] = t10, $[19] = t11, $[20] = t12, $[21] = t13, $[22] = t14, $[23] = t2, $[24] = t3, $[25] = t4, $[26] = t5, $[27] = t6, $[28] = t7, $[29] = t8, $[30] = t9, $[31] = updateRef;
|
|
1083
|
+
} else
|
|
1084
|
+
_fallbackPlacements = $[1], _floatingBoundary = $[2], _referenceBoundary = $[3], childProp = $[4], className = $[5], content2 = $[6], disabled = $[7], forwardedRef = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], padding = $[12], portal = $[13], referenceElement = $[14], rest = $[15], scheme = $[16], t1 = $[17], t10 = $[18], t11 = $[19], t12 = $[20], t13 = $[21], t14 = $[22], t2 = $[23], t3 = $[24], t4 = $[25], t5 = $[26], t6 = $[27], t7 = $[28], t8 = $[29], t9 = $[30], updateRef = $[31];
|
|
1085
|
+
const margins = t1 === void 0 ? DEFAULT_POPOVER_MARGINS : t1, _animate = t2 === void 0 ? !1 : t2, arrowProp = t3 === void 0 ? !1 : t3, as = t4 === void 0 ? DEFAULT_POPOVER_ELEMENT : t4, constrainSize = t5 === void 0 ? !1 : t5, overflow = t6 === void 0 ? "hidden" : t6, placementProp = t7 === void 0 ? "bottom" : t7, placementStrategy = t8 === void 0 ? "flip" : t8, preventOverflow = t9 === void 0 ? !0 : t9, radius = t10 === void 0 ? 3 : t10, shadow = t11 === void 0 ? 3 : t11, tone = t12 === void 0 ? "inherit" : t12, widthProp = t13 === void 0 ? "auto" : t13, zOffsetProp = t14 === void 0 ? Z_OFFSETS.popover : t14, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? use(BoundaryElementContext), referenceBoundary = _referenceBoundary ?? use(BoundaryElementContext), animate = usePrefersReducedMotion() ? !1 : _animate;
|
|
1086
|
+
let t15;
|
|
1087
|
+
$[32] !== zOffsetProp ? (t15 = _getResponsiveProp(zOffsetProp), $[32] = zOffsetProp, $[33] = t15) : t15 = $[33];
|
|
1088
|
+
const zOffset = t15, ref = useRef(null), arrowRef = useRef(null);
|
|
1089
|
+
let t16;
|
|
1090
|
+
$[34] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[34] = t16) : t16 = $[34], useImperativeHandle(forwardedRef, t16);
|
|
1091
|
+
const referenceWidthRef = useRef(void 0);
|
|
1092
|
+
let t17;
|
|
1093
|
+
$[35] !== animate || $[36] !== arrowProp || $[37] !== constrainSize || $[38] !== fallbackPlacements || $[39] !== floatingBoundary || $[40] !== margins || $[41] !== matchReferenceWidth || $[42] !== placementProp || $[43] !== placementStrategy || $[44] !== preventOverflow || $[45] !== referenceBoundary ? (t17 = {
|
|
1094
|
+
animate,
|
|
1095
|
+
arrowProp,
|
|
1096
|
+
arrowRef,
|
|
1097
|
+
constrainSize,
|
|
1098
|
+
fallbackPlacements,
|
|
1099
|
+
floatingBoundary,
|
|
1100
|
+
margins,
|
|
1049
1101
|
matchReferenceWidth,
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
updateRef,
|
|
1071
|
-
...rest
|
|
1072
|
-
} = props, card2 = useCard(), animate = usePrefersReducedMotion() ? !1 : _animate, zOffset = useResponsiveProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
|
|
1073
|
-
useImperativeHandle(forwardedRef, () => ref.current);
|
|
1074
|
-
const referenceWidthRef = useRef(void 0), middleware = useMemo(() => {
|
|
1075
|
-
const ret = [];
|
|
1076
|
-
return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(autoPlacement({
|
|
1077
|
-
allowedPlacements: [placementProp].concat(fallbackPlacements)
|
|
1078
|
-
})) : ret.push(flip({
|
|
1079
|
-
boundary: floatingBoundary || void 0,
|
|
1080
|
-
fallbackPlacements,
|
|
1081
|
-
padding: DEFAULT_POPOVER_PADDING,
|
|
1082
|
-
rootBoundary
|
|
1083
|
-
}))), ret.push(offset({
|
|
1084
|
-
mainAxis: DEFAULT_POPOVER_DISTANCE
|
|
1085
|
-
})), (constrainSize || matchReferenceWidth) && ret.push(size({
|
|
1086
|
-
apply({
|
|
1087
|
-
availableWidth,
|
|
1088
|
-
availableHeight,
|
|
1089
|
-
elements,
|
|
1090
|
-
referenceWidth
|
|
1091
|
-
}) {
|
|
1092
|
-
referenceWidthRef.current = referenceWidth, matchReferenceWidth && (elements.floating.style.width = `${referenceWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${availableWidth}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
|
|
1093
|
-
},
|
|
1094
|
-
boundaryElement: floatingBoundary || void 0,
|
|
1095
|
-
margins,
|
|
1096
|
-
padding: DEFAULT_POPOVER_PADDING
|
|
1097
|
-
})), preventOverflow && ret.push(shift({
|
|
1098
|
-
boundary: floatingBoundary || void 0,
|
|
1099
|
-
rootBoundary,
|
|
1100
|
-
padding: DEFAULT_POPOVER_PADDING
|
|
1101
|
-
})), arrowProp && ret.push(arrow({
|
|
1102
|
-
element: arrowRef,
|
|
1103
|
-
padding: DEFAULT_POPOVER_PADDING
|
|
1104
|
-
})), animate && ret.push(origin), ret.push(hide({
|
|
1105
|
-
boundary: referenceBoundary || void 0,
|
|
1106
|
-
padding: DEFAULT_POPOVER_PADDING,
|
|
1107
|
-
strategy: "referenceHidden"
|
|
1108
|
-
})), ret;
|
|
1109
|
-
}, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, placementProp, placementStrategy, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
|
|
1102
|
+
placementProp,
|
|
1103
|
+
placementStrategy,
|
|
1104
|
+
preventOverflow,
|
|
1105
|
+
referenceBoundary,
|
|
1106
|
+
referenceWidthRef,
|
|
1107
|
+
rootBoundary: "viewport"
|
|
1108
|
+
}, $[35] = animate, $[36] = arrowProp, $[37] = constrainSize, $[38] = fallbackPlacements, $[39] = floatingBoundary, $[40] = margins, $[41] = matchReferenceWidth, $[42] = placementProp, $[43] = placementStrategy, $[44] = preventOverflow, $[45] = referenceBoundary, $[46] = t17) : t17 = $[46];
|
|
1109
|
+
const middleware = useMiddleware$1(t17);
|
|
1110
|
+
let t18;
|
|
1111
|
+
$[47] !== referenceElement ? (t18 = referenceElement ? {
|
|
1112
|
+
reference: referenceElement
|
|
1113
|
+
} : void 0, $[47] = referenceElement, $[48] = t18) : t18 = $[48];
|
|
1114
|
+
let t19;
|
|
1115
|
+
$[49] !== middleware || $[50] !== placementProp || $[51] !== t18 ? (t19 = {
|
|
1116
|
+
middleware,
|
|
1117
|
+
placement: placementProp,
|
|
1118
|
+
whileElementsMounted: autoUpdate,
|
|
1119
|
+
elements: t18
|
|
1120
|
+
}, $[49] = middleware, $[50] = placementProp, $[51] = t18, $[52] = t19) : t19 = $[52];
|
|
1121
|
+
const {
|
|
1110
1122
|
x,
|
|
1111
1123
|
y,
|
|
1112
1124
|
middlewareData,
|
|
@@ -1114,38 +1126,149 @@ function Popover(props) {
|
|
|
1114
1126
|
refs,
|
|
1115
1127
|
strategy,
|
|
1116
1128
|
update
|
|
1117
|
-
} = useFloating(
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
whileElementsMounted: autoUpdate,
|
|
1121
|
-
elements: referenceElement ? {
|
|
1122
|
-
reference: referenceElement
|
|
1123
|
-
} : void 0
|
|
1124
|
-
}), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setArrow = useCallback((arrowEl) => {
|
|
1125
|
-
arrowRef.current = arrowEl;
|
|
1126
|
-
}, []), setFloating = useCallback((node) => {
|
|
1129
|
+
} = useFloating(t19), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
|
|
1130
|
+
let t20;
|
|
1131
|
+
$[53] !== refs ? (t20 = (node) => {
|
|
1127
1132
|
ref.current = node, refs.setFloating(node);
|
|
1128
|
-
}, [refs
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1133
|
+
}, $[53] = refs, $[54] = t20) : t20 = $[54];
|
|
1134
|
+
const setFloating = t20;
|
|
1135
|
+
let t21;
|
|
1136
|
+
$[55] !== childProp ? (t21 = childProp ? getElementRef(childProp) : null, $[55] = childProp, $[56] = t21) : t21 = $[56];
|
|
1137
|
+
let t22;
|
|
1138
|
+
$[57] !== refs.reference.current ? (t22 = () => refs.reference.current, $[57] = refs.reference.current, $[58] = t22) : t22 = $[58], useImperativeHandle(t21, t22);
|
|
1139
|
+
let t23;
|
|
1140
|
+
bb0: {
|
|
1141
|
+
if (referenceElement) {
|
|
1142
|
+
t23 = childProp;
|
|
1143
|
+
break bb0;
|
|
1144
|
+
}
|
|
1145
|
+
if (!childProp) {
|
|
1146
|
+
t23 = null;
|
|
1147
|
+
break bb0;
|
|
1148
|
+
}
|
|
1149
|
+
let t242;
|
|
1150
|
+
$[59] !== childProp || $[60] !== refs.setReference ? (t242 = cloneElement(childProp, {
|
|
1151
|
+
ref: refs.setReference
|
|
1152
|
+
}), $[59] = childProp, $[60] = refs.setReference, $[61] = t242) : t242 = $[61], t23 = t242;
|
|
1153
|
+
}
|
|
1154
|
+
const child = t23;
|
|
1155
|
+
let t24, t25;
|
|
1156
|
+
if ($[62] !== update ? (t24 = () => update, t25 = [update], $[62] = update, $[63] = t24, $[64] = t25) : (t24 = $[63], t25 = $[64]), useImperativeHandle(updateRef, t24, t25), disabled) {
|
|
1157
|
+
let t262;
|
|
1158
|
+
return $[65] !== childProp ? (t262 = childProp || /* @__PURE__ */ jsx(Fragment, {}), $[65] = childProp, $[66] = t262) : t262 = $[66], t262;
|
|
1159
|
+
}
|
|
1160
|
+
let t26;
|
|
1161
|
+
$[67] !== modal ? (t26 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[67] = modal, $[68] = t26) : t26 = $[68];
|
|
1162
|
+
let t27;
|
|
1163
|
+
$[69] !== className ? (t27 = popover({
|
|
1164
|
+
className
|
|
1165
|
+
}), $[69] = className, $[70] = t27) : t27 = $[70];
|
|
1166
|
+
let t28;
|
|
1167
|
+
$[71] !== animate || $[72] !== arrowProp || $[73] !== arrowX || $[74] !== arrowY || $[75] !== as || $[76] !== content2 || $[77] !== margins || $[78] !== originX || $[79] !== originY || $[80] !== overflow || $[81] !== padding || $[82] !== placement || $[83] !== radius || $[84] !== referenceHidden || $[85] !== rest || $[86] !== scheme || $[87] !== setFloating || $[88] !== shadow || $[89] !== strategy || $[90] !== t27 || $[91] !== tone || $[92] !== widthProp || $[93] !== x || $[94] !== y || $[95] !== zOffset ? (t28 = /* @__PURE__ */ jsx(PopoverLayer, { ...rest, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef, arrowX, arrowY, as, className: t27, hidden: referenceHidden, maxWidth: widthProp, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, tone, strategy, x, y, zOffset, children: content2 }), $[71] = animate, $[72] = arrowProp, $[73] = arrowX, $[74] = arrowY, $[75] = as, $[76] = content2, $[77] = margins, $[78] = originX, $[79] = originY, $[80] = overflow, $[81] = padding, $[82] = placement, $[83] = radius, $[84] = referenceHidden, $[85] = rest, $[86] = scheme, $[87] = setFloating, $[88] = shadow, $[89] = strategy, $[90] = t27, $[91] = tone, $[92] = widthProp, $[93] = x, $[94] = y, $[95] = zOffset, $[96] = t28) : t28 = $[96];
|
|
1168
|
+
let t29;
|
|
1169
|
+
$[97] !== t26 || $[98] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1170
|
+
t26,
|
|
1171
|
+
t28
|
|
1172
|
+
] }), $[97] = t26, $[98] = t28, $[99] = t29) : t29 = $[99];
|
|
1173
|
+
const node_0 = t29;
|
|
1174
|
+
let children = open ? node_0 : null;
|
|
1175
|
+
if (open && portal) {
|
|
1176
|
+
let resolvedTone = tone;
|
|
1177
|
+
if (tone === "inherit") {
|
|
1178
|
+
const card2 = use(CardContext);
|
|
1179
|
+
assertCardContext(card2), resolvedTone = card2.tone;
|
|
1180
|
+
}
|
|
1181
|
+
const t302 = typeof portal == "string" ? portal : void 0, t312 = scheme ?? "light";
|
|
1182
|
+
let t32;
|
|
1183
|
+
$[100] !== node_0 || $[101] !== resolvedTone || $[102] !== t312 ? (t32 = /* @__PURE__ */ jsx(CardProvider, { tone: resolvedTone, scheme: t312, children: node_0 }), $[100] = node_0, $[101] = resolvedTone, $[102] = t312, $[103] = t32) : t32 = $[103];
|
|
1184
|
+
let t33;
|
|
1185
|
+
$[104] !== t302 || $[105] !== t32 ? (t33 = /* @__PURE__ */ jsx(Portal, { __unstable_name: t302, children: t32 }), $[104] = t302, $[105] = t32, $[106] = t33) : t33 = $[106], children = t33;
|
|
1186
|
+
}
|
|
1187
|
+
let t30;
|
|
1188
|
+
$[107] !== animate || $[108] !== children ? (t30 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[107] = animate, $[108] = children, $[109] = t30) : t30 = $[109];
|
|
1189
|
+
let t31;
|
|
1190
|
+
return $[110] !== child || $[111] !== t30 ? (t31 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1191
|
+
t30,
|
|
1147
1192
|
child
|
|
1148
|
-
] });
|
|
1193
|
+
] }), $[110] = child, $[111] = t30, $[112] = t31) : t31 = $[112], t31;
|
|
1194
|
+
}
|
|
1195
|
+
function useMiddleware$1(t0) {
|
|
1196
|
+
const $ = c(36), {
|
|
1197
|
+
animate,
|
|
1198
|
+
arrowProp,
|
|
1199
|
+
arrowRef,
|
|
1200
|
+
constrainSize,
|
|
1201
|
+
fallbackPlacements,
|
|
1202
|
+
floatingBoundary,
|
|
1203
|
+
margins,
|
|
1204
|
+
matchReferenceWidth,
|
|
1205
|
+
placementProp,
|
|
1206
|
+
placementStrategy,
|
|
1207
|
+
preventOverflow,
|
|
1208
|
+
referenceBoundary,
|
|
1209
|
+
referenceWidthRef,
|
|
1210
|
+
rootBoundary
|
|
1211
|
+
} = t0;
|
|
1212
|
+
let ret;
|
|
1213
|
+
if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== constrainSize || $[4] !== fallbackPlacements || $[5] !== floatingBoundary || $[6] !== margins || $[7] !== matchReferenceWidth || $[8] !== placementProp || $[9] !== placementStrategy || $[10] !== preventOverflow || $[11] !== referenceBoundary || $[12] !== referenceWidthRef || $[13] !== rootBoundary) {
|
|
1214
|
+
if (ret = [], constrainSize || preventOverflow)
|
|
1215
|
+
if (placementStrategy === "autoPlacement") {
|
|
1216
|
+
let t12;
|
|
1217
|
+
$[15] !== fallbackPlacements || $[16] !== placementProp ? (t12 = autoPlacement({
|
|
1218
|
+
allowedPlacements: [placementProp].concat(fallbackPlacements)
|
|
1219
|
+
}), $[15] = fallbackPlacements, $[16] = placementProp, $[17] = t12) : t12 = $[17], ret.push(t12);
|
|
1220
|
+
} else {
|
|
1221
|
+
const t12 = floatingBoundary || void 0;
|
|
1222
|
+
let t22;
|
|
1223
|
+
$[18] !== fallbackPlacements || $[19] !== rootBoundary || $[20] !== t12 ? (t22 = flip({
|
|
1224
|
+
boundary: t12,
|
|
1225
|
+
fallbackPlacements,
|
|
1226
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
1227
|
+
rootBoundary
|
|
1228
|
+
}), $[18] = fallbackPlacements, $[19] = rootBoundary, $[20] = t12, $[21] = t22) : t22 = $[21], ret.push(t22);
|
|
1229
|
+
}
|
|
1230
|
+
let t1;
|
|
1231
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel") ? (t1 = offset({
|
|
1232
|
+
mainAxis: DEFAULT_POPOVER_DISTANCE
|
|
1233
|
+
}), $[22] = t1) : t1 = $[22], ret.push(t1), constrainSize || matchReferenceWidth) {
|
|
1234
|
+
const t22 = floatingBoundary || void 0;
|
|
1235
|
+
let t32;
|
|
1236
|
+
$[23] !== constrainSize || $[24] !== margins || $[25] !== matchReferenceWidth || $[26] !== referenceWidthRef || $[27] !== t22 ? (t32 = size({
|
|
1237
|
+
boundaryElement: t22,
|
|
1238
|
+
constrainSize,
|
|
1239
|
+
margins,
|
|
1240
|
+
matchReferenceWidth,
|
|
1241
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
1242
|
+
referenceWidthRef
|
|
1243
|
+
}), $[23] = constrainSize, $[24] = margins, $[25] = matchReferenceWidth, $[26] = referenceWidthRef, $[27] = t22, $[28] = t32) : t32 = $[28], ret.push(t32);
|
|
1244
|
+
}
|
|
1245
|
+
if (preventOverflow) {
|
|
1246
|
+
const t22 = floatingBoundary || void 0;
|
|
1247
|
+
let t32;
|
|
1248
|
+
$[29] !== rootBoundary || $[30] !== t22 ? (t32 = shift({
|
|
1249
|
+
boundary: t22,
|
|
1250
|
+
rootBoundary,
|
|
1251
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
1252
|
+
}), $[29] = rootBoundary, $[30] = t22, $[31] = t32) : t32 = $[31], ret.push(t32);
|
|
1253
|
+
}
|
|
1254
|
+
if (arrowProp) {
|
|
1255
|
+
let t22;
|
|
1256
|
+
$[32] !== arrowRef ? (t22 = arrow({
|
|
1257
|
+
element: arrowRef,
|
|
1258
|
+
padding: DEFAULT_POPOVER_PADDING
|
|
1259
|
+
}), $[32] = arrowRef, $[33] = t22) : t22 = $[33], ret.push(t22);
|
|
1260
|
+
}
|
|
1261
|
+
animate && ret.push(origin);
|
|
1262
|
+
const t2 = referenceBoundary || void 0;
|
|
1263
|
+
let t3;
|
|
1264
|
+
$[34] !== t2 ? (t3 = hide({
|
|
1265
|
+
boundary: t2,
|
|
1266
|
+
padding: DEFAULT_POPOVER_PADDING,
|
|
1267
|
+
strategy: "referenceHidden"
|
|
1268
|
+
}), $[34] = t2, $[35] = t3) : t3 = $[35], ret.push(t3), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = constrainSize, $[4] = fallbackPlacements, $[5] = floatingBoundary, $[6] = margins, $[7] = matchReferenceWidth, $[8] = placementProp, $[9] = placementStrategy, $[10] = preventOverflow, $[11] = referenceBoundary, $[12] = referenceWidthRef, $[13] = rootBoundary, $[14] = ret;
|
|
1269
|
+
} else
|
|
1270
|
+
ret = $[14];
|
|
1271
|
+
return ret;
|
|
1149
1272
|
}
|
|
1150
1273
|
const DEFAULT_SELECTABLE_ELEMENT = "button";
|
|
1151
1274
|
function Selectable(props) {
|
|
@@ -1166,7 +1289,7 @@ function Selectable(props) {
|
|
|
1166
1289
|
radius,
|
|
1167
1290
|
tone
|
|
1168
1291
|
}), $[7] = className, $[8] = radius, $[9] = tone, $[10] = t2) : t2 = $[10];
|
|
1169
|
-
const t3 = selected ? "" :
|
|
1292
|
+
const t3 = selected ? "" : props["data-selected"];
|
|
1170
1293
|
let t4;
|
|
1171
1294
|
return $[11] !== as || $[12] !== rest || $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { ...rest, as, className: t2, "data-selected": t3 }), $[11] = as, $[12] = rest, $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15], t4;
|
|
1172
1295
|
}
|
|
@@ -1189,18 +1312,16 @@ function Stack(props) {
|
|
|
1189
1312
|
return $[7] !== as || $[8] !== gap || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "Stack", ...rest, as, gridAutoRows: "min", className: t2, display: "grid", gap }), $[7] = as, $[8] = gap, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
1190
1313
|
}
|
|
1191
1314
|
function useCustomValidity(ref, customValidity) {
|
|
1192
|
-
const $ = c(
|
|
1193
|
-
let t0;
|
|
1194
|
-
$[0] !== customValidity || $[1] !== ref
|
|
1315
|
+
const $ = c(4);
|
|
1316
|
+
let t0, t1;
|
|
1317
|
+
$[0] !== customValidity || $[1] !== ref ? (t0 = () => {
|
|
1195
1318
|
ref.current?.setCustomValidity(customValidity || "");
|
|
1196
|
-
}, $[0] = customValidity, $[1] = ref
|
|
1197
|
-
let t1;
|
|
1198
|
-
$[3] !== customValidity || $[4] !== ref ? (t1 = [customValidity, ref], $[3] = customValidity, $[4] = ref, $[5] = t1) : t1 = $[5], useEffect(t0, t1);
|
|
1319
|
+
}, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1);
|
|
1199
1320
|
}
|
|
1200
1321
|
const DEFAULT_TEXT_INPUT_ELEMENT = "input";
|
|
1201
1322
|
function TextInput(props) {
|
|
1202
|
-
const $ = c(
|
|
1203
|
-
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
|
|
1323
|
+
const $ = c(86), t0 = props;
|
|
1324
|
+
let IconComponent, IconRightComponent, __unstable_disableFocusRing, className, clearButton, customValidity, flex, forwardedRef, onClear, prefix, readOnly, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, width;
|
|
1204
1325
|
if ($[0] !== t0) {
|
|
1205
1326
|
const {
|
|
1206
1327
|
__unstable_disableFocusRing: t92,
|
|
@@ -1209,111 +1330,129 @@ function TextInput(props) {
|
|
|
1209
1330
|
className: t122,
|
|
1210
1331
|
clearButton: t132,
|
|
1211
1332
|
disabled: t142,
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1333
|
+
flex: t152,
|
|
1334
|
+
fontSize: t162,
|
|
1335
|
+
gap: t172,
|
|
1336
|
+
icon: t182,
|
|
1337
|
+
iconRight: t192,
|
|
1338
|
+
onClear: t202,
|
|
1339
|
+
padding: t212,
|
|
1340
|
+
prefix: t222,
|
|
1341
|
+
radius: t232,
|
|
1342
|
+
readOnly: t242,
|
|
1343
|
+
ref: t252,
|
|
1344
|
+
suffix: t262,
|
|
1345
|
+
customValidity: t272,
|
|
1346
|
+
type: t282,
|
|
1225
1347
|
weight: _width,
|
|
1226
|
-
width:
|
|
1227
|
-
...
|
|
1348
|
+
width: t292,
|
|
1349
|
+
...t302
|
|
1228
1350
|
} = t0;
|
|
1229
|
-
__unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142,
|
|
1351
|
+
__unstable_disableFocusRing = t92, t1 = t102, t2 = t112, className = t122, clearButton = t132, t3 = t142, flex = t152, t4 = t162, t5 = t172, IconComponent = t182, IconRightComponent = t192, onClear = t202, t6 = t212, prefix = t222, t7 = t232, readOnly = t242, forwardedRef = t252, suffix = t262, customValidity = t272, t8 = t282, width = t292, rest = t302, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = className, $[5] = clearButton, $[6] = customValidity, $[7] = flex, $[8] = forwardedRef, $[9] = onClear, $[10] = prefix, $[11] = readOnly, $[12] = rest, $[13] = suffix, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6, $[20] = t7, $[21] = t8, $[22] = width;
|
|
1230
1352
|
} else
|
|
1231
|
-
IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6],
|
|
1232
|
-
const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null)
|
|
1353
|
+
IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], className = $[4], clearButton = $[5], customValidity = $[6], flex = $[7], forwardedRef = $[8], onClear = $[9], prefix = $[10], readOnly = $[11], rest = $[12], suffix = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], t5 = $[18], t6 = $[19], t7 = $[20], t8 = $[21], width = $[22];
|
|
1354
|
+
const Element2 = t1 === void 0 ? DEFAULT_TEXT_INPUT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, disabled = t3 === void 0 ? !1 : t3, fontSize = t4 === void 0 ? 2 : t4, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, type = t8 === void 0 ? "text" : t8, ref = useRef(null);
|
|
1233
1355
|
let t9;
|
|
1234
|
-
$[
|
|
1235
|
-
const
|
|
1356
|
+
$[23] !== padding ? (t9 = _getResponsiveProp(padding), $[23] = padding, $[24] = t9) : t9 = $[24];
|
|
1357
|
+
const responsivePadding = t9, withClearButton = !!clearButton;
|
|
1236
1358
|
let t10;
|
|
1237
|
-
$[
|
|
1359
|
+
$[25] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => ref.current, $[25] = t10) : t10 = $[25], useImperativeHandle(forwardedRef, t10), useCustomValidity(ref, customValidity);
|
|
1360
|
+
const handleClearMouseDown = _temp$a;
|
|
1361
|
+
let t11;
|
|
1362
|
+
$[26] !== onClear ? (t11 = (event_0) => {
|
|
1238
1363
|
event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
|
|
1239
|
-
}, $[
|
|
1240
|
-
const handleClearClick =
|
|
1241
|
-
let
|
|
1242
|
-
$[
|
|
1243
|
-
const clearButtonBoxPadding = t11;
|
|
1244
|
-
let t13, t14;
|
|
1245
|
-
$[27] !== responsivePadding ? (t14 = Object.fromEntries(Object.entries(responsivePadding).map(_temp3)), $[27] = responsivePadding, $[28] = t14) : t14 = $[28], t13 = t14;
|
|
1246
|
-
const clearButtonPadding = t13;
|
|
1247
|
-
let t15;
|
|
1248
|
-
t15 = isRecord(clearButton) ? clearButton : EMPTY_RECORD;
|
|
1249
|
-
const clearButtonProps = t15;
|
|
1250
|
-
let t16;
|
|
1251
|
-
$[29] !== border || $[30] !== className || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t16 = textInput({
|
|
1364
|
+
}, $[26] = onClear, $[27] = t11) : t11 = $[27];
|
|
1365
|
+
const handleClearClick = t11;
|
|
1366
|
+
let t12;
|
|
1367
|
+
$[28] !== border || $[29] !== className || $[30] !== flex || $[31] !== fontSize || $[32] !== gap || $[33] !== padding || $[34] !== radius || $[35] !== width ? (t12 = textInput({
|
|
1252
1368
|
className,
|
|
1253
1369
|
border,
|
|
1370
|
+
flex,
|
|
1254
1371
|
fontSize,
|
|
1255
1372
|
padding,
|
|
1256
1373
|
radius,
|
|
1257
1374
|
gap,
|
|
1258
1375
|
width
|
|
1259
|
-
}), $[
|
|
1260
|
-
const
|
|
1376
|
+
}), $[28] = border, $[29] = className, $[30] = flex, $[31] = fontSize, $[32] = gap, $[33] = padding, $[34] = radius, $[35] = width, $[36] = t12) : t12 = $[36];
|
|
1377
|
+
const t13 = IconComponent ? "" : void 0, t14 = IconRightComponent ? "" : void 0, t15 = customValidity ? "" : void 0, t16 = prefix ? "" : void 0, t17 = !disabled && readOnly ? "" : void 0, t18 = suffix ? "" : void 0;
|
|
1378
|
+
let t19;
|
|
1379
|
+
$[37] !== prefix ? (t19 = prefix && /* @__PURE__ */ jsx("span", { className: textInputPrefix(), children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[37] = prefix, $[38] = t19) : t19 = $[38];
|
|
1380
|
+
let t20;
|
|
1381
|
+
$[39] === Symbol.for("react.memo_cache_sentinel") ? (t20 = textInputElement(), $[39] = t20) : t20 = $[39];
|
|
1382
|
+
let t21;
|
|
1383
|
+
$[40] === Symbol.for("react.memo_cache_sentinel") ? (t21 = _inputElement(), $[40] = t21) : t21 = $[40];
|
|
1384
|
+
const t22 = __unstable_disableFocusRing ? "" : void 0;
|
|
1261
1385
|
let t23;
|
|
1262
|
-
$[
|
|
1386
|
+
$[41] !== Element2 || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t22 || $[46] !== type ? (t23 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t21, "data-no-focus-ring": t22, disabled, readOnly, ref, type }), $[41] = Element2, $[42] = disabled, $[43] = readOnly, $[44] = rest, $[45] = t22, $[46] = type, $[47] = t23) : t23 = $[47];
|
|
1263
1387
|
let t24;
|
|
1264
|
-
$[
|
|
1388
|
+
$[48] === Symbol.for("react.memo_cache_sentinel") ? (t24 = _inputPresentation(), $[48] = t24) : t24 = $[48];
|
|
1265
1389
|
let t25;
|
|
1266
|
-
$[
|
|
1267
|
-
const t26 = __unstable_disableFocusRing ? "" : void 0;
|
|
1268
|
-
let t27;
|
|
1269
|
-
$[41] !== Element2 || $[42] !== disabled || $[43] !== readOnly || $[44] !== rest || $[45] !== t26 || $[46] !== type ? (t27 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t25, "data-no-focus-ring": t26, disabled, readOnly, ref, type }), $[41] = Element2, $[42] = disabled, $[43] = readOnly, $[44] = rest, $[45] = t26, $[46] = type, $[47] = t27) : t27 = $[47];
|
|
1270
|
-
let t28;
|
|
1271
|
-
$[48] === Symbol.for("react.memo_cache_sentinel") ? (t28 = _inputPresentation(), $[48] = t28) : t28 = $[48];
|
|
1272
|
-
let t29;
|
|
1273
|
-
$[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t29 = IconComponent && /* @__PURE__ */ jsx(Box, { padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { size: fontSize, children: [
|
|
1390
|
+
$[49] !== IconComponent || $[50] !== fontSize || $[51] !== padding ? (t25 = IconComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetLeft: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
|
|
1274
1391
|
isValidElement(IconComponent) && IconComponent,
|
|
1275
1392
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
1276
|
-
] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] =
|
|
1277
|
-
let
|
|
1278
|
-
$[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (
|
|
1393
|
+
] }) }), $[49] = IconComponent, $[50] = fontSize, $[51] = padding, $[52] = t25) : t25 = $[52];
|
|
1394
|
+
let t26;
|
|
1395
|
+
$[53] !== IconRightComponent || $[54] !== fontSize || $[55] !== padding || $[56] !== withClearButton ? (t26 = !withClearButton && IconRightComponent && /* @__PURE__ */ jsx(Box, { as: "span", padding, position: "absolute", insetTop: 0, insetRight: 0, children: /* @__PURE__ */ jsxs(Text, { as: "span", size: fontSize, children: [
|
|
1279
1396
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
1280
1397
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
1281
|
-
] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] =
|
|
1398
|
+
] }) }), $[53] = IconRightComponent, $[54] = fontSize, $[55] = padding, $[56] = withClearButton, $[57] = t26) : t26 = $[57];
|
|
1399
|
+
let t27;
|
|
1400
|
+
$[58] !== t25 || $[59] !== t26 ? (t27 = /* @__PURE__ */ jsxs("span", { className: t24, children: [
|
|
1401
|
+
t25,
|
|
1402
|
+
t26
|
|
1403
|
+
] }), $[58] = t25, $[59] = t26, $[60] = t27) : t27 = $[60];
|
|
1404
|
+
let t28;
|
|
1405
|
+
$[61] !== clearButton || $[62] !== disabled || $[63] !== fontSize || $[64] !== handleClearClick || $[65] !== radius || $[66] !== readOnly || $[67] !== responsivePadding ? (t28 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(ClearButton, { fontSize, radius, clearButtonProps: isRecord(clearButton) ? clearButton : EMPTY_RECORD, handleClearClick, handleClearMouseDown, padding: responsivePadding }), $[61] = clearButton, $[62] = disabled, $[63] = fontSize, $[64] = handleClearClick, $[65] = radius, $[66] = readOnly, $[67] = responsivePadding, $[68] = t28) : t28 = $[68];
|
|
1406
|
+
let t29;
|
|
1407
|
+
$[69] !== t23 || $[70] !== t27 || $[71] !== t28 ? (t29 = /* @__PURE__ */ jsxs("span", { className: t20, children: [
|
|
1408
|
+
t23,
|
|
1409
|
+
t27,
|
|
1410
|
+
t28
|
|
1411
|
+
] }), $[69] = t23, $[70] = t27, $[71] = t28, $[72] = t29) : t29 = $[72];
|
|
1412
|
+
let t30;
|
|
1413
|
+
$[73] !== suffix ? (t30 = suffix && /* @__PURE__ */ jsx("span", { className: textInputSuffix(), children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[73] = suffix, $[74] = t30) : t30 = $[74];
|
|
1282
1414
|
let t31;
|
|
1283
|
-
$[
|
|
1415
|
+
return $[75] !== t12 || $[76] !== t13 || $[77] !== t14 || $[78] !== t15 || $[79] !== t16 || $[80] !== t17 || $[81] !== t18 || $[82] !== t19 || $[83] !== t29 || $[84] !== t30 ? (t31 = /* @__PURE__ */ jsxs("span", { className: t12, "data-icon-left": t13, "data-icon-right": t14, "data-invalid": t15, "data-prefix": t16, "data-read-only": t17, "data-suffix": t18, "data-ui": "TextInput", children: [
|
|
1416
|
+
t19,
|
|
1284
1417
|
t29,
|
|
1285
1418
|
t30
|
|
1286
|
-
] }), $[
|
|
1287
|
-
|
|
1288
|
-
|
|
1419
|
+
] }), $[75] = t12, $[76] = t13, $[77] = t14, $[78] = t15, $[79] = t16, $[80] = t17, $[81] = t18, $[82] = t19, $[83] = t29, $[84] = t30, $[85] = t31) : t31 = $[85], t31;
|
|
1420
|
+
}
|
|
1421
|
+
function _temp$a(event) {
|
|
1422
|
+
event.preventDefault(), event.stopPropagation();
|
|
1423
|
+
}
|
|
1424
|
+
function ClearButton(t0) {
|
|
1425
|
+
const $ = c(15), {
|
|
1426
|
+
fontSize,
|
|
1427
|
+
radius,
|
|
1428
|
+
clearButtonProps,
|
|
1429
|
+
handleClearClick,
|
|
1430
|
+
handleClearMouseDown,
|
|
1431
|
+
padding
|
|
1432
|
+
} = t0;
|
|
1433
|
+
let t1;
|
|
1434
|
+
$[0] !== padding ? (t1 = Object.fromEntries(Object.entries(padding).map(_temp2$2)), $[0] = padding, $[1] = t1) : t1 = $[1];
|
|
1435
|
+
const clearButtonBoxPadding = t1;
|
|
1436
|
+
let t2;
|
|
1437
|
+
$[2] !== padding ? (t2 = Object.fromEntries(Object.entries(padding).map(_temp3)), $[2] = padding, $[3] = t2) : t2 = $[3];
|
|
1438
|
+
const clearButtonPadding = t2;
|
|
1439
|
+
let t3;
|
|
1440
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
|
|
1289
1441
|
zIndex: 2
|
|
1290
|
-
},
|
|
1291
|
-
let
|
|
1292
|
-
$[
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
t32
|
|
1296
|
-
] }), $[71] = t27, $[72] = t31, $[73] = t32, $[74] = t33) : t33 = $[74];
|
|
1297
|
-
let t34;
|
|
1298
|
-
$[75] !== suffix ? (t34 = suffix && /* @__PURE__ */ jsx(Box, { className: textInputSuffix(), sizing: "border", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[75] = suffix, $[76] = t34) : t34 = $[76];
|
|
1299
|
-
let t35;
|
|
1300
|
-
return $[77] !== t16 || $[78] !== t17 || $[79] !== t18 || $[80] !== t19 || $[81] !== t20 || $[82] !== t21 || $[83] !== t22 || $[84] !== t23 || $[85] !== t33 || $[86] !== t34 ? (t35 = /* @__PURE__ */ jsxs(Box, { alignItems: "center", className: t16, "data-icon-left": t17, "data-icon-right": t18, "data-invalid": t19, "data-prefix": t20, "data-read-only": t21, "data-suffix": t22, "data-ui": "TextInput", display: "flex", children: [
|
|
1301
|
-
t23,
|
|
1302
|
-
t33,
|
|
1303
|
-
t34
|
|
1304
|
-
] }), $[77] = t16, $[78] = t17, $[79] = t18, $[80] = t19, $[81] = t20, $[82] = t21, $[83] = t22, $[84] = t23, $[85] = t33, $[86] = t34, $[87] = t35) : t35 = $[87], t35;
|
|
1442
|
+
}, $[4] = t3) : t3 = $[4];
|
|
1443
|
+
let t4;
|
|
1444
|
+
$[5] !== clearButtonPadding || $[6] !== clearButtonProps || $[7] !== fontSize || $[8] !== handleClearClick || $[9] !== handleClearMouseDown || $[10] !== radius ? (t4 = /* @__PURE__ */ jsx(Button, { "aria-label": "Clear", "data-qa": "clear-button", display: "block", fontSize, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }), $[5] = clearButtonPadding, $[6] = clearButtonProps, $[7] = fontSize, $[8] = handleClearClick, $[9] = handleClearMouseDown, $[10] = radius, $[11] = t4) : t4 = $[11];
|
|
1445
|
+
let t5;
|
|
1446
|
+
return $[12] !== clearButtonBoxPadding || $[13] !== t4 ? (t5 = /* @__PURE__ */ jsx(Box, { as: "span", insetTop: 0, insetRight: 0, padding: clearButtonBoxPadding, position: "absolute", style: t3, children: t4 }), $[12] = clearButtonBoxPadding, $[13] = t4, $[14] = t5) : t5 = $[14], t5;
|
|
1305
1447
|
}
|
|
1306
1448
|
function _temp3(t0) {
|
|
1307
1449
|
const [key_0, value_0] = t0;
|
|
1308
1450
|
return value_0 === 0 ? [key_0, 0] : value_0 === 1 ? [key_0, 0] : value_0 === 2 ? [key_0, 1] : [key_0, typeof value_0 == "number" ? value_0 - 1 : 0];
|
|
1309
1451
|
}
|
|
1310
|
-
function _temp2$
|
|
1452
|
+
function _temp2$2(t0) {
|
|
1311
1453
|
const [key2, value] = t0;
|
|
1312
1454
|
return value === 0 ? [key2, 0] : value === 1 ? [key2, 1] : value === 2 ? [key2, 1] : [key2, typeof value == "number" ? value - 2 : 0];
|
|
1313
1455
|
}
|
|
1314
|
-
function _temp$8(event) {
|
|
1315
|
-
event.preventDefault(), event.stopPropagation();
|
|
1316
|
-
}
|
|
1317
1456
|
function AutocompleteOption(props) {
|
|
1318
1457
|
const $ = c(11), {
|
|
1319
1458
|
children,
|
|
@@ -1378,16 +1517,18 @@ function autocompleteReducer(state, msg) {
|
|
|
1378
1517
|
}
|
|
1379
1518
|
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;
|
|
1380
1519
|
function Autocomplete(props) {
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1520
|
+
const $ = c(181), t0 = props;
|
|
1521
|
+
let customValidity, disabled, filterOptionProp, forwardedRef, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, rest, suffix, t1, t2, t3, t4, t5, t6, t7, t8, valueProp;
|
|
1522
|
+
$[0] !== t0 ? ({
|
|
1523
|
+
as: t1,
|
|
1524
|
+
border: t2,
|
|
1384
1525
|
customValidity,
|
|
1385
1526
|
disabled,
|
|
1386
1527
|
filterOption: filterOptionProp,
|
|
1387
|
-
fontSize
|
|
1528
|
+
fontSize: t3,
|
|
1388
1529
|
icon,
|
|
1389
1530
|
id,
|
|
1390
|
-
listBox
|
|
1531
|
+
listBox: t4,
|
|
1391
1532
|
loading,
|
|
1392
1533
|
onBlur,
|
|
1393
1534
|
onChange,
|
|
@@ -1397,36 +1538,61 @@ function Autocomplete(props) {
|
|
|
1397
1538
|
openButton,
|
|
1398
1539
|
openOnFocus,
|
|
1399
1540
|
options: optionsProp,
|
|
1400
|
-
padding:
|
|
1401
|
-
popover:
|
|
1541
|
+
padding: t5,
|
|
1542
|
+
popover: t6,
|
|
1402
1543
|
prefix,
|
|
1403
|
-
radius
|
|
1544
|
+
radius: t7,
|
|
1404
1545
|
readOnly,
|
|
1405
1546
|
ref: forwardedRef,
|
|
1406
1547
|
relatedElements,
|
|
1407
1548
|
renderOption: renderOptionProp,
|
|
1408
1549
|
renderPopover,
|
|
1409
|
-
renderValue
|
|
1550
|
+
renderValue: t8,
|
|
1410
1551
|
suffix,
|
|
1411
1552
|
value: valueProp,
|
|
1412
1553
|
...rest
|
|
1413
|
-
} =
|
|
1414
|
-
|
|
1554
|
+
} = t0, $[0] = t0, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = forwardedRef, $[5] = icon, $[6] = id, $[7] = loading, $[8] = onBlur, $[9] = onChange, $[10] = onFocus, $[11] = onQueryChange, $[12] = onSelect, $[13] = openButton, $[14] = openOnFocus, $[15] = optionsProp, $[16] = prefix, $[17] = readOnly, $[18] = relatedElements, $[19] = renderOptionProp, $[20] = renderPopover, $[21] = rest, $[22] = suffix, $[23] = t1, $[24] = t2, $[25] = t3, $[26] = t4, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t8, $[31] = valueProp) : (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], forwardedRef = $[4], icon = $[5], id = $[6], loading = $[7], onBlur = $[8], onChange = $[9], onFocus = $[10], onQueryChange = $[11], onSelect = $[12], openButton = $[13], openOnFocus = $[14], optionsProp = $[15], prefix = $[16], readOnly = $[17], relatedElements = $[18], renderOptionProp = $[19], renderPopover = $[20], rest = $[21], suffix = $[22], t1 = $[23], t2 = $[24], t3 = $[25], t4 = $[26], t5 = $[27], t6 = $[28], t7 = $[29], t8 = $[30], valueProp = $[31]);
|
|
1555
|
+
const as = t1 === void 0 ? DEFAULT_AUTOCOMPLETE_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, listBox = t4 === void 0 ? EMPTY_RECORD : t4, paddingProp = t5 === void 0 ? 3 : t5, popover2 = t6 === void 0 ? EMPTY_RECORD : t6, radius = t7 === void 0 ? 2 : t7, renderValue = t8 === void 0 ? DEFAULT_RENDER_VALUE : t8, t9 = valueProp || null, t10 = valueProp || null;
|
|
1556
|
+
let t11;
|
|
1557
|
+
$[32] !== t10 || $[33] !== t9 ? (t11 = {
|
|
1558
|
+
activeValue: t9,
|
|
1415
1559
|
focused: !1,
|
|
1416
1560
|
listFocused: !1,
|
|
1417
1561
|
query: null,
|
|
1418
|
-
value:
|
|
1419
|
-
}
|
|
1562
|
+
value: t10
|
|
1563
|
+
}, $[32] = t10, $[33] = t9, $[34] = t11) : t11 = $[34];
|
|
1564
|
+
const [state, dispatch] = useReducer(autocompleteReducer, t11), {
|
|
1420
1565
|
activeValue,
|
|
1421
1566
|
focused,
|
|
1422
1567
|
listFocused,
|
|
1423
1568
|
query,
|
|
1424
1569
|
value
|
|
1425
|
-
} = state
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1570
|
+
} = state;
|
|
1571
|
+
let t12;
|
|
1572
|
+
$[35] !== fontSize || $[36] !== paddingProp ? (t12 = (t132) => {
|
|
1573
|
+
const {
|
|
1574
|
+
value: value_0
|
|
1575
|
+
} = t132;
|
|
1576
|
+
return /* @__PURE__ */ jsx(Selectable, { as: "button", padding: paddingProp, radius: 2, children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
|
|
1577
|
+
}, $[35] = fontSize, $[36] = paddingProp, $[37] = t12) : t12 = $[37];
|
|
1578
|
+
const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t12, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), [inputElement, setInputElement] = useState(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
|
|
1579
|
+
let t13, t14;
|
|
1580
|
+
$[38] !== inputElement ? (t13 = () => inputElement, t14 = [inputElement], $[38] = inputElement, $[39] = t13, $[40] = t14) : (t13 = $[39], t14 = $[40]), useImperativeHandle(inputElementRef, t13, t14);
|
|
1581
|
+
let t15, t16;
|
|
1582
|
+
$[41] !== inputElement ? (t15 = () => inputElement, t16 = [inputElement], $[41] = inputElement, $[42] = t15, $[43] = t16) : (t15 = $[42], t16 = $[43]), useImperativeHandle(forwardedRef, t15, t16);
|
|
1583
|
+
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useResponsiveProp(paddingProp);
|
|
1584
|
+
let t17;
|
|
1585
|
+
$[44] !== options || $[45] !== value ? (t17 = value !== null ? options.find((o) => o.value === value) : void 0, $[44] = options, $[45] = value, $[46] = t17) : t17 = $[46];
|
|
1586
|
+
const currentOption = t17;
|
|
1587
|
+
let t18;
|
|
1588
|
+
if ($[47] !== filterOption || $[48] !== options || $[49] !== query) {
|
|
1589
|
+
let t192;
|
|
1590
|
+
$[51] !== filterOption || $[52] !== query ? (t192 = (option) => query ? filterOption(query, option) : !0, $[51] = filterOption, $[52] = query, $[53] = t192) : t192 = $[53], t18 = options.filter(t192), $[47] = filterOption, $[48] = options, $[49] = query, $[50] = t18;
|
|
1591
|
+
} else
|
|
1592
|
+
t18 = $[50];
|
|
1593
|
+
const filteredOptions = t18, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
|
|
1594
|
+
let t19;
|
|
1595
|
+
$[54] !== onBlur || $[55] !== onQueryChange || $[56] !== relatedElements ? (t19 = (event) => {
|
|
1430
1596
|
setTimeout(() => {
|
|
1431
1597
|
if (popoverMouseWithinRef.current)
|
|
1432
1598
|
return;
|
|
@@ -1443,20 +1609,30 @@ function Autocomplete(props) {
|
|
|
1443
1609
|
type: "root/blur"
|
|
1444
1610
|
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
1445
1611
|
}, 0);
|
|
1446
|
-
}, [onBlur, onQueryChange, relatedElements
|
|
1612
|
+
}, $[54] = onBlur, $[55] = onQueryChange, $[56] = relatedElements, $[57] = t19) : t19 = $[57];
|
|
1613
|
+
const handleRootBlur = t19;
|
|
1614
|
+
let t20;
|
|
1615
|
+
$[58] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_0) => {
|
|
1447
1616
|
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
1448
1617
|
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
1449
1618
|
type: "root/setListFocused",
|
|
1450
1619
|
listFocused: listFocused_0
|
|
1451
1620
|
}));
|
|
1452
|
-
}, []
|
|
1621
|
+
}, $[58] = t20) : t20 = $[58];
|
|
1622
|
+
const handleRootFocus = t20;
|
|
1623
|
+
let t21;
|
|
1624
|
+
$[59] !== onChange || $[60] !== onQueryChange || $[61] !== onSelect ? (t21 = (v) => {
|
|
1453
1625
|
dispatch({
|
|
1454
1626
|
type: "value/change",
|
|
1455
1627
|
value: v
|
|
1456
1628
|
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
1457
|
-
}, [onChange,
|
|
1629
|
+
}, $[59] = onChange, $[60] = onQueryChange, $[61] = onSelect, $[62] = t21) : t21 = $[62];
|
|
1630
|
+
const handleOptionSelect = t21;
|
|
1631
|
+
let t22;
|
|
1632
|
+
$[63] !== activeValue || $[64] !== filteredOptions || $[65] !== filteredOptionsLen || $[66] !== onQueryChange ? (t22 = (event_1) => {
|
|
1458
1633
|
if (event_1.key === "ArrowDown") {
|
|
1459
|
-
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
1634
|
+
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
1635
|
+
return;
|
|
1460
1636
|
const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
1461
1637
|
nextActiveOption && dispatch({
|
|
1462
1638
|
type: "root/setActiveValue",
|
|
@@ -1466,7 +1642,8 @@ function Autocomplete(props) {
|
|
|
1466
1642
|
return;
|
|
1467
1643
|
}
|
|
1468
1644
|
if (event_1.key === "ArrowUp") {
|
|
1469
|
-
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
1645
|
+
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
1646
|
+
return;
|
|
1470
1647
|
const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
|
|
1471
1648
|
nextActiveOption_0 && dispatch({
|
|
1472
1649
|
type: "root/setActiveValue",
|
|
@@ -1486,35 +1663,58 @@ function Autocomplete(props) {
|
|
|
1486
1663
|
inputElementRef.current?.focus();
|
|
1487
1664
|
return;
|
|
1488
1665
|
}
|
|
1489
|
-
}, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange
|
|
1666
|
+
}, $[63] = activeValue, $[64] = filteredOptions, $[65] = filteredOptionsLen, $[66] = onQueryChange, $[67] = t22) : t22 = $[67];
|
|
1667
|
+
const handleRootKeyDown = t22;
|
|
1668
|
+
let t23;
|
|
1669
|
+
$[68] !== onQueryChange ? (t23 = (event_2) => {
|
|
1490
1670
|
const nextQuery = event_2.currentTarget.value;
|
|
1491
1671
|
dispatch({
|
|
1492
1672
|
type: "input/change",
|
|
1493
1673
|
query: nextQuery
|
|
1494
1674
|
}), onQueryChange && onQueryChange(nextQuery);
|
|
1495
|
-
}, [onQueryChange
|
|
1675
|
+
}, $[68] = onQueryChange, $[69] = t23) : t23 = $[69];
|
|
1676
|
+
const handleInputChange = t23;
|
|
1677
|
+
let t24;
|
|
1678
|
+
$[70] !== currentOption || $[71] !== renderValue || $[72] !== value ? (t24 = () => {
|
|
1496
1679
|
dispatch({
|
|
1497
1680
|
type: "root/open",
|
|
1498
1681
|
query: value ? renderValue(value, currentOption) : ""
|
|
1499
1682
|
});
|
|
1500
|
-
}, [currentOption, renderValue, value
|
|
1683
|
+
}, $[70] = currentOption, $[71] = renderValue, $[72] = value, $[73] = t24) : t24 = $[73];
|
|
1684
|
+
const dispatchOpen = t24;
|
|
1685
|
+
let t25;
|
|
1686
|
+
$[74] !== dispatchOpen || $[75] !== focused || $[76] !== onFocus || $[77] !== openOnFocus ? (t25 = (event_3) => {
|
|
1501
1687
|
focused || (dispatch({
|
|
1502
1688
|
type: "input/focus"
|
|
1503
1689
|
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
1504
|
-
}, [focused, onFocus, openOnFocus,
|
|
1690
|
+
}, $[74] = dispatchOpen, $[75] = focused, $[76] = onFocus, $[77] = openOnFocus, $[78] = t25) : t25 = $[78];
|
|
1691
|
+
const handleInputFocus = t25;
|
|
1692
|
+
let t26;
|
|
1693
|
+
$[79] === Symbol.for("react.memo_cache_sentinel") ? (t26 = () => {
|
|
1505
1694
|
popoverMouseWithinRef.current = !0;
|
|
1506
|
-
}, []
|
|
1695
|
+
}, $[79] = t26) : t26 = $[79];
|
|
1696
|
+
const handlePopoverMouseEnter = t26;
|
|
1697
|
+
let t27;
|
|
1698
|
+
$[80] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
|
|
1507
1699
|
popoverMouseWithinRef.current = !1;
|
|
1508
|
-
}, []
|
|
1700
|
+
}, $[80] = t27) : t27 = $[80];
|
|
1701
|
+
const handlePopoverMouseLeave = t27;
|
|
1702
|
+
let t28;
|
|
1703
|
+
$[81] !== onChange || $[82] !== onQueryChange ? (t28 = () => {
|
|
1509
1704
|
dispatch({
|
|
1510
1705
|
type: "root/clear"
|
|
1511
1706
|
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
1512
|
-
}, [onChange, onQueryChange
|
|
1707
|
+
}, $[81] = onChange, $[82] = onQueryChange, $[83] = t28) : t28 = $[83];
|
|
1708
|
+
const handleClearButtonClick = t28;
|
|
1709
|
+
let t29;
|
|
1710
|
+
$[84] === Symbol.for("react.memo_cache_sentinel") ? (t29 = () => {
|
|
1513
1711
|
dispatch({
|
|
1514
1712
|
type: "input/focus"
|
|
1515
1713
|
});
|
|
1516
|
-
}, []);
|
|
1517
|
-
|
|
1714
|
+
}, $[84] = t29) : t29 = $[84];
|
|
1715
|
+
const handleClearButtonFocus = t29;
|
|
1716
|
+
let t30, t31;
|
|
1717
|
+
$[85] !== valueProp ? (t30 = () => {
|
|
1518
1718
|
if (valueProp !== valuePropRef.current) {
|
|
1519
1719
|
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
1520
1720
|
type: "value/change",
|
|
@@ -1526,14 +1726,19 @@ function Autocomplete(props) {
|
|
|
1526
1726
|
type: "value/change",
|
|
1527
1727
|
value: valueProp || null
|
|
1528
1728
|
}));
|
|
1529
|
-
}, [valueProp]), useEffect(
|
|
1729
|
+
}, t31 = [valueProp], $[85] = valueProp, $[86] = t30, $[87] = t31) : (t30 = $[86], t31 = $[87]), useEffect(t30, t31);
|
|
1730
|
+
let t32, t33;
|
|
1731
|
+
$[88] !== focused ? (t32 = () => {
|
|
1530
1732
|
!focused && valueRef.current && dispatch({
|
|
1531
1733
|
type: "root/setActiveValue",
|
|
1532
1734
|
value: valueRef.current
|
|
1533
1735
|
});
|
|
1534
|
-
}, [focused]), useEffect(
|
|
1736
|
+
}, t33 = [focused], $[88] = focused, $[89] = t32, $[90] = t33) : (t32 = $[89], t33 = $[90]), useEffect(t32, t33);
|
|
1737
|
+
let t34, t35;
|
|
1738
|
+
$[91] !== activeValue || $[92] !== filteredOptions ? (t34 = () => {
|
|
1535
1739
|
const listElement = listBoxElementRef.current;
|
|
1536
|
-
if (!listElement)
|
|
1740
|
+
if (!listElement)
|
|
1741
|
+
return;
|
|
1537
1742
|
const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
1538
1743
|
if (activeOption_1) {
|
|
1539
1744
|
const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
|
|
@@ -1543,41 +1748,128 @@ function Autocomplete(props) {
|
|
|
1543
1748
|
focusFirstDescendant(activeItemElement);
|
|
1544
1749
|
}
|
|
1545
1750
|
}
|
|
1546
|
-
}, [activeValue, filteredOptions]);
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1751
|
+
}, t35 = [activeValue, filteredOptions], $[91] = activeValue, $[92] = filteredOptions, $[93] = t34, $[94] = t35) : (t34 = $[93], t35 = $[94]), useEffect(t34, t35);
|
|
1752
|
+
let t36;
|
|
1753
|
+
bb0: {
|
|
1754
|
+
if (!loading && !disabled && value) {
|
|
1755
|
+
let t372;
|
|
1756
|
+
$[95] === Symbol.for("react.memo_cache_sentinel") ? (t372 = {
|
|
1550
1757
|
"aria-label": "Clear",
|
|
1551
1758
|
onFocus: handleClearButtonFocus
|
|
1552
|
-
};
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1759
|
+
}, $[95] = t372) : t372 = $[95], t36 = t372;
|
|
1760
|
+
break bb0;
|
|
1761
|
+
}
|
|
1762
|
+
t36 = void 0;
|
|
1763
|
+
}
|
|
1764
|
+
const clearButton = t36;
|
|
1765
|
+
let t37;
|
|
1766
|
+
$[96] !== padding ? (t37 = Object.fromEntries(Object.entries(padding).map(_temp$9)), $[96] = padding, $[97] = t37) : t37 = $[97];
|
|
1767
|
+
const openButtonBoxPadding = t37;
|
|
1768
|
+
let t38;
|
|
1769
|
+
$[98] !== padding ? (t38 = Object.values(padding).map(_temp2$1), $[98] = padding, $[99] = t38) : t38 = $[99];
|
|
1770
|
+
const openButtonPadding = t38, openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD;
|
|
1771
|
+
let t39;
|
|
1772
|
+
$[100] !== dispatchOpen || $[101] !== openButtonProps ? (t39 = (event_4) => {
|
|
1773
|
+
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
1774
|
+
}, $[100] = dispatchOpen, $[101] = openButtonProps, $[102] = t39) : t39 = $[102];
|
|
1775
|
+
const handleOpenClick = t39;
|
|
1776
|
+
let t40;
|
|
1777
|
+
$[103] !== disabled || $[104] !== expanded || $[105] !== fontSize || $[106] !== handleOpenClick || $[107] !== openButton || $[108] !== openButtonBoxPadding || $[109] !== openButtonPadding || $[110] !== openButtonProps || $[111] !== readOnly ? (t40 = !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, $[103] = disabled, $[104] = expanded, $[105] = fontSize, $[106] = handleOpenClick, $[107] = openButton, $[108] = openButtonBoxPadding, $[109] = openButtonPadding, $[110] = openButtonProps, $[111] = readOnly, $[112] = t40) : t40 = $[112];
|
|
1778
|
+
const openButtonNode = t40;
|
|
1779
|
+
let t41;
|
|
1780
|
+
bb1: {
|
|
1781
|
+
if (query === null) {
|
|
1782
|
+
if (value !== null) {
|
|
1783
|
+
let t422;
|
|
1784
|
+
$[113] !== currentOption || $[114] !== renderValue || $[115] !== value ? (t422 = renderValue(value, currentOption), $[113] = currentOption, $[114] = renderValue, $[115] = value, $[116] = t422) : t422 = $[116], t41 = t422;
|
|
1785
|
+
break bb1;
|
|
1786
|
+
}
|
|
1787
|
+
t41 = "";
|
|
1788
|
+
break bb1;
|
|
1789
|
+
}
|
|
1790
|
+
t41 = query;
|
|
1791
|
+
}
|
|
1792
|
+
const inputValue = t41;
|
|
1793
|
+
let t42;
|
|
1794
|
+
$[117] !== listFocused ? (t42 = (event_5) => {
|
|
1795
|
+
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
1796
|
+
}, $[117] = listFocused, $[118] = t42) : t42 = $[118];
|
|
1797
|
+
const handleListBoxKeyDown = t42;
|
|
1798
|
+
let t43;
|
|
1799
|
+
bb2: {
|
|
1800
|
+
if (filteredOptions.length === 0) {
|
|
1801
|
+
t43 = null;
|
|
1802
|
+
break bb2;
|
|
1803
|
+
}
|
|
1804
|
+
let t442;
|
|
1805
|
+
if ($[119] !== activeValue || $[120] !== currentOption || $[121] !== filteredOptions || $[122] !== handleOptionSelect || $[123] !== id || $[124] !== listFocused || $[125] !== loading || $[126] !== renderOption) {
|
|
1806
|
+
let t453;
|
|
1807
|
+
$[128] !== activeValue || $[129] !== currentOption || $[130] !== handleOptionSelect || $[131] !== id || $[132] !== listFocused || $[133] !== loading || $[134] !== renderOption ? (t453 = (option_0) => {
|
|
1808
|
+
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
1809
|
+
return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
|
|
1810
|
+
disabled: loading,
|
|
1811
|
+
selected: active,
|
|
1812
|
+
tabIndex: listFocused && active ? 0 : -1
|
|
1813
|
+
}) }, option_0.value);
|
|
1814
|
+
}, $[128] = activeValue, $[129] = currentOption, $[130] = handleOptionSelect, $[131] = id, $[132] = listFocused, $[133] = loading, $[134] = renderOption, $[135] = t453) : t453 = $[135], t442 = filteredOptions.map(t453), $[119] = activeValue, $[120] = currentOption, $[121] = filteredOptions, $[122] = handleOptionSelect, $[123] = id, $[124] = listFocused, $[125] = loading, $[126] = renderOption, $[127] = t442;
|
|
1815
|
+
} else
|
|
1816
|
+
t442 = $[127];
|
|
1817
|
+
let t452;
|
|
1818
|
+
$[136] !== listBoxId || $[137] !== t442 ? (t452 = /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", gap: 1, id: listBoxId, ref: listBoxElementRef, role: "listbox", children: t442 }), $[136] = listBoxId, $[137] = t442, $[138] = t452) : t452 = $[138];
|
|
1819
|
+
let t462;
|
|
1820
|
+
$[139] !== handleListBoxKeyDown || $[140] !== listBox || $[141] !== t452 ? (t462 = /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t452 }), $[139] = handleListBoxKeyDown, $[140] = listBox, $[141] = t452, $[142] = t462) : t462 = $[142], t43 = t462;
|
|
1821
|
+
}
|
|
1822
|
+
const content2 = t43;
|
|
1823
|
+
let t44;
|
|
1824
|
+
bb3: {
|
|
1825
|
+
if (renderPopover) {
|
|
1826
|
+
const t453 = !expanded;
|
|
1827
|
+
let t462;
|
|
1828
|
+
$[143] !== content2 || $[144] !== inputElement || $[145] !== renderPopover || $[146] !== t453 ? (t462 = /* @__PURE__ */ jsx(RenderPopover, { content: content2, hidden: t453, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[143] = content2, $[144] = inputElement, $[145] = renderPopover, $[146] = t453, $[147] = t462) : t462 = $[147], t44 = t462;
|
|
1829
|
+
break bb3;
|
|
1830
|
+
}
|
|
1831
|
+
if (filteredOptionsLen === 0) {
|
|
1832
|
+
t44 = null;
|
|
1833
|
+
break bb3;
|
|
1834
|
+
}
|
|
1835
|
+
let t452;
|
|
1836
|
+
$[148] !== content2 || $[149] !== expanded || $[150] !== inputElement || $[151] !== popover2 ? (t452 = /* @__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: inputElement, ...popover2 }), $[148] = content2, $[149] = expanded, $[150] = inputElement, $[151] = popover2, $[152] = t452) : t452 = $[152], t44 = t452;
|
|
1837
|
+
}
|
|
1838
|
+
const results = t44, t45 = loading && AnimatedSpinnerIcon, t46 = suffix || openButtonNode;
|
|
1839
|
+
let t47;
|
|
1840
|
+
$[153] !== activeItemId || $[154] !== as || $[155] !== border || $[156] !== clearButton || $[157] !== customValidity || $[158] !== disabled || $[159] !== expanded || $[160] !== fontSize || $[161] !== handleClearButtonClick || $[162] !== handleInputChange || $[163] !== handleInputFocus || $[164] !== icon || $[165] !== id || $[166] !== inputValue || $[167] !== listBoxId || $[168] !== padding || $[169] !== prefix || $[170] !== radius || $[171] !== readOnly || $[172] !== rest || $[173] !== t45 || $[174] !== t46 ? (t47 = /* @__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: t45, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t46, value: inputValue }), $[153] = activeItemId, $[154] = as, $[155] = border, $[156] = clearButton, $[157] = customValidity, $[158] = disabled, $[159] = expanded, $[160] = fontSize, $[161] = handleClearButtonClick, $[162] = handleInputChange, $[163] = handleInputFocus, $[164] = icon, $[165] = id, $[166] = inputValue, $[167] = listBoxId, $[168] = padding, $[169] = prefix, $[170] = radius, $[171] = readOnly, $[172] = rest, $[173] = t45, $[174] = t46, $[175] = t47) : t47 = $[175];
|
|
1841
|
+
let t48;
|
|
1842
|
+
return $[176] !== handleRootBlur || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t47 ? (t48 = /* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
1843
|
+
t47,
|
|
1844
|
+
results
|
|
1845
|
+
] }), $[176] = handleRootBlur, $[177] = handleRootKeyDown, $[178] = results, $[179] = t47, $[180] = t48) : t48 = $[180], t48;
|
|
1846
|
+
}
|
|
1847
|
+
function _temp2$1(v_0) {
|
|
1848
|
+
return Math.max(v_0 - 1, 0);
|
|
1849
|
+
}
|
|
1850
|
+
function _temp$9(t0) {
|
|
1851
|
+
const [key2, value_1] = t0;
|
|
1852
|
+
return value_1 === 0 ? [key2, 0] : value_1 === 1 ? [key2, 1] : value_1 === 2 ? [key2, 1] : [key2, value_1 - 2];
|
|
1853
|
+
}
|
|
1854
|
+
function RenderPopover({
|
|
1855
|
+
renderPopover,
|
|
1856
|
+
content: content2,
|
|
1857
|
+
hidden,
|
|
1858
|
+
inputElement,
|
|
1859
|
+
onMouseEnter,
|
|
1860
|
+
onMouseLeave,
|
|
1861
|
+
resultsPopoverElementRef
|
|
1862
|
+
}) {
|
|
1863
|
+
return renderPopover({
|
|
1565
1864
|
content: content2,
|
|
1566
|
-
hidden
|
|
1567
|
-
inputElement
|
|
1568
|
-
onMouseEnter
|
|
1569
|
-
onMouseLeave
|
|
1570
|
-
}, resultsPopoverElementRef)
|
|
1571
|
-
return (
|
|
1572
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
1573
|
-
/* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
1574
|
-
input,
|
|
1575
|
-
results
|
|
1576
|
-
] })
|
|
1577
|
-
);
|
|
1865
|
+
hidden,
|
|
1866
|
+
inputElement,
|
|
1867
|
+
onMouseEnter,
|
|
1868
|
+
onMouseLeave
|
|
1869
|
+
}, resultsPopoverElementRef);
|
|
1578
1870
|
}
|
|
1579
1871
|
function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
1580
|
-
const $ = c(9), elementsArg = t0 === void 0 ? _temp$
|
|
1872
|
+
const $ = c(9), elementsArg = t0 === void 0 ? _temp$8 : t0;
|
|
1581
1873
|
let t1;
|
|
1582
1874
|
$[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
|
|
1583
1875
|
if (!listener)
|
|
@@ -1607,38 +1899,97 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
|
|
|
1607
1899
|
let t3;
|
|
1608
1900
|
$[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
|
|
1609
1901
|
}
|
|
1610
|
-
function _temp$
|
|
1902
|
+
function _temp$8() {
|
|
1611
1903
|
return EMPTY_ARRAY;
|
|
1612
1904
|
}
|
|
1613
1905
|
const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
|
|
1614
1906
|
function Breadcrumbs(props) {
|
|
1615
|
-
const
|
|
1616
|
-
|
|
1907
|
+
const $ = c(37), t0 = props;
|
|
1908
|
+
let children, className, expandButtonProps, maxLength, rest, separator, t1, t2, t3, t4;
|
|
1909
|
+
$[0] !== t0 ? ({
|
|
1910
|
+
as: t1,
|
|
1617
1911
|
children,
|
|
1618
1912
|
className,
|
|
1619
1913
|
expandButton: expandButtonProps,
|
|
1620
|
-
gap
|
|
1621
|
-
gapX,
|
|
1622
|
-
gapY,
|
|
1914
|
+
gap: t2,
|
|
1915
|
+
gapX: t3,
|
|
1916
|
+
gapY: t4,
|
|
1623
1917
|
maxLength,
|
|
1624
1918
|
separator,
|
|
1625
1919
|
...rest
|
|
1626
|
-
} =
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1920
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = expandButtonProps, $[4] = maxLength, $[5] = rest, $[6] = separator, $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4) : (children = $[1], className = $[2], expandButtonProps = $[3], maxLength = $[4], rest = $[5], separator = $[6], t1 = $[7], t2 = $[8], t3 = $[9], t4 = $[10]);
|
|
1921
|
+
const as = t1 === void 0 ? DEFAULT_BREADCRUMBS_ELEMENT : t1, gap = t2 === void 0 ? 2 : t2, gapX = t3 === void 0 ? gap : t3, gapY = t4 === void 0 ? gap : t4, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null);
|
|
1922
|
+
let t5;
|
|
1923
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => setOpen(!1), $[11] = t5) : t5 = $[11];
|
|
1924
|
+
const collapse = t5;
|
|
1925
|
+
let t6;
|
|
1926
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => setOpen(!0), $[12] = t6) : t6 = $[12];
|
|
1927
|
+
const expand = t6;
|
|
1928
|
+
let t7;
|
|
1929
|
+
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [expandElementRef.current, popoverElementRef.current], $[13] = t7) : t7 = $[13], useClickOutsideEvent(collapse, t7);
|
|
1930
|
+
let t8;
|
|
1931
|
+
$[14] !== children ? (t8 = Children.toArray(children).filter(isValidElement), $[14] = children, $[15] = t8) : t8 = $[15];
|
|
1932
|
+
const rawItems = t8;
|
|
1933
|
+
let t9;
|
|
1934
|
+
$[16] !== expandButtonProps || $[17] !== gapY || $[18] !== maxLength || $[19] !== open || $[20] !== rawItems ? (t9 = {
|
|
1935
|
+
collapse,
|
|
1936
|
+
expand,
|
|
1937
|
+
expandElementRef,
|
|
1938
|
+
maxLength,
|
|
1939
|
+
open,
|
|
1940
|
+
popoverElementRef,
|
|
1941
|
+
rawItems,
|
|
1942
|
+
gapY,
|
|
1943
|
+
expandButtonProps
|
|
1944
|
+
}, $[16] = expandButtonProps, $[17] = gapY, $[18] = maxLength, $[19] = open, $[20] = rawItems, $[21] = t9) : t9 = $[21];
|
|
1945
|
+
const items = useItems(t9);
|
|
1946
|
+
let t10;
|
|
1947
|
+
$[22] !== className ? (t10 = breadcrumbs({
|
|
1637
1948
|
className
|
|
1638
|
-
}),
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1949
|
+
}), $[22] = className, $[23] = t10) : t10 = $[23];
|
|
1950
|
+
let t11;
|
|
1951
|
+
if ($[24] !== items || $[25] !== separator) {
|
|
1952
|
+
let t122;
|
|
1953
|
+
$[27] !== separator ? (t122 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1954
|
+
itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
|
|
1955
|
+
/* @__PURE__ */ jsx(Box, { as: "li", children: item })
|
|
1956
|
+
] }, itemIndex), $[27] = separator, $[28] = t122) : t122 = $[28], t11 = items.map(t122), $[24] = items, $[25] = separator, $[26] = t11;
|
|
1957
|
+
} else
|
|
1958
|
+
t11 = $[26];
|
|
1959
|
+
let t12;
|
|
1960
|
+
return $[29] !== as || $[30] !== gap || $[31] !== gapX || $[32] !== gapY || $[33] !== rest || $[34] !== t10 || $[35] !== t11 ? (t12 = /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: t10, gap, gapX, gapY, children: t11 }), $[29] = as, $[30] = gap, $[31] = gapX, $[32] = gapY, $[33] = rest, $[34] = t10, $[35] = t11, $[36] = t12) : t12 = $[36], t12;
|
|
1961
|
+
}
|
|
1962
|
+
function useItems(t0) {
|
|
1963
|
+
const $ = c(30), {
|
|
1964
|
+
collapse,
|
|
1965
|
+
expand,
|
|
1966
|
+
expandElementRef,
|
|
1967
|
+
maxLength,
|
|
1968
|
+
open,
|
|
1969
|
+
popoverElementRef,
|
|
1970
|
+
rawItems,
|
|
1971
|
+
gapY,
|
|
1972
|
+
expandButtonProps
|
|
1973
|
+
} = t0, len = rawItems.length;
|
|
1974
|
+
if (maxLength && len > maxLength) {
|
|
1975
|
+
const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
|
|
1976
|
+
let t1;
|
|
1977
|
+
if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandButtonProps || $[5] !== expandElementRef || $[6] !== gapY || $[7] !== len || $[8] !== open || $[9] !== popoverElementRef || $[10] !== rawItems) {
|
|
1978
|
+
const t2 = rawItems.slice(0, beforeLength - 1);
|
|
1979
|
+
let t3;
|
|
1980
|
+
$[12] !== afterLength || $[13] !== beforeLength || $[14] !== len || $[15] !== rawItems ? (t3 = rawItems.slice(beforeLength - 1, len - afterLength), $[12] = afterLength, $[13] = beforeLength, $[14] = len, $[15] = rawItems, $[16] = t3) : t3 = $[16];
|
|
1981
|
+
let t4;
|
|
1982
|
+
$[17] !== gapY || $[18] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, { as: "ol", gap: gapY, overflow: "auto", children: t3 }), $[17] = gapY, $[18] = t3, $[19] = t4) : t4 = $[19];
|
|
1983
|
+
const t5 = open ? collapse : expand;
|
|
1984
|
+
let t6;
|
|
1985
|
+
$[20] !== expandButtonProps || $[21] !== expandElementRef || $[22] !== open || $[23] !== t5 ? (t6 = /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: t5, ref: expandElementRef, selected: open }), $[20] = expandButtonProps, $[21] = expandElementRef, $[22] = open, $[23] = t5, $[24] = t6) : t6 = $[24];
|
|
1986
|
+
let t7;
|
|
1987
|
+
$[25] !== open || $[26] !== popoverElementRef || $[27] !== t4 || $[28] !== t6 ? (t7 = /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: t4, open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: t6 }, "button"), $[25] = open, $[26] = popoverElementRef, $[27] = t4, $[28] = t6, $[29] = t7) : t7 = $[29], t1 = [...t2, t7, ...rawItems.slice(len - afterLength)], $[0] = afterLength, $[1] = beforeLength, $[2] = collapse, $[3] = expand, $[4] = expandButtonProps, $[5] = expandElementRef, $[6] = gapY, $[7] = len, $[8] = open, $[9] = popoverElementRef, $[10] = rawItems, $[11] = t1;
|
|
1988
|
+
} else
|
|
1989
|
+
t1 = $[11];
|
|
1990
|
+
return t1;
|
|
1991
|
+
}
|
|
1992
|
+
return rawItems;
|
|
1642
1993
|
}
|
|
1643
1994
|
const DEFAULT_CONTAINER_ELEMENT = "div";
|
|
1644
1995
|
function Container(props) {
|
|
@@ -1659,18 +2010,18 @@ function Container(props) {
|
|
|
1659
2010
|
let t4;
|
|
1660
2011
|
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;
|
|
1661
2012
|
}
|
|
1662
|
-
function useGlobalKeyDown(onKeyDown) {
|
|
1663
|
-
const $ = c(
|
|
2013
|
+
function useGlobalKeyDown(onKeyDown, options) {
|
|
2014
|
+
const $ = c(7);
|
|
1664
2015
|
let t0;
|
|
1665
2016
|
$[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
|
|
1666
2017
|
const handleKeyDown = useEffectEvent(t0);
|
|
1667
2018
|
let t1;
|
|
1668
|
-
$[2] !== handleKeyDown ? (t1 = () => {
|
|
2019
|
+
$[2] !== handleKeyDown || $[3] !== options ? (t1 = () => {
|
|
1669
2020
|
const handler = (event_0) => handleKeyDown(event_0);
|
|
1670
|
-
return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
|
|
1671
|
-
}, $[2] = handleKeyDown, $[3] = t1) : t1 = $[
|
|
2021
|
+
return window.addEventListener("keydown", handler, options), () => window.removeEventListener("keydown", handler, options);
|
|
2022
|
+
}, $[2] = handleKeyDown, $[3] = options, $[4] = t1) : t1 = $[4];
|
|
1672
2023
|
let t2;
|
|
1673
|
-
$[
|
|
2024
|
+
$[5] !== options ? (t2 = [options], $[5] = options, $[6] = t2) : t2 = $[6], useEffect(t1, t2);
|
|
1674
2025
|
}
|
|
1675
2026
|
function isTargetWithinScope(boundaryElement, portalElement, target) {
|
|
1676
2027
|
return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
|
|
@@ -1694,9 +2045,9 @@ function DialogCard(props) {
|
|
|
1694
2045
|
ref: forwardedRef,
|
|
1695
2046
|
...rest
|
|
1696
2047
|
} = 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]);
|
|
1697
|
-
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement =
|
|
2048
|
+
const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = use(BoundaryElementContext), ref = useRef(null), contentRef = useRef(null), {
|
|
1698
2049
|
isTopLayer
|
|
1699
|
-
} =
|
|
2050
|
+
} = useLayer(), labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton, [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), scrollBottom = scrollHeight - scrollTop;
|
|
1700
2051
|
let t2;
|
|
1701
2052
|
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
|
|
1702
2053
|
let t3;
|
|
@@ -1769,15 +2120,15 @@ function DialogCard(props) {
|
|
|
1769
2120
|
t19
|
|
1770
2121
|
] }), $[55] = as, $[56] = rest, $[57] = t12, $[58] = t18, $[59] = t19, $[60] = t20) : t20 = $[60], t20;
|
|
1771
2122
|
}
|
|
1772
|
-
const DialogContext = createGlobalScopedContext("@sanity/ui/
|
|
2123
|
+
const DialogContext = createGlobalScopedContext("@sanity/ui/v4/dialog", {
|
|
1773
2124
|
version: 0
|
|
1774
2125
|
});
|
|
1775
2126
|
function useDialog() {
|
|
1776
|
-
return
|
|
2127
|
+
return use(DialogContext);
|
|
1777
2128
|
}
|
|
1778
2129
|
const DEFAULT_DIALOG_ELEMENT = "div";
|
|
1779
2130
|
function Dialog(props) {
|
|
1780
|
-
const $ = c(
|
|
2131
|
+
const $ = c(75), context = useDialog(), t0 = props;
|
|
1781
2132
|
let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
|
|
1782
2133
|
$[0] !== t0 ? ({
|
|
1783
2134
|
__unstable_autoFocus: t1,
|
|
@@ -1804,9 +2155,18 @@ function Dialog(props) {
|
|
|
1804
2155
|
tone,
|
|
1805
2156
|
...rest
|
|
1806
2157
|
} = 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]);
|
|
1807
|
-
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 =
|
|
2158
|
+
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 = use(BoundaryElementContext);
|
|
1808
2159
|
let t8;
|
|
1809
|
-
$[24] !==
|
|
2160
|
+
$[24] !== cardRadiusProp ? (t8 = _getResponsiveProp(cardRadiusProp), $[24] = cardRadiusProp, $[25] = t8) : t8 = $[25];
|
|
2161
|
+
const cardRadius = t8;
|
|
2162
|
+
let t9;
|
|
2163
|
+
$[26] !== positionProp ? (t9 = _getResponsiveProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
|
|
2164
|
+
const position = t9;
|
|
2165
|
+
let t10;
|
|
2166
|
+
$[28] !== zOffsetProp ? (t10 = _getResponsiveProp(zOffsetProp), $[28] = zOffsetProp, $[29] = t10) : t10 = $[29];
|
|
2167
|
+
const zOffset = t10, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
|
|
2168
|
+
let t11;
|
|
2169
|
+
$[30] !== onFocus ? (t11 = (event) => {
|
|
1810
2170
|
onFocus?.(event);
|
|
1811
2171
|
const target = event.target, cardElement = cardRef.current;
|
|
1812
2172
|
if (cardElement && target === preDivRef.current) {
|
|
@@ -1818,10 +2178,10 @@ function Dialog(props) {
|
|
|
1818
2178
|
return;
|
|
1819
2179
|
}
|
|
1820
2180
|
isHTMLElement(event.target) && (focusedElementRef.current = event.target);
|
|
1821
|
-
}, $[
|
|
1822
|
-
const handleFocus =
|
|
1823
|
-
let
|
|
1824
|
-
$[
|
|
2181
|
+
}, $[30] = onFocus, $[31] = t11) : t11 = $[31];
|
|
2182
|
+
const handleFocus = t11, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
|
|
2183
|
+
let t12;
|
|
2184
|
+
$[32] !== boundaryElement || $[33] !== portalElement ? (t12 = () => {
|
|
1825
2185
|
rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
|
|
1826
2186
|
const activeElement = document.activeElement;
|
|
1827
2187
|
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
@@ -1834,31 +2194,31 @@ function Dialog(props) {
|
|
|
1834
2194
|
target_0.focus();
|
|
1835
2195
|
}
|
|
1836
2196
|
}, 0);
|
|
1837
|
-
}, $[
|
|
1838
|
-
const handleRootClick =
|
|
1839
|
-
let t10;
|
|
1840
|
-
$[29] !== className ? (t10 = dialog({
|
|
1841
|
-
className
|
|
1842
|
-
}), $[29] = className, $[30] = t10) : t10 = $[30];
|
|
1843
|
-
const t11 = animate ? "" : void 0;
|
|
1844
|
-
let t12;
|
|
1845
|
-
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
|
|
2197
|
+
}, $[32] = boundaryElement, $[33] = portalElement, $[34] = t12) : t12 = $[34];
|
|
2198
|
+
const handleRootClick = t12;
|
|
1846
2199
|
let t13;
|
|
1847
|
-
$[
|
|
1848
|
-
|
|
1849
|
-
|
|
2200
|
+
$[35] !== className ? (t13 = dialog({
|
|
2201
|
+
className
|
|
2202
|
+
}), $[35] = className, $[36] = t13) : t13 = $[36];
|
|
2203
|
+
const t14 = animate ? "" : void 0;
|
|
1850
2204
|
let t15;
|
|
1851
|
-
$[
|
|
2205
|
+
$[37] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t15) : t15 = $[37];
|
|
1852
2206
|
let t16;
|
|
1853
|
-
$[
|
|
2207
|
+
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = dialogContainer(), $[38] = t16) : t16 = $[38];
|
|
1854
2208
|
let t17;
|
|
1855
|
-
$[
|
|
1856
|
-
t12,
|
|
1857
|
-
t15,
|
|
1858
|
-
t16
|
|
1859
|
-
] }), $[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];
|
|
2209
|
+
$[39] !== autoFocus || $[40] !== cardRadius || $[41] !== cardShadow || $[42] !== children || $[43] !== contentRef || $[44] !== footer || $[45] !== header || $[46] !== hideCloseButton || $[47] !== id || $[48] !== onClickOutside || $[49] !== onClose || $[50] !== portalProp || $[51] !== scheme || $[52] !== tone || $[53] !== width ? (t17 = /* @__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 }), $[39] = autoFocus, $[40] = cardRadius, $[41] = cardShadow, $[42] = children, $[43] = contentRef, $[44] = footer, $[45] = header, $[46] = hideCloseButton, $[47] = id, $[48] = onClickOutside, $[49] = onClose, $[50] = portalProp, $[51] = scheme, $[52] = tone, $[53] = width, $[54] = t17) : t17 = $[54];
|
|
1860
2210
|
let t18;
|
|
1861
|
-
|
|
2211
|
+
$[55] !== t17 || $[56] !== width ? (t18 = /* @__PURE__ */ jsx(Container, { alignItems: "center", className: t16, "data-ui": "DialogCard", flexDirection: "column", display: "flex", justifyContent: "center", width, children: t17 }), $[55] = t17, $[56] = width, $[57] = t18) : t18 = $[57];
|
|
2212
|
+
let t19;
|
|
2213
|
+
$[58] === Symbol.for("react.memo_cache_sentinel") ? (t19 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[58] = t19) : t19 = $[58];
|
|
2214
|
+
let t20;
|
|
2215
|
+
$[59] !== handleFocus || $[60] !== handleRootClick || $[61] !== id || $[62] !== labelId || $[63] !== onActivate || $[64] !== padding || $[65] !== position || $[66] !== rest || $[67] !== t13 || $[68] !== t14 || $[69] !== t18 || $[70] !== zOffset ? (t20 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t13, "data-animate": t14, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
|
|
2216
|
+
t15,
|
|
2217
|
+
t18,
|
|
2218
|
+
t19
|
|
2219
|
+
] }), $[59] = handleFocus, $[60] = handleRootClick, $[61] = id, $[62] = labelId, $[63] = onActivate, $[64] = padding, $[65] = position, $[66] = rest, $[67] = t13, $[68] = t14, $[69] = t18, $[70] = zOffset, $[71] = t20) : t20 = $[71];
|
|
2220
|
+
let t21;
|
|
2221
|
+
return $[72] !== portalProp || $[73] !== t20 ? (t21 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t20 }), $[72] = portalProp, $[73] = t20, $[74] = t21) : t21 = $[74], t21;
|
|
1862
2222
|
}
|
|
1863
2223
|
function DialogProvider(props) {
|
|
1864
2224
|
const $ = c(6), {
|
|
@@ -1866,15 +2226,15 @@ function DialogProvider(props) {
|
|
|
1866
2226
|
position,
|
|
1867
2227
|
zOffset
|
|
1868
2228
|
} = props;
|
|
1869
|
-
let t0
|
|
1870
|
-
$[0] !== position || $[1] !== zOffset ? (
|
|
2229
|
+
let t0;
|
|
2230
|
+
$[0] !== position || $[1] !== zOffset ? (t0 = {
|
|
1871
2231
|
version: 0,
|
|
1872
2232
|
position,
|
|
1873
2233
|
zOffset
|
|
1874
|
-
}, $[0] = position, $[1] = zOffset, $[2] =
|
|
2234
|
+
}, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
|
|
1875
2235
|
const contextValue = t0;
|
|
1876
|
-
let
|
|
1877
|
-
return $[3] !== children || $[4] !== contextValue ? (
|
|
2236
|
+
let t1;
|
|
2237
|
+
return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsx(DialogContext, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
|
|
1878
2238
|
}
|
|
1879
2239
|
const DEFAULT_KBD_ELEMENT = "kbd";
|
|
1880
2240
|
function KBD(props) {
|
|
@@ -1928,7 +2288,7 @@ function Hotkeys(props) {
|
|
|
1928
2288
|
let t4;
|
|
1929
2289
|
return $[19] !== as || $[20] !== gap || $[21] !== gapX || $[22] !== gapY || $[23] !== rest || $[24] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { as, "data-ui": "Hotkeys", ...rest, display: "flex", gap, gapX, gapY, children: t3 }), $[19] = as, $[20] = gap, $[21] = gapX, $[22] = gapY, $[23] = rest, $[24] = t3, $[25] = t4) : t4 = $[25], t4;
|
|
1930
2290
|
}
|
|
1931
|
-
const MenuContext = createGlobalScopedContext("@sanity/ui/
|
|
2291
|
+
const MenuContext = createGlobalScopedContext("@sanity/ui/v4/menu", null);
|
|
1932
2292
|
function _isFocusable(element) {
|
|
1933
2293
|
return isHTMLAnchorElement(element) && element.getAttribute("data-disabled") !== "true" || isHTMLButtonElement(element) && !element.disabled;
|
|
1934
2294
|
}
|
|
@@ -1966,16 +2326,24 @@ function _sortElements(rootElement, elements) {
|
|
|
1966
2326
|
elements.sort(_sort);
|
|
1967
2327
|
}
|
|
1968
2328
|
function useMenuController(props) {
|
|
1969
|
-
const {
|
|
2329
|
+
const $ = c(21), {
|
|
1970
2330
|
onKeyDown,
|
|
1971
2331
|
originElement,
|
|
1972
2332
|
shouldFocus,
|
|
1973
2333
|
rootElementRef
|
|
1974
|
-
} = props
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
2334
|
+
} = props;
|
|
2335
|
+
let t0;
|
|
2336
|
+
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
|
|
2337
|
+
const elementsRef = useRef(t0), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), [activeElement, setActiveElement] = useState(null);
|
|
2338
|
+
let t1;
|
|
2339
|
+
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (nextActiveIndex) => {
|
|
2340
|
+
_setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex, setActiveElement(elementsRef.current[nextActiveIndex] || null);
|
|
2341
|
+
}, $[1] = t1) : t1 = $[1];
|
|
2342
|
+
const setActiveIndex = t1;
|
|
2343
|
+
let t2;
|
|
2344
|
+
$[2] !== rootElementRef ? (t2 = (element, selected) => {
|
|
2345
|
+
if (!element)
|
|
2346
|
+
return _temp$7;
|
|
1979
2347
|
if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
|
|
1980
2348
|
const selectedIndex = elementsRef.current.indexOf(element);
|
|
1981
2349
|
setActiveIndex(selectedIndex);
|
|
@@ -1984,7 +2352,10 @@ function useMenuController(props) {
|
|
|
1984
2352
|
const idx = elementsRef.current.indexOf(element);
|
|
1985
2353
|
idx > -1 && elementsRef.current.splice(idx, 1);
|
|
1986
2354
|
};
|
|
1987
|
-
}, [rootElementRef,
|
|
2355
|
+
}, $[2] = rootElementRef, $[3] = t2) : t2 = $[3];
|
|
2356
|
+
const mount = t2;
|
|
2357
|
+
let t3;
|
|
2358
|
+
$[4] !== onKeyDown || $[5] !== originElement ? (t3 = (event) => {
|
|
1988
2359
|
if (event.key === "Tab") {
|
|
1989
2360
|
originElement && originElement.focus();
|
|
1990
2361
|
return;
|
|
@@ -1992,7 +2363,8 @@ function useMenuController(props) {
|
|
|
1992
2363
|
if (event.key === "Home") {
|
|
1993
2364
|
event.preventDefault(), event.stopPropagation();
|
|
1994
2365
|
const el = _getFocusableElements(elementsRef.current)[0];
|
|
1995
|
-
if (!el)
|
|
2366
|
+
if (!el)
|
|
2367
|
+
return;
|
|
1996
2368
|
const currentIndex = elementsRef.current.indexOf(el);
|
|
1997
2369
|
setActiveIndex(currentIndex);
|
|
1998
2370
|
return;
|
|
@@ -2000,7 +2372,8 @@ function useMenuController(props) {
|
|
|
2000
2372
|
if (event.key === "End") {
|
|
2001
2373
|
event.preventDefault(), event.stopPropagation();
|
|
2002
2374
|
const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
|
|
2003
|
-
if (!el_0)
|
|
2375
|
+
if (!el_0)
|
|
2376
|
+
return;
|
|
2004
2377
|
const currentIndex_0 = elementsRef.current.indexOf(el_0);
|
|
2005
2378
|
setActiveIndex(currentIndex_0);
|
|
2006
2379
|
return;
|
|
@@ -2008,7 +2381,8 @@ function useMenuController(props) {
|
|
|
2008
2381
|
if (event.key === "ArrowUp") {
|
|
2009
2382
|
event.preventDefault(), event.stopPropagation();
|
|
2010
2383
|
const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
|
|
2011
|
-
if (focusableLen === 0)
|
|
2384
|
+
if (focusableLen === 0)
|
|
2385
|
+
return;
|
|
2012
2386
|
const focusedElement = elementsRef.current[activeIndexRef.current];
|
|
2013
2387
|
let focusedIndex = focusableElements_1.indexOf(focusedElement);
|
|
2014
2388
|
focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
|
|
@@ -2019,7 +2393,8 @@ function useMenuController(props) {
|
|
|
2019
2393
|
if (event.key === "ArrowDown") {
|
|
2020
2394
|
event.preventDefault(), event.stopPropagation();
|
|
2021
2395
|
const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
|
|
2022
|
-
if (focusableLen_0 === 0)
|
|
2396
|
+
if (focusableLen_0 === 0)
|
|
2397
|
+
return;
|
|
2023
2398
|
const focusedElement_0 = elementsRef.current[activeIndexRef.current];
|
|
2024
2399
|
let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
|
|
2025
2400
|
focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
|
|
@@ -2028,14 +2403,23 @@ function useMenuController(props) {
|
|
|
2028
2403
|
return;
|
|
2029
2404
|
}
|
|
2030
2405
|
onKeyDown && onKeyDown(event);
|
|
2031
|
-
}, [onKeyDown, originElement,
|
|
2406
|
+
}, $[4] = onKeyDown, $[5] = originElement, $[6] = t3) : t3 = $[6];
|
|
2407
|
+
const handleKeyDown = t3;
|
|
2408
|
+
let t4;
|
|
2409
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = (event_0) => {
|
|
2032
2410
|
const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
|
|
2033
2411
|
setActiveIndex(currentIndex_3);
|
|
2034
|
-
}, [
|
|
2412
|
+
}, $[7] = t4) : t4 = $[7];
|
|
2413
|
+
const handleItemMouseEnter = t4;
|
|
2414
|
+
let t5;
|
|
2415
|
+
$[8] !== rootElementRef ? (t5 = () => {
|
|
2035
2416
|
setActiveIndex(-2), rootElementRef.current?.focus();
|
|
2036
|
-
}, [rootElementRef,
|
|
2037
|
-
|
|
2038
|
-
|
|
2417
|
+
}, $[8] = rootElementRef, $[9] = t5) : t5 = $[9];
|
|
2418
|
+
const handleItemMouseLeave = t5;
|
|
2419
|
+
let t6, t7;
|
|
2420
|
+
$[10] !== activeIndex || $[11] !== rootElementRef || $[12] !== shouldFocus ? (t6 = () => {
|
|
2421
|
+
if (!rootElementRef.current)
|
|
2422
|
+
return;
|
|
2039
2423
|
const rafId = requestAnimationFrame(() => {
|
|
2040
2424
|
if (activeIndex === -1) {
|
|
2041
2425
|
if (shouldFocus === "first") {
|
|
@@ -2057,18 +2441,22 @@ function useMenuController(props) {
|
|
|
2057
2441
|
(elementsRef.current[activeIndex] || null)?.focus();
|
|
2058
2442
|
});
|
|
2059
2443
|
return () => cancelAnimationFrame(rafId);
|
|
2060
|
-
}, [activeIndex,
|
|
2444
|
+
}, t7 = [activeIndex, rootElementRef, setActiveIndex, shouldFocus], $[10] = activeIndex, $[11] = rootElementRef, $[12] = shouldFocus, $[13] = t6, $[14] = t7) : (t6 = $[13], t7 = $[14]), useEffect(t6, t7);
|
|
2445
|
+
let t8;
|
|
2446
|
+
return $[15] !== activeElement || $[16] !== activeIndex || $[17] !== handleItemMouseLeave || $[18] !== handleKeyDown || $[19] !== mount ? (t8 = {
|
|
2061
2447
|
activeElement,
|
|
2062
2448
|
activeIndex,
|
|
2063
2449
|
handleItemMouseEnter,
|
|
2064
2450
|
handleItemMouseLeave,
|
|
2065
2451
|
handleKeyDown,
|
|
2066
2452
|
mount
|
|
2067
|
-
};
|
|
2453
|
+
}, $[15] = activeElement, $[16] = activeIndex, $[17] = handleItemMouseLeave, $[18] = handleKeyDown, $[19] = mount, $[20] = t8) : t8 = $[20], t8;
|
|
2454
|
+
}
|
|
2455
|
+
function _temp$7() {
|
|
2068
2456
|
}
|
|
2069
2457
|
const DEFAULT_MENU_ELEMENT = "div";
|
|
2070
2458
|
function Menu(props) {
|
|
2071
|
-
const $ = c(
|
|
2459
|
+
const $ = c(56), t0 = props;
|
|
2072
2460
|
let _shouldFocus, children, className, forwardedRef, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, rest, t1, t2, t3;
|
|
2073
2461
|
$[0] !== t0 ? ({
|
|
2074
2462
|
as: t1,
|
|
@@ -2123,32 +2511,29 @@ function Menu(props) {
|
|
|
2123
2511
|
$[28] !== isTopLayer || $[29] !== onEscape ? (t10 = (event) => {
|
|
2124
2512
|
isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
|
|
2125
2513
|
}, $[28] = isTopLayer, $[29] = onEscape, $[30] = t10) : t10 = $[30], useGlobalKeyDown(t10);
|
|
2126
|
-
let t11
|
|
2127
|
-
$[31] !== activeElement || $[32] !==
|
|
2128
|
-
version:
|
|
2514
|
+
let t11;
|
|
2515
|
+
$[31] !== activeElement || $[32] !== handleItemMouseEnter || $[33] !== handleItemMouseLeave || $[34] !== mount || $[35] !== onClickOutside || $[36] !== onEscape || $[37] !== onItemClick || $[38] !== registerElement ? (t11 = {
|
|
2516
|
+
version: 2,
|
|
2129
2517
|
activeElement,
|
|
2130
|
-
activeIndex,
|
|
2131
2518
|
mount,
|
|
2132
2519
|
onClickOutside,
|
|
2133
2520
|
onEscape,
|
|
2134
2521
|
onItemClick,
|
|
2135
2522
|
onItemMouseEnter: handleItemMouseEnter,
|
|
2136
2523
|
onItemMouseLeave: handleItemMouseLeave,
|
|
2137
|
-
registerElement
|
|
2138
|
-
|
|
2139
|
-
onMouseLeave: handleItemMouseLeave
|
|
2140
|
-
}, $[31] = activeElement, $[32] = activeIndex, $[33] = handleItemMouseEnter, $[34] = handleItemMouseLeave, $[35] = mount, $[36] = onClickOutside, $[37] = onEscape, $[38] = onItemClick, $[39] = registerElement, $[40] = t12) : t12 = $[40], t11 = t12;
|
|
2524
|
+
registerElement
|
|
2525
|
+
}, $[31] = activeElement, $[32] = handleItemMouseEnter, $[33] = handleItemMouseLeave, $[34] = mount, $[35] = onClickOutside, $[36] = onEscape, $[37] = onItemClick, $[38] = registerElement, $[39] = t11) : t11 = $[39];
|
|
2141
2526
|
const value = t11;
|
|
2142
|
-
let
|
|
2143
|
-
$[
|
|
2527
|
+
let t12;
|
|
2528
|
+
$[40] !== className ? (t12 = menu({
|
|
2144
2529
|
className
|
|
2145
|
-
}), $[
|
|
2530
|
+
}), $[40] = className, $[41] = t12) : t12 = $[41];
|
|
2531
|
+
let t13;
|
|
2532
|
+
$[42] !== children || $[43] !== gap ? (t13 = /* @__PURE__ */ jsx(Stack, { gap, children }), $[42] = children, $[43] = gap, $[44] = t13) : t13 = $[44];
|
|
2146
2533
|
let t14;
|
|
2147
|
-
$[
|
|
2534
|
+
$[45] !== as || $[46] !== handleKeyDown || $[47] !== handleRefChange || $[48] !== padding || $[49] !== rest || $[50] !== t12 || $[51] !== t13 ? (t14 = /* @__PURE__ */ jsx(Box, { "data-ui": "Menu", ...rest, as, className: t12, onKeyDown: handleKeyDown, overflow: "auto", outline: "none", padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t13 }), $[45] = as, $[46] = handleKeyDown, $[47] = handleRefChange, $[48] = padding, $[49] = rest, $[50] = t12, $[51] = t13, $[52] = t14) : t14 = $[52];
|
|
2148
2535
|
let t15;
|
|
2149
|
-
|
|
2150
|
-
let t16;
|
|
2151
|
-
return $[54] !== t15 || $[55] !== value ? (t16 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t15 }), $[54] = t15, $[55] = value, $[56] = t16) : t16 = $[56], t16;
|
|
2536
|
+
return $[53] !== t14 || $[54] !== value ? (t15 = /* @__PURE__ */ jsx(MenuContext, { value, children: t14 }), $[53] = t14, $[54] = value, $[55] = t15) : t15 = $[55], t15;
|
|
2152
2537
|
}
|
|
2153
2538
|
function MenuButton(props) {
|
|
2154
2539
|
const $ = c(57), {
|
|
@@ -2226,8 +2611,8 @@ function MenuButton(props) {
|
|
|
2226
2611
|
}, $[22] = menuElements, $[23] = t13) : t13 = $[23];
|
|
2227
2612
|
const handleBlur = t13;
|
|
2228
2613
|
let t14;
|
|
2229
|
-
$[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t14 = () => {
|
|
2230
|
-
setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
|
|
2614
|
+
$[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t14 = (e) => {
|
|
2615
|
+
e.defaultPrevented || (setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus());
|
|
2231
2616
|
}, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t14) : t14 = $[26];
|
|
2232
2617
|
const handleItemClick = t14;
|
|
2233
2618
|
let t15;
|
|
@@ -2268,18 +2653,18 @@ function MenuButton(props) {
|
|
|
2268
2653
|
const button2 = t17;
|
|
2269
2654
|
let t18, t19;
|
|
2270
2655
|
$[43] !== buttonElement ? (t18 = () => buttonElement, t19 = [buttonElement], $[43] = buttonElement, $[44] = t18, $[45] = t19) : (t18 = $[44], t19 = $[45]), useImperativeHandle(forwardedRef, t18, t19);
|
|
2271
|
-
let t20
|
|
2272
|
-
$[46] !== popover2 ? (
|
|
2273
|
-
let
|
|
2274
|
-
$[48] !==
|
|
2656
|
+
let t20;
|
|
2657
|
+
$[46] !== popover2 ? (t20 = popover2 || {}, $[46] = popover2, $[47] = t20) : t20 = $[47];
|
|
2658
|
+
let t21;
|
|
2659
|
+
$[48] !== t20 ? (t21 = {
|
|
2275
2660
|
overflow: "auto",
|
|
2276
|
-
...
|
|
2277
|
-
}, $[48] =
|
|
2278
|
-
const popoverProps =
|
|
2661
|
+
...t20
|
|
2662
|
+
}, $[48] = t20, $[49] = t21) : t21 = $[49];
|
|
2663
|
+
const popoverProps = t21;
|
|
2664
|
+
let t22;
|
|
2665
|
+
$[50] !== button2 ? (t22 = button2 || /* @__PURE__ */ jsx(Fragment, {}), $[50] = button2, $[51] = t22) : t22 = $[51];
|
|
2279
2666
|
let t23;
|
|
2280
|
-
$[
|
|
2281
|
-
let t24;
|
|
2282
|
-
return $[52] !== menu2 || $[53] !== open || $[54] !== popoverProps || $[55] !== t23 ? (t24 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu2, open, children: t23 }), $[52] = menu2, $[53] = open, $[54] = popoverProps, $[55] = t23, $[56] = t24) : t24 = $[56], t24;
|
|
2667
|
+
return $[52] !== menu2 || $[53] !== open || $[54] !== popoverProps || $[55] !== t22 ? (t23 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu2, open, children: t22 }), $[52] = menu2, $[53] = open, $[54] = popoverProps, $[55] = t22, $[56] = t23) : t23 = $[56], t23;
|
|
2283
2668
|
}
|
|
2284
2669
|
function _temp$6(v) {
|
|
2285
2670
|
return !v;
|
|
@@ -2302,10 +2687,10 @@ function MenuDivider(props) {
|
|
|
2302
2687
|
return $[6] !== Element2 || $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t2 }), $[6] = Element2, $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
|
|
2303
2688
|
}
|
|
2304
2689
|
function useMenu() {
|
|
2305
|
-
const value =
|
|
2690
|
+
const value = use(MenuContext);
|
|
2306
2691
|
if (!value)
|
|
2307
2692
|
throw new Error("useMenu(): missing context value");
|
|
2308
|
-
if (!isRecord(value) || value.version !==
|
|
2693
|
+
if (!isRecord(value) || value.version !== 2)
|
|
2309
2694
|
throw new Error("useMenu(): the context value is not compatible");
|
|
2310
2695
|
return value;
|
|
2311
2696
|
}
|
|
@@ -2355,8 +2740,8 @@ function MenuGroup(props) {
|
|
|
2355
2740
|
}, $[18] = onClick, $[19] = t9) : t9 = $[19];
|
|
2356
2741
|
const handleClick = t9;
|
|
2357
2742
|
let t10;
|
|
2358
|
-
$[20] !== onItemClick ? (t10 = () => {
|
|
2359
|
-
setOpen(!1), onItemClick?.();
|
|
2743
|
+
$[20] !== onItemClick ? (t10 = (e) => {
|
|
2744
|
+
setOpen(!1), onItemClick?.(e);
|
|
2360
2745
|
}, $[20] = onItemClick, $[21] = t10) : t10 = $[21];
|
|
2361
2746
|
const handleChildItemClick = t10;
|
|
2362
2747
|
let t11;
|
|
@@ -2415,36 +2800,40 @@ function MenuGroup(props) {
|
|
|
2415
2800
|
}
|
|
2416
2801
|
const DEFAULT_MENU_ITEM_ELEMENT = "button";
|
|
2417
2802
|
function MenuItem(props) {
|
|
2418
|
-
const $ = c(
|
|
2419
|
-
let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY,
|
|
2420
|
-
$[0] !== t0
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2803
|
+
const $ = c(72), t0 = props;
|
|
2804
|
+
let IconComponent, IconRightComponent, children, disabled, forwardedRef, gapX, gapY, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, rest, selectedProp, t1, t2, t3, t4, t5, t6, t7, text2;
|
|
2805
|
+
if ($[0] !== t0) {
|
|
2806
|
+
const {
|
|
2807
|
+
as: t82,
|
|
2808
|
+
children: t92,
|
|
2809
|
+
disabled: t102,
|
|
2810
|
+
fontSize: t112,
|
|
2811
|
+
gap: t122,
|
|
2812
|
+
gapX: t132,
|
|
2813
|
+
gapY: t142,
|
|
2814
|
+
hotkeys: t152,
|
|
2815
|
+
icon: t162,
|
|
2816
|
+
iconRight: t172,
|
|
2817
|
+
onClick: t18,
|
|
2818
|
+
padding: t19,
|
|
2819
|
+
paddingX: t20,
|
|
2820
|
+
paddingY: t21,
|
|
2821
|
+
paddingTop: t22,
|
|
2822
|
+
paddingRight: t23,
|
|
2823
|
+
paddingBottom: t24,
|
|
2824
|
+
paddingLeft: t25,
|
|
2825
|
+
pressed,
|
|
2826
|
+
radius: t26,
|
|
2827
|
+
ref: t27,
|
|
2828
|
+
role: t28,
|
|
2829
|
+
selected: t29,
|
|
2830
|
+
text: t30,
|
|
2831
|
+
tone: t31,
|
|
2832
|
+
...t32
|
|
2833
|
+
} = t0;
|
|
2834
|
+
t1 = t82, children = t92, disabled = t102, t2 = t112, t3 = t122, gapX = t132, gapY = t142, hotkeys = t152, IconComponent = t162, IconRightComponent = t172, onClick = t18, t4 = t19, paddingX = t20, paddingY = t21, paddingTop = t22, paddingRight = t23, paddingBottom = t24, paddingLeft = t25, t5 = t26, forwardedRef = t27, t6 = t28, selectedProp = t29, text2 = t30, t7 = t31, rest = t32, $[0] = t0, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = forwardedRef, $[6] = gapX, $[7] = gapY, $[8] = hotkeys, $[9] = onClick, $[10] = paddingBottom, $[11] = paddingLeft, $[12] = paddingRight, $[13] = paddingTop, $[14] = paddingX, $[15] = paddingY, $[16] = rest, $[17] = selectedProp, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = t6, $[24] = t7, $[25] = text2;
|
|
2835
|
+
} else
|
|
2836
|
+
IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], forwardedRef = $[5], gapX = $[6], gapY = $[7], hotkeys = $[8], onClick = $[9], paddingBottom = $[10], paddingLeft = $[11], paddingRight = $[12], paddingTop = $[13], paddingX = $[14], paddingY = $[15], rest = $[16], selectedProp = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], t6 = $[23], t7 = $[24], text2 = $[25];
|
|
2448
2837
|
const as = t1 === void 0 ? DEFAULT_MENU_ITEM_ELEMENT : t1, fontSize = t2 === void 0 ? 1 : t2, gap = t3 === void 0 ? 3 : t3, padding = t4 === void 0 ? 3 : t4, radius = t5 === void 0 ? 2 : t5, role = t6 === void 0 ? "menuitem" : t6, tone = t7 === void 0 ? "default" : t7, menu2 = useMenu(), {
|
|
2449
2838
|
activeElement,
|
|
2450
2839
|
mount,
|
|
@@ -2453,16 +2842,16 @@ function MenuItem(props) {
|
|
|
2453
2842
|
onItemMouseLeave
|
|
2454
2843
|
} = menu2, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
|
|
2455
2844
|
let t8;
|
|
2456
|
-
$[
|
|
2845
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[26] = t8) : t8 = $[26], useImperativeHandle(forwardedRef, t8);
|
|
2457
2846
|
let t10, t9;
|
|
2458
|
-
$[
|
|
2847
|
+
$[27] !== mount || $[28] !== rootElement || $[29] !== selectedProp ? (t9 = () => mount(rootElement, selectedProp), t10 = [mount, rootElement, selectedProp], $[27] = mount, $[28] = rootElement, $[29] = selectedProp, $[30] = t10, $[31] = t9) : (t10 = $[30], t9 = $[31]), useEffect(t9, t10);
|
|
2459
2848
|
let t11;
|
|
2460
|
-
$[
|
|
2461
|
-
disabled || (onClick && onClick(event), onItemClick && onItemClick());
|
|
2462
|
-
}, $[
|
|
2849
|
+
$[32] !== disabled || $[33] !== onClick || $[34] !== onItemClick ? (t11 = (event) => {
|
|
2850
|
+
disabled || (onClick && onClick(event), onItemClick && onItemClick(event));
|
|
2851
|
+
}, $[32] = disabled, $[33] = onClick, $[34] = onItemClick, $[35] = t11) : t11 = $[35];
|
|
2463
2852
|
const handleClick = t11;
|
|
2464
|
-
let t12
|
|
2465
|
-
$[
|
|
2853
|
+
let t12;
|
|
2854
|
+
$[36] !== padding || $[37] !== paddingBottom || $[38] !== paddingLeft || $[39] !== paddingRight || $[40] !== paddingTop || $[41] !== paddingX || $[42] !== paddingY ? (t12 = {
|
|
2466
2855
|
padding,
|
|
2467
2856
|
paddingX,
|
|
2468
2857
|
paddingY,
|
|
@@ -2470,15 +2859,15 @@ function MenuItem(props) {
|
|
|
2470
2859
|
paddingRight,
|
|
2471
2860
|
paddingBottom,
|
|
2472
2861
|
paddingLeft
|
|
2473
|
-
}, $[
|
|
2862
|
+
}, $[36] = padding, $[37] = paddingBottom, $[38] = paddingLeft, $[39] = paddingRight, $[40] = paddingTop, $[41] = paddingX, $[42] = paddingY, $[43] = t12) : t12 = $[43];
|
|
2474
2863
|
const paddingProps = t12;
|
|
2475
|
-
let
|
|
2476
|
-
$[
|
|
2864
|
+
let t13;
|
|
2865
|
+
$[44] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
|
|
2477
2866
|
ref.current = el, setRootElement(el);
|
|
2478
|
-
}, $[
|
|
2479
|
-
const setRef =
|
|
2480
|
-
let
|
|
2481
|
-
$[
|
|
2867
|
+
}, $[44] = t13) : t13 = $[44];
|
|
2868
|
+
const setRef = t13, t14 = as === "button" ? "button" : void 0;
|
|
2869
|
+
let t15;
|
|
2870
|
+
$[45] !== IconComponent || $[46] !== IconRightComponent || $[47] !== fontSize || $[48] !== gap || $[49] !== gapX || $[50] !== gapY || $[51] !== hotkeys || $[52] !== paddingProps || $[53] !== text2 ? (t15 = (IconComponent || text2 || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap, gapX, gapY, align: "center", ...paddingProps, children: [
|
|
2482
2871
|
IconComponent && /* @__PURE__ */ jsxs(Text, { muted: !0, size: fontSize, children: [
|
|
2483
2872
|
isValidElement(IconComponent) && IconComponent,
|
|
2484
2873
|
isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
|
|
@@ -2492,14 +2881,14 @@ function MenuItem(props) {
|
|
|
2492
2881
|
isValidElement(IconRightComponent) && IconRightComponent,
|
|
2493
2882
|
isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
|
|
2494
2883
|
] })
|
|
2495
|
-
] }), $[
|
|
2496
|
-
let
|
|
2497
|
-
$[
|
|
2498
|
-
let
|
|
2499
|
-
return $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== rest || $[66] !== role || $[67] !==
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
] }), $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = rest, $[66] = role, $[67] =
|
|
2884
|
+
] }), $[45] = IconComponent, $[46] = IconRightComponent, $[47] = fontSize, $[48] = gap, $[49] = gapX, $[50] = gapY, $[51] = hotkeys, $[52] = paddingProps, $[53] = text2, $[54] = t15) : t15 = $[54];
|
|
2885
|
+
let t16;
|
|
2886
|
+
$[55] !== children || $[56] !== paddingProps ? (t16 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[55] = children, $[56] = paddingProps, $[57] = t16) : t16 = $[57];
|
|
2887
|
+
let t17;
|
|
2888
|
+
return $[58] !== active || $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== radius || $[65] !== rest || $[66] !== role || $[67] !== t14 || $[68] !== t15 || $[69] !== t16 || $[70] !== tone ? (t17 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...rest, as, radius, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role, selected: active, tabIndex: -1, tone, type: t14, children: [
|
|
2889
|
+
t15,
|
|
2890
|
+
t16
|
|
2891
|
+
] }), $[58] = active, $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = radius, $[65] = rest, $[66] = role, $[67] = t14, $[68] = t15, $[69] = t16, $[70] = tone, $[71] = t17) : t17 = $[71], t17;
|
|
2503
2892
|
}
|
|
2504
2893
|
const DEFAULT_TAB_ELEMENT = "button";
|
|
2505
2894
|
function Tab(props) {
|
|
@@ -2710,7 +3099,7 @@ function _temp$5() {
|
|
|
2710
3099
|
return !0;
|
|
2711
3100
|
}
|
|
2712
3101
|
const subscribe = () => () => {
|
|
2713
|
-
}, ToastContext = createGlobalScopedContext("@sanity/ui/
|
|
3102
|
+
}, ToastContext = createGlobalScopedContext("@sanity/ui/v4/toast", null), DEFAULT_GRID_ELEMENT = "div";
|
|
2714
3103
|
function Grid(props) {
|
|
2715
3104
|
const $ = c(8), t0 = props;
|
|
2716
3105
|
let children, rest, t1;
|
|
@@ -2760,8 +3149,8 @@ function ToastProvider(props) {
|
|
|
2760
3149
|
let t1;
|
|
2761
3150
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
|
|
2762
3151
|
const [state, setState] = useState(t1), mounted = useMounted();
|
|
2763
|
-
let t2
|
|
2764
|
-
$[1] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3152
|
+
let t2;
|
|
3153
|
+
$[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
|
|
2765
3154
|
version: 0,
|
|
2766
3155
|
push: (params) => {
|
|
2767
3156
|
const id = params.id ?? generateToastId(), duration = params.duration ?? 5e3;
|
|
@@ -2773,7 +3162,7 @@ function ToastProvider(props) {
|
|
|
2773
3162
|
startTransition(() => {
|
|
2774
3163
|
timeoutId && clearTimeout(timeoutId), setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id));
|
|
2775
3164
|
});
|
|
2776
|
-
}, timeoutId = setTimeout(dismiss, duration);
|
|
3165
|
+
}, timeoutId = duration === 1 / 0 ? void 0 : setTimeout(dismiss, duration);
|
|
2777
3166
|
return [...prevState.filter((toast_1) => toast_1.id !== id), {
|
|
2778
3167
|
dismiss,
|
|
2779
3168
|
id,
|
|
@@ -2785,15 +3174,15 @@ function ToastProvider(props) {
|
|
|
2785
3174
|
});
|
|
2786
3175
|
}), id;
|
|
2787
3176
|
}
|
|
2788
|
-
}, $[1] =
|
|
3177
|
+
}, $[1] = t2) : t2 = $[1];
|
|
2789
3178
|
const value = t2;
|
|
3179
|
+
let t3;
|
|
3180
|
+
$[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = 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$4) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
|
|
2790
3181
|
let t4;
|
|
2791
|
-
|
|
2792
|
-
let t5;
|
|
2793
|
-
return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
|
|
3182
|
+
return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxs(ToastContext, { value, children: [
|
|
2794
3183
|
children,
|
|
2795
|
-
|
|
2796
|
-
] }), $[10] = children, $[11] =
|
|
3184
|
+
t3
|
|
3185
|
+
] }), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
2797
3186
|
}
|
|
2798
3187
|
function _temp$4(t0) {
|
|
2799
3188
|
const {
|
|
@@ -2804,7 +3193,7 @@ function _temp$4(t0) {
|
|
|
2804
3193
|
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);
|
|
2805
3194
|
}
|
|
2806
3195
|
function useToast() {
|
|
2807
|
-
const value =
|
|
3196
|
+
const value = use(ToastContext);
|
|
2808
3197
|
if (!value)
|
|
2809
3198
|
throw new Error("useToast(): missing context value");
|
|
2810
3199
|
if (!isRecord(value) || value.version !== 0)
|
|
@@ -2865,7 +3254,7 @@ function _focusItemElement(el) {
|
|
|
2865
3254
|
firstChild && firstChild instanceof HTMLElement && firstChild.focus();
|
|
2866
3255
|
}
|
|
2867
3256
|
}
|
|
2868
|
-
const TreeContext = createGlobalScopedContext("@sanity/ui/
|
|
3257
|
+
const TreeContext = createGlobalScopedContext("@sanity/ui/v4/tree", null), DEFAULT_TREE_ELEMENT = "div";
|
|
2869
3258
|
function Tree(props) {
|
|
2870
3259
|
const $ = c(38), t0 = props;
|
|
2871
3260
|
let children, forwardedRef, onFocus, rest, t1;
|
|
@@ -2877,27 +3266,27 @@ function Tree(props) {
|
|
|
2877
3266
|
...rest
|
|
2878
3267
|
} = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = onFocus, $[4] = rest, $[5] = t1) : (children = $[1], forwardedRef = $[2], onFocus = $[3], rest = $[4], t1 = $[5]);
|
|
2879
3268
|
const gap = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
|
|
2880
|
-
let t2
|
|
2881
|
-
$[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3269
|
+
let t2;
|
|
3270
|
+
$[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6];
|
|
2882
3271
|
const path = t2;
|
|
3272
|
+
let t3;
|
|
3273
|
+
$[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
|
|
3274
|
+
const [itemElements, setItemElements] = useState(t3);
|
|
2883
3275
|
let t4;
|
|
2884
|
-
$[
|
|
2885
|
-
const [
|
|
3276
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
|
|
3277
|
+
const [state, setState] = useState(t4), stateRef = useRef(state);
|
|
2886
3278
|
let t5;
|
|
2887
|
-
$[
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[9] = t6) : t6 = $[9], useImperativeHandle(forwardedRef, t6);
|
|
2891
|
-
let t7, t8;
|
|
2892
|
-
$[10] !== focusedElement ? (t7 = () => {
|
|
3279
|
+
$[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], useImperativeHandle(forwardedRef, t5);
|
|
3280
|
+
let t6, t7;
|
|
3281
|
+
$[10] !== focusedElement ? (t6 = () => {
|
|
2893
3282
|
focusedElementRef.current = focusedElement;
|
|
2894
|
-
},
|
|
2895
|
-
let
|
|
2896
|
-
$[13] !== state ? (
|
|
3283
|
+
}, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), useEffect(t6, t7);
|
|
3284
|
+
let t8, t9;
|
|
3285
|
+
$[13] !== state ? (t8 = () => {
|
|
2897
3286
|
stateRef.current = state;
|
|
2898
|
-
},
|
|
2899
|
-
let
|
|
2900
|
-
$[16] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3287
|
+
}, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), useEffect(t8, t9);
|
|
3288
|
+
let t10;
|
|
3289
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
|
|
2901
3290
|
...s,
|
|
2902
3291
|
[path_0]: {
|
|
2903
3292
|
element,
|
|
@@ -2910,10 +3299,10 @@ function Tree(props) {
|
|
|
2910
3299
|
};
|
|
2911
3300
|
return delete newState[path_0], newState;
|
|
2912
3301
|
});
|
|
2913
|
-
}), $[16] =
|
|
2914
|
-
const registerItem =
|
|
2915
|
-
let
|
|
2916
|
-
$[17] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3302
|
+
}), $[16] = t10) : t10 = $[16];
|
|
3303
|
+
const registerItem = t10;
|
|
3304
|
+
let t11;
|
|
3305
|
+
$[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
|
|
2917
3306
|
setState((s_1) => {
|
|
2918
3307
|
const itemState = s_1[path_1];
|
|
2919
3308
|
return itemState ? {
|
|
@@ -2924,14 +3313,12 @@ function Tree(props) {
|
|
|
2924
3313
|
}
|
|
2925
3314
|
} : s_1;
|
|
2926
3315
|
});
|
|
2927
|
-
}, $[17] =
|
|
2928
|
-
const setExpanded = t12;
|
|
3316
|
+
}, $[17] = t11) : t11 = $[17];
|
|
3317
|
+
const setExpanded = t11, t12 = focusedElement || itemElements[0] || null;
|
|
2929
3318
|
let t13;
|
|
2930
|
-
|
|
2931
|
-
let t15;
|
|
2932
|
-
$[18] !== gap || $[19] !== state || $[20] !== t14 ? (t15 = {
|
|
3319
|
+
$[18] !== gap || $[19] !== state || $[20] !== t12 ? (t13 = {
|
|
2933
3320
|
version: 0,
|
|
2934
|
-
focusedElement:
|
|
3321
|
+
focusedElement: t12,
|
|
2935
3322
|
gap,
|
|
2936
3323
|
level: 0,
|
|
2937
3324
|
path,
|
|
@@ -2939,10 +3326,10 @@ function Tree(props) {
|
|
|
2939
3326
|
setExpanded,
|
|
2940
3327
|
setFocusedElement,
|
|
2941
3328
|
state
|
|
2942
|
-
}, $[18] = gap, $[19] = state, $[20] =
|
|
3329
|
+
}, $[18] = gap, $[19] = state, $[20] = t12, $[21] = t13) : t13 = $[21];
|
|
2943
3330
|
const contextValue = t13;
|
|
2944
|
-
let
|
|
2945
|
-
$[22] !== itemElements ? (
|
|
3331
|
+
let t14;
|
|
3332
|
+
$[22] !== itemElements ? (t14 = (event) => {
|
|
2946
3333
|
if (focusedElementRef.current) {
|
|
2947
3334
|
if (event.key === "ArrowDown") {
|
|
2948
3335
|
event.preventDefault();
|
|
@@ -3001,29 +3388,29 @@ function Tree(props) {
|
|
|
3001
3388
|
return;
|
|
3002
3389
|
}
|
|
3003
3390
|
}
|
|
3004
|
-
}, $[22] = itemElements, $[23] =
|
|
3005
|
-
const handleKeyDown =
|
|
3006
|
-
let
|
|
3007
|
-
$[24] !== onFocus ? (
|
|
3391
|
+
}, $[22] = itemElements, $[23] = t14) : t14 = $[23];
|
|
3392
|
+
const handleKeyDown = t14;
|
|
3393
|
+
let t15;
|
|
3394
|
+
$[24] !== onFocus ? (t15 = (event_0) => {
|
|
3008
3395
|
setFocusedElement(event_0.target), onFocus?.(event_0);
|
|
3009
|
-
}, $[24] = onFocus, $[25] =
|
|
3010
|
-
const handleFocus =
|
|
3011
|
-
let
|
|
3012
|
-
$[26] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3396
|
+
}, $[24] = onFocus, $[25] = t15) : t15 = $[25];
|
|
3397
|
+
const handleFocus = t15;
|
|
3398
|
+
let t16;
|
|
3399
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => {
|
|
3013
3400
|
if (!ref.current)
|
|
3014
3401
|
return;
|
|
3015
3402
|
const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
|
|
3016
3403
|
setItemElements(_itemElements);
|
|
3017
|
-
}, $[26] =
|
|
3404
|
+
}, $[26] = t16) : t16 = $[26];
|
|
3405
|
+
let t17;
|
|
3406
|
+
$[27] !== children ? (t17 = [children], $[27] = children, $[28] = t17) : t17 = $[28], useEffect(t16, t17);
|
|
3407
|
+
let t18;
|
|
3408
|
+
$[29] !== children || $[30] !== gap || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest ? (t18 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = gap, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t18) : t18 = $[34];
|
|
3018
3409
|
let t19;
|
|
3019
|
-
$[
|
|
3020
|
-
let t20;
|
|
3021
|
-
$[29] !== children || $[30] !== gap || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest ? (t20 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = gap, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20) : t20 = $[34];
|
|
3022
|
-
let t21;
|
|
3023
|
-
return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
|
|
3410
|
+
return $[35] !== contextValue || $[36] !== t18 ? (t19 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t18 }), $[35] = contextValue, $[36] = t18, $[37] = t19) : t19 = $[37], t19;
|
|
3024
3411
|
}
|
|
3025
3412
|
function useTree() {
|
|
3026
|
-
const tree =
|
|
3413
|
+
const tree = use(TreeContext);
|
|
3027
3414
|
if (!tree)
|
|
3028
3415
|
throw new Error("Tree: missing context value");
|
|
3029
3416
|
return tree;
|
|
@@ -3041,97 +3428,135 @@ const TreeGroup = function(props) {
|
|
|
3041
3428
|
return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.gap ? (t3 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.gap, role: "group", gap: tree.gap, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.gap, $[8] = t3) : t3 = $[8], t3;
|
|
3042
3429
|
}, DEFAULT_TREE_ITEM_ELEMENT = "a";
|
|
3043
3430
|
function TreeItem(props) {
|
|
3044
|
-
const
|
|
3431
|
+
const $ = c(129), t0 = props;
|
|
3432
|
+
let IconComponent, children, className, href, idProp, muted, onClick, rest, t1, t2, t3, t4, t5, t6, t7, text2, weight;
|
|
3433
|
+
$[0] !== t0 ? ({
|
|
3045
3434
|
children,
|
|
3046
3435
|
className,
|
|
3047
|
-
expanded:
|
|
3048
|
-
fontSize
|
|
3436
|
+
expanded: t1,
|
|
3437
|
+
fontSize: t2,
|
|
3049
3438
|
href,
|
|
3050
3439
|
icon: IconComponent,
|
|
3051
3440
|
id: idProp,
|
|
3052
|
-
linkAs
|
|
3441
|
+
linkAs: t3,
|
|
3053
3442
|
muted,
|
|
3054
3443
|
onClick,
|
|
3055
|
-
padding
|
|
3056
|
-
radius
|
|
3057
|
-
selected
|
|
3058
|
-
space
|
|
3444
|
+
padding: t4,
|
|
3445
|
+
radius: t5,
|
|
3446
|
+
selected: t6,
|
|
3447
|
+
space: t7,
|
|
3059
3448
|
text: text2,
|
|
3060
3449
|
weight,
|
|
3061
3450
|
...rest
|
|
3062
|
-
} =
|
|
3451
|
+
} = t0, $[0] = t0, $[1] = IconComponent, $[2] = children, $[3] = className, $[4] = href, $[5] = idProp, $[6] = muted, $[7] = onClick, $[8] = rest, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = t7, $[16] = text2, $[17] = weight) : (IconComponent = $[1], children = $[2], className = $[3], href = $[4], idProp = $[5], muted = $[6], onClick = $[7], rest = $[8], t1 = $[9], t2 = $[10], t3 = $[11], t4 = $[12], t5 = $[13], t6 = $[14], t7 = $[15], text2 = $[16], weight = $[17]);
|
|
3452
|
+
const expandedProp = t1 === void 0 ? !1 : t1, fontSize = t2 === void 0 ? 1 : t2, linkAs = t3 === void 0 ? "a" : t3, padding = t4 === void 0 ? 2 : t4, radius = t5 === void 0 ? 2 : t5, selected = t6 === void 0 ? !1 : t6, space = t7 === void 0 ? 2 : t7, [rootElement, setRootElement] = useState(null), treeitemRef = useRef(null), tree = useTree(), {
|
|
3063
3453
|
path,
|
|
3064
3454
|
registerItem,
|
|
3065
3455
|
setExpanded,
|
|
3066
3456
|
setFocusedElement
|
|
3067
|
-
} = tree, _id = useId(), id = idProp || _id
|
|
3457
|
+
} = tree, _id = useId(), id = idProp || _id;
|
|
3458
|
+
let t8, t9;
|
|
3459
|
+
if ($[18] !== id || $[19] !== path) {
|
|
3460
|
+
const itemPath = path.concat([id || ""]);
|
|
3461
|
+
t8 = itemPath, t9 = itemPath.join("/"), $[18] = id, $[19] = path, $[20] = t8, $[21] = t9;
|
|
3462
|
+
} else
|
|
3463
|
+
t8 = $[20], t9 = $[21];
|
|
3464
|
+
let t10;
|
|
3465
|
+
$[22] !== t8 || $[23] !== t9 ? (t10 = [t8, t9], $[22] = t8, $[23] = t9, $[24] = t10) : t10 = $[24];
|
|
3466
|
+
const [itemPath_0, itemKey] = t10, itemState = tree.state[itemKey], expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, focused = tree.focusedElement && tree.focusedElement === rootElement, tabIndex = focused ? 0 : -1, t11 = tree.level + 1;
|
|
3467
|
+
let t12;
|
|
3468
|
+
$[25] !== itemPath_0 || $[26] !== t11 || $[27] !== tree ? (t12 = {
|
|
3068
3469
|
...tree,
|
|
3069
|
-
level:
|
|
3070
|
-
path:
|
|
3071
|
-
}
|
|
3470
|
+
level: t11,
|
|
3471
|
+
path: itemPath_0
|
|
3472
|
+
}, $[25] = itemPath_0, $[26] = t11, $[27] = tree, $[28] = t12) : t12 = $[28];
|
|
3473
|
+
const contextValue = t12;
|
|
3474
|
+
let t13;
|
|
3475
|
+
$[29] !== expanded || $[30] !== itemKey || $[31] !== onClick || $[32] !== rootElement || $[33] !== setExpanded || $[34] !== setFocusedElement ? (t13 = (event) => {
|
|
3072
3476
|
onClick && onClick(event);
|
|
3073
3477
|
const target = event.target;
|
|
3074
|
-
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(
|
|
3075
|
-
}, [expanded, itemKey, onClick, setExpanded, setFocusedElement
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3478
|
+
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
|
|
3479
|
+
}, $[29] = expanded, $[30] = itemKey, $[31] = onClick, $[32] = rootElement, $[33] = setExpanded, $[34] = setFocusedElement, $[35] = t13) : t13 = $[35];
|
|
3480
|
+
const handleClick = t13;
|
|
3481
|
+
let t14;
|
|
3482
|
+
$[36] !== focused || $[37] !== rootElement ? (t14 = (event_0) => {
|
|
3483
|
+
focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
|
|
3484
|
+
}, $[36] = focused, $[37] = rootElement, $[38] = t14) : t14 = $[38];
|
|
3485
|
+
const handleKeyDown = t14;
|
|
3486
|
+
let t15, t16;
|
|
3487
|
+
$[39] !== expanded || $[40] !== itemKey || $[41] !== registerItem || $[42] !== rootElement || $[43] !== selected ? (t15 = () => {
|
|
3488
|
+
if (rootElement)
|
|
3489
|
+
return registerItem(rootElement, itemKey, expanded, selected);
|
|
3490
|
+
}, t16 = [expanded, itemKey, registerItem, rootElement, selected], $[39] = expanded, $[40] = itemKey, $[41] = registerItem, $[42] = rootElement, $[43] = selected, $[44] = t15, $[45] = t16) : (t15 = $[44], t16 = $[45]), useEffect(t15, t16);
|
|
3491
|
+
const t17 = IconComponent || children ? "visible" : "hidden";
|
|
3492
|
+
let t18;
|
|
3493
|
+
$[46] !== t17 ? (t18 = {
|
|
3494
|
+
visibility: t17,
|
|
3495
|
+
pointerEvents: "none"
|
|
3496
|
+
}, $[46] = t17, $[47] = t18) : t18 = $[47];
|
|
3497
|
+
let t19;
|
|
3498
|
+
$[48] !== IconComponent || $[49] !== fontSize || $[50] !== muted || $[51] !== weight ? (t19 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[48] = IconComponent, $[49] = fontSize, $[50] = muted, $[51] = weight, $[52] = t19) : t19 = $[52];
|
|
3499
|
+
let t20;
|
|
3500
|
+
$[53] !== IconComponent || $[54] !== expanded || $[55] !== fontSize || $[56] !== muted || $[57] !== weight ? (t20 = !IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
|
|
3501
|
+
transform: expanded ? "rotate(90deg)" : void 0
|
|
3502
|
+
} }) }), $[53] = IconComponent, $[54] = expanded, $[55] = fontSize, $[56] = muted, $[57] = weight, $[58] = t20) : t20 = $[58];
|
|
3503
|
+
let t21;
|
|
3504
|
+
$[59] !== t18 || $[60] !== t19 || $[61] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Box, { style: t18, children: [
|
|
3505
|
+
t19,
|
|
3506
|
+
t20
|
|
3507
|
+
] }), $[59] = t18, $[60] = t19, $[61] = t20, $[62] = t21) : t21 = $[62];
|
|
3508
|
+
let t22;
|
|
3509
|
+
$[63] !== fontSize || $[64] !== muted || $[65] !== text2 || $[66] !== weight ? (t22 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text2 }) }), $[63] = fontSize, $[64] = muted, $[65] = text2, $[66] = weight, $[67] = t22) : t22 = $[67];
|
|
3510
|
+
let t23;
|
|
3511
|
+
$[68] !== padding || $[69] !== space || $[70] !== t21 || $[71] !== t22 ? (t23 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
|
|
3512
|
+
t21,
|
|
3513
|
+
t22
|
|
3514
|
+
] }), $[68] = padding, $[69] = space, $[70] = t21, $[71] = t22, $[72] = t23) : t23 = $[72];
|
|
3515
|
+
const content2 = t23;
|
|
3516
|
+
if (href) {
|
|
3517
|
+
const t242 = selected ? "" : void 0, t252 = rest;
|
|
3518
|
+
let t262;
|
|
3519
|
+
$[73] !== className ? (t262 = treeItem({
|
|
3520
|
+
className
|
|
3521
|
+
}), $[73] = className, $[74] = t262) : t262 = $[74];
|
|
3522
|
+
const t272 = `calc(${vars.space[2]} * ${tree.level})`;
|
|
3523
|
+
let t282;
|
|
3524
|
+
$[75] !== t272 ? (t282 = {
|
|
3525
|
+
paddingLeft: t272
|
|
3526
|
+
}, $[75] = t272, $[76] = t282) : t282 = $[76];
|
|
3527
|
+
let t292;
|
|
3528
|
+
$[77] !== content2 || $[78] !== expanded || $[79] !== href || $[80] !== linkAs || $[81] !== radius || $[82] !== selected || $[83] !== t282 || $[84] !== tabIndex ? (t292 = /* @__PURE__ */ jsx(Selectable, { "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", selected, tabIndex, style: t282, children: content2 }), $[77] = content2, $[78] = expanded, $[79] = href, $[80] = linkAs, $[81] = radius, $[82] = selected, $[83] = t282, $[84] = tabIndex, $[85] = t292) : t292 = $[85];
|
|
3529
|
+
let t302;
|
|
3530
|
+
$[86] !== children || $[87] !== expanded ? (t302 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[86] = children, $[87] = expanded, $[88] = t302) : t302 = $[88];
|
|
3531
|
+
let t312;
|
|
3532
|
+
$[89] !== contextValue || $[90] !== t302 ? (t312 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t302 }), $[89] = contextValue, $[90] = t302, $[91] = t312) : t312 = $[91];
|
|
3533
|
+
let t322;
|
|
3534
|
+
return $[92] !== handleClick || $[93] !== id || $[94] !== itemKey || $[95] !== t242 || $[96] !== t252 || $[97] !== t262 || $[98] !== t292 || $[99] !== t312 ? (t322 = /* @__PURE__ */ jsxs(Box, { "data-selected": t242, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...t252, as: "li", className: t262, onClick: handleClick, ref: setRootElement, role: "none", children: [
|
|
3535
|
+
t292,
|
|
3536
|
+
t312
|
|
3537
|
+
] }), $[92] = handleClick, $[93] = id, $[94] = itemKey, $[95] = t242, $[96] = t252, $[97] = t262, $[98] = t292, $[99] = t312, $[100] = t322) : t322 = $[100], t322;
|
|
3538
|
+
}
|
|
3539
|
+
const t24 = selected ? "" : void 0, t25 = rest;
|
|
3540
|
+
let t26;
|
|
3541
|
+
$[101] !== className ? (t26 = treeItem({
|
|
3117
3542
|
className
|
|
3118
|
-
}),
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
] });
|
|
3543
|
+
}), $[101] = className, $[102] = t26) : t26 = $[102];
|
|
3544
|
+
const t27 = focused ? "" : void 0, t28 = `calc(${vars.space[2]} * ${tree.level})`;
|
|
3545
|
+
let t29;
|
|
3546
|
+
$[103] !== t28 ? (t29 = {
|
|
3547
|
+
paddingLeft: t28
|
|
3548
|
+
}, $[103] = t28, $[104] = t29) : t29 = $[104];
|
|
3549
|
+
let t30;
|
|
3550
|
+
$[105] !== content2 || $[106] !== radius || $[107] !== selected || $[108] !== t27 || $[109] !== t29 ? (t30 = /* @__PURE__ */ jsx(Selectable, { as: "button", "data-focused": t27, "data-ui": "TreeItem__box", radius, selected, style: t29, children: content2 }), $[105] = content2, $[106] = radius, $[107] = selected, $[108] = t27, $[109] = t29, $[110] = t30) : t30 = $[110];
|
|
3551
|
+
let t31;
|
|
3552
|
+
$[111] !== children || $[112] !== expanded ? (t31 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[111] = children, $[112] = expanded, $[113] = t31) : t31 = $[113];
|
|
3553
|
+
let t32;
|
|
3554
|
+
$[114] !== contextValue || $[115] !== t31 ? (t32 = /* @__PURE__ */ jsx(TreeContext, { value: contextValue, children: t31 }), $[114] = contextValue, $[115] = t31, $[116] = t32) : t32 = $[116];
|
|
3555
|
+
let t33;
|
|
3556
|
+
return $[117] !== expanded || $[118] !== handleClick || $[119] !== handleKeyDown || $[120] !== id || $[121] !== itemKey || $[122] !== t24 || $[123] !== t25 || $[124] !== t26 || $[125] !== t30 || $[126] !== t32 || $[127] !== tabIndex ? (t33 = /* @__PURE__ */ jsxs(Box, { "data-selected": t24, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...t25, "aria-expanded": expanded, className: t26, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
|
|
3557
|
+
t30,
|
|
3558
|
+
t32
|
|
3559
|
+
] }), $[117] = expanded, $[118] = handleClick, $[119] = handleKeyDown, $[120] = id, $[121] = itemKey, $[122] = t24, $[123] = t25, $[124] = t26, $[125] = t30, $[126] = t32, $[127] = tabIndex, $[128] = t33) : t33 = $[128], t33;
|
|
3135
3560
|
}
|
|
3136
3561
|
function _isScrollable(el) {
|
|
3137
3562
|
if (!(el instanceof Element)) return !1;
|
|
@@ -3140,7 +3565,7 @@ function _isScrollable(el) {
|
|
|
3140
3565
|
}
|
|
3141
3566
|
const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
|
|
3142
3567
|
function VirtualList(props) {
|
|
3143
|
-
const $ = c(
|
|
3568
|
+
const $ = c(44), t0 = props;
|
|
3144
3569
|
let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
|
|
3145
3570
|
$[0] !== t0 ? ({
|
|
3146
3571
|
as: t1,
|
|
@@ -3204,60 +3629,87 @@ function VirtualList(props) {
|
|
|
3204
3629
|
}, 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);
|
|
3205
3630
|
let t10;
|
|
3206
3631
|
$[23] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => {
|
|
3207
|
-
setItemHeight(-1);
|
|
3632
|
+
startTransition(() => setItemHeight(-1));
|
|
3208
3633
|
}, $[23] = t10) : t10 = $[23];
|
|
3209
3634
|
let t11;
|
|
3210
3635
|
$[24] !== renderItem ? (t11 = [renderItem], $[24] = renderItem, $[25] = t11) : t11 = $[25], useEffect(t10, t11);
|
|
3211
3636
|
let t12;
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
let t18;
|
|
3228
|
-
$[33] !== t17 ? (t18 = /* @__PURE__ */ jsx("div", { ref: t162, style: {
|
|
3229
|
-
height: t17
|
|
3230
|
-
} }), $[33] = t17, $[34] = t18) : t18 = $[34];
|
|
3231
|
-
let t19;
|
|
3232
|
-
$[35] !== t152 || $[36] !== t18 ? (t19 = [/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3233
|
-
t152,
|
|
3234
|
-
t18
|
|
3235
|
-
] })], $[35] = t152, $[36] = t18, $[37] = t19) : t19 = $[37], t12 = t19;
|
|
3236
|
-
break bb0;
|
|
3237
|
-
}
|
|
3238
|
-
let t132;
|
|
3239
|
-
if ($[38] !== fromIndex || $[39] !== gapValue || $[40] !== getItemKey || $[41] !== itemHeight || $[42] !== items || $[43] !== renderItem || $[44] !== toIndex) {
|
|
3240
|
-
let t142;
|
|
3241
|
-
$[46] !== fromIndex || $[47] !== gapValue || $[48] !== getItemKey || $[49] !== itemHeight || $[50] !== renderItem ? (t142 = (item, _itemIndex) => {
|
|
3242
|
-
const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
3243
|
-
return /* @__PURE__ */ jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
|
|
3244
|
-
top: itemIndex * (itemHeight + gapValue)
|
|
3245
|
-
}, children: node }, key2);
|
|
3246
|
-
}, $[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;
|
|
3247
|
-
} else
|
|
3248
|
-
t132 = $[45];
|
|
3249
|
-
t12 = t132;
|
|
3250
|
-
}
|
|
3251
|
-
const children = t12;
|
|
3252
|
-
let t13, t14;
|
|
3253
|
-
$[52] !== height ? (t14 = {
|
|
3637
|
+
$[26] !== fromIndex || $[27] !== gap || $[28] !== gapValue || $[29] !== getItemKey || $[30] !== itemHeight || $[31] !== items || $[32] !== renderItem || $[33] !== toIndex ? (t12 = {
|
|
3638
|
+
fromIndex,
|
|
3639
|
+
gap,
|
|
3640
|
+
getItemKey,
|
|
3641
|
+
itemHeight,
|
|
3642
|
+
items,
|
|
3643
|
+
renderItem,
|
|
3644
|
+
toIndex,
|
|
3645
|
+
gapValue,
|
|
3646
|
+
setGapValue,
|
|
3647
|
+
setItemHeight
|
|
3648
|
+
}, $[26] = fromIndex, $[27] = gap, $[28] = gapValue, $[29] = getItemKey, $[30] = itemHeight, $[31] = items, $[32] = renderItem, $[33] = toIndex, $[34] = t12) : t12 = $[34];
|
|
3649
|
+
const children = useChildren(t12);
|
|
3650
|
+
let t13;
|
|
3651
|
+
$[35] !== height ? (t13 = {
|
|
3254
3652
|
height
|
|
3255
|
-
}, $[
|
|
3653
|
+
}, $[35] = height, $[36] = t13) : t13 = $[36];
|
|
3256
3654
|
const wrapperStyle = t13;
|
|
3655
|
+
let t14;
|
|
3656
|
+
$[37] !== children || $[38] !== wrapperStyle ? (t14 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[37] = children, $[38] = wrapperStyle, $[39] = t14) : t14 = $[39];
|
|
3257
3657
|
let t15;
|
|
3258
|
-
$[
|
|
3259
|
-
|
|
3260
|
-
|
|
3658
|
+
return $[40] !== as || $[41] !== rest || $[42] !== t14 ? (t15 = /* @__PURE__ */ jsx(Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t14 }), $[40] = as, $[41] = rest, $[42] = t14, $[43] = t15) : t15 = $[43], t15;
|
|
3659
|
+
}
|
|
3660
|
+
function useChildren(t0) {
|
|
3661
|
+
const $ = c(32), {
|
|
3662
|
+
fromIndex,
|
|
3663
|
+
gap,
|
|
3664
|
+
getItemKey,
|
|
3665
|
+
itemHeight,
|
|
3666
|
+
items,
|
|
3667
|
+
renderItem,
|
|
3668
|
+
toIndex,
|
|
3669
|
+
gapValue,
|
|
3670
|
+
setGapValue,
|
|
3671
|
+
setItemHeight
|
|
3672
|
+
} = t0;
|
|
3673
|
+
if (!renderItem || items.length === 0)
|
|
3674
|
+
return null;
|
|
3675
|
+
if (itemHeight === -1) {
|
|
3676
|
+
let t12;
|
|
3677
|
+
$[0] !== setItemHeight ? (t12 = (el) => {
|
|
3678
|
+
el && setItemHeight(el.offsetHeight);
|
|
3679
|
+
}, $[0] = setItemHeight, $[1] = t12) : t12 = $[1];
|
|
3680
|
+
let t2;
|
|
3681
|
+
$[2] !== items[0] || $[3] !== renderItem ? (t2 = renderItem(items[0]), $[2] = items[0], $[3] = renderItem, $[4] = t2) : t2 = $[4];
|
|
3682
|
+
let t3;
|
|
3683
|
+
$[5] !== t12 || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { ref: t12, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t2 }, 0), $[5] = t12, $[6] = t2, $[7] = t3) : t3 = $[7];
|
|
3684
|
+
let t4;
|
|
3685
|
+
$[8] !== setGapValue ? (t4 = (el_0) => {
|
|
3686
|
+
el_0 && setGapValue(el_0.offsetHeight);
|
|
3687
|
+
}, $[8] = setGapValue, $[9] = t4) : t4 = $[9];
|
|
3688
|
+
const t5 = vars.space[gap];
|
|
3689
|
+
let t6;
|
|
3690
|
+
$[10] !== t5 ? (t6 = {
|
|
3691
|
+
height: t5
|
|
3692
|
+
}, $[10] = t5, $[11] = t6) : t6 = $[11];
|
|
3693
|
+
let t7;
|
|
3694
|
+
$[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsx("div", { ref: t4, style: t6 }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
|
|
3695
|
+
let t8;
|
|
3696
|
+
return $[15] !== t3 || $[16] !== t7 ? (t8 = [/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3697
|
+
t3,
|
|
3698
|
+
t7
|
|
3699
|
+
] })], $[15] = t3, $[16] = t7, $[17] = t8) : t8 = $[17], t8;
|
|
3700
|
+
}
|
|
3701
|
+
let t1;
|
|
3702
|
+
if ($[18] !== fromIndex || $[19] !== gapValue || $[20] !== getItemKey || $[21] !== itemHeight || $[22] !== items || $[23] !== renderItem || $[24] !== toIndex) {
|
|
3703
|
+
let t2;
|
|
3704
|
+
$[26] !== fromIndex || $[27] !== gapValue || $[28] !== getItemKey || $[29] !== itemHeight || $[30] !== renderItem ? (t2 = (item, _itemIndex) => {
|
|
3705
|
+
const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
3706
|
+
return /* @__PURE__ */ jsx(Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
|
|
3707
|
+
top: itemIndex * (itemHeight + gapValue)
|
|
3708
|
+
}, children: node }, key2);
|
|
3709
|
+
}, $[26] = fromIndex, $[27] = gapValue, $[28] = getItemKey, $[29] = itemHeight, $[30] = renderItem, $[31] = t2) : t2 = $[31], t1 = items.slice(fromIndex, toIndex).map(t2), $[18] = fromIndex, $[19] = gapValue, $[20] = getItemKey, $[21] = itemHeight, $[22] = items, $[23] = renderItem, $[24] = toIndex, $[25] = t1;
|
|
3710
|
+
} else
|
|
3711
|
+
t1 = $[25];
|
|
3712
|
+
return t1;
|
|
3261
3713
|
}
|
|
3262
3714
|
function findScrollable(parentNode) {
|
|
3263
3715
|
let _scrollEl = parentNode;
|
|
@@ -3320,43 +3772,59 @@ function _temp$3() {
|
|
|
3320
3772
|
}
|
|
3321
3773
|
const DEFAULT_LABEL_ELEMENT = "div";
|
|
3322
3774
|
function Label(props) {
|
|
3323
|
-
const $ = c(
|
|
3324
|
-
let align, children, className, rest, t0, t1, t2, t3, textOverflowProp;
|
|
3775
|
+
const $ = c(42);
|
|
3776
|
+
let align, children, className, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, rest, t0, t1, t2, t3, textOverflowProp;
|
|
3325
3777
|
$[0] !== props ? ({
|
|
3326
3778
|
align,
|
|
3327
3779
|
as: t0,
|
|
3328
3780
|
children,
|
|
3329
3781
|
className,
|
|
3782
|
+
margin,
|
|
3783
|
+
marginX,
|
|
3784
|
+
marginY,
|
|
3785
|
+
marginTop,
|
|
3786
|
+
marginRight,
|
|
3787
|
+
marginBottom,
|
|
3788
|
+
marginLeft,
|
|
3789
|
+
maxWidth,
|
|
3330
3790
|
muted: t1,
|
|
3331
3791
|
size: t2,
|
|
3332
3792
|
textOverflow: textOverflowProp,
|
|
3333
3793
|
weight: t3,
|
|
3334
3794
|
...rest
|
|
3335
|
-
} = props, $[0] = props, $[1] = align, $[2] = children, $[3] = className, $[4] =
|
|
3795
|
+
} = props, $[0] = props, $[1] = align, $[2] = children, $[3] = className, $[4] = margin, $[5] = marginBottom, $[6] = marginLeft, $[7] = marginRight, $[8] = marginTop, $[9] = marginX, $[10] = marginY, $[11] = maxWidth, $[12] = rest, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], margin = $[4], marginBottom = $[5], marginLeft = $[6], marginRight = $[7], marginTop = $[8], marginX = $[9], marginY = $[10], maxWidth = $[11], rest = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16], textOverflowProp = $[17]);
|
|
3336
3796
|
const Element2 = t0 === void 0 ? DEFAULT_LABEL_ELEMENT : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 1 : t2, weight = t3 === void 0 ? "regular" : t3;
|
|
3337
3797
|
let t4;
|
|
3338
|
-
$[
|
|
3798
|
+
$[18] !== align || $[19] !== className || $[20] !== margin || $[21] !== marginBottom || $[22] !== marginLeft || $[23] !== marginRight || $[24] !== marginTop || $[25] !== marginX || $[26] !== marginY || $[27] !== maxWidth || $[28] !== muted || $[29] !== size2 || $[30] !== weight ? (t4 = label({
|
|
3339
3799
|
className,
|
|
3340
3800
|
align,
|
|
3801
|
+
margin,
|
|
3802
|
+
marginX,
|
|
3803
|
+
marginY,
|
|
3804
|
+
marginTop,
|
|
3805
|
+
marginRight,
|
|
3806
|
+
marginBottom,
|
|
3807
|
+
marginLeft,
|
|
3808
|
+
maxWidth,
|
|
3341
3809
|
muted,
|
|
3342
3810
|
size: size2,
|
|
3343
3811
|
weight
|
|
3344
|
-
}), $[
|
|
3812
|
+
}), $[18] = align, $[19] = className, $[20] = margin, $[21] = marginBottom, $[22] = marginLeft, $[23] = marginRight, $[24] = marginTop, $[25] = marginX, $[26] = marginY, $[27] = maxWidth, $[28] = muted, $[29] = size2, $[30] = weight, $[31] = t4) : t4 = $[31];
|
|
3345
3813
|
let t5;
|
|
3346
|
-
$[
|
|
3814
|
+
$[32] !== textOverflowProp ? (t5 = textOverflow({
|
|
3347
3815
|
textOverflow: textOverflowProp
|
|
3348
|
-
}), $[
|
|
3816
|
+
}), $[32] = textOverflowProp, $[33] = t5) : t5 = $[33];
|
|
3349
3817
|
let t6;
|
|
3350
|
-
$[
|
|
3818
|
+
$[34] !== children || $[35] !== t5 ? (t6 = /* @__PURE__ */ jsx("span", { className: t5, children }), $[34] = children, $[35] = t5, $[36] = t6) : t6 = $[36];
|
|
3351
3819
|
let t7;
|
|
3352
|
-
return $[
|
|
3820
|
+
return $[37] !== Element2 || $[38] !== rest || $[39] !== t4 || $[40] !== t6 ? (t7 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Label", ...rest, className: t4, children: t6 }), $[37] = Element2, $[38] = rest, $[39] = t4, $[40] = t6, $[41] = t7) : t7 = $[41], t7;
|
|
3353
3821
|
}
|
|
3354
3822
|
const DEFAULT_AVATAR_ELEMENT = "span";
|
|
3355
3823
|
function Avatar(props) {
|
|
3356
|
-
const $ = c(
|
|
3357
|
-
let
|
|
3824
|
+
const $ = c(52), t0 = props;
|
|
3825
|
+
let animateArrowFrom, arrowPositionProp, className, hideInnerStroke, initials, onImageLoadError, rest, src, t1, t2, t3, title;
|
|
3358
3826
|
$[0] !== t0 ? ({
|
|
3359
|
-
__unstable_hideInnerStroke,
|
|
3827
|
+
__unstable_hideInnerStroke: hideInnerStroke,
|
|
3360
3828
|
as: t1,
|
|
3361
3829
|
className,
|
|
3362
3830
|
color: t2,
|
|
@@ -3368,53 +3836,56 @@ function Avatar(props) {
|
|
|
3368
3836
|
animateArrowFrom,
|
|
3369
3837
|
size: t3,
|
|
3370
3838
|
...rest
|
|
3371
|
-
} = t0, $[0] = t0, $[1] =
|
|
3372
|
-
const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t3 === void 0 ? 1 : t3
|
|
3373
|
-
let t4
|
|
3374
|
-
$[13] !==
|
|
3839
|
+
} = t0, $[0] = t0, $[1] = animateArrowFrom, $[2] = arrowPositionProp, $[3] = className, $[4] = hideInnerStroke, $[5] = initials, $[6] = onImageLoadError, $[7] = rest, $[8] = src, $[9] = t1, $[10] = t2, $[11] = t3, $[12] = title) : (animateArrowFrom = $[1], arrowPositionProp = $[2], className = $[3], hideInnerStroke = $[4], initials = $[5], onImageLoadError = $[6], rest = $[7], src = $[8], t1 = $[9], t2 = $[10], t3 = $[11], title = $[12]);
|
|
3840
|
+
const Element2 = t1 === void 0 ? DEFAULT_AVATAR_ELEMENT : t1, color = t2 === void 0 ? "magenta" : t2, sizeProp = t3 === void 0 ? 1 : t3;
|
|
3841
|
+
let t4;
|
|
3842
|
+
$[13] !== sizeProp ? (t4 = _getResponsiveProp(sizeProp), $[13] = sizeProp, $[14] = t4) : t4 = $[14];
|
|
3843
|
+
const size2 = t4, [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageError, setImageError] = useState(!1);
|
|
3844
|
+
let t5, t6;
|
|
3845
|
+
$[15] !== arrowPosition || $[16] !== arrowPositionProp ? (t5 = () => {
|
|
3375
3846
|
if (arrowPosition === arrowPositionProp)
|
|
3376
3847
|
return;
|
|
3377
3848
|
const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
|
|
3378
3849
|
return () => cancelAnimationFrame(raf);
|
|
3379
|
-
},
|
|
3380
|
-
let
|
|
3381
|
-
$[
|
|
3850
|
+
}, t6 = [arrowPosition, arrowPositionProp], $[15] = arrowPosition, $[16] = arrowPositionProp, $[17] = t5, $[18] = t6) : (t5 = $[17], t6 = $[18]), useEffect(t5, t6);
|
|
3851
|
+
let t7, t8;
|
|
3852
|
+
$[19] !== src ? (t7 = () => {
|
|
3382
3853
|
src && setImageError(!1);
|
|
3383
|
-
},
|
|
3384
|
-
let
|
|
3385
|
-
$[
|
|
3854
|
+
}, t8 = [src], $[19] = src, $[20] = t7, $[21] = t8) : (t7 = $[20], t8 = $[21]), useEffect(t7, t8);
|
|
3855
|
+
let t9;
|
|
3856
|
+
$[22] !== onImageLoadError ? (t9 = () => {
|
|
3386
3857
|
setImageError(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
|
|
3387
|
-
}, $[
|
|
3388
|
-
const handleImageError =
|
|
3389
|
-
let
|
|
3390
|
-
$[
|
|
3391
|
-
const initialsSize =
|
|
3858
|
+
}, $[22] = onImageLoadError, $[23] = t9) : t9 = $[23];
|
|
3859
|
+
const handleImageError = t9;
|
|
3860
|
+
let t10;
|
|
3861
|
+
$[24] !== size2 ? (t10 = Object.values(size2).map(_temp$2), $[24] = size2, $[25] = t10) : t10 = $[25];
|
|
3862
|
+
const initialsSize = t10, t11 = hideInnerStroke ? "" : void 0;
|
|
3392
3863
|
let t12;
|
|
3393
|
-
$[
|
|
3864
|
+
$[26] !== className || $[27] !== color || $[28] !== sizeProp ? (t12 = avatar({
|
|
3394
3865
|
className,
|
|
3395
3866
|
color,
|
|
3396
3867
|
size: sizeProp
|
|
3397
|
-
}), $[
|
|
3868
|
+
}), $[26] = className, $[27] = color, $[28] = sizeProp, $[29] = t12) : t12 = $[29];
|
|
3398
3869
|
const t13 = imageError ? "" : void 0;
|
|
3399
3870
|
let t14;
|
|
3400
|
-
$[
|
|
3871
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t14 = avatarArrow(), $[30] = t14) : t14 = $[30];
|
|
3401
3872
|
let t15;
|
|
3402
|
-
$[
|
|
3873
|
+
$[31] !== color ? (t15 = /* @__PURE__ */ jsx("span", { className: t14, 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 }) }) }), $[31] = color, $[32] = t15) : t15 = $[32];
|
|
3403
3874
|
let t16;
|
|
3404
|
-
$[
|
|
3875
|
+
$[33] === Symbol.for("react.memo_cache_sentinel") ? (t16 = avatarInitials(), $[33] = t16) : t16 = $[33];
|
|
3405
3876
|
let t17;
|
|
3406
|
-
$[
|
|
3877
|
+
$[34] !== initials || $[35] !== initialsSize ? (t17 = /* @__PURE__ */ jsx(Box, { alignItems: "center", as: "span", className: t16, display: "flex", justifyContent: "center", position: "absolute", inset: 0, children: /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: initialsSize, weight: "medium", children: initials }) }), $[34] = initials, $[35] = initialsSize, $[36] = t17) : t17 = $[36];
|
|
3407
3878
|
let t18;
|
|
3408
|
-
$[
|
|
3879
|
+
$[37] !== handleImageError || $[38] !== initials || $[39] !== src ? (t18 = src && /* @__PURE__ */ jsxs(Box, { className: avatarImage(), inset: 0, position: "absolute", children: [
|
|
3409
3880
|
/* @__PURE__ */ jsx("img", { alt: initials, onError: handleImageError, src }),
|
|
3410
3881
|
/* @__PURE__ */ jsx("span", { className: avatarImageOutline() })
|
|
3411
|
-
] }), $[
|
|
3882
|
+
] }), $[37] = handleImageError, $[38] = initials, $[39] = src, $[40] = t18) : t18 = $[40];
|
|
3412
3883
|
let t19;
|
|
3413
|
-
return $[
|
|
3884
|
+
return $[41] !== Element2 || $[42] !== arrowPosition || $[43] !== rest || $[44] !== t11 || $[45] !== t12 || $[46] !== t13 || $[47] !== t15 || $[48] !== t17 || $[49] !== t18 || $[50] !== title ? (t19 = /* @__PURE__ */ jsxs(Element2, { "data-hide-inner-stroke": t11, "data-ui": "Avatar", ...rest, "aria-label": title, className: t12, "data-arrow-position": arrowPosition, "data-image-error": t13, title, children: [
|
|
3414
3885
|
t15,
|
|
3415
3886
|
t17,
|
|
3416
3887
|
t18
|
|
3417
|
-
] }), $[
|
|
3888
|
+
] }), $[41] = Element2, $[42] = arrowPosition, $[43] = rest, $[44] = t11, $[45] = t12, $[46] = t13, $[47] = t15, $[48] = t17, $[49] = t18, $[50] = title, $[51] = t19) : t19 = $[51], t19;
|
|
3418
3889
|
}
|
|
3419
3890
|
function _temp$2(s) {
|
|
3420
3891
|
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
@@ -3431,25 +3902,25 @@ function AvatarCounter(props) {
|
|
|
3431
3902
|
...rest
|
|
3432
3903
|
} = t0, $[0] = t0, $[1] = className, $[2] = count, $[3] = rest, $[4] = t1, $[5] = t2) : (className = $[1], count = $[2], rest = $[3], t1 = $[4], t2 = $[5]);
|
|
3433
3904
|
const as = t1 === void 0 ? DEFAULT_AVATAR_COUNTER_ELEMENT : t1, size2 = useResponsiveProp(t2 === void 0 ? 1 : t2);
|
|
3434
|
-
let t3
|
|
3435
|
-
$[6] !== size2 ? (
|
|
3905
|
+
let t3;
|
|
3906
|
+
$[6] !== size2 ? (t3 = Object.values(size2).map(_temp$1), $[6] = size2, $[7] = t3) : t3 = $[7];
|
|
3436
3907
|
const labelSize = t3;
|
|
3437
|
-
let
|
|
3438
|
-
$[8] !== className || $[9] !== size2 ? (
|
|
3908
|
+
let t4;
|
|
3909
|
+
$[8] !== className || $[9] !== size2 ? (t4 = avatarCounter({
|
|
3439
3910
|
className,
|
|
3440
3911
|
size: size2
|
|
3441
|
-
}), $[8] = className, $[9] = size2, $[10] =
|
|
3912
|
+
}), $[8] = className, $[9] = size2, $[10] = t4) : t4 = $[10];
|
|
3913
|
+
let t5;
|
|
3914
|
+
$[11] !== count || $[12] !== labelSize ? (t5 = /* @__PURE__ */ jsx(Label, { align: "center", as: "span", size: labelSize, weight: "medium", children: count }), $[11] = count, $[12] = labelSize, $[13] = t5) : t5 = $[13];
|
|
3442
3915
|
let t6;
|
|
3443
|
-
$[
|
|
3444
|
-
let t7;
|
|
3445
|
-
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;
|
|
3916
|
+
return $[14] !== as || $[15] !== rest || $[16] !== t4 || $[17] !== t5 ? (t6 = /* @__PURE__ */ jsx(Box, { "data-ui": "AvatarCounter", ...rest, alignItems: "center", as, className: t4, display: "flex", flex: "none", justifyContent: "center", paddingX: 2, sizing: "border", children: t5 }), $[14] = as, $[15] = rest, $[16] = t4, $[17] = t5, $[18] = t6) : t6 = $[18], t6;
|
|
3446
3917
|
}
|
|
3447
3918
|
function _temp$1(s) {
|
|
3448
3919
|
return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
|
|
3449
3920
|
}
|
|
3450
3921
|
const DEFAULT_AVATAR_STACK_ELEMENT = "span";
|
|
3451
3922
|
function AvatarStack(props) {
|
|
3452
|
-
const $ = c(
|
|
3923
|
+
const $ = c(27), t0 = props;
|
|
3453
3924
|
let childrenProp, className, rest, t1, t2, t3;
|
|
3454
3925
|
$[0] !== t0 ? ({
|
|
3455
3926
|
as: t1,
|
|
@@ -3465,18 +3936,22 @@ function AvatarStack(props) {
|
|
|
3465
3936
|
className,
|
|
3466
3937
|
size: size2
|
|
3467
3938
|
}), $[7] = className, $[8] = size2, $[9] = t6) : t6 = $[9];
|
|
3468
|
-
const t7 = "flex", t8 = "flex-start"
|
|
3939
|
+
const t7 = "flex", t8 = "flex-start";
|
|
3940
|
+
let t9;
|
|
3941
|
+
$[10] !== len || $[11] !== size2 ? (t9 = len === 0 && /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }), $[10] = len, $[11] = size2, $[12] = t9) : t9 = $[12];
|
|
3942
|
+
let t10;
|
|
3943
|
+
$[13] !== extraCount || $[14] !== len || $[15] !== size2 ? (t10 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }), $[13] = extraCount, $[14] = len, $[15] = size2, $[16] = t10) : t10 = $[16];
|
|
3469
3944
|
let t11;
|
|
3470
|
-
$[
|
|
3945
|
+
$[17] !== size2 ? (t11 = (child, childIndex) => /* @__PURE__ */ jsx(Fragment$1, { children: cloneElement(child, {
|
|
3471
3946
|
size: size2
|
|
3472
|
-
}) }, String(childIndex)), $[
|
|
3947
|
+
}) }, String(childIndex)), $[17] = size2, $[18] = t11) : t11 = $[18];
|
|
3473
3948
|
const t12 = visibleChildren.map(t11);
|
|
3474
3949
|
let t13;
|
|
3475
|
-
return $[
|
|
3950
|
+
return $[19] !== T0 || $[20] !== as || $[21] !== rest || $[22] !== t10 || $[23] !== t12 || $[24] !== t6 || $[25] !== t9 ? (t13 = /* @__PURE__ */ jsxs(T0, { "data-ui": t4, ...rest, alignItems: t5, as, className: t6, display: t7, justifyContent: t8, children: [
|
|
3476
3951
|
t9,
|
|
3477
3952
|
t10,
|
|
3478
3953
|
t12
|
|
3479
|
-
] }), $[
|
|
3954
|
+
] }), $[19] = T0, $[20] = as, $[21] = rest, $[22] = t10, $[23] = t12, $[24] = t6, $[25] = t9, $[26] = t13) : t13 = $[26], t13;
|
|
3480
3955
|
}
|
|
3481
3956
|
const DEFAULT_BADGE_ELEMENT = "span";
|
|
3482
3957
|
function Badge(props) {
|
|
@@ -3546,69 +4021,101 @@ function Checkbox(props) {
|
|
|
3546
4021
|
t11
|
|
3547
4022
|
] }), $[25] = style, $[26] = t10, $[27] = t5, $[28] = t12) : t12 = $[28], t12;
|
|
3548
4023
|
}
|
|
3549
|
-
const LazyRefractor = lazy(() => import("./_chunks-es/
|
|
4024
|
+
const LazyRefractor = lazy(() => import("./_chunks-es/Refractor.js")), DEFAULT_CODE_ELEMENT = "pre";
|
|
3550
4025
|
function Code(props) {
|
|
3551
|
-
const $ = c(
|
|
3552
|
-
let children, className, languageProp, rest, t1, t2, t3;
|
|
4026
|
+
const $ = c(41), t0 = props;
|
|
4027
|
+
let children, className, languageProp, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, rest, t1, t2, t3;
|
|
3553
4028
|
$[0] !== t0 ? ({
|
|
3554
4029
|
as: t1,
|
|
3555
4030
|
children,
|
|
3556
4031
|
className,
|
|
3557
4032
|
language: languageProp,
|
|
4033
|
+
margin,
|
|
4034
|
+
marginX,
|
|
4035
|
+
marginY,
|
|
4036
|
+
marginTop,
|
|
4037
|
+
marginRight,
|
|
4038
|
+
marginBottom,
|
|
4039
|
+
marginLeft,
|
|
4040
|
+
maxWidth,
|
|
3558
4041
|
size: t2,
|
|
3559
4042
|
weight: t3,
|
|
3560
4043
|
...rest
|
|
3561
|
-
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = languageProp, $[4] =
|
|
4044
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = languageProp, $[4] = margin, $[5] = marginBottom, $[6] = marginLeft, $[7] = marginRight, $[8] = marginTop, $[9] = marginX, $[10] = marginY, $[11] = maxWidth, $[12] = rest, $[13] = t1, $[14] = t2, $[15] = t3) : (children = $[1], className = $[2], languageProp = $[3], margin = $[4], marginBottom = $[5], marginLeft = $[6], marginRight = $[7], marginTop = $[8], marginX = $[9], marginY = $[10], maxWidth = $[11], rest = $[12], t1 = $[13], t2 = $[14], t3 = $[15]);
|
|
3562
4045
|
const Element2 = t1 === void 0 ? DEFAULT_CODE_ELEMENT : t1, size2 = t2 === void 0 ? 2 : t2, weight = t3 === void 0 ? "regular" : t3, language = typeof languageProp == "string" ? languageProp : void 0;
|
|
3563
4046
|
let t4;
|
|
3564
|
-
$[
|
|
4047
|
+
$[16] !== className || $[17] !== margin || $[18] !== marginBottom || $[19] !== marginLeft || $[20] !== marginRight || $[21] !== marginTop || $[22] !== marginX || $[23] !== marginY || $[24] !== maxWidth || $[25] !== size2 || $[26] !== weight ? (t4 = code({
|
|
3565
4048
|
className,
|
|
4049
|
+
margin,
|
|
4050
|
+
marginX,
|
|
4051
|
+
marginY,
|
|
4052
|
+
marginTop,
|
|
4053
|
+
marginRight,
|
|
4054
|
+
marginBottom,
|
|
4055
|
+
marginLeft,
|
|
4056
|
+
maxWidth,
|
|
3566
4057
|
size: size2,
|
|
3567
4058
|
weight
|
|
3568
|
-
}), $[
|
|
4059
|
+
}), $[16] = className, $[17] = margin, $[18] = marginBottom, $[19] = marginLeft, $[20] = marginRight, $[21] = marginTop, $[22] = marginX, $[23] = marginY, $[24] = maxWidth, $[25] = size2, $[26] = weight, $[27] = t4) : t4 = $[27];
|
|
3569
4060
|
let t5;
|
|
3570
|
-
$[
|
|
4061
|
+
$[28] !== children ? (t5 = /* @__PURE__ */ jsx("code", { children }), $[28] = children, $[29] = t5) : t5 = $[29];
|
|
3571
4062
|
let t6;
|
|
3572
|
-
$[
|
|
4063
|
+
$[30] !== children || $[31] !== language ? (t6 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[30] = children, $[31] = language, $[32] = t6) : t6 = $[32];
|
|
3573
4064
|
let t7;
|
|
3574
|
-
$[
|
|
4065
|
+
$[33] !== t5 || $[34] !== t6 ? (t7 = /* @__PURE__ */ jsx(Suspense, { fallback: t5, children: t6 }), $[33] = t5, $[34] = t6, $[35] = t7) : t7 = $[35];
|
|
3575
4066
|
let t8;
|
|
3576
|
-
return $[
|
|
4067
|
+
return $[36] !== Element2 || $[37] !== rest || $[38] !== t4 || $[39] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Code", ...rest, className: t4, children: t7 }), $[36] = Element2, $[37] = rest, $[38] = t4, $[39] = t7, $[40] = t8) : t8 = $[40], t8;
|
|
3577
4068
|
}
|
|
3578
4069
|
const DEFAULT_HEADING_ELEMENT = "div";
|
|
3579
4070
|
function Heading(props) {
|
|
3580
|
-
const $ = c(
|
|
3581
|
-
let align, children, className, flex, rest, t1, t2, t3, t4, textOverflowProp;
|
|
4071
|
+
const $ = c(44), t0 = props;
|
|
4072
|
+
let align, children, className, flex, margin, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, maxWidth, rest, t1, t2, t3, t4, textOverflowProp;
|
|
3582
4073
|
$[0] !== t0 ? ({
|
|
3583
4074
|
align,
|
|
3584
4075
|
as: t1,
|
|
3585
4076
|
children,
|
|
3586
4077
|
className,
|
|
3587
4078
|
flex,
|
|
4079
|
+
margin,
|
|
4080
|
+
marginX,
|
|
4081
|
+
marginY,
|
|
4082
|
+
marginTop,
|
|
4083
|
+
marginRight,
|
|
4084
|
+
marginBottom,
|
|
4085
|
+
marginLeft,
|
|
4086
|
+
maxWidth,
|
|
3588
4087
|
muted: t2,
|
|
3589
4088
|
size: t3,
|
|
3590
4089
|
textOverflow: textOverflowProp,
|
|
3591
4090
|
weight: t4,
|
|
3592
4091
|
...rest
|
|
3593
|
-
} = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] =
|
|
4092
|
+
} = t0, $[0] = t0, $[1] = align, $[2] = children, $[3] = className, $[4] = flex, $[5] = margin, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = maxWidth, $[13] = rest, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4, $[18] = textOverflowProp) : (align = $[1], children = $[2], className = $[3], flex = $[4], margin = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], maxWidth = $[12], rest = $[13], t1 = $[14], t2 = $[15], t3 = $[16], t4 = $[17], textOverflowProp = $[18]);
|
|
3594
4093
|
const Element2 = t1 === void 0 ? DEFAULT_HEADING_ELEMENT : t1, muted = t2 === void 0 ? !1 : t2, size2 = t3 === void 0 ? 2 : t3, weight = t4 === void 0 ? "regular" : t4;
|
|
3595
4094
|
let t5;
|
|
3596
|
-
$[
|
|
4095
|
+
$[19] !== align || $[20] !== className || $[21] !== flex || $[22] !== margin || $[23] !== marginBottom || $[24] !== marginLeft || $[25] !== marginRight || $[26] !== marginTop || $[27] !== marginX || $[28] !== marginY || $[29] !== maxWidth || $[30] !== muted || $[31] !== size2 || $[32] !== weight ? (t5 = heading({
|
|
3597
4096
|
className,
|
|
3598
4097
|
align,
|
|
3599
4098
|
flex,
|
|
4099
|
+
margin,
|
|
4100
|
+
marginX,
|
|
4101
|
+
marginY,
|
|
4102
|
+
marginTop,
|
|
4103
|
+
marginRight,
|
|
4104
|
+
marginBottom,
|
|
4105
|
+
marginLeft,
|
|
4106
|
+
maxWidth,
|
|
3600
4107
|
muted,
|
|
3601
4108
|
size: size2,
|
|
3602
4109
|
weight
|
|
3603
|
-
}), $[
|
|
4110
|
+
}), $[19] = align, $[20] = className, $[21] = flex, $[22] = margin, $[23] = marginBottom, $[24] = marginLeft, $[25] = marginRight, $[26] = marginTop, $[27] = marginX, $[28] = marginY, $[29] = maxWidth, $[30] = muted, $[31] = size2, $[32] = weight, $[33] = t5) : t5 = $[33];
|
|
3604
4111
|
let t6;
|
|
3605
|
-
$[
|
|
4112
|
+
$[34] !== textOverflowProp ? (t6 = textOverflow({
|
|
3606
4113
|
textOverflow: textOverflowProp
|
|
3607
|
-
}), $[
|
|
4114
|
+
}), $[34] = textOverflowProp, $[35] = t6) : t6 = $[35];
|
|
3608
4115
|
let t7;
|
|
3609
|
-
$[
|
|
4116
|
+
$[36] !== children || $[37] !== t6 ? (t7 = /* @__PURE__ */ jsx("span", { className: t6, children }), $[36] = children, $[37] = t6, $[38] = t7) : t7 = $[38];
|
|
3610
4117
|
let t8;
|
|
3611
|
-
return $[
|
|
4118
|
+
return $[39] !== Element2 || $[40] !== rest || $[41] !== t5 || $[42] !== t7 ? (t8 = /* @__PURE__ */ jsx(Element2, { "data-ui": "Heading", ...rest, className: t5, children: t7 }), $[39] = Element2, $[40] = rest, $[41] = t5, $[42] = t7, $[43] = t8) : t8 = $[43], t8;
|
|
3612
4119
|
}
|
|
3613
4120
|
const DEFAULT_INLINE_ELEMENT = "div";
|
|
3614
4121
|
function Inline(props) {
|
|
@@ -3653,90 +4160,89 @@ function Radio(props) {
|
|
|
3653
4160
|
let t9;
|
|
3654
4161
|
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx("span", { className: radioPresentation() }), $[20] = t9) : t9 = $[20];
|
|
3655
4162
|
let t10;
|
|
3656
|
-
return $[21] !== style || $[22] !== t3 || $[23] !== t8 ? (t10 = /* @__PURE__ */ jsxs("
|
|
4163
|
+
return $[21] !== style || $[22] !== t3 || $[23] !== t8 ? (t10 = /* @__PURE__ */ jsxs("span", { className: t3, "data-ui": "Radio", style, children: [
|
|
3657
4164
|
t8,
|
|
3658
4165
|
t9
|
|
3659
4166
|
] }), $[21] = style, $[22] = t3, $[23] = t8, $[24] = t10) : t10 = $[24], t10;
|
|
3660
4167
|
}
|
|
3661
4168
|
const DEFAULT_SELECT_ELEMENT = "select";
|
|
3662
4169
|
function Select(props) {
|
|
3663
|
-
const $ = c(
|
|
3664
|
-
let children, customValidity, disabled, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6;
|
|
4170
|
+
const $ = c(41), t0 = props;
|
|
4171
|
+
let children, customValidity, disabled, flex, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
|
|
3665
4172
|
$[0] !== t0 ? ({
|
|
3666
4173
|
as: t1,
|
|
3667
4174
|
border: t2,
|
|
3668
4175
|
children,
|
|
3669
4176
|
customValidity,
|
|
3670
4177
|
disabled,
|
|
4178
|
+
flex,
|
|
3671
4179
|
fontSize: t3,
|
|
3672
4180
|
gap: t4,
|
|
3673
4181
|
padding: t5,
|
|
3674
4182
|
radius: t6,
|
|
3675
4183
|
readOnly,
|
|
3676
4184
|
ref: forwardedRef,
|
|
4185
|
+
width: t7,
|
|
3677
4186
|
...rest
|
|
3678
|
-
} = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] =
|
|
3679
|
-
const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, gap = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 1 : t6, ref = useRef(null);
|
|
3680
|
-
let t7;
|
|
3681
|
-
$[13] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[13] = t7) : t7 = $[13], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
|
|
4187
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = flex, $[5] = forwardedRef, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6, $[14] = t7) : (children = $[1], customValidity = $[2], disabled = $[3], flex = $[4], forwardedRef = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13], t7 = $[14]);
|
|
4188
|
+
const Element2 = t1 === void 0 ? DEFAULT_SELECT_ELEMENT : t1, border = t2 === void 0 ? !0 : t2, fontSize = t3 === void 0 ? 2 : t3, gap = t4 === void 0 ? 2 : t4, padding = t5 === void 0 ? 3 : t5, radius = t6 === void 0 ? 1 : t6, width = t7 === void 0 ? "fill" : t7, ref = useRef(null);
|
|
3682
4189
|
let t8;
|
|
3683
|
-
$[
|
|
4190
|
+
$[15] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[15] = t8) : t8 = $[15], useImperativeHandle(forwardedRef, t8), useCustomValidity(ref, customValidity);
|
|
4191
|
+
let t9;
|
|
4192
|
+
$[16] !== border || $[17] !== flex || $[18] !== fontSize || $[19] !== gap || $[20] !== padding || $[21] !== radius || $[22] !== width ? (t9 = select({
|
|
3684
4193
|
border,
|
|
3685
4194
|
fontSize,
|
|
4195
|
+
flex,
|
|
3686
4196
|
gap,
|
|
3687
4197
|
padding,
|
|
3688
|
-
radius
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
$[21] !== Element2 || $[22] !== children || $[23] !== rest || $[24] !== t10 ? (t11 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t9, disabled: t10, ref, children }), $[21] = Element2, $[22] = children, $[23] = rest, $[24] = t10, $[25] = t11) : t11 = $[25];
|
|
4198
|
+
radius,
|
|
4199
|
+
width
|
|
4200
|
+
}), $[16] = border, $[17] = flex, $[18] = fontSize, $[19] = gap, $[20] = padding, $[21] = radius, $[22] = width, $[23] = t9) : t9 = $[23];
|
|
4201
|
+
let t10;
|
|
4202
|
+
$[24] === Symbol.for("react.memo_cache_sentinel") ? (t10 = _inputElement(), $[24] = t10) : t10 = $[24];
|
|
4203
|
+
const t11 = disabled || readOnly;
|
|
3695
4204
|
let t12;
|
|
3696
|
-
$[26]
|
|
4205
|
+
$[25] !== Element2 || $[26] !== children || $[27] !== rest || $[28] !== t11 ? (t12 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t10, disabled: t11, ref, children }), $[25] = Element2, $[26] = children, $[27] = rest, $[28] = t11, $[29] = t12) : t12 = $[29];
|
|
3697
4206
|
let t13;
|
|
3698
|
-
$[
|
|
4207
|
+
$[30] === Symbol.for("react.memo_cache_sentinel") ? (t13 = selectPresentation(), $[30] = t13) : t13 = $[30];
|
|
3699
4208
|
let t14;
|
|
3700
|
-
$[
|
|
4209
|
+
$[31] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[31] = t14) : t14 = $[31];
|
|
3701
4210
|
let t15;
|
|
3702
|
-
$[
|
|
4211
|
+
$[32] !== fontSize ? (t15 = /* @__PURE__ */ jsx(Text, { size: fontSize, children: t14 }), $[32] = fontSize, $[33] = t15) : t15 = $[33];
|
|
3703
4212
|
let t16;
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
4213
|
+
$[34] !== padding || $[35] !== t15 ? (t16 = /* @__PURE__ */ jsx("span", { className: t13, children: /* @__PURE__ */ jsx(Box, { as: "span", display: "inline-block", padding, children: t15 }) }), $[34] = padding, $[35] = t15, $[36] = t16) : t16 = $[36];
|
|
4214
|
+
let t17;
|
|
4215
|
+
return $[37] !== t12 || $[38] !== t16 || $[39] !== t9 ? (t17 = /* @__PURE__ */ jsxs("span", { "data-ui": "Select", className: t9, "data-icon-right": "", children: [
|
|
4216
|
+
t12,
|
|
4217
|
+
t16
|
|
4218
|
+
] }), $[37] = t12, $[38] = t16, $[39] = t9, $[40] = t17) : t17 = $[40], t17;
|
|
3708
4219
|
}
|
|
3709
4220
|
const DEFAULT_SKELETON_ELEMENT = "div";
|
|
3710
4221
|
function Skeleton(props) {
|
|
3711
|
-
const $ = c(
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
as: t1,
|
|
3715
|
-
animated: t2,
|
|
4222
|
+
const $ = c(9), {
|
|
4223
|
+
as: t0,
|
|
4224
|
+
animated: t1,
|
|
3716
4225
|
className,
|
|
3717
4226
|
delay,
|
|
3718
4227
|
...rest
|
|
3719
|
-
} =
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
$[6] !== delay ? (t3 = () => {
|
|
4228
|
+
} = props, As = t0 === void 0 ? DEFAULT_SKELETON_ELEMENT : t0, animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
|
|
4229
|
+
let t2, t3;
|
|
4230
|
+
$[0] !== delay ? (t2 = () => {
|
|
3723
4231
|
if (!delay)
|
|
3724
|
-
return
|
|
4232
|
+
return;
|
|
3725
4233
|
const timeout = setTimeout(() => {
|
|
3726
4234
|
setVisible(!0);
|
|
3727
4235
|
}, delay);
|
|
3728
4236
|
return () => {
|
|
3729
4237
|
clearTimeout(timeout);
|
|
3730
4238
|
};
|
|
3731
|
-
},
|
|
3732
|
-
|
|
3733
|
-
$[9] !== className || $[10] !== rest ? (t5 = skeleton({
|
|
4239
|
+
}, t3 = [delay], $[0] = delay, $[1] = t2, $[2] = t3) : (t2 = $[1], t3 = $[2]), useEffect(t2, t3);
|
|
4240
|
+
const t4 = "Skeleton", t5 = skeleton({
|
|
3734
4241
|
className,
|
|
3735
4242
|
...rest
|
|
3736
|
-
}),
|
|
3737
|
-
const t6 = animated ? "" : void 0, t7 = visible ? "" : void 0;
|
|
4243
|
+
}), t6 = animated ? "" : void 0, t7 = !delay || visible ? "" : void 0;
|
|
3738
4244
|
let t8;
|
|
3739
|
-
return $[
|
|
4245
|
+
return $[3] !== As || $[4] !== rest || $[5] !== t5 || $[6] !== t6 || $[7] !== t7 ? (t8 = /* @__PURE__ */ jsx(As, { "data-ui": t4, ...rest, className: t5, "data-animated": t6, "data-visible": t7 }), $[3] = As, $[4] = rest, $[5] = t5, $[6] = t6, $[7] = t7, $[8] = t8) : t8 = $[8], t8;
|
|
3740
4246
|
}
|
|
3741
4247
|
const DEFAULT_CODE_SKELETON_ELEMENT = "div";
|
|
3742
4248
|
function CodeSkeleton(props) {
|
|
@@ -3830,8 +4336,8 @@ function SrOnly(props) {
|
|
|
3830
4336
|
}
|
|
3831
4337
|
const DEFAULT_SWITCH_ELEMENT = "input";
|
|
3832
4338
|
function Switch(props) {
|
|
3833
|
-
const $ = c(
|
|
3834
|
-
let className, disabled, forwardedRef, indeterminate, readOnly, rest,
|
|
4339
|
+
const $ = c(24), t0 = props;
|
|
4340
|
+
let className, disabled, forwardedRef, indeterminate, readOnly, rest, t1;
|
|
3835
4341
|
$[0] !== t0 ? ({
|
|
3836
4342
|
as: t1,
|
|
3837
4343
|
className,
|
|
@@ -3839,78 +4345,83 @@ function Switch(props) {
|
|
|
3839
4345
|
indeterminate,
|
|
3840
4346
|
readOnly,
|
|
3841
4347
|
ref: forwardedRef,
|
|
3842
|
-
style,
|
|
3843
4348
|
...rest
|
|
3844
|
-
} = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = forwardedRef, $[4] = indeterminate, $[5] = readOnly, $[6] = rest, $[7] =
|
|
4349
|
+
} = t0, $[0] = t0, $[1] = className, $[2] = disabled, $[3] = forwardedRef, $[4] = indeterminate, $[5] = readOnly, $[6] = rest, $[7] = t1) : (className = $[1], disabled = $[2], forwardedRef = $[3], indeterminate = $[4], readOnly = $[5], rest = $[6], t1 = $[7]);
|
|
3845
4350
|
const Element2 = t1 === void 0 ? DEFAULT_SWITCH_ELEMENT : t1, ref = useRef(null);
|
|
3846
4351
|
let t2;
|
|
3847
|
-
$[
|
|
4352
|
+
$[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[8] = t2) : t2 = $[8], useImperativeHandle(forwardedRef, t2);
|
|
3848
4353
|
let t3, t4;
|
|
3849
|
-
$[
|
|
4354
|
+
$[9] !== indeterminate ? (t3 = () => {
|
|
3850
4355
|
ref.current && (ref.current.indeterminate = indeterminate || !1);
|
|
3851
|
-
}, t4 = [indeterminate], $[
|
|
4356
|
+
}, t4 = [indeterminate], $[9] = indeterminate, $[10] = t3, $[11] = t4) : (t3 = $[10], t4 = $[11]), useEffect(t3, t4);
|
|
3852
4357
|
let t5;
|
|
3853
|
-
$[
|
|
4358
|
+
$[12] !== className ? (t5 = _switch({
|
|
3854
4359
|
className
|
|
3855
|
-
}), $[
|
|
4360
|
+
}), $[12] = className, $[13] = t5) : t5 = $[13];
|
|
3856
4361
|
let t6;
|
|
3857
|
-
$[
|
|
4362
|
+
$[14] === Symbol.for("react.memo_cache_sentinel") ? (t6 = _switchElement(), $[14] = t6) : t6 = $[14];
|
|
3858
4363
|
const t7 = !disabled && readOnly ? "" : void 0, t8 = disabled || readOnly;
|
|
3859
4364
|
let t9;
|
|
3860
|
-
$[
|
|
4365
|
+
$[15] !== Element2 || $[16] !== rest || $[17] !== t7 || $[18] !== t8 ? (t9 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t6, "data-read-only": t7, disabled: t8, type: "checkbox", ref }), $[15] = Element2, $[16] = rest, $[17] = t7, $[18] = t8, $[19] = t9) : t9 = $[19];
|
|
3861
4366
|
let t10;
|
|
3862
|
-
$[
|
|
4367
|
+
$[20] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxs("span", { "aria-hidden": !0, className: _switchPresentation(), children: [
|
|
3863
4368
|
/* @__PURE__ */ jsx("span", { className: _switchTrack() }),
|
|
3864
4369
|
/* @__PURE__ */ jsx("span", { className: _switchThumb() })
|
|
3865
|
-
] }), $[
|
|
4370
|
+
] }), $[20] = t10) : t10 = $[20];
|
|
3866
4371
|
let t11;
|
|
3867
|
-
return $[
|
|
4372
|
+
return $[21] !== t5 || $[22] !== t9 ? (t11 = /* @__PURE__ */ jsxs("span", { className: t5, "data-ui": "Switch", children: [
|
|
3868
4373
|
t9,
|
|
3869
4374
|
t10
|
|
3870
|
-
] }), $[
|
|
4375
|
+
] }), $[21] = t5, $[22] = t9, $[23] = t11) : t11 = $[23], t11;
|
|
3871
4376
|
}
|
|
3872
4377
|
const DEFAULT_TEXT_AREA_ELEMENT = "textarea";
|
|
3873
4378
|
function TextArea(props) {
|
|
3874
|
-
const $ = c(
|
|
3875
|
-
let __unstable_disableFocusRing, customValidity, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6, t7;
|
|
4379
|
+
const $ = c(39), t0 = props;
|
|
4380
|
+
let __unstable_disableFocusRing, className, customValidity, flex, forwardedRef, readOnly, rest, t1, t2, t3, t4, t5, t6, t7, width;
|
|
3876
4381
|
$[0] !== t0 ? ({
|
|
3877
4382
|
__unstable_disableFocusRing,
|
|
3878
4383
|
as: t1,
|
|
3879
4384
|
border: t2,
|
|
4385
|
+
className,
|
|
3880
4386
|
customValidity,
|
|
3881
4387
|
disabled: t3,
|
|
4388
|
+
flex,
|
|
3882
4389
|
fontSize: t4,
|
|
3883
4390
|
gap: t5,
|
|
3884
4391
|
padding: t6,
|
|
3885
4392
|
radius: t7,
|
|
3886
4393
|
readOnly,
|
|
3887
4394
|
ref: forwardedRef,
|
|
4395
|
+
width,
|
|
3888
4396
|
...rest
|
|
3889
|
-
} = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] =
|
|
4397
|
+
} = t0, $[0] = t0, $[1] = __unstable_disableFocusRing, $[2] = className, $[3] = customValidity, $[4] = flex, $[5] = forwardedRef, $[6] = readOnly, $[7] = rest, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = t6, $[14] = t7, $[15] = width) : (__unstable_disableFocusRing = $[1], className = $[2], customValidity = $[3], flex = $[4], forwardedRef = $[5], readOnly = $[6], rest = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], t6 = $[13], t7 = $[14], width = $[15]);
|
|
3890
4398
|
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, gap = t5 === void 0 ? 3 : t5, padding = t6 === void 0 ? 3 : t6, radius = t7 === void 0 ? 2 : t7, ref = useRef(null);
|
|
3891
4399
|
let t8;
|
|
3892
|
-
$[
|
|
4400
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => ref.current, $[16] = t8) : t8 = $[16], useImperativeHandle(forwardedRef, t8), useCustomValidity(ref, customValidity);
|
|
3893
4401
|
let t9;
|
|
3894
|
-
$[
|
|
4402
|
+
$[17] !== border || $[18] !== className || $[19] !== flex || $[20] !== fontSize || $[21] !== gap || $[22] !== padding || $[23] !== radius || $[24] !== width ? (t9 = textArea({
|
|
4403
|
+
className,
|
|
3895
4404
|
border,
|
|
4405
|
+
flex,
|
|
3896
4406
|
fontSize,
|
|
4407
|
+
gap,
|
|
3897
4408
|
padding,
|
|
3898
4409
|
radius,
|
|
3899
|
-
|
|
3900
|
-
}), $[
|
|
4410
|
+
width
|
|
4411
|
+
}), $[17] = border, $[18] = className, $[19] = flex, $[20] = fontSize, $[21] = gap, $[22] = padding, $[23] = radius, $[24] = width, $[25] = t9) : t9 = $[25];
|
|
3901
4412
|
const t10 = customValidity ? "" : void 0, t11 = !disabled && readOnly ? "" : void 0;
|
|
3902
4413
|
let t12;
|
|
3903
|
-
$[
|
|
4414
|
+
$[26] === Symbol.for("react.memo_cache_sentinel") ? (t12 = _inputElement(), $[26] = t12) : t12 = $[26];
|
|
3904
4415
|
const t13 = __unstable_disableFocusRing ? "" : void 0;
|
|
3905
4416
|
let t14;
|
|
3906
|
-
$[
|
|
4417
|
+
$[27] !== Element2 || $[28] !== disabled || $[29] !== readOnly || $[30] !== rest || $[31] !== t13 ? (t14 = /* @__PURE__ */ jsx(Element2, { ...rest, className: t12, "data-no-focus-ring": t13, disabled, readOnly, ref }), $[27] = Element2, $[28] = disabled, $[29] = readOnly, $[30] = rest, $[31] = t13, $[32] = t14) : t14 = $[32];
|
|
3907
4418
|
let t15;
|
|
3908
|
-
$[
|
|
4419
|
+
$[33] === Symbol.for("react.memo_cache_sentinel") ? (t15 = /* @__PURE__ */ jsx("span", { className: _inputPresentation() }), $[33] = t15) : t15 = $[33];
|
|
3909
4420
|
let t16;
|
|
3910
|
-
return $[
|
|
4421
|
+
return $[34] !== t10 || $[35] !== t11 || $[36] !== t14 || $[37] !== t9 ? (t16 = /* @__PURE__ */ jsxs("span", { className: t9, "data-invalid": t10, "data-read-only": t11, "data-ui": "TextArea", children: [
|
|
3911
4422
|
t14,
|
|
3912
4423
|
t15
|
|
3913
|
-
] }), $[
|
|
4424
|
+
] }), $[34] = t10, $[35] = t11, $[36] = t14, $[37] = t9, $[38] = t16) : t16 = $[38], t16;
|
|
3914
4425
|
}
|
|
3915
4426
|
function useDelayedState(initialState) {
|
|
3916
4427
|
const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef(void 0);
|
|
@@ -3940,29 +4451,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
|
|
|
3940
4451
|
right: ["right-end", "right-start", "left", "top", "bottom"],
|
|
3941
4452
|
"right-start": ["right", "right-end", "left-start", "top-start", "bottom-start"],
|
|
3942
4453
|
"right-end": ["right", "right-start", "left-end", "top-end", "bottom-end"]
|
|
3943
|
-
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/
|
|
3944
|
-
function TooltipDelayGroupProvider(props) {
|
|
3945
|
-
const $ = c(9), {
|
|
3946
|
-
children,
|
|
3947
|
-
delay
|
|
3948
|
-
} = 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;
|
|
3949
|
-
let t0;
|
|
3950
|
-
const t1 = isGroupActive ? 1 : openDelay;
|
|
3951
|
-
let t2;
|
|
3952
|
-
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t1 ? (t2 = {
|
|
3953
|
-
setIsGroupActive,
|
|
3954
|
-
openTooltipId,
|
|
3955
|
-
setOpenTooltipId,
|
|
3956
|
-
openDelay: t1,
|
|
3957
|
-
closeDelay
|
|
3958
|
-
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t1, $[5] = t2) : t2 = $[5], t0 = t2;
|
|
3959
|
-
const value = t0;
|
|
3960
|
-
let t3;
|
|
3961
|
-
return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
|
|
3962
|
-
}
|
|
3963
|
-
function useTooltipDelayGroup() {
|
|
3964
|
-
return useContext(TooltipDelayGroupContext);
|
|
3965
|
-
}
|
|
4454
|
+
}, TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/v4/tooltipDelayGroup", null);
|
|
3966
4455
|
function TooltipLayer(props) {
|
|
3967
4456
|
const $ = c(50);
|
|
3968
4457
|
let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, rest, scheme, shadow, style, t0;
|
|
@@ -3984,101 +4473,108 @@ function TooltipLayer(props) {
|
|
|
3984
4473
|
tone: t0,
|
|
3985
4474
|
...rest
|
|
3986
4475
|
} = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = rest, $[13] = scheme, $[14] = shadow, $[15] = style, $[16] = t0) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], rest = $[12], scheme = $[13], shadow = $[14], style = $[15], t0 = $[16]);
|
|
3987
|
-
const tone = t0 === void 0 ? "inherit" : t0;
|
|
3988
|
-
let
|
|
3989
|
-
|
|
3990
|
-
let t3;
|
|
3991
|
-
$[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t2 ? (t3 = {
|
|
4476
|
+
const tone = t0 === void 0 ? "inherit" : t0, t1 = animate ? "transform" : void 0;
|
|
4477
|
+
let t2;
|
|
4478
|
+
$[17] !== originX || $[18] !== originY || $[19] !== style || $[20] !== t1 ? (t2 = {
|
|
3992
4479
|
originX,
|
|
3993
4480
|
originY,
|
|
3994
|
-
willChange:
|
|
4481
|
+
willChange: t1,
|
|
3995
4482
|
...style
|
|
3996
|
-
}, $[17] = originX, $[18] = originY, $[19] = style, $[20] =
|
|
3997
|
-
const rootStyle =
|
|
3998
|
-
let
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
left: t5,
|
|
4003
|
-
top: t6,
|
|
4483
|
+
}, $[17] = originX, $[18] = originY, $[19] = style, $[20] = t1, $[21] = t2) : t2 = $[21];
|
|
4484
|
+
const rootStyle = t2, t3 = arrowX !== null ? arrowX : void 0, t4 = arrowY !== null ? arrowY : void 0;
|
|
4485
|
+
let t5;
|
|
4486
|
+
$[22] !== t3 || $[23] !== t4 ? (t5 = {
|
|
4487
|
+
left: t3,
|
|
4488
|
+
top: t4,
|
|
4004
4489
|
right: void 0,
|
|
4005
4490
|
bottom: void 0
|
|
4006
|
-
}, $[22] =
|
|
4007
|
-
const arrowStyle =
|
|
4491
|
+
}, $[22] = t3, $[23] = t4, $[24] = t5) : t5 = $[24];
|
|
4492
|
+
const arrowStyle = t5, t6 = animate ? "" : void 0;
|
|
4493
|
+
let t7;
|
|
4494
|
+
$[25] !== animate ? (t7 = animate ? ["hidden", "initial"] : void 0, $[25] = animate, $[26] = t7) : t7 = $[26];
|
|
4495
|
+
let t8;
|
|
4496
|
+
$[27] !== animate ? (t8 = animate ? ["visible", "scaleIn"] : void 0, $[27] = animate, $[28] = t8) : t8 = $[28];
|
|
4008
4497
|
let t9;
|
|
4009
|
-
$[
|
|
4498
|
+
$[29] !== animate ? (t9 = animate ? ["hidden", "scaleOut"] : void 0, $[29] = animate, $[30] = t9) : t9 = $[30];
|
|
4010
4499
|
let t10;
|
|
4011
|
-
$[
|
|
4500
|
+
$[31] !== arrow2 || $[32] !== arrowRef || $[33] !== arrowStyle ? (t10 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[31] = arrow2, $[32] = arrowRef, $[33] = arrowStyle, $[34] = t10) : t10 = $[34];
|
|
4012
4501
|
let t11;
|
|
4013
|
-
$[
|
|
4014
|
-
let t12;
|
|
4015
|
-
$[31] !== arrow2 || $[32] !== arrowRef || $[33] !== arrowStyle ? (t12 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[31] = arrow2, $[32] = arrowRef, $[33] = arrowStyle, $[34] = t12) : t12 = $[34];
|
|
4016
|
-
let t13;
|
|
4017
|
-
return $[35] !== children || $[36] !== padding || $[37] !== placement || $[38] !== radius || $[39] !== rest || $[40] !== rootStyle || $[41] !== scheme || $[42] !== shadow || $[43] !== t10 || $[44] !== t11 || $[45] !== t12 || $[46] !== t8 || $[47] !== t9 || $[48] !== tone ? (t13 = /* @__PURE__ */ jsxs(Layer, { "data-ui": "Tooltip__layer", ...rest, as: motion.div, "data-animate": t8, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t9, animate: t10, exit: t11, tone, children: [
|
|
4502
|
+
return $[35] !== children || $[36] !== padding || $[37] !== placement || $[38] !== radius || $[39] !== rest || $[40] !== rootStyle || $[41] !== scheme || $[42] !== shadow || $[43] !== t10 || $[44] !== t6 || $[45] !== t7 || $[46] !== t8 || $[47] !== t9 || $[48] !== tone ? (t11 = /* @__PURE__ */ jsxs(Layer, { "data-ui": "Tooltip__layer", ...rest, as: motion.div, "data-animate": t6, "data-placement": placement, padding, radius, scheme, shadow, style: rootStyle, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t7, animate: t8, exit: t9, tone, children: [
|
|
4018
4503
|
children,
|
|
4019
|
-
|
|
4020
|
-
] }), $[35] = children, $[36] = padding, $[37] = placement, $[38] = radius, $[39] = rest, $[40] = rootStyle, $[41] = scheme, $[42] = shadow, $[43] = t10, $[44] =
|
|
4504
|
+
t10
|
|
4505
|
+
] }), $[35] = children, $[36] = padding, $[37] = placement, $[38] = radius, $[39] = rest, $[40] = rootStyle, $[41] = scheme, $[42] = shadow, $[43] = t10, $[44] = t6, $[45] = t7, $[46] = t8, $[47] = t9, $[48] = tone, $[49] = t11) : t11 = $[49], t11;
|
|
4021
4506
|
}
|
|
4022
4507
|
const DEFAULT_TOOLTIP_ELEMENT = "div";
|
|
4023
4508
|
function Tooltip(props) {
|
|
4024
|
-
const
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4509
|
+
const $ = c(143), t0 = props;
|
|
4510
|
+
let _boundaryElement, _fallbackPlacements, childProp, className, content2, delay, disabled, forwardedRef, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
|
4511
|
+
$[0] !== t0 ? ({
|
|
4512
|
+
animate: t1,
|
|
4513
|
+
arrow: t2,
|
|
4514
|
+
as: t3,
|
|
4515
|
+
boundaryElement: _boundaryElement,
|
|
4029
4516
|
children: childProp,
|
|
4030
4517
|
className,
|
|
4031
4518
|
content: content2,
|
|
4032
4519
|
delay,
|
|
4033
4520
|
disabled,
|
|
4034
|
-
fallbackPlacements
|
|
4035
|
-
padding
|
|
4036
|
-
placement:
|
|
4521
|
+
fallbackPlacements: _fallbackPlacements,
|
|
4522
|
+
padding: t4,
|
|
4523
|
+
placement: t5,
|
|
4037
4524
|
portal: portalProp,
|
|
4038
|
-
radius
|
|
4525
|
+
radius: t6,
|
|
4039
4526
|
ref: forwardedRef,
|
|
4040
4527
|
scheme,
|
|
4041
|
-
shadow
|
|
4042
|
-
zOffset
|
|
4043
|
-
tone
|
|
4528
|
+
shadow: t7,
|
|
4529
|
+
zOffset: t8,
|
|
4530
|
+
tone: t9,
|
|
4044
4531
|
...rest
|
|
4045
|
-
} =
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4532
|
+
} = t0, $[0] = t0, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = childProp, $[4] = className, $[5] = content2, $[6] = delay, $[7] = disabled, $[8] = forwardedRef, $[9] = portalProp, $[10] = rest, $[11] = scheme, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = t7, $[19] = t8, $[20] = t9) : (_boundaryElement = $[1], _fallbackPlacements = $[2], childProp = $[3], className = $[4], content2 = $[5], delay = $[6], disabled = $[7], forwardedRef = $[8], portalProp = $[9], rest = $[10], scheme = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], t7 = $[18], t8 = $[19], t9 = $[20]);
|
|
4533
|
+
const _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, as = t3 === void 0 ? DEFAULT_TOOLTIP_ELEMENT : t3, padding = t4 === void 0 ? 2 : t4, placementProp = t5 === void 0 ? "bottom" : t5, radius = t6 === void 0 ? 3 : t6, shadow = t7 === void 0 ? 2 : t7, zOffset = t8 === void 0 ? Z_OFFSETS.tooltip : t8, tone = t9 === void 0 ? "inherit" : t9, boundaryElement = _boundaryElement ?? use(BoundaryElementContext), fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], animate = usePrefersReducedMotion() ? !1 : _animate, ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
|
|
4534
|
+
let t10;
|
|
4535
|
+
$[21] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => ref.current, $[21] = t10) : t10 = $[21], useImperativeHandle(forwardedRef, t10);
|
|
4536
|
+
let portalElement = null;
|
|
4537
|
+
if (portalProp) {
|
|
4538
|
+
const portal = use(PortalContext);
|
|
4539
|
+
assertPortalContext(portal), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
|
|
4540
|
+
}
|
|
4541
|
+
let t11;
|
|
4542
|
+
$[22] !== animate || $[23] !== arrowProp || $[24] !== boundaryElement || $[25] !== fallbackPlacements ? (t11 = {
|
|
4543
|
+
animate,
|
|
4544
|
+
arrowProp,
|
|
4545
|
+
arrowRef,
|
|
4546
|
+
boundaryElement,
|
|
4547
|
+
fallbackPlacements,
|
|
4548
|
+
rootBoundary: "viewport"
|
|
4549
|
+
}, $[22] = animate, $[23] = arrowProp, $[24] = boundaryElement, $[25] = fallbackPlacements, $[26] = t11) : t11 = $[26];
|
|
4550
|
+
const middleware = useMiddleware(t11);
|
|
4551
|
+
let t12;
|
|
4552
|
+
$[27] !== referenceElement ? (t12 = {
|
|
4553
|
+
reference: referenceElement
|
|
4554
|
+
}, $[27] = referenceElement, $[28] = t12) : t12 = $[28];
|
|
4555
|
+
let t13;
|
|
4556
|
+
$[29] !== middleware || $[30] !== placementProp || $[31] !== t12 ? (t13 = {
|
|
4557
|
+
middleware,
|
|
4558
|
+
placement: placementProp,
|
|
4559
|
+
whileElementsMounted: autoUpdate,
|
|
4560
|
+
elements: t12,
|
|
4561
|
+
transform: !1
|
|
4562
|
+
}, $[29] = middleware, $[30] = placementProp, $[31] = t12, $[32] = t13) : t13 = $[32];
|
|
4563
|
+
const {
|
|
4065
4564
|
floatingStyles,
|
|
4066
4565
|
placement,
|
|
4067
4566
|
middlewareData,
|
|
4068
4567
|
refs,
|
|
4069
4568
|
update
|
|
4070
|
-
} = useFloating(
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
elements: {
|
|
4075
|
-
reference: referenceElement
|
|
4076
|
-
},
|
|
4077
|
-
transform: !1
|
|
4078
|
-
}), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
|
|
4569
|
+
} = useFloating(t13), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = use(TooltipDelayGroupContext);
|
|
4570
|
+
let t14;
|
|
4571
|
+
$[33] !== delayGroupContext ? (t14 = delayGroupContext || {}, $[33] = delayGroupContext, $[34] = t14) : t14 = $[34];
|
|
4572
|
+
const {
|
|
4079
4573
|
setIsGroupActive,
|
|
4080
4574
|
setOpenTooltipId
|
|
4081
|
-
} =
|
|
4575
|
+
} = t14, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp;
|
|
4576
|
+
let t15;
|
|
4577
|
+
$[35] !== closeDelay || $[36] !== isInsideGroup || $[37] !== openDelay || $[38] !== setIsGroupActive || $[39] !== setIsOpen || $[40] !== setOpenTooltipId || $[41] !== tooltipId ? (t15 = (open, immediate) => {
|
|
4082
4578
|
if (isInsideGroup)
|
|
4083
4579
|
if (open) {
|
|
4084
4580
|
const groupedOpenDelay = immediate ? 0 : openDelay;
|
|
@@ -4089,65 +4585,183 @@ function Tooltip(props) {
|
|
|
4089
4585
|
}
|
|
4090
4586
|
else
|
|
4091
4587
|
setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
|
|
4092
|
-
}, [isInsideGroup, openDelay, setIsGroupActive,
|
|
4588
|
+
}, $[35] = closeDelay, $[36] = isInsideGroup, $[37] = openDelay, $[38] = setIsGroupActive, $[39] = setIsOpen, $[40] = setOpenTooltipId, $[41] = tooltipId, $[42] = t15) : t15 = $[42];
|
|
4589
|
+
const handleIsOpenChange = t15;
|
|
4590
|
+
let t16;
|
|
4591
|
+
$[43] !== childProp?.props || $[44] !== handleIsOpenChange ? (t16 = (e) => {
|
|
4093
4592
|
handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
|
|
4094
|
-
}, [childProp?.props, handleIsOpenChange
|
|
4593
|
+
}, $[43] = childProp?.props, $[44] = handleIsOpenChange, $[45] = t16) : t16 = $[45];
|
|
4594
|
+
const handleBlur = t16;
|
|
4595
|
+
let t17;
|
|
4596
|
+
$[46] !== childProp?.props || $[47] !== handleIsOpenChange ? (t17 = (e_0) => {
|
|
4095
4597
|
handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
|
|
4096
|
-
}, [childProp?.props, handleIsOpenChange
|
|
4598
|
+
}, $[46] = childProp?.props, $[47] = handleIsOpenChange, $[48] = t17) : t17 = $[48];
|
|
4599
|
+
const handleClick = t17;
|
|
4600
|
+
let t18;
|
|
4601
|
+
$[49] !== childProp?.props || $[50] !== handleIsOpenChange ? (t18 = (e_1) => {
|
|
4097
4602
|
handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
|
|
4098
|
-
}, [childProp?.props, handleIsOpenChange
|
|
4603
|
+
}, $[49] = childProp?.props, $[50] = handleIsOpenChange, $[51] = t18) : t18 = $[51];
|
|
4604
|
+
const handleContextMenu = t18;
|
|
4605
|
+
let t19;
|
|
4606
|
+
$[52] !== childProp?.props || $[53] !== handleIsOpenChange ? (t19 = (e_2) => {
|
|
4099
4607
|
handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
|
|
4100
|
-
}, [childProp?.props, handleIsOpenChange
|
|
4608
|
+
}, $[52] = childProp?.props, $[53] = handleIsOpenChange, $[54] = t19) : t19 = $[54];
|
|
4609
|
+
const handleFocus = t19;
|
|
4610
|
+
let t20;
|
|
4611
|
+
$[55] !== childProp?.props || $[56] !== handleIsOpenChange ? (t20 = (e_3) => {
|
|
4101
4612
|
handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
|
|
4102
|
-
}, [childProp?.props, handleIsOpenChange
|
|
4613
|
+
}, $[55] = childProp?.props, $[56] = handleIsOpenChange, $[57] = t20) : t20 = $[57];
|
|
4614
|
+
const handleMouseEnter = t20;
|
|
4615
|
+
let t21;
|
|
4616
|
+
$[58] !== childProp?.props || $[59] !== handleIsOpenChange ? (t21 = (e_4) => {
|
|
4103
4617
|
handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
|
|
4104
|
-
}, [childProp?.props, handleIsOpenChange]);
|
|
4105
|
-
|
|
4618
|
+
}, $[58] = childProp?.props, $[59] = handleIsOpenChange, $[60] = t21) : t21 = $[60];
|
|
4619
|
+
const handleMouseLeave = t21;
|
|
4620
|
+
let t22;
|
|
4621
|
+
$[61] !== handleIsOpenChange || $[62] !== isInsideGroup || $[63] !== referenceElement || $[64] !== showTooltip ? (t22 = {
|
|
4106
4622
|
handleIsOpenChange,
|
|
4107
4623
|
referenceElement,
|
|
4108
4624
|
showTooltip,
|
|
4109
4625
|
isInsideGroup
|
|
4110
|
-
}),
|
|
4626
|
+
}, $[61] = handleIsOpenChange, $[62] = isInsideGroup, $[63] = referenceElement, $[64] = showTooltip, $[65] = t22) : t22 = $[65], useCloseOnMouseLeave(t22);
|
|
4627
|
+
let t23, t24;
|
|
4628
|
+
$[66] !== disabled || $[67] !== handleIsOpenChange || $[68] !== showTooltip ? (t23 = () => {
|
|
4111
4629
|
disabled && showTooltip && handleIsOpenChange(!1);
|
|
4112
|
-
}, [disabled, handleIsOpenChange, showTooltip]), useEffect(
|
|
4630
|
+
}, t24 = [disabled, handleIsOpenChange, showTooltip], $[66] = disabled, $[67] = handleIsOpenChange, $[68] = showTooltip, $[69] = t23, $[70] = t24) : (t23 = $[69], t24 = $[70]), useEffect(t23, t24);
|
|
4631
|
+
let t25, t26;
|
|
4632
|
+
$[71] !== content2 || $[72] !== handleIsOpenChange || $[73] !== showTooltip ? (t25 = () => {
|
|
4113
4633
|
!content2 && showTooltip && handleIsOpenChange(!1);
|
|
4114
|
-
}, [content2, handleIsOpenChange, showTooltip]), useEffect(
|
|
4115
|
-
|
|
4116
|
-
|
|
4634
|
+
}, t26 = [content2, handleIsOpenChange, showTooltip], $[71] = content2, $[72] = handleIsOpenChange, $[73] = showTooltip, $[74] = t25, $[75] = t26) : (t25 = $[74], t26 = $[75]), useEffect(t25, t26);
|
|
4635
|
+
let t27, t28;
|
|
4636
|
+
$[76] !== handleIsOpenChange || $[77] !== showTooltip ? (t27 = () => {
|
|
4637
|
+
if (!showTooltip)
|
|
4638
|
+
return;
|
|
4639
|
+
const handleWindowKeyDown = function(event) {
|
|
4117
4640
|
event.key === "Escape" && handleIsOpenChange(!1, !0);
|
|
4118
|
-
}
|
|
4641
|
+
};
|
|
4119
4642
|
return window.addEventListener("keydown", handleWindowKeyDown), () => {
|
|
4120
4643
|
window.removeEventListener("keydown", handleWindowKeyDown);
|
|
4121
4644
|
};
|
|
4122
|
-
}, [handleIsOpenChange, showTooltip]),
|
|
4645
|
+
}, t28 = [handleIsOpenChange, showTooltip], $[76] = handleIsOpenChange, $[77] = showTooltip, $[78] = t27, $[79] = t28) : (t27 = $[78], t28 = $[79]), useEffect(t27, t28);
|
|
4646
|
+
let t29;
|
|
4647
|
+
$[80] !== boundaryElement || $[81] !== portalElement ? (t29 = () => {
|
|
4123
4648
|
const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
|
|
4124
4649
|
setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
|
|
4125
|
-
}, [boundaryElement, portalElement]);
|
|
4126
|
-
|
|
4650
|
+
}, $[80] = boundaryElement, $[81] = portalElement, $[82] = t29) : t29 = $[82];
|
|
4651
|
+
let t30;
|
|
4652
|
+
$[83] !== boundaryElement || $[84] !== portalElement ? (t30 = [boundaryElement, portalElement], $[83] = boundaryElement, $[84] = portalElement, $[85] = t30) : t30 = $[85], useLayoutEffect(t29, t30);
|
|
4653
|
+
let t31;
|
|
4654
|
+
$[86] !== update ? (t31 = (arrowEl) => {
|
|
4127
4655
|
arrowRef.current = arrowEl, update();
|
|
4128
|
-
}, [update
|
|
4656
|
+
}, $[86] = update, $[87] = t31) : t31 = $[87];
|
|
4657
|
+
const setArrow = t31;
|
|
4658
|
+
let t32;
|
|
4659
|
+
$[88] !== refs ? (t32 = (node) => {
|
|
4129
4660
|
ref.current = node, refs.setFloating(node);
|
|
4130
|
-
}, [refs
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4661
|
+
}, $[88] = refs, $[89] = t32) : t32 = $[89];
|
|
4662
|
+
const setFloating = t32;
|
|
4663
|
+
let t33;
|
|
4664
|
+
bb0: {
|
|
4665
|
+
if (!childProp) {
|
|
4666
|
+
t33 = null;
|
|
4667
|
+
break bb0;
|
|
4668
|
+
}
|
|
4669
|
+
let t342;
|
|
4670
|
+
$[90] !== childProp || $[91] !== handleBlur || $[92] !== handleClick || $[93] !== handleContextMenu || $[94] !== handleFocus || $[95] !== handleMouseEnter || $[96] !== handleMouseLeave ? (t342 = cloneElement(childProp, {
|
|
4671
|
+
onBlur: handleBlur,
|
|
4672
|
+
onFocus: handleFocus,
|
|
4673
|
+
onMouseEnter: handleMouseEnter,
|
|
4674
|
+
onMouseLeave: handleMouseLeave,
|
|
4675
|
+
onClick: handleClick,
|
|
4676
|
+
onContextMenu: handleContextMenu,
|
|
4677
|
+
ref: setReferenceElement
|
|
4678
|
+
}), $[90] = childProp, $[91] = handleBlur, $[92] = handleClick, $[93] = handleContextMenu, $[94] = handleFocus, $[95] = handleMouseEnter, $[96] = handleMouseLeave, $[97] = t342) : t342 = $[97], t33 = t342;
|
|
4679
|
+
}
|
|
4680
|
+
const child = t33;
|
|
4681
|
+
let t34;
|
|
4682
|
+
$[98] !== childProp ? (t34 = childProp ? getElementRef(childProp) : null, $[98] = childProp, $[99] = t34) : t34 = $[99];
|
|
4683
|
+
let t35, t36;
|
|
4684
|
+
if ($[100] !== referenceElement ? (t35 = () => referenceElement, t36 = [referenceElement], $[100] = referenceElement, $[101] = t35, $[102] = t36) : (t35 = $[101], t36 = $[102]), useImperativeHandle(t34, t35, t36), !child) {
|
|
4685
|
+
let t372;
|
|
4686
|
+
return $[103] === Symbol.for("react.memo_cache_sentinel") ? (t372 = /* @__PURE__ */ jsx(Fragment, {}), $[103] = t372) : t372 = $[103], t372;
|
|
4687
|
+
}
|
|
4688
|
+
if (disabled)
|
|
4689
|
+
return child;
|
|
4690
|
+
let t37;
|
|
4691
|
+
$[104] !== className ? (t37 = tooltip({
|
|
4142
4692
|
className
|
|
4143
|
-
}),
|
|
4693
|
+
}), $[104] = className, $[105] = t37) : t37 = $[105];
|
|
4694
|
+
const t38 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
|
|
4695
|
+
let t39;
|
|
4696
|
+
$[106] !== floatingStyles || $[107] !== t38 ? (t39 = {
|
|
4144
4697
|
...floatingStyles,
|
|
4145
|
-
maxWidth:
|
|
4146
|
-
},
|
|
4147
|
-
|
|
4148
|
-
|
|
4698
|
+
maxWidth: t38
|
|
4699
|
+
}, $[106] = floatingStyles, $[107] = t38, $[108] = t39) : t39 = $[108];
|
|
4700
|
+
let t40;
|
|
4701
|
+
$[109] !== animate || $[110] !== arrowProp || $[111] !== arrowX || $[112] !== arrowY || $[113] !== as || $[114] !== content2 || $[115] !== originX || $[116] !== originY || $[117] !== padding || $[118] !== placement || $[119] !== radius || $[120] !== rest || $[121] !== scheme || $[122] !== setArrow || $[123] !== setFloating || $[124] !== shadow || $[125] !== t37 || $[126] !== t39 || $[127] !== tone || $[128] !== zOffset ? (t40 = /* @__PURE__ */ jsx(TooltipLayer, { "data-ui": "Tooltip", ...rest, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, as, className: t37, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, style: t39, tone, zOffset, children: content2 }), $[109] = animate, $[110] = arrowProp, $[111] = arrowX, $[112] = arrowY, $[113] = as, $[114] = content2, $[115] = originX, $[116] = originY, $[117] = padding, $[118] = placement, $[119] = radius, $[120] = rest, $[121] = scheme, $[122] = setArrow, $[123] = setFloating, $[124] = shadow, $[125] = t37, $[126] = t39, $[127] = tone, $[128] = zOffset, $[129] = t40) : t40 = $[129];
|
|
4702
|
+
const node_0 = t40;
|
|
4703
|
+
let children = showTooltip ? node_0 : null;
|
|
4704
|
+
if (showTooltip && portalProp) {
|
|
4705
|
+
let resolvedTone = tone;
|
|
4706
|
+
if (tone === "inherit") {
|
|
4707
|
+
const card2 = use(CardContext);
|
|
4708
|
+
assertCardContext(card2), resolvedTone = card2.tone;
|
|
4709
|
+
}
|
|
4710
|
+
const t412 = typeof portalProp == "string" ? portalProp : void 0, t422 = scheme ?? "light";
|
|
4711
|
+
let t43;
|
|
4712
|
+
$[130] !== node_0 || $[131] !== resolvedTone || $[132] !== t422 ? (t43 = /* @__PURE__ */ jsx(CardProvider, { tone: resolvedTone, scheme: t422, children: node_0 }), $[130] = node_0, $[131] = resolvedTone, $[132] = t422, $[133] = t43) : t43 = $[133];
|
|
4713
|
+
let t44;
|
|
4714
|
+
$[134] !== t412 || $[135] !== t43 ? (t44 = /* @__PURE__ */ jsx(Portal, { __unstable_name: t412, children: t43 }), $[134] = t412, $[135] = t43, $[136] = t44) : t44 = $[136], children = t44;
|
|
4715
|
+
}
|
|
4716
|
+
let t41;
|
|
4717
|
+
$[137] !== animate || $[138] !== children ? (t41 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[137] = animate, $[138] = children, $[139] = t41) : t41 = $[139];
|
|
4718
|
+
let t42;
|
|
4719
|
+
return $[140] !== child || $[141] !== t41 ? (t42 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4720
|
+
t41,
|
|
4149
4721
|
child
|
|
4150
|
-
] });
|
|
4722
|
+
] }), $[140] = child, $[141] = t41, $[142] = t42) : t42 = $[142], t42;
|
|
4723
|
+
}
|
|
4724
|
+
function useMiddleware(t0) {
|
|
4725
|
+
const $ = c(17), {
|
|
4726
|
+
animate,
|
|
4727
|
+
arrowProp,
|
|
4728
|
+
arrowRef,
|
|
4729
|
+
boundaryElement,
|
|
4730
|
+
fallbackPlacements,
|
|
4731
|
+
rootBoundary
|
|
4732
|
+
} = t0;
|
|
4733
|
+
let ret;
|
|
4734
|
+
if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
|
|
4735
|
+
ret = [];
|
|
4736
|
+
const t1 = boundaryElement || void 0;
|
|
4737
|
+
let t2;
|
|
4738
|
+
$[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = flip({
|
|
4739
|
+
boundary: t1,
|
|
4740
|
+
fallbackPlacements,
|
|
4741
|
+
padding: DEFAULT_TOOLTIP_PADDING,
|
|
4742
|
+
rootBoundary
|
|
4743
|
+
}), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
|
|
4744
|
+
let t3;
|
|
4745
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = offset({
|
|
4746
|
+
mainAxis: DEFAULT_TOOLTIP_DISTANCE
|
|
4747
|
+
}), $[11] = t3) : t3 = $[11], ret.push(t3);
|
|
4748
|
+
const t4 = boundaryElement || void 0;
|
|
4749
|
+
let t5;
|
|
4750
|
+
if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = shift({
|
|
4751
|
+
boundary: t4,
|
|
4752
|
+
rootBoundary,
|
|
4753
|
+
padding: DEFAULT_TOOLTIP_PADDING
|
|
4754
|
+
}), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
|
|
4755
|
+
let t6;
|
|
4756
|
+
$[15] !== arrowRef ? (t6 = arrow({
|
|
4757
|
+
element: arrowRef,
|
|
4758
|
+
padding: DEFAULT_TOOLTIP_PADDING
|
|
4759
|
+
}), $[15] = arrowRef, $[16] = t6) : t6 = $[16], ret.push(t6);
|
|
4760
|
+
}
|
|
4761
|
+
animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
|
|
4762
|
+
} else
|
|
4763
|
+
ret = $[6];
|
|
4764
|
+
return ret;
|
|
4151
4765
|
}
|
|
4152
4766
|
function useCloseOnMouseLeave(t0) {
|
|
4153
4767
|
const $ = c(10), {
|
|
@@ -4173,19 +4787,41 @@ function useCloseOnMouseLeave(t0) {
|
|
|
4173
4787
|
let t3;
|
|
4174
4788
|
$[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], useEffect(t2, t3);
|
|
4175
4789
|
}
|
|
4790
|
+
function TooltipDelayGroupProvider(props) {
|
|
4791
|
+
const $ = c(9), {
|
|
4792
|
+
children,
|
|
4793
|
+
delay
|
|
4794
|
+
} = 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, t0 = isGroupActive ? 1 : openDelay;
|
|
4795
|
+
let t1;
|
|
4796
|
+
$[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t0 ? (t1 = {
|
|
4797
|
+
setIsGroupActive,
|
|
4798
|
+
openTooltipId,
|
|
4799
|
+
setOpenTooltipId,
|
|
4800
|
+
openDelay: t0,
|
|
4801
|
+
closeDelay
|
|
4802
|
+
}, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
|
|
4803
|
+
const value = t1;
|
|
4804
|
+
let t2;
|
|
4805
|
+
return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsx(TooltipDelayGroupContext, { value, children }), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
|
|
4806
|
+
}
|
|
4807
|
+
function useTooltipDelayGroup() {
|
|
4808
|
+
return use(TooltipDelayGroupContext);
|
|
4809
|
+
}
|
|
4176
4810
|
function BoundaryElementProvider(props) {
|
|
4177
|
-
const $ = c(
|
|
4811
|
+
const $ = c(3), {
|
|
4178
4812
|
children,
|
|
4179
4813
|
element
|
|
4180
4814
|
} = props;
|
|
4181
|
-
let t0
|
|
4182
|
-
$[0] !== element ? (
|
|
4815
|
+
let t0;
|
|
4816
|
+
return $[0] !== children || $[1] !== element ? (t0 = /* @__PURE__ */ jsx(BoundaryElementContext, { value: element, children }), $[0] = children, $[1] = element, $[2] = t0) : t0 = $[2], t0;
|
|
4817
|
+
}
|
|
4818
|
+
function useBoundaryElement() {
|
|
4819
|
+
const $ = c(2), element = use(BoundaryElementContext);
|
|
4820
|
+
let t0;
|
|
4821
|
+
return $[0] !== element ? (t0 = {
|
|
4183
4822
|
version: 0,
|
|
4184
4823
|
element
|
|
4185
|
-
}, $[0] = element, $[1] =
|
|
4186
|
-
const value = t0;
|
|
4187
|
-
let t2;
|
|
4188
|
-
return $[2] !== children || $[3] !== value ? (t2 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t2) : t2 = $[4], t2;
|
|
4824
|
+
}, $[0] = element, $[1] = t0) : t0 = $[1], t0;
|
|
4189
4825
|
}
|
|
4190
4826
|
function findMaxBreakpoints(media2, width) {
|
|
4191
4827
|
const ret = [];
|
|
@@ -4210,30 +4846,25 @@ function ElementQuery(props) {
|
|
|
4210
4846
|
ref: forwardedRef,
|
|
4211
4847
|
...rest
|
|
4212
4848
|
} = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = mediaProp, $[4] = rest, $[5] = t1) : (children = $[1], forwardedRef = $[2], mediaProp = $[3], rest = $[4], t1 = $[5]);
|
|
4213
|
-
const Element2 = t1 === void 0 ? DEFAULT_ELEMENT_QUERY_ELEMENT : t1, breakpoints = mediaProp ?? DEFAULT_BREAKPOINTS, [element, setElement] = useState(null),
|
|
4849
|
+
const Element2 = t1 === void 0 ? DEFAULT_ELEMENT_QUERY_ELEMENT : t1, breakpoints = mediaProp ?? DEFAULT_BREAKPOINTS, [element, setElement] = useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth;
|
|
4214
4850
|
let t2;
|
|
4215
|
-
t2 = elementSize?.border.width ?? window.innerWidth;
|
|
4216
|
-
const width = t2;
|
|
4217
|
-
let t3, t4;
|
|
4218
4851
|
if ($[6] !== breakpoints || $[7] !== width) {
|
|
4219
4852
|
const eq = findMaxBreakpoints(breakpoints, width);
|
|
4220
|
-
|
|
4853
|
+
t2 = eq.length ? eq.join(" ") : void 0, $[6] = breakpoints, $[7] = width, $[8] = t2;
|
|
4221
4854
|
} else
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
let t5, t6;
|
|
4855
|
+
t2 = $[8];
|
|
4856
|
+
const max = t2;
|
|
4857
|
+
let t3;
|
|
4226
4858
|
if ($[9] !== breakpoints || $[10] !== width) {
|
|
4227
4859
|
const eq_0 = findMinBreakpoints(breakpoints, width);
|
|
4228
|
-
|
|
4860
|
+
t3 = eq_0.length ? eq_0.join(" ") : void 0, $[9] = breakpoints, $[10] = width, $[11] = t3;
|
|
4229
4861
|
} else
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
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;
|
|
4862
|
+
t3 = $[11];
|
|
4863
|
+
const min = t3;
|
|
4864
|
+
let t4, t5;
|
|
4865
|
+
$[12] !== element ? (t4 = () => element, t5 = [element], $[12] = element, $[13] = t4, $[14] = t5) : (t4 = $[13], t5 = $[14]), useImperativeHandle(forwardedRef, t4, t5);
|
|
4866
|
+
let t6;
|
|
4867
|
+
return $[15] !== Element2 || $[16] !== children || $[17] !== max || $[18] !== min || $[19] !== rest ? (t6 = /* @__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] = t6) : t6 = $[20], t6;
|
|
4237
4868
|
}
|
|
4238
4869
|
class ErrorBoundary extends Component {
|
|
4239
4870
|
state = {
|
|
@@ -4266,39 +4897,27 @@ function PortalProvider(props) {
|
|
|
4266
4897
|
const $ = c(9), {
|
|
4267
4898
|
children,
|
|
4268
4899
|
element,
|
|
4269
|
-
__unstable_elements:
|
|
4270
|
-
} = props,
|
|
4900
|
+
__unstable_elements: elements
|
|
4901
|
+
} = props, parentPortal = use(PortalContext);
|
|
4271
4902
|
let t0;
|
|
4272
4903
|
$[0] !== elements || $[1] !== parentPortal ? (t0 = () => elements?.default ?? (parentPortal.element || document.body), $[0] = elements, $[1] = parentPortal, $[2] = t0) : t0 = $[2];
|
|
4273
|
-
const fallbackElement = useSyncExternalStore(emptySubscribe, t0, _temp);
|
|
4274
|
-
let
|
|
4275
|
-
|
|
4276
|
-
let t3;
|
|
4277
|
-
$[3] !== elements || $[4] !== t2 ? (t3 = {
|
|
4904
|
+
const fallbackElement = useSyncExternalStore(emptySubscribe, t0, _temp), t1 = element || fallbackElement;
|
|
4905
|
+
let t2;
|
|
4906
|
+
$[3] !== elements || $[4] !== t1 ? (t2 = {
|
|
4278
4907
|
version: 0,
|
|
4279
4908
|
boundaryElement: null,
|
|
4280
|
-
element:
|
|
4909
|
+
element: t1,
|
|
4281
4910
|
elements
|
|
4282
|
-
}, $[3] = elements, $[4] =
|
|
4283
|
-
const value =
|
|
4284
|
-
let
|
|
4285
|
-
return $[6] !== children || $[7] !== value ? (
|
|
4911
|
+
}, $[3] = elements, $[4] = t1, $[5] = t2) : t2 = $[5];
|
|
4912
|
+
const value = t2;
|
|
4913
|
+
let t3;
|
|
4914
|
+
return $[6] !== children || $[7] !== value ? (t3 = /* @__PURE__ */ jsx(PortalContext, { value, children }), $[6] = children, $[7] = value, $[8] = t3) : t3 = $[8], t3;
|
|
4286
4915
|
}
|
|
4287
4916
|
function _temp() {
|
|
4288
4917
|
return null;
|
|
4289
4918
|
}
|
|
4290
4919
|
const emptySubscribe = () => () => {
|
|
4291
4920
|
};
|
|
4292
|
-
function useUnique(value) {
|
|
4293
|
-
const valueRef = useRef(value);
|
|
4294
|
-
return _isEqual(valueRef.current, value) || (valueRef.current = value), valueRef.current;
|
|
4295
|
-
}
|
|
4296
|
-
function _isEqual(objA, objB) {
|
|
4297
|
-
if (!objA || !objB)
|
|
4298
|
-
return objA === objB;
|
|
4299
|
-
const keysA = Object.keys(objA), keysB = Object.keys(objB);
|
|
4300
|
-
return keysA.length !== keysB.length ? !1 : keysA.every((key2) => objA[key2] === objB[key2]);
|
|
4301
|
-
}
|
|
4302
4921
|
function RootProvider(props) {
|
|
4303
4922
|
const $ = c(10), {
|
|
4304
4923
|
boundaryElement: t0,
|
|
@@ -4485,7 +5104,6 @@ export {
|
|
|
4485
5104
|
VirtualList,
|
|
4486
5105
|
_ResizeObserver,
|
|
4487
5106
|
_elementSizeObserver,
|
|
4488
|
-
_getArrayProp,
|
|
4489
5107
|
_getResponsiveProp,
|
|
4490
5108
|
_hasFocus,
|
|
4491
5109
|
_isEnterToClickElement,
|
|
@@ -4516,7 +5134,6 @@ export {
|
|
|
4516
5134
|
usePortal,
|
|
4517
5135
|
usePrefersDark,
|
|
4518
5136
|
usePrefersReducedMotion,
|
|
4519
|
-
useResponsiveProp,
|
|
4520
5137
|
useToast,
|
|
4521
5138
|
useTooltipDelayGroup,
|
|
4522
5139
|
useTree
|