@sanity/ui 2.1.6 → 2.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "ui",
@@ -108,7 +108,7 @@
108
108
  "@sanity/color": "^3.0.6",
109
109
  "@sanity/icons": "^2.11.8",
110
110
  "csstype": "^3.1.3",
111
- "framer-motion": "11.0.8",
111
+ "framer-motion": "11.2.0",
112
112
  "react-refractor": "^2.1.7"
113
113
  },
114
114
  "devDependencies": {
@@ -119,9 +119,9 @@
119
119
  "@commitlint/cli": "^19.3.0",
120
120
  "@commitlint/config-conventional": "^19.2.2",
121
121
  "@juggle/resize-observer": "^3.4.0",
122
- "@sanity/pkg-utils": "^6.8.10",
122
+ "@sanity/pkg-utils": "^6.8.14",
123
123
  "@sanity/semantic-release-preset": "^4.1.7",
124
- "@sanity/ui-workshop": "^2.0.12",
124
+ "@sanity/ui-workshop": "^2.0.13",
125
125
  "@storybook/addon-a11y": "^8.0.8",
126
126
  "@storybook/addon-docs": "^8.0.8",
127
127
  "@storybook/addon-essentials": "^8.0.8",
@@ -142,15 +142,15 @@
142
142
  "@types/jest": "^29.5.12",
143
143
  "@types/jest-axe": "^3.5.9",
144
144
  "@types/node": "^20.12.7",
145
- "@types/react": "^18.3.1",
145
+ "@types/react": "^18.3.2",
146
146
  "@types/react-dom": "^18.3.0",
147
147
  "@types/react-is": "^18.3.0",
148
148
  "@types/refractor": "^3.4.1",
149
149
  "@types/testing-library__jest-dom": "^5.14.9",
150
- "@typescript-eslint/eslint-plugin": "^7.8.0",
151
- "@typescript-eslint/parser": "^7.8.0",
150
+ "@typescript-eslint/eslint-plugin": "^7.9.0",
151
+ "@typescript-eslint/parser": "^7.9.0",
152
152
  "commitizen": "^4.3.0",
153
- "cypress": "^13.8.1",
153
+ "cypress": "^13.9.0",
154
154
  "cypress-real-events": "^1.12.0",
155
155
  "cz-conventional-changelog": "^3.3.0",
156
156
  "eslint": "^8.57.0",
@@ -177,10 +177,10 @@
177
177
  "react-is": "^18.3.1",
178
178
  "refractor": "^4.8.1",
179
179
  "rimraf": "^5.0.5",
180
- "semantic-release": "^23.0.8",
180
+ "semantic-release": "^23.1.1",
181
181
  "start-server-and-test": "^2.0.3",
182
182
  "storybook": "^8.0.8",
183
- "styled-components": "^6.1.8",
183
+ "styled-components": "^6.1.11",
184
184
  "tsconfig-paths": "^4.2.0",
185
185
  "typescript": "5.4.5",
186
186
  "vite": "^5.2.11",
@@ -192,7 +192,7 @@
192
192
  "react-is": "^18",
193
193
  "styled-components": "^5.2 || ^6"
194
194
  },
195
- "packageManager": "pnpm@9.0.6",
195
+ "packageManager": "pnpm@9.1.1",
196
196
  "engines": {
197
197
  "node": ">=14.0.0"
198
198
  },
@@ -1,6 +1,5 @@
1
1
  import {ThemeColorSchemeKey} from '@sanity/ui/theme'
2
2
  import {cloneElement, forwardRef, useCallback, useMemo, useState, useEffect, useRef} from 'react'
3
- import {isElement} from 'react-is'
4
3
  import {Popover, PopoverProps} from '../../primitives'
5
4
  import {Placement, Radius} from '../../types'
6
5
  import {MenuProps} from './menu'
@@ -218,7 +217,7 @@ export const MenuButton = forwardRef(function MenuButton(
218
217
  ],
219
218
  )
220
219
 
221
- const menu = isElement(menuProp) ? cloneElement(menuProp, menuProps) : null
220
+ const menu = menuProp && cloneElement(menuProp, menuProps)
222
221
 
223
222
  const setButtonRef = useCallback(
224
223
  (el: HTMLButtonElement | null) => {
@@ -235,19 +234,18 @@ export const MenuButton = forwardRef(function MenuButton(
235
234
 
236
235
  const button = useMemo(
237
236
  () =>
238
- isElement(buttonProp)
239
- ? cloneElement(buttonProp, {
240
- 'data-ui': 'MenuButton',
241
- id,
242
- onClick: handleButtonClick,
243
- onKeyDown: handleButtonKeyDown,
244
- onMouseDown: handleMouseDown,
245
- 'aria-haspopup': true,
246
- 'aria-expanded': open,
247
- ref: setButtonRef,
248
- selected: open,
249
- })
250
- : null,
237
+ buttonProp &&
238
+ cloneElement(buttonProp, {
239
+ 'data-ui': 'MenuButton',
240
+ id,
241
+ onClick: handleButtonClick,
242
+ onKeyDown: handleButtonKeyDown,
243
+ onMouseDown: handleMouseDown,
244
+ 'aria-haspopup': true,
245
+ 'aria-expanded': open,
246
+ ref: setButtonRef,
247
+ selected: open,
248
+ }),
251
249
  [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open, setButtonRef],
252
250
  )
253
251