@sanity/ui 3.0.0-static.33 → 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 +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 +2 -904
- package/dist/_visual-editing.d.ts +2 -904
- 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 +805 -14697
- package/dist/css/index.d.ts +805 -14697
- 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 +990 -3095
- package/dist/index.d.ts +990 -3095
- package/dist/index.js +243 -360
- 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 +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
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import type {ThemeFonts} from '../../v0'
|
|
2
|
-
|
|
3
|
-
export const defaultThemeFonts: ThemeFonts = {
|
|
4
|
-
code: {
|
|
5
|
-
family: 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace',
|
|
6
|
-
weights: {
|
|
7
|
-
regular: 400,
|
|
8
|
-
medium: 500,
|
|
9
|
-
semibold: 600,
|
|
10
|
-
bold: 700,
|
|
11
|
-
},
|
|
12
|
-
sizes: [
|
|
13
|
-
{
|
|
14
|
-
ascenderHeight: 4,
|
|
15
|
-
descenderHeight: 4,
|
|
16
|
-
fontSize: 10,
|
|
17
|
-
iconSize: 17,
|
|
18
|
-
lineHeight: 15,
|
|
19
|
-
letterSpacing: 0,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
ascenderHeight: 5,
|
|
23
|
-
descenderHeight: 5,
|
|
24
|
-
fontSize: 13,
|
|
25
|
-
iconSize: 21,
|
|
26
|
-
lineHeight: 19,
|
|
27
|
-
letterSpacing: 0,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
ascenderHeight: 6,
|
|
31
|
-
descenderHeight: 6,
|
|
32
|
-
fontSize: 16,
|
|
33
|
-
iconSize: 25,
|
|
34
|
-
lineHeight: 23,
|
|
35
|
-
letterSpacing: 0,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
ascenderHeight: 7,
|
|
39
|
-
descenderHeight: 7,
|
|
40
|
-
fontSize: 19,
|
|
41
|
-
iconSize: 29,
|
|
42
|
-
lineHeight: 27,
|
|
43
|
-
letterSpacing: 0,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
ascenderHeight: 8,
|
|
47
|
-
descenderHeight: 8,
|
|
48
|
-
fontSize: 22,
|
|
49
|
-
iconSize: 33,
|
|
50
|
-
lineHeight: 31,
|
|
51
|
-
letterSpacing: 0,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
heading: {
|
|
56
|
-
family:
|
|
57
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
58
|
-
weights: {
|
|
59
|
-
regular: 600,
|
|
60
|
-
medium: 700,
|
|
61
|
-
semibold: 800,
|
|
62
|
-
bold: 900,
|
|
63
|
-
},
|
|
64
|
-
sizes: [
|
|
65
|
-
{
|
|
66
|
-
ascenderHeight: 5,
|
|
67
|
-
descenderHeight: 5,
|
|
68
|
-
fontSize: 13,
|
|
69
|
-
iconSize: 17,
|
|
70
|
-
lineHeight: 19,
|
|
71
|
-
letterSpacing: 0,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
ascenderHeight: 6,
|
|
75
|
-
descenderHeight: 6,
|
|
76
|
-
fontSize: 16,
|
|
77
|
-
iconSize: 25,
|
|
78
|
-
lineHeight: 23,
|
|
79
|
-
letterSpacing: 0,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
ascenderHeight: 7,
|
|
83
|
-
descenderHeight: 7,
|
|
84
|
-
fontSize: 21,
|
|
85
|
-
iconSize: 33,
|
|
86
|
-
lineHeight: 29,
|
|
87
|
-
letterSpacing: -0.25,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
ascenderHeight: 8,
|
|
91
|
-
descenderHeight: 8,
|
|
92
|
-
fontSize: 27,
|
|
93
|
-
iconSize: 41,
|
|
94
|
-
lineHeight: 35,
|
|
95
|
-
letterSpacing: -0.5,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
ascenderHeight: 9.5,
|
|
99
|
-
descenderHeight: 8.5,
|
|
100
|
-
fontSize: 33,
|
|
101
|
-
iconSize: 49,
|
|
102
|
-
lineHeight: 41,
|
|
103
|
-
letterSpacing: -1,
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
ascenderHeight: 10.5,
|
|
107
|
-
descenderHeight: 9.5,
|
|
108
|
-
fontSize: 38,
|
|
109
|
-
iconSize: 53,
|
|
110
|
-
lineHeight: 47,
|
|
111
|
-
letterSpacing: -1,
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
label: {
|
|
116
|
-
family:
|
|
117
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
|
|
118
|
-
weights: {
|
|
119
|
-
regular: 500,
|
|
120
|
-
medium: 600,
|
|
121
|
-
semibold: 700,
|
|
122
|
-
bold: 800,
|
|
123
|
-
},
|
|
124
|
-
sizes: [
|
|
125
|
-
{
|
|
126
|
-
ascenderHeight: 2,
|
|
127
|
-
descenderHeight: 2,
|
|
128
|
-
fontSize: 8.1,
|
|
129
|
-
iconSize: 13,
|
|
130
|
-
lineHeight: 10,
|
|
131
|
-
letterSpacing: 0.5,
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
ascenderHeight: 1.5,
|
|
135
|
-
descenderHeight: 2.5,
|
|
136
|
-
fontSize: 9.5,
|
|
137
|
-
iconSize: 15,
|
|
138
|
-
lineHeight: 11,
|
|
139
|
-
letterSpacing: 0.5,
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
ascenderHeight: 2,
|
|
143
|
-
descenderHeight: 2,
|
|
144
|
-
fontSize: 10.8,
|
|
145
|
-
iconSize: 17,
|
|
146
|
-
lineHeight: 12,
|
|
147
|
-
letterSpacing: 0.5,
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
ascenderHeight: 2,
|
|
151
|
-
descenderHeight: 2,
|
|
152
|
-
fontSize: 12.25,
|
|
153
|
-
iconSize: 19,
|
|
154
|
-
lineHeight: 13,
|
|
155
|
-
letterSpacing: 0.5,
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
ascenderHeight: 1.5,
|
|
159
|
-
descenderHeight: 2.5,
|
|
160
|
-
fontSize: 13.6,
|
|
161
|
-
iconSize: 21,
|
|
162
|
-
lineHeight: 14,
|
|
163
|
-
letterSpacing: 0.5,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
ascenderHeight: 2,
|
|
167
|
-
descenderHeight: 2,
|
|
168
|
-
fontSize: 15,
|
|
169
|
-
iconSize: 23,
|
|
170
|
-
lineHeight: 15,
|
|
171
|
-
letterSpacing: 0.5,
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
text: {
|
|
176
|
-
family:
|
|
177
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
178
|
-
weights: {
|
|
179
|
-
regular: 400,
|
|
180
|
-
medium: 500,
|
|
181
|
-
semibold: 600,
|
|
182
|
-
bold: 700,
|
|
183
|
-
},
|
|
184
|
-
sizes: [
|
|
185
|
-
{
|
|
186
|
-
ascenderHeight: 4,
|
|
187
|
-
descenderHeight: 4,
|
|
188
|
-
fontSize: 10,
|
|
189
|
-
iconSize: 17,
|
|
190
|
-
lineHeight: 15,
|
|
191
|
-
letterSpacing: 0,
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
ascenderHeight: 5,
|
|
195
|
-
descenderHeight: 5,
|
|
196
|
-
fontSize: 13,
|
|
197
|
-
iconSize: 21,
|
|
198
|
-
lineHeight: 19,
|
|
199
|
-
letterSpacing: 0,
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
ascenderHeight: 6,
|
|
203
|
-
descenderHeight: 6,
|
|
204
|
-
fontSize: 15,
|
|
205
|
-
iconSize: 25,
|
|
206
|
-
lineHeight: 23,
|
|
207
|
-
letterSpacing: 0,
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
ascenderHeight: 7,
|
|
211
|
-
descenderHeight: 7,
|
|
212
|
-
fontSize: 18,
|
|
213
|
-
iconSize: 29,
|
|
214
|
-
lineHeight: 27,
|
|
215
|
-
letterSpacing: 0,
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
ascenderHeight: 8,
|
|
219
|
-
descenderHeight: 8,
|
|
220
|
-
fontSize: 21,
|
|
221
|
-
iconSize: 33,
|
|
222
|
-
lineHeight: 31,
|
|
223
|
-
letterSpacing: 0,
|
|
224
|
-
},
|
|
225
|
-
],
|
|
226
|
-
},
|
|
227
|
-
}
|
package/src/theme/v2/index.ts
DELETED
package/src/theme/v2/input.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type {ThemeFocusRing} from '../v0/focusRing'
|
|
2
|
-
|
|
3
|
-
/** @public */
|
|
4
|
-
export interface ThemeInput_v2 {
|
|
5
|
-
checkbox: {
|
|
6
|
-
size: number
|
|
7
|
-
focusRing: ThemeFocusRing
|
|
8
|
-
}
|
|
9
|
-
radio: {
|
|
10
|
-
size: number
|
|
11
|
-
markSize: number
|
|
12
|
-
focusRing: ThemeFocusRing
|
|
13
|
-
}
|
|
14
|
-
switch: {
|
|
15
|
-
width: number
|
|
16
|
-
height: number
|
|
17
|
-
padding: number
|
|
18
|
-
transitionDurationMs: number
|
|
19
|
-
transitionTimingFunction: string
|
|
20
|
-
focusRing: ThemeFocusRing
|
|
21
|
-
}
|
|
22
|
-
border: {
|
|
23
|
-
width: number
|
|
24
|
-
}
|
|
25
|
-
select: {
|
|
26
|
-
focusRing: ThemeFocusRing
|
|
27
|
-
}
|
|
28
|
-
text: {
|
|
29
|
-
focusRing: ThemeFocusRing
|
|
30
|
-
}
|
|
31
|
-
}
|
package/src/theme/v2/theme.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type {ThemeFocusRing} from '../v0/focusRing'
|
|
2
|
-
import type {ThemeFonts, ThemeFontWeightKey} from '../v0/font'
|
|
3
|
-
import type {ThemeLayer} from '../v0/layer'
|
|
4
|
-
import type {ThemeShadow} from '../v0/shadow'
|
|
5
|
-
import type {ThemeStyles} from '../v0/styles'
|
|
6
|
-
import type {ThemeAvatar_v2} from './avatar'
|
|
7
|
-
import type {ThemeColorCard_v2, ThemeColorSchemes_v2} from './color'
|
|
8
|
-
import type {ThemeInput_v2} from './input'
|
|
9
|
-
|
|
10
|
-
/** @public */
|
|
11
|
-
export interface RootTheme_v2 {
|
|
12
|
-
_version: 2
|
|
13
|
-
avatar: ThemeAvatar_v2
|
|
14
|
-
button: {
|
|
15
|
-
border: {width: number}
|
|
16
|
-
focusRing: ThemeFocusRing
|
|
17
|
-
textWeight: ThemeFontWeightKey
|
|
18
|
-
}
|
|
19
|
-
card: {
|
|
20
|
-
border: {width: number}
|
|
21
|
-
focusRing: ThemeFocusRing
|
|
22
|
-
shadow: {outline: number}
|
|
23
|
-
}
|
|
24
|
-
color: ThemeColorSchemes_v2
|
|
25
|
-
container: number[]
|
|
26
|
-
font: ThemeFonts
|
|
27
|
-
input: ThemeInput_v2
|
|
28
|
-
layer: ThemeLayer
|
|
29
|
-
media: number[]
|
|
30
|
-
radius: number[]
|
|
31
|
-
shadow: Array<ThemeShadow | null>
|
|
32
|
-
space: number[]
|
|
33
|
-
/** @internal */
|
|
34
|
-
style?: ThemeStyles
|
|
35
|
-
}
|
|
36
|
-
/** @public */
|
|
37
|
-
export type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
|
|
38
|
-
color: ThemeColorCard_v2
|
|
39
|
-
/**
|
|
40
|
-
* Indicates whether the theme is resolved or raw, it's necessary to avoid issues
|
|
41
|
-
* with sanity V2 components accessing a v1 <ThemeProvider>.
|
|
42
|
-
* See https://github.com/sanity-io/ui/pull/1203 for more info.
|
|
43
|
-
*/
|
|
44
|
-
_resolved: boolean
|
|
45
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** @public */
|
|
2
|
-
export const AVATAR_SIZE = [0, 1, 2, 3] as const
|
|
3
|
-
|
|
4
|
-
/** @public */
|
|
5
|
-
export const CONTAINER_SCALE = [0, 1, 2, 3, 4, 5] as const
|
|
6
|
-
|
|
7
|
-
/** @public */
|
|
8
|
-
export const CONTAINER = [...CONTAINER_SCALE, 'auto'] as const
|
|
9
|
-
|
|
10
|
-
/** @public */
|
|
11
|
-
export const RADIUS = [0, 1, 2, 3, 4, 5, 6] as const
|
|
12
|
-
|
|
13
|
-
/** @public */
|
|
14
|
-
export const SPACE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] as const
|
|
15
|
-
|
|
16
|
-
/** @public */
|
|
17
|
-
export const FONT_CODE_SIZE = [0, 1, 2, 3, 4] as const
|
|
18
|
-
|
|
19
|
-
/** @public */
|
|
20
|
-
export const FONT_HEADING_SIZE = [0, 1, 2, 3, 4, 5] as const
|
|
21
|
-
|
|
22
|
-
/** @public */
|
|
23
|
-
export const FONT_LABEL_SIZE = [0, 1, 2, 3, 4, 5] as const
|
|
24
|
-
|
|
25
|
-
/** @public */
|
|
26
|
-
export const FONT_TEXT_SIZE = [0, 1, 2, 3, 4] as const
|
|
27
|
-
|
|
28
|
-
/** @public */
|
|
29
|
-
export const SHADOW = [0, 1, 2, 3, 4, 5] as const
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {black, hues, white} from '@sanity/color'
|
|
2
|
-
|
|
3
|
-
import type {ThemeShadow} from '../v0'
|
|
4
|
-
import {defaultThemeConfig} from '../v2/defaults/config'
|
|
5
|
-
import {defaultThemeFonts} from './defaultFonts'
|
|
6
|
-
import {defaultTokens} from './defaultTokens'
|
|
7
|
-
import {resolveTokens} from './resolveTokens'
|
|
8
|
-
import type {Radius, Shadow, Space, Theme_v3, ThemeOptions} from './types'
|
|
9
|
-
|
|
10
|
-
/** @public */
|
|
11
|
-
export function buildTheme_v3(options?: ThemeOptions): Theme_v3 {
|
|
12
|
-
const {v2} = options ?? {}
|
|
13
|
-
|
|
14
|
-
const tokens = resolveTokens(options?.tokens ?? defaultTokens)
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
_version: 3,
|
|
18
|
-
_tokens: tokens,
|
|
19
|
-
avatar: v2?.avatar ?? defaultThemeConfig.avatar,
|
|
20
|
-
button: v2?.button ?? defaultThemeConfig.button,
|
|
21
|
-
card: v2?.card ?? defaultThemeConfig.card,
|
|
22
|
-
color: tokens.color,
|
|
23
|
-
container: v2?.container ?? defaultThemeConfig.container,
|
|
24
|
-
font: defaultThemeFonts,
|
|
25
|
-
input: v2?.input ?? defaultThemeConfig.input,
|
|
26
|
-
layer: v2?.layer ?? defaultThemeConfig.layer,
|
|
27
|
-
media: v2?.media ?? defaultThemeConfig.media,
|
|
28
|
-
palette: {black, white, hues},
|
|
29
|
-
// TODO
|
|
30
|
-
radius: (v2?.radius ?? defaultThemeConfig.radius) as unknown as Record<Radius, number>,
|
|
31
|
-
// TODO
|
|
32
|
-
shadow: (v2?.shadow ?? defaultThemeConfig.shadow) as unknown as Record<
|
|
33
|
-
Shadow,
|
|
34
|
-
ThemeShadow | undefined
|
|
35
|
-
>,
|
|
36
|
-
// TODO
|
|
37
|
-
space: (v2?.space ?? defaultThemeConfig.space) as unknown as Record<Space, number>,
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type {AVATAR_COLORS} from './_constants'
|
|
2
|
-
import type {ColorValue} from './token'
|
|
3
|
-
|
|
4
|
-
/** @public */
|
|
5
|
-
export type AvatarColor = (typeof AVATAR_COLORS)[number]
|
|
6
|
-
|
|
7
|
-
/** @public */
|
|
8
|
-
export interface ThemeColorAvatarHue_v3 {
|
|
9
|
-
bg: ColorValue
|
|
10
|
-
fg: ColorValue
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** @public */
|
|
14
|
-
export type ThemeColorAvatar_v3 = Record<AvatarColor, ThemeColorAvatarHue_v3>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type {ThemeColorStateToneKey} from '../../v2'
|
|
2
|
-
import type {Hue} from '../palette'
|
|
3
|
-
import type {ElementColorTokens} from './element'
|
|
4
|
-
import type {ColorValue} from './token'
|
|
5
|
-
|
|
6
|
-
/** @public */
|
|
7
|
-
export interface CardColorTokens {
|
|
8
|
-
_hue: Hue
|
|
9
|
-
avatar: Record<
|
|
10
|
-
Hue,
|
|
11
|
-
{
|
|
12
|
-
_hue: Hue
|
|
13
|
-
bg: ColorValue
|
|
14
|
-
fg: ColorValue
|
|
15
|
-
}
|
|
16
|
-
>
|
|
17
|
-
backdrop: ColorValue
|
|
18
|
-
code: {
|
|
19
|
-
bg: ColorValue
|
|
20
|
-
fg: ColorValue
|
|
21
|
-
token: {
|
|
22
|
-
atrule: ColorValue
|
|
23
|
-
attrName: ColorValue
|
|
24
|
-
attrValue: ColorValue
|
|
25
|
-
attribute: ColorValue
|
|
26
|
-
boolean: ColorValue
|
|
27
|
-
builtin: ColorValue
|
|
28
|
-
cdata: ColorValue
|
|
29
|
-
char: ColorValue
|
|
30
|
-
class: ColorValue
|
|
31
|
-
className: ColorValue
|
|
32
|
-
comment: ColorValue
|
|
33
|
-
constant: ColorValue
|
|
34
|
-
deleted: ColorValue
|
|
35
|
-
doctype: ColorValue
|
|
36
|
-
entity: ColorValue
|
|
37
|
-
function: ColorValue
|
|
38
|
-
hexcode: ColorValue
|
|
39
|
-
id: ColorValue
|
|
40
|
-
important: ColorValue
|
|
41
|
-
inserted: ColorValue
|
|
42
|
-
keyword: ColorValue
|
|
43
|
-
number: ColorValue
|
|
44
|
-
operator: ColorValue
|
|
45
|
-
prolog: ColorValue
|
|
46
|
-
property: ColorValue
|
|
47
|
-
pseudoClass: ColorValue
|
|
48
|
-
pseudoElement: ColorValue
|
|
49
|
-
punctuation: ColorValue
|
|
50
|
-
regex: ColorValue
|
|
51
|
-
selector: ColorValue
|
|
52
|
-
string: ColorValue
|
|
53
|
-
symbol: ColorValue
|
|
54
|
-
tag: ColorValue
|
|
55
|
-
unit: ColorValue
|
|
56
|
-
url: ColorValue
|
|
57
|
-
variable: ColorValue
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
focusRing: ColorValue
|
|
61
|
-
link: {
|
|
62
|
-
fg: ColorValue
|
|
63
|
-
}
|
|
64
|
-
shadow: {
|
|
65
|
-
outline: ColorValue
|
|
66
|
-
umbra: ColorValue
|
|
67
|
-
penumbra: ColorValue
|
|
68
|
-
ambient: ColorValue
|
|
69
|
-
}
|
|
70
|
-
skeleton: {
|
|
71
|
-
from: ColorValue
|
|
72
|
-
to: ColorValue
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
variant: {
|
|
76
|
-
solid: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
|
|
77
|
-
tinted: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ThemeColorCardToneKey as CardTone,
|
|
3
|
-
ThemeColorStateToneKey as ElementTone,
|
|
4
|
-
} from '../../v2'
|
|
5
|
-
import type {Hue} from '../palette'
|
|
6
|
-
import type {COLOR_VARIANTS} from './_constants'
|
|
7
|
-
import type {ThemeColorAvatar_v3} from './avatar'
|
|
8
|
-
import type {ColorValue} from './token'
|
|
9
|
-
|
|
10
|
-
/** @public */
|
|
11
|
-
export interface ThemeColorElement {
|
|
12
|
-
_hue: Hue
|
|
13
|
-
bg: {
|
|
14
|
-
0: ColorValue
|
|
15
|
-
4: ColorValue
|
|
16
|
-
}
|
|
17
|
-
border: {
|
|
18
|
-
0: ColorValue
|
|
19
|
-
4: ColorValue
|
|
20
|
-
}
|
|
21
|
-
fg: {
|
|
22
|
-
0: ColorValue
|
|
23
|
-
4: ColorValue
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** @public */
|
|
28
|
-
export type ThemeColorVariant = Record<ElementTone, ThemeColorElement>
|
|
29
|
-
|
|
30
|
-
/** @public */
|
|
31
|
-
export type ThemeColorVariantKey = (typeof COLOR_VARIANTS)[number] // 'tinted' | 'solid'
|
|
32
|
-
|
|
33
|
-
/** @public */
|
|
34
|
-
export interface ThemeColorCard_v3 {
|
|
35
|
-
_hue: Hue
|
|
36
|
-
avatar: ThemeColorAvatar_v3
|
|
37
|
-
backdrop: ColorValue
|
|
38
|
-
code: {
|
|
39
|
-
bg: ColorValue
|
|
40
|
-
fg: ColorValue
|
|
41
|
-
token: {
|
|
42
|
-
atrule: ColorValue
|
|
43
|
-
attrName: ColorValue
|
|
44
|
-
attrValue: ColorValue
|
|
45
|
-
attribute: ColorValue
|
|
46
|
-
boolean: ColorValue
|
|
47
|
-
builtin: ColorValue
|
|
48
|
-
cdata: ColorValue
|
|
49
|
-
char: ColorValue
|
|
50
|
-
class: ColorValue
|
|
51
|
-
className: ColorValue
|
|
52
|
-
comment: ColorValue
|
|
53
|
-
constant: ColorValue
|
|
54
|
-
deleted: ColorValue
|
|
55
|
-
doctype: ColorValue
|
|
56
|
-
entity: ColorValue
|
|
57
|
-
function: ColorValue
|
|
58
|
-
hexcode: ColorValue
|
|
59
|
-
id: ColorValue
|
|
60
|
-
important: ColorValue
|
|
61
|
-
inserted: ColorValue
|
|
62
|
-
keyword: ColorValue
|
|
63
|
-
number: ColorValue
|
|
64
|
-
operator: ColorValue
|
|
65
|
-
prolog: ColorValue
|
|
66
|
-
property: ColorValue
|
|
67
|
-
pseudoClass: ColorValue
|
|
68
|
-
pseudoElement: ColorValue
|
|
69
|
-
punctuation: ColorValue
|
|
70
|
-
regex: ColorValue
|
|
71
|
-
selector: ColorValue
|
|
72
|
-
string: ColorValue
|
|
73
|
-
symbol: ColorValue
|
|
74
|
-
tag: ColorValue
|
|
75
|
-
unit: ColorValue
|
|
76
|
-
url: ColorValue
|
|
77
|
-
variable: ColorValue
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
focusRing: ColorValue
|
|
81
|
-
link: {
|
|
82
|
-
fg: ColorValue
|
|
83
|
-
}
|
|
84
|
-
shadow: {
|
|
85
|
-
outline: ColorValue
|
|
86
|
-
umbra: ColorValue
|
|
87
|
-
penumbra: ColorValue
|
|
88
|
-
ambient: ColorValue
|
|
89
|
-
}
|
|
90
|
-
skeleton: {
|
|
91
|
-
from: ColorValue
|
|
92
|
-
to: ColorValue
|
|
93
|
-
}
|
|
94
|
-
variant: Record<ThemeColorVariantKey, ThemeColorVariant>
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** @public */
|
|
98
|
-
export type ThemeColor_v3 = Record<CardTone, ThemeColorCard_v3>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type {Hue} from '../palette'
|
|
2
|
-
import type {ColorValue} from './token'
|
|
3
|
-
|
|
4
|
-
/** @public */
|
|
5
|
-
export interface ElementColorTokens {
|
|
6
|
-
_hue: Hue
|
|
7
|
-
bg: {
|
|
8
|
-
0: ColorValue
|
|
9
|
-
4: ColorValue
|
|
10
|
-
}
|
|
11
|
-
border: {
|
|
12
|
-
0: ColorValue
|
|
13
|
-
4: ColorValue
|
|
14
|
-
}
|
|
15
|
-
fg: {
|
|
16
|
-
0: ColorValue
|
|
17
|
-
4: ColorValue
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type {Hue, Tint} from '../palette'
|
|
2
|
-
|
|
3
|
-
/** @public */
|
|
4
|
-
export type ColorTokenOpacityValue = `0` | `0.${number}` | `1`
|
|
5
|
-
|
|
6
|
-
/** @public */
|
|
7
|
-
export type ColorToken =
|
|
8
|
-
| `inherit`
|
|
9
|
-
| `black`
|
|
10
|
-
| `black/${ColorTokenOpacityValue}`
|
|
11
|
-
| `white`
|
|
12
|
-
| `white/${ColorTokenOpacityValue}`
|
|
13
|
-
| `${Hue}-${Tint}`
|
|
14
|
-
| `${Hue}-${Tint}/${ColorTokenOpacityValue}`
|
|
15
|
-
| `${Hue}-${Tint} ${number}%`
|
|
16
|
-
| `${Tint}`
|
|
17
|
-
| `${Tint}/${ColorTokenOpacityValue}`
|
|
18
|
-
| `${Tint} ${number}%`
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Theme color values are tuples of [light, dark] color tokens.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export type ColorValue = [ColorToken, ColorToken]
|
|
26
|
-
|
|
27
|
-
/** @public */
|
|
28
|
-
export interface ResolvedColorToken {
|
|
29
|
-
color: {type: 'inherit'} | {type: 'black' | 'white'} | {type: 'hue'; hue: Hue; tint: Tint}
|
|
30
|
-
opacity: number
|
|
31
|
-
mix: number
|
|
32
|
-
}
|