@sanity/ui 3.0.0-static.33 → 3.0.0-static.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +263 -375
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/refractor.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +263 -377
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/refractor.js.map +1 -1
- package/dist/_visual-editing.cjs +0 -2
- package/dist/_visual-editing.cjs.map +1 -1
- package/dist/_visual-editing.d.cts +34 -85
- package/dist/_visual-editing.d.ts +34 -85
- package/dist/_visual-editing.js +2 -4
- package/dist/css/index.cjs +12 -12
- package/dist/css/index.cjs.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/index.d.cts +383 -13934
- package/dist/css/index.d.ts +383 -13934
- package/dist/css/index.js +12 -12
- package/dist/css/index.js.map +1 -1
- package/dist/index.cjs +241 -366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +107 -817
- package/dist/index.d.ts +107 -817
- package/dist/index.js +243 -360
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +367 -4288
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +180 -1582
- package/dist/theme.d.ts +180 -1582
- package/dist/theme.js +371 -4292
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +0 -2
- package/package.json +3 -4
- package/src/core/Root.tsx +4 -2
- package/src/core/RootProvider.tsx +4 -4
- package/src/core/__workshop__/boundary.tsx +1 -1
- package/src/core/__workshop__/index.ts +5 -3
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/example.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/index.ts +5 -3
- package/src/core/components/autocomplete/__workshop__/mock/apiStore.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/mock/countries.ts +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +2 -2
- package/src/core/components/autocomplete/autocompleteOption.tsx +2 -2
- package/src/core/components/autocomplete/constants.ts +2 -2
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -1
- package/src/core/components/breadcrumbs/__workshop__/index.ts +5 -3
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +6 -11
- package/src/core/components/dialog/__workshop__/activate.tsx +1 -1
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +1 -1
- package/src/core/components/dialog/__workshop__/index.ts +5 -3
- package/src/core/components/dialog/__workshop__/layering.tsx +1 -1
- package/src/core/components/dialog/__workshop__/nested.tsx +2 -3
- package/src/core/components/dialog/__workshop__/onScroll.tsx +1 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/__workshop__/position.tsx +1 -1
- package/src/core/components/dialog/__workshop__/props.tsx +1 -1
- package/src/core/components/dialog/__workshop__/provider.tsx +1 -1
- package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +5 -6
- package/src/core/components/dialog/dialogCard.tsx +2 -2
- package/src/core/components/dialog/dialogContext.ts +3 -4
- package/src/core/components/dialog/dialogProvider.tsx +2 -2
- package/src/core/components/hotkeys/__workshop__/index.ts +5 -3
- package/src/core/components/hotkeys/__workshop__/plain.tsx +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +4 -15
- package/src/core/components/menu/__workshop__/asComponent.tsx +1 -1
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -1
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +1 -1
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +3 -3
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +1 -1
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -1
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
- package/src/core/components/menu/__workshop__/groups.tsx +1 -1
- package/src/core/components/menu/__workshop__/index.ts +5 -3
- package/src/core/components/menu/__workshop__/menuButton.tsx +2 -2
- package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
- package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
- package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +1 -1
- package/src/core/components/menu/__workshop__/selectedItem.tsx +1 -1
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -1
- package/src/core/components/menu/__workshop__/tones.tsx +3 -3
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
- package/src/core/components/menu/menu.test.tsx +2 -1
- package/src/core/components/menu/menu.tsx +7 -22
- package/src/core/components/menu/menuButton.tsx +4 -50
- package/src/core/components/menu/menuContext.ts +3 -15
- package/src/core/components/menu/menuDivider.tsx +2 -2
- package/src/core/components/menu/menuGroup.tsx +10 -15
- package/src/core/components/menu/menuItem.tsx +7 -18
- package/src/core/components/tab/__workshop__/example.tsx +1 -1
- package/src/core/components/tab/__workshop__/index.ts +5 -3
- package/src/core/components/tab/tab.tsx +6 -4
- package/src/core/components/tab/tabList.tsx +3 -8
- package/src/core/components/tab/tabPanel.tsx +2 -2
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/__workshop__/index.ts +5 -3
- package/src/core/components/toast/__workshop__/toast.tsx +1 -1
- package/src/core/components/toast/toast.test.tsx +2 -1
- package/src/core/components/toast/toast.tsx +2 -2
- package/src/core/components/toast/toastContext.ts +4 -4
- package/src/core/components/toast/toastLayer.tsx +3 -3
- package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
- package/src/core/components/tree/__workshop__/basic.tsx +1 -1
- package/src/core/components/tree/__workshop__/index.ts +5 -3
- package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
- package/src/core/components/tree/tree.tsx +8 -9
- package/src/core/components/tree/treeContext.ts +4 -4
- package/src/core/components/tree/treeGroup.tsx +6 -8
- package/src/core/components/tree/treeItem.tsx +4 -4
- package/src/core/components/tree/types.ts +1 -1
- package/src/core/components/virtualList/__workshop__/changingProps.tsx +1 -1
- package/src/core/components/virtualList/__workshop__/elementScroll.tsx +1 -1
- package/src/core/components/virtualList/__workshop__/index.ts +5 -3
- package/src/core/components/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/components/virtualList/__workshop__/windowScrolll.tsx +1 -1
- package/src/core/components/virtualList/virtualList.tsx +2 -2
- package/src/core/constants.ts +0 -18
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +5 -3
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +6 -1
- package/src/core/index.ts +1 -24
- package/src/core/lib/createGlobalScopedContext.ts +1 -1
- package/src/core/lib/globalScope.ts +1 -1
- package/src/core/observers/elementSize.ts +1 -1
- package/src/core/primitives/arrow/arrow.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/index.ts +5 -3
- package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +3 -10
- package/src/core/primitives/avatar/avatarCounter.tsx +2 -2
- package/src/core/primitives/avatar/avatarStack.tsx +2 -4
- package/src/core/primitives/avatar/types.ts +0 -32
- package/src/core/primitives/badge/__workshop__/index.ts +5 -3
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +3 -3
- package/src/core/primitives/badge/badge.test.tsx +2 -1
- package/src/core/primitives/badge/badge.tsx +12 -11
- package/src/core/primitives/box/__workshop__/index.ts +5 -3
- package/src/core/primitives/box/__workshop__/props.tsx +1 -1
- package/src/core/primitives/box/__workshop__/responsive.tsx +1 -1
- package/src/core/primitives/box/box.tsx +28 -32
- package/src/core/primitives/button/__workshop__/custom.tsx +5 -5
- package/src/core/primitives/button/__workshop__/customIcons.tsx +1 -1
- package/src/core/primitives/button/__workshop__/disabled.tsx +3 -3
- package/src/core/primitives/button/__workshop__/index.ts +5 -3
- package/src/core/primitives/button/__workshop__/mixedChildren.tsx +1 -1
- package/src/core/primitives/button/__workshop__/props.tsx +1 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/stacked.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +1 -1
- package/src/core/primitives/button/__workshop__/uploadButton.tsx +1 -1
- package/src/core/primitives/button/button.test.tsx +2 -1
- package/src/core/primitives/button/button.tsx +4 -7
- package/src/core/primitives/button/types.ts +0 -20
- package/src/core/primitives/card/__workshop__/asButton.tsx +2 -2
- package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
- package/src/core/primitives/card/__workshop__/checkered.tsx +3 -3
- package/src/core/primitives/card/__workshop__/index.ts +5 -3
- package/src/core/primitives/card/__workshop__/interactive.tsx +1 -1
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -1
- package/src/core/primitives/card/__workshop__/props.tsx +1 -1
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/__workshop__/tones.tsx +3 -3
- package/src/core/primitives/card/card.tsx +4 -2
- package/src/core/primitives/card/cardContext.ts +1 -1
- package/src/core/primitives/card/cardProvider.tsx +4 -4
- package/src/core/primitives/card/types.ts +5 -19
- package/src/core/primitives/checkbox/__workshop__/example.tsx +1 -1
- package/src/core/primitives/checkbox/__workshop__/index.ts +5 -3
- package/src/core/primitives/checkbox/__workshop__/props.tsx +1 -1
- package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +3 -3
- package/src/core/primitives/checkbox/checkbox.tsx +2 -2
- package/src/core/primitives/code/__workshop__/index.ts +5 -3
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/code/__workshop__/props.tsx +1 -1
- package/src/core/primitives/code/code.tsx +4 -2
- package/src/core/primitives/code/refractor.tsx +1 -1
- package/src/core/primitives/container/__workshop__/example.tsx +1 -1
- package/src/core/primitives/container/__workshop__/index.ts +5 -3
- package/src/core/primitives/container/container.tsx +2 -2
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/__workshop__/gap.tsx +1 -1
- package/src/core/primitives/flex/__workshop__/index.ts +5 -3
- package/src/core/primitives/flex/flex.tsx +4 -2
- package/src/core/primitives/grid/__workshop__/index.ts +5 -3
- package/src/core/primitives/grid/__workshop__/responsive.tsx +3 -3
- package/src/core/primitives/grid/grid.tsx +4 -2
- package/src/core/primitives/heading/__workshop__/index.ts +5 -3
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/heading/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/heading/heading.tsx +2 -4
- package/src/core/primitives/inline/__workshop__/index.ts +5 -3
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +4 -11
- package/src/core/primitives/kbd/__workshop__/index.ts +5 -3
- package/src/core/primitives/kbd/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/kbd/kbd.tsx +4 -2
- package/src/core/primitives/label/__workshop__/index.ts +5 -3
- package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/label/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/label/label.tsx +2 -4
- package/src/core/primitives/layer/__workshop__/_debug.tsx +1 -1
- package/src/core/primitives/layer/__workshop__/index.ts +5 -3
- package/src/core/primitives/layer/__workshop__/multipleRoots.tsx +1 -1
- package/src/core/primitives/layer/__workshop__/nested.tsx +1 -1
- package/src/core/primitives/layer/__workshop__/responsiveZOffset.tsx +1 -1
- package/src/core/primitives/layer/layer.test.tsx +2 -1
- package/src/core/primitives/layer/layer.tsx +2 -2
- package/src/core/primitives/layer/layerCard.tsx +2 -2
- package/src/core/primitives/layer/layerContext.ts +4 -4
- package/src/core/primitives/layer/layerProvider.tsx +2 -10
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/index.ts +5 -3
- package/src/core/primitives/popover/popover.tsx +4 -9
- package/src/core/primitives/popover/popoverLayer.tsx +2 -2
- package/src/core/primitives/radio/__workshop__/example.tsx +1 -1
- package/src/core/primitives/radio/__workshop__/index.ts +5 -3
- package/src/core/primitives/radio/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +2 -2
- package/src/core/primitives/select/__workshop__/index.ts +5 -3
- package/src/core/primitives/select/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/select/select.tsx +5 -15
- package/src/core/primitives/selectable/selectable.tsx +4 -4
- package/src/core/primitives/skeleton/__workshop__/delay.tsx +1 -1
- package/src/core/primitives/skeleton/__workshop__/index.ts +5 -3
- package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +2 -2
- package/src/core/primitives/skeleton/codeSkeleton.tsx +2 -2
- package/src/core/primitives/skeleton/headingSkeleton.tsx +2 -2
- package/src/core/primitives/skeleton/labelSkeleton.tsx +2 -2
- package/src/core/primitives/skeleton/skeleton.tsx +2 -2
- package/src/core/primitives/skeleton/textSkeleton.tsx +2 -2
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -1
- package/src/core/primitives/spinner/__workshop__/index.ts +5 -3
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +2 -2
- package/src/core/primitives/spinner/spinner.tsx +2 -2
- package/src/core/primitives/srOnly/srOnly.tsx +2 -2
- package/src/core/primitives/stack/__workshop__/index.ts +5 -3
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +5 -10
- package/src/core/primitives/switch/__workshop__/example.tsx +1 -1
- package/src/core/primitives/switch/__workshop__/index.ts +5 -3
- package/src/core/primitives/switch/__workshop__/props.tsx +1 -1
- package/src/core/primitives/switch/switch.tsx +2 -2
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/__workshop__/example.tsx +1 -1
- package/src/core/primitives/text/__workshop__/index.ts +5 -3
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/text/text.tsx +4 -4
- package/src/core/primitives/textArea/__workshop__/index.ts +5 -3
- package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textArea/textArea.tsx +5 -15
- package/src/core/primitives/textInput/__workshop__/clearButton.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/index.ts +5 -3
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/states.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/tones.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +6 -9
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/index.ts +5 -3
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/props.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.test.tsx +2 -4
- package/src/core/primitives/tooltip/tooltip.tsx +5 -9
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +4 -2
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +5 -3
- package/src/core/primitives/tooltip/tooltipLayer.tsx +2 -2
- package/src/core/{types/props.ts → types.ts} +27 -0
- package/src/core/utils/boundaryElement/__workshop__/index.ts +5 -3
- package/src/core/utils/boundaryElement/__workshop__/plain.tsx +1 -1
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +2 -1
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +7 -4
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +2 -2
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/index.ts +5 -3
- package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
- package/src/core/utils/getElementRef.ts +1 -1
- package/src/core/utils/portal/__workshop__/index.ts +5 -3
- package/src/core/utils/portal/__workshop__/named.tsx +1 -1
- package/src/core/utils/portal/portal.test.tsx +2 -1
- package/src/core/utils/portal/portalContext.ts +5 -2
- package/src/core/utils/portal/portalProvider.tsx +5 -9
- package/src/css/_responsiveClassName.ts +2 -2
- package/src/css/_style.css.ts +1 -1
- package/src/css/components/breadcrumbs/breadcrumbs.css.ts +1 -1
- package/src/css/components/dialog/dialog.css.ts +9 -17
- package/src/css/components/menu/menu.css.ts +2 -2
- package/src/css/components/menu/menu.ts +2 -2
- package/src/css/components/skeleton/skeleton.css.ts +2 -6
- package/src/css/components/toast/toast.css.ts +2 -2
- package/src/css/components/toast/toast.ts +2 -2
- package/src/css/components/tree/tree.css.ts +1 -1
- package/src/css/components/tree/tree.ts +1 -1
- package/src/css/defaultTheme.css.ts +59 -60
- package/src/css/layers.css.ts +4 -1
- package/src/css/primitives/_arrow/_arrow.css.ts +5 -5
- package/src/css/primitives/_input/_input.css.ts +4 -4
- package/src/css/primitives/_selectable/_selectable.css.ts +4 -4
- package/src/css/primitives/_selectable/types.ts +2 -2
- package/src/css/primitives/avatar/avatar.css.ts +10 -10
- package/src/css/primitives/badge/badge.css.ts +4 -4
- package/src/css/primitives/badge/types.ts +8 -2
- package/src/css/primitives/box/box.css.ts +2 -2
- package/src/css/primitives/button/button.css.ts +6 -6
- package/src/css/primitives/button/button.ts +2 -2
- package/src/css/primitives/button/types.ts +3 -3
- package/src/css/primitives/card/__workshop__/color.tsx +9 -9
- package/src/css/primitives/card/__workshop__/index.ts +5 -3
- package/src/css/primitives/card/card.css.ts +12 -18
- package/src/css/primitives/card/types.ts +3 -3
- package/src/css/primitives/checkbox/checkbox.css.ts +3 -3
- package/src/css/primitives/checkbox/checkbox.ts +3 -3
- package/src/css/primitives/code/code.css.ts +4 -3
- package/src/css/primitives/code/types.ts +3 -4
- package/src/css/primitives/container/container.css.ts +1 -1
- package/src/css/primitives/heading/heading.css.ts +5 -4
- package/src/css/primitives/heading/types.ts +3 -6
- package/src/css/primitives/kbd/kbd.css.ts +1 -1
- package/src/css/primitives/label/label.css.ts +5 -4
- package/src/css/primitives/label/types.ts +0 -8
- package/src/css/primitives/popover/popover.css.ts +2 -2
- package/src/css/primitives/popover/popover.ts +2 -2
- package/src/css/primitives/radio/radio.css.ts +3 -3
- package/src/css/primitives/radio/radio.ts +3 -3
- package/src/css/primitives/root/root.css.ts +1 -1
- package/src/css/primitives/root/root.ts +1 -1
- package/src/css/primitives/root/types.ts +3 -3
- package/src/css/primitives/select/select.css.ts +3 -3
- package/src/css/primitives/spinner/spinner.css.ts +2 -6
- package/src/css/primitives/spinner/spinner.ts +2 -2
- package/src/css/primitives/srOnly/srOnly.css.ts +1 -1
- package/src/css/primitives/srOnly/srOnly.ts +1 -1
- package/src/css/primitives/stack/stack.css.ts +1 -1
- package/src/css/primitives/stack/stack.ts +1 -1
- package/src/css/primitives/switch/switch.css.ts +5 -5
- package/src/css/primitives/text/text.css.ts +5 -4
- package/src/css/primitives/text/types.ts +3 -5
- package/src/css/primitives/textArea/textArea.css.ts +1 -1
- package/src/css/primitives/textInput/textInput.css.ts +4 -4
- package/src/css/primitives/tooltip/tooltip.css.ts +1 -1
- package/src/css/props/alignItems/alignItems.ts +1 -1
- package/src/css/props/border/border.ts +1 -16
- package/src/css/props/boxSizing/boxSizing.css.ts +2 -1
- package/src/css/props/boxSizing/boxSizing.ts +0 -3
- package/src/css/props/display/display.ts +1 -10
- package/src/css/props/flex/flex.ts +1 -1
- package/src/css/props/flexDirection/flexDirection.ts +1 -1
- package/src/css/props/flexWrap/flexWrap.ts +1 -1
- package/src/css/props/font/font.css.ts +3 -2
- package/src/css/props/font/font.ts +1 -1
- package/src/css/props/gap/gap.ts +1 -1
- package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +2 -2
- package/src/css/props/gridAutoColumns/gridAutoColumns.ts +2 -2
- package/src/css/props/gridAutoColumns/types.ts +0 -10
- package/src/css/props/gridAutoFlow/gridAutoFlow.ts +2 -2
- package/src/css/props/gridAutoFlow/types.ts +0 -4
- package/src/css/props/gridAutoRows/gridAutoRows.ts +2 -2
- package/src/css/props/gridAutoRows/types.ts +0 -4
- package/src/css/props/gridColumn/gridColumn.ts +3 -3
- package/src/css/props/gridColumn/types.ts +0 -10
- package/src/css/props/gridColumnEnd/gridColumnEnd.ts +3 -3
- package/src/css/props/gridColumnEnd/types.ts +0 -10
- package/src/css/props/gridColumnStart/gridColumnStart.ts +3 -6
- package/src/css/props/gridColumnStart/types.ts +0 -10
- package/src/css/props/gridRow/gridRow.ts +3 -3
- package/src/css/props/gridRow/types.ts +0 -10
- package/src/css/props/gridRowEnd/gridRowEnd.ts +3 -3
- package/src/css/props/gridRowEnd/types.ts +0 -10
- package/src/css/props/gridRowStart/gridRowStart.ts +3 -3
- package/src/css/props/gridRowStart/types.ts +0 -10
- package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +2 -2
- package/src/css/props/gridTemplateColumns/types.ts +0 -10
- package/src/css/props/gridTemplateRows/gridTemplateRows.ts +2 -2
- package/src/css/props/gridTemplateRows/types.ts +0 -10
- package/src/css/props/height/height.ts +1 -1
- package/src/css/props/height/types.ts +0 -6
- package/src/css/props/inset/inset.ts +1 -1
- package/src/css/props/justifyContent/justifyContent.ts +1 -1
- package/src/css/props/margin/margin.ts +1 -1
- package/src/css/props/maxWidth/maxWidth.ts +1 -1
- package/src/css/props/minHeight/minHeight.ts +1 -1
- package/src/css/props/minWidth/minWidth.ts +1 -1
- package/src/css/props/outline/outline.ts +1 -1
- package/src/css/props/overflow/overflow.ts +1 -1
- package/src/css/props/overflow/types.ts +0 -6
- package/src/css/props/padding/padding.ts +1 -1
- package/src/css/props/pointerEvents/pointerEvents.ts +1 -1
- package/src/css/props/position/position.ts +1 -1
- package/src/css/props/radius/radius.ts +1 -1
- package/src/css/props/shadow/shadow.ts +1 -1
- package/src/css/props/textAlign/textAlign.ts +1 -1
- package/src/css/props/textOverflow/textOverflow.ts +1 -1
- package/src/css/props/width/width.ts +1 -1
- package/src/css/types.ts +225 -53
- package/src/css/util.ts +2 -2
- package/src/css/vars.css.ts +33 -36
- package/src/theme/{v3/_parseColorToken.ts → _parseColorToken.ts} +2 -2
- package/src/theme/buildTheme.ts +33 -0
- package/src/theme/constants.ts +90 -0
- package/src/theme/defaults/color.ts +197 -0
- package/src/theme/{v2/defaults/config.ts → defaults/common.ts} +3 -16
- package/src/theme/{v3/defaultFonts.ts → defaults/fonts.ts} +2 -2
- package/src/theme/index.ts +4 -5
- package/src/theme/{v3/resolveTokens.ts → resolveTokens.ts} +15 -15
- package/src/theme/types.ts +355 -15
- package/src/core/__DEV__.ts +0 -5
- package/src/core/_compat/helpers.ts +0 -72
- package/src/core/_compat/styles/_responsive.ts +0 -19
- package/src/core/_compat/theme/theme.test.tsx +0 -73
- package/src/core/_compat/theme/themeColorProvider.tsx +0 -24
- package/src/core/_compat/theme/themeContext.ts +0 -10
- package/src/core/_compat/theme/themeProvider.tsx +0 -68
- package/src/core/_compat/theme/types.ts +0 -10
- package/src/core/_compat/theme/useRootTheme.ts +0 -15
- package/src/core/_compat/theme/useTheme.ts +0 -12
- package/src/core/_compat/types.ts +0 -191
- package/src/core/hooks/useArrayProp.ts +0 -26
- package/src/core/hooks/useClickOutside.test.tsx +0 -481
- package/src/core/hooks/useClickOutside.ts +0 -113
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -30
- package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
- package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
- package/src/core/hooks/useForwardedRef.ts +0 -19
- package/src/core/hooks/useIsomorphicEffect.ts +0 -7
- package/src/core/primitives/badge/types.ts +0 -18
- package/src/core/primitives/box/types.ts +0 -22
- package/src/core/primitives/flex/types.ts +0 -27
- package/src/core/primitives/grid/types.ts +0 -17
- package/src/core/primitives/selectable/types.ts +0 -7
- package/src/core/primitives/types.ts +0 -153
- package/src/core/types/gridItem.ts +0 -32
- package/src/core/types/placement.ts +0 -18
- package/src/core/types/radius.ts +0 -7
- package/src/core/types/textAlign.ts +0 -7
- package/src/core/utils/spanWithTextOverflow.tsx +0 -10
- package/src/theme/getScopedTheme.ts +0 -88
- package/src/theme/v0/avatar.ts +0 -10
- package/src/theme/v0/color/_generic.ts +0 -35
- package/src/theme/v0/color/_system.ts +0 -17
- package/src/theme/v0/color/base.ts +0 -21
- package/src/theme/v0/color/button.ts +0 -42
- package/src/theme/v0/color/card.ts +0 -19
- package/src/theme/v0/color/color.ts +0 -40
- package/src/theme/v0/color/index.ts +0 -11
- package/src/theme/v0/color/input.ts +0 -34
- package/src/theme/v0/color/muted.ts +0 -26
- package/src/theme/v0/color/selectable.ts +0 -31
- package/src/theme/v0/color/solid.ts +0 -26
- package/src/theme/v0/color/spot.ts +0 -13
- package/src/theme/v0/css.ts +0 -10
- package/src/theme/v0/focusRing.ts +0 -5
- package/src/theme/v0/font.ts +0 -40
- package/src/theme/v0/index.ts +0 -10
- package/src/theme/v0/input.ts +0 -23
- package/src/theme/v0/layer.ts +0 -6
- package/src/theme/v0/shadow.ts +0 -15
- package/src/theme/v0/styles.ts +0 -13
- package/src/theme/v0/theme.ts +0 -72
- package/src/theme/v2/avatar.ts +0 -12
- package/src/theme/v2/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
- package/src/theme/v2/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
- package/src/theme/v2/build/_deprecated/color/button/createButtonModes.ts +0 -22
- package/src/theme/v2/build/_deprecated/color/button/createButtonTones.ts +0 -55
- package/src/theme/v2/build/_deprecated/color/card/createCardStates.ts +0 -60
- package/src/theme/v2/build/_deprecated/color/color.test.ts +0 -63
- package/src/theme/v2/build/_deprecated/color/defaults.ts +0 -390
- package/src/theme/v2/build/_deprecated/color/factory.ts +0 -141
- package/src/theme/v2/build/_deprecated/color/index.ts +0 -1
- package/src/theme/v2/build/_deprecated/color/input/createInputModes.ts +0 -86
- package/src/theme/v2/build/_deprecated/color/muted/createMuted.ts +0 -54
- package/src/theme/v2/build/_deprecated/color/spot/createSpot.ts +0 -20
- package/src/theme/v2/build/buildColorTheme.test.ts +0 -185
- package/src/theme/v2/build/buildColorTheme.ts +0 -494
- package/src/theme/v2/build/buildTheme.test.ts +0 -89
- package/src/theme/v2/build/buildTheme.ts +0 -37
- package/src/theme/v2/build/colorToken/colorToken.ts +0 -19
- package/src/theme/v2/build/colorToken/compileColorToken.ts +0 -21
- package/src/theme/v2/build/colorToken/index.ts +0 -2
- package/src/theme/v2/build/colorToken/types.ts +0 -6
- package/src/theme/v2/build/index.ts +0 -3
- package/src/theme/v2/build/lib/color-fns/blend/index.ts +0 -3
- package/src/theme/v2/build/lib/color-fns/blend/mix.ts +0 -21
- package/src/theme/v2/build/lib/color-fns/blend/multiply.ts +0 -18
- package/src/theme/v2/build/lib/color-fns/blend/screen.ts +0 -18
- package/src/theme/v2/build/lib/color-fns/color-fns.test.ts +0 -68
- package/src/theme/v2/build/lib/color-fns/contrastRatio.ts +0 -34
- package/src/theme/v2/build/lib/color-fns/convert.ts +0 -150
- package/src/theme/v2/build/lib/color-fns/index.ts +0 -6
- package/src/theme/v2/build/lib/color-fns/parse.ts +0 -60
- package/src/theme/v2/build/lib/color-fns/rgba.ts +0 -14
- package/src/theme/v2/build/lib/color-fns/types.ts +0 -28
- package/src/theme/v2/build/lib/isRecord.ts +0 -3
- package/src/theme/v2/build/lib/utils.ts +0 -19
- package/src/theme/v2/build/merge.ts +0 -28
- package/src/theme/v2/build/mixThemeColor.test.ts +0 -23
- package/src/theme/v2/build/mixThemeColor.ts +0 -53
- package/src/theme/v2/build/renderColorTheme.ts +0 -532
- package/src/theme/v2/build/renderColorValue.ts +0 -85
- package/src/theme/v2/build/resolveColorTokens.ts +0 -268
- package/src/theme/v2/color/_constants.ts +0 -45
- package/src/theme/v2/color/_helpers.ts +0 -24
- package/src/theme/v2/color/_system.ts +0 -38
- package/src/theme/v2/color/avatar.ts +0 -11
- package/src/theme/v2/color/badge.ts +0 -12
- package/src/theme/v2/color/button.ts +0 -11
- package/src/theme/v2/color/color.ts +0 -28
- package/src/theme/v2/color/index.ts +0 -13
- package/src/theme/v2/color/input.ts +0 -23
- package/src/theme/v2/color/kbd.ts +0 -6
- package/src/theme/v2/color/selectable.ts +0 -8
- package/src/theme/v2/color/shadow.ts +0 -7
- package/src/theme/v2/color/state.ts +0 -41
- package/src/theme/v2/color/syntax.ts +0 -39
- package/src/theme/v2/config/helpers.ts +0 -48
- package/src/theme/v2/config/index.ts +0 -4
- package/src/theme/v2/config/system.ts +0 -114
- package/src/theme/v2/config/tokens/color/index.ts +0 -1
- package/src/theme/v2/config/tokens/color/types.ts +0 -137
- package/src/theme/v2/config/tokens/index.ts +0 -3
- package/src/theme/v2/config/tokens/parseTokenValue.test.ts +0 -44
- package/src/theme/v2/config/tokens/parseTokenValue.ts +0 -133
- package/src/theme/v2/config/tokens/types.ts +0 -53
- package/src/theme/v2/config/types.ts +0 -47
- package/src/theme/v2/defaults/colorPalette.ts +0 -5
- package/src/theme/v2/defaults/colorTokens.ts +0 -648
- package/src/theme/v2/defaults/fonts.ts +0 -227
- package/src/theme/v2/index.ts +0 -6
- package/src/theme/v2/input.ts +0 -31
- package/src/theme/v2/theme.ts +0 -45
- package/src/theme/v3/_constants.ts +0 -29
- package/src/theme/v3/buildTheme_v3.ts +0 -39
- package/src/theme/v3/color/_constants.ts +0 -15
- package/src/theme/v3/color/avatar.ts +0 -14
- package/src/theme/v3/color/card.ts +0 -79
- package/src/theme/v3/color/color.ts +0 -98
- package/src/theme/v3/color/element.ts +0 -19
- package/src/theme/v3/color/index.ts +0 -7
- package/src/theme/v3/color/token.ts +0 -32
- package/src/theme/v3/color/tokens.ts +0 -5
- package/src/theme/v3/defaultTokens.ts +0 -199
- package/src/theme/v3/index.ts +0 -9
- package/src/theme/v3/palette/constants.ts +0 -15
- package/src/theme/v3/palette/index.ts +0 -2
- package/src/theme/v3/palette/types.ts +0 -7
- package/src/theme/v3/tokens.ts +0 -16
- package/src/theme/v3/types.ts +0 -133
- package/src/theme/versioning/getTheme_v2.ts +0 -58
- package/src/theme/versioning/index.ts +0 -1
- package/src/theme/versioning/is_v0.ts +0 -7
- package/src/theme/versioning/is_v2.ts +0 -7
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -245
- package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
- package/src/theme/versioning/themeColor_v3_v2.ts +0 -383
- package/src/theme/versioning/v0_v2.ts +0 -95
- package/src/theme/versioning/v2_v0.ts +0 -127
- package/src/theme/versioning/v3_v2.ts +0 -130
- /package/src/theme/{v3/merge.ts → merge.ts} +0 -0
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
RadiusStyleProps,
|
|
5
5
|
ResponsiveProp,
|
|
6
6
|
} from '@sanity/ui/css'
|
|
7
|
-
import type {
|
|
7
|
+
import type {ElementTone, FontTextSize} from '@sanity/ui/theme'
|
|
8
8
|
import {
|
|
9
9
|
type ElementType,
|
|
10
10
|
isValidElement,
|
|
@@ -23,7 +23,7 @@ import {Box} from '../../primitives/box/box'
|
|
|
23
23
|
import {Flex} from '../../primitives/flex/flex'
|
|
24
24
|
import {Selectable} from '../../primitives/selectable/selectable'
|
|
25
25
|
import {Text} from '../../primitives/text/text'
|
|
26
|
-
import type {ComponentType, Props} from '../../types
|
|
26
|
+
import type {ComponentType, Props} from '../../types'
|
|
27
27
|
import {Hotkeys} from '../hotkeys/hotkeys'
|
|
28
28
|
import {useMenu} from './useMenu'
|
|
29
29
|
|
|
@@ -41,10 +41,8 @@ export type MenuItemOwnProps = GapStyleProps &
|
|
|
41
41
|
iconRight?: ElementType | ReactNode
|
|
42
42
|
pressed?: boolean
|
|
43
43
|
selected?: boolean
|
|
44
|
-
/** @deprecated Use `gap` instead. */
|
|
45
|
-
space?: ResponsiveProp<Space>
|
|
46
44
|
text?: ReactNode
|
|
47
|
-
tone?:
|
|
45
|
+
tone?: ElementTone
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
/** @public */
|
|
@@ -59,13 +57,13 @@ export type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> =
|
|
|
59
57
|
/** @public */
|
|
60
58
|
export function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(
|
|
61
59
|
props: MenuItemProps<E>,
|
|
62
|
-
) {
|
|
60
|
+
): React.JSX.Element {
|
|
63
61
|
const {
|
|
64
62
|
as = DEFAULT_MENU_ITEM_ELEMENT,
|
|
65
63
|
children,
|
|
66
64
|
disabled,
|
|
67
65
|
fontSize = 1,
|
|
68
|
-
gap,
|
|
66
|
+
gap = 3,
|
|
69
67
|
gapX,
|
|
70
68
|
gapY,
|
|
71
69
|
hotkeys,
|
|
@@ -83,22 +81,13 @@ export function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITE
|
|
|
83
81
|
radius = 2,
|
|
84
82
|
ref: forwardedRef,
|
|
85
83
|
selected: selectedProp,
|
|
86
|
-
space = 3,
|
|
87
84
|
text,
|
|
88
85
|
tone = 'default',
|
|
89
86
|
...rest
|
|
90
87
|
} = props as MenuItemProps<typeof DEFAULT_MENU_ITEM_ELEMENT>
|
|
91
88
|
|
|
92
89
|
const menu = useMenu()
|
|
93
|
-
const {
|
|
94
|
-
activeElement,
|
|
95
|
-
mount,
|
|
96
|
-
onItemClick,
|
|
97
|
-
onItemMouseEnter: _onItemMouseEnter,
|
|
98
|
-
onItemMouseLeave: _onItemMouseLeave,
|
|
99
|
-
} = menu
|
|
100
|
-
const onItemMouseEnter = _onItemMouseEnter ?? menu.onMouseEnter
|
|
101
|
-
const onItemMouseLeave = _onItemMouseLeave ?? menu.onMouseLeave
|
|
90
|
+
const {activeElement, mount, onItemClick, onItemMouseEnter, onItemMouseLeave} = menu
|
|
102
91
|
const [rootElement, setRootElement] = useState<HTMLButtonElement | null>(null)
|
|
103
92
|
const active = Boolean(activeElement) && activeElement === rootElement
|
|
104
93
|
const ref = useRef<HTMLButtonElement | null>(null)
|
|
@@ -157,7 +146,7 @@ export function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITE
|
|
|
157
146
|
type={as === 'button' ? 'button' : undefined}
|
|
158
147
|
>
|
|
159
148
|
{(IconComponent || text || IconRightComponent) && (
|
|
160
|
-
<Flex as="span" gap={gap
|
|
149
|
+
<Flex as="span" gap={gap} gapX={gapX} gapY={gapY} align="center" {...paddingProps}>
|
|
161
150
|
{IconComponent && (
|
|
162
151
|
<Text muted size={fontSize}>
|
|
163
152
|
{isValidElement(IconComponent) && IconComponent}
|
|
@@ -3,7 +3,7 @@ import {Box, Card, Tab, TabList, TabPanel, Text} from '@sanity/ui'
|
|
|
3
3
|
import {useBoolean} from '@sanity/ui-workshop'
|
|
4
4
|
import {useState} from 'react'
|
|
5
5
|
|
|
6
|
-
export default function ExampleStory() {
|
|
6
|
+
export default function ExampleStory(): React.JSX.Element {
|
|
7
7
|
const [tab, setTab] = useState('foo')
|
|
8
8
|
const useLongTitle = useBoolean('Use long title', false)
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {WorkshopScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const scope: WorkshopScope = {
|
|
5
5
|
name: 'components/tab',
|
|
6
6
|
title: 'Tab',
|
|
7
7
|
stories: [
|
|
@@ -11,4 +11,6 @@ export default defineScope({
|
|
|
11
11
|
component: lazy(() => import('./example')),
|
|
12
12
|
},
|
|
13
13
|
],
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default scope
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {ResponsiveProp} from '@sanity/ui/css'
|
|
2
|
-
import type {FontTextSize, Space,
|
|
2
|
+
import type {FontTextSize, Space, ElementTone} from '@sanity/ui/theme'
|
|
3
3
|
import {
|
|
4
4
|
type ElementType,
|
|
5
5
|
type FocusEvent,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'react'
|
|
12
12
|
|
|
13
13
|
import {Button} from '../../primitives/button/button'
|
|
14
|
-
import type {ComponentType, Props} from '../../types
|
|
14
|
+
import type {ComponentType, Props} from '../../types'
|
|
15
15
|
|
|
16
16
|
/** @public */
|
|
17
17
|
export const DEFAULT_TAB_ELEMENT = 'button'
|
|
@@ -29,7 +29,7 @@ export type TabOwnProps = {
|
|
|
29
29
|
'label'?: ReactNode
|
|
30
30
|
'padding'?: ResponsiveProp<Space>
|
|
31
31
|
'selected'?: boolean
|
|
32
|
-
'tone'?:
|
|
32
|
+
'tone'?: ElementTone
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/** @public */
|
|
@@ -39,7 +39,9 @@ export type TabElementType = 'button' | ComponentType
|
|
|
39
39
|
export type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>
|
|
40
40
|
|
|
41
41
|
/** @public */
|
|
42
|
-
export function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
|
|
42
|
+
export function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
|
|
43
|
+
props: TabProps<E>,
|
|
44
|
+
): React.JSX.Element {
|
|
43
45
|
const {
|
|
44
46
|
as = DEFAULT_TAB_ELEMENT,
|
|
45
47
|
icon,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {type ResponsiveProp} from '@sanity/ui/css'
|
|
2
|
-
import type {Space} from '@sanity/ui/theme'
|
|
3
1
|
import {
|
|
4
2
|
Children,
|
|
5
3
|
cloneElement,
|
|
@@ -10,7 +8,7 @@ import {
|
|
|
10
8
|
} from 'react'
|
|
11
9
|
|
|
12
10
|
import {Flex, type FlexOwnProps} from '../../primitives/flex/flex'
|
|
13
|
-
import type {ComponentType, Props} from '../../types
|
|
11
|
+
import type {ComponentType, Props} from '../../types'
|
|
14
12
|
import type {TabProps} from './tab'
|
|
15
13
|
|
|
16
14
|
/** @public */
|
|
@@ -22,8 +20,6 @@ export type TabListChild = ReactElement<Props<TabProps, 'button'>> | null | unde
|
|
|
22
20
|
/** @public */
|
|
23
21
|
export type TabListOwnProps = Omit<FlexOwnProps, 'as' | 'height'> & {
|
|
24
22
|
children: TabListChild[]
|
|
25
|
-
/** @deprecated Use `gap` instead */
|
|
26
|
-
space?: ResponsiveProp<Space>
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
/** @public */
|
|
@@ -38,12 +34,11 @@ export type TabListProps<E extends TabListElementType = TabListElementType> = Pr
|
|
|
38
34
|
/** @public */
|
|
39
35
|
export function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(
|
|
40
36
|
props: TabListProps<E>,
|
|
41
|
-
) {
|
|
37
|
+
): React.JSX.Element {
|
|
42
38
|
const {
|
|
43
39
|
as = DEFAULT_TAB_LIST_ELEMENT,
|
|
44
40
|
children: childrenProp,
|
|
45
41
|
gap = 1,
|
|
46
|
-
space = 1,
|
|
47
42
|
wrap = 'nowrap',
|
|
48
43
|
...rest
|
|
49
44
|
} = props as TabListProps<typeof DEFAULT_TAB_LIST_ELEMENT>
|
|
@@ -80,7 +75,7 @@ export function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_E
|
|
|
80
75
|
data-ui="TabList"
|
|
81
76
|
{...rest}
|
|
82
77
|
as={as}
|
|
83
|
-
gap={gap
|
|
78
|
+
gap={gap}
|
|
84
79
|
onKeyDown={handleKeyDown}
|
|
85
80
|
role="tablist"
|
|
86
81
|
wrap={wrap}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {Box, type BoxOwnProps} from '../../primitives/box/box'
|
|
2
|
-
import type {ComponentType, Props} from '../../types
|
|
2
|
+
import type {ComponentType, Props} from '../../types'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
5
5
|
export const DEFAULT_TAB_PANEL_ELEMENT = 'div'
|
|
@@ -25,7 +25,7 @@ export type TabPanelProps<E extends TabPanelElementType = TabPanelElementType> =
|
|
|
25
25
|
/** @public */
|
|
26
26
|
export function TabPanel<E extends TabPanelElementType = typeof DEFAULT_TAB_PANEL_ELEMENT>(
|
|
27
27
|
props: TabPanelProps<E>,
|
|
28
|
-
) {
|
|
28
|
+
): React.JSX.Element {
|
|
29
29
|
const {
|
|
30
30
|
as = DEFAULT_TAB_PANEL_ELEMENT,
|
|
31
31
|
children,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {WorkshopScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const scope: WorkshopScope = {
|
|
5
5
|
name: 'components/toast',
|
|
6
6
|
title: 'Toast',
|
|
7
7
|
stories: [
|
|
@@ -16,4 +16,6 @@ export default defineScope({
|
|
|
16
16
|
component: lazy(() => import('./hook')),
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default scope
|
|
@@ -3,7 +3,7 @@ import {useAction, useBoolean, useSelect, useString, useText} from '@sanity/ui-w
|
|
|
3
3
|
|
|
4
4
|
import {WORKSHOP_TOAST_STATUS_OPTIONS} from '$workshop'
|
|
5
5
|
|
|
6
|
-
export default function ToastStory() {
|
|
6
|
+
export default function ToastStory(): React.JSX.Element {
|
|
7
7
|
const closable = useBoolean('Closable', false)
|
|
8
8
|
const title = useString('Title', 'Toast title')
|
|
9
9
|
const status = useSelect('Status', WORKSHOP_TOAST_STATUS_OPTIONS)
|
|
@@ -10,7 +10,7 @@ import {Card} from '../../primitives/card/card'
|
|
|
10
10
|
import {Flex} from '../../primitives/flex/flex'
|
|
11
11
|
import {Stack} from '../../primitives/stack/stack'
|
|
12
12
|
import {Text} from '../../primitives/text/text'
|
|
13
|
-
import type {ComponentType, Props} from '../../types
|
|
13
|
+
import type {ComponentType, Props} from '../../types'
|
|
14
14
|
|
|
15
15
|
/** @internal */
|
|
16
16
|
export const DEFAULT_TOAST_ELEMENT = 'li'
|
|
@@ -65,7 +65,7 @@ const BUTTON_TONE = {
|
|
|
65
65
|
*/
|
|
66
66
|
export function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(
|
|
67
67
|
props: ToastProps<E>,
|
|
68
|
-
) {
|
|
68
|
+
): React.JSX.Element {
|
|
69
69
|
const {
|
|
70
70
|
as = DEFAULT_TOAST_ELEMENT,
|
|
71
71
|
closable,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type {Context} from 'react'
|
|
2
|
+
|
|
1
3
|
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
2
4
|
import type {ToastContextValue} from './types'
|
|
3
5
|
|
|
4
|
-
export const ToastContext
|
|
5
|
-
'@sanity/ui/
|
|
6
|
-
null,
|
|
7
|
-
)
|
|
6
|
+
export const ToastContext: Context<ToastContextValue | null> =
|
|
7
|
+
createGlobalScopedContext<ToastContextValue | null>('@sanity/ui/v3/toast', null)
|
|
@@ -2,7 +2,7 @@ import {type GapStyleProps, type PaddingStyleProps, toastLayer} from '@sanity/ui
|
|
|
2
2
|
|
|
3
3
|
import {Grid} from '../../primitives/grid/grid'
|
|
4
4
|
import {useLayer} from '../../primitives/layer/useLayer'
|
|
5
|
-
import type {ComponentType, Props} from '../../types
|
|
5
|
+
import type {ComponentType, Props} from '../../types'
|
|
6
6
|
|
|
7
7
|
/** @internal */
|
|
8
8
|
export const DEFAULT_TOAST_LAYER_ELEMENT = 'ul'
|
|
@@ -24,7 +24,7 @@ export type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElementT
|
|
|
24
24
|
*/
|
|
25
25
|
export function ToastLayer<E extends ToastLayerElementType = typeof DEFAULT_TOAST_LAYER_ELEMENT>(
|
|
26
26
|
props: ToastLayerProps<E>,
|
|
27
|
-
) {
|
|
27
|
+
): React.JSX.Element {
|
|
28
28
|
const {
|
|
29
29
|
as = DEFAULT_TOAST_LAYER_ELEMENT,
|
|
30
30
|
children,
|
|
@@ -45,7 +45,7 @@ export function ToastLayer<E extends ToastLayerElementType = typeof DEFAULT_TOAS
|
|
|
45
45
|
paddingX={paddingX}
|
|
46
46
|
paddingY={paddingY}
|
|
47
47
|
gap={gap}
|
|
48
|
-
|
|
48
|
+
gridTemplateColumns={1}
|
|
49
49
|
style={{zIndex}}
|
|
50
50
|
>
|
|
51
51
|
{children}
|
|
@@ -8,7 +8,7 @@ function test<ElementType = unknown>(
|
|
|
8
8
|
return {name: title, run}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const perfTests = [
|
|
11
|
+
export const perfTests: PerfTestProps<HTMLDivElement>[] = [
|
|
12
12
|
test('Toggle tree groups', async ({target}: {target: HTMLDivElement}) => {
|
|
13
13
|
const apples = await findByTestId(target, 'apples')
|
|
14
14
|
const oranges = await findByTestId(target, 'oranges')
|
|
@@ -5,7 +5,7 @@ import {useCallback, useState} from 'react'
|
|
|
5
5
|
|
|
6
6
|
import {perfTests} from './basic.perf'
|
|
7
7
|
|
|
8
|
-
export default function BasicStory() {
|
|
8
|
+
export default function BasicStory(): React.JSX.Element {
|
|
9
9
|
const {ref, Wrapper} = usePerfTest(perfTests[0])
|
|
10
10
|
|
|
11
11
|
const [id, setId] = useState('')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {WorkshopScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const scope: WorkshopScope = {
|
|
5
5
|
name: 'components/tree',
|
|
6
6
|
title: 'Tree',
|
|
7
7
|
stories: [
|
|
@@ -18,4 +18,6 @@ export default defineScope({
|
|
|
18
18
|
// options: {perfTests: () => import('./basic.perf')},
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
|
-
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default scope
|
|
@@ -5,7 +5,7 @@ import {useCallback, useState} from 'react'
|
|
|
5
5
|
|
|
6
6
|
import {perfTests} from './basic.perf'
|
|
7
7
|
|
|
8
|
-
export default function BasicStory() {
|
|
8
|
+
export default function BasicStory(): React.JSX.Element {
|
|
9
9
|
const {ref, Wrapper} = usePerfTest(perfTests[0])
|
|
10
10
|
|
|
11
11
|
const [id, setId] = useState('')
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from 'react'
|
|
13
13
|
|
|
14
14
|
import {Stack} from '../../primitives/stack/stack'
|
|
15
|
-
import type {ComponentType, Props} from '../../types
|
|
15
|
+
import type {ComponentType, Props} from '../../types'
|
|
16
16
|
import {_findNextItemElement, _findPrevItemElement, _focusItemElement} from './helpers'
|
|
17
17
|
import {TreeContext} from './treeContext'
|
|
18
18
|
import type {TreeContextValue, TreeState} from './types'
|
|
@@ -26,8 +26,6 @@ export const DEFAULT_TREE_ELEMENT = 'div'
|
|
|
26
26
|
*/
|
|
27
27
|
export type TreeOwnProps = {
|
|
28
28
|
gap?: ResponsiveProp<Space>
|
|
29
|
-
/** @deprecated Use `gap` instead. */
|
|
30
|
-
space?: ResponsiveProp<Space>
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/** @beta */
|
|
@@ -40,11 +38,12 @@ export type TreeProps<E extends TreeElementType = TreeElementType> = Props<TreeO
|
|
|
40
38
|
* This API might change. DO NOT USE IN PRODUCTION.
|
|
41
39
|
* @beta
|
|
42
40
|
*/
|
|
43
|
-
export function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(
|
|
41
|
+
export function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(
|
|
42
|
+
props: TreeProps<E>,
|
|
43
|
+
): React.JSX.Element {
|
|
44
44
|
const {
|
|
45
45
|
children,
|
|
46
|
-
gap,
|
|
47
|
-
space = 1,
|
|
46
|
+
gap = 1,
|
|
48
47
|
onFocus,
|
|
49
48
|
ref: forwardedRef,
|
|
50
49
|
...rest
|
|
@@ -103,15 +102,15 @@ export function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(pr
|
|
|
103
102
|
() => ({
|
|
104
103
|
version: 0.0,
|
|
105
104
|
focusedElement: focusedElement || itemElements[0] || null,
|
|
105
|
+
gap,
|
|
106
106
|
level: 0,
|
|
107
107
|
path,
|
|
108
108
|
registerItem,
|
|
109
109
|
setExpanded,
|
|
110
110
|
setFocusedElement,
|
|
111
|
-
space,
|
|
112
111
|
state,
|
|
113
112
|
}),
|
|
114
|
-
[focusedElement, itemElements, path, registerItem, setExpanded,
|
|
113
|
+
[focusedElement, gap, itemElements, path, registerItem, setExpanded, state],
|
|
115
114
|
)
|
|
116
115
|
|
|
117
116
|
const handleKeyDown = useCallback(
|
|
@@ -236,7 +235,7 @@ export function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(pr
|
|
|
236
235
|
as="ul"
|
|
237
236
|
data-ui="Tree"
|
|
238
237
|
{...rest}
|
|
239
|
-
gap={gap
|
|
238
|
+
gap={gap}
|
|
240
239
|
onFocus={handleFocus}
|
|
241
240
|
onKeyDown={handleKeyDown}
|
|
242
241
|
ref={ref}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type {Context} from 'react'
|
|
2
|
+
|
|
1
3
|
import {createGlobalScopedContext} from '../../lib/createGlobalScopedContext'
|
|
2
4
|
import type {TreeContextValue} from './types'
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* @internal
|
|
6
8
|
*/
|
|
7
|
-
export const TreeContext
|
|
8
|
-
'@sanity/ui/
|
|
9
|
-
null,
|
|
10
|
-
)
|
|
9
|
+
export const TreeContext: Context<TreeContextValue | null> =
|
|
10
|
+
createGlobalScopedContext<TreeContextValue | null>('@sanity/ui/v3/tree', null)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {memo, type ReactElement} from 'react'
|
|
2
|
-
|
|
3
1
|
import {Stack} from '../../primitives/stack/stack'
|
|
4
|
-
import type {ComponentType, Props} from '../../types
|
|
2
|
+
import type {ComponentType, Props} from '../../types'
|
|
5
3
|
import {useTree} from './useTree'
|
|
6
4
|
|
|
7
5
|
/** @public */
|
|
@@ -21,9 +19,9 @@ export type TreeGroupProps<E extends TreeGroupElementType = TreeGroupElementType
|
|
|
21
19
|
E
|
|
22
20
|
>
|
|
23
21
|
|
|
24
|
-
export const TreeGroup =
|
|
22
|
+
export const TreeGroup = function TreeGroup(
|
|
25
23
|
props: Props<TreeGroupProps, 'div'>,
|
|
26
|
-
):
|
|
24
|
+
): React.JSX.Element {
|
|
27
25
|
const {
|
|
28
26
|
children,
|
|
29
27
|
expanded = false,
|
|
@@ -38,11 +36,11 @@ export const TreeGroup = memo(function TreeGroup(
|
|
|
38
36
|
data-ui="TreeGroup"
|
|
39
37
|
{...rest}
|
|
40
38
|
hidden={!expanded}
|
|
41
|
-
marginTop={tree.
|
|
39
|
+
marginTop={tree.gap}
|
|
42
40
|
role="group"
|
|
43
|
-
gap={tree.
|
|
41
|
+
gap={tree.gap}
|
|
44
42
|
>
|
|
45
43
|
{children}
|
|
46
44
|
</Stack>
|
|
47
45
|
)
|
|
48
|
-
}
|
|
46
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ToggleArrowRightIcon} from '@sanity/icons'
|
|
2
2
|
import {type ResponsiveProp, treeItem, vars} from '@sanity/ui/css'
|
|
3
|
-
import type {FontTextSize,
|
|
3
|
+
import type {FontTextSize, FontWeight, Space} from '@sanity/ui/theme'
|
|
4
4
|
import {
|
|
5
5
|
type ElementType,
|
|
6
6
|
type KeyboardEvent,
|
|
@@ -20,7 +20,7 @@ import type {CardOwnProps} from '../../primitives/card/card'
|
|
|
20
20
|
import {Flex} from '../../primitives/flex/flex'
|
|
21
21
|
import {Selectable, type SelectableElementType} from '../../primitives/selectable/selectable'
|
|
22
22
|
import {Text} from '../../primitives/text/text'
|
|
23
|
-
import type {ComponentType, Props} from '../../types
|
|
23
|
+
import type {ComponentType, Props} from '../../types'
|
|
24
24
|
import {TreeContext} from './treeContext'
|
|
25
25
|
import {TreeGroup} from './treeGroup'
|
|
26
26
|
import {useTree} from './useTree'
|
|
@@ -42,7 +42,7 @@ export type TreeItemOwnProps = CardOwnProps & {
|
|
|
42
42
|
padding?: ResponsiveProp<Space>
|
|
43
43
|
space?: ResponsiveProp<Space>
|
|
44
44
|
text?: ReactNode
|
|
45
|
-
weight?:
|
|
45
|
+
weight?: FontWeight
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/** @beta */
|
|
@@ -60,7 +60,7 @@ export type TreeItemProps<E extends TreeItemElementType = TreeItemElementType> =
|
|
|
60
60
|
*/
|
|
61
61
|
export function TreeItem<E extends TreeItemElementType = typeof DEFAULT_TREE_ITEM_ELEMENT>(
|
|
62
62
|
props: TreeItemProps<E>,
|
|
63
|
-
) {
|
|
63
|
+
): React.JSX.Element {
|
|
64
64
|
const {
|
|
65
65
|
children,
|
|
66
66
|
className,
|
|
@@ -14,11 +14,11 @@ export interface TreeState {
|
|
|
14
14
|
export interface TreeContextValue {
|
|
15
15
|
version: 0.0
|
|
16
16
|
focusedElement: HTMLElement | null
|
|
17
|
+
gap: ResponsiveProp<Space>
|
|
17
18
|
level: number
|
|
18
19
|
path: string[]
|
|
19
20
|
registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void
|
|
20
21
|
setExpanded: (path: string, expanded: boolean) => void
|
|
21
22
|
setFocusedElement: (focusedElement: HTMLElement | null) => void
|
|
22
|
-
space: ResponsiveProp<Space>
|
|
23
23
|
state: TreeState
|
|
24
24
|
}
|
|
@@ -3,7 +3,7 @@ import {useCallback, useState} from 'react'
|
|
|
3
3
|
|
|
4
4
|
const data = Array.from(new Array(1000)).map((_, key) => ({key}))
|
|
5
5
|
|
|
6
|
-
export default function
|
|
6
|
+
export default function ChangingPropsStory(): React.JSX.Element {
|
|
7
7
|
const [expanded, setExpanded] = useState(false)
|
|
8
8
|
|
|
9
9
|
const toggleExpand = useCallback(() => setExpanded((v) => !v), [])
|
|
@@ -3,7 +3,7 @@ import {useCallback} from 'react'
|
|
|
3
3
|
|
|
4
4
|
const data = Array.from(new Array(1000)).map((_, key) => ({key}))
|
|
5
5
|
|
|
6
|
-
export default function
|
|
6
|
+
export default function ElementScrollStory(): React.JSX.Element {
|
|
7
7
|
const renderItem = useCallback((item: {key: number}) => {
|
|
8
8
|
return (
|
|
9
9
|
<Card padding={3} radius={2} shadow={1}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {WorkshopScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const scope: WorkshopScope = {
|
|
5
5
|
name: 'components/virtual-list',
|
|
6
6
|
title: 'VirtualList',
|
|
7
7
|
stories: [
|
|
@@ -26,4 +26,6 @@ export default defineScope({
|
|
|
26
26
|
component: lazy(() => import('./changingProps')),
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default scope
|
|
@@ -11,7 +11,7 @@ function getData(len: number, offsetIndex = 0): Item[] {
|
|
|
11
11
|
|
|
12
12
|
const ITEMS_PER_PAGE = 1000
|
|
13
13
|
|
|
14
|
-
export default function
|
|
14
|
+
export default function InfiniteListStory(): React.JSX.Element {
|
|
15
15
|
const [data, setData] = useState<Item[]>(() => getData(ITEMS_PER_PAGE))
|
|
16
16
|
const offsetRef = useRef(0)
|
|
17
17
|
|
|
@@ -3,7 +3,7 @@ import {useCallback} from 'react'
|
|
|
3
3
|
|
|
4
4
|
const data = Array.from(new Array(1000)).map((_, key) => ({key}))
|
|
5
5
|
|
|
6
|
-
export default function
|
|
6
|
+
export default function WindowScrollStory(): React.JSX.Element {
|
|
7
7
|
const renderItem = useCallback((item: {key: number}) => {
|
|
8
8
|
return (
|
|
9
9
|
<Card padding={3} radius={2} shadow={1}>
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {_isScrollable} from '../../helpers/scroll'
|
|
14
14
|
import {_ResizeObserver} from '../../observers/resize'
|
|
15
15
|
import {Box} from '../../primitives/box/box'
|
|
16
|
-
import type {ComponentType, Props} from '../../types
|
|
16
|
+
import type {ComponentType, Props} from '../../types'
|
|
17
17
|
|
|
18
18
|
/** @beta */
|
|
19
19
|
export const DEFAULT_VIRTUAL_LIST_ELEMENT = 'div'
|
|
@@ -49,7 +49,7 @@ export type VirtualListProps<E extends VirtualListElementType = VirtualListEleme
|
|
|
49
49
|
/** @beta */
|
|
50
50
|
export function VirtualList<E extends VirtualListElementType = typeof DEFAULT_VIRTUAL_LIST_ELEMENT>(
|
|
51
51
|
props: VirtualListProps<E>,
|
|
52
|
-
) {
|
|
52
|
+
): React.JSX.Element {
|
|
53
53
|
const {
|
|
54
54
|
as = DEFAULT_VIRTUAL_LIST_ELEMENT,
|
|
55
55
|
gap = 0,
|
package/src/core/constants.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import type {Transition, Variant} from 'framer-motion'
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
3
|
export const EMPTY_ARRAY: never[] = []
|
|
7
4
|
|
|
8
|
-
/**
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
5
|
export const EMPTY_RECORD: Record<string, never> = {}
|
|
12
6
|
|
|
13
7
|
const POPOVER_MOTION_DURATION = 0.2
|
|
14
8
|
|
|
15
9
|
/**
|
|
16
10
|
* Shared `framer-motion` variants used by `Popover` and `Tooltip` components.
|
|
17
|
-
* @internal
|
|
18
11
|
*/
|
|
19
12
|
export const POPOVER_MOTION_PROPS: {
|
|
20
13
|
card: {
|
|
@@ -67,17 +60,6 @@ export const POPOVER_MOTION_PROPS: {
|
|
|
67
60
|
},
|
|
68
61
|
}
|
|
69
62
|
|
|
70
|
-
/**
|
|
71
|
-
* @internal
|
|
72
|
-
* @deprecated No longer used.
|
|
73
|
-
*/
|
|
74
|
-
export const FLOATING_STATIC_SIDES: Record<string, 'bottom' | 'left' | 'top' | 'right'> = {
|
|
75
|
-
top: 'bottom',
|
|
76
|
-
right: 'left',
|
|
77
|
-
bottom: 'top',
|
|
78
|
-
left: 'right',
|
|
79
|
-
}
|
|
80
|
-
|
|
81
63
|
export const Z_OFFSETS = {
|
|
82
64
|
dialog: 600,
|
|
83
65
|
popover: 400,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {WorkshopScope} from '@sanity/ui-workshop'
|
|
2
2
|
import {lazy} from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const scope: WorkshopScope = {
|
|
5
5
|
name: 'hooks/use-media-index',
|
|
6
6
|
title: 'useMediaIndex',
|
|
7
7
|
stories: [
|
|
@@ -11,4 +11,6 @@ export default defineScope({
|
|
|
11
11
|
component: lazy(() => import('./test')),
|
|
12
12
|
},
|
|
13
13
|
],
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default scope
|