@lucasvu/scope-ui 0.0.5 → 0.0.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/AI_SETUP.md +14 -5
- package/README.md +17 -4
- package/bin/scope-ui-init.mjs +36 -1
- package/dist/index.cjs +210 -0
- package/dist/index.d.cts +286 -2
- package/dist/index.d.ts +286 -2
- package/dist/index.js +209 -1
- package/package.json +1 -1
package/AI_SETUP.md
CHANGED
|
@@ -5,13 +5,19 @@ Mục tiêu của file này là để AI của project dùng `@lucasvu/scope-ui`
|
|
|
5
5
|
Nếu project consumer đã cài package, cách nhanh nhất là chạy:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npm install @lucasvu/scope-ui
|
|
9
9
|
npx scope-ui-init --theme forest
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Nếu chưa
|
|
12
|
+
Nếu chưa biết chọn preset nào thì chạy thêm:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx scope-ui-init --list-themes
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Nếu chưa cài `@lucasvu/scope-ui`, các lệnh trên sẽ báo `E404` vì npm sẽ cố tải package tên `scope-ui-init`.
|
|
13
19
|
|
|
14
|
-
CLI này sẽ tạo `AGENTS.md` và `src/styles/ui-theme.css` theo đúng convention bên dưới. Nếu không truyền `--theme`, preset mặc định là `ocean`.
|
|
20
|
+
CLI này sẽ tạo `AGENTS.md` và `src/styles/ui-theme.css` theo đúng convention bên dưới. `AGENTS.md` sẽ chứa luôn workflow step-by-step để agent dựng UI đúng thứ tự. Nếu không truyền `--theme`, preset mặc định là `ocean`.
|
|
15
21
|
|
|
16
22
|
## 1. Import style đúng thứ tự
|
|
17
23
|
|
|
@@ -67,8 +73,10 @@ Always:
|
|
|
67
73
|
- import the project theme override file after the package stylesheet
|
|
68
74
|
- use root exports from `@lucasvu/scope-ui`
|
|
69
75
|
- stay inside the approved preset declared by `src/styles/ui-theme.css`
|
|
76
|
+
- follow the step-by-step UI build workflow from `AGENTS.md` before writing JSX
|
|
77
|
+
- fill the screen brief first: `routeUrl`, `sidebarItems`, `activeSidebarItemId`, `pageTitle`, `actions`, and the page-specific schema
|
|
70
78
|
- read `uiAiManifest` to choose the right component by intent
|
|
71
|
-
- read `uiThemeContract` before changing colors, surfaces, borders, or shadows
|
|
79
|
+
- read `uiScreenBlueprint` and `uiThemeContract` before changing layout, colors, surfaces, borders, or shadows
|
|
72
80
|
|
|
73
81
|
Do not:
|
|
74
82
|
- import from `MainFe` unless the task explicitly targets a legacy screen
|
|
@@ -93,10 +101,11 @@ Component choice:
|
|
|
93
101
|
Trong code, AI có thể đọc trực tiếp:
|
|
94
102
|
|
|
95
103
|
```ts
|
|
96
|
-
import { uiAiManifest, uiThemeContract, uiThemePresets, uiProjectAiRules } from '@lucasvu/scope-ui'
|
|
104
|
+
import { uiAiManifest, uiScreenBlueprint, uiThemeContract, uiThemePresets, uiProjectAiRules } from '@lucasvu/scope-ui'
|
|
97
105
|
```
|
|
98
106
|
|
|
99
107
|
- `uiAiManifest`: chọn component theo intent
|
|
108
|
+
- `uiScreenBlueprint`: brief input và khung layout chuẩn cho `list | form | detail | dashboard`
|
|
100
109
|
- `uiThemeContract`: biết override token nào và override ở đâu
|
|
101
110
|
- `uiThemePresets`: danh sách preset được duyệt để nhiều project dùng chung một visual language
|
|
102
111
|
- `uiProjectAiRules`: rule ngắn gọn để inject vào agent của project
|
package/README.md
CHANGED
|
@@ -19,13 +19,19 @@ import '@lucasvu/scope-ui/styles.css';
|
|
|
19
19
|
3. Nếu muốn bootstrap rule/theme cho AI trong project consumer:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
|
|
22
|
+
npm install @lucasvu/scope-ui
|
|
23
23
|
npx scope-ui-init --theme sunset
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Nếu chưa biết chọn preset nào thì mới cần xem danh sách trước:
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
```bash
|
|
29
|
+
npx scope-ui-init --list-themes
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Lưu ý: các lệnh này chỉ chạy được sau khi project đã cài `@lucasvu/scope-ui`. Nếu chưa cài package, `npx` sẽ đi tìm một package riêng tên `scope-ui-init` trên npm và báo `E404`.
|
|
33
|
+
|
|
34
|
+
Lệnh này sẽ tạo `AGENTS.md` và `src/styles/ui-theme.css` trong repo hiện tại theo preset đã chọn. `AGENTS.md` giờ có thêm playbook step-by-step để agent dựng màn hình đúng layout/component/theme chung. Nếu không truyền `--theme`, preset mặc định là `ocean`. Dùng `--force` nếu muốn overwrite file đã tồn tại.
|
|
29
35
|
|
|
30
36
|
4. Dùng component:
|
|
31
37
|
|
|
@@ -104,17 +110,21 @@ Nếu muốn AI render UI đúng và ổn định theo thư viện này, đừng
|
|
|
104
110
|
|
|
105
111
|
- Import CSS global một lần: `@lucasvu/scope-ui/styles.css`
|
|
106
112
|
- Import file theme override của project ngay sau package CSS, ví dụ `./styles/ui-theme.css`
|
|
113
|
+
- Cài package trước khi bootstrap: `npm install @lucasvu/scope-ui`
|
|
107
114
|
- Chạy `npx scope-ui-init --list-themes` để xem preset được duyệt
|
|
108
115
|
- Chạy `npx scope-ui-init --theme <preset>` ở project consumer sau khi đã cài `@lucasvu/scope-ui` để tạo `AGENTS.md` và `src/styles/ui-theme.css`
|
|
109
116
|
- Khoá project vào một preset thay vì tự bịa palette mới cho từng page
|
|
117
|
+
- Để agent đọc luôn playbook trong `AGENTS.md` để đi đúng thứ tự: kiểm tra import, chọn component, dựng layout, rồi mới tinh chỉnh token
|
|
118
|
+
- Buộc agent điền screen brief trước khi code: `routeUrl`, `sidebarItems`, `activeSidebarItemId`, `pageTitle`, `actions`, `filters`, `fields`, `tableColumns`
|
|
110
119
|
- Chỉ dùng các component canonical ở root package; tránh `MainFe` nếu không phải legacy screen
|
|
111
120
|
- Cho agent đọc `uiAiManifest` để biết component nào dùng cho intent nào, props quan trọng là gì, và khi nào không nên dùng
|
|
112
|
-
- Cho agent đọc `uiThemeContract` và `uiThemePresets` để biết
|
|
121
|
+
- Cho agent đọc `uiScreenBlueprint`, `uiThemeContract` và `uiThemePresets` để biết screen recipe, preset và token nào được phép override
|
|
113
122
|
|
|
114
123
|
```ts
|
|
115
124
|
import {
|
|
116
125
|
uiAiManifest,
|
|
117
126
|
uiProjectAiRules,
|
|
127
|
+
uiScreenBlueprint,
|
|
118
128
|
uiThemeContract,
|
|
119
129
|
uiThemePresets,
|
|
120
130
|
} from '@lucasvu/scope-ui';
|
|
@@ -122,6 +132,8 @@ import {
|
|
|
122
132
|
|
|
123
133
|
`uiAiManifest` mô tả luật chọn component theo intent như: text input, textarea, fixed select, searchable select, async combobox, multi select, data table, alert, card và field wrapper.
|
|
124
134
|
|
|
135
|
+
`uiScreenBlueprint` mô tả input brief bắt buộc cho từng màn hình như `routeUrl`, `sidebarItems`, `activeSidebarItemId`, `pageTitle`, `actions`, `filters`, `fields`, `tableColumns` và frame recipe cho `list | form | detail | dashboard`.
|
|
136
|
+
|
|
125
137
|
`uiThemeContract` mô tả token màu, surface, border, shadow, radius, gradient và selector theme (`:root`, `.dark`, `[data-ui-theme='*']`) để AI không hardcode màu sai chỗ.
|
|
126
138
|
|
|
127
139
|
`uiThemePresets` là danh sách preset được duyệt sẵn để nhiều project có thể chọn cùng một visual language mà không cần tự dựng theme từ đầu.
|
|
@@ -135,6 +147,7 @@ Nên để toàn bộ override theme của project vào một file riêng, ví d
|
|
|
135
147
|
Cách nhanh nhất là generate file này từ preset:
|
|
136
148
|
|
|
137
149
|
```bash
|
|
150
|
+
npm install @lucasvu/scope-ui
|
|
138
151
|
npx scope-ui-init --list-themes
|
|
139
152
|
npx scope-ui-init --theme ocean
|
|
140
153
|
```
|
package/bin/scope-ui-init.mjs
CHANGED
|
@@ -281,8 +281,12 @@ Usage:
|
|
|
281
281
|
npx scope-ui-init
|
|
282
282
|
Run this after @lucasvu/scope-ui has been installed in the consumer project.
|
|
283
283
|
|
|
284
|
-
npx scope-ui-init --list-themes
|
|
285
284
|
npx scope-ui-init --theme sunset
|
|
285
|
+
Fast path when you already know the preset you want.
|
|
286
|
+
|
|
287
|
+
npx scope-ui-init --list-themes
|
|
288
|
+
Optional: inspect approved presets before choosing one.
|
|
289
|
+
|
|
286
290
|
npx scope-ui-init --theme forest --force
|
|
287
291
|
npx scope-ui-init --agents-file AGENTS.md --theme-file src/styles/ui-theme.css
|
|
288
292
|
|
|
@@ -338,12 +342,43 @@ This repo is locked to the \`${themePreset.label}\` theme preset (\`${themePrese
|
|
|
338
342
|
Primary references:
|
|
339
343
|
- \`node_modules/${PACKAGE_NAME}/README.md\`
|
|
340
344
|
- \`node_modules/${PACKAGE_NAME}/AI_SETUP.md\`
|
|
345
|
+
- \`uiScreenBlueprint\` and \`uiAiManifest\` from \`${PACKAGE_NAME}\`
|
|
341
346
|
- \`${themeFile}\`
|
|
342
347
|
|
|
343
348
|
Theme preset summary:
|
|
344
349
|
- ${themePreset.description}
|
|
345
350
|
- Recommended for: ${themePreset.recommendedFor.join(', ')}
|
|
346
351
|
|
|
352
|
+
UI build workflow:
|
|
353
|
+
1. Read \`${themeFile}\`, \`node_modules/${PACKAGE_NAME}/README.md\`, \`node_modules/${PACKAGE_NAME}/AI_SETUP.md\`, and the exported \`uiScreenBlueprint\` contract before generating UI.
|
|
354
|
+
2. Fill the screen brief first. If route url, sidebar items, active sidebar item, title, actions, filters, fields, or columns are missing, ask for them or leave clear TODO placeholders instead of inventing them.
|
|
355
|
+
3. Verify the app entry imports \`${PACKAGE_NAME}/styles.css\` first and the project theme file right after it.
|
|
356
|
+
4. Identify the page kind (\`list | form | detail | dashboard\`), then map each block to canonical components from \`uiAiManifest\` before writing JSX.
|
|
357
|
+
5. Build the shell in this order: \`Sidebar\` -> \`Breadcrumb\` -> \`PageTitle\` -> top actions -> page body cards/grids.
|
|
358
|
+
6. For list pages, build filters first and then the \`DataTable\`. For form pages, build section cards and fields. For detail pages, build summary cards and related tables. For dashboard pages, build stat cards and then supporting tables/cards.
|
|
359
|
+
7. Keep all colors, radius, surface, and shadow decisions inside \`${themeFile}\`. If the preset is insufficient, update tokens there instead of styling one page ad hoc.
|
|
360
|
+
8. Before finishing, self-check: no \`MainFe\`, no hardcoded palette, correct import order, complete brief coverage, consistent spacing, and the screen still matches the shared preset.
|
|
361
|
+
|
|
362
|
+
Screen brief template:
|
|
363
|
+
- pageKind: list | form | detail | dashboard
|
|
364
|
+
- routeUrl:
|
|
365
|
+
- sidebarItems: [{ id, title, href }]
|
|
366
|
+
- activeSidebarItemId:
|
|
367
|
+
- breadcrumbs:
|
|
368
|
+
- pageTitle:
|
|
369
|
+
- pageSubtitle:
|
|
370
|
+
- primaryAction:
|
|
371
|
+
- secondaryActions:
|
|
372
|
+
- summaryStats:
|
|
373
|
+
- filters:
|
|
374
|
+
- tableColumns:
|
|
375
|
+
- rowActions:
|
|
376
|
+
- formSections:
|
|
377
|
+
- fields:
|
|
378
|
+
- detailSections:
|
|
379
|
+
- emptyState:
|
|
380
|
+
- permissions:
|
|
381
|
+
|
|
347
382
|
Always:
|
|
348
383
|
- import \`${PACKAGE_NAME}/styles.css\` once at the app entry
|
|
349
384
|
- import the project theme override file after the package stylesheet
|
package/dist/index.cjs
CHANGED
|
@@ -6647,6 +6647,7 @@ var uiAiManifest = {
|
|
|
6647
6647
|
rules: [
|
|
6648
6648
|
"Import the stylesheet once at the app entry before rendering any component.",
|
|
6649
6649
|
"If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.",
|
|
6650
|
+
"Collect the screen brief first: route url, sidebar items, active sidebar item, page title, actions, and the page-specific content schema.",
|
|
6650
6651
|
"Prefer the canonical component for each intent instead of mixing legacy MainFe components.",
|
|
6651
6652
|
"Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.",
|
|
6652
6653
|
"Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.",
|
|
@@ -6862,6 +6863,213 @@ var uiAiManifest = {
|
|
|
6862
6863
|
]
|
|
6863
6864
|
};
|
|
6864
6865
|
|
|
6866
|
+
// src/screen-blueprint.ts
|
|
6867
|
+
var uiScreenBriefFields = [
|
|
6868
|
+
{
|
|
6869
|
+
id: "pageKind",
|
|
6870
|
+
label: "Page kind",
|
|
6871
|
+
description: "Choose the base recipe for the screen.",
|
|
6872
|
+
required: true,
|
|
6873
|
+
appliesTo: ["all"],
|
|
6874
|
+
example: "list"
|
|
6875
|
+
},
|
|
6876
|
+
{
|
|
6877
|
+
id: "routeUrl",
|
|
6878
|
+
label: "Route URL",
|
|
6879
|
+
description: "Final route for the screen or feature entry.",
|
|
6880
|
+
required: true,
|
|
6881
|
+
appliesTo: ["all"],
|
|
6882
|
+
example: "/admin/users"
|
|
6883
|
+
},
|
|
6884
|
+
{
|
|
6885
|
+
id: "sidebarItems",
|
|
6886
|
+
label: "Sidebar items",
|
|
6887
|
+
description: "Sidebar entries with at least id, title, and href so the shell stays consistent.",
|
|
6888
|
+
required: true,
|
|
6889
|
+
appliesTo: ["all"],
|
|
6890
|
+
example: '[{ id: "users", title: "Users", href: "/admin/users" }]'
|
|
6891
|
+
},
|
|
6892
|
+
{
|
|
6893
|
+
id: "activeSidebarItemId",
|
|
6894
|
+
label: "Active sidebar item id",
|
|
6895
|
+
description: "The sidebar item that should appear active on this screen.",
|
|
6896
|
+
required: true,
|
|
6897
|
+
appliesTo: ["all"],
|
|
6898
|
+
example: "users"
|
|
6899
|
+
},
|
|
6900
|
+
{
|
|
6901
|
+
id: "breadcrumbs",
|
|
6902
|
+
label: "Breadcrumbs",
|
|
6903
|
+
description: "Ordered breadcrumb items for the page header.",
|
|
6904
|
+
required: false,
|
|
6905
|
+
appliesTo: ["all"],
|
|
6906
|
+
example: '[{ label: "Admin", href: "/admin" }, { label: "Users", current: true }]'
|
|
6907
|
+
},
|
|
6908
|
+
{
|
|
6909
|
+
id: "pageTitle",
|
|
6910
|
+
label: "Page title",
|
|
6911
|
+
description: "Main page heading shown in the content header.",
|
|
6912
|
+
required: true,
|
|
6913
|
+
appliesTo: ["all"],
|
|
6914
|
+
example: "Users"
|
|
6915
|
+
},
|
|
6916
|
+
{
|
|
6917
|
+
id: "pageSubtitle",
|
|
6918
|
+
label: "Page subtitle",
|
|
6919
|
+
description: "Short supporting text under the title.",
|
|
6920
|
+
required: false,
|
|
6921
|
+
appliesTo: ["all"],
|
|
6922
|
+
example: "Manage internal user accounts and permissions."
|
|
6923
|
+
},
|
|
6924
|
+
{
|
|
6925
|
+
id: "primaryAction",
|
|
6926
|
+
label: "Primary action",
|
|
6927
|
+
description: "The highest-emphasis action shown in the page header.",
|
|
6928
|
+
required: false,
|
|
6929
|
+
appliesTo: ["all"],
|
|
6930
|
+
example: '{ label: "Create user", href: "/admin/users/create" }'
|
|
6931
|
+
},
|
|
6932
|
+
{
|
|
6933
|
+
id: "secondaryActions",
|
|
6934
|
+
label: "Secondary actions",
|
|
6935
|
+
description: "Additional header actions such as export, refresh, or cancel.",
|
|
6936
|
+
required: false,
|
|
6937
|
+
appliesTo: ["all"],
|
|
6938
|
+
example: '[{ label: "Export" }, { label: "Refresh" }]'
|
|
6939
|
+
},
|
|
6940
|
+
{
|
|
6941
|
+
id: "summaryStats",
|
|
6942
|
+
label: "Summary stats",
|
|
6943
|
+
description: "Top-line numbers for dashboard or overview screens.",
|
|
6944
|
+
required: false,
|
|
6945
|
+
appliesTo: ["dashboard", "detail"],
|
|
6946
|
+
example: '[{ label: "Active users", value: "1,204", trend: "up", delta: "+12%" }]'
|
|
6947
|
+
},
|
|
6948
|
+
{
|
|
6949
|
+
id: "filters",
|
|
6950
|
+
label: "Filters",
|
|
6951
|
+
description: "Filter bar controls shown above list or dashboard content.",
|
|
6952
|
+
required: false,
|
|
6953
|
+
appliesTo: ["list", "dashboard"],
|
|
6954
|
+
example: '[{ type: "search", label: "Search user" }, { type: "select", label: "Role" }]'
|
|
6955
|
+
},
|
|
6956
|
+
{
|
|
6957
|
+
id: "tableColumns",
|
|
6958
|
+
label: "Table columns",
|
|
6959
|
+
description: "Columns for a list table, including label and render intent.",
|
|
6960
|
+
required: false,
|
|
6961
|
+
appliesTo: ["list", "detail", "dashboard"],
|
|
6962
|
+
example: '[{ key: "name", title: "Name" }, { key: "role", title: "Role" }]'
|
|
6963
|
+
},
|
|
6964
|
+
{
|
|
6965
|
+
id: "rowActions",
|
|
6966
|
+
label: "Row actions",
|
|
6967
|
+
description: "Per-row actions for table screens.",
|
|
6968
|
+
required: false,
|
|
6969
|
+
appliesTo: ["list", "detail"],
|
|
6970
|
+
example: '[{ label: "Edit" }, { label: "Reset password" }]'
|
|
6971
|
+
},
|
|
6972
|
+
{
|
|
6973
|
+
id: "formSections",
|
|
6974
|
+
label: "Form sections",
|
|
6975
|
+
description: "Grouped form sections and the fields inside each section.",
|
|
6976
|
+
required: false,
|
|
6977
|
+
appliesTo: ["form"],
|
|
6978
|
+
example: '[{ title: "Basic info", fields: ["name", "email", "role"] }]'
|
|
6979
|
+
},
|
|
6980
|
+
{
|
|
6981
|
+
id: "fields",
|
|
6982
|
+
label: "Fields",
|
|
6983
|
+
description: "Detailed field list with type, label, required state, and helper text.",
|
|
6984
|
+
required: false,
|
|
6985
|
+
appliesTo: ["form", "detail"],
|
|
6986
|
+
example: '[{ name: "email", type: "input", label: "Email", required: true }]'
|
|
6987
|
+
},
|
|
6988
|
+
{
|
|
6989
|
+
id: "detailSections",
|
|
6990
|
+
label: "Detail sections",
|
|
6991
|
+
description: "Cards or sections for detail pages such as profile, activity, permissions, or related records.",
|
|
6992
|
+
required: false,
|
|
6993
|
+
appliesTo: ["detail"],
|
|
6994
|
+
example: '[{ title: "Profile" }, { title: "Recent activity" }]'
|
|
6995
|
+
},
|
|
6996
|
+
{
|
|
6997
|
+
id: "emptyState",
|
|
6998
|
+
label: "Empty state",
|
|
6999
|
+
description: "Fallback title, description, and action when there is no data.",
|
|
7000
|
+
required: false,
|
|
7001
|
+
appliesTo: ["list", "dashboard", "detail"],
|
|
7002
|
+
example: '{ title: "No users yet", description: "Create the first user to get started." }'
|
|
7003
|
+
},
|
|
7004
|
+
{
|
|
7005
|
+
id: "permissions",
|
|
7006
|
+
label: "Permissions",
|
|
7007
|
+
description: "Permission keys that affect sidebar visibility or action availability.",
|
|
7008
|
+
required: false,
|
|
7009
|
+
appliesTo: ["all"],
|
|
7010
|
+
example: '["user.read", "user.write"]'
|
|
7011
|
+
}
|
|
7012
|
+
];
|
|
7013
|
+
var uiScreenBlueprint = {
|
|
7014
|
+
pageKinds: [
|
|
7015
|
+
{
|
|
7016
|
+
id: "list",
|
|
7017
|
+
label: "List page",
|
|
7018
|
+
frame: [
|
|
7019
|
+
"Sidebar shell",
|
|
7020
|
+
"Breadcrumb",
|
|
7021
|
+
"PageTitle with actions",
|
|
7022
|
+
"Optional stats",
|
|
7023
|
+
"Filter card",
|
|
7024
|
+
"DataTable card"
|
|
7025
|
+
]
|
|
7026
|
+
},
|
|
7027
|
+
{
|
|
7028
|
+
id: "form",
|
|
7029
|
+
label: "Form page",
|
|
7030
|
+
frame: [
|
|
7031
|
+
"Sidebar shell",
|
|
7032
|
+
"Breadcrumb",
|
|
7033
|
+
"PageTitle with primary and cancel actions",
|
|
7034
|
+
"Sectioned form cards",
|
|
7035
|
+
"Bottom action row"
|
|
7036
|
+
]
|
|
7037
|
+
},
|
|
7038
|
+
{
|
|
7039
|
+
id: "detail",
|
|
7040
|
+
label: "Detail page",
|
|
7041
|
+
frame: [
|
|
7042
|
+
"Sidebar shell",
|
|
7043
|
+
"Breadcrumb",
|
|
7044
|
+
"PageTitle with status/actions",
|
|
7045
|
+
"Summary stats or metadata card",
|
|
7046
|
+
"Detail cards and related tables"
|
|
7047
|
+
]
|
|
7048
|
+
},
|
|
7049
|
+
{
|
|
7050
|
+
id: "dashboard",
|
|
7051
|
+
label: "Dashboard page",
|
|
7052
|
+
frame: [
|
|
7053
|
+
"Sidebar shell",
|
|
7054
|
+
"Breadcrumb",
|
|
7055
|
+
"PageTitle with actions",
|
|
7056
|
+
"Stat cards row",
|
|
7057
|
+
"Filters",
|
|
7058
|
+
"Main insight cards and tables"
|
|
7059
|
+
]
|
|
7060
|
+
}
|
|
7061
|
+
],
|
|
7062
|
+
workflow: [
|
|
7063
|
+
"Collect the screen brief before coding. Do not invent sidebar items, route urls, filters, fields, or table columns if the brief is missing.",
|
|
7064
|
+
"Use Sidebar plus Breadcrumb and PageTitle to lock the shell before building the page body.",
|
|
7065
|
+
"Choose only canonical root exports from @lucasvu/scope-ui.",
|
|
7066
|
+
"Use Card and ui-grid utilities to create the frame first, then place controls and data components inside.",
|
|
7067
|
+
"Keep all palette, radius, surface, and shadow decisions in the shared ui-theme.css preset file.",
|
|
7068
|
+
"End with a consistency check against the selected preset and the screen brief."
|
|
7069
|
+
],
|
|
7070
|
+
briefFields: uiScreenBriefFields
|
|
7071
|
+
};
|
|
7072
|
+
|
|
6865
7073
|
// src/theme-contract.ts
|
|
6866
7074
|
var uiThemePresets = [
|
|
6867
7075
|
{
|
|
@@ -7296,5 +7504,7 @@ exports.hasActiveDescendant = hasActiveDescendant;
|
|
|
7296
7504
|
exports.uiAiManifest = uiAiManifest;
|
|
7297
7505
|
exports.uiDefaultThemePreset = uiDefaultThemePreset;
|
|
7298
7506
|
exports.uiProjectAiRules = uiProjectAiRules;
|
|
7507
|
+
exports.uiScreenBlueprint = uiScreenBlueprint;
|
|
7508
|
+
exports.uiScreenBriefFields = uiScreenBriefFields;
|
|
7299
7509
|
exports.uiThemeContract = uiThemeContract;
|
|
7300
7510
|
exports.uiThemePresets = uiThemePresets;
|
package/dist/index.d.cts
CHANGED
|
@@ -875,7 +875,7 @@ type UiAiComponentDescriptor = {
|
|
|
875
875
|
declare const uiAiManifest: {
|
|
876
876
|
readonly packageName: "@lucasvu/scope-ui";
|
|
877
877
|
readonly styleImport: "@lucasvu/scope-ui/styles.css";
|
|
878
|
-
readonly rules: readonly ["Import the stylesheet once at the app entry before rendering any component.", "If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.", "Prefer the canonical component for each intent instead of mixing legacy MainFe components.", "Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.", "Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.", "Always provide a stable rowKey to DataTable and use sortMode=\"server\" when sorting happens on the backend.", "Prefer Card as the outer layout section and keep alerts, stats, and tables inside CardContent when building dashboards or forms.", "Do not import MainFe components unless the target explicitly asks for legacy main-fe styling."];
|
|
878
|
+
readonly rules: readonly ["Import the stylesheet once at the app entry before rendering any component.", "If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.", "Collect the screen brief first: route url, sidebar items, active sidebar item, page title, actions, and the page-specific content schema.", "Prefer the canonical component for each intent instead of mixing legacy MainFe components.", "Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.", "Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.", "Always provide a stable rowKey to DataTable and use sortMode=\"server\" when sorting happens on the backend.", "Prefer Card as the outer layout section and keep alerts, stats, and tables inside CardContent when building dashboards or forms.", "Do not import MainFe components unless the target explicitly asks for legacy main-fe styling."];
|
|
879
879
|
readonly components: ({
|
|
880
880
|
name: string;
|
|
881
881
|
importName: string;
|
|
@@ -911,6 +911,290 @@ declare const uiAiManifest: {
|
|
|
911
911
|
})[];
|
|
912
912
|
};
|
|
913
913
|
|
|
914
|
+
type UiScreenKind = 'list' | 'form' | 'detail' | 'dashboard';
|
|
915
|
+
type UiScreenBriefField = {
|
|
916
|
+
id: string;
|
|
917
|
+
label: string;
|
|
918
|
+
description: string;
|
|
919
|
+
required: boolean;
|
|
920
|
+
appliesTo: UiScreenKind[] | ['all'];
|
|
921
|
+
example: string;
|
|
922
|
+
};
|
|
923
|
+
declare const uiScreenBriefFields: readonly [{
|
|
924
|
+
readonly id: "pageKind";
|
|
925
|
+
readonly label: "Page kind";
|
|
926
|
+
readonly description: "Choose the base recipe for the screen.";
|
|
927
|
+
readonly required: true;
|
|
928
|
+
readonly appliesTo: ["all"];
|
|
929
|
+
readonly example: "list";
|
|
930
|
+
}, {
|
|
931
|
+
readonly id: "routeUrl";
|
|
932
|
+
readonly label: "Route URL";
|
|
933
|
+
readonly description: "Final route for the screen or feature entry.";
|
|
934
|
+
readonly required: true;
|
|
935
|
+
readonly appliesTo: ["all"];
|
|
936
|
+
readonly example: "/admin/users";
|
|
937
|
+
}, {
|
|
938
|
+
readonly id: "sidebarItems";
|
|
939
|
+
readonly label: "Sidebar items";
|
|
940
|
+
readonly description: "Sidebar entries with at least id, title, and href so the shell stays consistent.";
|
|
941
|
+
readonly required: true;
|
|
942
|
+
readonly appliesTo: ["all"];
|
|
943
|
+
readonly example: "[{ id: \"users\", title: \"Users\", href: \"/admin/users\" }]";
|
|
944
|
+
}, {
|
|
945
|
+
readonly id: "activeSidebarItemId";
|
|
946
|
+
readonly label: "Active sidebar item id";
|
|
947
|
+
readonly description: "The sidebar item that should appear active on this screen.";
|
|
948
|
+
readonly required: true;
|
|
949
|
+
readonly appliesTo: ["all"];
|
|
950
|
+
readonly example: "users";
|
|
951
|
+
}, {
|
|
952
|
+
readonly id: "breadcrumbs";
|
|
953
|
+
readonly label: "Breadcrumbs";
|
|
954
|
+
readonly description: "Ordered breadcrumb items for the page header.";
|
|
955
|
+
readonly required: false;
|
|
956
|
+
readonly appliesTo: ["all"];
|
|
957
|
+
readonly example: "[{ label: \"Admin\", href: \"/admin\" }, { label: \"Users\", current: true }]";
|
|
958
|
+
}, {
|
|
959
|
+
readonly id: "pageTitle";
|
|
960
|
+
readonly label: "Page title";
|
|
961
|
+
readonly description: "Main page heading shown in the content header.";
|
|
962
|
+
readonly required: true;
|
|
963
|
+
readonly appliesTo: ["all"];
|
|
964
|
+
readonly example: "Users";
|
|
965
|
+
}, {
|
|
966
|
+
readonly id: "pageSubtitle";
|
|
967
|
+
readonly label: "Page subtitle";
|
|
968
|
+
readonly description: "Short supporting text under the title.";
|
|
969
|
+
readonly required: false;
|
|
970
|
+
readonly appliesTo: ["all"];
|
|
971
|
+
readonly example: "Manage internal user accounts and permissions.";
|
|
972
|
+
}, {
|
|
973
|
+
readonly id: "primaryAction";
|
|
974
|
+
readonly label: "Primary action";
|
|
975
|
+
readonly description: "The highest-emphasis action shown in the page header.";
|
|
976
|
+
readonly required: false;
|
|
977
|
+
readonly appliesTo: ["all"];
|
|
978
|
+
readonly example: "{ label: \"Create user\", href: \"/admin/users/create\" }";
|
|
979
|
+
}, {
|
|
980
|
+
readonly id: "secondaryActions";
|
|
981
|
+
readonly label: "Secondary actions";
|
|
982
|
+
readonly description: "Additional header actions such as export, refresh, or cancel.";
|
|
983
|
+
readonly required: false;
|
|
984
|
+
readonly appliesTo: ["all"];
|
|
985
|
+
readonly example: "[{ label: \"Export\" }, { label: \"Refresh\" }]";
|
|
986
|
+
}, {
|
|
987
|
+
readonly id: "summaryStats";
|
|
988
|
+
readonly label: "Summary stats";
|
|
989
|
+
readonly description: "Top-line numbers for dashboard or overview screens.";
|
|
990
|
+
readonly required: false;
|
|
991
|
+
readonly appliesTo: ["dashboard", "detail"];
|
|
992
|
+
readonly example: "[{ label: \"Active users\", value: \"1,204\", trend: \"up\", delta: \"+12%\" }]";
|
|
993
|
+
}, {
|
|
994
|
+
readonly id: "filters";
|
|
995
|
+
readonly label: "Filters";
|
|
996
|
+
readonly description: "Filter bar controls shown above list or dashboard content.";
|
|
997
|
+
readonly required: false;
|
|
998
|
+
readonly appliesTo: ["list", "dashboard"];
|
|
999
|
+
readonly example: "[{ type: \"search\", label: \"Search user\" }, { type: \"select\", label: \"Role\" }]";
|
|
1000
|
+
}, {
|
|
1001
|
+
readonly id: "tableColumns";
|
|
1002
|
+
readonly label: "Table columns";
|
|
1003
|
+
readonly description: "Columns for a list table, including label and render intent.";
|
|
1004
|
+
readonly required: false;
|
|
1005
|
+
readonly appliesTo: ["list", "detail", "dashboard"];
|
|
1006
|
+
readonly example: "[{ key: \"name\", title: \"Name\" }, { key: \"role\", title: \"Role\" }]";
|
|
1007
|
+
}, {
|
|
1008
|
+
readonly id: "rowActions";
|
|
1009
|
+
readonly label: "Row actions";
|
|
1010
|
+
readonly description: "Per-row actions for table screens.";
|
|
1011
|
+
readonly required: false;
|
|
1012
|
+
readonly appliesTo: ["list", "detail"];
|
|
1013
|
+
readonly example: "[{ label: \"Edit\" }, { label: \"Reset password\" }]";
|
|
1014
|
+
}, {
|
|
1015
|
+
readonly id: "formSections";
|
|
1016
|
+
readonly label: "Form sections";
|
|
1017
|
+
readonly description: "Grouped form sections and the fields inside each section.";
|
|
1018
|
+
readonly required: false;
|
|
1019
|
+
readonly appliesTo: ["form"];
|
|
1020
|
+
readonly example: "[{ title: \"Basic info\", fields: [\"name\", \"email\", \"role\"] }]";
|
|
1021
|
+
}, {
|
|
1022
|
+
readonly id: "fields";
|
|
1023
|
+
readonly label: "Fields";
|
|
1024
|
+
readonly description: "Detailed field list with type, label, required state, and helper text.";
|
|
1025
|
+
readonly required: false;
|
|
1026
|
+
readonly appliesTo: ["form", "detail"];
|
|
1027
|
+
readonly example: "[{ name: \"email\", type: \"input\", label: \"Email\", required: true }]";
|
|
1028
|
+
}, {
|
|
1029
|
+
readonly id: "detailSections";
|
|
1030
|
+
readonly label: "Detail sections";
|
|
1031
|
+
readonly description: "Cards or sections for detail pages such as profile, activity, permissions, or related records.";
|
|
1032
|
+
readonly required: false;
|
|
1033
|
+
readonly appliesTo: ["detail"];
|
|
1034
|
+
readonly example: "[{ title: \"Profile\" }, { title: \"Recent activity\" }]";
|
|
1035
|
+
}, {
|
|
1036
|
+
readonly id: "emptyState";
|
|
1037
|
+
readonly label: "Empty state";
|
|
1038
|
+
readonly description: "Fallback title, description, and action when there is no data.";
|
|
1039
|
+
readonly required: false;
|
|
1040
|
+
readonly appliesTo: ["list", "dashboard", "detail"];
|
|
1041
|
+
readonly example: "{ title: \"No users yet\", description: \"Create the first user to get started.\" }";
|
|
1042
|
+
}, {
|
|
1043
|
+
readonly id: "permissions";
|
|
1044
|
+
readonly label: "Permissions";
|
|
1045
|
+
readonly description: "Permission keys that affect sidebar visibility or action availability.";
|
|
1046
|
+
readonly required: false;
|
|
1047
|
+
readonly appliesTo: ["all"];
|
|
1048
|
+
readonly example: "[\"user.read\", \"user.write\"]";
|
|
1049
|
+
}];
|
|
1050
|
+
declare const uiScreenBlueprint: {
|
|
1051
|
+
readonly pageKinds: readonly [{
|
|
1052
|
+
readonly id: "list";
|
|
1053
|
+
readonly label: "List page";
|
|
1054
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with actions", "Optional stats", "Filter card", "DataTable card"];
|
|
1055
|
+
}, {
|
|
1056
|
+
readonly id: "form";
|
|
1057
|
+
readonly label: "Form page";
|
|
1058
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with primary and cancel actions", "Sectioned form cards", "Bottom action row"];
|
|
1059
|
+
}, {
|
|
1060
|
+
readonly id: "detail";
|
|
1061
|
+
readonly label: "Detail page";
|
|
1062
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with status/actions", "Summary stats or metadata card", "Detail cards and related tables"];
|
|
1063
|
+
}, {
|
|
1064
|
+
readonly id: "dashboard";
|
|
1065
|
+
readonly label: "Dashboard page";
|
|
1066
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with actions", "Stat cards row", "Filters", "Main insight cards and tables"];
|
|
1067
|
+
}];
|
|
1068
|
+
readonly workflow: readonly ["Collect the screen brief before coding. Do not invent sidebar items, route urls, filters, fields, or table columns if the brief is missing.", "Use Sidebar plus Breadcrumb and PageTitle to lock the shell before building the page body.", "Choose only canonical root exports from @lucasvu/scope-ui.", "Use Card and ui-grid utilities to create the frame first, then place controls and data components inside.", "Keep all palette, radius, surface, and shadow decisions in the shared ui-theme.css preset file.", "End with a consistency check against the selected preset and the screen brief."];
|
|
1069
|
+
readonly briefFields: readonly [{
|
|
1070
|
+
readonly id: "pageKind";
|
|
1071
|
+
readonly label: "Page kind";
|
|
1072
|
+
readonly description: "Choose the base recipe for the screen.";
|
|
1073
|
+
readonly required: true;
|
|
1074
|
+
readonly appliesTo: ["all"];
|
|
1075
|
+
readonly example: "list";
|
|
1076
|
+
}, {
|
|
1077
|
+
readonly id: "routeUrl";
|
|
1078
|
+
readonly label: "Route URL";
|
|
1079
|
+
readonly description: "Final route for the screen or feature entry.";
|
|
1080
|
+
readonly required: true;
|
|
1081
|
+
readonly appliesTo: ["all"];
|
|
1082
|
+
readonly example: "/admin/users";
|
|
1083
|
+
}, {
|
|
1084
|
+
readonly id: "sidebarItems";
|
|
1085
|
+
readonly label: "Sidebar items";
|
|
1086
|
+
readonly description: "Sidebar entries with at least id, title, and href so the shell stays consistent.";
|
|
1087
|
+
readonly required: true;
|
|
1088
|
+
readonly appliesTo: ["all"];
|
|
1089
|
+
readonly example: "[{ id: \"users\", title: \"Users\", href: \"/admin/users\" }]";
|
|
1090
|
+
}, {
|
|
1091
|
+
readonly id: "activeSidebarItemId";
|
|
1092
|
+
readonly label: "Active sidebar item id";
|
|
1093
|
+
readonly description: "The sidebar item that should appear active on this screen.";
|
|
1094
|
+
readonly required: true;
|
|
1095
|
+
readonly appliesTo: ["all"];
|
|
1096
|
+
readonly example: "users";
|
|
1097
|
+
}, {
|
|
1098
|
+
readonly id: "breadcrumbs";
|
|
1099
|
+
readonly label: "Breadcrumbs";
|
|
1100
|
+
readonly description: "Ordered breadcrumb items for the page header.";
|
|
1101
|
+
readonly required: false;
|
|
1102
|
+
readonly appliesTo: ["all"];
|
|
1103
|
+
readonly example: "[{ label: \"Admin\", href: \"/admin\" }, { label: \"Users\", current: true }]";
|
|
1104
|
+
}, {
|
|
1105
|
+
readonly id: "pageTitle";
|
|
1106
|
+
readonly label: "Page title";
|
|
1107
|
+
readonly description: "Main page heading shown in the content header.";
|
|
1108
|
+
readonly required: true;
|
|
1109
|
+
readonly appliesTo: ["all"];
|
|
1110
|
+
readonly example: "Users";
|
|
1111
|
+
}, {
|
|
1112
|
+
readonly id: "pageSubtitle";
|
|
1113
|
+
readonly label: "Page subtitle";
|
|
1114
|
+
readonly description: "Short supporting text under the title.";
|
|
1115
|
+
readonly required: false;
|
|
1116
|
+
readonly appliesTo: ["all"];
|
|
1117
|
+
readonly example: "Manage internal user accounts and permissions.";
|
|
1118
|
+
}, {
|
|
1119
|
+
readonly id: "primaryAction";
|
|
1120
|
+
readonly label: "Primary action";
|
|
1121
|
+
readonly description: "The highest-emphasis action shown in the page header.";
|
|
1122
|
+
readonly required: false;
|
|
1123
|
+
readonly appliesTo: ["all"];
|
|
1124
|
+
readonly example: "{ label: \"Create user\", href: \"/admin/users/create\" }";
|
|
1125
|
+
}, {
|
|
1126
|
+
readonly id: "secondaryActions";
|
|
1127
|
+
readonly label: "Secondary actions";
|
|
1128
|
+
readonly description: "Additional header actions such as export, refresh, or cancel.";
|
|
1129
|
+
readonly required: false;
|
|
1130
|
+
readonly appliesTo: ["all"];
|
|
1131
|
+
readonly example: "[{ label: \"Export\" }, { label: \"Refresh\" }]";
|
|
1132
|
+
}, {
|
|
1133
|
+
readonly id: "summaryStats";
|
|
1134
|
+
readonly label: "Summary stats";
|
|
1135
|
+
readonly description: "Top-line numbers for dashboard or overview screens.";
|
|
1136
|
+
readonly required: false;
|
|
1137
|
+
readonly appliesTo: ["dashboard", "detail"];
|
|
1138
|
+
readonly example: "[{ label: \"Active users\", value: \"1,204\", trend: \"up\", delta: \"+12%\" }]";
|
|
1139
|
+
}, {
|
|
1140
|
+
readonly id: "filters";
|
|
1141
|
+
readonly label: "Filters";
|
|
1142
|
+
readonly description: "Filter bar controls shown above list or dashboard content.";
|
|
1143
|
+
readonly required: false;
|
|
1144
|
+
readonly appliesTo: ["list", "dashboard"];
|
|
1145
|
+
readonly example: "[{ type: \"search\", label: \"Search user\" }, { type: \"select\", label: \"Role\" }]";
|
|
1146
|
+
}, {
|
|
1147
|
+
readonly id: "tableColumns";
|
|
1148
|
+
readonly label: "Table columns";
|
|
1149
|
+
readonly description: "Columns for a list table, including label and render intent.";
|
|
1150
|
+
readonly required: false;
|
|
1151
|
+
readonly appliesTo: ["list", "detail", "dashboard"];
|
|
1152
|
+
readonly example: "[{ key: \"name\", title: \"Name\" }, { key: \"role\", title: \"Role\" }]";
|
|
1153
|
+
}, {
|
|
1154
|
+
readonly id: "rowActions";
|
|
1155
|
+
readonly label: "Row actions";
|
|
1156
|
+
readonly description: "Per-row actions for table screens.";
|
|
1157
|
+
readonly required: false;
|
|
1158
|
+
readonly appliesTo: ["list", "detail"];
|
|
1159
|
+
readonly example: "[{ label: \"Edit\" }, { label: \"Reset password\" }]";
|
|
1160
|
+
}, {
|
|
1161
|
+
readonly id: "formSections";
|
|
1162
|
+
readonly label: "Form sections";
|
|
1163
|
+
readonly description: "Grouped form sections and the fields inside each section.";
|
|
1164
|
+
readonly required: false;
|
|
1165
|
+
readonly appliesTo: ["form"];
|
|
1166
|
+
readonly example: "[{ title: \"Basic info\", fields: [\"name\", \"email\", \"role\"] }]";
|
|
1167
|
+
}, {
|
|
1168
|
+
readonly id: "fields";
|
|
1169
|
+
readonly label: "Fields";
|
|
1170
|
+
readonly description: "Detailed field list with type, label, required state, and helper text.";
|
|
1171
|
+
readonly required: false;
|
|
1172
|
+
readonly appliesTo: ["form", "detail"];
|
|
1173
|
+
readonly example: "[{ name: \"email\", type: \"input\", label: \"Email\", required: true }]";
|
|
1174
|
+
}, {
|
|
1175
|
+
readonly id: "detailSections";
|
|
1176
|
+
readonly label: "Detail sections";
|
|
1177
|
+
readonly description: "Cards or sections for detail pages such as profile, activity, permissions, or related records.";
|
|
1178
|
+
readonly required: false;
|
|
1179
|
+
readonly appliesTo: ["detail"];
|
|
1180
|
+
readonly example: "[{ title: \"Profile\" }, { title: \"Recent activity\" }]";
|
|
1181
|
+
}, {
|
|
1182
|
+
readonly id: "emptyState";
|
|
1183
|
+
readonly label: "Empty state";
|
|
1184
|
+
readonly description: "Fallback title, description, and action when there is no data.";
|
|
1185
|
+
readonly required: false;
|
|
1186
|
+
readonly appliesTo: ["list", "dashboard", "detail"];
|
|
1187
|
+
readonly example: "{ title: \"No users yet\", description: \"Create the first user to get started.\" }";
|
|
1188
|
+
}, {
|
|
1189
|
+
readonly id: "permissions";
|
|
1190
|
+
readonly label: "Permissions";
|
|
1191
|
+
readonly description: "Permission keys that affect sidebar visibility or action availability.";
|
|
1192
|
+
readonly required: false;
|
|
1193
|
+
readonly appliesTo: ["all"];
|
|
1194
|
+
readonly example: "[\"user.read\", \"user.write\"]";
|
|
1195
|
+
}];
|
|
1196
|
+
};
|
|
1197
|
+
|
|
914
1198
|
type UiThemeToken = {
|
|
915
1199
|
name: string;
|
|
916
1200
|
description: string;
|
|
@@ -1342,4 +1626,4 @@ declare const uiProjectAiRules: readonly ["Use @lucasvu/scope-ui as the default
|
|
|
1342
1626
|
type ClassValue = string | false | null | undefined;
|
|
1343
1627
|
declare function cn(...values: ClassValue[]): string;
|
|
1344
1628
|
|
|
1345
|
-
export { Alert, type AlertProps, ArgonSidebar, AsyncCombobox, type AsyncComboboxProps, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, Button$1 as Button, type ButtonProps$1 as ButtonProps, Card$1 as Card, CardAction$1 as CardAction, CardContent$1 as CardContent, CardDescription$1 as CardDescription, CardFooter$1 as CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle, Combobox$1 as Combobox, type ComboboxOption$2 as ComboboxOption, FormControl as Control, DataTable$1 as DataTable, type DataTableAlign$1 as DataTableAlign, type DataTableColumn$1 as DataTableColumn, type DataTablePagination$1 as DataTablePagination, type DataTableProps$1 as DataTableProps, type DataTableRowSelection$1 as DataTableRowSelection, type DataTableSortDirection$1 as DataTableSortDirection, type DataTableSortState$1 as DataTableSortState, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, type FormFieldProps, FormItem, FormLabel, FormMessage, Input$1 as Input, type InputProps$1 as InputProps, FormItem as Item, FormLabel as Label, LineClampTooltip, type LineClampTooltipProps, Loading, type LoadingProps, index as MainFe, FormMessage as Message, MultiSelect, type MultiSelectOption, NumericInput, type NumericInputProps, type Option, OverflowTooltip, type OverflowTooltipProps, PageTitle$1 as PageTitle, Pagination, type PaginationInfo, type PaginationProps, type PermissionChecker, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, SectionTitle$1 as SectionTitle, Select, type SelectOption, type SelectProps, Sidebar, SidebarItem, type SidebarProps, Stat, type StatProps, type TabItem, Table$1 as Table, TableBody$1 as TableBody, TableCell$1 as TableCell, TableHeader$1 as TableHeader, TableRow$1 as TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Tooltip, type Trend, TruncatedText, type TruncatedTextProps, type UiAiComponentDescriptor, type UiAiComponentProp, type UiThemePreset, type UiThemeToken, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiThemeContract, uiThemePresets };
|
|
1629
|
+
export { Alert, type AlertProps, ArgonSidebar, AsyncCombobox, type AsyncComboboxProps, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, Button$1 as Button, type ButtonProps$1 as ButtonProps, Card$1 as Card, CardAction$1 as CardAction, CardContent$1 as CardContent, CardDescription$1 as CardDescription, CardFooter$1 as CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle, Combobox$1 as Combobox, type ComboboxOption$2 as ComboboxOption, FormControl as Control, DataTable$1 as DataTable, type DataTableAlign$1 as DataTableAlign, type DataTableColumn$1 as DataTableColumn, type DataTablePagination$1 as DataTablePagination, type DataTableProps$1 as DataTableProps, type DataTableRowSelection$1 as DataTableRowSelection, type DataTableSortDirection$1 as DataTableSortDirection, type DataTableSortState$1 as DataTableSortState, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, type FormFieldProps, FormItem, FormLabel, FormMessage, Input$1 as Input, type InputProps$1 as InputProps, FormItem as Item, FormLabel as Label, LineClampTooltip, type LineClampTooltipProps, Loading, type LoadingProps, index as MainFe, FormMessage as Message, MultiSelect, type MultiSelectOption, NumericInput, type NumericInputProps, type Option, OverflowTooltip, type OverflowTooltipProps, PageTitle$1 as PageTitle, Pagination, type PaginationInfo, type PaginationProps, type PermissionChecker, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, SectionTitle$1 as SectionTitle, Select, type SelectOption, type SelectProps, Sidebar, SidebarItem, type SidebarProps, Stat, type StatProps, type TabItem, Table$1 as Table, TableBody$1 as TableBody, TableCell$1 as TableCell, TableHeader$1 as TableHeader, TableRow$1 as TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Tooltip, type Trend, TruncatedText, type TruncatedTextProps, type UiAiComponentDescriptor, type UiAiComponentProp, type UiScreenBriefField, type UiScreenKind, type UiThemePreset, type UiThemeToken, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiScreenBlueprint, uiScreenBriefFields, uiThemeContract, uiThemePresets };
|
package/dist/index.d.ts
CHANGED
|
@@ -875,7 +875,7 @@ type UiAiComponentDescriptor = {
|
|
|
875
875
|
declare const uiAiManifest: {
|
|
876
876
|
readonly packageName: "@lucasvu/scope-ui";
|
|
877
877
|
readonly styleImport: "@lucasvu/scope-ui/styles.css";
|
|
878
|
-
readonly rules: readonly ["Import the stylesheet once at the app entry before rendering any component.", "If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.", "Prefer the canonical component for each intent instead of mixing legacy MainFe components.", "Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.", "Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.", "Always provide a stable rowKey to DataTable and use sortMode=\"server\" when sorting happens on the backend.", "Prefer Card as the outer layout section and keep alerts, stats, and tables inside CardContent when building dashboards or forms.", "Do not import MainFe components unless the target explicitly asks for legacy main-fe styling."];
|
|
878
|
+
readonly rules: readonly ["Import the stylesheet once at the app entry before rendering any component.", "If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.", "Collect the screen brief first: route url, sidebar items, active sidebar item, page title, actions, and the page-specific content schema.", "Prefer the canonical component for each intent instead of mixing legacy MainFe components.", "Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.", "Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.", "Always provide a stable rowKey to DataTable and use sortMode=\"server\" when sorting happens on the backend.", "Prefer Card as the outer layout section and keep alerts, stats, and tables inside CardContent when building dashboards or forms.", "Do not import MainFe components unless the target explicitly asks for legacy main-fe styling."];
|
|
879
879
|
readonly components: ({
|
|
880
880
|
name: string;
|
|
881
881
|
importName: string;
|
|
@@ -911,6 +911,290 @@ declare const uiAiManifest: {
|
|
|
911
911
|
})[];
|
|
912
912
|
};
|
|
913
913
|
|
|
914
|
+
type UiScreenKind = 'list' | 'form' | 'detail' | 'dashboard';
|
|
915
|
+
type UiScreenBriefField = {
|
|
916
|
+
id: string;
|
|
917
|
+
label: string;
|
|
918
|
+
description: string;
|
|
919
|
+
required: boolean;
|
|
920
|
+
appliesTo: UiScreenKind[] | ['all'];
|
|
921
|
+
example: string;
|
|
922
|
+
};
|
|
923
|
+
declare const uiScreenBriefFields: readonly [{
|
|
924
|
+
readonly id: "pageKind";
|
|
925
|
+
readonly label: "Page kind";
|
|
926
|
+
readonly description: "Choose the base recipe for the screen.";
|
|
927
|
+
readonly required: true;
|
|
928
|
+
readonly appliesTo: ["all"];
|
|
929
|
+
readonly example: "list";
|
|
930
|
+
}, {
|
|
931
|
+
readonly id: "routeUrl";
|
|
932
|
+
readonly label: "Route URL";
|
|
933
|
+
readonly description: "Final route for the screen or feature entry.";
|
|
934
|
+
readonly required: true;
|
|
935
|
+
readonly appliesTo: ["all"];
|
|
936
|
+
readonly example: "/admin/users";
|
|
937
|
+
}, {
|
|
938
|
+
readonly id: "sidebarItems";
|
|
939
|
+
readonly label: "Sidebar items";
|
|
940
|
+
readonly description: "Sidebar entries with at least id, title, and href so the shell stays consistent.";
|
|
941
|
+
readonly required: true;
|
|
942
|
+
readonly appliesTo: ["all"];
|
|
943
|
+
readonly example: "[{ id: \"users\", title: \"Users\", href: \"/admin/users\" }]";
|
|
944
|
+
}, {
|
|
945
|
+
readonly id: "activeSidebarItemId";
|
|
946
|
+
readonly label: "Active sidebar item id";
|
|
947
|
+
readonly description: "The sidebar item that should appear active on this screen.";
|
|
948
|
+
readonly required: true;
|
|
949
|
+
readonly appliesTo: ["all"];
|
|
950
|
+
readonly example: "users";
|
|
951
|
+
}, {
|
|
952
|
+
readonly id: "breadcrumbs";
|
|
953
|
+
readonly label: "Breadcrumbs";
|
|
954
|
+
readonly description: "Ordered breadcrumb items for the page header.";
|
|
955
|
+
readonly required: false;
|
|
956
|
+
readonly appliesTo: ["all"];
|
|
957
|
+
readonly example: "[{ label: \"Admin\", href: \"/admin\" }, { label: \"Users\", current: true }]";
|
|
958
|
+
}, {
|
|
959
|
+
readonly id: "pageTitle";
|
|
960
|
+
readonly label: "Page title";
|
|
961
|
+
readonly description: "Main page heading shown in the content header.";
|
|
962
|
+
readonly required: true;
|
|
963
|
+
readonly appliesTo: ["all"];
|
|
964
|
+
readonly example: "Users";
|
|
965
|
+
}, {
|
|
966
|
+
readonly id: "pageSubtitle";
|
|
967
|
+
readonly label: "Page subtitle";
|
|
968
|
+
readonly description: "Short supporting text under the title.";
|
|
969
|
+
readonly required: false;
|
|
970
|
+
readonly appliesTo: ["all"];
|
|
971
|
+
readonly example: "Manage internal user accounts and permissions.";
|
|
972
|
+
}, {
|
|
973
|
+
readonly id: "primaryAction";
|
|
974
|
+
readonly label: "Primary action";
|
|
975
|
+
readonly description: "The highest-emphasis action shown in the page header.";
|
|
976
|
+
readonly required: false;
|
|
977
|
+
readonly appliesTo: ["all"];
|
|
978
|
+
readonly example: "{ label: \"Create user\", href: \"/admin/users/create\" }";
|
|
979
|
+
}, {
|
|
980
|
+
readonly id: "secondaryActions";
|
|
981
|
+
readonly label: "Secondary actions";
|
|
982
|
+
readonly description: "Additional header actions such as export, refresh, or cancel.";
|
|
983
|
+
readonly required: false;
|
|
984
|
+
readonly appliesTo: ["all"];
|
|
985
|
+
readonly example: "[{ label: \"Export\" }, { label: \"Refresh\" }]";
|
|
986
|
+
}, {
|
|
987
|
+
readonly id: "summaryStats";
|
|
988
|
+
readonly label: "Summary stats";
|
|
989
|
+
readonly description: "Top-line numbers for dashboard or overview screens.";
|
|
990
|
+
readonly required: false;
|
|
991
|
+
readonly appliesTo: ["dashboard", "detail"];
|
|
992
|
+
readonly example: "[{ label: \"Active users\", value: \"1,204\", trend: \"up\", delta: \"+12%\" }]";
|
|
993
|
+
}, {
|
|
994
|
+
readonly id: "filters";
|
|
995
|
+
readonly label: "Filters";
|
|
996
|
+
readonly description: "Filter bar controls shown above list or dashboard content.";
|
|
997
|
+
readonly required: false;
|
|
998
|
+
readonly appliesTo: ["list", "dashboard"];
|
|
999
|
+
readonly example: "[{ type: \"search\", label: \"Search user\" }, { type: \"select\", label: \"Role\" }]";
|
|
1000
|
+
}, {
|
|
1001
|
+
readonly id: "tableColumns";
|
|
1002
|
+
readonly label: "Table columns";
|
|
1003
|
+
readonly description: "Columns for a list table, including label and render intent.";
|
|
1004
|
+
readonly required: false;
|
|
1005
|
+
readonly appliesTo: ["list", "detail", "dashboard"];
|
|
1006
|
+
readonly example: "[{ key: \"name\", title: \"Name\" }, { key: \"role\", title: \"Role\" }]";
|
|
1007
|
+
}, {
|
|
1008
|
+
readonly id: "rowActions";
|
|
1009
|
+
readonly label: "Row actions";
|
|
1010
|
+
readonly description: "Per-row actions for table screens.";
|
|
1011
|
+
readonly required: false;
|
|
1012
|
+
readonly appliesTo: ["list", "detail"];
|
|
1013
|
+
readonly example: "[{ label: \"Edit\" }, { label: \"Reset password\" }]";
|
|
1014
|
+
}, {
|
|
1015
|
+
readonly id: "formSections";
|
|
1016
|
+
readonly label: "Form sections";
|
|
1017
|
+
readonly description: "Grouped form sections and the fields inside each section.";
|
|
1018
|
+
readonly required: false;
|
|
1019
|
+
readonly appliesTo: ["form"];
|
|
1020
|
+
readonly example: "[{ title: \"Basic info\", fields: [\"name\", \"email\", \"role\"] }]";
|
|
1021
|
+
}, {
|
|
1022
|
+
readonly id: "fields";
|
|
1023
|
+
readonly label: "Fields";
|
|
1024
|
+
readonly description: "Detailed field list with type, label, required state, and helper text.";
|
|
1025
|
+
readonly required: false;
|
|
1026
|
+
readonly appliesTo: ["form", "detail"];
|
|
1027
|
+
readonly example: "[{ name: \"email\", type: \"input\", label: \"Email\", required: true }]";
|
|
1028
|
+
}, {
|
|
1029
|
+
readonly id: "detailSections";
|
|
1030
|
+
readonly label: "Detail sections";
|
|
1031
|
+
readonly description: "Cards or sections for detail pages such as profile, activity, permissions, or related records.";
|
|
1032
|
+
readonly required: false;
|
|
1033
|
+
readonly appliesTo: ["detail"];
|
|
1034
|
+
readonly example: "[{ title: \"Profile\" }, { title: \"Recent activity\" }]";
|
|
1035
|
+
}, {
|
|
1036
|
+
readonly id: "emptyState";
|
|
1037
|
+
readonly label: "Empty state";
|
|
1038
|
+
readonly description: "Fallback title, description, and action when there is no data.";
|
|
1039
|
+
readonly required: false;
|
|
1040
|
+
readonly appliesTo: ["list", "dashboard", "detail"];
|
|
1041
|
+
readonly example: "{ title: \"No users yet\", description: \"Create the first user to get started.\" }";
|
|
1042
|
+
}, {
|
|
1043
|
+
readonly id: "permissions";
|
|
1044
|
+
readonly label: "Permissions";
|
|
1045
|
+
readonly description: "Permission keys that affect sidebar visibility or action availability.";
|
|
1046
|
+
readonly required: false;
|
|
1047
|
+
readonly appliesTo: ["all"];
|
|
1048
|
+
readonly example: "[\"user.read\", \"user.write\"]";
|
|
1049
|
+
}];
|
|
1050
|
+
declare const uiScreenBlueprint: {
|
|
1051
|
+
readonly pageKinds: readonly [{
|
|
1052
|
+
readonly id: "list";
|
|
1053
|
+
readonly label: "List page";
|
|
1054
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with actions", "Optional stats", "Filter card", "DataTable card"];
|
|
1055
|
+
}, {
|
|
1056
|
+
readonly id: "form";
|
|
1057
|
+
readonly label: "Form page";
|
|
1058
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with primary and cancel actions", "Sectioned form cards", "Bottom action row"];
|
|
1059
|
+
}, {
|
|
1060
|
+
readonly id: "detail";
|
|
1061
|
+
readonly label: "Detail page";
|
|
1062
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with status/actions", "Summary stats or metadata card", "Detail cards and related tables"];
|
|
1063
|
+
}, {
|
|
1064
|
+
readonly id: "dashboard";
|
|
1065
|
+
readonly label: "Dashboard page";
|
|
1066
|
+
readonly frame: readonly ["Sidebar shell", "Breadcrumb", "PageTitle with actions", "Stat cards row", "Filters", "Main insight cards and tables"];
|
|
1067
|
+
}];
|
|
1068
|
+
readonly workflow: readonly ["Collect the screen brief before coding. Do not invent sidebar items, route urls, filters, fields, or table columns if the brief is missing.", "Use Sidebar plus Breadcrumb and PageTitle to lock the shell before building the page body.", "Choose only canonical root exports from @lucasvu/scope-ui.", "Use Card and ui-grid utilities to create the frame first, then place controls and data components inside.", "Keep all palette, radius, surface, and shadow decisions in the shared ui-theme.css preset file.", "End with a consistency check against the selected preset and the screen brief."];
|
|
1069
|
+
readonly briefFields: readonly [{
|
|
1070
|
+
readonly id: "pageKind";
|
|
1071
|
+
readonly label: "Page kind";
|
|
1072
|
+
readonly description: "Choose the base recipe for the screen.";
|
|
1073
|
+
readonly required: true;
|
|
1074
|
+
readonly appliesTo: ["all"];
|
|
1075
|
+
readonly example: "list";
|
|
1076
|
+
}, {
|
|
1077
|
+
readonly id: "routeUrl";
|
|
1078
|
+
readonly label: "Route URL";
|
|
1079
|
+
readonly description: "Final route for the screen or feature entry.";
|
|
1080
|
+
readonly required: true;
|
|
1081
|
+
readonly appliesTo: ["all"];
|
|
1082
|
+
readonly example: "/admin/users";
|
|
1083
|
+
}, {
|
|
1084
|
+
readonly id: "sidebarItems";
|
|
1085
|
+
readonly label: "Sidebar items";
|
|
1086
|
+
readonly description: "Sidebar entries with at least id, title, and href so the shell stays consistent.";
|
|
1087
|
+
readonly required: true;
|
|
1088
|
+
readonly appliesTo: ["all"];
|
|
1089
|
+
readonly example: "[{ id: \"users\", title: \"Users\", href: \"/admin/users\" }]";
|
|
1090
|
+
}, {
|
|
1091
|
+
readonly id: "activeSidebarItemId";
|
|
1092
|
+
readonly label: "Active sidebar item id";
|
|
1093
|
+
readonly description: "The sidebar item that should appear active on this screen.";
|
|
1094
|
+
readonly required: true;
|
|
1095
|
+
readonly appliesTo: ["all"];
|
|
1096
|
+
readonly example: "users";
|
|
1097
|
+
}, {
|
|
1098
|
+
readonly id: "breadcrumbs";
|
|
1099
|
+
readonly label: "Breadcrumbs";
|
|
1100
|
+
readonly description: "Ordered breadcrumb items for the page header.";
|
|
1101
|
+
readonly required: false;
|
|
1102
|
+
readonly appliesTo: ["all"];
|
|
1103
|
+
readonly example: "[{ label: \"Admin\", href: \"/admin\" }, { label: \"Users\", current: true }]";
|
|
1104
|
+
}, {
|
|
1105
|
+
readonly id: "pageTitle";
|
|
1106
|
+
readonly label: "Page title";
|
|
1107
|
+
readonly description: "Main page heading shown in the content header.";
|
|
1108
|
+
readonly required: true;
|
|
1109
|
+
readonly appliesTo: ["all"];
|
|
1110
|
+
readonly example: "Users";
|
|
1111
|
+
}, {
|
|
1112
|
+
readonly id: "pageSubtitle";
|
|
1113
|
+
readonly label: "Page subtitle";
|
|
1114
|
+
readonly description: "Short supporting text under the title.";
|
|
1115
|
+
readonly required: false;
|
|
1116
|
+
readonly appliesTo: ["all"];
|
|
1117
|
+
readonly example: "Manage internal user accounts and permissions.";
|
|
1118
|
+
}, {
|
|
1119
|
+
readonly id: "primaryAction";
|
|
1120
|
+
readonly label: "Primary action";
|
|
1121
|
+
readonly description: "The highest-emphasis action shown in the page header.";
|
|
1122
|
+
readonly required: false;
|
|
1123
|
+
readonly appliesTo: ["all"];
|
|
1124
|
+
readonly example: "{ label: \"Create user\", href: \"/admin/users/create\" }";
|
|
1125
|
+
}, {
|
|
1126
|
+
readonly id: "secondaryActions";
|
|
1127
|
+
readonly label: "Secondary actions";
|
|
1128
|
+
readonly description: "Additional header actions such as export, refresh, or cancel.";
|
|
1129
|
+
readonly required: false;
|
|
1130
|
+
readonly appliesTo: ["all"];
|
|
1131
|
+
readonly example: "[{ label: \"Export\" }, { label: \"Refresh\" }]";
|
|
1132
|
+
}, {
|
|
1133
|
+
readonly id: "summaryStats";
|
|
1134
|
+
readonly label: "Summary stats";
|
|
1135
|
+
readonly description: "Top-line numbers for dashboard or overview screens.";
|
|
1136
|
+
readonly required: false;
|
|
1137
|
+
readonly appliesTo: ["dashboard", "detail"];
|
|
1138
|
+
readonly example: "[{ label: \"Active users\", value: \"1,204\", trend: \"up\", delta: \"+12%\" }]";
|
|
1139
|
+
}, {
|
|
1140
|
+
readonly id: "filters";
|
|
1141
|
+
readonly label: "Filters";
|
|
1142
|
+
readonly description: "Filter bar controls shown above list or dashboard content.";
|
|
1143
|
+
readonly required: false;
|
|
1144
|
+
readonly appliesTo: ["list", "dashboard"];
|
|
1145
|
+
readonly example: "[{ type: \"search\", label: \"Search user\" }, { type: \"select\", label: \"Role\" }]";
|
|
1146
|
+
}, {
|
|
1147
|
+
readonly id: "tableColumns";
|
|
1148
|
+
readonly label: "Table columns";
|
|
1149
|
+
readonly description: "Columns for a list table, including label and render intent.";
|
|
1150
|
+
readonly required: false;
|
|
1151
|
+
readonly appliesTo: ["list", "detail", "dashboard"];
|
|
1152
|
+
readonly example: "[{ key: \"name\", title: \"Name\" }, { key: \"role\", title: \"Role\" }]";
|
|
1153
|
+
}, {
|
|
1154
|
+
readonly id: "rowActions";
|
|
1155
|
+
readonly label: "Row actions";
|
|
1156
|
+
readonly description: "Per-row actions for table screens.";
|
|
1157
|
+
readonly required: false;
|
|
1158
|
+
readonly appliesTo: ["list", "detail"];
|
|
1159
|
+
readonly example: "[{ label: \"Edit\" }, { label: \"Reset password\" }]";
|
|
1160
|
+
}, {
|
|
1161
|
+
readonly id: "formSections";
|
|
1162
|
+
readonly label: "Form sections";
|
|
1163
|
+
readonly description: "Grouped form sections and the fields inside each section.";
|
|
1164
|
+
readonly required: false;
|
|
1165
|
+
readonly appliesTo: ["form"];
|
|
1166
|
+
readonly example: "[{ title: \"Basic info\", fields: [\"name\", \"email\", \"role\"] }]";
|
|
1167
|
+
}, {
|
|
1168
|
+
readonly id: "fields";
|
|
1169
|
+
readonly label: "Fields";
|
|
1170
|
+
readonly description: "Detailed field list with type, label, required state, and helper text.";
|
|
1171
|
+
readonly required: false;
|
|
1172
|
+
readonly appliesTo: ["form", "detail"];
|
|
1173
|
+
readonly example: "[{ name: \"email\", type: \"input\", label: \"Email\", required: true }]";
|
|
1174
|
+
}, {
|
|
1175
|
+
readonly id: "detailSections";
|
|
1176
|
+
readonly label: "Detail sections";
|
|
1177
|
+
readonly description: "Cards or sections for detail pages such as profile, activity, permissions, or related records.";
|
|
1178
|
+
readonly required: false;
|
|
1179
|
+
readonly appliesTo: ["detail"];
|
|
1180
|
+
readonly example: "[{ title: \"Profile\" }, { title: \"Recent activity\" }]";
|
|
1181
|
+
}, {
|
|
1182
|
+
readonly id: "emptyState";
|
|
1183
|
+
readonly label: "Empty state";
|
|
1184
|
+
readonly description: "Fallback title, description, and action when there is no data.";
|
|
1185
|
+
readonly required: false;
|
|
1186
|
+
readonly appliesTo: ["list", "dashboard", "detail"];
|
|
1187
|
+
readonly example: "{ title: \"No users yet\", description: \"Create the first user to get started.\" }";
|
|
1188
|
+
}, {
|
|
1189
|
+
readonly id: "permissions";
|
|
1190
|
+
readonly label: "Permissions";
|
|
1191
|
+
readonly description: "Permission keys that affect sidebar visibility or action availability.";
|
|
1192
|
+
readonly required: false;
|
|
1193
|
+
readonly appliesTo: ["all"];
|
|
1194
|
+
readonly example: "[\"user.read\", \"user.write\"]";
|
|
1195
|
+
}];
|
|
1196
|
+
};
|
|
1197
|
+
|
|
914
1198
|
type UiThemeToken = {
|
|
915
1199
|
name: string;
|
|
916
1200
|
description: string;
|
|
@@ -1342,4 +1626,4 @@ declare const uiProjectAiRules: readonly ["Use @lucasvu/scope-ui as the default
|
|
|
1342
1626
|
type ClassValue = string | false | null | undefined;
|
|
1343
1627
|
declare function cn(...values: ClassValue[]): string;
|
|
1344
1628
|
|
|
1345
|
-
export { Alert, type AlertProps, ArgonSidebar, AsyncCombobox, type AsyncComboboxProps, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, Button$1 as Button, type ButtonProps$1 as ButtonProps, Card$1 as Card, CardAction$1 as CardAction, CardContent$1 as CardContent, CardDescription$1 as CardDescription, CardFooter$1 as CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle, Combobox$1 as Combobox, type ComboboxOption$2 as ComboboxOption, FormControl as Control, DataTable$1 as DataTable, type DataTableAlign$1 as DataTableAlign, type DataTableColumn$1 as DataTableColumn, type DataTablePagination$1 as DataTablePagination, type DataTableProps$1 as DataTableProps, type DataTableRowSelection$1 as DataTableRowSelection, type DataTableSortDirection$1 as DataTableSortDirection, type DataTableSortState$1 as DataTableSortState, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, type FormFieldProps, FormItem, FormLabel, FormMessage, Input$1 as Input, type InputProps$1 as InputProps, FormItem as Item, FormLabel as Label, LineClampTooltip, type LineClampTooltipProps, Loading, type LoadingProps, index as MainFe, FormMessage as Message, MultiSelect, type MultiSelectOption, NumericInput, type NumericInputProps, type Option, OverflowTooltip, type OverflowTooltipProps, PageTitle$1 as PageTitle, Pagination, type PaginationInfo, type PaginationProps, type PermissionChecker, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, SectionTitle$1 as SectionTitle, Select, type SelectOption, type SelectProps, Sidebar, SidebarItem, type SidebarProps, Stat, type StatProps, type TabItem, Table$1 as Table, TableBody$1 as TableBody, TableCell$1 as TableCell, TableHeader$1 as TableHeader, TableRow$1 as TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Tooltip, type Trend, TruncatedText, type TruncatedTextProps, type UiAiComponentDescriptor, type UiAiComponentProp, type UiThemePreset, type UiThemeToken, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiThemeContract, uiThemePresets };
|
|
1629
|
+
export { Alert, type AlertProps, ArgonSidebar, AsyncCombobox, type AsyncComboboxProps, Badge, type BadgeProps, Breadcrumb, type BreadcrumbItem, Button$1 as Button, type ButtonProps$1 as ButtonProps, Card$1 as Card, CardAction$1 as CardAction, CardContent$1 as CardContent, CardDescription$1 as CardDescription, CardFooter$1 as CardFooter, CardHeader$1 as CardHeader, CardTitle$1 as CardTitle, Combobox$1 as Combobox, type ComboboxOption$2 as ComboboxOption, FormControl as Control, DataTable$1 as DataTable, type DataTableAlign$1 as DataTableAlign, type DataTableColumn$1 as DataTableColumn, type DataTablePagination$1 as DataTablePagination, type DataTableProps$1 as DataTableProps, type DataTableRowSelection$1 as DataTableRowSelection, type DataTableSortDirection$1 as DataTableSortDirection, type DataTableSortState$1 as DataTableSortState, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, type FormFieldProps, FormItem, FormLabel, FormMessage, Input$1 as Input, type InputProps$1 as InputProps, FormItem as Item, FormLabel as Label, LineClampTooltip, type LineClampTooltipProps, Loading, type LoadingProps, index as MainFe, FormMessage as Message, MultiSelect, type MultiSelectOption, NumericInput, type NumericInputProps, type Option, OverflowTooltip, type OverflowTooltipProps, PageTitle$1 as PageTitle, Pagination, type PaginationInfo, type PaginationProps, type PermissionChecker, SearchableSelect, type SearchableSelectOption, type SearchableSelectProps, SectionTitle$1 as SectionTitle, Select, type SelectOption, type SelectProps, Sidebar, SidebarItem, type SidebarProps, Stat, type StatProps, type TabItem, Table$1 as Table, TableBody$1 as TableBody, TableCell$1 as TableCell, TableHeader$1 as TableHeader, TableRow$1 as TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, Tooltip, type Trend, TruncatedText, type TruncatedTextProps, type UiAiComponentDescriptor, type UiAiComponentProp, type UiScreenBriefField, type UiScreenKind, type UiThemePreset, type UiThemeToken, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiScreenBlueprint, uiScreenBriefFields, uiThemeContract, uiThemePresets };
|
package/dist/index.js
CHANGED
|
@@ -6625,6 +6625,7 @@ var uiAiManifest = {
|
|
|
6625
6625
|
rules: [
|
|
6626
6626
|
"Import the stylesheet once at the app entry before rendering any component.",
|
|
6627
6627
|
"If the project declares an approved theme preset in AGENTS.md or ui-theme.css, stay inside that preset and do not invent a second palette.",
|
|
6628
|
+
"Collect the screen brief first: route url, sidebar items, active sidebar item, page title, actions, and the page-specific content schema.",
|
|
6628
6629
|
"Prefer the canonical component for each intent instead of mixing legacy MainFe components.",
|
|
6629
6630
|
"Use Input/Textarea/Select label props directly for simple fields; use Field only to wrap custom controls or grouped content.",
|
|
6630
6631
|
"Use Select for small fixed option lists, SearchableSelect for larger local lists, Combobox for type-and-pick flows, and AsyncCombobox for remote search.",
|
|
@@ -6840,6 +6841,213 @@ var uiAiManifest = {
|
|
|
6840
6841
|
]
|
|
6841
6842
|
};
|
|
6842
6843
|
|
|
6844
|
+
// src/screen-blueprint.ts
|
|
6845
|
+
var uiScreenBriefFields = [
|
|
6846
|
+
{
|
|
6847
|
+
id: "pageKind",
|
|
6848
|
+
label: "Page kind",
|
|
6849
|
+
description: "Choose the base recipe for the screen.",
|
|
6850
|
+
required: true,
|
|
6851
|
+
appliesTo: ["all"],
|
|
6852
|
+
example: "list"
|
|
6853
|
+
},
|
|
6854
|
+
{
|
|
6855
|
+
id: "routeUrl",
|
|
6856
|
+
label: "Route URL",
|
|
6857
|
+
description: "Final route for the screen or feature entry.",
|
|
6858
|
+
required: true,
|
|
6859
|
+
appliesTo: ["all"],
|
|
6860
|
+
example: "/admin/users"
|
|
6861
|
+
},
|
|
6862
|
+
{
|
|
6863
|
+
id: "sidebarItems",
|
|
6864
|
+
label: "Sidebar items",
|
|
6865
|
+
description: "Sidebar entries with at least id, title, and href so the shell stays consistent.",
|
|
6866
|
+
required: true,
|
|
6867
|
+
appliesTo: ["all"],
|
|
6868
|
+
example: '[{ id: "users", title: "Users", href: "/admin/users" }]'
|
|
6869
|
+
},
|
|
6870
|
+
{
|
|
6871
|
+
id: "activeSidebarItemId",
|
|
6872
|
+
label: "Active sidebar item id",
|
|
6873
|
+
description: "The sidebar item that should appear active on this screen.",
|
|
6874
|
+
required: true,
|
|
6875
|
+
appliesTo: ["all"],
|
|
6876
|
+
example: "users"
|
|
6877
|
+
},
|
|
6878
|
+
{
|
|
6879
|
+
id: "breadcrumbs",
|
|
6880
|
+
label: "Breadcrumbs",
|
|
6881
|
+
description: "Ordered breadcrumb items for the page header.",
|
|
6882
|
+
required: false,
|
|
6883
|
+
appliesTo: ["all"],
|
|
6884
|
+
example: '[{ label: "Admin", href: "/admin" }, { label: "Users", current: true }]'
|
|
6885
|
+
},
|
|
6886
|
+
{
|
|
6887
|
+
id: "pageTitle",
|
|
6888
|
+
label: "Page title",
|
|
6889
|
+
description: "Main page heading shown in the content header.",
|
|
6890
|
+
required: true,
|
|
6891
|
+
appliesTo: ["all"],
|
|
6892
|
+
example: "Users"
|
|
6893
|
+
},
|
|
6894
|
+
{
|
|
6895
|
+
id: "pageSubtitle",
|
|
6896
|
+
label: "Page subtitle",
|
|
6897
|
+
description: "Short supporting text under the title.",
|
|
6898
|
+
required: false,
|
|
6899
|
+
appliesTo: ["all"],
|
|
6900
|
+
example: "Manage internal user accounts and permissions."
|
|
6901
|
+
},
|
|
6902
|
+
{
|
|
6903
|
+
id: "primaryAction",
|
|
6904
|
+
label: "Primary action",
|
|
6905
|
+
description: "The highest-emphasis action shown in the page header.",
|
|
6906
|
+
required: false,
|
|
6907
|
+
appliesTo: ["all"],
|
|
6908
|
+
example: '{ label: "Create user", href: "/admin/users/create" }'
|
|
6909
|
+
},
|
|
6910
|
+
{
|
|
6911
|
+
id: "secondaryActions",
|
|
6912
|
+
label: "Secondary actions",
|
|
6913
|
+
description: "Additional header actions such as export, refresh, or cancel.",
|
|
6914
|
+
required: false,
|
|
6915
|
+
appliesTo: ["all"],
|
|
6916
|
+
example: '[{ label: "Export" }, { label: "Refresh" }]'
|
|
6917
|
+
},
|
|
6918
|
+
{
|
|
6919
|
+
id: "summaryStats",
|
|
6920
|
+
label: "Summary stats",
|
|
6921
|
+
description: "Top-line numbers for dashboard or overview screens.",
|
|
6922
|
+
required: false,
|
|
6923
|
+
appliesTo: ["dashboard", "detail"],
|
|
6924
|
+
example: '[{ label: "Active users", value: "1,204", trend: "up", delta: "+12%" }]'
|
|
6925
|
+
},
|
|
6926
|
+
{
|
|
6927
|
+
id: "filters",
|
|
6928
|
+
label: "Filters",
|
|
6929
|
+
description: "Filter bar controls shown above list or dashboard content.",
|
|
6930
|
+
required: false,
|
|
6931
|
+
appliesTo: ["list", "dashboard"],
|
|
6932
|
+
example: '[{ type: "search", label: "Search user" }, { type: "select", label: "Role" }]'
|
|
6933
|
+
},
|
|
6934
|
+
{
|
|
6935
|
+
id: "tableColumns",
|
|
6936
|
+
label: "Table columns",
|
|
6937
|
+
description: "Columns for a list table, including label and render intent.",
|
|
6938
|
+
required: false,
|
|
6939
|
+
appliesTo: ["list", "detail", "dashboard"],
|
|
6940
|
+
example: '[{ key: "name", title: "Name" }, { key: "role", title: "Role" }]'
|
|
6941
|
+
},
|
|
6942
|
+
{
|
|
6943
|
+
id: "rowActions",
|
|
6944
|
+
label: "Row actions",
|
|
6945
|
+
description: "Per-row actions for table screens.",
|
|
6946
|
+
required: false,
|
|
6947
|
+
appliesTo: ["list", "detail"],
|
|
6948
|
+
example: '[{ label: "Edit" }, { label: "Reset password" }]'
|
|
6949
|
+
},
|
|
6950
|
+
{
|
|
6951
|
+
id: "formSections",
|
|
6952
|
+
label: "Form sections",
|
|
6953
|
+
description: "Grouped form sections and the fields inside each section.",
|
|
6954
|
+
required: false,
|
|
6955
|
+
appliesTo: ["form"],
|
|
6956
|
+
example: '[{ title: "Basic info", fields: ["name", "email", "role"] }]'
|
|
6957
|
+
},
|
|
6958
|
+
{
|
|
6959
|
+
id: "fields",
|
|
6960
|
+
label: "Fields",
|
|
6961
|
+
description: "Detailed field list with type, label, required state, and helper text.",
|
|
6962
|
+
required: false,
|
|
6963
|
+
appliesTo: ["form", "detail"],
|
|
6964
|
+
example: '[{ name: "email", type: "input", label: "Email", required: true }]'
|
|
6965
|
+
},
|
|
6966
|
+
{
|
|
6967
|
+
id: "detailSections",
|
|
6968
|
+
label: "Detail sections",
|
|
6969
|
+
description: "Cards or sections for detail pages such as profile, activity, permissions, or related records.",
|
|
6970
|
+
required: false,
|
|
6971
|
+
appliesTo: ["detail"],
|
|
6972
|
+
example: '[{ title: "Profile" }, { title: "Recent activity" }]'
|
|
6973
|
+
},
|
|
6974
|
+
{
|
|
6975
|
+
id: "emptyState",
|
|
6976
|
+
label: "Empty state",
|
|
6977
|
+
description: "Fallback title, description, and action when there is no data.",
|
|
6978
|
+
required: false,
|
|
6979
|
+
appliesTo: ["list", "dashboard", "detail"],
|
|
6980
|
+
example: '{ title: "No users yet", description: "Create the first user to get started." }'
|
|
6981
|
+
},
|
|
6982
|
+
{
|
|
6983
|
+
id: "permissions",
|
|
6984
|
+
label: "Permissions",
|
|
6985
|
+
description: "Permission keys that affect sidebar visibility or action availability.",
|
|
6986
|
+
required: false,
|
|
6987
|
+
appliesTo: ["all"],
|
|
6988
|
+
example: '["user.read", "user.write"]'
|
|
6989
|
+
}
|
|
6990
|
+
];
|
|
6991
|
+
var uiScreenBlueprint = {
|
|
6992
|
+
pageKinds: [
|
|
6993
|
+
{
|
|
6994
|
+
id: "list",
|
|
6995
|
+
label: "List page",
|
|
6996
|
+
frame: [
|
|
6997
|
+
"Sidebar shell",
|
|
6998
|
+
"Breadcrumb",
|
|
6999
|
+
"PageTitle with actions",
|
|
7000
|
+
"Optional stats",
|
|
7001
|
+
"Filter card",
|
|
7002
|
+
"DataTable card"
|
|
7003
|
+
]
|
|
7004
|
+
},
|
|
7005
|
+
{
|
|
7006
|
+
id: "form",
|
|
7007
|
+
label: "Form page",
|
|
7008
|
+
frame: [
|
|
7009
|
+
"Sidebar shell",
|
|
7010
|
+
"Breadcrumb",
|
|
7011
|
+
"PageTitle with primary and cancel actions",
|
|
7012
|
+
"Sectioned form cards",
|
|
7013
|
+
"Bottom action row"
|
|
7014
|
+
]
|
|
7015
|
+
},
|
|
7016
|
+
{
|
|
7017
|
+
id: "detail",
|
|
7018
|
+
label: "Detail page",
|
|
7019
|
+
frame: [
|
|
7020
|
+
"Sidebar shell",
|
|
7021
|
+
"Breadcrumb",
|
|
7022
|
+
"PageTitle with status/actions",
|
|
7023
|
+
"Summary stats or metadata card",
|
|
7024
|
+
"Detail cards and related tables"
|
|
7025
|
+
]
|
|
7026
|
+
},
|
|
7027
|
+
{
|
|
7028
|
+
id: "dashboard",
|
|
7029
|
+
label: "Dashboard page",
|
|
7030
|
+
frame: [
|
|
7031
|
+
"Sidebar shell",
|
|
7032
|
+
"Breadcrumb",
|
|
7033
|
+
"PageTitle with actions",
|
|
7034
|
+
"Stat cards row",
|
|
7035
|
+
"Filters",
|
|
7036
|
+
"Main insight cards and tables"
|
|
7037
|
+
]
|
|
7038
|
+
}
|
|
7039
|
+
],
|
|
7040
|
+
workflow: [
|
|
7041
|
+
"Collect the screen brief before coding. Do not invent sidebar items, route urls, filters, fields, or table columns if the brief is missing.",
|
|
7042
|
+
"Use Sidebar plus Breadcrumb and PageTitle to lock the shell before building the page body.",
|
|
7043
|
+
"Choose only canonical root exports from @lucasvu/scope-ui.",
|
|
7044
|
+
"Use Card and ui-grid utilities to create the frame first, then place controls and data components inside.",
|
|
7045
|
+
"Keep all palette, radius, surface, and shadow decisions in the shared ui-theme.css preset file.",
|
|
7046
|
+
"End with a consistency check against the selected preset and the screen brief."
|
|
7047
|
+
],
|
|
7048
|
+
briefFields: uiScreenBriefFields
|
|
7049
|
+
};
|
|
7050
|
+
|
|
6843
7051
|
// src/theme-contract.ts
|
|
6844
7052
|
var uiThemePresets = [
|
|
6845
7053
|
{
|
|
@@ -7215,4 +7423,4 @@ var uiProjectAiRules = [
|
|
|
7215
7423
|
"Prefer root exports and avoid MainFe unless the task explicitly targets a legacy screen."
|
|
7216
7424
|
];
|
|
7217
7425
|
|
|
7218
|
-
export { Alert, ArgonSidebar, AsyncCombobox, Badge, Breadcrumb, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, FormControl as Control, DataTable, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, FormItem as Item, FormLabel as Label, LineClampTooltip, Loading, main_fe_exports as MainFe, FormMessage as Message, MultiSelect, NumericInput, OverflowTooltip, PageTitle, Pagination, SearchableSelect, SectionTitle, Select, Sidebar, SidebarItem, Stat, Table, TableBody, TableCell, TableHeader, TableRow, Tabs, Textarea, Tooltip, TruncatedText, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiThemeContract, uiThemePresets };
|
|
7426
|
+
export { Alert, ArgonSidebar, AsyncCombobox, Badge, Breadcrumb, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Combobox, FormControl as Control, DataTable, FormDescription as Description, FormField as Field, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, FormItem as Item, FormLabel as Label, LineClampTooltip, Loading, main_fe_exports as MainFe, FormMessage as Message, MultiSelect, NumericInput, OverflowTooltip, PageTitle, Pagination, SearchableSelect, SectionTitle, Select, Sidebar, SidebarItem, Stat, Table, TableBody, TableCell, TableHeader, TableRow, Tabs, Textarea, Tooltip, TruncatedText, cn, defaultPermissionChecker, filterSidebarItems, hasActiveDescendant, uiAiManifest, uiDefaultThemePreset, uiProjectAiRules, uiScreenBlueprint, uiScreenBriefFields, uiThemeContract, uiThemePresets };
|