Skip to content

Commit

Permalink
feat(ButtonTertiary): re-add neutral color variant
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Jul 13, 2024
1 parent 2dc2be2 commit 2edc0b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/ButtonTertiary.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const Sizes = {
export const Colors = {
render: () => (
<div className="flex flex-wrap gap-4">
<ButtonTertiary color="neutral">Neutral</ButtonTertiary>
<ButtonTertiary color="accent">Accent</ButtonTertiary>
<ButtonTertiary color="danger">Danger</ButtonTertiary>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/ButtonTertiary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { Button, type ButtonProps } from "./Button";

export interface ButtonTertiaryProps extends ButtonProps {
size?: "sm" | "md" | "lg";
color?: "accent" | "danger";
color?: "neutral" | "accent" | "danger";
}

export const ButtonTertiary = forwardRef(function ButtonTertiary(
{ size = "md", color = "accent", className, ...props }: ButtonTertiaryProps,
{ size = "md", color = "neutral", className, ...props }: ButtonTertiaryProps,
ref: React.ForwardedRef<HTMLButtonElement>,
) {
return (
Expand All @@ -19,6 +19,8 @@ export const ButtonTertiary = forwardRef(function ButtonTertiary(
className={clsx(
className,
"bg-ui-neutral-50 font-medium ring-1 ring-inset",
color === "neutral" &&
"text-ui-neutral-950 ring-ui-neutral-600 active:bg-ui-neutral-100",
color === "accent" &&
"text-ui-accent-700 ring-ui-accent-600 active:bg-ui-accent-100",
color === "danger" &&
Expand Down
2 changes: 2 additions & 0 deletions src/docs/sample.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Unstyled } from "@storybook/blocks";
import { Alert } from "../components/Alert";
import { ButtonPrimary } from "../components/ButtonPrimary";
import { ButtonSecondary } from "../components/ButtonSecondary";
import { ButtonTertiary } from "../components/ButtonTertiary";
import { Input } from "../components/Input";

<Unstyled>
Expand All @@ -15,6 +16,7 @@ import { Input } from "../components/Input";
<div className="flex flex-wrap gap-2">
<Input size="sm" placeholder="Placeholder" />
<ButtonPrimary size="sm">Ok</ButtonPrimary>
<ButtonTertiary size="sm">Cancel</ButtonTertiary>
</div>
</div>
</Alert>
Expand Down

0 comments on commit 2edc0b3

Please sign in to comment.