@sanity/ui 5.0.0-alpha.24 → 5.0.0-alpha.25
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.
- package/dist/index.d.ts +136 -144
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -99
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/avatar/avatar.props.ts +4 -2
- package/src/components/avatar-counter/avatarCounter.props.ts +4 -2
- package/src/components/avatar-stack/avatarStack.props.ts +4 -2
- package/src/components/badge/Badge.tsx +2 -5
- package/src/components/badge/badge.props.ts +15 -15
- package/src/components/box/Box.tsx +2 -5
- package/src/components/box/box.props.ts +18 -12
- package/src/components/button/Button.tsx +2 -2
- package/src/components/button/button.props.ts +49 -43
- package/src/components/card/Card.tsx +2 -2
- package/src/components/card/card.props.ts +19 -13
- package/src/components/checkbox/checkbox.props.ts +4 -2
- package/src/components/code/code.props.ts +5 -3
- package/src/components/container/Container.tsx +2 -2
- package/src/components/container/container.props.ts +17 -11
- package/src/components/dialog/Dialog.tsx +10 -5
- package/src/components/dialog/dialog.props.ts +11 -3
- package/src/components/divider/divider.props.ts +4 -2
- package/src/components/eyebrow/Eyebrow.tsx +2 -5
- package/src/components/eyebrow/eyebrow.props.ts +19 -12
- package/src/components/flex/Flex.tsx +2 -5
- package/src/components/flex/flex.props.ts +19 -12
- package/src/components/grid/Grid.tsx +2 -5
- package/src/components/grid/grid.props.ts +20 -16
- package/src/components/h-stack/HStack.tsx +2 -5
- package/src/components/h-stack/hStack.props.ts +7 -4
- package/src/components/heading/Heading.tsx +2 -5
- package/src/components/heading/heading.props.ts +18 -13
- package/src/components/hotkeys/hotkeys.props.ts +4 -2
- package/src/components/icon/icon.props.ts +3 -3
- package/src/components/icon-button/IconButton.tsx +2 -4
- package/src/components/icon-button/iconButton.props.ts +17 -17
- package/src/components/indicator/Indicator.tsx +2 -2
- package/src/components/indicator/indicator.props.ts +17 -11
- package/src/components/indicator-stack/IndicatorStack.tsx +2 -4
- package/src/components/indicator-stack/indicatorStack.props.ts +13 -7
- package/src/components/inline/Inline.tsx +2 -2
- package/src/components/inline/inline.props.ts +17 -11
- package/src/components/kbd/kbd.props.ts +4 -2
- package/src/components/link/link.props.ts +4 -2
- package/src/components/list/List.tsx +47 -97
- package/src/components/list/list.css +28 -9
- package/src/components/list/list.props.ts +59 -68
- package/src/components/popover/popover.props.ts +7 -5
- package/src/components/press-area/PressArea.tsx +2 -4
- package/src/components/press-area/press-area.css +9 -3
- package/src/components/press-area/pressArea.props.ts +13 -7
- package/src/components/radio/radio.props.ts +2 -1
- package/src/components/select/select.props.ts +4 -2
- package/src/components/skip-to-content/skipToContent.props.ts +4 -2
- package/src/components/spinner/spinner.props.ts +4 -2
- package/src/components/switch/switch.props.ts +4 -2
- package/src/components/tabs/tabs.props.ts +8 -9
- package/src/components/text/Text.tsx +2 -5
- package/src/components/text/text.props.ts +19 -12
- package/src/components/text-area/textArea.props.ts +4 -5
- package/src/components/text-input/textInput.props.ts +5 -3
- package/src/components/tooltip/tooltip.props.ts +7 -5
- package/src/components/tooltip-group/TooltipGroup.tsx +2 -4
- package/src/components/tooltip-group/tooltipGroup.props.ts +13 -7
- package/src/components/v-stack/VStack.tsx +2 -5
- package/src/components/v-stack/vStack.props.ts +7 -4
- package/src/components/visually-hidden/VisuallyHidden.tsx +2 -4
- package/src/components/visually-hidden/visuallyHidden.props.ts +17 -11
- package/src/types/Interactive.ts +3 -1
- package/src/types/Polymorphic.ts +9 -0
- package/src/version.ts +2 -2
|
@@ -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
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 {
|
|
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
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
GridParentProps
|
|
14
|
-
GapProps
|
|
15
|
-
LayoutProps {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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 {
|
|
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
|
|
5
|
-
|
|
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
|
|
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
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
3
|
+
import type {PropDef} from '../../types/PropDef'
|
|
2
4
|
|
|
3
5
|
/** @public */
|
|
4
|
-
export interface HotkeysProps extends
|
|
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
|
|
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:
|
|
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 {
|
|
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
|
|
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
|
|
9
|
-
|
|
10
|
-
'as' | 'density' | 'level' | 'loading' | 'tone'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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': {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx'
|
|
2
|
-
import type {
|
|
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>
|
|
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
|
|
4
|
+
import type {Polymorphic} from '../../types/Polymorphic'
|
|
5
|
+
import type {PropDef} from '../../types/PropDef'
|
|
3
6
|
|
|
4
7
|
/** @beta */
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 {
|
|
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
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
3
|
+
import type {PropDef} from '../../types/PropDef'
|
|
2
4
|
|
|
3
5
|
/** @public */
|
|
4
|
-
export interface KBDProps extends
|
|
6
|
+
export interface KBDProps extends ComponentProps<'kbd'> {
|
|
5
7
|
/**
|
|
6
8
|
* Sets KBD's key label.
|
|
7
9
|
*/
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {ComponentProps} from 'react'
|
|
2
|
+
|
|
3
|
+
import type {PropDef} from '../../types/PropDef'
|
|
2
4
|
|
|
3
5
|
/** @beta */
|
|
4
|
-
export interface LinkProps extends
|
|
6
|
+
export interface LinkProps extends ComponentProps<'a'> {
|
|
5
7
|
/**
|
|
6
8
|
* Sets the link to `target="_blank"` and `rel="noopener noreferrer"`.
|
|
7
9
|
*/
|