adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
13.1k stars 1.14k forks source link

chore: Update S2 Dialog codemods #7388

Closed devongovett closed 1 week ago

devongovett commented 1 week ago

Updated the DialogTrigger/DialogContainer codemods to replace the Dialog child with Popover or FullscreenDialog depending on the type prop, and move other props to the child. Also took this opportunity to fix the spelling error in isDismissable 😄.

rspbot commented 1 week ago

Build successful! 🎉

rspbot commented 1 week ago

Build successful! 🎉

rspbot commented 1 week ago
## API Changes ### @react-spectrum/s2 #### /@react-spectrum/s2:Dialog ```diff Dialog { UNSAFE_className?: string UNSAFE_style?: CSSProperties aria-describedby?: string aria-details?: string aria-label?: string aria-labelledby?: string children?: ReactNode | (DialogRenderProps) => ReactNode id?: string - isDismissable?: boolean + isDismissible?: boolean isKeyboardDismissDisabled?: boolean role?: 'dialog' | 'alertdialog' = 'dialog' size?: 'S' | 'M' | 'L' = 'M' slot?: string | null } ``` #### /@react-spectrum/s2:CustomDialog ```diff CustomDialog { UNSAFE_className?: string UNSAFE_style?: CSSProperties aria-describedby?: string aria-details?: string aria-label?: string aria-labelledby?: string children?: ReactNode | (DialogRenderProps) => ReactNode id?: string - isDismissable?: boolean + isDismissible?: boolean isKeyboardDismissDisabled?: boolean padding?: 'default' | 'none' = 'default' role?: 'dialog' | 'alertdialog' = 'dialog' size?: 'S' | 'M' | 'L' | 'fullscreen' | 'fullscreenTakeover' styles?: StylesProp } ``` #### /@react-spectrum/s2:DialogContainer ```diff DialogContainer { children: ReactNode - isDismissable?: boolean - isKeyboardDismissDisabled?: boolean onDismiss: () => void } ``` #### /@react-spectrum/s2:DialogProps ```diff DialogProps { UNSAFE_className?: string UNSAFE_style?: CSSProperties aria-describedby?: string aria-details?: string aria-label?: string aria-labelledby?: string children?: ReactNode | (DialogRenderProps) => ReactNode id?: string - isDismissable?: boolean + isDismissible?: boolean isKeyboardDismissDisabled?: boolean role?: 'dialog' | 'alertdialog' = 'dialog' size?: 'S' | 'M' | 'L' = 'M' slot?: string | null } ``` #### /@react-spectrum/s2:CustomDialogProps ```diff CustomDialogProps { UNSAFE_className?: string UNSAFE_style?: CSSProperties aria-describedby?: string aria-details?: string aria-label?: string aria-labelledby?: string children?: ReactNode | (DialogRenderProps) => ReactNode id?: string - isDismissable?: boolean + isDismissible?: boolean isKeyboardDismissDisabled?: boolean padding?: 'default' | 'none' = 'default' role?: 'dialog' | 'alertdialog' = 'dialog' size?: 'S' | 'M' | 'L' | 'fullscreen' | 'fullscreenTakeover' styles?: StylesProp } ``` #### /@react-spectrum/s2:DialogContainerProps ```diff DialogContainerProps { children: ReactNode - isDismissable?: boolean - isKeyboardDismissDisabled?: boolean onDismiss: () => void } ``` -----------------------------------
dannify commented 1 week ago

💯 🥇