@sanity/ui 4.0.0-beta.6 → 4.0.0-beta.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/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -48
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/primitives/button/Button.tsx +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.8",
|
|
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-css": "1.0.0-beta.
|
|
53
|
-
"@sanity/ui-tokens": "1.0.0-beta.
|
|
52
|
+
"@sanity/ui-css": "1.0.0-beta.8",
|
|
53
|
+
"@sanity/ui-tokens": "1.0.0-beta.8"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/core": "^7.29.0",
|
|
@@ -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-
|
|
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.
|