✨(components) add react repo
This repo only contains a Button which is here only for demonstration purpose. Its purpose is to contain all the future react-based components of the design system.
This commit is contained in:
8
packages/react/src/components/Button/index.scss
Normal file
8
packages/react/src/components/Button/index.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
.c__button {
|
||||
background-color: var(--c--colors--primary);
|
||||
padding: 8px 30px;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
12
packages/react/src/components/Button/index.spec.tsx
Normal file
12
packages/react/src/components/Button/index.spec.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import React from "react";
|
||||
import { Button } from "./index";
|
||||
|
||||
describe("<Button/>", () => {
|
||||
it("renders", () => {
|
||||
render(<Button />);
|
||||
const button = screen.getByRole("button", { name: "<Button/>" });
|
||||
expect(button.classList.contains("c__button")).toBe(true);
|
||||
});
|
||||
});
|
||||
13
packages/react/src/components/Button/index.stories.tsx
Normal file
13
packages/react/src/components/Button/index.stories.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import React from "react";
|
||||
import { Button } from "./index";
|
||||
|
||||
export default {
|
||||
title: "Button",
|
||||
component: Button,
|
||||
} as ComponentMeta<typeof Button>;
|
||||
|
||||
const Template: ComponentStory<typeof Button> = () => <Button />;
|
||||
|
||||
export const Default = Template.bind({});
|
||||
Default.args = {};
|
||||
5
packages/react/src/components/Button/index.tsx
Normal file
5
packages/react/src/components/Button/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from "react";
|
||||
|
||||
export const Button = () => {
|
||||
return <button className="c__button">{"<Button/>"}</button>;
|
||||
};
|
||||
Reference in New Issue
Block a user