@amogads/ui 1.0.1
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 +287 -0
- package/dist/index.d.mts +952 -0
- package/dist/index.d.ts +952 -0
- package/dist/index.js +11514 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +11168 -0
- package/dist/index.mjs.map +1 -0
- package/dist/theme.css +138 -0
- package/dist/tokens.d.mts +56 -0
- package/dist/tokens.d.ts +56 -0
- package/dist/tokens.js +84 -0
- package/dist/tokens.js.map +1 -0
- package/dist/tokens.mjs +58 -0
- package/dist/tokens.mjs.map +1 -0
- package/package.json +237 -0
package/README.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# AmogaDS — Central Design System (`@amogads/ui`)
|
|
2
|
+
|
|
3
|
+
Welcome to the **Amoga Design System (AmogaDS)** repository. This repository serves two unified purposes:
|
|
4
|
+
1. **Source of Truth for `@amogads/ui`**: A centralized, versioned design system package containing design tokens, atomic UI primitives, reusable business patterns, and page templates published directly to the public [NPM Registry](https://www.npmjs.com/package/@amogads/ui).
|
|
5
|
+
2. **Interactive Component Gallery**: A live Next.js documentation and preview application for exploring components, states, responsive viewports, and theme variants.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📦 Consuming `@amogads/ui` in Next.js Applications
|
|
10
|
+
|
|
11
|
+
### 1. Install Package
|
|
12
|
+
Install directly from NPM into any Next.js (or React) project:
|
|
13
|
+
```bash
|
|
14
|
+
npm install @amogads/ui
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### 2. Import Theme & Styles
|
|
18
|
+
In your global stylesheet (`app/globals.css` or `src/styles/globals.css`):
|
|
19
|
+
```css
|
|
20
|
+
@import "tailwindcss";
|
|
21
|
+
@import "@amogads/ui/theme.css";
|
|
22
|
+
|
|
23
|
+
/* Tell Tailwind CSS v4 to scan compiled package classes */
|
|
24
|
+
@source "../node_modules/@amogads/ui/dist";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> 📖 **Full Developer Integration Guide**: For complete setup, dark mode, component examples, and templates, see [HOW-TO-USE.md](HOW-TO-USE.md).
|
|
28
|
+
|
|
29
|
+
### 3. Consume Components in Code
|
|
30
|
+
```tsx
|
|
31
|
+
import {
|
|
32
|
+
Button,
|
|
33
|
+
PageHeader,
|
|
34
|
+
DataTable,
|
|
35
|
+
StatusBadge,
|
|
36
|
+
ListTemplate
|
|
37
|
+
} from '@amogads/ui'
|
|
38
|
+
|
|
39
|
+
export default function UsersPage() {
|
|
40
|
+
return (
|
|
41
|
+
<ListTemplate
|
|
42
|
+
title="User Management"
|
|
43
|
+
description="Manage system users and their permissions."
|
|
44
|
+
actions={<Button>Invite User</Button>}
|
|
45
|
+
>
|
|
46
|
+
<StatusBadge status="success" dot pulse>
|
|
47
|
+
Active
|
|
48
|
+
</StatusBadge>
|
|
49
|
+
</ListTemplate>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🏛 Architecture & Public Exports
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
src/
|
|
60
|
+
└── design-system/
|
|
61
|
+
├── tokens/ # Semantic OKLCH tokens, themes, radius, animations
|
|
62
|
+
├── components/
|
|
63
|
+
│ ├── ui/ # 57 Radix-based atomic primitives
|
|
64
|
+
│ └── business/ # Multi-app reusable composite patterns
|
|
65
|
+
├── templates/ # 6 standard architectural page blueprints
|
|
66
|
+
└── index.ts # Central public barrel export
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Export Classification Matrix
|
|
70
|
+
|
|
71
|
+
| Layer | Subpath / Export | Examples |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| **Tokens** | `@amogads/ui/tokens`<br/>`@amogads/ui/theme.css` | `SEMANTIC_TOKENS`, `CHART_TOKENS`, `SIDEBAR_TOKENS`, CSS custom properties |
|
|
74
|
+
| **Primitives** | `@amogads/ui` | `Button`, `Input`, `Card`, `Table`, `Tabs`, `Dialog`, `Sheet`, `Drawer`, `Select`, `Checkbox`, `RadioGroup`, `Slider`, `Switch`, `Badge`, `Avatar`, `Breadcrumb`, `DropdownMenu`, `Popover`, `Tooltip`, `Command`, `ContextMenu`, `Pagination`, `Progress`, `ScrollArea`, `Skeleton`, `Sonner`, `Toaster`, `Spinner`, `Textarea`, `Toggle`, `Kbd`, `Label`, `Empty`, `Field`, `Form`, `InputGroup`, `InputOTP` |
|
|
75
|
+
| **Business Components** | `@amogads/ui` | `PageHeader`, `DataTable`, `StatusBadge`, `FilterBar`, `FormSection`, `MetricCard`, `ConfirmDialog`, `PasswordInput`, `SignOutDialog`, `ThemeSwitch`, `ThemeSelector`, `SelectDropdown`, `LongText`, `Search`, `Stats01`, `DatePicker`, `QrCodeDisplay` |
|
|
76
|
+
| **Page Templates** | `@amogads/ui` | `ListTemplate`, `DetailTemplate`, `FormTemplate`, `WizardTemplate`, `DashboardTemplate`, `WorkspaceTemplate` |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🛠 Local Development & Scripts
|
|
81
|
+
|
|
82
|
+
### 1. Install Dependencies
|
|
83
|
+
```bash
|
|
84
|
+
npm install
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2. Run Interactive Component Gallery
|
|
88
|
+
```bash
|
|
89
|
+
npm run dev
|
|
90
|
+
```
|
|
91
|
+
Open [http://localhost:3000](http://localhost:3000) to view the live component catalog and responsive viewports.
|
|
92
|
+
|
|
93
|
+
### 3. Build Distribution Package (`@amogads/ui`)
|
|
94
|
+
```bash
|
|
95
|
+
npm run build:package
|
|
96
|
+
```
|
|
97
|
+
Generates clean ESM (`dist/index.mjs`), CommonJS (`dist/index.js`), TypeScript declarations (`dist/index.d.ts`), and styles (`dist/theme.css`).
|
|
98
|
+
|
|
99
|
+
### 4. Build Next.js Documentation App
|
|
100
|
+
```bash
|
|
101
|
+
npm run build
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 5. Typecheck & Lint
|
|
105
|
+
```bash
|
|
106
|
+
npm run typecheck
|
|
107
|
+
npm run lint
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 6. Publish to NPM
|
|
111
|
+
```bash
|
|
112
|
+
npm publish --access public
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🛡 Repository Governance & CI/CD
|
|
118
|
+
|
|
119
|
+
### 1. Branch Protection & PRs
|
|
120
|
+
* Direct pushes to `main` are restricted.
|
|
121
|
+
* All changes must go through Pull Requests with minimum **1 Code Owner approval**.
|
|
122
|
+
* Required status check: `Lint, Typecheck & Build`.
|
|
123
|
+
|
|
124
|
+
### 2. Code Ownership ([.github/CODEOWNERS](.github/CODEOWNERS))
|
|
125
|
+
* `/src/design-system/tokens/` & `/ux/` → `@amoga-design-leads`
|
|
126
|
+
* `/src/design-system/components/ui/` → `@amoga-ui-engineers`
|
|
127
|
+
* `/src/design-system/components/business/` & `/templates/` → `@amoga-core-devs`
|
|
128
|
+
* `/package.json`, `tsup.config.ts`, `/.github/` → `@amoga-maintainers`
|
|
129
|
+
|
|
130
|
+
### 3. CI Pipeline ([.github/workflows/ci.yml](.github/workflows/ci.yml))
|
|
131
|
+
Triggered on every PR to `main`:
|
|
132
|
+
1. `npm ci` (Dependency installation)
|
|
133
|
+
2. `npm run lint` (ESLint validation)
|
|
134
|
+
3. `npx tsc --noEmit` (TypeScript compilation check)
|
|
135
|
+
4. `npm run build:package` (Package bundle validation)
|
|
136
|
+
5. `npm run build` (Next.js production build)
|
|
137
|
+
6. Non-blocking design token integrity check
|
|
138
|
+
|
|
139
|
+
### 4. Release Pipeline ([.github/workflows/release.yml](.github/workflows/release.yml))
|
|
140
|
+
Triggered via GitHub Actions Workflow Dispatch:
|
|
141
|
+
1. Select release type (`patch`, `minor`, `major`).
|
|
142
|
+
2. Pipeline validates codebase and executes `npm run build:package`.
|
|
143
|
+
3. Bumps version in `package.json` according to semantic versioning.
|
|
144
|
+
4. Generates Git release tag (e.g. `v1.0.0`) and GitHub Release notes.
|
|
145
|
+
5. Publishes `@amogads/ui` to NPM Registry.
|
|
146
|
+
6. Automatically triggers cross-repository upgrade PRs across registered consumer apps.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 🤖 Cross-Repository Upgrade Automation
|
|
151
|
+
|
|
152
|
+
AmogaDS provides a fully controlled, automated cross-repository dependency upgrade pipeline to keep all consuming applications up to date with `@amogads/ui` releases without risk of accidental code overwrites or regressions.
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
@amogads/ui Release Published (e.g. v1.4.0)
|
|
156
|
+
↓
|
|
157
|
+
Discover Registered Apps in consumers-registry.json
|
|
158
|
+
↓
|
|
159
|
+
Authenticate via Ephemeral GitHub App Token (Zero PATs)
|
|
160
|
+
↓
|
|
161
|
+
Create Isolation Branch (chore/upgrade-amoga-ui-v1.4.0)
|
|
162
|
+
↓
|
|
163
|
+
Update package.json & Lockfile ONLY (Protected Code Guard)
|
|
164
|
+
↓
|
|
165
|
+
Run Consuming Application CI & Build Checks
|
|
166
|
+
↓
|
|
167
|
+
Generate Detailed PR (Changelog + Safety Checks + Rollback Guide)
|
|
168
|
+
↓
|
|
169
|
+
Application Owner Reviews & Merges Manually (No Auto-Merge)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### 1. Checking Version Status Across Applications
|
|
175
|
+
|
|
176
|
+
Run the central tracker from the `amogads/` directory:
|
|
177
|
+
```bash
|
|
178
|
+
npm run consumers:status
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Live Output Example**:
|
|
182
|
+
```text
|
|
183
|
+
===============================================================
|
|
184
|
+
🌟 AmogaDS (@amogads/ui) Central Consumer Tracker
|
|
185
|
+
📦 Current Design System Version: v1.0.0
|
|
186
|
+
===============================================================
|
|
187
|
+
|
|
188
|
+
┌─────────┬──────────────────────────────────┬──────────────────────────┬───────────┬──────────┬─────────────────┬────────────┬─────────────────────────┬───────────┐
|
|
189
|
+
│ (index) │ Repository │ App Name │ Installed │ Target │ Status │ Automation │ Team │ Active PR │
|
|
190
|
+
├─────────┼──────────────────────────────────┼──────────────────────────┼───────────┼──────────┼─────────────────┼────────────┼─────────────────────────┼───────────┤
|
|
191
|
+
│ 0 │ 'MohammadAmannn/shadcn-admin' │ 'Shadcn Admin Pilot App' │ 'v1.0.0' │ 'v1.0.0' │ '✅ up-to-date' │ 'enabled' │ '@amoga-admin' │ 'None' │
|
|
192
|
+
│ 1 │ 'MohammadAmannn/amoga-analytics' │ 'Amoga Analytics Portal' │ 'v1.0.0' │ 'v1.0.0' │ '✅ up-to-date' │ 'enabled' │ '@amoga-analytics-team' │ 'None' │
|
|
193
|
+
└─────────┴──────────────────────────────────┴──────────────────────────┴───────────┴──────────┴─────────────────┴────────────┴─────────────────────────┴───────────┘
|
|
194
|
+
|
|
195
|
+
📊 Summary: 2 registered apps | 2 up-to-date | 0 pending upgrade.
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
### 2. How to Register a New Consuming Application
|
|
201
|
+
|
|
202
|
+
To register a new Next.js application for automated `@amogads/ui` upgrades, add an entry to [`consumers-registry.json`](consumers-registry.json):
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"id": "my-new-app",
|
|
207
|
+
"name": "My Next.js Application",
|
|
208
|
+
"repository": "OrganizationOrOwner/my-new-app",
|
|
209
|
+
"defaultBranch": "main",
|
|
210
|
+
"packagePath": "package.json",
|
|
211
|
+
"currentVersion": "1.0.0",
|
|
212
|
+
"targetVersion": "1.0.0",
|
|
213
|
+
"updateStatus": "up-to-date",
|
|
214
|
+
"automationStatus": "enabled",
|
|
215
|
+
"team": "@my-app-team",
|
|
216
|
+
"lastCheckedAt": "2026-08-24T11:00:00Z",
|
|
217
|
+
"lastUpgradedAt": "2026-08-24T11:00:00Z",
|
|
218
|
+
"activePrUrl": null
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### Field Reference:
|
|
223
|
+
* `repository`: GitHub repository in `owner/repo` format.
|
|
224
|
+
* `defaultBranch`: Target branch for PRs (usually `main`).
|
|
225
|
+
* `automationStatus`: Set to `"enabled"` to receive PRs, or `"paused"` / `"disabled"` to hold updates.
|
|
226
|
+
* `team`: Team handle or maintainer notified for PR review.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
### 3. Application Code Protection & Security
|
|
231
|
+
|
|
232
|
+
The automation engine ([scripts/upgrade-consumers.mjs](scripts/upgrade-consumers.mjs)) enforces strict boundaries:
|
|
233
|
+
* **Zero Personal Access Tokens (PATs)**: Uses GitHub App installation tokens scoped with minimum required permissions (`contents: write`, `pull_requests: write`).
|
|
234
|
+
* **Protected File Zones**: `app/`, `features/`, `components/custom/`, `src/lib/`, `src/services/`, and state stores are **never modified**.
|
|
235
|
+
* **Strict Whitelist**: Automation is only allowed to touch `package.json` and lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`). Any unexpected file modification immediately aborts the pipeline.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### 4. Reviewing & Merging an Upgrade PR (Developer Guide)
|
|
240
|
+
|
|
241
|
+
When an automated upgrade PR is opened in your consuming application:
|
|
242
|
+
|
|
243
|
+
1. **Inspect Version Diff & Changelog**: Check whether the release is `PATCH`, `MINOR`, or `MAJOR` in the PR description.
|
|
244
|
+
2. **Verify CI Status**: Ensure all automated checks (`Lint`, `Typecheck`, `Build`, `Tests`) pass on the PR branch.
|
|
245
|
+
3. **Local Visual Verification (Optional)**:
|
|
246
|
+
```bash
|
|
247
|
+
git fetch origin chore/upgrade-amoga-ui-vX.Y.Z
|
|
248
|
+
git checkout chore/upgrade-amoga-ui-vX.Y.Z
|
|
249
|
+
npm install
|
|
250
|
+
npm run dev
|
|
251
|
+
```
|
|
252
|
+
Check light/dark mode and key user flows (forms, tables, navigation).
|
|
253
|
+
4. **Manual Approval & Merge**: Approve and merge the PR. *(Auto-merging is intentionally disabled for safety).*
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### 5. Rollback & Emergency Recovery
|
|
258
|
+
|
|
259
|
+
If an issue is discovered after merging an upgrade:
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
# 1. Revert to previous stable version
|
|
263
|
+
npm install @amogads/ui@<PREVIOUS_VERSION>
|
|
264
|
+
|
|
265
|
+
# 2. Re-build and verify
|
|
266
|
+
npm run build
|
|
267
|
+
|
|
268
|
+
# 3. Commit and push
|
|
269
|
+
git commit -am "fix: rollback @amogads/ui to v<PREVIOUS_VERSION>"
|
|
270
|
+
git push origin main
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 📚 UX & Architectural Documentation
|
|
276
|
+
|
|
277
|
+
Comprehensive documentation is available in the repository:
|
|
278
|
+
|
|
279
|
+
- [Developer How-To-Use Guide](HOW-TO-USE.md)
|
|
280
|
+
- [Cross-Repository Upgrade Automation Guide](ux/UPGRADE-AUTOMATION.md)
|
|
281
|
+
- [Design System Architecture & Boundaries](ux/DESIGN-SYSTEM.md)
|
|
282
|
+
- [UX Guidelines & Interaction Foundations](ux/UX-GUIDELINES.md)
|
|
283
|
+
- [Component Guidelines & Taxonomy](ux/COMPONENT-GUIDELINES.md)
|
|
284
|
+
- [Page Guidelines & Template Specifications](ux/PAGE-GUIDELINES.md)
|
|
285
|
+
- [AI Development Guidelines](ux/AI-DEVELOPMENT-GUIDELINES.md)
|
|
286
|
+
- [Design System Rules](ux/design-rules.md)
|
|
287
|
+
- [Token Specifications](ux/token-specifications.md)
|