sanity-plugin-media 3.0.0 → 3.0.2

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.
Files changed (45) hide show
  1. package/dist/index.d.mts +7 -4
  2. package/dist/index.d.ts +7 -4
  3. package/dist/index.js +436 -265
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +455 -285
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +26 -30
  8. package/src/components/AssetGridVirtualized/index.tsx +13 -2
  9. package/src/components/Browser/index.tsx +30 -41
  10. package/src/components/ButtonViewGroup/index.tsx +0 -1
  11. package/src/components/CardAsset/index.tsx +13 -14
  12. package/src/components/CardUpload/index.tsx +1 -1
  13. package/src/components/Controls/index.tsx +0 -1
  14. package/src/components/DebugControls/index.tsx +1 -0
  15. package/src/components/DialogAssetEdit/index.tsx +10 -3
  16. package/src/components/DialogConfirm/index.tsx +8 -1
  17. package/src/components/DialogSearchFacets/index.tsx +1 -1
  18. package/src/components/DialogTagCreate/index.tsx +1 -1
  19. package/src/components/DialogTagEdit/index.tsx +1 -1
  20. package/src/components/DialogTags/index.tsx +1 -1
  21. package/src/components/Dialogs/index.tsx +1 -1
  22. package/src/components/DocumentList/index.tsx +1 -1
  23. package/src/components/FileAssetPreview/index.tsx +1 -1
  24. package/src/components/FormFieldInputLabel/index.tsx +2 -1
  25. package/src/components/FormSubmitButton/index.tsx +1 -0
  26. package/src/components/Header/index.tsx +1 -1
  27. package/src/components/Image/index.tsx +4 -4
  28. package/src/components/OrderSelect/index.tsx +0 -1
  29. package/src/components/ReduxProvider/index.tsx +0 -1
  30. package/src/components/SearchFacet/index.tsx +4 -9
  31. package/src/components/SearchFacetNumber/index.tsx +1 -1
  32. package/src/components/SearchFacetSelect/index.tsx +1 -1
  33. package/src/components/SearchFacets/index.tsx +1 -1
  34. package/src/components/SearchFacetsControl/index.tsx +1 -1
  35. package/src/components/TableHeader/index.tsx +4 -6
  36. package/src/components/TableHeaderItem/index.tsx +1 -1
  37. package/src/components/TableRowAsset/index.tsx +37 -45
  38. package/src/components/TableRowUpload/index.tsx +6 -1
  39. package/src/components/Tag/index.tsx +1 -0
  40. package/src/components/TagIcon/index.tsx +0 -2
  41. package/src/components/TagView/index.tsx +1 -1
  42. package/src/components/TagsPanel/index.tsx +1 -1
  43. package/src/components/Tool/index.tsx +1 -1
  44. package/src/hooks/usePortalPopoverProps.ts +1 -0
  45. package/src/plugin.tsx +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-media",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "This version of `sanity-plugin-media` is for Sanity Studio V3.",
5
5
  "keywords": [
6
6
  "sanity",
@@ -63,56 +63,56 @@
63
63
  "@sanity/uuid": "^3.0.1",
64
64
  "@tanem/react-nprogress": "^5.0.55",
65
65
  "copy-to-clipboard": "^3.3.1",
66
- "date-fns": "^2.27.0",
66
+ "date-fns": "^4.0.0",
67
67
  "filesize": "^9.0.0",
68
68
  "groq": "^3.0.0",
69
- "is-hotkey": "^0.2.0",
69
+ "is-hotkey-esm": "^1.0.0",
70
70
  "nanoid": "^3.3.8",
71
71
  "pluralize": "^8.0.0",
72
72
  "react-dropzone": "^11.3.1",
73
73
  "react-file-icon": "^1.6.0",
74
74
  "react-hook-form": "^7.54.2",
75
75
  "react-redux": "^9.2.0",
76
- "react-select": "^5.3.2",
77
- "react-virtuoso": "^4.3.11",
76
+ "react-select": "^5.10.1",
77
+ "react-virtuoso": "^4.12.5",
78
78
  "redux": "^5.0.1",
79
- "redux-observable": "^3.0.0-rc.2",
79
+ "redux-observable": "3.0.0-rc.2",
80
80
  "rxjs": "^7.8.1",
81
81
  "zod": "^3.21.4"
82
82
  },
83
83
  "devDependencies": {
84
- "@commitlint/cli": "^17.2.0",
85
- "@commitlint/config-conventional": "^17.2.0",
86
- "@sanity/pkg-utils": "^7.0.3",
84
+ "@commitlint/cli": "^17.8.1",
85
+ "@commitlint/config-conventional": "^17.8.1",
86
+ "@sanity/pkg-utils": "^7.1.1",
87
87
  "@sanity/plugin-kit": "^4.0.19",
88
- "@sanity/semantic-release-preset": "^2.0.2",
89
- "@sanity/vision": "^3.78.1",
90
- "@types/is-hotkey": "^0.1.7",
91
- "@types/pluralize": "^0.0.29",
92
- "@types/react": "^19.0.10",
88
+ "@sanity/semantic-release-preset": "^2.0.5",
89
+ "@sanity/vision": "^3.80.1",
90
+ "@types/is-hotkey": "^0.1.10",
91
+ "@types/pluralize": "^0.0.33",
92
+ "@types/react": "^19.0.12",
93
93
  "@types/react-dom": "^19.0.4",
94
- "@types/react-file-icon": "^1.0.1",
95
- "@typescript-eslint/eslint-plugin": "^5.42.0",
96
- "@typescript-eslint/parser": "^5.42.0",
94
+ "@types/react-file-icon": "^1.0.4",
95
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
96
+ "@typescript-eslint/parser": "^5.62.0",
97
97
  "conventional-changelog-conventionalcommits": "^5.0.0",
98
- "eslint": "^8.27.0",
99
- "eslint-config-prettier": "^8.5.0",
98
+ "eslint": "^8.57.1",
99
+ "eslint-config-prettier": "^8.10.0",
100
100
  "eslint-config-sanity": "^6.0.0",
101
101
  "eslint-plugin-prettier": "^4.2.1",
102
- "eslint-plugin-react": "^7.31.10",
103
- "eslint-plugin-react-hooks": "^4.6.0",
102
+ "eslint-plugin-react": "^7.37.4",
103
+ "eslint-plugin-react-hooks": "^4.6.2",
104
104
  "husky": "^8.0.2",
105
105
  "lint-staged": "^13.0.3",
106
- "prettier": "^2.7.1",
107
- "prettier-plugin-packagejson": "^2.3.0",
106
+ "prettier": "^2.8.8",
107
+ "prettier-plugin-packagejson": "^2.5.10",
108
108
  "react": "^19.0.0",
109
109
  "react-dom": "^19.0.0",
110
110
  "react-is": "^19.0.0",
111
111
  "rimraf": "^3.0.2",
112
- "sanity": "^3.78.1",
112
+ "sanity": "^3.80.1",
113
113
  "standard-version": "^9.5.0",
114
- "styled-components": "^6.1.15",
115
- "typescript": "5.7.3"
114
+ "styled-components": "^6.1.16",
115
+ "typescript": "5.8.2"
116
116
  },
117
117
  "peerDependencies": {
118
118
  "@sanity/ui": "^2.15",
@@ -122,10 +122,6 @@
122
122
  "sanity": "^3.78",
123
123
  "styled-components": "^6.1"
124
124
  },
125
- "overrides": {
126
- "react": "$react",
127
- "react-dom": "$react-dom"
128
- },
129
125
  "engines": {
130
126
  "node": ">=18"
131
127
  }
@@ -28,18 +28,29 @@ const VirtualCell = memo(
28
28
  }
29
29
  )
30
30
 
31
- const ItemContainer = styled.div`
31
+ const StyledItemContainer = styled.div`
32
32
  height: ${CARD_HEIGHT}px;
33
33
  width: ${CARD_WIDTH}px;
34
34
  `
35
35
 
36
- const ListContainer = styled.div`
36
+ function ItemContainer(props: any) {
37
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- we're doing this to avoid sc warnings about `context` passed as an attribute
38
+ const {context, ...rest} = props
39
+ return <StyledItemContainer {...rest} />
40
+ }
41
+
42
+ const StyledListContainer = styled.div`
37
43
  display: grid;
38
44
  grid-template-columns: repeat(auto-fill, ${CARD_WIDTH}px);
39
45
  grid-template-rows: repeat(auto-fill, ${CARD_HEIGHT}px);
40
46
  justify-content: center;
41
47
  margin: 0 auto;
42
48
  `
49
+ function ListContainer(props: any) {
50
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- we're doing this to avoid sc warnings about `context` passed as an attribute
51
+ const {context, ...rest} = props
52
+ return <StyledListContainer {...rest} />
53
+ }
43
54
 
44
55
  const AssetGridVirtualized = (props: Props) => {
45
56
  const {items, onLoadMore} = props
@@ -1,10 +1,10 @@
1
1
  import type {MutationEvent} from '@sanity/client'
2
- import {Card, Flex, PortalProvider, studioTheme, ThemeProvider, ToastProvider} from '@sanity/ui'
2
+ import {Card, Flex, PortalProvider} from '@sanity/ui'
3
3
  import type {Asset, Tag} from '../../types'
4
4
  import groq from 'groq'
5
5
  import {useEffect, useState} from 'react'
6
6
  import {useDispatch} from 'react-redux'
7
- import {useColorSchemeValue, type AssetSourceComponentProps, type SanityDocument} from 'sanity'
7
+ import {type AssetSourceComponentProps, type SanityDocument} from 'sanity'
8
8
  import {TAG_DOCUMENT_NAME} from '../../constants'
9
9
  import {AssetBrowserDispatchProvider} from '../../contexts/AssetSourceDispatchContext'
10
10
  import useVersionedClient from '../../hooks/useVersionedClient'
@@ -32,47 +32,42 @@ type Props = {
32
32
 
33
33
  const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose']}) => {
34
34
  const client = useVersionedClient()
35
-
36
35
  const [portalElement, setPortalElement] = useState<HTMLDivElement | null>(null)
37
-
38
- // Redux
39
36
  const dispatch = useDispatch()
40
37
 
41
- // Callbacks
42
- const handleAssetUpdate = (update: MutationEvent) => {
43
- const {documentId, result, transition} = update
38
+ useEffect(() => {
39
+ const handleAssetUpdate = (update: MutationEvent) => {
40
+ const {documentId, result, transition} = update
44
41
 
45
- if (transition === 'appear') {
46
- dispatch(assetsActions.listenerCreateQueue({asset: result as Asset}))
47
- }
42
+ if (transition === 'appear') {
43
+ dispatch(assetsActions.listenerCreateQueue({asset: result as Asset}))
44
+ }
48
45
 
49
- if (transition === 'disappear') {
50
- dispatch(assetsActions.listenerDeleteQueue({assetId: documentId}))
51
- }
46
+ if (transition === 'disappear') {
47
+ dispatch(assetsActions.listenerDeleteQueue({assetId: documentId}))
48
+ }
52
49
 
53
- if (transition === 'update') {
54
- dispatch(assetsActions.listenerUpdateQueue({asset: result as Asset}))
50
+ if (transition === 'update') {
51
+ dispatch(assetsActions.listenerUpdateQueue({asset: result as Asset}))
52
+ }
55
53
  }
56
- }
57
54
 
58
- const handleTagUpdate = (update: MutationEvent) => {
59
- const {documentId, result, transition} = update
55
+ const handleTagUpdate = (update: MutationEvent) => {
56
+ const {documentId, result, transition} = update
60
57
 
61
- if (transition === 'appear') {
62
- dispatch(tagsActions.listenerCreateQueue({tag: result as Tag}))
63
- }
58
+ if (transition === 'appear') {
59
+ dispatch(tagsActions.listenerCreateQueue({tag: result as Tag}))
60
+ }
64
61
 
65
- if (transition === 'disappear') {
66
- dispatch(tagsActions.listenerDeleteQueue({tagId: documentId}))
67
- }
62
+ if (transition === 'disappear') {
63
+ dispatch(tagsActions.listenerDeleteQueue({tagId: documentId}))
64
+ }
68
65
 
69
- if (transition === 'update') {
70
- dispatch(tagsActions.listenerUpdateQueue({tag: result as Tag}))
66
+ if (transition === 'update') {
67
+ dispatch(tagsActions.listenerUpdateQueue({tag: result as Tag}))
68
+ }
71
69
  }
72
- }
73
70
 
74
- // Effects
75
- useEffect(() => {
76
71
  // Fetch assets: first page
77
72
  dispatch(assetsActions.loadPageIndex({pageIndex: 0}))
78
73
 
@@ -97,7 +92,7 @@ const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose
97
92
  subscriptionAsset?.unsubscribe()
98
93
  subscriptionTag?.unsubscribe()
99
94
  }
100
- }, [])
95
+ }, [client, dispatch])
101
96
 
102
97
  return (
103
98
  <PortalProvider element={portalElement}>
@@ -132,7 +127,6 @@ const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose
132
127
 
133
128
  const Browser = (props: Props) => {
134
129
  const client = useVersionedClient()
135
- const scheme = useColorSchemeValue()
136
130
 
137
131
  return (
138
132
  <ReduxProvider
@@ -141,15 +135,10 @@ const Browser = (props: Props) => {
141
135
  document={props?.document}
142
136
  selectedAssets={props?.selectedAssets}
143
137
  >
144
- <ThemeProvider scheme={scheme} theme={studioTheme}>
145
- <ToastProvider>
146
- <AssetBrowserDispatchProvider onSelect={props?.onSelect}>
147
- <GlobalStyle />
148
-
149
- <BrowserContent onClose={props?.onClose} />
150
- </AssetBrowserDispatchProvider>
151
- </ToastProvider>
152
- </ThemeProvider>
138
+ <AssetBrowserDispatchProvider onSelect={props?.onSelect}>
139
+ <GlobalStyle />
140
+ <BrowserContent onClose={props?.onClose} />
141
+ </AssetBrowserDispatchProvider>
153
142
  </ReduxProvider>
154
143
  )
155
144
  }
@@ -1,6 +1,5 @@
1
1
  import {ThLargeIcon, ThListIcon} from '@sanity/icons'
2
2
  import {Button, Inline} from '@sanity/ui'
3
- import React from 'react'
4
3
  import {useDispatch} from 'react-redux'
5
4
  import useTypedSelector from '../../hooks/useTypedSelector'
6
5
  import {assetsActions} from '../../modules/assets'
@@ -39,22 +39,22 @@ const CardWrapper = styled(Flex)`
39
39
  width: 100%;
40
40
  `
41
41
 
42
- const CardContainer = styled(Flex)<{picked?: boolean; theme: Theme; updating?: boolean}>(
43
- ({picked, theme, updating}) => {
42
+ const CardContainer = styled(Flex)<{$picked?: boolean; theme: Theme; $updating?: boolean}>(
43
+ ({$picked, theme, $updating}) => {
44
44
  return css`
45
45
  border: 1px solid transparent;
46
46
  height: 100%;
47
- pointer-events: ${updating ? 'none' : 'auto'};
47
+ pointer-events: ${$updating ? 'none' : 'auto'};
48
48
  position: relative;
49
49
  transition: all 300ms;
50
50
  user-select: none;
51
51
  width: 100%;
52
52
 
53
- border: ${picked
53
+ border: ${$picked
54
54
  ? `1px solid ${theme.sanity.color.spot.orange} !important`
55
55
  : '1px solid inherit'};
56
56
 
57
- ${!updating &&
57
+ ${!$updating &&
58
58
  css`
59
59
  @media (hover: hover) and (pointer: fine) {
60
60
  &:hover {
@@ -66,16 +66,15 @@ const CardContainer = styled(Flex)<{picked?: boolean; theme: Theme; updating?: b
66
66
  }
67
67
  )
68
68
 
69
- const ContextActionContainer = styled(Flex)(
70
- // @ts-expect-error - fix typings later
71
- ({scheme}: {scheme: ThemeColorSchemeKey}) => {
69
+ const ContextActionContainer = styled<typeof Flex, {$scheme: ThemeColorSchemeKey}>(Flex)(
70
+ ({$scheme}) => {
72
71
  return css`
73
72
  cursor: pointer;
74
73
  height: ${PANEL_HEIGHT}px;
75
74
  transition: all 300ms;
76
75
  @media (hover: hover) and (pointer: fine) {
77
76
  &:hover {
78
- background: ${getSchemeColor(scheme, 'bg')};
77
+ background: ${getSchemeColor($scheme, 'bg')};
79
78
  }
80
79
  }
81
80
  `
@@ -153,7 +152,7 @@ const CardAsset = (props: Props) => {
153
152
 
154
153
  return (
155
154
  <CardWrapper padding={1}>
156
- <CardContainer direction="column" picked={picked} updating={item.updating}>
155
+ <CardContainer direction="column" $picked={picked} $updating={item.updating}>
157
156
  {/* Image */}
158
157
  <Box
159
158
  flex={1}
@@ -170,8 +169,8 @@ const CardAsset = (props: Props) => {
170
169
  {isImageAsset(asset) && (
171
170
  <Image
172
171
  draggable={false}
173
- scheme={scheme}
174
- showCheckerboard={!isOpaque}
172
+ $scheme={scheme}
173
+ $showCheckerboard={!isOpaque}
175
174
  src={imageDprUrl(asset, {height: 250, width: 250})}
176
175
  style={{
177
176
  draggable: false,
@@ -224,8 +223,7 @@ const CardAsset = (props: Props) => {
224
223
  align="center"
225
224
  onClick={handleContextActionClick}
226
225
  paddingX={1}
227
- // @ts-expect-error - fix typings later
228
- scheme={scheme}
226
+ $scheme={scheme}
229
227
  style={{opacity: opacityContainer}}
230
228
  >
231
229
  {onSelect ? (
@@ -266,6 +264,7 @@ const CardAsset = (props: Props) => {
266
264
  }}
267
265
  >
268
266
  <Tooltip
267
+ animate
269
268
  content={
270
269
  <Container padding={2} width={0}>
271
270
  <Text size={1}>{error}</Text>
@@ -90,7 +90,7 @@ const CardUpload = (props: Props) => {
90
90
  {item.assetType === 'image' && item?.objectUrl && (
91
91
  <Image
92
92
  draggable={false}
93
- scheme={scheme}
93
+ $scheme={scheme}
94
94
  src={item.objectUrl}
95
95
  style={{
96
96
  opacity: 0.4
@@ -1,5 +1,4 @@
1
1
  import {Box, Button, Flex, Inline, useMediaIndex} from '@sanity/ui'
2
- import React from 'react'
3
2
  import {useDispatch} from 'react-redux'
4
3
  import useTypedSelector from '../../hooks/useTypedSelector'
5
4
  import {dialogActions} from '../../modules/dialog'
@@ -49,6 +49,7 @@ const DebugControls = () => {
49
49
  </Text>
50
50
  </Box>
51
51
  <Tooltip
52
+ animate
52
53
  content={
53
54
  <Box padding={2}>
54
55
  <Text muted size={1}>
@@ -240,7 +240,14 @@ const DialogAssetEdit = (props: Props) => {
240
240
  }
241
241
 
242
242
  return (
243
- <Dialog footer={<Footer />} header="Asset details" id={id} onClose={handleClose} width={3}>
243
+ <Dialog
244
+ animate
245
+ footer={<Footer />}
246
+ header="Asset details"
247
+ id={id}
248
+ onClose={handleClose}
249
+ width={3}
250
+ >
244
251
  {/*
245
252
  We reverse direction to ensure the download button doesn't appear (in the DOM) before other tabbable items.
246
253
  This ensures that the dialog doesn't scroll down to the download button (which on smaller screens, can sometimes
@@ -395,8 +402,8 @@ const DialogAssetEdit = (props: Props) => {
395
402
  {isImageAsset(currentAsset) && (
396
403
  <Image
397
404
  draggable={false}
398
- scheme={scheme}
399
- showCheckerboard={!currentAsset?.metadata?.isOpaque}
405
+ $scheme={scheme}
406
+ $showCheckerboard={!currentAsset?.metadata?.isOpaque}
400
407
  src={imageDprUrl(currentAsset, {height: 600, width: 600})}
401
408
  />
402
409
  )}
@@ -60,7 +60,14 @@ const DialogConfirm = (props: Props) => {
60
60
  )
61
61
 
62
62
  return (
63
- <Dialog footer={<Footer />} header={<Header />} id="confirm" onClose={handleClose} width={1}>
63
+ <Dialog
64
+ animate
65
+ footer={<Footer />}
66
+ header={<Header />}
67
+ id="confirm"
68
+ onClose={handleClose}
69
+ width={1}
70
+ >
64
71
  <Box paddingX={4} paddingY={4}>
65
72
  <Stack space={3}>
66
73
  {dialog?.title && <Text size={1}>{dialog.title}</Text>}
@@ -27,7 +27,7 @@ const DialogSearchFacets = (props: Props) => {
27
27
  }, [])
28
28
 
29
29
  return (
30
- <Dialog header="Filters" id={id} onClose={handleClose} width={1}>
30
+ <Dialog animate header="Filters" id={id} onClose={handleClose} width={1}>
31
31
  <Box padding={3}>
32
32
  <SearchFacets layout="stack" />
33
33
  <SearchFacetsControl />
@@ -78,7 +78,7 @@ const DialogTagCreate = (props: Props) => {
78
78
  )
79
79
 
80
80
  return (
81
- <Dialog footer={<Footer />} header="Create Tag" id={id} onClose={handleClose} width={1}>
81
+ <Dialog animate footer={<Footer />} header="Create Tag" id={id} onClose={handleClose} width={1}>
82
82
  {/* Form fields */}
83
83
  <Box as="form" padding={4} onSubmit={handleSubmit(onSubmit)}>
84
84
  {/* Hidden button to enable enter key submissions */}
@@ -158,7 +158,7 @@ const DialogTagEdit = (props: Props) => {
158
158
  }
159
159
 
160
160
  return (
161
- <Dialog footer={<Footer />} header="Edit Tag" id={id} onClose={handleClose} width={1}>
161
+ <Dialog animate footer={<Footer />} header="Edit Tag" id={id} onClose={handleClose} width={1}>
162
162
  {/* Form fields */}
163
163
  <Box as="form" padding={4} onSubmit={handleSubmit(onSubmit)}>
164
164
  {/* Deleted notification */}
@@ -26,7 +26,7 @@ const DialogTags = (props: Props) => {
26
26
  }, [])
27
27
 
28
28
  return (
29
- <Dialog header="All Tags" id={id} onClose={handleClose} width={1}>
29
+ <Dialog animate header="All Tags" id={id} onClose={handleClose} width={1}>
30
30
  <Box
31
31
  style={{
32
32
  height: '100%',
@@ -1,5 +1,5 @@
1
1
  import type {Dialog} from '../../types'
2
- import React from 'react'
2
+
3
3
  import useTypedSelector from '../../hooks/useTypedSelector'
4
4
  import DialogAssetEdit from '../DialogAssetEdit'
5
5
  import DialogConfirm from '../DialogConfirm'
@@ -1,6 +1,6 @@
1
1
  import type {SanityDocument} from '@sanity/client'
2
2
  import {Box, Button, Card, Stack, Text} from '@sanity/ui'
3
- import React from 'react'
3
+
4
4
  import {Preview, type SchemaType, useSchema} from 'sanity'
5
5
  import {useIntentLink} from 'sanity/router'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import {Flex} from '@sanity/ui'
2
2
  import type {Asset} from '../../types'
3
- import React from 'react'
3
+
4
4
  import FileIcon from '../FileIcon'
5
5
 
6
6
  type Props = {
@@ -1,6 +1,6 @@
1
1
  import {ErrorOutlineIcon} from '@sanity/icons'
2
2
  import {Box, Inline, Text, Tooltip} from '@sanity/ui'
3
- import React from 'react'
3
+
4
4
  import {styled} from 'styled-components'
5
5
 
6
6
  type Props = {
@@ -32,6 +32,7 @@ const FormFieldInputLabel = (props: Props) => {
32
32
  {error && (
33
33
  <Text size={1}>
34
34
  <Tooltip
35
+ animate
35
36
  content={
36
37
  <Box padding={2}>
37
38
  <Text muted size={1}>
@@ -31,6 +31,7 @@ const FormSubmitButton = (props: Props) => {
31
31
 
32
32
  return (
33
33
  <Tooltip
34
+ animate
34
35
  content={
35
36
  <Box padding={3} style={{maxWidth: '185px'}}>
36
37
  <Text muted size={1}>
@@ -1,7 +1,7 @@
1
1
  import {CloseIcon, Icon, UploadIcon} from '@sanity/icons'
2
2
  import {Box, Button, Flex, Inline, Text} from '@sanity/ui'
3
3
  import pluralize from 'pluralize'
4
- import React from 'react'
4
+
5
5
  import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
6
6
  import {useDropzoneActions} from '../../contexts/DropzoneDispatchContext'
7
7
  import useTypedSelector from '../../hooks/useTypedSelector'
@@ -5,15 +5,15 @@ import {getSchemeColor} from '../../utils/getSchemeColor'
5
5
 
6
6
  type Props = {
7
7
  onClick?: (e: MouseEvent) => void
8
- showCheckerboard?: boolean
9
- scheme?: ThemeColorSchemeKey
8
+ $showCheckerboard?: boolean
9
+ $scheme?: ThemeColorSchemeKey
10
10
  src: string
11
11
  style?: any
12
12
  }
13
13
 
14
14
  const Image = styled.img<Props>`
15
15
  --checkerboard-color: ${props =>
16
- props.scheme ? getSchemeColor(props.scheme, 'bg2') : 'inherit'};
16
+ props.$scheme ? getSchemeColor(props.$scheme, 'bg2') : 'inherit'};
17
17
 
18
18
  display: block;
19
19
  width: 100%;
@@ -21,7 +21,7 @@ const Image = styled.img<Props>`
21
21
  object-fit: contain;
22
22
 
23
23
  ${props =>
24
- props.showCheckerboard &&
24
+ props.$showCheckerboard &&
25
25
  css`
26
26
  background-image: linear-gradient(45deg, var(--checkerboard-color) 25%, transparent 25%),
27
27
  linear-gradient(-45deg, var(--checkerboard-color) 25%, transparent 25%),
@@ -1,6 +1,5 @@
1
1
  import {SortIcon} from '@sanity/icons'
2
2
  import {Button, Menu, MenuButton, MenuDivider, MenuItem} from '@sanity/ui'
3
- import React from 'react'
4
3
  import {useDispatch} from 'react-redux'
5
4
  import {getOrderTitle} from '../../config/orders'
6
5
  import {ORDER_OPTIONS} from '../../constants'
@@ -85,7 +85,6 @@ class ReduxProvider extends Component<Props> {
85
85
  }
86
86
 
87
87
  override render() {
88
- // @ts-ignore
89
88
  return <Provider store={this.store}>{this.props.children}</Provider>
90
89
  }
91
90
  }
@@ -1,5 +1,5 @@
1
1
  import {CloseIcon} from '@sanity/icons'
2
- import {Box, Flex, Label, rem, Text, type Theme, type ThemeColorSchemeKey} from '@sanity/ui'
2
+ import {Box, Flex, Label, rem, Text, type ThemeColorSchemeKey} from '@sanity/ui'
3
3
  import type {SearchFacetInputProps, WithId} from '../../types'
4
4
  import {type ReactNode} from 'react'
5
5
  import {useDispatch} from 'react-redux'
@@ -13,10 +13,9 @@ type Props = {
13
13
  facet: WithId<SearchFacetInputProps>
14
14
  }
15
15
 
16
- // @ts-expect-error - fix typings later
17
- const Container = styled(Box)(({scheme, theme}: {scheme: ThemeColorSchemeKey; theme: Theme}) => {
16
+ const Container = styled<typeof Box, {$scheme: ThemeColorSchemeKey}>(Box)(({$scheme, theme}) => {
18
17
  return css`
19
- background: ${getSchemeColor(scheme, 'bg')};
18
+ background: ${getSchemeColor($scheme, 'bg')};
20
19
  border-radius: ${rem(theme.sanity.radius[2])};
21
20
  `
22
21
  })
@@ -34,11 +33,7 @@ const SearchFacet = (props: Props) => {
34
33
  }
35
34
 
36
35
  return (
37
- <Container
38
- padding={[2, 2, 1]}
39
- // @ts-expect-error - fix typings later
40
- scheme={scheme}
41
- >
36
+ <Container padding={[2, 2, 1]} $scheme={scheme}>
42
37
  <Flex align={['flex-start', 'flex-start', 'center']} direction={['column', 'column', 'row']}>
43
38
  {/* Title */}
44
39
  <Box paddingBottom={[3, 3, 0]} paddingLeft={1} paddingRight={2} paddingTop={[1, 1, 0]}>
@@ -6,7 +6,7 @@ import type {
6
6
  SearchFacetOperatorType,
7
7
  WithId
8
8
  } from '../../types'
9
- import React from 'react'
9
+
10
10
  import {useDispatch} from 'react-redux'
11
11
  import {operators} from '../../config/searchFacets'
12
12
  import {usePortalPopoverProps} from '../../hooks/usePortalPopoverProps'
@@ -6,7 +6,7 @@ import type {
6
6
  SearchFacetOperatorType,
7
7
  WithId
8
8
  } from '../../types'
9
- import React from 'react'
9
+
10
10
  import {useDispatch} from 'react-redux'
11
11
 
12
12
  import {operators} from '../../config/searchFacets'
@@ -1,5 +1,5 @@
1
1
  import {Box, Flex, Inline, rem, type Theme} from '@sanity/ui'
2
- import React from 'react'
2
+
3
3
  import {styled, css} from 'styled-components'
4
4
 
5
5
  import useTypedSelector from '../../hooks/useTypedSelector'
@@ -1,7 +1,7 @@
1
1
  import {AddIcon} from '@sanity/icons'
2
2
  import {Button, Flex, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem} from '@sanity/ui'
3
3
  import type {SearchFacetDivider, SearchFacetGroup, SearchFacetInputProps} from '../../types'
4
- import React from 'react'
4
+
5
5
  import {useDispatch} from 'react-redux'
6
6
  import {FACETS} from '../../constants'
7
7
  import {usePortalPopoverProps} from '../../hooks/usePortalPopoverProps'