@sanity/ui 2.1.3 → 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 +45 -47
- 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",
|
|
@@ -51,32 +51,6 @@
|
|
|
51
51
|
"src",
|
|
52
52
|
"theme.js"
|
|
53
53
|
],
|
|
54
|
-
"scripts": {
|
|
55
|
-
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
56
|
-
"clean": "rimraf .workshop dist",
|
|
57
|
-
"commit": "cz",
|
|
58
|
-
"cypress:dev": "run-p dev cypress:open",
|
|
59
|
-
"cypress:open": "cypress open",
|
|
60
|
-
"cypress:run": "cypress run",
|
|
61
|
-
"dev": "run-p storybook:dev workshop:dev",
|
|
62
|
-
"figma:pkg:build": "cd figma && pnpm build",
|
|
63
|
-
"format": "prettier --write --cache --ignore-unknown .",
|
|
64
|
-
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx --quiet",
|
|
65
|
-
"pkg:build": "pkg build --strict",
|
|
66
|
-
"pkg:check": "pkg --strict",
|
|
67
|
-
"prepare": "husky install",
|
|
68
|
-
"prepublishOnly": "pnpm build",
|
|
69
|
-
"release": "semantic-release",
|
|
70
|
-
"storybook:build": "storybook build",
|
|
71
|
-
"storybook:dev": "storybook dev -p 6006",
|
|
72
|
-
"test": "jest",
|
|
73
|
-
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
74
|
-
"ts:check": "tsc",
|
|
75
|
-
"watch": "pkg watch --strict",
|
|
76
|
-
"workshop:build": "workshop build",
|
|
77
|
-
"workshop:dev": "workshop dev",
|
|
78
|
-
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
79
|
-
},
|
|
80
54
|
"commitlint": {
|
|
81
55
|
"extends": [
|
|
82
56
|
"@commitlint/config-conventional"
|
|
@@ -119,38 +93,38 @@
|
|
|
119
93
|
"@commitlint/cli": "^19.2.1",
|
|
120
94
|
"@commitlint/config-conventional": "^19.1.0",
|
|
121
95
|
"@juggle/resize-observer": "^3.4.0",
|
|
122
|
-
"@sanity/pkg-utils": "^6.6.
|
|
96
|
+
"@sanity/pkg-utils": "^6.6.6",
|
|
123
97
|
"@sanity/semantic-release-preset": "^4.1.7",
|
|
124
98
|
"@sanity/ui-workshop": "^2.0.12",
|
|
125
|
-
"@storybook/addon-a11y": "^8.0.
|
|
126
|
-
"@storybook/addon-docs": "^8.0.
|
|
127
|
-
"@storybook/addon-essentials": "^8.0.
|
|
128
|
-
"@storybook/addon-interactions": "^8.0.
|
|
129
|
-
"@storybook/addon-links": "^8.0.
|
|
130
|
-
"@storybook/addon-storysource": "^8.0.
|
|
131
|
-
"@storybook/addon-themes": "^8.0.
|
|
132
|
-
"@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",
|
|
133
107
|
"@storybook/jest": "^0.2.3",
|
|
134
|
-
"@storybook/manager-api": "^8.0.
|
|
135
|
-
"@storybook/react": "^8.0.
|
|
136
|
-
"@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",
|
|
137
111
|
"@storybook/testing-library": "^0.2.2",
|
|
138
|
-
"@storybook/theming": "^8.0.
|
|
112
|
+
"@storybook/theming": "^8.0.8",
|
|
139
113
|
"@testing-library/dom": "^9.3.4",
|
|
140
114
|
"@testing-library/jest-dom": "^5.17.0",
|
|
141
|
-
"@testing-library/react": "^14.3.
|
|
115
|
+
"@testing-library/react": "^14.3.1",
|
|
142
116
|
"@types/jest": "^29.5.12",
|
|
143
117
|
"@types/jest-axe": "^3.5.9",
|
|
144
118
|
"@types/node": "^20.5.9",
|
|
145
|
-
"@types/react": "^18.2.
|
|
146
|
-
"@types/react-dom": "^18.2.
|
|
119
|
+
"@types/react": "^18.2.77",
|
|
120
|
+
"@types/react-dom": "^18.2.25",
|
|
147
121
|
"@types/react-is": "^18.2.4",
|
|
148
122
|
"@types/refractor": "^3.4.1",
|
|
149
123
|
"@types/testing-library__jest-dom": "^5.14.9",
|
|
150
124
|
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
151
125
|
"@typescript-eslint/parser": "^7.6.0",
|
|
152
126
|
"commitizen": "^4.3.0",
|
|
153
|
-
"cypress": "^13.7.
|
|
127
|
+
"cypress": "^13.7.3",
|
|
154
128
|
"cypress-real-events": "^1.12.0",
|
|
155
129
|
"cz-conventional-changelog": "^3.3.0",
|
|
156
130
|
"eslint": "^8.57.0",
|
|
@@ -179,7 +153,7 @@
|
|
|
179
153
|
"rimraf": "^5.0.1",
|
|
180
154
|
"semantic-release": "^23.0.8",
|
|
181
155
|
"start-server-and-test": "^2.0.3",
|
|
182
|
-
"storybook": "^8.0.
|
|
156
|
+
"storybook": "^8.0.8",
|
|
183
157
|
"styled-components": "^6.1.8",
|
|
184
158
|
"tsconfig-paths": "^4.2.0",
|
|
185
159
|
"typescript": "5.4.5",
|
|
@@ -192,7 +166,7 @@
|
|
|
192
166
|
"react-is": "^18",
|
|
193
167
|
"styled-components": "^5.2 || ^6"
|
|
194
168
|
},
|
|
195
|
-
"packageManager": "pnpm@8.15.
|
|
169
|
+
"packageManager": "pnpm@8.15.7",
|
|
196
170
|
"engines": {
|
|
197
171
|
"node": ">=14.0.0"
|
|
198
172
|
},
|
|
@@ -201,5 +175,29 @@
|
|
|
201
175
|
},
|
|
202
176
|
"esm.sh": {
|
|
203
177
|
"bundle": false
|
|
178
|
+
},
|
|
179
|
+
"scripts": {
|
|
180
|
+
"build": "run-s clean pkg:build pkg:check figma:pkg:build",
|
|
181
|
+
"clean": "rimraf .workshop dist",
|
|
182
|
+
"commit": "cz",
|
|
183
|
+
"cypress:dev": "run-p dev cypress:open",
|
|
184
|
+
"cypress:open": "cypress open",
|
|
185
|
+
"cypress:run": "cypress run",
|
|
186
|
+
"dev": "run-p storybook:dev workshop:dev",
|
|
187
|
+
"figma:pkg:build": "cd figma && pnpm build",
|
|
188
|
+
"format": "prettier --write --cache --ignore-unknown .",
|
|
189
|
+
"lint": "eslint . --ext .cjs,.js,.jsx,.mjs,.ts,.tsx --quiet",
|
|
190
|
+
"pkg:build": "pkg build --strict",
|
|
191
|
+
"pkg:check": "pkg --strict",
|
|
192
|
+
"release": "semantic-release",
|
|
193
|
+
"storybook:build": "storybook build",
|
|
194
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
195
|
+
"test": "jest",
|
|
196
|
+
"test:browser": "start-server-and-test 'run-s workshop:build workshop:start' http://localhost:1337 'run-s cypress:run'",
|
|
197
|
+
"ts:check": "tsc",
|
|
198
|
+
"watch": "pkg watch --strict",
|
|
199
|
+
"workshop:build": "workshop build",
|
|
200
|
+
"workshop:dev": "workshop dev",
|
|
201
|
+
"workshop:start": "http-server -a localhost -c-0 -p 1337 -s -P http://localhost:1337/index.html? dist"
|
|
204
202
|
}
|
|
205
|
-
}
|
|
203
|
+
}
|
|
@@ -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
|