@sanity/ui 1.7.9 → 1.7.10

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/index.d.ts +351 -15
  2. package/dist/index.esm.js +20 -13
  3. package/dist/index.esm.js.map +1 -1
  4. package/dist/index.js +20 -13
  5. package/dist/index.js.map +1 -1
  6. package/package.json +20 -19
  7. package/src/components/dialog/styles.ts +1 -1
  8. package/src/components/menu/__workshop__/shouldFocus.tsx +1 -1
  9. package/src/components/menu/menuDivider.ts +2 -3
  10. package/src/components/menu/menuGroup.tsx +1 -1
  11. package/src/components/tree/style.ts +4 -4
  12. package/src/primitives/_selectable/style.ts +3 -3
  13. package/src/primitives/avatar/styles.ts +6 -3
  14. package/src/primitives/badge/styles.ts +1 -1
  15. package/src/primitives/box/box.tsx +1 -0
  16. package/src/primitives/button/styles.ts +3 -2
  17. package/src/primitives/card/styles.ts +4 -4
  18. package/src/primitives/checkbox/styles.ts +3 -3
  19. package/src/primitives/code/styles.ts +3 -5
  20. package/src/primitives/container/styles.ts +1 -1
  21. package/src/primitives/flex/flex.tsx +1 -0
  22. package/src/primitives/heading/styles.ts +2 -4
  23. package/src/primitives/inline/inline.tsx +8 -1
  24. package/src/primitives/inline/styles.ts +1 -1
  25. package/src/primitives/label/styles.ts +2 -2
  26. package/src/primitives/popover/popover.tsx +2 -0
  27. package/src/primitives/radio/styles.ts +3 -3
  28. package/src/primitives/select/styles.ts +6 -5
  29. package/src/primitives/stack/styles.ts +1 -1
  30. package/src/primitives/switch/styles.ts +6 -6
  31. package/src/primitives/text/styles.ts +2 -2
  32. package/src/styles/border/borderStyle.ts +1 -1
  33. package/src/styles/box/boxStyle.ts +1 -1
  34. package/src/styles/colorVars/colorVarsStyle.ts +1 -1
  35. package/src/styles/flex/flexItemStyle.ts +1 -1
  36. package/src/styles/flex/flexStyle.ts +1 -1
  37. package/src/styles/font/codeFontStyle.ts +1 -1
  38. package/src/styles/font/headingFontStyle.ts +1 -1
  39. package/src/styles/font/labelFontStyle.ts +1 -1
  40. package/src/styles/font/responsiveFont.ts +1 -1
  41. package/src/styles/font/textAlignStyle.ts +1 -1
  42. package/src/styles/font/textFontStyle.ts +1 -1
  43. package/src/styles/grid/gridItemStyle.ts +1 -1
  44. package/src/styles/grid/gridStyle.ts +1 -1
  45. package/src/styles/helpers.ts +1 -1
  46. package/src/styles/input/responsiveInputPaddingStyle.ts +1 -1
  47. package/src/styles/input/textInputStyle.ts +5 -4
  48. package/src/styles/margin/marginStyle.ts +1 -1
  49. package/src/styles/padding/paddingStyle.ts +1 -1
  50. package/src/styles/radius/radiusStyle.ts +1 -1
  51. package/src/styles/shadow/shadowStyle.ts +1 -1
  52. package/src/theme/types.ts +1 -1
  53. package/src/types/index.ts +1 -0
  54. package/src/types/styled.ts +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "sideEffects": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "source": "./src/index.ts",
@@ -12,6 +12,7 @@
12
12
  "source": "./src/index.ts",
13
13
  "require": "./dist/index.js",
14
14
  "node": {
15
+ "module": "./dist/index.esm.js",
15
16
  "import": "./dist/index.cjs.mjs"
16
17
  },
17
18
  "import": "./dist/index.esm.js",
@@ -52,7 +53,7 @@
52
53
  "@sanity/color": "^2.2.5",
53
54
  "@sanity/icons": "^2.4.1",
54
55
  "csstype": "^3.1.2",
55
- "framer-motion": "^10.15.2",
56
+ "framer-motion": "^10.16.1",
56
57
  "react-refractor": "^2.1.7"
57
58
  },
58
59
  "devDependencies": {
@@ -63,49 +64,49 @@
63
64
  "@commitlint/cli": "^17.7.1",
64
65
  "@commitlint/config-conventional": "^17.7.0",
65
66
  "@juggle/resize-observer": "^3.4.0",
66
- "@sanity/pkg-utils": "^2.4.5",
67
+ "@sanity/pkg-utils": "^2.4.8",
67
68
  "@sanity/semantic-release-preset": "^4.1.3",
68
- "@sanity/ui-workshop": "^1.2.9",
69
+ "@sanity/ui-workshop": "^1.2.10",
69
70
  "@testing-library/dom": "^9.3.1",
70
71
  "@testing-library/jest-dom": "^5.17.0",
71
72
  "@testing-library/react": "^14.0.0",
72
- "@types/jest": "^29.5.3",
73
+ "@types/jest": "^29.5.4",
73
74
  "@types/jest-axe": "^3.5.5",
74
- "@types/node": "^20.5.0",
75
- "@types/react": "^18.2.20",
75
+ "@types/node": "^20.5.3",
76
+ "@types/react": "^18.2.21",
76
77
  "@types/react-dom": "^18.2.7",
77
78
  "@types/react-is": "^18.2.1",
78
79
  "@types/refractor": "^3.0.2",
79
80
  "@types/testing-library__jest-dom": "^5.14.9",
80
- "@typescript-eslint/eslint-plugin": "^6.3.0",
81
- "@typescript-eslint/parser": "^6.3.0",
81
+ "@typescript-eslint/eslint-plugin": "^6.4.1",
82
+ "@typescript-eslint/parser": "^6.4.1",
82
83
  "commitizen": "^4.3.0",
83
- "cypress": "^12.17.3",
84
+ "cypress": "^12.17.4",
84
85
  "cypress-real-events": "^1.10.0",
85
86
  "cz-conventional-changelog": "^3.3.0",
86
87
  "esbuild": "^0.19.2",
87
88
  "esbuild-register": "^3.4.2",
88
89
  "eslint": "^8.47.0",
89
- "eslint-config-prettier": "^8.10.0",
90
- "eslint-plugin-import": "^2.28.0",
90
+ "eslint-config-prettier": "^9.0.0",
91
+ "eslint-plugin-import": "^2.28.1",
91
92
  "eslint-plugin-jsx-a11y": "^6.7.1",
92
93
  "eslint-plugin-prettier": "^5.0.0",
93
- "eslint-plugin-react": "^7.33.1",
94
+ "eslint-plugin-react": "^7.33.2",
94
95
  "eslint-plugin-react-hooks": "^4.6.0",
95
96
  "http-server": "^14.1.1",
96
97
  "husky": "^8.0.3",
97
- "jest": "^29.6.2",
98
+ "jest": "^29.6.3",
98
99
  "jest-axe": "^8.0.0",
99
- "jest-environment-jsdom": "^29.6.2",
100
- "lint-staged": "^13.3.0",
100
+ "jest-environment-jsdom": "^29.6.3",
101
+ "lint-staged": "^14.0.1",
101
102
  "module-alias": "^2.2.3",
102
103
  "npm-run-all": "^4.1.5",
103
- "prettier": "^3.0.1",
104
+ "prettier": "^3.0.2",
104
105
  "react": "^18.2.0",
105
106
  "react-dom": "^18.2.0",
106
107
  "react-is": "^18.2.0",
107
108
  "rimraf": "^5.0.1",
108
- "semantic-release": "^21.0.7",
109
+ "semantic-release": "^21.0.9",
109
110
  "start-server-and-test": "^2.0.0",
110
111
  "styled-components": "^6.0.7",
111
112
  "tsconfig-paths": "^4.2.0",
@@ -144,7 +145,7 @@
144
145
  "prettier --write --cache --ignore-unknown"
145
146
  ]
146
147
  },
147
- "packageManager": "pnpm@8.6.10",
148
+ "packageManager": "pnpm@8.6.12",
148
149
  "publishConfig": {
149
150
  "access": "public",
150
151
  "provenance": true
@@ -1,6 +1,6 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {_responsive, ThemeProps} from '../../styles'
3
2
  import {DialogPosition} from '../../types'
3
+ import {CSSObject} from '../../types/styled'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -14,7 +14,7 @@ const ITEMS = [...Array(8).keys()].map((num) => ({
14
14
  const OPTIONS = {first: 'first', last: 'last'}
15
15
 
16
16
  export default function ShouldFocusStory() {
17
- const shouldFocus = useSelect('Should focus', OPTIONS, 'first')
17
+ const shouldFocus = useSelect<keyof typeof OPTIONS>('Should focus', OPTIONS, 'first')
18
18
 
19
19
  const [popoverOpen, setPopoverOpen] = useState<boolean>(false)
20
20
  const handleToggleOpen = useCallback(() => setPopoverOpen((v) => !v), [])
@@ -1,10 +1,9 @@
1
- import styled, {StyledComponent} from 'styled-components'
2
- import {Theme} from '../../theme'
1
+ import styled from 'styled-components'
3
2
 
4
3
  /**
5
4
  * @public
6
5
  */
7
- export const MenuDivider: StyledComponent<'hr', Theme> = styled.hr`
6
+ export const MenuDivider = styled.hr`
8
7
  height: 1px;
9
8
  border: 0;
10
9
  background: var(--card-hairline-soft-color);
@@ -54,7 +54,7 @@ export function MenuGroup(
54
54
  onItemMouseEnter = menu.onMouseEnter,
55
55
  registerElement,
56
56
  } = menu
57
- const [rootElement, setRootElement] = useState<HTMLButtonElement | null>(null)
57
+ const [rootElement, setRootElement] = useState<HTMLButtonElement | HTMLDivElement | null>(null)
58
58
  const [open, setOpen] = useState(false)
59
59
  const shouldFocusRef = useRef<'first' | 'last' | null>(null)
60
60
  const active = Boolean(activeElement) && activeElement === rootElement
@@ -1,8 +1,8 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {rem, ThemeProps} from '../../styles'
3
3
  import {_colorVarsStyle} from '../../styles/colorVars'
4
4
 
5
- export function treeItemRootStyle(): FlattenSimpleInterpolation {
5
+ export function treeItemRootStyle(): ReturnType<typeof css> {
6
6
  return css`
7
7
  &[role='none'] > [role='treeitem'] {
8
8
  outline: none;
@@ -29,7 +29,7 @@ export function treeItemRootStyle(): FlattenSimpleInterpolation {
29
29
  `
30
30
  }
31
31
 
32
- export function treeItemRootColorStyle(props: ThemeProps): FlattenSimpleInterpolation {
32
+ export function treeItemRootColorStyle(props: ThemeProps): ReturnType<typeof css> {
33
33
  const {theme} = props
34
34
  const $tone = 'default'
35
35
  const {base, muted, selectable} = theme.sanity.color
@@ -93,7 +93,7 @@ export interface TreeItemBoxStyleProps {
93
93
 
94
94
  export function treeItemBoxStyle(
95
95
  props: TreeItemBoxStyleProps & ThemeProps,
96
- ): FlattenSimpleInterpolation {
96
+ ): ReturnType<typeof css> {
97
97
  const {$level, theme} = props
98
98
  const {space} = theme.sanity
99
99
 
@@ -1,4 +1,4 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {ThemeProps} from '../../styles'
3
3
  import {_colorVarsStyle} from '../../styles/colorVars'
4
4
  import {SelectableTone} from '../../types/selectable'
@@ -10,7 +10,7 @@ export interface SelectableStyleProps {
10
10
  $tone: SelectableTone
11
11
  }
12
12
 
13
- export function selectableBaseStyle(): FlattenSimpleInterpolation {
13
+ export function selectableBaseStyle(): ReturnType<typeof css> {
14
14
  return css`
15
15
  background-color: inherit;
16
16
  color: inherit;
@@ -34,7 +34,7 @@ export function selectableBaseStyle(): FlattenSimpleInterpolation {
34
34
 
35
35
  export function selectableColorStyle(
36
36
  props: SelectableStyleProps & ThemeProps,
37
- ): FlattenSimpleInterpolation {
37
+ ): ReturnType<typeof css> {
38
38
  const {$tone, theme} = props
39
39
  const {base, muted, selectable} = theme.sanity.color
40
40
  // @todo: remove use of `muted` here
@@ -1,6 +1,6 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {rem, _responsive, ThemeProps} from '../../styles'
3
2
  import {focusRingStyle} from '../../styles/internal'
3
+ import {CSSObject} from '../../types/styled'
4
4
  import {AvatarRootStyleProps, ResponsiveAvatarSizeStyleProps} from './types'
5
5
 
6
6
  export const avatarStyle = {
@@ -32,6 +32,7 @@ function avatarArrowStyle(): CSSObject {
32
32
  left: '50%',
33
33
  transform: 'translateX(-6px)',
34
34
 
35
+ // @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
35
36
  '&:not([hidden])': {
36
37
  display: 'block',
37
38
  },
@@ -70,6 +71,7 @@ export function avatarRootStyle(props: AvatarRootStyleProps & ThemeProps): CSSOb
70
71
  },
71
72
 
72
73
  '&>svg': {
74
+ // @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
73
75
  '&:not([hidden])': {
74
76
  display: 'block',
75
77
  },
@@ -77,7 +79,7 @@ export function avatarRootStyle(props: AvatarRootStyleProps & ThemeProps): CSSOb
77
79
 
78
80
  /* &:is(button) */
79
81
  '&[data-as="button"]': {
80
- '-webkit-font-smoothing': 'inherit',
82
+ WebkitFontSmoothing: 'inherit',
81
83
  appearance: 'none',
82
84
  margin: 0,
83
85
  padding: 0,
@@ -86,6 +88,7 @@ export function avatarRootStyle(props: AvatarRootStyleProps & ThemeProps): CSSOb
86
88
  color: 'inherit',
87
89
  outline: 'none',
88
90
 
91
+ // @ts-expect-error -- TODO wait for CSSObject types to be fixed in `styled-components` itself
89
92
  '&:focus': {
90
93
  boxShadow: focusRingStyle({focusRing}),
91
94
  },
@@ -152,7 +155,7 @@ function avatarStrokeStyle(): CSSObject {
152
155
  strokeWidth: '3px',
153
156
 
154
157
  '[data-status="editing"] &': {
155
- strokeSasharray: '2 4',
158
+ strokeDasharray: '2 4',
156
159
  strokeLinecap: 'round',
157
160
  },
158
161
  }
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {ThemeProps} from '../../styles'
2
+ import {CSSObject} from '../../types/styled'
3
3
  import {BadgeStyleProps} from './types'
4
4
 
5
5
  export function badgeStyle(props: BadgeStyleProps & ThemeProps): CSSObject {
@@ -32,6 +32,7 @@ export interface BoxProps
32
32
  ResponsiveMarginProps,
33
33
  ResponsivePaddingProps {
34
34
  as?: React.ElementType | keyof JSX.IntrinsicElements
35
+ forwardedAs?: React.ElementType | keyof JSX.IntrinsicElements
35
36
  }
36
37
 
37
38
  const Root = styled.div<
@@ -1,13 +1,14 @@
1
- import {css, CSSObject, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {ThemeProps} from '../../styles'
3
3
  import {_colorVarsStyle} from '../../styles/colorVars'
4
4
  import {focusRingBorderStyle, focusRingStyle} from '../../styles/internal'
5
5
  import {ButtonMode, ButtonTone} from '../../types'
6
+ import {CSSObject} from '../../types/styled'
6
7
 
7
8
  /**
8
9
  * @internal
9
10
  */
10
- export function buttonBaseStyles(): FlattenSimpleInterpolation {
11
+ export function buttonBaseStyles(): ReturnType<typeof css> {
11
12
  return css`
12
13
  -webkit-font-smoothing: inherit;
13
14
  appearance: none;
@@ -1,4 +1,4 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {ThemeProps} from '../../styles'
3
3
  import {_colorVarsStyle} from '../../styles/colorVars'
4
4
  import {focusRingBorderStyle, focusRingStyle} from '../../styles/focusRing'
@@ -6,11 +6,11 @@ import {CardStyleProps} from './types'
6
6
 
7
7
  export function cardStyle(
8
8
  props: CardStyleProps & ThemeProps,
9
- ): Array<FlattenSimpleInterpolation | (() => FlattenSimpleInterpolation)> {
9
+ ): Array<ReturnType<typeof css> | (() => ReturnType<typeof css>)> {
10
10
  return [cardBaseStyle(props), cardColorStyle(props)]
11
11
  }
12
12
 
13
- export function cardBaseStyle(props: CardStyleProps & ThemeProps): FlattenSimpleInterpolation {
13
+ export function cardBaseStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {
14
14
  const {$checkered, theme} = props
15
15
  const space = theme.sanity.space
16
16
 
@@ -45,7 +45,7 @@ export function cardBaseStyle(props: CardStyleProps & ThemeProps): FlattenSimple
45
45
  `
46
46
  }
47
47
 
48
- export function cardColorStyle(props: CardStyleProps & ThemeProps): FlattenSimpleInterpolation {
48
+ export function cardColorStyle(props: CardStyleProps & ThemeProps): ReturnType<typeof css> {
49
49
  const {$checkered, $focusRing, theme} = props
50
50
  const {focusRing} = theme.sanity
51
51
  const {base, card, dark} = theme.sanity.color
@@ -1,15 +1,15 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {rem, ThemeProps} from '../../styles'
3
3
  import {focusRingBorderStyle, focusRingStyle} from '../../styles/internal'
4
4
 
5
- export function checkboxBaseStyles(): FlattenSimpleInterpolation {
5
+ export function checkboxBaseStyles(): ReturnType<typeof css> {
6
6
  return css`
7
7
  position: relative;
8
8
  display: inline-block;
9
9
  `
10
10
  }
11
11
 
12
- export function inputElementStyles(props: ThemeProps): FlattenSimpleInterpolation {
12
+ export function inputElementStyles(props: ThemeProps): ReturnType<typeof css> {
13
13
  const {theme} = props
14
14
  const color = theme.sanity.color.input
15
15
  const {focusRing, input, radius} = theme.sanity
@@ -1,8 +1,6 @@
1
- import {css, FlattenInterpolation, ThemeProps as StyledThemeProps} from 'styled-components'
2
- import {ThemeProps} from '../../styles'
3
- import {Theme} from '../../theme'
1
+ import {css, ExecutionContext} from 'styled-components'
4
2
 
5
- function codeSyntaxHighlightingStyle({theme}: ThemeProps) {
3
+ function codeSyntaxHighlightingStyle({theme}: ExecutionContext) {
6
4
  const color = theme.sanity.color.syntax
7
5
 
8
6
  return {
@@ -45,7 +43,7 @@ function codeSyntaxHighlightingStyle({theme}: ThemeProps) {
45
43
  }
46
44
  }
47
45
 
48
- export function codeBaseStyle(): FlattenInterpolation<StyledThemeProps<Theme>> {
46
+ export function codeBaseStyle(): ReturnType<typeof css> {
49
47
  return css`
50
48
  color: var(--card-code-fg-color);
51
49
 
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {rem, _responsive, ThemeProps} from '../../styles'
2
+ import {CSSObject} from '../../types/styled'
3
3
  import {ResponsiveWidthStyleProps} from './types'
4
4
 
5
5
  const BASE_STYLE: CSSObject = {
@@ -35,6 +35,7 @@ export const Flex = forwardRef(function Flex(
35
35
  const {align, as, direction = 'row', gap, justify, wrap, ...restProps} = props
36
36
 
37
37
  return (
38
+ // @ts-expect-error -- some dollar prefixed typings aren't inferred correctly https://github.com/styled-components/styled-components/issues/4062
38
39
  <Root
39
40
  data-ui="Flex"
40
41
  {...restProps}
@@ -1,10 +1,8 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {ThemeProps} from '../../styles'
3
3
  import {HeadingStyleProps} from './types'
4
4
 
5
- export function headingBaseStyle(
6
- props: HeadingStyleProps & ThemeProps,
7
- ): FlattenSimpleInterpolation {
5
+ export function headingBaseStyle(props: HeadingStyleProps & ThemeProps): ReturnType<typeof css> {
8
6
  const {$accent, $muted, theme} = props
9
7
 
10
8
  return css`
@@ -33,7 +33,14 @@ export const Inline = forwardRef(function Inline(
33
33
  )
34
34
 
35
35
  return (
36
- <Root data-ui="Inline" {...restProps} $space={useArrayProp(space)} forwardedAs={as} ref={ref}>
36
+ <Root
37
+ data-ui="Inline"
38
+ {...restProps}
39
+ $space={useArrayProp(space)}
40
+ forwardedAs={as}
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
+ ref={ref as any}
43
+ >
37
44
  {children}
38
45
  </Root>
39
46
  )
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {rem, _responsive, ThemeProps} from '../../styles'
2
+ import {CSSObject} from '../../types/styled'
3
3
  import {ResponsiveInlineSpaceStyleProps} from './types'
4
4
 
5
5
  export function inlineBaseStyle(): CSSObject {
@@ -1,9 +1,9 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {ThemeProps} from '../../styles'
3
3
 
4
4
  export function labelBaseStyle(
5
5
  props: {$accent?: boolean; $muted: boolean} & ThemeProps,
6
- ): FlattenSimpleInterpolation {
6
+ ): ReturnType<typeof css> {
7
7
  const {$accent, $muted, theme} = props
8
8
  const {fonts} = theme.sanity
9
9
 
@@ -35,6 +35,8 @@ import {calcCurrentWidth, calcMaxWidth} from './helpers'
35
35
  import {PopoverCard} from './popoverCard'
36
36
  import {PopoverUpdateCallback, PopoverWidth} from './types'
37
37
 
38
+ export type {PopoverUpdateCallback}
39
+
38
40
  /** @public */
39
41
  export interface PopoverProps
40
42
  extends Omit<LayerProps, 'as'>,
@@ -1,8 +1,8 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {rem, ThemeProps} from '../../styles'
3
3
  import {focusRingBorderStyle, focusRingStyle} from '../../styles/internal'
4
4
 
5
- export function radioBaseStyle(): FlattenSimpleInterpolation {
5
+ export function radioBaseStyle(): ReturnType<typeof css> {
6
6
  return css`
7
7
  position: relative;
8
8
 
@@ -16,7 +16,7 @@ export function radioBaseStyle(): FlattenSimpleInterpolation {
16
16
  `
17
17
  }
18
18
 
19
- export function inputElementStyle(props: ThemeProps): FlattenSimpleInterpolation {
19
+ export function inputElementStyle(props: ThemeProps): ReturnType<typeof css> {
20
20
  const {theme} = props
21
21
  const {focusRing, input} = theme.sanity
22
22
  const color = theme.sanity.color.input
@@ -1,4 +1,4 @@
1
- import {css, CSSObject, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {rem, _responsive, ThemeProps} from '../../styles'
3
3
  import {
4
4
  focusRingBorderStyle,
@@ -8,8 +8,9 @@ import {
8
8
  ResponsiveRadiusStyleProps,
9
9
  } from '../../styles/internal'
10
10
  import {ThemeFontSize} from '../../theme'
11
+ import {CSSObject} from '../../types/styled'
11
12
 
12
- function rootStyle(): FlattenSimpleInterpolation {
13
+ function rootStyle(): ReturnType<typeof css> {
13
14
  return css`
14
15
  position: relative;
15
16
  width: stretch;
@@ -20,7 +21,7 @@ function rootStyle(): FlattenSimpleInterpolation {
20
21
  `
21
22
  }
22
23
 
23
- function inputBaseStyle(props: ThemeProps): FlattenSimpleInterpolation {
24
+ function inputBaseStyle(props: ThemeProps): ReturnType<typeof css> {
24
25
  const {theme} = props
25
26
  const font = theme.sanity.fonts.text
26
27
 
@@ -117,7 +118,7 @@ function inputStyle(): Array<
117
118
  $space: number[]
118
119
  } & ThemeProps,
119
120
  ) => CSSObject[])
120
- | ((props: ThemeProps) => FlattenSimpleInterpolation)
121
+ | ((props: ThemeProps) => ReturnType<typeof css>)
121
122
  > {
122
123
  return [
123
124
  responsiveRadiusStyle,
@@ -128,7 +129,7 @@ function inputStyle(): Array<
128
129
  ]
129
130
  }
130
131
 
131
- function iconBoxStyle(props: ThemeProps): FlattenSimpleInterpolation {
132
+ function iconBoxStyle(props: ThemeProps): ReturnType<typeof css> {
132
133
  const {theme} = props
133
134
  const color = theme.sanity.color.input
134
135
 
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {rem, _responsive, ThemeProps} from '../../styles'
2
+ import {CSSObject} from '../../types/styled'
3
3
 
4
4
  export interface ResponsiveStackSpaceStyleProps {
5
5
  $space: number[]
@@ -1,9 +1,9 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {rem, ThemeProps} from '../../styles'
3
3
  import {focusRingStyle} from '../../styles/internal'
4
4
 
5
5
  /* Root */
6
- export function switchBaseStyles(): FlattenSimpleInterpolation {
6
+ export function switchBaseStyles(): ReturnType<typeof css> {
7
7
  return css`
8
8
  position: relative;
9
9
  &:not([hidden]) {
@@ -13,7 +13,7 @@ export function switchBaseStyles(): FlattenSimpleInterpolation {
13
13
  }
14
14
 
15
15
  /* Input */
16
- export function switchInputStyles(): FlattenSimpleInterpolation {
16
+ export function switchInputStyles(): ReturnType<typeof css> {
17
17
  // Visually hide the input element while keeping it interactive
18
18
  return css`
19
19
  position: absolute;
@@ -34,7 +34,7 @@ export function switchInputStyles(): FlattenSimpleInterpolation {
34
34
  }
35
35
 
36
36
  /* Representation */
37
- export function switchRepresentationStyles(props: ThemeProps): FlattenSimpleInterpolation {
37
+ export function switchRepresentationStyles(props: ThemeProps): ReturnType<typeof css> {
38
38
  const {theme} = props
39
39
  const {focusRing, input} = theme.sanity
40
40
  const color = theme.sanity.color.button.default
@@ -102,7 +102,7 @@ export function switchRepresentationStyles(props: ThemeProps): FlattenSimpleInte
102
102
  }
103
103
 
104
104
  /* Track */
105
- export function switchTrackStyles(props: ThemeProps): FlattenSimpleInterpolation {
105
+ export function switchTrackStyles(props: ThemeProps): ReturnType<typeof css> {
106
106
  const {theme} = props
107
107
  const {input} = theme.sanity
108
108
 
@@ -123,7 +123,7 @@ export function switchTrackStyles(props: ThemeProps): FlattenSimpleInterpolation
123
123
  /* Thumb */
124
124
  export function switchThumbStyles(
125
125
  props: {$checked?: boolean; $indeterminate?: boolean} & ThemeProps,
126
- ): FlattenSimpleInterpolation {
126
+ ): ReturnType<typeof css> {
127
127
  const {$indeterminate, theme} = props
128
128
  const {input} = theme.sanity
129
129
  const trackWidth = input.switch.width
@@ -1,9 +1,9 @@
1
- import {css, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} 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
- ): FlattenSimpleInterpolation {
6
+ ): ReturnType<typeof css> {
7
7
  const {$accent, $muted, theme} = props
8
8
  const {weights} = theme.sanity.fonts.text
9
9
 
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {_responsive} from '../helpers'
3
3
  import {ThemeProps} from '../types'
4
4
  import {ResponsiveBorderStyleProps} from './types'
@@ -1,5 +1,5 @@
1
1
  import {Property} from 'csstype'
2
- import {CSSObject} from 'styled-components'
2
+ import {CSSObject} from '../../types/styled'
3
3
  import {_responsive} from '../helpers'
4
4
  import {ThemeProps} from '../types'
5
5
  import {ResponsiveBoxStyleProps} from './types'
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {ThemeColorBase, ThemeColorGenericState} from '../../theme'
2
+ import {CSSObject} from '../../types/styled'
3
3
 
4
4
  /**
5
5
  * @internal
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {EMPTY_ARRAY} from '../../constants'
2
+ import {CSSObject} from '../../types/styled'
3
3
  import {_responsive} from '../helpers'
4
4
  import {ThemeProps} from '../types'
5
5
  import {ResponsiveFlexItemStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {rem, _responsive} from '../helpers'
3
3
  import {ThemeProps} from '../types'
4
4
  import {ResponsiveFlexStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {ThemeProps} from '../types'
3
3
  import {responsiveFont} from './responsiveFont'
4
4
  import {ResponsiveFontStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {ThemeProps} from '../types'
3
3
  import {responsiveFont} from './responsiveFont'
4
4
  import {ResponsiveFontStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {ThemeProps} from '../types'
3
3
  import {responsiveFont} from './responsiveFont'
4
4
  import {ResponsiveFontStyleProps} from './types'
@@ -1,5 +1,5 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {ThemeFontSize, ThemeFontKey} from '../../theme'
2
+ import {CSSObject} from '../../types/styled'
3
3
  import {rem, _responsive} from '../helpers'
4
4
  import {ThemeProps} from '../types'
5
5
  import {ResponsiveFontStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {_responsive} from '../helpers'
3
3
  import {ThemeProps} from '../types'
4
4
  import {ResponsiveTextAlignStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {ThemeProps} from '../types'
3
3
  import {responsiveFont} from './responsiveFont'
4
4
  import {ResponsiveFontStyleProps} from './types'