@sanity/ui 3.0.0-static.18 → 3.0.0-static.19
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/dist/_chunks-cjs/_visual-editing.cjs +137 -136
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/buildCommand.cjs +21 -22
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +138 -137
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_visual-editing.d.cts +12 -22
- package/dist/_visual-editing.d.ts +12 -22
- package/dist/cli.cjs +1 -1
- package/dist/css.cjs +1589 -2017
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +9423 -874
- package/dist/css.d.ts +9423 -874
- package/dist/css.js +1591 -2019
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +28 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -21
- package/dist/index.d.ts +23 -21
- package/dist/index.js +30 -42
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +2749 -2756
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +242 -161
- package/dist/theme.d.ts +242 -161
- package/dist/theme.js +2750 -2757
- package/dist/theme.js.map +1 -1
- package/dist/ui-system.css +15719 -16097
- package/dist/ui-system.min.css +1 -1
- package/dist/ui-theme.css +850 -4568
- package/dist/ui-theme.min.css +1 -1
- package/dist/ui.css +16569 -20772
- package/dist/ui.min.css +1 -1
- package/package.json +10 -15
- package/src/cli/buildCommand.ts +13 -30
- package/src/core/StyleTags.tsx +4 -12
- package/src/core/_compat/styles/_responsive.ts +1 -1
- package/src/core/_compat/theme/theme.test.tsx +4 -5
- package/src/core/_compat/theme/themeColorProvider.tsx +2 -2
- package/src/core/_compat/theme/themeContext.ts +2 -2
- package/src/core/_compat/theme/themeProvider.tsx +2 -2
- package/src/core/_compat/theme/types.ts +1 -1
- package/src/core/_compat/theme/useRootTheme.ts +1 -1
- package/src/core/_compat/theme/useTheme.ts +1 -1
- package/src/core/components/autocomplete/__workshop__/async.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/custom.tsx +11 -11
- package/src/core/components/autocomplete/__workshop__/example.tsx +6 -7
- package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +5 -5
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
- package/src/core/components/autocomplete/constants.ts +1 -1
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +7 -7
- package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
- 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__/wrapped.tsx +2 -2
- package/src/core/components/dialog/dialog.tsx +15 -8
- package/src/core/components/dialog/dialogCard.tsx +18 -3
- package/src/core/components/dialog/dialogContext.ts +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +3 -3
- package/src/core/components/dialog/useDialog.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +4 -4
- package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
- package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
- package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
- package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
- package/src/core/components/menu/__workshop__/groups.tsx +2 -2
- package/src/core/components/menu/__workshop__/menuButton.tsx +1 -1
- 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 +13 -4
- package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
- package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
- package/src/core/components/menu/menu.test.tsx +6 -7
- package/src/core/components/menu/menu.tsx +2 -2
- package/src/core/components/menu/menuButton.tsx +9 -9
- package/src/core/components/menu/menuContext.ts +1 -1
- package/src/core/components/menu/menuDivider.tsx +3 -3
- package/src/core/components/menu/menuGroup.tsx +9 -9
- package/src/core/components/menu/menuItem.tsx +9 -6
- package/src/core/components/menu/useMenu.ts +1 -1
- package/src/core/components/menu/useMenuController.ts +4 -4
- package/src/core/components/skeleton/__workshop__/delay.tsx +1 -1
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +2 -2
- package/src/core/components/skeleton/codeSkeleton.tsx +5 -5
- package/src/core/components/skeleton/headingSkeleton.tsx +5 -5
- package/src/core/components/skeleton/labelSkeleton.tsx +5 -5
- package/src/core/components/skeleton/skeleton.tsx +4 -4
- package/src/core/components/skeleton/textSkeleton.tsx +5 -5
- package/src/core/components/tab/__workshop__/example.tsx +1 -1
- package/src/core/components/tab/tab.tsx +7 -7
- package/src/core/components/tab/tabList.tsx +14 -7
- package/src/core/components/tab/tabPanel.tsx +10 -7
- package/src/core/components/toast/__workshop__/hook.tsx +1 -1
- package/src/core/components/toast/toast.test.tsx +5 -5
- package/src/core/components/toast/toast.tsx +6 -7
- package/src/core/components/toast/toastContext.ts +1 -1
- package/src/core/components/toast/toastLayer.tsx +2 -2
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/toast/types.ts +1 -1
- package/src/core/components/toast/useToast.ts +1 -1
- 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__/tabFromElement.tsx +1 -1
- package/src/core/components/tree/helpers.ts +1 -1
- package/src/core/components/tree/tree.tsx +6 -6
- package/src/core/components/tree/treeContext.ts +1 -1
- package/src/core/components/tree/treeGroup.tsx +2 -2
- package/src/core/components/tree/treeItem.tsx +15 -15
- package/src/core/components/tree/types.ts +2 -2
- package/src/core/components/tree/useTree.ts +1 -1
- package/src/core/hooks/useClickOutside.test.tsx +15 -16
- package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
- package/src/core/hooks/useDelayed.test.ts +6 -7
- package/src/core/hooks/useDelayedState.ts +1 -1
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
- package/src/core/hooks/useElementSize.ts +1 -1
- package/src/core/hooks/useForwardedRef.ts +1 -1
- package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -0
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -2
- package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
- package/src/core/hooks/usePrefersDark.test.tsx +1 -0
- package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
- package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
- package/src/core/middleware/origin.ts +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +3 -3
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +6 -6
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -3
- package/src/core/primitives/avatar/avatarStack.tsx +7 -7
- package/src/core/primitives/avatar/types.ts +1 -3
- package/src/core/primitives/badge/badge.test.tsx +2 -3
- package/src/core/primitives/badge/badge.tsx +3 -3
- package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
- package/src/core/primitives/box/box.tsx +4 -2
- package/src/core/primitives/button/__workshop__/custom.tsx +2 -2
- package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
- package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
- package/src/core/primitives/button/__workshop__/props.tsx +3 -4
- package/src/core/primitives/button/__workshop__/stacked.tsx +4 -5
- package/src/core/primitives/button/button.test.tsx +2 -3
- package/src/core/primitives/button/button.tsx +11 -6
- package/src/core/primitives/card/__workshop__/asButton.tsx +16 -7
- package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
- package/src/core/primitives/card/__workshop__/index.ts +1 -1
- package/src/core/primitives/card/__workshop__/interactive.tsx +1 -1
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
- package/src/core/primitives/card/__workshop__/props.tsx +3 -3
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
- package/src/core/primitives/card/card.tsx +4 -4
- package/src/core/primitives/card/cardContext.ts +2 -2
- package/src/core/primitives/card/cardProvider.tsx +3 -3
- package/src/core/primitives/card/types.ts +2 -2
- package/src/core/primitives/card/useCard.ts +2 -1
- package/src/core/primitives/checkbox/__workshop__/props.tsx +2 -0
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
- package/src/core/primitives/checkbox/checkbox.tsx +5 -7
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/code/code.tsx +3 -3
- package/src/core/primitives/container/container.tsx +4 -4
- package/src/core/primitives/flex/flex.tsx +2 -2
- package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/heading/heading.tsx +2 -2
- package/src/core/primitives/inline/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +2 -2
- package/src/core/primitives/inline/types.ts +1 -0
- package/src/core/primitives/kbd/kbd.tsx +5 -5
- package/src/core/primitives/label/label.tsx +5 -5
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +4 -4
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -3
- package/src/core/primitives/popover/constants.ts +1 -1
- package/src/core/primitives/popover/floating-ui/size.ts +2 -2
- package/src/core/primitives/popover/helpers.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +1 -1
- package/src/core/primitives/popover/popoverLayer.tsx +4 -4
- package/src/core/primitives/popover/types.ts +3 -2
- package/src/core/primitives/radio/__workshop__/example.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +5 -5
- package/src/core/primitives/select/__workshop__/plain.tsx +15 -3
- package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
- package/src/core/primitives/select/select.tsx +4 -10
- package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -2
- package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +3 -3
- package/src/core/primitives/spinner/spinner.tsx +3 -3
- package/src/core/primitives/stack/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +5 -5
- package/src/core/primitives/switch/switch.tsx +3 -3
- package/src/core/primitives/text/__workshop__/colored.tsx +5 -5
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
- package/src/core/primitives/text/text.tsx +6 -6
- package/src/core/primitives/textArea/__workshop__/plain.tsx +35 -23
- package/src/core/primitives/textArea/textArea.tsx +14 -5
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +9 -15
- package/src/core/primitives/textInput/__workshop__/states.tsx +4 -4
- package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +13 -11
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +2 -2
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/props.tsx +5 -4
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
- package/src/core/primitives/tooltip/tooltip.tsx +11 -6
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -3
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +4 -4
- package/src/core/primitives/types.ts +15 -24
- package/src/core/types/badge.ts +1 -1
- package/src/core/types/button.ts +1 -1
- package/src/core/types/card.ts +1 -1
- package/src/core/types/selectable.ts +1 -1
- package/src/core/utils/arrow/arrow.tsx +5 -14
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
- package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +2 -2
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
- package/src/core/utils/elementQuery/elementQuery.tsx +1 -1
- package/src/core/utils/errorBoundary.tsx +4 -4
- package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
- package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
- package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
- package/src/core/utils/layer/getLayerContext.test.ts +3 -1
- package/src/core/utils/layer/getLayerContext.ts +1 -1
- package/src/core/utils/layer/layer.test.tsx +5 -5
- package/src/core/utils/layer/layer.tsx +2 -2
- package/src/core/utils/layer/layerCard.tsx +3 -3
- package/src/core/utils/layer/layerContext.ts +1 -1
- package/src/core/utils/layer/layerProvider.tsx +10 -2
- package/src/core/utils/layer/useLayer.ts +1 -1
- package/src/core/utils/portal/__workshop__/named.tsx +3 -3
- package/src/core/utils/portal/portal.test.tsx +5 -5
- package/src/core/utils/portal/portal.tsx +3 -2
- package/src/core/utils/portal/portalContext.ts +1 -1
- package/src/core/utils/portal/portalProvider.tsx +2 -2
- package/src/core/utils/portal/usePortal.ts +1 -1
- package/src/core/utils/srOnly/srOnly.tsx +3 -3
- package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +3 -3
- package/src/css/_assign.ts +3 -0
- package/src/css/_compileStyle.ts +12 -4
- package/src/css/_compileTheme.ts +10 -13
- package/src/css/_composeClassNames.ts +12 -0
- package/src/css/_fromEntries.ts +3 -0
- package/src/css/_getClassNames.ts +9 -0
- package/src/css/_hash.ts +9 -0
- package/src/css/_mergeStyles.ts +1 -1
- package/src/css/_resp.ts +6 -12
- package/src/css/_scopeClassName.ts +9 -0
- package/src/css/_scopeClassNames.ts +12 -0
- package/src/css/_system.style.ts +2 -0
- package/src/css/aspects/border/border.style.ts +2 -2
- package/src/css/aspects/border/border.ts +3 -3
- package/src/css/aspects/border/types.ts +1 -1
- package/src/css/aspects/boxSizing/boxSizing.style.ts +10 -0
- package/src/css/aspects/boxSizing/boxSizing.ts +8 -0
- package/src/css/aspects/boxSizing/index.ts +2 -0
- package/src/css/aspects/boxSizing/types.ts +9 -0
- package/src/css/aspects/display/display.style.ts +8 -8
- package/src/css/aspects/display/display.ts +3 -3
- package/src/css/aspects/display/types.ts +1 -1
- package/src/css/aspects/flex/flex.ts +3 -3
- package/src/css/aspects/flex/types.ts +1 -1
- package/src/css/aspects/flexItem/flex.style.ts +1 -1
- package/src/css/aspects/flexItem/flexItem.ts +3 -3
- package/src/css/aspects/flexItem/types.ts +1 -1
- package/src/css/aspects/font/font.style.ts +33 -22
- package/src/css/aspects/font/font.ts +3 -3
- package/src/css/aspects/font/types.ts +1 -1
- package/src/css/aspects/gap/gap.style.ts +2 -2
- package/src/css/aspects/gap/gap.ts +3 -3
- package/src/css/aspects/gap/types.ts +2 -2
- package/src/css/aspects/grid/grid.ts +3 -3
- package/src/css/aspects/grid/types.ts +1 -1
- package/src/css/aspects/gridItem/gridItem.ts +3 -3
- package/src/css/aspects/gridItem/types.ts +1 -1
- package/src/css/aspects/height/height.ts +3 -3
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/inset/inset.ts +3 -3
- package/src/css/aspects/inset/types.ts +1 -1
- package/src/css/aspects/margin/margin.style.ts +10 -10
- package/src/css/aspects/margin/margin.ts +3 -3
- package/src/css/aspects/margin/types.ts +1 -1
- package/src/css/aspects/maxWidth/maxWidth.style.ts +1 -1
- package/src/css/aspects/maxWidth/maxWidth.ts +4 -3
- package/src/css/aspects/maxWidth/types.ts +2 -2
- package/src/css/aspects/minWidth/minWidth.ts +4 -3
- package/src/css/aspects/minWidth/types.ts +1 -1
- package/src/css/aspects/overflow/overflow.ts +3 -3
- package/src/css/aspects/overflow/types.ts +1 -1
- package/src/css/aspects/padding/padding.style.ts +2 -5
- package/src/css/aspects/padding/padding.ts +3 -3
- package/src/css/aspects/padding/types.ts +2 -2
- package/src/css/aspects/pointerEvents/pointerEvents.ts +3 -3
- package/src/css/aspects/position/position.ts +3 -3
- package/src/css/aspects/position/types.ts +1 -1
- package/src/css/aspects/radius/radius.style.ts +1 -1
- package/src/css/aspects/radius/radius.ts +3 -3
- package/src/css/aspects/radius/types.ts +2 -2
- package/src/css/aspects/shadow/shadow.style.ts +7 -7
- package/src/css/aspects/shadow/shadow.ts +3 -3
- package/src/css/aspects/shadow/types.ts +2 -2
- package/src/css/aspects/textAlign/textAlign.style.ts +1 -1
- package/src/css/aspects/textAlign/textAlign.ts +3 -3
- package/src/css/aspects/textOverflow/textOverflow.ts +3 -3
- package/src/css/aspects/width/types.ts +2 -2
- package/src/css/aspects/width/width.style.ts +1 -1
- package/src/css/aspects/width/width.ts +4 -3
- package/src/css/components/breadcrumbs/breadcrumbs.style.ts +1 -1
- package/src/css/components/breadcrumbs/breadcrumbs.ts +2 -2
- package/src/css/components/dialog/dialog.style.ts +14 -16
- package/src/css/components/dialog/dialog.ts +9 -8
- package/src/css/components/menu/menu.style.ts +2 -2
- package/src/css/components/menu/menu.ts +3 -3
- package/src/css/components/skeleton/skeleton.style.ts +24 -17
- package/src/css/components/skeleton/skeleton.ts +8 -7
- package/src/css/components/skeleton/types.ts +4 -6
- package/src/css/components/toast/toast.style.ts +1 -1
- package/src/css/components/toast/toast.ts +6 -6
- package/src/css/components/tree/tree.style.ts +7 -23
- package/src/css/components/tree/tree.ts +2 -2
- package/src/css/constants.ts +0 -3
- package/src/css/index.ts +3 -5
- package/src/css/prefix/constants.ts +6 -0
- package/src/css/prefix/types.ts +1 -0
- package/src/css/primitives/_arrow/_arrow.style.ts +11 -13
- package/src/css/primitives/_arrow/_arrow.ts +5 -5
- package/src/css/primitives/_input/_input.style.ts +171 -75
- package/src/css/primitives/_input/input.ts +13 -10
- package/src/css/primitives/_input/types.ts +3 -3
- package/src/css/primitives/_selectable/_selectable.style.ts +5 -6
- package/src/css/primitives/_selectable/selectable.ts +4 -3
- package/src/css/primitives/_selectable/types.ts +2 -2
- package/src/css/primitives/avatar/avatar.style.ts +38 -39
- package/src/css/primitives/avatar/avatar.ts +8 -8
- package/src/css/primitives/avatar/types.ts +3 -3
- package/src/css/primitives/badge/badge.style.ts +2 -3
- package/src/css/primitives/badge/badge.ts +7 -3
- package/src/css/primitives/badge/types.ts +2 -2
- package/src/css/primitives/box/box.style.ts +5 -15
- package/src/css/primitives/box/box.ts +7 -9
- package/src/css/primitives/box/types.ts +3 -6
- package/src/css/primitives/button/button.style.ts +189 -162
- package/src/css/primitives/button/button.ts +11 -4
- package/src/css/primitives/button/types.ts +1 -1
- package/src/css/primitives/card/card.style.ts +102 -68
- package/src/css/primitives/card/card.ts +5 -7
- package/src/css/primitives/card/types.ts +2 -2
- package/src/css/primitives/checkbox/checkbox.style.ts +125 -101
- package/src/css/primitives/checkbox/checkbox.ts +3 -3
- package/src/css/primitives/code/code.style.ts +24 -26
- package/src/css/primitives/code/code.ts +7 -3
- package/src/css/primitives/code/types.ts +2 -2
- package/src/css/primitives/container/container.style.ts +1 -1
- package/src/css/primitives/container/container.ts +4 -3
- package/src/css/primitives/container/types.ts +2 -2
- package/src/css/primitives/heading/heading.style.ts +31 -23
- package/src/css/primitives/heading/heading.ts +10 -8
- package/src/css/primitives/heading/types.ts +3 -2
- package/src/css/primitives/kbd/kbd.style.ts +7 -7
- package/src/css/primitives/kbd/kbd.ts +4 -3
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.style.ts +27 -24
- package/src/css/primitives/label/label.ts +5 -8
- package/src/css/primitives/label/types.ts +4 -3
- package/src/css/primitives/popover/popover.style.ts +6 -2
- package/src/css/primitives/popover/popover.ts +3 -3
- package/src/css/primitives/radio/radio.style.ts +37 -76
- package/src/css/primitives/radio/radio.ts +2 -2
- package/src/css/primitives/select/select.style.ts +3 -3
- package/src/css/primitives/select/select.ts +5 -5
- package/src/css/primitives/select/types.ts +1 -1
- package/src/css/primitives/spinner/spinner.style.ts +1 -1
- package/src/css/primitives/spinner/spinner.ts +3 -3
- package/src/css/primitives/stack/stack.style.ts +6 -2
- package/src/css/primitives/stack/stack.ts +2 -2
- package/src/css/primitives/switch/switch.style.ts +47 -39
- package/src/css/primitives/switch/switch.ts +6 -6
- package/src/css/primitives/text/text.style.ts +28 -23
- package/src/css/primitives/text/text.ts +5 -8
- package/src/css/primitives/text/types.ts +2 -2
- package/src/css/primitives/textArea/textArea.style.ts +6 -2
- package/src/css/primitives/textArea/textArea.ts +4 -4
- package/src/css/primitives/textArea/types.ts +1 -1
- package/src/css/primitives/textInput/textInput.style.ts +23 -17
- package/src/css/primitives/textInput/textInput.ts +4 -4
- package/src/css/primitives/textInput/types.ts +2 -8
- package/src/css/primitives/token/token.style.ts +4 -4
- package/src/css/primitives/tooltip/tooltip.style.ts +5 -4
- package/src/css/primitives/tooltip/tooltip.ts +3 -3
- package/src/css/renderColor.ts +31 -0
- package/src/css/theme/index.ts +14 -0
- package/src/css/theme/lib/contract/buildVarContract.ts +76 -0
- package/src/css/theme/lib/contract/index.ts +2 -0
- package/src/css/theme/lib/contract/types.ts +15 -0
- package/src/css/theme/resolveTheme.ts +852 -0
- package/src/css/types.ts +25 -914
- package/src/css/utils/srOnly/srOnly.style.ts +1 -1
- package/src/css/utils/srOnly/srOnly.ts +3 -3
- package/src/theme/getScopedTheme.ts +4 -4
- package/src/theme/index.ts +0 -5
- package/src/theme/types.ts +4 -4
- package/src/theme/v0/color/_generic.ts +1 -1
- package/src/theme/v0/color/button.ts +1 -1
- package/src/theme/v0/color/card.ts +1 -1
- package/src/theme/v0/color/color.ts +11 -11
- package/src/theme/v0/color/input.ts +1 -1
- package/src/theme/v0/color/muted.ts +1 -1
- package/src/theme/v0/color/selectable.ts +1 -1
- package/src/theme/v0/color/solid.ts +1 -1
- package/src/theme/v0/color/spot.ts +1 -1
- package/src/theme/v0/styles.ts +1 -1
- package/src/theme/v0/theme.ts +7 -7
- package/src/theme/v2/avatar.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
- package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
- package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
- package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
- package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
- package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
- package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
- package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
- package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
- package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
- package/src/theme/{build → v2/build}/buildTheme.ts +4 -4
- package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
- package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
- package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
- package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
- package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
- package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
- package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
- package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
- package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
- package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
- package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
- package/src/theme/v2/color/_helpers.ts +2 -2
- package/src/theme/v2/color/_system.ts +1 -1
- package/src/theme/v2/color/avatar.ts +1 -1
- package/src/theme/v2/color/badge.ts +1 -1
- package/src/theme/v2/color/button.ts +2 -2
- package/src/theme/v2/color/color.ts +7 -7
- package/src/theme/v2/color/input.ts +5 -1
- package/src/theme/v2/color/selectable.ts +2 -2
- package/src/theme/v2/color/state.ts +4 -4
- package/src/theme/{config → v2/config}/helpers.ts +6 -13
- package/src/theme/{config → v2/config}/system.ts +11 -12
- package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
- package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
- package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
- package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
- package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
- package/src/theme/{config → v2/config}/types.ts +8 -6
- package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/colorTokens.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/config.ts +1 -1
- package/src/theme/{defaults → v2/defaults}/fonts.ts +1 -1
- package/src/theme/v2/index.ts +2 -0
- package/src/theme/v2/input.ts +1 -1
- package/src/theme/v2/theme.ts +8 -8
- package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
- package/src/theme/v3/_parseColorToken.ts +185 -0
- package/src/theme/v3/buildTheme_v3.ts +11 -7
- package/src/theme/v3/color/_constants.ts +15 -0
- package/src/theme/v3/color/avatar.ts +14 -0
- package/src/theme/v3/color/card.ts +53 -53
- package/src/theme/v3/color/color.ts +66 -68
- package/src/theme/v3/color/element.ts +8 -8
- package/src/theme/v3/color/index.ts +2 -2
- package/src/theme/v3/color/token.ts +18 -4
- package/src/theme/v3/color/tokens.ts +2 -2
- package/src/theme/v3/defaultTokens.ts +73 -85
- package/src/theme/v3/index.ts +3 -0
- package/src/theme/v3/palette/index.ts +2 -0
- package/src/theme/v3/resolveTokens.ts +65 -65
- package/src/theme/v3/tokens.ts +2 -2
- package/src/theme/v3/types.ts +61 -7
- package/src/theme/versioning/getTheme_v2.ts +3 -3
- package/src/theme/versioning/is_v0.ts +2 -2
- package/src/theme/versioning/is_v2.ts +2 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
- package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
- package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
- package/src/theme/versioning/v0_v2.ts +3 -3
- package/src/theme/versioning/v2_v0.ts +4 -4
- package/src/theme/versioning/v3_v2.ts +38 -38
- package/dist/ui-palette.css +0 -105
- package/dist/ui-palette.min.css +0 -1
- package/src/css/_comp.test.ts +0 -7
- package/src/css/_comp.ts +0 -11
- package/src/css/_compilePalette.ts +0 -32
- package/src/css/_compileTheme_v3.ts +0 -440
- package/src/css/aspects/flex/flex.style.ts +0 -30
- package/src/css/composeClassNames.ts +0 -19
- package/src/css/primitives/_selectable/__style.ts +0 -117
- package/src/css/primitives/checkbox/__styles.ts +0 -129
- package/src/css/scopeClassName.ts +0 -7
- package/src/css/varNames.ts +0 -607
- package/src/css/vars.ts +0 -520
- package/src/theme/_types.ts +0 -41
- package/src/theme/build/theme.test.ts +0 -27
- package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
- package/src/theme/config/tokens/parseTokenKey.ts +0 -67
- package/src/theme/v3/buildTheme_v3.test.ts +0 -40
- package/src/theme/v3/color/buildColor_v3.ts +0 -226
- package/src/theme/v3/color/parseColor.test.ts +0 -79
- package/src/theme/v3/color/parseColor.ts +0 -167
- package/src/theme/v3/color/renderColor.test.ts +0 -20
- package/src/theme/v3/color/renderColor.ts +0 -43
- /package/src/{theme/palette → css/prefix}/index.ts +0 -0
- /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
- /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
- /package/src/theme/{build → v2/build}/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
- /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
- /package/src/theme/{build → v2/build}/merge.ts +0 -0
- /package/src/theme/{config → v2/config}/index.ts +0 -0
- /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
- /package/src/theme/{palette → v3/palette}/constants.ts +0 -0
- /package/src/theme/{palette → v3/palette}/types.ts +0 -0
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {vars} from '../../theme'
|
|
2
|
+
import type {Style, StyleRules} from '../../types'
|
|
3
3
|
|
|
4
4
|
const primitive: StyleRules = {
|
|
5
5
|
'.arrow': {
|
|
6
|
-
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
width: vars.arrow.size,
|
|
8
|
+
height: vars.arrow.size,
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
'width': 'var(--arrow-size)',
|
|
10
|
-
'height': 'var(--arrow-size)',
|
|
11
|
-
|
|
12
|
-
'@nest': {
|
|
10
|
+
nest: {
|
|
13
11
|
':empty + &': {
|
|
14
12
|
display: 'none',
|
|
15
13
|
},
|
|
16
14
|
|
|
17
15
|
'& > svg': {
|
|
18
16
|
display: 'block',
|
|
19
|
-
transformOrigin: `calc(
|
|
17
|
+
transformOrigin: `calc(${vars.arrow.size} / 2) calc(${vars.arrow.size} / 2)`,
|
|
20
18
|
},
|
|
21
19
|
|
|
22
20
|
// top
|
|
23
21
|
'[data-placement^="top"] > &': {
|
|
24
|
-
bottom:
|
|
22
|
+
bottom: `calc(0px - ${vars.arrow.size})`,
|
|
25
23
|
},
|
|
26
24
|
'[data-placement^="top"] > & svg': {
|
|
27
25
|
transform: 'rotate(0deg)',
|
|
@@ -29,7 +27,7 @@ const primitive: StyleRules = {
|
|
|
29
27
|
|
|
30
28
|
// right
|
|
31
29
|
'[data-placement^="right"] > &': {
|
|
32
|
-
left:
|
|
30
|
+
left: `calc(0px - ${vars.arrow.size})`,
|
|
33
31
|
},
|
|
34
32
|
'[data-placement^="right"] > & svg': {
|
|
35
33
|
transform: 'rotate(90deg)',
|
|
@@ -37,7 +35,7 @@ const primitive: StyleRules = {
|
|
|
37
35
|
|
|
38
36
|
// left
|
|
39
37
|
'[data-placement^="left"] > &': {
|
|
40
|
-
right:
|
|
38
|
+
right: `calc(0px - ${vars.arrow.size})`,
|
|
41
39
|
},
|
|
42
40
|
'[data-placement^="left"] > & svg': {
|
|
43
41
|
transform: 'rotate(-90deg)',
|
|
@@ -45,7 +43,7 @@ const primitive: StyleRules = {
|
|
|
45
43
|
|
|
46
44
|
// bottom
|
|
47
45
|
'[data-placement^="bottom"] > &': {
|
|
48
|
-
top:
|
|
46
|
+
top: `calc(0px - ${vars.arrow.size})`,
|
|
49
47
|
},
|
|
50
48
|
'[data-placement^="bottom"] > & svg': {
|
|
51
49
|
transform: 'rotate(180deg)',
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {_scopeClassNames} from '../../_scopeClassNames'
|
|
2
2
|
|
|
3
3
|
/** @internal */
|
|
4
4
|
export function _arrow(): string | undefined {
|
|
5
|
-
return
|
|
5
|
+
return _scopeClassNames('arrow')
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/** @internal */
|
|
9
9
|
export function _arrowStroke(): string | undefined {
|
|
10
|
-
return
|
|
10
|
+
return _scopeClassNames('arrow-stroke')
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** @internal */
|
|
14
14
|
export function _arrowStrokeMask(): string | undefined {
|
|
15
|
-
return
|
|
15
|
+
return _scopeClassNames('arrow-stroke-mask')
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/** @internal */
|
|
19
19
|
export function _arrowShape(): string | undefined {
|
|
20
|
-
return
|
|
20
|
+
return _scopeClassNames('arrow-shape')
|
|
21
21
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {FONT_TEXT_SIZE, SPACE} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
3
|
import {_responsiveRule} from '../../_responsiveRule'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {vars} from '../../vars'
|
|
4
|
+
import {varNames, vars} from '../../theme'
|
|
5
|
+
import type {Style, StyleRules} from '../../types'
|
|
7
6
|
|
|
8
7
|
const primitive: StyleRules = {
|
|
9
8
|
'.input': {
|
|
@@ -11,86 +10,113 @@ const primitive: StyleRules = {
|
|
|
11
10
|
},
|
|
12
11
|
|
|
13
12
|
'.input-b': {
|
|
14
|
-
|
|
13
|
+
nest: {
|
|
15
14
|
'& .input-presentation': {
|
|
16
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.border}`,
|
|
15
|
+
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
17
16
|
},
|
|
18
17
|
},
|
|
19
18
|
},
|
|
20
19
|
|
|
21
20
|
'.input-element': {
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'var(--input-padding)',
|
|
39
|
-
'calc(var(--input-padding) - var(--input-descender-height))',
|
|
40
|
-
'var(--input-padding)',
|
|
21
|
+
WebkitFontSmoothing: 'inherit',
|
|
22
|
+
appearance: 'none',
|
|
23
|
+
border: 0,
|
|
24
|
+
outline: 'none',
|
|
25
|
+
margin: 0,
|
|
26
|
+
fontFamily: vars.font.text.family,
|
|
27
|
+
fontSize: vars.input.fontSize,
|
|
28
|
+
lineHeight: vars.input.lineHeight,
|
|
29
|
+
letterSpacing: vars.input.letterSpacing,
|
|
30
|
+
backgroundColor: 'transparent',
|
|
31
|
+
color: vars.color.input.text.fg,
|
|
32
|
+
padding: [
|
|
33
|
+
`calc(${vars.input.padding} - ${vars.input.ascenderHeight})`,
|
|
34
|
+
vars.input.padding,
|
|
35
|
+
`calc(${vars.input.padding} - ${vars.input.descenderHeight})`,
|
|
36
|
+
vars.input.padding,
|
|
41
37
|
].join(' '),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
borderRadius: 'inherit',
|
|
39
|
+
position: 'relative',
|
|
40
|
+
zIndex: 1,
|
|
41
|
+
display: 'block',
|
|
42
|
+
boxSizing: 'border-box',
|
|
43
|
+
resize: 'none',
|
|
48
44
|
// @ts-expect-error - TODO: fix this
|
|
49
|
-
|
|
45
|
+
width: ['-moz-available', '-webkit-fill-available', 'stretch'],
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
nest: {
|
|
52
48
|
'.input[data-icon-left] &': {
|
|
53
|
-
paddingLeft: `calc(
|
|
49
|
+
paddingLeft: `calc(${vars.input.padding} + calc(${vars.input.lineHeight} - ${vars.input.ascenderHeight} - ${vars.input.descenderHeight}) + ${vars.input.gap})`,
|
|
54
50
|
},
|
|
55
51
|
|
|
56
52
|
'.input[data-icon-right] &': {
|
|
57
|
-
paddingRight: `calc(
|
|
53
|
+
paddingRight: `calc(${vars.input.padding} + calc(${vars.input.lineHeight} - ${vars.input.ascenderHeight} - ${vars.input.descenderHeight}) + ${vars.input.gap})`,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
'.input:not([data-invalid]) &': {
|
|
57
|
+
vars: {
|
|
58
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[2],
|
|
59
|
+
[varNames.color.input.text.placeholder]: vars.color.tinted.default.border[4],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
'.input:not([data-invalid]) &::placeholder': {
|
|
64
|
+
color: vars.color.input.text.placeholder,
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
'.input:not([data-invalid]) &:hover': {
|
|
68
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[0],
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
'.input:not([data-invalid]) &:focus': {
|
|
72
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[0],
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
'.input:not([data-invalid]) &:disabled': {
|
|
76
|
+
vars: {
|
|
77
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.border[4],
|
|
78
|
+
[varNames.color.input.text.placeholder]: vars.color.tinted.default.border[1],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
'.input[data-invalid] &': {
|
|
83
|
+
vars: {
|
|
84
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[2],
|
|
85
|
+
[varNames.color.input.text.placeholder]: vars.color.tinted.critical.border[4],
|
|
86
|
+
},
|
|
58
87
|
},
|
|
59
88
|
|
|
60
|
-
'&::placeholder': {
|
|
61
|
-
color: vars.color.input.placeholder,
|
|
89
|
+
'.input[data-invalid] &::placeholder': {
|
|
90
|
+
color: vars.color.input.text.placeholder,
|
|
62
91
|
},
|
|
63
92
|
|
|
64
|
-
'&:hover': {
|
|
65
|
-
[varNames.color.input.fg]: vars.color.tinted.
|
|
93
|
+
'.input[data-invalid] &:hover': {
|
|
94
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
66
95
|
},
|
|
67
96
|
|
|
68
|
-
'&:focus': {
|
|
69
|
-
[varNames.color.input.fg]: vars.color.tinted.
|
|
97
|
+
'.input[data-invalid] &:focus': {
|
|
98
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
70
99
|
},
|
|
71
100
|
|
|
72
|
-
'&:disabled': {
|
|
73
|
-
[varNames.color.input.fg]: vars.color.tinted.
|
|
101
|
+
'.input[data-invalid] &:disabled': {
|
|
102
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.border[3],
|
|
74
103
|
},
|
|
75
104
|
},
|
|
76
105
|
},
|
|
77
106
|
|
|
78
107
|
'.input-presentation': {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
'zIndex': 0,
|
|
92
|
-
|
|
93
|
-
'@nest': {
|
|
108
|
+
backgroundColor: vars.color.input.text.bg,
|
|
109
|
+
borderRadius: 'inherit',
|
|
110
|
+
position: 'absolute',
|
|
111
|
+
top: 0,
|
|
112
|
+
left: 0,
|
|
113
|
+
right: 0,
|
|
114
|
+
bottom: 0,
|
|
115
|
+
display: 'block',
|
|
116
|
+
pointerEvents: 'none',
|
|
117
|
+
zIndex: 0,
|
|
118
|
+
|
|
119
|
+
nest: {
|
|
94
120
|
'.input[data-prefix] &': {
|
|
95
121
|
borderTopLeftRadius: 0,
|
|
96
122
|
borderBottomLeftRadius: 0,
|
|
@@ -101,22 +127,8 @@ const primitive: StyleRules = {
|
|
|
101
127
|
borderBottomRightRadius: 0,
|
|
102
128
|
},
|
|
103
129
|
|
|
104
|
-
'.input-element:placeholder-shown + &': {
|
|
105
|
-
[varNames.color.input.fg]: vars.color.tinted.default.border[4],
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
'.input-element:hover + &': {
|
|
109
|
-
[varNames.color.input.border]: vars.color.tinted.default.border[2],
|
|
110
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[1],
|
|
111
|
-
|
|
112
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.border}`,
|
|
113
|
-
},
|
|
114
|
-
|
|
115
130
|
'.input-element:focus + &': {
|
|
116
|
-
|
|
117
|
-
[varNames.color.input.fg]: vars.color.tinted.default.fg[1],
|
|
118
|
-
|
|
119
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.border}`,
|
|
131
|
+
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
120
132
|
outlineWidth: vars.input.text.focusRing.width,
|
|
121
133
|
outlineStyle: 'solid',
|
|
122
134
|
outlineColor: vars.color.focusRing,
|
|
@@ -124,11 +136,95 @@ const primitive: StyleRules = {
|
|
|
124
136
|
},
|
|
125
137
|
|
|
126
138
|
'.input-element:disabled + &': {
|
|
127
|
-
[varNames.color.input.bg]: vars.color.tinted.default.bg[1],
|
|
128
|
-
[varNames.color.input.border]: vars.color.tinted.default.border[0],
|
|
129
|
-
|
|
130
139
|
opacity: 1,
|
|
131
140
|
},
|
|
141
|
+
|
|
142
|
+
// valid
|
|
143
|
+
|
|
144
|
+
'.input:not([data-invalid]) &': {
|
|
145
|
+
vars: {
|
|
146
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[4],
|
|
147
|
+
[varNames.color.input.text.bg]: vars.color.tinted.default.bg[0],
|
|
148
|
+
[varNames.color.input.text.border]: vars.color.tinted.default.border[1],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
'.input:not([data-invalid])[data-read-only] .input-element + &': {
|
|
153
|
+
vars: {
|
|
154
|
+
[varNames.color.input.text.bg]: vars.color.tinted.default.bg[1],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
'.input:not([data-invalid]) .input-element:placeholder-shown + &': {
|
|
159
|
+
vars: {
|
|
160
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.border[4],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
'.input:not([data-invalid]):not([data-read-only]) .input-element:not(:disabled):hover + &': {
|
|
165
|
+
vars: {
|
|
166
|
+
[varNames.color.input.text.border]: vars.color.tinted.default.border[2],
|
|
167
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[1],
|
|
168
|
+
},
|
|
169
|
+
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
'.input:not([data-invalid]) .input-element:focus + &': {
|
|
173
|
+
vars: {
|
|
174
|
+
[varNames.color.input.text.border]: vars.color.tinted.default.border[2],
|
|
175
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[1],
|
|
176
|
+
},
|
|
177
|
+
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
'.input:not([data-invalid]) .input-element:disabled + &': {
|
|
181
|
+
vars: {
|
|
182
|
+
[varNames.color.input.text.bg]: vars.color.tinted.default.bg[1],
|
|
183
|
+
[varNames.color.input.text.border]: vars.color.tinted.default.border[0],
|
|
184
|
+
|
|
185
|
+
// icon
|
|
186
|
+
[varNames.color.muted.fg]: vars.color.tinted.default.border[4],
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
// invalid
|
|
191
|
+
|
|
192
|
+
'.input[data-invalid] &': {
|
|
193
|
+
vars: {
|
|
194
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[4],
|
|
195
|
+
[varNames.color.input.text.bg]: vars.color.tinted.critical.bg[1],
|
|
196
|
+
[varNames.color.input.text.border]: vars.color.tinted.critical.border[1],
|
|
197
|
+
|
|
198
|
+
[varNames.color.focusRing]: vars.color.solid.critical.bg[0],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
'.input[data-invalid] .input-element:placeholder-shown + &': {
|
|
203
|
+
vars: {
|
|
204
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.border[4],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
'.input[data-invalid] .input-element:not(:disabled):hover + &': {
|
|
209
|
+
vars: {
|
|
210
|
+
[varNames.color.input.text.border]: vars.color.tinted.critical.border[2],
|
|
211
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
'.input[data-invalid] .input-element:focus + &': {
|
|
216
|
+
vars: {
|
|
217
|
+
[varNames.color.input.text.border]: vars.color.tinted.critical.border[2],
|
|
218
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
'.input[data-invalid] .input-element:disabled + &': {
|
|
223
|
+
vars: {
|
|
224
|
+
[varNames.color.input.text.bg]: vars.color.tinted.critical.bg[1],
|
|
225
|
+
[varNames.color.input.text.border]: vars.color.tinted.critical.border[0],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
132
228
|
},
|
|
133
229
|
},
|
|
134
230
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
+
import {_scopeClassNames} from '../../_scopeClassNames'
|
|
3
4
|
import {radius, width} from '../../aspects'
|
|
4
|
-
import {InputStyleProps} from './types'
|
|
5
|
+
import type {InputStyleProps} from './types'
|
|
5
6
|
|
|
6
7
|
/** @internal */
|
|
7
8
|
export function _input(props: InputStyleProps): string | undefined {
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
return _composeClassNames(
|
|
10
|
+
_scopeClassNames(
|
|
11
|
+
'input',
|
|
12
|
+
props.border ? 'input-b' : undefined,
|
|
13
|
+
_resp('input', props.fontSize),
|
|
14
|
+
_resp('input-p', props.padding),
|
|
15
|
+
_resp('input-g', props.gap),
|
|
16
|
+
),
|
|
14
17
|
radius(props),
|
|
15
18
|
width(props),
|
|
16
19
|
)
|
|
@@ -18,10 +21,10 @@ export function _input(props: InputStyleProps): string | undefined {
|
|
|
18
21
|
|
|
19
22
|
/** @internal */
|
|
20
23
|
export function _inputElement(): string | undefined {
|
|
21
|
-
return
|
|
24
|
+
return _scopeClassNames('input-element')
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
/** @internal */
|
|
25
28
|
export function _inputPresentation(): string | undefined {
|
|
26
|
-
return
|
|
29
|
+
return _scopeClassNames('input-presentation')
|
|
27
30
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {FontTextSize, Space} from '@sanity/ui/theme'
|
|
1
|
+
import type {FontTextSize, Space} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import {RadiusStyleProps, WidthStyleProps} from '../../aspects'
|
|
4
|
-
import {ResponsiveProp} from '../../types'
|
|
3
|
+
import type {RadiusStyleProps, WidthStyleProps} from '../../aspects'
|
|
4
|
+
import type {ResponsiveProp} from '../../types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
7
7
|
export interface InputStyleProps extends RadiusStyleProps, WidthStyleProps {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import {THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {vars} from '../../vars'
|
|
3
|
+
import {varNames, vars} from '../../theme'
|
|
4
|
+
import type {Properties, Style, StyleRules} from '../../types'
|
|
6
5
|
|
|
7
6
|
const primitive: StyleRules = {
|
|
8
7
|
'.selectable': {
|
|
@@ -13,7 +12,7 @@ const primitive: StyleRules = {
|
|
|
13
12
|
[varNames.color.border]: vars.color.tinted.border[2],
|
|
14
13
|
[varNames.color.fg]: vars.color.tinted.fg[2],
|
|
15
14
|
|
|
16
|
-
'
|
|
15
|
+
'nest': {
|
|
17
16
|
'&:is(button)': {
|
|
18
17
|
WebkitFontSmoothing: 'inherit',
|
|
19
18
|
appearance: 'none',
|
|
@@ -36,9 +35,9 @@ const primitive: StyleRules = {
|
|
|
36
35
|
|
|
37
36
|
'@media': {
|
|
38
37
|
'(hover: hover)': {
|
|
39
|
-
|
|
38
|
+
nest: {
|
|
40
39
|
'&:not([data-disabled])': {
|
|
41
|
-
|
|
40
|
+
cursor: 'pointer',
|
|
42
41
|
},
|
|
43
42
|
|
|
44
43
|
'&:not([data-disabled]):hover': {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
|
+
import {_scopeClassNames} from '../../_scopeClassNames'
|
|
2
3
|
import {radius} from '../../aspects'
|
|
3
|
-
import {SelectableStyleProps} from './types'
|
|
4
|
+
import type {SelectableStyleProps} from './types'
|
|
4
5
|
|
|
5
6
|
/** @internal */
|
|
6
7
|
export function _selectable(props: SelectableStyleProps): string | undefined {
|
|
7
|
-
return
|
|
8
|
+
return _composeClassNames(_scopeClassNames('selectable', props.tone ?? 'default'), radius(props))
|
|
8
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
1
|
+
import type {ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import {RadiusStyleProps} from '../../aspects'
|
|
3
|
+
import type {RadiusStyleProps} from '../../aspects'
|
|
4
4
|
|
|
5
5
|
/** @internal */
|
|
6
6
|
export interface SelectableStyleProps extends RadiusStyleProps {
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {AVATAR_COLORS, AVATAR_SIZE} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
3
|
import {_responsiveRule} from '../../_responsiveRule'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {vars} from '../../vars'
|
|
4
|
+
import {varNames, vars} from '../../theme'
|
|
5
|
+
import type {Properties, Style, StyleRules} from '../../types'
|
|
7
6
|
|
|
8
7
|
const primitive: StyleRules = {
|
|
9
8
|
'.avatar': {
|
|
10
9
|
[varNames.color.fg]: vars.color.avatar.fg,
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
backgroundColor: vars.color.avatar.bg,
|
|
12
|
+
position: 'relative',
|
|
13
|
+
boxSizing: 'border-box',
|
|
14
|
+
userSelect: 'none',
|
|
15
|
+
boxShadow: `0 0 0 1px ${vars.color.bg}`,
|
|
16
|
+
lineHeight: 0,
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
width: vars.avatar.size,
|
|
19
|
+
height: vars.avatar.size,
|
|
20
|
+
borderRadius: vars.avatar.size,
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
nest: {
|
|
24
23
|
'button&': {
|
|
25
24
|
WebkitFontSmoothing: 'inherit',
|
|
26
25
|
appearance: 'none',
|
|
@@ -33,8 +32,8 @@ const primitive: StyleRules = {
|
|
|
33
32
|
},
|
|
34
33
|
|
|
35
34
|
'button&:focus': {
|
|
36
|
-
outline:
|
|
37
|
-
outlineOffset:
|
|
35
|
+
outline: `${vars.avatar.focusRing.width} solid ${vars.color.focusRing}`,
|
|
36
|
+
outlineOffset: vars.avatar.focusRing.offset,
|
|
38
37
|
},
|
|
39
38
|
|
|
40
39
|
'button&:focus:not(:focus-visible)': {
|
|
@@ -46,7 +45,7 @@ const primitive: StyleRules = {
|
|
|
46
45
|
[varNames.color.avatar.fg]: vars.color.bg,
|
|
47
46
|
},
|
|
48
47
|
|
|
49
|
-
...
|
|
48
|
+
...AVATAR_COLORS.reduce(
|
|
50
49
|
(acc, color) => {
|
|
51
50
|
return {
|
|
52
51
|
...acc,
|
|
@@ -62,18 +61,18 @@ const primitive: StyleRules = {
|
|
|
62
61
|
},
|
|
63
62
|
|
|
64
63
|
'.avatar-arrow': {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
boxSizing: 'border-box',
|
|
66
|
+
zIndex: 0,
|
|
67
|
+
opacity: 0,
|
|
68
|
+
transition: 'all 0.2s linear',
|
|
69
|
+
transform: 'rotate(-90deg) translate3d(0, 6px, 0)',
|
|
70
|
+
left: 0,
|
|
71
|
+
right: 0,
|
|
72
|
+
top: 0,
|
|
73
|
+
bottom: 0,
|
|
74
|
+
|
|
75
|
+
nest: {
|
|
77
76
|
'& > svg': {
|
|
78
77
|
display: 'block',
|
|
79
78
|
width: '11px',
|
|
@@ -102,7 +101,7 @@ const primitive: StyleRules = {
|
|
|
102
101
|
},
|
|
103
102
|
|
|
104
103
|
'.avatar-image': {
|
|
105
|
-
|
|
104
|
+
nest: {
|
|
106
105
|
'& > img': {
|
|
107
106
|
display: 'block',
|
|
108
107
|
position: 'absolute',
|
|
@@ -135,14 +134,14 @@ const primitive: StyleRules = {
|
|
|
135
134
|
},
|
|
136
135
|
|
|
137
136
|
'.avatar-counter': {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
137
|
+
color: vars.color.fg,
|
|
138
|
+
backgroundColor: vars.color.bg,
|
|
139
|
+
boxShadow: [`0 0 0 1px ${vars.color.bg}`, `inset 0 0 0 1px ${vars.color.border}`].join(', '),
|
|
140
|
+
userSelect: 'none',
|
|
141
|
+
borderRadius: vars.avatar.size,
|
|
142
|
+
height: vars.avatar.size,
|
|
143
|
+
|
|
144
|
+
nest: {
|
|
146
145
|
'&&': {
|
|
147
146
|
minWidth: vars.avatar.size,
|
|
148
147
|
},
|
|
@@ -154,7 +153,7 @@ const primitive: StyleRules = {
|
|
|
154
153
|
},
|
|
155
154
|
|
|
156
155
|
'.avatar-stack': {
|
|
157
|
-
|
|
156
|
+
nest: {
|
|
158
157
|
'& > div + div': {
|
|
159
158
|
marginLeft: vars.avatar.distance,
|
|
160
159
|
},
|