diff --git a/src/components/button-group/button-group.stories.tsx b/src/components/button-group/button-group.stories.tsx new file mode 100644 index 00000000..86d965d5 --- /dev/null +++ b/src/components/button-group/button-group.stories.tsx @@ -0,0 +1,34 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import React from "react"; +import { ButtonGroup } from "./button-group"; + +const meta: Meta = { + title: "ButtonGroup", + component: ButtonGroup, + parameters: { + options: { + showPanel: false, + }, + }, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + render: () => ( + + Normal + + Disabled + + + Active + + + Active & Disabled + + Button 1 + + ), +}; diff --git a/src/components/button-group/button-group.tsx b/src/components/button-group/button-group.tsx new file mode 100644 index 00000000..db983eb7 --- /dev/null +++ b/src/components/button-group/button-group.tsx @@ -0,0 +1,42 @@ +import React from "react"; +import { classNames } from "../../util/class-names"; + +interface ButtonProps extends React.ComponentPropsWithoutRef<"button"> { + children?: React.ReactNode; + type: "button" | "submit" | "reset"; + isActive?: boolean; +} + +const Button = ({ children, type, isActive, ...props }: ButtonProps) => { + return ( + + ); +}; + +interface ButtonGroupProps { + children?: React.ReactNode; +} + +const ButtonGroup = ({ children }: ButtonGroupProps) => { + return ( +
+ {children} +
+ ); +}; + +ButtonGroup.Button = Button; + +export { ButtonGroup }; diff --git a/src/components/button-group/index.tsx b/src/components/button-group/index.tsx new file mode 100644 index 00000000..4f0b2848 --- /dev/null +++ b/src/components/button-group/index.tsx @@ -0,0 +1 @@ +export { ButtonGroup } from "./button-group"; diff --git a/src/components/index.ts b/src/components/index.ts index 127369c9..e715c11c 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -29,3 +29,4 @@ export { Toggle } from "./toggle"; export { Tooltip } from "./tooltip"; export { TopBar } from "./top-bar"; export { Disclosure } from "./disclosure"; +export { ButtonGroup } from "./button-group";