@sanity/ui 4.0.0-static.9 → 4.0.0
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/LICENSE +1 -1
- package/README.md +25 -7
- package/dist/_system-CTe2lb5l.d.ts +40 -0
- package/dist/_system-CTe2lb5l.d.ts.map +1 -0
- package/dist/arrow-CHE8-_G7.js +161 -0
- package/dist/arrow-CHE8-_G7.js.map +1 -0
- package/dist/autocomplete.d.ts +140 -0
- package/dist/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete.js +475 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/breadcrumbs.d.ts +18 -0
- package/dist/breadcrumbs.d.ts.map +1 -0
- package/dist/breadcrumbs.js +116 -0
- package/dist/breadcrumbs.js.map +1 -0
- package/dist/button-dnqMFkWg.d.ts +76 -0
- package/dist/button-dnqMFkWg.d.ts.map +1 -0
- package/dist/button-mxfSqr0n.js +179 -0
- package/dist/button-mxfSqr0n.js.map +1 -0
- package/dist/card-C0a0wQTc.d.ts +7 -0
- package/dist/card-C0a0wQTc.d.ts.map +1 -0
- package/dist/code.d.ts +20 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +90 -0
- package/dist/code.js.map +1 -0
- package/dist/codeFontStyle-DYUujk7K.js +11 -0
- package/dist/codeFontStyle-DYUujk7K.js.map +1 -0
- package/dist/component-DVlwaWB-.d.ts +25 -0
- package/dist/component-DVlwaWB-.d.ts.map +1 -0
- package/dist/element-BYgCE_iK.js +51 -0
- package/dist/element-BYgCE_iK.js.map +1 -0
- package/dist/factory-BA3gEfyI.js +3056 -0
- package/dist/factory-BA3gEfyI.js.map +1 -0
- package/dist/flex-C-5JHi1C.js +76 -0
- package/dist/flex-C-5JHi1C.js.map +1 -0
- package/dist/font-EtfxKPUz.d.ts +49 -0
- package/dist/font-EtfxKPUz.d.ts.map +1 -0
- package/dist/getElementRef-5HZQ-Owu.js +91 -0
- package/dist/getElementRef-5HZQ-Owu.js.map +1 -0
- package/dist/getScopedTheme-C-sZsyAz.js +267 -0
- package/dist/getScopedTheme-C-sZsyAz.js.map +1 -0
- package/dist/getTheme_v2-y09KqtEb.js +487 -0
- package/dist/getTheme_v2-y09KqtEb.js.map +1 -0
- package/dist/grid-BXHFJhf_.js +115 -0
- package/dist/grid-BXHFJhf_.js.map +1 -0
- package/dist/helpers-bwfx1e-Y.js +67 -0
- package/dist/helpers-bwfx1e-Y.js.map +1 -0
- package/dist/hotkeys-CmmTQZpn.js +165 -0
- package/dist/hotkeys-CmmTQZpn.js.map +1 -0
- package/dist/index.d.ts +1192 -2168
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2069 -4483
- package/dist/index.js.map +1 -1
- package/dist/layer-B98ynOf2.js +61 -0
- package/dist/layer-B98ynOf2.js.map +1 -0
- package/dist/layer-ChlP9Ik6.d.ts +242 -0
- package/dist/layer-ChlP9Ik6.d.ts.map +1 -0
- package/dist/menu.d.ts +146 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +614 -0
- package/dist/menu.js.map +1 -0
- package/dist/popover-CMlQeKn0.d.ts +96 -0
- package/dist/popover-CMlQeKn0.d.ts.map +1 -0
- package/dist/popover-PorX5Jv9.js +419 -0
- package/dist/popover-PorX5Jv9.js.map +1 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +3 -0
- package/dist/refractor-CC48DwHi.js +20 -0
- package/dist/refractor-CC48DwHi.js.map +1 -0
- package/dist/responsiveFont-hN1mZFjm.js +55 -0
- package/dist/responsiveFont-hN1mZFjm.js.map +1 -0
- package/dist/rgba-BSYaEUW6.d.ts +846 -0
- package/dist/rgba-BSYaEUW6.d.ts.map +1 -0
- package/dist/selectable-B0GUIL74.d.ts +7 -0
- package/dist/selectable-B0GUIL74.d.ts.map +1 -0
- package/dist/stack-iW9HuGLg.js +112 -0
- package/dist/stack-iW9HuGLg.js.map +1 -0
- package/dist/styles-css.d.ts +2 -0
- package/dist/styles-css.js +4 -0
- package/dist/styles.css +28 -0
- package/dist/textInput-udxyGbm1.js +321 -0
- package/dist/textInput-udxyGbm1.js.map +1 -0
- package/dist/theme.d.ts +240 -459
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +55 -870
- package/dist/theme.js.map +1 -1
- package/dist/toast.d.ts +73 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +297 -0
- package/dist/toast.js.map +1 -0
- package/dist/tooltip.d.ts +88 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +447 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/useClickOutsideEvent-lEVhDFCQ.js +36 -0
- package/dist/useClickOutsideEvent-lEVhDFCQ.js.map +1 -0
- package/dist/useElementSize-BJvbGHq8.js +51 -0
- package/dist/useElementSize-BJvbGHq8.js.map +1 -0
- package/dist/useLayer-BAVfmbNN.js +712 -0
- package/dist/useLayer-BAVfmbNN.js.map +1 -0
- package/package.json +73 -208
- package/dist/_chunks-cjs/refractor.cjs +0 -22
- package/dist/_chunks-cjs/refractor.cjs.map +0 -1
- package/dist/_chunks-es/refractor.js +0 -25
- package/dist/_chunks-es/refractor.js.map +0 -1
- package/dist/css/index.cjs +0 -966
- package/dist/css/index.cjs.map +0 -1
- package/dist/css/index.css +0 -23387
- package/dist/css/index.css.map +0 -1
- package/dist/css/index.d.cts +0 -1394
- package/dist/css/index.d.ts +0 -1394
- package/dist/css/index.js +0 -967
- package/dist/css/index.js.map +0 -1
- 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/exports/css.ts +0 -1
- package/exports/index.ts +0 -1
- package/exports/theme.ts +0 -1
- package/src/core/Root.tsx +0 -88
- package/src/core/RootProvider.tsx +0 -40
- package/src/core/__workshop__/boundary.tsx +0 -28
- package/src/core/__workshop__/index.ts +0 -16
- package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -131
- package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -91
- package/src/core/components/autocomplete/__workshop__/example.tsx +0 -80
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -292
- package/src/core/components/autocomplete/__workshop__/index.ts +0 -41
- package/src/core/components/autocomplete/__workshop__/mock/apiStore.ts +0 -49
- package/src/core/components/autocomplete/__workshop__/mock/countries.ts +0 -245
- package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
- package/src/core/components/autocomplete/autocomplete.tsx +0 -690
- package/src/core/components/autocomplete/autocompleteOption.tsx +0 -45
- package/src/core/components/autocomplete/autocompleteReducer.ts +0 -47
- package/src/core/components/autocomplete/constants.ts +0 -28
- package/src/core/components/autocomplete/types.ts +0 -103
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -61
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -16
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +0 -131
- package/src/core/components/dialog/__workshop__/activate.tsx +0 -141
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
- package/src/core/components/dialog/__workshop__/index.ts +0 -21
- package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
- package/src/core/components/dialog/__workshop__/nested.tsx +0 -71
- package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -51
- package/src/core/components/dialog/__workshop__/panes.tsx +0 -89
- package/src/core/components/dialog/__workshop__/position.tsx +0 -30
- package/src/core/components/dialog/__workshop__/props.tsx +0 -77
- package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
- package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
- package/src/core/components/dialog/dialog.tsx +0 -232
- package/src/core/components/dialog/dialogCard.tsx +0 -233
- package/src/core/components/dialog/dialogContext.ts +0 -21
- package/src/core/components/dialog/dialogProvider.tsx +0 -34
- package/src/core/components/dialog/isTargetWithinScope.ts +0 -14
- package/src/core/components/dialog/types.ts +0 -2
- package/src/core/components/dialog/useDialog.ts +0 -11
- package/src/core/components/hotkeys/__workshop__/index.ts +0 -16
- package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
- package/src/core/components/hotkeys/hotkeys.tsx +0 -60
- package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -57
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -47
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -133
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -35
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
- package/src/core/components/menu/__workshop__/groups.tsx +0 -156
- package/src/core/components/menu/__workshop__/index.ts +0 -91
- package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -50
- package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -42
- package/src/core/components/menu/__workshop__/tones.tsx +0 -25
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
- package/src/core/components/menu/helpers.ts +0 -82
- package/src/core/components/menu/menu.test.tsx +0 -129
- package/src/core/components/menu/menu.tsx +0 -179
- package/src/core/components/menu/menuButton.tsx +0 -225
- package/src/core/components/menu/menuContext.ts +0 -19
- package/src/core/components/menu/menuDivider.tsx +0 -32
- package/src/core/components/menu/menuGroup.tsx +0 -233
- package/src/core/components/menu/menuItem.tsx +0 -184
- package/src/core/components/menu/useMenu.ts +0 -21
- package/src/core/components/menu/useMenuController.ts +0 -241
- package/src/core/components/tab/__workshop__/example.tsx +0 -79
- package/src/core/components/tab/__workshop__/index.ts +0 -16
- package/src/core/components/tab/tab.tsx +0 -109
- package/src/core/components/tab/tabList.tsx +0 -90
- package/src/core/components/tab/tabPanel.tsx +0 -47
- package/src/core/components/toast/__workshop__/hook.tsx +0 -71
- package/src/core/components/toast/__workshop__/index.ts +0 -21
- package/src/core/components/toast/__workshop__/toast.tsx +0 -26
- package/src/core/components/toast/toast.test.tsx +0 -103
- package/src/core/components/toast/toast.tsx +0 -191
- package/src/core/components/toast/toastContext.ts +0 -7
- package/src/core/components/toast/toastLayer.tsx +0 -54
- package/src/core/components/toast/toastProvider.tsx +0 -112
- package/src/core/components/toast/toastState.ts +0 -6
- package/src/core/components/toast/types.ts +0 -24
- package/src/core/components/toast/useToast.ts +0 -23
- package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
- package/src/core/components/tree/__workshop__/basic.tsx +0 -105
- package/src/core/components/tree/__workshop__/index.ts +0 -23
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
- package/src/core/components/tree/helpers.ts +0 -105
- package/src/core/components/tree/tree.tsx +0 -248
- package/src/core/components/tree/treeContext.ts +0 -10
- package/src/core/components/tree/treeGroup.tsx +0 -46
- package/src/core/components/tree/treeItem.tsx +0 -237
- package/src/core/components/tree/types.ts +0 -24
- package/src/core/components/tree/useTree.ts +0 -17
- package/src/core/components/virtualList/__workshop__/changingProps.tsx +0 -36
- package/src/core/components/virtualList/__workshop__/elementScroll.tsx +0 -24
- package/src/core/components/virtualList/__workshop__/index.ts +0 -31
- package/src/core/components/virtualList/__workshop__/infiniteList.tsx +0 -48
- package/src/core/components/virtualList/__workshop__/windowScrolll.tsx +0 -22
- package/src/core/components/virtualList/virtualList.tsx +0 -209
- package/src/core/constants.ts +0 -67
- package/src/core/helpers/animation.ts +0 -27
- package/src/core/helpers/element.ts +0 -55
- package/src/core/helpers/focus.ts +0 -92
- package/src/core/helpers/props.ts +0 -28
- package/src/core/helpers/scroll.ts +0 -15
- package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -114
- package/src/core/hooks/useClickOutsideEvent.ts +0 -67
- package/src/core/hooks/useCustomValidity.ts +0 -13
- package/src/core/hooks/useDelayed.test.ts +0 -67
- package/src/core/hooks/useDelayedState.ts +0 -28
- package/src/core/hooks/useElementSize.ts +0 -19
- package/src/core/hooks/useGlobalKeyDown.ts +0 -17
- package/src/core/hooks/useMatchMedia.ts +0 -28
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -16
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -21
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +0 -107
- package/src/core/hooks/useMounted.ts +0 -15
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +0 -56
- package/src/core/hooks/usePrefersDark.test.tsx +0 -20
- package/src/core/hooks/usePrefersDark.ts +0 -16
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +0 -20
- package/src/core/hooks/usePrefersReducedMotion.ts +0 -16
- package/src/core/hooks/useResponsiveProp.ts +0 -28
- package/src/core/index.ts +0 -115
- package/src/core/lib/createGlobalScopedContext.ts +0 -37
- package/src/core/lib/globalScope.ts +0 -19
- package/src/core/lib/isArray.ts +0 -3
- package/src/core/lib/isRecord.ts +0 -3
- package/src/core/middleware/origin.ts +0 -47
- package/src/core/observers/elementSize.ts +0 -116
- package/src/core/observers/resize.ts +0 -9
- package/src/core/primitives/arrow/arrow.tsx +0 -74
- package/src/core/primitives/arrow/cmds.ts +0 -91
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
- package/src/core/primitives/avatar/__workshop__/index.ts +0 -31
- package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -55
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -72
- package/src/core/primitives/avatar/avatar.tsx +0 -147
- package/src/core/primitives/avatar/avatarCounter.tsx +0 -69
- package/src/core/primitives/avatar/avatarStack.tsx +0 -79
- package/src/core/primitives/avatar/types.ts +0 -2
- package/src/core/primitives/badge/__workshop__/index.ts +0 -21
- package/src/core/primitives/badge/__workshop__/props.tsx +0 -19
- package/src/core/primitives/badge/__workshop__/tones.tsx +0 -16
- package/src/core/primitives/badge/badge.test.tsx +0 -16
- package/src/core/primitives/badge/badge.tsx +0 -61
- package/src/core/primitives/box/__workshop__/index.ts +0 -21
- package/src/core/primitives/box/__workshop__/props.tsx +0 -20
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
- package/src/core/primitives/box/box.tsx +0 -222
- package/src/core/primitives/button/__workshop__/custom.tsx +0 -27
- package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
- package/src/core/primitives/button/__workshop__/disabled.tsx +0 -54
- package/src/core/primitives/button/__workshop__/index.ts +0 -66
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
- package/src/core/primitives/button/__workshop__/props.tsx +0 -55
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +0 -13
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -29
- package/src/core/primitives/button/button.test.tsx +0 -30
- package/src/core/primitives/button/button.tsx +0 -193
- package/src/core/primitives/button/types.ts +0 -2
- package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
- package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
- package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
- package/src/core/primitives/card/__workshop__/index.ts +0 -20
- package/src/core/primitives/card/__workshop__/interactive.tsx +0 -29
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -78
- package/src/core/primitives/card/__workshop__/props.tsx +0 -52
- package/src/core/primitives/card/__workshop__/selected.tsx +0 -62
- package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
- package/src/core/primitives/card/__workshop__/tones.tsx +0 -27
- package/src/core/primitives/card/card.tsx +0 -109
- package/src/core/primitives/card/cardContext.ts +0 -10
- package/src/core/primitives/card/cardProvider.tsx +0 -27
- package/src/core/primitives/card/types.ts +0 -17
- package/src/core/primitives/card/useCard.ts +0 -15
- package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
- package/src/core/primitives/checkbox/__workshop__/index.ts +0 -15
- package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -35
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -27
- package/src/core/primitives/checkbox/checkbox.tsx +0 -80
- package/src/core/primitives/code/__workshop__/index.ts +0 -21
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -23
- package/src/core/primitives/code/__workshop__/props.tsx +0 -18
- package/src/core/primitives/code/code.tsx +0 -48
- package/src/core/primitives/code/refractor.tsx +0 -18
- package/src/core/primitives/container/__workshop__/example.tsx +0 -20
- package/src/core/primitives/container/__workshop__/index.ts +0 -10
- package/src/core/primitives/container/container.tsx +0 -37
- package/src/core/primitives/container/types.ts +0 -6
- package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
- package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
- package/src/core/primitives/flex/__workshop__/index.ts +0 -13
- package/src/core/primitives/flex/flex.tsx +0 -58
- package/src/core/primitives/grid/__workshop__/index.ts +0 -12
- package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
- package/src/core/primitives/grid/grid.tsx +0 -35
- package/src/core/primitives/heading/__workshop__/index.ts +0 -21
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/heading/__workshop__/plain.tsx +0 -29
- package/src/core/primitives/heading/heading.tsx +0 -78
- package/src/core/primitives/inline/__workshop__/index.ts +0 -10
- package/src/core/primitives/inline/__workshop__/plain.tsx +0 -24
- package/src/core/primitives/inline/inline.tsx +0 -62
- package/src/core/primitives/kbd/__workshop__/index.ts +0 -10
- package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
- package/src/core/primitives/kbd/kbd.tsx +0 -57
- package/src/core/primitives/label/__workshop__/index.ts +0 -21
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -54
- package/src/core/primitives/label/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/label/label.tsx +0 -75
- package/src/core/primitives/layer/__workshop__/_debug.tsx +0 -17
- package/src/core/primitives/layer/__workshop__/index.ts +0 -26
- package/src/core/primitives/layer/__workshop__/multipleRoots.tsx +0 -49
- package/src/core/primitives/layer/__workshop__/nested.tsx +0 -98
- package/src/core/primitives/layer/__workshop__/responsiveZOffset.tsx +0 -17
- package/src/core/primitives/layer/getLayerContext.test.ts +0 -32
- package/src/core/primitives/layer/getLayerContext.ts +0 -21
- package/src/core/primitives/layer/layer.test.tsx +0 -110
- package/src/core/primitives/layer/layer.tsx +0 -42
- package/src/core/primitives/layer/layerCard.tsx +0 -90
- package/src/core/primitives/layer/layerContext.ts +0 -7
- package/src/core/primitives/layer/layerProvider.tsx +0 -106
- package/src/core/primitives/layer/types.ts +0 -9
- package/src/core/primitives/layer/useLayer.ts +0 -24
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -69
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -96
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -100
- package/src/core/primitives/popover/__workshop__/index.ts +0 -51
- package/src/core/primitives/popover/constants.ts +0 -22
- package/src/core/primitives/popover/floating-ui/size.ts +0 -83
- package/src/core/primitives/popover/helpers.ts +0 -32
- package/src/core/primitives/popover/popover.tsx +0 -443
- package/src/core/primitives/popover/popoverLayer.tsx +0 -149
- package/src/core/primitives/popover/types.ts +0 -12
- package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
- package/src/core/primitives/radio/__workshop__/index.ts +0 -13
- package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
- package/src/core/primitives/radio/radio.tsx +0 -64
- package/src/core/primitives/select/__workshop__/index.ts +0 -13
- package/src/core/primitives/select/__workshop__/plain.tsx +0 -39
- package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
- package/src/core/primitives/select/select.tsx +0 -75
- package/src/core/primitives/selectable/selectable.tsx +0 -50
- package/src/core/primitives/skeleton/__workshop__/delay.tsx +0 -70
- package/src/core/primitives/skeleton/__workshop__/index.ts +0 -13
- package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +0 -64
- package/src/core/primitives/skeleton/codeSkeleton.tsx +0 -49
- package/src/core/primitives/skeleton/headingSkeleton.tsx +0 -48
- package/src/core/primitives/skeleton/labelSkeleton.tsx +0 -47
- package/src/core/primitives/skeleton/skeleton.tsx +0 -70
- package/src/core/primitives/skeleton/textSkeleton.tsx +0 -49
- package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
- package/src/core/primitives/spinner/__workshop__/index.ts +0 -16
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +0 -14
- package/src/core/primitives/spinner/spinner.tsx +0 -45
- package/src/core/primitives/srOnly/srOnly.tsx +0 -33
- package/src/core/primitives/stack/__workshop__/index.ts +0 -16
- package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
- package/src/core/primitives/stack/stack.tsx +0 -60
- package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
- package/src/core/primitives/switch/__workshop__/index.ts +0 -13
- package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
- package/src/core/primitives/switch/switch.tsx +0 -84
- package/src/core/primitives/text/__workshop__/colored.tsx +0 -23
- package/src/core/primitives/text/__workshop__/example.tsx +0 -28
- package/src/core/primitives/text/__workshop__/index.ts +0 -26
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -23
- package/src/core/primitives/text/text.tsx +0 -76
- package/src/core/primitives/textArea/__workshop__/index.ts +0 -16
- package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -61
- package/src/core/primitives/textArea/textArea.tsx +0 -84
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
- package/src/core/primitives/textInput/__workshop__/index.ts +0 -46
- package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -110
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
- package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
- package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
- package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
- package/src/core/primitives/textInput/textInput.tsx +0 -258
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
- package/src/core/primitives/tooltip/__workshop__/index.ts +0 -31
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
- package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -112
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
- package/src/core/primitives/tooltip/constants.ts +0 -23
- package/src/core/primitives/tooltip/tooltip.test.tsx +0 -452
- package/src/core/primitives/tooltip/tooltip.tsx +0 -482
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -13
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -55
- package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +0 -10
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
- package/src/core/primitives/tooltip/tooltipLayer.tsx +0 -106
- package/src/core/types.ts +0 -56
- package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -16
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -102
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +0 -10
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -18
- package/src/core/utils/boundaryElement/types.ts +0 -5
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +0 -24
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -41
- package/src/core/utils/elementQuery/__workshop__/index.ts +0 -16
- package/src/core/utils/elementQuery/elementQuery.tsx +0 -75
- package/src/core/utils/elementQuery/helpers.ts +0 -27
- package/src/core/utils/errorBoundary.tsx +0 -50
- package/src/core/utils/getElementRef.ts +0 -29
- package/src/core/utils/portal/__workshop__/index.ts +0 -16
- package/src/core/utils/portal/__workshop__/named.tsx +0 -63
- package/src/core/utils/portal/portal.test.tsx +0 -105
- package/src/core/utils/portal/portal.tsx +0 -36
- package/src/core/utils/portal/portalContext.ts +0 -37
- package/src/core/utils/portal/portalProvider.tsx +0 -70
- package/src/core/utils/portal/types.ts +0 -7
- package/src/core/utils/portal/usePortal.ts +0 -23
- package/src/css/_assign.ts +0 -3
- package/src/css/_composeClassNames.ts +0 -12
- package/src/css/_fromEntries.ts +0 -3
- package/src/css/_getClassNames.ts +0 -9
- package/src/css/_responsiveClassName.ts +0 -45
- package/src/css/_responsiveStyle.css.ts +0 -34
- package/src/css/_style.css.ts +0 -9
- package/src/css/components/breadcrumbs/breadcrumbs.css.ts +0 -6
- package/src/css/components/breadcrumbs/breadcrumbs.ts +0 -7
- package/src/css/components/dialog/dialog.css.ts +0 -98
- package/src/css/components/dialog/dialog.ts +0 -58
- package/src/css/components/menu/menu.css.ts +0 -14
- package/src/css/components/menu/menu.ts +0 -12
- package/src/css/components/skeleton/skeleton.css.ts +0 -128
- package/src/css/components/skeleton/skeleton.ts +0 -38
- package/src/css/components/skeleton/types.ts +0 -36
- package/src/css/components/toast/toast.css.ts +0 -17
- package/src/css/components/toast/toast.ts +0 -11
- package/src/css/components/tree/tree.css.ts +0 -65
- package/src/css/components/tree/tree.ts +0 -7
- package/src/css/constants.ts +0 -10
- package/src/css/getVarName.ts +0 -27
- package/src/css/index.ts +0 -146
- package/src/css/layers.css.ts +0 -12
- package/src/css/primitives/_arrow/_arrow.css.ts +0 -68
- package/src/css/primitives/_arrow/_arrow.ts +0 -26
- package/src/css/primitives/_input/_input.css.ts +0 -261
- package/src/css/primitives/_input/input.ts +0 -29
- package/src/css/primitives/_input/types.ts +0 -13
- package/src/css/primitives/avatar/avatar.css.ts +0 -201
- package/src/css/primitives/avatar/avatar.ts +0 -68
- package/src/css/primitives/avatar/types.ts +0 -10
- package/src/css/primitives/badge/badge.css.ts +0 -27
- package/src/css/primitives/badge/badge.ts +0 -8
- package/src/css/primitives/badge/types.ts +0 -13
- package/src/css/primitives/box/box.css.ts +0 -19
- package/src/css/primitives/box/box.ts +0 -82
- package/src/css/primitives/box/types.ts +0 -75
- package/src/css/primitives/button/button.css.ts +0 -287
- package/src/css/primitives/button/button.ts +0 -26
- package/src/css/primitives/button/types.ts +0 -12
- package/src/css/primitives/card/__workshop__/color.tsx +0 -75
- package/src/css/primitives/card/__workshop__/index.ts +0 -16
- package/src/css/primitives/card/card.css.ts +0 -387
- package/src/css/primitives/card/card.ts +0 -13
- package/src/css/primitives/card/types.ts +0 -9
- package/src/css/primitives/checkbox/checkbox.css.ts +0 -193
- package/src/css/primitives/checkbox/checkbox.ts +0 -17
- package/src/css/primitives/code/code.css.ts +0 -272
- package/src/css/primitives/code/code.ts +0 -19
- package/src/css/primitives/code/types.ts +0 -11
- package/src/css/primitives/container/container.css.ts +0 -4
- package/src/css/primitives/container/container.ts +0 -17
- package/src/css/primitives/container/types.ts +0 -9
- package/src/css/primitives/heading/heading.css.ts +0 -86
- package/src/css/primitives/heading/heading.ts +0 -22
- package/src/css/primitives/heading/types.ts +0 -14
- package/src/css/primitives/kbd/kbd.css.ts +0 -16
- package/src/css/primitives/kbd/kbd.ts +0 -9
- package/src/css/primitives/kbd/types.ts +0 -6
- package/src/css/primitives/label/label.css.ts +0 -87
- package/src/css/primitives/label/label.ts +0 -22
- package/src/css/primitives/label/types.ts +0 -14
- package/src/css/primitives/popover/popover.css.ts +0 -6
- package/src/css/primitives/popover/popover.ts +0 -12
- package/src/css/primitives/radio/radio.css.ts +0 -78
- package/src/css/primitives/radio/radio.ts +0 -17
- package/src/css/primitives/root/root.css.ts +0 -19
- package/src/css/primitives/root/root.ts +0 -17
- package/src/css/primitives/root/types.ts +0 -10
- package/src/css/primitives/select/select.css.ts +0 -24
- package/src/css/primitives/select/select.ts +0 -14
- package/src/css/primitives/select/types.ts +0 -5
- package/src/css/primitives/selectable/selectable.css.ts +0 -131
- package/src/css/primitives/selectable/selectable.ts +0 -9
- package/src/css/primitives/selectable/types.ts +0 -9
- package/src/css/primitives/spinner/spinner.css.ts +0 -19
- package/src/css/primitives/spinner/spinner.ts +0 -13
- package/src/css/primitives/spinner/types.ts +0 -4
- package/src/css/primitives/srOnly/srOnly.css.ts +0 -10
- package/src/css/primitives/srOnly/srOnly.ts +0 -7
- package/src/css/primitives/stack/stack.css.ts +0 -6
- package/src/css/primitives/stack/stack.ts +0 -7
- package/src/css/primitives/switch/switch.css.ts +0 -98
- package/src/css/primitives/switch/switch.ts +0 -27
- package/src/css/primitives/text/text.css.ts +0 -86
- package/src/css/primitives/text/text.ts +0 -24
- package/src/css/primitives/text/types.ts +0 -18
- package/src/css/primitives/textArea/textArea.css.ts +0 -4
- package/src/css/primitives/textArea/textArea.ts +0 -9
- package/src/css/primitives/textArea/types.ts +0 -7
- package/src/css/primitives/textInput/textInput.css.ts +0 -43
- package/src/css/primitives/textInput/textInput.ts +0 -24
- package/src/css/primitives/textInput/types.ts +0 -7
- package/src/css/primitives/tooltip/tooltip.css.ts +0 -4
- package/src/css/primitives/tooltip/tooltip.ts +0 -8
- package/src/css/primitives/tooltip/types.ts +0 -4
- package/src/css/props/alignItems/alignItems.css.ts +0 -22
- package/src/css/props/alignItems/alignItems.ts +0 -8
- package/src/css/props/alignItems/types.ts +0 -9
- package/src/css/props/border/border.css.ts +0 -65
- package/src/css/props/border/border.ts +0 -21
- package/src/css/props/border/types.ts +0 -13
- package/src/css/props/boxSizing/boxSizing.css.ts +0 -12
- package/src/css/props/boxSizing/boxSizing.ts +0 -7
- package/src/css/props/boxSizing/types.ts +0 -7
- package/src/css/props/display/display.css.ts +0 -56
- package/src/css/props/display/display.ts +0 -8
- package/src/css/props/display/types.ts +0 -16
- package/src/css/props/flex/flex.css.ts +0 -52
- package/src/css/props/flex/flex.ts +0 -8
- package/src/css/props/flex/types.ts +0 -9
- package/src/css/props/flexDirection/flexDirection.css.ts +0 -19
- package/src/css/props/flexDirection/flexDirection.ts +0 -8
- package/src/css/props/flexDirection/types.ts +0 -9
- package/src/css/props/flexWrap/flexWrap.css.ts +0 -16
- package/src/css/props/flexWrap/flexWrap.ts +0 -8
- package/src/css/props/flexWrap/types.ts +0 -9
- package/src/css/props/font/font.css.ts +0 -94
- package/src/css/props/font/font.ts +0 -8
- package/src/css/props/font/types.ts +0 -6
- package/src/css/props/gap/gap.css.ts +0 -40
- package/src/css/props/gap/gap.ts +0 -13
- package/src/css/props/gap/types.ts +0 -10
- package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +0 -19
- package/src/css/props/gridAutoColumns/gridAutoColumns.ts +0 -8
- package/src/css/props/gridAutoColumns/types.ts +0 -9
- package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +0 -19
- package/src/css/props/gridAutoFlow/gridAutoFlow.ts +0 -8
- package/src/css/props/gridAutoFlow/types.ts +0 -9
- package/src/css/props/gridAutoRows/gridAutoRows.css.ts +0 -19
- package/src/css/props/gridAutoRows/gridAutoRows.ts +0 -8
- package/src/css/props/gridAutoRows/types.ts +0 -9
- package/src/css/props/gridColumn/gridColumn.css.ts +0 -49
- package/src/css/props/gridColumn/gridColumn.ts +0 -8
- package/src/css/props/gridColumn/types.ts +0 -9
- package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +0 -46
- package/src/css/props/gridColumnEnd/gridColumnEnd.ts +0 -8
- package/src/css/props/gridColumnEnd/types.ts +0 -9
- package/src/css/props/gridColumnStart/gridColumnStart.css.ts +0 -46
- package/src/css/props/gridColumnStart/gridColumnStart.ts +0 -8
- package/src/css/props/gridColumnStart/types.ts +0 -9
- package/src/css/props/gridRow/gridRow.css.ts +0 -49
- package/src/css/props/gridRow/gridRow.ts +0 -8
- package/src/css/props/gridRow/types.ts +0 -9
- package/src/css/props/gridRowEnd/gridRowEnd.css.ts +0 -46
- package/src/css/props/gridRowEnd/gridRowEnd.ts +0 -8
- package/src/css/props/gridRowEnd/types.ts +0 -9
- package/src/css/props/gridRowStart/gridRowStart.css.ts +0 -46
- package/src/css/props/gridRowStart/gridRowStart.ts +0 -8
- package/src/css/props/gridRowStart/types.ts +0 -9
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +0 -43
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +0 -8
- package/src/css/props/gridTemplateColumns/types.ts +0 -9
- package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +0 -43
- package/src/css/props/gridTemplateRows/gridTemplateRows.ts +0 -8
- package/src/css/props/gridTemplateRows/types.ts +0 -9
- package/src/css/props/height/height.css.ts +0 -25
- package/src/css/props/height/height.ts +0 -8
- package/src/css/props/height/types.ts +0 -9
- package/src/css/props/inset/inset.css.ts +0 -37
- package/src/css/props/inset/inset.ts +0 -21
- package/src/css/props/inset/types.ts +0 -13
- package/src/css/props/justifyContent/justifyContent.css.ts +0 -25
- package/src/css/props/justifyContent/justifyContent.ts +0 -8
- package/src/css/props/justifyContent/types.ts +0 -15
- package/src/css/props/margin/margin.css.ts +0 -117
- package/src/css/props/margin/margin.ts +0 -25
- package/src/css/props/margin/types.ts +0 -17
- package/src/css/props/maxWidth/maxWidth.css.ts +0 -32
- package/src/css/props/maxWidth/maxWidth.ts +0 -8
- package/src/css/props/maxWidth/types.ts +0 -11
- package/src/css/props/minHeight/minHeight.css.ts +0 -13
- package/src/css/props/minHeight/minHeight.ts +0 -8
- package/src/css/props/minHeight/types.ts +0 -9
- package/src/css/props/minWidth/minWidth.css.ts +0 -25
- package/src/css/props/minWidth/minWidth.ts +0 -8
- package/src/css/props/minWidth/types.ts +0 -9
- package/src/css/props/outline/outline.css.ts +0 -10
- package/src/css/props/outline/outline.ts +0 -8
- package/src/css/props/outline/types.ts +0 -7
- package/src/css/props/overflow/overflow.css.ts +0 -16
- package/src/css/props/overflow/overflow.ts +0 -8
- package/src/css/props/overflow/types.ts +0 -11
- package/src/css/props/padding/padding.css.ts +0 -87
- package/src/css/props/padding/padding.ts +0 -25
- package/src/css/props/padding/types.ts +0 -17
- package/src/css/props/pointerEvents/pointerEvents.css.ts +0 -13
- package/src/css/props/pointerEvents/pointerEvents.ts +0 -8
- package/src/css/props/pointerEvents/types.ts +0 -7
- package/src/css/props/position/position.css.ts +0 -22
- package/src/css/props/position/position.ts +0 -8
- package/src/css/props/position/types.ts +0 -9
- package/src/css/props/radius/radius.css.ts +0 -21
- package/src/css/props/radius/radius.ts +0 -8
- package/src/css/props/radius/types.ts +0 -8
- package/src/css/props/shadow/shadow.css.ts +0 -23
- package/src/css/props/shadow/shadow.ts +0 -8
- package/src/css/props/shadow/types.ts +0 -8
- package/src/css/props/textAlign/textAlign.css.ts +0 -22
- package/src/css/props/textAlign/textAlign.ts +0 -8
- package/src/css/props/textAlign/types.ts +0 -7
- package/src/css/props/textOverflow/textOverflow.css.ts +0 -19
- package/src/css/props/textOverflow/textOverflow.ts +0 -8
- package/src/css/props/textOverflow/types.ts +0 -12
- package/src/css/props/width/types.ts +0 -11
- package/src/css/props/width/width.css.ts +0 -31
- package/src/css/props/width/width.ts +0 -8
- package/src/css/theme/buildCSSTheme.ts +0 -488
- package/src/css/theme/defaultTheme.css.ts +0 -64
- package/src/css/types.ts +0 -427
- package/src/css/vars.css.ts +0 -676
- package/src/theme/_parseColorToken.ts +0 -180
- package/src/theme/buildTheme.ts +0 -32
- package/src/theme/constants.ts +0 -90
- package/src/theme/defaults/color.ts +0 -197
- package/src/theme/defaults/common.ts +0 -71
- package/src/theme/defaults/fonts.ts +0 -250
- package/src/theme/index.ts +0 -5
- package/src/theme/merge.ts +0 -24
- package/src/theme/resolveTokens.ts +0 -204
- package/src/theme/types.ts +0 -366
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { c as POPOVER_MOTION_PROPS, n as _getArrayProp } from "./helpers-bwfx1e-Y.js";
|
|
2
|
+
import { _ as useTheme_v2, i as usePrefersReducedMotion, n as LayerProvider, o as useMediaIndex, s as Card, t as useLayer } from "./useLayer-BAVfmbNN.js";
|
|
3
|
+
import { t as Flex } from "./flex-C-5JHi1C.js";
|
|
4
|
+
import { t as useElementSize } from "./useElementSize-BJvbGHq8.js";
|
|
5
|
+
import { n as AnimateActivity, r as origin, t as getElementRef } from "./getElementRef-5HZQ-Owu.js";
|
|
6
|
+
import { a as useBoundaryElement, n as Portal, t as Arrow } from "./arrow-CHE8-_G7.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import { Activity, cloneElement, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
9
|
+
import { styled } from "styled-components";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { arrow, autoPlacement, autoUpdate, detectOverflow, flip, hide, offset, shift, useFloating } from "@floating-ui/react-dom";
|
|
12
|
+
import { motion } from "motion/react";
|
|
13
|
+
const DEFAULT_POPOVER_MARGINS = [
|
|
14
|
+
0,
|
|
15
|
+
0,
|
|
16
|
+
0,
|
|
17
|
+
0
|
|
18
|
+
], DEFAULT_FALLBACK_PLACEMENTS = {
|
|
19
|
+
top: [
|
|
20
|
+
"bottom",
|
|
21
|
+
"left",
|
|
22
|
+
"right"
|
|
23
|
+
],
|
|
24
|
+
"top-start": [
|
|
25
|
+
"bottom-start",
|
|
26
|
+
"left-start",
|
|
27
|
+
"right-start"
|
|
28
|
+
],
|
|
29
|
+
"top-end": [
|
|
30
|
+
"bottom-end",
|
|
31
|
+
"left-end",
|
|
32
|
+
"right-end"
|
|
33
|
+
],
|
|
34
|
+
bottom: [
|
|
35
|
+
"top",
|
|
36
|
+
"left",
|
|
37
|
+
"right"
|
|
38
|
+
],
|
|
39
|
+
"bottom-start": [
|
|
40
|
+
"top-start",
|
|
41
|
+
"left-start",
|
|
42
|
+
"right-start"
|
|
43
|
+
],
|
|
44
|
+
"bottom-end": [
|
|
45
|
+
"top-end",
|
|
46
|
+
"left-end",
|
|
47
|
+
"right-end"
|
|
48
|
+
],
|
|
49
|
+
left: [
|
|
50
|
+
"right",
|
|
51
|
+
"top",
|
|
52
|
+
"bottom"
|
|
53
|
+
],
|
|
54
|
+
"left-start": [
|
|
55
|
+
"right-start",
|
|
56
|
+
"top-start",
|
|
57
|
+
"bottom-start"
|
|
58
|
+
],
|
|
59
|
+
"left-end": [
|
|
60
|
+
"right-end",
|
|
61
|
+
"top-end",
|
|
62
|
+
"bottom-end"
|
|
63
|
+
],
|
|
64
|
+
right: [
|
|
65
|
+
"left",
|
|
66
|
+
"top",
|
|
67
|
+
"bottom"
|
|
68
|
+
],
|
|
69
|
+
"right-start": [
|
|
70
|
+
"left-start",
|
|
71
|
+
"top-start",
|
|
72
|
+
"bottom-start"
|
|
73
|
+
],
|
|
74
|
+
"right-end": [
|
|
75
|
+
"left-end",
|
|
76
|
+
"top-end",
|
|
77
|
+
"bottom-end"
|
|
78
|
+
]
|
|
79
|
+
};
|
|
80
|
+
function size(options) {
|
|
81
|
+
let { constrainSize, margins, matchReferenceWidth, maxWidthRef, padding = 0, referenceWidthRef, setReferenceWidth, widthRef } = options;
|
|
82
|
+
return {
|
|
83
|
+
name: "@sanity/ui/size",
|
|
84
|
+
async fn(args) {
|
|
85
|
+
let { elements, placement, platform, rects } = args, { floating, reference } = rects, overflow = await detectOverflow(args, {
|
|
86
|
+
altBoundary: !0,
|
|
87
|
+
boundary: options.boundaryElement || void 0,
|
|
88
|
+
elementContext: "floating",
|
|
89
|
+
padding,
|
|
90
|
+
rootBoundary: "viewport"
|
|
91
|
+
}), maxWidth = Infinity, maxHeight = Infinity, floatingW = floating.width, floatingH = floating.height;
|
|
92
|
+
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));
|
|
93
|
+
let availableWidth = maxWidth - margins[1] - margins[3], availableHeight = maxHeight - margins[0] - margins[2], referenceWidth = reference.width - margins[1] - margins[3];
|
|
94
|
+
referenceWidthRef.current = referenceWidth, setReferenceWidth(referenceWidth), matchReferenceWidth ? elements.floating.style.width = `${referenceWidth}px` : widthRef.current !== void 0 && (elements.floating.style.width = `${widthRef.current}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, maxWidthRef.current ?? Infinity)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
|
|
95
|
+
let nextDimensions = await platform.getDimensions(elements.floating), targetH = nextDimensions.height;
|
|
96
|
+
return floatingW !== nextDimensions.width || floatingH !== targetH ? { reset: { rects: !0 } } : {};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function calcCurrentWidth(params) {
|
|
101
|
+
let { container, mediaIndex, width } = params, w = width[mediaIndex], currentWidth = w === void 0 ? width[width.length - 1] : w;
|
|
102
|
+
return typeof currentWidth == "number" ? container[currentWidth] : void 0;
|
|
103
|
+
}
|
|
104
|
+
function calcMaxWidth(params) {
|
|
105
|
+
let { boundaryWidth, currentWidth } = params;
|
|
106
|
+
if (currentWidth !== void 0 || boundaryWidth !== void 0) return Math.min(currentWidth ?? Infinity, (boundaryWidth || Infinity) - 8);
|
|
107
|
+
}
|
|
108
|
+
const MotionCard = styled(motion.create(Card)).withConfig({
|
|
109
|
+
displayName: "MotionCard",
|
|
110
|
+
componentId: "sc-9hcc5m-0"
|
|
111
|
+
})`&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;`, MotionFlex = styled(motion.create(Flex)).withConfig({
|
|
112
|
+
displayName: "MotionFlex",
|
|
113
|
+
componentId: "sc-9hcc5m-1"
|
|
114
|
+
})`will-change:opacity;`;
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
function PopoverCard(props) {
|
|
119
|
+
let $ = c(67), animate, arrow, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, ref, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
|
|
120
|
+
$[0] === props ? (animate = $[1], arrow = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], ref = $[14], restProps = $[15], scheme = $[16], shadow = $[17], strategy = $[18], style = $[19], tone = $[20], width = $[21], xProp = $[22], yProp = $[23]) : ({__unstable_margins: marginsProp, animate, arrow, arrowRef, arrowX, arrowY, children, padding, placement, originX, originY, overflow, radius, ref, scheme, shadow, strategy, style, tone, width, x: xProp, y: yProp, ...restProps} = props, $[0] = props, $[1] = animate, $[2] = arrow, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = ref, $[15] = restProps, $[16] = scheme, $[17] = shadow, $[18] = strategy, $[19] = style, $[20] = tone, $[21] = width, $[22] = xProp, $[23] = yProp);
|
|
121
|
+
let { zIndex } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0, t1;
|
|
122
|
+
$[24] !== originX || $[25] !== originY || $[26] !== strategy || $[27] !== style || $[28] !== t0 || $[29] !== width || $[30] !== x || $[31] !== y || $[32] !== zIndex ? (t1 = {
|
|
123
|
+
left: x,
|
|
124
|
+
originX,
|
|
125
|
+
originY,
|
|
126
|
+
position: strategy,
|
|
127
|
+
top: y,
|
|
128
|
+
width,
|
|
129
|
+
zIndex,
|
|
130
|
+
willChange: t0,
|
|
131
|
+
...style
|
|
132
|
+
}, $[24] = originX, $[25] = originY, $[26] = strategy, $[27] = style, $[28] = t0, $[29] = width, $[30] = x, $[31] = y, $[32] = zIndex, $[33] = t1) : t1 = $[33];
|
|
133
|
+
let rootStyle = t1, t2 = arrowX === null ? void 0 : arrowX, t3 = arrowY === null ? void 0 : arrowY, t4;
|
|
134
|
+
$[34] !== t2 || $[35] !== t3 ? (t4 = {
|
|
135
|
+
left: t2,
|
|
136
|
+
top: t3,
|
|
137
|
+
right: void 0,
|
|
138
|
+
bottom: void 0
|
|
139
|
+
}, $[34] = t2, $[35] = t3, $[36] = t4) : t4 = $[36];
|
|
140
|
+
let arrowStyle = t4, t5;
|
|
141
|
+
$[37] === animate ? t5 = $[38] : (t5 = animate ? ["hidden", "initial"] : void 0, $[37] = animate, $[38] = t5);
|
|
142
|
+
let t6;
|
|
143
|
+
$[39] === animate ? t6 = $[40] : (t6 = animate ? ["visible", "scaleIn"] : void 0, $[39] = animate, $[40] = t6);
|
|
144
|
+
let t7;
|
|
145
|
+
$[41] === animate ? t7 = $[42] : (t7 = animate ? ["hidden", "scaleOut"] : void 0, $[41] = animate, $[42] = t7);
|
|
146
|
+
let t8;
|
|
147
|
+
$[43] !== children || $[44] !== padding ? (t8 = /* @__PURE__ */ jsx(Flex, {
|
|
148
|
+
direction: "column",
|
|
149
|
+
flex: 1,
|
|
150
|
+
padding,
|
|
151
|
+
children
|
|
152
|
+
}), $[43] = children, $[44] = padding, $[45] = t8) : t8 = $[45];
|
|
153
|
+
let t9;
|
|
154
|
+
$[46] !== overflow || $[47] !== t8 ? (t9 = /* @__PURE__ */ jsx(MotionFlex, {
|
|
155
|
+
"data-ui": "Popover__wrapper",
|
|
156
|
+
direction: "column",
|
|
157
|
+
flex: 1,
|
|
158
|
+
overflow,
|
|
159
|
+
variants: POPOVER_MOTION_PROPS.children,
|
|
160
|
+
transition: POPOVER_MOTION_PROPS.transition,
|
|
161
|
+
children: t8
|
|
162
|
+
}), $[46] = overflow, $[47] = t8, $[48] = t9) : t9 = $[48];
|
|
163
|
+
let t10;
|
|
164
|
+
$[49] !== arrow || $[50] !== arrowRef || $[51] !== arrowStyle ? (t10 = arrow && /* @__PURE__ */ jsx(Arrow, {
|
|
165
|
+
ref: arrowRef,
|
|
166
|
+
style: arrowStyle,
|
|
167
|
+
width: 19,
|
|
168
|
+
height: 8,
|
|
169
|
+
radius: 2
|
|
170
|
+
}), $[49] = arrow, $[50] = arrowRef, $[51] = arrowStyle, $[52] = t10) : t10 = $[52];
|
|
171
|
+
let t11;
|
|
172
|
+
return $[53] !== placement || $[54] !== radius || $[55] !== ref || $[56] !== restProps || $[57] !== rootStyle || $[58] !== scheme || $[59] !== shadow || $[60] !== t10 || $[61] !== t5 || $[62] !== t6 || $[63] !== t7 || $[64] !== t9 || $[65] !== tone ? (t11 = /* @__PURE__ */ jsxs(MotionCard, {
|
|
173
|
+
"data-ui": "Popover",
|
|
174
|
+
...restProps,
|
|
175
|
+
"data-placement": placement,
|
|
176
|
+
radius,
|
|
177
|
+
ref,
|
|
178
|
+
scheme,
|
|
179
|
+
shadow,
|
|
180
|
+
sizing: "border",
|
|
181
|
+
style: rootStyle,
|
|
182
|
+
tone,
|
|
183
|
+
variants: POPOVER_MOTION_PROPS.card,
|
|
184
|
+
transition: POPOVER_MOTION_PROPS.transition,
|
|
185
|
+
initial: t5,
|
|
186
|
+
animate: t6,
|
|
187
|
+
exit: t7,
|
|
188
|
+
children: [t9, t10]
|
|
189
|
+
}), $[53] = placement, $[54] = radius, $[55] = ref, $[56] = restProps, $[57] = rootStyle, $[58] = scheme, $[59] = shadow, $[60] = t10, $[61] = t5, $[62] = t6, $[63] = t7, $[64] = t9, $[65] = tone, $[66] = t11) : t11 = $[66], t11;
|
|
190
|
+
}
|
|
191
|
+
const ViewportOverlay = () => {
|
|
192
|
+
let $ = c(2), { zIndex } = useLayer(), t0;
|
|
193
|
+
return $[0] === zIndex ? t0 = $[1] : (t0 = /* @__PURE__ */ jsx("div", { style: {
|
|
194
|
+
height: "100vh",
|
|
195
|
+
inset: 0,
|
|
196
|
+
position: "fixed",
|
|
197
|
+
width: "100vw",
|
|
198
|
+
zIndex
|
|
199
|
+
} }), $[0] = zIndex, $[1] = t0), t0;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* The `Popover` component is used to display some content on top of another.
|
|
203
|
+
*
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
206
|
+
function Popover(props) {
|
|
207
|
+
let $ = c(126), { container, layer } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), _fallbackPlacements, _floatingBoundary, _referenceBoundary, _zOffsetProp, childProp, content, disabled, forwardedRef, matchReferenceWidth, modal, open, paddingProp, portal, referenceElement, restProps, scheme, t0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
|
|
208
|
+
if ($[0] !== props) {
|
|
209
|
+
let { __unstable_margins: t12, animate: t13, arrow: t14, children: t15, constrainSize: t16, content: t17, disabled: t18, fallbackPlacements: t19, matchReferenceWidth: t20, floatingBoundary: t21, modal: t22, onActivate, open: t23, overflow: t24, padding: t25, placement: t26, placementStrategy: t27, portal: t28, preventOverflow: t29, radius: t30, ref: t31, referenceBoundary: t32, referenceElement: t33, scheme: t34, shadow: t35, tone: t36, width: t37, zOffset: t38, updateRef: t39, ...t40 } = props;
|
|
210
|
+
t0 = t12, t1 = t13, t2 = t14, childProp = t15, t3 = t16, content = t17, disabled = t18, _fallbackPlacements = t19, matchReferenceWidth = t20, _floatingBoundary = t21, modal = t22, open = t23, t4 = t24, paddingProp = t25, t5 = t26, t6 = t27, portal = t28, t7 = t29, t8 = t30, forwardedRef = t31, _referenceBoundary = t32, referenceElement = t33, scheme = t34, t9 = t35, t10 = t36, t11 = t37, _zOffsetProp = t38, updateRef = t39, restProps = t40, $[0] = props, $[1] = _fallbackPlacements, $[2] = _floatingBoundary, $[3] = _referenceBoundary, $[4] = _zOffsetProp, $[5] = childProp, $[6] = content, $[7] = disabled, $[8] = forwardedRef, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = paddingProp, $[13] = portal, $[14] = referenceElement, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t10, $[20] = t11, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = updateRef;
|
|
211
|
+
} else _fallbackPlacements = $[1], _floatingBoundary = $[2], _referenceBoundary = $[3], _zOffsetProp = $[4], childProp = $[5], content = $[6], disabled = $[7], forwardedRef = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], paddingProp = $[12], portal = $[13], referenceElement = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t10 = $[19], t11 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], t6 = $[25], t7 = $[26], t8 = $[27], t9 = $[28], updateRef = $[29];
|
|
212
|
+
let margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 !== void 0 && t1, arrowProp = t2 !== void 0 && t2, constrainSize = t3 !== void 0 && t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, placementStrategy = t6 === void 0 ? "flip" : t6, preventOverflow = t7 === void 0 || t7, radiusProp = t8 === void 0 ? 3 : t8, shadowProp = t9 === void 0 ? 3 : t9, tone = t10 === void 0 ? "inherit" : t10, widthProp = t11 === void 0 ? "auto" : t11, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? boundaryElementContext.element, boundaryElement = boundaryElementContext.element ?? floatingBoundary, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = !usePrefersReducedMotion() && _animate, boundarySize = useElementSize(boundaryElement)?.border, t12;
|
|
213
|
+
$[30] === paddingProp ? t12 = $[31] : (t12 = _getArrayProp(paddingProp), $[30] = paddingProp, $[31] = t12);
|
|
214
|
+
let padding = t12, t13;
|
|
215
|
+
$[32] === radiusProp ? t13 = $[33] : (t13 = _getArrayProp(radiusProp), $[32] = radiusProp, $[33] = t13);
|
|
216
|
+
let radius = t13, t14;
|
|
217
|
+
$[34] === shadowProp ? t14 = $[35] : (t14 = _getArrayProp(shadowProp), $[34] = shadowProp, $[35] = t14);
|
|
218
|
+
let shadow = t14, widthArrayProp = _getArrayProp(widthProp), t15;
|
|
219
|
+
$[36] === zOffsetProp ? t15 = $[37] : (t15 = _getArrayProp(zOffsetProp), $[36] = zOffsetProp, $[37] = t15);
|
|
220
|
+
let zOffset = t15, ref = useRef(null), arrowRef = useRef(null), t16;
|
|
221
|
+
$[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[38] = t16) : t16 = $[38], useImperativeHandle(forwardedRef, t16);
|
|
222
|
+
let mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
|
|
223
|
+
container,
|
|
224
|
+
mediaIndex,
|
|
225
|
+
width: widthArrayProp
|
|
226
|
+
}), widthRef = useRef(width), t17, t18;
|
|
227
|
+
$[39] === width ? (t17 = $[40], t18 = $[41]) : (t17 = () => {
|
|
228
|
+
widthRef.current = width;
|
|
229
|
+
}, t18 = [width], $[39] = width, $[40] = t17, $[41] = t18), useEffect(t17, t18);
|
|
230
|
+
let t19;
|
|
231
|
+
$[42] !== boundaryWidth || $[43] !== width ? (t19 = calcMaxWidth({
|
|
232
|
+
boundaryWidth,
|
|
233
|
+
currentWidth: width
|
|
234
|
+
}), $[42] = boundaryWidth, $[43] = width, $[44] = t19) : t19 = $[44];
|
|
235
|
+
let maxWidth = t19, maxWidthRef = useRef(maxWidth), t20, t21;
|
|
236
|
+
$[45] === maxWidth ? (t20 = $[46], t21 = $[47]) : (t20 = () => {
|
|
237
|
+
maxWidthRef.current = maxWidth;
|
|
238
|
+
}, t21 = [maxWidth], $[45] = maxWidth, $[46] = t20, $[47] = t21), useEffect(t20, t21);
|
|
239
|
+
let referenceWidthRef = useRef(void 0), t22, t23;
|
|
240
|
+
$[48] !== matchReferenceWidth || $[49] !== maxWidth || $[50] !== open || $[51] !== width ? (t22 = () => {
|
|
241
|
+
let floatingElement = ref.current;
|
|
242
|
+
if (!open || !floatingElement) return;
|
|
243
|
+
let referenceWidth = referenceWidthRef.current;
|
|
244
|
+
matchReferenceWidth ? referenceWidth !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
|
|
245
|
+
}, t23 = [
|
|
246
|
+
width,
|
|
247
|
+
matchReferenceWidth,
|
|
248
|
+
maxWidth,
|
|
249
|
+
open
|
|
250
|
+
], $[48] = matchReferenceWidth, $[49] = maxWidth, $[50] = open, $[51] = width, $[52] = t22, $[53] = t23) : (t22 = $[52], t23 = $[53]), useEffect(t22, t23);
|
|
251
|
+
let [referenceWidth_0, setReferenceWidth] = useState(void 0), t24;
|
|
252
|
+
$[54] !== animate || $[55] !== arrowProp || $[56] !== constrainSize || $[57] !== fallbackPlacements || $[58] !== floatingBoundary || $[59] !== margins || $[60] !== matchReferenceWidth || $[61] !== placementProp || $[62] !== placementStrategy || $[63] !== preventOverflow || $[64] !== referenceBoundary ? (t24 = {
|
|
253
|
+
animate,
|
|
254
|
+
arrowProp,
|
|
255
|
+
arrowRef,
|
|
256
|
+
constrainSize,
|
|
257
|
+
fallbackPlacements,
|
|
258
|
+
floatingBoundary,
|
|
259
|
+
margins,
|
|
260
|
+
matchReferenceWidth,
|
|
261
|
+
maxWidthRef,
|
|
262
|
+
placementProp,
|
|
263
|
+
placementStrategy,
|
|
264
|
+
preventOverflow,
|
|
265
|
+
referenceBoundary,
|
|
266
|
+
referenceWidthRef,
|
|
267
|
+
rootBoundary: "viewport",
|
|
268
|
+
setReferenceWidth,
|
|
269
|
+
widthRef
|
|
270
|
+
}, $[54] = animate, $[55] = arrowProp, $[56] = constrainSize, $[57] = fallbackPlacements, $[58] = floatingBoundary, $[59] = margins, $[60] = matchReferenceWidth, $[61] = placementProp, $[62] = placementStrategy, $[63] = preventOverflow, $[64] = referenceBoundary, $[65] = t24) : t24 = $[65];
|
|
271
|
+
let middleware = useMiddleware(t24), t25;
|
|
272
|
+
$[66] === referenceElement ? t25 = $[67] : (t25 = referenceElement ? { reference: referenceElement } : void 0, $[66] = referenceElement, $[67] = t25);
|
|
273
|
+
let t26;
|
|
274
|
+
$[68] !== middleware || $[69] !== placementProp || $[70] !== t25 ? (t26 = {
|
|
275
|
+
middleware,
|
|
276
|
+
placement: placementProp,
|
|
277
|
+
whileElementsMounted: autoUpdate,
|
|
278
|
+
elements: t25
|
|
279
|
+
}, $[68] = middleware, $[69] = placementProp, $[70] = t25, $[71] = t26) : t26 = $[71];
|
|
280
|
+
let { x, y, middlewareData, placement, refs, strategy, update } = useFloating(t26), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, t27;
|
|
281
|
+
$[72] === Symbol.for("react.memo_cache_sentinel") ? (t27 = (arrowEl) => {
|
|
282
|
+
arrowRef.current = arrowEl;
|
|
283
|
+
}, $[72] = t27) : t27 = $[72];
|
|
284
|
+
let setArrow = t27, t28;
|
|
285
|
+
$[73] === refs ? t28 = $[74] : (t28 = (node) => {
|
|
286
|
+
ref.current = node, refs.setFloating(node);
|
|
287
|
+
}, $[73] = refs, $[74] = t28);
|
|
288
|
+
let setFloating = t28, t29;
|
|
289
|
+
$[75] === childProp ? t29 = $[76] : (t29 = childProp ? getElementRef(childProp) : null, $[75] = childProp, $[76] = t29);
|
|
290
|
+
let t30;
|
|
291
|
+
$[77] === refs.reference.current ? t30 = $[78] : (t30 = () => refs.reference.current, $[77] = refs.reference.current, $[78] = t30), useImperativeHandle(t29, t30);
|
|
292
|
+
let t31;
|
|
293
|
+
bb0: {
|
|
294
|
+
if (referenceElement) {
|
|
295
|
+
t31 = childProp;
|
|
296
|
+
break bb0;
|
|
297
|
+
}
|
|
298
|
+
if (!childProp) {
|
|
299
|
+
t31 = null;
|
|
300
|
+
break bb0;
|
|
301
|
+
}
|
|
302
|
+
let t32;
|
|
303
|
+
$[79] !== childProp || $[80] !== refs.setReference ? (t32 = cloneElement(childProp, { ref: refs.setReference }), $[79] = childProp, $[80] = refs.setReference, $[81] = t32) : t32 = $[81], t31 = t32;
|
|
304
|
+
}
|
|
305
|
+
let child = t31, t32, t33;
|
|
306
|
+
if ($[82] === update ? (t32 = $[83], t33 = $[84]) : (t32 = () => update, t33 = [update], $[82] = update, $[83] = t32, $[84] = t33), useImperativeHandle(updateRef, t32, t33), disabled) {
|
|
307
|
+
let t34;
|
|
308
|
+
return $[85] === childProp ? t34 = $[86] : (t34 = childProp || /* @__PURE__ */ jsx(Fragment$1, {}), $[85] = childProp, $[86] = t34), t34;
|
|
309
|
+
}
|
|
310
|
+
let t34;
|
|
311
|
+
$[87] === modal ? t34 = $[88] : (t34 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[87] = modal, $[88] = t34);
|
|
312
|
+
let t35 = matchReferenceWidth ? referenceWidth_0 : width, t36;
|
|
313
|
+
$[89] !== animate || $[90] !== arrowProp || $[91] !== arrowX || $[92] !== arrowY || $[93] !== content || $[94] !== margins || $[95] !== originX || $[96] !== originY || $[97] !== overflow || $[98] !== padding || $[99] !== placement || $[100] !== radius || $[101] !== referenceHidden || $[102] !== restProps || $[103] !== scheme || $[104] !== setFloating || $[105] !== shadow || $[106] !== strategy || $[107] !== t35 || $[108] !== tone || $[109] !== x || $[110] !== y ? (t36 = /* @__PURE__ */ jsx(PopoverCard, {
|
|
314
|
+
...restProps,
|
|
315
|
+
__unstable_margins: margins,
|
|
316
|
+
animate,
|
|
317
|
+
arrow: arrowProp,
|
|
318
|
+
arrowRef: setArrow,
|
|
319
|
+
arrowX,
|
|
320
|
+
arrowY,
|
|
321
|
+
hidden: referenceHidden,
|
|
322
|
+
overflow,
|
|
323
|
+
padding,
|
|
324
|
+
placement,
|
|
325
|
+
radius,
|
|
326
|
+
ref: setFloating,
|
|
327
|
+
scheme,
|
|
328
|
+
shadow,
|
|
329
|
+
originX,
|
|
330
|
+
originY,
|
|
331
|
+
strategy,
|
|
332
|
+
tone,
|
|
333
|
+
width: t35,
|
|
334
|
+
x,
|
|
335
|
+
y,
|
|
336
|
+
children: content
|
|
337
|
+
}), $[89] = animate, $[90] = arrowProp, $[91] = arrowX, $[92] = arrowY, $[93] = content, $[94] = margins, $[95] = originX, $[96] = originY, $[97] = overflow, $[98] = padding, $[99] = placement, $[100] = radius, $[101] = referenceHidden, $[102] = restProps, $[103] = scheme, $[104] = setFloating, $[105] = shadow, $[106] = strategy, $[107] = t35, $[108] = tone, $[109] = x, $[110] = y, $[111] = t36) : t36 = $[111];
|
|
338
|
+
let t37;
|
|
339
|
+
$[112] !== t34 || $[113] !== t36 || $[114] !== zOffset ? (t37 = /* @__PURE__ */ jsxs(LayerProvider, {
|
|
340
|
+
zOffset,
|
|
341
|
+
children: [t34, t36]
|
|
342
|
+
}), $[112] = t34, $[113] = t36, $[114] = zOffset, $[115] = t37) : t37 = $[115];
|
|
343
|
+
let popover = t37, t38;
|
|
344
|
+
$[116] !== popover || $[117] !== portal ? (t38 = portal ? /* @__PURE__ */ jsx(Portal, {
|
|
345
|
+
__unstable_name: typeof portal == "string" ? portal : void 0,
|
|
346
|
+
children: popover
|
|
347
|
+
}) : popover, $[116] = popover, $[117] = portal, $[118] = t38) : t38 = $[118];
|
|
348
|
+
let popoverNode = t38, t39;
|
|
349
|
+
$[119] !== animate || $[120] !== open || $[121] !== popoverNode ? (t39 = animate ? /* @__PURE__ */ jsx(AnimateActivity, {
|
|
350
|
+
layoutMode: "default",
|
|
351
|
+
mode: open ? "visible" : "hidden",
|
|
352
|
+
children: popoverNode
|
|
353
|
+
}) : /* @__PURE__ */ jsx(Activity, {
|
|
354
|
+
mode: open ? "visible" : "hidden",
|
|
355
|
+
children: popoverNode
|
|
356
|
+
}), $[119] = animate, $[120] = open, $[121] = popoverNode, $[122] = t39) : t39 = $[122];
|
|
357
|
+
let t40;
|
|
358
|
+
return $[123] !== child || $[124] !== t39 ? (t40 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t39, child] }), $[123] = child, $[124] = t39, $[125] = t40) : t40 = $[125], t40;
|
|
359
|
+
}
|
|
360
|
+
function useMiddleware(t0) {
|
|
361
|
+
let $ = c(42), { animate, arrowProp, arrowRef, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, maxWidthRef, placementProp, placementStrategy, preventOverflow, referenceBoundary, referenceWidthRef, rootBoundary, setReferenceWidth, widthRef } = t0, ret;
|
|
362
|
+
if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== constrainSize || $[4] !== fallbackPlacements || $[5] !== floatingBoundary || $[6] !== margins || $[7] !== matchReferenceWidth || $[8] !== maxWidthRef || $[9] !== placementProp || $[10] !== placementStrategy || $[11] !== preventOverflow || $[12] !== referenceBoundary || $[13] !== referenceWidthRef || $[14] !== rootBoundary || $[15] !== setReferenceWidth || $[16] !== widthRef) {
|
|
363
|
+
if (ret = [], constrainSize || preventOverflow) {
|
|
364
|
+
if (placementStrategy === "autoPlacement") {
|
|
365
|
+
let t1;
|
|
366
|
+
$[18] !== fallbackPlacements || $[19] !== placementProp ? (t1 = autoPlacement({ allowedPlacements: [placementProp].concat(fallbackPlacements) }), $[18] = fallbackPlacements, $[19] = placementProp, $[20] = t1) : t1 = $[20], ret.push(t1);
|
|
367
|
+
} else {
|
|
368
|
+
let t1 = floatingBoundary || void 0, t2;
|
|
369
|
+
$[21] !== fallbackPlacements || $[22] !== rootBoundary || $[23] !== t1 ? (t2 = flip({
|
|
370
|
+
boundary: t1,
|
|
371
|
+
fallbackPlacements,
|
|
372
|
+
padding: 4,
|
|
373
|
+
rootBoundary
|
|
374
|
+
}), $[21] = fallbackPlacements, $[22] = rootBoundary, $[23] = t1, $[24] = t2) : t2 = $[24], ret.push(t2);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
let t1;
|
|
378
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel") ? (t1 = offset({ mainAxis: 4 }), $[25] = t1) : t1 = $[25], ret.push(t1), constrainSize || matchReferenceWidth) {
|
|
379
|
+
let t2 = floatingBoundary || void 0, t3;
|
|
380
|
+
$[26] !== constrainSize || $[27] !== margins || $[28] !== matchReferenceWidth || $[29] !== maxWidthRef || $[30] !== referenceWidthRef || $[31] !== setReferenceWidth || $[32] !== t2 || $[33] !== widthRef ? (t3 = size({
|
|
381
|
+
boundaryElement: t2,
|
|
382
|
+
constrainSize,
|
|
383
|
+
margins,
|
|
384
|
+
matchReferenceWidth,
|
|
385
|
+
maxWidthRef,
|
|
386
|
+
padding: 4,
|
|
387
|
+
referenceWidthRef,
|
|
388
|
+
setReferenceWidth,
|
|
389
|
+
widthRef
|
|
390
|
+
}), $[26] = constrainSize, $[27] = margins, $[28] = matchReferenceWidth, $[29] = maxWidthRef, $[30] = referenceWidthRef, $[31] = setReferenceWidth, $[32] = t2, $[33] = widthRef, $[34] = t3) : t3 = $[34], ret.push(t3);
|
|
391
|
+
}
|
|
392
|
+
if (preventOverflow) {
|
|
393
|
+
let t2 = floatingBoundary || void 0, t3;
|
|
394
|
+
$[35] !== rootBoundary || $[36] !== t2 ? (t3 = shift({
|
|
395
|
+
boundary: t2,
|
|
396
|
+
rootBoundary,
|
|
397
|
+
padding: 4
|
|
398
|
+
}), $[35] = rootBoundary, $[36] = t2, $[37] = t3) : t3 = $[37], ret.push(t3);
|
|
399
|
+
}
|
|
400
|
+
if (arrowProp) {
|
|
401
|
+
let t2;
|
|
402
|
+
$[38] === arrowRef ? t2 = $[39] : (t2 = arrow({
|
|
403
|
+
element: arrowRef,
|
|
404
|
+
padding: 4
|
|
405
|
+
}), $[38] = arrowRef, $[39] = t2), ret.push(t2);
|
|
406
|
+
}
|
|
407
|
+
animate && ret.push(origin);
|
|
408
|
+
let t2 = referenceBoundary || void 0, t3;
|
|
409
|
+
$[40] === t2 ? t3 = $[41] : (t3 = hide({
|
|
410
|
+
boundary: t2,
|
|
411
|
+
padding: 4,
|
|
412
|
+
strategy: "referenceHidden"
|
|
413
|
+
}), $[40] = t2, $[41] = t3), ret.push(t3), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = constrainSize, $[4] = fallbackPlacements, $[5] = floatingBoundary, $[6] = margins, $[7] = matchReferenceWidth, $[8] = maxWidthRef, $[9] = placementProp, $[10] = placementStrategy, $[11] = preventOverflow, $[12] = referenceBoundary, $[13] = referenceWidthRef, $[14] = rootBoundary, $[15] = setReferenceWidth, $[16] = widthRef, $[17] = ret;
|
|
414
|
+
} else ret = $[17];
|
|
415
|
+
return ret;
|
|
416
|
+
}
|
|
417
|
+
export { Popover as t };
|
|
418
|
+
|
|
419
|
+
//# sourceMappingURL=popover-PorX5Jv9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-PorX5Jv9.js","names":["Placement","PopoverMargins","DEFAULT_POPOVER_DISTANCE","DEFAULT_POPOVER_PADDING","DEFAULT_POPOVER_ARROW_WIDTH","DEFAULT_POPOVER_ARROW_HEIGHT","DEFAULT_POPOVER_ARROW_RADIUS","DEFAULT_POPOVER_MARGINS","DEFAULT_FALLBACK_PLACEMENTS","Record","detectOverflow","Middleware","PopoverMargins","size","options","boundaryElement","HTMLElement","constrainSize","margins","matchReferenceWidth","maxWidthRef","React","RefObject","padding","referenceWidthRef","setReferenceWidth","referenceWidth","widthRef","name","fn","args","elements","placement","platform","rects","floating","reference","overflow","altBoundary","boundary","undefined","elementContext","rootBoundary","maxWidth","Infinity","maxHeight","floatingW","width","floatingH","height","includes","left","right","top","bottom","availableWidth","availableHeight","current","style","Math","min","nextDimensions","getDimensions","targetH","targetW","reset","DEFAULT_POPOVER_PADDING","PopoverWidth","calcCurrentWidth","params","mediaIndex","container","width","w","currentWidth","undefined","length","calcMaxWidth","boundaryWidth","Math","min","Infinity","Strategy","motion","React","CSSProperties","useMemo","styled","ThemeColorSchemeKey","POPOVER_MOTION_PROPS","BoxOverflow","CardTone","Placement","PopoverMargins","Radius","Arrow","useLayer","Card","Flex","DEFAULT_POPOVER_ARROW_HEIGHT","DEFAULT_POPOVER_ARROW_RADIUS","DEFAULT_POPOVER_ARROW_WIDTH","DEFAULT_POPOVER_MARGINS","MotionCard","create","MotionFlex","PopoverCard","props","$","_c","animate","arrow","arrowRef","arrowX","arrowY","children","marginsProp","originX","originY","overflow","padding","placement","radius","ref","restProps","scheme","shadow","strategy","style","tone","width","xProp","yProp","__unstable_margins","x","y","zIndex","margins","t0","undefined","t1","left","position","top","willChange","rootStyle","t2","t3","t4","right","bottom","arrowStyle","t5","t6","t7","t8","t9","transition","t10","t11","card","arrow","autoPlacement","autoUpdate","flip","hide","Middleware","offset","RootBoundary","shift","useFloating","Activity","cloneElement","Ref","useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","ThemeColorSchemeKey","useElementSize","useMediaIndex","usePrefersReducedMotion","origin","_getArrayProp","useTheme_v2","BoxOverflow","CardTone","Placement","PopoverMargins","AnimateActivity","useBoundaryElement","getElementRef","LayerProps","LayerProvider","useLayer","Portal","ResponsiveRadiusProps","ResponsiveShadowProps","DEFAULT_FALLBACK_PLACEMENTS","DEFAULT_POPOVER_DISTANCE","DEFAULT_POPOVER_MARGINS","DEFAULT_POPOVER_PADDING","size","calcCurrentWidth","calcMaxWidth","PopoverCard","PopoverUpdateCallback","PopoverWidth","PopoverProps","Omit","__unstable_margins","animate","boundaryElement","children","React","JSX","Element","constrainSize","content","ReactNode","disabled","fallbackPlacements","floatingBoundary","HTMLElement","matchReferenceWidth","modal","open","overflow","padding","placement","placementStrategy","portal","preventOverflow","referenceBoundary","referenceElement","scheme","tone","updateRef","width","ViewportOverlay","$","_c","zIndex","t0","height","inset","position","Popover","props","container","layer","boundaryElementContext","_fallbackPlacements","_floatingBoundary","_referenceBoundary","_zOffsetProp","childProp","forwardedRef","paddingProp","restProps","t1","t10","t11","t2","t3","t4","t5","t6","t7","t8","t9","t12","t13","t14","t15","t16","t17","t18","t19","t20","t21","t22","onActivate","t23","t24","t25","t26","t27","t28","t29","radius","t30","ref","t31","t32","t33","t34","shadow","t35","t36","t37","zOffset","t38","t39","t40","margins","undefined","_animate","arrowProp","placementProp","radiusProp","shadowProp","widthProp","element","zOffsetProp","popover","prefersReducedMotion","boundarySize","border","widthArrayProp","arrowRef","Symbol","for","current","mediaIndex","boundaryWidth","widthRef","currentWidth","maxWidth","maxWidthRef","referenceWidthRef","floatingElement","referenceWidth","style","referenceWidth_0","setReferenceWidth","rootBoundary","middleware","useMiddleware","reference","whileElementsMounted","elements","x","y","middlewareData","refs","strategy","update","referenceHidden","arrowX","arrowY","originX","originY","arrowEl","setArrow","node","setFloating","bb0","setReference","child","popoverNode","ret","allowedPlacements","concat","push","boundary","mainAxis"],"sources":["../src/core/primitives/popover/constants.ts","../src/core/primitives/popover/floating-ui/size.ts","../src/core/primitives/popover/helpers.ts","../src/core/primitives/popover/popoverCard.tsx","../src/core/primitives/popover/popover.tsx"],"sourcesContent":["import {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\n\nexport const DEFAULT_POPOVER_DISTANCE = 4\nexport const DEFAULT_POPOVER_PADDING = 4\nexport const DEFAULT_POPOVER_ARROW_WIDTH = 19\nexport const DEFAULT_POPOVER_ARROW_HEIGHT = 8\nexport const DEFAULT_POPOVER_ARROW_RADIUS = 2\nexport const DEFAULT_POPOVER_MARGINS: PopoverMargins = [0, 0, 0, 0]\nexport const DEFAULT_FALLBACK_PLACEMENTS: Record<Placement, Placement[]> = {\n 'top': ['bottom', 'left', 'right'],\n 'top-start': ['bottom-start', 'left-start', 'right-start'],\n 'top-end': ['bottom-end', 'left-end', 'right-end'],\n 'bottom': ['top', 'left', 'right'],\n 'bottom-start': ['top-start', 'left-start', 'right-start'],\n 'bottom-end': ['top-end', 'left-end', 'right-end'],\n 'left': ['right', 'top', 'bottom'],\n 'left-start': ['right-start', 'top-start', 'bottom-start'],\n 'left-end': ['right-end', 'top-end', 'bottom-end'],\n 'right': ['left', 'top', 'bottom'],\n 'right-start': ['left-start', 'top-start', 'bottom-start'],\n 'right-end': ['left-end', 'top-end', 'bottom-end'],\n}\n","import {detectOverflow, Middleware} from '@floating-ui/react-dom'\n\nimport {PopoverMargins} from '../../../types/popover'\n\nexport function size(options: {\n boundaryElement?: HTMLElement | null\n constrainSize: boolean\n margins: PopoverMargins\n matchReferenceWidth?: boolean\n maxWidthRef: React.RefObject<number | undefined>\n padding?: number\n referenceWidthRef: React.RefObject<number | undefined>\n setReferenceWidth: (referenceWidth: number) => void\n widthRef: React.RefObject<number | undefined>\n}): Middleware {\n const {\n constrainSize,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n padding = 0,\n referenceWidthRef,\n setReferenceWidth,\n widthRef,\n } = options\n\n return {\n name: '@sanity/ui/size',\n async fn(args) {\n const {elements, placement, platform, rects} = args\n const {floating, reference} = rects\n\n const overflow = await detectOverflow(args, {\n altBoundary: true,\n boundary: options.boundaryElement || undefined,\n elementContext: 'floating',\n padding,\n rootBoundary: 'viewport',\n })\n\n let maxWidth = Infinity\n let maxHeight = Infinity\n\n const floatingW = floating.width\n const floatingH = floating.height\n\n if (placement.includes('top')) {\n maxWidth = floatingW - (overflow.left + overflow.right)\n maxHeight = floatingH - overflow.top\n }\n\n if (placement.includes('right')) {\n maxWidth = floatingW - overflow.right\n maxHeight = floatingH - (overflow.top + overflow.bottom)\n }\n\n if (placement.includes('bottom')) {\n maxWidth = floatingW - (overflow.left + overflow.right)\n maxHeight = floatingH - overflow.bottom\n }\n\n if (placement.includes('left')) {\n maxWidth = floatingW - overflow.left\n maxHeight = floatingH - (overflow.top + overflow.bottom)\n }\n\n // IMPORTANT – APPLY ELEMENT STYLES HERE\n // Elements need to be resized BEFORE the `platform.getDimensions` call below\n const availableWidth = maxWidth - margins[1] - margins[3]\n const availableHeight = maxHeight - margins[0] - margins[2]\n const referenceWidth = reference.width - margins[1] - margins[3]\n referenceWidthRef.current = referenceWidth\n setReferenceWidth(referenceWidth)\n\n if (matchReferenceWidth) {\n elements.floating.style.width = `${referenceWidth}px`\n } else if (widthRef.current !== undefined) {\n elements.floating.style.width = `${widthRef.current}px`\n }\n\n if (constrainSize) {\n elements.floating.style.maxWidth = `${Math.min(availableWidth, maxWidthRef.current ?? Infinity)}px`\n\n elements.floating.style.maxHeight = `${availableHeight}px`\n }\n\n const nextDimensions = await platform.getDimensions(elements.floating)\n\n const targetH = nextDimensions.height\n const targetW = nextDimensions.width\n\n if (floatingW !== targetW || floatingH !== targetH) {\n return {reset: {rects: true}}\n }\n\n return {}\n },\n }\n}\n","import {DEFAULT_POPOVER_PADDING} from './constants'\nimport {PopoverWidth} from './types'\n\nexport function calcCurrentWidth(params: {\n mediaIndex: number\n container: number[]\n width: PopoverWidth[]\n}): number | undefined {\n const {container, mediaIndex, width} = params\n\n const w = width[mediaIndex]\n const currentWidth: PopoverWidth | undefined = w === undefined ? width[width.length - 1] : w\n\n return typeof currentWidth === 'number' ? container[currentWidth] : undefined\n}\n\nexport function calcMaxWidth(params: {\n boundaryWidth: number | undefined\n currentWidth: number | undefined\n}): number | undefined {\n const {boundaryWidth, currentWidth} = params\n\n if (currentWidth === undefined && boundaryWidth === undefined) {\n return undefined\n }\n\n return Math.min(\n currentWidth ?? Infinity,\n (boundaryWidth || Infinity) - DEFAULT_POPOVER_PADDING * 2,\n )\n}\n","import {Strategy} from '@floating-ui/react-dom'\nimport {motion} from 'motion/react'\nimport React, {CSSProperties, useMemo} from 'react'\nimport {styled} from 'styled-components'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {POPOVER_MOTION_PROPS} from '../../constants'\nimport {BoxOverflow} from '../../types/box'\nimport {CardTone} from '../../types/card'\nimport {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\nimport {Radius} from '../../types/radius'\nimport {Arrow} from '../../utils/arrow/arrow'\nimport {useLayer} from '../../utils/layer/useLayer'\nimport {Card} from '../card/card'\nimport {Flex} from '../flex/flex'\nimport {\n DEFAULT_POPOVER_ARROW_HEIGHT,\n DEFAULT_POPOVER_ARROW_RADIUS,\n DEFAULT_POPOVER_ARROW_WIDTH,\n DEFAULT_POPOVER_MARGINS,\n} from './constants'\n\nconst MotionCard = styled(motion.create(Card))`\n &:not([hidden]) {\n display: flex;\n }\n flex-direction: column;\n width: max-content;\n min-width: min-content;\n will-change: transform;\n`\n\nconst MotionFlex = styled(motion.create(Flex))`\n will-change: opacity;\n`\n\n/**\n * @internal\n */\nexport function PopoverCard(\n props: {\n /** @beta*/\n __unstable_margins?: PopoverMargins\n animate?: boolean\n arrow: boolean\n arrowRef: React.Ref<HTMLDivElement>\n arrowX?: number\n arrowY?: number\n originX?: number\n originY?: number\n overflow?: BoxOverflow\n padding?: number | number[]\n placement: Placement\n radius?: Radius | Radius[]\n scheme?: ThemeColorSchemeKey\n shadow?: number | number[]\n strategy: Strategy\n tone: CardTone\n width: number | undefined\n x: number | null\n y: number | null\n } & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'width'>,\n) {\n const {\n __unstable_margins: marginsProp,\n animate,\n arrow,\n arrowRef,\n arrowX,\n arrowY,\n children,\n padding,\n placement,\n originX,\n originY,\n overflow,\n radius,\n ref,\n scheme,\n shadow,\n strategy,\n style,\n tone,\n width,\n x: xProp,\n y: yProp,\n ...restProps\n } = props\n\n const {zIndex} = useLayer()\n\n // Get margins: [top, right, bottom, left]\n const margins: PopoverMargins = useMemo(\n () => marginsProp || DEFAULT_POPOVER_MARGINS,\n [marginsProp],\n )\n\n // Translate according to margins\n const x = (xProp ?? 0) + margins[3]\n const y = (yProp ?? 0) + margins[0]\n\n const rootStyle: CSSProperties = useMemo(\n () => ({\n left: x,\n originX,\n originY,\n position: strategy,\n top: y,\n width,\n zIndex,\n willChange: animate ? 'transform' : undefined,\n ...style,\n }),\n [animate, originX, originY, strategy, style, width, x, y, zIndex],\n )\n\n const arrowStyle: CSSProperties = useMemo(\n () => ({\n left: arrowX !== null ? arrowX : undefined,\n top: arrowY !== null ? arrowY : undefined,\n right: undefined,\n bottom: undefined,\n }),\n [arrowX, arrowY],\n )\n\n return (\n <MotionCard\n data-ui=\"Popover\"\n {...restProps}\n data-placement={placement}\n radius={radius}\n ref={ref}\n scheme={scheme}\n shadow={shadow}\n sizing=\"border\"\n style={rootStyle}\n tone={tone}\n variants={POPOVER_MOTION_PROPS.card}\n transition={POPOVER_MOTION_PROPS.transition}\n initial={animate ? ['hidden', 'initial'] : undefined}\n animate={animate ? ['visible', 'scaleIn'] : undefined}\n exit={animate ? ['hidden', 'scaleOut'] : undefined}\n >\n <MotionFlex\n data-ui=\"Popover__wrapper\"\n direction=\"column\"\n flex={1}\n overflow={overflow}\n variants={POPOVER_MOTION_PROPS.children}\n transition={POPOVER_MOTION_PROPS.transition}\n >\n <Flex direction=\"column\" flex={1} padding={padding}>\n {children}\n </Flex>\n </MotionFlex>\n\n {arrow && (\n <Arrow\n ref={arrowRef}\n style={arrowStyle}\n width={DEFAULT_POPOVER_ARROW_WIDTH}\n height={DEFAULT_POPOVER_ARROW_HEIGHT}\n radius={DEFAULT_POPOVER_ARROW_RADIUS}\n />\n )}\n </MotionCard>\n )\n}\n","import {\n arrow,\n autoPlacement,\n autoUpdate,\n flip,\n hide,\n Middleware,\n offset,\n RootBoundary,\n shift,\n useFloating,\n} from '@floating-ui/react-dom'\nimport {\n Activity,\n cloneElement,\n type Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport {ThemeColorSchemeKey} from '../../../theme/system/color/_system'\nimport {useElementSize} from '../../hooks/useElementSize'\nimport {useMediaIndex} from '../../hooks/useMediaIndex/useMediaIndex'\nimport {usePrefersReducedMotion} from '../../hooks/usePrefersReducedMotion'\nimport {origin} from '../../middleware/origin'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {useTheme_v2} from '../../theme/useTheme'\nimport {BoxOverflow} from '../../types/box'\nimport {CardTone} from '../../types/card'\nimport {Placement} from '../../types/placement'\nimport {PopoverMargins} from '../../types/popover'\nimport {AnimateActivity} from '../../utils/animateActivity'\nimport {useBoundaryElement} from '../../utils/boundaryElement/useBoundaryElement'\nimport {getElementRef} from '../../utils/getElementRef'\nimport {LayerProps} from '../../utils/layer/layer'\nimport {LayerProvider} from '../../utils/layer/layerProvider'\nimport {useLayer} from '../../utils/layer/useLayer'\nimport {Portal} from '../../utils/portal/portal'\nimport {ResponsiveRadiusProps, ResponsiveShadowProps} from '../types'\nimport {\n DEFAULT_FALLBACK_PLACEMENTS,\n DEFAULT_POPOVER_DISTANCE,\n DEFAULT_POPOVER_MARGINS,\n DEFAULT_POPOVER_PADDING,\n} from './constants'\nimport {size} from './floating-ui/size'\nimport {calcCurrentWidth, calcMaxWidth} from './helpers'\nimport {PopoverCard} from './popoverCard'\nimport {PopoverUpdateCallback, PopoverWidth} from './types'\n\n/** @public */\nexport interface PopoverProps\n extends Omit<LayerProps, 'as'>, ResponsiveRadiusProps, ResponsiveShadowProps {\n /** @beta */\n __unstable_margins?: PopoverMargins\n /**\n * Whether the popover should animate in and out.\n *\n * @beta\n * @defaultValue false\n */\n animate?: boolean\n arrow?: boolean\n /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */\n boundaryElement?: never\n children?: React.JSX.Element\n /**\n * When `true`, prevent overflow within the current boundary:\n * - by flipping on its side axis\n * - by resizing\n /*\n * Note that:\n * - setting `preventOverflow` to `true` also prevents overflow on its side axis\n * - setting `matchReferenceWidth` to `true` also causes the popover to resize\n *\n * @defaultValue false\n */\n constrainSize?: boolean\n content?: React.ReactNode\n disabled?: boolean\n fallbackPlacements?: Placement[]\n floatingBoundary?: HTMLElement | null\n /**\n * When `true`, set the maximum width to match the reference element, and also prevent overflow within\n * the current boundary by resizing.\n *\n * Note that setting `constrainSize` to `true` also causes the popover to resize\n *\n * @defaultValue false\n */\n matchReferenceWidth?: boolean\n /**\n * When true, blocks all pointer interaction with elements beneath the popover until closed.\n *\n * @beta\n * @defaultValue false\n */\n modal?: boolean\n open?: boolean\n overflow?: BoxOverflow\n padding?: number | number[]\n placement?: Placement\n /**\n * When 'flip' (default), the placement is determined from the initial placement and the\n * fallback placements in order. Whichever fits in the viewport first.\n *\n * When 'autoPlacement', the initial placement and all fallback placements are evaluated\n * and the placement with the most viewport space available.\n *\n * Option is only relevant if either `constrainSize` or `preventOverflow` is `true`\n */\n placementStrategy?: 'flip' | 'autoPlacement'\n /** Whether or not to render the popover in a portal element. */\n portal?: boolean | string\n preventOverflow?: boolean\n referenceBoundary?: HTMLElement | null\n /**\n * When defined, the popover will be positioned relative to this element.\n * The children of the popover won't be rendered.\n */\n referenceElement?: HTMLElement | null\n scheme?: ThemeColorSchemeKey\n tone?: CardTone\n /** @beta */\n updateRef?: Ref<PopoverUpdateCallback | undefined>\n width?: PopoverWidth | PopoverWidth[]\n}\n\nconst ViewportOverlay = () => {\n const {zIndex} = useLayer()\n\n return <div style={{height: '100vh', inset: 0, position: 'fixed', width: '100vw', zIndex}} />\n}\n\n/**\n * The `Popover` component is used to display some content on top of another.\n *\n * @public\n */\nexport function Popover(\n props: PopoverProps &\n Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'width'>,\n): React.JSX.Element {\n const {container, layer} = useTheme_v2()\n const boundaryElementContext = useBoundaryElement()\n\n const {\n __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,\n animate: _animate = false,\n arrow: arrowProp = false,\n children: childProp,\n constrainSize = false,\n content,\n disabled,\n fallbackPlacements: _fallbackPlacements,\n matchReferenceWidth,\n floatingBoundary: _floatingBoundary,\n modal,\n // oxlint-disable-next-line no-unused-vars\n onActivate,\n open,\n overflow = 'hidden',\n padding: paddingProp,\n placement: placementProp = 'bottom',\n placementStrategy = 'flip',\n portal,\n preventOverflow = true,\n radius: radiusProp = 3,\n ref: forwardedRef,\n referenceBoundary: _referenceBoundary,\n referenceElement,\n scheme,\n shadow: shadowProp = 3,\n tone = 'inherit',\n width: widthProp = 'auto',\n zOffset: _zOffsetProp,\n updateRef,\n ...restProps\n } = props\n const fallbackPlacements =\n _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? 'bottom']\n const floatingBoundary = _floatingBoundary ?? boundaryElementContext.element\n const referenceBoundary = _referenceBoundary ?? boundaryElementContext.element\n // Max-width uses BoundaryElementProvider when present; otherwise the floating\n // boundary (same element the old `boundaryElement` prop used for both).\n const boundaryElement = boundaryElementContext.element ?? floatingBoundary\n const zOffsetProp = _zOffsetProp ?? layer.popover.zOffset\n const prefersReducedMotion = usePrefersReducedMotion()\n const animate = prefersReducedMotion ? false : _animate\n const boundarySize = useElementSize(boundaryElement)?.border\n const padding = _getArrayProp(paddingProp)\n const radius = _getArrayProp(radiusProp)\n const shadow = _getArrayProp(shadowProp)\n const widthArrayProp = _getArrayProp(widthProp)\n const zOffset = _getArrayProp(zOffsetProp)\n const ref = useRef<HTMLDivElement | null>(null)\n const arrowRef = useRef<HTMLDivElement | null>(null)\n const rootBoundary: RootBoundary = 'viewport'\n\n useImperativeHandle<HTMLDivElement | null, HTMLDivElement | null>(forwardedRef, () => ref.current)\n\n const mediaIndex = useMediaIndex()\n const boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : undefined\n\n // Update width when\n // - media index changes\n // - `width` property changes\n const width = calcCurrentWidth({\n container,\n mediaIndex,\n width: widthArrayProp,\n })\n const widthRef = useRef(width)\n\n useEffect(() => {\n widthRef.current = width\n }, [width])\n\n // Update max width when\n // - boundary width changes\n // - `width` property changes\n const maxWidth = calcMaxWidth({boundaryWidth, currentWidth: width})\n const maxWidthRef = useRef(maxWidth)\n\n useEffect(() => {\n maxWidthRef.current = maxWidth\n }, [maxWidth])\n\n // Keep track of reference element width (see `size` middleware below)\n const referenceWidthRef = useRef<number>(undefined)\n\n // Force apply width & max width to floating element\n useEffect(() => {\n const floatingElement = ref.current\n\n if (!open || !floatingElement) return\n\n const referenceWidth = referenceWidthRef.current\n\n if (matchReferenceWidth) {\n if (referenceWidth !== undefined) {\n floatingElement.style.width = `${referenceWidth}px`\n }\n } else if (width !== undefined) {\n floatingElement.style.width = `${width}px`\n }\n\n if (typeof maxWidth === 'number') {\n floatingElement.style.maxWidth = `${maxWidth}px`\n }\n }, [width, matchReferenceWidth, maxWidth, open])\n\n const [referenceWidth, setReferenceWidth] = useState<number | undefined>(undefined)\n const middleware = useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\n })\n\n const {x, y, middlewareData, placement, refs, strategy, update} = useFloating({\n middleware,\n placement: placementProp,\n whileElementsMounted: autoUpdate,\n elements: referenceElement\n ? {\n reference: referenceElement,\n }\n : undefined,\n })\n\n const referenceHidden = middlewareData.hide?.referenceHidden\n\n const arrowX = middlewareData.arrow?.x\n const arrowY = middlewareData.arrow?.y\n\n const originX = middlewareData['@sanity/ui/origin']?.originX\n const originY = middlewareData['@sanity/ui/origin']?.originY\n\n const setArrow = useCallback((arrowEl: HTMLDivElement | null) => {\n arrowRef.current = arrowEl\n }, [])\n\n const setFloating = useCallback(\n (node: HTMLDivElement | null) => {\n ref.current = node\n refs.setFloating(node)\n },\n [refs],\n )\n\n // If there's a child then we need to set the reference element to the cloned child ref\n // and if child changes we make sure to update or remove the reference element.\n useImperativeHandle(childProp ? getElementRef(childProp) : null, () => refs.reference.current)\n\n const child = useMemo(() => {\n // If a reference element is defined, we don't need to clone the child\n if (referenceElement) return childProp\n\n if (!childProp) return null\n\n return cloneElement(childProp, {ref: refs.setReference})\n }, [childProp, referenceElement, refs.setReference])\n\n useImperativeHandle(updateRef, () => update, [update])\n\n if (disabled) {\n return childProp || <></>\n }\n\n const popover = (\n <LayerProvider zOffset={zOffset}>\n {/* Optional transparent blocking overlay at the top-most z-index layer. Must be positioned before the below popover card. */}\n {modal && <ViewportOverlay />}\n\n <PopoverCard\n {...restProps}\n __unstable_margins={margins}\n animate={animate}\n arrow={arrowProp}\n arrowRef={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n hidden={referenceHidden}\n overflow={overflow}\n padding={padding}\n placement={placement}\n radius={radius}\n ref={setFloating}\n scheme={scheme}\n shadow={shadow}\n originX={originX}\n originY={originY}\n strategy={strategy}\n tone={tone}\n width={matchReferenceWidth ? referenceWidth : width}\n x={x}\n y={y}\n >\n {content}\n </PopoverCard>\n </LayerProvider>\n )\n\n const popoverNode = portal ? (\n <Portal __unstable_name={typeof portal === 'string' ? portal : undefined}>{popover}</Portal>\n ) : (\n popover\n )\n\n return (\n <>\n {/* the popover */}\n {animate ? (\n <AnimateActivity layoutMode=\"default\" mode={open ? 'visible' : 'hidden'}>\n {popoverNode}\n </AnimateActivity>\n ) : (\n <Activity mode={open ? 'visible' : 'hidden'}>{popoverNode}</Activity>\n )}\n\n {/* the referred element */}\n {child}\n </>\n )\n}\n\nfunction useMiddleware({\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\n}: {\n animate: boolean\n arrowProp: boolean\n arrowRef: React.RefObject<HTMLDivElement | null>\n constrainSize: boolean\n fallbackPlacements: Placement[]\n floatingBoundary: HTMLElement | null\n margins: PopoverMargins\n matchReferenceWidth: boolean | undefined\n maxWidthRef: React.RefObject<number | undefined>\n placementProp: Placement\n placementStrategy: 'flip' | 'autoPlacement'\n preventOverflow: boolean\n referenceBoundary: HTMLElement | null\n referenceWidthRef: React.RefObject<number | undefined>\n rootBoundary: RootBoundary\n setReferenceWidth: (referenceWidth: number) => void\n widthRef: React.RefObject<number | undefined>\n}) {\n return useMemo(() => {\n const ret: Middleware[] = []\n\n // Flip the floating element when leaving the boundary box\n if (constrainSize || preventOverflow) {\n if (placementStrategy === 'autoPlacement') {\n ret.push(\n autoPlacement({\n allowedPlacements: [placementProp].concat(fallbackPlacements),\n }),\n )\n } else {\n ret.push(\n flip({\n boundary: floatingBoundary || undefined,\n fallbackPlacements,\n padding: DEFAULT_POPOVER_PADDING,\n rootBoundary,\n }),\n )\n }\n }\n\n // Define distance between reference and floating element\n ret.push(offset({mainAxis: DEFAULT_POPOVER_DISTANCE}))\n\n // Track sizes\n if (constrainSize || matchReferenceWidth) {\n ret.push(\n size({\n boundaryElement: floatingBoundary || undefined,\n constrainSize,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n padding: DEFAULT_POPOVER_PADDING,\n referenceWidthRef,\n setReferenceWidth,\n widthRef,\n }),\n )\n }\n\n // Shift the popover so its sits within the boundary element\n if (preventOverflow) {\n ret.push(\n shift({\n boundary: floatingBoundary || undefined,\n rootBoundary,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Place arrow\n if (arrowProp) {\n ret.push(\n arrow({\n element: arrowRef,\n padding: DEFAULT_POPOVER_PADDING,\n }),\n )\n }\n\n // Determine the origin to scale from.\n // Must be placed after `@sanity/ui/size` and `shift` middleware.\n if (animate) {\n ret.push(origin)\n }\n\n ret.push(\n hide({\n boundary: referenceBoundary || undefined,\n padding: DEFAULT_POPOVER_PADDING,\n strategy: 'referenceHidden',\n }),\n )\n\n return ret\n }, [\n animate,\n arrowProp,\n arrowRef,\n constrainSize,\n fallbackPlacements,\n floatingBoundary,\n margins,\n matchReferenceWidth,\n maxWidthRef,\n placementProp,\n placementStrategy,\n preventOverflow,\n referenceBoundary,\n referenceWidthRef,\n rootBoundary,\n setReferenceWidth,\n widthRef,\n ])\n}\n"],"mappings":";;;;;;;;;;;;AAQA,MAAaO,0BAA0C;CAAC;CAAG;CAAG;CAAG;AAAC,GACrDC,8BAA8D;CACzE,KAAO;EAAC;EAAU;EAAQ;CAAO;CACjC,aAAa;EAAC;EAAgB;EAAc;CAAa;CACzD,WAAW;EAAC;EAAc;EAAY;CAAW;CACjD,QAAU;EAAC;EAAO;EAAQ;CAAO;CACjC,gBAAgB;EAAC;EAAa;EAAc;CAAa;CACzD,cAAc;EAAC;EAAW;EAAY;CAAW;CACjD,MAAQ;EAAC;EAAS;EAAO;CAAQ;CACjC,cAAc;EAAC;EAAe;EAAa;CAAc;CACzD,YAAY;EAAC;EAAa;EAAW;CAAY;CACjD,OAAS;EAAC;EAAQ;EAAO;CAAQ;CACjC,eAAe;EAAC;EAAc;EAAa;CAAc;CACzD,aAAa;EAAC;EAAY;EAAW;CAAY;AACnD;AClBA,SAAgBK,KAAKC,SAUN;CACb,IAAM,EACJG,eACAC,SACAC,qBACAC,aACAG,UAAU,GACVC,mBACAC,mBACAE,aACEb;CAEJ,OAAO;EACLc,MAAM;EACN,MAAMC,GAAGC,MAAM;GACb,IAAM,EAACC,UAA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M,UACOtG;GAA8BnC,SAAAA;GACRsH,UACtB;EACZ,CAAC,GAAC1G,EAAA,MAAAuB,IAAAvB,EAAA,MAAAwB,KALJiG,IAAGG,KACDpG,EAKF,GAACxB,EAAA,KAAA7B,SAAA6B,EAAA,KAAAoE,WAAApE,EAAA,KAAAgF,UAAAhF,EAAA,KAAAvB,eAAAuB,EAAA,KAAAnB,oBAAAmB,EAAA,KAAAlB,kBAAAkB,EAAA,KAAAiE,SAAAjE,EAAA,KAAAhB,qBAAAgB,EAAA,KAAAyF,aAAAzF,EAAA,KAAAqE,eAAArE,EAAA,MAAAV,mBAAAU,EAAA,MAAAR,iBAAAQ,EAAA,MAAAP,mBAAAO,EAAA,MAAA0F,mBAAA1F,EAAA,MAAAgG,cAAAhG,EAAA,MAAA+F,mBAAA/F,EAAA,MAAAsF,UAAAtF,EAAA,MAAAyH;CAAA,OAAAA,MAAAzH,EAAA;CAAA,OAEDyH;AAAU"}
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Refractor, hasLanguage } from "react-refractor";
|
|
4
|
+
function LazyRefractor(props) {
|
|
5
|
+
let $ = c(13), { language: languageProp, value } = props, language = typeof languageProp == "string" ? languageProp : void 0, t0;
|
|
6
|
+
$[0] === language ? t0 = $[1] : (t0 = language ? hasLanguage(language) : !1, $[0] = language, $[1] = t0);
|
|
7
|
+
let registered = t0, t1;
|
|
8
|
+
$[2] !== language || $[3] !== registered || $[4] !== value ? (t1 = !(language && registered) && /* @__PURE__ */ jsx("code", { children: value }), $[2] = language, $[3] = registered, $[4] = value, $[5] = t1) : t1 = $[5];
|
|
9
|
+
let t2;
|
|
10
|
+
$[6] !== language || $[7] !== registered || $[8] !== value ? (t2 = language && registered && /* @__PURE__ */ jsx(Refractor, {
|
|
11
|
+
inline: !0,
|
|
12
|
+
language,
|
|
13
|
+
value: String(value)
|
|
14
|
+
}), $[6] = language, $[7] = registered, $[8] = value, $[9] = t2) : t2 = $[9];
|
|
15
|
+
let t3;
|
|
16
|
+
return $[10] !== t1 || $[11] !== t2 ? (t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] }), $[10] = t1, $[11] = t2, $[12] = t3) : t3 = $[12], t3;
|
|
17
|
+
}
|
|
18
|
+
export { LazyRefractor as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=refractor-CC48DwHi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refractor-CC48DwHi.js","names":["hasLanguage","Refractor","LazyRefractor","props","$","_c","language","languageProp","value","undefined","t0","registered","t1","t2","String","t3"],"sources":["../src/core/primitives/code/refractor.tsx"],"sourcesContent":["import {hasLanguage, Refractor} from 'react-refractor'\n\nexport default function LazyRefractor(\n props: Partial<Pick<React.ComponentProps<typeof Refractor>, 'language'>> & {\n value: React.ReactNode\n },\n) {\n const {language: languageProp, value} = props\n const language = typeof languageProp === 'string' ? languageProp : undefined\n // oxlint-disable-next-line no-unnecessary-type-assertion, no-unsafe-type-assertion\n const registered = language ? hasLanguage(language as any) : false\n\n return (\n <>\n {!(language && registered) && <code>{value}</code>}\n {/* oxlint-disable-next-line no-base-to-string */}\n {language && registered && <Refractor inline language={language} value={String(value)} />}\n </>\n )\n}\n"],"mappings":";;;AAEA,SAAeE,cAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GAKb,EAAAC,UAAAC,cAAAC,UAAwCL,OACxCG,WAAiB,OAAOC,gBAAiB,WAAxBA,eAAAE,KAAAA,GAA2DC;CAAA,AAAAN,EAAA,OAAAE,WAEVI,KAAAN,EAAA,MAA/CM,KAAAJ,WAAWN,YAAYM,QAAuB,IAA9C,IAA+CF,EAAA,KAAAE,UAAAF,EAAA,KAAAM;CAAlE,IAAAC,aAAmBD,IAA+CE;CAAA,AAAAR,EAAA,OAAAE,YAAAF,EAAA,OAAAO,cAAAP,EAAA,OAAAI,SAI7DI,KAAA,EAAEN,YAAAK,eAA2B,oBAAA,QAAA,EAAA,UAAOH,MAAa,CAAA,GAAAJ,EAAA,KAAAE,UAAAF,EAAA,KAAAO,YAAAP,EAAA,KAAAI,OAAAJ,EAAA,KAAAQ,MAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,AAAAT,EAAA,OAAAE,YAAAF,EAAA,OAAAO,cAAAP,EAAA,OAAAI,SAEjDK,KAAAP,YAAAK,cAA0B,oBAAC,WAAD;EAAW,QAAA;EAAiBL;EAAiB,OAAAQ,OAAON,KAAK;CAAC,CAAA,GAAIJ,EAAA,KAAAE,UAAAF,EAAA,KAAAO,YAAAP,EAAA,KAAAI,OAAAJ,EAAA,KAAAS,MAAAA,KAAAT,EAAA;CAAA,IAAAW;CACxF,OADwFX,EAAA,QAAAQ,MAAAR,EAAA,QAAAS,MAH3FE,KAAA,qBAAA,UAAA,EAAA,UAAA,CACGH,IAEAC,EAAwF,EAAA,CAAA,GACxFT,EAAA,MAAAQ,IAAAR,EAAA,MAAAS,IAAAT,EAAA,MAAAW,MAAAA,KAAAX,EAAA,KAJHW;AAIG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { a as rem, i as _responsive } from "./helpers-bwfx1e-Y.js";
|
|
2
|
+
import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
|
|
3
|
+
/**
|
|
4
|
+
* A utility function getting responsive font styles.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
function responsiveFont(fontKey, props) {
|
|
8
|
+
let { $size, $weight } = props, { font, media } = getTheme_v2(props.theme), { family, sizes, weights } = font[fontKey], fontWeight = $weight && weights[$weight] || weights.regular, defaultSize = sizes[2], base = {
|
|
9
|
+
position: "relative",
|
|
10
|
+
fontFamily: family,
|
|
11
|
+
fontWeight: `${fontWeight}`,
|
|
12
|
+
padding: "1px 0",
|
|
13
|
+
margin: 0,
|
|
14
|
+
"&:before": {
|
|
15
|
+
content: "\"\"",
|
|
16
|
+
display: "block",
|
|
17
|
+
height: 0
|
|
18
|
+
},
|
|
19
|
+
"&:after": {
|
|
20
|
+
content: "\"\"",
|
|
21
|
+
display: "block",
|
|
22
|
+
height: 0
|
|
23
|
+
},
|
|
24
|
+
"& > code, & > span": { display: "block" },
|
|
25
|
+
"&:not([hidden])": { display: "block" }
|
|
26
|
+
};
|
|
27
|
+
return $size ? [base, ..._responsive(media, $size, (sizeIndex) => fontSize(sizes[sizeIndex] || defaultSize))] : (responsiveFont.warned ||= (console.warn("No size specified for responsive font", {
|
|
28
|
+
fontKey,
|
|
29
|
+
$size,
|
|
30
|
+
props,
|
|
31
|
+
base
|
|
32
|
+
}), !0), [base]);
|
|
33
|
+
}
|
|
34
|
+
function fontSize(size) {
|
|
35
|
+
let { ascenderHeight, descenderHeight, fontSize, iconSize, letterSpacing, lineHeight } = size, negHeight = ascenderHeight + descenderHeight, capHeight = lineHeight - negHeight, iconOffset = (capHeight - iconSize) / 2, customIconSize = Math.floor(fontSize * 1.125 / 2) * 2 + 1, customIconOffset = (capHeight - customIconSize) / 2;
|
|
36
|
+
return {
|
|
37
|
+
fontSize: rem(fontSize),
|
|
38
|
+
lineHeight: `calc(${lineHeight} / ${fontSize})`,
|
|
39
|
+
letterSpacing: rem(letterSpacing),
|
|
40
|
+
transform: `translateY(${rem(descenderHeight)})`,
|
|
41
|
+
"&:before": { marginTop: `calc(${rem(0 - negHeight)} - 1px)` },
|
|
42
|
+
"&:after": { marginBottom: "-1px" },
|
|
43
|
+
"& svg:not([data-sanity-icon])": {
|
|
44
|
+
fontSize: `calc(${customIconSize} / 16 * 1rem)`,
|
|
45
|
+
margin: rem(customIconOffset)
|
|
46
|
+
},
|
|
47
|
+
"& [data-sanity-icon]": {
|
|
48
|
+
fontSize: `calc(${iconSize} / 16 * 1rem)`,
|
|
49
|
+
margin: rem(iconOffset)
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export { responsiveFont as t };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=responsiveFont-hN1mZFjm.js.map
|