Skip to content

Commit

Permalink
feat!: remove unstable variants (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki authored Jan 22, 2025
1 parent 3d4809c commit de3184d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 49 deletions.
3 changes: 0 additions & 3 deletions src/components/Button/ActionButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ const VARIANTS = enumValues<ActionButtonProps["variant"]>({
tertiary: true,
bordered: true,
text: true,
unstable_noBorder: true,
unstable_inverted: true,
unstable_success: true,
})
const STABLE_VARIANTS = VARIANTS.filter((v) => !v.startsWith("unstable"))
const SIZES = enumValues<ActionButtonProps["size"]>({
Expand Down
3 changes: 0 additions & 3 deletions src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const VARIANTS = enumValues<ButtonProps["variant"]>({
tertiary: true,
bordered: true,
text: true,
unstable_noBorder: true,
unstable_inverted: true,
unstable_success: true,
})
const STABLE_VARIANTS = VARIANTS.filter((v) => !v.startsWith("unstable"))
const SIZES = enumValues<ButtonProps["size"]>({
Expand Down
44 changes: 1 addition & 43 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ import {
LinkAdapterPropsOverrides,
} from "../LinkAdapter/LinkAdapter"

type ButtonVariant =
| "primary"
| "secondary"
| "tertiary"
| "text"
| "bordered"
| "unstable_noBorder"
| "unstable_inverted"
| "unstable_success"
type ButtonVariant = "primary" | "secondary" | "tertiary" | "text" | "bordered"
type ButtonSize = "small" | "medium" | "large"
type ButtonEdge = "circular" | "rounded" | "none"

Expand Down Expand Up @@ -152,22 +144,6 @@ const buttonStyles = (props: ButtonStyleProps & { theme: Theme }) => {
boxShadow: "none",
},
},
variant === "unstable_success" && {
backgroundColor: colors.darkGreen,
color: colors.white,
border: "none",
/* Shadow/04dp */
boxShadow:
"0px 2px 4px 0px rgba(37, 38, 43, 0.10), 0px 3px 8px 0px rgba(37, 38, 43, 0.12)",
":hover:not(:disabled)": {
backgroundColor: colors.darkGreen,
boxShadow: "none",
},
":disabled": {
backgroundColor: colors.silverGray,
boxShadow: "none",
},
},
variant === "secondary" && {
color: colors.red,
backgroundColor: "transparent",
Expand Down Expand Up @@ -207,18 +183,6 @@ const buttonStyles = (props: ButtonStyleProps & { theme: Theme }) => {
color: colors.silverGrayDark,
},
},
variant === "unstable_noBorder" && {
backgroundColor: colors.white,
color: colors.darkGray2,
border: "none",
":hover:not(:disabled)": {
// darkGray1 at 6% alpha
backgroundColor: "rgba(64, 70, 76, 0.06)",
},
":disabled": {
color: colors.silverGray,
},
},
variant === "tertiary" && {
color: colors.darkGray2,
border: "none",
Expand All @@ -231,12 +195,6 @@ const buttonStyles = (props: ButtonStyleProps & { theme: Theme }) => {
color: colors.silverGrayLight,
},
},
variant === "unstable_inverted" && {
backgroundColor: colors.white,
color: colors.mitRed,
borderColor: colors.mitRed,
borderStyle: "solid",
},
// edge
edge === "rounded" && {
borderRadius: "4px",
Expand Down

0 comments on commit de3184d

Please sign in to comment.