chore: Audit style props in AI package#10218
Merged
Merged
Conversation
|
Build successful! 🎉 |
Member
|
Sorry I wasn't clear. We should:
Going for easiest path here, not going out of our way to restrict and also not going out of our way to allow. |
also updated chat to be more consistent and other audit todos
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
## API Changes
@react-spectrum/ai/@react-spectrum/ai:Attachment Attachment {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children: ReactNode | (AttachmentRenderProps) => 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
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, TagRenderProps>
routerOptions?: RouterOptions
size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
styles?: StyleString
target?: HTMLAttributeAnchorTarget
uploadProgress?: number
value?: T
variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'
}/@react-spectrum/ai:MessageFeedback MessageFeedback {
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
+ styles?: StylesPropWithHeight
thumbDownLabel?: string
thumbUpLabel?: string
value?: MessageFeedbackValue
}/@react-spectrum/ai:MessageSource MessageSource {
children: ReactNode
defaultExpanded?: boolean
density?: 'compact' | 'regular' | 'spacious' = 'regular'
id?: Key
isDisabled?: boolean
isExpanded?: boolean
label: string
onExpandedChange?: (boolean) => void
size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
- styles?: StyleString
+ styles?: StylesProp
}/@react-spectrum/ai:SourceList SourceList {
+ 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/ai:SourceListItem SourceListItem {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
autoFocus?: boolean
children: React.ReactNode
download?: boolean | string
href?: Href
hrefLang?: string
id?: string
isDisabled?: boolean
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
ping?: string
referrerPolicy?: HTMLAttributeReferrerPolicy
rel?: string
- render?: (DetailedHTMLProps<LinkWithRequiredHref, HTMLAnchorElement> | React.JSX.IntrinsicElements[keyof React.JSX.IntrinsicElements], LinkRenderProps) => ReactElement
routerOptions?: RouterOptions
slot?: string | null
styles?: StyleString
target?: HTMLAttributeAnchorTarget/@react-spectrum/ai:MessageSuggestion MessageSuggestion {
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'
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
styles?: StyleString
type?: 'button' | 'submit' | 'reset' = 'button'
value?: string/@react-spectrum/ai:PromptField PromptField {
- UNSAFE_className?: UnsafeClassName
- UNSAFE_style?: CSSProperties
acceptedAttachmentTypes?: Array<string>
children: React.ReactNode
isGenerating?: boolean
onAddAttachments?: (Array<PromptFieldAttachment>) => void
onStop?: () => void
onSubmit?: (TokenSegmentList, Array<PromptFieldAttachment>) => void
styles?: StyleString
}/@react-spectrum/ai:PromptToken PromptToken {
children: React.ReactNode
className?: ClassNameOrFunction<TokenRenderProps>
- render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, TokenRenderProps>
style?: StyleOrFunction<TokenRenderProps>
}/@react-spectrum/ai:Chat Chat {
children?: ReactNode
- className?: string
- style?: CSSProperties
+ styles?: StyleString
}/@react-spectrum/ai:Thread Thread <T extends {}> {
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (T) => ReactNode
- className?: ClassNameOrFunction<GridListRenderProps> = 'react-aria-GridList'
items?: Iterable<T>
+ styles?: StyleString
}/@react-spectrum/ai:ThreadItem ThreadItem {
children?: ChildrenOrFunction<GridListItemRenderProps>
- className?: ClassNameOrFunction<GridListItemRenderProps> = 'react-aria-GridListItem'
isStreaming?: boolean
shouldAnnounceOnMount?: boolean
+ styles?: StyleString
textValue?: string
}/@react-spectrum/ai:AttachmentProps AttachmentProps {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children: ReactNode | (AttachmentRenderProps) => 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
+ render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, TagRenderProps>
routerOptions?: RouterOptions
size?: 'XS' | 'S' | 'M' | 'L' | 'XL' = 'M'
styles?: StyleString
target?: HTMLAttributeAnchorTarget
uploadProgress?: number
value?: T
variant?: 'primary' | 'secondary' | 'tertiary' | 'quiet' = 'primary'
}/@react-spectrum/ai:PromptFieldProps PromptFieldProps {
- UNSAFE_className?: UnsafeClassName
- UNSAFE_style?: CSSProperties
acceptedAttachmentTypes?: Array<string>
children: React.ReactNode
isGenerating?: boolean
onAddAttachments?: (Array<PromptFieldAttachment>) => void
onStop?: () => void
onSubmit?: (TokenSegmentList, Array<PromptFieldAttachment>) => void
styles?: StyleString
}/@react-spectrum/ai:PromptTokenProps PromptTokenProps {
children: React.ReactNode
className?: ClassNameOrFunction<TokenRenderProps>
- render?: DOMRenderFunction<keyof React.JSX.IntrinsicElements, TokenRenderProps>
style?: StyleOrFunction<TokenRenderProps>
}/@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
+ styles?: StylesPropWithHeight
thumbDownLabel?: string
thumbUpLabel?: string
value?: MessageFeedbackValue
}/@react-spectrum/ai:MessageSourceProps MessageSourceProps {
children: ReactNode
defaultExpanded?: boolean
density?: 'compact' | 'regular' | 'spacious' = 'regular'
id?: Key
isDisabled?: boolean
isExpanded?: boolean
label: string
onExpandedChange?: (boolean) => void
size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
- styles?: StyleString
+ styles?: StylesProp
}/@react-spectrum/ai:SourceListProps SourceListProps {
+ 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/ai:SourceListItemProps SourceListItemProps {
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
autoFocus?: boolean
children: React.ReactNode
download?: boolean | string
href?: Href
hrefLang?: string
id?: string
isDisabled?: boolean
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
ping?: string
referrerPolicy?: HTMLAttributeReferrerPolicy
rel?: string
- render?: (DetailedHTMLProps<LinkWithRequiredHref, HTMLAnchorElement> | React.JSX.IntrinsicElements[keyof React.JSX.IntrinsicElements], LinkRenderProps) => ReactElement
routerOptions?: RouterOptions
slot?: string | null
styles?: StyleString
target?: HTMLAttributeAnchorTarget/@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'
+ size?: 'S' | 'M' | 'L' | 'XL' = 'M'
slot?: string | null
styles?: StyleString
type?: 'button' | 'submit' | 'reset' = 'button'
value?: string/@react-spectrum/ai:ChatProps ChatProps {
children?: ReactNode
- className?: string
- style?: CSSProperties
+ styles?: StyleString
}/@react-spectrum/ai:ThreadProps ThreadProps <T extends {}> {
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (T) => ReactNode
- className?: ClassNameOrFunction<GridListRenderProps> = 'react-aria-GridList'
items?: Iterable<T>
+ styles?: StyleString
}/@react-spectrum/ai:ThreadItemProps ThreadItemProps {
children?: ChildrenOrFunction<GridListItemRenderProps>
- className?: ClassNameOrFunction<GridListItemRenderProps> = 'react-aria-GridListItem'
isStreaming?: boolean
shouldAnnounceOnMount?: boolean
+ styles?: StyleString
textValue?: string
}/@react-spectrum/ai:BasicHorizontalCard+BasicHorizontalCard {
+ 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:CardPreview+CardPreview {
+ children: ReactNode
+ id?: string
+ styles?: StyleString
+}/@react-spectrum/ai:HorizontalCard+HorizontalCard {
+ 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: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'
+} |
devongovett
approved these changes
Jun 17, 2026
reidbarber
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes
Mostly matched everything to PromptField, it seemed the most correct.
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: