@sanity/ui 2.12.3 → 2.13.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/_chunks-cjs/_visual-editing.js +27 -22
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/getTheme_v2.js +0 -1
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +27 -22
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +0 -1
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_chunks-es/refractor.mjs +1 -1
- package/dist/_legacy/_visual-editing.esm.js +27 -22
- package/dist/_legacy/_visual-editing.esm.js.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +0 -1
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/_legacy/refractor.esm.js +1 -1
- package/dist/_visual-editing.d.mts +2 -1
- package/dist/_visual-editing.d.ts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/theme.esm.js +0 -3
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +0 -3
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +0 -3
- package/dist/theme.mjs.map +1 -1
- package/package.json +23 -23
- package/src/core/__workshop__/constants.ts +5 -4
- package/src/core/hooks/useClickOutsideEvent.ts +1 -1
- package/src/core/hooks/useGlobalKeyDown.ts +1 -1
- package/src/core/primitives/button/__workshop__/props.tsx +4 -0
- package/src/core/primitives/button/button.tsx +5 -2
- package/src/core/primitives/tooltip/tooltip.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"@sanity/color": "^3.0.6",
|
|
121
121
|
"@sanity/icons": "^3.5.7",
|
|
122
122
|
"csstype": "^3.1.3",
|
|
123
|
-
"framer-motion": "^12.4.
|
|
123
|
+
"framer-motion": "^12.4.2",
|
|
124
124
|
"react-compiler-runtime": "19.0.0-beta-30d8a17-20250209",
|
|
125
125
|
"react-refractor": "^2.2.0",
|
|
126
126
|
"use-effect-event": "^1.0.2"
|
|
127
127
|
},
|
|
128
128
|
"devDependencies": {
|
|
129
|
-
"@babel/core": "^7.26.
|
|
130
|
-
"@babel/preset-env": "^7.26.
|
|
129
|
+
"@babel/core": "^7.26.8",
|
|
130
|
+
"@babel/preset-env": "^7.26.8",
|
|
131
131
|
"@babel/preset-react": "^7.26.3",
|
|
132
132
|
"@babel/preset-typescript": "^7.26.0",
|
|
133
133
|
"@commitlint/cli": "^19.7.1",
|
|
@@ -135,21 +135,21 @@
|
|
|
135
135
|
"@sanity/pkg-utils": "^6.13.4",
|
|
136
136
|
"@sanity/prettier-config": "^1.0.3",
|
|
137
137
|
"@sanity/semantic-release-preset": "^5.0.0",
|
|
138
|
-
"@sanity/ui-workshop": "^2.0.
|
|
139
|
-
"@storybook/addon-a11y": "^8.5.
|
|
140
|
-
"@storybook/addon-docs": "^8.5.
|
|
141
|
-
"@storybook/addon-essentials": "^8.5.
|
|
142
|
-
"@storybook/addon-interactions": "^8.5.
|
|
143
|
-
"@storybook/addon-links": "^8.5.
|
|
144
|
-
"@storybook/addon-mdx-gfm": "^8.5.
|
|
145
|
-
"@storybook/addon-storysource": "^8.5.
|
|
146
|
-
"@storybook/addon-themes": "^8.5.
|
|
147
|
-
"@storybook/blocks": "^8.5.
|
|
148
|
-
"@storybook/manager-api": "^8.5.
|
|
149
|
-
"@storybook/react": "^8.5.
|
|
150
|
-
"@storybook/react-vite": "^8.5.
|
|
151
|
-
"@storybook/test": "^8.5.
|
|
152
|
-
"@storybook/theming": "^8.5.
|
|
138
|
+
"@sanity/ui-workshop": "^2.0.27",
|
|
139
|
+
"@storybook/addon-a11y": "^8.5.5",
|
|
140
|
+
"@storybook/addon-docs": "^8.5.5",
|
|
141
|
+
"@storybook/addon-essentials": "^8.5.5",
|
|
142
|
+
"@storybook/addon-interactions": "^8.5.5",
|
|
143
|
+
"@storybook/addon-links": "^8.5.5",
|
|
144
|
+
"@storybook/addon-mdx-gfm": "^8.5.5",
|
|
145
|
+
"@storybook/addon-storysource": "^8.5.5",
|
|
146
|
+
"@storybook/addon-themes": "^8.5.5",
|
|
147
|
+
"@storybook/blocks": "^8.5.5",
|
|
148
|
+
"@storybook/manager-api": "^8.5.5",
|
|
149
|
+
"@storybook/react": "^8.5.5",
|
|
150
|
+
"@storybook/react-vite": "^8.5.5",
|
|
151
|
+
"@storybook/test": "^8.5.5",
|
|
152
|
+
"@storybook/theming": "^8.5.5",
|
|
153
153
|
"@testing-library/dom": "^10.4.0",
|
|
154
154
|
"@testing-library/jest-dom": "^6.6.3",
|
|
155
155
|
"@testing-library/react": "^16.2.0",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
178
178
|
"eslint-plugin-react": "^7.37.4",
|
|
179
179
|
"eslint-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209",
|
|
180
|
-
"eslint-plugin-react-hooks": "
|
|
180
|
+
"eslint-plugin-react-hooks": "experimental",
|
|
181
181
|
"eslint-plugin-storybook": "^0.11.2",
|
|
182
182
|
"http-server": "^14.1.1",
|
|
183
183
|
"husky": "^8.0.3",
|
|
@@ -187,15 +187,15 @@
|
|
|
187
187
|
"lint-staged": "^14.0.1",
|
|
188
188
|
"module-alias": "^2.2.3",
|
|
189
189
|
"npm-run-all2": "^5.0.2",
|
|
190
|
-
"prettier": "^3.
|
|
190
|
+
"prettier": "^3.5.0",
|
|
191
191
|
"react": "^19.0.0",
|
|
192
192
|
"react-dom": "^19.0.0",
|
|
193
193
|
"react-is": "^19.0.0",
|
|
194
194
|
"refractor": "^4.8.1",
|
|
195
195
|
"rimraf": "^5.0.5",
|
|
196
|
-
"semantic-release": "^24.2.
|
|
196
|
+
"semantic-release": "^24.2.2",
|
|
197
197
|
"start-server-and-test": "^2.0.10",
|
|
198
|
-
"storybook": "^8.5.
|
|
198
|
+
"storybook": "^8.5.5",
|
|
199
199
|
"styled-components": "^6.1.15",
|
|
200
200
|
"tsconfig-paths": "^4.2.0",
|
|
201
201
|
"typescript": "5.7.3",
|
|
@@ -265,10 +265,11 @@ export const WORKSHOP_TEXT_SIZE_OPTIONS = {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
export const WORKSHOP_TEXT_WEIGHT_OPTIONS: {[key: string]: ThemeFontWeightKey | ''} = {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
'(none)': '',
|
|
269
|
+
'Regular': 'regular',
|
|
270
|
+
'Medium': 'medium',
|
|
271
|
+
'Semibold': 'semibold',
|
|
272
|
+
'Bold': 'bold',
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
export const WORKSHOP_TOAST_STATUS_OPTIONS: {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
WORKSHOP_ICON_SYMBOL_OPTIONS,
|
|
10
10
|
WORKSHOP_TEXT_SIZE_OPTIONS,
|
|
11
11
|
WORKSHOP_SPACE_OPTIONS,
|
|
12
|
+
WORKSHOP_TEXT_WEIGHT_OPTIONS,
|
|
12
13
|
} from '../../../__workshop__/constants'
|
|
13
14
|
|
|
14
15
|
export default function ButtonStory() {
|
|
@@ -26,6 +27,8 @@ export default function ButtonStory() {
|
|
|
26
27
|
const textAlign =
|
|
27
28
|
useSelect('Text align', WORKSHOP_BUTTON_TEXT_ALIGN_OPTIONS, undefined, 'Props') || undefined
|
|
28
29
|
const textProp = useText('Text', 'Label', 'Props')
|
|
30
|
+
const textWeight =
|
|
31
|
+
useSelect('Text weight', WORKSHOP_TEXT_WEIGHT_OPTIONS, '', 'Props') || undefined
|
|
29
32
|
|
|
30
33
|
return (
|
|
31
34
|
<Flex align="center" height="fill" justify="center">
|
|
@@ -43,6 +46,7 @@ export default function ButtonStory() {
|
|
|
43
46
|
space={space}
|
|
44
47
|
textAlign={textAlign}
|
|
45
48
|
text={textProp}
|
|
49
|
+
textWeight={textWeight}
|
|
46
50
|
tone={tone}
|
|
47
51
|
/>
|
|
48
52
|
</Flex>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {ThemeFontWeightKey} from '@sanity/ui/theme'
|
|
1
2
|
import {forwardRef, isValidElement, useMemo} from 'react'
|
|
2
3
|
import {isValidElementType} from 'react-is'
|
|
3
4
|
import {styled} from 'styled-components'
|
|
@@ -29,9 +30,10 @@ export interface ButtonProps extends ResponsivePaddingProps, ResponsiveRadiusPro
|
|
|
29
30
|
loading?: boolean
|
|
30
31
|
selected?: boolean
|
|
31
32
|
space?: number | number[]
|
|
32
|
-
textAlign?: ButtonTextAlign
|
|
33
33
|
muted?: boolean
|
|
34
34
|
text?: React.ReactNode
|
|
35
|
+
textAlign?: ButtonTextAlign
|
|
36
|
+
textWeight?: ThemeFontWeightKey
|
|
35
37
|
tone?: ButtonTone
|
|
36
38
|
type?: 'button' | 'reset' | 'submit'
|
|
37
39
|
width?: ButtonWidth
|
|
@@ -85,6 +87,7 @@ export const Button = forwardRef(function Button(
|
|
|
85
87
|
space: spaceProp = 3,
|
|
86
88
|
text,
|
|
87
89
|
textAlign,
|
|
90
|
+
textWeight,
|
|
88
91
|
tone = 'default',
|
|
89
92
|
type = 'button',
|
|
90
93
|
muted = false,
|
|
@@ -155,7 +158,7 @@ export const Button = forwardRef(function Button(
|
|
|
155
158
|
align={textAlign}
|
|
156
159
|
size={fontSize}
|
|
157
160
|
textOverflow="ellipsis"
|
|
158
|
-
weight={button.textWeight}
|
|
161
|
+
weight={textWeight ?? button.textWeight}
|
|
159
162
|
>
|
|
160
163
|
{text}
|
|
161
164
|
</Text>
|