Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"version": "0.0.8",
"version": "0.0.9",
"description": "system.css theme wrapped for React",
"type": "module",
"main": "dist/index.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion src/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import styles from "../styles";

export type ButtonProps = React.ComponentProps<"button"> & {
export type ButtonProps = Omit<React.ComponentProps<"button">, "className"> & {
primary?: boolean;
};

Expand Down
17 changes: 17 additions & 0 deletions src/checkbox/CheckBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import "@sakun/system.css";

export type CheckBoxProps = Omit<React.ComponentProps<"input">, "type"> & {
label: string;
};

const CheckBox: React.FC<CheckBoxProps> = (props) => {
return (
<div>
<input {...props} type="checkbox" />
<label htmlFor={props.id}>{props.label}</label>
</div>
);
};

export default CheckBox;
14 changes: 14 additions & 0 deletions src/checkbox/__docs__/CheckBox.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Meta, StoryObj } from "@storybook/react";
import Example from "./Example";

const meta: Meta<typeof Example> = {
title: "CheckBox",
component: Example,
};

export default meta;
type Story = StoryObj<typeof Example>;

export const Primary: Story = {
args: {},
};
26 changes: 26 additions & 0 deletions src/checkbox/__docs__/Example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React, { FC } from "react";
import CheckBox from "..";

export type ExampleProps = {};

const Example: FC<ExampleProps> = ({}) => {
return (
<div
style={{
display: "flex",
justifyContent: "flex-start",
alignItems: "center",
height: "100%",
width: "50rem",
}}
>
<form>
<CheckBox label="A defaulted textbox" id="id1" defaultChecked />
<CheckBox label="This has a placeholder" id="id2" />
<CheckBox label="This one is disabled" id="id3" disabled />
</form>
</div>
);
};

export default Example;
4 changes: 4 additions & 0 deletions src/checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import CheckBox from "./CheckBox";
export type { CheckBoxProps } from "./CheckBox";

export default CheckBox;
2 changes: 1 addition & 1 deletion src/textbox/TextBox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import "@sakun/system.css";

export type TextBoxProps = React.ComponentProps<"input"> & {
export type TextBoxProps = Omit<React.ComponentProps<"input">, "type"> & {
label: string;
};

Expand Down