@sanity/ui 4.0.0-beta.5 → 4.0.0-beta.7

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": "4.0.0-beta.5",
3
+ "version": "4.0.0-beta.7",
4
4
  "keywords": [
5
5
  "react",
6
6
  "ui",
@@ -49,8 +49,8 @@
49
49
  "csstype": "^3.2.3",
50
50
  "motion": "^12.38.0",
51
51
  "react-refractor": "^4.0.0",
52
- "@sanity/ui-tokens": "1.0.0-beta.5",
53
- "@sanity/ui-css": "1.0.0-beta.5"
52
+ "@sanity/ui-css": "1.0.0-beta.7",
53
+ "@sanity/ui-tokens": "1.0.0-beta.7"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/core": "^7.29.0",
@@ -89,8 +89,8 @@
89
89
  "vite-tsconfig-paths": "^6.1.1",
90
90
  "vitest": "^4.1.4",
91
91
  "vitest-axe": "1.0.0-pre.5",
92
- "@repo/eslint-config": "0.0.0",
93
- "@repo/typescript-config": "0.0.0"
92
+ "@repo/typescript-config": "0.0.0",
93
+ "@repo/eslint-config": "0.0.0"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "react": "^19.2",
@@ -25,9 +25,10 @@ export interface ButtonOwnProps extends ButtonStyleProps {
25
25
  'fontSize'?: ResponsiveProp<FontTextSize>
26
26
  'icon'?: React.ElementType | React.ReactNode
27
27
  'iconRight'?: React.ElementType | React.ReactNode
28
- /** @beta Do not use in production, as this might change.*/
29
28
  'loading'?: boolean
30
29
  'muted'?: boolean
30
+ 'pressed'?: boolean
31
+ /** @deprecated Use `pressed` instead. */
31
32
  'selected'?: boolean
32
33
  'textAlign'?: TextOwnProps['align']
33
34
  'text'?: React.ReactNode
@@ -57,7 +58,9 @@ export function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEME
57
58
  iconRight: IconRight,
58
59
  loading,
59
60
  muted,
60
- selected,
61
+ pressed = props.selected,
62
+ // eslint-disable-next-line no-warning-comments
63
+ selected: _selected, // TODO: remove in next major version
61
64
  text,
62
65
  textAlign,
63
66
  textOverflow = 'ellipsis',
@@ -82,7 +85,7 @@ export function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEME
82
85
  {...domProps}
83
86
  className={button(styleProps)}
84
87
  data-disabled={loading || disabled ? '' : props['data-disabled']}
85
- data-selected={selected ? '' : props['data-selected']}
88
+ data-pressed={pressed ? '' : (props['data-pressed'] ?? props['data-selected'])}
86
89
  disabled={Boolean(loading || disabled)}
87
90
  // WORKAROUND: Since `a` elements don't support the `disabled` prop,
88
91
  // we need to remove the `href` prop from the DOM props when the button is disabled.