@sanity/ui 3.0.9 → 3.0.10
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 +5 -1
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +5 -1
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/package.json +6 -6
- package/src/core/hooks/useClickOutside.test.tsx +1 -1
- package/src/core/lib/createGlobalScopedContext.ts +3 -1
- package/src/core/primitives/avatar/avatar.tsx +1 -0
- package/src/core/primitives/card/card.tsx +1 -0
- package/src/core/primitives/popover/types.ts +2 -1
- package/src/core/styles/font/responsiveFont.ts +2 -0
- package/src/core/theme/__workshop__/canvas.tsx +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.10",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"dev": "run-p storybook:dev workshop:dev",
|
|
71
71
|
"figma:pkg:build": "cd figma && pnpm build",
|
|
72
72
|
"format": "prettier --write --cache --ignore-unknown .",
|
|
73
|
-
"lint": "eslint .",
|
|
73
|
+
"lint": "eslint --cache .",
|
|
74
74
|
"prepack": "pnpm build",
|
|
75
75
|
"pkg:build": "pkg build --strict",
|
|
76
76
|
"pkg:check": "pkg --strict",
|
|
@@ -169,13 +169,13 @@
|
|
|
169
169
|
"cz-conventional-changelog": "^3.3.0",
|
|
170
170
|
"eslint": "^9.34.0",
|
|
171
171
|
"eslint-config-prettier": "^10.1.8",
|
|
172
|
-
"eslint-formatter-
|
|
172
|
+
"eslint-formatter-gha": "^1.6.0",
|
|
173
173
|
"eslint-plugin-boundaries": "^5.0.1",
|
|
174
174
|
"eslint-plugin-import": "^2.32.0",
|
|
175
175
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
176
176
|
"eslint-plugin-react": "^7.37.5",
|
|
177
|
-
"eslint-plugin-react-
|
|
178
|
-
"eslint-plugin-react-hooks": "0.0.0-experimental-edac0dde-20250723",
|
|
177
|
+
"eslint-plugin-react-hooks": "6.0.0-rc.2",
|
|
178
|
+
"eslint-plugin-react-hooks-with-use-effect-event": "npm:eslint-plugin-react-hooks@0.0.0-experimental-edac0dde-20250723",
|
|
179
179
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
180
180
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
181
181
|
"eslint-plugin-storybook": "^0.12.0",
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"semantic-release": "^24.2.7",
|
|
198
198
|
"start-server-and-test": "^2.0.13",
|
|
199
199
|
"storybook": "^8.6.14",
|
|
200
|
-
"styled-components": "
|
|
200
|
+
"styled-components": "npm:@sanity/styled-components@^6.1.22",
|
|
201
201
|
"tsconfig-paths": "^4.2.0",
|
|
202
202
|
"typescript": "5.9.2",
|
|
203
203
|
"typescript-eslint": "^8.41.0",
|
|
@@ -441,7 +441,7 @@ describe('useClickOutside', () => {
|
|
|
441
441
|
const useBoundaryElementFromRef = (ref: React.MutableRefObject<HTMLElement | null>) => {
|
|
442
442
|
const [element, setElement] = useState(() => ref.current)
|
|
443
443
|
|
|
444
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
444
|
+
// eslint-disable-next-line react-hooks-with-use-effect-event/exhaustive-deps
|
|
445
445
|
useEffect(() => {
|
|
446
446
|
// If the ref has mutated since the last render, update the state and schedule a re-render
|
|
447
447
|
if (ref.current !== element) {
|
|
@@ -25,7 +25,9 @@ export function createGlobalScopedContext<ContextType, const T extends ContextTy
|
|
|
25
25
|
* Prevent errors about re-renders on React SSR on Next.js App Router
|
|
26
26
|
*/
|
|
27
27
|
if (typeof document === 'undefined') {
|
|
28
|
-
|
|
28
|
+
const context = createContext<ContextType>(defaultValue)
|
|
29
|
+
context.displayName = key
|
|
30
|
+
return context
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
globalScope[symbol] = globalScope[symbol] || createContext<T>(defaultValue)
|
|
@@ -77,6 +77,7 @@ export const Avatar = forwardRef(function Avatar(
|
|
|
77
77
|
const as = ReactIs.isValidElementType(asProp) ? asProp : 'div'
|
|
78
78
|
const size = useArrayProp(sizeProp)
|
|
79
79
|
|
|
80
|
+
// eslint-disable-next-line no-warning-comments
|
|
80
81
|
// @todo: remove this
|
|
81
82
|
const avatarSize = avatar.sizes[size[0]] || avatar.sizes[0]
|
|
82
83
|
const _sizeRem = avatarSize.size
|
|
@@ -83,6 +83,7 @@ export const Card = forwardRef(function Card(
|
|
|
83
83
|
const rootTheme = useRootTheme()
|
|
84
84
|
const tone = toneProp === 'inherit' ? rootTheme.tone : toneProp
|
|
85
85
|
|
|
86
|
+
// eslint-disable-next-line no-warning-comments
|
|
86
87
|
// todo: Consider adding the wrapper approach for nested cards in which the tones are not changing, avoid unnecessary ThemeColorProvider
|
|
87
88
|
return (
|
|
88
89
|
<ThemeColorProvider scheme={scheme} tone={tone}>
|
|
@@ -17,6 +17,7 @@ export function responsiveFont(
|
|
|
17
17
|
const {family, sizes, weights} = font[fontKey]
|
|
18
18
|
const fontWeight = ($weight && weights[$weight]) || weights.regular
|
|
19
19
|
|
|
20
|
+
// eslint-disable-next-line no-warning-comments
|
|
20
21
|
// @todo: make this configurable
|
|
21
22
|
const defaultSize = sizes[2]
|
|
22
23
|
|
|
@@ -48,6 +49,7 @@ export function responsiveFont(
|
|
|
48
49
|
},
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
// eslint-disable-next-line no-warning-comments
|
|
51
53
|
// @TODO fix the real condition that is causing $size to be undefined sometimes
|
|
52
54
|
if (!$size) {
|
|
53
55
|
// @ts-expect-error: `warned` isn't typed, the underlying issue should be solved rather than typing it
|
|
@@ -124,6 +124,7 @@ function Color(props: {color: ThemeColorCard_v2; tone: CardTone}) {
|
|
|
124
124
|
|
|
125
125
|
{/* {features.muted && <ColorMuted color={color.muted} />} */}
|
|
126
126
|
|
|
127
|
+
{/* eslint-disable-next-line no-warning-comments */}
|
|
127
128
|
{/* @todo: remove use of `muted` here */}
|
|
128
129
|
{features.selectable && <ColorSelectable color={color.selectable || color.muted} />}
|
|
129
130
|
|