@pallasoft/ps-table-components 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ Pallasoft Proprietary License
2
+
3
+ Version 1.0, 23-Jan-2024
4
+
5
+ 1. Grant of License:
6
+ Pallasoft grants you a non-exclusive, non-transferable, revocable license to use the software, solely for internal business purposes.
7
+
8
+ 2. Restrictions:
9
+ You may not:
10
+ a. Distribute or sublicense the software to third parties.
11
+ b. Reverse engineer, decompile, or disassemble the software.
12
+ c. Remove or alter any proprietary notices or labels on the software.
13
+
14
+ 3. Ownership:
15
+ Pallasoft retains all right, title, and interest in and to the software, including all intellectual property rights.
16
+
17
+ 4. Confidentiality:
18
+ You agree to keep the software confidential and not disclose it to third parties.
19
+
20
+ 5. Support and Updates:
21
+ This license does not entitle you to support or updates. Pallasoft may, at its discretion, provide support and updates.
22
+
23
+ 6. Termination:
24
+ This license is effective until terminated. Pallasoft may terminate the license at any time if you breach any terms. Upon termination, you must cease using the software.
25
+
26
+ 7. Governing Law:
27
+ This license is governed by the Canadian Laws. Any disputes arising out of this license shall be resolved in the courts of Canada.
28
+
29
+ 8. Contact Information:
30
+ For inquiries regarding this license, contact operations@pallasoft.com.
31
+
32
+ [End of License]
package/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # @pallasoft/ps-table-components
2
+
3
+ Shared Pallasoft table components package.
4
+
5
+ ## Scripts
6
+
7
+ - `npm run build` compiles the package into `dist`.
8
+ - `npm run lint` runs ESLint using the shared package baseline.
9
+ - `npm run format:check` checks Prettier formatting.
10
+ - `npm run release` publishes through semantic-release.
@@ -0,0 +1,9 @@
1
+ import type { PsTableColumn } from '../interfaces/table-column';
2
+ export interface PsDataTableProps<RowData> {
3
+ caption?: string;
4
+ columns: PsTableColumn<RowData>[];
5
+ density?: 'compact' | 'normal';
6
+ getRowId: (row: RowData) => string;
7
+ rows: RowData[];
8
+ }
9
+ export declare const PsDataTable: <RowData>({ caption, columns, density, getRowId, rows, }: PsDataTableProps<RowData>) => import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PsDataTable = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const densityClassNames = {
6
+ compact: {
7
+ cell: 'px-4 py-3',
8
+ head: 'px-4 py-3',
9
+ },
10
+ normal: {
11
+ cell: 'px-4 py-4',
12
+ head: 'px-4 py-3.5',
13
+ },
14
+ };
15
+ const PsDataTable = ({ caption, columns, density = 'normal', getRowId, rows, }) => ((0, jsx_runtime_1.jsx)("div", { className: 'overflow-hidden rounded-[1.25rem] border border-line bg-white', children: (0, jsx_runtime_1.jsxs)("table", { className: 'w-full border-collapse text-left', children: [caption ? (0, jsx_runtime_1.jsx)("caption", { className: 'sr-only', children: caption }) : null, (0, jsx_runtime_1.jsx)("thead", { className: 'bg-slate-50/90 text-[0.68rem] font-semibold uppercase tracking-[0.18em] text-slate-400', children: (0, jsx_runtime_1.jsx)("tr", { children: columns.map((column) => ((0, jsx_runtime_1.jsx)("th", { className: densityClassNames[density].head, children: column.label }, column.id))) }) }), (0, jsx_runtime_1.jsx)("tbody", { className: 'divide-y divide-line', children: rows.map((row) => ((0, jsx_runtime_1.jsx)("tr", { className: 'align-top transition hover:bg-slate-50/60', children: columns.map((column) => ((0, jsx_runtime_1.jsx)("td", { className: densityClassNames[density].cell, children: column.render(row) }, column.id))) }, getRowId(row)))) })] }) }));
16
+ exports.PsDataTable = PsDataTable;
@@ -0,0 +1,2 @@
1
+ export * from './components/ps-data-table';
2
+ export * from './interfaces/table-column';
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./components/ps-data-table"), exports);
18
+ __exportStar(require("./interfaces/table-column"), exports);
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PsTableColumn<RowData> {
3
+ id: string;
4
+ label: string;
5
+ render: (row: RowData) => ReactNode;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@pallasoft/ps-table-components",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "require": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "/dist"
16
+ ],
17
+ "scripts": {
18
+ "husky:prepare": "npx husky",
19
+ "build": "tsc",
20
+ "setup:graphify": "sh scripts/graphify-setup.sh",
21
+ "update:graphify": "sh scripts/graphify-update.sh",
22
+ "lint": "npm run lint:eslint",
23
+ "lint:fix": "npm run lint:eslint:fix",
24
+ "format:check": "npx prettier --check --ignore-unknown \"src/**/*.{ts,tsx,json,md}\"",
25
+ "format:prettier": "npx prettier --write \"src/**/*.{ts,tsx,json,md}\"",
26
+ "lint:eslint": "npx eslint \"src/**/*.{ts,tsx}\"",
27
+ "lint:eslint:fix": "npx eslint --fix \"src/**/*.{ts,tsx}\"",
28
+ "release": "semantic-release"
29
+ },
30
+ "peerDependencies": {
31
+ "react": "^18 || ^19"
32
+ },
33
+ "devDependencies": {
34
+ "@commitlint/cli": "^20.1.0",
35
+ "@commitlint/config-conventional": "^20.0.0",
36
+ "@eslint/compat": "^2.0.0",
37
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
38
+ "@semantic-release/changelog": "^6.0.3",
39
+ "@semantic-release/commit-analyzer": "^13.0.0",
40
+ "@semantic-release/git": "^10.0.1",
41
+ "@semantic-release/github": "^11.0.1",
42
+ "@semantic-release/npm": "^12.0.0",
43
+ "@semantic-release/release-notes-generator": "^14.0.1",
44
+ "@types/react": "^18.3.28",
45
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
46
+ "@typescript-eslint/parser": "^8.48.0",
47
+ "commitlint": "^20.1.0",
48
+ "conventional-changelog-conventionalcommits": "^7.0.2",
49
+ "eslint": "^9.39.1",
50
+ "eslint-config-prettier": "^10.1.8",
51
+ "eslint-plugin-import": "^2.32.0",
52
+ "eslint-plugin-prettier": "^5.5.4",
53
+ "husky": "^9.1.7",
54
+ "lint-staged": "^16.2.7",
55
+ "prettier": "^3.6.2",
56
+ "react": "^18.3.1",
57
+ "semantic-release": "^24.2.0",
58
+ "ts-node": "^10.9.2",
59
+ "typescript": "^5.9.3"
60
+ },
61
+ "publishConfig": {
62
+ "access": "public",
63
+ "registry": "https://registry.npmjs.org/"
64
+ },
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "git+https://github.com/pallasoft/ps-table-components.git"
68
+ }
69
+ }