♻️(react) update Button component props and refactor related components

This commit modifies the Button component to switch the `variant` and
`color` props, ensuring consistency across various components that
utilize the Button. The changes include updates in the Alert, Modal,
Tooltip, and other components to reflect this new prop structure.
Additionally, several test and story files have been adjusted to
accommodate these changes, enhancing the overall component architecture.
This commit is contained in:
Nathan Panchout
2025-09-18 15:19:01 +02:00
committed by NathanVss
parent f93a83655c
commit 748d070bd9
27 changed files with 186 additions and 186 deletions

View File

@@ -97,7 +97,7 @@ describe("<Toast />", () => {
<Button
onClick={() =>
toast("Toast content", VariantType.NEUTRAL, {
actions: <Button color="tertiary">Tertiary</Button>,
actions: <Button variant="tertiary">Tertiary</Button>,
})
}
>

View File

@@ -78,8 +78,8 @@ export const InfoCustom: Story = {
type: VariantType.INFO,
actions: (
<>
<Button color="primary">Primary</Button>
<Button color="secondary">Secondary</Button>
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
</>
),
},

View File

@@ -45,7 +45,7 @@ export const Toast = (props: ToastProps) => {
const removeAfterAnimation = async () => {
await Promise.allSettled(
container.current!.getAnimations().map((animation) => animation.finished),
container.current!.getAnimations().map((animation) => animation.finished)
);
props.onDelete?.();
};
@@ -71,7 +71,7 @@ export const Toast = (props: ToastProps) => {
{props.primaryLabel && (
<div className="c__toast__content__buttons">
<Button
color="primary"
variant="primary"
onClick={props.primaryOnClick}
{...props.primaryProps}
>