@sanity/ui 3.0.0-static.15 → 3.0.0-static.17
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 +6 -6
- package/bin/{ui.js → sanity-ui.cjs} +1 -1
- package/dist/_chunks-cjs/{_visual-editing.js → _visual-editing.cjs} +67 -77
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
- package/dist/_chunks-cjs/{buildCommand.js → buildCommand.cjs} +26 -10
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
- package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
- package/dist/_chunks-cjs/refractor.cjs.map +1 -0
- package/dist/_chunks-es/{_visual-editing.mjs → _visual-editing.js} +68 -78
- package/dist/_chunks-es/_visual-editing.js.map +1 -0
- package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
- package/dist/_chunks-es/refractor.js.map +1 -0
- package/dist/_visual-editing.cjs +30 -0
- package/dist/_visual-editing.cjs.map +1 -0
- package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +5 -15
- package/dist/_visual-editing.d.ts +5 -15
- package/dist/_visual-editing.js +29 -30
- package/dist/_visual-editing.js.map +1 -1
- package/dist/{cli.js → cli.cjs} +4 -4
- package/dist/cli.cjs.map +1 -0
- package/dist/{css.mjs → css.cjs} +809 -923
- package/dist/css.cjs.map +1 -0
- package/dist/{css.d.mts → css.d.cts} +31 -24
- package/dist/css.d.ts +31 -24
- package/dist/css.js +809 -921
- package/dist/css.js.map +1 -1
- package/dist/{index.mjs → index.cjs} +373 -406
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +10 -20
- package/dist/index.d.ts +10 -20
- package/dist/index.js +371 -406
- package/dist/index.js.map +1 -1
- package/dist/{theme.mjs → theme.cjs} +219 -196
- package/dist/theme.cjs.map +1 -0
- package/dist/{theme.d.mts → theme.d.cts} +2 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +218 -195
- package/dist/theme.js.map +1 -1
- package/dist/{sanity-palette.css → ui-palette.css} +1 -1
- package/dist/ui-palette.min.css +1 -0
- package/dist/{system.css → ui-system.css} +1135 -245
- package/dist/ui-system.min.css +1 -0
- package/dist/{sanity-theme.css → ui-theme.css} +199 -199
- package/dist/ui-theme.min.css +1 -0
- package/dist/ui.css +29152 -0
- package/dist/ui.min.css +1 -0
- package/exports/_visual-editing.ts +27 -27
- package/exports/index.ts +1 -1
- package/package.json +24 -24
- package/src/cli/buildCommand.ts +55 -20
- package/src/cli/index.ts +2 -14
- package/src/{ui → core}/StyleTags.tsx +4 -4
- package/src/{ui → core}/_compat/index.ts +0 -1
- package/src/{ui → core}/_compat/theme/themeProvider.tsx +3 -3
- package/src/{ui → core}/components/autocomplete/__workshop__/async.tsx +2 -2
- package/src/{ui → core}/components/autocomplete/__workshop__/custom.tsx +2 -2
- package/src/{ui → core}/components/autocomplete/__workshop__/focusAndBlur.tsx +3 -3
- package/src/{ui → core}/components/tab/tabList.tsx +19 -4
- package/src/{ui → core}/index.ts +0 -1
- package/src/{ui → core}/primitives/box/box.tsx +3 -0
- package/src/core/primitives/button/__workshop__/custom.tsx +27 -0
- package/src/{ui → core}/primitives/button/button.tsx +3 -1
- package/src/{ui → core}/primitives/card/__workshop__/asButton.tsx +0 -9
- package/src/{ui → core}/primitives/card/__workshop__/interactive.tsx +0 -1
- package/src/{ui → core}/primitives/card/__workshop__/props.tsx +0 -3
- package/src/{ui → core}/primitives/card/__workshop__/selected.tsx +6 -37
- package/src/{ui → core}/primitives/card/card.tsx +15 -21
- package/src/core/primitives/card/cardProvider.tsx +27 -0
- package/src/{ui → core}/primitives/card/types.ts +5 -4
- package/src/{ui → core}/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/{ui → core}/primitives/heading/__workshop__/plain.tsx +1 -8
- package/src/{ui → core}/primitives/label/__workshop__/plain.tsx +1 -9
- package/src/{ui → core}/primitives/popover/popover.tsx +1 -1
- package/src/{ui → core}/primitives/text/__workshop__/example.tsx +1 -9
- package/src/{ui → core}/primitives/tooltip/tooltip.tsx +1 -1
- package/src/{ui/utils/portal/portal.ts → core/utils/portal/portal.tsx} +8 -10
- package/src/css/{compilePalette.ts → _compilePalette.ts} +2 -2
- package/src/css/{compileSystem.ts → _compileSystem.ts} +1 -1
- package/src/css/{compileTheme.ts → _compileTheme.ts} +3 -3
- package/src/css/{compileTheme_v3.ts → _compileTheme_v3.ts} +7 -1
- package/src/css/_mergeStyles.ts +0 -7
- package/src/css/_system.style.ts +3 -0
- package/src/css/aspects/font/font.style.ts +0 -21
- package/src/css/aspects/font/font.ts +1 -6
- package/src/css/aspects/font/types.ts +0 -4
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/textAlign/index.ts +2 -0
- package/src/css/aspects/textAlign/textAlign.style.ts +26 -0
- package/src/css/aspects/textAlign/textAlign.ts +8 -0
- package/src/css/aspects/textAlign/types.ts +7 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/_input/_input.style.ts +9 -11
- package/src/css/primitives/box/box.style.ts +5 -1
- package/src/css/primitives/box/box.ts +2 -0
- package/src/css/primitives/box/types.ts +2 -0
- package/src/css/primitives/button/button.style.ts +23 -9
- package/src/css/primitives/button/button.ts +1 -12
- package/src/css/primitives/button/types.ts +1 -6
- package/src/css/primitives/card/card.style.ts +12 -21
- package/src/css/primitives/heading/heading.ts +2 -1
- package/src/css/primitives/heading/types.ts +2 -1
- package/src/css/primitives/kbd/kbd.style.ts +3 -6
- package/src/css/primitives/label/label.ts +2 -1
- package/src/css/primitives/label/types.ts +2 -1
- package/src/css/primitives/text/text.style.ts +0 -5
- package/src/css/primitives/text/text.ts +2 -1
- package/src/css/primitives/text/types.ts +2 -1
- package/src/css/primitives/textInput/textInput.style.ts +1 -120
- package/src/css/types.ts +9 -9
- package/src/theme/v3/color/buildColor_v3.ts +53 -25
- package/src/theme/v3/color/card.ts +0 -42
- package/src/theme/v3/color/renderColor.test.ts +1 -0
- package/src/theme/v3/color/renderColor.ts +9 -2
- package/src/theme/v3/color/token.ts +1 -0
- package/src/theme/v3/defaultTokens.ts +7 -2
- package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
- package/dist/_chunks-cjs/buildCommand.js.map +0 -1
- package/dist/_chunks-cjs/refractor.js.map +0 -1
- package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
- package/dist/_chunks-es/refractor.mjs.map +0 -1
- package/dist/_visual-editing.mjs +0 -31
- package/dist/_visual-editing.mjs.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/css.mjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/sanity-palette.min.css +0 -1
- package/dist/sanity-theme.min.css +0 -1
- package/dist/system.min.css +0 -1
- package/dist/theme.mjs.map +0 -1
- package/src/css/primitives/button/_constants.ts +0 -17
- package/src/ui/RootClassNames.tsx +0 -44
- package/src/ui/_compat/studioTheme.ts +0 -7
- package/src/ui/primitives/button/__workshop__/custom.tsx +0 -50
- package/src/ui/primitives/card/cardProvider.tsx +0 -21
- /package/dist/{cli.d.ts → cli.d.cts} +0 -0
- /package/src/{ui → core}/_compat/helpers.ts +0 -0
- /package/src/{ui → core}/_compat/styles/_responsive.ts +0 -0
- /package/src/{ui → core}/_compat/styles/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/theme.test.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeColorProvider.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeContext.ts +0 -0
- /package/src/{ui → core}/_compat/theme/types.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useRootTheme.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useTheme.ts +0 -0
- /package/src/{ui → core}/_compat/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/apiStore.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/countries.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/fullscreen.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/autocomplete.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteOption.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteReducer.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/constants.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/types.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/breadcrumbs.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/activate.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/autoFocus.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/onScroll.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/panes.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/position.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/wrapped.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialog.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogCard.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogContext.ts +0 -0
- /package/src/{ui → core}/components/dialog/dialogProvider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/isTargetWithinScope.ts +0 -0
- /package/src/{ui → core}/components/dialog/useDialog.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/hotkeys.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/index.ts +0 -0
- /package/src/{ui → core}/components/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/avatarMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/closableMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/constrainedInBoundary.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customMenuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customSelectedState.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/disableFocusOnClose.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/groups.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuGroupRight.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/nestedMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/onCloseMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/selectedItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/shouldFocus.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/withoutArrow.tsx +0 -0
- /package/src/{ui → core}/components/menu/helpers.ts +0 -0
- /package/src/{ui → core}/components/menu/index.ts +0 -0
- /package/src/{ui → core}/components/menu/menu.test.tsx +0 -0
- /package/src/{ui → core}/components/menu/menu.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuContext.ts +0 -0
- /package/src/{ui → core}/components/menu/menuDivider.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuGroup.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/useMenu.ts +0 -0
- /package/src/{ui → core}/components/menu/useMenuController.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/codeSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/headingSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/labelSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/textSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tab/index.ts +0 -0
- /package/src/{ui → core}/components/tab/tab.tsx +0 -0
- /package/src/{ui → core}/components/tab/tabPanel.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/hook.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/index.ts +0 -0
- /package/src/{ui → core}/components/toast/toast.test.tsx +0 -0
- /package/src/{ui → core}/components/toast/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastContext.ts +0 -0
- /package/src/{ui → core}/components/toast/toastLayer.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastProvider.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastState.ts +0 -0
- /package/src/{ui → core}/components/toast/types.ts +0 -0
- /package/src/{ui → core}/components/toast/useToast.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.perf.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.tsx +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/tabFromElement.tsx +0 -0
- /package/src/{ui → core}/components/tree/helpers.ts +0 -0
- /package/src/{ui → core}/components/tree/index.ts +0 -0
- /package/src/{ui → core}/components/tree/tree.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeContext.ts +0 -0
- /package/src/{ui → core}/components/tree/treeGroup.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeItem.tsx +0 -0
- /package/src/{ui → core}/components/tree/types.ts +0 -0
- /package/src/{ui → core}/components/tree/useTree.ts +0 -0
- /package/src/{ui → core}/constants.ts +0 -0
- /package/src/{ui → core}/global.ts +0 -0
- /package/src/{ui → core}/helpers/animation.ts +0 -0
- /package/src/{ui → core}/helpers/element.ts +0 -0
- /package/src/{ui → core}/helpers/focus.ts +0 -0
- /package/src/{ui → core}/helpers/index.ts +0 -0
- /package/src/{ui → core}/helpers/props.ts +0 -0
- /package/src/{ui → core}/helpers/scroll.ts +0 -0
- /package/src/{ui → core}/hooks/index.ts +0 -0
- /package/src/{ui → core}/hooks/useArrayProp.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.ts +0 -0
- /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayed.test.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayedState.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
- /package/src/{ui → core}/hooks/useElementSize.ts +0 -0
- /package/src/{ui → core}/hooks/useForwardedRef.ts +0 -0
- /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
- /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
- /package/src/{ui → core}/hooks/useMatchMedia.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.ts +0 -0
- /package/src/{ui → core}/hooks/useMounted.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
- /package/src/{ui → core}/lib/createGlobalScopedContext.ts +0 -0
- /package/src/{ui → core}/lib/globalScope.ts +0 -0
- /package/src/{ui → core}/lib/isRecord.ts +0 -0
- /package/src/{ui → core}/middleware/origin.ts +0 -0
- /package/src/{ui → core}/observers/elementSizeObserver.ts +0 -0
- /package/src/{ui → core}/observers/index.ts +0 -0
- /package/src/{ui → core}/observers/resizeObserver.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/index.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/selectable.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/asButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatar.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarCounter.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarStack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/types.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.test.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/types.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/box/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/customIcons.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/disabled.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/sanityUploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/stacked.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/uploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/button.test.tsx +0 -0
- /package/src/{ui → core}/primitives/button/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/allTones.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/checkered.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/listNavigation.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
- /package/src/{ui → core}/primitives/card/cardContext.ts +0 -0
- /package/src/{ui → core}/primitives/card/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/useCard.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/checkbox.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/code/code.tsx +0 -0
- /package/src/{ui → core}/primitives/code/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/refractor.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/container.tsx +0 -0
- /package/src/{ui → core}/primitives/container/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/types.ts +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/flex/flex.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/grid.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/heading.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/index.ts +0 -0
- /package/src/{ui → core}/primitives/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/inline.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/types.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/kbd/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/kbd.tsx +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/label/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/label.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/AlignedStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/PlainStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/RecursiveStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/SidePanelStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/TestStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/constants.ts +0 -0
- /package/src/{ui → core}/primitives/popover/floating-ui/size.ts +0 -0
- /package/src/{ui → core}/primitives/popover/helpers.ts +0 -0
- /package/src/{ui → core}/primitives/popover/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/popoverLayer.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/types.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/radio.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/select/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/select.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/Props.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/animatedSpinnerIcon.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/spinner.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/switch.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/colored.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/text/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/text.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/textArea.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/customValidity.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/states.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/typed.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/textInput.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/customPortal.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/constants.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltip.test.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipLayer.tsx +0 -0
- /package/src/{ui → core}/primitives/types.ts +0 -0
- /package/src/{ui → core}/types/avatar.ts +0 -0
- /package/src/{ui → core}/types/badge.ts +0 -0
- /package/src/{ui → core}/types/box.ts +0 -0
- /package/src/{ui → core}/types/button.ts +0 -0
- /package/src/{ui → core}/types/card.ts +0 -0
- /package/src/{ui → core}/types/dialog.ts +0 -0
- /package/src/{ui → core}/types/flex.ts +0 -0
- /package/src/{ui → core}/types/grid.ts +0 -0
- /package/src/{ui → core}/types/gridItem.ts +0 -0
- /package/src/{ui → core}/types/index.ts +0 -0
- /package/src/{ui → core}/types/placement.ts +0 -0
- /package/src/{ui → core}/types/popover.ts +0 -0
- /package/src/{ui → core}/types/props.ts +0 -0
- /package/src/{ui → core}/types/radius.ts +0 -0
- /package/src/{ui → core}/types/selectable.ts +0 -0
- /package/src/{ui → core}/types/text.ts +0 -0
- /package/src/{ui → core}/utils/arrow/arrow.tsx +0 -0
- /package/src/{ui → core}/utils/arrow/cmds.ts +0 -0
- /package/src/{ui → core}/utils/arrow/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElement.test.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementContext.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementProvider.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/types.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/useBoundaryElement.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/customMedia.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/elementQuery.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/index.ts +0 -0
- /package/src/{ui → core}/utils/errorBoundary.tsx +0 -0
- /package/src/{ui → core}/utils/getElementRef.ts +0 -0
- /package/src/{ui → core}/utils/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/_debug.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.test.ts +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/layer.test.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layer.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerCard.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/layerProvider.tsx +0 -0
- /package/src/{ui → core}/utils/layer/types.ts +0 -0
- /package/src/{ui → core}/utils/layer/useLayer.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/named.tsx +0 -0
- /package/src/{ui → core}/utils/portal/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/portal.test.tsx +0 -0
- /package/src/{ui → core}/utils/portal/portalContext.ts +0 -0
- /package/src/{ui → core}/utils/portal/portalProvider.tsx +0 -0
- /package/src/{ui → core}/utils/portal/types.ts +0 -0
- /package/src/{ui → core}/utils/portal/usePortal.ts +0 -0
- /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
- /package/src/{ui → core}/utils/srOnly/index.ts +0 -0
- /package/src/{ui → core}/utils/srOnly/srOnly.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/virtualList.tsx +0 -0
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
PointerEventsStyleProps,
|
|
17
17
|
PositionStyleProps,
|
|
18
18
|
RadiusStyleProps,
|
|
19
|
+
TextAlignStyleProps,
|
|
19
20
|
WidthStyleProps,
|
|
20
21
|
} from '../../aspects'
|
|
21
22
|
import {ResponsiveProp} from '../../types'
|
|
@@ -42,6 +43,7 @@ export interface BoxStyleProps
|
|
|
42
43
|
PointerEventsStyleProps,
|
|
43
44
|
PositionStyleProps,
|
|
44
45
|
RadiusStyleProps,
|
|
46
|
+
TextAlignStyleProps,
|
|
45
47
|
WidthStyleProps {
|
|
46
48
|
muted?: boolean
|
|
47
49
|
outline?: 'none'
|
|
@@ -3,7 +3,6 @@ import {THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
|
|
|
3
3
|
import {Style, StyleRules} from '../../types'
|
|
4
4
|
import {varNames} from '../../varNames'
|
|
5
5
|
import {vars} from '../../vars'
|
|
6
|
-
import {toneMap, variantMap} from './_constants'
|
|
7
6
|
|
|
8
7
|
const primitive: StyleRules = {
|
|
9
8
|
'.button': {
|
|
@@ -62,9 +61,11 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
62
61
|
const tinted = vars.color.tinted[tone]
|
|
63
62
|
|
|
64
63
|
// mode: default
|
|
65
|
-
primitive[`.button
|
|
64
|
+
primitive[`.button[data-mode="default"][data-tone="${tone}"]`] = {
|
|
66
65
|
[varNames.color.bg]: solid.bg[0],
|
|
67
66
|
[varNames.color.border]: solid.border[1],
|
|
67
|
+
[varNames.color.code.bg]: solid.bg[1],
|
|
68
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
68
69
|
[varNames.color.fg]: solid.fg[0],
|
|
69
70
|
[varNames.color.muted.bg]: solid.bg[1],
|
|
70
71
|
[varNames.color.muted.fg]: solid.fg[4],
|
|
@@ -74,6 +75,8 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
74
75
|
'&:not([data-disabled]):hover': {
|
|
75
76
|
[varNames.color.bg]: solid.bg[1],
|
|
76
77
|
[varNames.color.border]: solid.border[2],
|
|
78
|
+
[varNames.color.code.bg]: solid.bg[2],
|
|
79
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
77
80
|
[varNames.color.fg]: solid.fg[0],
|
|
78
81
|
[varNames.color.muted.bg]: solid.bg[2],
|
|
79
82
|
[varNames.color.muted.fg]: solid.fg[4],
|
|
@@ -82,6 +85,8 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
82
85
|
'&:not([data-disabled]):active': {
|
|
83
86
|
[varNames.color.bg]: solid.bg[2],
|
|
84
87
|
[varNames.color.border]: solid.border[3],
|
|
88
|
+
[varNames.color.code.bg]: solid.bg[3],
|
|
89
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
85
90
|
[varNames.color.fg]: solid.fg[0],
|
|
86
91
|
[varNames.color.muted.bg]: solid.bg[3],
|
|
87
92
|
[varNames.color.muted.fg]: solid.fg[4],
|
|
@@ -90,6 +95,8 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
90
95
|
'&:not([data-disabled])[data-selected]': {
|
|
91
96
|
[varNames.color.bg]: solid.bg[2],
|
|
92
97
|
[varNames.color.border]: solid.border[3],
|
|
98
|
+
[varNames.color.code.bg]: solid.bg[3],
|
|
99
|
+
[varNames.color.code.fg]: solid.fg[4],
|
|
93
100
|
[varNames.color.fg]: solid.fg[0],
|
|
94
101
|
[varNames.color.muted.bg]: solid.bg[3],
|
|
95
102
|
[varNames.color.muted.fg]: solid.fg[4],
|
|
@@ -117,10 +124,12 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
// mode: ghost
|
|
120
|
-
primitive[`.button
|
|
127
|
+
primitive[`.button[data-mode="ghost"][data-tone="${tone}"]`] = {
|
|
121
128
|
[varNames.color.bg]: tinted.bg[1],
|
|
122
|
-
[varNames.color.border]: tinted.border[
|
|
129
|
+
[varNames.color.border]: tinted.border[1],
|
|
123
130
|
[varNames.color.fg]: tinted.fg[2],
|
|
131
|
+
[varNames.color.code.bg]: tinted.bg[2],
|
|
132
|
+
[varNames.color.code.fg]: tinted.fg[4],
|
|
124
133
|
[varNames.color.muted.bg]: tinted.bg[2],
|
|
125
134
|
[varNames.color.muted.fg]: tinted.fg[4],
|
|
126
135
|
'--button-box-shadow': `inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
@@ -128,16 +137,19 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
128
137
|
'@nest': {
|
|
129
138
|
'&:not([data-disabled]):hover': {
|
|
130
139
|
[varNames.color.bg]: tinted.bg[2],
|
|
131
|
-
[varNames.color.border]: tinted.border[
|
|
140
|
+
[varNames.color.border]: tinted.border[2],
|
|
141
|
+
[varNames.color.code.bg]: tinted.bg[3],
|
|
142
|
+
[varNames.color.code.fg]: tinted.fg[3],
|
|
132
143
|
[varNames.color.fg]: tinted.fg[1],
|
|
133
144
|
[varNames.color.muted.bg]: tinted.bg[3],
|
|
134
145
|
[varNames.color.muted.fg]: tinted.fg[3],
|
|
135
|
-
// '--button-box-shadow': `inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
136
146
|
},
|
|
137
147
|
|
|
138
148
|
'&:not([data-disabled]):active': {
|
|
139
149
|
[varNames.color.bg]: tinted.bg[3],
|
|
140
|
-
[varNames.color.border]: tinted.border[
|
|
150
|
+
[varNames.color.border]: tinted.border[3],
|
|
151
|
+
[varNames.color.code.bg]: tinted.bg[4],
|
|
152
|
+
[varNames.color.code.fg]: tinted.fg[3],
|
|
141
153
|
[varNames.color.fg]: tinted.fg[1],
|
|
142
154
|
[varNames.color.muted.bg]: tinted.bg[4],
|
|
143
155
|
[varNames.color.muted.fg]: tinted.fg[3],
|
|
@@ -146,7 +158,9 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
146
158
|
|
|
147
159
|
'&:not([data-disabled])[data-selected]': {
|
|
148
160
|
[varNames.color.bg]: tinted.bg[3],
|
|
149
|
-
[varNames.color.border]: tinted.border[
|
|
161
|
+
[varNames.color.border]: tinted.border[3],
|
|
162
|
+
[varNames.color.code.bg]: tinted.bg[4],
|
|
163
|
+
[varNames.color.code.fg]: tinted.fg[3],
|
|
150
164
|
[varNames.color.fg]: tinted.fg[1],
|
|
151
165
|
[varNames.color.muted.bg]: tinted.bg[4],
|
|
152
166
|
[varNames.color.muted.fg]: tinted.fg[3],
|
|
@@ -175,7 +189,7 @@ for (const tone of THEME_COLOR_STATE_TONES) {
|
|
|
175
189
|
}
|
|
176
190
|
|
|
177
191
|
// mode: bleed
|
|
178
|
-
primitive[`.button
|
|
192
|
+
primitive[`.button[data-mode="bleed"][data-tone="${tone}"]`] = {
|
|
179
193
|
'boxShadow': 'none',
|
|
180
194
|
[varNames.color.bg]: tinted.bg[0],
|
|
181
195
|
[varNames.color.border]: tinted.border[1],
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {display, flexItem, radius, width} from '../../aspects'
|
|
3
|
-
import {toneMap, variantMap} from './_constants'
|
|
4
3
|
import {ButtonStyleProps} from './types'
|
|
5
4
|
|
|
6
5
|
/** @public */
|
|
7
6
|
export function button(props: ButtonStyleProps): string | undefined {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return _comp(
|
|
11
|
-
'button',
|
|
12
|
-
variantMap[mode ?? 'default'],
|
|
13
|
-
toneMap[tone ?? 'default'],
|
|
14
|
-
display(props),
|
|
15
|
-
flexItem(props),
|
|
16
|
-
radius(props),
|
|
17
|
-
width(props),
|
|
18
|
-
)
|
|
7
|
+
return _comp('button', display(props), flexItem(props), radius(props), width(props))
|
|
19
8
|
}
|
|
20
9
|
|
|
21
10
|
/** @public */
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {ThemeColorButtonModeKey, ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
DisplayStyleProps,
|
|
5
3
|
FlexItemStyleProps,
|
|
@@ -12,7 +10,4 @@ export interface ButtonStyleProps
|
|
|
12
10
|
extends DisplayStyleProps,
|
|
13
11
|
FlexItemStyleProps,
|
|
14
12
|
RadiusStyleProps,
|
|
15
|
-
WidthStyleProps {
|
|
16
|
-
mode?: ThemeColorButtonModeKey
|
|
17
|
-
tone?: ThemeColorStateToneKey
|
|
18
|
-
}
|
|
13
|
+
WidthStyleProps {}
|
|
@@ -45,6 +45,13 @@ const primitive: StyleRules = {
|
|
|
45
45
|
whiteSpace: 'inherit',
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
+
'&[data-checkered]': {
|
|
49
|
+
backgroundSize: `${vars.space[3]} ${vars.space[3]}` as string,
|
|
50
|
+
backgroundPosition: 'top left',
|
|
51
|
+
backgroundImage:
|
|
52
|
+
`repeating-conic-gradient(${vars.color.bg} 0% 25%, ${vars.color.muted.bg} 0% 50%)` as string,
|
|
53
|
+
},
|
|
54
|
+
|
|
48
55
|
'a&:not([data-disabled]):hover, button&:not([data-disabled]):hover': {
|
|
49
56
|
[varNames.color.bg]: vars.color.tinted.default.bg[1],
|
|
50
57
|
[varNames.color.border]: vars.color.tinted.default.border[3],
|
|
@@ -87,29 +94,13 @@ const primitive: StyleRules = {
|
|
|
87
94
|
[varNames.color.muted.fg]: vars.color.solid.primary.fg[3],
|
|
88
95
|
},
|
|
89
96
|
|
|
90
|
-
// '&:not([data-disabled]):focus': {
|
|
91
|
-
// '--color-bg': vars.color.solid.bg[0],
|
|
92
|
-
// '--color-border': vars.color.solid.border[1],
|
|
93
|
-
// '--color-fg': vars.color.solid.fg[1],
|
|
94
|
-
// '--color-muted-bg': vars.color.solid.bg[1],
|
|
95
|
-
// '--color-muted-fg': vars.color.solid.fg[3],
|
|
96
|
-
// },
|
|
97
|
-
|
|
98
97
|
'a&[data-disabled], button&[data-disabled]': {
|
|
99
|
-
[varNames.color.bg]: vars.color.tinted.default.bg[
|
|
100
|
-
[varNames.color.border]: vars.color.tinted.default.border[
|
|
101
|
-
[varNames.color.fg]: vars.color.tinted.default.
|
|
102
|
-
[varNames.color.muted.bg]: vars.color.tinted.default.bg[
|
|
103
|
-
[varNames.color.muted.fg]: vars.color.tinted.default.
|
|
98
|
+
[varNames.color.bg]: vars.color.tinted.default.bg[0],
|
|
99
|
+
[varNames.color.border]: vars.color.tinted.default.border[1],
|
|
100
|
+
[varNames.color.fg]: vars.color.tinted.default.border[3],
|
|
101
|
+
[varNames.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
102
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[1],
|
|
104
103
|
},
|
|
105
|
-
|
|
106
|
-
// '&[data-disabled]': {
|
|
107
|
-
// '--color-bg': vars.color.tinted.bg[0],
|
|
108
|
-
// '--color-border': vars.color.tinted.border[1],
|
|
109
|
-
// '--color-fg': vars.color.tinted.border[4],
|
|
110
|
-
// '--color-muted-bg': vars.color.tinted.bg[1],
|
|
111
|
-
// '--color-muted-fg': vars.color.tinted.border[4],
|
|
112
|
-
// },
|
|
113
104
|
},
|
|
114
105
|
},
|
|
115
106
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
-
import {flexItem, font} from '../../aspects'
|
|
3
|
+
import {flexItem, font, textAlign} from '../../aspects'
|
|
4
4
|
import {HeadingStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
@@ -13,5 +13,6 @@ export function heading(props: HeadingStyleProps): string | undefined {
|
|
|
13
13
|
props.muted && 'heading-muted',
|
|
14
14
|
_resp(`heading`, props.size),
|
|
15
15
|
flexItem(props),
|
|
16
|
+
textAlign({textAlign: props.align}),
|
|
16
17
|
)
|
|
17
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FlexItemStyleProps, FontStyleProps} from '../../aspects'
|
|
1
|
+
import {FlexItemStyleProps, FontStyleProps, TextAlignStyleProps} from '../../aspects'
|
|
2
2
|
import {ResponsiveProp} from '../../types'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
@@ -7,6 +7,7 @@ export type HeadingSize = number
|
|
|
7
7
|
/** @public */
|
|
8
8
|
export interface HeadingStyleProps extends FontStyleProps, FlexItemStyleProps {
|
|
9
9
|
accent?: boolean
|
|
10
|
+
align?: TextAlignStyleProps['textAlign']
|
|
10
11
|
muted?: boolean
|
|
11
12
|
size?: ResponsiveProp<HeadingSize>
|
|
12
13
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import {Style, StyleRules} from '../../types'
|
|
2
|
+
import {vars} from '../../vars'
|
|
2
3
|
|
|
3
4
|
const primitive: StyleRules = {
|
|
4
5
|
'.kbd': {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// '--color-fg': 'var(--color-tinted-default-fg-3)',
|
|
8
|
-
|
|
9
|
-
'boxShadow': 'inset 0 0 0 0.5px var(--color-tinted-default-border-3)',
|
|
10
|
-
'background': 'var(--color-muted-bg)',
|
|
6
|
+
'boxShadow': `inset 0 0 0 0.5px ${vars.color.border}`,
|
|
7
|
+
'backgroundColor': vars.color.muted.bg,
|
|
11
8
|
'font': 'inherit',
|
|
12
9
|
'verticalAlign': 'top',
|
|
13
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
-
import {font} from '../../aspects'
|
|
3
|
+
import {font, textAlign} from '../../aspects'
|
|
4
4
|
import {LabelStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
@@ -12,5 +12,6 @@ export function label(props: LabelStyleProps): string | undefined {
|
|
|
12
12
|
props.accent && 'label-accent',
|
|
13
13
|
props.muted && 'label-muted',
|
|
14
14
|
_resp(`label`, props.size),
|
|
15
|
+
textAlign({textAlign: props.align}),
|
|
15
16
|
)
|
|
16
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {FontLabelSize} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import {FontStyleProps} from '../../aspects'
|
|
3
|
+
import {FontStyleProps, TextAlignStyleProps} from '../../aspects'
|
|
4
4
|
import {ResponsiveProp} from '../../types'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -12,6 +12,7 @@ export type LabelSize = number
|
|
|
12
12
|
/** @public */
|
|
13
13
|
export interface LabelStyleProps extends FontStyleProps {
|
|
14
14
|
accent?: boolean
|
|
15
|
+
align?: TextAlignStyleProps['textAlign']
|
|
15
16
|
muted?: boolean
|
|
16
17
|
size?: ResponsiveProp<FontLabelSize>
|
|
17
18
|
}
|
|
@@ -39,13 +39,8 @@ const primitive: StyleRules = {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
|
|
42
|
-
// 'text-accent': {
|
|
43
|
-
// '--color-fg': 'var(--color-accent-fg)',
|
|
44
|
-
// },
|
|
45
|
-
|
|
46
42
|
'.text-muted': {
|
|
47
43
|
color: 'var(--color-muted-fg)',
|
|
48
|
-
// '--color-fg': 'var(--color-tinted-default-fg-4)',
|
|
49
44
|
},
|
|
50
45
|
}
|
|
51
46
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
-
import {flexItem, font} from '../../aspects'
|
|
3
|
+
import {flexItem, font, textAlign} from '../../aspects'
|
|
4
4
|
import {TextStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
@@ -13,5 +13,6 @@ export function text(props: TextStyleProps): string | undefined {
|
|
|
13
13
|
props.accent && 'text-accent',
|
|
14
14
|
props.muted && 'text-muted',
|
|
15
15
|
_resp(`text`, props.size),
|
|
16
|
+
textAlign({textAlign: props.align}),
|
|
16
17
|
)
|
|
17
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FlexItemStyleProps, FontStyleProps} from '../../aspects'
|
|
1
|
+
import {FlexItemStyleProps, FontStyleProps, TextAlignStyleProps} from '../../aspects'
|
|
2
2
|
import {ResponsiveProp} from '../../types'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
@@ -10,6 +10,7 @@ export interface TextStyleProps extends FlexItemStyleProps, FontStyleProps {
|
|
|
10
10
|
* @deprecated Will be removed in next major version
|
|
11
11
|
*/
|
|
12
12
|
accent?: boolean
|
|
13
|
+
align?: TextAlignStyleProps['textAlign']
|
|
13
14
|
muted?: boolean
|
|
14
15
|
size?: ResponsiveProp<TextSize>
|
|
15
16
|
}
|
|
@@ -42,126 +42,7 @@ const primitive: StyleRules = {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
|
|
45
|
-
'.text-input-presentation': {
|
|
46
|
-
// position: 'absolute',
|
|
47
|
-
// top: 0,
|
|
48
|
-
// left: 0,
|
|
49
|
-
// right: 0,
|
|
50
|
-
// bottom: 0,
|
|
51
|
-
// display: 'block',
|
|
52
|
-
// pointerEvents: 'none',
|
|
53
|
-
// zIndex: 0,
|
|
54
|
-
// backgroundColor: 'var(--input-bg-color)',
|
|
55
|
-
// 'boxShadow': 'var(--input-box-shadow)',
|
|
56
|
-
// '--input-border-color': 'var(--color-input-default-enabled-border)',
|
|
57
|
-
// '--input-border-color': 'var(--color-tinted-default-border-1)',
|
|
58
|
-
// '--input-box-shadow': 'inset 0 0 0 1px var(--input-border-color)',
|
|
59
|
-
// border-top-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
60
|
-
// border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
61
|
-
// border-top-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
62
|
-
// border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
63
|
-
// '@nest': {
|
|
64
|
-
// 'input:hover + &': {
|
|
65
|
-
// '--input-border-color': 'var(--color-tinted-default-border-2)',
|
|
66
|
-
// },
|
|
67
|
-
// 'input:focus + &': {
|
|
68
|
-
// '--input-border-color': 'var(--color-tinted-default-border-2)',
|
|
69
|
-
// },
|
|
70
|
-
// },
|
|
71
|
-
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
72
|
-
// --card-bg-color: ${color.input.default.enabled.bg};
|
|
73
|
-
// --card-fg-color: ${color.input.default.enabled.fg};
|
|
74
|
-
// /* enabled */
|
|
75
|
-
// *:not(:disabled) + &[data-border] {
|
|
76
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
77
|
-
// color: color.input.default.enabled.border,
|
|
78
|
-
// width: input.border.width,
|
|
79
|
-
// })};
|
|
80
|
-
// }
|
|
81
|
-
// /* invalid */
|
|
82
|
-
// *:not(:disabled):invalid + & {
|
|
83
|
-
// --card-bg-color: ${color.input.invalid.enabled.bg};
|
|
84
|
-
// --card-fg-color: ${color.input.invalid.enabled.fg};
|
|
85
|
-
// &[data-border] {
|
|
86
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
87
|
-
// color: color.input.invalid.enabled.border,
|
|
88
|
-
// width: input.border.width,
|
|
89
|
-
// })};
|
|
90
|
-
// }
|
|
91
|
-
// }
|
|
92
|
-
// /* focused */
|
|
93
|
-
// *:not(:disabled):focus + & {
|
|
94
|
-
// &[data-border] {
|
|
95
|
-
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
96
|
-
// ? undefined
|
|
97
|
-
// : focusRingStyle({
|
|
98
|
-
// border: {color: color.input.default.enabled.border, width: input.border.width},
|
|
99
|
-
// focusRing: input.text.focusRing,
|
|
100
|
-
// })};
|
|
101
|
-
// }
|
|
102
|
-
// &:not([data-border]) {
|
|
103
|
-
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
104
|
-
// ? undefined
|
|
105
|
-
// : focusRingStyle({focusRing: input.text.focusRing})};
|
|
106
|
-
// }
|
|
107
|
-
// }
|
|
108
|
-
// /* disabled */
|
|
109
|
-
// *:not(:invalid):disabled + & {
|
|
110
|
-
// --card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
111
|
-
// --card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
112
|
-
// --card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
113
|
-
// &[data-border] {
|
|
114
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
115
|
-
// color: color.input.default.disabled.border,
|
|
116
|
-
// width: input.border.width,
|
|
117
|
-
// })};
|
|
118
|
-
// }
|
|
119
|
-
// }
|
|
120
|
-
// *:invalid:disabled + & {
|
|
121
|
-
// --card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
122
|
-
// --card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
123
|
-
// --card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
124
|
-
// &[data-border] {
|
|
125
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
126
|
-
// color: color.input.invalid.disabled.border,
|
|
127
|
-
// width: input.border.width,
|
|
128
|
-
// })};
|
|
129
|
-
// }
|
|
130
|
-
// }
|
|
131
|
-
// /* readOnly */
|
|
132
|
-
// *:not(:invalid):read-only + & {
|
|
133
|
-
// --card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
134
|
-
// --card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
135
|
-
// }
|
|
136
|
-
// *:invalid:read-only + & {
|
|
137
|
-
// --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
138
|
-
// --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
139
|
-
// }
|
|
140
|
-
// /* hovered */
|
|
141
|
-
// @media (hover: hover) {
|
|
142
|
-
// *:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
143
|
-
// --card-bg-color: ${color.input.default.hovered.bg};
|
|
144
|
-
// --card-fg-color: ${color.input.default.hovered.fg};
|
|
145
|
-
// }
|
|
146
|
-
// *:invalid:not(:disabled):not(:read-only):hover + & {
|
|
147
|
-
// --card-bg-color: ${color.input.invalid.hovered.bg};
|
|
148
|
-
// --card-fg-color: ${color.input.invalid.hovered.fg};
|
|
149
|
-
// }
|
|
150
|
-
// *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
151
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
152
|
-
// color: color.input.default.hovered.border,
|
|
153
|
-
// width: input.border.width,
|
|
154
|
-
// })};
|
|
155
|
-
// }
|
|
156
|
-
// *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
157
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
158
|
-
// color: color.input.invalid.hovered.border,
|
|
159
|
-
// width: input.border.width,
|
|
160
|
-
// })};
|
|
161
|
-
// }
|
|
162
|
-
// }
|
|
163
|
-
// }
|
|
164
|
-
},
|
|
45
|
+
'.text-input-presentation': {},
|
|
165
46
|
}
|
|
166
47
|
|
|
167
48
|
export const textInputStyle: Style = {layers: {primitive}}
|
package/src/css/types.ts
CHANGED
|
@@ -611,6 +611,15 @@ export interface FontVarNames<Size extends number> {
|
|
|
611
611
|
|
|
612
612
|
/** @public */
|
|
613
613
|
export interface VarNames {
|
|
614
|
+
avatar: {
|
|
615
|
+
distance: VarName
|
|
616
|
+
focusRing: {
|
|
617
|
+
offset: VarName
|
|
618
|
+
width: VarName
|
|
619
|
+
}
|
|
620
|
+
size: VarName
|
|
621
|
+
sizes: Record<AvatarSize, {distance: VarName; size: VarName}>
|
|
622
|
+
}
|
|
614
623
|
button: {
|
|
615
624
|
border: {
|
|
616
625
|
width: VarName
|
|
@@ -629,15 +638,6 @@ export interface VarNames {
|
|
|
629
638
|
ScopedColorVarNames &
|
|
630
639
|
Record<CardTone, ColorCardVarNames>
|
|
631
640
|
container: Record<Exclude<ContainerWidth, 'auto'>, VarName>
|
|
632
|
-
avatar: {
|
|
633
|
-
distance: VarName
|
|
634
|
-
focusRing: {
|
|
635
|
-
offset: VarName
|
|
636
|
-
width: VarName
|
|
637
|
-
}
|
|
638
|
-
size: VarName
|
|
639
|
-
sizes: Record<AvatarSize, {distance: VarName; size: VarName}>
|
|
640
|
-
}
|
|
641
641
|
font: {
|
|
642
642
|
code: FontVarNames<FontCodeSize>
|
|
643
643
|
heading: FontVarNames<FontHeadingSize>
|
|
@@ -57,7 +57,22 @@ function buildColorCard_v3(
|
|
|
57
57
|
},
|
|
58
58
|
): ThemeColorCard_v3 {
|
|
59
59
|
const {cardTone, scheme} = options
|
|
60
|
-
const context: RenderColorContext = {
|
|
60
|
+
const context: RenderColorContext = {
|
|
61
|
+
bgVar: `--color-bg`,
|
|
62
|
+
bgValue: 'transparent',
|
|
63
|
+
hue: tokens._hue,
|
|
64
|
+
scheme,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const tintedDefaultVariant = buildColorElement_v3(tokens.variant.tinted.default, {
|
|
68
|
+
bgValue: 'transparent',
|
|
69
|
+
cardTone,
|
|
70
|
+
debugId: 'tinted',
|
|
71
|
+
scheme,
|
|
72
|
+
tone: 'default',
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const bgValue = tintedDefaultVariant.bg[0]
|
|
61
76
|
|
|
62
77
|
return {
|
|
63
78
|
_hue: tokens._hue ?? 'gray',
|
|
@@ -65,8 +80,18 @@ function buildColorCard_v3(
|
|
|
65
80
|
const avatarTokens = tokens.avatar[hue]
|
|
66
81
|
|
|
67
82
|
acc[hue] = {
|
|
68
|
-
bg: renderColor(avatarTokens.bg, {
|
|
69
|
-
|
|
83
|
+
bg: renderColor(avatarTokens.bg, {
|
|
84
|
+
bgValue,
|
|
85
|
+
bgVar: `--color-bg-1`,
|
|
86
|
+
hue: avatarTokens._hue,
|
|
87
|
+
scheme,
|
|
88
|
+
}),
|
|
89
|
+
fg: renderColor(avatarTokens.fg, {
|
|
90
|
+
bgValue,
|
|
91
|
+
bgVar: `--color-bg-1`,
|
|
92
|
+
hue: avatarTokens._hue,
|
|
93
|
+
scheme,
|
|
94
|
+
}),
|
|
70
95
|
}
|
|
71
96
|
|
|
72
97
|
return acc
|
|
@@ -128,32 +153,34 @@ function buildColorCard_v3(
|
|
|
128
153
|
|
|
129
154
|
variant: {
|
|
130
155
|
solid: {
|
|
131
|
-
...THEME_COLOR_STATE_TONES.reduce(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
),
|
|
156
|
+
...THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
|
|
157
|
+
acc[tone] = buildColorElement_v3(tokens.variant.solid[tone], {
|
|
158
|
+
bgValue,
|
|
159
|
+
cardTone,
|
|
160
|
+
debugId: `solid`,
|
|
161
|
+
scheme,
|
|
162
|
+
tone,
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
return acc
|
|
166
|
+
}, {} as ThemeColorVariant),
|
|
143
167
|
},
|
|
144
168
|
tinted: {
|
|
145
|
-
...THEME_COLOR_STATE_TONES.reduce(
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
|
|
169
|
+
...THEME_COLOR_STATE_TONES.reduce((acc, tone) => {
|
|
170
|
+
if (tone === 'default') {
|
|
171
|
+
acc[tone] = tintedDefaultVariant
|
|
172
|
+
} else {
|
|
173
|
+
acc[tone] = buildColorElement_v3(tokens.variant.tinted[tone], {
|
|
174
|
+
bgValue,
|
|
149
175
|
cardTone,
|
|
150
176
|
debugId: `tinted`,
|
|
151
177
|
scheme,
|
|
152
178
|
tone,
|
|
153
|
-
})
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return acc
|
|
183
|
+
}, {} as ThemeColorVariant),
|
|
157
184
|
},
|
|
158
185
|
},
|
|
159
186
|
}
|
|
@@ -162,13 +189,14 @@ function buildColorCard_v3(
|
|
|
162
189
|
function buildColorElement_v3(
|
|
163
190
|
tokens: ElementColorTokens,
|
|
164
191
|
options: {
|
|
192
|
+
bgValue: string
|
|
165
193
|
cardTone: ThemeColorCardToneKey
|
|
166
194
|
debugId?: string
|
|
167
195
|
scheme: ThemeColorSchemeKey
|
|
168
196
|
tone?: ThemeColorStateToneKey
|
|
169
197
|
},
|
|
170
198
|
): ThemeColorElement {
|
|
171
|
-
const {cardTone, debugId, scheme, tone} = options
|
|
199
|
+
const {bgValue, cardTone, debugId, scheme, tone} = options
|
|
172
200
|
|
|
173
201
|
const path = [scheme, cardTone, debugId, tone].filter(Boolean).join('/')
|
|
174
202
|
|
|
@@ -178,7 +206,7 @@ function buildColorElement_v3(
|
|
|
178
206
|
nodeLen += 1
|
|
179
207
|
}
|
|
180
208
|
|
|
181
|
-
const context: RenderColorContext = {bgVar: `--bg`, hue: tokens._hue, scheme}
|
|
209
|
+
const context: RenderColorContext = {bgValue, bgVar: `--color-bg`, hue: tokens._hue, scheme}
|
|
182
210
|
|
|
183
211
|
return {
|
|
184
212
|
_hue: tokens._hue ?? 'gray',
|
|
@@ -77,45 +77,3 @@ export interface CardColorTokens {
|
|
|
77
77
|
tinted: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
// /**
|
|
82
|
-
// * @public
|
|
83
|
-
// */
|
|
84
|
-
// export interface ThemeColorSyntax {
|
|
85
|
-
// atrule: string
|
|
86
|
-
// attrName: string
|
|
87
|
-
// attrValue: string
|
|
88
|
-
// attribute: string
|
|
89
|
-
// boolean: string
|
|
90
|
-
// builtin: string
|
|
91
|
-
// cdata: string
|
|
92
|
-
// char: string
|
|
93
|
-
// class: string
|
|
94
|
-
// className: string
|
|
95
|
-
// comment: string
|
|
96
|
-
// constant: string
|
|
97
|
-
// deleted: string
|
|
98
|
-
// doctype: string
|
|
99
|
-
// entity: string
|
|
100
|
-
// function: string
|
|
101
|
-
// hexcode: string
|
|
102
|
-
// id: string
|
|
103
|
-
// important: string
|
|
104
|
-
// inserted: string
|
|
105
|
-
// keyword: string
|
|
106
|
-
// number: string
|
|
107
|
-
// operator: string
|
|
108
|
-
// prolog: string
|
|
109
|
-
// property: string
|
|
110
|
-
// pseudoClass: string
|
|
111
|
-
// pseudoElement: string
|
|
112
|
-
// punctuation: string
|
|
113
|
-
// regex: string
|
|
114
|
-
// selector: string
|
|
115
|
-
// string: string
|
|
116
|
-
// symbol: string
|
|
117
|
-
// tag: string
|
|
118
|
-
// unit: string
|
|
119
|
-
// url: string
|
|
120
|
-
// variable: string
|
|
121
|
-
// }
|