@sanity/ui 4.0.0-static.16 → 4.0.0-static.17

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.
Files changed (54) hide show
  1. package/dist/css/index.css +1 -1
  2. package/dist/css/index.css.map +1 -1
  3. package/dist/css/index.d.ts +4 -0
  4. package/dist/css/index.js +5986 -5974
  5. package/dist/css/index.js.map +1 -1
  6. package/dist/index.js +9 -10
  7. package/dist/index.js.map +1 -1
  8. package/package.json +5 -5
  9. package/src/core/components/autocomplete/__workshop__/custom.tsx +14 -1
  10. package/src/core/components/autocomplete/__workshop__/example.tsx +12 -1
  11. package/src/core/components/dialog/__workshop__/position.tsx +9 -1
  12. package/src/core/components/dialog/__workshop__/props.tsx +2 -0
  13. package/src/core/components/menu/__workshop__/menuButton.tsx +6 -1
  14. package/src/core/components/menu/__workshop__/tones.tsx +7 -1
  15. package/src/core/components/toast/__workshop__/toast.tsx +2 -0
  16. package/src/core/primitives/avatar/__workshop__/asButton.tsx +8 -1
  17. package/src/core/primitives/avatar/__workshop__/stack.tsx +5 -1
  18. package/src/core/primitives/badge/__workshop__/props.tsx +12 -1
  19. package/src/core/primitives/box/__workshop__/props.tsx +6 -1
  20. package/src/core/primitives/button/__workshop__/props.tsx +22 -0
  21. package/src/core/primitives/button/__workshop__/stacked.tsx +16 -0
  22. package/src/core/primitives/card/__workshop__/props.tsx +10 -0
  23. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  24. package/src/core/primitives/card/card.tsx +2 -2
  25. package/src/core/primitives/code/__workshop__/props.tsx +6 -1
  26. package/src/core/primitives/container/__workshop__/example.tsx +6 -1
  27. package/src/core/primitives/flex/__workshop__/example.tsx +7 -1
  28. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -1
  29. package/src/core/primitives/inline/__workshop__/plain.tsx +5 -1
  30. package/src/core/primitives/label/__workshop__/plain.tsx +15 -1
  31. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +13 -1
  32. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +2 -0
  33. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +8 -0
  34. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +7 -1
  35. package/src/core/primitives/popover/__workshop__/TestStory.tsx +6 -0
  36. package/src/core/primitives/select/__workshop__/plain.tsx +4 -0
  37. package/src/core/primitives/skeleton/__workshop__/delay.tsx +9 -1
  38. package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +9 -1
  39. package/src/core/primitives/spinner/__workshop__/Props.tsx +6 -1
  40. package/src/core/primitives/stack/__workshop__/plain.tsx +4 -1
  41. package/src/core/primitives/text/__workshop__/colored.tsx +8 -1
  42. package/src/core/primitives/text/__workshop__/example.tsx +15 -1
  43. package/src/core/primitives/textArea/__workshop__/plain.tsx +8 -0
  44. package/src/core/primitives/textInput/__workshop__/plain.tsx +34 -4
  45. package/src/core/primitives/textInput/__workshop__/typed.tsx +7 -1
  46. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +2 -0
  47. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -0
  48. package/src/core/primitives/tooltip/__workshop__/props.tsx +12 -0
  49. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +5 -0
  50. package/src/css/primitives/card/__workshop__/color.tsx +9 -1
  51. package/src/css/primitives/card/card.css.ts +10 -0
  52. package/src/css/theme/buildCSSTheme.ts +4 -0
  53. package/src/css/types.ts +4 -0
  54. package/src/css/vars.css.ts +4 -0
@@ -12,11 +12,15 @@ import {
12
12
 
13
13
  export default function AlignedStory(): React.JSX.Element {
14
14
  const constrainSize = useBoolean('Constrain size', false)
15
+ // @ts-expect-error - TODO: fix this
15
16
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS)
16
17
  const portal = useBoolean('Portal', true)
18
+ // @ts-expect-error - TODO: fix this
17
19
  const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 'auto')
18
20
 
21
+ // @ts-expect-error - TODO: fix this
19
22
  const flexAlign = useSelect('Align', WORKSHOP_FLEX_ALIGN_OPTIONS)
23
+ // @ts-expect-error - TODO: fix this
20
24
  const flexJustify = useSelect('Justify', WORKSHOP_FLEX_JUSTIFY_OPTIONS)
21
25
 
22
26
  const [open, setOpen] = useState(false)
@@ -49,7 +53,13 @@ export default function AlignedStory(): React.JSX.Element {
49
53
  return (
50
54
  <Card height="fill" padding={[4, 5, 6]} sizing="border" tone="transparent">
51
55
  <Card height="fill" padding={2} ref={setBoundaryElement} shadow={1} sizing="border">
52
- <Flex align={flexAlign} height="fill" justify={flexJustify}>
56
+ <Flex
57
+ // @ts-expect-error - TODO: fix this
58
+ align={flexAlign}
59
+ height="fill"
60
+ // @ts-expect-error - TODO: fix this
61
+ justify={flexJustify}
62
+ >
53
63
  <Popover
54
64
  constrainSize={constrainSize}
55
65
  content={content}
@@ -58,8 +68,10 @@ export default function AlignedStory(): React.JSX.Element {
58
68
  overflow="auto"
59
69
  padding={3}
60
70
  portal={portal}
71
+ // @ts-expect-error - TODO: fix this
61
72
  placement={placement}
62
73
  ref={popoverElementRef}
74
+ // @ts-expect-error - TODO: fix this
63
75
  width={width}
64
76
  >
65
77
  <Button
@@ -5,6 +5,7 @@ import {WORKSHOP_PLACEMENT_OPTIONS} from '$workshop'
5
5
 
6
6
  export default function MatchReferenceWidthStory(): React.JSX.Element {
7
7
  const arrow = useBoolean('Arrow', true)
8
+ // @ts-expect-error - TODO: fix this
8
9
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'bottom')
9
10
 
10
11
  return (
@@ -18,6 +19,7 @@ export default function MatchReferenceWidthStory(): React.JSX.Element {
18
19
  }
19
20
  matchReferenceWidth
20
21
  open
22
+ // @ts-expect-error - TODO: fix this
21
23
  placement={placement}
22
24
  radius={2}
23
25
  >
@@ -15,11 +15,15 @@ export default function PlainStory(): React.JSX.Element {
15
15
  const constrainSize = useBoolean('Constrain size', true)
16
16
  const matchReferenceWidth = useBoolean('Match reference width', false)
17
17
  const open = useBoolean('Open', true)
18
+ // @ts-expect-error - TODO: fix this
18
19
  const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3)
20
+ // @ts-expect-error - TODO: fix this
19
21
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'bottom')
20
22
  const portal = useBoolean('Portal', true)
21
23
  const preventOverflow = useBoolean('Prevent overflow', true)
24
+ // @ts-expect-error - TODO: fix this
22
25
  const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 2)
26
+ // @ts-expect-error - TODO: fix this
23
27
  const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 'auto')
24
28
  const [portalElement, setPortalElement] = useState<HTMLDivElement | null>(null)
25
29
  const [boundaryElement, setBoundaryElement] = useState<HTMLDivElement | null>(null)
@@ -53,11 +57,15 @@ export default function PlainStory(): React.JSX.Element {
53
57
  floatingBoundary={boundaryElementFlag ? boundaryElement : undefined}
54
58
  matchReferenceWidth={matchReferenceWidth}
55
59
  open={open}
60
+ // @ts-expect-error - TODO: fix this
56
61
  padding={padding}
62
+ // @ts-expect-error - TODO: fix this
57
63
  placement={placement}
58
64
  portal={portal}
59
65
  preventOverflow={preventOverflow}
66
+ // @ts-expect-error - TODO: fix this
60
67
  radius={radius}
68
+ // @ts-expect-error - TODO: fix this
61
69
  width={width}
62
70
  >
63
71
  <Button text="This button is the popover reference" />
@@ -26,6 +26,7 @@ export default function SidePanelStory(): React.JSX.Element {
26
26
  const sidePanelWidth = useSelect('Side panel width', SIDE_PANEL_WIDTH, SIDE_PANEL_WIDTH.md)
27
27
  const [sidePanel, setSidePanel] = useState<HTMLDivElement | null>(null)
28
28
  const updateRef = useRef<PopoverUpdateCallback>(undefined)
29
+ // @ts-expect-error - TODO: fix this
29
30
  const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS) ?? 'inherit'
30
31
 
31
32
  useEffect(() => updateRef.current?.(), [sidePanelWidth])
@@ -48,7 +49,12 @@ export default function SidePanelStory(): React.JSX.Element {
48
49
 
49
50
  <Card border padding={3}>
50
51
  <Text size={1}>
51
- Some editor <InlineObject tone={tone} updateRef={updateRef} />
52
+ Some editor{' '}
53
+ <InlineObject
54
+ // @ts-expect-error - TODO: fix this
55
+ tone={tone}
56
+ updateRef={updateRef}
57
+ />
52
58
  </Text>
53
59
  </Card>
54
60
  </Stack>
@@ -25,11 +25,14 @@ export default function TestStory(): React.JSX.Element {
25
25
  const constrainSize = useBoolean('Constrain size', true)
26
26
  const matchReferenceWidth = useBoolean('Match reference width', false)
27
27
  const open = useBoolean('Open', true)
28
+ // @ts-expect-error - TODO: fix this
28
29
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'bottom')
29
30
  const portal = useBoolean('Render in portal', true)
30
31
  const preventOverflow = useBoolean('Prevent overflow', true)
32
+ // @ts-expect-error - TODO: fix this
31
33
  const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 2)
32
34
  const referenceWide = useBoolean('Reference wide?', false)
35
+ // @ts-expect-error - TODO: fix this
33
36
  const width = useSelect('Width', WORKSHOP_CONTAINER_WIDTH_OPTIONS, 'auto')
34
37
 
35
38
  const text = useText('Text', 'Test')
@@ -81,11 +84,14 @@ export default function TestStory(): React.JSX.Element {
81
84
  open={open}
82
85
  overflow="hidden"
83
86
  padding={3}
87
+ // @ts-expect-error - TODO: fix this
84
88
  placement={placement}
85
89
  portal={portal}
86
90
  preventOverflow={preventOverflow}
91
+ // @ts-expect-error - TODO: fix this
87
92
  radius={radius}
88
93
  updateRef={updateRef}
94
+ // @ts-expect-error - TODO: fix this
89
95
  width={width}
90
96
  >
91
97
  {button}
@@ -6,7 +6,9 @@ import {WORKSHOP_RADIUS_OPTIONS, WORKSHOP_TEXT_FONT_SIZE_OPTIONS} from '$worksho
6
6
  export default function PlainStory(): React.JSX.Element {
7
7
  const border = useBoolean('Border', true)
8
8
  const disabled = useBoolean('Disabled', false)
9
+ // @ts-expect-error - TODO: fix this
9
10
  const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS)
11
+ // @ts-expect-error - TODO: fix this
10
12
  const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS)
11
13
  const readOnly = useBoolean('Read only', false)
12
14
 
@@ -21,8 +23,10 @@ export default function PlainStory(): React.JSX.Element {
21
23
  <Select
22
24
  border={border}
23
25
  disabled={disabled}
26
+ // @ts-expect-error - TODO: fix this
24
27
  fontSize={fontSize}
25
28
  id="select-example"
29
+ // @ts-expect-error - TODO: fix this
26
30
  radius={radius}
27
31
  readOnly={readOnly}
28
32
  >
@@ -16,6 +16,7 @@ import {useBoolean, useSelect} from '@sanity/ui-workshop'
16
16
  import {WORKSHOP_CARD_TONE_OPTIONS} from '$workshop'
17
17
 
18
18
  export default function SkeletonDelayStory(): React.JSX.Element {
19
+ // @ts-expect-error - TODO: fix this
19
20
  const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS)
20
21
  const animated = useBoolean('Animated', true)
21
22
 
@@ -23,7 +24,14 @@ export default function SkeletonDelayStory(): React.JSX.Element {
23
24
  <Box padding={[4, 5, 6]}>
24
25
  <Container width={1}>
25
26
  <Text muted>Delayed by 2000ms</Text>
26
- <Card tone={tone} marginTop={4} padding={2} radius={2} border>
27
+ <Card
28
+ // @ts-expect-error - TODO: fix this
29
+ tone={tone}
30
+ marginTop={4}
31
+ padding={2}
32
+ radius={2}
33
+ border
34
+ >
27
35
  <Flex align="center">
28
36
  <Skeleton
29
37
  style={{width: 90, height: 90}}
@@ -16,6 +16,7 @@ import {useBoolean, useSelect} from '@sanity/ui-workshop'
16
16
  import {WORKSHOP_CARD_TONE_OPTIONS} from '$workshop'
17
17
 
18
18
  export default function SkeletonStory(): React.JSX.Element {
19
+ // @ts-expect-error - TODO: fix this
19
20
  const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS)
20
21
  const animated = useBoolean('Animated', true)
21
22
 
@@ -24,7 +25,14 @@ export default function SkeletonStory(): React.JSX.Element {
24
25
  <Container width={1}>
25
26
  <Stack gap={4}>
26
27
  {[1, 2, 3].map((item) => (
27
- <Card key={item} tone={tone} padding={2} radius={2} border>
28
+ <Card
29
+ key={item}
30
+ // @ts-expect-error - TODO: fix this
31
+ tone={tone}
32
+ padding={2}
33
+ radius={2}
34
+ border
35
+ >
28
36
  <Flex align="center">
29
37
  <Grid gap={2} gridTemplateColumns={2} marginRight={3}>
30
38
  <Skeleton style={{width: 40, height: 40}} radius={2} animated={animated} />
@@ -5,11 +5,16 @@ import {WORKSHOP_TEXT_FONT_SIZE_OPTIONS} from '$workshop'
5
5
 
6
6
  export default function Props(): React.JSX.Element {
7
7
  const muted = useBoolean('Muted', false)
8
+ // @ts-expect-error - TODO: fix this
8
9
  const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 2)
9
10
 
10
11
  return (
11
12
  <Flex align="center" height="fill" justify="center">
12
- <Spinner muted={muted} size={size} />
13
+ <Spinner
14
+ muted={muted}
15
+ // @ts-expect-error - TODO: fix this
16
+ size={size}
17
+ />
13
18
  </Flex>
14
19
  )
15
20
  }
@@ -7,7 +7,10 @@ export default function PlainStory(): React.JSX.Element {
7
7
  return (
8
8
  <Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
9
9
  <Container width={0}>
10
- <Stack gap={useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 0)}>
10
+ <Stack
11
+ // @ts-expect-error - TODO: fix this
12
+ gap={useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 0)}
13
+ >
11
14
  <Card padding={[2, 3, 4]} shadow={1}>
12
15
  <Text align="center" muted>
13
16
  Stack item
@@ -11,11 +11,18 @@ const ColoredText = styled(Text)<{$color: AvatarColor}>`
11
11
  `
12
12
 
13
13
  export default function ColoredTextStory(): React.JSX.Element {
14
+ // @ts-expect-error - TODO: fix this
14
15
  const color = useSelect('Color', WORKSHOP_AVATAR_COLOR_OPTIONS, 'gray') ?? 'gray'
15
16
 
16
17
  return (
17
18
  <Flex align="center" height="fill" justify="center" padding={[4, 5, 6]} sizing="border">
18
- <ColoredText align="center" $color={color} size={4} weight="bold">
19
+ <ColoredText
20
+ align="center"
21
+ // @ts-expect-error - TODO: fix this
22
+ $color={color}
23
+ size={4}
24
+ weight="bold"
25
+ >
19
26
  {color}
20
27
  </ColoredText>
21
28
  </Flex>
@@ -9,17 +9,31 @@ import {
9
9
  } from '$workshop'
10
10
 
11
11
  export default function TextStory(): React.JSX.Element {
12
+ // @ts-expect-error - TODO: fix this
12
13
  const align = useSelect('Align', WORKSHOP_TEXT_ALIGN_OPTIONS)
13
14
  const muted = useBoolean('Muted', false)
15
+ // @ts-expect-error - TODO: fix this
14
16
  const size = useSelect('Size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 1)
15
17
  const text = useText('Text', 'Hello, world')
18
+ // @ts-expect-error - TODO: fix this
16
19
  const textOverflow = useSelect('Text overflow', WORKSHOP_TEXT_OVERFLOW_OPTIONS)
20
+ // @ts-expect-error - TODO: fix this
17
21
  const weight = useSelect('Weight', WORKSHOP_TEXT_WEIGHT_OPTIONS)
18
22
 
19
23
  return (
20
24
  <Flex align="center" height="fill" justify="center" padding={4} sizing="border">
21
25
  <Container width={0}>
22
- <Text align={align} muted={muted} size={size} textOverflow={textOverflow} weight={weight}>
26
+ <Text
27
+ // @ts-expect-error - TODO: fix this
28
+ align={align}
29
+ muted={muted}
30
+ // @ts-expect-error - TODO: fix this
31
+ size={size}
32
+ // @ts-expect-error - TODO: fix this
33
+ textOverflow={textOverflow}
34
+ // @ts-expect-error - TODO: fix this
35
+ weight={weight}
36
+ >
23
37
  {text}
24
38
  </Text>
25
39
  </Container>
@@ -10,15 +10,19 @@ import {
10
10
  } from '$workshop'
11
11
 
12
12
  export default function PlainStory(): React.JSX.Element {
13
+ // @ts-expect-error - TODO: fix this
13
14
  const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS)
14
15
 
15
16
  const border = useBoolean('Border', true)
16
17
  const customValidity = useText('Custom validity')
17
18
  const disableFocusRing = useBoolean('Disable focus ring (unstable)', false)
18
19
  const disabled = useBoolean('Disabled', false)
20
+ // @ts-expect-error - TODO: fix this
19
21
  const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 2)
22
+ // @ts-expect-error - TODO: fix this
20
23
  const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3)
21
24
  const placeholder = useText('Placeholder', 'Placeholder')
25
+ // @ts-expect-error - TODO: fix this
22
26
  const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 2)
23
27
  const readOnly = useBoolean('Read only', false)
24
28
 
@@ -32,6 +36,7 @@ export default function PlainStory(): React.JSX.Element {
32
36
  justifyContent="center"
33
37
  padding={[4, 5, 6]}
34
38
  sizing="border"
39
+ // @ts-expect-error - TODO: fix this
35
40
  tone={tone}
36
41
  >
37
42
  <Container width={0}>
@@ -44,11 +49,14 @@ export default function PlainStory(): React.JSX.Element {
44
49
  border={border}
45
50
  customValidity={customValidity}
46
51
  disabled={disabled}
52
+ // @ts-expect-error - TODO: fix this
47
53
  fontSize={fontSize}
48
54
  id="text-area-example"
49
55
  onChange={(e) => setValue(e.target.value)}
56
+ // @ts-expect-error - TODO: fix this
50
57
  padding={padding}
51
58
  placeholder={placeholder}
59
+ // @ts-expect-error - TODO: fix this
52
60
  radius={radius}
53
61
  readOnly={readOnly}
54
62
  rows={10}
@@ -53,16 +53,23 @@ function TextInputTest(props: {inputRef: React.Ref<HTMLInputElement>}) {
53
53
  const border = useBoolean('Border', true)
54
54
  const customValidity = useText('Custom validity')
55
55
  const disabled = useBoolean('Disabled', false)
56
+ // @ts-expect-error - TODO: fix this
56
57
  const fontSize = useSelect('Font size', WORKSHOP_TEXT_FONT_SIZE_OPTIONS, 2)
58
+ // @ts-expect-error - TODO: fix this
57
59
  const gap = useSelect('Gap', WORKSHOP_SPACE_OPTIONS, 3)
60
+ // @ts-expect-error - TODO: fix this
58
61
  const icon = useSelect('Icon', WORKSHOP_ICON_SYMBOL_OPTIONS, 'search')
62
+ // @ts-expect-error - TODO: fix this
59
63
  const iconRight = useSelect('Icon (right)', WORKSHOP_ICON_SYMBOL_OPTIONS, 'cube')
64
+ // @ts-expect-error - TODO: fix this
60
65
  const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 3)
61
66
  const placeholder = useText('Placeholder')
62
67
  const prefix = useBoolean('Prefix', false)
68
+ // @ts-expect-error - TODO: fix this
63
69
  const radius = useSelect('Radius', WORKSHOP_RADIUS_OPTIONS, 2)
64
70
  const readOnly = useBoolean('Read only', false)
65
71
  const suffix = useBoolean('Suffix', false)
72
+ // @ts-expect-error - TODO: fix this
66
73
  const weight = useSelect('Weight', WORKSHOP_FONT_WEIGHT_OPTIONS)
67
74
 
68
75
  const [value, setValue] = useState('')
@@ -77,33 +84,56 @@ function TextInputTest(props: {inputRef: React.Ref<HTMLInputElement>}) {
77
84
  border={border}
78
85
  customValidity={customValidity}
79
86
  disabled={disabled}
87
+ // @ts-expect-error - TODO: fix this
80
88
  fontSize={fontSize}
89
+ // @ts-expect-error - TODO: fix this
81
90
  gap={gap}
91
+ // @ts-expect-error - TODO: fix this
82
92
  icon={icon && icons[icon]}
93
+ // @ts-expect-error - TODO: fix this
83
94
  iconRight={iconRight && icons[iconRight]}
84
95
  id="text-input-example"
85
96
  name="test"
86
97
  onChange={handleChange}
98
+ // @ts-expect-error - TODO: fix this
87
99
  padding={padding}
88
100
  placeholder={placeholder}
89
101
  prefix={
90
102
  prefix && (
91
- <Box padding={padding}>
92
- <Text size={fontSize}>Prefix</Text>
103
+ <Box
104
+ // @ts-expect-error - TODO: fix this
105
+ padding={padding}
106
+ >
107
+ <Text
108
+ // @ts-expect-error - TODO: fix this
109
+ size={fontSize}
110
+ >
111
+ Prefix
112
+ </Text>
93
113
  </Box>
94
114
  )
95
115
  }
116
+ // @ts-expect-error - TODO: fix this
96
117
  radius={radius}
97
118
  readOnly={readOnly}
98
119
  ref={ref}
99
120
  suffix={
100
121
  suffix && (
101
- <Box padding={padding}>
102
- <Text size={fontSize}>Suffix</Text>
122
+ <Box
123
+ // @ts-expect-error - TODO: fix this
124
+ padding={padding}
125
+ >
126
+ <Text
127
+ // @ts-expect-error - TODO: fix this
128
+ size={fontSize}
129
+ >
130
+ Suffix
131
+ </Text>
103
132
  </Box>
104
133
  )
105
134
  }
106
135
  value={value}
136
+ // @ts-expect-error - TODO: fix this
107
137
  weight={weight}
108
138
  />
109
139
  )
@@ -5,6 +5,7 @@ import {useCallback, useState} from 'react'
5
5
  import {WORKSHOP_TEXT_INPUT_TYPE_OPTIONS} from '$workshop'
6
6
 
7
7
  export default function TypedStory(): React.JSX.Element {
8
+ // @ts-expect-error - TODO: fix this
8
9
  const type = useSelect('Type', WORKSHOP_TEXT_INPUT_TYPE_OPTIONS, 'text')
9
10
 
10
11
  const [value, setValue] = useState('')
@@ -16,7 +17,12 @@ export default function TypedStory(): React.JSX.Element {
16
17
  return (
17
18
  <Box padding={4}>
18
19
  <Container width={1}>
19
- <TextInput onChange={handleChange} type={type} value={value} />
20
+ <TextInput
21
+ onChange={handleChange}
22
+ // @ts-expect-error - TODO: fix this
23
+ type={type}
24
+ value={value}
25
+ />
20
26
  </Container>
21
27
  </Box>
22
28
  )
@@ -25,6 +25,7 @@ export default function CustomPortalStory(): React.JSX.Element {
25
25
  'Content',
26
26
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mollis consectetur malesuada. Sed lobortis est dolor, eget imperdiet velit placerat et. Aenean posuere mi non aliquet iaculis. Donec fermentum pulvinar purus at sagittis. Ut tincidunt massa odio, sed finibus justo ullamcorper id. Nam venenatis justo non ligula elementum cursus. Pellentesque laoreet justo in mollis sagittis. In lacinia ornare ultrices. Suspendisse potenti.',
27
27
  )
28
+ // @ts-expect-error - TODO: fix this
28
29
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'top')
29
30
  const portal = useSelect('Portal', PORTAL_OPTIONS)
30
31
  const useBoundaryElement = useBoolean('Use boundary element', true)
@@ -60,6 +61,7 @@ export default function CustomPortalStory(): React.JSX.Element {
60
61
  boundaryElement={useBoundaryElement ? boundaryElement : null}
61
62
  content={content ? <Text size={1}>{content}</Text> : undefined}
62
63
  padding={2}
64
+ // @ts-expect-error - TODO: fix this
63
65
  placement={placement}
64
66
  portal={portal}
65
67
  >
@@ -9,6 +9,7 @@ export default function OverflowingBoundaryStory(): React.JSX.Element {
9
9
  'Content',
10
10
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mollis consectetur malesuada. Sed lobortis est dolor, eget imperdiet velit placerat et. Aenean posuere mi non aliquet iaculis. Donec fermentum pulvinar purus at sagittis. Ut tincidunt massa odio, sed finibus justo ullamcorper id. Nam venenatis justo non ligula elementum cursus. Pellentesque laoreet justo in mollis sagittis. In lacinia ornare ultrices. Suspendisse potenti.',
11
11
  )
12
+ // @ts-expect-error - TODO: fix this
12
13
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'top')
13
14
  const portal = useBoolean('Portal', false)
14
15
  const useBoundaryElement = useBoolean('Use boundary element', true)
@@ -56,6 +57,7 @@ export default function OverflowingBoundaryStory(): React.JSX.Element {
56
57
  <Tooltip
57
58
  content={<Text size={1}>{content}</Text>}
58
59
  padding={2}
60
+ // @ts-expect-error - TODO: fix this
59
61
  placement={placement}
60
62
  portal={portal}
61
63
  >
@@ -11,11 +11,14 @@ import {
11
11
  export default function PropsStory(): React.JSX.Element {
12
12
  const arrow = useBoolean('Arrow', false)
13
13
  const content = useText('Content', 'Tooltip content')
14
+ // @ts-expect-error - TODO: fix this
14
15
  const padding = useSelect('Padding', WORKSHOP_SPACE_OPTIONS, 2)
16
+ // @ts-expect-error - TODO: fix this
15
17
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'top')
16
18
  const portal = useBoolean('Portal', true)
17
19
  const openDelay = useNumber('Open Delay', 200)
18
20
  const closeDelay = useNumber('Close Delay', 200)
21
+ // @ts-expect-error - TODO: fix this
19
22
  const shadow = useSelect('Shadow', WORKSHOP_SHADOW_OPTIONS, 2)
20
23
 
21
24
  return (
@@ -41,9 +44,12 @@ export default function PropsStory(): React.JSX.Element {
41
44
  <Tooltip
42
45
  arrow={arrow}
43
46
  content={<Text size={1}>{content}</Text>}
47
+ // @ts-expect-error - TODO: fix this
44
48
  padding={padding}
49
+ // @ts-expect-error - TODO: fix this
45
50
  placement={placement}
46
51
  portal={portal}
52
+ // @ts-expect-error - TODO: fix this
47
53
  shadow={shadow}
48
54
  delay={{
49
55
  open: openDelay,
@@ -81,9 +87,12 @@ export default function PropsStory(): React.JSX.Element {
81
87
  close: 100,
82
88
  }}
83
89
  content={<Text size={1}>{content}</Text>}
90
+ // @ts-expect-error - TODO: fix this
84
91
  padding={padding}
92
+ // @ts-expect-error - TODO: fix this
85
93
  placement={placement}
86
94
  portal={portal}
95
+ // @ts-expect-error - TODO: fix this
87
96
  shadow={shadow}
88
97
  >
89
98
  <Button mode="bleed" text="Hover me" />
@@ -96,9 +105,12 @@ export default function PropsStory(): React.JSX.Element {
96
105
  close: 100,
97
106
  }}
98
107
  content={<Text size={1}>{content}</Text>}
108
+ // @ts-expect-error - TODO: fix this
99
109
  padding={padding}
110
+ // @ts-expect-error - TODO: fix this
100
111
  placement={placement}
101
112
  portal={portal}
113
+ // @ts-expect-error - TODO: fix this
102
114
  shadow={shadow}
103
115
  >
104
116
  <Button mode="bleed" text="Or me" />
@@ -9,6 +9,7 @@ export default function ResizableBoundaryStory(): React.JSX.Element {
9
9
  'Content',
10
10
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mollis consectetur malesuada. Sed lobortis est dolor, eget imperdiet velit placerat et. Aenean posuere mi non aliquet iaculis. Donec fermentum pulvinar purus at sagittis. Ut tincidunt massa odio, sed finibus justo ullamcorper id. Nam venenatis justo non ligula elementum cursus. Pellentesque laoreet justo in mollis sagittis. In lacinia ornare ultrices. Suspendisse potenti.',
11
11
  )
12
+ // @ts-expect-error - TODO: fix this
12
13
  const placement = useSelect('Placement', WORKSHOP_PLACEMENT_OPTIONS, 'right')
13
14
  const portal = useBoolean('Portal', true)
14
15
  const useBoundaryElement = useBoolean('Use boundary element', true)
@@ -38,6 +39,7 @@ export default function ResizableBoundaryStory(): React.JSX.Element {
38
39
  <Tooltip
39
40
  content={<Text size={1}>{content}</Text>}
40
41
  padding={2}
42
+ // @ts-expect-error - TODO: fix this
41
43
  placement={placement}
42
44
  portal={portal}
43
45
  >
@@ -46,6 +48,7 @@ export default function ResizableBoundaryStory(): React.JSX.Element {
46
48
  <Tooltip
47
49
  content={<Text size={1}>{content}</Text>}
48
50
  padding={2}
51
+ // @ts-expect-error - TODO: fix this
49
52
  placement={placement}
50
53
  portal={portal}
51
54
  >
@@ -58,6 +61,7 @@ export default function ResizableBoundaryStory(): React.JSX.Element {
58
61
  <Tooltip
59
62
  content={<Text size={1}>{content}</Text>}
60
63
  padding={2}
64
+ // @ts-expect-error - TODO: fix this
61
65
  placement={placement}
62
66
  portal={portal}
63
67
  >
@@ -70,6 +74,7 @@ export default function ResizableBoundaryStory(): React.JSX.Element {
70
74
  <Tooltip
71
75
  content={<Text size={1}>{content}</Text>}
72
76
  padding={2}
77
+ // @ts-expect-error - TODO: fix this
73
78
  placement={placement}
74
79
  portal={portal}
75
80
  >
@@ -20,10 +20,18 @@ interface ColorRecordNode extends Record<string, ColorNode> {}
20
20
  type ColorNode = string | ColorRecordNode
21
21
 
22
22
  export default function ColorStory(): React.JSX.Element {
23
+ // @ts-expect-error - TODO: fix this
23
24
  const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS, 'default')
24
25
 
25
26
  return (
26
- <Card display="flex" flexDirection="column" gap={4} padding={4} tone={tone}>
27
+ <Card
28
+ display="flex"
29
+ flexDirection="column"
30
+ gap={4}
31
+ padding={4}
32
+ // @ts-expect-error - TODO: fix this
33
+ tone={tone}
34
+ >
27
35
  {Object.entries(vars.color).map(([key, value]) => {
28
36
  if (key === 'palette') {
29
37
  return null
@@ -134,6 +134,16 @@ export const root: string = _style(layers.primitives, {
134
134
  [vars.color.muted.fg]: vars.color.tinted.default.border[2],
135
135
  },
136
136
  },
137
+
138
+ 'a&[data-focus-ring]:focus, button&[data-focus-ring]:focus': {
139
+ outline: `${vars.card.focusRing.width} solid ${vars.color.focusRing}`,
140
+ outlineOffset: vars.card.focusRing.offset,
141
+ },
142
+
143
+ 'a&[data-focus-ring]:focus:not(:focus-visible), button&[data-focus-ring]:focus:not(:focus-visible)':
144
+ {
145
+ outline: 'none',
146
+ },
137
147
  },
138
148
  })
139
149
 
@@ -79,6 +79,10 @@ export function buildCSSTheme(options?: CSSThemeOptions): ThemeTokens {
79
79
  border: {
80
80
  width: px(theme.card.border.width),
81
81
  },
82
+ focusRing: {
83
+ offset: px(theme.card.focusRing.offset),
84
+ width: px(theme.card.focusRing.width),
85
+ },
82
86
  shadow: {
83
87
  outline: px(theme.card.shadow.outline),
84
88
  },
package/src/css/types.ts CHANGED
@@ -183,6 +183,10 @@ export type CoreThemeTokens = {
183
183
  border: {
184
184
  width: string
185
185
  }
186
+ focusRing: {
187
+ offset: string
188
+ width: string
189
+ }
186
190
  shadow: {
187
191
  outline: string
188
192
  }
@@ -74,6 +74,10 @@ const themeTokens: CoreThemeTokens = {
74
74
  border: {
75
75
  width: '',
76
76
  },
77
+ focusRing: {
78
+ offset: '',
79
+ width: '',
80
+ },
77
81
  shadow: {
78
82
  outline: '',
79
83
  },