@sanity/ui 3.0.0-static.32 → 3.0.0-static.34
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 +269 -378
- 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 +270 -381
- 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 +2 -894
- package/dist/_visual-editing.d.ts +2 -894
- package/dist/_visual-editing.js +2 -4
- package/dist/css/index.cjs +13 -13
- package/dist/css/index.cjs.map +1 -1
- package/dist/css/index.css +1 -1
- package/dist/css/index.d.cts +805 -14697
- package/dist/css/index.d.ts +805 -14697
- package/dist/css/index.js +13 -13
- package/dist/css/index.js.map +1 -1
- package/dist/index.cjs +242 -367
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +990 -3085
- package/dist/index.d.ts +990 -3085
- package/dist/index.js +244 -361
- package/dist/index.js.map +1 -1
- package/dist/portalProvider-DgNIVviV.d.ts +575 -0
- package/dist/theme.cjs +367 -4288
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +272 -1806
- package/dist/theme.d.ts +272 -1806
- package/dist/theme.js +371 -4292
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +0 -2
- package/package.json +8 -9
- package/src/core/Root.tsx +6 -4
- 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 +34 -17
- 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 +2 -2
- package/src/css/primitives/root/root.ts +2 -2
- 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/dist/css/layers.css +0 -4
- package/dist/css/primitives/popover/popover.css +0 -4
- 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
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
* @deprecated Will be removed in next major version.
|
|
6
|
-
*/
|
|
7
|
-
export type BadgeMode = 'default' | 'outline'
|
|
8
|
-
|
|
9
|
-
/** @public */
|
|
10
|
-
export type BadgeTone = ThemeColorStateToneKey
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @internal
|
|
14
|
-
* @deprecated Will be removed in next major version.
|
|
15
|
-
*/
|
|
16
|
-
export interface BadgeStyleProps {
|
|
17
|
-
$tone: BadgeTone
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
* @deprecated use `Display` from `@sanity/ui/css` instead.
|
|
5
|
-
*/
|
|
6
|
-
type Display as BoxDisplay,
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
* @deprecated use `BoxHeight` from `@sanity/ui/css` instead.
|
|
10
|
-
*/
|
|
11
|
-
type BoxHeight,
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
* @deprecated use `Overflow` from `@sanity/ui/css` instead.
|
|
15
|
-
*/
|
|
16
|
-
type BoxOverflow,
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
* @deprecated use `BoxSizing` from `@sanity/ui/css` instead.
|
|
20
|
-
*/
|
|
21
|
-
type BoxSizing,
|
|
22
|
-
} from '@sanity/ui/css'
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
* @deprecated
|
|
5
|
-
*/
|
|
6
|
-
type AlignItems as FlexAlign,
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
type FlexDirection,
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
* @deprecated
|
|
15
|
-
*/
|
|
16
|
-
type JustifyContent as FlexJustify,
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
* @deprecated
|
|
20
|
-
*/
|
|
21
|
-
type Flex as FlexValue,
|
|
22
|
-
/**
|
|
23
|
-
* @public
|
|
24
|
-
* @deprecated
|
|
25
|
-
*/
|
|
26
|
-
type FlexWrap,
|
|
27
|
-
} from '@sanity/ui/css'
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
* @deprecated Use `GridAutoColumns` from `@sanity/ui/css` instead.
|
|
5
|
-
*/
|
|
6
|
-
type GridAutoCols,
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
* @deprecated Use `GridAutoFlow` from `@sanity/ui/css` instead.
|
|
10
|
-
*/
|
|
11
|
-
type GridAutoFlow,
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
* @deprecated Use `GridAutoRows` from `@sanity/ui/css` instead.
|
|
15
|
-
*/
|
|
16
|
-
type GridAutoRows,
|
|
17
|
-
} from '@sanity/ui/css'
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AlignItems,
|
|
3
|
-
BoxHeight,
|
|
4
|
-
BoxOverflow,
|
|
5
|
-
BoxSizing,
|
|
6
|
-
Flex,
|
|
7
|
-
FlexDirection,
|
|
8
|
-
FlexWrap,
|
|
9
|
-
GridAutoCols,
|
|
10
|
-
GridAutoFlow,
|
|
11
|
-
GridAutoRows,
|
|
12
|
-
GridItemColumn,
|
|
13
|
-
GridItemColumnEnd,
|
|
14
|
-
GridItemColumnStart,
|
|
15
|
-
GridItemRow,
|
|
16
|
-
GridItemRowEnd,
|
|
17
|
-
GridItemRowStart,
|
|
18
|
-
JustifyContent,
|
|
19
|
-
} from '@sanity/ui/css'
|
|
20
|
-
import type {Radius} from '@sanity/ui/theme'
|
|
21
|
-
|
|
22
|
-
import type {BoxDisplay} from './box/types'
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @public
|
|
26
|
-
* @deprecated No longer used.
|
|
27
|
-
*/
|
|
28
|
-
export interface ResponsiveBorderProps {
|
|
29
|
-
border?: boolean | boolean[]
|
|
30
|
-
borderTop?: boolean | boolean[]
|
|
31
|
-
borderRight?: boolean | boolean[]
|
|
32
|
-
borderBottom?: boolean | boolean[]
|
|
33
|
-
borderLeft?: boolean | boolean[]
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @public
|
|
38
|
-
* @deprecated No longer used.
|
|
39
|
-
*/
|
|
40
|
-
export interface ResponsiveBoxProps {
|
|
41
|
-
display?: BoxDisplay | BoxDisplay[]
|
|
42
|
-
height?: BoxHeight | BoxHeight[]
|
|
43
|
-
overflow?: BoxOverflow | BoxOverflow[]
|
|
44
|
-
sizing?: BoxSizing | BoxSizing[]
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @public
|
|
49
|
-
* @deprecated No longer used.
|
|
50
|
-
*/
|
|
51
|
-
export interface ResponsiveFlexProps {
|
|
52
|
-
align?: AlignItems | AlignItems[]
|
|
53
|
-
direction?: FlexDirection | FlexDirection[]
|
|
54
|
-
justify?: JustifyContent | JustifyContent[]
|
|
55
|
-
wrap?: FlexWrap | FlexWrap[]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @public
|
|
60
|
-
* @deprecated No longer used.
|
|
61
|
-
*/
|
|
62
|
-
export interface ResponsiveFlexItemProps {
|
|
63
|
-
/** Sets the flex CSS attribute. The property is responsive. */
|
|
64
|
-
flex?: Flex | Flex[]
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @public
|
|
69
|
-
* @deprecated No longer used.
|
|
70
|
-
*/
|
|
71
|
-
export interface ResponsiveGridProps {
|
|
72
|
-
autoRows?: GridAutoRows | GridAutoRows[]
|
|
73
|
-
autoCols?: GridAutoCols | GridAutoCols[]
|
|
74
|
-
autoFlow?: GridAutoFlow | GridAutoFlow[]
|
|
75
|
-
columns?: number | number[]
|
|
76
|
-
rows?: number | number[]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @public
|
|
81
|
-
* @deprecated No longer used.
|
|
82
|
-
*/
|
|
83
|
-
export interface ResponsiveGridItemProps {
|
|
84
|
-
column?: GridItemColumn | GridItemColumn[]
|
|
85
|
-
columnStart?: GridItemColumnStart | GridItemColumnStart[]
|
|
86
|
-
columnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
|
|
87
|
-
row?: GridItemRow | GridItemRow[]
|
|
88
|
-
rowStart?: GridItemRowStart | GridItemRowStart[]
|
|
89
|
-
rowEnd?: GridItemRowEnd | GridItemRowEnd[]
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @public
|
|
94
|
-
* @deprecated No longer used.
|
|
95
|
-
*/
|
|
96
|
-
export interface ResponsiveMarginProps {
|
|
97
|
-
/** Applies margins to all sides. The property is responsive. */
|
|
98
|
-
margin?: number | number[]
|
|
99
|
-
/** Applies margins to the left and right sides. The property is responsive. */
|
|
100
|
-
marginX?: number | number[]
|
|
101
|
-
/** Applies margins to the top and bottom sides. The property is responsive. */
|
|
102
|
-
marginY?: number | number[]
|
|
103
|
-
marginTop?: number | number[]
|
|
104
|
-
marginRight?: number | number[]
|
|
105
|
-
marginBottom?: number | number[]
|
|
106
|
-
marginLeft?: number | number[]
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* @public
|
|
111
|
-
* @deprecated No longer used.
|
|
112
|
-
*/
|
|
113
|
-
export interface ResponsivePaddingProps {
|
|
114
|
-
padding?: number | number[]
|
|
115
|
-
paddingX?: number | number[]
|
|
116
|
-
paddingY?: number | number[]
|
|
117
|
-
paddingTop?: number | number[]
|
|
118
|
-
paddingRight?: number | number[]
|
|
119
|
-
paddingBottom?: number | number[]
|
|
120
|
-
paddingLeft?: number | number[]
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @public
|
|
125
|
-
* @deprecated No longer used.
|
|
126
|
-
*/
|
|
127
|
-
export interface ResponsiveRadiusProps {
|
|
128
|
-
radius?: Radius | Radius[]
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @public
|
|
133
|
-
* @deprecated No longer used.
|
|
134
|
-
*/
|
|
135
|
-
export interface ResponsiveShadowProps {
|
|
136
|
-
shadow?: number | number[]
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @public
|
|
141
|
-
* @deprecated No longer used.
|
|
142
|
-
*/
|
|
143
|
-
export interface ResponsiveWidthProps {
|
|
144
|
-
width?: number | 'auto' | (number | 'auto')[]
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/** @public */
|
|
148
|
-
export type Delay =
|
|
149
|
-
| number
|
|
150
|
-
| Partial<{
|
|
151
|
-
open: number
|
|
152
|
-
close: number
|
|
153
|
-
}>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
* @deprecated
|
|
5
|
-
*/
|
|
6
|
-
type GridItemColumn,
|
|
7
|
-
/**
|
|
8
|
-
* @public
|
|
9
|
-
* @deprecated
|
|
10
|
-
*/
|
|
11
|
-
type GridItemColumnEnd,
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
* @deprecated
|
|
15
|
-
*/
|
|
16
|
-
type GridItemColumnStart,
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
* @deprecated
|
|
20
|
-
*/
|
|
21
|
-
type GridItemRow,
|
|
22
|
-
/**
|
|
23
|
-
* @public
|
|
24
|
-
* @deprecated
|
|
25
|
-
*/
|
|
26
|
-
type GridItemRowEnd,
|
|
27
|
-
/**
|
|
28
|
-
* @public
|
|
29
|
-
* @deprecated
|
|
30
|
-
*/
|
|
31
|
-
type GridItemRowStart,
|
|
32
|
-
} from '@sanity/ui/css'
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Placement of floating UI elements.
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export type Placement =
|
|
7
|
-
| 'top'
|
|
8
|
-
| 'top-start'
|
|
9
|
-
| 'top-end'
|
|
10
|
-
| 'right'
|
|
11
|
-
| 'right-start'
|
|
12
|
-
| 'right-end'
|
|
13
|
-
| 'bottom'
|
|
14
|
-
| 'bottom-start'
|
|
15
|
-
| 'bottom-end'
|
|
16
|
-
| 'left'
|
|
17
|
-
| 'left-start'
|
|
18
|
-
| 'left-end'
|
package/src/core/types/radius.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type {RootTheme, Theme} from './types'
|
|
2
|
-
import type {ThemeColor} from './v0'
|
|
3
|
-
import type {RootTheme_v2, ThemeColorCardToneKey, ThemeColorSchemeKey} from './v2'
|
|
4
|
-
import {defaultThemeConfig} from './v2/defaults/config'
|
|
5
|
-
import {is_v2} from './versioning/is_v2'
|
|
6
|
-
import {themeColor_v0_v2_9} from './versioning/themeColor_v2_v2_9'
|
|
7
|
-
import {v0_v2} from './versioning/v0_v2'
|
|
8
|
-
import {v2_v0} from './versioning/v2_v0'
|
|
9
|
-
|
|
10
|
-
// cache[scheme][tone][rootTheme] = theme
|
|
11
|
-
const cache = new Map<
|
|
12
|
-
ThemeColorSchemeKey,
|
|
13
|
-
Map<ThemeColorCardToneKey, WeakMap<RootTheme | RootTheme_v2, Theme>>
|
|
14
|
-
>()
|
|
15
|
-
|
|
16
|
-
/** @internal */
|
|
17
|
-
export function getScopedTheme(
|
|
18
|
-
themeProp: RootTheme | RootTheme_v2,
|
|
19
|
-
scheme: ThemeColorSchemeKey,
|
|
20
|
-
tone: ThemeColorCardToneKey,
|
|
21
|
-
): Theme {
|
|
22
|
-
const cachedTheme = _getCachedTheme(themeProp, scheme, tone)
|
|
23
|
-
|
|
24
|
-
if (cachedTheme) return cachedTheme
|
|
25
|
-
|
|
26
|
-
const v0 = is_v2(themeProp) ? v2_v0(themeProp) : themeProp
|
|
27
|
-
const v2 = is_v2(themeProp) ? themeProp : v0_v2(themeProp)
|
|
28
|
-
|
|
29
|
-
const colorScheme_v0 = v0.color[scheme] || v0.color.light
|
|
30
|
-
const color_v0 = (colorScheme_v0 as Record<string, ThemeColor>)[tone] || colorScheme_v0.default
|
|
31
|
-
const layer_v0 = v0.layer || defaultThemeConfig.layer
|
|
32
|
-
|
|
33
|
-
const colorScheme_v2 = v2.color[scheme] || v2.color.light
|
|
34
|
-
const color_v2 = colorScheme_v2[tone] || colorScheme_v2.default
|
|
35
|
-
const color_v2_9 = themeColor_v0_v2_9(color_v2)
|
|
36
|
-
const layer_v2 = v2.layer || defaultThemeConfig.layer
|
|
37
|
-
|
|
38
|
-
const theme: Theme = {
|
|
39
|
-
sanity: {
|
|
40
|
-
...v0,
|
|
41
|
-
color: color_v0,
|
|
42
|
-
layer: layer_v0,
|
|
43
|
-
v2: {
|
|
44
|
-
...v2,
|
|
45
|
-
_resolved: true,
|
|
46
|
-
color: color_v2_9,
|
|
47
|
-
layer: layer_v2,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
_setCachedTheme(themeProp, scheme, tone, theme)
|
|
53
|
-
|
|
54
|
-
return theme
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function _getCachedTheme(
|
|
58
|
-
rootTheme: RootTheme | RootTheme_v2,
|
|
59
|
-
scheme: ThemeColorSchemeKey,
|
|
60
|
-
tone: ThemeColorCardToneKey,
|
|
61
|
-
) {
|
|
62
|
-
const schemeCache = cache.get(scheme)
|
|
63
|
-
|
|
64
|
-
if (!schemeCache) return undefined
|
|
65
|
-
|
|
66
|
-
const toneCache = schemeCache.get(tone)
|
|
67
|
-
|
|
68
|
-
if (!toneCache) return undefined
|
|
69
|
-
|
|
70
|
-
return toneCache.get(rootTheme)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _setCachedTheme(
|
|
74
|
-
rootTheme: RootTheme | RootTheme_v2,
|
|
75
|
-
scheme: ThemeColorSchemeKey,
|
|
76
|
-
tone: ThemeColorCardToneKey,
|
|
77
|
-
theme: Theme,
|
|
78
|
-
) {
|
|
79
|
-
if (!cache.has(scheme)) cache.set(scheme, new Map())
|
|
80
|
-
|
|
81
|
-
const schemeCache = cache.get(scheme)!
|
|
82
|
-
|
|
83
|
-
if (!schemeCache.has(tone)) schemeCache.set(tone, new WeakMap())
|
|
84
|
-
|
|
85
|
-
const toneCache = schemeCache.get(tone)!
|
|
86
|
-
|
|
87
|
-
toneCache.set(rootTheme, theme)
|
|
88
|
-
}
|
package/src/theme/v0/avatar.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorBlendModeKey} from '../../v2/color/_system'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
* @deprecated Use `ThemeColorState_v2` instead.
|
|
6
|
-
*/
|
|
7
|
-
export interface ThemeColorGenericState {
|
|
8
|
-
/** @internal */
|
|
9
|
-
_blend?: ThemeColorBlendModeKey
|
|
10
|
-
bg: string
|
|
11
|
-
/**
|
|
12
|
-
* @beta
|
|
13
|
-
*/
|
|
14
|
-
bg2?: string
|
|
15
|
-
border: string
|
|
16
|
-
fg: string
|
|
17
|
-
icon: string
|
|
18
|
-
muted: {
|
|
19
|
-
fg: string
|
|
20
|
-
}
|
|
21
|
-
accent: {
|
|
22
|
-
fg: string
|
|
23
|
-
}
|
|
24
|
-
link: {
|
|
25
|
-
fg: string
|
|
26
|
-
}
|
|
27
|
-
code: {
|
|
28
|
-
bg: string
|
|
29
|
-
fg: string
|
|
30
|
-
}
|
|
31
|
-
skeleton?: {
|
|
32
|
-
from: string
|
|
33
|
-
to: string
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
4
|
-
*/
|
|
5
|
-
export type ThemeColorName =
|
|
6
|
-
| 'transparent'
|
|
7
|
-
| 'default'
|
|
8
|
-
| 'primary'
|
|
9
|
-
| 'positive'
|
|
10
|
-
| 'caution'
|
|
11
|
-
| 'critical'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
16
|
-
*/
|
|
17
|
-
export type ThemeColorToneKey = ThemeColorName
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
* @deprecated Use `ThemeColorCard_v2` instead.
|
|
4
|
-
*/
|
|
5
|
-
export interface ThemeColorBase {
|
|
6
|
-
bg: string
|
|
7
|
-
fg: string
|
|
8
|
-
border: string
|
|
9
|
-
focusRing: string
|
|
10
|
-
backdrop?: string
|
|
11
|
-
shadow: {
|
|
12
|
-
outline: string
|
|
13
|
-
umbra: string
|
|
14
|
-
penumbra: string
|
|
15
|
-
ambient: string
|
|
16
|
-
}
|
|
17
|
-
skeleton?: {
|
|
18
|
-
from: string
|
|
19
|
-
to: string
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorGenericState} from './_generic'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
* @deprecated Use `ThemeColorState_v2` instead.
|
|
6
|
-
*/
|
|
7
|
-
export type ThemeColorButtonState = ThemeColorGenericState
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
* @deprecated Use `ThemeColorButtonStates_v2` instead.
|
|
12
|
-
*/
|
|
13
|
-
export interface ThemeColorButtonStates {
|
|
14
|
-
enabled: ThemeColorGenericState
|
|
15
|
-
hovered: ThemeColorGenericState
|
|
16
|
-
pressed: ThemeColorGenericState
|
|
17
|
-
selected: ThemeColorGenericState
|
|
18
|
-
disabled: ThemeColorGenericState
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* TODO: Rename to `ThemeColorButtonMode`.
|
|
23
|
-
* @public
|
|
24
|
-
* @deprecated Use `ThemeColorButtonTones_v2` instead.
|
|
25
|
-
*/
|
|
26
|
-
export interface ThemeColorButtonTones {
|
|
27
|
-
default: ThemeColorButtonStates
|
|
28
|
-
primary: ThemeColorButtonStates
|
|
29
|
-
positive: ThemeColorButtonStates
|
|
30
|
-
caution: ThemeColorButtonStates
|
|
31
|
-
critical: ThemeColorButtonStates
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @public
|
|
36
|
-
* @deprecated Use `ThemeColorButton_v2` instead.
|
|
37
|
-
*/
|
|
38
|
-
export interface ThemeColorButton {
|
|
39
|
-
default: ThemeColorButtonTones
|
|
40
|
-
ghost: ThemeColorButtonTones
|
|
41
|
-
bleed: ThemeColorButtonTones
|
|
42
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorGenericState} from './_generic'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
* @deprecated Use `ThemeColorState_v2` instead.
|
|
6
|
-
*/
|
|
7
|
-
export type ThemeColorCardState = ThemeColorGenericState
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
12
|
-
*/
|
|
13
|
-
export interface ThemeColorCard {
|
|
14
|
-
enabled: ThemeColorGenericState
|
|
15
|
-
hovered: ThemeColorGenericState
|
|
16
|
-
pressed: ThemeColorGenericState
|
|
17
|
-
selected: ThemeColorGenericState
|
|
18
|
-
disabled: ThemeColorGenericState
|
|
19
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorSchemeKey, ThemeColorSyntax} from '../../v2/color'
|
|
2
|
-
import type {ThemeColorGenericState} from './_generic'
|
|
3
|
-
import type {ThemeColorName} from './_system'
|
|
4
|
-
import type {ThemeColorBase} from './base'
|
|
5
|
-
import type {ThemeColorButton} from './button'
|
|
6
|
-
import type {ThemeColorCard} from './card'
|
|
7
|
-
import type {ThemeColorInput} from './input'
|
|
8
|
-
import type {ThemeColorMuted} from './muted'
|
|
9
|
-
import type {ThemeColorSelectable} from './selectable'
|
|
10
|
-
import type {ThemeColorSolid} from './solid'
|
|
11
|
-
import type {ThemeColorSpot} from './spot'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
* @deprecated Use `ThemeColor_v2` instead.
|
|
16
|
-
*/
|
|
17
|
-
export interface ThemeColor extends Partial<Omit<ThemeColorGenericState, 'muted'>> {
|
|
18
|
-
base: ThemeColorBase
|
|
19
|
-
button: ThemeColorButton
|
|
20
|
-
card: ThemeColorCard
|
|
21
|
-
dark: boolean
|
|
22
|
-
input: ThemeColorInput
|
|
23
|
-
muted: ThemeColorMuted
|
|
24
|
-
selectable?: ThemeColorSelectable
|
|
25
|
-
solid: ThemeColorSolid
|
|
26
|
-
spot: ThemeColorSpot
|
|
27
|
-
syntax: ThemeColorSyntax
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @public
|
|
32
|
-
* @deprecated Use `ThemeColorScheme_v2` instead.
|
|
33
|
-
*/
|
|
34
|
-
export type ThemeColorScheme = Record<ThemeColorName, ThemeColor>
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @public
|
|
38
|
-
* @deprecated Use `ThemeColorSchemes_v2` instead.
|
|
39
|
-
*/
|
|
40
|
-
export type ThemeColorSchemes = Record<ThemeColorSchemeKey, ThemeColorScheme>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './_generic'
|
|
2
|
-
export * from './_system'
|
|
3
|
-
export * from './base'
|
|
4
|
-
export * from './button'
|
|
5
|
-
export * from './card'
|
|
6
|
-
export * from './color'
|
|
7
|
-
export * from './input'
|
|
8
|
-
export * from './muted'
|
|
9
|
-
export * from './selectable'
|
|
10
|
-
export * from './solid'
|
|
11
|
-
export * from './spot'
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorBlendModeKey} from '../../v2/color/_system'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
* @deprecated Use `ThemeColorInputState_v2` instead.
|
|
6
|
-
*/
|
|
7
|
-
export interface ThemeColorInputState {
|
|
8
|
-
_blend?: ThemeColorBlendModeKey
|
|
9
|
-
bg: string
|
|
10
|
-
bg2: string
|
|
11
|
-
border: string
|
|
12
|
-
fg: string
|
|
13
|
-
placeholder: string
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
* @deprecated Use `ThemeColorInputMode_v2` instead.
|
|
19
|
-
*/
|
|
20
|
-
export interface ThemeColorInputStates {
|
|
21
|
-
enabled: ThemeColorInputState
|
|
22
|
-
disabled: ThemeColorInputState
|
|
23
|
-
hovered: ThemeColorInputState
|
|
24
|
-
readOnly: ThemeColorInputState
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @public
|
|
29
|
-
* @deprecated Use `ThemeColorInput_v2` instead.
|
|
30
|
-
*/
|
|
31
|
-
export interface ThemeColorInput {
|
|
32
|
-
default: ThemeColorInputStates
|
|
33
|
-
invalid: ThemeColorInputStates
|
|
34
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorGenericState} from './_generic'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
* @deprecated Use `ThemeColorSelectableTone_v2` instead.
|
|
6
|
-
*/
|
|
7
|
-
export interface ThemeColorMutedTone {
|
|
8
|
-
enabled: ThemeColorGenericState
|
|
9
|
-
disabled: ThemeColorGenericState
|
|
10
|
-
hovered: ThemeColorGenericState
|
|
11
|
-
pressed: ThemeColorGenericState
|
|
12
|
-
selected: ThemeColorGenericState
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @public
|
|
17
|
-
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
18
|
-
*/
|
|
19
|
-
export interface ThemeColorMuted {
|
|
20
|
-
default: ThemeColorMutedTone
|
|
21
|
-
transparent: ThemeColorMutedTone
|
|
22
|
-
primary: ThemeColorMutedTone
|
|
23
|
-
positive: ThemeColorMutedTone
|
|
24
|
-
caution: ThemeColorMutedTone
|
|
25
|
-
critical: ThemeColorMutedTone
|
|
26
|
-
}
|