{"_id":"@astralibx/staff-ui","_rev":"4-6abd8a2c25ae656c12908ef516a73dc2","name":"@astralibx/staff-ui","dist-tags":{"latest":"0.2.3"},"versions":{"0.2.0":{"name":"@astralibx/staff-ui","version":"0.2.0","license":"MIT","_id":"@astralibx/staff-ui@0.2.0","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"ab7df20bd280f3a1e376633d423243fc8d2d08d9","tarball":"https://registry.npmjs.org/@astralibx/staff-ui/-/staff-ui-0.2.0.tgz","fileCount":4,"integrity":"sha512-UT4Txw1jPPgpkECQa1sC61asoVv+gpBP8Xx8v12f6eUZqH8jhjoHO0yBAdwWa+mjB62Tn2VWlwBAui7e3Nymjg==","signatures":[{"sig":"MEUCIGSzyh6k5q9H9V8NfRHT5Xlg+d9fc79oClnDETYVZnC1AiEAkZURlkepdanJF+NIixCVviag5uXlGkCvZ3cARn/4UIA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":166516},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"2469f8e7ec03a0b42cf5db266e50e3bfca011bcb","scripts":{"dev":"vite","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/staff/staff-ui"},"_npmVersion":"10.9.4","description":"Lit Web Components for the @astralibx staff admin dashboard","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/staff-types":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0"},"_npmOperationalInternal":{"tmp":"tmp/staff-ui_0.2.0_1774187336365_0.6437380999688964","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@astralibx/staff-ui","version":"0.2.1","license":"MIT","_id":"@astralibx/staff-ui@0.2.1","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"b685a32df1e79c6999da59a79f643c62ae183914","tarball":"https://registry.npmjs.org/@astralibx/staff-ui/-/staff-ui-0.2.1.tgz","fileCount":4,"integrity":"sha512-W3uivuaX1+i/WfM0iXzjWKAN6BIFWRYRyB/gK1sgNmXQ7oDM6zkl7uNcK6LZ2SDYyIiRm85I4bcbu1fsP/TLMw==","signatures":[{"sig":"MEQCIHjsRaXx1qxmTmu0vgDdKmVNYR0k4hDBX0ycQRXIpfTNAiBTwT5uoICR6ZJN7R5NiiMC9Pp/ADaTfUTDCZh50plXgg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":168442},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"aa24b21103d13c355fbf84fb143335febb4b0136","scripts":{"dev":"vite","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/staff/staff-ui"},"_npmVersion":"10.9.4","description":"Lit Web Components for the @astralibx staff admin dashboard","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/staff-types":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0"},"_npmOperationalInternal":{"tmp":"tmp/staff-ui_0.2.1_1774200548634_0.043179099499656814","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@astralibx/staff-ui","version":"0.2.2","license":"MIT","_id":"@astralibx/staff-ui@0.2.2","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"homepage":"https://github.com/Hariprakash1997/astralib#readme","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"dist":{"shasum":"575a963808b6bc1b605ce297ed68e2911354b1bb","tarball":"https://registry.npmjs.org/@astralibx/staff-ui/-/staff-ui-0.2.2.tgz","fileCount":5,"integrity":"sha512-wyO8/QyZb3TqoRIJtQn2XxlZzitp90Gh5e6DX5gZaziwA2VRp56MyV10GiA+ZpgSe1lIWDNGiIWUhkl7bAoAQw==","signatures":[{"sig":"MEYCIQCKnGatB0gpuVaRhAwvtcfbiYRo3f8B3rXDdlMvpU//aQIhAN01Fm0S333mXBHh3Z9oBzKs7Wt7tQbdDBokmBN83qj0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":171312},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"536d6d435d86f884d250a4afdfa6ee5a79b0bbdc","scripts":{"dev":"vite","build":"vite build"},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"repository":{"url":"git+https://github.com/Hariprakash1997/astralib.git","type":"git","directory":"packages/staff/staff-ui"},"_npmVersion":"10.9.4","description":"Lit Web Components for the @astralibx staff admin dashboard","directories":{},"_nodeVersion":"22.22.1","dependencies":{"lit":"^3.0.0","@astralibx/staff-types":"^0.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^6.0.0","vitest":"^3.0.0","typescript":"^5.8.0","vite-plugin-dts":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/staff-ui_0.2.2_1774233264507_0.4056115176318409","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@astralibx/staff-ui","version":"0.2.3","description":"Lit Web Components for the @astralibx staff admin dashboard","repository":{"type":"git","url":"git+https://github.com/Hariprakash1997/astralib.git","directory":"packages/staff/staff-ui"},"type":"module","main":"dist/index.js","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"vite build","dev":"vite"},"dependencies":{"lit":"^3.0.0","@astralibx/staff-types":"^0.2.0"},"devDependencies":{"vite":"^6.0.0","vite-plugin-dts":"^4.0.0","typescript":"^5.8.0","vitest":"^3.0.0"},"license":"MIT","_id":"@astralibx/staff-ui@0.2.3","gitHead":"18ae0348539bf3644ee008d3c122bd39abff0db4","bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"homepage":"https://github.com/Hariprakash1997/astralib#readme","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-rlj+hKoesQRBLGl9ny+PO8LvV5L40VlCXg3pOgGMYKoPLo7H11Aux5Yhi4Hjb2zRh1QdkzXu65HFqeHuN90wMg==","shasum":"ac29a95377e4150cb3e3c758a8d58ea3c3d7d8a6","tarball":"https://registry.npmjs.org/@astralibx/staff-ui/-/staff-ui-0.2.3.tgz","fileCount":5,"unpackedSize":171433,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCr4QU6jhj4YsVPUKl2Bn0AsAvxmF26UPpEpIz/+9RAGAIgFfOq+s0D/N7LRUIWlH+v2dt4ypXsQxD6KuCZJLiRcE0="}]},"_npmUser":{"name":"astralib","email":"1997hariprakash@gmail.com"},"directories":{},"maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/staff-ui_0.2.3_1774259916883_0.23534154280018837"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-22T13:48:56.272Z","modified":"2026-03-23T09:58:37.161Z","0.2.0":"2026-03-22T13:48:56.537Z","0.2.1":"2026-03-22T17:29:08.783Z","0.2.2":"2026-03-23T02:34:24.670Z","0.2.3":"2026-03-23T09:58:37.035Z"},"bugs":{"url":"https://github.com/Hariprakash1997/astralib/issues"},"license":"MIT","homepage":"https://github.com/Hariprakash1997/astralib#readme","repository":{"type":"git","url":"git+https://github.com/Hariprakash1997/astralib.git","directory":"packages/staff/staff-ui"},"description":"Lit Web Components for the @astralibx staff admin dashboard","maintainers":[{"name":"astralib","email":"1997hariprakash@gmail.com"}],"readme":"# @astralibx/staff-ui\n\n[![npm version](https://img.shields.io/npm/v/@astralibx/staff-ui.svg)](https://www.npmjs.com/package/@astralibx/staff-ui)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nAdmin dashboard Lit web components for staff management. 7 self-contained shadow DOM components for building a staff management UI that connects to `@astralibx/staff-engine` via REST.\n\n## Install\n\n```bash\nnpm install @astralibx/staff-ui\n```\n\n### Peer Dependencies\n\n| Package | Required |\n|---------|----------|\n| `lit` | Yes |\n\n```bash\nnpm install lit\n```\n\n## Setup\n\nCall `AlxStaffConfig.setup()` once at application startup before rendering any components:\n\n```ts\nimport { AlxStaffConfig } from '@astralibx/staff-ui';\n\nAlxStaffConfig.setup({\n  staffApi: '/api/staff',       // Base URL of the staff engine routes\n  authToken: 'Bearer <token>',  // Owner JWT token for API requests\n});\n\nimport '@astralibx/staff-ui'; // Registers all 7 custom elements\n```\n\nTo update the token after login (e.g. after setup completes):\n\n```ts\nAlxStaffConfig.setAuthToken('Bearer <new-token>');\n```\n\n## Components\n\n| Tag | Class | Description |\n|-----|-------|-------------|\n| `<alx-staff-list>` | `AlxStaffList` | Paginated staff table with status/role filters, inline action buttons for permissions, password reset, and activate/deactivate |\n| `<alx-staff-create-form>` | `AlxStaffCreateForm` | Form to create a new staff member with name, email, password, and permission checkboxes grouped by permission group |\n| `<alx-staff-permission-editor>` | `AlxStaffPermissionEditor` | Per-staff permission editor with collapsible groups, select-all/clear per group, and edit-to-view auto-cascade |\n| `<alx-staff-password-reset>` | `AlxStaffPasswordReset` | Owner form to reset a staff member's password with confirm-password validation |\n| `<alx-staff-status-toggle>` | `AlxStaffStatusToggle` | Shows current status badge and toggles active/inactive with a confirmation step |\n| `<alx-permission-group-list>` | `AlxPermissionGroupList` | Group list with create/delete -- renders `<alx-permission-entry-editor>` inside expanded groups |\n| `<alx-permission-entry-editor>` | `AlxPermissionEntryEditor` | Per-group permission entry editor -- add/remove entries with key, label, type |\n| `<alx-staff-setup>` | `AlxStaffSetup` | First-run setup form that calls `POST /setup` to create the initial owner account |\n\n### Component attributes\n\n| Component | Attribute | Type | Description |\n|-----------|-----------|------|-------------|\n| `alx-staff-list` | `density` | `'default' \\| 'compact'` | Layout density mode |\n| `alx-staff-permission-editor` | `staff-id` | `string` | ID of the staff member to edit permissions for |\n| `alx-staff-password-reset` | `staff-id` | `string` | ID of the staff member whose password to reset |\n| `alx-staff-status-toggle` | `staff-id` | `string` | ID of the staff member to toggle |\n| `alx-staff-status-toggle` | `current-status` | `string` | Current status value shown in the badge |\n\n## Events\n\nAll events bubble and are composed (cross shadow DOM).\n\n| Event | Component | Detail | Description |\n|-------|-----------|--------|-------------|\n| `create-staff` | `alx-staff-list` | `{}` | User clicked \"+ Add Staff\" button |\n| `edit-permissions` | `alx-staff-list` | `{ staffId: string }` | User clicked \"Permissions\" for a staff row |\n| `reset-password` | `alx-staff-list` | `{ staffId: string }` | User clicked \"Reset PW\" for a staff row |\n| `toggle-status` | `alx-staff-list` | `{ staffId: string, currentStatus: string }` | User clicked Activate/Deactivate for a staff row |\n| `staff-created` | `alx-staff-create-form` | `{ staff: IStaffSummary }` | New staff member was successfully created |\n| `cancel` | `alx-staff-create-form` | `{}` | User cancelled the create form |\n| `permissions-updated` | `alx-staff-permission-editor` | `{ staffId: string, permissions: string[] }` | Permissions were saved for a staff member |\n| `password-reset` | `alx-staff-password-reset` | `{ staffId: string }` | Password was successfully reset |\n| `cancel` | `alx-staff-password-reset` | `{}` | User cancelled the password reset form |\n| `status-changed` | `alx-staff-status-toggle` | `{ staffId: string, status: string }` | Staff status was changed |\n| `group-created` | `alx-permission-group-list` | `{ group: IPermissionGroup }` | A new permission group was created |\n| `group-updated` | `alx-permission-entry-editor` | `{ groupId: string, group: IPermissionGroup }` | A permission group's entries were updated |\n| `group-deleted` | `alx-permission-group-list` | `{ groupId: string }` | A permission group was deleted |\n| `setup-complete` | `alx-staff-setup` | `{ staff: IStaff, token: string }` | Initial owner setup completed |\n\n## Theming\n\nAll components share a set of CSS custom properties defined on `:host`. Override them to match your design system:\n\n```css\nalx-staff-list {\n  --alx-bg: #0f1117;\n  --alx-surface: #181a20;\n  --alx-surface-alt: #1e2028;\n  --alx-border: #2a2d37;\n  --alx-text: #e1e4ea;\n  --alx-text-muted: #8b8fa3;\n  --alx-primary: #6366f1;\n  --alx-success: #22c55e;\n  --alx-danger: #ef4444;\n  --alx-warning: #f59e0b;\n  --alx-info: #3b82f6;\n  --alx-radius: 6px;\n  --alx-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n```\n\n### Compact density\n\nApply the `density=\"compact\"` attribute to reduce padding and font size for tighter layouts:\n\n```html\n<alx-staff-list density=\"compact\"></alx-staff-list>\n```\n\n## Links\n\n- [GitHub](https://github.com/Hariprakash1997/astralib/tree/main/packages/staff/staff-ui)\n- [staff-engine](https://github.com/Hariprakash1997/astralib/tree/main/packages/staff/staff-engine)\n- [CHANGELOG](https://github.com/Hariprakash1997/astralib/blob/main/packages/staff/staff-ui/CHANGELOG.md)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}