Skip to content

chore: Ai components followup#10162

Merged
yihuiliao merged 8 commits into
mainfrom
ai-components-followup
Jun 5, 2026
Merged

chore: Ai components followup#10162
yihuiliao merged 8 commits into
mainfrom
ai-components-followup

Conversation

@yihuiliao
Copy link
Copy Markdown
Member

@yihuiliao yihuiliao commented Jun 5, 2026

follow-ups from #10095

main things:

  • export CenterBaseline from S2
  • remove useSpectrumContextProps. make it simpler for now by removing contexts. can decide to add them later
  • remove getAllowedOverrides(), instead we allow users to override anything. i stripped out most of everything in types.ts but kept StyleString bc mergeStyles expects a StyleString. Removed UNSAFE_className and UNSAFE_style since we're going to allow everything

✅ 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:

Spot check storybook

🧢 Your Project:

@github-actions github-actions Bot added the S2 label Jun 5, 2026
@rspbot
Copy link
Copy Markdown

rspbot commented Jun 5, 2026

@rspbot
Copy link
Copy Markdown

rspbot commented Jun 5, 2026

## API Changes

@react-spectrum/s2-ai

/@react-spectrum/s2-ai:BasicHorizontalCard

 BasicHorizontalCard {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   children: ReactNode | (CardRenderProps) => 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
+  styles?: StyleString
   target?: HTMLAttributeAnchorTarget
   textValue?: string
   value?: T
   variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'

/@react-spectrum/s2-ai:HorizontalCard

 HorizontalCard {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   children: ReactNode | (CardRenderProps) => 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
+  styles?: StyleString
   target?: HTMLAttributeAnchorTarget
   textValue?: string
   value?: T
   variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'

/@react-spectrum/s2-ai:MessageFeedback

 MessageFeedback {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   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?: StylesProp
+  styles?: StyleString
   thumbDownLabel?: string
   thumbUpLabel?: string
   value?: MessageFeedbackValue
 }

/@react-spectrum/s2-ai:MessageSuggestion

 MessageSuggestion {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   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?: StylesProp
+  styles?: StyleString
   type?: 'button' | 'submit' | 'reset' = 'button'
   value?: string
 }

/@react-spectrum/s2-ai:MessageSuggestionContext

-MessageSuggestionContext {
-  UNTYPED
-}

/@react-spectrum/s2-ai:MessageSuggestionList

 MessageSuggestionList {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   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?: StylesProp
+  styles?: StyleString
   title: string
 }

/@react-spectrum/s2-ai:MessageSuggestionListContext

-MessageSuggestionListContext {
-  UNTYPED
-}

/@react-spectrum/s2-ai:ResponseStatus

 ResponseStatus {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   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?: StylesProp
+  styles?: StyleString
 }

/@react-spectrum/s2-ai:ResponseStatusPanel

 ResponseStatusPanel {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   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/s2-ai:UserMessage

 UserMessage {
-  UNSAFE_className?: UnsafeClassName
-  UNSAFE_style?: CSSProperties
   aria-describedby?: string
   aria-details?: string
   aria-label?: string
   aria-labelledby?: string
   children: ReactNode
   id?: string
   slot?: string | null
-  styles?: StylesProp
+  styles?: StyleString
 }

@yihuiliao yihuiliao added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit c74c5dd Jun 5, 2026
32 checks passed
@yihuiliao yihuiliao deleted the ai-components-followup branch June 5, 2026 21:34
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