@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,475 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { n as _getArrayProp, o as EMPTY_ARRAY, s as EMPTY_RECORD } from "./helpers-bwfx1e-Y.js";
|
|
3
|
+
import { d as focusFirstDescendant, l as _hasFocus, m as _raf, t as TextInput } from "./textInput-udxyGbm1.js";
|
|
4
|
+
import { t as _isEnterToClickElement } from "./element-BYgCE_iK.js";
|
|
5
|
+
import { s as Card, y as Box } from "./useLayer-BAVfmbNN.js";
|
|
6
|
+
import { n as Text, t as Stack } from "./stack-iW9HuGLg.js";
|
|
7
|
+
import { t as Button } from "./button-mxfSqr0n.js";
|
|
8
|
+
import { t as Popover } from "./popover-PorX5Jv9.js";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
10
|
+
import { ChevronDownIcon } from "@sanity/icons/ChevronDown";
|
|
11
|
+
import { cloneElement, startTransition, useEffect, useImperativeHandle, useReducer, useRef, useState } from "react";
|
|
12
|
+
import { keyframes, styled } from "styled-components";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { SpinnerIcon } from "@sanity/icons/Spinner";
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
const StyledAutocomplete = styled.div.withConfig({
|
|
19
|
+
displayName: "StyledAutocomplete",
|
|
20
|
+
componentId: "sc-ilitn5-0"
|
|
21
|
+
})`line-height:0;`, ListBox = styled(Box).withConfig({
|
|
22
|
+
displayName: "ListBox",
|
|
23
|
+
componentId: "sc-ilitn5-1"
|
|
24
|
+
})`& > ul{list-style:none;padding:0;margin:0;}`, rotate = keyframes`from{transform:rotate(0deg);}to{transform:rotate(360deg);}`, AnimatedSpinnerIcon = styled(SpinnerIcon).withConfig({
|
|
25
|
+
displayName: "AnimatedSpinnerIcon",
|
|
26
|
+
componentId: "sc-ilitn5-2"
|
|
27
|
+
})`animation:${rotate} 500ms linear infinite;`;
|
|
28
|
+
function AutocompleteOption(props) {
|
|
29
|
+
let $ = c(11), { children, id, onSelect, selected, value } = props, t0;
|
|
30
|
+
$[0] !== onSelect || $[1] !== value ? (t0 = () => {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
onSelect(value);
|
|
33
|
+
}, 0);
|
|
34
|
+
}, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
|
|
35
|
+
let handleClick = t0, t1;
|
|
36
|
+
$[3] === handleClick ? t1 = $[4] : (t1 = (event) => {
|
|
37
|
+
event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
|
|
38
|
+
}, $[3] = handleClick, $[4] = t1);
|
|
39
|
+
let handleKeyDown = t1, t2;
|
|
40
|
+
return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", {
|
|
41
|
+
"aria-selected": selected,
|
|
42
|
+
"data-ui": "AutocompleteOption",
|
|
43
|
+
id,
|
|
44
|
+
role: "option",
|
|
45
|
+
onClick: handleClick,
|
|
46
|
+
onKeyDown: handleKeyDown,
|
|
47
|
+
children
|
|
48
|
+
}), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
function autocompleteReducer(state, msg) {
|
|
54
|
+
return msg.type === "input/change" ? {
|
|
55
|
+
...state,
|
|
56
|
+
activeValue: null,
|
|
57
|
+
focused: !0,
|
|
58
|
+
query: msg.query
|
|
59
|
+
} : msg.type === "input/focus" ? {
|
|
60
|
+
...state,
|
|
61
|
+
focused: !0
|
|
62
|
+
} : msg.type === "root/blur" ? {
|
|
63
|
+
...state,
|
|
64
|
+
focused: !1,
|
|
65
|
+
query: null
|
|
66
|
+
} : msg.type === "root/clear" ? {
|
|
67
|
+
...state,
|
|
68
|
+
activeValue: null,
|
|
69
|
+
query: null,
|
|
70
|
+
value: null
|
|
71
|
+
} : msg.type === "root/escape" ? {
|
|
72
|
+
...state,
|
|
73
|
+
focused: !1,
|
|
74
|
+
query: null
|
|
75
|
+
} : msg.type === "root/open" ? {
|
|
76
|
+
...state,
|
|
77
|
+
query: state.query || msg.query
|
|
78
|
+
} : msg.type === "root/setActiveValue" ? {
|
|
79
|
+
...state,
|
|
80
|
+
activeValue: msg.value,
|
|
81
|
+
listFocused: msg.listFocused || state.listFocused
|
|
82
|
+
} : msg.type === "root/setListFocused" ? {
|
|
83
|
+
...state,
|
|
84
|
+
listFocused: msg.listFocused
|
|
85
|
+
} : msg.type === "value/change" ? {
|
|
86
|
+
...state,
|
|
87
|
+
activeValue: msg.value,
|
|
88
|
+
query: null,
|
|
89
|
+
value: msg.value
|
|
90
|
+
} : state;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
96
|
+
"Control",
|
|
97
|
+
"Shift",
|
|
98
|
+
"Alt",
|
|
99
|
+
"Enter",
|
|
100
|
+
"Home",
|
|
101
|
+
"End",
|
|
102
|
+
"PageUp",
|
|
103
|
+
"PageDown",
|
|
104
|
+
"Meta",
|
|
105
|
+
"Tab",
|
|
106
|
+
"CapsLock"
|
|
107
|
+
], AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
|
|
108
|
+
/**
|
|
109
|
+
* The Autocomplete component is typically used for search components.
|
|
110
|
+
* It consists of a text input for writing a query, and properties for rendering suggestions.
|
|
111
|
+
*
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
function Autocomplete(props) {
|
|
115
|
+
let $ = c(182), customValidity, disabled, filterOptionProp, forwardedRef, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, valueProp;
|
|
116
|
+
$[0] === props ? (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], forwardedRef = $[4], icon = $[5], id = $[6], loading = $[7], onBlur = $[8], onChange = $[9], onFocus = $[10], onQueryChange = $[11], onSelect = $[12], openButton = $[13], openOnFocus = $[14], optionsProp = $[15], prefix = $[16], readOnly = $[17], relatedElements = $[18], renderOptionProp = $[19], renderPopover = $[20], restProps = $[21], suffix = $[22], t0 = $[23], t1 = $[24], t2 = $[25], t3 = $[26], t4 = $[27], t5 = $[28], t6 = $[29], valueProp = $[30]) : ({border: t0, customValidity, disabled, filterOption: filterOptionProp, fontSize: t1, icon, id, listBox: t2, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, options: optionsProp, padding: t3, popover: t4, prefix, radius: t5, readOnly, ref: forwardedRef, relatedElements, renderOption: renderOptionProp, renderPopover, renderValue: t6, suffix, value: valueProp, ...restProps} = props, $[0] = props, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = forwardedRef, $[5] = icon, $[6] = id, $[7] = loading, $[8] = onBlur, $[9] = onChange, $[10] = onFocus, $[11] = onQueryChange, $[12] = onSelect, $[13] = openButton, $[14] = openOnFocus, $[15] = optionsProp, $[16] = prefix, $[17] = readOnly, $[18] = relatedElements, $[19] = renderOptionProp, $[20] = renderPopover, $[21] = restProps, $[22] = suffix, $[23] = t0, $[24] = t1, $[25] = t2, $[26] = t3, $[27] = t4, $[28] = t5, $[29] = t6, $[30] = valueProp);
|
|
117
|
+
let border = t0 === void 0 || t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null, t9;
|
|
118
|
+
$[31] !== t7 || $[32] !== t8 ? (t9 = {
|
|
119
|
+
activeValue: t7,
|
|
120
|
+
focused: !1,
|
|
121
|
+
listFocused: !1,
|
|
122
|
+
query: null,
|
|
123
|
+
value: t8
|
|
124
|
+
}, $[31] = t7, $[32] = t8, $[33] = t9) : t9 = $[33];
|
|
125
|
+
let [state, dispatch] = useReducer(autocompleteReducer, t9), { activeValue, focused, listFocused, query, value } = state, t10;
|
|
126
|
+
$[34] !== fontSize || $[35] !== paddingProp ? (t10 = (t11) => {
|
|
127
|
+
let { value: value_0 } = t11;
|
|
128
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
129
|
+
"data-as": "button",
|
|
130
|
+
padding: paddingProp,
|
|
131
|
+
radius: 2,
|
|
132
|
+
tone: "inherit",
|
|
133
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
134
|
+
size: fontSize,
|
|
135
|
+
textOverflow: "ellipsis",
|
|
136
|
+
children: value_0
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}, $[34] = fontSize, $[35] = paddingProp, $[36] = t10) : t10 = $[36];
|
|
140
|
+
let renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), [inputElement, _setInputElement] = useState(null), t11;
|
|
141
|
+
$[37] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (node) => {
|
|
142
|
+
startTransition(() => _setInputElement(node));
|
|
143
|
+
}, $[37] = t11) : t11 = $[37];
|
|
144
|
+
let setInputElement = t11, listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1), t12, t13;
|
|
145
|
+
$[38] === inputElement ? (t12 = $[39], t13 = $[40]) : (t12 = () => inputElement, t13 = [inputElement], $[38] = inputElement, $[39] = t12, $[40] = t13), useImperativeHandle(inputElementRef, t12, t13);
|
|
146
|
+
let t14, t15;
|
|
147
|
+
$[41] === inputElement ? (t14 = $[42], t15 = $[43]) : (t14 = () => inputElement, t15 = [inputElement], $[41] = inputElement, $[42] = t14, $[43] = t15), useImperativeHandle(forwardedRef, t14, t15);
|
|
148
|
+
let listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(paddingProp), t16;
|
|
149
|
+
$[44] !== options || $[45] !== value ? (t16 = value === null ? void 0 : options.find((o) => o.value === value), $[44] = options, $[45] = value, $[46] = t16) : t16 = $[46];
|
|
150
|
+
let currentOption = t16, t17;
|
|
151
|
+
if ($[47] !== filterOption || $[48] !== options || $[49] !== query) {
|
|
152
|
+
let t18;
|
|
153
|
+
$[51] !== filterOption || $[52] !== query ? (t18 = (option) => !query || filterOption(query, option), $[51] = filterOption, $[52] = query, $[53] = t18) : t18 = $[53], t17 = options.filter(t18), $[47] = filterOption, $[48] = options, $[49] = query, $[50] = t17;
|
|
154
|
+
} else t17 = $[50];
|
|
155
|
+
let filteredOptions = t17, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, t18;
|
|
156
|
+
$[54] !== onBlur || $[55] !== onQueryChange || $[56] !== relatedElements ? (t18 = (event) => {
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
if (popoverMouseWithinRef.current) return;
|
|
159
|
+
let elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []), focusInside = !1;
|
|
160
|
+
if (document.activeElement) {
|
|
161
|
+
for (let e of elements) if (e === document.activeElement || e.contains(document.activeElement)) {
|
|
162
|
+
focusInside = !0;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
focusInside === !1 && (dispatch({ type: "root/blur" }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
167
|
+
}, 0);
|
|
168
|
+
}, $[54] = onBlur, $[55] = onQueryChange, $[56] = relatedElements, $[57] = t18) : t18 = $[57];
|
|
169
|
+
let handleRootBlur = t18, t19;
|
|
170
|
+
$[58] === Symbol.for("react.memo_cache_sentinel") ? (t19 = (event_0) => {
|
|
171
|
+
let listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
172
|
+
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
173
|
+
type: "root/setListFocused",
|
|
174
|
+
listFocused: listFocused_0
|
|
175
|
+
}));
|
|
176
|
+
}, $[58] = t19) : t19 = $[58];
|
|
177
|
+
let handleRootFocus = t19, t20;
|
|
178
|
+
$[59] !== onChange || $[60] !== onQueryChange || $[61] !== onSelect ? (t20 = (v) => {
|
|
179
|
+
dispatch({
|
|
180
|
+
type: "value/change",
|
|
181
|
+
value: v
|
|
182
|
+
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
183
|
+
}, $[59] = onChange, $[60] = onQueryChange, $[61] = onSelect, $[62] = t20) : t20 = $[62];
|
|
184
|
+
let handleOptionSelect = t20, t21;
|
|
185
|
+
$[63] !== activeValue || $[64] !== filteredOptions || $[65] !== filteredOptionsLen || $[66] !== onQueryChange ? (t21 = (event_1) => {
|
|
186
|
+
if (event_1.key === "ArrowDown") {
|
|
187
|
+
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
188
|
+
let activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
|
|
189
|
+
nextActiveOption && dispatch({
|
|
190
|
+
type: "root/setActiveValue",
|
|
191
|
+
value: nextActiveOption.value,
|
|
192
|
+
listFocused: !0
|
|
193
|
+
});
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (event_1.key === "ArrowUp") {
|
|
197
|
+
if (event_1.preventDefault(), !filteredOptionsLen) return;
|
|
198
|
+
let activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
|
|
199
|
+
nextActiveOption_0 && dispatch({
|
|
200
|
+
type: "root/setActiveValue",
|
|
201
|
+
value: nextActiveOption_0.value,
|
|
202
|
+
listFocused: !0
|
|
203
|
+
});
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (event_1.key === "Escape") {
|
|
207
|
+
dispatch({ type: "root/escape" }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
let target = event_1.target, listEl = listBoxElementRef.current;
|
|
211
|
+
if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
|
|
212
|
+
inputElementRef.current?.focus();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}, $[63] = activeValue, $[64] = filteredOptions, $[65] = filteredOptionsLen, $[66] = onQueryChange, $[67] = t21) : t21 = $[67];
|
|
216
|
+
let handleRootKeyDown = t21, t22;
|
|
217
|
+
$[68] === onQueryChange ? t22 = $[69] : (t22 = (event_2) => {
|
|
218
|
+
let nextQuery = event_2.currentTarget.value;
|
|
219
|
+
dispatch({
|
|
220
|
+
type: "input/change",
|
|
221
|
+
query: nextQuery
|
|
222
|
+
}), onQueryChange && onQueryChange(nextQuery);
|
|
223
|
+
}, $[68] = onQueryChange, $[69] = t22);
|
|
224
|
+
let handleInputChange = t22, t23;
|
|
225
|
+
$[70] !== currentOption || $[71] !== renderValue || $[72] !== value ? (t23 = () => {
|
|
226
|
+
dispatch({
|
|
227
|
+
type: "root/open",
|
|
228
|
+
query: value ? renderValue(value, currentOption) : ""
|
|
229
|
+
});
|
|
230
|
+
}, $[70] = currentOption, $[71] = renderValue, $[72] = value, $[73] = t23) : t23 = $[73];
|
|
231
|
+
let dispatchOpen = t23, t24;
|
|
232
|
+
$[74] !== dispatchOpen || $[75] !== focused || $[76] !== onFocus || $[77] !== openOnFocus ? (t24 = (event_3) => {
|
|
233
|
+
focused || (dispatch({ type: "input/focus" }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
234
|
+
}, $[74] = dispatchOpen, $[75] = focused, $[76] = onFocus, $[77] = openOnFocus, $[78] = t24) : t24 = $[78];
|
|
235
|
+
let handleInputFocus = t24, t25;
|
|
236
|
+
$[79] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
|
|
237
|
+
popoverMouseWithinRef.current = !0;
|
|
238
|
+
}, $[79] = t25) : t25 = $[79];
|
|
239
|
+
let handlePopoverMouseEnter = t25, t26;
|
|
240
|
+
$[80] === Symbol.for("react.memo_cache_sentinel") ? (t26 = () => {
|
|
241
|
+
popoverMouseWithinRef.current = !1;
|
|
242
|
+
}, $[80] = t26) : t26 = $[80];
|
|
243
|
+
let handlePopoverMouseLeave = t26, t27;
|
|
244
|
+
$[81] !== onChange || $[82] !== onQueryChange ? (t27 = () => {
|
|
245
|
+
dispatch({ type: "root/clear" }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
246
|
+
}, $[81] = onChange, $[82] = onQueryChange, $[83] = t27) : t27 = $[83];
|
|
247
|
+
let handleClearButtonClick = t27, t28;
|
|
248
|
+
$[84] === Symbol.for("react.memo_cache_sentinel") ? (t28 = () => {
|
|
249
|
+
dispatch({ type: "input/focus" });
|
|
250
|
+
}, $[84] = t28) : t28 = $[84];
|
|
251
|
+
let handleClearButtonFocus = t28, t29, t30;
|
|
252
|
+
$[85] === valueProp ? (t29 = $[86], t30 = $[87]) : (t29 = () => {
|
|
253
|
+
if (valueProp !== valuePropRef.current) {
|
|
254
|
+
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
255
|
+
type: "value/change",
|
|
256
|
+
value: valueProp
|
|
257
|
+
}), valueRef.current = valueProp);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
valueProp !== valueRef.current && (valueRef.current = valueProp || null, dispatch({
|
|
261
|
+
type: "value/change",
|
|
262
|
+
value: valueProp || null
|
|
263
|
+
}));
|
|
264
|
+
}, t30 = [valueProp], $[85] = valueProp, $[86] = t29, $[87] = t30), useEffect(t29, t30);
|
|
265
|
+
let t31, t32;
|
|
266
|
+
$[88] === focused ? (t31 = $[89], t32 = $[90]) : (t31 = () => {
|
|
267
|
+
!focused && valueRef.current && dispatch({
|
|
268
|
+
type: "root/setActiveValue",
|
|
269
|
+
value: valueRef.current
|
|
270
|
+
});
|
|
271
|
+
}, t32 = [focused], $[88] = focused, $[89] = t31, $[90] = t32), useEffect(t31, t32);
|
|
272
|
+
let t33, t34;
|
|
273
|
+
$[91] !== activeValue || $[92] !== filteredOptions ? (t33 = () => {
|
|
274
|
+
let listElement = listBoxElementRef.current;
|
|
275
|
+
if (!listElement) return;
|
|
276
|
+
let activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
|
|
277
|
+
if (activeOption_1) {
|
|
278
|
+
let activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
|
|
279
|
+
if (activeItemElement) {
|
|
280
|
+
if (_hasFocus(activeItemElement)) return;
|
|
281
|
+
focusFirstDescendant(activeItemElement);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}, t34 = [activeValue, filteredOptions], $[91] = activeValue, $[92] = filteredOptions, $[93] = t33, $[94] = t34) : (t33 = $[93], t34 = $[94]), useEffect(t33, t34);
|
|
285
|
+
let t35;
|
|
286
|
+
bb0: {
|
|
287
|
+
if (!loading && !disabled && value) {
|
|
288
|
+
let t36;
|
|
289
|
+
$[95] === Symbol.for("react.memo_cache_sentinel") ? (t36 = {
|
|
290
|
+
"aria-label": "Clear",
|
|
291
|
+
onFocus: handleClearButtonFocus
|
|
292
|
+
}, $[95] = t36) : t36 = $[95], t35 = t36;
|
|
293
|
+
break bb0;
|
|
294
|
+
}
|
|
295
|
+
t35 = void 0;
|
|
296
|
+
}
|
|
297
|
+
let clearButton = t35, openButtonBoxPadding = padding.map(_temp), openButtonPadding = padding.map(_temp2), openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD, t36;
|
|
298
|
+
$[96] !== dispatchOpen || $[97] !== openButtonProps ? (t36 = (event_4) => {
|
|
299
|
+
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
300
|
+
}, $[96] = dispatchOpen, $[97] = openButtonProps, $[98] = t36) : t36 = $[98];
|
|
301
|
+
let handleOpenClick = t36, t37;
|
|
302
|
+
$[99] !== disabled || $[100] !== expanded || $[101] !== fontSize || $[102] !== handleOpenClick || $[103] !== openButton || $[104] !== openButtonBoxPadding || $[105] !== openButtonPadding || $[106] !== openButtonProps || $[107] !== readOnly ? (t37 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, {
|
|
303
|
+
"aria-hidden": expanded,
|
|
304
|
+
padding: openButtonBoxPadding,
|
|
305
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
306
|
+
"aria-label": "Open",
|
|
307
|
+
disabled: expanded,
|
|
308
|
+
fontSize,
|
|
309
|
+
icon: ChevronDownIcon,
|
|
310
|
+
mode: "bleed",
|
|
311
|
+
padding: openButtonPadding,
|
|
312
|
+
...openButtonProps,
|
|
313
|
+
onClick: handleOpenClick
|
|
314
|
+
})
|
|
315
|
+
}) : void 0, $[99] = disabled, $[100] = expanded, $[101] = fontSize, $[102] = handleOpenClick, $[103] = openButton, $[104] = openButtonBoxPadding, $[105] = openButtonPadding, $[106] = openButtonProps, $[107] = readOnly, $[108] = t37) : t37 = $[108];
|
|
316
|
+
let openButtonNode = t37, t38;
|
|
317
|
+
bb1: {
|
|
318
|
+
if (query === null) {
|
|
319
|
+
if (value !== null) {
|
|
320
|
+
let t39;
|
|
321
|
+
$[109] !== currentOption || $[110] !== renderValue || $[111] !== value ? (t39 = renderValue(value, currentOption), $[109] = currentOption, $[110] = renderValue, $[111] = value, $[112] = t39) : t39 = $[112], t38 = t39;
|
|
322
|
+
break bb1;
|
|
323
|
+
}
|
|
324
|
+
t38 = "";
|
|
325
|
+
break bb1;
|
|
326
|
+
}
|
|
327
|
+
t38 = query;
|
|
328
|
+
}
|
|
329
|
+
let inputValue = t38, t39;
|
|
330
|
+
$[113] === listFocused ? t39 = $[114] : (t39 = (event_5) => {
|
|
331
|
+
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
332
|
+
}, $[113] = listFocused, $[114] = t39);
|
|
333
|
+
let handleListBoxKeyDown = t39, t40;
|
|
334
|
+
bb2: {
|
|
335
|
+
if (filteredOptions.length === 0) {
|
|
336
|
+
t40 = null;
|
|
337
|
+
break bb2;
|
|
338
|
+
}
|
|
339
|
+
let t41;
|
|
340
|
+
if ($[115] !== activeValue || $[116] !== currentOption || $[117] !== filteredOptions || $[118] !== handleOptionSelect || $[119] !== id || $[120] !== listFocused || $[121] !== loading || $[122] !== renderOption) {
|
|
341
|
+
let t42;
|
|
342
|
+
$[124] !== activeValue || $[125] !== currentOption || $[126] !== handleOptionSelect || $[127] !== id || $[128] !== listFocused || $[129] !== loading || $[130] !== renderOption ? (t42 = (option_0) => {
|
|
343
|
+
let active = activeValue === null ? currentOption === option_0 : option_0.value === activeValue;
|
|
344
|
+
return /* @__PURE__ */ jsx(AutocompleteOption, {
|
|
345
|
+
id: `${id}-option-${option_0.value}`,
|
|
346
|
+
onSelect: handleOptionSelect,
|
|
347
|
+
selected: active,
|
|
348
|
+
value: option_0.value,
|
|
349
|
+
children: cloneElement(renderOption(option_0), {
|
|
350
|
+
disabled: loading,
|
|
351
|
+
selected: active,
|
|
352
|
+
tabIndex: listFocused && active ? 0 : -1
|
|
353
|
+
})
|
|
354
|
+
}, option_0.value);
|
|
355
|
+
}, $[124] = activeValue, $[125] = currentOption, $[126] = handleOptionSelect, $[127] = id, $[128] = listFocused, $[129] = loading, $[130] = renderOption, $[131] = t42) : t42 = $[131], t41 = filteredOptions.map(t42), $[115] = activeValue, $[116] = currentOption, $[117] = filteredOptions, $[118] = handleOptionSelect, $[119] = id, $[120] = listFocused, $[121] = loading, $[122] = renderOption, $[123] = t41;
|
|
356
|
+
} else t41 = $[123];
|
|
357
|
+
let t42;
|
|
358
|
+
$[132] !== listBoxId || $[133] !== t41 ? (t42 = /* @__PURE__ */ jsx(Stack, {
|
|
359
|
+
as: "ul",
|
|
360
|
+
"aria-multiselectable": !1,
|
|
361
|
+
"data-ui": "AutoComplete__resultsList",
|
|
362
|
+
id: listBoxId,
|
|
363
|
+
ref: listBoxElementRef,
|
|
364
|
+
role: "listbox",
|
|
365
|
+
gap: 1,
|
|
366
|
+
children: t41
|
|
367
|
+
}), $[132] = listBoxId, $[133] = t41, $[134] = t42) : t42 = $[134];
|
|
368
|
+
let t43;
|
|
369
|
+
$[135] !== handleListBoxKeyDown || $[136] !== listBox || $[137] !== t42 ? (t43 = /* @__PURE__ */ jsx(ListBox, {
|
|
370
|
+
"data-ui": "AutoComplete__results",
|
|
371
|
+
onKeyDown: handleListBoxKeyDown,
|
|
372
|
+
padding: 1,
|
|
373
|
+
...listBox,
|
|
374
|
+
tabIndex: -1,
|
|
375
|
+
children: t42
|
|
376
|
+
}), $[135] = handleListBoxKeyDown, $[136] = listBox, $[137] = t42, $[138] = t43) : t43 = $[138], t40 = t43;
|
|
377
|
+
}
|
|
378
|
+
let content = t40, t41;
|
|
379
|
+
bb3: {
|
|
380
|
+
if (renderPopover) {
|
|
381
|
+
let t42 = !expanded, t43;
|
|
382
|
+
$[139] !== content || $[140] !== handlePopoverMouseEnter || $[141] !== handlePopoverMouseLeave || $[142] !== inputElement || $[143] !== renderPopover || $[144] !== t42 ? (t43 = /* @__PURE__ */ jsx(RenderPopover, {
|
|
383
|
+
content,
|
|
384
|
+
hidden: t42,
|
|
385
|
+
inputElement,
|
|
386
|
+
onMouseEnter: handlePopoverMouseEnter,
|
|
387
|
+
onMouseLeave: handlePopoverMouseLeave,
|
|
388
|
+
resultsPopoverElementRef,
|
|
389
|
+
renderPopover
|
|
390
|
+
}), $[139] = content, $[140] = handlePopoverMouseEnter, $[141] = handlePopoverMouseLeave, $[142] = inputElement, $[143] = renderPopover, $[144] = t42, $[145] = t43) : t43 = $[145], t41 = t43;
|
|
391
|
+
break bb3;
|
|
392
|
+
}
|
|
393
|
+
if (filteredOptionsLen === 0) {
|
|
394
|
+
t41 = null;
|
|
395
|
+
break bb3;
|
|
396
|
+
}
|
|
397
|
+
let t42;
|
|
398
|
+
$[146] !== content || $[147] !== expanded || $[148] !== handlePopoverMouseEnter || $[149] !== handlePopoverMouseLeave || $[150] !== inputElement || $[151] !== popover || $[152] !== radius ? (t42 = /* @__PURE__ */ jsx(Popover, {
|
|
399
|
+
arrow: !1,
|
|
400
|
+
constrainSize: !0,
|
|
401
|
+
content,
|
|
402
|
+
fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS,
|
|
403
|
+
matchReferenceWidth: !0,
|
|
404
|
+
onMouseEnter: handlePopoverMouseEnter,
|
|
405
|
+
onMouseLeave: handlePopoverMouseLeave,
|
|
406
|
+
open: expanded,
|
|
407
|
+
overflow: "auto",
|
|
408
|
+
placement: "bottom-start",
|
|
409
|
+
portal: !0,
|
|
410
|
+
radius,
|
|
411
|
+
ref: resultsPopoverElementRef,
|
|
412
|
+
referenceElement: inputElement,
|
|
413
|
+
...popover
|
|
414
|
+
}), $[146] = content, $[147] = expanded, $[148] = handlePopoverMouseEnter, $[149] = handlePopoverMouseLeave, $[150] = inputElement, $[151] = popover, $[152] = radius, $[153] = t42) : t42 = $[153], t41 = t42;
|
|
415
|
+
}
|
|
416
|
+
let results = t41, t42 = loading && AnimatedSpinnerIcon, t43 = suffix || openButtonNode, t44;
|
|
417
|
+
$[154] !== activeItemId || $[155] !== border || $[156] !== clearButton || $[157] !== customValidity || $[158] !== disabled || $[159] !== expanded || $[160] !== fontSize || $[161] !== handleClearButtonClick || $[162] !== handleInputChange || $[163] !== handleInputFocus || $[164] !== icon || $[165] !== id || $[166] !== inputValue || $[167] !== listBoxId || $[168] !== padding || $[169] !== prefix || $[170] !== radius || $[171] !== readOnly || $[172] !== restProps || $[173] !== t42 || $[174] !== t43 ? (t44 = /* @__PURE__ */ jsx(TextInput, {
|
|
418
|
+
...restProps,
|
|
419
|
+
"aria-activedescendant": activeItemId,
|
|
420
|
+
"aria-autocomplete": "list",
|
|
421
|
+
"aria-expanded": expanded,
|
|
422
|
+
"aria-owns": listBoxId,
|
|
423
|
+
autoCapitalize: "off",
|
|
424
|
+
autoComplete: "off",
|
|
425
|
+
autoCorrect: "off",
|
|
426
|
+
border,
|
|
427
|
+
clearButton,
|
|
428
|
+
customValidity,
|
|
429
|
+
disabled,
|
|
430
|
+
fontSize,
|
|
431
|
+
icon,
|
|
432
|
+
iconRight: t42,
|
|
433
|
+
id,
|
|
434
|
+
inputMode: "search",
|
|
435
|
+
onChange: handleInputChange,
|
|
436
|
+
onClear: handleClearButtonClick,
|
|
437
|
+
onFocus: handleInputFocus,
|
|
438
|
+
padding,
|
|
439
|
+
prefix,
|
|
440
|
+
radius,
|
|
441
|
+
readOnly,
|
|
442
|
+
ref: setInputElement,
|
|
443
|
+
role: "combobox",
|
|
444
|
+
spellCheck: !1,
|
|
445
|
+
suffix: t43,
|
|
446
|
+
value: inputValue
|
|
447
|
+
}), $[154] = activeItemId, $[155] = border, $[156] = clearButton, $[157] = customValidity, $[158] = disabled, $[159] = expanded, $[160] = fontSize, $[161] = handleClearButtonClick, $[162] = handleInputChange, $[163] = handleInputFocus, $[164] = icon, $[165] = id, $[166] = inputValue, $[167] = listBoxId, $[168] = padding, $[169] = prefix, $[170] = radius, $[171] = readOnly, $[172] = restProps, $[173] = t42, $[174] = t43, $[175] = t44) : t44 = $[175];
|
|
448
|
+
let t45;
|
|
449
|
+
return $[176] !== handleRootBlur || $[177] !== handleRootFocus || $[178] !== handleRootKeyDown || $[179] !== results || $[180] !== t44 ? (t45 = /* @__PURE__ */ jsxs(StyledAutocomplete, {
|
|
450
|
+
"data-ui": "Autocomplete",
|
|
451
|
+
onBlur: handleRootBlur,
|
|
452
|
+
onFocus: handleRootFocus,
|
|
453
|
+
onKeyDown: handleRootKeyDown,
|
|
454
|
+
ref: rootElementRef,
|
|
455
|
+
children: [t44, results]
|
|
456
|
+
}), $[176] = handleRootBlur, $[177] = handleRootFocus, $[178] = handleRootKeyDown, $[179] = results, $[180] = t44, $[181] = t45) : t45 = $[181], t45;
|
|
457
|
+
}
|
|
458
|
+
function _temp2(v_1) {
|
|
459
|
+
return Math.max(v_1 - 1, 0);
|
|
460
|
+
}
|
|
461
|
+
function _temp(v_0) {
|
|
462
|
+
return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
|
|
463
|
+
}
|
|
464
|
+
function RenderPopover({ renderPopover, content, hidden, inputElement, onMouseEnter, onMouseLeave, resultsPopoverElementRef }) {
|
|
465
|
+
return renderPopover({
|
|
466
|
+
content,
|
|
467
|
+
hidden,
|
|
468
|
+
inputElement,
|
|
469
|
+
onMouseEnter,
|
|
470
|
+
onMouseLeave
|
|
471
|
+
}, resultsPopoverElementRef);
|
|
472
|
+
}
|
|
473
|
+
export { Autocomplete };
|
|
474
|
+
|
|
475
|
+
//# sourceMappingURL=autocomplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autocomplete.js","names":["SpinnerIcon","keyframes","styled","Box","StyledAutocomplete","div","ListBox","rotate","AnimatedSpinnerIcon","useCallback","_isEnterToClickElement","AutocompleteOptionProps","children","React","ReactNode","id","onSelect","v","selected","value","AutocompleteOption","props","$","_c","t0","setTimeout","handleClick","t1","event","key","currentTarget","handleKeyDown","t2","AutocompleteMsg","AutocompleteState","autocompleteReducer","state","msg","type","activeValue","focused","query","value","listFocused","Placement","AUTOCOMPLETE_LISTBOX_IGNORE_KEYS","AUTOCOMPLETE_POPOVER_PLACEMENT","AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS","ChevronDownIcon","ChangeEvent","cloneElement","ElementType","FocusEvent","HTMLProps","KeyboardEvent","MouseEvent","ReactNode","Ref","startTransition","useCallback","useEffect","useImperativeHandle","useMemo","useReducer","useRef","useState","EMPTY_ARRAY","EMPTY_RECORD","_raf","_hasFocus","focusFirstDescendant","Box","BoxProps","Button","Card","Popover","PopoverProps","Stack","Text","TextInput","_getArrayProp","Radius","AnimatedSpinnerIcon","ListBox","StyledAutocomplete","AutocompleteOption","autocompleteReducer","AUTOCOMPLETE_LISTBOX_IGNORE_KEYS","AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS","AUTOCOMPLETE_POPOVER_PLACEMENT","AutocompleteOpenButtonProps","BaseAutocompleteOption","AutocompleteProps","border","customValidity","filterOption","query","option","Option","fontSize","icon","id","listBox","loading","onChange","value","onQueryChange","onSelect","openButton","openOnFocus","options","padding","popover","Omit","HTMLDivElement","prefix","radius","relatedElements","HTMLElement","renderOption","React","JSX","Element","renderPopover","props","content","hidden","inputElement","HTMLInputElement","onMouseEnter","onMouseLeave","ref","renderValue","suffix","DEFAULT_RENDER_VALUE","DEFAULT_FILTER_OPTION","toLowerCase","indexOf","Autocomplete","$","_c","disabled","filterOptionProp","forwardedRef","onBlur","onFocus","optionsProp","readOnly","renderOptionProp","restProps","t0","t1","t2","t3","t4","t5","t6","valueProp","undefined","paddingProp","t7","t8","t9","activeValue","focused","listFocused","state","dispatch","t10","t11","value_0","defaultRenderOption","rootElementRef","resultsPopoverElementRef","inputElementRef","listBoxElementRef","_setInputElement","Symbol","for","node","setInputElement","listFocusedRef","valueRef","valuePropRef","popoverMouseWithinRef","t12","t13","t14","t15","listBoxId","Array","isArray","t16","find","o","currentOption","t17","t18","filter","filteredOptions","filteredOptionsLen","length","activeItemId","expanded","event","setTimeout","current","elements","concat","focusInside","document","activeElement","e","contains","type","handleRootBlur","t19","event_0","listBoxElement","focusedElement","target","listFocused_0","handleRootFocus","t20","v","focus","handleOptionSelect","t21","event_1","key","preventDefault","activeOption","o_0","activeIndex","nextActiveOption","activeOption_0","o_1","activeIndex_0","nextActiveOption_0","Node","listEl","includes","handleRootKeyDown","t22","event_2","nextQuery","currentTarget","handleInputChange","t23","dispatchOpen","t24","event_3","handleInputFocus","t25","handlePopoverMouseEnter","t26","handlePopoverMouseLeave","t27","handleClearButtonClick","t28","handleClearButtonFocus","t29","t30","t31","t32","t33","t34","listElement","activeOption_1","o_2","activeIndex_1","activeItemElement","childNodes","HTMLLIElement","t35","bb0","t36","clearButton","openButtonBoxPadding","map","_temp","openButtonPadding","_temp2","openButtonProps","event_4","onClick","handleOpenClick","t37","openButtonNode","t38","bb1","t39","inputValue","event_5","handleListBoxKeyDown","t40","bb2","t41","t42","option_0","active","selected","tabIndex","t43","bb3","results","t44","t45","v_1","Math","max","v_0","RenderPopover","Exclude","Parameters"],"sources":["../src/core/components/autocomplete/autocomplete.styles.tsx","../src/core/components/autocomplete/autocompleteOption.tsx","../src/core/components/autocomplete/autocompleteReducer.ts","../src/core/components/autocomplete/constants.ts","../src/core/components/autocomplete/autocomplete.tsx"],"sourcesContent":["import {SpinnerIcon} from '@sanity/icons/Spinner'\nimport {keyframes, styled} from 'styled-components'\n\nimport {Box} from '../../primitives/box/box'\n\n/**\n * @internal\n */\nexport const StyledAutocomplete = styled.div`\n line-height: 0;\n`\n\n/**\n * @internal\n */\nexport const ListBox = styled(Box)`\n & > ul {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n`\n\nconst rotate = keyframes`\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n`\n\n/**\n * @internal\n */\nexport const AnimatedSpinnerIcon = styled(SpinnerIcon)`\n animation: ${rotate} 500ms linear infinite;\n`\n","import {useCallback} from 'react'\n\nimport {_isEnterToClickElement} from '../../helpers/element'\n\nexport interface AutocompleteOptionProps {\n children: React.ReactNode\n id: string\n onSelect: (v: string) => void\n selected: boolean\n value: string\n}\n\nexport function AutocompleteOption(props: AutocompleteOptionProps): React.JSX.Element {\n const {children, id, onSelect, selected, value} = props\n\n const handleClick = useCallback(() => {\n // Calling the `onSelect` in a timeout is a fix to\n // allow the `click` event to propagate in some cases\n setTimeout(() => {\n onSelect(value)\n }, 0)\n }, [onSelect, value])\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLLIElement>) => {\n if (event.key === 'Enter' && !_isEnterToClickElement(event.currentTarget)) {\n handleClick()\n }\n },\n [handleClick],\n )\n\n return (\n <li\n aria-selected={selected}\n data-ui=\"AutocompleteOption\"\n id={id}\n // oxlint-disable-next-line no-noninteractive-element-to-interactive-role, prefer-tag-over-role\n role=\"option\"\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {children}\n </li>\n )\n}\n","import {AutocompleteMsg, AutocompleteState} from './types'\n\n/**\n * @internal\n */\nexport function autocompleteReducer(\n state: AutocompleteState,\n msg: AutocompleteMsg,\n): AutocompleteState {\n if (msg.type === 'input/change') {\n return {...state, activeValue: null, focused: true, query: msg.query}\n }\n\n if (msg.type === 'input/focus') {\n return {...state, focused: true}\n }\n\n if (msg.type === 'root/blur') {\n return {...state, focused: false, query: null}\n }\n\n if (msg.type === 'root/clear') {\n return {...state, activeValue: null, query: null, value: null}\n }\n\n if (msg.type === 'root/escape') {\n return {...state, focused: false, query: null}\n }\n\n if (msg.type === 'root/open') {\n return {...state, query: state.query || msg.query}\n }\n\n if (msg.type === 'root/setActiveValue') {\n return {...state, activeValue: msg.value, listFocused: msg.listFocused || state.listFocused}\n }\n\n if (msg.type === 'root/setListFocused') {\n return {...state, listFocused: msg.listFocused}\n }\n\n if (msg.type === 'value/change') {\n return {...state, activeValue: msg.value, query: null, value: msg.value}\n }\n\n return state\n}\n","import {Placement} from '../../types/placement'\n\n/**\n * @internal\n */\nexport const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [\n 'Control',\n 'Shift',\n 'Alt',\n 'Enter',\n 'Home',\n 'End',\n 'PageUp',\n 'PageDown',\n 'Meta',\n 'Tab',\n 'CapsLock',\n]\n\n/**\n * @internal\n */\nexport const AUTOCOMPLETE_POPOVER_PLACEMENT: Placement = 'bottom-start'\n\n/**\n * @internal\n */\nexport const AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS: Placement[] = ['bottom-start', 'top-start']\n","import {ChevronDownIcon} from '@sanity/icons/ChevronDown'\nimport {\n ChangeEvent,\n cloneElement,\n ElementType,\n FocusEvent,\n HTMLProps,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n Ref,\n startTransition,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from 'react'\n\nimport {EMPTY_ARRAY, EMPTY_RECORD} from '../../constants'\nimport {_raf} from '../../helpers/animation'\nimport {_hasFocus, focusFirstDescendant} from '../../helpers/focus'\nimport {Box, BoxProps} from '../../primitives/box/box'\nimport {Button} from '../../primitives/button/button'\nimport {Card} from '../../primitives/card/card'\nimport {Popover, PopoverProps} from '../../primitives/popover/popover'\nimport {Stack} from '../../primitives/stack/stack'\nimport {Text} from '../../primitives/text/text'\nimport {TextInput} from '../../primitives/textInput/textInput'\nimport {_getArrayProp} from '../../styles/helpers'\nimport {Radius} from '../../types/radius'\nimport {AnimatedSpinnerIcon, ListBox, StyledAutocomplete} from './autocomplete.styles'\nimport {AutocompleteOption} from './autocompleteOption'\nimport {autocompleteReducer} from './autocompleteReducer'\nimport {\n AUTOCOMPLETE_LISTBOX_IGNORE_KEYS,\n AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS,\n AUTOCOMPLETE_POPOVER_PLACEMENT,\n} from './constants'\nimport {AutocompleteOpenButtonProps, BaseAutocompleteOption} from './types'\n\n/**\n * @public\n */\nexport interface AutocompleteProps<Option extends BaseAutocompleteOption = BaseAutocompleteOption> {\n border?: boolean\n customValidity?: string\n filterOption?: (query: string, option: Option) => boolean\n fontSize?: number | number[]\n // oxlint-disable-next-line no-redundant-type-constituents\n icon?: ElementType | ReactNode\n id: string\n /** @beta */\n listBox?: BoxProps\n loading?: boolean\n onChange?: (value: string) => void\n onQueryChange?: (query: string | null) => void\n onSelect?: (value: string) => void\n /** @beta */\n openButton?: boolean | AutocompleteOpenButtonProps\n /** @beta */\n openOnFocus?: boolean\n /** The options to render. */\n options?: Option[]\n padding?: number | number[]\n popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> &\n Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>\n prefix?: ReactNode\n radius?: Radius | Radius[]\n /** @beta */\n relatedElements?: HTMLElement[]\n /** The callback function for rendering each option. */\n renderOption?: (option: Option) => React.JSX.Element\n /** @beta */\n renderPopover?: (\n props: {\n content: React.JSX.Element | null\n hidden: boolean\n inputElement: HTMLInputElement | null\n onMouseEnter: () => void\n onMouseLeave: () => void\n },\n ref: Ref<HTMLDivElement>,\n ) => ReactNode\n renderValue?: (value: string, option?: Option) => string\n suffix?: ReactNode\n /** The current value. */\n value?: string\n}\n\nconst DEFAULT_RENDER_VALUE = (value: string, option?: BaseAutocompleteOption) =>\n option ? option.value : value\n\nconst DEFAULT_FILTER_OPTION = (query: string, option: BaseAutocompleteOption) =>\n option.value.toLowerCase().indexOf(query.toLowerCase()) > -1\n\n/**\n * The Autocomplete component is typically used for search components.\n * It consists of a text input for writing a query, and properties for rendering suggestions.\n *\n * @public\n */\nexport function Autocomplete<Option extends BaseAutocompleteOption>(\n props: AutocompleteProps<Option> &\n Omit<\n HTMLProps<HTMLInputElement>,\n | 'aria-activedescendant'\n | 'aria-autocomplete'\n | 'aria-expanded'\n | 'aria-owns'\n | 'as'\n | 'autoCapitalize'\n | 'autoComplete'\n | 'autoCorrect'\n | 'id'\n | 'inputMode'\n | 'onChange'\n | 'onSelect'\n | 'popover'\n | 'prefix'\n | 'role'\n | 'spellCheck'\n | 'type'\n | 'value'\n >,\n) {\n const {\n border = true,\n customValidity,\n disabled,\n filterOption: filterOptionProp,\n fontSize = 2,\n icon,\n id,\n listBox = EMPTY_RECORD,\n loading,\n onBlur,\n onChange,\n onFocus,\n onQueryChange,\n onSelect,\n openButton,\n openOnFocus,\n options: optionsProp,\n padding: paddingProp = 3,\n popover = EMPTY_RECORD,\n prefix,\n radius = 2,\n readOnly,\n ref: forwardedRef,\n relatedElements,\n renderOption: renderOptionProp,\n renderPopover,\n renderValue = DEFAULT_RENDER_VALUE,\n suffix,\n value: valueProp,\n ...restProps\n } = props\n\n const [state, dispatch] = useReducer(autocompleteReducer, {\n activeValue: valueProp || null,\n focused: false,\n listFocused: false,\n query: null,\n value: valueProp || null,\n })\n\n const {activeValue, focused, listFocused, query, value} = state\n\n const defaultRenderOption = useCallback(\n ({value}: BaseAutocompleteOption) => (\n <Card data-as=\"button\" padding={paddingProp} radius={2} tone=\"inherit\">\n <Text size={fontSize} textOverflow=\"ellipsis\">\n {value}\n </Text>\n </Card>\n ),\n [fontSize, paddingProp],\n )\n\n const renderOption =\n typeof renderOptionProp === 'function' ? renderOptionProp : defaultRenderOption\n\n const filterOption =\n typeof filterOptionProp === 'function' ? filterOptionProp : DEFAULT_FILTER_OPTION\n\n // Element refs\n const rootElementRef = useRef<HTMLDivElement | null>(null)\n const resultsPopoverElementRef = useRef<HTMLDivElement | null>(null)\n const inputElementRef = useRef<HTMLInputElement | null>(null)\n const listBoxElementRef = useRef<HTMLUListElement | null>(null)\n // Element refs that need to be accessed during render\n const [inputElement, _setInputElement] = useState<HTMLInputElement | null>(null)\n /**\n * The startTransition wrapper here is to avoid an issue when on React 18 where this error can happen:\n * >Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\n * This doesn't happen on React 19 due to automatic batching of all state updates, the startTransition wrapper here gives a type of batching for 18 users in a way that still works with 19.\n * NOTE: The startTransition wrapper is not needed in UI v4, since the baseline there is React 19.\n */\n const setInputElement = useCallback((node: HTMLInputElement | null) => {\n startTransition(() => _setInputElement(node))\n }, [])\n\n // Value refs\n const listFocusedRef = useRef(false)\n const valueRef = useRef(value)\n const valuePropRef = useRef(valueProp)\n const popoverMouseWithinRef = useRef(false)\n\n // Forward inputElement state to inputElementRef\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n inputElementRef,\n () => inputElement,\n [inputElement],\n )\n // Forward inputElement to parent\n useImperativeHandle<HTMLInputElement | null, HTMLInputElement | null>(\n forwardedRef,\n () => inputElement,\n [inputElement],\n )\n\n const listBoxId = `${id}-listbox`\n const options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY\n const padding = _getArrayProp(paddingProp)\n const currentOption = useMemo(\n () => (value !== null ? options.find((o) => o.value === value) : undefined),\n [options, value],\n )\n const filteredOptions = useMemo(\n () => options.filter((option) => (query ? filterOption(query, option) : true)),\n [filterOption, options, query],\n )\n const filteredOptionsLen = filteredOptions.length\n const activeItemId = activeValue ? `${id}-option-${activeValue}` : undefined\n const expanded = (query !== null && loading) || (focused && query !== null)\n\n const handleRootBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n setTimeout(() => {\n // NOTE: This is a workaround for a bug that may happen in Chrome (clicking the scrollbar\n // closes the results in certain situations):\n // - Do not handle blur if the mouse is within the popover\n if (popoverMouseWithinRef.current) {\n return\n }\n\n const elements: HTMLElement[] = (relatedElements || []).concat(\n rootElementRef.current ? [rootElementRef.current] : [],\n resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : [],\n )\n\n let focusInside = false\n\n if (document.activeElement) {\n for (const e of elements) {\n if (e === document.activeElement || e.contains(document.activeElement)) {\n focusInside = true\n break\n }\n }\n }\n\n // oxlint-disable-next-line no-unnecessary-boolean-literal-compare\n if (focusInside === false) {\n dispatch({type: 'root/blur'})\n popoverMouseWithinRef.current = false\n if (onQueryChange) onQueryChange(null)\n if (onBlur) onBlur(event)\n }\n }, 0)\n },\n [onBlur, onQueryChange, relatedElements],\n )\n\n const handleRootFocus = useCallback((event: FocusEvent<HTMLDivElement>) => {\n const listBoxElement = listBoxElementRef.current\n const focusedElement = event.target instanceof HTMLElement ? event.target : null\n const listFocused = listBoxElement?.contains(focusedElement) || false\n\n if (listFocused !== listFocusedRef.current) {\n listFocusedRef.current = listFocused\n\n dispatch({type: 'root/setListFocused', listFocused})\n }\n }, [])\n\n const handleOptionSelect = useCallback(\n (v: string) => {\n dispatch({type: 'value/change', value: v})\n\n popoverMouseWithinRef.current = false\n\n if (onSelect) onSelect(v)\n\n valueRef.current = v\n\n if (onChange) onChange(v)\n if (onQueryChange) onQueryChange(null)\n\n inputElementRef.current?.focus()\n },\n [onChange, onSelect, onQueryChange],\n )\n\n const handleRootKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault()\n\n if (!filteredOptionsLen) return\n\n const activeOption = filteredOptions.find((o) => o.value === activeValue)\n const activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1\n const nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen]\n\n if (nextActiveOption) {\n dispatch({type: 'root/setActiveValue', value: nextActiveOption.value, listFocused: true})\n }\n\n return\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault()\n\n if (!filteredOptionsLen) return\n\n const activeOption = filteredOptions.find((o) => o.value === activeValue)\n const activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1\n const nextActiveOption =\n filteredOptions[\n activeIndex === -1\n ? filteredOptionsLen - 1\n : (filteredOptionsLen + activeIndex - 1) % filteredOptionsLen\n ]\n\n if (nextActiveOption) {\n dispatch({type: 'root/setActiveValue', value: nextActiveOption.value, listFocused: true})\n }\n\n return\n }\n\n if (event.key === 'Escape') {\n dispatch({type: 'root/escape'})\n popoverMouseWithinRef.current = false\n if (onQueryChange) onQueryChange(null)\n inputElementRef.current?.focus()\n\n return\n }\n\n // oxlint-disable-next-line no-unsafe-type-assertion\n const target = event.target as Node\n const listEl = listBoxElementRef.current\n\n if (\n (listEl === target || listEl?.contains(target)) &&\n !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event.key)\n ) {\n inputElementRef.current?.focus()\n\n return\n }\n },\n [activeValue, filteredOptions, filteredOptionsLen, onQueryChange],\n )\n\n const handleInputChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const nextQuery = event.currentTarget.value\n\n dispatch({type: 'input/change', query: nextQuery})\n\n if (onQueryChange) onQueryChange(nextQuery)\n },\n [onQueryChange],\n )\n\n const dispatchOpen = useCallback(() => {\n dispatch({\n type: 'root/open',\n query: value ? renderValue(value, currentOption) : '',\n })\n }, [currentOption, renderValue, value])\n\n const handleInputFocus = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n if (!focused) {\n dispatch({type: 'input/focus'})\n\n if (onFocus) onFocus(event)\n if (openOnFocus) dispatchOpen()\n }\n },\n [focused, onFocus, openOnFocus, dispatchOpen],\n )\n\n const handlePopoverMouseEnter = useCallback(() => {\n popoverMouseWithinRef.current = true\n }, [])\n\n const handlePopoverMouseLeave = useCallback(() => {\n popoverMouseWithinRef.current = false\n }, [])\n\n const handleClearButtonClick = useCallback(() => {\n dispatch({type: 'root/clear'})\n valueRef.current = ''\n if (onChange) onChange('')\n if (onQueryChange) onQueryChange(null)\n inputElementRef.current?.focus()\n }, [onChange, onQueryChange])\n\n const handleClearButtonFocus = useCallback(() => {\n dispatch({type: 'input/focus'})\n }, [])\n\n // Change the value when `value` prop changes\n useEffect(() => {\n // If `valueProp` changed\n if (valueProp !== valuePropRef.current) {\n valuePropRef.current = valueProp\n\n if (valueProp !== undefined) {\n dispatch({type: 'value/change', value: valueProp})\n valueRef.current = valueProp\n }\n\n return\n }\n\n // If `valueProp` is not equal to `value`\n if (valueProp !== valueRef.current) {\n valueRef.current = valueProp || null\n\n dispatch({type: 'value/change', value: valueProp || null})\n }\n }, [valueProp])\n\n // Reset active item when closing\n useEffect(() => {\n if (!focused && valueRef.current) {\n dispatch({type: 'root/setActiveValue', value: valueRef.current})\n }\n }, [focused])\n\n // Focus the selected item\n useEffect(() => {\n const listElement = listBoxElementRef.current\n\n if (!listElement) return\n\n const activeOption = filteredOptions.find((o) => o.value === activeValue)\n\n if (activeOption) {\n const activeIndex = filteredOptions.indexOf(activeOption)\n // oxlint-disable-next-line no-unsafe-type-assertion\n const activeItemElement = listElement.childNodes[activeIndex] as HTMLLIElement | undefined\n\n if (activeItemElement) {\n if (_hasFocus(activeItemElement)) {\n // already focused\n return\n }\n\n focusFirstDescendant(activeItemElement)\n }\n }\n }, [activeValue, filteredOptions])\n\n const clearButton = useMemo(() => {\n if (!loading && !disabled && value) {\n return {\n 'aria-label': 'Clear',\n 'onFocus': handleClearButtonFocus,\n }\n }\n\n return undefined\n }, [disabled, handleClearButtonFocus, loading, value])\n\n const openButtonBoxPadding = padding.map((v) => {\n if (v === 0) return 0\n if (v === 1) return 1\n if (v === 2) return 1\n\n return v - 2\n })\n const openButtonPadding = padding.map((v) => Math.max(v - 1, 0))\n const openButtonProps: AutocompleteOpenButtonProps = useMemo(\n () => (typeof openButton === 'object' ? openButton : EMPTY_RECORD),\n [openButton],\n )\n\n const handleOpenClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n dispatchOpen()\n\n if (openButtonProps.onClick) openButtonProps.onClick(event)\n\n _raf(() => inputElementRef.current?.focus())\n },\n [openButtonProps, dispatchOpen],\n )\n\n const openButtonNode = useMemo(\n () =>\n !disabled && !readOnly && openButton ? (\n <Box aria-hidden={expanded} padding={openButtonBoxPadding}>\n <Button\n aria-label=\"Open\"\n disabled={expanded}\n fontSize={fontSize}\n icon={ChevronDownIcon}\n mode=\"bleed\"\n padding={openButtonPadding}\n {...openButtonProps}\n onClick={handleOpenClick}\n />\n </Box>\n ) : undefined,\n [\n disabled,\n expanded,\n fontSize,\n handleOpenClick,\n openButton,\n openButtonBoxPadding,\n openButtonPadding,\n openButtonProps,\n readOnly,\n ],\n )\n\n const inputValue = useMemo(() => {\n if (query === null) {\n if (value !== null) {\n return renderValue(value, currentOption)\n }\n\n return ''\n }\n\n return query\n }, [currentOption, query, renderValue, value])\n\n const handleListBoxKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n // If the focus is currently in the list, move focus to the input element\n if (event.key === 'Tab') {\n if (listFocused) inputElementRef.current?.focus()\n }\n },\n [listFocused],\n )\n\n const content = useMemo(() => {\n if (filteredOptions.length === 0) return null\n\n return (\n <ListBox\n data-ui=\"AutoComplete__results\"\n onKeyDown={handleListBoxKeyDown}\n padding={1}\n {...listBox}\n tabIndex={-1}\n >\n <Stack\n as=\"ul\"\n aria-multiselectable={false}\n data-ui=\"AutoComplete__resultsList\"\n id={listBoxId}\n ref={listBoxElementRef}\n // oxlint-disable-next-line prefer-tag-over-role\n role=\"listbox\"\n gap={1}\n >\n {filteredOptions.map((option) => {\n const active =\n activeValue !== null ? option.value === activeValue : currentOption === option\n\n return (\n <AutocompleteOption\n id={`${id}-option-${option.value}`}\n key={option.value}\n onSelect={handleOptionSelect}\n selected={active}\n value={option.value}\n >\n {cloneElement(renderOption(option), {\n disabled: loading,\n selected: active,\n tabIndex: listFocused && active ? 0 : -1,\n })}\n </AutocompleteOption>\n )\n })}\n </Stack>\n </ListBox>\n )\n }, [\n activeValue,\n currentOption,\n filteredOptions,\n handleOptionSelect,\n handleListBoxKeyDown,\n id,\n listBox,\n listBoxId,\n listFocused,\n loading,\n renderOption,\n ])\n\n const results = useMemo(() => {\n if (renderPopover) {\n return (\n <RenderPopover\n content={content}\n hidden={!expanded}\n inputElement={inputElement}\n onMouseEnter={handlePopoverMouseEnter}\n onMouseLeave={handlePopoverMouseLeave}\n resultsPopoverElementRef={resultsPopoverElementRef}\n renderPopover={renderPopover}\n />\n )\n }\n\n if (filteredOptionsLen === 0) {\n return null\n }\n\n return (\n <Popover\n arrow={false}\n constrainSize\n content={content}\n fallbackPlacements={AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS}\n matchReferenceWidth\n onMouseEnter={handlePopoverMouseEnter}\n onMouseLeave={handlePopoverMouseLeave}\n open={expanded}\n overflow=\"auto\"\n placement={AUTOCOMPLETE_POPOVER_PLACEMENT}\n portal\n radius={radius}\n ref={resultsPopoverElementRef}\n referenceElement={inputElement}\n {...popover}\n />\n )\n }, [\n content,\n expanded,\n filteredOptionsLen,\n handlePopoverMouseEnter,\n handlePopoverMouseLeave,\n inputElement,\n popover,\n radius,\n renderPopover,\n ])\n\n return (\n <StyledAutocomplete\n data-ui=\"Autocomplete\"\n onBlur={handleRootBlur}\n onFocus={handleRootFocus}\n onKeyDown={handleRootKeyDown}\n ref={rootElementRef}\n >\n <TextInput\n {...restProps}\n aria-activedescendant={activeItemId}\n aria-autocomplete=\"list\"\n aria-expanded={expanded}\n aria-owns={listBoxId}\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n border={border}\n clearButton={clearButton}\n customValidity={customValidity}\n disabled={disabled}\n fontSize={fontSize}\n icon={icon}\n iconRight={loading && AnimatedSpinnerIcon}\n id={id}\n inputMode=\"search\"\n onChange={handleInputChange}\n onClear={handleClearButtonClick}\n onFocus={handleInputFocus}\n padding={padding}\n prefix={prefix}\n radius={radius}\n readOnly={readOnly}\n ref={setInputElement}\n // oxlint-disable-next-line prefer-tag-over-role, role-has-required-aria-props\n role=\"combobox\"\n spellCheck={false}\n suffix={suffix || openButtonNode}\n value={inputValue}\n />\n {results}\n </StyledAutocomplete>\n )\n}\n\nfunction RenderPopover({\n renderPopover,\n content,\n hidden,\n inputElement,\n onMouseEnter,\n onMouseLeave,\n resultsPopoverElementRef,\n}: {\n renderPopover: Exclude<AutocompleteProps['renderPopover'], undefined>\n resultsPopoverElementRef: Parameters<Exclude<AutocompleteProps['renderPopover'], undefined>>[1]\n} & Parameters<Exclude<AutocompleteProps['renderPopover'], undefined>>[0]) {\n return renderPopover(\n {\n content,\n hidden,\n inputElement,\n onMouseEnter,\n onMouseLeave,\n },\n resultsPopoverElementRef,\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAQA,MAAaI,qBAAqBF,OAAOG,IAAAA,WAAAA;;;AAAG,CAAA,CAAA,kBAO/BC,UAAUJ,OAAOC,GAAG,CAAC,CAAA,WAAA;;;iDAQ5BI,SAASN,SAAS,8DAaXO,sBAAsBN,OAAOF,WAAW,CAAC,CAAA,WAAA;;;AACvCO,CAAAA,CAAAA,aAAAA,OAAM;ACzBrB,SAAOa,mBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,EAAA,GACL,EAAAX,UAAAG,IAAAC,UAAAE,UAAAC,UAAkDE,OAAKG;CAAA,AAAAF,EAAA,OAAAN,YAAAM,EAAA,OAAAH,SAEvBK,WAAA;EAG9BC,iBAAW;GACTT,SAASG,KAAK;EAAC,GACd,CAAC;CAAC,GACNG,EAAA,KAAAN,UA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AAAwK,OAAAA,MAAAxK,EAAA,MAxCrBwK;AAwCqB;AA7lBlB,SAAAzB,OAAA0B,KAAA;CAAA,OAoYwCC,KAAIC,IAAKtF,MAAI,GAAG,CAAC;AAAC;AApY1D,SAAAwD,MAAA+B,KAAA;CAgYkB,OAFjBvF,QAAM,IAAU,IAChBA,QAAM,KACNA,QAAM,IAAU,IAEbA,MAAI;AAAC;AA+NhB,SAASwF,cAAc,EACrB7L,eACAE,SACAC,QACAC,cACAE,cACAC,cACA2C,4BAIyE;CACzE,OAAOlD,cACL;EACEE;EACAC;EACAC;EACAE;EACAC;CACF,GACA2C,wBACF;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta
|
|
3
|
+
*/
|
|
4
|
+
interface BreadcrumbsProps {
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
separator?: React.ReactNode;
|
|
7
|
+
gap?: number | number[];
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `gap` instead.
|
|
10
|
+
*/
|
|
11
|
+
space?: never;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
declare function Breadcrumbs(props: BreadcrumbsProps & Omit<React.HTMLProps<HTMLOListElement>, 'as' | 'type'>): import("react").JSX.Element;
|
|
17
|
+
export { Breadcrumbs, type BreadcrumbsProps };
|
|
18
|
+
//# sourceMappingURL=breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","names":[],"sources":["../src/core/components/breadcrumbs/breadcrumbs.tsx"],"mappings":"AAaA;;;UAAiB;EACf;EACA,YAAY,MAAM;EAClB;;;;EAIA;;;;;iBAMc,YACd,OAAO,mBAAmB,KAAK,MAAM,UAAU,oDAAiC,IAAA"}
|