diff --git a/packages/ui-card/README.md b/packages/ui-card/README.md new file mode 100644 index 00000000..baa511c4 --- /dev/null +++ b/packages/ui-card/README.md @@ -0,0 +1,3 @@ +# @versini/ui-card + +A simple card component for React. diff --git a/packages/ui-card/package.json b/packages/ui-card/package.json new file mode 100644 index 00000000..e4a7213e --- /dev/null +++ b/packages/ui-card/package.json @@ -0,0 +1,50 @@ +{ + "name": "@versini/ui-card", + "version": "0.0.0", + "license": "MIT", + "author": "Arno Versini", + "publishConfig": { + "access": "public" + }, + "homepage": "https://github.com/aversini/ui-components", + "repository": { + "type": "git", + "url": "git@github.com:aversini/ui-components.git" + }, + "type": "module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": ["dist"], + "scripts": { + "build:check": "tsc", + "build:js": "vite build", + "build:types": "tsup", + "build": "npm-run-all --serial clean build:check build:js build:types", + "clean": "rimraf dist tmp", + "dev:js": "vite build --watch --mode development", + "dev:types": "tsup --watch src", + "dev": "npm-run-all clean --parallel dev:js dev:types", + "lint": "biome lint src", + "start": "static-server dist --port 5173", + "test:coverage:ui": "vitest --coverage --ui", + "test:coverage": "vitest run --coverage", + "test:watch": "vitest", + "test": "vitest run" + }, + "peerDependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@versini/ui-styles": "workspace:../ui-styles" + }, + "dependencies": { + "@floating-ui/react": "0.26.24", + "@tailwindcss/typography": "0.5.15", + "@versini/ui-hooks": "workspace:../ui-hooks", + "@versini/ui-private": "workspace:../ui-private", + "clsx": "2.1.1", + "tailwindcss": "3.4.11" + }, + "sideEffects": ["**/*.css"] +} diff --git a/packages/ui-card/postcss.config.cjs b/packages/ui-card/postcss.config.cjs new file mode 100644 index 00000000..e873f1a4 --- /dev/null +++ b/packages/ui-card/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/packages/ui-card/src/common/constants.ts b/packages/ui-card/src/common/constants.ts new file mode 100644 index 00000000..a0be43a0 --- /dev/null +++ b/packages/ui-card/src/common/constants.ts @@ -0,0 +1 @@ +export const CARD_CLASSNAME = "av-card"; diff --git a/packages/ui-components/src/components/Card/Card.tsx b/packages/ui-card/src/components/Card/Card.tsx similarity index 100% rename from packages/ui-components/src/components/Card/Card.tsx rename to packages/ui-card/src/components/Card/Card.tsx diff --git a/packages/ui-components/src/components/Card/CardTypes.d.ts b/packages/ui-card/src/components/Card/CardTypes.d.ts similarity index 100% rename from packages/ui-components/src/components/Card/CardTypes.d.ts rename to packages/ui-card/src/components/Card/CardTypes.d.ts diff --git a/packages/ui-components/src/components/Card/__tests__/Card.test.tsx b/packages/ui-card/src/components/Card/__tests__/Card.test.tsx similarity index 100% rename from packages/ui-components/src/components/Card/__tests__/Card.test.tsx rename to packages/ui-card/src/components/Card/__tests__/Card.test.tsx diff --git a/packages/ui-components/src/components/Card/utilities.ts b/packages/ui-card/src/components/Card/utilities.ts similarity index 100% rename from packages/ui-components/src/components/Card/utilities.ts rename to packages/ui-card/src/components/Card/utilities.ts diff --git a/packages/ui-card/src/components/index.ts b/packages/ui-card/src/components/index.ts new file mode 100644 index 00000000..199d7bbb --- /dev/null +++ b/packages/ui-card/src/components/index.ts @@ -0,0 +1,2 @@ +export * from "../common/constants"; +export * from "./Card/Card"; diff --git a/packages/ui-card/src/index.css b/packages/ui-card/src/index.css new file mode 100644 index 00000000..b5c61c95 --- /dev/null +++ b/packages/ui-card/src/index.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/packages/ui-card/src/style.ts b/packages/ui-card/src/style.ts new file mode 100644 index 00000000..3a29aed1 --- /dev/null +++ b/packages/ui-card/src/style.ts @@ -0,0 +1 @@ +import "./index.css"; diff --git a/packages/ui-card/src/vite-env.d.ts b/packages/ui-card/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/packages/ui-card/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/ui-card/tailwind.config.js b/packages/ui-card/tailwind.config.js new file mode 100644 index 00000000..42ba260d --- /dev/null +++ b/packages/ui-card/tailwind.config.js @@ -0,0 +1,2 @@ +import { commonTailwindConfigForComponent } from "../../configuration/tailwind.common"; +export default commonTailwindConfigForComponent(); diff --git a/packages/ui-card/tsconfig.json b/packages/ui-card/tsconfig.json new file mode 100644 index 00000000..652d144c --- /dev/null +++ b/packages/ui-card/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../configuration/tsconfig.common.json", + "include": ["src"] +} diff --git a/packages/ui-card/tsup.config.ts b/packages/ui-card/tsup.config.ts new file mode 100644 index 00000000..7490cbb5 --- /dev/null +++ b/packages/ui-card/tsup.config.ts @@ -0,0 +1,2 @@ +import { commonTsupConfig } from "../../configuration/tsup.common"; +export default commonTsupConfig; diff --git a/packages/ui-card/vite.config.ts b/packages/ui-card/vite.config.ts new file mode 100644 index 00000000..39de7539 --- /dev/null +++ b/packages/ui-card/vite.config.ts @@ -0,0 +1,6 @@ +import { commonViteConfigForComponent } from "../../configuration/vite.common"; + +export default commonViteConfigForComponent({ + globalComponentName: "__VERSINI_UI_CARD__", + globalLibraryName: "UICard", +}); diff --git a/packages/ui-card/vitest.config.js b/packages/ui-card/vitest.config.js new file mode 100644 index 00000000..028e7ef7 --- /dev/null +++ b/packages/ui-card/vitest.config.js @@ -0,0 +1,4 @@ +import { commonVitestConfig } from "../../configuration/vitestconfig.common"; +import viteConfig from "./vite.config"; + +export default commonVitestConfig(viteConfig); diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index c21c74e7..4e51cb79 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -14,9 +14,7 @@ "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", - "files": [ - "dist" - ], + "files": ["dist"], "scripts": { "build:check": "tsc", "build:js": "vite build", @@ -50,13 +48,12 @@ "@versini/ui-anchor": "workspace:../ui-anchor", "@versini/ui-button": "workspace:../ui-button", "@versini/ui-bubble": "workspace:../ui-bubble", + "@versini/ui-card": "workspace:../ui-card", "@versini/ui-hooks": "workspace:../ui-hooks", "@versini/ui-icons": "workspace:../ui-icons", "@versini/ui-private": "workspace:../ui-private", "clsx": "2.1.1", "tailwindcss": "3.4.11" }, - "sideEffects": [ - "**/*.css" - ] + "sideEffects": ["**/*.css"] } diff --git a/packages/ui-components/src/components/index.ts b/packages/ui-components/src/components/index.ts index a12bef15..803ed4ed 100644 --- a/packages/ui-components/src/components/index.ts +++ b/packages/ui-components/src/components/index.ts @@ -1,8 +1,8 @@ import { Anchor } from "@versini/ui-anchor"; import { Bubble } from "@versini/ui-bubble"; import { Button, ButtonIcon } from "@versini/ui-button"; +import { Card } from "@versini/ui-card"; -import { Card } from "./Card/Card"; import { Footer } from "./Footer/Footer"; import { Header } from "./Header/Header"; import { Main } from "./Main/Main"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd1d042f..797be228 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -264,6 +264,37 @@ importers: specifier: workspace:../ui-styles version: link:../ui-styles + packages/ui-card: + dependencies: + '@floating-ui/react': + specifier: 0.26.24 + version: 0.26.24(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@tailwindcss/typography': + specifier: 0.5.15 + version: 0.5.15(tailwindcss@3.4.11) + '@versini/ui-hooks': + specifier: workspace:../ui-hooks + version: link:../ui-hooks + '@versini/ui-private': + specifier: workspace:../ui-private + version: link:../ui-private + clsx: + specifier: 2.1.1 + version: 2.1.1 + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + tailwindcss: + specifier: 3.4.11 + version: 3.4.11 + devDependencies: + '@versini/ui-styles': + specifier: workspace:../ui-styles + version: link:../ui-styles + packages/ui-components: dependencies: '@floating-ui/react': @@ -281,6 +312,9 @@ importers: '@versini/ui-button': specifier: workspace:../ui-button version: link:../ui-button + '@versini/ui-card': + specifier: workspace:../ui-card + version: link:../ui-card '@versini/ui-hooks': specifier: workspace:../ui-hooks version: link:../ui-hooks