@sanity/ui 4.0.0-static.4 → 4.0.0-static.41
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-es/{refractor.js → Refractor.js} +1 -1
- package/dist/_chunks-es/{refractor.js.map → Refractor.js.map} +1 -1
- package/dist/css/index.css +2 -1
- package/dist/css/index.css.map +1 -0
- package/dist/css/index.d.ts +51 -7
- package/dist/css/index.js +17979 -55
- package/dist/css/index.js.map +1 -1
- package/dist/index.d.ts +26 -38
- package/dist/index.js +1752 -1132
- package/dist/index.js.map +1 -1
- package/exports/css/index.css +1 -0
- package/package.json +39 -51
- package/src/core/Root.tsx +1 -1
- package/src/core/RootProvider.tsx +5 -5
- package/src/core/__workshop__/index.ts +1 -1
- package/src/core/components/autocomplete/{autocomplete.tsx → Autocomplete.tsx} +90 -58
- package/src/core/components/autocomplete/__workshop__/{custom.tsx → Custom.tsx} +14 -1
- package/src/core/components/autocomplete/__workshop__/{example.tsx → Example.tsx} +12 -1
- package/src/core/components/autocomplete/__workshop__/index.ts +6 -6
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/{breadcrumbs.tsx → Breadcrumbs.tsx} +80 -47
- package/src/core/components/breadcrumbs/__workshop__/index.ts +1 -1
- package/src/core/components/dialog/{dialog.tsx → Dialog.tsx} +20 -11
- package/src/core/components/dialog/{dialogCard.tsx → DialogCard.tsx} +9 -9
- package/src/core/components/dialog/{dialogContext.ts → DialogContext.ts} +1 -1
- package/src/core/components/dialog/{dialogProvider.tsx → DialogProvider.tsx} +2 -2
- package/src/core/components/dialog/__workshop__/{panes.tsx → Panes.tsx} +9 -21
- package/src/core/components/dialog/__workshop__/{position.tsx → Position.tsx} +9 -1
- package/src/core/components/dialog/__workshop__/{props.tsx → Props.tsx} +2 -0
- package/src/core/components/dialog/__workshop__/index.ts +10 -10
- package/src/core/components/dialog/__workshop__/styles.css.ts +18 -0
- package/src/core/components/dialog/useDialog.ts +3 -3
- package/src/core/components/hotkeys/{hotkeys.tsx → Hotkeys.tsx} +2 -2
- package/src/core/components/hotkeys/__workshop__/index.ts +1 -1
- package/src/core/components/menu/{menu.test.tsx → Menu.test.tsx} +9 -13
- package/src/core/components/menu/{menu.tsx → Menu.tsx} +19 -24
- package/src/core/components/menu/{menuButton.tsx → MenuButton.tsx} +14 -9
- package/src/core/components/menu/{menuContext.ts → MenuContext.ts} +3 -4
- package/src/core/components/menu/{menuGroup.tsx → MenuGroup.tsx} +16 -11
- package/src/core/components/menu/{menuItem.tsx → MenuItem.tsx} +7 -9
- package/src/core/components/menu/__workshop__/DataProps.tsx +27 -0
- package/src/core/components/menu/__workshop__/{menuButton.tsx → MenuButton.tsx} +6 -1
- package/src/core/components/menu/__workshop__/{tones.tsx → Tones.tsx} +7 -1
- package/src/core/components/menu/__workshop__/index.ts +22 -17
- package/src/core/components/menu/useMenu.ts +5 -5
- package/src/core/components/menu/useMenuController.ts +5 -5
- package/src/core/components/tab/{tab.tsx → Tab.tsx} +1 -1
- package/src/core/components/tab/{tabList.tsx → TabList.tsx} +2 -2
- package/src/core/components/tab/{tabPanel.tsx → TabPanel.tsx} +1 -1
- package/src/core/components/tab/__workshop__/index.ts +1 -1
- package/src/core/components/toast/{toast.test.tsx → Toast.test.tsx} +7 -7
- package/src/core/components/toast/{toast.tsx → Toast.tsx} +6 -6
- package/src/core/components/toast/{toastContext.ts → ToastContext.ts} +1 -1
- package/src/core/components/toast/{toastLayer.tsx → ToastLayer.tsx} +1 -1
- package/src/core/components/toast/{toastProvider.tsx → ToastProvider.tsx} +24 -9
- package/src/core/components/toast/__workshop__/{toast.tsx → Toast.tsx} +2 -0
- package/src/core/components/toast/__workshop__/index.ts +2 -2
- package/src/core/components/toast/useToast.ts +3 -3
- package/src/core/components/tree/{tree.tsx → Tree.tsx} +4 -4
- package/src/core/components/tree/{treeContext.ts → TreeContext.ts} +1 -1
- package/src/core/components/tree/{treeGroup.tsx → TreeGroup.tsx} +1 -1
- package/src/core/components/tree/{treeItem.tsx → TreeItem.tsx} +28 -25
- package/src/core/components/tree/__workshop__/index.ts +4 -4
- package/src/core/components/tree/useTree.ts +3 -3
- package/src/core/components/virtualList/{virtualList.tsx → VirtualList.tsx} +87 -45
- package/src/core/components/virtualList/__workshop__/index.ts +4 -4
- package/src/core/helpers/props.ts +0 -9
- package/src/core/hooks/useGlobalKeyDown.ts +11 -4
- package/src/core/hooks/useMediaIndex/__workshop__/index.ts +1 -1
- package/src/core/hooks/useResponsiveProp.ts +4 -17
- package/src/core/index.ts +68 -66
- package/src/core/lib/createGlobalScopedContext.ts +5 -3
- package/src/core/primitives/avatar/{avatar.tsx → Avatar.tsx} +7 -6
- package/src/core/primitives/avatar/{avatarCounter.tsx → AvatarCounter.tsx} +2 -2
- package/src/core/primitives/avatar/{avatarStack.tsx → AvatarStack.tsx} +3 -3
- package/src/core/primitives/avatar/__workshop__/{asButton.tsx → AsButton.tsx} +8 -1
- package/src/core/primitives/avatar/__workshop__/PropsStory.tsx +22 -0
- package/src/core/primitives/avatar/__workshop__/{stack.tsx → Stack.tsx} +5 -1
- package/src/core/primitives/avatar/__workshop__/index.ts +9 -4
- package/src/core/primitives/badge/{badge.test.tsx → Badge.test.tsx} +1 -1
- package/src/core/primitives/badge/{badge.tsx → Badge.tsx} +2 -2
- package/src/core/primitives/badge/__workshop__/{props.tsx → Props.tsx} +12 -1
- package/src/core/primitives/badge/__workshop__/index.ts +2 -2
- package/src/core/primitives/box/__workshop__/{props.tsx → Props.tsx} +6 -1
- package/src/core/primitives/box/__workshop__/index.ts +2 -2
- package/src/core/primitives/button/{button.test.tsx → Button.test.tsx} +1 -1
- package/src/core/primitives/button/{button.tsx → Button.tsx} +12 -11
- package/src/core/primitives/button/__workshop__/DataProps.tsx +22 -0
- package/src/core/primitives/button/__workshop__/{props.tsx → Props.tsx} +22 -0
- package/src/core/primitives/button/__workshop__/SanityUploadButton.tsx +21 -0
- package/src/core/primitives/button/__workshop__/{stacked.tsx → Stacked.tsx} +16 -0
- package/src/core/primitives/button/__workshop__/Styled1.tsx +11 -0
- package/src/core/primitives/button/__workshop__/index.ts +15 -15
- package/src/core/primitives/button/__workshop__/styles.css.ts +30 -0
- package/src/core/primitives/card/{card.tsx → Card.tsx} +10 -10
- package/src/core/primitives/card/{cardContext.ts → CardContext.ts} +1 -1
- package/src/core/primitives/card/{cardProvider.tsx → CardProvider.tsx} +3 -12
- package/src/core/primitives/card/__workshop__/DataProps.tsx +30 -0
- package/src/core/primitives/card/__workshop__/{props.tsx → Props.tsx} +10 -0
- package/src/core/primitives/card/__workshop__/{selected.tsx → Selected.tsx} +1 -1
- package/src/core/primitives/card/__workshop__/{styled.tsx → Styled.tsx} +2 -5
- package/src/core/primitives/card/__workshop__/index.ts +10 -9
- package/src/core/primitives/card/useCard.ts +11 -6
- package/src/core/primitives/checkbox/__workshop__/index.ts +4 -4
- package/src/core/primitives/code/{code.tsx → Code.tsx} +26 -2
- package/src/core/primitives/code/__workshop__/{props.tsx → Props.tsx} +6 -1
- package/src/core/primitives/code/__workshop__/index.ts +2 -2
- package/src/core/primitives/container/{container.tsx → Container.tsx} +1 -1
- package/src/core/primitives/container/__workshop__/{example.tsx → Example.tsx} +6 -1
- package/src/core/primitives/container/__workshop__/index.ts +1 -1
- package/src/core/primitives/flex/{flex.tsx → Flex.tsx} +1 -1
- package/src/core/primitives/flex/__workshop__/{example.tsx → Example.tsx} +14 -16
- package/src/core/primitives/flex/__workshop__/index.ts +2 -2
- package/src/core/primitives/flex/__workshop__/styles.css.ts +12 -0
- package/src/core/primitives/grid/{grid.tsx → Grid.tsx} +1 -1
- package/src/core/primitives/grid/__workshop__/index.ts +1 -1
- package/src/core/primitives/heading/{heading.tsx → Heading.tsx} +16 -0
- package/src/core/primitives/heading/__workshop__/{plain.tsx → Plain.tsx} +12 -1
- package/src/core/primitives/heading/__workshop__/index.ts +2 -2
- package/src/core/primitives/inline/{inline.tsx → Inline.tsx} +2 -1
- package/src/core/primitives/inline/__workshop__/{plain.tsx → Plain.tsx} +5 -1
- package/src/core/primitives/inline/__workshop__/index.ts +1 -1
- package/src/core/primitives/kbd/{kbd.tsx → Kbd.tsx} +2 -2
- package/src/core/primitives/kbd/__workshop__/index.ts +1 -1
- package/src/core/primitives/label/{label.tsx → Label.tsx} +16 -0
- package/src/core/primitives/label/__workshop__/{plain.tsx → Plain.tsx} +15 -1
- package/src/core/primitives/label/__workshop__/index.ts +2 -2
- package/src/core/primitives/layer/{layer.test.tsx → Layer.test.tsx} +7 -7
- package/src/core/primitives/layer/{layer.tsx → Layer.tsx} +3 -3
- package/src/core/primitives/layer/{layerCard.tsx → LayerCard.tsx} +2 -2
- package/src/core/primitives/layer/{layerContext.ts → LayerContext.ts} +1 -1
- package/src/core/primitives/layer/{layerProvider.tsx → LayerProvider.tsx} +6 -6
- package/src/core/primitives/layer/__workshop__/index.ts +3 -3
- package/src/core/primitives/layer/useLayer.ts +3 -3
- package/src/core/primitives/popover/{popover.tsx → Popover.tsx} +170 -150
- package/src/core/primitives/popover/{popoverLayer.tsx → PopoverLayer.tsx} +3 -3
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +13 -1
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +2 -0
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +8 -0
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +7 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +6 -0
- package/src/core/primitives/popover/floating-ui/size.ts +17 -16
- package/src/core/primitives/radio/{radio.tsx → Radio.tsx} +2 -2
- package/src/core/primitives/radio/__workshop__/index.ts +2 -2
- package/src/core/primitives/select/{select.tsx → Select.tsx} +7 -5
- package/src/core/primitives/select/__workshop__/{plain.tsx → Plain.tsx} +4 -0
- package/src/core/primitives/select/__workshop__/index.ts +2 -2
- package/src/core/primitives/selectable/{selectable.tsx → Selectable.tsx} +2 -2
- package/src/core/primitives/selectable/__workshop__/DataProps.tsx +27 -0
- package/src/core/primitives/selectable/__workshop__/index.ts +14 -0
- package/src/core/primitives/skeleton/{codeSkeleton.tsx → CodeSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/{headingSkeleton.tsx → HeadingSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/{labelSkeleton.tsx → LabelSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/{skeleton.tsx → Skeleton.tsx} +2 -2
- package/src/core/primitives/skeleton/{textSkeleton.tsx → TextSkeleton.tsx} +1 -1
- package/src/core/primitives/skeleton/__workshop__/{delay.tsx → Delay.tsx} +9 -1
- package/src/core/primitives/skeleton/__workshop__/{skeleton.tsx → Skeleton.tsx} +9 -1
- package/src/core/primitives/skeleton/__workshop__/index.ts +2 -2
- package/src/core/primitives/spinner/{spinner.tsx → Spinner.tsx} +2 -2
- package/src/core/primitives/spinner/__workshop__/Props.tsx +6 -1
- package/src/core/primitives/stack/{stack.tsx → Stack.tsx} +1 -1
- package/src/core/primitives/stack/__workshop__/{plain.tsx → Plain.tsx} +4 -1
- package/src/core/primitives/stack/__workshop__/index.ts +1 -1
- package/src/core/primitives/switch/{switch.tsx → Switch.tsx} +2 -10
- package/src/core/primitives/switch/__workshop__/index.ts +2 -2
- package/src/core/primitives/text/{text.tsx → Text.tsx} +14 -0
- package/src/core/primitives/text/__workshop__/{colored.tsx → Colored.tsx} +10 -8
- package/src/core/primitives/text/__workshop__/{example.tsx → Example.tsx} +15 -1
- package/src/core/primitives/text/__workshop__/index.ts +3 -3
- package/src/core/primitives/textArea/{textArea.tsx → TextArea.tsx} +7 -1
- package/src/core/primitives/textArea/__workshop__/{plain.tsx → Plain.tsx} +8 -0
- package/src/core/primitives/textArea/__workshop__/index.ts +1 -1
- package/src/core/primitives/textInput/{textInput.tsx → TextInput.tsx} +93 -72
- package/src/core/primitives/textInput/__workshop__/{plain.tsx → Plain.tsx} +34 -4
- package/src/core/primitives/textInput/__workshop__/{typed.tsx → Typed.tsx} +7 -1
- package/src/core/primitives/textInput/__workshop__/index.ts +7 -7
- package/src/core/primitives/tooltip/{tooltip.test.tsx → Tooltip.test.tsx} +4 -4
- package/src/core/primitives/tooltip/{tooltip.tsx → Tooltip.tsx} +102 -63
- package/src/core/primitives/tooltip/{tooltipLayer.tsx → TooltipLayer.tsx} +2 -2
- package/src/core/primitives/tooltip/__workshop__/{customPortal.tsx → CustomPortal.tsx} +2 -0
- package/src/core/primitives/tooltip/__workshop__/{overflowingBoundary.tsx → OverflowingBoundary.tsx} +2 -0
- package/src/core/primitives/tooltip/__workshop__/{props.tsx → Props.tsx} +12 -0
- package/src/core/primitives/tooltip/__workshop__/{resizableBoundary.tsx → ResizableBoundary.tsx} +5 -0
- package/src/core/primitives/tooltip/__workshop__/index.ts +4 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/{tooltipDelayGroupContext.tsx → TooltipDelayGroupContext.tsx} +1 -1
- package/src/core/primitives/tooltip/tooltipDelayGroup/{tooltipDelayGroupProvider.tsx → TooltipDelayGroupProvider.tsx} +2 -4
- package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +3 -3
- package/src/core/types.ts +6 -5
- package/src/core/utils/{errorBoundary.tsx → ErrorBoundary.tsx} +1 -1
- package/src/core/utils/boundaryElement/{boundaryElementContext.ts → BoundaryElementContext.ts} +2 -5
- package/src/core/utils/boundaryElement/BoundaryElementProvider.tsx +16 -0
- package/src/core/utils/boundaryElement/__workshop__/index.ts +1 -1
- package/src/core/utils/boundaryElement/types.ts +1 -4
- package/src/core/utils/boundaryElement/useBoundaryElement.ts +7 -19
- package/src/core/utils/elementQuery/__workshop__/CustomMedia.tsx +19 -0
- package/src/core/utils/elementQuery/__workshop__/index.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/styles.css.ts +31 -0
- package/src/core/utils/portal/{portal.test.tsx → Portal.test.tsx} +7 -7
- package/src/core/utils/portal/{portal.tsx → Portal.tsx} +7 -4
- package/src/core/utils/portal/{portalContext.ts → PortalContext.ts} +1 -1
- package/src/core/utils/portal/PortalProvider.tsx +38 -0
- package/src/core/utils/portal/__workshop__/index.ts +1 -1
- package/src/core/utils/portal/usePortal.ts +12 -5
- package/src/css/_responsiveStyle.css.ts +2 -2
- package/src/css/primitives/_input/_input.css.ts +13 -12
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_input/types.ts +2 -1
- package/src/css/primitives/avatar/avatar.css.ts +17 -5
- package/src/css/primitives/box/box.css.ts +19 -1
- package/src/css/primitives/button/button.css.ts +252 -183
- package/src/css/primitives/card/__workshop__/{color.tsx → Color.tsx} +9 -1
- package/src/css/primitives/card/__workshop__/index.ts +1 -1
- package/src/css/primitives/card/card.css.ts +133 -130
- package/src/css/primitives/checkbox/checkbox.css.ts +1 -0
- package/src/css/primitives/code/code.ts +4 -0
- package/src/css/primitives/code/types.ts +7 -1
- package/src/css/primitives/heading/heading.ts +4 -0
- package/src/css/primitives/heading/types.ts +7 -1
- package/src/css/primitives/label/label.ts +4 -0
- package/src/css/primitives/label/types.ts +7 -1
- package/src/css/primitives/radio/radio.css.ts +1 -1
- package/src/css/primitives/root/root.css.ts +1 -1
- package/src/css/primitives/select/select.css.ts +7 -1
- package/src/css/primitives/selectable/selectable.css.ts +79 -70
- package/src/css/primitives/switch/switch.css.ts +10 -1
- package/src/css/primitives/text/text.ts +2 -0
- package/src/css/primitives/text/types.ts +6 -1
- package/src/css/primitives/textInput/textInput.css.ts +15 -3
- package/src/css/props/width/types.ts +1 -1
- package/src/css/props/width/width.css.ts +5 -2
- package/src/css/theme/buildCSSTheme.ts +4 -0
- package/src/css/types.ts +4 -0
- package/src/css/vars.css.ts +4 -0
- package/dist/_chunks-cjs/refractor.cjs +0 -22
- package/dist/_chunks-cjs/refractor.cjs.map +0 -1
- package/dist/css/index.cjs +0 -966
- package/dist/css/index.cjs.map +0 -1
- package/dist/css/index.d.cts +0 -1370
- package/dist/index.cjs +0 -4515
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -2521
- package/dist/theme.cjs +0 -870
- package/dist/theme.cjs.map +0 -1
- package/dist/theme.d.cts +0 -499
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
- package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
- package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
- package/src/core/primitives/popover/helpers.ts +0 -32
- package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
- package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -102
- package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -18
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -41
- package/src/core/utils/portal/portalProvider.tsx +0 -70
- /package/src/core/__workshop__/{boundary.tsx → Boundary.tsx} +0 -0
- /package/src/core/components/autocomplete/{autocompleteOption.tsx → AutocompleteOption.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{async.tsx → Async.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{constrainedHeight.tsx → ConstrainedHeight.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{focusAndBlur.tsx → FocusAndBlur.tsx} +0 -0
- /package/src/core/components/autocomplete/__workshop__/{fullscreen.tsx → Fullscreen.tsx} +0 -0
- /package/src/core/components/breadcrumbs/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{activate.tsx → Activate.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{autoFocus.tsx → AutoFocus.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{layering.tsx → Layering.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{nested.tsx → Nested.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{onScroll.tsx → OnScroll.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{provider.tsx → Provider.tsx} +0 -0
- /package/src/core/components/dialog/__workshop__/{wrapped.tsx → Wrapped.tsx} +0 -0
- /package/src/core/components/hotkeys/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/components/menu/{menuDivider.tsx → MenuDivider.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{asComponent.tsx → AsComponent.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{avatarMenu.tsx → AvatarMenu.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{closableMenuButton.tsx → ClosableMenuButton.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{constrainedInBoundary.tsx → ConstrainedInBoundary.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{customMenuItem.tsx → CustomMenuItem.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{customSelectedState.tsx → CustomSelectedState.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{disableFocusOnClose.tsx → DisableFocusOnClose.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{groups.tsx → Groups.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{menuGroupRight.tsx → MenuGroupRight.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{nestedMenu.tsx → NestedMenu.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{onCloseMenuButton.tsx → OnCloseMenuButton.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{selectedItem.tsx → SelectedItem.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{shouldFocus.tsx → ShouldFocus.tsx} +0 -0
- /package/src/core/components/menu/__workshop__/{withoutArrow.tsx → WithoutArrow.tsx} +0 -0
- /package/src/core/components/tab/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/components/toast/__workshop__/{hook.tsx → Hook.tsx} +0 -0
- /package/src/core/components/tree/__workshop__/{basic.tsx → Basic.tsx} +0 -0
- /package/src/core/components/tree/__workshop__/{tabFromElement.tsx → TabFromElement.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{changingProps.tsx → ChangingProps.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{elementScroll.tsx → ElementScroll.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{infiniteList.tsx → InfiniteList.tsx} +0 -0
- /package/src/core/components/virtualList/__workshop__/{windowScrolll.tsx → WindowScrolll.tsx} +0 -0
- /package/src/core/hooks/useMediaIndex/__workshop__/{test.tsx → Test.tsx} +0 -0
- /package/src/core/primitives/arrow/{arrow.tsx → Arrow.tsx} +0 -0
- /package/src/core/primitives/avatar/__workshop__/{withinButton.tsx → WithinButton.tsx} +0 -0
- /package/src/core/primitives/avatar/__workshop__/{withinMenuItem.tsx → WithinMenuItem.tsx} +0 -0
- /package/src/core/primitives/badge/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/primitives/box/{box.tsx → Box.tsx} +0 -0
- /package/src/core/primitives/box/__workshop__/{responsive.tsx → Responsive.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{custom.tsx → Custom.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{customIcons.tsx → CustomIcons.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{disabled.tsx → Disabled.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{mixedChildren.tsx → MixedChildren.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{textOverflow.tsx → TextOverflow.tsx} +0 -0
- /package/src/core/primitives/button/__workshop__/{uploadButton.tsx → UploadButton.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{asButton.tsx → AsButton.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{asComponent.tsx → AsComponent.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{checkered.tsx → Checkered.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{interactive.tsx → Interactive.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{listNavigation.tsx → ListNavigation.tsx} +0 -0
- /package/src/core/primitives/card/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/primitives/checkbox/{checkbox.tsx → Checkbox.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{props.tsx → Props.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
- /package/src/core/primitives/checkbox/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/primitives/code/{refractor.tsx → Refractor.tsx} +0 -0
- /package/src/core/primitives/code/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/flex/__workshop__/{gap.tsx → Gap.tsx} +0 -0
- /package/src/core/primitives/grid/__workshop__/{responsive.tsx → Responsive.tsx} +0 -0
- /package/src/core/primitives/heading/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/kbd/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/primitives/label/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/layer/__workshop__/{multipleRoots.tsx → MultipleRoots.tsx} +0 -0
- /package/src/core/primitives/layer/__workshop__/{nested.tsx → Nested.tsx} +0 -0
- /package/src/core/primitives/layer/__workshop__/{responsiveZOffset.tsx → ResponsiveZOffset.tsx} +0 -0
- /package/src/core/primitives/radio/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/primitives/radio/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/primitives/select/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
- /package/src/core/primitives/spinner/{animatedSpinnerIcon.tsx → AnimatedSpinnerIcon.tsx} +0 -0
- /package/src/core/primitives/srOnly/{srOnly.tsx → SrOnly.tsx} +0 -0
- /package/src/core/primitives/switch/__workshop__/{example.tsx → Example.tsx} +0 -0
- /package/src/core/primitives/switch/__workshop__/{props.tsx → Props.tsx} +0 -0
- /package/src/core/primitives/text/__workshop__/{opticalAlignment.tsx → OpticalAlignment.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{clearButton.tsx → ClearButton.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{customValidity.tsx → CustomValidity.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{readOnly.tsx → ReadOnly.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{states.tsx → States.tsx} +0 -0
- /package/src/core/primitives/textInput/__workshop__/{tones.tsx → Tones.tsx} +0 -0
- /package/src/core/utils/boundaryElement/__workshop__/{plain.tsx → Plain.tsx} +0 -0
- /package/src/core/utils/elementQuery/{elementQuery.tsx → ElementQuery.tsx} +0 -0
- /package/src/core/utils/portal/__workshop__/{named.tsx → Named.tsx} +0 -0
|
@@ -15,15 +15,8 @@ import {_style} from '../../_style.css'
|
|
|
15
15
|
import {layers} from '../../layers.css'
|
|
16
16
|
import {vars} from '../../vars.css'
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color: vars.color.fg,
|
|
21
|
-
|
|
22
|
-
//
|
|
23
|
-
transition:
|
|
24
|
-
'background-color 100ms ease-in-out, border-color 100ms, box-shadow 100ms ease-in-out, color 100ms ease-in-out',
|
|
25
|
-
|
|
26
|
-
vars: {
|
|
18
|
+
const stateVars = {
|
|
19
|
+
enabled: {
|
|
27
20
|
[vars.color.bg]: vars.color.tinted.default.bg[0],
|
|
28
21
|
[vars.color.border]: vars.color.tinted.default.border[1],
|
|
29
22
|
[vars.color.fg]: vars.color.tinted.default.fg[0],
|
|
@@ -32,18 +25,90 @@ export const root: string = _style(layers.primitives, {
|
|
|
32
25
|
[vars.color.muted.fg]: vars.color.tinted.default.fg[4],
|
|
33
26
|
},
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
hovered: {
|
|
29
|
+
[vars.color.bg]: vars.color.tinted.default.bg[1],
|
|
30
|
+
[vars.color.border]: vars.color.tinted.default.border[3],
|
|
31
|
+
[vars.color.fg]: vars.color.tinted.default.fg[1],
|
|
32
|
+
[vars.color.code.bg]: vars.color.tinted.default.bg[2],
|
|
33
|
+
[vars.color.code.fg]: vars.color.tinted.default.fg[4],
|
|
34
|
+
[vars.color.muted.bg]: vars.color.tinted.default.bg[2],
|
|
35
|
+
[vars.color.muted.fg]: vars.color.tinted.default.fg[4],
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
pressed: {
|
|
39
|
+
[vars.color.bg]: vars.color.tinted.default.bg[2],
|
|
40
|
+
[vars.color.border]: vars.color.tinted.default.border[4],
|
|
41
|
+
[vars.color.fg]: vars.color.tinted.default.fg[0],
|
|
42
|
+
[vars.color.code.bg]: vars.color.tinted.default.bg[3],
|
|
43
|
+
[vars.color.code.fg]: vars.color.tinted.default.fg[4],
|
|
44
|
+
[vars.color.muted.bg]: vars.color.tinted.default.bg[3],
|
|
45
|
+
[vars.color.muted.fg]: vars.color.tinted.default.fg[4],
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
selected: {
|
|
49
|
+
[vars.color.bg]: vars.color.solid.primary.bg[0],
|
|
50
|
+
[vars.color.border]: vars.color.solid.primary.border[1],
|
|
51
|
+
[vars.color.fg]: vars.color.solid.primary.fg[0],
|
|
52
|
+
[vars.color.code.bg]: vars.color.solid.primary.bg[1],
|
|
53
|
+
[vars.color.code.fg]: vars.color.solid.primary.fg[3],
|
|
54
|
+
[vars.color.muted.bg]: vars.color.solid.primary.bg[1],
|
|
55
|
+
[vars.color.muted.fg]: vars.color.solid.primary.fg[3],
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
disabled: {
|
|
59
|
+
[vars.color.bg]: vars.color.tinted.default.bg[0],
|
|
60
|
+
[vars.color.border]: vars.color.tinted.default.border[1],
|
|
61
|
+
[vars.color.fg]: vars.color.tinted.default.border[3],
|
|
62
|
+
[vars.color.code.bg]: vars.color.tinted.default.bg[0],
|
|
63
|
+
[vars.color.code.fg]: vars.color.tinted.default.border[2],
|
|
64
|
+
[vars.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
65
|
+
[vars.color.muted.fg]: vars.color.tinted.default.border[2],
|
|
66
|
+
},
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const root: string = _style(layers.primitives, {
|
|
70
|
+
'backgroundColor': vars.color.bg,
|
|
71
|
+
'color': vars.color.fg,
|
|
72
|
+
|
|
73
|
+
'vars': stateVars.enabled,
|
|
74
|
+
|
|
75
|
+
'@media': {
|
|
76
|
+
'(hover: hover)': {
|
|
77
|
+
selectors: {
|
|
78
|
+
[[
|
|
79
|
+
'a.&',
|
|
80
|
+
':not(:active)',
|
|
81
|
+
':not(:focus)',
|
|
82
|
+
':not(:disabled)',
|
|
83
|
+
':not([aria-pressed="true"])',
|
|
84
|
+
':not([data-pressed])',
|
|
85
|
+
':not([data-focused])',
|
|
86
|
+
':not([data-selected])',
|
|
87
|
+
':not([data-disabled])',
|
|
88
|
+
':hover',
|
|
89
|
+
].join('')]: {
|
|
90
|
+
vars: stateVars.hovered,
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
[[
|
|
94
|
+
'button.&',
|
|
95
|
+
':not(:active)',
|
|
96
|
+
':not(:focus)',
|
|
97
|
+
':not(:disabled)',
|
|
98
|
+
':not([aria-pressed="true"])',
|
|
99
|
+
':not([data-pressed])',
|
|
100
|
+
':not([data-focused])',
|
|
101
|
+
':not([data-selected])',
|
|
102
|
+
':not([data-disabled])',
|
|
103
|
+
':hover',
|
|
104
|
+
].join('')]: {
|
|
105
|
+
vars: stateVars.hovered,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
45
108
|
},
|
|
109
|
+
},
|
|
46
110
|
|
|
111
|
+
'selectors': {
|
|
47
112
|
'a.&': {
|
|
48
113
|
outline: 'none',
|
|
49
114
|
textDecoration: 'none',
|
|
@@ -61,78 +126,64 @@ export const root: string = _style(layers.primitives, {
|
|
|
61
126
|
`repeating-conic-gradient(${vars.color.bg} 0% 25%, ${vars.color.muted.bg} 0% 50%)` as string,
|
|
62
127
|
},
|
|
63
128
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
[vars.color.muted.bg]: vars.color.tinted.default.bg[2],
|
|
72
|
-
[vars.color.muted.fg]: vars.color.tinted.default.fg[4],
|
|
73
|
-
},
|
|
129
|
+
// hovered
|
|
130
|
+
[[
|
|
131
|
+
//
|
|
132
|
+
'a.&:not([data-disabled])[data-hovered]',
|
|
133
|
+
'button.&:not([data-disabled])[data-hovered]',
|
|
134
|
+
].join(',')]: {
|
|
135
|
+
vars: stateVars.hovered,
|
|
74
136
|
},
|
|
75
137
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
138
|
+
// pressed
|
|
139
|
+
[[
|
|
140
|
+
'a.&:not([data-disabled]):active',
|
|
141
|
+
'button.&:not([data-disabled]):active',
|
|
142
|
+
'a.&:not([data-disabled])[aria-pressed="true"]',
|
|
143
|
+
'button.&:not([data-disabled])[aria-pressed="true"]',
|
|
144
|
+
'a.&:not([data-disabled])[data-pressed]',
|
|
145
|
+
'button.&:not([data-disabled])[data-pressed]',
|
|
146
|
+
].join(',')]: {
|
|
147
|
+
vars: stateVars.pressed,
|
|
86
148
|
},
|
|
87
149
|
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
[vars.color.code.fg]: vars.color.tinted.default.fg[4],
|
|
97
|
-
[vars.color.muted.bg]: vars.color.tinted.default.bg[3],
|
|
98
|
-
[vars.color.muted.fg]: vars.color.tinted.default.fg[4],
|
|
99
|
-
},
|
|
100
|
-
},
|
|
150
|
+
// selected
|
|
151
|
+
[[
|
|
152
|
+
//
|
|
153
|
+
'a.&:not([data-disabled])[data-selected]',
|
|
154
|
+
'button.&:not([data-disabled])[data-selected]',
|
|
155
|
+
].join(',')]: {
|
|
156
|
+
vars: stateVars.selected,
|
|
157
|
+
},
|
|
101
158
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
159
|
+
// disabled
|
|
160
|
+
[[
|
|
161
|
+
//
|
|
162
|
+
'a.&:disabled',
|
|
163
|
+
'a.&[data-disabled]',
|
|
164
|
+
'button.&:disabled',
|
|
165
|
+
'button.&[data-disabled]',
|
|
166
|
+
].join(',')]: {
|
|
167
|
+
vars: stateVars.disabled,
|
|
112
168
|
},
|
|
113
169
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
[vars.color.muted.fg]: vars.color.solid.primary.fg[3],
|
|
123
|
-
},
|
|
170
|
+
// focus ring
|
|
171
|
+
[[
|
|
172
|
+
//
|
|
173
|
+
'a.&[data-focus-ring]:focus',
|
|
174
|
+
'button.&[data-focus-ring]:focus',
|
|
175
|
+
].join(',')]: {
|
|
176
|
+
outline: `${vars.card.focusRing.width} solid ${vars.color.focusRing}`,
|
|
177
|
+
outlineOffset: vars.card.focusRing.offset,
|
|
124
178
|
},
|
|
125
179
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
[vars.color.muted.bg]: vars.color.tinted.default.bg[1],
|
|
134
|
-
[vars.color.muted.fg]: vars.color.tinted.default.border[2],
|
|
135
|
-
},
|
|
180
|
+
// focus ring - not focus visible
|
|
181
|
+
[[
|
|
182
|
+
//
|
|
183
|
+
'a.&[data-focus-ring]:focus:not(:focus-visible)',
|
|
184
|
+
'button.&[data-focus-ring]:focus:not(:focus-visible)',
|
|
185
|
+
].join(',')]: {
|
|
186
|
+
outline: 'none',
|
|
136
187
|
},
|
|
137
188
|
},
|
|
138
189
|
})
|
|
@@ -333,54 +384,6 @@ function buildToneRule(tone: CardTone): StyleRule {
|
|
|
333
384
|
}
|
|
334
385
|
}
|
|
335
386
|
|
|
336
|
-
// assign legacy vars
|
|
337
|
-
// todo: remove before release?
|
|
338
|
-
_assign(toneVars, {
|
|
339
|
-
'--card-accent-fg-color': vars.color.tinted.suggest.fg[4],
|
|
340
|
-
})
|
|
341
|
-
for (const color of AVATAR_COLORS) {
|
|
342
|
-
_assign(toneVars, {
|
|
343
|
-
[`--card-avatar-${color}-bg-color`]: vars.color.avatar[color].bg,
|
|
344
|
-
[`--card-avatar-${color}-fg-color`]: vars.color.avatar[color].fg,
|
|
345
|
-
})
|
|
346
|
-
}
|
|
347
|
-
_assign(toneVars, {
|
|
348
|
-
'--card-backdrop-color': vars.color.backdrop,
|
|
349
|
-
})
|
|
350
|
-
for (const tone of ELEMENT_TONES) {
|
|
351
|
-
_assign(toneVars, {
|
|
352
|
-
[`--card-badge-${tone}-bg-color`]: vars.color.tinted[tone].bg[1],
|
|
353
|
-
[`--card-badge-${tone}-dot-color`]: vars.color.tinted[tone].fg[4],
|
|
354
|
-
[`--card-badge-${tone}-fg-color`]: vars.color.tinted[tone].fg[2],
|
|
355
|
-
[`--card-badge-${tone}-icon-color`]: vars.color.tinted[tone].fg[4],
|
|
356
|
-
})
|
|
357
|
-
}
|
|
358
|
-
_assign(toneVars, {
|
|
359
|
-
'--card-bg-color': vars.color.bg,
|
|
360
|
-
'--card-bg2-color': vars.color.muted.bg,
|
|
361
|
-
'--card-border-color': vars.color.border,
|
|
362
|
-
'--card-code-bg-color': vars.color.code.bg,
|
|
363
|
-
'--card-code-fg-color': vars.color.code.fg,
|
|
364
|
-
'--card-fg-color': vars.color.fg,
|
|
365
|
-
'--card-focus-ring-color': vars.color.focusRing,
|
|
366
|
-
'--card-hairline-soft-color': vars.color.tinted.default.border[1],
|
|
367
|
-
'--card-hairline-hard-color': vars.color.tinted.default.border[2],
|
|
368
|
-
'--card-icon-color': vars.color.fg,
|
|
369
|
-
'--card-kbd-bg-color': vars.color.muted.bg,
|
|
370
|
-
'--card-kbd-border-color': vars.color.tinted.default.border[1],
|
|
371
|
-
'--card-kbd-fg-color': vars.color.muted.fg,
|
|
372
|
-
'--card-link-color': vars.color.link.fg,
|
|
373
|
-
'--card-link-fg-color': vars.color.link.fg,
|
|
374
|
-
'--card-muted-bg-color': vars.color.muted.bg,
|
|
375
|
-
'--card-muted-fg-color': vars.color.muted.fg,
|
|
376
|
-
'--card-shadow-outline-color': vars.color.shadow.outline,
|
|
377
|
-
'--card-shadow-umbra-color': vars.color.shadow.umbra,
|
|
378
|
-
'--card-shadow-penumbra-color': vars.color.shadow.penumbra,
|
|
379
|
-
'--card-shadow-ambient-color': vars.color.shadow.ambient,
|
|
380
|
-
'--card-skeleton-from-color': vars.color.skeleton.from,
|
|
381
|
-
'--card-skeleton-to-color': vars.color.skeleton.to,
|
|
382
|
-
})
|
|
383
|
-
|
|
384
387
|
return {
|
|
385
388
|
vars: toneVars,
|
|
386
389
|
}
|
|
@@ -3,6 +3,8 @@ import {_responsiveClassName} from '../../_responsiveClassName'
|
|
|
3
3
|
import {display} from '../../props/display/display'
|
|
4
4
|
import {flex} from '../../props/flex/flex'
|
|
5
5
|
import {font} from '../../props/font/font'
|
|
6
|
+
import {margin} from '../../props/margin/margin'
|
|
7
|
+
import {maxWidth} from '../../props/maxWidth/maxWidth'
|
|
6
8
|
import {root, scale} from './code.css'
|
|
7
9
|
import type {CodeStyleProps} from './types'
|
|
8
10
|
|
|
@@ -15,5 +17,7 @@ export function code(props: CodeStyleProps): string | undefined {
|
|
|
15
17
|
display({display: 'block'}),
|
|
16
18
|
flex(props),
|
|
17
19
|
font(props),
|
|
20
|
+
margin(props),
|
|
21
|
+
maxWidth(props),
|
|
18
22
|
)
|
|
19
23
|
}
|
|
@@ -2,10 +2,16 @@ import type {FontCodeSize} from '@sanity/ui/theme'
|
|
|
2
2
|
|
|
3
3
|
import type {FlexStyleProps} from '../../props/flex/types'
|
|
4
4
|
import type {FontStyleProps} from '../../props/font/types'
|
|
5
|
+
import type {MarginStyleProps} from '../../props/margin/types'
|
|
6
|
+
import type {MaxWidthStyleProps} from '../../props/maxWidth/types'
|
|
5
7
|
import type {ResponsiveProp} from '../../types'
|
|
6
8
|
|
|
7
9
|
/** @public */
|
|
8
|
-
export interface CodeStyleProps
|
|
10
|
+
export interface CodeStyleProps
|
|
11
|
+
extends FlexStyleProps,
|
|
12
|
+
Omit<FontStyleProps, 'align'>,
|
|
13
|
+
MarginStyleProps,
|
|
14
|
+
MaxWidthStyleProps {
|
|
9
15
|
className?: string
|
|
10
16
|
size?: ResponsiveProp<FontCodeSize>
|
|
11
17
|
}
|
|
@@ -3,6 +3,8 @@ import {_responsiveClassName} from '../../_responsiveClassName'
|
|
|
3
3
|
import {display} from '../../props/display/display'
|
|
4
4
|
import {flex} from '../../props/flex/flex'
|
|
5
5
|
import {font} from '../../props/font/font'
|
|
6
|
+
import {margin} from '../../props/margin/margin'
|
|
7
|
+
import {maxWidth} from '../../props/maxWidth/maxWidth'
|
|
6
8
|
import {textAlign} from '../../props/textAlign/textAlign'
|
|
7
9
|
import {muted, root, sizes} from './heading.css'
|
|
8
10
|
import type {HeadingStyleProps} from './types'
|
|
@@ -17,6 +19,8 @@ export function heading(props: HeadingStyleProps): string | undefined {
|
|
|
17
19
|
display({display: 'block'}),
|
|
18
20
|
flex(props),
|
|
19
21
|
font(props),
|
|
22
|
+
margin(props),
|
|
23
|
+
maxWidth(props),
|
|
20
24
|
textAlign({textAlign: props.align}),
|
|
21
25
|
)
|
|
22
26
|
}
|
|
@@ -2,11 +2,17 @@ import type {FontHeadingSize} from '@sanity/ui/theme'
|
|
|
2
2
|
|
|
3
3
|
import type {FlexStyleProps} from '../../props/flex/types'
|
|
4
4
|
import type {FontStyleProps} from '../../props/font/types'
|
|
5
|
+
import type {MarginStyleProps} from '../../props/margin/types'
|
|
6
|
+
import type {MaxWidthStyleProps} from '../../props/maxWidth/types'
|
|
5
7
|
import type {TextAlignStyleProps} from '../../props/textAlign/types'
|
|
6
8
|
import type {ResponsiveProp} from '../../types'
|
|
7
9
|
|
|
8
10
|
/** @public */
|
|
9
|
-
export interface HeadingStyleProps
|
|
11
|
+
export interface HeadingStyleProps
|
|
12
|
+
extends FontStyleProps,
|
|
13
|
+
FlexStyleProps,
|
|
14
|
+
MarginStyleProps,
|
|
15
|
+
MaxWidthStyleProps {
|
|
10
16
|
align?: TextAlignStyleProps['textAlign']
|
|
11
17
|
className?: string
|
|
12
18
|
muted?: boolean
|
|
@@ -3,6 +3,8 @@ import {_responsiveClassName} from '../../_responsiveClassName'
|
|
|
3
3
|
import {display} from '../../props/display/display'
|
|
4
4
|
import {flex} from '../../props/flex/flex'
|
|
5
5
|
import {font} from '../../props/font/font'
|
|
6
|
+
import {margin} from '../../props/margin/margin'
|
|
7
|
+
import {maxWidth} from '../../props/maxWidth/maxWidth'
|
|
6
8
|
import {textAlign} from '../../props/textAlign/textAlign'
|
|
7
9
|
import {muted, root, sizes} from './label.css'
|
|
8
10
|
import type {LabelStyleProps} from './types'
|
|
@@ -17,6 +19,8 @@ export function label(props: LabelStyleProps): string | undefined {
|
|
|
17
19
|
display({display: 'block'}),
|
|
18
20
|
flex(props),
|
|
19
21
|
font(props),
|
|
22
|
+
margin(props),
|
|
23
|
+
maxWidth(props),
|
|
20
24
|
textAlign({textAlign: props.align}),
|
|
21
25
|
)
|
|
22
26
|
}
|
|
@@ -2,11 +2,17 @@ import type {FontLabelSize} from '@sanity/ui/theme'
|
|
|
2
2
|
|
|
3
3
|
import type {FlexStyleProps} from '../../props/flex/types'
|
|
4
4
|
import type {FontStyleProps} from '../../props/font/types'
|
|
5
|
+
import type {MarginStyleProps} from '../../props/margin/types'
|
|
6
|
+
import type {MaxWidthStyleProps} from '../../props/maxWidth/types'
|
|
5
7
|
import type {TextAlignStyleProps} from '../../props/textAlign/types'
|
|
6
8
|
import type {ResponsiveProp} from '../../types'
|
|
7
9
|
|
|
8
10
|
/** @public */
|
|
9
|
-
export interface LabelStyleProps
|
|
11
|
+
export interface LabelStyleProps
|
|
12
|
+
extends FlexStyleProps,
|
|
13
|
+
FontStyleProps,
|
|
14
|
+
MarginStyleProps,
|
|
15
|
+
MaxWidthStyleProps {
|
|
10
16
|
align?: TextAlignStyleProps['textAlign']
|
|
11
17
|
className?: string
|
|
12
18
|
muted?: boolean
|
|
@@ -2,8 +2,8 @@ import {_style} from '../../_style.css'
|
|
|
2
2
|
import {layers} from '../../layers.css'
|
|
3
3
|
|
|
4
4
|
export const _root: string = _style(layers.primitives, {
|
|
5
|
+
containerType: 'inline-size',
|
|
5
6
|
WebkitFontSmoothing: 'antialiased',
|
|
6
|
-
// minWidth: `${320 / 16}rem`, // 320px
|
|
7
7
|
|
|
8
8
|
selectors: {
|
|
9
9
|
'html.&': {
|
|
@@ -3,7 +3,13 @@ import {globalStyle} from '@vanilla-extract/css'
|
|
|
3
3
|
import {_style} from '../../_style.css'
|
|
4
4
|
import {layers} from '../../layers.css'
|
|
5
5
|
|
|
6
|
-
export const root: string = _style(layers.primitives, {
|
|
6
|
+
export const root: string = _style(layers.primitives, {
|
|
7
|
+
selectors: {
|
|
8
|
+
'&:not([hidden])': {
|
|
9
|
+
display: 'block',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
})
|
|
7
13
|
|
|
8
14
|
export const input: string = _style(layers.primitives, {
|
|
9
15
|
':disabled': {
|
|
@@ -35,93 +35,102 @@ export const tones: Record<ElementTone, string> = {
|
|
|
35
35
|
const focused = vars.color.solid.primary
|
|
36
36
|
const disabled = vars.color.tinted.default
|
|
37
37
|
|
|
38
|
+
const stateVars = {
|
|
39
|
+
enabled: {
|
|
40
|
+
[vars.color.bg]: tinted.bg[0],
|
|
41
|
+
[vars.color.border]: tinted.border[1],
|
|
42
|
+
[vars.color.fg]: tinted.fg[2],
|
|
43
|
+
[vars.color.muted.bg]: tinted.bg[1],
|
|
44
|
+
[vars.color.muted.fg]: tinted.fg[3],
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
hovered: {
|
|
48
|
+
[vars.color.bg]: tinted.bg[1],
|
|
49
|
+
[vars.color.border]: tinted.border[2],
|
|
50
|
+
[vars.color.fg]: tinted.fg[1],
|
|
51
|
+
[vars.color.muted.bg]: tinted.bg[2],
|
|
52
|
+
[vars.color.muted.fg]: tinted.fg[4],
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
pressed: {
|
|
56
|
+
[vars.color.bg]: tinted.bg[2],
|
|
57
|
+
[vars.color.border]: tinted.border[4],
|
|
58
|
+
[vars.color.fg]: tinted.fg[0],
|
|
59
|
+
[vars.color.muted.bg]: tinted.bg[3],
|
|
60
|
+
[vars.color.muted.fg]: tinted.fg[4],
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
focused: {
|
|
64
|
+
[vars.color.bg]: focused.bg[0],
|
|
65
|
+
[vars.color.border]: focused.border[1],
|
|
66
|
+
[vars.color.fg]: focused.fg[0],
|
|
67
|
+
[vars.color.muted.bg]: focused.bg[1],
|
|
68
|
+
[vars.color.muted.fg]: focused.fg[3],
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
disabled: {
|
|
72
|
+
[vars.color.bg]: disabled.bg[0],
|
|
73
|
+
[vars.color.border]: disabled.border[1],
|
|
74
|
+
[vars.color.fg]: disabled.border[4],
|
|
75
|
+
[vars.color.muted.bg]: disabled.bg[1],
|
|
76
|
+
[vars.color.muted.fg]: disabled.border[4],
|
|
77
|
+
},
|
|
78
|
+
} as const
|
|
79
|
+
|
|
38
80
|
return [
|
|
39
81
|
t,
|
|
40
82
|
_style(layers.primitives, {
|
|
41
|
-
'vars':
|
|
42
|
-
[vars.color.bg]: tinted.bg[0],
|
|
43
|
-
[vars.color.border]: tinted.border[1],
|
|
44
|
-
[vars.color.fg]: tinted.fg[2],
|
|
45
|
-
},
|
|
83
|
+
'vars': stateVars.enabled,
|
|
46
84
|
|
|
47
85
|
'@media': {
|
|
48
86
|
'(hover: hover)': {
|
|
49
87
|
selectors: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
// [vars.color.muted.bg]: tinted.bg[2],
|
|
65
|
-
// [vars.color.muted.fg]: tinted.fg[4],
|
|
66
|
-
// },
|
|
67
|
-
// },
|
|
88
|
+
[[
|
|
89
|
+
'&',
|
|
90
|
+
':not(:active)',
|
|
91
|
+
':not(:focus)',
|
|
92
|
+
':not(:disabled)',
|
|
93
|
+
':not([aria-pressed="true"])',
|
|
94
|
+
':not([data-pressed])',
|
|
95
|
+
':not([data-focused])',
|
|
96
|
+
':not([data-selected])',
|
|
97
|
+
':not([data-disabled])',
|
|
98
|
+
':hover',
|
|
99
|
+
].join('')]: {
|
|
100
|
+
vars: stateVars.hovered,
|
|
101
|
+
},
|
|
68
102
|
},
|
|
69
103
|
},
|
|
70
104
|
},
|
|
71
105
|
|
|
72
106
|
'selectors': {
|
|
73
|
-
//
|
|
74
|
-
'&:not([data-disabled])
|
|
75
|
-
|
|
76
|
-
vars: {
|
|
77
|
-
[vars.color.bg]: tinted.bg[2],
|
|
78
|
-
[vars.color.border]: tinted.border[4],
|
|
79
|
-
[vars.color.fg]: tinted.fg[0],
|
|
80
|
-
[vars.color.muted.bg]: tinted.bg[3],
|
|
81
|
-
[vars.color.muted.fg]: tinted.fg[4],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
// focused
|
|
86
|
-
'&:not([data-disabled]):focus': {
|
|
87
|
-
vars: {
|
|
88
|
-
[vars.color.bg]: focused.bg[0],
|
|
89
|
-
[vars.color.border]: focused.border[1],
|
|
90
|
-
[vars.color.fg]: focused.fg[0],
|
|
91
|
-
[vars.color.muted.bg]: focused.bg[1],
|
|
92
|
-
[vars.color.muted.fg]: focused.fg[3],
|
|
93
|
-
},
|
|
107
|
+
// hovered
|
|
108
|
+
[['&:not([data-disabled])[data-hovered]'].join(',')]: {
|
|
109
|
+
vars: stateVars.hovered,
|
|
94
110
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
|
|
112
|
+
// pressed
|
|
113
|
+
[[
|
|
114
|
+
'&:not([data-disabled]):active',
|
|
115
|
+
'&:not([data-disabled])[aria-pressed="true"]',
|
|
116
|
+
'&:not([data-disabled])[data-pressed]',
|
|
117
|
+
].join(',')]: {
|
|
118
|
+
vars: stateVars.pressed,
|
|
103
119
|
},
|
|
104
120
|
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// },
|
|
121
|
+
// focused
|
|
122
|
+
// selected
|
|
123
|
+
[[
|
|
124
|
+
'&:not([data-disabled]):focus',
|
|
125
|
+
'&:not([data-disabled])[data-focused]',
|
|
126
|
+
'&:not([data-disabled])[data-selected]',
|
|
127
|
+
].join(',')]: {
|
|
128
|
+
vars: stateVars.focused,
|
|
129
|
+
},
|
|
115
130
|
|
|
116
131
|
// disabled
|
|
117
|
-
'&[data-disabled]': {
|
|
118
|
-
vars:
|
|
119
|
-
[vars.color.bg]: disabled.bg[0],
|
|
120
|
-
[vars.color.border]: disabled.border[1],
|
|
121
|
-
[vars.color.fg]: disabled.border[4],
|
|
122
|
-
[vars.color.muted.bg]: disabled.bg[1],
|
|
123
|
-
[vars.color.muted.fg]: disabled.border[4],
|
|
124
|
-
},
|
|
132
|
+
[['&:disabled', '&[data-disabled]'].join(',')]: {
|
|
133
|
+
vars: stateVars.disabled,
|
|
125
134
|
},
|
|
126
135
|
},
|
|
127
136
|
}),
|
|
@@ -2,7 +2,16 @@ import {_style} from '../../_style.css'
|
|
|
2
2
|
import {layers} from '../../layers.css'
|
|
3
3
|
import {vars} from '../../vars.css'
|
|
4
4
|
|
|
5
|
-
export const root: string = _style(layers.primitives, {
|
|
5
|
+
export const root: string = _style(layers.primitives, {
|
|
6
|
+
flex: 'none',
|
|
7
|
+
position: 'relative',
|
|
8
|
+
|
|
9
|
+
selectors: {
|
|
10
|
+
'&:not([hidden])': {
|
|
11
|
+
display: 'block',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
})
|
|
6
15
|
|
|
7
16
|
export const input: string = _style(layers.primitives, {
|
|
8
17
|
position: 'absolute',
|