@sanity/ui 2.0.13-alpha.2 → 2.0.14
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +84 -78
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +211 -205
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +84 -78
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.esm.js +587 -51
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +560 -22
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +587 -51
- package/dist/theme.mjs.map +1 -1
- package/package.json +27 -28
- package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -1
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +1 -1
- package/src/core/components/dialog/styles.ts +3 -3
- package/src/core/components/hotkeys/hotkeys.tsx +1 -1
- package/src/core/components/menu/menu.tsx +1 -1
- package/src/core/components/menu/menuDivider.ts +1 -1
- package/src/core/components/skeleton/skeleton.tsx +1 -1
- package/src/core/components/skeleton/textSkeleton.tsx +3 -3
- package/src/core/components/tab/tab.tsx +1 -1
- package/src/core/components/tab/tabList.tsx +1 -1
- package/src/core/components/toast/toast.tsx +1 -1
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/style.ts +3 -2
- package/src/core/components/tree/treeItem.tsx +1 -1
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +1 -1
- package/src/core/primitives/_selectable/selectable.tsx +1 -1
- package/src/core/primitives/_selectable/style.ts +2 -1
- package/src/core/primitives/avatar/avatar.tsx +1 -1
- package/src/core/primitives/avatar/avatarCounter.tsx +4 -3
- package/src/core/primitives/avatar/avatarStack.tsx +3 -2
- package/src/core/primitives/avatar/styles.ts +3 -3
- package/src/core/primitives/badge/badge.tsx +1 -1
- package/src/core/primitives/box/box.tsx +1 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/button.tsx +1 -1
- package/src/core/primitives/button/styles.ts +3 -3
- package/src/core/primitives/card/__workshop__/selected.tsx +3 -3
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/styles.ts +3 -2
- package/src/core/primitives/checkbox/checkbox.tsx +1 -1
- package/src/core/primitives/checkbox/styles.ts +2 -1
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/code/styles.ts +4 -1
- package/src/core/primitives/container/container.tsx +1 -1
- package/src/core/primitives/container/styles.ts +2 -2
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -1
- package/src/core/primitives/grid/grid.tsx +1 -1
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/heading/styles.ts +2 -1
- package/src/core/primitives/inline/inline.tsx +1 -1
- package/src/core/primitives/inline/styles.ts +2 -2
- package/src/core/primitives/kbd/kbd.tsx +1 -1
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/primitives/label/styles.ts +2 -1
- package/src/core/primitives/popover/popoverCard.tsx +1 -1
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +2 -1
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +5 -5
- package/src/core/primitives/spinner/spinner.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +1 -1
- package/src/core/primitives/stack/styles.ts +2 -2
- package/src/core/primitives/switch/styles.ts +4 -3
- package/src/core/primitives/switch/switch.tsx +1 -1
- package/src/core/primitives/text/__workshop__/colored.tsx +3 -3
- package/src/core/primitives/text/styles.ts +2 -1
- package/src/core/primitives/text/text.tsx +1 -1
- package/src/core/primitives/textArea/textArea.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +21 -12
- package/src/core/primitives/tooltip/tooltipCard.tsx +1 -1
- package/src/core/styles/border/borderStyle.ts +6 -6
- package/src/core/styles/box/boxStyle.ts +5 -5
- package/src/core/styles/flex/flexItemStyle.ts +2 -2
- package/src/core/styles/flex/flexStyle.ts +6 -6
- package/src/core/styles/font/responsiveFont.ts +2 -2
- package/src/core/styles/font/textAlignStyle.ts +2 -2
- package/src/core/styles/grid/gridItemStyle.ts +7 -7
- package/src/core/styles/grid/gridStyle.ts +9 -9
- package/src/core/styles/helpers.ts +2 -2
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +2 -2
- package/src/core/styles/input/textInputStyle.ts +4 -4
- package/src/core/styles/margin/marginsStyle.test.ts +1 -1
- package/src/core/styles/padding/paddingStyle.test.ts +1 -1
- package/src/core/styles/radius/radiusStyle.ts +2 -2
- package/src/core/styles/shadow/shadowStyle.ts +2 -2
- package/src/core/theme/__workshop__/build/Root.tsx +2 -1
- package/src/core/theme/theme.test.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +7 -6
- package/src/core/theme/useTheme.ts +1 -2
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +1 -1
- package/src/core/utils/srOnly/srOnly.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/theme/system/theme.ts +1 -1
- package/dist/_chunks-cjs/getScopedTheme.js +0 -547
- package/dist/_chunks-cjs/getScopedTheme.js.map +0 -1
- package/dist/_chunks-es/getScopedTheme.mjs +0 -548
- package/dist/_chunks-es/getScopedTheme.mjs.map +0 -1
- package/dist/_legacy/getScopedTheme.esm.js +0 -548
- package/dist/_legacy/getScopedTheme.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {CSSObject} from '@sanity/ui/theme'
|
|
1
|
+
import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {_responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveGridItemStyleProps} from './types'
|
|
@@ -27,7 +27,7 @@ const GRID_ITEM_COLUMN = {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function responsiveGridItemRowStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
30
|
-
const {media} = props.theme
|
|
30
|
+
const {media} = getTheme_v2(props.theme)
|
|
31
31
|
|
|
32
32
|
return _responsive(media, props.$row, (row) => {
|
|
33
33
|
if (typeof row === 'number') {
|
|
@@ -39,7 +39,7 @@ function responsiveGridItemRowStyle(props: ResponsiveGridItemStyleProps & ThemeP
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function responsiveGridItemRowStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
42
|
-
const {media} = props.theme
|
|
42
|
+
const {media} = getTheme_v2(props.theme)
|
|
43
43
|
|
|
44
44
|
return _responsive(media, props.$rowStart, (rowStart) => ({
|
|
45
45
|
gridRowStart: rowStart,
|
|
@@ -47,13 +47,13 @@ function responsiveGridItemRowStartStyle(props: ResponsiveGridItemStyleProps & T
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function responsiveGridItemRowEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
50
|
-
const {media} = props.theme
|
|
50
|
+
const {media} = getTheme_v2(props.theme)
|
|
51
51
|
|
|
52
52
|
return _responsive(media, props.$rowEnd, (rowEnd) => ({gridRowEnd: rowEnd}))
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function responsiveGridItemColumnStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
56
|
-
const {media} = props.theme
|
|
56
|
+
const {media} = getTheme_v2(props.theme)
|
|
57
57
|
|
|
58
58
|
return _responsive(media, props.$column, (column) => {
|
|
59
59
|
if (typeof column === 'number') {
|
|
@@ -65,7 +65,7 @@ function responsiveGridItemColumnStyle(props: ResponsiveGridItemStyleProps & The
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
function responsiveGridItemColumnStartStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
68
|
-
const {media} = props.theme
|
|
68
|
+
const {media} = getTheme_v2(props.theme)
|
|
69
69
|
|
|
70
70
|
return _responsive(media, props.$columnStart, (columnStart) => ({
|
|
71
71
|
gridColumnStart: columnStart,
|
|
@@ -73,7 +73,7 @@ function responsiveGridItemColumnStartStyle(props: ResponsiveGridItemStyleProps
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function responsiveGridItemColumnEndStyle(props: ResponsiveGridItemStyleProps & ThemeProps) {
|
|
76
|
-
const {media} = props.theme
|
|
76
|
+
const {media} = getTheme_v2(props.theme)
|
|
77
77
|
|
|
78
78
|
return _responsive(media, props.$columnEnd, (columnEnd) => ({
|
|
79
79
|
gridColumnEnd: columnEnd,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {CSSObject} from '@sanity/ui/theme'
|
|
1
|
+
import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {rem, _responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveGridStyleProps} from './types'
|
|
@@ -43,7 +43,7 @@ export function responsiveGridStyle(): Array<
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
function responsiveGridAutoFlowStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
46
|
-
const {media} = props.theme
|
|
46
|
+
const {media} = getTheme_v2(props.theme)
|
|
47
47
|
|
|
48
48
|
return _responsive(media, props.$autoFlow, (autoFlow) => ({
|
|
49
49
|
gridAutoFlow: autoFlow,
|
|
@@ -51,7 +51,7 @@ function responsiveGridAutoFlowStyle(props: ResponsiveGridStyleProps & ThemeProp
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function responsiveGridAutoRowsStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
54
|
-
const {media} = props.theme
|
|
54
|
+
const {media} = getTheme_v2(props.theme)
|
|
55
55
|
|
|
56
56
|
return _responsive(media, props.$autoRows, (autoRows) => ({
|
|
57
57
|
gridAutoRows: autoRows && GRID_AUTO_ROWS[autoRows],
|
|
@@ -59,7 +59,7 @@ function responsiveGridAutoRowsStyle(props: ResponsiveGridStyleProps & ThemeProp
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
function responsiveGridAutoColsStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
62
|
-
const {media} = props.theme
|
|
62
|
+
const {media} = getTheme_v2(props.theme)
|
|
63
63
|
|
|
64
64
|
return _responsive(media, props.$autoCols, (autoCols) => ({
|
|
65
65
|
gridAutoColumns: autoCols && GRID_AUTO_COLUMS[autoCols],
|
|
@@ -67,7 +67,7 @@ function responsiveGridAutoColsStyle(props: ResponsiveGridStyleProps & ThemeProp
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function responsiveGridColumnsStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
70
|
-
const {media} = props.theme
|
|
70
|
+
const {media} = getTheme_v2(props.theme)
|
|
71
71
|
|
|
72
72
|
return _responsive(media, props.$columns, (columns) => ({
|
|
73
73
|
gridTemplateColumns: columns && `repeat(${columns},minmax(0,1fr));`,
|
|
@@ -75,7 +75,7 @@ function responsiveGridColumnsStyle(props: ResponsiveGridStyleProps & ThemeProps
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function responsiveGridRowsStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
78
|
-
const {media} = props.theme
|
|
78
|
+
const {media} = getTheme_v2(props.theme)
|
|
79
79
|
|
|
80
80
|
return _responsive(media, props.$rows, (rows) => ({
|
|
81
81
|
gridTemplateRows: rows && `repeat(${rows},minmax(0,1fr));`,
|
|
@@ -83,7 +83,7 @@ function responsiveGridRowsStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
function responsiveGridGapStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
86
|
-
const {media, space} = props.theme
|
|
86
|
+
const {media, space} = getTheme_v2(props.theme)
|
|
87
87
|
|
|
88
88
|
return _responsive(media, props.$gap, (gap) => ({
|
|
89
89
|
gridGap: gap ? rem(space[gap]) : undefined,
|
|
@@ -91,7 +91,7 @@ function responsiveGridGapStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
function responsiveGridGapXStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
94
|
-
const {media, space} = props.theme
|
|
94
|
+
const {media, space} = getTheme_v2(props.theme)
|
|
95
95
|
|
|
96
96
|
return _responsive(media, props.$gapX, (gapX) => ({
|
|
97
97
|
columnGap: gapX ? rem(space[gapX]) : undefined,
|
|
@@ -99,7 +99,7 @@ function responsiveGridGapXStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function responsiveGridGapYStyle(props: ResponsiveGridStyleProps & ThemeProps) {
|
|
102
|
-
const {media, space} = props.theme
|
|
102
|
+
const {media, space} = getTheme_v2(props.theme)
|
|
103
103
|
|
|
104
104
|
return _responsive(media, props.$gapY, (gapY) => ({
|
|
105
105
|
rowGap: gapY ? rem(space[gapY]) : undefined,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Theme} from '@sanity/ui/theme'
|
|
1
|
+
import {Theme, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {CSSObject} from '@sanity/ui/theme'
|
|
3
3
|
import {EMPTY_ARRAY} from '../constants'
|
|
4
4
|
|
|
@@ -64,7 +64,7 @@ export function _getResponsiveSpace(
|
|
|
64
64
|
return null
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const {media, space} = theme
|
|
67
|
+
const {media, space} = getTheme_v2(theme)
|
|
68
68
|
|
|
69
69
|
return _responsive(media, spaceIndexes, (spaceIndex) =>
|
|
70
70
|
_fillCSSObject(props, rem(space[spaceIndex])),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {CSSObject} from '@sanity/ui/theme'
|
|
1
|
+
import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {rem, _responsive} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ export function responsiveInputPaddingStyle(
|
|
|
14
14
|
props: TextInputResponsivePaddingStyleProps & ThemeProps,
|
|
15
15
|
): CSSObject[] {
|
|
16
16
|
const {$fontSize, $iconLeft, $iconRight, $padding, $space} = props
|
|
17
|
-
const {font, media, space} = props.theme
|
|
17
|
+
const {font, media, space} = getTheme_v2(props.theme)
|
|
18
18
|
const len = Math.max($padding.length, $space.length, $fontSize.length)
|
|
19
19
|
const _padding: number[] = []
|
|
20
20
|
const _space: number[] = []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ThemeColorSchemeKey, ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
1
|
+
import {ThemeColorSchemeKey, ThemeFontWeightKey, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {CSSObject} from '@sanity/ui/theme'
|
|
3
3
|
import {css} from 'styled-components'
|
|
4
4
|
import {CardTone} from '../../types'
|
|
@@ -43,7 +43,7 @@ export function textInputBaseStyle(
|
|
|
43
43
|
props: TextInputInputStyleProps & ThemeProps,
|
|
44
44
|
): ReturnType<typeof css> {
|
|
45
45
|
const {$scheme, $tone, $weight} = props
|
|
46
|
-
const {color, font} = props.theme
|
|
46
|
+
const {color, font} = getTheme_v2(props.theme)
|
|
47
47
|
|
|
48
48
|
return css`
|
|
49
49
|
appearance: none;
|
|
@@ -113,7 +113,7 @@ export function textInputBaseStyle(
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export function textInputFontSizeStyle(props: TextInputInputStyleProps & ThemeProps): CSSObject[] {
|
|
116
|
-
const {font, media} = props.theme
|
|
116
|
+
const {font, media} = getTheme_v2(props.theme)
|
|
117
117
|
|
|
118
118
|
return _responsive(media, props.$fontSize, (sizeIndex) => {
|
|
119
119
|
const size = font.text.sizes[sizeIndex] || font.text.sizes[2]
|
|
@@ -129,7 +129,7 @@ export function textInputRepresentationStyle(
|
|
|
129
129
|
props: TextInputRepresentationStyleProps & ThemeProps,
|
|
130
130
|
): ReturnType<typeof css> {
|
|
131
131
|
const {$hasPrefix, $hasSuffix, $scheme, $tone, $unstableDisableFocusRing} = props
|
|
132
|
-
const {color, input} = props.theme
|
|
132
|
+
const {color, input} = getTheme_v2(props.theme)
|
|
133
133
|
|
|
134
134
|
return css`
|
|
135
135
|
--input-box-shadow: none;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jest-environment jsdom */
|
|
2
2
|
|
|
3
|
-
import {buildTheme, getScopedTheme} from '
|
|
3
|
+
import {buildTheme, getScopedTheme} from '@sanity/ui/theme'
|
|
4
4
|
import {responsiveMarginStyle} from './marginStyle'
|
|
5
5
|
|
|
6
6
|
const theme = getScopedTheme(buildTheme(), 'light', 'default')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jest-environment jsdom */
|
|
2
2
|
|
|
3
|
-
import {buildTheme, getScopedTheme} from '
|
|
3
|
+
import {buildTheme, getScopedTheme} from '@sanity/ui/theme'
|
|
4
4
|
import {responsivePaddingStyle} from './paddingStyle'
|
|
5
5
|
|
|
6
6
|
const theme = getScopedTheme(buildTheme(), 'light', 'default')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {CSSObject} from '@sanity/ui/theme'
|
|
1
|
+
import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {_responsive, rem} from '../helpers'
|
|
3
3
|
import {ThemeProps} from '../types'
|
|
4
4
|
import {ResponsiveRadiusStyleProps} from './types'
|
|
5
5
|
|
|
6
6
|
export function responsiveRadiusStyle(props: ResponsiveRadiusStyleProps & ThemeProps): CSSObject[] {
|
|
7
|
-
const {media, radius} = props.theme
|
|
7
|
+
const {media, radius} = getTheme_v2(props.theme)
|
|
8
8
|
|
|
9
9
|
return _responsive(media, props.$radius, (value) => {
|
|
10
10
|
let borderRadius: string | 0 = 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {ThemeBoxShadow, ThemeShadow} from '@sanity/ui/theme'
|
|
1
|
+
import {ThemeBoxShadow, ThemeShadow, getTheme_v2} from '@sanity/ui/theme'
|
|
2
2
|
import {CSSObject} from '@sanity/ui/theme'
|
|
3
3
|
import {EMPTY_RECORD} from '../../constants'
|
|
4
4
|
import {rem, _responsive} from '../helpers'
|
|
@@ -21,7 +21,7 @@ function shadowStyle(shadow: ThemeShadow | null, outlineWidth: number = 1): CSSO
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export function responsiveShadowStyle(props: ResponsiveShadowStyleProps & ThemeProps): CSSObject[] {
|
|
24
|
-
const {card, media, shadow} = props.theme
|
|
24
|
+
const {card, media, shadow} = getTheme_v2(props.theme)
|
|
25
25
|
|
|
26
26
|
return _responsive(media, props.$shadow, (index) =>
|
|
27
27
|
shadowStyle(shadow[index], card.shadow.outline),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {css, styled} from 'styled-components'
|
|
2
|
+
import {getTheme_v2} from '../../../../theme'
|
|
2
3
|
|
|
3
4
|
export const Root = styled.div((props) => {
|
|
4
|
-
const {button, card, input} = props.theme
|
|
5
|
+
const {button, card, input} = getTheme_v2(props.theme)
|
|
5
6
|
|
|
6
7
|
return css`
|
|
7
8
|
background: #000;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jest-environment jsdom */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
3
|
|
|
4
|
+
import {buildTheme} from '@sanity/ui/theme'
|
|
4
5
|
import {render} from '../../../test'
|
|
5
|
-
import {buildTheme} from '../../theme'
|
|
6
6
|
import {ThemeContext} from './themeContext'
|
|
7
7
|
import {ThemeContextValue} from './types'
|
|
8
8
|
import {useRootTheme} from './useRootTheme'
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
RootTheme,
|
|
3
|
+
ThemeColorCardToneKey,
|
|
4
|
+
ThemeColorSchemeKey,
|
|
5
|
+
Theme,
|
|
6
|
+
getScopedTheme,
|
|
7
|
+
} from '@sanity/ui/theme'
|
|
2
8
|
import {useContext, useMemo} from 'react'
|
|
3
9
|
import {ThemeProvider as StyledThemeProvider} from 'styled-components'
|
|
4
|
-
import {getScopedTheme} from '../../theme'
|
|
5
10
|
import {ThemeContext} from './themeContext'
|
|
6
11
|
import {ThemeContextValue} from './types'
|
|
7
12
|
|
|
@@ -48,10 +53,6 @@ export function ThemeProvider(props: ThemeProviderProps): React.ReactElement {
|
|
|
48
53
|
return <pre>ThemeProvider: no "theme" property provided</pre>
|
|
49
54
|
}
|
|
50
55
|
|
|
51
|
-
if (!theme.sanity.v2) {
|
|
52
|
-
return <pre>ThemeProvider: no "theme.sanity.v2" property in theme</pre>
|
|
53
|
-
}
|
|
54
|
-
|
|
55
56
|
return (
|
|
56
57
|
<ThemeContext.Provider value={themeContext}>
|
|
57
58
|
<StyledThemeProvider theme={theme}>{children}</StyledThemeProvider>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ForwardedRef, HTMLProps, ReactElement, forwardRef} from 'react'
|
|
2
|
-
import styled,
|
|
2
|
+
import {styled, css} from 'styled-components'
|
|
3
3
|
import {useTheme_v2} from '../../theme'
|
|
4
4
|
import {Point, compileCommands, getRoundedCommands} from './cmds'
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {FocusEvent, forwardRef, useCallback, useEffect, useRef} from 'react'
|
|
2
|
-
import styled from 'styled-components'
|
|
2
|
+
import {styled} from 'styled-components'
|
|
3
3
|
import {EMPTY_RECORD} from '../../constants'
|
|
4
4
|
import {containsOrEqualsElement, isHTMLElement} from '../../helpers'
|
|
5
5
|
import {useForwardedRef} from '../../hooks'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import {forwardRef, useEffect, useMemo, useRef, useState} from 'react'
|
|
3
|
-
import styled from 'styled-components'
|
|
3
|
+
import {styled} from 'styled-components'
|
|
4
4
|
import {_isScrollable} from '../../helpers'
|
|
5
5
|
import {useForwardedRef} from '../../hooks'
|
|
6
6
|
import {_ResizeObserver} from '../../observers'
|