@mshuja288/aksuicore 0.2.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/CHANGELOG.md ADDED
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@mshuja288/aksuicore` are documented in this file.
4
+
5
+ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ Versioning follows [VERSIONING.md](./VERSIONING.md).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] — 2026-10-05
11
+
12
+ ### Changed
13
+
14
+ - **Package rename:** `@mshuja288/aksui` → `@mshuja288/aksuicore`
15
+ - Preview control: only the checkbox toggles preview (label/icon no longer toggle); removed bordered preview chrome; checkbox no longer inherits tall field input styles
16
+ - Select menu options: left-aligned with smaller text (`13px`)
17
+ - Avatar menu: larger username, more compact Logout action
18
+
19
+ ### Fixed
20
+
21
+ - README / docs package name alignment for npm consumers
22
+
23
+ ### Migration
24
+
25
+ ```bash
26
+ npm uninstall @mshuja288/aksui
27
+ npm install @mshuja288/aksuicore@^0.2.0
28
+ ```
29
+
30
+ Update imports from `@mshuja288/aksui` to `@mshuja288/aksuicore` (including `/styles.css`).
31
+
32
+ ## [0.1.0] — 2026-10-04
33
+
34
+ ### Added
35
+
36
+ - Theme tokens (`--aks-*`) with configurator compatibility aliases
37
+ - Primitives: `Button`, `Select`, `DateField`, `Dialog`, `Snackbar`, `Topbar`, `SideNav`, `Pagination`, `FormActions`
38
+ - Patterns: `RecordWorkspace` (table + side rail + preview + filters), `AppShell` (topbar + side nav + mobile bottom nav)
39
+ - Deprecated migration aliases: `AppSelect`, `FormDialog`, `StatusMessage`, `RecordTable`
40
+ - Vite playground for visual demos
41
+
42
+ Published originally as `@mshuja288/aksui@0.1.0`.
43
+
44
+ [Unreleased]: https://github.com/mshuja288/aksui/compare/v0.2.0...HEAD
45
+ [0.2.0]: https://github.com/mshuja288/aksui/releases/tag/v0.2.0
46
+ [0.1.0]: https://github.com/mshuja288/aksui/releases/tag/v0.1.0
package/PLAN.md ADDED
@@ -0,0 +1,139 @@
1
+ # aksui Implementation Plan
2
+
3
+ Track progress here. Mark items `[x]` when done.
4
+
5
+ Library: `@mshuja288/aksuicore`
6
+ First consumer: `aksconfigurator_ui`
7
+ Principle: library owns presentation + interaction patterns; apps own APIs and domain forms.
8
+
9
+ ---
10
+
11
+ ## Phase 0 — Scaffold
12
+
13
+ - [x] Create `E:\ikssam\aksui` repository
14
+ - [x] Library package boilerplate (`package.json`, TypeScript, tsup)
15
+ - [x] Theme token stub (`src/theme/aksui.css`)
16
+ - [x] Folder layout: `primitives/`, `patterns/`, `theme/`
17
+ - [x] Playground Vite app shell with dummy placeholder page
18
+ - [x] This plan document
19
+
20
+ ---
21
+
22
+ ## Phase 1 — Foundation
23
+
24
+ Goal: installable package + stable theme contract.
25
+
26
+ - [x] Install root + playground dependencies (`npm run setup`)
27
+ - [x] Verify `npm run build` produces `dist/` + `aksui.css`
28
+ - [x] Verify playground runs (`npm run playground`)
29
+ - [x] Align CSS tokens with current configurator brand values
30
+ - [x] Document local consumption (`file:` / workspace link)
31
+ - [x] Decide private npm registry target → **GitHub Packages** for `@ikssam` (local `file:` until Phase 6)
32
+
33
+ ---
34
+
35
+ ## Phase 2 — Primitives
36
+
37
+ Extract low-level reusable components from `aksconfigurator_ui`.
38
+
39
+ Order of extraction:
40
+
41
+ 1. [x] Button / Ghost / Danger variants
42
+ 2. [x] AppSelect + LookupSelect patterns (generic Select first; LookupSelect stays in apps)
43
+ 3. [x] DateField
44
+ 4. [x] Dialog / FormDialog shell
45
+ 5. [x] Snackbar / StatusMessage
46
+ 6. [x] Topbar (brand + avatar menu slot)
47
+ 7. [x] SideNav (app shell left menu)
48
+ 8. [x] Pagination controls
49
+
50
+ For each primitive:
51
+
52
+ - [x] Move/adapt component into `src/primitives`
53
+ - [x] Export from package entry
54
+ - [x] Add playground demo with dummy props
55
+ - [x] Keep domain lookups (status/enabled options) in apps, not aksui
56
+
57
+ ---
58
+
59
+ ## Phase 3 — Record Workspace template (flagship)
60
+
61
+ This is the manager’s reusable template:
62
+
63
+ **Table + right collapsible rail** including:
64
+
65
+ - [x] Data table with column model
66
+ - [x] Per-record actions (View / Update / Delete as callbacks/slots)
67
+ - [x] Sorting
68
+ - [x] Client filters + Reset
69
+ - [x] Preview mode checkbox + preview panel
70
+ - [x] Hover tooltip (when preview off)
71
+ - [x] Add action in rail
72
+ - [x] Pagination
73
+ - [x] Dialog host slot for Add/Update/View forms (form body stays in app)
74
+
75
+ Deliverable:
76
+
77
+ - [x] `RecordWorkspace<T>` (or equivalent) in `src/patterns`
78
+ - [x] Full playground demo with dummy companies/modules data
79
+ - [x] Typed public API documented in README
80
+
81
+ ---
82
+
83
+ ## Phase 4 — App shell template (optional but useful)
84
+
85
+ - [x] `AppShell` composing Topbar + SideNav + content area
86
+ - [x] Playground demo of full app chrome with dummy nav items
87
+
88
+ ---
89
+
90
+ ## Phase 5 — Consume from aksconfigurator_ui
91
+
92
+ - [x] Link `@mshuja288/aksuicore` into configurator UI
93
+ - [x] Replace local theme tokens with aksui styles
94
+ - [x] Replace RecordTable usage with RecordWorkspace
95
+ - [x] Replace shared primitives gradually
96
+ - [x] Remove duplicated local UI once parity confirmed
97
+ - [ ] Regression pass: Companies, Modules, Licenses, Parameters, Audit
98
+
99
+ ---
100
+
101
+ ## Phase 6 — Versioning & publish
102
+
103
+ - [x] Semver policy (0.x while stabilizing; 1.0 when template API is stable) → `VERSIONING.md`
104
+ - [x] CHANGELOG.md (`0.1.0`)
105
+ - [x] `npm pack` / publish dry-run (`npm run pack:check`)
106
+ - [x] CI: typecheck + build (+ playground build) → `.github/workflows/ci.yml` + `npm run ci`
107
+ - [ ] Tag `v0.1.0` after first git commit + push (repo currently has no commits)
108
+
109
+ ---
110
+
111
+ ## Phase 7 — Ready for next module UIs
112
+
113
+ - [ ] Short “How to build a screen with aksui” guide
114
+ - [ ] Starter checklist for new apps (install, import styles, AppShell, RecordWorkspace)
115
+ - [ ] Freeze breaking changes behind minor/major bumps
116
+
117
+ ---
118
+
119
+ ## Progress log
120
+
121
+ | Date | Note |
122
+ |------|------|
123
+ | 2026-10-04 | Boilerplate created; plan drafted |
124
+ | 2026-10-04 | Phase 1 done: tokens aligned, playground verified, local + GitHub Packages docs |
125
+ | 2026-10-04 | Phase 2 done: Button, Select, DateField, Dialog, Snackbar, Topbar, SideNav, Pagination + playground |
126
+ | 2026-10-04 | Phase 3 done: RecordWorkspace template + dummy companies playground demo |
127
+ | 2026-10-04 | Phase 4 done: AppShell pattern; playground uses AppShell chrome |
128
+ | 2026-10-04 | Phase 5: aksconfigurator_ui consumes aksui (AppShell, RecordWorkspace, primitives); local duplicates removed |
129
+ | 2026-10-04 | Phase 6: VERSIONING + CHANGELOG + CI workflow + pack dry-run; tag pending first commit |
130
+
131
+ ---
132
+
133
+ ## Out of scope (for now)
134
+
135
+ - Domain API clients
136
+ - Auth / JWT handling
137
+ - Business validation rules
138
+ - Parameters/Audit-specific form logic
139
+ - Forced Tailwind adoption
package/README.md ADDED
@@ -0,0 +1,192 @@
1
+ # @mshuja288/aksuicore
2
+
3
+ Shared React UI library for Ikssam apps — reusable **primitives** and **templates** (especially the Record Workspace).
4
+
5
+ ## Status
6
+
7
+ `v0.2.0` — package renamed to `@mshuja288/aksuicore`. Published on npmjs. See [CHANGELOG.md](./CHANGELOG.md).
8
+
9
+ ## AppShell API
10
+
11
+ ```tsx
12
+ import { AppShell, RecordWorkspace } from "@mshuja288/aksuicore";
13
+
14
+ <AppShell
15
+ title="Configurator"
16
+ username="admin"
17
+ onLogout={signOut}
18
+ navItems={[
19
+ { id: "companies", label: "Companies" },
20
+ { id: "modules", label: "Modules" },
21
+ ]}
22
+ activeNavId={screen}
23
+ onNavSelect={setScreen}
24
+ >
25
+ <RecordWorkspace ... />
26
+ </AppShell>
27
+ ```
28
+
29
+
30
+ ## RecordWorkspace API
31
+
32
+ ```tsx
33
+ import "@mshuja288/aksuicore/styles.css";
34
+ import { RecordWorkspace, Dialog, type TableColumn } from "@mshuja288/aksuicore";
35
+
36
+ type Row = { id: number; name: string; status: string };
37
+
38
+ const columns: TableColumn<Row>[] = [
39
+ { key: "id", header: "ID", value: (r) => r.id },
40
+ { key: "name", header: "Name", value: (r) => r.name },
41
+ {
42
+ key: "status",
43
+ header: "Status",
44
+ value: (r) => r.status,
45
+ filterOptions: [
46
+ { value: "DFT", label: "Draft" },
47
+ { value: "APP", label: "Approved" },
48
+ ],
49
+ filterPlaceholder: "All statuses",
50
+ },
51
+ ];
52
+
53
+ <RecordWorkspace
54
+ title="Companies"
55
+ empty="No records yet."
56
+ columns={columns}
57
+ items={rows}
58
+ rowKey={(r) => r.id}
59
+ addLabel="Add company"
60
+ onAdd={openCreate}
61
+ onView={openView}
62
+ onUpdate={openUpdate}
63
+ onDelete={removeRow}
64
+ toolbar={/* optional company picker etc */}
65
+ form={/* <Dialog>...</Dialog> owned by the app */}
66
+ />
67
+ ```
68
+
69
+ Domain lookups stay in the app via `filterOptions`. Form bodies stay in the `form` slot.
70
+
71
+ See **[PLAN.md](./PLAN.md)** for the phased roadmap and progress checklist.
72
+
73
+ ## Structure
74
+
75
+ ```
76
+ aksui/
77
+ src/
78
+ theme/ Design tokens + base stylesheet
79
+ primitives/ Buttons, nav, dialogs, inputs, pagination
80
+ patterns/ RecordWorkspace and other templates
81
+ playground/ Visual demo app with dummy data
82
+ dist/ Built package output
83
+ PLAN.md Step-by-step implementation tracker
84
+ ```
85
+
86
+ ## Setup
87
+
88
+ ```bash
89
+ # from E:\ikssam\aksui
90
+ npm run setup # installs root + playground deps
91
+ npm run build # emits dist/ + dist/aksui.css
92
+ npm run typecheck
93
+ npm run playground # http://localhost:5173
94
+ npm run pack:check # dry-run of npm pack contents
95
+ ```
96
+
97
+ ## Theme
98
+
99
+ Import once in the host app:
100
+
101
+ ```tsx
102
+ import "@mshuja288/aksuicore/styles.css";
103
+ ```
104
+
105
+ Canonical tokens use the `--aks-*` prefix. Compatibility aliases (`--brand`, `--accent`, …) are also defined so existing configurator CSS can migrate gradually.
106
+
107
+ TypeScript mirror: `aksuiTokens` / `aksuiThemeVersion`.
108
+
109
+ ## Local consumption (recommended while developing)
110
+
111
+ From an app next to this repo (e.g. `aksconfigurator_ui`):
112
+
113
+ 1. Build the library: `npm run build` in `aksui`
114
+ 2. In the app `package.json`:
115
+
116
+ ```json
117
+ {
118
+ "dependencies": {
119
+ "@mshuja288/aksuicore": "file:../aksui"
120
+ }
121
+ }
122
+ ```
123
+
124
+ 3. Install in the app: `npm install`
125
+ 4. Import styles + components:
126
+
127
+ ```tsx
128
+ import "@mshuja288/aksuicore/styles.css";
129
+ import { aksuiThemeVersion } from "@mshuja288/aksuicore";
130
+ ```
131
+
132
+ 5. **Next.js (Turbopack) apps** — set `turbopack.root` to the monorepo parent and alias the package to source (Windows absolute paths are not supported yet):
133
+
134
+ ```ts
135
+ // next.config.ts
136
+ turbopack: {
137
+ root: path.resolve(__dirname, ".."),
138
+ resolveAlias: {
139
+ "@mshuja288/aksuicore": "./aksui/src/index.ts",
140
+ "@mshuja288/aksuicore/styles.css": "./aksui/dist/aksui.css",
141
+ },
142
+ },
143
+ transpilePackages: ["@mshuja288/aksuicore"],
144
+ ```
145
+
146
+ Re-run `npm run build` in `aksui` after library CSS/API changes (or use playground, which aliases `src` directly).
147
+
148
+ ### Alternative: npm link
149
+
150
+ ```bash
151
+ # in aksui
152
+ npm run build
153
+ npm link
154
+
155
+ # in aksconfigurator_ui
156
+ npm link @mshuja288/aksuicore
157
+ ```
158
+
159
+ Prefer `file:../aksui` for simpler team workflows on Windows.
160
+
161
+ ## Versioning & publish
162
+
163
+ - Semver rules: [VERSIONING.md](./VERSIONING.md)
164
+ - Changelog: [CHANGELOG.md](./CHANGELOG.md)
165
+ - CI: `.github/workflows/ci.yml` (typecheck, build, pack dry-run, playground build)
166
+ - Local verify: `npm run ci`
167
+
168
+ ### GitHub Packages
169
+
170
+ | Stage | Approach |
171
+ |-------|----------|
172
+ | **Development** | `file:../aksui` (or `npm link`) |
173
+ | **Publish** | GitHub Packages — `@ikssam` scope |
174
+
175
+ ```bash
176
+ # once: auth (PAT with write:packages)
177
+ cp .npmrc.example .npmrc # or merge into ~/.npmrc
178
+ # set NODE_AUTH_TOKEN
179
+
180
+ npm run ci
181
+ npm publish
182
+ ```
183
+
184
+ Note: GitHub Packages usually requires the package scope (`@ikssam`) to match a GitHub org of the same name. If the repo lives under a personal account, either create/transfer to an `ikssam` org or rename the package scope before the first publish.
185
+
186
+ Example auth config: [`.npmrc.example`](./.npmrc.example).
187
+
188
+ ## Design rules
189
+
190
+ - Library owns look, chrome, and interaction patterns
191
+ - Apps own APIs, auth, and domain form bodies
192
+ - React / ReactDOM are peer dependencies
package/VERSIONING.md ADDED
@@ -0,0 +1,33 @@
1
+ # Versioning policy — `@mshuja288/aksuicore`
2
+
3
+ ## Semver
4
+
5
+ | Range | Meaning |
6
+ |-------|---------|
7
+ | **0.x** | Stabilizing. Breaking changes allowed in minor bumps (`0.2.0`) when called out in CHANGELOG. |
8
+ | **1.0.0** | Template API is stable (`AppShell`, `RecordWorkspace`, core primitives). Breaking changes require a major bump. |
9
+ | **Patch** (`0.1.x`) | Bug fixes, style tweaks, docs — no intentional API breaks. |
10
+ | **Minor** (`0.x.0` while `< 1.0`) | New components/props, or intentional breaking changes during 0.x. |
11
+ | **Major** (`≥ 1.0`) | Breaking public API or CSS contract changes. |
12
+
13
+ ## Public API surface
14
+
15
+ Breaking if removed/renamed/behavior-changed without a major (or 0.x minor) bump:
16
+
17
+ - Named exports from `@mshuja288/aksuicore`
18
+ - `@mshuja288/aksuicore/styles.css` and `--aks-*` tokens (compatibility aliases `--name` may be removed only in a major)
19
+ - Prop contracts for `AppShell`, `RecordWorkspace`, and primitives listed in README
20
+
21
+ Deprecated aliases (`FormDialog`, `StatusMessage`, `AppSelect`, `RecordTable`) may be removed in a future **1.0** or a documented 0.x minor.
22
+
23
+ ## Release checklist
24
+
25
+ 1. Update `CHANGELOG.md` under `[Unreleased]` → version section
26
+ 2. Bump `version` in `package.json` (and `aksuiThemeVersion` if you treat it as the package version)
27
+ 3. `npm run typecheck && npm run build && npm run playground:build && npm run pack:check`
28
+ 4. Commit, tag `vX.Y.Z`, push tag
29
+ 5. Publish to GitHub Packages (see README)
30
+
31
+ ## Tags
32
+
33
+ Git tags use the `v` prefix matching `package.json` version (e.g. `v0.1.0`).