@sanity/ui 5.0.0-alpha.6 → 5.0.0-alpha.8

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 (47) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/install.js +2 -1
  3. package/dist/index.d.ts +285 -116
  4. package/dist/index.js +177 -174
  5. package/dist/index.js.map +1 -1
  6. package/dist/styles.css +1 -1
  7. package/package.json +2 -2
  8. package/src/cli/install.ts +2 -1
  9. package/src/components/box/box.props.ts +7 -2
  10. package/src/components/button/button.props.ts +27 -9
  11. package/src/components/card/card.props.ts +6 -2
  12. package/src/components/checkbox/Checkbox.tsx +2 -1
  13. package/src/components/checkbox/checkbox.props.ts +11 -3
  14. package/src/components/code/code.props.ts +10 -3
  15. package/src/components/container/container.props.ts +6 -2
  16. package/src/components/{modal/Modal.tsx → dialog/Dialog.tsx} +28 -28
  17. package/src/components/{modal/modal.css → dialog/dialog.css} +11 -11
  18. package/src/components/dialog/dialog.props.ts +38 -0
  19. package/src/components/eyebrow/eyebrow.props.ts +6 -2
  20. package/src/components/flex/flex.props.ts +6 -2
  21. package/src/components/grid/grid.props.ts +6 -2
  22. package/src/components/h-stack/hStack.props.ts +3 -1
  23. package/src/components/heading/heading.props.ts +8 -2
  24. package/src/components/icon/icon.props.ts +6 -2
  25. package/src/components/icon-button/iconButton.props.ts +7 -2
  26. package/src/components/index.css +1 -1
  27. package/src/components/indicator/indicator.props.ts +6 -2
  28. package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
  29. package/src/components/inline/inline.props.ts +6 -2
  30. package/src/components/label/label.props.ts +7 -1
  31. package/src/components/link/link.props.ts +4 -4
  32. package/src/components/list/list.props.ts +27 -9
  33. package/src/components/popover/popover.props.ts +14 -4
  34. package/src/components/press-area/pressArea.props.ts +3 -1
  35. package/src/components/radio/radio.props.ts +7 -2
  36. package/src/components/skip-to-content/skipToContent.props.ts +9 -3
  37. package/src/components/spinner/Spinner.tsx +1 -1
  38. package/src/components/spinner/spinner.props.ts +3 -0
  39. package/src/components/switch/switch.props.ts +7 -2
  40. package/src/components/text/text.props.ts +6 -2
  41. package/src/components/tooltip/tooltip.props.ts +12 -4
  42. package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
  43. package/src/components/v-stack/vStack.props.ts +3 -1
  44. package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
  45. package/src/index.ts +1 -1
  46. package/src/version.ts +2 -2
  47. package/src/components/modal/modal.props.ts +0 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/ui",
3
- "version": "5.0.0-alpha.6",
3
+ "version": "5.0.0-alpha.8",
4
4
  "description": "Sanity UI Library",
5
5
  "keywords": [
6
6
  "components",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@sanity-labs/design-tokens": "0.0.2-alpha.4",
52
- "@sanity/icons": "^3.7.4",
52
+ "@sanity/icons": "^5.2.1",
53
53
  "clsx": "^2.1.1",
54
54
  "comment-json": "^5.0.0",
55
55
  "dialog-closedby-polyfill": "^1.3.0",
@@ -36,7 +36,8 @@ function exactFromRange(range: string | undefined): string | null {
36
36
  *
37
37
  * Icons is already a dependency, so the package manager installs it either way.
38
38
  * It is listed explicitly because apps import icons directly to pass to
39
- * components (`<Button iconStart={AddIcon} />`), and under pnpm an import that
39
+ * components (`import {AddIcon} from '@sanity/icons/Add'`, then
40
+ * `<Button iconStart={AddIcon} />`), and under pnpm an import that
40
41
  * isn't in the app's own package.json doesn't resolve. Dependencies the app
41
42
  * never imports itself (react-refractor, clsx) are left to the package manager.
42
43
  * React/react-dom are peers that belong to the host app, so they are left out
@@ -5,9 +5,14 @@ import type {Responsive} from '../../types/Responsive'
5
5
 
6
6
  /** @public */
7
7
  export interface BoxProps<T extends React.ElementType = 'div'> extends LayoutProps {
8
- /** Element to render */
8
+ /**
9
+ * HTML element or component to render.
10
+ */
9
11
  as?: T
10
- /** CSS **display** property */
12
+ /**
13
+ * CSS `display` property.
14
+ * @remarks Does not include `'flex'` or `'grid'`. Use the Flex or Grid components for those.
15
+ */
11
16
  display?: Responsive<DisplayBlock>
12
17
  }
13
18
 
@@ -16,23 +16,41 @@ import type {Responsive} from '../../types/Responsive'
16
16
 
17
17
  /** @public */
18
18
  export interface ButtonProps<T extends React.ElementType = 'button'> {
19
- /** Element to render */
19
+ /**
20
+ * HTML element to render.
21
+ */
20
22
  as?: InteractiveAs<T>
21
- /** Composite prop for setting padding and gap */
23
+ /**
24
+ * Sets padding and gap together to specify size.
25
+ */
22
26
  density?: ButtonDensity
23
- /** Set CSS **width** property to 100% */
27
+ /**
28
+ * Sets Button to fill the width of its container.
29
+ */
24
30
  fullWidth?: Responsive<boolean>
25
- /** Starting icon */
31
+ /**
32
+ * Shows an icon in the start position (left side in left-to-right languages).
33
+ */
26
34
  iconStart?: React.ElementType | React.ReactNode
27
- /** Ending icon */
35
+ /**
36
+ * Shows an icon in the end position (right side in left-to-right languages).
37
+ */
28
38
  iconEnd?: React.ElementType | React.ReactNode
29
- /** Button level */
39
+ /**
40
+ * Sets the importance of Button's action.
41
+ */
30
42
  level?: ButtonLevel
31
- /** Loading state */
43
+ /**
44
+ * Places Button into a loading state.
45
+ */
32
46
  loading?: boolean
33
- /** Button text */
47
+ /**
48
+ * Sets Button's text label.
49
+ */
34
50
  text?: string
35
- /** Button tone */
51
+ /**
52
+ * Sets Button's semantic meaning and related color.
53
+ */
36
54
  tone?: ButtonTone
37
55
  }
38
56
 
@@ -9,9 +9,13 @@ import {type Responsive} from '../../types/Responsive'
9
9
 
10
10
  /** @public */
11
11
  export interface CardProps<T extends React.ElementType = 'div'> extends MarginProps, ToneProps {
12
- /** Element to render */
12
+ /**
13
+ * HTML element or component to render.
14
+ */
13
15
  as?: T
14
- /** Composite prop for setting padding and border radius */
16
+ /**
17
+ * Sets padding, gap, and border-radius together to specify size. This prop is used in place of separate `padding`, `gap`, and `border-radius` props.
18
+ */
15
19
  density?: Responsive<Density>
16
20
  }
17
21
 
@@ -1,4 +1,5 @@
1
- import {CheckmarkIcon, RemoveIcon} from '@sanity/icons'
1
+ import {CheckmarkIcon} from '@sanity/icons/Checkmark'
2
+ import {RemoveIcon} from '@sanity/icons/Remove'
2
3
  import clsx from 'clsx'
3
4
  import {useEffect, useRef} from 'react'
4
5
 
@@ -3,11 +3,19 @@ import {type PropDef} from '../../types/PropDef'
3
3
 
4
4
  /** @beta */
5
5
  export interface CheckboxProps extends React.ComponentProps<'input'>, MarginProps {
6
- /** Error state */
6
+ /**
7
+ * Applies error styling to the checkbox mark.
8
+ * @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
9
+ */
7
10
  error?: boolean
8
- /** Indeterminate state */
11
+ /**
12
+ * Renders the "mixed state" mark (a horizontal line).
13
+ * @remarks Use when the checkbox controls a group with some-but-not-all children checked.
14
+ */
9
15
  indeterminate?: boolean
10
- /** Input label */
16
+ /**
17
+ * Visible label next to the checkbox.
18
+ */
11
19
  label: React.ReactNode
12
20
  }
13
21
 
@@ -9,11 +9,18 @@ export interface CodeProps<T extends CodeTag = 'pre'> extends Omit<
9
9
  TypographyProps,
10
10
  'align' | 'truncate' | 'tone'
11
11
  > {
12
- /** Element to render */
12
+ /**
13
+ * HTML element or component to render.
14
+ * @remarks The defined element wraps an inner `<code>` tag.
15
+ */
13
16
  as?: T
14
- /** Refractor language for syntax highlighting */
17
+ /**
18
+ * Refractor language for syntax highlighting.
19
+ */
15
20
  language?: string
16
- /** CSS **font-size** property */
21
+ /**
22
+ * Sets font size.
23
+ */
17
24
  size?: Responsive<CodeSize>
18
25
  }
19
26
 
@@ -5,9 +5,13 @@ import type {Responsive} from '../../types/Responsive'
5
5
 
6
6
  /** @public */
7
7
  export interface ContainerProps<T extends React.ElementType = 'div'> extends LayoutProps {
8
- /** Element to render */
8
+ /**
9
+ * HTML element or component to render.
10
+ */
9
11
  as?: T
10
- /** CSS **max-width** property */
12
+ /**
13
+ * Maximum width of the container.
14
+ */
11
15
  size?: Responsive<ContainerSize>
12
16
  }
13
17
 
@@ -1,4 +1,4 @@
1
- import {CloseIcon} from '@sanity/icons'
1
+ import {CloseIcon} from '@sanity/icons/Close'
2
2
  import clsx from 'clsx'
3
3
  import {type ComponentProps, useEffect, useId, useRef} from 'react'
4
4
 
@@ -8,28 +8,28 @@ import {Box} from '../box/Box'
8
8
  import {Flex} from '../flex/Flex'
9
9
  import {Heading} from '../heading/Heading'
10
10
  import {IconButton} from '../icon-button/IconButton'
11
- import {type ModalProps, modalProps} from './modal.props'
11
+ import {type DialogProps, dialogProps} from './dialog.props'
12
12
 
13
- const modalClassName = suffixClassName('sui-Modal')
14
- const modalContentClassName = suffixClassName('sui-ModalContent')
15
- const modalFooterClassName = suffixClassName('sui-ModalFooter')
13
+ const dialogClassName = suffixClassName('sui-Dialog')
14
+ const dialogContentClassName = suffixClassName('sui-DialogContent')
15
+ const dialogFooterClassName = suffixClassName('sui-DialogFooter')
16
16
 
17
- function ModalRoot({open = false, size = 0, ...props}: ModalProps) {
17
+ function DialogRoot({open = false, size = 0, ...props}: DialogProps) {
18
18
  const {children, className, style, header, onClose, ...rest} = getProps(
19
19
  {size, ...props},
20
- modalProps,
20
+ dialogProps,
21
21
  )
22
22
 
23
- const modalRef = useRef<HTMLDialogElement>(null)
23
+ const dialogRef = useRef<HTMLDialogElement>(null)
24
24
  const headerId = useId()
25
25
 
26
- const modalClasses = clsx(
27
- modalClassName,
26
+ const dialogClasses = clsx(
27
+ dialogClassName,
28
28
  'sui-inset0 sui-m-auto sui-radius5 sui-shadow3 sui-p4 sui-flex-direction-column sui-gap4 sui-overflow-y-auto',
29
29
  )
30
30
 
31
31
  useEffect(() => {
32
- const dialogElement = modalRef.current
32
+ const dialogElement = dialogRef.current
33
33
  if (!dialogElement) return
34
34
 
35
35
  // `open` = `open` prop
@@ -46,7 +46,7 @@ function ModalRoot({open = false, size = 0, ...props}: ModalProps) {
46
46
  }
47
47
  }
48
48
 
49
- // Ensure the modal is closed (and thus its `open` attribute updated)
49
+ // Ensure the dialog is closed (and thus its `open` attribute updated)
50
50
  // when the component is unmounted.
51
51
  return () => {
52
52
  dialogElement.close()
@@ -56,13 +56,13 @@ function ModalRoot({open = false, size = 0, ...props}: ModalProps) {
56
56
  return (
57
57
  <dialog
58
58
  {...rest}
59
- ref={modalRef}
59
+ ref={dialogRef}
60
60
  closedby="any"
61
61
  aria-labelledby={header ? headerId : undefined}
62
62
  onClose={onClose}
63
- className={clsx(modalClasses, className)}
63
+ className={clsx(dialogClasses, className)}
64
64
  style={style}
65
- data-ui="Modal"
65
+ data-ui="Dialog"
66
66
  >
67
67
  <Flex flexShrink={0} justifyContent="space-between" alignItems="center">
68
68
  {header ? (
@@ -76,7 +76,7 @@ function ModalRoot({open = false, size = 0, ...props}: ModalProps) {
76
76
  aria-label="Close"
77
77
  level="tertiary"
78
78
  icon={CloseIcon}
79
- onClick={() => modalRef.current?.close()}
79
+ onClick={() => dialogRef.current?.close()}
80
80
  />
81
81
  </Flex>
82
82
  {children}
@@ -84,15 +84,15 @@ function ModalRoot({open = false, size = 0, ...props}: ModalProps) {
84
84
  )
85
85
  }
86
86
 
87
- function ModalContent(props: ComponentProps<'div'>) {
87
+ function DialogContent(props: ComponentProps<'div'>) {
88
88
  const {children, className, style, ...rest} = getProps(props, {})
89
89
 
90
90
  return (
91
91
  <Box
92
92
  {...rest}
93
- className={clsx(modalContentClassName, className)}
93
+ className={clsx(dialogContentClassName, className)}
94
94
  style={style}
95
- data-ui="ModalContent"
95
+ data-ui="DialogContent"
96
96
  flexGrow={1}
97
97
  overflowY="auto"
98
98
  >
@@ -101,15 +101,15 @@ function ModalContent(props: ComponentProps<'div'>) {
101
101
  )
102
102
  }
103
103
 
104
- function ModalFooter(props: ComponentProps<'div'>) {
104
+ function DialogFooter(props: ComponentProps<'div'>) {
105
105
  const {children, className, style, ...rest} = getProps(props, {})
106
106
 
107
107
  return (
108
108
  <Box
109
109
  {...rest}
110
- className={clsx(modalFooterClassName, className)}
110
+ className={clsx(dialogFooterClassName, className)}
111
111
  style={style}
112
- data-ui="ModalFooter"
112
+ data-ui="DialogFooter"
113
113
  flexShrink={0}
114
114
  >
115
115
  {children}
@@ -117,7 +117,7 @@ function ModalFooter(props: ComponentProps<'div'>) {
117
117
  )
118
118
  }
119
119
 
120
- ModalRoot.displayName = 'Modal'
120
+ DialogRoot.displayName = 'Dialog'
121
121
 
122
122
  /**
123
123
  * @beta
@@ -126,14 +126,14 @@ ModalRoot.displayName = 'Modal'
126
126
  * Modal dialogs make their containing documents inert, and render on the topmost
127
127
  * layer within that containing document; they must be dimissed before the containing
128
128
  * document and its contents become unblocked. They also trap focus within the bounds
129
- * of the modal element and its descendants.
129
+ * of the dialog element and its descendants.
130
130
  *
131
131
  * For more on dialogs and modality, refer to the HTML specification for the dialog element:
132
132
  * https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element
133
133
  */
134
- export const Modal = ModalRoot
134
+ export const Dialog = DialogRoot
135
135
 
136
- ModalRoot.Content = ModalContent
137
- ModalRoot.Footer = ModalFooter
136
+ DialogRoot.Content = DialogContent
137
+ DialogRoot.Footer = DialogFooter
138
138
 
139
- export type {ModalProps}
139
+ export type {DialogProps}
@@ -1,5 +1,5 @@
1
- .sui-Modal {
2
- /* Computed width is moderated by Modal's size prop, which controls max-width */
1
+ .sui-Dialog {
2
+ /* Computed width is moderated by Dialog's size prop, which controls max-width */
3
3
  width: calc(100dvw - 2rem);
4
4
  max-height: calc(100dvh - 2rem);
5
5
  transition:
@@ -9,41 +9,41 @@
9
9
  scale 150ms var(--timing-curve);
10
10
  }
11
11
 
12
- .sui-Modal:not([open]) {
12
+ .sui-Dialog:not([open]) {
13
13
  opacity: 0;
14
14
  scale: 0.9;
15
15
  }
16
16
 
17
- .sui-Modal[open] {
17
+ .sui-Dialog[open] {
18
18
  display: flex;
19
19
  opacity: 1;
20
20
  scale: 1;
21
21
  }
22
22
 
23
- .sui-Modal::backdrop {
24
- --modal-backdrop: hsl(from var(--separator-high) h s l / var(--overlay-opacity));
25
- background-color: var(--modal-backdrop);
23
+ .sui-Dialog::backdrop {
24
+ --dialog-backdrop: hsl(from var(--separator-high) h s l / var(--overlay-opacity));
25
+ background-color: var(--dialog-backdrop);
26
26
  transition:
27
27
  display 150ms allow-discrete,
28
28
  overlay 150ms allow-discrete,
29
29
  opacity 150ms var(--timing-linear);
30
30
  }
31
31
 
32
- .sui-Modal:not([open])::backdrop {
32
+ .sui-Dialog:not([open])::backdrop {
33
33
  opacity: 0;
34
34
  }
35
35
 
36
- .sui-Modal[open]::backdrop {
36
+ .sui-Dialog[open]::backdrop {
37
37
  opacity: 1;
38
38
  }
39
39
 
40
40
  @starting-style {
41
- .sui-Modal[open] {
41
+ .sui-Dialog[open] {
42
42
  opacity: 0;
43
43
  scale: 0.9;
44
44
  }
45
45
 
46
- .sui-Modal[open]::backdrop {
46
+ .sui-Dialog[open]::backdrop {
47
47
  opacity: 0;
48
48
  }
49
49
  }
@@ -0,0 +1,38 @@
1
+ import {CONTAINER_SIZE, type ContainerSize} from '../../types/Container'
2
+ import {type PropDef} from '../../types/PropDef'
3
+ import type {Responsive} from '../../types/Responsive'
4
+
5
+ /** @beta */
6
+ export interface DialogProps extends Omit<React.ComponentProps<'dialog'>, 'open'> {
7
+ /**
8
+ * Text for the dialog heading.
9
+ * @remarks Recommended for accessibility. The component sets `aria-labelledby` to the heading when you give this prop.
10
+ */
11
+ header?: string
12
+ /**
13
+ * A function to call alongside the native `close` event.
14
+ * @remarks Use it to set `open` back to `false`. It runs for every close cause: the Escape key, a backdrop click, the close button, or a programmatic close.
15
+ */
16
+ onClose: React.ReactEventHandler<HTMLDialogElement>
17
+ /**
18
+ * Toggles the dialog's open state.
19
+ * @remarks `true` calls `showModal()` on the element. `false` calls `close()`.
20
+ */
21
+ open?: boolean
22
+ /** Sets the max width of the dialog */
23
+ size?: Responsive<ContainerSize>
24
+ }
25
+
26
+ export const dialogProps: Record<string, PropDef> = {
27
+ header: {
28
+ type: 'string',
29
+ },
30
+ open: {
31
+ type: 'boolean',
32
+ },
33
+ size: {
34
+ type: 'union',
35
+ className: 'container',
36
+ values: CONTAINER_SIZE,
37
+ },
38
+ }
@@ -5,9 +5,13 @@ import type {Responsive} from '../../types/Responsive'
5
5
 
6
6
  /** @public */
7
7
  export interface EyebrowProps<T extends React.ElementType = 'span'> extends TypographyProps {
8
- /** Element to render */
8
+ /**
9
+ * HTML element to render.
10
+ */
9
11
  as?: T
10
- /** CSS **font-size** property */
12
+ /**
13
+ * Sets font size. Uses the same scale as Label.
14
+ */
11
15
  size?: Responsive<EyebrowSize>
12
16
  }
13
17
 
@@ -8,9 +8,13 @@ import type {Responsive} from '../../types/Responsive'
8
8
  /** @public */
9
9
  export interface FlexProps<T extends React.ElementType = 'div'>
10
10
  extends FlexParentProps, GapProps, LayoutProps {
11
- /** Element to render */
11
+ /**
12
+ * HTML element or component to render.
13
+ */
12
14
  as?: T
13
- /** CSS **display** property */
15
+ /**
16
+ * CSS `display` property.
17
+ */
14
18
  display?: Responsive<DisplayFlex>
15
19
  }
16
20
 
@@ -8,9 +8,13 @@ import type {Responsive} from '../../types/Responsive'
8
8
  /** @public */
9
9
  export interface GridProps<T extends React.ElementType = 'div'>
10
10
  extends GridParentProps, GapProps, LayoutProps {
11
- /** Element to render */
11
+ /**
12
+ * HTML element or component to render.
13
+ */
12
14
  as?: T
13
- /** CSS **display** property */
15
+ /**
16
+ * CSS `display` property.
17
+ */
14
18
  display?: Responsive<DisplayGrid>
15
19
  }
16
20
 
@@ -3,7 +3,9 @@ import {type PropDef} from '../../types/PropDef'
3
3
 
4
4
  /** @public */
5
5
  export interface HStackProps<T extends React.ElementType = 'div'> extends Pick<GapProps, 'gap'> {
6
- /** Element to render */
6
+ /**
7
+ * HTML element or component to render.
8
+ */
7
9
  as?: T
8
10
  }
9
11
 
@@ -5,9 +5,15 @@ import type {Responsive} from '../../types/Responsive'
5
5
 
6
6
  /** @public */
7
7
  export interface HeadingProps extends TypographyProps {
8
- /** Element to render */
8
+ /**
9
+ * Semantic heading element to render.
10
+ * @remarks Always set this explicitly.
11
+ */
9
12
  as?: HeadingTag
10
- /** CSS **font-size** property */
13
+ /**
14
+ * Sets font size.
15
+ * @remarks Independent of `as`.
16
+ */
11
17
  size?: Responsive<HeadingSize>
12
18
  }
13
19
 
@@ -10,9 +10,13 @@ import type {Responsive} from '../../types/Responsive'
10
10
  /** @public */
11
11
  export interface IconProps
12
12
  extends ComponentProps<'svg'>, Pick<TypographyProps, 'muted'>, MarginProps, ToneProps {
13
- /** Icon to render */
13
+ /**
14
+ * The icon component to render.
15
+ */
14
16
  icon: React.ComponentType<SVGProps<SVGSVGElement>>
15
- /** CSS **font-size** property */
17
+ /**
18
+ * Sets icon size.
19
+ */
16
20
  size?: Responsive<IconSize>
17
21
  }
18
22
 
@@ -9,9 +9,14 @@ export interface IconButtonProps<T extends React.ElementType = 'button'> extends
9
9
  ButtonProps<T>,
10
10
  'as' | 'density' | 'level' | 'loading' | 'tone'
11
11
  > {
12
- /** Button label */
12
+ /**
13
+ * Accessible name for the button.
14
+ * @remarks Because IconButtons have no visible text, this is required.
15
+ */
13
16
  'aria-label': string
14
- /** Icon */
17
+ /**
18
+ * Icon to render.
19
+ */
15
20
  'icon': React.ComponentType<SVGProps<SVGSVGElement>>
16
21
  }
17
22
 
@@ -4,6 +4,7 @@
4
4
  @import './checkbox/checkbox.css';
5
5
  @import './code/code.css';
6
6
  @import './container/container.css';
7
+ @import './dialog/dialog.css';
7
8
  @import './eyebrow/eyebrow.css';
8
9
  @import './flex/flex.css';
9
10
  @import './grid/grid.css';
@@ -15,7 +16,6 @@
15
16
  @import './label/label.css';
16
17
  @import './link/link.css';
17
18
  @import './list/list.css';
18
- @import './modal/modal.css';
19
19
  @import './popover/popover.css';
20
20
  @import './press-area/press-area.css';
21
21
  @import './radio/radio.css';
@@ -3,9 +3,13 @@ import {type PropDef} from '../../types/PropDef'
3
3
 
4
4
  /** @beta */
5
5
  export interface IndicatorProps<T extends React.ElementType = 'span'> extends ToneProps {
6
- /** Element to render */
6
+ /**
7
+ * HTML element to render.
8
+ */
7
9
  as?: T
8
- /** Label for aria-label attribute */
10
+ /**
11
+ * Accessible label.
12
+ */
9
13
  label?: string
10
14
  }
11
15
 
@@ -2,7 +2,9 @@ import {type PropDef} from '../../types/PropDef'
2
2
 
3
3
  /** @public */
4
4
  export interface IndicatorStackProps<T extends React.ElementType = 'div'> {
5
- /** Element to render */
5
+ /**
6
+ * HTML element to render.
7
+ */
6
8
  as?: T
7
9
  }
8
10
 
@@ -7,9 +7,13 @@ import {SPACE, type SpaceInherit} from '../../types/Space'
7
7
  /** @deprecated Use HStack component instead */
8
8
  /** @public */
9
9
  export interface InlineProps<T extends React.ElementType = 'div'> extends PaddingProps {
10
- /** Element to render */
10
+ /**
11
+ * HTML element or component to render.
12
+ */
11
13
  as?: T
12
- /** CSS **gap** property */
14
+ /**
15
+ * Space between children.
16
+ */
13
17
  gap?: Responsive<SpaceInherit>
14
18
  }
15
19
 
@@ -3,8 +3,14 @@ import {type PropDef} from '../../types/PropDef'
3
3
 
4
4
  /** @beta */
5
5
  export interface LabelProps extends React.ComponentProps<'label'>, MarginProps {
6
- /** Element to render */
6
+ /**
7
+ * Renders the label in a muted color.
8
+ */
7
9
  disabled?: boolean
10
+ /**
11
+ * Renders the label in the error color.
12
+ * @remarks Use when the linked input has a validation error.
13
+ */
8
14
  error?: boolean
9
15
  }
10
16
 
@@ -2,12 +2,12 @@ import {type PropDef} from '../../types/PropDef'
2
2
 
3
3
  /** @beta */
4
4
  export interface LinkProps extends React.ComponentProps<'a'> {
5
- /** If true, sets `target="_blank"` and `rel="noopener noreferrer"` */
5
+ /**
6
+ * Sets the link to `target="_blank"` and `rel="noopener noreferrer"`.
7
+ */
6
8
  openInNewTab?: boolean
7
9
  /**
8
- * If true, sets `text-decoration: underline`
9
- *
10
- * @defaultValue true
10
+ * Underlines the link.
11
11
  */
12
12
  underlined?: boolean
13
13
  }