@sanity/ui 2.0.0-alpha.32 → 2.0.0-alpha.34

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": "2.0.0-alpha.32",
3
+ "version": "2.0.0-alpha.34",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./exports/index.ts",
@@ -1,6 +1,7 @@
1
1
  import {forwardRef} from 'react'
2
2
  import styled, {css} from 'styled-components'
3
3
  import {useArrayProp} from '../../hooks'
4
+ import {ThemeProps} from '../../styles'
4
5
  import {responsiveRadiusStyle, ResponsiveRadiusStyleProps} from '../../styles/internal'
5
6
  import {Radius} from '../../types'
6
7
  import {Box} from '../box'
@@ -16,9 +17,17 @@ export interface KBDProps {
16
17
  radius?: Radius | Radius[]
17
18
  }
18
19
 
19
- function kbdStyle() {
20
+ function kbdStyle(props: ThemeProps) {
21
+ const {theme} = props
22
+ const color = theme.sanity.color.kbd || theme.sanity.color.base
23
+
20
24
  return css`
21
- background: var(--card-bg2-color);
25
+ --card-fg-color: ${color.fg};
26
+ --kbd-box-bg: ${color.bg};
27
+ --kbd-box-shadow: ${color.border};
28
+
29
+ box-shadow: inset 0 0 0 1px var(--kbd-box-shadow);
30
+ background: var(--kbd-box-bg);
22
31
  font: inherit;
23
32
 
24
33
  &:not([hidden]) {
@@ -38,12 +47,12 @@ export const KBD = forwardRef(function KBD(
38
47
  props: KBDProps & Omit<React.HTMLProps<HTMLElement>, 'as' | 'ref' | 'size'>,
39
48
  ref: React.ForwardedRef<HTMLDivElement>,
40
49
  ) {
41
- const {children, fontSize = 1, padding = 1, radius = 2, ...restProps} = props
50
+ const {children, fontSize = 0, padding = 1, radius = 2, ...restProps} = props
42
51
 
43
52
  return (
44
53
  <Root data-ui="KBD" {...restProps} $radius={useArrayProp(radius)} ref={ref}>
45
54
  <Box as="span" padding={padding}>
46
- <Text as="span" muted size={fontSize} weight="medium">
55
+ <Text as="span" size={fontSize} weight="medium">
47
56
  {children}
48
57
  </Text>
49
58
  </Box>
@@ -7,15 +7,15 @@ export const config: Omit<RootTheme, 'color' | 'fonts'> = {
7
7
  avatar: {
8
8
  sizes: [
9
9
  {distance: -3, size: 19},
10
- {distance: -6, size: 31},
11
- {distance: -9, size: 51},
10
+ {distance: -6, size: 25},
11
+ {distance: -9, size: 35},
12
12
  ],
13
13
  focusRing: {offset: 0, width: 1},
14
14
  },
15
15
  button: {
16
16
  textWeight: 'medium',
17
17
  border: {width: STROKE_WIDTH},
18
- focusRing: {offset: -1, width: 2},
18
+ focusRing: {offset: -1, width: 1},
19
19
  },
20
20
  card: {
21
21
  border: {width: STROKE_WIDTH},