sherick-ui 2.5.0 → 2.6.0

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 (58) hide show
  1. package/README.md +55 -1
  2. package/dist/cjs/components/CheckboxGroup.cjs +41 -0
  3. package/dist/cjs/components/CheckboxGroup.cjs.map +1 -0
  4. package/dist/cjs/components/Combobox.cjs +186 -12
  5. package/dist/cjs/components/Combobox.cjs.map +1 -1
  6. package/dist/cjs/components/Form.cjs +27 -0
  7. package/dist/cjs/components/Form.cjs.map +1 -0
  8. package/dist/cjs/components/Input.cjs +20 -2
  9. package/dist/cjs/components/Input.cjs.map +1 -1
  10. package/dist/cjs/components/NumberField.cjs +29 -3
  11. package/dist/cjs/components/NumberField.cjs.map +1 -1
  12. package/dist/cjs/components/RadioGroup.cjs +7 -3
  13. package/dist/cjs/components/RadioGroup.cjs.map +1 -1
  14. package/dist/cjs/components/Select.cjs +4 -2
  15. package/dist/cjs/components/Select.cjs.map +1 -1
  16. package/dist/cjs/components/Textarea.cjs +6 -1
  17. package/dist/cjs/components/Textarea.cjs.map +1 -1
  18. package/dist/cjs/components/choice-row.cjs +51 -0
  19. package/dist/cjs/components/choice-row.cjs.map +1 -0
  20. package/dist/cjs/components/option-groups.cjs +35 -0
  21. package/dist/cjs/components/option-groups.cjs.map +1 -0
  22. package/dist/cjs/components/ui.common.cjs +13 -0
  23. package/dist/cjs/components/ui.common.cjs.map +1 -1
  24. package/dist/cjs/dev.cjs +1 -0
  25. package/dist/cjs/dev.cjs.map +1 -1
  26. package/dist/cjs/index.cjs +4 -0
  27. package/dist/cjs/index.cjs.map +1 -1
  28. package/dist/esm/components/CheckboxGroup.js +36 -0
  29. package/dist/esm/components/CheckboxGroup.js.map +1 -0
  30. package/dist/esm/components/Combobox.js +191 -17
  31. package/dist/esm/components/Combobox.js.map +1 -1
  32. package/dist/esm/components/Form.js +22 -0
  33. package/dist/esm/components/Form.js.map +1 -0
  34. package/dist/esm/components/Input.js +21 -3
  35. package/dist/esm/components/Input.js.map +1 -1
  36. package/dist/esm/components/NumberField.js +30 -4
  37. package/dist/esm/components/NumberField.js.map +1 -1
  38. package/dist/esm/components/RadioGroup.js +10 -6
  39. package/dist/esm/components/RadioGroup.js.map +1 -1
  40. package/dist/esm/components/Select.js +6 -4
  41. package/dist/esm/components/Select.js.map +1 -1
  42. package/dist/esm/components/Textarea.js +6 -1
  43. package/dist/esm/components/Textarea.js.map +1 -1
  44. package/dist/esm/components/choice-row.js +46 -0
  45. package/dist/esm/components/choice-row.js.map +1 -0
  46. package/dist/esm/components/option-groups.js +30 -0
  47. package/dist/esm/components/option-groups.js.map +1 -0
  48. package/dist/esm/components/ui.common.js +14 -2
  49. package/dist/esm/components/ui.common.js.map +1 -1
  50. package/dist/esm/dev.js +1 -1
  51. package/dist/esm/index.js +2 -0
  52. package/dist/esm/index.js.map +1 -1
  53. package/dist/styles.css +31 -0
  54. package/dist/types/dev.d.cts +3 -1
  55. package/dist/types/dev.d.ts +3 -1
  56. package/dist/types/index.d.cts +184 -20
  57. package/dist/types/index.d.ts +184 -20
  58. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -290,6 +290,9 @@
290
290
  :where(.sui-scope).visible {
291
291
  visibility: visible
292
292
  }
293
+ :where(.sui-scope).invisible {
294
+ visibility: hidden
295
+ }
293
296
  :where(.sui-scope).collapse {
294
297
  visibility: collapse
295
298
  }
@@ -469,6 +472,9 @@
469
472
  :where(.sui-scope).ms-3 {
470
473
  margin-inline-start: 0.75rem
471
474
  }
475
+ :where(.sui-scope).mt-0\.5 {
476
+ margin-top: 0.125rem
477
+ }
472
478
  :where(.sui-scope).mt-1 {
473
479
  margin-top: 0.25rem
474
480
  }
@@ -604,6 +610,9 @@
604
610
  :where(.sui-scope).h-6 {
605
611
  height: 1.5rem
606
612
  }
613
+ :where(.sui-scope).h-7 {
614
+ height: 1.75rem
615
+ }
607
616
  :where(.sui-scope).h-8 {
608
617
  height: 2rem
609
618
  }
@@ -727,6 +736,9 @@
727
736
  :where(.sui-scope).min-w-14 {
728
737
  min-width: 3.5rem
729
738
  }
739
+ :where(.sui-scope).min-w-16 {
740
+ min-width: 4rem
741
+ }
730
742
  :where(.sui-scope).min-w-28 {
731
743
  min-width: 7rem
732
744
  }
@@ -736,6 +748,9 @@
736
748
  :where(.sui-scope).min-w-9 {
737
749
  min-width: 2.25rem
738
750
  }
751
+ :where(.sui-scope).min-w-\[1ch\] {
752
+ min-width: 1ch
753
+ }
739
754
  :where(.sui-scope).min-w-\[var\(--anchor-width\)\] {
740
755
  min-width: var(--anchor-width)
741
756
  }
@@ -947,6 +962,9 @@
947
962
  :where(.sui-scope).gap-4 {
948
963
  gap: 1rem
949
964
  }
965
+ :where(.sui-scope).gap-6 {
966
+ gap: 1.5rem
967
+ }
950
968
  :where(.sui-scope).gap-x-2 {
951
969
  column-gap: 0.5rem
952
970
  }
@@ -1007,6 +1025,9 @@
1007
1025
  :where(.sui-scope).whitespace-nowrap {
1008
1026
  white-space: nowrap
1009
1027
  }
1028
+ :where(.sui-scope).whitespace-pre {
1029
+ white-space: pre
1030
+ }
1010
1031
  :where(.sui-scope).break-all {
1011
1032
  word-break: break-all
1012
1033
  }
@@ -1360,6 +1381,9 @@
1360
1381
  :where(.sui-scope).pb-6 {
1361
1382
  padding-bottom: 1.5rem
1362
1383
  }
1384
+ :where(.sui-scope).pe-0\.5 {
1385
+ padding-inline-end: 0.125rem
1386
+ }
1363
1387
  :where(.sui-scope).pe-12 {
1364
1388
  padding-inline-end: 3rem
1365
1389
  }
@@ -2190,6 +2214,9 @@
2190
2214
  --tw-bg-opacity: 1;
2191
2215
  background-color: oklch(var(--sui-primary-selected) / var(--tw-bg-opacity, 1))
2192
2216
  }
2217
+ :where(.sui-scope).has-\[\[data-sui-value-chip\]\]\:ps-2\.5:has([data-sui-value-chip]) {
2218
+ padding-inline-start: 0.625rem
2219
+ }
2193
2220
  :where(.sui-scope).has-\[\[data-checked\]\]\:text-sherick-ink:has([data-checked]) {
2194
2221
  --tw-text-opacity: 1;
2195
2222
  color: oklch(var(--sui-ink) / var(--tw-text-opacity, 1))
@@ -2214,6 +2241,10 @@
2214
2241
  :where(.sui-scope).has-\[\:focus-visible\]\:outline-sherick-focus:has(:focus-visible) {
2215
2242
  outline-color: oklch(var(--sui-focus) / 1)
2216
2243
  }
2244
+ :where(.sui-scope).group:has([data-checked]) :where(.sui-scope).group-has-\[\[data-checked\]\]\:text-sherick-ink {
2245
+ --tw-text-opacity: 1;
2246
+ color: oklch(var(--sui-ink) / var(--tw-text-opacity, 1))
2247
+ }
2217
2248
  :where(.sui-scope).data-\[ending-style\]\:h-0[data-ending-style] {
2218
2249
  height: 0px
2219
2250
  }
@@ -145,6 +145,7 @@ declare const detail: {
145
145
  declare const list: {
146
146
  readonly sheet: "max-w-[var(--available-width)] max-h-[var(--available-height)] overflow-y-auto";
147
147
  readonly option: string;
148
+ readonly groupLabel: string;
148
149
  readonly command: string;
149
150
  };
150
151
  declare const disclosure: {
@@ -197,6 +198,7 @@ declare const tone: {
197
198
  };
198
199
  declare const currentDestination = "bg-sherick-primary-soft text-sherick-ink font-medium";
199
200
  declare const selectableRowSurface = "has-[[data-checked]]:bg-sherick-primary-selected has-[[data-checked]]:text-sherick-ink has-[[data-checked]]:shadow-sherick-control";
201
+ declare const selectableRowSupporting = "group-has-[[data-checked]]:text-sherick-ink";
200
202
  declare const selectable: {
201
203
  readonly surface: string;
202
204
  readonly markSurface: string;
@@ -343,5 +345,5 @@ declare const motionPresenceToast: string;
343
345
  */
344
346
  declare const cn: (...inputs: ClassValue[]) => string;
345
347
 
346
- export { cn, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLayout, fieldMessage, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, groupFocusRing, hitArea, iconSlot, list, material, matteInset, mediaCanvas, motionActivityIndeterminate, motionActivityPulse, motionActivitySpin, motionArrive, motionDirect, motionDisclose, motionFeedback, motionInkPress, motionOrient, motionPresenceAnchored, motionPresenceModal, motionPresenceScrim, motionPresenceSheet, motionPresenceToast, motionPresenceTooltip, motionRelocate, motionRelocateLong, motionRim, motionRowLayer, motionStateLayer, motionTactile, motionTactileField, motionTactileWide, overlay, parentFocusRingInset, recessedTop, recipeAlphas, rim, selectable, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
348
+ export { cn, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLayout, fieldMessage, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, groupFocusRing, hitArea, iconSlot, list, material, matteInset, mediaCanvas, motionActivityIndeterminate, motionActivityPulse, motionActivitySpin, motionArrive, motionDirect, motionDisclose, motionFeedback, motionInkPress, motionOrient, motionPresenceAnchored, motionPresenceModal, motionPresenceScrim, motionPresenceSheet, motionPresenceToast, motionPresenceTooltip, motionRelocate, motionRelocateLong, motionRim, motionRowLayer, motionStateLayer, motionTactile, motionTactileField, motionTactileWide, overlay, parentFocusRingInset, recessedTop, recipeAlphas, rim, selectable, selectableRowSupporting, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
347
349
  export type { MotionIntent };
@@ -145,6 +145,7 @@ declare const detail: {
145
145
  declare const list: {
146
146
  readonly sheet: "max-w-[var(--available-width)] max-h-[var(--available-height)] overflow-y-auto";
147
147
  readonly option: string;
148
+ readonly groupLabel: string;
148
149
  readonly command: string;
149
150
  };
150
151
  declare const disclosure: {
@@ -197,6 +198,7 @@ declare const tone: {
197
198
  };
198
199
  declare const currentDestination = "bg-sherick-primary-soft text-sherick-ink font-medium";
199
200
  declare const selectableRowSurface = "has-[[data-checked]]:bg-sherick-primary-selected has-[[data-checked]]:text-sherick-ink has-[[data-checked]]:shadow-sherick-control";
201
+ declare const selectableRowSupporting = "group-has-[[data-checked]]:text-sherick-ink";
200
202
  declare const selectable: {
201
203
  readonly surface: string;
202
204
  readonly markSurface: string;
@@ -343,5 +345,5 @@ declare const motionPresenceToast: string;
343
345
  */
344
346
  declare const cn: (...inputs: ClassValue[]) => string;
345
347
 
346
- export { cn, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLayout, fieldMessage, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, groupFocusRing, hitArea, iconSlot, list, material, matteInset, mediaCanvas, motionActivityIndeterminate, motionActivityPulse, motionActivitySpin, motionArrive, motionDirect, motionDisclose, motionFeedback, motionInkPress, motionOrient, motionPresenceAnchored, motionPresenceModal, motionPresenceScrim, motionPresenceSheet, motionPresenceToast, motionPresenceTooltip, motionRelocate, motionRelocateLong, motionRim, motionRowLayer, motionStateLayer, motionTactile, motionTactileField, motionTactileWide, overlay, parentFocusRingInset, recessedTop, recipeAlphas, rim, selectable, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
348
+ export { cn, currentDestination, density, detail, disclosure, edge, edgeTone, elevation, fieldLayout, fieldMessage, focusRing, focusRingDrag, focusRingHeld, focusRingInset, focusRingWithin, groupFocusRing, hitArea, iconSlot, list, material, matteInset, mediaCanvas, motionActivityIndeterminate, motionActivityPulse, motionActivitySpin, motionArrive, motionDirect, motionDisclose, motionFeedback, motionInkPress, motionOrient, motionPresenceAnchored, motionPresenceModal, motionPresenceScrim, motionPresenceSheet, motionPresenceToast, motionPresenceTooltip, motionRelocate, motionRelocateLong, motionRim, motionRowLayer, motionStateLayer, motionTactile, motionTactileField, motionTactileWide, overlay, parentFocusRingInset, recessedTop, recipeAlphas, rim, selectable, selectableRowSupporting, selectableRowSurface, shape, stacking, state, stateLayer, stateLayerQuietComposite, text, tone, type };
347
349
  export type { MotionIntent };
@@ -1,9 +1,10 @@
1
1
  import { Accordion as Accordion$1 } from '@base-ui/react/accordion';
2
2
  import * as React from 'react';
3
- import React__default, { ReactNode, ButtonHTMLAttributes, ImgHTMLAttributes, HTMLAttributes, ComponentPropsWithoutRef, AnchorHTMLAttributes, ComponentProps, Ref, ReactElement, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, MouseEventHandler, ComponentPropsWithRef, TextareaHTMLAttributes } from 'react';
3
+ import React__default, { ReactNode, ButtonHTMLAttributes, ImgHTMLAttributes, HTMLAttributes, ComponentPropsWithoutRef, AnchorHTMLAttributes, ComponentProps, Ref, ClipboardEvent, ReactElement, InputHTMLAttributes, ForwardRefExoticComponent, RefAttributes, MouseEventHandler, ComponentPropsWithRef, TextareaHTMLAttributes } from 'react';
4
4
  import { Collapsible as Collapsible$1 } from '@base-ui/react/collapsible';
5
5
  import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
6
6
  import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
7
+ import { CheckboxGroup as CheckboxGroup$1 } from '@base-ui/react/checkbox-group';
7
8
  import { Toggle } from '@base-ui/react/toggle';
8
9
  import { ToggleGroup as ToggleGroup$1 } from '@base-ui/react/toggle-group';
9
10
  import { Combobox as Combobox$1 } from '@base-ui/react/combobox';
@@ -12,6 +13,7 @@ import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
12
13
  import { Popover as Popover$1 } from '@base-ui/react/popover';
13
14
  import { Select as Select$1 } from '@base-ui/react/select';
14
15
  import { Field as Field$1 } from '@base-ui/react/field';
16
+ import { Form as Form$1 } from '@base-ui/react/form';
15
17
  import { Input as Input$1 } from '@base-ui/react/input';
16
18
  import { Menu as Menu$1 } from '@base-ui/react/menu';
17
19
  import { NumberField as NumberField$1 } from '@base-ui/react/number-field';
@@ -324,6 +326,55 @@ interface CheckboxProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "v
324
326
  */
325
327
  declare const Checkbox: React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<HTMLButtonElement>>;
326
328
 
329
+ type ChoiceAppearance = "default" | "surface";
330
+
331
+ interface CheckboxGroupOption {
332
+ value: string;
333
+ label: ReactNode;
334
+ /** Supporting copy beneath the label, such as the domains a casino answers on. */
335
+ description?: ReactNode;
336
+ disabled?: boolean;
337
+ }
338
+ type CheckboxGroupChangeDetails = Parameters<NonNullable<CheckboxGroup$1.Props["onValueChange"]>>[1];
339
+ interface CheckboxGroupProps extends Omit<ComponentProps<"div">, "onChange" | "defaultValue" | "children"> {
340
+ options: CheckboxGroupOption[];
341
+ /** Gives each choice its own selectable surface. The default keeps the compact, unfilled rows. */
342
+ appearance?: ChoiceAppearance;
343
+ /** The group's own label. Base names the group from it. */
344
+ label?: ReactNode;
345
+ /** Supporting copy beneath the group. */
346
+ description?: ReactNode;
347
+ /**
348
+ * The message shown while the group is invalid. Its presence is what makes the group invalid; omit
349
+ * it and the group shows what Base reports, including an error a `Form` returns for its `name`.
350
+ */
351
+ error?: ReactNode;
352
+ /** The ticked options' values. */
353
+ value?: string[];
354
+ defaultValue?: string[];
355
+ /** Base's own change callback, event details included. */
356
+ onValueChange?: (value: string[], eventDetails: CheckboxGroupChangeDetails) => void;
357
+ /** Identifies the group when a form is submitted: one entry per ticked option. */
358
+ name?: string;
359
+ /**
360
+ * At least one option must be ticked. It marks the label and is checked when a `Form` validates;
361
+ * the message is `requiredMessage`.
362
+ */
363
+ required?: boolean;
364
+ /** The message a required group shows when nothing is ticked. */
365
+ requiredMessage?: string;
366
+ disabled?: boolean;
367
+ readOnly?: boolean;
368
+ /** Styles the labelled group. */
369
+ className?: string;
370
+ }
371
+ /**
372
+ * Any number of choices out of a list — the options-API sibling of `RadioGroup`, with the same rows,
373
+ * the same opt-in `surface` row and the same labelled column. Base UI owns the value, the group
374
+ * semantics and the form participation; Sherick UI owns the rows and the marks.
375
+ */
376
+ declare const CheckboxGroup: React__default.ForwardRefExoticComponent<Omit<CheckboxGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
377
+
327
378
  /** The parts every chip has, whichever of its two forms it takes. */
328
379
  interface ChipAnatomy {
329
380
  children: ReactNode;
@@ -402,23 +453,35 @@ interface ChipGroupProps extends Omit<ToggleGroup$1.Props<string>, "multiple" |
402
453
  */
403
454
  declare const ChipGroup: React__default.ForwardRefExoticComponent<Omit<ChipGroupProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
404
455
 
456
+ interface OptionGroup<Option> {
457
+ /** The heading the group is filed under. The primitive names the group from it. */
458
+ label: string;
459
+ options: Option[];
460
+ }
461
+
405
462
  interface ComboboxOption {
406
463
  label: string;
407
464
  value: string;
408
465
  disabled?: boolean;
409
466
  }
467
+ /** Options filed under one heading, such as channels under their category. */
468
+ type ComboboxOptionGroup = OptionGroup<ComboboxOption>;
410
469
  type ComboboxRootProps = Combobox$1.Root.Props<ComboboxOption>;
411
470
  type ComboboxChangeDetails = Parameters<NonNullable<ComboboxRootProps["onValueChange"]>>[1];
412
- interface ComboboxProps {
413
- options: ComboboxOption[];
414
- /** The selected option's value, or `null` for no selection. */
415
- value?: string | null;
416
- defaultValue?: string | null;
471
+ /**
472
+ * A change Base did not make: several entries pasted at once into a creatable combobox. It carries
473
+ * the paste event itself, and nothing to cancel — the entries are added in one step.
474
+ */
475
+ interface ComboboxPasteDetails {
476
+ reason: "input-paste";
477
+ event: ClipboardEvent<HTMLInputElement>["nativeEvent"];
478
+ }
479
+ interface ComboboxCommonProps {
417
480
  /**
418
- * The selected option's own `value`, so two equal options compare equal even when a caller
419
- * rebuilds its options array. Base's event details are passed through unchanged.
481
+ * The options, in the order they read. Any of them may be filed under a heading by passing a group
482
+ * (`{ label, options }`) in its place; an option outside every group is listed where it stands.
420
483
  */
421
- onValueChange?: (value: string | null, eventDetails: ComboboxChangeDetails) => void;
484
+ options: Array<ComboboxOption | ComboboxOptionGroup>;
422
485
  placeholder?: string;
423
486
  /** Shown in place of the list when the query matches no option. */
424
487
  emptyMessage?: ReactNode;
@@ -447,12 +510,48 @@ interface ComboboxProps {
447
510
  readOnly?: boolean;
448
511
  disabled?: boolean;
449
512
  }
513
+ interface ComboboxSingleProps extends ComboboxCommonProps {
514
+ multiple?: false;
515
+ /** The selected option's value, or `null` for no selection. */
516
+ value?: string | null;
517
+ defaultValue?: string | null;
518
+ /**
519
+ * The selected option's own `value`, so two equal options compare equal even when a caller
520
+ * rebuilds its options array. Base's event details are passed through unchanged.
521
+ */
522
+ onValueChange?: (value: string | null, eventDetails: ComboboxChangeDetails) => void;
523
+ creatable?: never;
524
+ createLabel?: never;
525
+ chipsLabel?: never;
526
+ }
527
+ interface ComboboxMultipleProps extends ComboboxCommonProps {
528
+ /** Holds any number of options, each shown as a removable chip inside the field. */
529
+ multiple: true;
530
+ /** The selected options' values, in the order they were chosen. */
531
+ value?: string[];
532
+ defaultValue?: string[];
533
+ /**
534
+ * The selected options' own values. Base's event details are passed through unchanged; a
535
+ * multi-line paste into a creatable field reports `{ reason: "input-paste" }` instead.
536
+ */
537
+ onValueChange?: (value: string[], eventDetails: ComboboxChangeDetails | ComboboxPasteDetails) => void;
538
+ /**
539
+ * Accepts entries that are not among the options: the typed text is offered as an "Add" row, and
540
+ * pasting several lines adds one entry per line. A created entry's value is its own text.
541
+ */
542
+ creatable?: boolean;
543
+ /** The "Add" row's copy for the current query. */
544
+ createLabel?: (query: string) => ReactNode;
545
+ /** The accessible name of the chip row. */
546
+ chipsLabel?: string;
547
+ }
548
+ type ComboboxProps = ComboboxSingleProps | ComboboxMultipleProps;
450
549
  /**
451
- * A text field that filters a list of options and selects one of them. It is the searchable
452
- * sibling of `Select`: the same option shape, the same value contract and the same box, with an
453
- * input instead of a trigger. Base UI owns filtering, the listbox semantics, keyboard
454
- * interaction, the anchored popup and the hidden form input; Sherick UI owns the field, the row
455
- * treatment and the tone of the selected option.
550
+ * A text field that filters a list of options and selects one of them, or several. It is the
551
+ * searchable sibling of `Select`: the same option shape, the same value contract and the same box,
552
+ * with an input instead of a trigger. Base UI owns filtering, the listbox semantics, keyboard
553
+ * interaction, chip navigation and removal, the anchored popup and the hidden form inputs; Sherick UI
554
+ * owns the field, the row treatment, the chips and the tone of the selected option.
456
555
  *
457
556
  * Filtering is Base's and it is local — an application that needs remote results owns the
458
557
  * fetching, the debounce and the loading state around this control.
@@ -772,10 +871,16 @@ interface SelectOption {
772
871
  value: string;
773
872
  disabled?: boolean;
774
873
  }
874
+ /** Options filed under one heading, such as channels under their category. */
875
+ type SelectOptionGroup = OptionGroup<SelectOption>;
775
876
  type SelectRootProps = Select$1.Root.Props<string>;
776
877
  type SelectChangeDetails = Parameters<NonNullable<SelectRootProps["onValueChange"]>>[1];
777
878
  interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "defaultValue"> {
778
- options: SelectOption[];
879
+ /**
880
+ * The options, in the order they read. Any of them may be filed under a heading by passing a group
881
+ * (`{ label, options }`) in its place; an option outside every group is listed where it stands.
882
+ */
883
+ options: Array<SelectOption | SelectOptionGroup>;
779
884
  variant?: Variant;
780
885
  value?: string | null;
781
886
  defaultValue?: string | null;
@@ -882,6 +987,32 @@ interface FileUploadProps extends Omit<HTMLAttributes<HTMLDivElement>, "children
882
987
  }
883
988
  declare const FileUpload: React__default.ForwardRefExoticComponent<FileUploadProps & React__default.RefAttributes<HTMLInputElement>>;
884
989
 
990
+ /** Messages keyed by each field's `name`: one message, or several. */
991
+ type FormErrors = Record<string, string | string[]>;
992
+ interface FormProps extends Omit<ComponentProps<typeof Form$1>, "className" | "render" | "errors" | "children" | "ref"> {
993
+ /**
994
+ * Errors returned from outside the form — typically a server's answer to a submission — keyed by
995
+ * each field's `name`. Each field shows its own message, the form moves focus to the first field
996
+ * that has one, and a field's entry clears as soon as its value changes.
997
+ */
998
+ errors?: FormErrors;
999
+ /** Styles the form's own column. The fields inside it style themselves. */
1000
+ className?: string;
1001
+ children?: ReactNode;
1002
+ }
1003
+ /**
1004
+ * A form whose fields report what is wrong where it is wrong. On submit, Base UI validates every
1005
+ * field it holds, keeps the submission from leaving while any is invalid and moves focus to the
1006
+ * first invalid field in document order, so a submit button at the bottom of a long form never
1007
+ * answers with nothing. The same happens when `errors` arrive after a submission.
1008
+ *
1009
+ * Every Sherick field takes part through its `name`: `Input`, `Textarea`, `RadioGroup` and
1010
+ * `CheckboxGroup` carry their own; `Select`, `Combobox`, `NumberField`, `Checkbox`, `Switch` and
1011
+ * `Slider` take part inside a `Field` given the `name`. Base UI owns validation, the errors map and
1012
+ * the focus move; Sherick UI owns only the column the fields stand in.
1013
+ */
1014
+ declare const Form: React__default.ForwardRefExoticComponent<FormProps & React__default.RefAttributes<HTMLFormElement>>;
1015
+
885
1016
  type IconButtonAppearance = "tonal" | "ghost" | "acrylic";
886
1017
  interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
887
1018
  variant?: Variant;
@@ -891,7 +1022,7 @@ interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
891
1022
  }
892
1023
  declare const IconButton: React__default.ForwardRefExoticComponent<IconButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
893
1024
 
894
- interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
1025
+ interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "prefix"> {
895
1026
  label?: ReactNode;
896
1027
  description?: ReactNode;
897
1028
  error?: boolean;
@@ -899,6 +1030,13 @@ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
899
1030
  inputClassName?: string;
900
1031
  /** Base's value-change callback, event details included. */
901
1032
  onValueChange?: Input$1.Props["onValueChange"];
1033
+ /**
1034
+ * Text or a mark at the start of the field, such as `€` or `https://`. It is presentation only and
1035
+ * hidden from assistive technology, so the label must carry whatever the reader needs from it.
1036
+ */
1037
+ prefix?: ReactNode;
1038
+ /** Text or a mark at the end of the field, such as `tickets` or `.discord.gg`. Presentation only. */
1039
+ suffix?: ReactNode;
902
1040
  }
903
1041
  declare const Input: React__default.ForwardRefExoticComponent<InputProps & React__default.RefAttributes<HTMLInputElement>>;
904
1042
 
@@ -1084,7 +1222,7 @@ interface NavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
1084
1222
  }
1085
1223
  declare const NavItem: ({ children, icon, className, href, active, ...props }: NavItemProps) => React__default.JSX.Element;
1086
1224
 
1087
- interface NumberFieldProps extends Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "min" | "max" | "step" | "type" | "size" | "ref"> {
1225
+ interface NumberFieldProps extends Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "min" | "max" | "step" | "type" | "size" | "ref" | "prefix"> {
1088
1226
  value?: number | null;
1089
1227
  defaultValue?: number;
1090
1228
  onValueChange?: NumberField$1.Root.Props["onValueChange"];
@@ -1093,6 +1231,23 @@ interface NumberFieldProps extends Omit<ComponentProps<"input">, "value" | "defa
1093
1231
  min?: number;
1094
1232
  max?: number;
1095
1233
  step?: number;
1234
+ /**
1235
+ * How the value is written: Base's `Intl.NumberFormatOptions`, passed through unchanged —
1236
+ * `{ style: "currency", currency: "EUR" }`, `{ minimumFractionDigits: 2 }`, `{ style: "percent" }`.
1237
+ */
1238
+ format?: NumberField$1.Root.Props["format"];
1239
+ /** The locale the value is parsed and written in. Defaults to the runtime's own. */
1240
+ locale?: NumberField$1.Root.Props["locale"];
1241
+ /**
1242
+ * A unit written before the value, such as `€`. It is presentation only and hidden from assistive
1243
+ * technology, so the field's label must name the unit as well ("Price (€)").
1244
+ */
1245
+ prefix?: ReactNode;
1246
+ /**
1247
+ * A unit written after the value, such as `×` or `tickets`. Presentation only, like `prefix`:
1248
+ * name the unit in the label as well.
1249
+ */
1250
+ suffix?: ReactNode;
1096
1251
  disabled?: boolean;
1097
1252
  readOnly?: boolean;
1098
1253
  required?: boolean;
@@ -1209,15 +1364,24 @@ declare const Progress: React__default.ForwardRefExoticComponent<Omit<ProgressPr
1209
1364
  interface RadioGroupOption {
1210
1365
  value: string;
1211
1366
  label: ReactNode;
1367
+ /** Supporting copy beneath the label. It describes the choice rather than naming it. */
1368
+ description?: ReactNode;
1212
1369
  disabled?: boolean;
1213
1370
  }
1214
1371
  interface RadioGroupProps extends Omit<ComponentProps<"div">, "onChange" | "defaultValue" | "children"> {
1215
1372
  options: RadioGroupOption[];
1216
1373
  /** Gives each choice its own selectable surface. The default keeps the compact, unfilled rows. */
1217
- appearance?: "default" | "surface";
1374
+ appearance?: ChoiceAppearance;
1218
1375
  /** The group's own label. Naming the group is the group's job, not a field's: an
1219
1376
  * enclosing `Field` names one control, while every option here is its own control. */
1220
1377
  label?: ReactNode;
1378
+ /** Supporting copy beneath the group. */
1379
+ description?: ReactNode;
1380
+ /**
1381
+ * The message shown while the group is invalid. Its presence is what makes the group invalid; omit
1382
+ * it and the group shows what Base reports, including an error a `Form` returns for its `name`.
1383
+ */
1384
+ error?: ReactNode;
1221
1385
  value?: string;
1222
1386
  defaultValue?: string;
1223
1387
  onValueChange?: RadioGroup$1.Props<string>["onValueChange"];
@@ -1726,5 +1890,5 @@ interface DirectionProviderProps {
1726
1890
  /** Declares writing direction to the interaction and positioning primitives, including portals. */
1727
1891
  declare const DirectionProvider: ({ direction, children }: DirectionProviderProps) => React__default.JSX.Element;
1728
1892
 
1729
- export { Accordion, Alert, AlertDialog, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Checkbox, Chip, ChipGroup, Collapsible, Combobox, Command, CommandPalette, DatePicker, DateRangePicker, DateTimePicker, Dialog, DirectionProvider, Divider, Drawer, Field, FileUpload, IconButton, Input, Media, Menu, NavGroup, NavItem, NumberField, Pagination, Popover, Progress, RadioGroup, Search, SegmentedControl, Select, Skeleton, Slider, Spinner, Stepper, Switch, Table, Tabs, Textarea, ToastProvider, ToastViewport, ToggleGroup, Tooltip, TreeView, createToastManager, useToast };
1730
- export type { AccordionHeadingLevel, AccordionItemProps, AccordionPanelProps, AccordionProps, AccordionTriggerProps, AlertDialogProps, AlertProps, AvatarProps, BadgeProps, BreadcrumbItem, BreadcrumbProps, ButtonAppearance, ButtonProps, ButtonSize, CalendarDate, CalendarDateTime, CalendarLabels, CalendarProps, CardProps, CheckboxProps, ChipGroupProps, ChipProps, CollapsiblePanelProps, CollapsibleProps, CollapsibleTriggerProps, ComboboxOption, ComboboxProps, CommandItem, CommandPaletteProps, CommandProps, DatePickerProps, DateRange, DateRangePickerProps, DateTimePickerLabels, DateTimePickerProps, DialogContentProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DirectionProviderProps, DividerProps, DividerWeight, DrawerContentProps, DrawerDescriptionProps, DrawerFooterProps, DrawerHeaderProps, DrawerProps, DrawerSide, DrawerTriggerProps, FieldProps, FileRejection, FileUploadProps, IconButtonAppearance, IconButtonProps, InputProps, MediaImageProps, MediaVideoProps, MenuContentProps, MenuItemProps, MenuProps, MenuSeparatorProps, MenuTriggerProps, NavGroupHeadingLevel, NavGroupItem, NavGroupProps, NavItemProps, NumberFieldProps, OverlayAlign, OverlaySide, PaginationProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, ProgressProps, RadioGroupOption, RadioGroupProps, SearchProps, SegmentedControlOption, SegmentedControlProps, SelectOption, SelectProps, SkeletonProps, SliderProps, SpinnerProps, StepperItem, StepperProps, SwitchProps, Tab, TableColumn, TableProps, TabsProps, TextareaProps, ToastActionOptions, ToastManager, ToastOptions, ToastPosition, ToastPromiseOptions, ToastProviderProps, ToastType, ToastUpdateOptions, ToastViewportProps, ToggleGroupItemProps, ToggleGroupProps, TooltipProps, TreeViewItem, TreeViewProps, Variant };
1893
+ export { Accordion, Alert, AlertDialog, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Checkbox, CheckboxGroup, Chip, ChipGroup, Collapsible, Combobox, Command, CommandPalette, DatePicker, DateRangePicker, DateTimePicker, Dialog, DirectionProvider, Divider, Drawer, Field, FileUpload, Form, IconButton, Input, Media, Menu, NavGroup, NavItem, NumberField, Pagination, Popover, Progress, RadioGroup, Search, SegmentedControl, Select, Skeleton, Slider, Spinner, Stepper, Switch, Table, Tabs, Textarea, ToastProvider, ToastViewport, ToggleGroup, Tooltip, TreeView, createToastManager, useToast };
1894
+ export type { AccordionHeadingLevel, AccordionItemProps, AccordionPanelProps, AccordionProps, AccordionTriggerProps, AlertDialogProps, AlertProps, AvatarProps, BadgeProps, BreadcrumbItem, BreadcrumbProps, ButtonAppearance, ButtonProps, ButtonSize, CalendarDate, CalendarDateTime, CalendarLabels, CalendarProps, CardProps, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, ChipGroupProps, ChipProps, CollapsiblePanelProps, CollapsibleProps, CollapsibleTriggerProps, ComboboxMultipleProps, ComboboxOption, ComboboxOptionGroup, ComboboxPasteDetails, ComboboxProps, ComboboxSingleProps, CommandItem, CommandPaletteProps, CommandProps, DatePickerProps, DateRange, DateRangePickerProps, DateTimePickerLabels, DateTimePickerProps, DialogContentProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DirectionProviderProps, DividerProps, DividerWeight, DrawerContentProps, DrawerDescriptionProps, DrawerFooterProps, DrawerHeaderProps, DrawerProps, DrawerSide, DrawerTriggerProps, FieldProps, FileRejection, FileUploadProps, FormErrors, FormProps, IconButtonAppearance, IconButtonProps, InputProps, MediaImageProps, MediaVideoProps, MenuContentProps, MenuItemProps, MenuProps, MenuSeparatorProps, MenuTriggerProps, NavGroupHeadingLevel, NavGroupItem, NavGroupProps, NavItemProps, NumberFieldProps, OverlayAlign, OverlaySide, PaginationProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, ProgressProps, RadioGroupOption, RadioGroupProps, SearchProps, SegmentedControlOption, SegmentedControlProps, SelectOption, SelectOptionGroup, SelectProps, SkeletonProps, SliderProps, SpinnerProps, StepperItem, StepperProps, SwitchProps, Tab, TableColumn, TableProps, TabsProps, TextareaProps, ToastActionOptions, ToastManager, ToastOptions, ToastPosition, ToastPromiseOptions, ToastProviderProps, ToastType, ToastUpdateOptions, ToastViewportProps, ToggleGroupItemProps, ToggleGroupProps, TooltipProps, TreeViewItem, TreeViewProps, Variant };