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.7",
"version": "0.0.8",
"description": "system.css theme wrapped for React",
"type": "module",
"main": "dist/index.cjs.js",
Expand Down
12 changes: 0 additions & 12 deletions src/button/__test__/Button.test.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export type * from "./modeless";
export * from "./select";
export type * from "./select";

export * from "./textbox";
export type * from "./textbox";

export * from "./window";
export type * from "./window";

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

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

const TextBox: React.FC<TextBoxProps> = (props) => {
return (
<div>
<label htmlFor={props.id}>{props.label}</label>
<br />
<input {...props} />
<br />
</div>
);
};

export default TextBox;
41 changes: 41 additions & 0 deletions src/textbox/__docs__/Example.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { FC } from "react";
import TextBox from "..";

export type ExampleProps = {};

const Example: FC<ExampleProps> = ({}) => {
return (
<div
style={{
display: "flex",
justifyContent: "flex-start",
alignItems: "center",
height: "100%",
width: "50rem",
}}
>
<form>
<TextBox
label="A defaulted textbox"
id="id1"
defaultValue="a default value"
/>
<br />
<TextBox
label="This has a placeholder"
id="id2"
placeholder="some placeholder!"
/>
<br />
<TextBox
label="This one is disabled"
id="id3"
disabled
placeholder="you can't change me"
/>
</form>
</div>
);
};

export default Example;
14 changes: 14 additions & 0 deletions src/textbox/__docs__/TextBox.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: "TextBox",
component: Example,
};

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

export const Primary: Story = {
args: {},
};
4 changes: 4 additions & 0 deletions src/textbox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import TextBox from "./TextBox";
export type { TextBoxProps } from "./TextBox";

export default TextBox;