@sanity/ui 2.1.3-canary.1 → 2.1.4-canary.0
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 +22 -13
- package/dist/index.d.ts +22 -13
- package/dist/index.esm.js +3 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +2 -2
- package/dist/theme.d.ts +2 -2
- package/package.json +20 -20
- package/src/core/components/dialog/dialog.tsx +2 -2
- package/src/core/components/toast/toastProvider.tsx +4 -2
- package/src/core/hooks/useDelayedState.ts +2 -2
- package/src/theme/system/v0/color/_system.ts +2 -2
package/dist/theme.d.mts
CHANGED
|
@@ -988,7 +988,7 @@ export declare interface ThemeColorMutedTone {
|
|
|
988
988
|
|
|
989
989
|
/**
|
|
990
990
|
* @public
|
|
991
|
-
* @deprecated Use `
|
|
991
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
992
992
|
*/
|
|
993
993
|
export declare type ThemeColorName = ThemeColorCardToneKey
|
|
994
994
|
|
|
@@ -1261,7 +1261,7 @@ export declare type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
|
|
|
1261
1261
|
|
|
1262
1262
|
/**
|
|
1263
1263
|
* @public
|
|
1264
|
-
* @deprecated Use `
|
|
1264
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
1265
1265
|
*/
|
|
1266
1266
|
export declare type ThemeColorToneKey = ThemeColorCardToneKey
|
|
1267
1267
|
|
package/dist/theme.d.ts
CHANGED
|
@@ -988,7 +988,7 @@ export declare interface ThemeColorMutedTone {
|
|
|
988
988
|
|
|
989
989
|
/**
|
|
990
990
|
* @public
|
|
991
|
-
* @deprecated Use `
|
|
991
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
992
992
|
*/
|
|
993
993
|
export declare type ThemeColorName = ThemeColorCardToneKey
|
|
994
994
|
|
|
@@ -1261,7 +1261,7 @@ export declare type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
|
|
|
1261
1261
|
|
|
1262
1262
|
/**
|
|
1263
1263
|
* @public
|
|
1264
|
-
* @deprecated Use `
|
|
1264
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
1265
1265
|
*/
|
|
1266
1266
|
export declare type ThemeColorToneKey = ThemeColorCardToneKey
|
|
1267
1267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4-canary.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -93,38 +93,38 @@
|
|
|
93
93
|
"@commitlint/cli": "^19.2.1",
|
|
94
94
|
"@commitlint/config-conventional": "^19.1.0",
|
|
95
95
|
"@juggle/resize-observer": "^3.4.0",
|
|
96
|
-
"@sanity/pkg-utils": "^6.6.
|
|
96
|
+
"@sanity/pkg-utils": "^6.6.6",
|
|
97
97
|
"@sanity/semantic-release-preset": "^4.1.7",
|
|
98
98
|
"@sanity/ui-workshop": "^2.0.12",
|
|
99
|
-
"@storybook/addon-a11y": "^8.0.
|
|
100
|
-
"@storybook/addon-docs": "^8.0.
|
|
101
|
-
"@storybook/addon-essentials": "^8.0.
|
|
102
|
-
"@storybook/addon-interactions": "^8.0.
|
|
103
|
-
"@storybook/addon-links": "^8.0.
|
|
104
|
-
"@storybook/addon-storysource": "^8.0.
|
|
105
|
-
"@storybook/addon-themes": "^8.0.
|
|
106
|
-
"@storybook/blocks": "^8.0.
|
|
99
|
+
"@storybook/addon-a11y": "^8.0.8",
|
|
100
|
+
"@storybook/addon-docs": "^8.0.8",
|
|
101
|
+
"@storybook/addon-essentials": "^8.0.8",
|
|
102
|
+
"@storybook/addon-interactions": "^8.0.8",
|
|
103
|
+
"@storybook/addon-links": "^8.0.8",
|
|
104
|
+
"@storybook/addon-storysource": "^8.0.8",
|
|
105
|
+
"@storybook/addon-themes": "^8.0.8",
|
|
106
|
+
"@storybook/blocks": "^8.0.8",
|
|
107
107
|
"@storybook/jest": "^0.2.3",
|
|
108
|
-
"@storybook/manager-api": "^8.0.
|
|
109
|
-
"@storybook/react": "^8.0.
|
|
110
|
-
"@storybook/react-vite": "^8.0.
|
|
108
|
+
"@storybook/manager-api": "^8.0.8",
|
|
109
|
+
"@storybook/react": "^8.0.8",
|
|
110
|
+
"@storybook/react-vite": "^8.0.8",
|
|
111
111
|
"@storybook/testing-library": "^0.2.2",
|
|
112
|
-
"@storybook/theming": "^8.0.
|
|
112
|
+
"@storybook/theming": "^8.0.8",
|
|
113
113
|
"@testing-library/dom": "^9.3.4",
|
|
114
114
|
"@testing-library/jest-dom": "^5.17.0",
|
|
115
|
-
"@testing-library/react": "^14.3.
|
|
115
|
+
"@testing-library/react": "^14.3.1",
|
|
116
116
|
"@types/jest": "^29.5.12",
|
|
117
117
|
"@types/jest-axe": "^3.5.9",
|
|
118
118
|
"@types/node": "^20.5.9",
|
|
119
|
-
"@types/react": "^18.2.
|
|
120
|
-
"@types/react-dom": "^18.2.
|
|
119
|
+
"@types/react": "^18.2.77",
|
|
120
|
+
"@types/react-dom": "^18.2.25",
|
|
121
121
|
"@types/react-is": "^18.2.4",
|
|
122
122
|
"@types/refractor": "^3.4.1",
|
|
123
123
|
"@types/testing-library__jest-dom": "^5.14.9",
|
|
124
124
|
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
125
125
|
"@typescript-eslint/parser": "^7.6.0",
|
|
126
126
|
"commitizen": "^4.3.0",
|
|
127
|
-
"cypress": "^13.7.
|
|
127
|
+
"cypress": "^13.7.3",
|
|
128
128
|
"cypress-real-events": "^1.12.0",
|
|
129
129
|
"cz-conventional-changelog": "^3.3.0",
|
|
130
130
|
"eslint": "^8.57.0",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"rimraf": "^5.0.1",
|
|
154
154
|
"semantic-release": "^23.0.8",
|
|
155
155
|
"start-server-and-test": "^2.0.3",
|
|
156
|
-
"storybook": "^8.0.
|
|
156
|
+
"storybook": "^8.0.8",
|
|
157
157
|
"styled-components": "^6.1.8",
|
|
158
158
|
"tsconfig-paths": "^4.2.0",
|
|
159
159
|
"typescript": "5.4.5",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"react-is": "^18",
|
|
167
167
|
"styled-components": "^5.2 || ^6"
|
|
168
168
|
},
|
|
169
|
-
"packageManager": "pnpm@8.15.
|
|
169
|
+
"packageManager": "pnpm@8.15.7",
|
|
170
170
|
"engines": {
|
|
171
171
|
"node": ">=14.0.0"
|
|
172
172
|
},
|
|
@@ -369,7 +369,7 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
369
369
|
|
|
370
370
|
const labelId = `${id}_label`
|
|
371
371
|
|
|
372
|
-
const rootClickTimeoutRef = useRef<
|
|
372
|
+
const rootClickTimeoutRef = useRef<number>()
|
|
373
373
|
|
|
374
374
|
// If the resulting active element (a.k.a. focused element) is not withing scope when clicking
|
|
375
375
|
// within the dialog, then we want to focus the previously interactive element in the dialog instead.
|
|
@@ -379,7 +379,7 @@ export const Dialog = forwardRef(function Dialog(
|
|
|
379
379
|
clearTimeout(rootClickTimeoutRef.current)
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
rootClickTimeoutRef.current = setTimeout(() => {
|
|
382
|
+
rootClickTimeoutRef.current = (setTimeout as typeof window.setTimeout)(() => {
|
|
383
383
|
const activeElement = document.activeElement
|
|
384
384
|
|
|
385
385
|
if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
|
|
@@ -53,7 +53,7 @@ let toastId = 0
|
|
|
53
53
|
export function ToastProvider(props: ToastProviderProps): React.ReactElement {
|
|
54
54
|
const {children, padding = 4, paddingX, paddingY, zOffset} = props
|
|
55
55
|
const [state, _setState] = useState<ToastState>([])
|
|
56
|
-
const toastsRef = useRef<{[key: string]: {timeoutId:
|
|
56
|
+
const toastsRef = useRef<{[key: string]: {timeoutId: number}}>({})
|
|
57
57
|
const mounted = useMounted()
|
|
58
58
|
const prefersReducedMotion = usePrefersReducedMotion()
|
|
59
59
|
const variants = useMemo<Variants>(
|
|
@@ -129,7 +129,9 @@ export function ToastProvider(props: ToastProviderProps): React.ReactElement {
|
|
|
129
129
|
delete toastsRef.current[id]
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
toastsRef.current[id] = {
|
|
132
|
+
toastsRef.current[id] = {
|
|
133
|
+
timeoutId: (setTimeout as typeof window.setTimeout)(dismiss, duration),
|
|
134
|
+
}
|
|
133
135
|
|
|
134
136
|
return id
|
|
135
137
|
}
|
|
@@ -8,7 +8,7 @@ export function useDelayedState<S>(
|
|
|
8
8
|
initialState: S | (() => S),
|
|
9
9
|
): [S, (nextState: SetStateAction<S>, delay?: number) => void] {
|
|
10
10
|
const [state, setState] = useState(initialState)
|
|
11
|
-
const delayedAction = useRef<
|
|
11
|
+
const delayedAction = useRef<number | undefined>()
|
|
12
12
|
|
|
13
13
|
const onStateChange = useCallback((nextState: SetStateAction<S>, delay?: number) => {
|
|
14
14
|
const action = () => {
|
|
@@ -22,7 +22,7 @@ export function useDelayedState<S>(
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (!delay) return action()
|
|
25
|
-
delayedAction.current = setTimeout(action, delay)
|
|
25
|
+
delayedAction.current = (setTimeout as typeof window.setTimeout)(action, delay)
|
|
26
26
|
}, [])
|
|
27
27
|
|
|
28
28
|
return [state, onStateChange]
|
|
@@ -2,12 +2,12 @@ import {ThemeColorCardToneKey} from '../../color/_system'
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
|
-
* @deprecated Use `
|
|
5
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
6
6
|
*/
|
|
7
7
|
export type ThemeColorName = ThemeColorCardToneKey
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
|
-
* @deprecated Use `
|
|
11
|
+
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
12
12
|
*/
|
|
13
13
|
export type ThemeColorToneKey = ThemeColorCardToneKey
|