@sanity/ui 1.0.0-next.3 → 1.0.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.
Files changed (144) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/dist/{types/src/index.d.ts → index.d.ts} +4450 -4398
  4. package/dist/{sanity-ui.esm.js → index.esm.js} +888 -2678
  5. package/dist/index.esm.js.map +1 -0
  6. package/dist/{sanity-ui.js → index.js} +882 -2688
  7. package/dist/index.js.map +1 -0
  8. package/package.json +112 -23
  9. package/src/components/autocomplete/__workshop__/example.tsx +1 -1
  10. package/src/components/autocomplete/__workshop__/index.ts +36 -32
  11. package/src/components/autocomplete/autocomplete.styles.tsx +22 -28
  12. package/src/components/autocomplete/autocomplete.tsx +1 -2
  13. package/src/components/autocomplete/constants.ts +3 -8
  14. package/src/components/breadcrumbs/__workshop__/index.ts +11 -7
  15. package/src/components/breadcrumbs/breadcrumbs.styles.ts +13 -18
  16. package/src/components/dialog/__workshop__/index.ts +13 -9
  17. package/src/components/dialog/dialog.tsx +53 -67
  18. package/src/components/hotkeys/__workshop__/index.ts +11 -3
  19. package/src/components/hotkeys/hotkeys.tsx +12 -16
  20. package/src/components/menu/__workshop__/index.ts +71 -67
  21. package/src/components/menu/menu.tsx +5 -7
  22. package/src/components/menu/menuButton.tsx +16 -14
  23. package/src/components/menu/menuDivider.ts +8 -10
  24. package/src/components/skeleton/__workshop__/index.ts +8 -4
  25. package/src/components/skeleton/skeleton.tsx +4 -6
  26. package/src/components/skeleton/styles.ts +13 -9
  27. package/src/components/skeleton/textSkeleton.tsx +12 -14
  28. package/src/components/tab/__workshop__/index.ts +11 -3
  29. package/src/components/toast/__workshop__/index.ts +16 -4
  30. package/src/components/toast/toast.tsx +6 -11
  31. package/src/components/toast/toastProvider.tsx +18 -22
  32. package/src/components/tree/__workshop__/basic.perf.ts +1 -14
  33. package/src/components/tree/__workshop__/basic.tsx +1 -1
  34. package/src/components/tree/__workshop__/index.ts +12 -8
  35. package/src/components/tree/style.ts +78 -76
  36. package/src/components/tree/treeItem.tsx +7 -12
  37. package/src/hooks/useElementRect/__workshop__/index.ts +11 -3
  38. package/src/hooks/useMediaIndex/__workshop__/index.ts +11 -3
  39. package/src/primitives/_selectable/selectable.tsx +4 -7
  40. package/src/primitives/_selectable/style.ts +85 -82
  41. package/src/primitives/avatar/__workshop__/index.ts +16 -12
  42. package/src/primitives/avatar/avatar.tsx +9 -12
  43. package/src/primitives/avatar/avatarCounter.tsx +22 -24
  44. package/src/primitives/avatar/avatarStack.tsx +16 -14
  45. package/src/primitives/avatar/styles.ts +1 -1
  46. package/src/primitives/badge/__workshop__/index.ts +16 -12
  47. package/src/primitives/badge/__workshop__/tones.tsx +1 -1
  48. package/src/primitives/badge/badge.tsx +6 -5
  49. package/src/primitives/box/__workshop__/index.ts +16 -4
  50. package/src/primitives/box/box.tsx +21 -49
  51. package/src/primitives/button/__workshop__/index.ts +51 -47
  52. package/src/primitives/button/__workshop__/sanityUploadButton.tsx +19 -20
  53. package/src/primitives/button/__workshop__/styled1.tsx +6 -6
  54. package/src/primitives/button/button.tsx +20 -26
  55. package/src/primitives/button/styles.ts +30 -29
  56. package/src/primitives/card/__workshop__/index.ts +15 -11
  57. package/src/primitives/card/card.tsx +9 -25
  58. package/src/primitives/card/styles.ts +119 -114
  59. package/src/primitives/checkbox/__workshop__/index.ts +10 -6
  60. package/src/primitives/checkbox/checkbox.tsx +4 -4
  61. package/src/primitives/checkbox/styles.ts +71 -69
  62. package/src/primitives/code/__workshop__/index.ts +16 -12
  63. package/src/primitives/code/code.tsx +3 -5
  64. package/src/primitives/code/styles.ts +20 -18
  65. package/src/primitives/container/__workshop__/index.ts +5 -3
  66. package/src/primitives/container/container.tsx +5 -4
  67. package/src/primitives/flex/__workshop__/index.ts +8 -4
  68. package/src/primitives/flex/flex.tsx +7 -23
  69. package/src/primitives/grid/__workshop__/index.ts +7 -3
  70. package/src/primitives/grid/grid.tsx +4 -27
  71. package/src/primitives/heading/__workshop__/index.ts +16 -12
  72. package/src/primitives/heading/heading.tsx +10 -17
  73. package/src/primitives/heading/styles.ts +45 -36
  74. package/src/primitives/inline/__workshop__/index.ts +5 -3
  75. package/src/primitives/inline/inline.tsx +3 -5
  76. package/src/primitives/kbd/__workshop__/index.ts +5 -3
  77. package/src/primitives/kbd/kbd.tsx +12 -13
  78. package/src/primitives/label/__workshop__/index.ts +16 -12
  79. package/src/primitives/label/label.tsx +13 -18
  80. package/src/primitives/label/styles.ts +24 -18
  81. package/src/primitives/popover/__workshop__/PlainStory.tsx +0 -1
  82. package/src/primitives/popover/__workshop__/TestStory.tsx +0 -1
  83. package/src/primitives/popover/__workshop__/index.ts +36 -32
  84. package/src/primitives/popover/constants.ts +0 -3
  85. package/src/primitives/popover/floating-ui/size.ts +40 -25
  86. package/src/primitives/popover/popover.tsx +220 -196
  87. package/src/primitives/popover/popoverArrow.tsx +42 -48
  88. package/src/primitives/popover/popoverCard.tsx +12 -22
  89. package/src/primitives/radio/__workshop__/index.ts +8 -4
  90. package/src/primitives/radio/radio.tsx +3 -3
  91. package/src/primitives/radio/styles.ts +73 -73
  92. package/src/primitives/select/__workshop__/index.ts +8 -4
  93. package/src/primitives/select/select.tsx +9 -11
  94. package/src/primitives/select/styles.ts +77 -77
  95. package/src/primitives/spinner/__workshop__/index.ts +11 -7
  96. package/src/primitives/spinner/spinner.tsx +2 -5
  97. package/src/primitives/stack/__workshop__/index.ts +11 -7
  98. package/src/primitives/stack/stack.tsx +3 -5
  99. package/src/primitives/switch/__workshop__/index.ts +8 -4
  100. package/src/primitives/switch/styles.ts +119 -112
  101. package/src/primitives/switch/switch.tsx +6 -6
  102. package/src/primitives/text/__workshop__/index.ts +21 -17
  103. package/src/primitives/text/styles.ts +51 -45
  104. package/src/primitives/text/text.tsx +11 -16
  105. package/src/primitives/textArea/__workshop__/index.ts +11 -7
  106. package/src/primitives/textArea/textArea.tsx +15 -22
  107. package/src/primitives/textInput/__workshop__/index.ts +46 -42
  108. package/src/primitives/textInput/__workshop__/plain.tsx +2 -1
  109. package/src/primitives/textInput/textInput.tsx +49 -69
  110. package/src/primitives/tooltip/__workshop__/index.ts +11 -7
  111. package/src/primitives/tooltip/tooltip.tsx +3 -6
  112. package/src/primitives/tooltip/tooltipArrow.tsx +69 -59
  113. package/src/styles/border/borderStyle.ts +10 -18
  114. package/src/styles/box/boxStyle.ts +14 -18
  115. package/src/styles/flex/flexItemStyle.ts +7 -1
  116. package/src/styles/flex/flexStyle.ts +14 -9
  117. package/src/styles/grid/gridItemStyle.ts +18 -30
  118. package/src/styles/grid/gridStyle.ts +25 -33
  119. package/src/styles/helpers.ts +2 -2
  120. package/src/styles/index.ts +0 -1
  121. package/src/styles/input/textInputStyle.ts +127 -123
  122. package/src/styles/margin/marginStyle.ts +11 -10
  123. package/src/styles/margin/marginsStyle.test.ts +12 -10
  124. package/src/styles/padding/paddingStyle.test.ts +12 -10
  125. package/src/styles/padding/paddingStyle.ts +9 -10
  126. package/src/theme/__workshop__/index.ts +26 -22
  127. package/src/theme/{ThemeContext.ts → themeContext.ts} +0 -0
  128. package/src/utils/boundaryElement/__workshop__/index.ts +11 -7
  129. package/src/utils/elementQuery/__workshop__/index.ts +11 -7
  130. package/src/utils/layer/__workshop__/index.ts +21 -17
  131. package/src/utils/layer/layer.tsx +4 -6
  132. package/src/utils/portal/__workshop__/index.ts +11 -7
  133. package/src/utils/srOnly/srOnly.tsx +8 -10
  134. package/src/utils/virtualList/__workshop__/index.ts +26 -22
  135. package/src/utils/virtualList/virtualList.tsx +10 -14
  136. package/dist/sanity-ui.esm.js.map +0 -1
  137. package/dist/sanity-ui.js.map +0 -1
  138. package/src/__workshop__/color/overview.tsx +0 -101
  139. package/src/__workshop__/index.ts +0 -10
  140. package/src/icons/__workshop__/.eslintrc +0 -5
  141. package/src/icons/__workshop__/index.tsx +0 -6
  142. package/src/icons/__workshop__/overview.tsx +0 -76
  143. package/src/styles/compose.ts +0 -35
  144. package/src/utils/srOnly/__workshop__/.eslintrc +0 -5
@@ -1,20 +1,24 @@
1
1
  import {defineScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
- export default defineScope('primitives/text', 'Text', [
5
- {
6
- name: 'default',
7
- title: 'Text',
8
- component: lazy(() => import('./example')),
9
- },
10
- {
11
- name: 'colored',
12
- title: 'Colored text',
13
- component: lazy(() => import('./colored')),
14
- },
15
- {
16
- name: 'optical-alignment',
17
- title: 'Optical alignment',
18
- component: lazy(() => import('./opticalAlignment')),
19
- },
20
- ])
4
+ export default defineScope({
5
+ name: 'primitives/text',
6
+ title: 'Text',
7
+ stories: [
8
+ {
9
+ name: 'default',
10
+ title: 'Text',
11
+ component: lazy(() => import('./example')),
12
+ },
13
+ {
14
+ name: 'colored',
15
+ title: 'Colored text',
16
+ component: lazy(() => import('./colored')),
17
+ },
18
+ {
19
+ name: 'optical-alignment',
20
+ title: 'Optical alignment',
21
+ component: lazy(() => import('./opticalAlignment')),
22
+ },
23
+ ],
24
+ })
@@ -1,53 +1,59 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {css, FlattenSimpleInterpolation} from 'styled-components'
2
2
  import {ThemeProps} from '../../styles'
3
3
 
4
4
  export function textBaseStyle(
5
5
  props: {$accent?: boolean; $muted?: boolean} & ThemeProps
6
- ): CSSObject {
6
+ ): FlattenSimpleInterpolation {
7
7
  const {$accent, $muted, theme} = props
8
8
  const {weights} = theme.sanity.fonts.text
9
9
 
10
- return {
11
- color: 'var(--card-fg-color)',
12
-
13
- ...($accent ? {color: 'var(--card-accent-fg-color)'} : {}),
14
-
15
- ...($muted ? {color: 'var(--card-muted-fg-color)'} : {}),
16
-
17
- '& code': {
18
- fontFamily: theme.sanity.fonts.code.family,
19
- borderRadius: 1,
20
- backgroundColor: 'var(--card-code-bg-color)',
21
- color: 'var(--card-code-fg-color)',
22
- },
23
-
24
- '& a': {
25
- textDecoration: 'none',
26
- borderRadius: 1,
27
- color: 'var(--card-link-color)',
28
- outline: 'none',
29
-
30
- '@media (hover: hover)': {
31
- '&:hover': {
32
- textDecoration: 'underline',
33
- },
34
- },
35
-
36
- '&:focus': {
37
- boxShadow: '0 0 0 1px var(--card-bg-color), 0 0 0 3px var(--card-focus-ring-color)',
38
- },
39
-
40
- '&:focus:not(:focus-visible)': {
41
- boxShadow: 'none',
42
- },
43
- },
44
-
45
- '& strong': {
46
- fontWeight: weights.bold,
47
- },
48
-
49
- '& [data-sanity-icon]': {
50
- verticalAlign: 'baseline',
51
- },
52
- }
10
+ return css`
11
+ color: var(--card-fg-color);
12
+
13
+ ${$accent &&
14
+ css`
15
+ color: var(--card-accent-fg-color);
16
+ `}
17
+
18
+ ${$muted &&
19
+ css`
20
+ color: var(--card-muted-fg-color);
21
+ `}
22
+
23
+ & code {
24
+ font-family: ${theme.sanity.fonts.code.family};
25
+ border-radius: 1px;
26
+ background-color: var(--card-code-bg-color);
27
+ color: var(--card-code-fg-color);
28
+ }
29
+
30
+ & a {
31
+ text-decoration: none;
32
+ border-radius: 1px;
33
+ color: var(--card-link-color);
34
+ outline: none;
35
+
36
+ @media (hover: hover) {
37
+ &:hover {
38
+ text-decoration: underline;
39
+ }
40
+ }
41
+
42
+ &:focus {
43
+ box-shadow: 0 0 0 1px var(--card-bg-color), 0 0 0 3px var(--card-focus-ring-color);
44
+ }
45
+
46
+ &:focus:not(:focus-visible) {
47
+ box-shadow: none;
48
+ }
49
+ }
50
+
51
+ & strong {
52
+ font-weight: ${weights.bold};
53
+ }
54
+
55
+ & [data-sanity-icon] {
56
+ vertical-align: baseline;
57
+ }
58
+ `
53
59
  }
@@ -1,7 +1,6 @@
1
- import {forwardRef, memo} from 'react'
1
+ import {forwardRef} from 'react'
2
2
  import styled from 'styled-components'
3
3
  import {useArrayProp} from '../../hooks'
4
- import {compose} from '../../styles'
5
4
  import {
6
5
  ResponsiveFontStyleProps,
7
6
  responsiveTextAlignStyle,
@@ -29,22 +28,18 @@ export interface TextProps {
29
28
  weight?: ThemeFontWeightKey
30
29
  }
31
30
 
32
- const Root = memo(
33
- compose<ResponsiveFontStyleProps>('div', [
34
- responsiveTextFont,
35
- responsiveTextAlignStyle,
36
- textBaseStyle,
37
- ])
31
+ const Root = styled.div<ResponsiveFontStyleProps>(
32
+ responsiveTextFont,
33
+ responsiveTextAlignStyle,
34
+ textBaseStyle
38
35
  )
39
36
 
40
- const SpanWithTextOverflow = memo(
41
- styled.span({
42
- display: 'block',
43
- whiteSpace: 'nowrap',
44
- textOverflow: 'ellipsis',
45
- overflow: 'hidden',
46
- })
47
- )
37
+ const SpanWithTextOverflow = styled.span`
38
+ display: block;
39
+ white-space: nowrap;
40
+ text-overflow: ellipsis;
41
+ overflow: hidden;
42
+ `
48
43
 
49
44
  /**
50
45
  * @public
@@ -1,10 +1,14 @@
1
1
  import {defineScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
- export default defineScope('primitives/text-area', 'TextArea', [
5
- {
6
- name: 'plain',
7
- title: 'Plain',
8
- component: lazy(() => import('./plain')),
9
- },
10
- ])
4
+ export default defineScope({
5
+ name: 'primitives/text-area',
6
+ title: 'TextArea',
7
+ stories: [
8
+ {
9
+ name: 'plain',
10
+ title: 'Plain',
11
+ component: lazy(() => import('./plain')),
12
+ },
13
+ ],
14
+ })
@@ -1,7 +1,6 @@
1
- import {forwardRef, memo} from 'react'
1
+ import {forwardRef} from 'react'
2
2
  import styled from 'styled-components'
3
3
  import {useForwardedRef, useCustomValidity, useArrayProp} from '../../hooks'
4
- import {compose} from '../../styles'
5
4
  import {
6
5
  responsiveInputPaddingStyle,
7
6
  responsiveRadiusStyle,
@@ -28,30 +27,24 @@ export interface TextAreaProps extends ResponsiveRadiusProps {
28
27
  weight?: ThemeFontWeightKey
29
28
  }
30
29
 
31
- const Root = memo(styled.span(textInputRootStyle))
30
+ const Root = styled.span(textInputRootStyle)
32
31
 
33
- const InputRoot = memo(
34
- styled.span({
35
- flex: 1,
36
- minWidth: 0,
37
- display: 'block',
38
- position: 'relative',
39
- })
40
- )
32
+ const InputRoot = styled.span`
33
+ flex: 1;
34
+ min-width: 0;
35
+ display: block;
36
+ position: relative;
37
+ `
41
38
 
42
- const Input = memo(
43
- compose<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>('textarea', [
44
- responsiveInputPaddingStyle,
45
- textInputBaseStyle,
46
- textInputFontSizeStyle,
47
- ])
39
+ const Input = styled.textarea<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(
40
+ responsiveInputPaddingStyle,
41
+ textInputBaseStyle,
42
+ textInputFontSizeStyle
48
43
  )
49
44
 
50
- const Presentation = memo(
51
- compose<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>('div', [
52
- responsiveRadiusStyle,
53
- textInputRepresentationStyle,
54
- ])
45
+ const Presentation = styled.div<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>(
46
+ responsiveRadiusStyle,
47
+ textInputRepresentationStyle
55
48
  )
56
49
 
57
50
  /**
@@ -1,45 +1,49 @@
1
1
  import {defineScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
- export default defineScope('primitives/text-input', 'TextInput', [
5
- {
6
- name: 'plain',
7
- title: 'Plain',
8
- component: lazy(() => import('./plain')),
9
- },
10
- {
11
- name: 'custom-validity',
12
- title: 'Custom validity',
13
- component: lazy(() => import('./customValidity')),
14
- },
15
- {
16
- name: 'typed',
17
- title: 'Typed',
18
- component: lazy(() => import('./typed')),
19
- },
20
- {
21
- name: 'tones',
22
- title: 'Tones',
23
- component: lazy(() => import('./tones')),
24
- },
25
- {
26
- name: 'clear-button',
27
- title: 'Clear button',
28
- component: lazy(() => import('./clearButton')),
29
- },
30
- {
31
- name: 'read-only',
32
- title: 'Read only',
33
- component: lazy(() => import('./readOnly')),
34
- },
35
- {
36
- name: 'multiple-tones',
37
- title: 'Multiple tones',
38
- component: lazy(() => import('./multipleTones')),
39
- },
40
- {
41
- name: 'states',
42
- title: 'States',
43
- component: lazy(() => import('./states')),
44
- },
45
- ])
4
+ export default defineScope({
5
+ name: 'primitives/text-input',
6
+ title: 'TextInput',
7
+ stories: [
8
+ {
9
+ name: 'plain',
10
+ title: 'Plain',
11
+ component: lazy(() => import('./plain')),
12
+ },
13
+ {
14
+ name: 'custom-validity',
15
+ title: 'Custom validity',
16
+ component: lazy(() => import('./customValidity')),
17
+ },
18
+ {
19
+ name: 'typed',
20
+ title: 'Typed',
21
+ component: lazy(() => import('./typed')),
22
+ },
23
+ {
24
+ name: 'tones',
25
+ title: 'Tones',
26
+ component: lazy(() => import('./tones')),
27
+ },
28
+ {
29
+ name: 'clear-button',
30
+ title: 'Clear button',
31
+ component: lazy(() => import('./clearButton')),
32
+ },
33
+ {
34
+ name: 'read-only',
35
+ title: 'Read only',
36
+ component: lazy(() => import('./readOnly')),
37
+ },
38
+ {
39
+ name: 'multiple-tones',
40
+ title: 'Multiple tones',
41
+ component: lazy(() => import('./multipleTones')),
42
+ },
43
+ {
44
+ name: 'states',
45
+ title: 'States',
46
+ component: lazy(() => import('./states')),
47
+ },
48
+ ],
49
+ })
@@ -1,6 +1,7 @@
1
1
  import {icons, IconSymbol} from '@sanity/icons'
2
2
  import {Container, Flex, Stack, Text, TextInput} from '@sanity/ui'
3
- import {PerfTestProps, useBoolean, usePerfTest, useSelect, useText} from '@sanity/ui-workshop'
3
+ import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
4
+ import {PerfTestProps, usePerfTest} from '@sanity/ui-workshop/plugin-perf'
4
5
  import {fireEvent} from '@testing-library/dom'
5
6
  import {useCallback, useState} from 'react'
6
7
  import {
@@ -1,10 +1,9 @@
1
1
  import {CloseIcon} from '@sanity/icons'
2
- import {createElement, forwardRef, isValidElement, memo, useCallback, useMemo} from 'react'
2
+ import {createElement, forwardRef, isValidElement, useCallback, useMemo} from 'react'
3
3
  import {isValidElementType} from 'react-is'
4
4
  import styled from 'styled-components'
5
5
  import {EMPTY_RECORD} from '../../constants'
6
6
  import {useArrayProp, useForwardedRef, useCustomValidity} from '../../hooks'
7
- import {compose} from '../../styles'
8
7
  import {
9
8
  responsiveRadiusStyle,
10
9
  ResponsiveRadiusStyleProps,
@@ -74,83 +73,64 @@ export interface TextInputProps {
74
73
 
75
74
  const CLEAR_BUTTON_BOX_STYLE: React.CSSProperties = {zIndex: 2}
76
75
 
77
- // NOTE: use `['attrs']` to work around a VS Code syntax highlighting issue
78
- const Root = memo(styled(Card)['attrs']({forwardedAs: 'span'})(textInputRootStyle))
76
+ const Root = styled(Card).attrs({forwardedAs: 'span'})(textInputRootStyle)
79
77
 
80
- const InputRoot = memo(
81
- styled.span({
82
- flex: 1,
83
- minWidth: 0,
84
- display: 'block',
85
- position: 'relative',
86
- })
87
- )
78
+ const InputRoot = styled.span`
79
+ flex: 1;
80
+ min-width: 0;
81
+ display: block;
82
+ position: relative;
83
+ `
88
84
 
89
- // NOTE: use `['attrs']` to work around a VS Code syntax highlighting issue
90
- const Prefix = memo(
91
- styled(Card)['attrs']({forwardedAs: 'span'})({
92
- borderTopRightRadius: 0,
93
- borderBottomRightRadius: 0,
85
+ const Prefix = styled(Card).attrs({forwardedAs: 'span'})`
86
+ border-top-right-radius: 0;
87
+ border-bottom-right-radius: 0;
94
88
 
95
- '& > span': {
96
- display: 'block',
97
- margin: '-1px',
98
- },
99
- })
100
- )
89
+ & > span {
90
+ display: block;
91
+ margin: -1px;
92
+ }
93
+ `
101
94
 
102
- // NOTE: use `['attrs']` to work around a VS Code syntax highlighting issue
103
- const Suffix = memo(
104
- styled(Card)['attrs']({forwardedAs: 'span'})({
105
- borderTopLeftRadius: 0,
106
- borderBottomLeftRadius: 0,
95
+ const Suffix = styled(Card).attrs({forwardedAs: 'span'})`
96
+ border-top-left-radius: 0;
97
+ border-bottom-left-radius: 0;
107
98
 
108
- '& > span': {
109
- display: 'block',
110
- margin: '-1px',
111
- },
112
- })
113
- )
114
-
115
- const Input = memo(
116
- compose<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>('input', [
117
- responsiveInputPaddingStyle,
118
- textInputBaseStyle,
119
- textInputFontSizeStyle,
120
- ])
121
- )
99
+ & > span {
100
+ display: block;
101
+ margin: -1px;
102
+ }
103
+ `
122
104
 
123
- const Presentation = memo(
124
- compose<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>('span', [
125
- responsiveRadiusStyle,
126
- textInputRepresentationStyle,
127
- ])
128
- )
129
-
130
- const LeftBox = memo(
131
- styled(Box)({
132
- position: 'absolute',
133
- top: 0,
134
- left: 0,
135
- })
105
+ const Input = styled.input<TextInputResponsivePaddingStyleProps & TextInputInputStyleProps>(
106
+ responsiveInputPaddingStyle,
107
+ textInputBaseStyle,
108
+ textInputFontSizeStyle
136
109
  )
137
110
 
138
- const RightBox = memo(
139
- styled(Box)({
140
- position: 'absolute',
141
- top: 0,
142
- right: 0,
143
- })
111
+ const Presentation = styled.span<ResponsiveRadiusStyleProps & TextInputRepresentationStyleProps>(
112
+ responsiveRadiusStyle,
113
+ textInputRepresentationStyle
144
114
  )
145
115
 
146
- const RightCard = memo(
147
- styled(Card)({
148
- backgroundColor: 'transparent',
149
- position: 'absolute',
150
- top: 0,
151
- right: 0,
152
- })
153
- )
116
+ const LeftBox = styled(Box)`
117
+ position: absolute;
118
+ top: 0;
119
+ left: 0;
120
+ `
121
+
122
+ const RightBox = styled(Box)`
123
+ position: absolute;
124
+ top: 0;
125
+ right: 0;
126
+ `
127
+
128
+ const RightCard = styled(Card)`
129
+ background-color: transparent;
130
+ position: absolute;
131
+ top: 0;
132
+ right: 0;
133
+ `
154
134
 
155
135
  /**
156
136
  * @public
@@ -1,10 +1,14 @@
1
1
  import {defineScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
- export default defineScope('primitives/tooltip', 'Tooltip', [
5
- {
6
- name: 'props',
7
- title: 'Props',
8
- component: lazy(() => import('./props')),
9
- },
10
- ])
4
+ export default defineScope({
5
+ name: 'primitives/tooltip',
6
+ title: 'Tooltip',
7
+ stories: [
8
+ {
9
+ name: 'props',
10
+ title: 'Props',
11
+ component: lazy(() => import('./props')),
12
+ },
13
+ ],
14
+ })
@@ -18,7 +18,6 @@ import {
18
18
  useState,
19
19
  CSSProperties,
20
20
  ForwardedRef,
21
- memo,
22
21
  } from 'react'
23
22
  import styled from 'styled-components'
24
23
  import {FLOATING_STATIC_SIDES} from '../../constants'
@@ -47,11 +46,9 @@ export interface TooltipProps extends Omit<LayerProps, 'as'> {
47
46
  shadow?: number | number[]
48
47
  }
49
48
 
50
- const Root = memo(
51
- styled(Layer)({
52
- pointerEvents: 'none',
53
- })
54
- )
49
+ const Root = styled(Layer)`
50
+ pointer-events: none;
51
+ `
55
52
 
56
53
  /**
57
54
  * @public