Skip to content

Commit

Permalink
fix: change inline to variant
Browse files Browse the repository at this point in the history
  • Loading branch information
mitrotasios committed Jan 15, 2023
1 parent 1243a9d commit 0df977d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 15 deletions.
8 changes: 1 addition & 7 deletions src/components/input-elements/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ const Button = ({
"DeprecationWarning: The `importance` property is deprecated and will be removed in the next major release. Please use `variant` instead."
);
}
if (importance) {
console.warn(
"DeprecationWarning: The `importance` property is deprecated and will be removed \
in the next major release. Please use `variant` instead."
);
}

const Icon = icon;
const buttonImportance = importance ?? Importances.Primary;
Expand All @@ -154,7 +148,7 @@ const Button = ({
iconSizes[buttonSize].width
);
const buttonShapeStyles =
variant !== "inline"
variant !== "light"
? classNames(borderRadius.md.all, border.sm.all, boxShadow.sm)
: "";
const buttonColorStyles = isBaseColor(color)
Expand Down
4 changes: 2 additions & 2 deletions src/components/input-elements/Button/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const iconSizes: { [size: string]: Sizing } = {
};

export const getButtonProportions = (variant: ButtonVariant) => {
if (!(variant === "inline")) {
if (!(variant === "light")) {
return {
xs: {
paddingLeft: spacing.md.paddingLeft,
Expand Down Expand Up @@ -159,7 +159,7 @@ export const getButtonColors = (variant: ButtonVariant, color: Color) => {
getColorTheme(color).ring
).focusRingColor,
};
case "inline":
case "light":
return {
textColor: getColorVariantsFromColorThemeValue(
getColorTheme(color).text
Expand Down
4 changes: 2 additions & 2 deletions src/components/input-elements/ButtonInline/ButtonInline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* NOTE: The ButtonInline component is deprecated and will be removed in the next major release.
* Please refer to the variant="inline" property of the Button component instead.
* Please refer to the variant="light" property of the Button component instead.
*/

import React from "react";
Expand Down Expand Up @@ -65,7 +65,7 @@ const ButtonInline = ({
children,
}: ButtonInlineProps) => {
console.warn(
"DeprecationWarning: The `ButtonInline` component is deprecated and will be removed in the next major release. Please use `<Button variant='inline'>` instead."
"DeprecationWarning: The `ButtonInline` component is deprecated and will be removed in the next major release. Please use `<Button variant='light'>` instead."
);

if (handleClick) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/inputTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type VerticalPosition = "top" | "bottom";

export type Importance = "primary" | "secondary";

export type ButtonVariant = "primary" | "secondary" | "inline";
export type ButtonVariant = "primary" | "secondary" | "light";

export type RelativeFilterOption = "tdy" | "w" | "t" | "m" | "y" | null;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const Importances: { [key: string]: Importance } = {
export const ButtonVariants: { [key: string]: ButtonVariant } = {
Primary: "primary",
Secondary: "secondary",
Inline: "inline",
Light: "light",
};

export const HorizontalPositions: { [key: string]: HorizontalPosition } = {
Expand Down
4 changes: 2 additions & 2 deletions src/stories/input-elements/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const SizesTemplate: ComponentStory<typeof Button> = (args) => (
{...args}
size={size}
text="Button"
variant="inline"
variant="light"
icon={MyIcon}
iconPosition="right"
/>
Expand All @@ -62,7 +62,7 @@ const ColorsTemplate: ComponentStory<typeof Button> = (args) => (
<Button {...args} color={color} text={color} />
<Button {...args} color={color} text={color} icon={MyIcon} />
<Button {...args} color={color} text={color} variant="secondary" />
<Button {...args} color={color} text={color} variant="inline" />
<Button {...args} color={color} text={color} variant="light" />
</>
))}
</ColGrid>
Expand Down

0 comments on commit 0df977d

Please sign in to comment.