Skip to content

Commit

Permalink
feat(Pill): extracting Pill as a standalone package (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
aversini authored Sep 17, 2024
1 parent 3450a8f commit 0f13fae
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@versini/ui-main": "workspace:../ui-main",
"@versini/ui-menu": "workspace:../ui-menu",
"@versini/ui-panel": "workspace:../ui-panel",
"@versini/ui-pill": "workspace:../ui-pill",
"@versini/ui-private": "workspace:../ui-private",
"clsx": "2.1.1",
"tailwindcss": "3.4.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-components/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Header } from "@versini/ui-header";
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 { Pill } from "./Pill/Pill";
import { Spinner } from "./Spinner/Spinner";
import {
Table,
Expand Down
3 changes: 3 additions & 0 deletions packages/ui-pill/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @versini/ui-pill

A simple pill component for React.
48 changes: 48 additions & 0 deletions packages/ui-pill/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "@versini/ui-pill",
"version": "0.0.0",
"license": "MIT",
"author": "Arno Versini",
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/aversini/ui-components",
"repository": {
"type": "git",
"url": "[email protected]: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",
"clsx": "2.1.1",
"tailwindcss": "3.4.11"
},
"sideEffects": ["**/*.css"]
}
6 changes: 6 additions & 0 deletions packages/ui-pill/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
1 change: 1 addition & 0 deletions packages/ui-pill/src/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const PILL_CLASSNAME = "av-pill";
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { render, screen } from "@testing-library/react";

import { Pill } from "../..";
import { PILL_CLASSNAME, Pill } from "../..";
import { expectToHaveClasses } from "../../../../../../configuration/tests-helpers";
import { PILL_CLASSNAME } from "../../../common/constants";

describe("Pill (exceptions)", () => {
it("should be able to require/import from root", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui-pill/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "../common/constants";
export * from "./Pill/Pill";
3 changes: 3 additions & 0 deletions packages/ui-pill/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/ui-pill/src/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./index.css";
1 change: 1 addition & 0 deletions packages/ui-pill/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
2 changes: 2 additions & 0 deletions packages/ui-pill/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { commonTailwindConfigForComponent } from "../../configuration/tailwind.common";
export default commonTailwindConfigForComponent();
4 changes: 4 additions & 0 deletions packages/ui-pill/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../configuration/tsconfig.common.json",
"include": ["src"]
}
2 changes: 2 additions & 0 deletions packages/ui-pill/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { commonTsupConfig } from "../../configuration/tsup.common";
export default commonTsupConfig;
2 changes: 2 additions & 0 deletions packages/ui-pill/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { commonViteConfigForComponent } from "../../configuration/vite.common";
export default commonViteConfigForComponent();
4 changes: 4 additions & 0 deletions packages/ui-pill/vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { commonVitestConfig } from "../../configuration/vitestconfig.common";
import viteConfig from "./vite.config";

export default commonVitestConfig(viteConfig);
28 changes: 28 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f13fae

Please sign in to comment.