@lucasvu/scope-ui 0.0.5 → 0.0.7
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 +16 -5
- package/README.md +18 -4
- package/bin/scope-ui-init.mjs +101 -3
- 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
13
|
|
|
14
|
-
|
|
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`.
|
|
19
|
+
|
|
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
|
|
|
@@ -37,6 +43,8 @@ npx scope-ui-init --theme graphite
|
|
|
37
43
|
|
|
38
44
|
File generate ra sẽ là source of truth cho palette, surface, radius và shadow của project. Agent phải bám vào file này thay vì tự nghĩ màu mới.
|
|
39
45
|
|
|
46
|
+
`AGENTS.md` sẽ có thêm block brief dạng YAML để agent điền các giá trị như `routeUrl`, `sidebarItems`, `pageTitle`, `filters`, `fields`, `tableColumns` trước khi bắt đầu viết JSX.
|
|
47
|
+
|
|
40
48
|
```css
|
|
41
49
|
:root {
|
|
42
50
|
--tw-primary: 12 88% 56%;
|
|
@@ -67,8 +75,10 @@ Always:
|
|
|
67
75
|
- import the project theme override file after the package stylesheet
|
|
68
76
|
- use root exports from `@lucasvu/scope-ui`
|
|
69
77
|
- stay inside the approved preset declared by `src/styles/ui-theme.css`
|
|
78
|
+
- follow the step-by-step UI build workflow from `AGENTS.md` before writing JSX
|
|
79
|
+
- fill the screen brief first: `routeUrl`, `sidebarItems`, `activeSidebarItemId`, `pageTitle`, `actions`, and the page-specific schema
|
|
70
80
|
- read `uiAiManifest` to choose the right component by intent
|
|
71
|
-
- read `uiThemeContract` before changing colors, surfaces, borders, or shadows
|
|
81
|
+
- read `uiScreenBlueprint` and `uiThemeContract` before changing layout, colors, surfaces, borders, or shadows
|
|
72
82
|
|
|
73
83
|
Do not:
|
|
74
84
|
- import from `MainFe` unless the task explicitly targets a legacy screen
|
|
@@ -93,10 +103,11 @@ Component choice:
|
|
|
93
103
|
Trong code, AI có thể đọc trực tiếp:
|
|
94
104
|
|
|
95
105
|
```ts
|
|
96
|
-
import { uiAiManifest, uiThemeContract, uiThemePresets, uiProjectAiRules } from '@lucasvu/scope-ui'
|
|
106
|
+
import { uiAiManifest, uiScreenBlueprint, uiThemeContract, uiThemePresets, uiProjectAiRules } from '@lucasvu/scope-ui'
|
|
97
107
|
```
|
|
98
108
|
|
|
99
109
|
- `uiAiManifest`: chọn component theo intent
|
|
110
|
+
- `uiScreenBlueprint`: brief input và khung layout chuẩn cho `list | form | detail | dashboard`
|
|
100
111
|
- `uiThemeContract`: biết override token nào và override ở đâu
|
|
101
112
|
- `uiThemePresets`: danh sách preset được duyệt để nhiều project dùng chung một visual language
|
|
102
113
|
- `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,22 @@ 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ự: điền brief, 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`
|
|
119
|
+
- `AGENTS.md` mới sẽ có sẵn block brief dạng YAML để agent hoặc dev điền trực tiếp trước khi code
|
|
110
120
|
- Chỉ dùng các component canonical ở root package; tránh `MainFe` nếu không phải legacy screen
|
|
111
121
|
- 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
|
|
122
|
+
- Cho agent đọc `uiScreenBlueprint`, `uiThemeContract` và `uiThemePresets` để biết screen recipe, preset và token nào được phép override
|
|
113
123
|
|
|
114
124
|
```ts
|
|
115
125
|
import {
|
|
116
126
|
uiAiManifest,
|
|
117
127
|
uiProjectAiRules,
|
|
128
|
+
uiScreenBlueprint,
|
|
118
129
|
uiThemeContract,
|
|
119
130
|
uiThemePresets,
|
|
120
131
|
} from '@lucasvu/scope-ui';
|
|
@@ -122,6 +133,8 @@ import {
|
|
|
122
133
|
|
|
123
134
|
`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
135
|
|
|
136
|
+
`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`.
|
|
137
|
+
|
|
125
138
|
`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
139
|
|
|
127
140
|
`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 +148,7 @@ Nên để toàn bộ override theme của project vào một file riêng, ví d
|
|
|
135
148
|
Cách nhanh nhất là generate file này từ preset:
|
|
136
149
|
|
|
137
150
|
```bash
|
|
151
|
+
npm install @lucasvu/scope-ui
|
|
138
152
|
npx scope-ui-init --list-themes
|
|
139
153
|
npx scope-ui-init --theme ocean
|
|
140
154
|
```
|
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,13 +342,94 @@ 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
|
|
|
347
|
-
|
|
352
|
+
## Required Flow
|
|
353
|
+
|
|
354
|
+
When asked to build or edit a screen, follow these steps in order:
|
|
355
|
+
|
|
356
|
+
1. Read \`${themeFile}\`, \`node_modules/${PACKAGE_NAME}/README.md\`, \`node_modules/${PACKAGE_NAME}/AI_SETUP.md\`, and the exported \`uiScreenBlueprint\` contract before generating UI.
|
|
357
|
+
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.
|
|
358
|
+
3. Verify the app entry imports \`${PACKAGE_NAME}/styles.css\` first and the project theme file right after it.
|
|
359
|
+
4. Identify the page kind (\`list | form | detail | dashboard\`), then map each block to canonical components from \`uiAiManifest\` before writing JSX.
|
|
360
|
+
5. Build the shell in this exact order: \`Sidebar\` -> \`Breadcrumb\` -> \`PageTitle\` -> top actions -> page body cards/grids.
|
|
361
|
+
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 cards/tables.
|
|
362
|
+
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.
|
|
363
|
+
8. Before finishing, run the output checklist in this file.
|
|
364
|
+
|
|
365
|
+
## Screen Brief
|
|
366
|
+
|
|
367
|
+
Complete this brief before writing JSX:
|
|
368
|
+
|
|
369
|
+
\`\`\`yaml
|
|
370
|
+
pageKind: list | form | detail | dashboard
|
|
371
|
+
routeUrl:
|
|
372
|
+
sidebarItems:
|
|
373
|
+
- id:
|
|
374
|
+
title:
|
|
375
|
+
href:
|
|
376
|
+
activeSidebarItemId:
|
|
377
|
+
breadcrumbs:
|
|
378
|
+
- label:
|
|
379
|
+
href:
|
|
380
|
+
current:
|
|
381
|
+
pageTitle:
|
|
382
|
+
pageSubtitle:
|
|
383
|
+
primaryAction:
|
|
384
|
+
label:
|
|
385
|
+
href:
|
|
386
|
+
secondaryActions:
|
|
387
|
+
- label:
|
|
388
|
+
href:
|
|
389
|
+
summaryStats:
|
|
390
|
+
- label:
|
|
391
|
+
value:
|
|
392
|
+
delta:
|
|
393
|
+
trend:
|
|
394
|
+
filters:
|
|
395
|
+
- type:
|
|
396
|
+
label:
|
|
397
|
+
key:
|
|
398
|
+
tableColumns:
|
|
399
|
+
- key:
|
|
400
|
+
title:
|
|
401
|
+
type:
|
|
402
|
+
rowActions:
|
|
403
|
+
- label:
|
|
404
|
+
key:
|
|
405
|
+
formSections:
|
|
406
|
+
- title:
|
|
407
|
+
fields: []
|
|
408
|
+
fields:
|
|
409
|
+
- name:
|
|
410
|
+
type:
|
|
411
|
+
label:
|
|
412
|
+
required:
|
|
413
|
+
helperText:
|
|
414
|
+
detailSections:
|
|
415
|
+
- title:
|
|
416
|
+
type:
|
|
417
|
+
emptyState:
|
|
418
|
+
title:
|
|
419
|
+
description:
|
|
420
|
+
actionLabel:
|
|
421
|
+
permissions: []
|
|
422
|
+
\`\`\`
|
|
423
|
+
|
|
424
|
+
## Page Frame Recipes
|
|
425
|
+
|
|
426
|
+
- \`list\`: \`Sidebar\` -> \`Breadcrumb\` -> \`PageTitle\` -> header actions -> optional stats -> filter \`Card\` -> \`DataTable\` \`Card\`
|
|
427
|
+
- \`form\`: \`Sidebar\` -> \`Breadcrumb\` -> \`PageTitle\` -> primary/cancel actions -> sectioned form \`Card\` blocks -> bottom action row
|
|
428
|
+
- \`detail\`: \`Sidebar\` -> \`Breadcrumb\` -> \`PageTitle\` -> status/actions -> summary metadata \`Card\` -> detail \`Card\` blocks -> related \`DataTable\`
|
|
429
|
+
- \`dashboard\`: \`Sidebar\` -> \`Breadcrumb\` -> \`PageTitle\` -> header actions -> \`Stat\` row -> filters -> insight \`Card\` blocks and \`DataTable\`
|
|
430
|
+
|
|
431
|
+
## Hard Rules
|
|
432
|
+
|
|
348
433
|
- import \`${PACKAGE_NAME}/styles.css\` once at the app entry
|
|
349
434
|
- import the project theme override file after the package stylesheet
|
|
350
435
|
- use root exports from \`${PACKAGE_NAME}\`
|
|
@@ -360,7 +445,8 @@ Do not:
|
|
|
360
445
|
- restyle individual pages if the preset tokens can solve it globally
|
|
361
446
|
- create duplicate Button/Input/Select wrappers unless a project-specific behavior is required
|
|
362
447
|
|
|
363
|
-
Component
|
|
448
|
+
## Component Choice
|
|
449
|
+
|
|
364
450
|
- \`Input\` for short text
|
|
365
451
|
- \`Textarea\` for multiline text
|
|
366
452
|
- \`Select\` for small fixed options
|
|
@@ -370,6 +456,18 @@ Component choice:
|
|
|
370
456
|
- \`MultiSelect\` for multi-pick
|
|
371
457
|
- \`Field\` only for custom controls or grouped content
|
|
372
458
|
- \`DataTable\` for tabular records
|
|
459
|
+
|
|
460
|
+
## Output Check
|
|
461
|
+
|
|
462
|
+
Before finishing, confirm all of these are true:
|
|
463
|
+
|
|
464
|
+
- The screen brief is complete or unresolved values are clearly marked as TODO.
|
|
465
|
+
- The shell contains \`Sidebar\`, \`Breadcrumb\`, and \`PageTitle\` in the correct order.
|
|
466
|
+
- The chosen components match the page kind and the brief.
|
|
467
|
+
- No \`MainFe\` imports were used.
|
|
468
|
+
- No hardcoded brand colors were added in page components.
|
|
469
|
+
- Theme decisions live in \`${themeFile}\`, not in ad hoc JSX styling.
|
|
470
|
+
- Spacing, card structure, and actions are consistent with the shared preset.
|
|
373
471
|
`
|
|
374
472
|
}
|
|
375
473
|
|
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;
|