@fayz-ai/plugin-dashboard 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -0
  3. package/package.json +3 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Faya Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @fayz-ai/plugin-dashboard
2
+
3
+ > One composable home where every plugin renders its own widgets.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@fayz-ai/plugin-dashboard.svg)](https://www.npmjs.com/package/@fayz-ai/plugin-dashboard)
6
+ [![license](https://img.shields.io/npm/l/@fayz-ai/plugin-dashboard.svg)](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
7
+
8
+ A SaaS home page is never owned by one team. Bookings wants today's agenda, finance wants revenue, the shop wants top products. The usual outcome is one god-component that imports everything and rots. This plugin kills that. It provides the `/` home surface and a **widget registry**: every plugin contributes its own `dashboardWidgets`, and the dashboard renders, orders, and lays them out into a single coherent grid — no plugin needs to know any other plugin exists.
9
+
10
+ That's the whole bet of the Fayz SDK at the home screen. Enable booking + finance + shop and the home fills itself out. The app author curates — which widgets show, order, span, an optional shared time-range — and each plugin owns its own data. Compose a real SaaS home from plugins instead of maintaining a dashboard by hand.
11
+
12
+ ## What's inside
13
+ - The `/` home **surface** rendered by `DashboardCanvas`, driven entirely by the widget registry
14
+ - KPI metrics with async `compute`, trends, goals, and currency formatting (`metrics` → KPI cards)
15
+ - Custom app sections, an onboarding/getting-started checklist, and app-contributed `customWidgets`
16
+ - App-level `layout` curation on top of every plugin's registered defaults — visibility, order, span
17
+ - An optional shared, sticky `range` control (7d/30d/90d) that widgets read via `useDashboardRange()`
18
+ - An `getKpiSummary` AI tool so an assistant can answer "how is my business doing today?"
19
+ - Per-surface user preferences (show/hide/reorder), persisted, plus full i18n
20
+
21
+ ## Install
22
+ ```bash
23
+ npm install @fayz-ai/plugin-dashboard
24
+ ```
25
+ Peer deps: `@fayz-ai/core`, `@fayz-ai/ui` (+ `react`, `react-dom`).
26
+
27
+ ## Usage
28
+ ```tsx
29
+ import { defineSaas } from '@fayz-ai/saas'
30
+ import { createDashboardPlugin } from '@fayz-ai/plugin-dashboard'
31
+
32
+ export const app = defineSaas({
33
+ // ...
34
+ plugins: [
35
+ createDashboardPlugin({
36
+ metrics: [
37
+ { id: 'revenue', label: 'Revenue', icon: 'DollarSign', format: 'currency', compute: getRevenue },
38
+ ],
39
+ currency: { code: 'BRL', locale: 'pt-BR' },
40
+ onboardingSteps: [
41
+ { id: 'connect-payments', label: 'Connect payments', done: false },
42
+ ],
43
+ range: true, // shared 7d/30d/90d time-range on the home
44
+ }),
45
+ // other plugins contribute their own widgets into this same home
46
+ ],
47
+ })
48
+ ```
49
+ Other plugins just ship `dashboardWidgets` in their manifest — they land on this surface automatically. Use `defineKpiWidget` / `defineChartWidget` / `defineTableWidget` from `@fayz-ai/ui` to build them.
50
+
51
+ ## Part of the Fayz SDK
52
+ The home surface and widget registry that the rest of the Fayz plugins render into.
53
+
54
+ ## Roadmap & contributing
55
+ Built and evolving in the open. See the [Fayz SDK roadmap](../../docs/ROADMAP.md#plugin-dashboard) for current gaps, missing features, and good first issues.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fayz-ai/plugin-dashboard",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Fayz SDK — plugin-dashboard plugin",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -25,8 +25,8 @@
25
25
  "dependencies": {
26
26
  "lucide-react": "^0.400.0",
27
27
  "zustand": "^4.5.0",
28
- "@fayz-ai/ui": "^0.1.6",
29
- "@fayz-ai/core": "^0.1.6"
28
+ "@fayz-ai/core": "^0.2.0",
29
+ "@fayz-ai/ui": "^0.2.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "^18.3.0",