Skip to content

chore: setup AI exports#10193

Open
snowystinger wants to merge 1 commit into
mainfrom
ai-exports
Open

chore: setup AI exports#10193
snowystinger wants to merge 1 commit into
mainfrom
ai-exports

Conversation

@snowystinger

Copy link
Copy Markdown
Member

Closes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@github-actions github-actions Bot added the v3 label Jun 12, 2026
@rspbot

rspbot commented Jun 12, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Jun 12, 2026

Copy link
Copy Markdown
## API Changes

@react-spectrum/ai

/@react-spectrum/ai:AttachmentList

 AttachmentList {
-
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  className?: string = 'react-aria-TagGroup'
+  defaultSelectedKeys?: 'all' | Iterable<Key>
+  disabledKeys?: Iterable<Key>
+  disallowEmptySelection?: boolean
+  escapeKeyBehavior?: 'clearSelection' | 'none' = 'clearSelection'
+  id?: string
+  onAction?: (Key) => void
+  onRemove?: (Set<Key>) => void
+  onSelectionChange?: (Selection) => void
+  render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
+  selectedKeys?: 'all' | Iterable<Key>
+  selectionBehavior?: SelectionBehavior = 'toggle'
+  selectionMode?: SelectionMode
+  shouldSelectOnPressUp?: boolean
+  slot?: string | null
+  style?: CSSProperties
+  styles?: StylesProp
 }

/@react-spectrum/ai:BasicHorizontalCard

 BasicHorizontalCard {
-  children: ReactNode | (CardRenderProps) => ReactNode
+  children: ReactNode | (HorizontalCardRenderProps) => ReactNode
   density?: 'compact' | 'regular' | 'spacious' = 'regular'
   download?: boolean | string
   href?: Href
   hrefLang?: string
   isDisabled?: boolean
   onAction?: () => void
   onPress?: (PressEvent) => void
   onPressChange?: (boolean) => void
   onPressEnd?: (PressEvent) => void
   onPressStart?: (PressEvent) => void
   onPressUp?: (PressEvent) => void
   ping?: string
   referrerPolicy?: HTMLAttributeReferrerPolicy
   rel?: string
   routerOptions?: RouterOptions
   size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
   styles?: StyleString
   target?: HTMLAttributeAnchorTarget
   textValue?: string
   value?: T
   variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'
 }

/@react-spectrum/ai:HorizontalCard

 HorizontalCard {
-  children: ReactNode | (CardRenderProps) => ReactNode
+  children: ReactNode | (HorizontalCardRenderProps) => ReactNode
   density?: 'compact' | 'regular' | 'spacious' = 'regular'
   download?: boolean | string
   href?: Href
   hrefLang?: string
   isDisabled?: boolean
   onAction?: () => void
   onPress?: (PressEvent) => void
   onPressChange?: (boolean) => void
   onPressEnd?: (PressEvent) => void
   onPressStart?: (PressEvent) => void
   onPressUp?: (PressEvent) => void
   ping?: string
   referrerPolicy?: HTMLAttributeReferrerPolicy
   rel?: string
   routerOptions?: RouterOptions
   size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
   styles?: StyleString
   target?: HTMLAttributeAnchorTarget
   textValue?: string
   value?: T
   variant?: 'primary' | 'secondary' | 'tertiary' = 'primary'
 }

/@react-spectrum/ai:ResponseStatusTitle

+ResponseStatusTitle {
+  children: React.ReactNode
+  id?: string
+  level?: number = 3
+  styles?: StyleString
+}

/@react-spectrum/ai:Thread

+Thread {
+  children?: ReactNode
+  className?: string
+  style?: CSSProperties
+}

/@react-spectrum/ai:ThreadItem

+ThreadItem {
+  children?: ChildrenOrFunction<GridListItemRenderProps>
+  className?: ClassNameOrFunction<GridListItemRenderProps> = 'react-aria-GridListItem'
+  isStreaming?: boolean
+  shouldAnnounceOnMount?: boolean
+  textValue?: string
+}

/@react-spectrum/ai:ThreadList

+ThreadList <T extends {}> {
+  aria-label?: string
+  aria-labelledby?: string
+  children?: ReactNode | (T) => ReactNode
+  className?: ClassNameOrFunction<GridListRenderProps> = 'react-aria-GridList'
+  items?: Iterable<T>
+}

/@react-spectrum/ai:ThreadScrollButton

+ThreadScrollButton {
+  children?: ReactNode
+}

/@react-spectrum/ai:AttachmentProps

+AttachmentProps {
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  children: ReactNode
+  density?: 'compact' | 'regular' | 'spacious' = 'regular'
+  download?: boolean | string
+  href?: Href
+  hrefLang?: string
+  id?: Key
+  isDisabled?: boolean
+  onAction?: () => void
+  onPress?: (PressEvent) => void
+  onPressChange?: (boolean) => void
+  onPressEnd?: (PressEvent) => void
+  onPressStart?: (PressEvent) => void
+  onPressUp?: (PressEvent) => void
+  ping?: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  rel?: string
+  routerOptions?: RouterOptions
+  size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
+  styles?: StylesProp
+  target?: HTMLAttributeAnchorTarget
+  textValue?: string
+  value?: T
+  variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'
+}

/@react-spectrum/ai:AttachmentListProps

+AttachmentListProps {
+  UNSAFE_className?: UnsafeClassName
+  UNSAFE_style?: CSSProperties
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  className?: string = 'react-aria-TagGroup'
+  defaultSelectedKeys?: 'all' | Iterable<Key>
+  disabledKeys?: Iterable<Key>
+  disallowEmptySelection?: boolean
+  escapeKeyBehavior?: 'clearSelection' | 'none' = 'clearSelection'
+  id?: string
+  onAction?: (Key) => void
+  onRemove?: (Set<Key>) => void
+  onSelectionChange?: (Selection) => void
+  render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, undefined>
+  selectedKeys?: 'all' | Iterable<Key>
+  selectionBehavior?: SelectionBehavior = 'toggle'
+  selectionMode?: SelectionMode
+  shouldSelectOnPressUp?: boolean
+  slot?: string | null
+  style?: CSSProperties
+  styles?: StylesProp
+}

/@react-spectrum/ai:HorizontalCardProps

+HorizontalCardProps {
+  children: ReactNode | (HorizontalCardRenderProps) => ReactNode
+  density?: 'compact' | 'regular' | 'spacious' = 'regular'
+  download?: boolean | string
+  href?: Href
+  hrefLang?: string
+  id?: Key
+  isDisabled?: boolean
+  onAction?: () => void
+  onPress?: (PressEvent) => void
+  onPressChange?: (boolean) => void
+  onPressEnd?: (PressEvent) => void
+  onPressStart?: (PressEvent) => void
+  onPressUp?: (PressEvent) => void
+  ping?: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  rel?: string
+  routerOptions?: RouterOptions
+  size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
+  styles?: StyleString
+  target?: HTMLAttributeAnchorTarget
+  textValue?: string
+  value?: T
+  variant?: 'primary' | 'secondary' | 'tertiary' = 'primary'
+}

/@react-spectrum/ai:BasicCardProps

+BasicCardProps {
+  children: ReactNode | (HorizontalCardRenderProps) => ReactNode
+  density?: 'compact' | 'regular' | 'spacious' = 'regular'
+  download?: boolean | string
+  href?: Href
+  hrefLang?: string
+  id?: Key
+  isDisabled?: boolean
+  onAction?: () => void
+  onPress?: (PressEvent) => void
+  onPressChange?: (boolean) => void
+  onPressEnd?: (PressEvent) => void
+  onPressStart?: (PressEvent) => void
+  onPressUp?: (PressEvent) => void
+  ping?: string
+  referrerPolicy?: HTMLAttributeReferrerPolicy
+  rel?: string
+  routerOptions?: RouterOptions
+  size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
+  styles?: StyleString
+  target?: HTMLAttributeAnchorTarget
+  textValue?: string
+  value?: T
+  variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'
+}

/@react-spectrum/ai:MessageFeedbackProps

+MessageFeedbackProps {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  defaultValue?: MessageFeedbackValue
+  id?: string
+  isDisabled?: boolean
+  onChange?: (MessageFeedbackValue) => void
+  slot?: string | null
+  styles?: StyleString
+  thumbDownLabel?: string
+  thumbUpLabel?: string
+  value?: MessageFeedbackValue
+}

/@react-spectrum/ai:MessageSuggestionProps

+MessageSuggestionProps {
+  aria-controls?: string
+  aria-current?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
+  aria-describedby?: string
+  aria-details?: string
+  aria-disabled?: boolean | 'true' | 'false'
+  aria-expanded?: boolean | 'true' | 'false'
+  aria-haspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false'
+  aria-label?: string
+  aria-labelledby?: string
+  aria-pressed?: boolean | 'true' | 'false' | 'mixed'
+  autoFocus?: boolean
+  children: ReactNode
+  excludeFromTabOrder?: boolean
+  form?: string
+  formAction?: ButtonHTMLAttributes<HTMLButtonElement>['formAction']
+  formEncType?: string
+  formMethod?: string
+  formNoValidate?: boolean
+  formTarget?: string
+  id?: string
+  name?: string
+  onBlur?: (FocusEvent<Target>) => void
+  onClick?: (MouseEvent<FocusableElement>) => void
+  onFocus?: (FocusEvent<Target>) => void
+  onFocusChange?: (boolean) => void
+  onHoverChange?: (boolean) => void
+  onHoverEnd?: (HoverEvent) => void
+  onHoverStart?: (HoverEvent) => void
+  onKeyDown?: (KeyboardEvent) => void
+  onKeyUp?: (KeyboardEvent) => void
+  onPress?: (PressEvent) => void
+  onPressChange?: (boolean) => void
+  onPressEnd?: (PressEvent) => void
+  onPressStart?: (PressEvent) => void
+  onPressUp?: (PressEvent) => void
+  preventFocusOnPress?: boolean
+  render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, ButtonRenderProps>
+  size?: 'S' | 'M' | 'L' | 'XL'
+  slot?: string | null
+  styles?: StyleString
+  type?: 'button' | 'submit' | 'reset' = 'button'
+  value?: string
+}

/@react-spectrum/ai:MessageSuggestionListProps

+MessageSuggestionListProps {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  id?: string
+  size?: 'S' | 'M' | 'L' | 'XL'
+  slot?: string | null
+  styles?: StyleString
+  title: string
+}

/@react-spectrum/ai:ResponseStatusProps

+ResponseStatusProps {
+  children: ReactNode
+  defaultExpanded?: boolean
+  density?: 'compact' | 'regular' | 'spacious' = 'regular'
+  id?: Key
+  isDisabled?: boolean
+  isExpanded?: boolean
+  isLoading?: boolean
+  onExpandedChange?: (boolean) => void
+  size?: 'S' | 'M' | 'L' | 'XL' = 'M'
+  slot?: string | null
+  styles?: StyleString
+}

/@react-spectrum/ai:ResponseStatusTitleProps

+ResponseStatusTitleProps {
+  children: React.ReactNode
+  id?: string
+  level?: number = 3
+  styles?: StyleString
+}

/@react-spectrum/ai:ResponseStatusPanelProps

+ResponseStatusPanelProps {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: React.ReactNode
+  id?: string
+  label?: ReactNode
+  labelElementType?: ElementType = 'label'
+  role?: 'group' | 'region' = 'group'
+  styles?: StyleString
+}

/@react-spectrum/ai:ThreadProps

+ThreadProps {
+  children?: ReactNode
+  className?: string
+  style?: CSSProperties
+}

/@react-spectrum/ai:ThreadItemProps

+ThreadItemProps {
+  children?: ChildrenOrFunction<GridListItemRenderProps>
+  className?: ClassNameOrFunction<GridListItemRenderProps> = 'react-aria-GridListItem'
+  isStreaming?: boolean
+  shouldAnnounceOnMount?: boolean
+  textValue?: string
+}

/@react-spectrum/ai:ThreadListProps

+ThreadListProps <T extends {}> {
+  aria-label?: string
+  aria-labelledby?: string
+  children?: ReactNode | (T) => ReactNode
+  className?: ClassNameOrFunction<GridListRenderProps> = 'react-aria-GridList'
+  items?: Iterable<T>
+}

/@react-spectrum/ai:ThreadScrollButtonProps

+ThreadScrollButtonProps {
+  children?: ReactNode
+}

/@react-spectrum/ai:UserMessageProps

+UserMessageProps {
+  aria-describedby?: string
+  aria-details?: string
+  aria-label?: string
+  aria-labelledby?: string
+  children: ReactNode
+  id?: string
+  slot?: string | null
+  styles?: StyleString
+}

Comment on lines +27 to +29
export interface AttachmentListProps extends TagGroupProps, StyleProps {
children: ReactNode;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export interface AttachmentListProps extends TagGroupProps, StyleProps {
children: ReactNode;
}
export interface AttachmentListProps extends TagGroupProps {
children: ReactNode;
styles?: StyleString
}

we're allowing all properties to be overridden so no need for StyleProps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i noticed while looking at the storybook that AttachmentList also includes selectionMode and selectionBehavior bc it extends from TagGroupProps. should those be omitted?

@@ -1 +1,3 @@
export {Attachment, AttachmentList} from '../src/AttachmentList';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need individual subpath exports for this package? I'm not sure why you'd use only one component. They are all related to each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants