@sanity/ui 3.0.0-static.14 → 3.0.0-static.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/_chunks-cjs/_visual-editing.js +132 -145
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/refractor.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +133 -146
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_chunks-es/refractor.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +5 -15
- package/dist/_visual-editing.d.ts +5 -15
- package/dist/_visual-editing.js +0 -1
- package/dist/_visual-editing.js.map +1 -1
- package/dist/_visual-editing.mjs +1 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/css.d.mts +12 -1
- package/dist/css.d.ts +12 -1
- package/dist/css.js +325 -430
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +325 -430
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +10 -20
- package/dist/index.d.ts +10 -20
- package/dist/index.js +7 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -44
- package/dist/index.mjs.map +1 -1
- package/dist/system.css +856 -84
- package/dist/system.min.css +1 -1
- package/exports/_visual-editing.ts +27 -27
- package/exports/index.ts +1 -1
- package/package.json +5 -5
- package/src/cli/index.ts +1 -13
- package/src/{ui → core}/_compat/index.ts +0 -1
- package/src/{ui → core}/_compat/theme/themeProvider.tsx +3 -3
- package/src/{ui → core}/components/tab/tabList.tsx +19 -4
- package/src/{ui → core}/index.ts +0 -1
- package/src/{ui → core}/primitives/box/box.tsx +3 -0
- package/src/{ui → core}/primitives/card/card.tsx +15 -21
- package/src/core/primitives/card/cardProvider.tsx +27 -0
- package/src/{ui → core}/primitives/card/types.ts +5 -4
- package/src/{ui → core}/primitives/popover/popover.tsx +1 -1
- package/src/{ui → core}/primitives/popover/popoverLayer.tsx +9 -20
- package/src/{ui → core}/primitives/tooltip/tooltip.tsx +2 -1
- package/src/{ui → core}/primitives/tooltip/tooltipLayer.tsx +11 -21
- package/src/{ui/utils/portal/portal.ts → core/utils/portal/portal.tsx} +8 -10
- package/src/css/_mergeStyles.ts +0 -7
- package/src/css/_system.style.ts +2 -0
- package/src/css/aspects/font/font.style.ts +0 -21
- package/src/css/aspects/font/font.ts +1 -6
- package/src/css/aspects/font/types.ts +0 -4
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/margin/margin.style.ts +0 -3
- package/src/css/aspects/textAlign/index.ts +2 -0
- package/src/css/aspects/textAlign/textAlign.style.ts +26 -0
- package/src/css/aspects/textAlign/textAlign.ts +8 -0
- package/src/css/aspects/textAlign/types.ts +7 -0
- package/src/css/primitives/_input/_input.style.ts +9 -11
- package/src/css/primitives/box/box.style.ts +5 -1
- package/src/css/primitives/box/box.ts +2 -0
- package/src/css/primitives/box/types.ts +2 -0
- package/src/css/primitives/heading/heading.ts +2 -1
- package/src/css/primitives/heading/types.ts +2 -1
- package/src/css/primitives/label/label.ts +2 -1
- package/src/css/primitives/label/types.ts +2 -1
- package/src/css/primitives/text/text.style.ts +0 -5
- package/src/css/primitives/text/text.ts +2 -1
- package/src/css/primitives/text/types.ts +2 -1
- package/src/css/primitives/textInput/textInput.style.ts +1 -120
- package/src/css/aspects/height/rules.ts +0 -7
- package/src/css/aspects/width/rules.ts +0 -8
- package/src/css/components/menu/rules.ts +0 -15
- package/src/css/primitives/avatar/rules.ts +0 -176
- package/src/css/primitives/button/rules.ts +0 -302
- package/src/css/primitives/checkbox/rules.ts +0 -152
- package/src/css/primitives/code/rules.ts +0 -96
- package/src/css/primitives/container/rules.ts +0 -8
- package/src/css/primitives/heading/rules.ts +0 -155
- package/src/css/primitives/kbd/rules.ts +0 -20
- package/src/css/primitives/label/rules.ts +0 -137
- package/src/css/primitives/radio/rules.ts +0 -121
- package/src/css/primitives/select/rules.ts +0 -22
- package/src/css/primitives/switch/rules.ts +0 -340
- package/src/css/primitives/text/rules.ts +0 -164
- package/src/css/primitives/textArea/rules.ts +0 -7
- package/src/css/primitives/textInput/rules.ts +0 -224
- package/src/css/primitives/tooltip/rules.ts +0 -19
- package/src/ui/RootClassNames.tsx +0 -44
- package/src/ui/_compat/studioTheme.ts +0 -7
- package/src/ui/primitives/card/cardProvider.tsx +0 -21
- /package/src/{ui → core}/StyleTags.tsx +0 -0
- /package/src/{ui → core}/_compat/helpers.ts +0 -0
- /package/src/{ui → core}/_compat/styles/_responsive.ts +0 -0
- /package/src/{ui → core}/_compat/styles/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/index.ts +0 -0
- /package/src/{ui → core}/_compat/theme/theme.test.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeColorProvider.tsx +0 -0
- /package/src/{ui → core}/_compat/theme/themeContext.ts +0 -0
- /package/src/{ui → core}/_compat/theme/types.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useRootTheme.ts +0 -0
- /package/src/{ui → core}/_compat/theme/useTheme.ts +0 -0
- /package/src/{ui → core}/_compat/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/apiStore.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__mocks__/countries.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/async.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/custom.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/fullscreen.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/autocomplete.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteOption.tsx +0 -0
- /package/src/{ui → core}/components/autocomplete/autocompleteReducer.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/constants.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/index.ts +0 -0
- /package/src/{ui → core}/components/autocomplete/types.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/breadcrumbs/breadcrumbs.tsx +0 -0
- /package/src/{ui → core}/components/breadcrumbs/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/activate.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/autoFocus.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/onScroll.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/panes.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/position.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/__workshop__/wrapped.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialog.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogCard.tsx +0 -0
- /package/src/{ui → core}/components/dialog/dialogContext.ts +0 -0
- /package/src/{ui → core}/components/dialog/dialogProvider.tsx +0 -0
- /package/src/{ui → core}/components/dialog/index.ts +0 -0
- /package/src/{ui → core}/components/dialog/isTargetWithinScope.ts +0 -0
- /package/src/{ui → core}/components/dialog/useDialog.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/hotkeys.tsx +0 -0
- /package/src/{ui → core}/components/hotkeys/index.ts +0 -0
- /package/src/{ui → core}/components/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/avatarMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/closableMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/constrainedInBoundary.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customMenuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/customSelectedState.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/disableFocusOnClose.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/groups.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/menuGroupRight.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/nestedMenu.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/onCloseMenuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/selectedItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/shouldFocus.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/components/menu/__workshop__/withoutArrow.tsx +0 -0
- /package/src/{ui → core}/components/menu/helpers.ts +0 -0
- /package/src/{ui → core}/components/menu/index.ts +0 -0
- /package/src/{ui → core}/components/menu/menu.test.tsx +0 -0
- /package/src/{ui → core}/components/menu/menu.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuButton.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuContext.ts +0 -0
- /package/src/{ui → core}/components/menu/menuDivider.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuGroup.tsx +0 -0
- /package/src/{ui → core}/components/menu/menuItem.tsx +0 -0
- /package/src/{ui → core}/components/menu/useMenu.ts +0 -0
- /package/src/{ui → core}/components/menu/useMenuController.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/codeSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/headingSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/index.ts +0 -0
- /package/src/{ui → core}/components/skeleton/labelSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/skeleton.tsx +0 -0
- /package/src/{ui → core}/components/skeleton/textSkeleton.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tab/index.ts +0 -0
- /package/src/{ui → core}/components/tab/tab.tsx +0 -0
- /package/src/{ui → core}/components/tab/tabPanel.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/hook.tsx +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/toast/__workshop__/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/index.ts +0 -0
- /package/src/{ui → core}/components/toast/toast.test.tsx +0 -0
- /package/src/{ui → core}/components/toast/toast.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastContext.ts +0 -0
- /package/src/{ui → core}/components/toast/toastLayer.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastProvider.tsx +0 -0
- /package/src/{ui → core}/components/toast/toastState.ts +0 -0
- /package/src/{ui → core}/components/toast/types.ts +0 -0
- /package/src/{ui → core}/components/toast/useToast.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.perf.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/basic.tsx +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/components/tree/__workshop__/tabFromElement.tsx +0 -0
- /package/src/{ui → core}/components/tree/helpers.ts +0 -0
- /package/src/{ui → core}/components/tree/index.ts +0 -0
- /package/src/{ui → core}/components/tree/tree.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeContext.ts +0 -0
- /package/src/{ui → core}/components/tree/treeGroup.tsx +0 -0
- /package/src/{ui → core}/components/tree/treeItem.tsx +0 -0
- /package/src/{ui → core}/components/tree/types.ts +0 -0
- /package/src/{ui → core}/components/tree/useTree.ts +0 -0
- /package/src/{ui → core}/constants.ts +0 -0
- /package/src/{ui → core}/global.ts +0 -0
- /package/src/{ui → core}/helpers/animation.ts +0 -0
- /package/src/{ui → core}/helpers/element.ts +0 -0
- /package/src/{ui → core}/helpers/focus.ts +0 -0
- /package/src/{ui → core}/helpers/index.ts +0 -0
- /package/src/{ui → core}/helpers/props.ts +0 -0
- /package/src/{ui → core}/helpers/scroll.ts +0 -0
- /package/src/{ui → core}/hooks/index.ts +0 -0
- /package/src/{ui → core}/hooks/useArrayProp.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutside.ts +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useClickOutsideEvent.ts +0 -0
- /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayed.test.ts +0 -0
- /package/src/{ui → core}/hooks/useDelayedState.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/index.ts +0 -0
- /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
- /package/src/{ui → core}/hooks/useElementSize.ts +0 -0
- /package/src/{ui → core}/hooks/useForwardedRef.ts +0 -0
- /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
- /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
- /package/src/{ui → core}/hooks/useMatchMedia.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/index.ts +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -0
- /package/src/{ui → core}/hooks/useMediaIndex/useMediaIndex.ts +0 -0
- /package/src/{ui → core}/hooks/useMounted.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.test.tsx +0 -0
- /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
- /package/src/{ui → core}/lib/createGlobalScopedContext.ts +0 -0
- /package/src/{ui → core}/lib/globalScope.ts +0 -0
- /package/src/{ui → core}/lib/isRecord.ts +0 -0
- /package/src/{ui → core}/middleware/origin.ts +0 -0
- /package/src/{ui → core}/observers/elementSizeObserver.ts +0 -0
- /package/src/{ui → core}/observers/index.ts +0 -0
- /package/src/{ui → core}/observers/resizeObserver.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/index.ts +0 -0
- /package/src/{ui → core}/primitives/_selectable/selectable.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/asButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinButton.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatar.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarCounter.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/avatarStack.tsx +0 -0
- /package/src/{ui → core}/primitives/avatar/index.ts +0 -0
- /package/src/{ui → core}/primitives/avatar/types.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.test.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/badge.tsx +0 -0
- /package/src/{ui → core}/primitives/badge/index.ts +0 -0
- /package/src/{ui → core}/primitives/badge/types.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/box/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/box/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/custom.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/customIcons.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/disabled.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/sanityUploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/stacked.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
- /package/src/{ui → core}/primitives/button/__workshop__/uploadButton.tsx +0 -0
- /package/src/{ui → core}/primitives/button/button.test.tsx +0 -0
- /package/src/{ui → core}/primitives/button/button.tsx +0 -0
- /package/src/{ui → core}/primitives/button/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/allTones.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/asButton.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/asComponent.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/checkered.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/interactive.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/listNavigation.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/selected.tsx +0 -0
- /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
- /package/src/{ui → core}/primitives/card/cardContext.ts +0 -0
- /package/src/{ui → core}/primitives/card/index.ts +0 -0
- /package/src/{ui → core}/primitives/card/useCard.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/checkbox.tsx +0 -0
- /package/src/{ui → core}/primitives/checkbox/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/code/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/code/code.tsx +0 -0
- /package/src/{ui → core}/primitives/code/index.ts +0 -0
- /package/src/{ui → core}/primitives/code/refractor.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/container.tsx +0 -0
- /package/src/{ui → core}/primitives/container/index.ts +0 -0
- /package/src/{ui → core}/primitives/container/types.ts +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/flex/flex.tsx +0 -0
- /package/src/{ui → core}/primitives/flex/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/grid.tsx +0 -0
- /package/src/{ui → core}/primitives/grid/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/heading.tsx +0 -0
- /package/src/{ui → core}/primitives/heading/index.ts +0 -0
- /package/src/{ui → core}/primitives/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/index.ts +0 -0
- /package/src/{ui → core}/primitives/inline/inline.tsx +0 -0
- /package/src/{ui → core}/primitives/inline/types.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/kbd/index.ts +0 -0
- /package/src/{ui → core}/primitives/kbd/kbd.tsx +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/label/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/label/index.ts +0 -0
- /package/src/{ui → core}/primitives/label/label.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/AlignedStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/PlainStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/RecursiveStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/SidePanelStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/TestStory.tsx +0 -0
- /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/constants.ts +0 -0
- /package/src/{ui → core}/primitives/popover/floating-ui/size.ts +0 -0
- /package/src/{ui → core}/primitives/popover/helpers.ts +0 -0
- /package/src/{ui → core}/primitives/popover/index.ts +0 -0
- /package/src/{ui → core}/primitives/popover/types.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/radio/index.ts +0 -0
- /package/src/{ui → core}/primitives/radio/radio.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/select/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/select/index.ts +0 -0
- /package/src/{ui → core}/primitives/select/select.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/Props.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/animatedSpinnerIcon.tsx +0 -0
- /package/src/{ui → core}/primitives/spinner/index.ts +0 -0
- /package/src/{ui → core}/primitives/spinner/spinner.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/stack/index.ts +0 -0
- /package/src/{ui → core}/primitives/stack/stack.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/switch/index.ts +0 -0
- /package/src/{ui → core}/primitives/switch/switch.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/colored.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/example.tsx +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/__workshop__/opticalAlignment.tsx +0 -0
- /package/src/{ui → core}/primitives/text/index.ts +0 -0
- /package/src/{ui → core}/primitives/text/text.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textArea/index.ts +0 -0
- /package/src/{ui → core}/primitives/textArea/textArea.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/customValidity.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/states.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/tones.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/__workshop__/typed.tsx +0 -0
- /package/src/{ui → core}/primitives/textInput/index.ts +0 -0
- /package/src/{ui → core}/primitives/textInput/textInput.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/customPortal.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/props.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/constants.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltip.test.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
- /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -0
- /package/src/{ui → core}/primitives/types.ts +0 -0
- /package/src/{ui → core}/types/avatar.ts +0 -0
- /package/src/{ui → core}/types/badge.ts +0 -0
- /package/src/{ui → core}/types/box.ts +0 -0
- /package/src/{ui → core}/types/button.ts +0 -0
- /package/src/{ui → core}/types/card.ts +0 -0
- /package/src/{ui → core}/types/dialog.ts +0 -0
- /package/src/{ui → core}/types/flex.ts +0 -0
- /package/src/{ui → core}/types/grid.ts +0 -0
- /package/src/{ui → core}/types/gridItem.ts +0 -0
- /package/src/{ui → core}/types/index.ts +0 -0
- /package/src/{ui → core}/types/placement.ts +0 -0
- /package/src/{ui → core}/types/popover.ts +0 -0
- /package/src/{ui → core}/types/props.ts +0 -0
- /package/src/{ui → core}/types/radius.ts +0 -0
- /package/src/{ui → core}/types/selectable.ts +0 -0
- /package/src/{ui → core}/types/text.ts +0 -0
- /package/src/{ui → core}/utils/arrow/arrow.tsx +0 -0
- /package/src/{ui → core}/utils/arrow/cmds.ts +0 -0
- /package/src/{ui → core}/utils/arrow/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElement.test.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementContext.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/boundaryElementProvider.tsx +0 -0
- /package/src/{ui → core}/utils/boundaryElement/index.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/types.ts +0 -0
- /package/src/{ui → core}/utils/boundaryElement/useBoundaryElement.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/customMedia.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/elementQuery.tsx +0 -0
- /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
- /package/src/{ui → core}/utils/elementQuery/index.ts +0 -0
- /package/src/{ui → core}/utils/errorBoundary.tsx +0 -0
- /package/src/{ui → core}/utils/getElementRef.ts +0 -0
- /package/src/{ui → core}/utils/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/_debug.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/nested.tsx +0 -0
- /package/src/{ui → core}/utils/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.test.ts +0 -0
- /package/src/{ui → core}/utils/layer/getLayerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/index.ts +0 -0
- /package/src/{ui → core}/utils/layer/layer.test.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layer.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerCard.tsx +0 -0
- /package/src/{ui → core}/utils/layer/layerContext.ts +0 -0
- /package/src/{ui → core}/utils/layer/layerProvider.tsx +0 -0
- /package/src/{ui → core}/utils/layer/types.ts +0 -0
- /package/src/{ui → core}/utils/layer/useLayer.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/__workshop__/named.tsx +0 -0
- /package/src/{ui → core}/utils/portal/index.ts +0 -0
- /package/src/{ui → core}/utils/portal/portal.test.tsx +0 -0
- /package/src/{ui → core}/utils/portal/portalContext.ts +0 -0
- /package/src/{ui → core}/utils/portal/portalProvider.tsx +0 -0
- /package/src/{ui → core}/utils/portal/types.ts +0 -0
- /package/src/{ui → core}/utils/portal/usePortal.ts +0 -0
- /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
- /package/src/{ui → core}/utils/srOnly/index.ts +0 -0
- /package/src/{ui → core}/utils/srOnly/srOnly.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/{ui → core}/utils/virtualList/index.ts +0 -0
- /package/src/{ui → core}/utils/virtualList/virtualList.tsx +0 -0
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import {THEME_COLOR_BUTTON_MODES, THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
|
|
2
|
-
|
|
3
|
-
import {Rules} from '../../types'
|
|
4
|
-
import {toneMap, variantMap} from './_constants'
|
|
5
|
-
|
|
6
|
-
const buttonVariantRules: Rules = {}
|
|
7
|
-
|
|
8
|
-
for (const mode of THEME_COLOR_BUTTON_MODES) {
|
|
9
|
-
for (const tone of THEME_COLOR_STATE_TONES) {
|
|
10
|
-
if (mode === 'default') {
|
|
11
|
-
buttonVariantRules[`&.${variantMap[mode]}.${toneMap[tone]}`] = {
|
|
12
|
-
// 'boxShadow': 'none',
|
|
13
|
-
'--color-bg': `var(--color-solid-${tone}-bg-0)`,
|
|
14
|
-
'--color-border': `var(--color-solid-${tone}-border-1)`,
|
|
15
|
-
'--color-fg': `var(--color-solid-${tone}-fg-0)`,
|
|
16
|
-
'--color-muted-fg': `var(--color-solid-${tone}-fg-4)`,
|
|
17
|
-
'--button-box-shadow': 'none',
|
|
18
|
-
|
|
19
|
-
'@nest': {
|
|
20
|
-
'&:not([data-disabled]):hover': {
|
|
21
|
-
'--color-bg': `var(--color-solid-${tone}-bg-1)`,
|
|
22
|
-
'--color-border': `var(--color-solid-${tone}-border-2)`,
|
|
23
|
-
'--color-fg': `var(--color-solid-${tone}-fg-0)`,
|
|
24
|
-
'--color-muted-fg': `var(--color-solid-${tone}-fg-4)`,
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
'&:not([data-disabled]):active': {
|
|
28
|
-
'--color-bg': `var(--color-solid-${tone}-bg-2)`,
|
|
29
|
-
'--color-border': `var(--color-solid-${tone}-border-3)`,
|
|
30
|
-
'--color-fg': `var(--color-solid-${tone}-fg-0)`,
|
|
31
|
-
'--color-muted-fg': `var(--color-solid-${tone}-fg-4)`,
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
'&:not([data-disabled])[data-selected]': {
|
|
35
|
-
'--color-bg': `var(--color-solid-${tone}-bg-2)`,
|
|
36
|
-
'--color-border': `var(--color-solid-${tone}-border-3)`,
|
|
37
|
-
'--color-fg': `var(--color-solid-${tone}-fg-0)`,
|
|
38
|
-
'--color-muted-fg': `var(--color-solid-${tone}-fg-4)`,
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
'&[data-disabled]': {
|
|
42
|
-
'--color-bg': `var(--color-tinted-default-bg-1)`,
|
|
43
|
-
'--color-border': `var(--color-tinted-default-border-0)`,
|
|
44
|
-
'--color-fg': `var(--color-tinted-default-border-2)`,
|
|
45
|
-
'--color-muted-fg': `var(--color-tinted-default-border-1)`,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (mode === 'bleed') {
|
|
52
|
-
buttonVariantRules[`&.${variantMap[mode]}.${toneMap[tone]}`] = {
|
|
53
|
-
'boxShadow': 'none',
|
|
54
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-0)`,
|
|
55
|
-
'--color-border': `var(--color-tinted-${tone}-border-1)`,
|
|
56
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-2)`,
|
|
57
|
-
'--color-muted-fg': `var(--color-tinted-${tone}-fg-4)`,
|
|
58
|
-
'--button-box-shadow': 'none',
|
|
59
|
-
|
|
60
|
-
'@nest': {
|
|
61
|
-
'&:not([data-disabled]):hover': {
|
|
62
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-1)`,
|
|
63
|
-
'--color-border': `var(--color-tinted-${tone}-border-2)`,
|
|
64
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-1)`,
|
|
65
|
-
'--color-muted-fg': `var(--color-tinted-${tone}-fg-3)`,
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
'&:not([data-disabled]):active': {
|
|
69
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-2)`,
|
|
70
|
-
'--color-border': `var(--color-tinted-${tone}-border-3)`,
|
|
71
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-1)`,
|
|
72
|
-
'--color-muted-fg': `var(--color-tinted-${tone}-fg-3)`,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
'&:not([data-disabled])[data-selected]': {
|
|
76
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-2)`,
|
|
77
|
-
'--color-border': `var(--color-tinted-${tone}-border-3)`,
|
|
78
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-1)`,
|
|
79
|
-
'--color-muted-fg': `var(--color-tinted-${tone}-fg-3)`,
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
'&[data-disabled]': {
|
|
83
|
-
'--color-bg': `var(--color-tinted-default-bg-0)`,
|
|
84
|
-
'--color-border': `var(--color-tinted-default-border-0)`,
|
|
85
|
-
'--color-fg': `var(--color-tinted-default-border-2)`,
|
|
86
|
-
'--color-muted-fg': `var(--color-tinted-default-border-1)`,
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (mode === 'ghost') {
|
|
93
|
-
buttonVariantRules[`&.${variantMap[mode]}.${toneMap[tone]}`] = {
|
|
94
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-0)`,
|
|
95
|
-
'--color-border': `var(--color-tinted-${tone}-border-1)`,
|
|
96
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-2)`,
|
|
97
|
-
'--button-box-shadow': [
|
|
98
|
-
`inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
99
|
-
`inset 0 -1.5px 0 0.5px var(--color-shadow-umbra)`,
|
|
100
|
-
].join(','),
|
|
101
|
-
|
|
102
|
-
'@nest': {
|
|
103
|
-
'&:not([data-disabled]):hover': {
|
|
104
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-1)`,
|
|
105
|
-
'--color-border': `var(--color-tinted-${tone}-border-2)`,
|
|
106
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-1)`,
|
|
107
|
-
// '--button-box-shadow': `inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
'&:not([data-disabled]):active': {
|
|
111
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-2)`,
|
|
112
|
-
'--color-border': `var(--color-tinted-${tone}-border-3)`,
|
|
113
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-1)`,
|
|
114
|
-
'--button-box-shadow': `inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
'&:not([data-disabled])[data-selected]': {
|
|
118
|
-
'--color-bg': `var(--color-tinted-${tone}-bg-2)`,
|
|
119
|
-
'--color-border': `var(--color-tinted-${tone}-border-3)`,
|
|
120
|
-
'--color-fg': `var(--color-tinted-${tone}-fg-1)`,
|
|
121
|
-
'--button-box-shadow': `inset 0 0 0 var(--button-border-width) var(--color-border)`,
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
'&[data-disabled]': {
|
|
125
|
-
'--color-bg': `var(--color-tinted-default-bg-0)`,
|
|
126
|
-
'--color-border': `var(--color-tinted-default-border-0)`,
|
|
127
|
-
'--color-fg': `var(--color-tinted-default-border-2)`,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export const buttonRules: Rules = {
|
|
136
|
-
'button': {
|
|
137
|
-
'WebkitFontSmoothing': 'inherit',
|
|
138
|
-
'appearance': 'none',
|
|
139
|
-
'font': 'inherit',
|
|
140
|
-
'outline': 'none',
|
|
141
|
-
'userSelect': 'none',
|
|
142
|
-
'textDecoration': 'none',
|
|
143
|
-
'border': 0,
|
|
144
|
-
'boxSizing': 'border-box',
|
|
145
|
-
'padding': 0,
|
|
146
|
-
'overflow': 'hidden',
|
|
147
|
-
'margin': 0,
|
|
148
|
-
'textAlign': 'left',
|
|
149
|
-
'position': 'relative',
|
|
150
|
-
'verticalAlign': 'top',
|
|
151
|
-
'backgroundColor': 'var(--color-bg)',
|
|
152
|
-
'color': 'var(--color-fg)',
|
|
153
|
-
'boxShadow': 'var(--button-box-shadow)',
|
|
154
|
-
|
|
155
|
-
'@nest': {
|
|
156
|
-
'&::-moz-focus-inner': {
|
|
157
|
-
border: 0,
|
|
158
|
-
padding: 0,
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
'&:focus': {
|
|
162
|
-
outline: 'var(--button-focus-ring-width) solid var(--color-focus-ring)',
|
|
163
|
-
outlineOffset: 'var(--button-focus-ring-offset)',
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
'&:focus:not(:focus-visible)': {
|
|
167
|
-
outline: 'none',
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
...buttonVariantRules,
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
'button-loading-box': {
|
|
175
|
-
position: 'absolute',
|
|
176
|
-
top: 0,
|
|
177
|
-
left: 0,
|
|
178
|
-
right: 0,
|
|
179
|
-
bottom: 0,
|
|
180
|
-
backgroundColor: 'var(--color-bg)',
|
|
181
|
-
borderRadius: 'inherit',
|
|
182
|
-
zIndex: 1,
|
|
183
|
-
opacity: 0.8,
|
|
184
|
-
},
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
|
|
188
|
-
// import {ThemeProps} from '../../_compat'
|
|
189
|
-
// import {_cardColorStyle} from '../../_compat/styles/card'
|
|
190
|
-
// import {focusRingBorderStyle, focusRingStyle} from '../../_compat/styles/internal'
|
|
191
|
-
// import {css} from '../../lib/styled'
|
|
192
|
-
// import {ButtonMode, ButtonTone, ButtonWidth} from '../../types'
|
|
193
|
-
|
|
194
|
-
// /**
|
|
195
|
-
// * @internal
|
|
196
|
-
// */
|
|
197
|
-
// export function buttonBaseStyles(
|
|
198
|
-
// props: {$width?: ButtonWidth} & ThemeProps,
|
|
199
|
-
// ): ReturnType<typeof css> {
|
|
200
|
-
// const {$width} = props
|
|
201
|
-
// const {style} = getTheme_v2(props.theme)
|
|
202
|
-
|
|
203
|
-
// return css`
|
|
204
|
-
// ${style?.button};
|
|
205
|
-
|
|
206
|
-
// -webkit-font-smoothing: inherit;
|
|
207
|
-
// appearance: none;
|
|
208
|
-
// display: inline-flex;
|
|
209
|
-
// align-items: center;
|
|
210
|
-
// font: inherit;
|
|
211
|
-
// border: 0;
|
|
212
|
-
// outline: none;
|
|
213
|
-
// user-select: none;
|
|
214
|
-
// text-decoration: none;
|
|
215
|
-
// border: 0;
|
|
216
|
-
// box-sizing: border-box;
|
|
217
|
-
// padding: 0;
|
|
218
|
-
// margin: 0;
|
|
219
|
-
// white-space: nowrap;
|
|
220
|
-
// text-align: left;
|
|
221
|
-
// position: relative;
|
|
222
|
-
// vertical-align: top;
|
|
223
|
-
|
|
224
|
-
// ${$width === 'fill' &&
|
|
225
|
-
// css`
|
|
226
|
-
// width: -moz-available;
|
|
227
|
-
// width: -webkit-fill-available;
|
|
228
|
-
// width: stretch;
|
|
229
|
-
// `}
|
|
230
|
-
|
|
231
|
-
// & > span {
|
|
232
|
-
// display: block;
|
|
233
|
-
// flex: 1;
|
|
234
|
-
// min-width: 0;
|
|
235
|
-
// border-radius: inherit;
|
|
236
|
-
// }
|
|
237
|
-
|
|
238
|
-
// &::-moz-focus-inner {
|
|
239
|
-
// border: 0;
|
|
240
|
-
// padding: 0;
|
|
241
|
-
// }
|
|
242
|
-
// `
|
|
243
|
-
// }
|
|
244
|
-
|
|
245
|
-
// function combineBoxShadow(...boxShadows: (string | undefined)[]): string {
|
|
246
|
-
// return boxShadows.filter(Boolean).join(',')
|
|
247
|
-
// }
|
|
248
|
-
|
|
249
|
-
// /**
|
|
250
|
-
// * @internal
|
|
251
|
-
// */
|
|
252
|
-
// export function buttonColorStyles(
|
|
253
|
-
// props: {$mode: ButtonMode; $tone: ButtonTone} & ThemeProps,
|
|
254
|
-
// ): CSSObject[] {
|
|
255
|
-
// const {$mode} = props
|
|
256
|
-
// const {button, color: baseColor, style} = getTheme_v2(props.theme)
|
|
257
|
-
// const shadow = props.$mode === 'ghost'
|
|
258
|
-
// const mode = baseColor.button[$mode] || baseColor.button.default
|
|
259
|
-
// const color = mode[props.$tone] || mode.default
|
|
260
|
-
// const border = {
|
|
261
|
-
// width: button.border.width,
|
|
262
|
-
// color: 'var(--color-border)',
|
|
263
|
-
// }
|
|
264
|
-
// // const defaultBoxShadow = `inset 0px -1.5px 0px ${buttonTheme.border.width}px color-mix(in srgb, var(--color-border) 25%, var(--color-bg))`
|
|
265
|
-
// const defaultBoxShadow = undefined
|
|
266
|
-
|
|
267
|
-
// return [
|
|
268
|
-
// _cardColorStyle(baseColor, color.enabled),
|
|
269
|
-
// {
|
|
270
|
-
// 'backgroundColor': 'var(--color-bg)',
|
|
271
|
-
// 'color': 'var(--color-fg)',
|
|
272
|
-
// 'boxShadow': focusRingBorderStyle(border),
|
|
273
|
-
// '&:disabled, &[data-disabled]': _cardColorStyle(baseColor, color.disabled),
|
|
274
|
-
// "&:not([data-disabled='true'])": {
|
|
275
|
-
// 'boxShadow': combineBoxShadow(
|
|
276
|
-
// focusRingBorderStyle(border),
|
|
277
|
-
// shadow ? defaultBoxShadow : undefined,
|
|
278
|
-
// ),
|
|
279
|
-
// '&:focus': {
|
|
280
|
-
// boxShadow: focusRingStyle({
|
|
281
|
-
// base: baseColor,
|
|
282
|
-
// border: {width: 2, color: baseColor.bg},
|
|
283
|
-
// focusRing: button.focusRing,
|
|
284
|
-
// }),
|
|
285
|
-
// },
|
|
286
|
-
// '&:focus:not(:focus-visible)': {
|
|
287
|
-
// boxShadow: combineBoxShadow(
|
|
288
|
-
// focusRingBorderStyle(border),
|
|
289
|
-
// shadow ? defaultBoxShadow : undefined,
|
|
290
|
-
// ),
|
|
291
|
-
// },
|
|
292
|
-
// '@media (hover: hover)': {
|
|
293
|
-
// '&:hover': _cardColorStyle(baseColor, color.hovered),
|
|
294
|
-
// '&:active': _cardColorStyle(baseColor, color.pressed),
|
|
295
|
-
// '&[data-hovered]': _cardColorStyle(baseColor, color.hovered),
|
|
296
|
-
// },
|
|
297
|
-
// '&[data-selected]': _cardColorStyle(baseColor, color.pressed),
|
|
298
|
-
// },
|
|
299
|
-
// },
|
|
300
|
-
// style?.button?.root,
|
|
301
|
-
// ].filter(Boolean) as CSSObject[]
|
|
302
|
-
// }
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import {Rules} from '../../types'
|
|
2
|
-
|
|
3
|
-
export const checkboxRules: Rules = {
|
|
4
|
-
'checkbox': {
|
|
5
|
-
position: 'relative',
|
|
6
|
-
display: 'inline-block',
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
'checkbox-input': {
|
|
10
|
-
'position': 'absolute',
|
|
11
|
-
'top': 0,
|
|
12
|
-
'left': 0,
|
|
13
|
-
'width': '100%',
|
|
14
|
-
'height': '100%',
|
|
15
|
-
'outline': 'none',
|
|
16
|
-
'opacity': 0,
|
|
17
|
-
'zIndex': 1,
|
|
18
|
-
'padding': 0,
|
|
19
|
-
'margin': 0,
|
|
20
|
-
|
|
21
|
-
'@nest': {
|
|
22
|
-
'& + span': {
|
|
23
|
-
'position': 'relative',
|
|
24
|
-
'display': 'block',
|
|
25
|
-
'width': `var(--input-checkbox-size)`,
|
|
26
|
-
'height': `var(--input-checkbox-size)`,
|
|
27
|
-
'boxSizing': 'border-box',
|
|
28
|
-
'borderRadius': `var(--radius-2)`,
|
|
29
|
-
'lineHeight': 1,
|
|
30
|
-
'backgroundColor': `var(--color-checkbox-bg)`,
|
|
31
|
-
'boxShadow': `inset 0 0 0 1px var(--color-checkbox-border)`,
|
|
32
|
-
'color': `var(--color-checkbox-fg)`,
|
|
33
|
-
|
|
34
|
-
// '--color-checkbox-bg': 'var(--color-input-default-enabled-bg)',
|
|
35
|
-
// '--color-checkbox-border': 'var(--color-input-default-enabled-border)',
|
|
36
|
-
// '--color-checkbox-fg': 'var(--color-input-default-enabled-fg)',
|
|
37
|
-
|
|
38
|
-
'--color-checkbox-bg': 'var(--color-tinted-default-bg-0)',
|
|
39
|
-
'--color-checkbox-border': 'var(--color-tinted-default-border-1)',
|
|
40
|
-
'--color-checkbox-fg': 'var(--color-tinted-default-fg-0)',
|
|
41
|
-
|
|
42
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
43
|
-
// color: color.input.default.enabled.border,
|
|
44
|
-
// width: input.border.width,
|
|
45
|
-
// })},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
'& + span > svg': {
|
|
49
|
-
display: 'block',
|
|
50
|
-
position: 'absolute',
|
|
51
|
-
opacity: 0,
|
|
52
|
-
height: '100%',
|
|
53
|
-
width: '100%',
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
'& + span > svg > path': {
|
|
57
|
-
vectorEffect: 'non-scaling-stroke',
|
|
58
|
-
strokeWidth: '1.5px !important',
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
'&:hover + span': {
|
|
62
|
-
'--color-checkbox-bg': 'var(--color-tinted-default-bg-1)',
|
|
63
|
-
'--color-checkbox-border': 'var(--color-tinted-default-border-2)',
|
|
64
|
-
'--color-checkbox-fg': 'var(--color-tinted-default-fg-0)',
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
'&:checked + span': {
|
|
68
|
-
'--color-checkbox-bg': 'var(--color-solid-default-bg-0)',
|
|
69
|
-
'--color-checkbox-border': 'var(--color-solid-default-bg-0)',
|
|
70
|
-
'--color-checkbox-fg': 'var(--color-solid-default-fg-0)',
|
|
71
|
-
// '--color-checkbox-bg': 'var(--color-input-default-enabled-fg)',
|
|
72
|
-
// '--color-checkbox-border': 'var(--color-input-default-enabled-fg)',
|
|
73
|
-
// '--color-checkbox-fg': 'var(--color-input-default-enabled-bg)',
|
|
74
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
75
|
-
// color: color.input.default.enabled.fg,
|
|
76
|
-
// width: input.border.width,
|
|
77
|
-
// })},
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
'&:checked + span > svg:first-child': {
|
|
81
|
-
opacity: 1,
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
// focus
|
|
85
|
-
'&:not(:disabled):focus:focus-visible + span': {
|
|
86
|
-
// box-shadow: ${focusRingStyle({focusRing})},
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
// focus when checked - uses a different offset
|
|
90
|
-
'&:not(:disabled):focus:focus-visible&:checked + span': {
|
|
91
|
-
// box-shadow: ${focusRingStyle({focusRing: {width: 1, offset: 1}})},
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
'&[data-error] + span': {
|
|
95
|
-
'--color-checkbox-bg': 'var(--color-input-invalid-enabled-border)',
|
|
96
|
-
'--color-checkbox-border': 'var(--color-input-invalid-enabled-bg)',
|
|
97
|
-
'--color-checkbox-fg': 'var(--color-input-invalid-enabled-fg)',
|
|
98
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
99
|
-
// width: input.border.width,
|
|
100
|
-
// color: color.input.invalid.enabled.muted.bg,
|
|
101
|
-
// })},
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
'&[data-error]:checked + span': {
|
|
105
|
-
'--color-checkbox-bg': 'var(--color-input-invalid-enabled-muted-bg)',
|
|
106
|
-
'--color-checkbox-fg': 'var(--color-input-invalid-enabled-bg)',
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
'&[data-error]:checked:not(:disabled):focus:focus-visible + span': {
|
|
110
|
-
'--color-checkbox-border': 'var(--color-input-invalid-readOnly-muted-bg)',
|
|
111
|
-
// box-shadow: ${focusRingStyle({
|
|
112
|
-
// border: {width: input.border.width, color: color.input.invalid.readOnly.muted.bg},
|
|
113
|
-
// focusRing: {width: 1, offset: 1},
|
|
114
|
-
// })},
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
'&:disabled + span': {
|
|
118
|
-
'--color-checkbox-bg': 'var(--color-tinted-default-bg-1)',
|
|
119
|
-
'--color-checkbox-border': 'var(--color-tinted-default-border-0)',
|
|
120
|
-
'--color-checkbox-fg': 'var(--color-tinted-default-border-2)',
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
'&:checked:disabled + span': {
|
|
124
|
-
'--color-checkbox-bg': 'var(--color-tinted-default-border-2)',
|
|
125
|
-
'--color-checkbox-border': 'var(--color-tinted-default-border-2)',
|
|
126
|
-
'--color-checkbox-fg': 'var(--color-tinted-default-bg-0)',
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
// '&:disabled:checked + span': {
|
|
130
|
-
// '--color-checkbox-bg': 'var(--color-input-default-disabled-muted-bg)',
|
|
131
|
-
// },
|
|
132
|
-
|
|
133
|
-
'&[data-read-only] + span': {
|
|
134
|
-
'--color-checkbox-bg': 'var(--color-input-default-readOnly-bg)',
|
|
135
|
-
'--color-checkbox-border': 'var(--color-input-default-readOnly-border)',
|
|
136
|
-
'--color-checkbox-fg': 'var(--color-input-default-readOnly-fg)',
|
|
137
|
-
// box-shadow: ${focusRingBorderStyle({
|
|
138
|
-
// width: input.border.width,
|
|
139
|
-
// color: color.input.default.readOnly.border,
|
|
140
|
-
// })},
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
'&[data-read-only]:checked + span': {
|
|
144
|
-
'--color-checkbox-bg': 'var(--color-input-default-readOnly-muted-bg)',
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
'&:indeterminate + span > svg:last-child': {
|
|
148
|
-
opacity: 1,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import {responsiveRules} from '../../responsiveRules'
|
|
2
|
-
import {Rules} from '../../types'
|
|
3
|
-
|
|
4
|
-
export const codeRules: Rules = {
|
|
5
|
-
code: {
|
|
6
|
-
'--font-weight-regular': `var(--font-code-weight-regular)`,
|
|
7
|
-
'--font-weight-medium': `var(--font-code-weight-medium)`,
|
|
8
|
-
'--font-weight-semibold': `var(--font-code-weight-semibold)`,
|
|
9
|
-
'--font-weight-bold': `var(--font-code-weight-bold)`,
|
|
10
|
-
|
|
11
|
-
'--font-family': `var(--font-code-family)`,
|
|
12
|
-
'--font-feature-settings': `var(--font-code-feature-settings)`,
|
|
13
|
-
|
|
14
|
-
'color': 'var(--color-code-fg)',
|
|
15
|
-
|
|
16
|
-
'@nest': {
|
|
17
|
-
'& > code': {
|
|
18
|
-
fontFamily: 'inherit',
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
// & code {
|
|
22
|
-
// font-family: inherit;
|
|
23
|
-
|
|
24
|
-
// &.refractor .token {
|
|
25
|
-
// ${codeSyntaxHighlightingStyle}
|
|
26
|
-
// }
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
|
-
'& a': {
|
|
30
|
-
color: 'var(--color-link-fg)',
|
|
31
|
-
textDecoration: 'none',
|
|
32
|
-
borderRadius: '1px',
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
'& svg': {
|
|
36
|
-
// Some popular CSS libraries change the defaults for SVG display
|
|
37
|
-
// Make sure SVGs are rendered as inline elements
|
|
38
|
-
display: 'inline',
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
'& [data-sanity-icon]': {
|
|
42
|
-
verticalAlign: 'baseline',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
...responsiveRules('code-0', {
|
|
48
|
-
'--font-size': 'var(--font-code-0-size)',
|
|
49
|
-
'--font-line-height': 'var(--font-code-0-line-height)',
|
|
50
|
-
'--font-letter-spacing': 'var(--font-code-0-letter-spacing)',
|
|
51
|
-
'--font-icon-size': 'var(--font-code-0-icon-size)',
|
|
52
|
-
'--font-ascender-height': 'var(--font-code-0-ascender-height)',
|
|
53
|
-
'--font-descender-height': 'var(--font-code-0-descender-height)',
|
|
54
|
-
// '--font-cap-height': 'var(--font-code-0-cap-height)',
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
...responsiveRules('code-1', {
|
|
58
|
-
'--font-size': 'var(--font-code-1-size)',
|
|
59
|
-
'--font-line-height': 'var(--font-code-1-line-height)',
|
|
60
|
-
'--font-letter-spacing': 'var(--font-code-1-letter-spacing)',
|
|
61
|
-
'--font-icon-size': 'var(--font-code-1-icon-size)',
|
|
62
|
-
'--font-ascender-height': 'var(--font-code-1-ascender-height)',
|
|
63
|
-
'--font-descender-height': 'var(--font-code-1-descender-height)',
|
|
64
|
-
// '--font-cap-height': 'var(--font-code-1-cap-height)',
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
...responsiveRules('code-2', {
|
|
68
|
-
'--font-size': 'var(--font-code-2-size)',
|
|
69
|
-
'--font-line-height': 'var(--font-code-2-line-height)',
|
|
70
|
-
'--font-letter-spacing': 'var(--font-code-2-letter-spacing)',
|
|
71
|
-
'--font-icon-size': 'var(--font-code-2-icon-size)',
|
|
72
|
-
'--font-ascender-height': 'var(--font-code-2-ascender-height)',
|
|
73
|
-
'--font-descender-height': 'var(--font-code-2-descender-height)',
|
|
74
|
-
// '--font-cap-height': 'var(--font-code-2-cap-height)',
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
...responsiveRules('code-3', {
|
|
78
|
-
'--font-size': 'var(--font-code-3-size)',
|
|
79
|
-
'--font-line-height': 'var(--font-code-3-line-height)',
|
|
80
|
-
'--font-letter-spacing': 'var(--font-code-3-letter-spacing)',
|
|
81
|
-
'--font-icon-size': 'var(--font-code-3-icon-size)',
|
|
82
|
-
'--font-ascender-height': 'var(--font-code-3-ascender-height)',
|
|
83
|
-
'--font-descender-height': 'var(--font-code-3-descender-height)',
|
|
84
|
-
// '--font-cap-height': 'var(--font-code-3-cap-height)',
|
|
85
|
-
}),
|
|
86
|
-
|
|
87
|
-
...responsiveRules('code-4', {
|
|
88
|
-
'--font-size': 'var(--font-code-4-size)',
|
|
89
|
-
'--font-line-height': 'var(--font-code-4-line-height)',
|
|
90
|
-
'--font-letter-spacing': 'var(--font-code-4-letter-spacing)',
|
|
91
|
-
'--font-icon-size': 'var(--font-code-4-icon-size)',
|
|
92
|
-
'--font-ascender-height': 'var(--font-code-4-ascender-height)',
|
|
93
|
-
'--font-descender-height': 'var(--font-code-4-descender-height)',
|
|
94
|
-
// '--font-cap-height': 'var(--font-code-4-cap-height)',
|
|
95
|
-
}),
|
|
96
|
-
}
|