Skip to content

Commit

Permalink
fix: remove isFullWidth from button
Browse files Browse the repository at this point in the history
  • Loading branch information
receter committed Oct 1, 2024
1 parent 9ee341f commit a7287af
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions packages/ui/fixtures/Button.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default function ButtonFixture() {
defaultValue: "default",
});
const [isDisabled] = useValue("Disabled", { defaultValue: false });
const [isFullWidth] = useValue("isFullWidth", { defaultValue: false });
const refButton = useRef(null);
return (
<>
Expand All @@ -36,7 +35,6 @@ export default function ButtonFixture() {
}}
size={size === "default" ? undefined : size}
variant={variant === "default" ? undefined : variant}
isFullWidth={isFullWidth}
disabled={isDisabled}
>
{withIcon && <SvgIconFocusLog className={classInlineIcon} />}
Expand All @@ -48,7 +46,6 @@ export default function ButtonFixture() {
href="https://github.com/receter/sys42"
size={size === "default" ? undefined : size}
variant={variant === "default" ? undefined : variant}
isFullWidth={isFullWidth}
title="Go to GitHub"
>
{withIcon && <SvgIconFocusLog className={classInlineIcon} />}
Expand Down
4 changes: 0 additions & 4 deletions packages/ui/lib/Button/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,3 @@ a.button {
)
calc(var(--sys42-button_lg-padding-vert) - var(--sys42-button-border-width));
}

.button_fullWidth {
width: 100%;
}
4 changes: 1 addition & 3 deletions packages/ui/lib/Button/useButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ import styles from "./styles.module.css";
export type ButtonProps<ElemProps> = BaseButtonProps<ElemProps> & {
variant?: "primary";
size?: "lg";
isFullWidth?: boolean;
};

export function useButton<
Props extends ButtonProps<HTMLAttributes<HTMLElement>>,
Elem extends HTMLElement,
>(options: UseBaseButtonOptions<Props, Elem>) {
const { variant, size, isFullWidth, ...restProps } = options.props;
const { variant, size, ...restProps } = options.props;

const button = useBaseButton({
...options,
Expand All @@ -31,7 +30,6 @@ export function useButton<
button.buttonProps.className,
variant === "primary" && styles.button_primary,
size === "lg" && styles.button_lg,
isFullWidth && styles.button_fullWidth,
styles.button,
);

Expand Down

0 comments on commit a7287af

Please sign in to comment.