diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 280b38d2..3a4d47c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -15,5 +15,7 @@ "packages/ui-header": "1.0.0", "packages/ui-main": "1.0.0", "packages/ui-menu": "1.0.0", - "packages/ui-panel": "1.0.0" + "packages/ui-panel": "1.0.0", + "packages/ui-pill": "0.0.0", + "packages/ui-spinner": "0.0.0" } diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index df3b2a17..f10cef8d 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", @@ -60,10 +58,9 @@ "@versini/ui-panel": "workspace:../ui-panel", "@versini/ui-pill": "workspace:../ui-pill", "@versini/ui-private": "workspace:../ui-private", + "@versini/ui-spinner": "workspace:../ui-spinner", "clsx": "2.1.1", "tailwindcss": "3.4.11" }, - "sideEffects": [ - "**/*.css" - ] + "sideEffects": ["**/*.css"] } diff --git a/packages/ui-components/src/common/constants.ts b/packages/ui-components/src/common/constants.ts deleted file mode 100644 index f502bde9..00000000 --- a/packages/ui-components/src/common/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const BUBBLE_CLASSNAME = "av-bubble"; -export const BUTTON_CLASSNAME = "av-button"; -export const CARD_CLASSNAME = "av-card"; -export const FOOTER_CLASSNAME = "av-footer"; -export const HEADER_CLASSNAME = "av-header"; -export const MAIN_CLASSNAME = "av-main"; -export const MESSAGEBOX_CLASSNAME = "av-messagebox"; -export const PANEL_CLASSNAME = "av-panel"; -export const PILL_CLASSNAME = "av-pill"; -export const SPINNER_CLASSNAME = "av-spinner"; diff --git a/packages/ui-components/src/components/index.ts b/packages/ui-components/src/components/index.ts index ec935e88..bec65dd5 100644 --- a/packages/ui-components/src/components/index.ts +++ b/packages/ui-components/src/components/index.ts @@ -8,8 +8,8 @@ import { Main } from "@versini/ui-main"; import { Menu, MenuItem, MenuSeparator } from "@versini/ui-menu"; import { Panel } from "@versini/ui-panel"; import { Pill } from "@versini/ui-pill"; +import { Spinner } from "@versini/ui-spinner"; -import { Spinner } from "./Spinner/Spinner"; import { Table, TableBody, diff --git a/packages/ui-spinner/README.md b/packages/ui-spinner/README.md new file mode 100644 index 00000000..7d07f9dd --- /dev/null +++ b/packages/ui-spinner/README.md @@ -0,0 +1,3 @@ +# @versini/ui-spinner + +A simple spinner component for React. diff --git a/packages/ui-spinner/package.json b/packages/ui-spinner/package.json new file mode 100644 index 00000000..5f1f977b --- /dev/null +++ b/packages/ui-spinner/package.json @@ -0,0 +1,47 @@ +{ + "name": "@versini/ui-spinner", + "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": { + "@tailwindcss/typography": "0.5.15", + "@versini/ui-private": "workspace:../ui-private", + "tailwindcss": "3.4.11" + }, + "sideEffects": ["**/*.css"] +} diff --git a/packages/ui-spinner/postcss.config.cjs b/packages/ui-spinner/postcss.config.cjs new file mode 100644 index 00000000..e873f1a4 --- /dev/null +++ b/packages/ui-spinner/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/packages/ui-spinner/src/common/constants.ts b/packages/ui-spinner/src/common/constants.ts new file mode 100644 index 00000000..4073439e --- /dev/null +++ b/packages/ui-spinner/src/common/constants.ts @@ -0,0 +1 @@ +export const SPINNER_CLASSNAME = "av-spinner"; diff --git a/packages/ui-components/src/components/Spinner/Spinner.tsx b/packages/ui-spinner/src/components/Spinner/Spinner.tsx similarity index 100% rename from packages/ui-components/src/components/Spinner/Spinner.tsx rename to packages/ui-spinner/src/components/Spinner/Spinner.tsx diff --git a/packages/ui-components/src/components/Spinner/SpinnerTypes.d.ts b/packages/ui-spinner/src/components/Spinner/SpinnerTypes.d.ts similarity index 100% rename from packages/ui-components/src/components/Spinner/SpinnerTypes.d.ts rename to packages/ui-spinner/src/components/Spinner/SpinnerTypes.d.ts diff --git a/packages/ui-components/src/components/Spinner/__tests__/Spinner.test.tsx b/packages/ui-spinner/src/components/Spinner/__tests__/Spinner.test.tsx similarity index 95% rename from packages/ui-components/src/components/Spinner/__tests__/Spinner.test.tsx rename to packages/ui-spinner/src/components/Spinner/__tests__/Spinner.test.tsx index 209e6118..91d78977 100644 --- a/packages/ui-components/src/components/Spinner/__tests__/Spinner.test.tsx +++ b/packages/ui-spinner/src/components/Spinner/__tests__/Spinner.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from "@testing-library/react"; import { Spinner } from "../.."; +import { SPINNER_CLASSNAME } from "../.."; import { expectToHaveClasses } from "../../../../../../configuration/tests-helpers"; -import { SPINNER_CLASSNAME } from "../../../common/constants"; describe("Spinner (exceptions)", () => { it("should be able to require/import from root", () => { diff --git a/packages/ui-spinner/src/components/index.ts b/packages/ui-spinner/src/components/index.ts new file mode 100644 index 00000000..96bdbb64 --- /dev/null +++ b/packages/ui-spinner/src/components/index.ts @@ -0,0 +1,2 @@ +export * from "../common/constants"; +export * from "./Spinner/Spinner"; diff --git a/packages/ui-spinner/src/index.css b/packages/ui-spinner/src/index.css new file mode 100644 index 00000000..b5c61c95 --- /dev/null +++ b/packages/ui-spinner/src/index.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/packages/ui-spinner/src/style.ts b/packages/ui-spinner/src/style.ts new file mode 100644 index 00000000..3a29aed1 --- /dev/null +++ b/packages/ui-spinner/src/style.ts @@ -0,0 +1 @@ +import "./index.css"; diff --git a/packages/ui-spinner/src/vite-env.d.ts b/packages/ui-spinner/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/packages/ui-spinner/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/ui-spinner/tailwind.config.js b/packages/ui-spinner/tailwind.config.js new file mode 100644 index 00000000..42ba260d --- /dev/null +++ b/packages/ui-spinner/tailwind.config.js @@ -0,0 +1,2 @@ +import { commonTailwindConfigForComponent } from "../../configuration/tailwind.common"; +export default commonTailwindConfigForComponent(); diff --git a/packages/ui-spinner/tsconfig.json b/packages/ui-spinner/tsconfig.json new file mode 100644 index 00000000..652d144c --- /dev/null +++ b/packages/ui-spinner/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../configuration/tsconfig.common.json", + "include": ["src"] +} diff --git a/packages/ui-spinner/tsup.config.ts b/packages/ui-spinner/tsup.config.ts new file mode 100644 index 00000000..7490cbb5 --- /dev/null +++ b/packages/ui-spinner/tsup.config.ts @@ -0,0 +1,2 @@ +import { commonTsupConfig } from "../../configuration/tsup.common"; +export default commonTsupConfig; diff --git a/packages/ui-spinner/vite.config.ts b/packages/ui-spinner/vite.config.ts new file mode 100644 index 00000000..f23a2b78 --- /dev/null +++ b/packages/ui-spinner/vite.config.ts @@ -0,0 +1,2 @@ +import { commonViteConfigForComponent } from "../../configuration/vite.common"; +export default commonViteConfigForComponent(); diff --git a/packages/ui-spinner/vitest.config.js b/packages/ui-spinner/vitest.config.js new file mode 100644 index 00000000..028e7ef7 --- /dev/null +++ b/packages/ui-spinner/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/pnpm-lock.yaml b/pnpm-lock.yaml index d3c75922..b58c1aa4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -342,6 +342,9 @@ importers: '@versini/ui-private': specifier: workspace:../ui-private version: link:../ui-private + '@versini/ui-spinner': + specifier: workspace:../ui-spinner + version: link:../ui-spinner clsx: specifier: 2.1.1 version: 2.1.1 @@ -591,6 +594,28 @@ importers: specifier: 18.3.1 version: 18.3.1(react@18.3.1) + packages/ui-spinner: + dependencies: + '@tailwindcss/typography': + specifier: 0.5.15 + version: 0.5.15(tailwindcss@3.4.11) + '@versini/ui-private': + specifier: workspace:../ui-private + version: link:../ui-private + 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-styles: dependencies: '@tailwindcss/typography': diff --git a/release-please-config.json b/release-please-config.json index 38630d16..973930f9 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -16,7 +16,9 @@ "packages/ui-header": {}, "packages/ui-main": {}, "packages/ui-menu": {}, - "packages/ui-panel": {} + "packages/ui-panel": {}, + "packages/ui-pill": {}, + "packages/ui-spinner": {} }, "plugins": ["node-workspace"], "pull-request-header": ":rocket: Automated Release"