@sanity/ui 3.0.0-static.10 → 3.0.0-static.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.js +160 -207
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +161 -208
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +1 -3
- package/dist/_visual-editing.d.ts +1 -3
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +115 -2
- package/dist/css.d.ts +115 -2
- package/dist/css.js +539 -402
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +541 -404
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +50 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -12
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +1 -1
- package/dist/system.css +418 -182
- package/dist/theme.js +10 -11
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +10 -11
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/_resp.ts +0 -1
- package/src/css/aspects/font/font.style.ts +7 -66
- package/src/css/aspects/shadow/shadow.style.ts +16 -41
- package/src/css/compile/compilePalette.ts +4 -3
- package/src/css/compile/compileSystem.ts +0 -3
- package/src/css/compile/compileTheme_v3.ts +233 -219
- package/src/css/components/skeleton/skeleton.style.ts +8 -4
- package/src/css/constants.ts +9 -0
- package/src/css/index.ts +1 -0
- package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
- package/src/css/primitives/_arrow/_arrow.ts +4 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +23 -23
- package/src/css/primitives/button/button.style.ts +48 -15
- package/src/css/primitives/card/card.style.ts +1 -1
- package/src/css/primitives/token/token.style.ts +37 -36
- package/src/css/responsiveRules.ts +12 -19
- package/src/css/types.ts +106 -3
- package/src/css/varNames.ts +101 -4
- package/src/css/vars.ts +52 -16
- package/src/theme/v3/buildTheme_v3.ts +1 -1
- package/src/theme/v3/{defaults.ts → defaultTokens.ts} +1 -2
- package/src/theme/v3/index.ts +1 -1
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +41 -0
- package/src/ui/_compat/helpers.ts +72 -0
- package/src/ui/_compat/index.ts +2 -6
- package/src/ui/_compat/studioTheme.ts +7 -0
- package/src/ui/_compat/types.ts +0 -83
- package/src/ui/index.ts +1 -0
- package/src/ui/primitives/button/button.tsx +5 -6
- package/src/ui/primitives/popover/popover.tsx +25 -7
- package/src/ui/primitives/popover/popoverCard.tsx +46 -45
- package/src/ui/primitives/tooltip/tooltip.tsx +9 -2
- package/src/ui/primitives/tooltip/tooltipCard.tsx +1 -1
- package/src/ui/utils/arrow/arrow.tsx +3 -11
- package/src/ui/utils/elementQuery/elementQuery.tsx +10 -8
- package/src/ui/utils/virtualList/virtualList.tsx +37 -32
- package/src/css/components/breadcrumbs/rules.ts +0 -25
- package/src/css/components/dialog/rules.ts +0 -78
- package/src/css/components/skeleton/rules.ts +0 -113
- package/src/css/components/toast/rules.ts +0 -18
- package/src/css/components/tree/rules.ts +0 -168
- package/src/css/primitives/popover/rules.ts +0 -5
- package/src/css/primitives/spinner/rules.ts +0 -21
- package/src/css/primitives/token/rules.ts +0 -45
package/package.json
CHANGED
package/src/css/_resp.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
// import {responsiveRules} from '../../responsiveRules'
|
|
2
1
|
import {_responsiveRule} from '../../_responsiveRule'
|
|
3
2
|
import {Style, StyleRules} from '../../types'
|
|
4
3
|
|
|
5
|
-
export const
|
|
4
|
+
export const primitive: StyleRules = {
|
|
6
5
|
'.font': {
|
|
7
|
-
// 'position': 'relative',
|
|
8
6
|
'fontFamily': 'var(--font-family)',
|
|
9
7
|
'fontFeatureSettings': 'var(--font-feature-settings)',
|
|
10
8
|
'fontSize': 'var(--font-size)',
|
|
@@ -71,81 +69,24 @@ export const rules: StyleRules = {
|
|
|
71
69
|
},
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_responsiveRule(rules, `text-align-initial`, {
|
|
72
|
+
_responsiveRule(primitive, `text-align-initial`, {
|
|
77
73
|
textAlign: 'initial',
|
|
78
74
|
})
|
|
79
75
|
|
|
80
|
-
_responsiveRule(
|
|
76
|
+
_responsiveRule(primitive, `text-align-left`, {
|
|
81
77
|
textAlign: 'left',
|
|
82
78
|
})
|
|
83
79
|
|
|
84
|
-
_responsiveRule(
|
|
80
|
+
_responsiveRule(primitive, `text-align-center`, {
|
|
85
81
|
textAlign: 'center',
|
|
86
82
|
})
|
|
87
83
|
|
|
88
|
-
_responsiveRule(
|
|
84
|
+
_responsiveRule(primitive, `text-align-right`, {
|
|
89
85
|
textAlign: 'right',
|
|
90
86
|
})
|
|
91
87
|
|
|
92
|
-
_responsiveRule(
|
|
88
|
+
_responsiveRule(primitive, `text-align-justify`, {
|
|
93
89
|
textAlign: 'justify',
|
|
94
90
|
})
|
|
95
91
|
|
|
96
|
-
export const fontStyle: Style = {layers: {primitive
|
|
97
|
-
|
|
98
|
-
// .font {
|
|
99
|
-
// position: relative;
|
|
100
|
-
// font-family: var(--font-family);
|
|
101
|
-
// font-size: var(--font-size);
|
|
102
|
-
// line-height: var(--font-line-height);
|
|
103
|
-
// letter-spacing: var(--font-letter-spacing);
|
|
104
|
-
// font-weight: var(--font-weight);
|
|
105
|
-
// transform: translateY(var(--font-descender-height));
|
|
106
|
-
// padding: 1px 0;
|
|
107
|
-
// margin: 0;
|
|
108
|
-
|
|
109
|
-
// --font-negative-height: calc(var(--font-ascender-height) + var(--font-descender-height));
|
|
110
|
-
// --font-cap-height: calc(var(--font-line-height) - var(--font-negative-height));
|
|
111
|
-
// --font-icon-offset: calc((var(--font-cap-height) - var(--font-icon-size)) / 2);
|
|
112
|
-
// --font-custom-icon-size: calc((var(--font-size) * 1.125) / 2) * 2 + 1;
|
|
113
|
-
// --font-custom-icon-offset: calc((var(--font-cap-height) - var(--font-custom-icon-size)) / 2);
|
|
114
|
-
|
|
115
|
-
// &:before {
|
|
116
|
-
// content: '';
|
|
117
|
-
// display: block;
|
|
118
|
-
// height: 0;
|
|
119
|
-
// margin-top: calc(0px - var(--font-negative-height) - 1px);
|
|
120
|
-
// }
|
|
121
|
-
|
|
122
|
-
// &:after {
|
|
123
|
-
// content: '';
|
|
124
|
-
// display: block;
|
|
125
|
-
// height: 0;
|
|
126
|
-
// margin-bottom: -1px;
|
|
127
|
-
// }
|
|
128
|
-
|
|
129
|
-
// & > code,
|
|
130
|
-
// & > span {
|
|
131
|
-
// display: block;
|
|
132
|
-
// }
|
|
133
|
-
|
|
134
|
-
// &:not([hidden]) {
|
|
135
|
-
// display: block;
|
|
136
|
-
// }
|
|
137
|
-
|
|
138
|
-
// & svg:not([data-sanity-icon]) {
|
|
139
|
-
// /* todo */
|
|
140
|
-
// font-size: var(--font-custom-icon-size);
|
|
141
|
-
// /* font-size: calc(var(--font-custom-icon-size) / 16 * 1rem); */
|
|
142
|
-
// margin: var(--font-custom-icon-offset);
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
// & [data-sanity-icon] {
|
|
146
|
-
// /* todo */
|
|
147
|
-
// font-size: var(--font-icon-size);
|
|
148
|
-
// /* font-size: calc(var(--font-icon-size) / 16 * 1rem); */
|
|
149
|
-
// margin: var(--font-icon-offset);
|
|
150
|
-
// }
|
|
151
|
-
// }
|
|
92
|
+
export const fontStyle: Style = {layers: {primitive}}
|
|
@@ -1,49 +1,24 @@
|
|
|
1
|
+
import {SHADOW} from '@sanity/ui/theme'
|
|
2
|
+
|
|
1
3
|
import {_responsiveRule} from '../../_responsiveRule'
|
|
2
4
|
import type {Style, StyleRules} from '../../types'
|
|
3
5
|
import {vars} from '../../vars'
|
|
4
6
|
|
|
5
7
|
const util: StyleRules = {}
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`var(--shadow-2-ambient) ${vars.color.shadow.ambient}`,
|
|
22
|
-
].join(', '),
|
|
23
|
-
})
|
|
24
|
-
_responsiveRule(util, 'shadow-3', {
|
|
25
|
-
boxShadow: [
|
|
26
|
-
`var(--shadow-outline) ${vars.color.shadow.outline}`,
|
|
27
|
-
`var(--shadow-3-umbra) ${vars.color.shadow.umbra}`,
|
|
28
|
-
`var(--shadow-3-penumbra) ${vars.color.shadow.penumbra}`,
|
|
29
|
-
`var(--shadow-3-ambient) ${vars.color.shadow.ambient}`,
|
|
30
|
-
].join(', '),
|
|
31
|
-
})
|
|
32
|
-
_responsiveRule(util, 'shadow-4', {
|
|
33
|
-
boxShadow: [
|
|
34
|
-
`var(--shadow-outline) ${vars.color.shadow.outline}`,
|
|
35
|
-
`var(--shadow-4-umbra) ${vars.color.shadow.umbra}`,
|
|
36
|
-
`var(--shadow-4-penumbra) ${vars.color.shadow.penumbra}`,
|
|
37
|
-
`var(--shadow-4-ambient) ${vars.color.shadow.ambient}`,
|
|
38
|
-
].join(', '),
|
|
39
|
-
})
|
|
40
|
-
_responsiveRule(util, 'shadow-5', {
|
|
41
|
-
boxShadow: [
|
|
42
|
-
`var(--shadow-outline) ${vars.color.shadow.outline}`,
|
|
43
|
-
`var(--shadow-5-umbra) ${vars.color.shadow.umbra}`,
|
|
44
|
-
`var(--shadow-5-penumbra) ${vars.color.shadow.penumbra}`,
|
|
45
|
-
`var(--shadow-5-ambient) ${vars.color.shadow.ambient}`,
|
|
46
|
-
].join(', '),
|
|
47
|
-
})
|
|
9
|
+
for (const shadow of SHADOW) {
|
|
10
|
+
if (shadow === 0) {
|
|
11
|
+
_responsiveRule(util, 'shadow-0', {boxShadow: 'none'})
|
|
12
|
+
} else {
|
|
13
|
+
_responsiveRule(util, `shadow-${shadow}`, {
|
|
14
|
+
boxShadow: [
|
|
15
|
+
`0 0 0 ${vars.card.shadow.outline} ${vars.color.shadow.outline}`,
|
|
16
|
+
`${vars.shadow[shadow].umbra} ${vars.color.shadow.umbra}`,
|
|
17
|
+
`${vars.shadow[shadow].penumbra} ${vars.color.shadow.penumbra}`,
|
|
18
|
+
`${vars.shadow[shadow].ambient} ${vars.color.shadow.ambient}`,
|
|
19
|
+
].join(', '),
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
}
|
|
48
23
|
|
|
49
24
|
export const shadowStyle: Style = {layers: {util}}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {color} from '@sanity/color'
|
|
2
2
|
import {HUES, TINTS} from '@sanity/ui/theme'
|
|
3
3
|
|
|
4
|
+
import {varNames} from '../varNames'
|
|
4
5
|
import {compileRule} from './compileRule'
|
|
5
6
|
|
|
6
7
|
export function compilePalette(): string {
|
|
7
8
|
const props: Record<string, string> = {
|
|
8
9
|
...compileHues(),
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
[varNames.black]: color.black.hex,
|
|
12
|
+
[varNames.white]: color.white.hex,
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
return compileRule(':root', props, {keyframes: {}, media: {}})
|
|
@@ -19,7 +20,7 @@ function compileHues() {
|
|
|
19
20
|
|
|
20
21
|
for (const hue of HUES) {
|
|
21
22
|
for (const tint of TINTS) {
|
|
22
|
-
rules[
|
|
23
|
+
rules[varNames[hue][tint]] = color[hue][tint].hex
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
// import {rules} from '../rules'
|
|
2
1
|
import {systemStyle} from '../system.style'
|
|
3
2
|
import {compileStyle} from './compileStyle'
|
|
4
|
-
// import {compileRules} from './compileRules'
|
|
5
3
|
|
|
6
4
|
/** @public */
|
|
7
5
|
export function compileSystem(): string {
|
|
8
|
-
// return compileRules(rules)
|
|
9
6
|
return compileStyle(systemStyle)
|
|
10
7
|
}
|