@sanity/ui 5.0.0-alpha.24 → 5.0.0-alpha.26

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 (86) hide show
  1. package/dist/index.d.ts +145 -147
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +256 -179
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +1 -1
  6. package/package.json +1 -1
  7. package/src/components/avatar/avatar.props.ts +4 -2
  8. package/src/components/avatar-counter/avatarCounter.props.ts +4 -2
  9. package/src/components/avatar-stack/avatarStack.props.ts +4 -2
  10. package/src/components/badge/Badge.tsx +2 -5
  11. package/src/components/badge/badge.props.ts +15 -15
  12. package/src/components/box/Box.tsx +2 -5
  13. package/src/components/box/box.props.ts +18 -12
  14. package/src/components/button/Button.tsx +2 -2
  15. package/src/components/button/button.props.ts +49 -43
  16. package/src/components/card/Card.tsx +2 -2
  17. package/src/components/card/card.props.ts +19 -13
  18. package/src/components/checkbox/Checkbox.tsx +3 -2
  19. package/src/components/checkbox/checkbox.props.ts +4 -2
  20. package/src/components/code/code.props.ts +5 -3
  21. package/src/components/container/Container.tsx +2 -2
  22. package/src/components/container/container.props.ts +17 -11
  23. package/src/components/dialog/Dialog.tsx +13 -7
  24. package/src/components/dialog/dialog.props.ts +11 -3
  25. package/src/components/divider/divider.props.ts +4 -2
  26. package/src/components/eyebrow/Eyebrow.tsx +2 -5
  27. package/src/components/eyebrow/eyebrow.props.ts +19 -12
  28. package/src/components/flex/Flex.tsx +2 -5
  29. package/src/components/flex/flex.props.ts +19 -12
  30. package/src/components/grid/Grid.tsx +2 -5
  31. package/src/components/grid/grid.props.ts +20 -16
  32. package/src/components/h-stack/HStack.tsx +2 -5
  33. package/src/components/h-stack/hStack.props.ts +7 -4
  34. package/src/components/heading/Heading.tsx +2 -5
  35. package/src/components/heading/heading.props.ts +18 -13
  36. package/src/components/hotkeys/hotkeys.props.ts +4 -2
  37. package/src/components/icon/icon.props.ts +3 -3
  38. package/src/components/icon-button/IconButton.tsx +2 -4
  39. package/src/components/icon-button/iconButton.props.ts +17 -17
  40. package/src/components/index.css +1 -0
  41. package/src/components/indicator/Indicator.tsx +2 -2
  42. package/src/components/indicator/indicator.props.ts +17 -11
  43. package/src/components/indicator-stack/IndicatorStack.tsx +2 -4
  44. package/src/components/indicator-stack/indicatorStack.props.ts +13 -7
  45. package/src/components/inline/Inline.tsx +2 -2
  46. package/src/components/inline/inline.props.ts +17 -11
  47. package/src/components/kbd/kbd.props.ts +4 -2
  48. package/src/components/link/link.props.ts +4 -2
  49. package/src/components/list/List.tsx +47 -97
  50. package/src/components/list/list.css +28 -9
  51. package/src/components/list/list.props.ts +59 -68
  52. package/src/components/popover/popover.props.ts +7 -5
  53. package/src/components/press-area/PressArea.tsx +2 -4
  54. package/src/components/press-area/press-area.css +9 -3
  55. package/src/components/press-area/pressArea.props.ts +13 -7
  56. package/src/components/radio/radio.props.ts +2 -1
  57. package/src/components/search-input/SearchInput.tsx +90 -0
  58. package/src/components/search-input/search-input.css +125 -0
  59. package/src/components/search-input/searchInput.props.ts +18 -0
  60. package/src/components/select/Select.tsx +6 -1
  61. package/src/components/select/select.css +10 -12
  62. package/src/components/select/select.props.ts +4 -2
  63. package/src/components/skip-to-content/skipToContent.props.ts +4 -2
  64. package/src/components/spinner/spinner.props.ts +4 -2
  65. package/src/components/switch/switch.props.ts +4 -2
  66. package/src/components/tabs/tabs.props.ts +8 -9
  67. package/src/components/text/Text.tsx +2 -5
  68. package/src/components/text/text.props.ts +19 -12
  69. package/src/components/text-area/textArea.props.ts +4 -5
  70. package/src/components/text-input/textInput.props.ts +5 -3
  71. package/src/components/tooltip/tooltip.props.ts +7 -5
  72. package/src/components/tooltip-group/TooltipGroup.tsx +8 -9
  73. package/src/components/tooltip-group/tooltipGroup.props.ts +13 -7
  74. package/src/components/v-stack/VStack.tsx +2 -5
  75. package/src/components/v-stack/vStack.props.ts +7 -4
  76. package/src/components/visually-hidden/VisuallyHidden.tsx +2 -4
  77. package/src/components/visually-hidden/visuallyHidden.props.ts +18 -12
  78. package/src/index.ts +1 -0
  79. package/src/types/Interactive.ts +3 -1
  80. package/src/types/Polymorphic.ts +9 -0
  81. package/src/types/Tone.ts +1 -1
  82. package/src/utils/composeRefs.test.ts +130 -0
  83. package/src/utils/composeRefs.ts +52 -0
  84. package/src/utils/getProps.test.ts +18 -0
  85. package/src/utils/getProps.ts +31 -16
  86. package/src/version.ts +2 -2
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
2
+ import type {ElementType} from 'react'
3
3
 
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -8,10 +8,7 @@ import {type FlexProps, flexProps} from './flex.props'
8
8
  const flexClassName = suffixClassName('sui-Flex')
9
9
 
10
10
  /** @public */
11
- export function Flex<T extends ElementType = 'div'>({
12
- display = 'flex',
13
- ...props
14
- }: FlexProps<T> & Omit<ComponentPropsWithRef<T>, keyof FlexProps<T>>) {
11
+ export function Flex<T extends ElementType = 'div'>({display = 'flex', ...props}: FlexProps<T>) {
15
12
  const {as, children, className, style, ...rest} = getProps({display, ...props}, flexProps)
16
13
  const Component = as || 'div'
17
14
 
@@ -1,22 +1,29 @@
1
+ import type {ElementType} from 'react'
2
+
1
3
  import {type FlexParentProps, flexParentProps} from '../../props/flexParent'
2
4
  import {type GapProps, gapProps} from '../../props/gap'
3
5
  import {type LayoutProps, layoutProps} from '../../props/layout'
4
6
  import {DISPLAY_FLEX, type DisplayFlex} from '../../types/Display'
5
- import {type PropDef} from '../../types/PropDef'
7
+ import type {Polymorphic} from '../../types/Polymorphic'
8
+ import type {PropDef} from '../../types/PropDef'
6
9
  import type {Responsive} from '../../types/Responsive'
7
10
 
8
11
  /** @public */
9
- export interface FlexProps<T extends React.ElementType = 'div'>
10
- extends FlexParentProps, GapProps, LayoutProps {
11
- /**
12
- * HTML element or component to render.
13
- */
14
- as?: T
15
- /**
16
- * CSS `display` property.
17
- */
18
- display?: Responsive<DisplayFlex>
19
- }
12
+ export type FlexProps<T extends ElementType = 'div'> = Polymorphic<
13
+ T,
14
+ FlexParentProps &
15
+ GapProps &
16
+ LayoutProps & {
17
+ /**
18
+ * HTML element or component to render.
19
+ */
20
+ as?: T
21
+ /**
22
+ * CSS `display` property.
23
+ */
24
+ display?: Responsive<DisplayFlex>
25
+ }
26
+ >
20
27
 
21
28
  export const flexProps: Record<string, PropDef> = {
22
29
  as: {
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
2
+ import type {ElementType} from 'react'
3
3
 
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -8,10 +8,7 @@ import {type GridProps, gridProps} from './grid.props'
8
8
  const gridClassName = suffixClassName('sui-Grid')
9
9
 
10
10
  /** @public */
11
- export function Grid<T extends ElementType = 'div'>({
12
- display = 'grid',
13
- ...props
14
- }: GridProps<T> & Omit<ComponentPropsWithRef<T>, keyof GridProps<T>>) {
11
+ export function Grid<T extends ElementType = 'div'>({display = 'grid', ...props}: GridProps<T>) {
15
12
  const {as, children, className, style, ...rest} = getProps({display, ...props}, gridProps)
16
13
  const Component = as || 'div'
17
14
 
@@ -1,27 +1,31 @@
1
+ import type {ElementType} from 'react'
2
+
1
3
  import {flexParentProps, type FlexParentProps} from '../../props/flexParent'
2
4
  import {type GapProps, gapProps} from '../../props/gap'
3
5
  import {type GridParentProps, gridParentProps} from '../../props/gridParent'
4
6
  import {type LayoutProps, layoutProps} from '../../props/layout'
5
7
  import {DISPLAY_GRID, type DisplayGrid} from '../../types/Display'
6
- import {type PropDef} from '../../types/PropDef'
8
+ import type {Polymorphic} from '../../types/Polymorphic'
9
+ import type {PropDef} from '../../types/PropDef'
7
10
  import type {Responsive} from '../../types/Responsive'
8
11
 
9
12
  /** @public */
10
- export interface GridProps<T extends React.ElementType = 'div'>
11
- extends
12
- Pick<FlexParentProps, 'alignItems' | 'justifyContent'>,
13
- GridParentProps,
14
- GapProps,
15
- LayoutProps {
16
- /**
17
- * HTML element or component to render.
18
- */
19
- as?: T
20
- /**
21
- * CSS `display` property.
22
- */
23
- display?: Responsive<DisplayGrid>
24
- }
13
+ export type GridProps<T extends ElementType = 'div'> = Polymorphic<
14
+ T,
15
+ Pick<FlexParentProps, 'alignItems' | 'justifyContent'> &
16
+ GridParentProps &
17
+ GapProps &
18
+ LayoutProps & {
19
+ /**
20
+ * HTML element or component to render.
21
+ */
22
+ as?: T
23
+ /**
24
+ * CSS `display` property.
25
+ */
26
+ display?: Responsive<DisplayGrid>
27
+ }
28
+ >
25
29
 
26
30
  export const gridProps: Record<string, PropDef> = {
27
31
  as: {
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
2
+ import type {ElementType} from 'react'
3
3
 
4
4
  import {type ComponentProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -9,10 +9,7 @@ import {type HStackProps} from './hStack.props'
9
9
  const hStackClassName = suffixClassName('sui-HStack')
10
10
 
11
11
  /** @public */
12
- export function HStack<T extends ElementType = 'div'>({
13
- className,
14
- ...props
15
- }: HStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof HStackProps<T>>) {
12
+ export function HStack<T extends ElementType = 'div'>({className, ...props}: HStackProps<T>) {
16
13
  return (
17
14
  <Flex
18
15
  className={clsx(hStackClassName, className)}
@@ -1,7 +1,10 @@
1
+ import type {ElementType} from 'react'
2
+
3
+ import type {Polymorphic} from '../../types/Polymorphic'
1
4
  import type {FlexProps} from '../flex/flex.props'
2
5
 
3
6
  /** @public */
4
- export interface HStackProps<T extends React.ElementType = 'div'> extends Pick<
5
- FlexProps<T>,
6
- 'as' | 'gap'
7
- > {}
7
+ export type HStackProps<T extends ElementType = 'div'> = Polymorphic<
8
+ T,
9
+ Pick<FlexProps<T>, 'as' | 'gap'>
10
+ >
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
3
2
 
3
+ import {type HeadingTag} from '../../types/Heading'
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
6
6
  import {type HeadingProps, headingProps} from './heading.props'
@@ -8,10 +8,7 @@ import {type HeadingProps, headingProps} from './heading.props'
8
8
  const headingClassName = suffixClassName('sui-Heading')
9
9
 
10
10
  /** @public */
11
- export function Heading<T extends ElementType = 'h2'>({
12
- size = 2,
13
- ...props
14
- }: HeadingProps & Omit<ComponentPropsWithRef<T>, keyof HeadingProps>) {
11
+ export function Heading<T extends HeadingTag = 'h2'>({size = 2, ...props}: HeadingProps<T>) {
15
12
  const {as, children, className, style, ...rest} = getProps({size, ...props}, headingProps)
16
13
  const Component = as || 'h2'
17
14
 
@@ -2,22 +2,27 @@ import {marginProps, type MarginProps} from '../../props/margin'
2
2
  import {toneProps, type ToneProps} from '../../props/tone'
3
3
  import {type TypographyProps, typographyProps} from '../../props/typography'
4
4
  import {HEADING_SIZE, HEADING_TAG, type HeadingSize, type HeadingTag} from '../../types/Heading'
5
- import {type PropDef} from '../../types/PropDef'
5
+ import type {Polymorphic} from '../../types/Polymorphic'
6
+ import type {PropDef} from '../../types/PropDef'
6
7
  import type {Responsive} from '../../types/Responsive'
7
8
 
8
9
  /** @public */
9
- export interface HeadingProps
10
- extends MarginProps, ToneProps, Omit<TypographyProps, 'muted' | 'weight'> {
11
- /**
12
- * Semantic heading element to render.
13
- */
14
- as: HeadingTag
15
- /**
16
- * Sets font size.
17
- * @remarks Independent of `as`.
18
- */
19
- size?: Responsive<HeadingSize>
20
- }
10
+ export type HeadingProps<T extends HeadingTag = HeadingTag> = Polymorphic<
11
+ T,
12
+ MarginProps &
13
+ ToneProps &
14
+ Omit<TypographyProps, 'muted' | 'weight'> & {
15
+ /**
16
+ * Semantic heading element to render.
17
+ */
18
+ as: T
19
+ /**
20
+ * Sets font size.
21
+ * @remarks Independent of `as`.
22
+ */
23
+ size?: Responsive<HeadingSize>
24
+ }
25
+ >
21
26
 
22
27
  export const headingProps: Record<string, PropDef> = {
23
28
  as: {
@@ -1,7 +1,9 @@
1
- import {type PropDef} from '../../types/PropDef'
1
+ import type {ComponentProps} from 'react'
2
+
3
+ import type {PropDef} from '../../types/PropDef'
2
4
 
3
5
  /** @public */
4
- export interface HotkeysProps extends React.ComponentProps<'kbd'> {
6
+ export interface HotkeysProps extends ComponentProps<'kbd'> {
5
7
  /**
6
8
  * The keys in the shortcut, in order. Each one renders as a KBD.
7
9
  */
@@ -1,10 +1,10 @@
1
- import type {ComponentProps, SVGProps} from 'react'
1
+ import type {ComponentProps, ComponentType, ReactElement, SVGProps} from 'react'
2
2
 
3
3
  import {type MarginProps, marginProps} from '../../props/margin'
4
4
  import {type ToneProps, toneProps} from '../../props/tone'
5
5
  import {type TypographyProps, typographyProps} from '../../props/typography'
6
6
  import {ICON_SIZE, type IconSize} from '../../types/Icon'
7
- import {type PropDef} from '../../types/PropDef'
7
+ import type {PropDef} from '../../types/PropDef'
8
8
  import type {Responsive} from '../../types/Responsive'
9
9
 
10
10
  /** @public */
@@ -13,7 +13,7 @@ export interface IconProps
13
13
  /**
14
14
  * The icon component to render.
15
15
  */
16
- icon: React.ComponentType<SVGProps<SVGSVGElement>> | React.ReactElement<SVGProps<SVGSVGElement>>
16
+ icon: ComponentType<SVGProps<SVGSVGElement>> | ReactElement<SVGProps<SVGSVGElement>>
17
17
  /**
18
18
  * Sets icon size.
19
19
  */
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
2
+ import type {ElementType} from 'react'
3
3
 
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -10,9 +10,7 @@ import {type IconButtonProps, iconButtonProps} from './iconButton.props'
10
10
  const iconButtonClassName = suffixClassName('sui-IconButton')
11
11
 
12
12
  /** @public */
13
- export function IconButton<T extends ElementType = 'button'>(
14
- props: IconButtonProps<T> & Omit<ComponentPropsWithRef<T>, keyof IconButtonProps<T>>,
15
- ) {
13
+ export function IconButton<T extends ElementType = 'button'>(props: IconButtonProps<T>) {
16
14
  const {as, className, style, icon: IconProp, ...rest} = getProps(props, iconButtonProps)
17
15
  const Component = as || 'button'
18
16
 
@@ -1,24 +1,24 @@
1
- import type {SVGProps} from 'react'
2
- import type React from 'react'
1
+ import type {ComponentType, ElementType, SVGProps} from 'react'
3
2
 
4
- import {type PropDef} from '../../types/PropDef'
3
+ import type {Polymorphic} from '../../types/Polymorphic'
4
+ import type {PropDef} from '../../types/PropDef'
5
5
  import {type ButtonProps, buttonProps} from '../button/button.props'
6
6
 
7
7
  /** @public */
8
- export interface IconButtonProps<T extends React.ElementType = 'button'> extends Pick<
9
- ButtonProps<T>,
10
- 'as' | 'density' | 'level' | 'loading' | 'tone'
11
- > {
12
- /**
13
- * Accessible name for the button.
14
- * @remarks Because IconButtons have no visible text, this is required.
15
- */
16
- 'aria-label': string
17
- /**
18
- * Icon to render.
19
- */
20
- 'icon': React.ComponentType<SVGProps<SVGSVGElement>>
21
- }
8
+ export type IconButtonProps<T extends ElementType = 'button'> = Polymorphic<
9
+ T,
10
+ Pick<ButtonProps<T>, 'as' | 'density' | 'level' | 'loading' | 'tone'> & {
11
+ /**
12
+ * Accessible name for the button.
13
+ * @remarks Because IconButtons have no visible text, this is required.
14
+ */
15
+ 'aria-label': string
16
+ /**
17
+ * Icon to render.
18
+ */
19
+ 'icon': ComponentType<SVGProps<SVGSVGElement>>
20
+ }
21
+ >
22
22
 
23
23
  export const iconButtonProps: Record<string, PropDef> = {
24
24
  'aria-label': {
@@ -24,6 +24,7 @@
24
24
  @import './popover/popover.css';
25
25
  @import './press-area/press-area.css';
26
26
  @import './radio/radio.css';
27
+ @import './search-input/search-input.css';
27
28
  @import './select/select.css';
28
29
  @import './spinner/spinner.css';
29
30
  @import './skip-to-content/skip-to-content.css';
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
2
+ import type {ElementType} from 'react'
3
3
 
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -12,7 +12,7 @@ const indicatorClassName = suffixClassName('sui-Indicator')
12
12
  export function Indicator<T extends ElementType = 'span'>({
13
13
  tone = 'neutral',
14
14
  ...props
15
- }: IndicatorProps<T> & Omit<ComponentPropsWithRef<T>, keyof IndicatorProps<T>>) {
15
+ }: IndicatorProps<T>) {
16
16
  const {as, children, className, style, label, ...rest} = getProps(
17
17
  {tone, ...props},
18
18
  indicatorProps,
@@ -1,17 +1,23 @@
1
+ import type {ElementType} from 'react'
2
+
1
3
  import {type ToneProps, toneProps} from '../../props/tone'
2
- import {type PropDef} from '../../types/PropDef'
4
+ import type {Polymorphic} from '../../types/Polymorphic'
5
+ import type {PropDef} from '../../types/PropDef'
3
6
 
4
7
  /** @beta */
5
- export interface IndicatorProps<T extends React.ElementType = 'span'> extends ToneProps {
6
- /**
7
- * HTML element to render.
8
- */
9
- as?: T
10
- /**
11
- * Accessible label.
12
- */
13
- label?: string
14
- }
8
+ export type IndicatorProps<T extends ElementType = 'span'> = Polymorphic<
9
+ T,
10
+ ToneProps & {
11
+ /**
12
+ * HTML element to render.
13
+ */
14
+ as?: T
15
+ /**
16
+ * Accessible label.
17
+ */
18
+ label?: string
19
+ }
20
+ >
15
21
 
16
22
  export const indicatorProps: Record<string, PropDef> = {
17
23
  as: {
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import type {ComponentPropsWithRef, ElementType} from 'react'
2
+ import type {ElementType} from 'react'
3
3
 
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -9,9 +9,7 @@ import {type IndicatorStackProps, indicatorStackProps} from './indicatorStack.pr
9
9
  const indicatorStackClassName = suffixClassName('sui-IndicatorStack')
10
10
 
11
11
  /** @public */
12
- export function IndicatorStack<T extends ElementType = 'div'>(
13
- props: IndicatorStackProps<T> & Omit<ComponentPropsWithRef<T>, keyof IndicatorStackProps<T>>,
14
- ) {
12
+ export function IndicatorStack<T extends ElementType = 'div'>(props: IndicatorStackProps<T>) {
15
13
  const {as, children, className, style, ...rest} = getProps(props, indicatorStackProps)
16
14
  const Component = as || 'div'
17
15
 
@@ -1,12 +1,18 @@
1
- import {type PropDef} from '../../types/PropDef'
1
+ import type {ElementType} from 'react'
2
+
3
+ import type {Polymorphic} from '../../types/Polymorphic'
4
+ import type {PropDef} from '../../types/PropDef'
2
5
 
3
6
  /** @public */
4
- export interface IndicatorStackProps<T extends React.ElementType = 'div'> {
5
- /**
6
- * HTML element to render.
7
- */
8
- as?: T
9
- }
7
+ export type IndicatorStackProps<T extends ElementType = 'div'> = Polymorphic<
8
+ T,
9
+ {
10
+ /**
11
+ * HTML element to render.
12
+ */
13
+ as?: T
14
+ }
15
+ >
10
16
 
11
17
  export const indicatorStackProps: Record<string, PropDef> = {
12
18
  as: {
@@ -1,5 +1,5 @@
1
1
  import clsx from 'clsx'
2
- import {Children, type ComponentPropsWithRef, type ElementType} from 'react'
2
+ import {Children, type ElementType} from 'react'
3
3
 
4
4
  import {getProps} from '../../utils/getProps'
5
5
  import {suffixClassName} from '../../utils/suffixClassName'
@@ -11,7 +11,7 @@ const inlineClassName = suffixClassName('sui-Inline')
11
11
  /** @public */
12
12
  export function Inline<T extends ElementType = 'div'>(
13
13
  // oxlint-disable-next-line no-deprecated
14
- props: InlineProps<T> & Omit<ComponentPropsWithRef<T>, keyof InlineProps<T>>,
14
+ props: InlineProps<T>,
15
15
  ) {
16
16
  const {as, children: childrenProp, className, style, ...rest} = getProps(props, inlineProps)
17
17
  const {className: childrenClassName} = getProps(props, inlineChildrenProps)
@@ -1,21 +1,27 @@
1
+ import type {ElementType} from 'react'
2
+
1
3
  import {marginProps} from '../../props/margin'
2
4
  import {type PaddingProps, paddingProps} from '../../props/padding'
3
- import {type PropDef} from '../../types/PropDef'
5
+ import type {Polymorphic} from '../../types/Polymorphic'
6
+ import type {PropDef} from '../../types/PropDef'
4
7
  import type {Responsive} from '../../types/Responsive'
5
8
  import {SPACE, type SpaceInherit} from '../../types/Space'
6
9
 
7
10
  /** @deprecated Use HStack component instead */
8
11
  /** @public */
9
- export interface InlineProps<T extends React.ElementType = 'div'> extends PaddingProps {
10
- /**
11
- * HTML element or component to render.
12
- */
13
- as?: T
14
- /**
15
- * Space between children.
16
- */
17
- gap?: Responsive<SpaceInherit>
18
- }
12
+ export type InlineProps<T extends ElementType = 'div'> = Polymorphic<
13
+ T,
14
+ PaddingProps & {
15
+ /**
16
+ * HTML element or component to render.
17
+ */
18
+ as?: T
19
+ /**
20
+ * Space between children.
21
+ */
22
+ gap?: Responsive<SpaceInherit>
23
+ }
24
+ >
19
25
 
20
26
  export const inlineProps: Record<string, PropDef> = {
21
27
  as: {
@@ -1,7 +1,9 @@
1
- import {type PropDef} from '../../types/PropDef'
1
+ import type {ComponentProps} from 'react'
2
+
3
+ import type {PropDef} from '../../types/PropDef'
2
4
 
3
5
  /** @public */
4
- export interface KBDProps extends React.ComponentProps<'kbd'> {
6
+ export interface KBDProps extends ComponentProps<'kbd'> {
5
7
  /**
6
8
  * Sets KBD's key label.
7
9
  */
@@ -1,7 +1,9 @@
1
- import {type PropDef} from '../../types/PropDef'
1
+ import type {ComponentProps} from 'react'
2
+
3
+ import type {PropDef} from '../../types/PropDef'
2
4
 
3
5
  /** @beta */
4
- export interface LinkProps extends React.ComponentProps<'a'> {
6
+ export interface LinkProps extends ComponentProps<'a'> {
5
7
  /**
6
8
  * Sets the link to `target="_blank"` and `rel="noopener noreferrer"`.
7
9
  */