@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/README.md CHANGED
@@ -46,7 +46,7 @@ import '@sanity/ui/styles.css'
46
46
 
47
47
  ```tsx
48
48
  import {Box, Flex, Card, Heading, Text, Button} from '@sanity/ui'
49
- import {AddIcon} from '@sanity/icons'
49
+ import {AddIcon} from '@sanity/icons/Add'
50
50
 
51
51
  export default function App() {
52
52
  return (
@@ -23,7 +23,8 @@ function exactFromRange(range) {
23
23
  *
24
24
  * Icons is already a dependency, so the package manager installs it either way.
25
25
  * It is listed explicitly because apps import icons directly to pass to
26
- * components (`<Button iconStart={AddIcon} />`), and under pnpm an import that
26
+ * components (`import {AddIcon} from '@sanity/icons/Add'`, then
27
+ * `<Button iconStart={AddIcon} />`), and under pnpm an import that
27
28
  * isn't in the app's own package.json doesn't resolve. Dependencies the app
28
29
  * never imports itself (react-refractor, clsx) are left to the package manager.
29
30
  * React/react-dom are peers that belong to the host app, so they are left out
package/dist/index.d.ts CHANGED
@@ -44,9 +44,14 @@ export declare function Box<T extends ElementType = "div">({
44
44
  export declare interface BoxProps<
45
45
  T extends React.ElementType = "div",
46
46
  > extends LayoutProps {
47
- /** Element to render */
47
+ /**
48
+ * HTML element or component to render.
49
+ */
48
50
  as?: T;
49
- /** CSS **display** property */
51
+ /**
52
+ * CSS `display` property.
53
+ * @remarks Does not include `'flex'` or `'grid'`. Use the Flex or Grid components for those.
54
+ */
50
55
  display?: Responsive<DisplayBlock>;
51
56
  }
52
57
 
@@ -71,23 +76,41 @@ declare type ButtonLevel = (typeof BUTTON_LEVEL)[number];
71
76
 
72
77
  /** @public */
73
78
  export declare interface ButtonProps<T extends React.ElementType = "button"> {
74
- /** Element to render */
79
+ /**
80
+ * HTML element to render.
81
+ */
75
82
  as?: InteractiveAs<T>;
76
- /** Composite prop for setting padding and gap */
83
+ /**
84
+ * Sets padding and gap together to specify size.
85
+ */
77
86
  density?: ButtonDensity;
78
- /** Set CSS **width** property to 100% */
87
+ /**
88
+ * Sets Button to fill the width of its container.
89
+ */
79
90
  fullWidth?: Responsive<boolean>;
80
- /** Starting icon */
91
+ /**
92
+ * Shows an icon in the start position (left side in left-to-right languages).
93
+ */
81
94
  iconStart?: React.ElementType | React.ReactNode;
82
- /** Ending icon */
95
+ /**
96
+ * Shows an icon in the end position (right side in left-to-right languages).
97
+ */
83
98
  iconEnd?: React.ElementType | React.ReactNode;
84
- /** Button level */
99
+ /**
100
+ * Sets the importance of Button's action.
101
+ */
85
102
  level?: ButtonLevel;
86
- /** Loading state */
103
+ /**
104
+ * Places Button into a loading state.
105
+ */
87
106
  loading?: boolean;
88
- /** Button text */
107
+ /**
108
+ * Sets Button's text label.
109
+ */
89
110
  text?: string;
90
- /** Button tone */
111
+ /**
112
+ * Sets Button's semantic meaning and related color.
113
+ */
91
114
  tone?: ButtonTone;
92
115
  }
93
116
 
@@ -104,9 +127,13 @@ export declare function Card<T extends ElementType = "div">({
104
127
  /** @public */
105
128
  export declare interface CardProps<T extends React.ElementType = "div">
106
129
  extends MarginProps, ToneProps {
107
- /** Element to render */
130
+ /**
131
+ * HTML element or component to render.
132
+ */
108
133
  as?: T;
109
- /** Composite prop for setting padding and border radius */
134
+ /**
135
+ * Sets padding, gap, and border-radius together to specify size. This prop is used in place of separate `padding`, `gap`, and `border-radius` props.
136
+ */
110
137
  density?: Responsive<Density>;
111
138
  }
112
139
 
@@ -116,11 +143,19 @@ export declare function Checkbox(props: CheckboxProps): JSX.Element;
116
143
  /** @beta */
117
144
  export declare interface CheckboxProps
118
145
  extends React.ComponentProps<"input">, MarginProps {
119
- /** Error state */
146
+ /**
147
+ * Applies error styling to the checkbox mark.
148
+ * @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
149
+ */
120
150
  error?: boolean;
121
- /** Indeterminate state */
151
+ /**
152
+ * Renders the "mixed state" mark (a horizontal line).
153
+ * @remarks Use when the checkbox controls a group with some-but-not-all children checked.
154
+ */
122
155
  indeterminate?: boolean;
123
- /** Input label */
156
+ /**
157
+ * Visible label next to the checkbox.
158
+ */
124
159
  label: React.ReactNode;
125
160
  }
126
161
 
@@ -140,11 +175,18 @@ export declare interface CodeProps<T extends CodeTag = "pre"> extends Omit<
140
175
  TypographyProps,
141
176
  "align" | "truncate" | "tone"
142
177
  > {
143
- /** Element to render */
178
+ /**
179
+ * HTML element or component to render.
180
+ * @remarks The defined element wraps an inner `<code>` tag.
181
+ */
144
182
  as?: T;
145
- /** Refractor language for syntax highlighting */
183
+ /**
184
+ * Refractor language for syntax highlighting.
185
+ */
146
186
  language?: string;
147
- /** CSS **font-size** property */
187
+ /**
188
+ * Sets font size.
189
+ */
148
190
  size?: Responsive<CodeSize>;
149
191
  }
150
192
 
@@ -166,9 +208,13 @@ declare const CONTAINER_SIZE: readonly [0, 1, 2, 3, 4, 5];
166
208
  export declare interface ContainerProps<
167
209
  T extends React.ElementType = "div",
168
210
  > extends LayoutProps {
169
- /** Element to render */
211
+ /**
212
+ * HTML element or component to render.
213
+ */
170
214
  as?: T;
171
- /** CSS **max-width** property */
215
+ /**
216
+ * Maximum width of the container.
217
+ */
172
218
  size?: Responsive<ContainerSize>;
173
219
  }
174
220
 
@@ -180,6 +226,56 @@ declare const DENSITY: readonly ["compact", "regular", "loose"];
180
226
  /** @public */
181
227
  export declare type Density = (typeof DENSITY)[number];
182
228
 
229
+ /**
230
+ * @beta
231
+ *
232
+ * Renders a modal dialog element — should not be used for nonmodal dialogs.
233
+ * Modal dialogs make their containing documents inert, and render on the topmost
234
+ * layer within that containing document; they must be dimissed before the containing
235
+ * document and its contents become unblocked. They also trap focus within the bounds
236
+ * of the dialog element and its descendants.
237
+ *
238
+ * For more on dialogs and modality, refer to the HTML specification for the dialog element:
239
+ * https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element
240
+ */
241
+ export declare const Dialog: typeof DialogRoot;
242
+
243
+ declare function DialogContent(props: ComponentProps<"div">): JSX.Element;
244
+
245
+ declare function DialogFooter(props: ComponentProps<"div">): JSX.Element;
246
+
247
+ /** @beta */
248
+ export declare interface DialogProps extends Omit<
249
+ React.ComponentProps<"dialog">,
250
+ "open"
251
+ > {
252
+ /**
253
+ * Text for the dialog heading.
254
+ * @remarks Recommended for accessibility. The component sets `aria-labelledby` to the heading when you give this prop.
255
+ */
256
+ header?: string;
257
+ /**
258
+ * A function to call alongside the native `close` event.
259
+ * @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.
260
+ */
261
+ onClose: React.ReactEventHandler<HTMLDialogElement>;
262
+ /**
263
+ * Toggles the dialog's open state.
264
+ * @remarks `true` calls `showModal()` on the element. `false` calls `close()`.
265
+ */
266
+ open?: boolean;
267
+ /** Sets the max width of the dialog */
268
+ size?: Responsive<ContainerSize>;
269
+ }
270
+
271
+ declare function DialogRoot({ open, size, ...props }: DialogProps): JSX.Element;
272
+
273
+ declare namespace DialogRoot {
274
+ var displayName: string;
275
+ var Content: typeof DialogContent;
276
+ var Footer: typeof DialogFooter;
277
+ }
278
+
183
279
  declare const DISPLAY_BLOCK: readonly ["block", "inline-block", "none"];
184
280
 
185
281
  declare const DISPLAY_FLEX: readonly ["flex", "inline-flex", "none"];
@@ -216,9 +312,13 @@ declare const EYEBROW_SIZE: readonly [0, 1, 2, 3, 4];
216
312
  export declare interface EyebrowProps<
217
313
  T extends React.ElementType = "span",
218
314
  > extends TypographyProps {
219
- /** Element to render */
315
+ /**
316
+ * HTML element to render.
317
+ */
220
318
  as?: T;
221
- /** CSS **font-size** property */
319
+ /**
320
+ * Sets font size. Uses the same scale as Label.
321
+ */
222
322
  size?: Responsive<EyebrowSize>;
223
323
  }
224
324
 
@@ -270,9 +370,13 @@ export declare type FlexParentProps = {
270
370
  /** @public */
271
371
  export declare interface FlexProps<T extends React.ElementType = "div">
272
372
  extends FlexParentProps, GapProps, LayoutProps {
273
- /** Element to render */
373
+ /**
374
+ * HTML element or component to render.
375
+ */
274
376
  as?: T;
275
- /** CSS **display** property */
377
+ /**
378
+ * CSS `display` property.
379
+ */
276
380
  display?: Responsive<DisplayFlex>;
277
381
  }
278
382
 
@@ -346,9 +450,13 @@ export declare type GridParentProps = {
346
450
  /** @public */
347
451
  export declare interface GridProps<T extends React.ElementType = "div">
348
452
  extends GridParentProps, GapProps, LayoutProps {
349
- /** Element to render */
453
+ /**
454
+ * HTML element or component to render.
455
+ */
350
456
  as?: T;
351
- /** CSS **display** property */
457
+ /**
458
+ * CSS `display` property.
459
+ */
352
460
  display?: Responsive<DisplayGrid>;
353
461
  }
354
462
 
@@ -366,9 +474,15 @@ declare const HEADING_TAG: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
366
474
 
367
475
  /** @public */
368
476
  export declare interface HeadingProps extends TypographyProps {
369
- /** Element to render */
477
+ /**
478
+ * Semantic heading element to render.
479
+ * @remarks Always set this explicitly.
480
+ */
370
481
  as?: HeadingTag;
371
- /** CSS **font-size** property */
482
+ /**
483
+ * Sets font size.
484
+ * @remarks Independent of `as`.
485
+ */
372
486
  size?: Responsive<HeadingSize>;
373
487
  }
374
488
 
@@ -395,7 +509,9 @@ export declare function HStack<T extends ElementType = "div">(
395
509
  export declare interface HStackProps<
396
510
  T extends React.ElementType = "div",
397
511
  > extends Pick<GapProps, "gap"> {
398
- /** Element to render */
512
+ /**
513
+ * HTML element or component to render.
514
+ */
399
515
  as?: T;
400
516
  }
401
517
 
@@ -417,9 +533,14 @@ export declare interface IconButtonProps<
417
533
  ButtonProps<T>,
418
534
  "as" | "density" | "level" | "loading" | "tone"
419
535
  > {
420
- /** Button label */
536
+ /**
537
+ * Accessible name for the button.
538
+ * @remarks Because IconButtons have no visible text, this is required.
539
+ */
421
540
  "aria-label": string;
422
- /** Icon */
541
+ /**
542
+ * Icon to render.
543
+ */
423
544
  icon: React_2.ComponentType<SVGProps<SVGSVGElement>>;
424
545
  }
425
546
 
@@ -430,9 +551,13 @@ export declare interface IconProps
430
551
  Pick<TypographyProps, "muted">,
431
552
  MarginProps,
432
553
  ToneProps {
433
- /** Icon to render */
554
+ /**
555
+ * The icon component to render.
556
+ */
434
557
  icon: React.ComponentType<SVGProps<SVGSVGElement>>;
435
- /** CSS **font-size** property */
558
+ /**
559
+ * Sets icon size.
560
+ */
436
561
  size?: Responsive<IconSize>;
437
562
  }
438
563
 
@@ -450,9 +575,13 @@ export declare function Indicator<T extends ElementType = "span">({
450
575
  export declare interface IndicatorProps<
451
576
  T extends React.ElementType = "span",
452
577
  > extends ToneProps {
453
- /** Element to render */
578
+ /**
579
+ * HTML element to render.
580
+ */
454
581
  as?: T;
455
- /** Label for aria-label attribute */
582
+ /**
583
+ * Accessible label.
584
+ */
456
585
  label?: string;
457
586
  }
458
587
 
@@ -466,7 +595,9 @@ export declare function IndicatorStack<T extends ElementType = "div">(
466
595
  export declare interface IndicatorStackProps<
467
596
  T extends React.ElementType = "div",
468
597
  > {
469
- /** Element to render */
598
+ /**
599
+ * HTML element to render.
600
+ */
470
601
  as?: T;
471
602
  }
472
603
 
@@ -481,9 +612,13 @@ export declare function Inline<T extends ElementType = "div">(
481
612
  export declare interface InlineProps<
482
613
  T extends React.ElementType = "div",
483
614
  > extends PaddingProps {
484
- /** Element to render */
615
+ /**
616
+ * HTML element or component to render.
617
+ */
485
618
  as?: T;
486
- /** CSS **gap** property */
619
+ /**
620
+ * Space between children.
621
+ */
487
622
  gap?: Responsive<SpaceInherit>;
488
623
  }
489
624
 
@@ -512,8 +647,14 @@ export declare function Label(props: LabelProps): JSX.Element;
512
647
  /** @beta */
513
648
  export declare interface LabelProps
514
649
  extends React.ComponentProps<"label">, MarginProps {
515
- /** Element to render */
650
+ /**
651
+ * Renders the label in a muted color.
652
+ */
516
653
  disabled?: boolean;
654
+ /**
655
+ * Renders the label in the error color.
656
+ * @remarks Use when the linked input has a validation error.
657
+ */
517
658
  error?: boolean;
518
659
  }
519
660
 
@@ -538,12 +679,12 @@ export declare function Link({ underlined, ...props }: LinkProps): JSX.Element;
538
679
 
539
680
  /** @beta */
540
681
  export declare interface LinkProps extends React.ComponentProps<"a"> {
541
- /** If true, sets `target="_blank"` and `rel="noopener noreferrer"` */
682
+ /**
683
+ * Sets the link to `target="_blank"` and `rel="noopener noreferrer"`.
684
+ */
542
685
  openInNewTab?: boolean;
543
686
  /**
544
- * If true, sets `text-decoration: underline`
545
- *
546
- * @defaultValue true
687
+ * Underlines the link.
547
688
  */
548
689
  underlined?: boolean;
549
690
  }
@@ -563,9 +704,13 @@ declare function ListButtonItem<T extends ElementType = "button">({
563
704
  export declare interface ListButtonItemProps<
564
705
  T extends React_2.ElementType = "button",
565
706
  > extends ListItemProps {
566
- /** Element to render */
707
+ /**
708
+ * Element or component to render for the press target.
709
+ */
567
710
  as?: InteractiveAs<T>;
568
- /** Selected state */
711
+ /**
712
+ * Marks the row as the current selection.
713
+ */
569
714
  selected?: boolean;
570
715
  }
571
716
 
@@ -575,11 +720,17 @@ declare function ListItemImage(props: ComponentProps<"img">): JSX.Element;
575
720
 
576
721
  /** @beta */
577
722
  export declare interface ListItemProps extends React_2.ComponentProps<"li"> {
578
- /** Composite prop for setting padding and gap */
723
+ /**
724
+ * Sets horizontal padding, gap, and minimum row height together.
725
+ */
579
726
  density?: Responsive<Density>;
580
- /** Starting slot */
727
+ /**
728
+ * Slot at the left edge of the row.
729
+ */
581
730
  start?: React_2.ReactNode;
582
- /** Ending slot */
731
+ /**
732
+ * Slot at the right edge of the row.
733
+ */
583
734
  end?: React_2.ReactNode;
584
735
  }
585
736
 
@@ -592,11 +743,17 @@ declare function ListItemText<T extends ElementType = "div">(
592
743
  export declare interface ListItemTextProps<
593
744
  T extends React_2.ElementType = "div",
594
745
  > {
595
- /** Element to render */
746
+ /**
747
+ * HTML element to render.
748
+ */
596
749
  as?: T;
597
- /** Title text */
750
+ /**
751
+ * Main label.
752
+ */
598
753
  title?: React_2.ReactNode;
599
- /** Subtitle text */
754
+ /**
755
+ * Text below the title.
756
+ */
600
757
  subtitle?: React_2.ReactNode;
601
758
  }
602
759
 
@@ -605,7 +762,9 @@ export declare interface ListProps<T extends ListTag = "ul"> extends Pick<
605
762
  GapProps,
606
763
  "gap"
607
764
  > {
608
- /** Element to render */
765
+ /**
766
+ * HTML element to render.
767
+ */
609
768
  as?: T;
610
769
  }
611
770
 
@@ -641,47 +800,6 @@ export declare type MarginProps = {
641
800
  marginLeft?: Responsive<SpaceAutoNegative>;
642
801
  };
643
802
 
644
- /**
645
- * @beta
646
- *
647
- * Renders a modal dialog element — should not be used for nonmodal dialogs.
648
- * Modal dialogs make their containing documents inert, and render on the topmost
649
- * layer within that containing document; they must be dimissed before the containing
650
- * document and its contents become unblocked. They also trap focus within the bounds
651
- * of the modal element and its descendants.
652
- *
653
- * For more on dialogs and modality, refer to the HTML specification for the dialog element:
654
- * https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element
655
- */
656
- export declare const Modal: typeof ModalRoot;
657
-
658
- declare function ModalContent(props: ComponentProps<"div">): JSX.Element;
659
-
660
- declare function ModalFooter(props: ComponentProps<"div">): JSX.Element;
661
-
662
- /** @beta */
663
- export declare interface ModalProps extends Omit<
664
- React.ComponentProps<"dialog">,
665
- "open"
666
- > {
667
- /** Text to be displayed as the modal's heading; optional but recommended for optimal accessibility and presentation */
668
- header?: string;
669
- /** Used to set the value of open to false. Fires whenever the modal is closed, either programmatically or by the user (via Esc key, clicking background, clicking the modal's close button, or any other means.) */
670
- onClose: React.ReactEventHandler<HTMLDialogElement>;
671
- /** Whether the modal is open; defaults to false. */
672
- open?: boolean;
673
- /** Max width of the modal */
674
- size?: Responsive<ContainerSize>;
675
- }
676
-
677
- declare function ModalRoot({ open, size, ...props }: ModalProps): JSX.Element;
678
-
679
- declare namespace ModalRoot {
680
- var displayName: string;
681
- var Content: typeof ModalContent;
682
- var Footer: typeof ModalFooter;
683
- }
684
-
685
803
  declare const OVERFLOW: readonly [
686
804
  "visible",
687
805
  "hidden",
@@ -754,13 +872,23 @@ export declare interface PopoverProps
754
872
  extends
755
873
  Omit<React.ComponentProps<"div">, "children" | "content">,
756
874
  PlacementProps {
757
- /** Anchor name for positioning */
875
+ /**
876
+ * Shared anchor identifier.
877
+ * @remarks Set the same value on a Tooltip and a Popover to point both at one trigger.
878
+ */
758
879
  anchorName?: React.ReactNode;
759
- /** Focusable trigger element */
880
+ /**
881
+ * The trigger element.
882
+ * @remarks Popover clones it and attaches the `popovertarget` attribute that opens the floating layer.
883
+ */
760
884
  children: React.ReactElement<Record<string, unknown>>;
761
- /** Popover content */
885
+ /**
886
+ * The floating content.
887
+ */
762
888
  content?: React.ReactNode;
763
- /** Render tooltip in portal */
889
+ /**
890
+ * Renders the content into `document.body` through a React portal instead of inline.
891
+ */
764
892
  portal?: boolean;
765
893
  }
766
894
 
@@ -807,7 +935,9 @@ export declare function PressArea<T extends ElementType = "button">(
807
935
  export declare interface PressAreaProps<
808
936
  T extends React.ElementType = "button",
809
937
  > {
810
- /** Element to render */
938
+ /**
939
+ * Element or component to render.
940
+ */
811
941
  as?: InteractiveAs<T>;
812
942
  }
813
943
 
@@ -817,9 +947,14 @@ export declare function Radio(props: RadioProps): JSX.Element;
817
947
  /** @beta */
818
948
  export declare interface RadioProps
819
949
  extends React.ComponentProps<"input">, MarginProps {
820
- /** Error state */
950
+ /**
951
+ * Applies error styling to the radio mark.
952
+ * @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
953
+ */
821
954
  error?: boolean;
822
- /** Input label */
955
+ /**
956
+ * Visible label next to the radio.
957
+ */
823
958
  label: React.ReactNode;
824
959
  }
825
960
 
@@ -867,12 +1002,18 @@ export declare function SkipToContent(props: SkipToContentProps): JSX.Element;
867
1002
  /** @beta */
868
1003
  export declare interface SkipToContentProps extends React.ComponentProps<"a"> {
869
1004
  /**
870
- * Anchor href. The target element should be focusable or have `tabindex="-1"`.
1005
+ * Same-page fragment to jump to.
1006
+ * @remarks Note: The hash character # is required for proper linking.
871
1007
  */
872
1008
  href: string;
873
- /** Visible/announced label */
1009
+ /**
1010
+ * Visible and announced text.
1011
+ */
874
1012
  label: string;
875
- /** Use label instead */
1013
+ /**
1014
+ * Not accepted.
1015
+ * @remarks Pass text via `label`.
1016
+ */
876
1017
  children?: never;
877
1018
  }
878
1019
 
@@ -922,6 +1063,9 @@ export declare function Spinner({ size, ...props }: SpinnerProps): JSX.Element;
922
1063
 
923
1064
  /** @public */
924
1065
  export declare interface SpinnerProps extends React.ComponentProps<"svg"> {
1066
+ /**
1067
+ * Size of the spinner icon.
1068
+ */
925
1069
  size?: Responsive<IconSize>;
926
1070
  }
927
1071
 
@@ -931,9 +1075,14 @@ export declare function Switch(props: SwitchProps): JSX.Element;
931
1075
  /** @beta */
932
1076
  export declare interface SwitchProps
933
1077
  extends React.ComponentProps<"input">, MarginProps {
934
- /** Error state */
1078
+ /**
1079
+ * Applies error styling to the switch track.
1080
+ * @remarks Use when form validation fails. Pair with a visible error message. The prop is visual only.
1081
+ */
935
1082
  error?: boolean;
936
- /** Input label */
1083
+ /**
1084
+ * Visible label next to the switch.
1085
+ */
937
1086
  label: React.ReactNode;
938
1087
  }
939
1088
 
@@ -956,9 +1105,13 @@ export declare type TextAlign = (typeof TEXT_ALIGN)[number];
956
1105
  export declare interface TextProps<
957
1106
  T extends React.ElementType = "span",
958
1107
  > extends TypographyProps {
959
- /** Element to render */
1108
+ /**
1109
+ * HTML element to render.
1110
+ */
960
1111
  as?: T;
961
- /** CSS **font-size** property */
1112
+ /**
1113
+ * Sets font size.
1114
+ */
962
1115
  size?: Responsive<TextSize>;
963
1116
  }
964
1117
 
@@ -994,7 +1147,9 @@ export declare function TooltipGroup<T extends ElementType = "div">(
994
1147
  export declare interface TooltipGroupProps<
995
1148
  T extends React.ElementType = "div",
996
1149
  > {
997
- /** Element to render */
1150
+ /**
1151
+ * HTML element to render.
1152
+ */
998
1153
  as?: T;
999
1154
  }
1000
1155
 
@@ -1003,13 +1158,21 @@ export declare interface TooltipProps
1003
1158
  extends
1004
1159
  Omit<React.ComponentProps<"div">, "children" | "content">,
1005
1160
  PlacementProps {
1006
- /** Anchor name for positioning */
1161
+ /**
1162
+ * Shared anchor identifier.
1163
+ */
1007
1164
  anchorName?: React.ReactNode;
1008
- /** Focusable trigger element */
1165
+ /**
1166
+ * The trigger element.
1167
+ */
1009
1168
  children: React.ReactElement<Record<string, unknown>>;
1010
- /** Tooltip content */
1169
+ /**
1170
+ * The tooltip label.
1171
+ */
1011
1172
  content?: React.ReactNode;
1012
- /** Render tooltip in portal */
1173
+ /**
1174
+ * Renders the label into `document.body` through a React portal instead of inline.
1175
+ */
1013
1176
  portal?: boolean;
1014
1177
  }
1015
1178
 
@@ -1047,9 +1210,13 @@ export declare function VisuallyHidden<T extends ElementType = "span">(
1047
1210
  export declare interface VisuallyHiddenProps<
1048
1211
  T extends React.ElementType = "span",
1049
1212
  > {
1050
- /** Element to render */
1213
+ /**
1214
+ * HTML element to render.
1215
+ */
1051
1216
  as?: T;
1052
- /** If true, element is visible on :focus-visible */
1217
+ /**
1218
+ * If true, the element becomes visible on `:focus-visible`.
1219
+ */
1053
1220
  visibleOnFocus?: boolean;
1054
1221
  }
1055
1222
 
@@ -1062,7 +1229,9 @@ export declare function VStack<T extends ElementType = "div">(
1062
1229
  export declare interface VStackProps<
1063
1230
  T extends React.ElementType = "div",
1064
1231
  > extends Pick<GapProps, "gap"> {
1065
- /** Element to render */
1232
+ /**
1233
+ * HTML element or component to render.
1234
+ */
1066
1235
  as?: T;
1067
1236
  }
1068
1237