@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
package/src/css/aspects/index.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {_responsiveRule} from '../../_responsiveRule'
|
|
2
|
+
import {Style, StyleRules} from '../../types'
|
|
3
|
+
|
|
4
|
+
export const util: StyleRules = {}
|
|
5
|
+
|
|
6
|
+
_responsiveRule(util, `text-align-initial`, {
|
|
7
|
+
textAlign: 'initial',
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
_responsiveRule(util, `text-align-left`, {
|
|
11
|
+
textAlign: 'left',
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
_responsiveRule(util, `text-align-center`, {
|
|
15
|
+
textAlign: 'center',
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
_responsiveRule(util, `text-align-right`, {
|
|
19
|
+
textAlign: 'right',
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
_responsiveRule(util, `text-align-justify`, {
|
|
23
|
+
textAlign: 'justify',
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export const textAlignStyle: Style = {layers: {util}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import {_resp} from '../../_resp'
|
|
2
|
+
import {composeClassNames} from '../../composeClassNames'
|
|
3
|
+
import {TextAlignStyleProps} from './types'
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export function textAlign(props: TextAlignStyleProps): string | undefined {
|
|
7
|
+
return composeClassNames(_resp('text-align', props.textAlign))
|
|
8
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {FONT_TEXT_SIZE, SPACE} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
+
import {_responsiveRule} from '../../_responsiveRule'
|
|
3
4
|
import {Style, StyleRules} from '../../types'
|
|
4
5
|
import {varNames} from '../../varNames'
|
|
5
6
|
import {vars} from '../../vars'
|
|
@@ -132,31 +133,28 @@ const primitive: StyleRules = {
|
|
|
132
133
|
},
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const source = vars.font.text.sizes[textSize]
|
|
136
|
+
for (const size of FONT_TEXT_SIZE) {
|
|
137
|
+
const source = vars.font.text.sizes[size]
|
|
138
138
|
|
|
139
|
-
primitive
|
|
139
|
+
_responsiveRule(primitive, `input-${size}`, {
|
|
140
140
|
[varNames.input.fontSize]: source.fontSize,
|
|
141
141
|
[varNames.input.lineHeight]: source.lineHeight,
|
|
142
142
|
[varNames.input.letterSpacing]: source.letterSpacing,
|
|
143
143
|
[varNames.input.ascenderHeight]: source.ascenderHeight,
|
|
144
144
|
[varNames.input.descenderHeight]: source.descenderHeight,
|
|
145
|
-
}
|
|
145
|
+
})
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
// todo: make responsive
|
|
149
148
|
for (const space of SPACE) {
|
|
150
|
-
primitive
|
|
149
|
+
_responsiveRule(primitive, `input-p-${space}`, {
|
|
151
150
|
[varNames.input.padding]: vars.space[space],
|
|
152
|
-
}
|
|
151
|
+
})
|
|
153
152
|
}
|
|
154
153
|
|
|
155
|
-
// todo: make responsive
|
|
156
154
|
for (const space of SPACE) {
|
|
157
|
-
primitive
|
|
155
|
+
_responsiveRule(primitive, `input-g-${space}`, {
|
|
158
156
|
[varNames.input.gap]: vars.space[space],
|
|
159
|
-
}
|
|
157
|
+
})
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
export const _inputStyle: Style = {layers: {primitive}}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
pointerEvents,
|
|
19
19
|
position,
|
|
20
20
|
radius,
|
|
21
|
+
textAlign,
|
|
21
22
|
width,
|
|
22
23
|
} from '../../aspects'
|
|
23
24
|
import {BoxStyleProps} from './types'
|
|
@@ -47,6 +48,7 @@ export function box(props: BoxStyleProps): string | undefined {
|
|
|
47
48
|
pointerEvents(props),
|
|
48
49
|
position(props),
|
|
49
50
|
radius(props),
|
|
51
|
+
textAlign(props),
|
|
50
52
|
width(props),
|
|
51
53
|
)
|
|
52
54
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
PointerEventsStyleProps,
|
|
17
17
|
PositionStyleProps,
|
|
18
18
|
RadiusStyleProps,
|
|
19
|
+
TextAlignStyleProps,
|
|
19
20
|
WidthStyleProps,
|
|
20
21
|
} from '../../aspects'
|
|
21
22
|
import {ResponsiveProp} from '../../types'
|
|
@@ -42,6 +43,7 @@ export interface BoxStyleProps
|
|
|
42
43
|
PointerEventsStyleProps,
|
|
43
44
|
PositionStyleProps,
|
|
44
45
|
RadiusStyleProps,
|
|
46
|
+
TextAlignStyleProps,
|
|
45
47
|
WidthStyleProps {
|
|
46
48
|
muted?: boolean
|
|
47
49
|
outline?: 'none'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
-
import {flexItem, font} from '../../aspects'
|
|
3
|
+
import {flexItem, font, textAlign} from '../../aspects'
|
|
4
4
|
import {HeadingStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
@@ -13,5 +13,6 @@ export function heading(props: HeadingStyleProps): string | undefined {
|
|
|
13
13
|
props.muted && 'heading-muted',
|
|
14
14
|
_resp(`heading`, props.size),
|
|
15
15
|
flexItem(props),
|
|
16
|
+
textAlign({textAlign: props.align}),
|
|
16
17
|
)
|
|
17
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FlexItemStyleProps, FontStyleProps} from '../../aspects'
|
|
1
|
+
import {FlexItemStyleProps, FontStyleProps, TextAlignStyleProps} from '../../aspects'
|
|
2
2
|
import {ResponsiveProp} from '../../types'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
@@ -7,6 +7,7 @@ export type HeadingSize = number
|
|
|
7
7
|
/** @public */
|
|
8
8
|
export interface HeadingStyleProps extends FontStyleProps, FlexItemStyleProps {
|
|
9
9
|
accent?: boolean
|
|
10
|
+
align?: TextAlignStyleProps['textAlign']
|
|
10
11
|
muted?: boolean
|
|
11
12
|
size?: ResponsiveProp<HeadingSize>
|
|
12
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
-
import {font} from '../../aspects'
|
|
3
|
+
import {font, textAlign} from '../../aspects'
|
|
4
4
|
import {LabelStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
@@ -12,5 +12,6 @@ export function label(props: LabelStyleProps): string | undefined {
|
|
|
12
12
|
props.accent && 'label-accent',
|
|
13
13
|
props.muted && 'label-muted',
|
|
14
14
|
_resp(`label`, props.size),
|
|
15
|
+
textAlign({textAlign: props.align}),
|
|
15
16
|
)
|
|
16
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {FontLabelSize} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import {FontStyleProps} from '../../aspects'
|
|
3
|
+
import {FontStyleProps, TextAlignStyleProps} from '../../aspects'
|
|
4
4
|
import {ResponsiveProp} from '../../types'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -12,6 +12,7 @@ export type LabelSize = number
|
|
|
12
12
|
/** @public */
|
|
13
13
|
export interface LabelStyleProps extends FontStyleProps {
|
|
14
14
|
accent?: boolean
|
|
15
|
+
align?: TextAlignStyleProps['textAlign']
|
|
15
16
|
muted?: boolean
|
|
16
17
|
size?: ResponsiveProp<FontLabelSize>
|
|
17
18
|
}
|
|
@@ -39,13 +39,8 @@ const primitive: StyleRules = {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
|
|
42
|
-
// 'text-accent': {
|
|
43
|
-
// '--color-fg': 'var(--color-accent-fg)',
|
|
44
|
-
// },
|
|
45
|
-
|
|
46
42
|
'.text-muted': {
|
|
47
43
|
color: 'var(--color-muted-fg)',
|
|
48
|
-
// '--color-fg': 'var(--color-tinted-default-fg-4)',
|
|
49
44
|
},
|
|
50
45
|
}
|
|
51
46
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {_comp} from '../../_comp'
|
|
2
2
|
import {_resp} from '../../_resp'
|
|
3
|
-
import {flexItem, font} from '../../aspects'
|
|
3
|
+
import {flexItem, font, textAlign} from '../../aspects'
|
|
4
4
|
import {TextStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
/** @public */
|
|
@@ -13,5 +13,6 @@ export function text(props: TextStyleProps): string | undefined {
|
|
|
13
13
|
props.accent && 'text-accent',
|
|
14
14
|
props.muted && 'text-muted',
|
|
15
15
|
_resp(`text`, props.size),
|
|
16
|
+
textAlign({textAlign: props.align}),
|
|
16
17
|
)
|
|
17
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FlexItemStyleProps, FontStyleProps} from '../../aspects'
|
|
1
|
+
import {FlexItemStyleProps, FontStyleProps, TextAlignStyleProps} from '../../aspects'
|
|
2
2
|
import {ResponsiveProp} from '../../types'
|
|
3
3
|
|
|
4
4
|
/** @public */
|
|
@@ -10,6 +10,7 @@ export interface TextStyleProps extends FlexItemStyleProps, FontStyleProps {
|
|
|
10
10
|
* @deprecated Will be removed in next major version
|
|
11
11
|
*/
|
|
12
12
|
accent?: boolean
|
|
13
|
+
align?: TextAlignStyleProps['textAlign']
|
|
13
14
|
muted?: boolean
|
|
14
15
|
size?: ResponsiveProp<TextSize>
|
|
15
16
|
}
|
|
@@ -42,126 +42,7 @@ const primitive: StyleRules = {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
|
|
45
|
-
'.text-input-presentation': {
|
|
46
|
-
// position: 'absolute',
|
|
47
|
-
// top: 0,
|
|
48
|
-
// left: 0,
|
|
49
|
-
// right: 0,
|
|
50
|
-
// bottom: 0,
|
|
51
|
-
// display: 'block',
|
|
52
|
-
// pointerEvents: 'none',
|
|
53
|
-
// zIndex: 0,
|
|
54
|
-
// backgroundColor: 'var(--input-bg-color)',
|
|
55
|
-
// 'boxShadow': 'var(--input-box-shadow)',
|
|
56
|
-
// '--input-border-color': 'var(--color-input-default-enabled-border)',
|
|
57
|
-
// '--input-border-color': 'var(--color-tinted-default-border-1)',
|
|
58
|
-
// '--input-box-shadow': 'inset 0 0 0 1px var(--input-border-color)',
|
|
59
|
-
// border-top-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
60
|
-
// border-bottom-left-radius: ${$hasPrefix ? 0 : undefined};
|
|
61
|
-
// border-top-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
62
|
-
// border-bottom-right-radius: ${$hasSuffix ? 0 : undefined};
|
|
63
|
-
// '@nest': {
|
|
64
|
-
// 'input:hover + &': {
|
|
65
|
-
// '--input-border-color': 'var(--color-tinted-default-border-2)',
|
|
66
|
-
// },
|
|
67
|
-
// 'input:focus + &': {
|
|
68
|
-
// '--input-border-color': 'var(--color-tinted-default-border-2)',
|
|
69
|
-
// },
|
|
70
|
-
// },
|
|
71
|
-
// &[data-scheme='${$scheme}'][data-tone='${$tone}'] {
|
|
72
|
-
// --card-bg-color: ${color.input.default.enabled.bg};
|
|
73
|
-
// --card-fg-color: ${color.input.default.enabled.fg};
|
|
74
|
-
// /* enabled */
|
|
75
|
-
// *:not(:disabled) + &[data-border] {
|
|
76
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
77
|
-
// color: color.input.default.enabled.border,
|
|
78
|
-
// width: input.border.width,
|
|
79
|
-
// })};
|
|
80
|
-
// }
|
|
81
|
-
// /* invalid */
|
|
82
|
-
// *:not(:disabled):invalid + & {
|
|
83
|
-
// --card-bg-color: ${color.input.invalid.enabled.bg};
|
|
84
|
-
// --card-fg-color: ${color.input.invalid.enabled.fg};
|
|
85
|
-
// &[data-border] {
|
|
86
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
87
|
-
// color: color.input.invalid.enabled.border,
|
|
88
|
-
// width: input.border.width,
|
|
89
|
-
// })};
|
|
90
|
-
// }
|
|
91
|
-
// }
|
|
92
|
-
// /* focused */
|
|
93
|
-
// *:not(:disabled):focus + & {
|
|
94
|
-
// &[data-border] {
|
|
95
|
-
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
96
|
-
// ? undefined
|
|
97
|
-
// : focusRingStyle({
|
|
98
|
-
// border: {color: color.input.default.enabled.border, width: input.border.width},
|
|
99
|
-
// focusRing: input.text.focusRing,
|
|
100
|
-
// })};
|
|
101
|
-
// }
|
|
102
|
-
// &:not([data-border]) {
|
|
103
|
-
// --input-box-shadow: ${$unstableDisableFocusRing
|
|
104
|
-
// ? undefined
|
|
105
|
-
// : focusRingStyle({focusRing: input.text.focusRing})};
|
|
106
|
-
// }
|
|
107
|
-
// }
|
|
108
|
-
// /* disabled */
|
|
109
|
-
// *:not(:invalid):disabled + & {
|
|
110
|
-
// --card-bg-color: ${color.input.default.disabled.bg} !important;
|
|
111
|
-
// --card-fg-color: ${color.input.default.disabled.fg} !important;
|
|
112
|
-
// --card-icon-color: ${color.input.default.disabled.fg} !important;
|
|
113
|
-
// &[data-border] {
|
|
114
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
115
|
-
// color: color.input.default.disabled.border,
|
|
116
|
-
// width: input.border.width,
|
|
117
|
-
// })};
|
|
118
|
-
// }
|
|
119
|
-
// }
|
|
120
|
-
// *:invalid:disabled + & {
|
|
121
|
-
// --card-bg-color: ${color.input.invalid.disabled.bg} !important;
|
|
122
|
-
// --card-fg-color: ${color.input.invalid.disabled.fg} !important;
|
|
123
|
-
// --card-icon-color: ${color.input.invalid.disabled.fg} !important;
|
|
124
|
-
// &[data-border] {
|
|
125
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
126
|
-
// color: color.input.invalid.disabled.border,
|
|
127
|
-
// width: input.border.width,
|
|
128
|
-
// })};
|
|
129
|
-
// }
|
|
130
|
-
// }
|
|
131
|
-
// /* readOnly */
|
|
132
|
-
// *:not(:invalid):read-only + & {
|
|
133
|
-
// --card-bg-color: ${color.input.default.readOnly.bg} !important;
|
|
134
|
-
// --card-fg-color: ${color.input.default.readOnly.fg} !important;
|
|
135
|
-
// }
|
|
136
|
-
// *:invalid:read-only + & {
|
|
137
|
-
// --card-bg-color: ${color.input.invalid.readOnly.bg} !important;
|
|
138
|
-
// --card-fg-color: ${color.input.invalid.readOnly.fg} !important;
|
|
139
|
-
// }
|
|
140
|
-
// /* hovered */
|
|
141
|
-
// @media (hover: hover) {
|
|
142
|
-
// *:not(:disabled):not(:read-only):not(:invalid):hover + & {
|
|
143
|
-
// --card-bg-color: ${color.input.default.hovered.bg};
|
|
144
|
-
// --card-fg-color: ${color.input.default.hovered.fg};
|
|
145
|
-
// }
|
|
146
|
-
// *:invalid:not(:disabled):not(:read-only):hover + & {
|
|
147
|
-
// --card-bg-color: ${color.input.invalid.hovered.bg};
|
|
148
|
-
// --card-fg-color: ${color.input.invalid.hovered.fg};
|
|
149
|
-
// }
|
|
150
|
-
// *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {
|
|
151
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
152
|
-
// color: color.input.default.hovered.border,
|
|
153
|
-
// width: input.border.width,
|
|
154
|
-
// })};
|
|
155
|
-
// }
|
|
156
|
-
// *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {
|
|
157
|
-
// --input-box-shadow: ${focusRingBorderStyle({
|
|
158
|
-
// color: color.input.invalid.hovered.border,
|
|
159
|
-
// width: input.border.width,
|
|
160
|
-
// })};
|
|
161
|
-
// }
|
|
162
|
-
// }
|
|
163
|
-
// }
|
|
164
|
-
},
|
|
45
|
+
'.text-input-presentation': {},
|
|
165
46
|
}
|
|
166
47
|
|
|
167
48
|
export const textInputStyle: Style = {layers: {primitive}}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {Rules} from '../../types'
|
|
2
|
-
import {vars} from '../../vars'
|
|
3
|
-
|
|
4
|
-
export const menuRules: Rules = {
|
|
5
|
-
'menu': {
|
|
6
|
-
outline: 'none',
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
'menu-divider': {
|
|
10
|
-
height: `1px`,
|
|
11
|
-
border: 0,
|
|
12
|
-
backgroundColor: vars.color.border,
|
|
13
|
-
margin: 0,
|
|
14
|
-
},
|
|
15
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import {AVATAR_SIZE, THEME_COLOR_AVATAR_COLORS} from '@sanity/ui/theme'
|
|
2
|
-
|
|
3
|
-
import {responsiveRules} from '../../responsiveRules'
|
|
4
|
-
import {Properties, Rules} from '../../types'
|
|
5
|
-
import {varNames} from '../../varNames'
|
|
6
|
-
import {vars} from '../../vars'
|
|
7
|
-
|
|
8
|
-
export const avatarRules: Rules = {
|
|
9
|
-
'avatar': {
|
|
10
|
-
'backgroundColor': vars.color.avatar.bg,
|
|
11
|
-
'position': 'relative',
|
|
12
|
-
'boxSizing': 'border-box',
|
|
13
|
-
'userSelect': 'none',
|
|
14
|
-
'boxShadow': `0 0 0 1px ${vars.color.bg}`,
|
|
15
|
-
'lineHeight': 0,
|
|
16
|
-
|
|
17
|
-
'width': vars.avatar.size,
|
|
18
|
-
'height': vars.avatar.size,
|
|
19
|
-
'borderRadius': vars.avatar.size,
|
|
20
|
-
|
|
21
|
-
'@nest': {
|
|
22
|
-
'&[data-status="inactive"]': {
|
|
23
|
-
opacity: 0.5,
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
// &:is(button)
|
|
27
|
-
'&:is(button)': {
|
|
28
|
-
WebkitFontSmoothing: 'inherit',
|
|
29
|
-
appearance: 'none',
|
|
30
|
-
margin: 0,
|
|
31
|
-
padding: 0,
|
|
32
|
-
border: 0,
|
|
33
|
-
font: 'inherit',
|
|
34
|
-
color: 'inherit',
|
|
35
|
-
outline: 'none',
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
'&:is(button):focus': {
|
|
39
|
-
outline: 'var(--avatar-focus-ring-width) solid var(--color-focus-ring)',
|
|
40
|
-
outlineOffset: 'var(--avatar-focus-ring-offset)',
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
'&:is(button):focus:not(:focus-visible)': {
|
|
44
|
-
boxShadow: 'none',
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
':disabled &, [data-disabled] &': {
|
|
48
|
-
[varNames.color.avatar.bg]: vars.color.border,
|
|
49
|
-
[varNames.color.avatar.fg]: vars.color.bg,
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
...THEME_COLOR_AVATAR_COLORS.reduce(
|
|
53
|
-
(acc, color) => {
|
|
54
|
-
return {
|
|
55
|
-
...acc,
|
|
56
|
-
[`&.${color}`]: {
|
|
57
|
-
[varNames.color.avatar.bg]: vars.color.avatar[color].bg,
|
|
58
|
-
[varNames.color.avatar.fg]: vars.color.avatar[color].fg,
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{} as Record<string, Properties>,
|
|
63
|
-
),
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
...(AVATAR_SIZE.reduce((acc, size) => {
|
|
68
|
-
return {
|
|
69
|
-
...acc,
|
|
70
|
-
...responsiveRules(`avatar-${size}`, {
|
|
71
|
-
[varNames.avatar.distance]: vars.avatar.sizes[size].distance,
|
|
72
|
-
[varNames.avatar.size]: vars.avatar.sizes[size].size,
|
|
73
|
-
}),
|
|
74
|
-
}
|
|
75
|
-
}, {} as Rules) as Rules),
|
|
76
|
-
|
|
77
|
-
'avatar-arrow': {
|
|
78
|
-
'position': 'absolute',
|
|
79
|
-
'boxSizing': 'border-box',
|
|
80
|
-
'zIndex': 0,
|
|
81
|
-
'opacity': 0,
|
|
82
|
-
'transition': 'all 0.2s linear',
|
|
83
|
-
'transform': 'rotate(-90deg) translate3d(0, 6px, 0)',
|
|
84
|
-
'left': 0,
|
|
85
|
-
'right': 0,
|
|
86
|
-
'top': 0,
|
|
87
|
-
'bottom': 0,
|
|
88
|
-
|
|
89
|
-
'@nest': {
|
|
90
|
-
'& > svg': {
|
|
91
|
-
display: 'block',
|
|
92
|
-
width: '11px',
|
|
93
|
-
height: '7px',
|
|
94
|
-
position: 'absolute',
|
|
95
|
-
top: '-5px',
|
|
96
|
-
left: '50%',
|
|
97
|
-
transform: 'translateX(-6px)',
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
'[data-arrow-position="inside"] > &': {
|
|
101
|
-
transform: 'rotate(-90deg) translate3d(0, 6px, 0)',
|
|
102
|
-
opacity: 0,
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
'[data-arrow-position="top"] > &': {
|
|
106
|
-
opacity: 1,
|
|
107
|
-
transform: 'rotate(0deg)',
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
'[data-arrow-position="bottom"] > &': {
|
|
111
|
-
opacity: 1,
|
|
112
|
-
transform: 'rotate(-180deg)',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
'avatar-image': {
|
|
118
|
-
'@nest': {
|
|
119
|
-
'& > img': {
|
|
120
|
-
display: 'block',
|
|
121
|
-
position: 'absolute',
|
|
122
|
-
width: vars.avatar.size,
|
|
123
|
-
height: vars.avatar.size,
|
|
124
|
-
borderRadius: vars.avatar.size,
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
'& > span': {
|
|
128
|
-
display: 'block',
|
|
129
|
-
position: 'absolute',
|
|
130
|
-
width: vars.avatar.size,
|
|
131
|
-
height: vars.avatar.size,
|
|
132
|
-
borderRadius: vars.avatar.size,
|
|
133
|
-
boxShadow: [
|
|
134
|
-
`inset 0 0 0 1px ${vars.color.avatar.bg}`,
|
|
135
|
-
`inset 0 0 0 1.75px ${vars.color.bg}`,
|
|
136
|
-
].join(', '),
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
'[data-image-error] &': {
|
|
140
|
-
display: 'none',
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
'avatar-initials': {
|
|
146
|
-
color: vars.color.avatar.fg,
|
|
147
|
-
borderRadius: vars.avatar.size,
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
'avatar-counter': {
|
|
151
|
-
'color': vars.color.fg,
|
|
152
|
-
'backgroundColor': vars.color.bg,
|
|
153
|
-
'boxShadow': [`0 0 0 1px ${vars.color.bg}`, `inset 0 0 0 1px ${vars.color.border}`].join(', '),
|
|
154
|
-
'userSelect': 'none',
|
|
155
|
-
'borderRadius': vars.avatar.size,
|
|
156
|
-
'height': vars.avatar.size,
|
|
157
|
-
|
|
158
|
-
'@nest': {
|
|
159
|
-
'&&': {
|
|
160
|
-
minWidth: vars.avatar.size,
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
'[data-hide-inner-stroke] &': {
|
|
164
|
-
boxShadow: `0 0 0 1px ${vars.color.bg}`,
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
'avatar-stack': {
|
|
170
|
-
'@nest': {
|
|
171
|
-
'& > div + div': {
|
|
172
|
-
marginLeft: vars.avatar.distance,
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
}
|