@fayz-ai/ui 0.5.0 → 0.6.6
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/dist/{chunk-7TBDPNLY.cjs → chunk-5QFB6AIQ.cjs} +40 -11
- package/dist/chunk-5QFB6AIQ.cjs.map +1 -0
- package/dist/{chunk-GE6XUREM.cjs → chunk-DJHS2XRW.cjs} +185 -21
- package/dist/chunk-DJHS2XRW.cjs.map +1 -0
- package/dist/{chunk-CZ6X6PZT.js → chunk-LO5QZO7F.js} +192 -28
- package/dist/chunk-LO5QZO7F.js.map +1 -0
- package/dist/{chunk-GFH5HOCO.js → chunk-XLBGB7IW.js} +40 -12
- package/dist/chunk-XLBGB7IW.js.map +1 -0
- package/dist/dashboard/DashboardCanvas.d.ts +5 -1
- package/dist/dashboard/DashboardCanvas.d.ts.map +1 -1
- package/dist/dashboard/GoldCard.d.ts +19 -0
- package/dist/dashboard/GoldCard.d.ts.map +1 -0
- package/dist/dashboard/KpiCard.d.ts.map +1 -1
- package/dist/dashboard/index.cjs +28 -24
- package/dist/dashboard/index.d.ts +1 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +46 -42
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/layout/AppShell.d.ts +27 -6
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Topbar.d.ts.map +1 -1
- package/dist/layout/index.cjs +17 -17
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/tailwind.cjs +30 -0
- package/dist/tailwind.cjs.map +1 -0
- package/dist/tailwind.d.ts +19 -0
- package/dist/tailwind.d.ts.map +1 -0
- package/dist/tailwind.js +28 -0
- package/dist/tailwind.js.map +1 -0
- package/package.json +9 -6
- package/src/dashboard/DashboardCanvas.tsx +13 -2
- package/src/dashboard/GoldCard.tsx +38 -0
- package/src/dashboard/KpiCard.tsx +4 -2
- package/src/dashboard/index.ts +1 -0
- package/src/index.ts +6 -0
- package/src/layout/AppShell.tsx +240 -20
- package/src/layout/ModulePage.tsx +2 -2
- package/src/layout/Sidebar.tsx +32 -6
- package/src/layout/Topbar.tsx +46 -17
- package/src/layout/index.ts +9 -1
- package/src/tailwind.ts +43 -0
- package/dist/chunk-7TBDPNLY.cjs.map +0 -1
- package/dist/chunk-CZ6X6PZT.js.map +0 -1
- package/dist/chunk-GE6XUREM.cjs.map +0 -1
- package/dist/chunk-GFH5HOCO.js.map +0 -1
package/dist/layout/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDJHS2XRW_cjs = require('../chunk-DJHS2XRW.cjs');
|
|
4
4
|
var chunkW4XXXJRW_cjs = require('../chunk-W4XXXJRW.cjs');
|
|
5
5
|
require('../chunk-VVVZO2LE.cjs');
|
|
6
6
|
|
|
@@ -8,67 +8,67 @@ require('../chunk-VVVZO2LE.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "AppShell", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkDJHS2XRW_cjs.AppShell; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "BackStyleProvider", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkDJHS2XRW_cjs.BackStyleProvider; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ICON_MAP", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkDJHS2XRW_cjs.ICON_MAP; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "ModuleLayoutProvider", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkDJHS2XRW_cjs.ModuleLayoutProvider; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "ModulePage", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkDJHS2XRW_cjs.ModulePage; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "NavTransitionProvider", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkDJHS2XRW_cjs.NavTransitionProvider; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "PageHeaderActions", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkDJHS2XRW_cjs.PageHeaderActions; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "PageTransition", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkDJHS2XRW_cjs.PageTransition; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "Sidebar", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkDJHS2XRW_cjs.Sidebar; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "SubpageHeader", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkDJHS2XRW_cjs.SubpageHeader; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "Topbar", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkDJHS2XRW_cjs.Topbar; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "useBackStyle", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkDJHS2XRW_cjs.useBackStyle; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "useModuleHeaderActionsSlot", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkDJHS2XRW_cjs.useModuleHeaderActionsSlot; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "useModuleHeaderSlot", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkDJHS2XRW_cjs.useModuleHeaderSlot; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "useModuleLayout", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkDJHS2XRW_cjs.useModuleLayout; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "useNavTransition", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkDJHS2XRW_cjs.useNavTransition; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "SaveBar", {
|
|
74
74
|
enumerable: true,
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AppShell, type AppShellProps, type AppShellUser } from './AppShell';
|
|
1
|
+
export { AppShell, type AppShellProps, type AppShellUser, type BottomNavItem, type BottomNavRouteItem, type BottomNavActionItem, type MobileHeaderVariant, } from './AppShell';
|
|
2
2
|
export { Sidebar, type SidebarProps, type SidebarUser, type NavigationItem, ICON_MAP } from './Sidebar';
|
|
3
3
|
export { Topbar, type TopbarProps } from './Topbar';
|
|
4
4
|
export { ModulePage, SubpageHeader, ModuleLayoutProvider, useModuleLayout, PageHeaderActions, BackStyleProvider, useBackStyle, type ModulePageProps, type ModuleNavItem, type ModuleNavVariant, type SubpageHeaderProps, type BackButtonStyle, } from './ModulePage';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACvG,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC1G,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAA"}
|
package/dist/layout/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AppShell, BackStyleProvider, ICON_MAP, ModuleLayoutProvider, ModulePage, NavTransitionProvider, PageHeaderActions, PageTransition, Sidebar, SubpageHeader, Topbar, useBackStyle, useModuleHeaderActionsSlot, useModuleHeaderSlot, useModuleLayout, useNavTransition } from '../chunk-
|
|
1
|
+
export { AppShell, BackStyleProvider, ICON_MAP, ModuleLayoutProvider, ModulePage, NavTransitionProvider, PageHeaderActions, PageTransition, Sidebar, SubpageHeader, Topbar, useBackStyle, useModuleHeaderActionsSlot, useModuleHeaderSlot, useModuleLayout, useNavTransition } from '../chunk-LO5QZO7F.js';
|
|
2
2
|
export { SaveBar, SaveBarProvider, useBackHandler, useSaveBar } from '../chunk-E526FHZ4.js';
|
|
3
3
|
import '../chunk-DNYVEOAX.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk2P7T6QQK_cjs = require('./chunk-2P7T6QQK.cjs');
|
|
4
|
+
|
|
5
|
+
// src/tailwind.ts
|
|
6
|
+
var SDK_PACKAGES = ["ui", "saas", "storefront", "portal"];
|
|
7
|
+
var GLOB = "/src/**/*.{ts,tsx}";
|
|
8
|
+
function fayzTailwind(opts = {}) {
|
|
9
|
+
const sdk = opts.sdkDir ?? "../../fayz-sdk";
|
|
10
|
+
return {
|
|
11
|
+
presets: [chunk2P7T6QQK_cjs.fayzUiPreset],
|
|
12
|
+
darkMode: "class",
|
|
13
|
+
content: [
|
|
14
|
+
"./index.html",
|
|
15
|
+
"./src/**/*.{ts,tsx}",
|
|
16
|
+
// Published / sandbox: SDK installed in node_modules (packages ship src/).
|
|
17
|
+
...SDK_PACKAGES.map((p) => `./node_modules/@fayz-ai/${p}${GLOB}`),
|
|
18
|
+
"./node_modules/@fayz-ai/plugin-*/src/**/*.{ts,tsx}",
|
|
19
|
+
// Local dev: SDK as a sibling checkout (matches nothing in production).
|
|
20
|
+
...SDK_PACKAGES.map((p) => `${sdk}/packages/${p}${GLOB}`),
|
|
21
|
+
`${sdk}/plugins/*/src/**/*.{ts,tsx}`,
|
|
22
|
+
...opts.content ?? []
|
|
23
|
+
],
|
|
24
|
+
plugins: []
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.fayzTailwind = fayzTailwind;
|
|
29
|
+
//# sourceMappingURL=tailwind.cjs.map
|
|
30
|
+
//# sourceMappingURL=tailwind.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tailwind.ts"],"names":["fayzUiPreset"],"mappings":";;;;;AAWA,IAAM,YAAA,GAAe,CAAC,IAAA,EAAM,MAAA,EAAQ,cAAc,QAAQ,CAAA;AAC1D,IAAM,IAAA,GAAO,oBAAA;AAYN,SAAS,YAAA,CAAa,IAAA,GAA4B,EAAC,EAAW;AACnE,EAAA,MAAM,GAAA,GAAM,KAAK,MAAA,IAAU,gBAAA;AAC3B,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAACA,8BAAsB,CAAA;AAAA,IAChC,QAAA,EAAU,OAAA;AAAA,IACV,OAAA,EAAS;AAAA,MACP,cAAA;AAAA,MACA,qBAAA;AAAA;AAAA,MAEA,GAAG,aAAa,GAAA,CAAI,CAAC,MAAM,CAAA,wBAAA,EAA2B,CAAC,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAAA,MAChE,oDAAA;AAAA;AAAA,MAEA,GAAG,YAAA,CAAa,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,EAAG,GAAG,CAAA,UAAA,EAAa,CAAC,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAAA,MACxD,GAAG,GAAG,CAAA,4BAAA,CAAA;AAAA,MACN,GAAI,IAAA,CAAK,OAAA,IAAW;AAAC,KACvB;AAAA,IACA,SAAS;AAAC,GACZ;AACF","file":"tailwind.cjs","sourcesContent":["import type { Config } from 'tailwindcss'\nimport { fayzUiPreset } from './theme/preset'\n\nexport interface FayzTailwindOptions {\n /** Extra app-specific content globs, appended after the SDK globs. */\n content?: string[]\n /** SDK source location relative to the app root (default ../../fayz-sdk). */\n sdkDir?: string\n}\n\n// SDK packages whose source ships Tailwind class names the app renders.\nconst SDK_PACKAGES = ['ui', 'saas', 'storefront', 'portal'] as const\nconst GLOB = '/src/**/*.{ts,tsx}'\n\n/**\n * Shared Tailwind config for Fayz dogfood apps. Applies the Fayz UI preset and\n * scans the SDK shell/UI/plugin source for class names — from node_modules (the\n * Fayz editor sandbox / published) and a sibling `../../fayz-sdk` checkout (local\n * dev). Whichever exists is scanned; missing globs are ignored. Apps no longer\n * hand-maintain content globs or the relative-vs-npm preset import.\n *\n * import { fayzTailwind } from '@fayz-ai/ui/tailwind'\n * export default fayzTailwind()\n */\nexport function fayzTailwind(opts: FayzTailwindOptions = {}): Config {\n const sdk = opts.sdkDir ?? '../../fayz-sdk'\n return {\n presets: [fayzUiPreset as Config],\n darkMode: 'class',\n content: [\n './index.html',\n './src/**/*.{ts,tsx}',\n // Published / sandbox: SDK installed in node_modules (packages ship src/).\n ...SDK_PACKAGES.map((p) => `./node_modules/@fayz-ai/${p}${GLOB}`),\n './node_modules/@fayz-ai/plugin-*/src/**/*.{ts,tsx}',\n // Local dev: SDK as a sibling checkout (matches nothing in production).\n ...SDK_PACKAGES.map((p) => `${sdk}/packages/${p}${GLOB}`),\n `${sdk}/plugins/*/src/**/*.{ts,tsx}`,\n ...(opts.content ?? []),\n ],\n plugins: [],\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss';
|
|
2
|
+
export interface FayzTailwindOptions {
|
|
3
|
+
/** Extra app-specific content globs, appended after the SDK globs. */
|
|
4
|
+
content?: string[];
|
|
5
|
+
/** SDK source location relative to the app root (default ../../fayz-sdk). */
|
|
6
|
+
sdkDir?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Shared Tailwind config for Fayz dogfood apps. Applies the Fayz UI preset and
|
|
10
|
+
* scans the SDK shell/UI/plugin source for class names — from node_modules (the
|
|
11
|
+
* Fayz editor sandbox / published) and a sibling `../../fayz-sdk` checkout (local
|
|
12
|
+
* dev). Whichever exists is scanned; missing globs are ignored. Apps no longer
|
|
13
|
+
* hand-maintain content globs or the relative-vs-npm preset import.
|
|
14
|
+
*
|
|
15
|
+
* import { fayzTailwind } from '@fayz-ai/ui/tailwind'
|
|
16
|
+
* export default fayzTailwind()
|
|
17
|
+
*/
|
|
18
|
+
export declare function fayzTailwind(opts?: FayzTailwindOptions): Config;
|
|
19
|
+
//# sourceMappingURL=tailwind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../src/tailwind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,MAAM,CAkBnE"}
|
package/dist/tailwind.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fayzUiPreset } from './chunk-IWBXYV4U.js';
|
|
2
|
+
|
|
3
|
+
// src/tailwind.ts
|
|
4
|
+
var SDK_PACKAGES = ["ui", "saas", "storefront", "portal"];
|
|
5
|
+
var GLOB = "/src/**/*.{ts,tsx}";
|
|
6
|
+
function fayzTailwind(opts = {}) {
|
|
7
|
+
const sdk = opts.sdkDir ?? "../../fayz-sdk";
|
|
8
|
+
return {
|
|
9
|
+
presets: [fayzUiPreset],
|
|
10
|
+
darkMode: "class",
|
|
11
|
+
content: [
|
|
12
|
+
"./index.html",
|
|
13
|
+
"./src/**/*.{ts,tsx}",
|
|
14
|
+
// Published / sandbox: SDK installed in node_modules (packages ship src/).
|
|
15
|
+
...SDK_PACKAGES.map((p) => `./node_modules/@fayz-ai/${p}${GLOB}`),
|
|
16
|
+
"./node_modules/@fayz-ai/plugin-*/src/**/*.{ts,tsx}",
|
|
17
|
+
// Local dev: SDK as a sibling checkout (matches nothing in production).
|
|
18
|
+
...SDK_PACKAGES.map((p) => `${sdk}/packages/${p}${GLOB}`),
|
|
19
|
+
`${sdk}/plugins/*/src/**/*.{ts,tsx}`,
|
|
20
|
+
...opts.content ?? []
|
|
21
|
+
],
|
|
22
|
+
plugins: []
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { fayzTailwind };
|
|
27
|
+
//# sourceMappingURL=tailwind.js.map
|
|
28
|
+
//# sourceMappingURL=tailwind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tailwind.ts"],"names":[],"mappings":";;;AAWA,IAAM,YAAA,GAAe,CAAC,IAAA,EAAM,MAAA,EAAQ,cAAc,QAAQ,CAAA;AAC1D,IAAM,IAAA,GAAO,oBAAA;AAYN,SAAS,YAAA,CAAa,IAAA,GAA4B,EAAC,EAAW;AACnE,EAAA,MAAM,GAAA,GAAM,KAAK,MAAA,IAAU,gBAAA;AAC3B,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,CAAC,YAAsB,CAAA;AAAA,IAChC,QAAA,EAAU,OAAA;AAAA,IACV,OAAA,EAAS;AAAA,MACP,cAAA;AAAA,MACA,qBAAA;AAAA;AAAA,MAEA,GAAG,aAAa,GAAA,CAAI,CAAC,MAAM,CAAA,wBAAA,EAA2B,CAAC,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAAA,MAChE,oDAAA;AAAA;AAAA,MAEA,GAAG,YAAA,CAAa,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,EAAG,GAAG,CAAA,UAAA,EAAa,CAAC,CAAA,EAAG,IAAI,CAAA,CAAE,CAAA;AAAA,MACxD,GAAG,GAAG,CAAA,4BAAA,CAAA;AAAA,MACN,GAAI,IAAA,CAAK,OAAA,IAAW;AAAC,KACvB;AAAA,IACA,SAAS;AAAC,GACZ;AACF","file":"tailwind.js","sourcesContent":["import type { Config } from 'tailwindcss'\nimport { fayzUiPreset } from './theme/preset'\n\nexport interface FayzTailwindOptions {\n /** Extra app-specific content globs, appended after the SDK globs. */\n content?: string[]\n /** SDK source location relative to the app root (default ../../fayz-sdk). */\n sdkDir?: string\n}\n\n// SDK packages whose source ships Tailwind class names the app renders.\nconst SDK_PACKAGES = ['ui', 'saas', 'storefront', 'portal'] as const\nconst GLOB = '/src/**/*.{ts,tsx}'\n\n/**\n * Shared Tailwind config for Fayz dogfood apps. Applies the Fayz UI preset and\n * scans the SDK shell/UI/plugin source for class names — from node_modules (the\n * Fayz editor sandbox / published) and a sibling `../../fayz-sdk` checkout (local\n * dev). Whichever exists is scanned; missing globs are ignored. Apps no longer\n * hand-maintain content globs or the relative-vs-npm preset import.\n *\n * import { fayzTailwind } from '@fayz-ai/ui/tailwind'\n * export default fayzTailwind()\n */\nexport function fayzTailwind(opts: FayzTailwindOptions = {}): Config {\n const sdk = opts.sdkDir ?? '../../fayz-sdk'\n return {\n presets: [fayzUiPreset as Config],\n darkMode: 'class',\n content: [\n './index.html',\n './src/**/*.{ts,tsx}',\n // Published / sandbox: SDK installed in node_modules (packages ship src/).\n ...SDK_PACKAGES.map((p) => `./node_modules/@fayz-ai/${p}${GLOB}`),\n './node_modules/@fayz-ai/plugin-*/src/**/*.{ts,tsx}',\n // Local dev: SDK as a sibling checkout (matches nothing in production).\n ...SDK_PACKAGES.map((p) => `${sdk}/packages/${p}${GLOB}`),\n `${sdk}/plugins/*/src/**/*.{ts,tsx}`,\n ...(opts.content ?? []),\n ],\n plugins: [],\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fayz-ai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Fayz SDK UI — Radix + Tailwind component library with CRUD engine and layout shells",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
"types": "./dist/preset.d.ts",
|
|
44
44
|
"import": "./dist/preset.js",
|
|
45
45
|
"require": "./dist/preset.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./tailwind": {
|
|
48
|
+
"source": "./src/tailwind.ts",
|
|
49
|
+
"types": "./dist/tailwind.d.ts",
|
|
50
|
+
"import": "./dist/tailwind.js",
|
|
51
|
+
"require": "./dist/tailwind.cjs"
|
|
46
52
|
}
|
|
47
53
|
},
|
|
48
54
|
"files": [
|
|
@@ -75,8 +81,8 @@
|
|
|
75
81
|
"sonner": "^1.5.0",
|
|
76
82
|
"tailwind-merge": "^2.4.0",
|
|
77
83
|
"zustand": "^4.5.0",
|
|
78
|
-
"@fayz-ai/core": "^0.
|
|
79
|
-
"@fayz-ai/auth": "^0.
|
|
84
|
+
"@fayz-ai/core": "^0.6.6",
|
|
85
|
+
"@fayz-ai/auth": "^0.6.6"
|
|
80
86
|
},
|
|
81
87
|
"devDependencies": {
|
|
82
88
|
"@types/react": "^18.3.0",
|
|
@@ -90,9 +96,6 @@
|
|
|
90
96
|
"typescript": "^5.5.0"
|
|
91
97
|
},
|
|
92
98
|
"license": "MIT",
|
|
93
|
-
"publishConfig": {
|
|
94
|
-
"access": "public"
|
|
95
|
-
},
|
|
96
99
|
"scripts": {
|
|
97
100
|
"build": "tsup && tsc --emitDeclarationOnly --declaration --declarationMap --noEmit false",
|
|
98
101
|
"dev": "tsup --watch",
|
|
@@ -90,6 +90,10 @@ export interface DashboardCanvasProps {
|
|
|
90
90
|
showHeader?: boolean
|
|
91
91
|
/** App-level curation of which widgets show, their order and span. */
|
|
92
92
|
appLayout?: DashboardLayoutConfig
|
|
93
|
+
/** App-level widgets injected into this surface's grid without a plugin — e.g.
|
|
94
|
+
* an "Ask the assistant" CTA. Merged with the registry widgets, then laid out
|
|
95
|
+
* (respects each widget's span/defaultOrder). Filtered to this surface. */
|
|
96
|
+
extraWidgets?: DashboardWidgetDef[]
|
|
93
97
|
/** Show a shared time-range control (sticky, top-right). Widgets read it via
|
|
94
98
|
* useDashboardRange(). Pass `true` for defaults or an options object. */
|
|
95
99
|
range?: boolean | DashboardRangeOptions
|
|
@@ -115,11 +119,18 @@ export interface DashboardRangeOptions {
|
|
|
115
119
|
}
|
|
116
120
|
|
|
117
121
|
export function DashboardCanvas({
|
|
118
|
-
surface, domain, title, subtitle, showHeader = true, appLayout, range,
|
|
122
|
+
surface, domain, title, subtitle, showHeader = true, appLayout, extraWidgets, range,
|
|
119
123
|
customizable = true, customizeLabel, initialVisibility, onNavigate, className,
|
|
120
124
|
}: DashboardCanvasProps) {
|
|
121
125
|
const runtime = usePluginRuntime()
|
|
122
|
-
const
|
|
126
|
+
const registryWidgets = getDashboardWidgets(runtime, { surface, domain })
|
|
127
|
+
const widgets = React.useMemo<DashboardWidgetDef[]>(() => {
|
|
128
|
+
const extra = (extraWidgets ?? []).filter((w) => {
|
|
129
|
+
if (!(w.surfaces ?? ['home', 'plugin-home']).includes(surface)) return false
|
|
130
|
+
return !domain || w.domain === domain
|
|
131
|
+
})
|
|
132
|
+
return extra.length ? [...registryWidgets, ...extra] : registryWidgets
|
|
133
|
+
}, [registryWidgets, extraWidgets, surface, domain])
|
|
123
134
|
const rangeOpts: DashboardRangeOptions | null = range ? (range === true ? {} : range) : null
|
|
124
135
|
|
|
125
136
|
const forceAll = (initialVisibility ?? (surface === 'plugin-home' ? 'all' : 'default')) === 'all'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '../utils/cn'
|
|
3
|
+
|
|
4
|
+
export interface GoldCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Brand-colored hero variant — `bg-primary text-primary-foreground` with a
|
|
7
|
+
* soft branded shadow. Use for the headline card (e.g. a balance hero). When
|
|
8
|
+
* false (default) it's a plain surface card (`bg-card` + border).
|
|
9
|
+
*/
|
|
10
|
+
branded?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* GoldCard — a generic, reusable rounded card wrapper for dashboard surfaces.
|
|
15
|
+
*
|
|
16
|
+
* The `branded` variant paints the card in the app's primary color so a single
|
|
17
|
+
* hero (balance, headline KPI, CTA) pops against the neutral grid. Both variants
|
|
18
|
+
* are internally full-width so they reflow cleanly inside the responsive
|
|
19
|
+
* DashboardGrid (full-width on mobile, cell-width on desktop).
|
|
20
|
+
*/
|
|
21
|
+
export const GoldCard = React.forwardRef<HTMLDivElement, GoldCardProps>(
|
|
22
|
+
({ branded = false, className, children, ...rest }, ref) => (
|
|
23
|
+
<div
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn(
|
|
26
|
+
'h-full rounded-3xl p-5',
|
|
27
|
+
branded
|
|
28
|
+
? 'bg-primary text-primary-foreground shadow-lg shadow-primary/20'
|
|
29
|
+
: 'border border-border bg-card text-card-foreground shadow-sm',
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</div>
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
GoldCard.displayName = 'GoldCard'
|
|
@@ -222,8 +222,10 @@ export function KpiCard(props: KpiCardProps) {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
return (
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
// h-full so cards fill the (stretch) grid cell and every card in a row matches
|
|
226
|
+
// the tallest — labels/subtitles of different lengths no longer misalign them.
|
|
227
|
+
<Card className="h-full">
|
|
228
|
+
<CardContent className="flex h-full flex-col p-4">
|
|
227
229
|
<div className="mb-2 flex items-center justify-between gap-2">
|
|
228
230
|
<span className="text-sm text-muted-foreground">{label}</span>
|
|
229
231
|
<span className="text-muted-foreground">{renderIcon(icon)}</span>
|
package/src/dashboard/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { resolveDashboardLayout, type LaidOutWidget } from './layout'
|
|
|
10
10
|
export { useDashboardPreferences, type DashboardPreferencesState } from './preferences'
|
|
11
11
|
export { DashboardCustomizeMenu, type DashboardCustomizeMenuProps } from './DashboardCustomizeMenu'
|
|
12
12
|
export { DashboardGrid, type DashboardGridItem, type DashboardGridProps } from './DashboardGrid'
|
|
13
|
+
export { GoldCard, type GoldCardProps } from './GoldCard'
|
|
13
14
|
export {
|
|
14
15
|
DashboardRangeProvider,
|
|
15
16
|
DashboardRangeControl,
|
package/src/index.ts
CHANGED
|
@@ -105,6 +105,10 @@ export {
|
|
|
105
105
|
AppShell,
|
|
106
106
|
type AppShellProps,
|
|
107
107
|
type AppShellUser,
|
|
108
|
+
type BottomNavItem,
|
|
109
|
+
type BottomNavRouteItem,
|
|
110
|
+
type BottomNavActionItem,
|
|
111
|
+
type MobileHeaderVariant,
|
|
108
112
|
Sidebar,
|
|
109
113
|
type SidebarProps,
|
|
110
114
|
type SidebarUser,
|
|
@@ -179,6 +183,8 @@ export {
|
|
|
179
183
|
DashboardGrid,
|
|
180
184
|
type DashboardGridItem,
|
|
181
185
|
type DashboardGridProps,
|
|
186
|
+
GoldCard,
|
|
187
|
+
type GoldCardProps,
|
|
182
188
|
DashboardRangeProvider,
|
|
183
189
|
DashboardRangeControl,
|
|
184
190
|
useDashboardRange,
|