Skip to content

Commit

Permalink
Improve and combine changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesricky committed Jan 17, 2025
1 parent ceefaa6 commit 5da9b57
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
35 changes: 27 additions & 8 deletions .changeset/olive-fans-invite.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,37 @@
"@comet/admin": minor
---

Add new `Button` with optional responsive behavior to use in favor of MUI's `Button`
Add a new `Button` component to replace `ToolbarActionButton` and MUI's `Button`

When setting the `responsive` prop, the button will only show the icon on mobile and show the text content in a tooltip.

This works the same as MUI's `Button` component, with the exception of the `variant` and `color` props that are not supported in the same way.
This `Button` only supports values for `variant` that are defined by the Comet design guidelines, the `color` prop cannot be used.
Compared to MUI's `Button` component, the `color` prop has been removed, and the `variant` prop now defines those variants, defined by the Comet design guidelines.

```diff
-import { Button } from "@mui/material";
+import { Button } from "@comet/admin";

const MyComponent = () => {
return <Button onClick={() => console.log("Hello")}>Hello</Button>;
};
export const Foo = () => {
return (
- <Button variant="contained" color="primary">
+ <Button variant="primary">
Hello
</Button>
);
};
```

**Responsive behavior**

`ToolbarActionButton` is now deprecated.
Previously, `ToolbarActionButton` would hide its text content on mobile and add it with a tooltip instead.
This behavior can now be achieved by setting the `responsive` prop on the `Button` component.

```diff
-import { ToolbarActionButton } from "@comet/admin/lib/common/toolbar/actions/ToolbarActionButton";
+import { Button } from "@comet/admin";
import { Favorite } from "@comet/admin-icons";

const Foo = () => {
- return <ToolbarActionButton startIcon={<Favorite />}>Hello</ToolbarActionButton>;
+ return <Button responsive startIcon={<Favorite />}>Hello</Button>;
};
```
7 changes: 0 additions & 7 deletions .changeset/sweet-dancers-exist.md

This file was deleted.

0 comments on commit 5da9b57

Please sign in to comment.