@prediktif/ui 0.1.4
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/README.md +142 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +46 -0
- package/dist/index.mjs +19 -0
- package/package.json +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# `@prediktif/ui`
|
|
2
|
+
|
|
3
|
+
The official shared Design System and UI Component Library for the **Prediktif** ecosystem.
|
|
4
|
+
|
|
5
|
+
This repository provides reusable React components, custom layout blocks, and standardized design tokens for applications built within the Prediktif product line.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 🚀 Quick Start (Installation)
|
|
10
|
+
|
|
11
|
+
To consume Prediktif's custom components in any application within the ecosystem:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @prediktif/ui
|
|
15
|
+
# or
|
|
16
|
+
npm install @prediktif/ui
|
|
17
|
+
# or
|
|
18
|
+
yarn add @prediktif/ui
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 💻 Usage
|
|
24
|
+
|
|
25
|
+
Only Prediktif's custom composed components (`src/components/composed/*`) are exposed by the package entry points.
|
|
26
|
+
|
|
27
|
+
### Importing Composed Components
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { HeaderTitle } from "@prediktif/ui";
|
|
31
|
+
|
|
32
|
+
export default function DashboardHeader() {
|
|
33
|
+
return (
|
|
34
|
+
<HeaderTitle
|
|
35
|
+
title="User Management"
|
|
36
|
+
subtitle="Manage roles and permissions across your organization"
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or via subpath export:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { HeaderTitle } from "@prediktif/ui/composed";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🏗️ Project Architecture & Component Classification
|
|
51
|
+
|
|
52
|
+
The repository is structured as follows:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
src/
|
|
56
|
+
├── components/
|
|
57
|
+
│ ├── composed/ <-- Custom components built by Prediktif (EXPOSED)
|
|
58
|
+
│ ├── ai-elements/ <-- Third-party AI/LLM UI components (Internal)
|
|
59
|
+
│ └── ui/ <-- Third-party primitive UI components (Internal)
|
|
60
|
+
├── app/ <-- Next.js Documentation & Preview Portal
|
|
61
|
+
├── index.ts <-- Main library entry point
|
|
62
|
+
└── components/composed/index.ts <-- Composed components export index
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
* **`src/components/composed/`**: High-level, custom-tailored components created specifically for Prediktif applications. **These components are bundled and exported in the published package.**
|
|
66
|
+
* **`src/components/ui/` & `src/components/ai-elements/`**: Base primitives and AI component libraries used internally to construct `composed` elements and render the local documentation preview.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 🛠️ Development Workflow
|
|
71
|
+
|
|
72
|
+
### 1. Running the Local Documentation Portal
|
|
73
|
+
To preview components and view interactive documentation locally:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pnpm dev
|
|
77
|
+
```
|
|
78
|
+
Open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
79
|
+
|
|
80
|
+
### 2. Adding a New Composed Component
|
|
81
|
+
|
|
82
|
+
1. Create your component in `src/components/composed/my-component.tsx`:
|
|
83
|
+
```tsx
|
|
84
|
+
export interface MyComponentProps {
|
|
85
|
+
label: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function MyComponent({ label }: MyComponentProps) {
|
|
89
|
+
return <div className="p-4 rounded-md border">{label}</div>;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
2. Export the component in `src/components/composed/index.ts`:
|
|
93
|
+
```ts
|
|
94
|
+
export * from "./header-title";
|
|
95
|
+
export * from "./my-component";
|
|
96
|
+
```
|
|
97
|
+
3. (Optional) Create a documentation page in `src/app/(docs)/components/my-component/page.tsx` for visual testing.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 📦 Building & Publishing
|
|
102
|
+
|
|
103
|
+
### Building the Component Library
|
|
104
|
+
To build the distribution bundle (`dist/index.mjs`, `dist/index.js`, `dist/index.d.ts`):
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
pnpm build:lib
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
This uses `tsup` to bundle the TypeScript components while preserving React `"use client"` directives and generating TypeScript type declarations (`.d.ts`).
|
|
111
|
+
|
|
112
|
+
### Publishing to NPM Registry
|
|
113
|
+
|
|
114
|
+
> [!NOTE]
|
|
115
|
+
> **Private GitHub Repository + Public NPM Package**:
|
|
116
|
+
> The GitHub repository is **Private** to protect source code and documentation history.
|
|
117
|
+
> The compiled library package is published **Publicly** to NPM (`npmjs.com`) so that all Prediktif ecosystem projects can install it without requiring GitHub credentials or tokens.
|
|
118
|
+
|
|
119
|
+
#### Publishing Steps:
|
|
120
|
+
|
|
121
|
+
1. **Bump Version** in `package.json` (or use `npm version patch | minor | major`):
|
|
122
|
+
```bash
|
|
123
|
+
npm version patch
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
2. **Login to NPM** (if not authenticated):
|
|
127
|
+
```bash
|
|
128
|
+
npm login
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
3. **Publish Package**:
|
|
132
|
+
```bash
|
|
133
|
+
pnpm publish --access public --registry https://registry.npmjs.org/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
*Note: The `prepublishOnly` hook automatically runs `pnpm build:lib` before publishing.*
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 📄 License
|
|
141
|
+
|
|
142
|
+
Private & Proprietary — **Prediktif Ecosystem**. All rights reserved.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface HeaderTitleProps {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
subtitle: React.ReactNode;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
|
|
9
|
+
|
|
10
|
+
export { HeaderTitle, type HeaderTitleProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface HeaderTitleProps {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
subtitle: React.ReactNode;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const HeaderTitle: react.NamedExoticComponent<HeaderTitleProps>;
|
|
9
|
+
|
|
10
|
+
export { HeaderTitle, type HeaderTitleProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
HeaderTitle: () => HeaderTitle
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/components/composed/header-title.tsx
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var HeaderTitle = (0, import_react.memo)(function HeaderTitle2({
|
|
31
|
+
title,
|
|
32
|
+
subtitle,
|
|
33
|
+
children
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full space-y-4", children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "font-semibold", children: title }),
|
|
38
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
39
|
+
] }),
|
|
40
|
+
children
|
|
41
|
+
] });
|
|
42
|
+
});
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
HeaderTitle
|
|
46
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/components/composed/header-title.tsx
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var HeaderTitle = memo(function HeaderTitle2({
|
|
5
|
+
title,
|
|
6
|
+
subtitle,
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full space-y-4", children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11
|
+
/* @__PURE__ */ jsx("h1", { className: "font-semibold", children: title }),
|
|
12
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: subtitle })
|
|
13
|
+
] }),
|
|
14
|
+
children
|
|
15
|
+
] });
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
HeaderTitle
|
|
19
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prediktif/ui",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"module": "./dist/index.mjs",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./composed": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@base-ui/react": "^1.8.0",
|
|
29
|
+
"@radix-ui/react-use-controllable-state": "^1.2.6",
|
|
30
|
+
"@rive-app/react-webgl2": "^4.34.2",
|
|
31
|
+
"@shadcn/react": "^0.3.1",
|
|
32
|
+
"@streamdown/cjk": "^1.0.3",
|
|
33
|
+
"@streamdown/code": "^1.1.1",
|
|
34
|
+
"@streamdown/math": "^1.0.2",
|
|
35
|
+
"@streamdown/mermaid": "^1.0.2",
|
|
36
|
+
"@xyflow/react": "^12.11.6",
|
|
37
|
+
"ai": "^7.0.101",
|
|
38
|
+
"ansi-to-react": "^6.2.6",
|
|
39
|
+
"class-variance-authority": "^0.7.1",
|
|
40
|
+
"cmdk": "^1.1.1",
|
|
41
|
+
"cn": "^0.3.0",
|
|
42
|
+
"date-fns": "^4.4.0",
|
|
43
|
+
"embla-carousel-react": "^8.6.0",
|
|
44
|
+
"input-otp": "^1.5.0",
|
|
45
|
+
"lucide-react": "^1.46.0",
|
|
46
|
+
"media-chrome": "^4.19.2",
|
|
47
|
+
"motion": "^13.3.0",
|
|
48
|
+
"nanoid": "^6.0.1",
|
|
49
|
+
"next": "16.3.5",
|
|
50
|
+
"next-themes": "^0.4.6",
|
|
51
|
+
"react": "19.2.8",
|
|
52
|
+
"react-day-picker": "^10.0.1",
|
|
53
|
+
"react-dom": "19.2.8",
|
|
54
|
+
"react-jsx-parser": "^2.4.1",
|
|
55
|
+
"react-resizable-panels": "^4.12.4",
|
|
56
|
+
"recharts": "3.8.0",
|
|
57
|
+
"shadcn": "^4.21.0",
|
|
58
|
+
"shiki": "^4.4.3",
|
|
59
|
+
"streamdown": "^2.6.0",
|
|
60
|
+
"tokenlens": "^1.3.1",
|
|
61
|
+
"tw-animate-css": "^1.4.0",
|
|
62
|
+
"use-stick-to-bottom": "^1.1.6"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@biomejs/biome": "2.4.2",
|
|
66
|
+
"@tailwindcss/postcss": "^4",
|
|
67
|
+
"@types/node": "^20",
|
|
68
|
+
"@types/react": "^19",
|
|
69
|
+
"@types/react-dom": "^19",
|
|
70
|
+
"babel-plugin-react-compiler": "1.0.0",
|
|
71
|
+
"tailwindcss": "^4",
|
|
72
|
+
"tsup": "^8.5.1",
|
|
73
|
+
"typescript": "^5"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"dev": "next dev",
|
|
77
|
+
"build": "next build",
|
|
78
|
+
"build:lib": "tsup src/index.ts --format esm,cjs --dts --clean --tsconfig tsconfig.build.json --external react,react-dom,next",
|
|
79
|
+
"start": "next start",
|
|
80
|
+
"lint": "biome check",
|
|
81
|
+
"format": "biome format --write"
|
|
82
|
+
}
|
|
83
|
+
}
|