Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
UI: Match item JSDoc to package conventions
  • Loading branch information
mirka committed Sep 25, 2026
commit 6fc7bf8dc1044a749d8b7c6d14a8513436e04c32
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Text } from '../../../text';
import itemPopupStyles from '../../../utils/css/item-popup.module.css';
import type { AutocompleteItemDescriptionProps } from './types';

/** Supplementary text below an autocomplete item label. */
/**
* Supplementary text below an autocomplete item label.
*/
export const ItemDescription = forwardRef<
HTMLSpanElement,
AutocompleteItemDescriptionProps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Text } from '../../../text';
import itemPopupStyles from '../../../utils/css/item-popup.module.css';
import type { AutocompleteItemLabelProps } from './types';

/** The primary label and accessible name of an autocomplete item. */
/**
* The primary label and accessible name of an autocomplete item.
*/
export const ItemLabel = forwardRef<
HTMLSpanElement,
AutocompleteItemLabelProps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export const Default: Story = {
},
};

/** Item descriptions appear below labels and contribute to each suggestion's accessible description. */
/**
* Item descriptions appear below labels and contribute to each suggestion's accessible description.
*/
export const WithItemDescriptions: Story = {
args: {
items: URLS.slice( 0, 3 ),
Expand Down
12 changes: 9 additions & 3 deletions packages/ui/src/form/primitives/autocomplete/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ export type AutocompleteInputGroupProps = ComponentProps<
};

export interface AutocompleteItemLabelProps extends ComponentProps< 'span' > {
/** The primary label and accessible name of an autocomplete item. */
/**
* The primary label and accessible name of an autocomplete item.
*/
children: ReactNode;
}

export interface AutocompleteItemDescriptionProps extends ComponentProps< 'span' > {
/** Supplementary content described by the autocomplete item. */
/**
* Supplementary content described by the autocomplete item.
*/
children: ReactNode;
}

Expand All @@ -70,7 +74,9 @@ export type AutocompleteItemProps = Omit<
ComponentProps< typeof _Autocomplete.Item >,
'children'
> & {
/** One direct ItemLabel, followed by zero or more ItemDescription components. */
/**
* One direct ItemLabel, followed by zero or more ItemDescription components.
*/
children: AutocompleteItemChildren;
};

Expand Down
12 changes: 9 additions & 3 deletions packages/ui/src/form/primitives/combobox/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,16 @@ export type ComboboxInputGroupProps = ComponentProps<
};

export interface ComboboxItemLabelProps extends ComponentProps< 'span' > {
/** The primary label and accessible name of a combobox item. */
/**
* The primary label and accessible name of a combobox item.
*/
children: ReactNode;
}

export interface ComboboxItemDescriptionProps extends ComponentProps< 'span' > {
/** Supplementary content described by the combobox item. */
/**
* Supplementary content described by the combobox item.
*/
children: ReactNode;
}

Expand All @@ -85,7 +89,9 @@ export type ComboboxItemProps = Omit<
ComponentProps< typeof _Combobox.Item >,
'children'
> & {
/** One direct ItemLabel, followed by zero or more ItemDescription components. */
/**
* One direct ItemLabel, followed by zero or more ItemDescription components.
*/
children: ComboboxItemChildren;
/**
* The variant of the item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export const Default: Story = {
},
};

/** Item descriptions appear below labels in the popup and are not copied to chips. */
/**
* Item descriptions appear below labels in the popup and are not copied to chips.
*/
export const WithItemDescriptions: Story = {
args: {
...Default.args,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export type Item = {
label: string;
value: string;
disabled?: boolean;
/** Supplementary text shown below the item label in the popup. */
/**
* Supplementary text shown below the item label in the popup.
*/
description?: string;
/**
* When `true`, the item renders in the list footer, not the main list,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const Default: Story = {
},
};

/** Item descriptions appear below labels in the popup and are not copied to the trigger. */
/**
* Item descriptions appear below labels in the popup and are not copied to the trigger.
*/
export const WithItemDescriptions: Story = {
args: {
...Default.args,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export type Item = {
label: string;
value: string;
disabled?: boolean;
/** Supplementary text shown below the item label in the popup. */
/**
* Supplementary text shown below the item label in the popup.
*/
description?: string;
/**
* When `true`, the item renders in the list footer, not the main list,
Expand Down
Loading