Skip to content

Commit

Permalink
Merge pull request #34 from mittwald/feature/text
Browse files Browse the repository at this point in the history
Add Text component
  • Loading branch information
Lisa18289 authored Dec 7, 2023
2 parents 216e80c + e7af00d commit b4ec73b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "module",
"exports": {
"./Button": "./dist/Button.js",
"./Text": "./dist/Text.js",
"./style": "./dist/style.css",
"./style/init": "./dist/index.js"
},
Expand Down
5 changes: 0 additions & 5 deletions packages/components/src/components/Dummy/Dummy.tsx

This file was deleted.

1 change: 0 additions & 1 deletion packages/components/src/components/Dummy/index.ts

This file was deleted.

11 changes: 11 additions & 0 deletions packages/components/src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React, { FC, PropsWithChildren } from "react";
import styles from "./styles.module.css";
import * as Aria from "react-aria-components";

export const Text: FC<PropsWithChildren> = (props) => {
const { children } = props;

return <Aria.Text className={styles.root}>{children}</Aria.Text>;
};

export default Text;
1 change: 1 addition & 0 deletions packages/components/src/components/Text/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Text";
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Meta, StoryObj } from "@storybook/react";
import Text from "../Text";

const meta: Meta<typeof Text> = {
title: "Text",
component: Text,
};
export default meta;

type Story = StoryObj<typeof Text>;

export const Default: Story = {
args: {
children: "Text...",
},
};
4 changes: 4 additions & 0 deletions packages/components/src/components/Text/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "@/styles";

.root {
}
1 change: 1 addition & 0 deletions packages/components/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./Button/index.js";
export * from "./Text/index.js";
2 changes: 1 addition & 1 deletion packages/components/vite.build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineConfig(
lib: {
entry: [
"./src/components/Button/Button.tsx",
"./src/components/Dummy/Dummy.tsx",
"./src/components/Text/Text.tsx",
],
formats: ["es"],
},
Expand Down

0 comments on commit b4ec73b

Please sign in to comment.