Rename the toast button style props to Sonner's singular names
ZE
10h ago+131+131+012345678901234567890123456789-18-18-01234567890123456789
Closes #7984 (follow-up to #7786).
Renamed action_button_styles and cancel_button_styles on ToastProps to action_button_style and cancel_button_style to match Sonner's keys directly, and removed the _TOAST_STYLE_PROP_ALIASES rename in dict().
- The plural props stay declared (so
NoExtrasAllowedPropsstill accepts them) and forward to the singular fields in__init__with aconsole.deprecatewarning (deprecated in 0.11.1, removed in 1.0). - If both the singular and plural name are passed for the same button, the singular one is used and the plural one still logs the deprecation warning.
- Small behavior note: mutating
props.action_button_stylesafter construction won't get renamed anymore since thedict()rename step is gone. - Added tests in
test_toast.py, the two props intoast.md, a deprecation news fragment, and regenerated the stubs.
Ran pytest, ruff, and pyright (Linux platform) locally. The only failures were 17 symlink tests (WinError 1314) that also fail on main on Windows.
All Submissions:
- Have you followed the guidelines stated in CONTRIBUTING.md file?
- Have you checked to ensure there aren't any other open Pull Requests for the desired changed?
Type of change
- New feature (non-breaking change which adds functionality)
- This change requires a documentation update