Skip to content

Commit

Permalink
fix(MultiButton): add button sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
HQFOX authored and francisco-guilherme committed Mar 6, 2024
1 parent afe3ab0 commit dfaddaf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions packages/core/src/MultiButton/MultiButton.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { createClasses } from "../utils/classes";
export const { staticClasses, useClasses } = createClasses("HvMultiButton", {
root: {
display: "flex",
height: 32,
alignItems: "center",
transition: "none",
background: theme.colors.atmo2,
Expand All @@ -18,7 +17,6 @@ export const { staticClasses, useClasses } = createClasses("HvMultiButton", {
},

"& button$button": {
height: 32,
width: "100%",
minWidth: 32,
maxWidth: 200,
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/MultiButton/MultiButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { cloneElement } from "react";

import { useDefaultProps } from "../hooks/useDefaultProps";
import { HvButtonVariant } from "../Button";
import { HvButtonSize, HvButtonVariant } from "../Button";
import { HvBaseProps } from "../types/generic";
import { ExtractNames } from "../utils/classes";

Expand All @@ -19,6 +19,9 @@ export interface HvMultiButtonProps extends HvBaseProps {
variant?: HvButtonVariant;
/** A Jss Object used to override or extend the styles applied to the component. */
classes?: HvMultiButtonClasses;
/** Button size. */
size?: HvButtonSize;
split?: boolean;
}

export const HvMultiButton = (props: HvMultiButtonProps) => {
Expand All @@ -29,6 +32,7 @@ export const HvMultiButton = (props: HvMultiButtonProps) => {
disabled = false,
vertical = false,
variant = "secondarySubtle",
size,
...others
} = useDefaultProps("HvMultiButton", props);
const { classes, cx } = useClasses(classesProp);
Expand All @@ -39,6 +43,7 @@ export const HvMultiButton = (props: HvMultiButtonProps) => {
classes.root,
{
[classes.vertical]: vertical,
[classes[variant]]: variant,
},
className
)}
Expand All @@ -51,6 +56,7 @@ export const HvMultiButton = (props: HvMultiButtonProps) => {
return cloneElement(child as React.ReactElement, {
variant,
disabled: disabled || child.props.disabled,
size,
className: cx(child.props.className, classes.button, {
[classes.selected]: childIsSelected,
}),
Expand Down

0 comments on commit dfaddaf

Please sign in to comment.