Skip to content

Commit

Permalink
fix: transpile to js
Browse files Browse the repository at this point in the history
  • Loading branch information
BayanBennett committed Apr 9, 2023
1 parent a5ba905 commit 8fa678f
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 190 deletions.
465 changes: 301 additions & 164 deletions package-lock.json

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
"name": "@coradion/ui",
"version": "0.0.0",
"description": "A component library for Coradion sites and apps",
"main": "dist/index.ts",
"main": "dist/index.js",
"type": "module",
"exports": {
"./styles.css": "./dist/styles.css",
".": "./dist/index.js",
"./package.json": "./package.json"
},
"files": [
"dist/**/*"
],
Expand All @@ -21,7 +27,8 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"build-tailwind": "npx tailwindcss -i ./src/styles.css -o ./dist/styles.css",
"build": "copyfiles -u 1 -e src/styles.css \"src/**/*\" dist && npm run build-tailwind"
"build-components": "tsc --build",
"build": "npm run build-components && npm run build-tailwind"
},
"author": "Coradion",
"license": "AGPL-3.0-or-later",
Expand All @@ -34,28 +41,25 @@
"@storybook/addon-essentials": "^7.0.2",
"@storybook/addon-interactions": "^7.0.2",
"@storybook/addon-links": "^7.0.2",
"@storybook/addon-styling": "^1.0.0-next.1",
"@storybook/blocks": "^7.0.2",
"@storybook/react": "^7.0.2",
"@storybook/react-webpack5": "^7.0.2",
"@storybook/testing-library": "^0.1.0",
"@storybook/theming": "^7.0.2",
"@tsconfig/strictest": "^2.0.0",
"autoprefixer": "^10.4.14",
"babel-loader": "^8.3.0",
"postcss": "^8.4.21",
"prop-types": "^15.8.1",
"postcss-loader": "^7.2.4",
"storybook": "^7.0.2",
"tailwindcss": "^3.3.1"
"tailwindcss": "^3.3.1",
"typescript": "^5.0.4"
},
"dependencies": {
"@fontsource/public-sans": "^4.5.10",
"@storybook/addon-styling": "^1.0.0-next.1",
"@storybook/theming": "^7.0.2",
"@types/react": "^18.0.33",
"copyfiles": "^2.4.1",
"postcss-loader": "^7.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.0.4"
"react-dom": "^18.2.0"
},
"release": {
"branches": [
Expand Down
3 changes: 2 additions & 1 deletion src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { FunctionComponent, useMemo } from "react";
import React, { useMemo } from "react";
import type { FunctionComponent } from "react";

const getSizeClasses = (size: "small" | "medium" | "large") => {
switch (size) {
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
import "./styles.css";
export * from "./components/Button";
6 changes: 6 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
#__next {
display: contents;
}
}
2 changes: 1 addition & 1 deletion stories/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "../src/components/Button";
import { Button } from "../src";

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
export default {
Expand Down
9 changes: 0 additions & 9 deletions tailwind.config.js

This file was deleted.

17 changes: 17 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Config } from "tailwindcss";

const config: Config = {
content: ["./src/**/*.tsx"],
darkMode: ["class", '[data-mode="dark"]'],
theme: {
extend: {
fontFamily: {
sans: ["var(--font-main)", "sans-serif"],
coradion: ["var(--font-coradion)"],
},
},
},
plugins: [],
};

export default config;
14 changes: 11 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
"extends": "@tsconfig/strictest/tsconfig.json",
"compilerOptions": {
"baseUrl": "src",
"composite": true,
"declaration": true,
"declarationMap": true,
"jsx": "react",
"module": "ESNext",
"jsx": "preserve",
"moduleResolution": "Node"
"moduleResolution": "Node",
"outDir": "dist",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "src",
"target": "ESNext"
},
"include": ["src/**/*", "stories/**/*"]
"include": ["src/**/*"]
}

0 comments on commit 8fa678f

Please sign in to comment.