@sanity/ui 1.7.8 → 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 +346 -10
  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 +22 -22
  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
@@ -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'
@@ -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 {ResponsiveGridItemStyleProps} 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 {ResponsiveGridStyleProps} from './types'
@@ -1,6 +1,6 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {EMPTY_ARRAY} from '../constants'
3
2
  import {Theme} from '../theme'
3
+ import {CSSObject} from '../types/styled'
4
4
 
5
5
  /**
6
6
  * @internal
@@ -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
 
@@ -1,6 +1,7 @@
1
- import {css, CSSObject, FlattenSimpleInterpolation} from 'styled-components'
1
+ import {css} from 'styled-components'
2
2
  import {ThemeColorSchemeKey, ThemeFontWeightKey} from '../../theme'
3
3
  import {CardTone} from '../../types'
4
+ import {CSSObject} from '../../types/styled'
4
5
  import {focusRingBorderStyle, focusRingStyle} from '../focusRing'
5
6
  import {rem, _responsive} from '../helpers'
6
7
  import {ThemeProps} from '../types'
@@ -33,13 +34,13 @@ const ROOT_STYLE = css`
33
34
  align-items: center;
34
35
  `
35
36
 
36
- export function textInputRootStyle(): FlattenSimpleInterpolation {
37
+ export function textInputRootStyle(): ReturnType<typeof css> {
37
38
  return ROOT_STYLE
38
39
  }
39
40
 
40
41
  export function textInputBaseStyle(
41
42
  props: TextInputInputStyleProps & ThemeProps,
42
- ): FlattenSimpleInterpolation {
43
+ ): ReturnType<typeof css> {
43
44
  const {theme, $scheme, $tone, $weight} = props
44
45
  const font = theme.sanity.fonts.text
45
46
  const color = theme.sanity.color.input
@@ -127,7 +128,7 @@ export function textInputFontSizeStyle(props: TextInputInputStyleProps & ThemePr
127
128
 
128
129
  export function textInputRepresentationStyle(
129
130
  props: TextInputRepresentationStyleProps & ThemeProps,
130
- ): FlattenSimpleInterpolation {
131
+ ): ReturnType<typeof css> {
131
132
  const {$hasPrefix, $hasSuffix, $scheme, $tone, theme} = props
132
133
  const {focusRing, input} = theme.sanity
133
134
  const color = theme.sanity.color.input
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {_getResponsiveSpace} from '../helpers'
3
3
  import {ThemeProps} from '../types'
4
4
  import {ResponsiveMarginStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../../types/styled'
2
2
  import {_getResponsiveSpace} from '../helpers'
3
3
  import {ThemeProps} from '../types'
4
4
  import {ResponsivePaddingStyleProps} 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 {ResponsiveRadiusStyleProps} from './types'
@@ -1,6 +1,6 @@
1
- import {CSSObject} from 'styled-components'
2
1
  import {EMPTY_RECORD} from '../../constants'
3
2
  import {BoxShadow, ThemeShadow} from '../../theme'
3
+ import {CSSObject} from '../../types/styled'
4
4
  import {rem, _responsive} from '../helpers'
5
5
  import {ThemeProps} from '../types'
6
6
  import {ResponsiveShadowStyleProps} from './types'
@@ -1,4 +1,4 @@
1
- import {CSSObject} from 'styled-components'
1
+ import {CSSObject} from '../types/styled'
2
2
  import {BaseTheme, ThemeColor, ThemeColorName, ThemeColorSchemeKey} from './lib/theme'
3
3
 
4
4
  /**
@@ -10,4 +10,5 @@ export * from './gridItem'
10
10
  export * from './placement'
11
11
  export * from './popover'
12
12
  export * from './selectable'
13
+ export * from './styled'
13
14
  export * from './text'
@@ -0,0 +1,9 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ // Workaround types that are missing in v6
3
+ // https://github.com/styled-components/styled-components/issues/4062
4
+
5
+ import type {StyledObject} from 'styled-components'
6
+
7
+ /** @internal */
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ export type CSSObject = StyledObject<any>