@sanity/ui
Advanced tools
Comparing version 2.3.7-canary.0 to 2.4.0
@@ -1261,2 +1261,3 @@ /// <reference types="react" /> | ||
level?: number | ||
registerChild: (childLevel?: number) => () => void | ||
size: number | ||
@@ -1427,3 +1428,2 @@ zIndex: number | ||
export declare interface MenuProps extends ResponsivePaddingProps { | ||
'aria-labelledby'?: string | ||
/** | ||
@@ -1438,3 +1438,2 @@ * @deprecated Use `shouldFocus="first"` instead. | ||
onClickOutside?: (event: MouseEvent) => void | ||
onBlurCapture?: (event: React.FocusEvent<HTMLButtonElement>) => void | ||
onEscape?: () => void | ||
@@ -1519,3 +1518,2 @@ onItemClick?: () => void | ||
boundaryElement?: HTMLElement | null | ||
/** @deprecated Use `referenceElement` instead */ | ||
children?: React.ReactElement | ||
@@ -2456,2 +2454,3 @@ /** | ||
status?: 'error' | 'warning' | 'success' | 'info' | ||
duration?: number | ||
} | ||
@@ -2642,12 +2641,2 @@ | ||
* @beta | ||
* @deprecated use `_getArrayProp` and `useMemo` directly instead | ||
* @example | ||
* ```diff | ||
* -import {useArrayProp} from '@sanity/ui' | ||
* +import {_getArrayProp} from '@sanity/ui' | ||
* +import {useMemo} from 'react' | ||
* | ||
* -const width = useArrayProp(props.width) | ||
* +const width = useMemo(() => _getArrayProp(props.width), [props.width]) | ||
* ``` | ||
*/ | ||
@@ -2654,0 +2643,0 @@ export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>( |
{ | ||
"name": "@sanity/ui", | ||
"version": "2.3.7-canary.0", | ||
"version": "2.4.0", | ||
"keywords": [ | ||
@@ -26,6 +26,2 @@ "sanity", | ||
"source": "./exports/index.ts", | ||
"react-compiler": { | ||
"source": "./exports/index.ts", | ||
"default": "./dist/index.compiled.mjs" | ||
}, | ||
"import": "./dist/index.mjs", | ||
@@ -59,2 +55,28 @@ "require": "./dist/index.js", | ||
], | ||
"scripts": { | ||
"build": "run-s clean pkg:build pkg:check figma:pkg:build", | ||
"clean": "rimraf .workshop dist", | ||
"commit": "cz", | ||
"cypress:dev": "run-p dev cypress:open", | ||
"cypress:open": "cypress open", | ||
"cypress:run": "cypress run", | ||
"dev": "run-p storybook:dev workshop:dev", | ||
"figma:pkg:build": "cd figma && pnpm build", | ||
"format": "prettier --write --cache --ignore-unknown .", | ||
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx", | ||
"pkg:build": "pkg build --strict", | ||
"pkg:check": "pkg --strict", | ||
"prepare": "husky install", | ||
"prepublishOnly": "pnpm build", | ||
"release": "semantic-release", | ||
"storybook:build": "storybook build", | ||
"storybook:dev": "storybook dev -p 6006", | ||
"test": "jest", | ||
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'", | ||
"ts:check": "tsc", | ||
"watch": "pkg watch --strict", | ||
"workshop:build": "workshop build", | ||
"workshop:dev": "workshop dev", | ||
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist" | ||
}, | ||
"commitlint": { | ||
@@ -89,3 +111,3 @@ "extends": [ | ||
"@sanity/color": "^3.0.6", | ||
"@sanity/icons": "3.2.1-canary.0", | ||
"@sanity/icons": "^3.2.0", | ||
"csstype": "^3.1.3", | ||
@@ -103,3 +125,3 @@ "framer-motion": "11.0.8", | ||
"@juggle/resize-observer": "^3.4.0", | ||
"@sanity/pkg-utils": "6.9.4-canary.1", | ||
"@sanity/pkg-utils": "^6.9.3", | ||
"@sanity/semantic-release-preset": "^4.1.8", | ||
@@ -178,2 +200,3 @@ "@sanity/ui-workshop": "^2.0.15", | ||
}, | ||
"packageManager": "pnpm@9.2.0", | ||
"engines": { | ||
@@ -188,26 +211,7 @@ "node": ">=14.0.0" | ||
}, | ||
"scripts": { | ||
"build": "run-s clean pkg:build pkg:check figma:pkg:build", | ||
"clean": "rimraf .workshop dist", | ||
"commit": "cz", | ||
"cypress:dev": "run-p dev cypress:open", | ||
"cypress:open": "cypress open", | ||
"cypress:run": "cypress run", | ||
"dev": "run-p storybook:dev workshop:dev", | ||
"figma:pkg:build": "cd figma && pnpm build", | ||
"format": "prettier --write --cache --ignore-unknown .", | ||
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx", | ||
"pkg:build": "pkg build --strict", | ||
"pkg:check": "pkg --strict", | ||
"release": "semantic-release", | ||
"storybook:build": "storybook build", | ||
"storybook:dev": "storybook dev -p 6006", | ||
"test": "jest", | ||
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'", | ||
"ts:check": "tsc", | ||
"watch": "pkg watch --strict", | ||
"workshop:build": "workshop build", | ||
"workshop:dev": "workshop dev", | ||
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist" | ||
"pnpm": { | ||
"overrides": { | ||
"conventional-changelog-conventionalcommits": ">= 8.0.0" | ||
} | ||
} | ||
} | ||
} |
@@ -10,12 +10,2 @@ import {useMemo} from 'react' | ||
* @beta | ||
* @deprecated use `_getArrayProp` and `useMemo` directly instead | ||
* @example | ||
* ```diff | ||
* -import {useArrayProp} from '@sanity/ui' | ||
* +import {_getArrayProp} from '@sanity/ui' | ||
* +import {useMemo} from 'react' | ||
* | ||
* -const width = useArrayProp(props.width) | ||
* +const width = useMemo(() => _getArrayProp(props.width), [props.width]) | ||
* ``` | ||
*/ | ||
@@ -26,3 +16,12 @@ export function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>( | ||
): T[] { | ||
return useMemo(() => _getArrayProp(val, defaultVal), [defaultVal, val]) | ||
// JSON.stringify is fast, but it's not faster than useMemo's referencial equality check | ||
const __perf_hash__ = useMemo(() => JSON.stringify(val ?? defaultVal), [defaultVal, val]) | ||
return useMemo( | ||
() => _getArrayProp(val, defaultVal), | ||
// Improve performance: Keep object identify for a given hash of the value | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
[__perf_hash__], | ||
) | ||
} |
@@ -11,2 +11,5 @@ import {getLayerContext} from './getLayerContext' | ||
level: 0, | ||
registerChild: () => () => { | ||
// | ||
}, | ||
size: 0, | ||
@@ -22,2 +25,3 @@ zIndex: 0, | ||
level: 0, | ||
registerChild: expect.any(Function), | ||
size: 0, | ||
@@ -24,0 +28,0 @@ zIndex: 0, |
@@ -6,4 +6,5 @@ /** @public */ | ||
level?: number | ||
registerChild: (childLevel?: number) => () => void | ||
size: number | ||
zIndex: number | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
649
0
4512690
62951
+ Added@sanity/icons@3.4.0(transitive)
- Removed@sanity/icons@3.2.1-canary.0(transitive)
Updated@sanity/icons@^3.2.0