@genesislcap/ai-assistant 15.70.0 → 15.71.0-FUI-2650.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-assistant.api.json +97 -0
- package/dist/ai-assistant.d.ts +65 -0
- package/dist/chat-driver.cjs +18031 -0
- package/dist/chat-driver.cjs.map +4 -4
- package/dist/chat-driver.mjs +18024 -0
- package/dist/chat-driver.mjs.map +4 -4
- package/dist/custom-elements.json +9287 -6447
- package/dist/dts/chat-driver-node.d.ts +2 -0
- package/dist/dts/chat-driver-node.d.ts.map +1 -1
- package/dist/dts/code-review/code-review.types.d.ts +76 -0
- package/dist/dts/code-review/code-review.types.d.ts.map +1 -0
- package/dist/dts/code-review/code-reviewer.agent.d.ts +77 -0
- package/dist/dts/code-review/code-reviewer.agent.d.ts.map +1 -0
- package/dist/dts/code-review/code-reviewer.prompt.d.ts +23 -0
- package/dist/dts/code-review/code-reviewer.prompt.d.ts.map +1 -0
- package/dist/dts/code-review/gate.d.ts +44 -0
- package/dist/dts/code-review/gate.d.ts.map +1 -0
- package/dist/dts/code-review/index.d.ts +27 -0
- package/dist/dts/code-review/index.d.ts.map +1 -0
- package/dist/dts/code-review/review-changes.d.ts +70 -0
- package/dist/dts/code-review/review-changes.d.ts.map +1 -0
- package/dist/dts/code-review/rules/context-trigger-map.d.ts +6 -0
- package/dist/dts/code-review/rules/context-trigger-map.d.ts.map +1 -0
- package/dist/dts/code-review/rules/context.registry.d.ts +123 -0
- package/dist/dts/code-review/rules/context.registry.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-ai-extensions.d.ts +13 -0
- package/dist/dts/code-review/rules/fui-ai-extensions.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-blotter.d.ts +16 -0
- package/dist/dts/code-review/rules/fui-blotter.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-chart.d.ts +20 -0
- package/dist/dts/code-review/rules/fui-chart.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-column-defs.d.ts +21 -0
- package/dist/dts/code-review/rules/fui-column-defs.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-components.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-components.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-criteria.d.ts +32 -0
- package/dist/dts/code-review/rules/fui-criteria.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-custom-renderer.d.ts +15 -0
- package/dist/dts/code-review/rules/fui-custom-renderer.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-dashboard.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-dashboard.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-dialogs.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-dialogs.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-entity-management.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-entity-management.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-error-boundary.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-error-boundary.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-eventing.d.ts +8 -0
- package/dist/dts/code-review/rules/fui-eventing.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-flexlayout.d.ts +17 -0
- package/dist/dts/code-review/rules/fui-flexlayout.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-flyout-panel.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-flyout-panel.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-form-component.d.ts +9 -0
- package/dist/dts/code-review/rules/fui-form-component.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-formatters.d.ts +12 -0
- package/dist/dts/code-review/rules/fui-formatters.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-foundation-comms.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-foundation-comms.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-global-filters.d.ts +33 -0
- package/dist/dts/code-review/rules/fui-global-filters.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-import-surface.d.ts +37 -0
- package/dist/dts/code-review/rules/fui-import-surface.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-inline-editing.d.ts +10 -0
- package/dist/dts/code-review/rules/fui-inline-editing.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-layout.d.ts +7 -0
- package/dist/dts/code-review/rules/fui-layout.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-notifications.d.ts +12 -0
- package/dist/dts/code-review/rules/fui-notifications.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-primitives.d.ts +26 -0
- package/dist/dts/code-review/rules/fui-primitives.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts +18 -0
- package/dist/dts/code-review/rules/fui-rapid-grid-pro.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-redux-store.d.ts +8 -0
- package/dist/dts/code-review/rules/fui-redux-store.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-reporting.d.ts +19 -0
- package/dist/dts/code-review/rules/fui-reporting.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-styling.d.ts +15 -0
- package/dist/dts/code-review/rules/fui-styling.d.ts.map +1 -0
- package/dist/dts/code-review/rules/fui-trade-form.d.ts +13 -0
- package/dist/dts/code-review/rules/fui-trade-form.d.ts.map +1 -0
- package/dist/dts/code-review/submit-code-review.tool.d.ts +12 -0
- package/dist/dts/code-review/submit-code-review.tool.d.ts.map +1 -0
- package/dist/dts/code-review/unified-diff.d.ts +7 -0
- package/dist/dts/code-review/unified-diff.d.ts.map +1 -0
- package/dist/dts/code-review/verdict.d.ts +23 -0
- package/dist/dts/code-review/verdict.d.ts.map +1 -0
- package/dist/dts/components/code-review-result/code-review-result.d.ts +26 -0
- package/dist/dts/components/code-review-result/code-review-result.d.ts.map +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/react.d.ts +10 -0
- package/dist/esm/chat-driver-node.js +6 -0
- package/dist/esm/code-review/code-review.types.js +6 -0
- package/dist/esm/code-review/code-reviewer.agent.js +167 -0
- package/dist/esm/code-review/code-reviewer.prompt.js +103 -0
- package/dist/esm/code-review/gate.js +93 -0
- package/dist/esm/code-review/index.js +28 -0
- package/dist/esm/code-review/review-changes.js +123 -0
- package/dist/esm/code-review/rules/context-trigger-map.js +20 -0
- package/dist/esm/code-review/rules/context.registry.js +772 -0
- package/dist/esm/code-review/rules/fui-ai-extensions.js +306 -0
- package/dist/esm/code-review/rules/fui-blotter.js +596 -0
- package/dist/esm/code-review/rules/fui-chart.js +669 -0
- package/dist/esm/code-review/rules/fui-column-defs.js +862 -0
- package/dist/esm/code-review/rules/fui-components.js +245 -0
- package/dist/esm/code-review/rules/fui-criteria.js +538 -0
- package/dist/esm/code-review/rules/fui-custom-renderer.js +612 -0
- package/dist/esm/code-review/rules/fui-dashboard.js +604 -0
- package/dist/esm/code-review/rules/fui-dialogs.js +588 -0
- package/dist/esm/code-review/rules/fui-entity-management.js +1014 -0
- package/dist/esm/code-review/rules/fui-error-boundary.js +244 -0
- package/dist/esm/code-review/rules/fui-eventing.js +628 -0
- package/dist/esm/code-review/rules/fui-flexlayout.js +860 -0
- package/dist/esm/code-review/rules/fui-flyout-panel.js +432 -0
- package/dist/esm/code-review/rules/fui-form-component.js +898 -0
- package/dist/esm/code-review/rules/fui-formatters.js +415 -0
- package/dist/esm/code-review/rules/fui-foundation-comms.js +518 -0
- package/dist/esm/code-review/rules/fui-global-filters.js +778 -0
- package/dist/esm/code-review/rules/fui-import-surface.js +452 -0
- package/dist/esm/code-review/rules/fui-inline-editing.js +445 -0
- package/dist/esm/code-review/rules/fui-layout.js +431 -0
- package/dist/esm/code-review/rules/fui-notifications.js +439 -0
- package/dist/esm/code-review/rules/fui-primitives.js +1216 -0
- package/dist/esm/code-review/rules/fui-rapid-grid-pro.js +650 -0
- package/dist/esm/code-review/rules/fui-redux-store.js +522 -0
- package/dist/esm/code-review/rules/fui-reporting.js +506 -0
- package/dist/esm/code-review/rules/fui-styling.js +1229 -0
- package/dist/esm/code-review/rules/fui-trade-form.js +618 -0
- package/dist/esm/code-review/submit-code-review.tool.js +43 -0
- package/dist/esm/code-review/unified-diff.js +96 -0
- package/dist/esm/code-review/verdict.js +24 -0
- package/dist/esm/components/code-review-result/code-review-result.js +89 -0
- package/dist/esm/index.js +3 -0
- package/dist/react.cjs +7 -0
- package/dist/react.mjs +6 -0
- package/docs/code-review.md +137 -0
- package/package.json +24 -17
- package/scripts/smoke-chat-driver-node.mjs +15 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context: Complete @genesislcap import surface — runtime paths, type-only paths, subpath rules, anti-patterns.
|
|
3
|
+
* Always-auto-injected (Tier 1) since correct import paths are universally required.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The `@genesislcap/rapid-design-system/react` components the architecture planner may name.
|
|
7
|
+
*
|
|
8
|
+
* This is a STRUCTURAL GATE, not documentation. The planner's COMPONENT EXISTENCE RULE
|
|
9
|
+
* (architecture-planner.prompt.ts) forbids planning any Genesis component absent from the
|
|
10
|
+
* import-surface table below — so a component missing from this array is unreachable no matter
|
|
11
|
+
* how well the model is prompted, and the agent hand-rolls `<div>`/`<button>` markup instead.
|
|
12
|
+
*
|
|
13
|
+
* **Curated, not derived.** The installed dist exports 83 React components; this list is a
|
|
14
|
+
* deliberate subset. What is left out, and why (every name below IS a real rapid-design-system
|
|
15
|
+
* React export — this list is scoped to that package, so foundation-ui-only exports such as
|
|
16
|
+
* `DataGrid` and `FlexLayout` were never candidates here in the first place):
|
|
17
|
+
*
|
|
18
|
+
* - Infrastructure the agent must never place by hand: `DesignSystemProvider`, `AnchoredRegion`,
|
|
19
|
+
* `RapidRouter`, `SystemHealthOverlay`, `Flipper`.
|
|
20
|
+
* - Owned by a dedicated package + context module: `RapidExpressionBuilder`,
|
|
21
|
+
* `RapidRuleExpressionBuilder`, `RapidValueExpressionBuilder` (see `fui-criteria`);
|
|
22
|
+
* `FilterBar` / `Filter` (see `fui-global-filters`); `ActionsMenu` (reached through
|
|
23
|
+
* `GridProRendererTypes.actionsMenu`, see `fui-column-defs`).
|
|
24
|
+
* - Niche enough that a wrong guess costs more than the omission: `Scheduler*`,
|
|
25
|
+
* `VerificationCodeInput`, `StackingIcons`, `TreeView` / `TreeItem`, `Calendar`.
|
|
26
|
+
*
|
|
27
|
+
* Auto-deriving the full export set would trade "substituted a div" for "used the wrong
|
|
28
|
+
* component" and would carry no usage guidance — so entries are added deliberately, and each
|
|
29
|
+
* newly surfaced one is paired with a usage example in the context below.
|
|
30
|
+
*
|
|
31
|
+
* Every name here is pinned to the installed dist by `fui-import-surface.test.ts`, which fails if
|
|
32
|
+
* a name is not a real export (typo / upstream removal) or if a required component is dropped.
|
|
33
|
+
*/
|
|
34
|
+
export const RAPID_DESIGN_SYSTEM_REACT_COMPONENTS = [
|
|
35
|
+
// Form controls
|
|
36
|
+
'Button',
|
|
37
|
+
'TextField',
|
|
38
|
+
'Select',
|
|
39
|
+
'ListboxOption',
|
|
40
|
+
'Optgroup',
|
|
41
|
+
'Combobox',
|
|
42
|
+
'Multiselect',
|
|
43
|
+
'Checkbox',
|
|
44
|
+
'Switch',
|
|
45
|
+
'Radio',
|
|
46
|
+
'RadioGroup',
|
|
47
|
+
'DatePicker',
|
|
48
|
+
'NumberField',
|
|
49
|
+
'TextArea',
|
|
50
|
+
'FileUpload',
|
|
51
|
+
'SearchBar',
|
|
52
|
+
'Slider',
|
|
53
|
+
'SliderLabel',
|
|
54
|
+
// Overlays
|
|
55
|
+
'Dialog',
|
|
56
|
+
'Modal',
|
|
57
|
+
'Flyout',
|
|
58
|
+
'Tooltip',
|
|
59
|
+
'DropdownMenu',
|
|
60
|
+
// Containers / layout
|
|
61
|
+
'Card',
|
|
62
|
+
'Divider',
|
|
63
|
+
'Toolbar',
|
|
64
|
+
'Accordion',
|
|
65
|
+
'AccordionItem',
|
|
66
|
+
'Tabs',
|
|
67
|
+
'Tab',
|
|
68
|
+
'TabPanel',
|
|
69
|
+
'Stepper',
|
|
70
|
+
'StepperTab',
|
|
71
|
+
'StepperTabPanel',
|
|
72
|
+
'SegmentedControl',
|
|
73
|
+
'SegmentedItem',
|
|
74
|
+
// Status, feedback and loading
|
|
75
|
+
'Icon',
|
|
76
|
+
'Badge',
|
|
77
|
+
'StatusPill',
|
|
78
|
+
'Pill',
|
|
79
|
+
'Banner',
|
|
80
|
+
'Snackbar',
|
|
81
|
+
'Toast',
|
|
82
|
+
'Skeleton',
|
|
83
|
+
'Progress',
|
|
84
|
+
'ProgressRing',
|
|
85
|
+
// Identity / navigation
|
|
86
|
+
'Avatar',
|
|
87
|
+
'Anchor',
|
|
88
|
+
'Breadcrumb',
|
|
89
|
+
'BreadcrumbItem',
|
|
90
|
+
];
|
|
91
|
+
export const FUI_IMPORT_SURFACE_TAGS = [
|
|
92
|
+
'@genesislcap',
|
|
93
|
+
'genesislcap',
|
|
94
|
+
'import path',
|
|
95
|
+
'import surface',
|
|
96
|
+
'subpath',
|
|
97
|
+
'rapid-design-system',
|
|
98
|
+
'foundation-entity-management',
|
|
99
|
+
'foundation-forms',
|
|
100
|
+
'rapid-grid-pro',
|
|
101
|
+
'grid-pro',
|
|
102
|
+
'g2plot-chart',
|
|
103
|
+
'foundation-comms',
|
|
104
|
+
'foundation-redux',
|
|
105
|
+
'foundation-utils',
|
|
106
|
+
'foundation-react-utils',
|
|
107
|
+
'expression-builder',
|
|
108
|
+
'grid-tabulator',
|
|
109
|
+
'rapid-grid-tabulator',
|
|
110
|
+
];
|
|
111
|
+
export const FUI_IMPORT_SURFACE_CONTEXT = `
|
|
112
|
+
## IMPORT SURFACE — all valid @genesislcap package paths
|
|
113
|
+
|
|
114
|
+
### Runtime component imports (always /react subpath)
|
|
115
|
+
|
|
116
|
+
Import React wrappers from the \`/react\` subpath. Every package below has a verified \`"./react"\`
|
|
117
|
+
entry in its \`package.json\` exports field.
|
|
118
|
+
|
|
119
|
+
| What you need | Import from |
|
|
120
|
+
|---|---|
|
|
121
|
+
| ${RAPID_DESIGN_SYSTEM_REACT_COMPONENTS.join(', ')} | \`@genesislcap/rapid-design-system/react\` |
|
|
122
|
+
| OptionsDatasource, MultiselectDatasource (+ \`OptionsDatasourceRef\`, \`MultiselectDatasourceRef\`) — datasource children that populate a Select/Combobox/Multiselect from a Genesis resource | \`@genesislcap/foundation-ui/react\` |
|
|
123
|
+
| EntityManagement, SmartFormModal, List | \`@genesislcap/foundation-entity-management/react\` |
|
|
124
|
+
| Form, Filters, JSONForms, FoundationReactSlot (+ \`FormRef\`, \`FiltersRef\` element types) | \`@genesislcap/foundation-forms/react\` |
|
|
125
|
+
| renderersWithReact, ReactSlotRendererOptions, ReactSlotControlRendererEntry | \`@genesislcap/foundation-forms/react-extras\` |
|
|
126
|
+
| RapidGridPro (alias as GridPro in this app) | \`@genesislcap/rapid-grid-pro/react\` |
|
|
127
|
+
| GridProGenesisDatasource, GridProClientSideDatasource, GridProServerSideDatasource, GridProColumn | \`@genesislcap/grid-pro/react\` |
|
|
128
|
+
| G2PlotChart, ChartDatasource | \`@genesislcap/g2plot-chart/react\` |
|
|
129
|
+
| ExpressionBuilder, ExpressionGroup, ExpressionRule, RuleField, RuleOperator, RuleValue | \`@genesislcap/expression-builder/react\` |
|
|
130
|
+
| GridTabulator, GridTabulatorCell, GridTabulatorColumn, GridTabulatorClientSideDatasource | \`@genesislcap/grid-tabulator/react\` |
|
|
131
|
+
|
|
132
|
+
> **\`@genesislcap/rapid-grid-tabulator\` has NO \`/react\` subpath and NO React wrapper** — there is
|
|
133
|
+
> no \`RapidGridTabulator\` React component. For a Tabulator grid use \`GridTabulator\` from
|
|
134
|
+
> \`@genesislcap/grid-tabulator/react\`; the rapid theme comes from the ROOT:
|
|
135
|
+
> \`import { initRapidGridTabulator, FormatterTypes } from '@genesislcap/rapid-grid-tabulator'\`.
|
|
136
|
+
|
|
137
|
+
> **Note:** \`GridProGenesisDatasource\` and \`GridProColumn\` live in \`@genesislcap/grid-pro/react\`,
|
|
138
|
+
> NOT in \`@genesislcap/rapid-grid-pro/react\`. \`RapidGridPro\` itself is in rapid-grid-pro.
|
|
139
|
+
> Both packages are always used together for a datasource-connected grid:
|
|
140
|
+
> \`import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react'\` +
|
|
141
|
+
> \`import { GridProGenesisDatasource, GridProColumn } from '@genesislcap/grid-pro/react'\`
|
|
142
|
+
|
|
143
|
+
> **Note:** to feed a **Select / Combobox / Multiselect** from a Genesis resource, the host field comes
|
|
144
|
+
> from \`@genesislcap/rapid-design-system/react\` but its datasource child (\`OptionsDatasource\` for
|
|
145
|
+
> Select/Combobox, \`MultiselectDatasource\` for Multiselect) is imported from
|
|
146
|
+
> \`@genesislcap/foundation-ui/react\` — the only package that exports them. This split is expected;
|
|
147
|
+
> rapid-design-system is built on foundation-ui. Full prop/event reference is in the \`fui-primitives\`
|
|
148
|
+
> context module.
|
|
149
|
+
|
|
150
|
+
### PREFER A DESIGN-SYSTEM COMPONENT OVER HAND-ROLLED MARKUP
|
|
151
|
+
|
|
152
|
+
If a component in the table above does the job, use it — do not hand-roll the same thing out of
|
|
153
|
+
\`<div>\`/\`<button>\`/\`<input>\` plus CSS. Hand-rolled markup misses the theme's colours, focus rings,
|
|
154
|
+
keyboard behaviour and dark/light handling, so it looks visibly "off-system" next to real
|
|
155
|
+
components even when the CSS is careful.
|
|
156
|
+
|
|
157
|
+
| Hand-rolled | Use instead |
|
|
158
|
+
|---|---|
|
|
159
|
+
| \`<button>\` | \`Button\` |
|
|
160
|
+
| \`<input type="date">\` | \`DatePicker\` |
|
|
161
|
+
| \`<input type="text">\`, \`<input type="number">\`, \`<textarea>\` | \`TextField\`, \`NumberField\`, \`TextArea\` |
|
|
162
|
+
| \`<select>\` + \`<option>\` (+ \`<optgroup>\`) | \`Select\` + \`ListboxOption\` (+ \`Optgroup\`) |
|
|
163
|
+
| \`<a href>\` as a themed link | \`Anchor\` |
|
|
164
|
+
| \`<table>\`/\`<thead>\`/\`<tr>\` holding a DATASET (rows from a resource, sortable/filterable/scrolling) | \`RapidGridPro\` (or \`EntityManagement\` when it needs CRUD) — but a fixed, non-interactive matrix such as a price ladder or a summary key/value block is a legitimate \`<table>\`; the grid buys virtualisation, sorting and filtering you would not use there |
|
|
165
|
+
| a \`<span>\` styled as a status chip | \`StatusPill\` |
|
|
166
|
+
| a \`<div>\` with a border + shadow | \`Card\` |
|
|
167
|
+
| a \`<div>\` bar animated for loading | \`Skeleton\`, \`Progress\`, \`ProgressRing\` |
|
|
168
|
+
| a \`<div>\` row of action buttons above content | keep the \`<div>\` — see fui-styling; \`Toolbar\` left-clamps its buttons. **Exception: a button above an \`EntityManagement\` grid is a \`customActions\` entry with \`position: CrudMenuPosition.Top\` passed to \`EntityManagement\` itself — not a hand-rolled div and not \`Toolbar\`.** |
|
|
169
|
+
| an \`<hr>\` or a 1px \`<div>\` | \`Divider\` |
|
|
170
|
+
|
|
171
|
+
A \`<div>\` for **layout only** (flex/grid containers, spacing wrappers) is correct and expected —
|
|
172
|
+
this rule is about elements that carry behaviour or a visual identity the design system owns.
|
|
173
|
+
|
|
174
|
+
### Usage examples — one line each
|
|
175
|
+
|
|
176
|
+
\`\`\`tsx
|
|
177
|
+
import {
|
|
178
|
+
Button, StatusPill, Pill, Skeleton, Progress, ProgressRing,
|
|
179
|
+
Card, Toolbar, Avatar, Anchor, Breadcrumb, BreadcrumbItem, Divider, Tooltip,
|
|
180
|
+
Select, ListboxOption, Optgroup, Slider, SliderLabel,
|
|
181
|
+
} from '@genesislcap/rapid-design-system/react';
|
|
182
|
+
|
|
183
|
+
// Button — the COMPLETE styled set (rapid-design-system button.styles.d.ts). Outline exists for
|
|
184
|
+
// primary, secondary and neutral ONLY — there is no danger-outline or accent-outline (TS2322).
|
|
185
|
+
// 'primary' | 'secondary' | 'tertiary' | 'neutral' | 'accent' | 'danger' | 'success' | 'warning'
|
|
186
|
+
// | 'primary-outline' | 'secondary-outline' | 'neutral-outline' | 'link'
|
|
187
|
+
// 'stealth' / 'outline' / 'lightweight' typecheck but are FAST-only: the dist says they "are NOT
|
|
188
|
+
// styled here and render as a plain button". Never use them.
|
|
189
|
+
<Button appearance="primary" onClick={handleSubmit}>Submit</Button>
|
|
190
|
+
|
|
191
|
+
// StatusPill — data-driven status chip. Attributes: text, backgroundColor, textColor, iconName.
|
|
192
|
+
<StatusPill text="Filled" backgroundColor="var(--success-color)" iconName="check" />
|
|
193
|
+
|
|
194
|
+
// Pill — removable label/value chip (active filters). Events: onRemove, onPillClick.
|
|
195
|
+
<Pill label="Cpty Desk" value="EQUITIES" onRemove={() => clearFilter('cptyDesk')} />
|
|
196
|
+
|
|
197
|
+
// Skeleton — loading placeholder. shape: 'rect' | 'circle'; shimmer animates it.
|
|
198
|
+
<Skeleton shape="rect" shimmer style={{ height: 18, width: '100%' }} />
|
|
199
|
+
|
|
200
|
+
// Progress — determinate bar (omit value for indeterminate).
|
|
201
|
+
<Progress value={42} min={0} max={100} />
|
|
202
|
+
|
|
203
|
+
// ProgressRing — spinner; indeterminate while value is omitted.
|
|
204
|
+
<ProgressRing />
|
|
205
|
+
|
|
206
|
+
// Card — the generic surface. Compose KPI tiles, panels and summary blocks from it.
|
|
207
|
+
<Card className="kpi-card">{children}</Card>
|
|
208
|
+
|
|
209
|
+
// EXCEPTION — EntityManagement: never hand-roll a div (or reach for Toolbar) above an
|
|
210
|
+
// EntityManagement grid. Pass a customActions entry with position: CrudMenuPosition.Top to
|
|
211
|
+
// EntityManagement itself — it renders a native toolbar button with no wrapper and no left-clamp.
|
|
212
|
+
// Toolbar — a roving-focus button group, NOT the strip of actions above a grid. Its internal
|
|
213
|
+
// .positioning-region hardcodes justify-content: flex-start, so the buttons shrink-wrap to the
|
|
214
|
+
// LEFT of a full-width host unless the host overrides it (as below). A plain flex <div> needs no
|
|
215
|
+
// such rule and is what the anti-pattern table above asks for — see fui-styling.
|
|
216
|
+
<Toolbar style={{ justifyContent: 'flex-end' }}><Button appearance="neutral">Export</Button></Toolbar>
|
|
217
|
+
|
|
218
|
+
// Avatar — user / counterparty initials.
|
|
219
|
+
<Avatar>JD</Avatar>
|
|
220
|
+
|
|
221
|
+
// Breadcrumb — trail; the last item carries no href.
|
|
222
|
+
<Breadcrumb>
|
|
223
|
+
<BreadcrumbItem href="#/trades">Trades</BreadcrumbItem>
|
|
224
|
+
<BreadcrumbItem>TRD-1042</BreadcrumbItem>
|
|
225
|
+
</Breadcrumb>
|
|
226
|
+
|
|
227
|
+
// Divider — a themed rule between sections.
|
|
228
|
+
<Divider />
|
|
229
|
+
|
|
230
|
+
// Anchor — a themed link. Use this instead of a raw <a href>.
|
|
231
|
+
<Anchor href="#/trades/TRD-1042">TRD-1042</Anchor>
|
|
232
|
+
|
|
233
|
+
// Optgroup — groups options inside a Select. The React prop is groupLabel, NOT label:
|
|
234
|
+
// Optgroup extends ListboxOption, which already owns \`label\`, so the group's own text was
|
|
235
|
+
// renamed to avoid the clash. \`label\` compiles but sets the wrong property and renders nothing.
|
|
236
|
+
<Select>
|
|
237
|
+
<Optgroup groupLabel="G10">
|
|
238
|
+
<ListboxOption value="EUR/USD">EUR/USD</ListboxOption>
|
|
239
|
+
</Optgroup>
|
|
240
|
+
</Select>
|
|
241
|
+
|
|
242
|
+
// SliderLabel — tick labels for the allowed Slider. position is a STRING, not a number.
|
|
243
|
+
<Slider min={0} max={100}><SliderLabel position="50">50</SliderLabel></Slider>
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
> **\`StatusPill\` INSIDE a grid cell:** do not render the component from a cell renderer — use the
|
|
247
|
+
> built-in \`GridProRendererTypes.statusPill\` renderer instead (see \`fui-column-defs\`). The
|
|
248
|
+
> component is for status chips OUTSIDE a grid (headers, KPI strips, detail panels).
|
|
249
|
+
|
|
250
|
+
> \`Modal\`, \`Dialog\` and \`Flyout\` have ref/prop patterns that are easy to get wrong (Flyout's
|
|
251
|
+
> \`closed\` prop, Modal's missing \`onClose\`) — read \`fui-dialogs\` before using them. Full prop and
|
|
252
|
+
> event reference for every control is in \`fui-primitives\`.
|
|
253
|
+
|
|
254
|
+
### Root imports — types + runtime helpers (base package root — NOT /react)
|
|
255
|
+
|
|
256
|
+
| Name(s) | Import from |
|
|
257
|
+
|---|---|
|
|
258
|
+
| \`CustomAction\`, \`CustomActionState\`, \`CrudAction\`, \`CrudMenuPosition\`, \`ActionsMenuStyle\`, \`ModalFormType\`, \`GridColDef\` | \`@genesislcap/foundation-entity-management\` |
|
|
259
|
+
| \`ColDef\`, \`GridOptions\`, \`ValueFormatterParams\`, \`ICellRendererParams\`, \`CellEditingStoppedEvent\` | \`@ag-grid-community/core\` (the canonical ColDef source — generated column-def files import from here) |
|
|
260
|
+
| \`UiSchema\`, \`RendererEntry\`, \`UiSchemaElement\`, \`CategorizationRendererOptions\`, \`GenesisType\`, \`StandardRendererOptions\`, \`RendererControlProps\` | \`@genesislcap/foundation-forms\` |
|
|
261
|
+
| \`GridProRendererTypes\`, \`GridProCaseType\`, \`GridProErrorEvent\` | \`@genesislcap/rapid-grid-pro\` (root — no /react; re-exports from @genesislcap/grid-pro) |
|
|
262
|
+
| \`ChartConfig\`, \`ChartTypes\`, \`chartsGradients\` | \`@genesislcap/g2plot-chart\` |
|
|
263
|
+
| \`Connect\`, \`getConnect\`, \`messageOrThrow\`, \`Message\` | \`@genesislcap/foundation-comms\` |
|
|
264
|
+
| \`createSlice\`, \`createStore\`, \`PayloadAction\` | \`@genesislcap/foundation-redux\` |
|
|
265
|
+
| \`getNumberFormatter\`, \`getDateFormatter\`, \`formatTimestamp\`, \`NumberParser\` | \`@genesislcap/foundation-utils\` |
|
|
266
|
+
| \`getUser\`, \`User\` | \`@genesislcap/foundation-user\` |
|
|
267
|
+
|
|
268
|
+
> There is NO \`JsonSchema\` type in foundation-forms — the JSON-schema type it uses is
|
|
269
|
+
> \`JSONSchema7\` from the \`json-schema\` package (rarely needed: \`Form\`/\`Filters\` fetch their
|
|
270
|
+
> schema from \`resourceName\`).
|
|
271
|
+
|
|
272
|
+
### Subpath rules (critical)
|
|
273
|
+
|
|
274
|
+
1. **Always use \`/react\` subpath** for WC React wrappers. The bare root (e.g. \`@genesislcap/rapid-design-system\`) exports WC registrations only — React components are NOT exported from the root.
|
|
275
|
+
2. **\`@genesislcap/rapid-grid-pro\`** root exports \`GridProRendererTypes\` and \`GridProCaseType\` — correct, intentional. These are re-exported from \`@genesislcap/grid-pro\`.
|
|
276
|
+
3. **\`@genesislcap/foundation-entity-management\`** root is type-only — do NOT import React components from here.
|
|
277
|
+
4. **\`@genesislcap/foundation-forms\`** root exports types (\`UiSchema\`, \`RendererEntry\`, etc.) — for React form component import use \`/react\`; for custom React slot renderers use \`/react-extras\`.
|
|
278
|
+
5. **\`@genesislcap/foundation-comms\`**, **\`@genesislcap/foundation-redux\`**, **\`@genesislcap/foundation-utils\`** have no \`/react\` subpath — import directly from their root.
|
|
279
|
+
6. **\`@genesislcap/foundation-criteria\`** has no \`/react\` subpath — root only (criteria-building helpers; do not use its WC components in React directly).
|
|
280
|
+
7. **NOT installed in this app — never import from them**: \`@genesislcap/foundation-filters\`. Any import fails to resolve at build time. (\`@genesislcap/foundation-react-utils\` IS installed — see rule 7b.)
|
|
281
|
+
7b. **\`@genesislcap/foundation-react-utils\` IS installed and IS a direct dependency** (verified at 15.19.4 in a materialised app, and the generated scaffold itself imports \`@genesislcap/foundation-react-utils/router\` from \`AppRoutes.tsx\`, \`SingleComponent.tsx\` and \`registry.ts\`). Earlier guidance said the opposite and that was wrong. Its exports include \`createGridProCellRenderer\`, \`createGridProCellPortals\`, \`createReactRenderer\` and the \`/router\` helpers. **\`createGridProCellRenderer\` is the ONLY way a React component can be a grid-pro cell renderer** — see fui-column-defs.
|
|
282
|
+
8. **React must be explicitly imported** in every new \`.tsx\` file: \`import React, { useState, useRef, useEffect } from 'react';\`
|
|
283
|
+
|
|
284
|
+
### Complete import example — datasource-connected grid
|
|
285
|
+
|
|
286
|
+
\`\`\`tsx
|
|
287
|
+
import React, { useMemo } from 'react';
|
|
288
|
+
// React wrappers
|
|
289
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
290
|
+
import { GridProGenesisDatasource, GridProColumn } from '@genesislcap/grid-pro/react';
|
|
291
|
+
// Types (root, no /react)
|
|
292
|
+
import { GridProRendererTypes, GridProCaseType } from '@genesislcap/rapid-grid-pro';
|
|
293
|
+
import type { ColDef } from '@ag-grid-community/core';
|
|
294
|
+
|
|
295
|
+
const colDefs: ColDef[] = [
|
|
296
|
+
{ field: 'TRADE_ID', headerName: 'ID' },
|
|
297
|
+
{ field: 'QUANTITY', headerName: 'Qty', cellRenderer: GridProRendererTypes.actionsMenu },
|
|
298
|
+
];
|
|
299
|
+
|
|
300
|
+
export default function TradeGrid() {
|
|
301
|
+
return (
|
|
302
|
+
<RapidGridPro headerCaseType={GridProCaseType.capitalCase} enableCellFlashing>
|
|
303
|
+
<GridProGenesisDatasource resourceName="ALL_TRADES" />
|
|
304
|
+
{colDefs.map((def, i) => (
|
|
305
|
+
<GridProColumn key={i} definition={def} />
|
|
306
|
+
))}
|
|
307
|
+
</RapidGridPro>
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
\`\`\`
|
|
311
|
+
|
|
312
|
+
### Complete import example — EntityManagement
|
|
313
|
+
|
|
314
|
+
\`\`\`tsx
|
|
315
|
+
import React from 'react';
|
|
316
|
+
import { EntityManagement } from '@genesislcap/foundation-entity-management/react';
|
|
317
|
+
import { CrudMenuPosition, CustomAction } from '@genesislcap/foundation-entity-management';
|
|
318
|
+
import type { UiSchema } from '@genesislcap/foundation-forms';
|
|
319
|
+
import type { ColDef } from '@ag-grid-community/core';
|
|
320
|
+
\`\`\`
|
|
321
|
+
|
|
322
|
+
### Complete import example — foundation-forms (Form + custom renderers)
|
|
323
|
+
|
|
324
|
+
\`\`\`tsx
|
|
325
|
+
import React from 'react';
|
|
326
|
+
import { Form, Filters, FiltersRef } from '@genesislcap/foundation-forms/react';
|
|
327
|
+
import { renderersWithReact, ReactSlotControlRendererEntry } from '@genesislcap/foundation-forms/react-extras';
|
|
328
|
+
import type { UiSchema, RendererEntry, RendererControlProps } from '@genesislcap/foundation-forms';
|
|
329
|
+
\`\`\`
|
|
330
|
+
|
|
331
|
+
### App-local imports every FlexLayout page needs
|
|
332
|
+
|
|
333
|
+
\`\`\`tsx
|
|
334
|
+
import { Layout, Model, TabNode } from 'flexlayout-react'; // npm package, root import
|
|
335
|
+
import { getFlexLayoutStorageKey } from '../../utils/layout'; // layout persistence key helper
|
|
336
|
+
import { TileErrorBoundary } from '../../components/error-boundary/ErrorBoundary'; // per-tile crash isolation
|
|
337
|
+
import { actions } from '../../store/store'; // pre-bound redux actions
|
|
338
|
+
\`\`\`
|
|
339
|
+
(Adjust relative depth to the file's location; these modules ship with every generated app.)
|
|
340
|
+
|
|
341
|
+
### Redux state — correct import pattern
|
|
342
|
+
|
|
343
|
+
| What you need | Import from |
|
|
344
|
+
|---|---|
|
|
345
|
+
| \`useSelector\` | \`react-redux\` |
|
|
346
|
+
| \`createSlice\`, \`createStore\` | \`@genesislcap/foundation-redux\` |
|
|
347
|
+
|
|
348
|
+
**NEVER import \`useDispatch\` from \`react-redux\`.**
|
|
349
|
+
foundation-redux's \`createStore\` pre-binds every action creator — call them directly:
|
|
350
|
+
|
|
351
|
+
\`\`\`ts
|
|
352
|
+
// Correct
|
|
353
|
+
import { actions } from '../store/store';
|
|
354
|
+
actions.mySlice.setField(value);
|
|
355
|
+
|
|
356
|
+
// Wrong — dispatch is unused (TS6133) because pre-bound actions don't need it
|
|
357
|
+
import { useDispatch } from 'react-redux';
|
|
358
|
+
const dispatch = useDispatch();
|
|
359
|
+
dispatch(actions.mySlice.setField(value));
|
|
360
|
+
\`\`\`
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
### DANGEROUS PATTERNS
|
|
365
|
+
|
|
366
|
+
#### DP-1: Importing React components from bare package root
|
|
367
|
+
|
|
368
|
+
\`\`\`ts
|
|
369
|
+
// WRONG — bare root only has WC registrations:
|
|
370
|
+
import { Button } from '@genesislcap/rapid-design-system';
|
|
371
|
+
import { EntityManagement } from '@genesislcap/foundation-entity-management';
|
|
372
|
+
|
|
373
|
+
// CORRECT — always use /react subpath for React wrappers:
|
|
374
|
+
import { Button } from '@genesislcap/rapid-design-system/react';
|
|
375
|
+
import { EntityManagement } from '@genesislcap/foundation-entity-management/react';
|
|
376
|
+
\`\`\`
|
|
377
|
+
|
|
378
|
+
#### DP-2: Getting GridProGenesisDatasource from rapid-grid-pro
|
|
379
|
+
|
|
380
|
+
\`\`\`ts
|
|
381
|
+
// WRONG — GridProGenesisDatasource is NOT exported from rapid-grid-pro/react:
|
|
382
|
+
import { RapidGridPro, GridProGenesisDatasource } from '@genesislcap/rapid-grid-pro/react';
|
|
383
|
+
|
|
384
|
+
// CORRECT — RapidGridPro is in rapid-grid-pro/react; datasources + columns are in grid-pro/react:
|
|
385
|
+
import { RapidGridPro } from '@genesislcap/rapid-grid-pro/react';
|
|
386
|
+
import { GridProGenesisDatasource, GridProColumn } from '@genesislcap/grid-pro/react';
|
|
387
|
+
\`\`\`
|
|
388
|
+
|
|
389
|
+
#### DP-3: Importing UiSchema / RendererEntry from /react subpath
|
|
390
|
+
|
|
391
|
+
\`\`\`ts
|
|
392
|
+
// WRONG — types are not exported from the /react subpath:
|
|
393
|
+
import type { UiSchema } from '@genesislcap/foundation-forms/react';
|
|
394
|
+
import type { CustomAction } from '@genesislcap/foundation-entity-management/react';
|
|
395
|
+
|
|
396
|
+
// CORRECT — types come from the base package root:
|
|
397
|
+
import type { UiSchema, RendererEntry } from '@genesislcap/foundation-forms';
|
|
398
|
+
import type { CustomAction, CrudMenuPosition } from '@genesislcap/foundation-entity-management';
|
|
399
|
+
\`\`\`
|
|
400
|
+
|
|
401
|
+
#### DP-4: Using useDispatch with foundation-redux actions
|
|
402
|
+
|
|
403
|
+
\`\`\`ts
|
|
404
|
+
// WRONG — useDispatch is never needed; causes TS6133 unused variable:
|
|
405
|
+
import { useDispatch } from 'react-redux';
|
|
406
|
+
const dispatch = useDispatch();
|
|
407
|
+
dispatch(actions.mySlice.setField(value));
|
|
408
|
+
|
|
409
|
+
// CORRECT — foundation-redux createStore pre-binds all actions:
|
|
410
|
+
import { actions } from '../store/store';
|
|
411
|
+
actions.mySlice.setField(value);
|
|
412
|
+
\`\`\`
|
|
413
|
+
|
|
414
|
+
#### DP-5: Importing G2PlotChart from rapid-design-system
|
|
415
|
+
|
|
416
|
+
\`\`\`ts
|
|
417
|
+
// WRONG — charts are not part of rapid-design-system:
|
|
418
|
+
import { G2PlotChart } from '@genesislcap/rapid-design-system/react';
|
|
419
|
+
|
|
420
|
+
// CORRECT — chart components are a separate marketplace package:
|
|
421
|
+
import { G2PlotChart, ChartDatasource } from '@genesislcap/g2plot-chart/react';
|
|
422
|
+
import type { ChartConfig, ChartTypes } from '@genesislcap/g2plot-chart';
|
|
423
|
+
\`\`\`
|
|
424
|
+
|
|
425
|
+
#### DP-6: Importing renderersWithReact from /react instead of /react-extras
|
|
426
|
+
|
|
427
|
+
\`\`\`ts
|
|
428
|
+
// WRONG — renderersWithReact is in /react-extras, not /react:
|
|
429
|
+
import { renderersWithReact } from '@genesislcap/foundation-forms/react';
|
|
430
|
+
|
|
431
|
+
// CORRECT:
|
|
432
|
+
import { renderersWithReact } from '@genesislcap/foundation-forms/react-extras';
|
|
433
|
+
\`\`\`
|
|
434
|
+
|
|
435
|
+
#### DP-7: Adding useDispatch to importsFromPackages in a plan
|
|
436
|
+
|
|
437
|
+
When writing a plan, NEVER include \`useDispatch\` in \`importsFromPackages\`. The generated code will
|
|
438
|
+
call pre-bound actions directly, leaving \`dispatch\` unused and causing a TS6133 compile error.
|
|
439
|
+
|
|
440
|
+
#### DP-8: Importing from packages that are not app dependencies
|
|
441
|
+
|
|
442
|
+
\`\`\`ts
|
|
443
|
+
// WRONG — these packages are NOT installed in generated apps; the import fails to resolve:
|
|
444
|
+
import { RapidGridTabulator } from '@genesislcap/rapid-grid-tabulator/react'; // subpath does not exist
|
|
445
|
+
import { Filters } from '@genesislcap/foundation-filters';
|
|
446
|
+
|
|
447
|
+
// CORRECT — stay on the installed surface:
|
|
448
|
+
import { ReactSlotControlRendererEntry, renderersWithReact } from '@genesislcap/foundation-forms/react-extras';
|
|
449
|
+
import { GridTabulator } from '@genesislcap/grid-tabulator/react';
|
|
450
|
+
import { Filters } from '@genesislcap/foundation-forms/react';
|
|
451
|
+
\`\`\`
|
|
452
|
+
`.trim();
|