@sanity/ui 2.6.6 → 2.6.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/dist/index.d.mts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.esm.js +47 -48
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -48
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +14 -14
- package/dist/theme.d.ts +14 -14
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs.map +1 -1
- package/package.json +24 -25
- package/src/core/__workshop__/constants.ts +36 -36
- package/src/core/components/autocomplete/autocomplete.tsx +1 -1
- package/src/core/components/dialog/styles.ts +8 -8
- package/src/core/components/menu/menuButton.tsx +10 -10
- package/src/core/components/tab/tab.tsx +8 -8
- package/src/core/components/tab/tabPanel.tsx +1 -1
- package/src/core/primitives/avatar/styles.ts +42 -42
- package/src/core/primitives/badge/styles.ts +2 -2
- package/src/core/primitives/button/styles.ts +4 -4
- package/src/core/primitives/inline/styles.ts +2 -2
- package/src/core/primitives/popover/constants.ts +4 -4
- package/src/core/primitives/stack/styles.ts +2 -2
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -1
- package/src/core/primitives/tooltip/constants.ts +4 -4
- package/src/core/primitives/tooltip/tooltip.tsx +49 -68
- package/src/core/styles/font/responsiveFont.ts +8 -8
- package/src/core/theme/__workshop__/debug/story.tsx +11 -11
- package/src/core/utils/portal/portalProvider.tsx +10 -5
- package/src/theme/build/buildColorTheme.test.ts +13 -13
- package/src/theme/config/tokens/color/types.ts +14 -14
- package/src/theme/defaults/colorTokens.ts +36 -36
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.7",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -87,7 +87,6 @@
|
|
|
87
87
|
"prettier --write --cache --ignore-unknown"
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
|
-
"prettier": "@sanity/prettier-config",
|
|
91
90
|
"release": {
|
|
92
91
|
"branches": [
|
|
93
92
|
"+([0-9])?(.{+([0-9]),x}).x",
|
|
@@ -110,8 +109,7 @@
|
|
|
110
109
|
"@sanity/icons": "^3.3.0",
|
|
111
110
|
"csstype": "^3.1.3",
|
|
112
111
|
"framer-motion": "11.0.8",
|
|
113
|
-
"react-refractor": "^2.2.0"
|
|
114
|
-
"use-effect-event": "^1.0.2"
|
|
112
|
+
"react-refractor": "^2.2.0"
|
|
115
113
|
},
|
|
116
114
|
"devDependencies": {
|
|
117
115
|
"@babel/core": "^7.24.7",
|
|
@@ -122,25 +120,24 @@
|
|
|
122
120
|
"@commitlint/config-conventional": "^19.2.2",
|
|
123
121
|
"@juggle/resize-observer": "^3.4.0",
|
|
124
122
|
"@sanity/pkg-utils": "^6.10.3",
|
|
125
|
-
"@sanity/
|
|
126
|
-
"@sanity/semantic-release-preset": "^5.0.0",
|
|
123
|
+
"@sanity/semantic-release-preset": "^4.1.8",
|
|
127
124
|
"@sanity/ui-workshop": "^2.0.15",
|
|
128
|
-
"@storybook/addon-a11y": "^8.
|
|
129
|
-
"@storybook/addon-docs": "^8.
|
|
130
|
-
"@storybook/addon-essentials": "^8.
|
|
131
|
-
"@storybook/addon-interactions": "^8.
|
|
132
|
-
"@storybook/addon-links": "^8.
|
|
133
|
-
"@storybook/addon-
|
|
134
|
-
"@storybook/addon-
|
|
135
|
-
"@storybook/
|
|
136
|
-
"@storybook/
|
|
137
|
-
"@storybook/manager-api": "^8.
|
|
138
|
-
"@storybook/react": "^8.
|
|
139
|
-
"@storybook/react-vite": "^8.
|
|
140
|
-
"@storybook/
|
|
141
|
-
"@storybook/theming": "^8.
|
|
125
|
+
"@storybook/addon-a11y": "^8.0.8",
|
|
126
|
+
"@storybook/addon-docs": "^8.0.8",
|
|
127
|
+
"@storybook/addon-essentials": "^8.0.8",
|
|
128
|
+
"@storybook/addon-interactions": "^8.0.8",
|
|
129
|
+
"@storybook/addon-links": "^8.0.8",
|
|
130
|
+
"@storybook/addon-storysource": "^8.0.8",
|
|
131
|
+
"@storybook/addon-themes": "^8.0.8",
|
|
132
|
+
"@storybook/blocks": "^8.0.8",
|
|
133
|
+
"@storybook/jest": "^0.2.3",
|
|
134
|
+
"@storybook/manager-api": "^8.0.8",
|
|
135
|
+
"@storybook/react": "^8.0.8",
|
|
136
|
+
"@storybook/react-vite": "^8.0.8",
|
|
137
|
+
"@storybook/testing-library": "^0.2.2",
|
|
138
|
+
"@storybook/theming": "^8.0.8",
|
|
142
139
|
"@testing-library/dom": "^10.3.1",
|
|
143
|
-
"@testing-library/jest-dom": "^
|
|
140
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
144
141
|
"@testing-library/react": "^16.0.0",
|
|
145
142
|
"@types/jest": "^29.5.12",
|
|
146
143
|
"@types/jest-axe": "^3.5.9",
|
|
@@ -149,6 +146,7 @@
|
|
|
149
146
|
"@types/react-dom": "^18.3.0",
|
|
150
147
|
"@types/react-is": "^18.3.0",
|
|
151
148
|
"@types/refractor": "^3.4.1",
|
|
149
|
+
"@types/testing-library__jest-dom": "^5.14.9",
|
|
152
150
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
153
151
|
"@typescript-eslint/parser": "^7.16.0",
|
|
154
152
|
"commitizen": "^4.3.0",
|
|
@@ -174,6 +172,7 @@
|
|
|
174
172
|
"module-alias": "^2.2.3",
|
|
175
173
|
"npm-run-all2": "^5.0.2",
|
|
176
174
|
"prettier": "^3.3.2",
|
|
175
|
+
"prettier-plugin-packagejson": "^2.5.0",
|
|
177
176
|
"react": "^18.3.1",
|
|
178
177
|
"react-dom": "^18.3.1",
|
|
179
178
|
"react-is": "^18.3.1",
|
|
@@ -181,7 +180,7 @@
|
|
|
181
180
|
"rimraf": "^5.0.5",
|
|
182
181
|
"semantic-release": "^24.0.0",
|
|
183
182
|
"start-server-and-test": "^2.0.4",
|
|
184
|
-
"storybook": "^8.
|
|
183
|
+
"storybook": "^8.0.8",
|
|
185
184
|
"styled-components": "^6.1.11",
|
|
186
185
|
"tsconfig-paths": "^4.2.0",
|
|
187
186
|
"typescript": "5.5.3",
|
|
@@ -201,12 +200,12 @@
|
|
|
201
200
|
"publishConfig": {
|
|
202
201
|
"access": "public"
|
|
203
202
|
},
|
|
203
|
+
"esm.sh": {
|
|
204
|
+
"bundle": false
|
|
205
|
+
},
|
|
204
206
|
"pnpm": {
|
|
205
207
|
"overrides": {
|
|
206
208
|
"conventional-changelog-conventionalcommits": ">= 8.0.0"
|
|
207
209
|
}
|
|
208
|
-
},
|
|
209
|
-
"esm.sh": {
|
|
210
|
-
"bundle": false
|
|
211
210
|
}
|
|
212
211
|
}
|
|
@@ -44,9 +44,9 @@ export const WORKSHOP_BUTTON_MODE_OPTIONS: {[key: string]: ButtonMode} = {
|
|
|
44
44
|
|
|
45
45
|
export const WORKSHOP_BUTTON_TEXT_ALIGN_OPTIONS: {[key: string]: ButtonTextAlign | ''} = {
|
|
46
46
|
'(none)': '',
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
Left: 'left',
|
|
48
|
+
Right: 'right',
|
|
49
|
+
Center: 'center',
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export const WORKSHOP_BUTTON_TONE_OPTIONS: {[key: string]: ButtonTone} = {
|
|
@@ -61,11 +61,11 @@ export const WORKSHOP_CARD_AS_OPTIONS: {
|
|
|
61
61
|
[key: string]: 'div' | 'button' | 'span' | 'ol' | 'pre' | 'ul'
|
|
62
62
|
} = {
|
|
63
63
|
'DIV (default)': 'div',
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
BUTTON: 'button',
|
|
65
|
+
SPAN: 'span',
|
|
66
|
+
OL: 'ol',
|
|
67
|
+
PRE: 'pre',
|
|
68
|
+
UL: 'ul',
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export const WORKSHOP_CARD_TONE_OPTIONS: {[key: string]: CardTone} = {
|
|
@@ -92,7 +92,7 @@ export const WORKSHOP_CONTAINER_WIDTH_OPTIONS: {[key: string]: number | 'auto'}
|
|
|
92
92
|
'3': 3,
|
|
93
93
|
'4': 4,
|
|
94
94
|
'5': 5,
|
|
95
|
-
|
|
95
|
+
auto: 'auto',
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export const WORKSHOP_DIALOG_POSITION_OPTIONS: {[key: string]: DialogPosition} = {
|
|
@@ -106,15 +106,15 @@ export const WORKSHOP_FLEX_DIRECTION_OPTIONS: {[key: string]: 'row' | 'column'}
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export const WORKSHOP_FLEX_ALIGN_OPTIONS: Record<FlexAlign, FlexAlign> = {
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
baseline: 'baseline',
|
|
110
|
+
center: 'center',
|
|
111
111
|
'flex-end': 'flex-end',
|
|
112
112
|
'flex-start': 'flex-start',
|
|
113
|
-
|
|
113
|
+
stretch: 'stretch',
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
export const WORKSHOP_FLEX_JUSTIFY_OPTIONS: Record<FlexJustify, FlexJustify> = {
|
|
117
|
-
|
|
117
|
+
center: 'center',
|
|
118
118
|
'flex-end': 'flex-end',
|
|
119
119
|
'flex-start': 'flex-start',
|
|
120
120
|
'space-around': 'space-around',
|
|
@@ -157,16 +157,16 @@ export const WORKSHOP_LABEL_FONT_SIZE_OPTIONS = {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
export const WORKSHOP_PLACEMENT_OPTIONS: Record<Placement, Placement> = {
|
|
160
|
-
|
|
160
|
+
top: 'top',
|
|
161
161
|
'top-start': 'top-start',
|
|
162
162
|
'top-end': 'top-end',
|
|
163
|
-
|
|
163
|
+
right: 'right',
|
|
164
164
|
'right-start': 'right-start',
|
|
165
165
|
'right-end': 'right-end',
|
|
166
|
-
|
|
166
|
+
left: 'left',
|
|
167
167
|
'left-start': 'left-start',
|
|
168
168
|
'left-end': 'left-end',
|
|
169
|
-
|
|
169
|
+
bottom: 'bottom',
|
|
170
170
|
'bottom-start': 'bottom-start',
|
|
171
171
|
'bottom-end': 'bottom-end',
|
|
172
172
|
}
|
|
@@ -217,11 +217,11 @@ export const WORKSHOP_SPOT_COLOR_OPTIONS: {[key: string]: ThemeColorSpotKey} = {
|
|
|
217
217
|
|
|
218
218
|
export const WORKSHOP_TEXT_ALIGN_OPTIONS: {[key: string]: TextAlign | ''} = {
|
|
219
219
|
'(none)': '',
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
Initial: 'initial',
|
|
221
|
+
Left: 'left',
|
|
222
|
+
Right: 'right',
|
|
223
|
+
Center: 'center',
|
|
224
|
+
Justify: 'justify',
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
export const WORKSHOP_TEXT_FONT_SIZE_OPTIONS = {
|
|
@@ -233,17 +233,17 @@ export const WORKSHOP_TEXT_FONT_SIZE_OPTIONS = {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
export const WORKSHOP_TEXT_INPUT_TYPE_OPTIONS: {[key: string]: TextInputType} = {
|
|
236
|
-
|
|
236
|
+
date: 'date',
|
|
237
237
|
'datetime-local': 'datetime-local',
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
238
|
+
email: 'email',
|
|
239
|
+
month: 'month',
|
|
240
|
+
number: 'number',
|
|
241
|
+
password: 'password',
|
|
242
|
+
tel: 'tel',
|
|
243
|
+
time: 'time',
|
|
244
|
+
text: 'text',
|
|
245
|
+
week: 'week',
|
|
246
|
+
color: 'color',
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
export const WORKSHOP_TEXT_OVERFLOW_OPTIONS: {[key: string]: 'ellipsis' | ''} = {
|
|
@@ -261,9 +261,9 @@ export const WORKSHOP_TEXT_SIZE_OPTIONS = {
|
|
|
261
261
|
|
|
262
262
|
export const WORKSHOP_TEXT_WEIGHT_OPTIONS: {[key: string]: ThemeFontWeightKey | ''} = {
|
|
263
263
|
'Regular (default)': '',
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
Medium: 'medium',
|
|
265
|
+
Semibold: 'semibold',
|
|
266
|
+
Bold: 'bold',
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
export const WORKSHOP_THEME_COLOR_TONE_OPTIONS: {[key: string]: ThemeColorToneKey} = {
|
|
@@ -286,7 +286,7 @@ export const WORKSHOP_TOAST_STATUS_OPTIONS: {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
export const WORKSHOP_WIDTH_OPTIONS: {[key: string]: number | 'auto'} = {
|
|
289
|
-
|
|
289
|
+
Auto: 'auto',
|
|
290
290
|
'0': 0,
|
|
291
291
|
'1': 1,
|
|
292
292
|
'2': 2,
|
|
@@ -18,14 +18,14 @@ export function dialogStyle({theme}: ThemeProps): CSSObject {
|
|
|
18
18
|
display: 'flex',
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0,
|
|
23
|
+
right: 0,
|
|
24
|
+
bottom: 0,
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
outline: 'none',
|
|
28
|
+
background: color.backdrop,
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -206,11 +206,11 @@ export const MenuButton = forwardRef(function MenuButton(
|
|
|
206
206
|
const menuProps: MenuProps = useMemo(
|
|
207
207
|
() => ({
|
|
208
208
|
'aria-labelledby': id,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
onBlurCapture: handleBlur,
|
|
210
|
+
onClickOutside: handleMenuClickOutside,
|
|
211
|
+
onEscape: handleMenuEscape,
|
|
212
|
+
onItemClick: handleItemClick,
|
|
213
|
+
originElement: buttonElement,
|
|
214
214
|
registerElement,
|
|
215
215
|
shouldFocus,
|
|
216
216
|
}),
|
|
@@ -235,13 +235,13 @@ export const MenuButton = forwardRef(function MenuButton(
|
|
|
235
235
|
cloneElement(buttonProp, {
|
|
236
236
|
'data-ui': 'MenuButton',
|
|
237
237
|
id,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
onClick: handleButtonClick,
|
|
239
|
+
onKeyDown: handleButtonKeyDown,
|
|
240
|
+
onMouseDown: handleMouseDown,
|
|
241
241
|
'aria-haspopup': true,
|
|
242
242
|
'aria-expanded': open,
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
ref: ref,
|
|
244
|
+
selected: buttonProp.props.selected ?? open,
|
|
245
245
|
}),
|
|
246
246
|
[buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open],
|
|
247
247
|
)
|
|
@@ -11,14 +11,14 @@ export interface TabProps {
|
|
|
11
11
|
* The `id` of the correlating `TabPanel` component.
|
|
12
12
|
*/
|
|
13
13
|
'aria-controls': string
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
id: string
|
|
15
|
+
icon?: React.ElementType | React.ReactNode
|
|
16
|
+
focused?: boolean
|
|
17
|
+
fontSize?: number | number[]
|
|
18
|
+
label?: React.ReactNode
|
|
19
|
+
padding?: number | number[]
|
|
20
|
+
selected?: boolean
|
|
21
|
+
tone?: ButtonTone
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const CustomButton = styled(Button)`
|
|
@@ -14,24 +14,24 @@ export const avatarStyle = {
|
|
|
14
14
|
|
|
15
15
|
function avatarArrowStyle(): CSSObject {
|
|
16
16
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
zIndex: 0,
|
|
20
|
+
opacity: 0,
|
|
21
|
+
transition: 'all 0.2s linear',
|
|
22
|
+
transform: 'rotate(-90deg) translate3d(0, 6px, 0)',
|
|
23
|
+
left: 0,
|
|
24
|
+
right: 0,
|
|
25
|
+
top: 0,
|
|
26
|
+
bottom: 0,
|
|
27
27
|
|
|
28
28
|
'& > svg': {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
width: '11px',
|
|
30
|
+
height: '7px',
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
top: '-5px',
|
|
33
|
+
left: '50%',
|
|
34
|
+
transform: 'translateX(-6px)',
|
|
35
35
|
|
|
36
36
|
'&:not([hidden])': {
|
|
37
37
|
display: 'block',
|
|
@@ -63,11 +63,11 @@ export function avatarRootStyle(props: AvatarRootStyleProps & ThemeProps): CSSOb
|
|
|
63
63
|
'--avatar-bg-color': `var(--card-avatar-${$color}-bg-color)`,
|
|
64
64
|
'--avatar-fg-color': `var(--card-avatar-${$color}-fg-color)`,
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
backgroundColor: 'var(--avatar-bg-color)',
|
|
67
|
+
position: 'relative',
|
|
68
|
+
boxSizing: 'border-box',
|
|
69
|
+
userSelect: 'none',
|
|
70
|
+
boxShadow: '0 0 0 1px var(--card-bg-color)',
|
|
71
71
|
|
|
72
72
|
'&[data-status="inactive"]': {
|
|
73
73
|
opacity: 0.5,
|
|
@@ -81,14 +81,14 @@ export function avatarRootStyle(props: AvatarRootStyleProps & ThemeProps): CSSOb
|
|
|
81
81
|
|
|
82
82
|
/* &:is(button) */
|
|
83
83
|
'&[data-as="button"]': {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
WebkitFontSmoothing: 'inherit',
|
|
85
|
+
appearance: 'none',
|
|
86
|
+
margin: 0,
|
|
87
|
+
padding: 0,
|
|
88
|
+
border: 0,
|
|
89
|
+
font: 'inherit',
|
|
90
|
+
color: 'inherit',
|
|
91
|
+
outline: 'none',
|
|
92
92
|
|
|
93
93
|
'&:focus': {
|
|
94
94
|
boxShadow: focusRingStyle({focusRing: avatar.focusRing}),
|
|
@@ -110,9 +110,9 @@ export function responsiveAvatarSizeStyle(
|
|
|
110
110
|
const avatarSize = avatar.sizes[size] || avatar.sizes[0]
|
|
111
111
|
|
|
112
112
|
return {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
width: rem(avatarSize.size),
|
|
114
|
+
height: rem(avatarSize.size),
|
|
115
|
+
borderRadius: rem(avatarSize.size / 2),
|
|
116
116
|
|
|
117
117
|
'&>svg': {
|
|
118
118
|
width: rem(avatarSize.size),
|
|
@@ -131,14 +131,14 @@ export function avatarImageStyle(): CSSObject {
|
|
|
131
131
|
|
|
132
132
|
export function avatarInitialsStyle(): CSSObject {
|
|
133
133
|
return {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
width: '100%',
|
|
135
|
+
height: '100%',
|
|
136
|
+
color: 'var(--avatar-fg-color)',
|
|
137
|
+
alignItems: 'center',
|
|
138
|
+
justifyContent: 'center',
|
|
139
|
+
textTransform: 'uppercase',
|
|
140
|
+
textAlign: 'center',
|
|
141
|
+
borderRadius: '50%',
|
|
142
142
|
|
|
143
143
|
'&:not([hidden])': {
|
|
144
144
|
display: 'flex',
|
|
@@ -155,8 +155,8 @@ function avatarBgStrokeStyle(): CSSObject {
|
|
|
155
155
|
|
|
156
156
|
function avatarStrokeStyle(): CSSObject {
|
|
157
157
|
return {
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
strokeWidth: '2px',
|
|
159
|
+
stroke: 'var(--avatar-bg-color)',
|
|
160
160
|
|
|
161
161
|
'[data-status="editing"] &': {
|
|
162
162
|
strokeDasharray: '2 4',
|
|
@@ -8,8 +8,8 @@ export function badgeStyle(props: BadgeStyleProps): CSSObject {
|
|
|
8
8
|
'--card-bg-color': `var(--card-badge-${$tone}-bg-color)`,
|
|
9
9
|
'--card-fg-color': `var(--card-badge-${$tone}-fg-color)`,
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
backgroundColor: 'var(--card-bg-color)',
|
|
12
|
+
cursor: 'default',
|
|
13
13
|
|
|
14
14
|
'&:not([hidden])': {
|
|
15
15
|
display: 'inline-block',
|
|
@@ -81,12 +81,12 @@ export function buttonColorStyles(
|
|
|
81
81
|
return [
|
|
82
82
|
_cardColorStyle(baseColor, color.enabled),
|
|
83
83
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
backgroundColor: 'var(--card-bg-color)',
|
|
85
|
+
color: 'var(--card-fg-color)',
|
|
86
|
+
boxShadow: focusRingBorderStyle(border),
|
|
87
87
|
'&:disabled, &[data-disabled="true"]': _cardColorStyle(baseColor, color.disabled),
|
|
88
88
|
"&:not([data-disabled='true'])": {
|
|
89
|
-
|
|
89
|
+
boxShadow: combineBoxShadow(
|
|
90
90
|
focusRingBorderStyle(border),
|
|
91
91
|
shadow ? defaultBoxShadow : undefined,
|
|
92
92
|
),
|
|
@@ -4,7 +4,7 @@ import {ResponsiveInlineSpaceStyleProps} from './types'
|
|
|
4
4
|
|
|
5
5
|
export function inlineBaseStyle(): CSSObject {
|
|
6
6
|
return {
|
|
7
|
-
|
|
7
|
+
lineHeight: 0,
|
|
8
8
|
|
|
9
9
|
'&&:not([hidden])': {
|
|
10
10
|
display: 'block',
|
|
@@ -24,7 +24,7 @@ export function inlineSpaceStyle(props: ResponsiveInlineSpaceStyleProps & ThemeP
|
|
|
24
24
|
const _space = rem(spaceIndex === 0.5 ? space[1] / 2 : space[spaceIndex])
|
|
25
25
|
|
|
26
26
|
return {
|
|
27
|
-
|
|
27
|
+
margin: `-${_space} 0 0 -${_space}`,
|
|
28
28
|
'& > div': {padding: `${_space} 0 0 ${_space}`},
|
|
29
29
|
}
|
|
30
30
|
})
|
|
@@ -7,16 +7,16 @@ export const DEFAULT_POPOVER_ARROW_HEIGHT = 8
|
|
|
7
7
|
export const DEFAULT_POPOVER_ARROW_RADIUS = 2
|
|
8
8
|
export const DEFAULT_POPOVER_MARGINS: PopoverMargins = [0, 0, 0, 0]
|
|
9
9
|
export const DEFAULT_FALLBACK_PLACEMENTS: Record<Placement, Placement[]> = {
|
|
10
|
-
|
|
10
|
+
top: ['bottom', 'left', 'right'],
|
|
11
11
|
'top-start': ['bottom-start', 'left-start', 'right-start'],
|
|
12
12
|
'top-end': ['bottom-end', 'left-end', 'right-end'],
|
|
13
|
-
|
|
13
|
+
bottom: ['top', 'left', 'right'],
|
|
14
14
|
'bottom-start': ['top-start', 'left-start', 'right-start'],
|
|
15
15
|
'bottom-end': ['top-end', 'left-end', 'right-end'],
|
|
16
|
-
|
|
16
|
+
left: ['right', 'top', 'bottom'],
|
|
17
17
|
'left-start': ['right-start', 'top-start', 'bottom-start'],
|
|
18
18
|
'left-end': ['right-end', 'top-end', 'bottom-end'],
|
|
19
|
-
|
|
19
|
+
right: ['left', 'top', 'bottom'],
|
|
20
20
|
'right-start': ['left-start', 'top-start', 'bottom-start'],
|
|
21
21
|
'right-end': ['left-end', 'top-end', 'bottom-end'],
|
|
22
22
|
}
|
|
@@ -12,8 +12,8 @@ const BASE_STYLE: CSSObject = {
|
|
|
12
12
|
'&[data-as="ul"],&[data-as="ol"]': {
|
|
13
13
|
listStyle: 'none',
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
gridTemplateColumns: 'minmax(0, 1fr)',
|
|
16
|
+
gridAutoRows: 'min-content',
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export function stackBaseStyle(): CSSObject {
|
|
@@ -8,16 +8,16 @@ export const DEFAULT_TOOLTIP_DISTANCE = 4
|
|
|
8
8
|
export const DEFAULT_TOOLTIP_PADDING = 4
|
|
9
9
|
|
|
10
10
|
export const DEFAULT_FALLBACK_PLACEMENTS: Record<Placement, Placement[]> = {
|
|
11
|
-
|
|
11
|
+
top: ['top-end', 'top-start', 'bottom', 'left', 'right'],
|
|
12
12
|
'top-start': ['top', 'top-end', 'bottom-start', 'left-start', 'right-start'],
|
|
13
13
|
'top-end': ['top', 'top-start', 'bottom-end', 'left-end', 'right-end'],
|
|
14
|
-
|
|
14
|
+
bottom: ['bottom-end', 'bottom-start', 'top', 'left', 'right'],
|
|
15
15
|
'bottom-start': ['bottom', 'bottom-end', 'top-start', 'left-start', 'right-start'],
|
|
16
16
|
'bottom-end': ['bottom', 'bottom-start', 'top-end', 'left-end', 'right-end'],
|
|
17
|
-
|
|
17
|
+
left: ['left-end', 'left-start', 'right', 'top', 'bottom'],
|
|
18
18
|
'left-start': ['left', 'left-end', 'right-start', 'top-start', 'bottom-start'],
|
|
19
19
|
'left-end': ['left', 'left-start', 'right-end', 'top-end', 'bottom-end'],
|
|
20
|
-
|
|
20
|
+
right: ['right-end', 'right-start', 'left', 'top', 'bottom'],
|
|
21
21
|
'right-start': ['right', 'right-end', 'left-start', 'top-start', 'bottom-start'],
|
|
22
22
|
'right-end': ['right', 'right-start', 'left-end', 'top-end', 'bottom-end'],
|
|
23
23
|
}
|