@sanity/ui 2.0.16 → 2.1.1
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/theme.esm.js +16 -11
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +16 -11
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +16 -11
- package/dist/theme.mjs.map +1 -1
- package/package.json +22 -19
- package/src/core/primitives/button/__workshop__/disabled.tsx +73 -0
- package/src/core/primitives/button/__workshop__/index.ts +5 -0
- package/src/theme/defaults/colorTokens.ts +16 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -120,36 +120,36 @@
|
|
|
120
120
|
"@commitlint/cli": "^19.2.1",
|
|
121
121
|
"@commitlint/config-conventional": "^19.1.0",
|
|
122
122
|
"@juggle/resize-observer": "^3.4.0",
|
|
123
|
-
"@sanity/pkg-utils": "^
|
|
123
|
+
"@sanity/pkg-utils": "^6.0.2",
|
|
124
124
|
"@sanity/semantic-release-preset": "^4.1.7",
|
|
125
125
|
"@sanity/ui-workshop": "^2.0.11",
|
|
126
|
-
"@storybook/addon-a11y": "^8.0.
|
|
127
|
-
"@storybook/addon-docs": "^8.0.
|
|
128
|
-
"@storybook/addon-essentials": "^8.0.
|
|
129
|
-
"@storybook/addon-interactions": "^8.0.
|
|
130
|
-
"@storybook/addon-links": "^8.0.
|
|
131
|
-
"@storybook/addon-storysource": "^8.0.
|
|
132
|
-
"@storybook/addon-themes": "^8.0.
|
|
133
|
-
"@storybook/blocks": "^8.0.
|
|
126
|
+
"@storybook/addon-a11y": "^8.0.6",
|
|
127
|
+
"@storybook/addon-docs": "^8.0.6",
|
|
128
|
+
"@storybook/addon-essentials": "^8.0.6",
|
|
129
|
+
"@storybook/addon-interactions": "^8.0.6",
|
|
130
|
+
"@storybook/addon-links": "^8.0.6",
|
|
131
|
+
"@storybook/addon-storysource": "^8.0.6",
|
|
132
|
+
"@storybook/addon-themes": "^8.0.6",
|
|
133
|
+
"@storybook/blocks": "^8.0.6",
|
|
134
134
|
"@storybook/jest": "^0.2.3",
|
|
135
|
-
"@storybook/manager-api": "^8.0.
|
|
136
|
-
"@storybook/react": "^8.0.
|
|
137
|
-
"@storybook/react-vite": "^8.0.
|
|
135
|
+
"@storybook/manager-api": "^8.0.6",
|
|
136
|
+
"@storybook/react": "^8.0.6",
|
|
137
|
+
"@storybook/react-vite": "^8.0.6",
|
|
138
138
|
"@storybook/testing-library": "^0.2.2",
|
|
139
|
-
"@storybook/theming": "^8.0.
|
|
139
|
+
"@storybook/theming": "^8.0.6",
|
|
140
140
|
"@testing-library/dom": "^9.3.4",
|
|
141
141
|
"@testing-library/jest-dom": "^5.17.0",
|
|
142
|
-
"@testing-library/react": "^14.
|
|
142
|
+
"@testing-library/react": "^14.3.0",
|
|
143
143
|
"@types/jest": "^29.5.12",
|
|
144
144
|
"@types/jest-axe": "^3.5.9",
|
|
145
145
|
"@types/node": "^20.5.9",
|
|
146
|
-
"@types/react": "^18.2.
|
|
146
|
+
"@types/react": "^18.2.75",
|
|
147
147
|
"@types/react-dom": "^18.2.24",
|
|
148
148
|
"@types/react-is": "^18.2.4",
|
|
149
149
|
"@types/refractor": "^3.4.1",
|
|
150
150
|
"@types/testing-library__jest-dom": "^5.14.9",
|
|
151
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
152
|
-
"@typescript-eslint/parser": "^7.
|
|
151
|
+
"@typescript-eslint/eslint-plugin": "^7.6.0",
|
|
152
|
+
"@typescript-eslint/parser": "^7.6.0",
|
|
153
153
|
"commitizen": "^4.3.0",
|
|
154
154
|
"cypress": "^13.7.2",
|
|
155
155
|
"cypress-real-events": "^1.12.0",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"rimraf": "^5.0.1",
|
|
181
181
|
"semantic-release": "^23.0.7",
|
|
182
182
|
"start-server-and-test": "^2.0.3",
|
|
183
|
-
"storybook": "^8.0.
|
|
183
|
+
"storybook": "^8.0.6",
|
|
184
184
|
"styled-components": "^6.1.8",
|
|
185
185
|
"tsconfig-paths": "^4.2.0",
|
|
186
186
|
"typescript": "5.4.2",
|
|
@@ -200,5 +200,8 @@
|
|
|
200
200
|
"publishConfig": {
|
|
201
201
|
"access": "public",
|
|
202
202
|
"provenance": true
|
|
203
|
+
},
|
|
204
|
+
"esm.sh": {
|
|
205
|
+
"bundle": false
|
|
203
206
|
}
|
|
204
207
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {SquareIcon} from '@sanity/icons'
|
|
2
|
+
import {Card} from '../../card/card'
|
|
3
|
+
import {Container} from '../../container/container'
|
|
4
|
+
import {Grid} from '../../grid/grid'
|
|
5
|
+
import {Stack} from '../../stack/stack'
|
|
6
|
+
import {Text} from '../../text/text'
|
|
7
|
+
import {Button, ButtonProps} from '../button'
|
|
8
|
+
|
|
9
|
+
const GAP = 4
|
|
10
|
+
const COLUMNS = 3
|
|
11
|
+
|
|
12
|
+
const DEFAULT_PROPS: ButtonProps = {
|
|
13
|
+
icon: SquareIcon,
|
|
14
|
+
iconRight: SquareIcon,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function Layout() {
|
|
18
|
+
return (
|
|
19
|
+
<Container width={2}>
|
|
20
|
+
<Stack space={4}>
|
|
21
|
+
<Grid columns={COLUMNS} gap={GAP}>
|
|
22
|
+
<Text size={1} weight="semibold">
|
|
23
|
+
Default
|
|
24
|
+
</Text>
|
|
25
|
+
<Text size={1} weight="semibold">
|
|
26
|
+
Ghost
|
|
27
|
+
</Text>
|
|
28
|
+
<Text size={1} weight="semibold">
|
|
29
|
+
Bleed
|
|
30
|
+
</Text>
|
|
31
|
+
</Grid>
|
|
32
|
+
|
|
33
|
+
<Stack space={2}>
|
|
34
|
+
<Grid columns={COLUMNS} gap={GAP}>
|
|
35
|
+
<Stack space={2}>
|
|
36
|
+
<Button {...DEFAULT_PROPS} mode="default" text="Enabled" />
|
|
37
|
+
<Button {...DEFAULT_PROPS} disabled mode="default" text="Disabled" />
|
|
38
|
+
<Button {...DEFAULT_PROPS} disabled mode="default" muted text="Disabled (muted)" />
|
|
39
|
+
</Stack>
|
|
40
|
+
|
|
41
|
+
<Stack space={2}>
|
|
42
|
+
<Button {...DEFAULT_PROPS} mode="ghost" text="Enabled" />
|
|
43
|
+
<Button {...DEFAULT_PROPS} disabled mode="ghost" text="Disabled" />
|
|
44
|
+
<Button {...DEFAULT_PROPS} disabled mode="ghost" muted text="Disabled (muted)" />
|
|
45
|
+
</Stack>
|
|
46
|
+
|
|
47
|
+
<Stack space={2}>
|
|
48
|
+
<Button {...DEFAULT_PROPS} mode="bleed" text="Enabled" />
|
|
49
|
+
<Button {...DEFAULT_PROPS} mode="bleed" disabled text="Disabled" />
|
|
50
|
+
<Button {...DEFAULT_PROPS} disabled mode="bleed" muted text="Disabled (muted)" />
|
|
51
|
+
</Stack>
|
|
52
|
+
</Grid>
|
|
53
|
+
</Stack>
|
|
54
|
+
</Stack>
|
|
55
|
+
</Container>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export default function DisabledButtonStory() {
|
|
60
|
+
return (
|
|
61
|
+
<Stack>
|
|
62
|
+
<Stack space={4}>
|
|
63
|
+
<Card padding={5} scheme="light">
|
|
64
|
+
<Layout />
|
|
65
|
+
</Card>
|
|
66
|
+
|
|
67
|
+
<Card padding={5} scheme="dark">
|
|
68
|
+
<Layout />
|
|
69
|
+
</Card>
|
|
70
|
+
</Stack>
|
|
71
|
+
</Stack>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -155,7 +155,12 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
155
155
|
icon: ['white', 'black'],
|
|
156
156
|
},
|
|
157
157
|
},
|
|
158
|
-
bg: ['
|
|
158
|
+
bg: ['300', '600'],
|
|
159
|
+
fg: ['300', '600'],
|
|
160
|
+
muted: {
|
|
161
|
+
bg: ['300', '600'],
|
|
162
|
+
fg: ['300', '600'],
|
|
163
|
+
},
|
|
159
164
|
kbd: {
|
|
160
165
|
bg: ['black', 'white'],
|
|
161
166
|
fg: ['white', 'black'],
|
|
@@ -256,8 +261,11 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
256
261
|
bg: ['50', '950'],
|
|
257
262
|
fg: ['200', '800'],
|
|
258
263
|
},
|
|
259
|
-
fg: ['
|
|
260
|
-
icon: ['
|
|
264
|
+
fg: ['400', '600'],
|
|
265
|
+
icon: ['300', '700'],
|
|
266
|
+
muted: {
|
|
267
|
+
fg: ['400', '600'],
|
|
268
|
+
},
|
|
261
269
|
kbd: {
|
|
262
270
|
bg: ['white', 'black'],
|
|
263
271
|
fg: ['200', '800'],
|
|
@@ -266,9 +274,6 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
266
274
|
link: {
|
|
267
275
|
fg: ['200', '800'],
|
|
268
276
|
},
|
|
269
|
-
muted: {
|
|
270
|
-
fg: ['200', '800'],
|
|
271
|
-
},
|
|
272
277
|
},
|
|
273
278
|
},
|
|
274
279
|
positive: {
|
|
@@ -354,8 +359,11 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
354
359
|
bg: ['50', '950'],
|
|
355
360
|
fg: ['200', '800'],
|
|
356
361
|
},
|
|
357
|
-
fg: ['
|
|
358
|
-
icon: ['
|
|
362
|
+
fg: ['400', '600'],
|
|
363
|
+
icon: ['300', '700'],
|
|
364
|
+
muted: {
|
|
365
|
+
fg: ['400', '600'],
|
|
366
|
+
},
|
|
359
367
|
kbd: {
|
|
360
368
|
bg: ['white', 'black'],
|
|
361
369
|
fg: ['200', '800'],
|
|
@@ -364,9 +372,6 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
364
372
|
link: {
|
|
365
373
|
fg: ['200', '800'],
|
|
366
374
|
},
|
|
367
|
-
muted: {
|
|
368
|
-
fg: ['200', '800'],
|
|
369
|
-
},
|
|
370
375
|
},
|
|
371
376
|
},
|
|
372
377
|
},
|