@sanity/ui 3.0.0-static.26 → 3.0.0-static.28
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 +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +674 -804
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/refractor.cjs +2 -2
- package/dist/_chunks-cjs/refractor.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +652 -781
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/refractor.js +1 -1
- package/dist/_visual-editing.d.cts +1 -0
- package/dist/_visual-editing.d.ts +1 -0
- package/dist/css/layers.css +4 -0
- package/dist/css/primitives/popover/popover.css +4 -0
- package/dist/css.cjs +59 -50
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +14 -6
- package/dist/css.d.ts +14 -6
- package/dist/css.js +59 -50
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +1995 -1813
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.cts +35 -17
- package/dist/index.d.ts +35 -17
- package/dist/index.js +2013 -1832
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +2605 -1075
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +2689 -1159
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +2 -2
- package/package.json +20 -38
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +13 -17
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/core/components/autocomplete/constants.ts +3 -1
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +8 -3
- package/src/core/components/dialog/__workshop__/activate.tsx +11 -3
- package/src/core/components/dialog/__workshop__/panes.tsx +12 -5
- package/src/core/components/dialog/dialog.tsx +12 -13
- package/src/core/components/dialog/dialogCard.tsx +89 -53
- package/src/core/components/dialog/dialogContext.ts +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +1 -1
- package/src/core/components/dialog/index.ts +1 -0
- package/src/core/components/dialog/isTargetWithinScope.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +3 -2
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +12 -6
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -5
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -2
- package/src/core/components/menu/helpers.ts +1 -1
- package/src/core/components/menu/menu.tsx +6 -4
- package/src/core/components/menu/menuButton.tsx +5 -3
- package/src/core/components/menu/menuDivider.tsx +1 -1
- package/src/core/components/menu/menuGroup.tsx +8 -4
- package/src/core/components/menu/menuItem.tsx +4 -2
- package/src/core/components/tab/tab.tsx +2 -2
- package/src/core/components/tab/tabList.tsx +2 -2
- package/src/core/components/tab/tabPanel.tsx +2 -2
- package/src/core/components/toast/toast.tsx +7 -2
- package/src/core/components/toast/toastLayer.tsx +2 -2
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/tree.tsx +2 -2
- package/src/core/components/tree/treeGroup.tsx +2 -2
- package/src/core/components/tree/treeItem.tsx +13 -6
- package/src/core/components/tree/types.ts +0 -1
- package/src/core/{utils → components}/virtualList/__workshop__/index.ts +1 -1
- package/src/core/{utils → components}/virtualList/virtualList.tsx +10 -5
- package/src/core/helpers/focus.ts +0 -8
- package/src/core/hooks/useArrayProp.ts +1 -1
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -3
- package/src/core/hooks/useElementSize.ts +1 -1
- package/src/core/hooks/useResponsiveProp.ts +1 -1
- package/src/core/index.ts +83 -7
- package/src/core/observers/{elementSizeObserver.ts → elementSize.ts} +1 -1
- package/src/core/primitives/_selectable/index.ts +1 -0
- package/src/core/primitives/_selectable/selectable.tsx +13 -3
- package/src/core/{types/selectable.ts → primitives/_selectable/types.ts} +1 -1
- package/src/core/{utils → primitives}/arrow/arrow.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +4 -3
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -3
- package/src/core/primitives/avatar/avatarStack.tsx +4 -4
- package/src/core/primitives/avatar/types.ts +17 -0
- package/src/core/primitives/badge/badge.tsx +4 -2
- package/src/core/primitives/badge/types.ts +11 -2
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -1
- package/src/core/primitives/box/box.tsx +1 -1
- package/src/core/primitives/box/index.ts +1 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +37 -51
- package/src/core/primitives/button/__workshop__/index.ts +5 -0
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +13 -0
- package/src/core/primitives/button/button.tsx +15 -14
- package/src/core/primitives/button/index.ts +1 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +2 -2
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/types.ts +3 -0
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +9 -1
- package/src/core/primitives/checkbox/checkbox.tsx +3 -4
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +17 -42
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/container/container.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -1
- package/src/core/primitives/flex/index.ts +1 -0
- package/src/core/primitives/grid/grid.tsx +1 -1
- package/src/core/primitives/grid/index.ts +1 -0
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +1 -1
- package/src/core/primitives/kbd/kbd.tsx +1 -1
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/{utils → primitives}/layer/__workshop__/index.ts +1 -1
- package/src/core/{utils → primitives}/layer/layer.test.tsx +1 -1
- package/src/core/{utils → primitives}/layer/layer.tsx +2 -2
- package/src/core/{utils → primitives}/layer/layerCard.tsx +3 -3
- package/src/core/{utils → primitives}/layer/layerProvider.tsx +2 -1
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +12 -9
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +9 -8
- package/src/core/primitives/popover/constants.ts +1 -1
- package/src/core/primitives/popover/floating-ui/size.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +8 -4
- package/src/core/primitives/popover/popoverLayer.tsx +4 -2
- package/src/core/primitives/popover/types.ts +5 -0
- package/src/core/primitives/radio/radio.tsx +2 -2
- package/src/core/primitives/select/select.tsx +2 -2
- package/src/core/{components → primitives}/skeleton/__workshop__/index.ts +1 -1
- package/src/core/{components → primitives}/skeleton/codeSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/headingSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/labelSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/skeleton.tsx +7 -8
- package/src/core/{components → primitives}/skeleton/textSkeleton.tsx +1 -1
- package/src/core/primitives/spinner/spinner.tsx +1 -1
- package/src/core/{utils → primitives}/srOnly/srOnly.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +2 -1
- package/src/core/primitives/switch/switch.tsx +2 -7
- package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +17 -42
- package/src/core/primitives/text/text.tsx +3 -1
- package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/textArea/textArea.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +3 -2
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +6 -3
- package/src/core/primitives/tooltip/tooltipLayer.tsx +3 -2
- package/src/core/primitives/types.ts +8 -10
- package/src/core/types/radius.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +9 -5
- package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
- package/src/core/utils/getElementRef.ts +1 -0
- package/src/core/utils/portal/portal.tsx +1 -1
- package/src/css/components/dialog/dialog.css.ts +26 -1
- package/src/css/components/dialog/dialog.ts +27 -7
- package/src/css/components/skeleton/skeleton.ts +3 -1
- package/src/css/components/skeleton/types.ts +3 -1
- package/src/css/index.ts +75 -5
- package/src/css/primitives/_input/input.ts +2 -1
- package/src/css/primitives/_input/types.ts +2 -1
- package/src/css/primitives/_selectable/_selectable.css.ts +32 -24
- package/src/css/primitives/_selectable/selectable.ts +1 -1
- package/src/css/primitives/_selectable/types.ts +1 -1
- package/src/css/primitives/avatar/avatar.css.ts +11 -2
- package/src/css/primitives/avatar/avatar.ts +1 -1
- package/src/css/primitives/badge/badge.css.ts +2 -1
- package/src/css/primitives/badge/types.ts +0 -2
- package/src/css/primitives/box/box.ts +35 -37
- package/src/css/primitives/box/types.ts +34 -36
- package/src/css/primitives/button/button.css.ts +4 -0
- package/src/css/primitives/button/button.ts +5 -2
- package/src/css/primitives/button/types.ts +4 -11
- package/src/css/primitives/card/__workshop__/color.tsx +70 -0
- package/src/css/primitives/card/__workshop__/index.ts +14 -0
- package/src/css/primitives/card/card.css.ts +4 -0
- package/src/css/primitives/code/code.ts +3 -1
- package/src/css/primitives/code/types.ts +2 -1
- package/src/css/primitives/container/container.ts +3 -1
- package/src/css/primitives/heading/heading.ts +4 -1
- package/src/css/primitives/heading/types.ts +3 -1
- package/src/css/primitives/kbd/kbd.ts +1 -1
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.css.ts +1 -0
- package/src/css/primitives/label/label.ts +4 -1
- package/src/css/primitives/label/types.ts +3 -1
- package/src/css/primitives/switch/switch.css.ts +1 -1
- package/src/css/primitives/text/text.ts +6 -1
- package/src/css/primitives/text/types.ts +5 -2
- package/src/css/props/width/types.ts +1 -1
- package/src/css/props/width/width.css.ts +3 -0
- package/src/theme/v2/build/buildTheme.test.ts +8 -8
- package/src/theme/v2/build/buildTheme.ts +32 -7
- package/src/theme/v3/defaultFonts.ts +6 -6
- package/src/theme/v3/defaultTokens.ts +1 -1
- package/bin/sanity-ui.cjs +0 -5
- package/dist/ui.css +0 -1
- package/src/cli/buildCommand.ts +0 -10
- package/src/cli/index.ts +0 -26
- package/src/core/components/autocomplete/index.ts +0 -2
- package/src/core/components/index.ts +0 -9
- package/src/core/helpers/index.ts +0 -5
- package/src/core/hooks/index.ts +0 -13
- package/src/core/observers/index.ts +0 -2
- package/src/core/primitives/index.ts +0 -27
- package/src/core/types/avatar.ts +0 -16
- package/src/core/types/card.ts +0 -4
- package/src/core/types/index.ts +0 -15
- package/src/core/types/popover.ts +0 -4
- package/src/core/utils/index.ts +0 -8
- package/src/css/__theme/index.ts +0 -16
- package/src/css/__theme/lib/contract/buildVarContract.ts +0 -78
- package/src/css/__theme/lib/contract/index.ts +0 -4
- package/src/css/__theme/lib/contract/types.ts +0 -17
- package/src/css/__theme/resolveTheme.ts +0 -865
- package/src/css/components/index.ts +0 -6
- package/src/css/primitives/index.ts +0 -24
- package/src/css/props/index.ts +0 -37
- package/src/css/utils/srOnly/index.ts +0 -1
- /package/src/core/{global.ts → __DEV__.ts} +0 -0
- /package/src/core/{types/dialog.ts → components/dialog/types.ts} +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/index.ts +0 -0
- /package/src/core/observers/{resizeObserver.ts → resize.ts} +0 -0
- /package/src/core/{utils → primitives}/arrow/cmds.ts +0 -0
- /package/src/core/{utils → primitives}/arrow/index.ts +0 -0
- /package/src/core/{types/badge.ts → primitives/badge/types2.ts} +0 -0
- /package/src/core/{types/box.ts → primitives/box/types.ts} +0 -0
- /package/src/core/{types/button.ts → primitives/button/types.ts} +0 -0
- /package/src/core/{types/flex.ts → primitives/flex/types.ts} +0 -0
- /package/src/core/{types/grid.ts → primitives/grid/types.ts} +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/_debug.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/nested.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/getLayerContext.test.ts +0 -0
- /package/src/core/{utils → primitives}/layer/getLayerContext.ts +0 -0
- /package/src/core/{utils → primitives}/layer/index.ts +0 -0
- /package/src/core/{utils → primitives}/layer/layerContext.ts +0 -0
- /package/src/core/{utils → primitives}/layer/types.ts +0 -0
- /package/src/core/{utils → primitives}/layer/useLayer.ts +0 -0
- /package/src/core/{components → primitives}/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/core/{components → primitives}/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/core/{components → primitives}/skeleton/index.ts +0 -0
- /package/src/core/{utils → primitives}/srOnly/index.ts +0 -0
- /package/src/core/types/{text.ts → textAlign.ts} +0 -0
- /package/src/css/{utils → primitives/srOnly}/index.ts +0 -0
- /package/src/css/{utils → primitives}/srOnly/srOnly.css.ts +0 -0
- /package/src/css/{utils → primitives}/srOnly/srOnly.ts +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type {FontCodeSize, FontHeadingSize, FontLabelSize, FontTextSize} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
+
import type {FlexStyleProps} from '../../props/flex'
|
|
4
|
+
import type {MarginStyleProps} from '../../props/margin'
|
|
3
5
|
import type {RadiusStyleProps} from '../../props/radius'
|
|
4
6
|
import type {ResponsiveProp} from '../../types'
|
|
5
7
|
|
|
6
8
|
/** @beta */
|
|
7
9
|
|
|
8
|
-
export interface SkeletonStyleProps extends RadiusStyleProps {
|
|
10
|
+
export interface SkeletonStyleProps extends FlexStyleProps, MarginStyleProps, RadiusStyleProps {
|
|
9
11
|
className?: string
|
|
10
12
|
}
|
|
11
13
|
|
package/src/css/index.ts
CHANGED
|
@@ -1,14 +1,84 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
1
|
+
/* eslint-disable simple-import-sort/exports */
|
|
2
2
|
|
|
3
3
|
export * from './layers.css'
|
|
4
4
|
export * from './vars.css'
|
|
5
|
-
export * from './props'
|
|
6
|
-
export * from './utils'
|
|
7
|
-
export * from './primitives'
|
|
8
|
-
export * from './components'
|
|
9
5
|
|
|
10
6
|
export * from './defaultTheme.css'
|
|
11
7
|
|
|
8
|
+
// props
|
|
9
|
+
export * from './props/alignItems'
|
|
10
|
+
export * from './props/border'
|
|
11
|
+
export * from './props/boxSizing'
|
|
12
|
+
export * from './props/display'
|
|
13
|
+
export * from './props/flex'
|
|
14
|
+
export * from './props/flexDirection'
|
|
15
|
+
export * from './props/flexWrap'
|
|
16
|
+
export * from './props/font'
|
|
17
|
+
export * from './props/gap'
|
|
18
|
+
export * from './props/gridAutoColumns'
|
|
19
|
+
export * from './props/gridAutoFlow'
|
|
20
|
+
export * from './props/gridAutoRows'
|
|
21
|
+
export * from './props/gridColumn'
|
|
22
|
+
export * from './props/gridColumnEnd'
|
|
23
|
+
export * from './props/gridColumnStart'
|
|
24
|
+
export * from './props/gridRow'
|
|
25
|
+
export * from './props/gridRowEnd'
|
|
26
|
+
export * from './props/gridRowStart'
|
|
27
|
+
export * from './props/gridTemplateColumns'
|
|
28
|
+
export * from './props/gridTemplateRows'
|
|
29
|
+
export * from './props/height'
|
|
30
|
+
export * from './props/inset'
|
|
31
|
+
export * from './props/justifyContent'
|
|
32
|
+
export * from './props/margin'
|
|
33
|
+
export * from './props/maxWidth'
|
|
34
|
+
export * from './props/minHeight'
|
|
35
|
+
export * from './props/minWidth'
|
|
36
|
+
export * from './props/outline'
|
|
37
|
+
export * from './props/overflow'
|
|
38
|
+
export * from './props/padding'
|
|
39
|
+
export * from './props/pointerEvents'
|
|
40
|
+
export * from './props/position'
|
|
41
|
+
export * from './props/radius'
|
|
42
|
+
export * from './props/shadow'
|
|
43
|
+
export * from './props/textAlign'
|
|
44
|
+
export * from './props/textOverflow'
|
|
45
|
+
export * from './props/width'
|
|
46
|
+
|
|
47
|
+
// primitives
|
|
48
|
+
export * from './primitives/_arrow'
|
|
49
|
+
export * from './primitives/_input'
|
|
50
|
+
export * from './primitives/_selectable'
|
|
51
|
+
export * from './primitives/avatar'
|
|
52
|
+
export * from './primitives/badge'
|
|
53
|
+
export * from './primitives/box'
|
|
54
|
+
export * from './primitives/button'
|
|
55
|
+
export * from './primitives/card'
|
|
56
|
+
export * from './primitives/checkbox'
|
|
57
|
+
export * from './primitives/code'
|
|
58
|
+
export * from './primitives/container'
|
|
59
|
+
export * from './primitives/heading'
|
|
60
|
+
export * from './primitives/kbd'
|
|
61
|
+
export * from './primitives/label'
|
|
62
|
+
export * from './primitives/popover'
|
|
63
|
+
export * from './primitives/radio'
|
|
64
|
+
export * from './primitives/select'
|
|
65
|
+
export * from './primitives/spinner'
|
|
66
|
+
export * from './primitives/srOnly'
|
|
67
|
+
export * from './primitives/stack'
|
|
68
|
+
export * from './primitives/switch'
|
|
69
|
+
export * from './primitives/text'
|
|
70
|
+
export * from './primitives/textArea'
|
|
71
|
+
export * from './primitives/textInput'
|
|
72
|
+
export * from './primitives/tooltip'
|
|
73
|
+
|
|
74
|
+
// components
|
|
75
|
+
export * from './components/breadcrumbs'
|
|
76
|
+
export * from './components/dialog'
|
|
77
|
+
export * from './components/menu'
|
|
78
|
+
export * from './components/skeleton'
|
|
79
|
+
export * from './components/toast'
|
|
80
|
+
export * from './components/tree'
|
|
81
|
+
|
|
12
82
|
export * from './constants'
|
|
13
83
|
export * from './types'
|
|
14
84
|
export * from './util'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
2
|
import {_responsiveClassName} from '../../_responsiveClassName'
|
|
3
|
-
import {radius
|
|
3
|
+
import {radius} from '../../props/radius'
|
|
4
|
+
import {width} from '../../props/width'
|
|
4
5
|
import {border, element, fontSize, gap, padding, presentation, root} from './_input.css'
|
|
5
6
|
import type {InputStyleProps} from './types'
|
|
6
7
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {FontTextSize, Space} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import type {RadiusStyleProps
|
|
3
|
+
import type {RadiusStyleProps} from '../../props/radius'
|
|
4
|
+
import type {WidthStyleProps} from '../../props/width'
|
|
4
5
|
import type {ResponsiveProp} from '../../types'
|
|
5
6
|
|
|
6
7
|
/** @public */
|
|
@@ -46,33 +46,32 @@ export const tones = {
|
|
|
46
46
|
|
|
47
47
|
'@media': {
|
|
48
48
|
'(hover: hover)': {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
cursor: 'pointer',
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
'&:not([data-disabled]):hover': {
|
|
61
|
-
vars: {
|
|
62
|
-
[vars.color.bg]: tinted.bg[1],
|
|
63
|
-
[vars.color.border]: tinted.border[3],
|
|
64
|
-
[vars.color.fg]: tinted.fg[1],
|
|
65
|
-
[vars.color.muted.bg]: tinted.bg[2],
|
|
66
|
-
[vars.color.muted.fg]: tinted.fg[4],
|
|
49
|
+
selectors: {
|
|
50
|
+
'&:not([data-pressed]):not([data-selected]):not([data-focused]):not([data-disabled]):not(:active):not(:focus):hover':
|
|
51
|
+
{
|
|
52
|
+
vars: {
|
|
53
|
+
[vars.color.bg]: tinted.bg[1],
|
|
54
|
+
[vars.color.border]: tinted.border[1],
|
|
55
|
+
[vars.color.fg]: tinted.fg[1],
|
|
56
|
+
},
|
|
67
57
|
},
|
|
68
|
-
|
|
58
|
+
|
|
59
|
+
// '&:not([data-disabled]):hover': {
|
|
60
|
+
// vars: {
|
|
61
|
+
// [vars.color.bg]: tinted.bg[1],
|
|
62
|
+
// [vars.color.border]: tinted.border[3],
|
|
63
|
+
// [vars.color.fg]: tinted.fg[1],
|
|
64
|
+
// [vars.color.muted.bg]: tinted.bg[2],
|
|
65
|
+
// [vars.color.muted.fg]: tinted.fg[4],
|
|
66
|
+
// },
|
|
67
|
+
// },
|
|
69
68
|
},
|
|
70
69
|
},
|
|
71
70
|
},
|
|
72
71
|
|
|
73
72
|
'selectors': {
|
|
74
|
-
//
|
|
75
|
-
'&:not([data-disabled]):active, &:not([data-disabled])[aria-pressed="true"], &:not([data-disabled])[data-
|
|
73
|
+
// selected
|
|
74
|
+
'&:not([data-disabled]):active, &:not([data-disabled])[aria-pressed="true"], &:not([data-disabled])[data-selected]':
|
|
76
75
|
{
|
|
77
76
|
vars: {
|
|
78
77
|
[vars.color.bg]: tinted.bg[2],
|
|
@@ -93,9 +92,7 @@ export const tones = {
|
|
|
93
92
|
[vars.color.muted.fg]: focused.fg[3],
|
|
94
93
|
},
|
|
95
94
|
},
|
|
96
|
-
|
|
97
|
-
// selected
|
|
98
|
-
'&:not([data-disabled])[data-selected]': {
|
|
95
|
+
'&:not([data-disabled])[data-focused]': {
|
|
99
96
|
vars: {
|
|
100
97
|
[vars.color.bg]: focused.bg[0],
|
|
101
98
|
[vars.color.border]: focused.border[1],
|
|
@@ -105,6 +102,17 @@ export const tones = {
|
|
|
105
102
|
},
|
|
106
103
|
},
|
|
107
104
|
|
|
105
|
+
// // selected
|
|
106
|
+
// '&:not([data-disabled])[data-selected]': {
|
|
107
|
+
// vars: {
|
|
108
|
+
// [vars.color.bg]: focused.bg[0],
|
|
109
|
+
// [vars.color.border]: focused.border[1],
|
|
110
|
+
// [vars.color.fg]: focused.fg[0],
|
|
111
|
+
// [vars.color.muted.bg]: focused.bg[1],
|
|
112
|
+
// [vars.color.muted.fg]: focused.fg[3],
|
|
113
|
+
// },
|
|
114
|
+
// },
|
|
115
|
+
|
|
108
116
|
// disabled
|
|
109
117
|
'&[data-disabled]': {
|
|
110
118
|
vars: {
|
|
@@ -10,7 +10,16 @@ import {vars} from '../../vars.css'
|
|
|
10
10
|
|
|
11
11
|
export const stack = _style(layers.primitives, {})
|
|
12
12
|
|
|
13
|
+
globalStyle(`${stack} > * + *`, {
|
|
14
|
+
'@layer': {
|
|
15
|
+
[layers.primitives]: {
|
|
16
|
+
marginLeft: vars.avatar.distance,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
|
|
13
21
|
export const root = _style(layers.primitives, {
|
|
22
|
+
// display: 'block',
|
|
14
23
|
backgroundColor: vars.color.avatar.bg,
|
|
15
24
|
position: 'relative',
|
|
16
25
|
boxSizing: 'border-box',
|
|
@@ -26,8 +35,8 @@ export const root = _style(layers.primitives, {
|
|
|
26
35
|
},
|
|
27
36
|
|
|
28
37
|
selectors: {
|
|
29
|
-
[
|
|
30
|
-
|
|
38
|
+
'&:not([hidden])': {
|
|
39
|
+
display: 'block',
|
|
31
40
|
},
|
|
32
41
|
|
|
33
42
|
'button.&': {
|
|
@@ -8,7 +8,7 @@ import {vars} from '../../vars.css'
|
|
|
8
8
|
export const root = _style(layers.primitives, {
|
|
9
9
|
backgroundColor: vars.color.bg,
|
|
10
10
|
color: vars.color.fg,
|
|
11
|
-
|
|
11
|
+
whiteSpace: 'nowrap',
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
export const tones = {
|
|
@@ -18,6 +18,7 @@ export const tones = {
|
|
|
18
18
|
_style(layers.primitives, {
|
|
19
19
|
vars: {
|
|
20
20
|
[vars.color.bg]: vars.color.tinted[t].bg[2],
|
|
21
|
+
[vars.color.border]: vars.color.tinted[t].border[2],
|
|
21
22
|
[vars.color.fg]: vars.color.tinted[t].fg[3],
|
|
22
23
|
},
|
|
23
24
|
}),
|
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
width,
|
|
38
|
-
} from '../../props'
|
|
2
|
+
import {alignItems} from '../../props/alignItems'
|
|
3
|
+
import {border} from '../../props/border'
|
|
4
|
+
import {boxSizing} from '../../props/boxSizing'
|
|
5
|
+
import {display} from '../../props/display'
|
|
6
|
+
import {flex} from '../../props/flex'
|
|
7
|
+
import {flexDirection} from '../../props/flexDirection'
|
|
8
|
+
import {flexWrap} from '../../props/flexWrap'
|
|
9
|
+
import {gap} from '../../props/gap'
|
|
10
|
+
import {gridAutoColumns} from '../../props/gridAutoColumns'
|
|
11
|
+
import {gridAutoFlow} from '../../props/gridAutoFlow'
|
|
12
|
+
import {gridAutoRows} from '../../props/gridAutoRows'
|
|
13
|
+
import {gridColumn} from '../../props/gridColumn'
|
|
14
|
+
import {gridColumnEnd} from '../../props/gridColumnEnd'
|
|
15
|
+
import {gridColumnStart} from '../../props/gridColumnStart'
|
|
16
|
+
import {gridRow} from '../../props/gridRow'
|
|
17
|
+
import {gridRowEnd} from '../../props/gridRowEnd'
|
|
18
|
+
import {gridRowStart} from '../../props/gridRowStart'
|
|
19
|
+
import {gridTemplateColumns} from '../../props/gridTemplateColumns'
|
|
20
|
+
import {gridTemplateRows} from '../../props/gridTemplateRows'
|
|
21
|
+
import {height} from '../../props/height'
|
|
22
|
+
import {inset} from '../../props/inset'
|
|
23
|
+
import {justifyContent} from '../../props/justifyContent'
|
|
24
|
+
import {margin} from '../../props/margin'
|
|
25
|
+
import {maxWidth} from '../../props/maxWidth'
|
|
26
|
+
import {minHeight} from '../../props/minHeight'
|
|
27
|
+
import {minWidth} from '../../props/minWidth'
|
|
28
|
+
import {outline} from '../../props/outline'
|
|
29
|
+
import {overflow} from '../../props/overflow'
|
|
30
|
+
import {padding} from '../../props/padding'
|
|
31
|
+
import {pointerEvents} from '../../props/pointerEvents'
|
|
32
|
+
import {position} from '../../props/position'
|
|
33
|
+
import {radius} from '../../props/radius'
|
|
34
|
+
import {shadow} from '../../props/shadow'
|
|
35
|
+
import {textAlign} from '../../props/textAlign'
|
|
36
|
+
import {width} from '../../props/width'
|
|
39
37
|
import {muted, root} from './box.css'
|
|
40
38
|
import type {BoxStyleProps} from './types'
|
|
41
39
|
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
WidthStyleProps,
|
|
36
|
-
} from '../../props'
|
|
1
|
+
import type {AlignItemsStyleProps} from '../../props/alignItems'
|
|
2
|
+
import type {BorderStyleProps} from '../../props/border'
|
|
3
|
+
import type {BoxSizingStyleProps} from '../../props/boxSizing'
|
|
4
|
+
import type {DisplayStyleProps} from '../../props/display'
|
|
5
|
+
import type {FlexStyleProps} from '../../props/flex'
|
|
6
|
+
import type {FlexDirectionStyleProps} from '../../props/flexDirection'
|
|
7
|
+
import type {FlexWrapStyleProps} from '../../props/flexWrap'
|
|
8
|
+
import type {GapStyleProps} from '../../props/gap'
|
|
9
|
+
import type {GridAutoColumnsStyleProps} from '../../props/gridAutoColumns'
|
|
10
|
+
import type {GridAutoFlowStyleProps} from '../../props/gridAutoFlow'
|
|
11
|
+
import type {GridAutoRowsStyleProps} from '../../props/gridAutoRows'
|
|
12
|
+
import type {GridColumnStyleProps} from '../../props/gridColumn'
|
|
13
|
+
import type {GridColumnEndStyleProps} from '../../props/gridColumnEnd'
|
|
14
|
+
import type {GridColumnStartStyleProps} from '../../props/gridColumnStart'
|
|
15
|
+
import type {GridRowStyleProps} from '../../props/gridRow'
|
|
16
|
+
import type {GridRowEndStyleProps} from '../../props/gridRowEnd'
|
|
17
|
+
import type {GridRowStartStyleProps} from '../../props/gridRowStart'
|
|
18
|
+
import type {GridTemplateColumnsStyleProps} from '../../props/gridTemplateColumns'
|
|
19
|
+
import type {GridTemplateRowsStyleProps} from '../../props/gridTemplateRows'
|
|
20
|
+
import type {HeightStyleProps} from '../../props/height'
|
|
21
|
+
import type {InsetStyleProps} from '../../props/inset'
|
|
22
|
+
import type {JustifyContentStyleProps} from '../../props/justifyContent'
|
|
23
|
+
import type {MarginStyleProps} from '../../props/margin'
|
|
24
|
+
import type {MaxWidthStyleProps} from '../../props/maxWidth'
|
|
25
|
+
import type {MinHeightStyleProps} from '../../props/minHeight'
|
|
26
|
+
import type {MinWidthStyleProps} from '../../props/minWidth'
|
|
27
|
+
import type {OverflowStyleProps} from '../../props/overflow'
|
|
28
|
+
import type {PaddingStyleProps} from '../../props/padding'
|
|
29
|
+
import type {PointerEventsStyleProps} from '../../props/pointerEvents'
|
|
30
|
+
import type {PositionStyleProps} from '../../props/position'
|
|
31
|
+
import type {RadiusStyleProps} from '../../props/radius'
|
|
32
|
+
import type {ShadowStyleProps} from '../../props/shadow'
|
|
33
|
+
import type {TextAlignStyleProps} from '../../props/textAlign'
|
|
34
|
+
import type {WidthStyleProps} from '../../props/width'
|
|
37
35
|
|
|
38
36
|
/** @public */
|
|
39
37
|
export interface BoxStyleProps
|
|
@@ -24,6 +24,10 @@ export const root = _style(layers.primitives, {
|
|
|
24
24
|
backgroundColor: vars.color.bg,
|
|
25
25
|
color: vars.color.fg,
|
|
26
26
|
|
|
27
|
+
//
|
|
28
|
+
transition:
|
|
29
|
+
'background-color 100ms ease-in-out, box-shadow 100ms ease-in-out, color 100ms ease-in-out',
|
|
30
|
+
|
|
27
31
|
selectors: {
|
|
28
32
|
'&::-moz-focus-inner': {
|
|
29
33
|
border: 0,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
|
-
import {display
|
|
2
|
+
import {display} from '../../props/display'
|
|
3
|
+
import {flex} from '../../props/flex'
|
|
4
|
+
import {radius} from '../../props/radius'
|
|
5
|
+
import {width} from '../../props/width'
|
|
3
6
|
import {loadingBox, modes, root, tones} from './button.css'
|
|
4
7
|
import type {ButtonStyleProps} from './types'
|
|
5
8
|
|
|
@@ -10,7 +13,7 @@ export function button(props: ButtonStyleProps) {
|
|
|
10
13
|
root,
|
|
11
14
|
modes[props.mode ?? 'default'],
|
|
12
15
|
tones[props.tone ?? 'default'],
|
|
13
|
-
display(
|
|
16
|
+
display({display: 'flex'}),
|
|
14
17
|
flex(props),
|
|
15
18
|
radius(props),
|
|
16
19
|
width(props),
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import type {ThemeColorButtonModeKey, ThemeColorStateToneKey} from '@sanity/ui/theme'
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
RadiusStyleProps,
|
|
7
|
-
WidthStyleProps,
|
|
8
|
-
} from '../../props'
|
|
3
|
+
import type {FlexStyleProps} from '../../props/flex'
|
|
4
|
+
import type {RadiusStyleProps} from '../../props/radius'
|
|
5
|
+
import type {WidthStyleProps} from '../../props/width'
|
|
9
6
|
|
|
10
7
|
/** @public */
|
|
11
|
-
export interface ButtonStyleProps
|
|
12
|
-
extends DisplayStyleProps,
|
|
13
|
-
FlexStyleProps,
|
|
14
|
-
RadiusStyleProps,
|
|
15
|
-
WidthStyleProps {
|
|
8
|
+
export interface ButtonStyleProps extends FlexStyleProps, RadiusStyleProps, WidthStyleProps {
|
|
16
9
|
className?: string
|
|
17
10
|
mode?: ThemeColorButtonModeKey
|
|
18
11
|
tone?: ThemeColorStateToneKey
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
2
|
+
|
|
3
|
+
import {Box, Card, Code} from '@sanity/ui'
|
|
4
|
+
import {vars} from '@sanity/ui/css'
|
|
5
|
+
import {
|
|
6
|
+
COLOR_VARIANTS,
|
|
7
|
+
THEME_COLOR_CARD_TONES,
|
|
8
|
+
THEME_COLOR_SCHEMES,
|
|
9
|
+
type ThemeColorCardToneKey,
|
|
10
|
+
type ThemeColorSchemeKey,
|
|
11
|
+
type ThemeColorVariantKey,
|
|
12
|
+
} from '@sanity/ui/theme'
|
|
13
|
+
import {useState} from 'react'
|
|
14
|
+
|
|
15
|
+
interface ColorRecordNode extends Record<string, ColorNode> {}
|
|
16
|
+
|
|
17
|
+
type ColorNode = string | ColorRecordNode
|
|
18
|
+
|
|
19
|
+
export default function ColorStory() {
|
|
20
|
+
return (
|
|
21
|
+
<Box display="flex" flexDirection="column" gap={4} padding={4}>
|
|
22
|
+
{Object.entries(vars.color).map(([key, value]) => {
|
|
23
|
+
if (key === 'palette') {
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (THEME_COLOR_SCHEMES.includes(key as ThemeColorSchemeKey)) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (THEME_COLOR_CARD_TONES.includes(key as ThemeColorCardToneKey)) {
|
|
32
|
+
return null
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (COLOR_VARIANTS.includes(key as ThemeColorVariantKey)) {
|
|
36
|
+
// return null
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return <ColorBox key={key} node={{key, value}} />
|
|
40
|
+
})}
|
|
41
|
+
</Box>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function ColorBox({node}: {node: {key: string; value: ColorNode}}) {
|
|
46
|
+
const {key, value} = node
|
|
47
|
+
const [open, setOpen] = useState(true)
|
|
48
|
+
|
|
49
|
+
if (typeof value === 'string') {
|
|
50
|
+
return (
|
|
51
|
+
<Box radius={2} padding={3} style={{backgroundColor: value}}>
|
|
52
|
+
<Code size={1}>{key}</Code>
|
|
53
|
+
</Box>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Box overflow="hidden" radius={3} shadow={1}>
|
|
59
|
+
<Card as="button" onClick={() => setOpen(!open)} padding={3}>
|
|
60
|
+
<Code size={1}>{`${key} +`}</Code>
|
|
61
|
+
</Card>
|
|
62
|
+
|
|
63
|
+
<Box display="flex" flexDirection="column" gap={3} hidden={!open} padding={3}>
|
|
64
|
+
{Object.entries(value).map(([key, value]) => (
|
|
65
|
+
<ColorBox key={key} node={{key, value}} />
|
|
66
|
+
))}
|
|
67
|
+
</Box>
|
|
68
|
+
</Box>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {defineScope} from '@sanity/ui-workshop'
|
|
2
|
+
import {lazy} from 'react'
|
|
3
|
+
|
|
4
|
+
export default defineScope({
|
|
5
|
+
name: 'css/card',
|
|
6
|
+
title: 'Card',
|
|
7
|
+
stories: [
|
|
8
|
+
{
|
|
9
|
+
name: 'color',
|
|
10
|
+
title: 'Color',
|
|
11
|
+
component: lazy(() => import('./color')),
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
})
|
|
@@ -19,6 +19,10 @@ export const root = _style(layers.primitives, {
|
|
|
19
19
|
backgroundColor: vars.color.bg,
|
|
20
20
|
color: vars.color.fg,
|
|
21
21
|
|
|
22
|
+
//
|
|
23
|
+
transition:
|
|
24
|
+
'background-color 100ms ease-in-out, border-color 100ms, box-shadow 100ms ease-in-out, color 100ms ease-in-out',
|
|
25
|
+
|
|
22
26
|
vars: {
|
|
23
27
|
[vars.color.bg]: vars.color.tinted.default.bg[0],
|
|
24
28
|
[vars.color.border]: vars.color.tinted.default.border[1],
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
2
|
import {_responsiveClassName} from '../../_responsiveClassName'
|
|
3
|
-
import {display
|
|
3
|
+
import {display} from '../../props/display'
|
|
4
|
+
import {flex} from '../../props/flex'
|
|
5
|
+
import {font} from '../../props/font'
|
|
4
6
|
import {root, scale} from './code.css'
|
|
5
7
|
import type {CodeStyleProps} from './types'
|
|
6
8
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
|
-
import {margin
|
|
2
|
+
import {margin} from '../../props/margin'
|
|
3
|
+
import {maxWidth} from '../../props/maxWidth'
|
|
4
|
+
import {width} from '../../props/width'
|
|
3
5
|
import {root} from './container.css'
|
|
4
6
|
import type {ContainerStyleProps} from './types'
|
|
5
7
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {_composeClassNames} from '../../_composeClassNames'
|
|
2
2
|
import {_responsiveClassName} from '../../_responsiveClassName'
|
|
3
|
-
import {display
|
|
3
|
+
import {display} from '../../props/display'
|
|
4
|
+
import {flex} from '../../props/flex'
|
|
5
|
+
import {font} from '../../props/font'
|
|
6
|
+
import {textAlign} from '../../props/textAlign'
|
|
4
7
|
import {muted, root, sizes} from './heading.css'
|
|
5
8
|
import type {HeadingStyleProps} from './types'
|
|
6
9
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {FlexStyleProps
|
|
1
|
+
import type {FlexStyleProps} from '../../props/flex'
|
|
2
|
+
import type {FontStyleProps} from '../../props/font'
|
|
3
|
+
import type {TextAlignStyleProps} from '../../props/textAlign'
|
|
2
4
|
import type {ResponsiveProp} from '../../types'
|
|
3
5
|
|
|
4
6
|
/** @public */
|