@elevasis/sdk 1.20.2 → 1.22.0
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/cli.cjs +4220 -1583
- package/dist/index.d.ts +1035 -481
- package/dist/index.js +7381 -4187
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.js +40 -49
- package/dist/test-utils/index.d.ts +699 -123
- package/dist/test-utils/index.js +3826 -630
- package/dist/worker/index.js +3616 -442
- package/package.json +3 -3
- package/reference/_navigation.md +9 -7
- package/reference/_reference-manifest.json +1 -1
- package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
- package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
- package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
- package/reference/claude-config/registries/graph-skills.json +4 -4
- package/reference/claude-config/registries/knowledge-flags.json +0 -2
- package/reference/claude-config/rules/active-change-index.md +80 -80
- package/reference/claude-config/rules/agent-start-here.md +277 -273
- package/reference/claude-config/rules/deployment.md +57 -57
- package/reference/claude-config/rules/error-handling.md +56 -56
- package/reference/claude-config/rules/execution.md +40 -40
- package/reference/claude-config/rules/frontend.md +4 -4
- package/reference/claude-config/rules/observability.md +31 -31
- package/reference/claude-config/rules/operations.md +29 -17
- package/reference/claude-config/rules/organization-model.md +108 -40
- package/reference/claude-config/rules/organization-os.md +115 -113
- package/reference/claude-config/rules/package-taxonomy.md +33 -33
- package/reference/claude-config/rules/platform.md +42 -42
- package/reference/claude-config/rules/shared-types.md +49 -46
- package/reference/claude-config/rules/task-tracking.md +47 -47
- package/reference/claude-config/rules/ui.md +200 -200
- package/reference/claude-config/rules/vibe.md +235 -231
- package/reference/claude-config/scripts/statusline-command.js +18 -18
- package/reference/claude-config/settings.json +34 -34
- package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
- package/reference/claude-config/skills/dsp/SKILL.md +66 -66
- package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
- package/reference/claude-config/skills/explore/SKILL.md +6 -6
- package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
- package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
- package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
- package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
- package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
- package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
- package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
- package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
- package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
- package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
- package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
- package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
- package/reference/claude-config/skills/project/SKILL.md +1088 -1088
- package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
- package/reference/claude-config/skills/save/SKILL.md +3 -3
- package/reference/claude-config/skills/setup/SKILL.md +275 -275
- package/reference/claude-config/skills/status/SKILL.md +59 -59
- package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
- package/reference/claude-config/skills/sync/SKILL.md +47 -47
- package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
- package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
- package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
- package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
- package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
- package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
- package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
- package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
- package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
- package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
- package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
- package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
- package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
- package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
- package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
- package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
- package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
- package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
- package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
- package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
- package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
- package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
- package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
- package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
- package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
- package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
- package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
- package/reference/claude-config/sync-notes/README.md +43 -43
- package/reference/cli.mdx +808 -668
- package/reference/concepts.mdx +146 -146
- package/reference/deployment/api.mdx +297 -297
- package/reference/deployment/command-center.mdx +209 -209
- package/reference/deployment/index.mdx +195 -195
- package/reference/deployment/provided-features.mdx +107 -93
- package/reference/deployment/ui-execution.mdx +250 -250
- package/reference/examples/organization-model.ts +147 -84
- package/reference/framework/agent.mdx +156 -156
- package/reference/framework/index.mdx +195 -195
- package/reference/framework/interaction-guidance.mdx +182 -182
- package/reference/framework/memory.mdx +326 -326
- package/reference/framework/project-structure.mdx +282 -282
- package/reference/framework/tutorial-system.mdx +135 -135
- package/reference/getting-started.mdx +142 -142
- package/reference/index.mdx +106 -106
- package/reference/packages/core/src/README.md +14 -14
- package/reference/packages/core/src/business/README.md +2 -2
- package/reference/packages/core/src/knowledge/README.md +33 -32
- package/reference/packages/core/src/organization-model/README.md +149 -109
- package/reference/packages/core/src/test-utils/README.md +37 -37
- package/reference/packages/ui/src/api/README.md +18 -18
- package/reference/packages/ui/src/app/README.md +24 -24
- package/reference/packages/ui/src/auth/README.md +18 -18
- package/reference/packages/ui/src/components/README.md +24 -24
- package/reference/packages/ui/src/execution/README.md +16 -16
- package/reference/packages/ui/src/features/README.md +28 -28
- package/reference/packages/ui/src/graph/README.md +16 -16
- package/reference/packages/ui/src/hooks/README.md +23 -23
- package/reference/packages/ui/src/initialization/README.md +19 -19
- package/reference/packages/ui/src/knowledge/README.md +31 -31
- package/reference/packages/ui/src/organization/README.md +18 -18
- package/reference/packages/ui/src/profile/README.md +19 -19
- package/reference/packages/ui/src/provider/README.md +32 -32
- package/reference/packages/ui/src/router/README.md +18 -18
- package/reference/packages/ui/src/sse/README.md +13 -13
- package/reference/packages/ui/src/test-utils/README.md +7 -7
- package/reference/packages/ui/src/theme/README.md +23 -23
- package/reference/packages/ui/src/theme/presets/README.md +19 -19
- package/reference/packages/ui/src/types/README.md +16 -16
- package/reference/packages/ui/src/utils/README.md +18 -18
- package/reference/packages/ui/src/zustand/README.md +18 -18
- package/reference/platform-tools/adapters-integration.mdx +301 -301
- package/reference/platform-tools/adapters-platform.mdx +553 -553
- package/reference/platform-tools/index.mdx +217 -217
- package/reference/platform-tools/type-safety.mdx +82 -82
- package/reference/resources/index.mdx +349 -349
- package/reference/resources/patterns.mdx +449 -449
- package/reference/resources/types.mdx +116 -116
- package/reference/roadmap.mdx +165 -165
- package/reference/runtime.mdx +173 -173
- package/reference/scaffold/core/organization-graph.mdx +110 -89
- package/reference/scaffold/core/organization-model.mdx +226 -171
- package/reference/scaffold/index.mdx +67 -67
- package/reference/scaffold/operations/propagation-pipeline.md +77 -77
- package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
- package/reference/scaffold/operations/workflow-recipes.md +138 -138
- package/reference/scaffold/recipes/add-a-feature.md +310 -88
- package/reference/scaffold/recipes/add-a-resource.md +137 -117
- package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
- package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
- package/reference/scaffold/recipes/customize-organization-model.md +281 -118
- package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
- package/reference/scaffold/recipes/extend-crm.md +40 -39
- package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
- package/reference/scaffold/recipes/index.md +47 -46
- package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
- package/reference/scaffold/reference/contracts.md +2389 -2121
- package/reference/scaffold/reference/feature-registry.md +9 -20
- package/reference/scaffold/reference/glossary.md +76 -76
- package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
- package/reference/scaffold/ui/customization.md +243 -243
- package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
- package/reference/scaffold/ui/feature-shell.mdx +72 -72
- package/reference/scaffold/ui/recipes.md +221 -213
- package/reference/spine/spine-primer.md +96 -96
- package/reference/templates/index.mdx +47 -47
- package/reference/troubleshooting.mdx +223 -223
|
@@ -1,236 +1,236 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Composition & Extensibility
|
|
3
|
-
description: Organization OS Toolkit layer guidance for customizing shared shell
|
|
4
|
-
---
|
|
1
|
+
---
|
|
2
|
+
title: Composition & Extensibility
|
|
3
|
+
description: Organization OS Toolkit layer guidance for customizing shared shell systems without forking, including exported nav arrays, optional sidebar props, composable layout primitives, and the manifest.sidebar override pattern.
|
|
4
|
+
---
|
|
5
5
|
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
|
|
6
6
|
<!-- Regenerate: pnpm scaffold:sync -->
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
Within Organization OS, this doc covers the **Toolkit** layer: the primitives consumers use to customize shared shell
|
|
12
|
-
|
|
13
|
-
The core pattern: set `sidebar` on your manifest to a component that composes the
|
|
14
|
-
|
|
15
|
-
Shipped in `@elevasis/ui >= 2.8.1`.
|
|
16
|
-
|
|
17
|
-
## The Override Pattern
|
|
18
|
-
|
|
19
|
-
Every `
|
|
20
|
-
|
|
21
|
-
1. Importing the
|
|
22
|
-
2. Wrapping or replacing the middle with custom content.
|
|
23
|
-
3. Spreading the stock manifest and setting `sidebar` to their component.
|
|
24
|
-
4. Passing the customized manifest to `
|
|
25
|
-
|
|
26
|
-
No new manifest fields. No discriminated unions. No runtime machinery.
|
|
27
|
-
|
|
28
|
-
## Decision Tree
|
|
29
|
-
|
|
30
|
-
- **Adding or changing nav items?** -> Extend the exported item array and pass to `<*SidebarMiddle items={...}>`.
|
|
31
|
-
- **Structural changes (injecting panels, wrapping sections)?** -> Compose `SidebarTop`, `SidebarMiddle`, and exported panels directly in your own component.
|
|
32
|
-
- **Wrapping pages?** -> Import the
|
|
33
|
-
- **None of these fits?** -> Missing export is the bug. File an issue.
|
|
34
|
-
|
|
35
|
-
## Exported Primitives
|
|
36
|
-
|
|
37
|
-
### Nav item arrays
|
|
38
|
-
|
|
39
|
-
Re-exported from each
|
|
40
|
-
|
|
41
|
-
- `CRM_ITEMS` from `@elevasis/ui/features/crm`
|
|
42
|
-
- `LEAD_GEN_ITEMS` from `@elevasis/ui/features/lead-gen`
|
|
43
|
-
- `DELIVERY_PROJECT_ITEMS`, `DELIVERY_WORK_ITEMS`, `DELIVERY_COMMUNICATION_ITEMS` from `@elevasis/ui/features/delivery`
|
|
44
|
-
|
|
45
|
-
Shape is the shared `NavItem` type exported from `@elevasis/ui/layout`.
|
|
46
|
-
|
|
47
|
-
### Sidebar wrappers
|
|
48
|
-
|
|
49
|
-
Thin Top+Middle composers. Each accepts optional `children?: ReactNode` that replaces the default middle:
|
|
50
|
-
|
|
51
|
-
- `CrmSidebar`, `LeadGenSidebar`, `ProjectsSidebar`
|
|
52
|
-
|
|
53
|
-
### Middle components with optional item props
|
|
54
|
-
|
|
55
|
-
- `CrmSidebarMiddle` -- `items?: NavItem[]` (defaults to `CRM_ITEMS`)
|
|
56
|
-
- `LeadGenSidebarMiddle` -- `items?: NavItem[]` (defaults to `LEAD_GEN_ITEMS`)
|
|
57
|
-
- `ProjectsSidebarMiddle` -- `projectItems?`, `workItems?`, `communicationItems?` (each defaults to its respective exported array)
|
|
58
|
-
|
|
59
|
-
Delivery's three sections are preserved intentionally -- a real UX pattern consumers may want to extend with additional sections.
|
|
60
|
-
|
|
61
|
-
### Composable layout primitives
|
|
62
|
-
|
|
63
|
-
From `@elevasis/ui/layout`:
|
|
64
|
-
|
|
65
|
-
- `SubshellNavItem` -- individual nav link
|
|
66
|
-
- `SubshellNavList` -- router-context-aware list renderer (accepts `items: NavItem[]`, derives active state via `useRouterContext()`)
|
|
67
|
-
- `SubshellSidebarSection` -- section header with icon, label, optional top border
|
|
68
|
-
- `NavItem` -- shared item shape type
|
|
69
|
-
- `SubshellContainer` -- full-width, full-height flex wrapper that composes sidebar and content side by side
|
|
70
|
-
- `SubshellRightSideContainer` -- content area column (`flex: 1`, `minWidth: 0`) that prevents sidebar from squeezing content
|
|
71
|
-
- `SubshellContentContainer` -- scrollable content area with standard `md` padding and automatic topbar offset applied via `paddingTop`
|
|
72
|
-
- `SubshellLoader` -- loading placeholder centered in the subshell viewport; reads the active loader from `AppearanceContext`
|
|
73
|
-
|
|
74
|
-
`
|
|
75
|
-
|
|
76
|
-
### SubshellSidebar
|
|
77
|
-
|
|
78
|
-
`SubshellSidebar` is more than a thin wrapper. Key behaviors verified in source:
|
|
79
|
-
|
|
80
|
-
- **Collapsible** -- controlled by `collapsible` prop (defaults to `true`) and `defaultOpen` prop (defaults to `true`). When collapsed, the sidebar animates to zero width and a small toggle button remains visible at the bottom-right edge.
|
|
81
|
-
- **Glass morphism** -- applies `color-mix(in srgb, var(--glass-background) 80%, transparent)` as background and `var(--glass-blur)` as `backdropFilter`, consistent with the theme token system.
|
|
82
|
-
- **Animated transitions** -- width and opacity animate on collapse/expand using `sidebarTransitionDuration` from the layout constants.
|
|
83
|
-
- **Width** -- no built-in default; the caller supplies `width`. `
|
|
84
|
-
|
|
85
|
-
From `@elevasis/ui/router/context`:
|
|
86
|
-
|
|
87
|
-
- `useRouterContext` -- access route state for custom active-state logic
|
|
88
|
-
|
|
89
|
-
### RouterAdapter interface
|
|
90
|
-
|
|
91
|
-
`RouterAdapter` is the interface that bridges any router implementation to the shared layout primitives. Defined in `packages/ui/src/router/context.ts`:
|
|
92
|
-
|
|
93
|
-
- `currentPath: string` -- current pathname, used by `SubshellNavList` to derive active state
|
|
94
|
-
- `currentSearch?: string` -- current search string (optional)
|
|
95
|
-
- `navigate: (to: string) => void` -- imperative navigation
|
|
96
|
-
- `Link: ElementType<LinkProps>` -- router-aware anchor component; `LinkProps` extends `AnchorHTMLAttributes\<HTMLAnchorElement>` with a required `to: string` field
|
|
97
|
-
|
|
98
|
-
Consumers calling `useRouterContext()` get back a `RouterAdapter`. Any component that needs to read `currentPath` or call `navigate` can use the hook directly rather than prop-drilling from a parent.
|
|
99
|
-
|
|
100
|
-
### TanStackRouterBridge
|
|
101
|
-
|
|
102
|
-
`TanStackRouterBridge` is the concrete `RouterAdapter` implementation for TanStack Router. Exported from `packages/ui/src/router/providers/TanStackRouterBridge.tsx` and available via `@elevasis/ui/router`.
|
|
103
|
-
|
|
104
|
-
It wraps `RouterProvider` and supplies the adapter by reading `useLocation` and `useRouter` from `@tanstack/react-router`. The adapter value is stabilized with `useMemo` to prevent unnecessary re-renders in downstream consumers. Place it inside TanStack's `RouterProvider`:
|
|
105
|
-
|
|
106
|
-
```tsx
|
|
107
|
-
<TanStackRouterBridge>
|
|
108
|
-
<
|
|
109
|
-
<
|
|
110
|
-
</
|
|
111
|
-
</TanStackRouterBridge>
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Consumers using a different router can implement `RouterAdapter` directly and pass it to `RouterProvider` instead of using this bridge.
|
|
115
|
-
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
-
- `MyTasksPanel`, `QuickCreateActions` -- exported from `@elevasis/ui/features/crm`, included by default in `CrmSidebarMiddle`; consumers composing their own middle can re-include them explicitly.
|
|
119
|
-
|
|
120
|
-
###
|
|
121
|
-
|
|
122
|
-
Every page each
|
|
123
|
-
|
|
124
|
-
- CRM: `DealsListPage`, `DealDetailPage`
|
|
125
|
-
- Lead-gen: `LeadGenOverviewPage`, `LeadGenListsPage`, `LeadGenListDetailPage`, `LeadGenCompaniesPage`, `LeadGenContactsPage`
|
|
126
|
-
- Delivery: `AllTasksPage`, `UpcomingMilestonesPage`, `ProjectsListPage`, `ProjectDetailPage`
|
|
127
|
-
- Operations, monitoring, settings -- full page inventories exported from their
|
|
128
|
-
|
|
129
|
-
## Consumer Patterns
|
|
130
|
-
|
|
131
|
-
### 1. Extend nav items (shortest path)
|
|
132
|
-
|
|
133
|
-
```tsx
|
|
134
|
-
import { CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
|
|
135
|
-
import { IconFileText } from '@tabler/icons-react'
|
|
136
|
-
|
|
137
|
-
const customItems = [
|
|
138
|
-
...CRM_ITEMS,
|
|
139
|
-
{ label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false },
|
|
140
|
-
]
|
|
141
|
-
|
|
142
|
-
const MyCrmSidebar = () => (
|
|
143
|
-
<CrmSidebar>
|
|
144
|
-
<CrmSidebarMiddle items={customItems} />
|
|
145
|
-
</CrmSidebar>
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
const customCrmManifest = { ...crmManifest, sidebar: MyCrmSidebar }
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### 2. Inject a new delivery section (compose from primitives)
|
|
152
|
-
|
|
153
|
-
```tsx
|
|
154
|
-
import {
|
|
155
|
-
ProjectsSidebar,
|
|
156
|
-
DELIVERY_PROJECT_ITEMS,
|
|
157
|
-
DELIVERY_WORK_ITEMS,
|
|
158
|
-
DELIVERY_COMMUNICATION_ITEMS,
|
|
159
|
-
} from '@elevasis/ui/features/delivery'
|
|
160
|
-
import { SubshellSidebarSection, SubshellNavList } from '@elevasis/ui/layout'
|
|
161
|
-
import { Stack } from '@mantine/core'
|
|
162
|
-
import { IconChartBar, IconListCheck, IconMessageCircle } from '@tabler/icons-react'
|
|
163
|
-
|
|
164
|
-
const ANALYTICS_ITEMS = [
|
|
165
|
-
{ label: 'Dashboard', to: '/projects/analytics', icon: IconChartBar, exact: true },
|
|
166
|
-
]
|
|
167
|
-
|
|
168
|
-
const MyDeliveryMiddle = () => (
|
|
169
|
-
<Stack gap={0} style={{ flex: 1, overflowY: 'auto' }}>
|
|
170
|
-
<Stack gap={0} p="sm"><SubshellNavList items={DELIVERY_PROJECT_ITEMS} /></Stack>
|
|
171
|
-
<SubshellSidebarSection icon={IconListCheck} label="Work" withTopBorder />
|
|
172
|
-
<Stack gap={0} p="sm"><SubshellNavList items={DELIVERY_WORK_ITEMS} /></Stack>
|
|
173
|
-
<SubshellSidebarSection icon={IconMessageCircle} label="Communication" withTopBorder />
|
|
174
|
-
<Stack gap={0} p="sm"><SubshellNavList items={DELIVERY_COMMUNICATION_ITEMS} /></Stack>
|
|
175
|
-
<SubshellSidebarSection icon={IconChartBar} label="Analytics" withTopBorder />
|
|
176
|
-
<Stack gap={0} p="sm"><SubshellNavList items={ANALYTICS_ITEMS} /></Stack>
|
|
177
|
-
</Stack>
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
const MyDeliverySidebar = () => (
|
|
181
|
-
<ProjectsSidebar>
|
|
182
|
-
<MyDeliveryMiddle />
|
|
183
|
-
</ProjectsSidebar>
|
|
184
|
-
)
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### 3. Wrap a page with custom chrome
|
|
188
|
-
|
|
189
|
-
```tsx
|
|
190
|
-
// in a route file
|
|
191
|
-
import { DealsListPage } from '@elevasis/ui/features/crm'
|
|
192
|
-
|
|
193
|
-
export default function CustomDealsRoute() {
|
|
194
|
-
return (
|
|
195
|
-
<MyChromeWrapper>
|
|
196
|
-
<DealsListPage />
|
|
197
|
-
</MyChromeWrapper>
|
|
198
|
-
)
|
|
199
|
-
}
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
## Operations & Unmodified
|
|
203
|
-
|
|
204
|
-
- **Operations** -- uses `sidebar?: ComponentType` with route-aware dispatch; the items-prop pattern does not apply.
|
|
205
|
-
- **Monitoring, Settings** -- no subshell sidebar. No customization surface needed.
|
|
206
|
-
- **SEO** -- has sidebar components (`SEOSidebar`, `SEOSidebarTop`, `SEOSidebarMiddle`) but no page inventory in `@elevasis/ui`.
|
|
207
|
-
|
|
208
|
-
## Publish-Surface Discipline
|
|
209
|
-
|
|
210
|
-
All primitives above flow through published subpaths (`@elevasis/ui/features/<
|
|
211
|
-
|
|
212
|
-
The published barrel (`packages/ui/src/provider/published.ts`) remains headless -- no Mantine-dependent visual pieces leak into the external contract.
|
|
213
|
-
|
|
214
|
-
## Knowledge Browser Customization
|
|
215
|
-
|
|
216
|
-
The Knowledge Browser follows the same pattern described in this document. The three tiers map directly:
|
|
217
|
-
|
|
218
|
-
- **Tier 1** -- import `knowledgeManifest` from `@elevasis/ui/features/knowledge` and pass it to `
|
|
219
|
-
- **Tier 2** -- spread the manifest, override `sidebar` to a component that composes `KnowledgeSidebar` + `KnowledgeSidebarMiddle items={customItems}`. Same shape as the CRM example above.
|
|
220
|
-
- **Tier 3** -- skip the manifest, own the route, call `
|
|
221
|
-
|
|
222
|
-
One additional wiring step is required for Knowledge Browser that does not apply to CRM or Lead Gen: add `knowledgePlugin()` from `@elevasis/ui/vite-plugin-knowledge` to `vite.config.ts`. The plugin runs build-time MDX codegen so rendered body components are available at runtime.
|
|
223
|
-
|
|
224
|
-
See [recipes/customize-knowledge-browser.md](../recipes/customize-knowledge-browser.md) for the full walkthrough including code examples, the CSS import requirement, and the full exports reference.
|
|
225
|
-
|
|
226
|
-
Phase 1.5 adds two further extension surfaces documented in the same recipe file under the "Phase 1.5" section:
|
|
227
|
-
|
|
228
|
-
- **Extending the SegmentedControl** -- supply a `segments` prop to `KnowledgeSidebarMiddle` to add custom mount-axis tabs beyond the default five (By Feature, By Kind, By Owner, Governs, Governed By).
|
|
229
|
-
- **Replacing `DescribeNodeView`** -- override the `/knowledge/:nodeId` route component to swap the entire main-pane dispatcher, or use `createDescribeNodeDispatcher` from `@elevasis/ui/knowledge` to override only specific node-kind views while keeping the platform defaults for the rest.
|
|
230
|
-
|
|
231
|
-
## What Not to Do
|
|
232
|
-
|
|
233
|
-
- **Don't fork sidebar files into your app tree.** You own upstream drift forever.
|
|
234
|
-
- **Don't redefine `NavItem` locally.** Import it from `@elevasis/ui/layout` so future shape changes stay coherent.
|
|
235
|
-
- **Don't monkey-patch `
|
|
236
|
-
- **Don't add discriminated-union sidebar configuration to manifests.** The single pattern (assign a component to `manifest.sidebar`) is intentional.
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Within Organization OS, this doc covers the **Toolkit** layer: the primitives consumers use to customize shared shell systems by composition instead of fork. Consumers extend nav items, inject panels, or wrap pages by combining published primitives and assigning a custom component to `manifest.sidebar`. Copying source is physically possible but unsupported -- a fork owns upstream drift forever.
|
|
12
|
+
|
|
13
|
+
The core pattern: set `sidebar` on your manifest to a component that composes the system's published pieces. If the published pieces can't express what you need, the missing export is a bug. File an issue instead of forking.
|
|
14
|
+
|
|
15
|
+
Shipped in `@elevasis/ui >= 2.8.1`.
|
|
16
|
+
|
|
17
|
+
## The Override Pattern
|
|
18
|
+
|
|
19
|
+
Every `SystemModule.sidebar` is a `ComponentType`. Consumers customize by:
|
|
20
|
+
|
|
21
|
+
1. Importing the system's published sidebar wrapper and middle component.
|
|
22
|
+
2. Wrapping or replacing the middle with custom content.
|
|
23
|
+
3. Spreading the stock manifest and setting `sidebar` to their component.
|
|
24
|
+
4. Passing the customized manifest to `ElevasisSystemsProvider`.
|
|
25
|
+
|
|
26
|
+
No new manifest fields. No discriminated unions. No runtime machinery.
|
|
27
|
+
|
|
28
|
+
## Decision Tree
|
|
29
|
+
|
|
30
|
+
- **Adding or changing nav items?** -> Extend the exported item array and pass to `<*SidebarMiddle items={...}>`.
|
|
31
|
+
- **Structural changes (injecting panels, wrapping sections)?** -> Compose `SidebarTop`, `SidebarMiddle`, and exported panels directly in your own component.
|
|
32
|
+
- **Wrapping pages?** -> Import the system's page component and wrap with custom chrome in a route file.
|
|
33
|
+
- **None of these fits?** -> Missing export is the bug. File an issue.
|
|
34
|
+
|
|
35
|
+
## Exported Primitives
|
|
36
|
+
|
|
37
|
+
### Nav item arrays
|
|
38
|
+
|
|
39
|
+
Re-exported from each system sidebar barrel:
|
|
40
|
+
|
|
41
|
+
- `CRM_ITEMS` from `@elevasis/ui/features/crm`
|
|
42
|
+
- `LEAD_GEN_ITEMS` from `@elevasis/ui/features/lead-gen`
|
|
43
|
+
- `DELIVERY_PROJECT_ITEMS`, `DELIVERY_WORK_ITEMS`, `DELIVERY_COMMUNICATION_ITEMS` from `@elevasis/ui/features/delivery`
|
|
44
|
+
|
|
45
|
+
Shape is the shared `NavItem` type exported from `@elevasis/ui/layout`.
|
|
46
|
+
|
|
47
|
+
### Sidebar wrappers
|
|
48
|
+
|
|
49
|
+
Thin Top+Middle composers. Each accepts optional `children?: ReactNode` that replaces the default middle:
|
|
50
|
+
|
|
51
|
+
- `CrmSidebar`, `LeadGenSidebar`, `ProjectsSidebar`
|
|
52
|
+
|
|
53
|
+
### Middle components with optional item props
|
|
54
|
+
|
|
55
|
+
- `CrmSidebarMiddle` -- `items?: NavItem[]` (defaults to `CRM_ITEMS`)
|
|
56
|
+
- `LeadGenSidebarMiddle` -- `items?: NavItem[]` (defaults to `LEAD_GEN_ITEMS`)
|
|
57
|
+
- `ProjectsSidebarMiddle` -- `projectItems?`, `workItems?`, `communicationItems?` (each defaults to its respective exported array)
|
|
58
|
+
|
|
59
|
+
Delivery's three sections are preserved intentionally -- a real UX pattern consumers may want to extend with additional sections.
|
|
60
|
+
|
|
61
|
+
### Composable layout primitives
|
|
62
|
+
|
|
63
|
+
From `@elevasis/ui/layout`:
|
|
64
|
+
|
|
65
|
+
- `SubshellNavItem` -- individual nav link
|
|
66
|
+
- `SubshellNavList` -- router-context-aware list renderer (accepts `items: NavItem[]`, derives active state via `useRouterContext()`)
|
|
67
|
+
- `SubshellSidebarSection` -- section header with icon, label, optional top border
|
|
68
|
+
- `NavItem` -- shared item shape type
|
|
69
|
+
- `SubshellContainer` -- full-width, full-height flex wrapper that composes sidebar and content side by side
|
|
70
|
+
- `SubshellRightSideContainer` -- content area column (`flex: 1`, `minWidth: 0`) that prevents sidebar from squeezing content
|
|
71
|
+
- `SubshellContentContainer` -- scrollable content area with standard `md` padding and automatic topbar offset applied via `paddingTop`
|
|
72
|
+
- `SubshellLoader` -- loading placeholder centered in the subshell viewport; reads the active loader from `AppearanceContext`
|
|
73
|
+
|
|
74
|
+
`SystemShell` wires these together at `width={250}` as the default sidebar width. Consumers composing their own shell layout can pass a different `width` prop to `SubshellSidebar`.
|
|
75
|
+
|
|
76
|
+
### SubshellSidebar behavior
|
|
77
|
+
|
|
78
|
+
`SubshellSidebar` is more than a thin wrapper. Key behaviors verified in source:
|
|
79
|
+
|
|
80
|
+
- **Collapsible** -- controlled by `collapsible` prop (defaults to `true`) and `defaultOpen` prop (defaults to `true`). When collapsed, the sidebar animates to zero width and a small toggle button remains visible at the bottom-right edge.
|
|
81
|
+
- **Glass morphism** -- applies `color-mix(in srgb, var(--glass-background) 80%, transparent)` as background and `var(--glass-blur)` as `backdropFilter`, consistent with the theme token system.
|
|
82
|
+
- **Animated transitions** -- width and opacity animate on collapse/expand using `sidebarTransitionDuration` from the layout constants.
|
|
83
|
+
- **Width** -- no built-in default; the caller supplies `width`. `SystemShell` passes `250` and this is the canonical default for stock system sidebars.
|
|
84
|
+
|
|
85
|
+
From `@elevasis/ui/router/context`:
|
|
86
|
+
|
|
87
|
+
- `useRouterContext` -- access route state for custom active-state logic
|
|
88
|
+
|
|
89
|
+
### RouterAdapter interface
|
|
90
|
+
|
|
91
|
+
`RouterAdapter` is the interface that bridges any router implementation to the shared layout primitives. Defined in `packages/ui/src/router/context.ts`:
|
|
92
|
+
|
|
93
|
+
- `currentPath: string` -- current pathname, used by `SubshellNavList` to derive active state
|
|
94
|
+
- `currentSearch?: string` -- current search string (optional)
|
|
95
|
+
- `navigate: (to: string) => void` -- imperative navigation
|
|
96
|
+
- `Link: ElementType<LinkProps>` -- router-aware anchor component; `LinkProps` extends `AnchorHTMLAttributes\<HTMLAnchorElement>` with a required `to: string` field
|
|
97
|
+
|
|
98
|
+
Consumers calling `useRouterContext()` get back a `RouterAdapter`. Any component that needs to read `currentPath` or call `navigate` can use the hook directly rather than prop-drilling from a parent.
|
|
99
|
+
|
|
100
|
+
### TanStackRouterBridge
|
|
101
|
+
|
|
102
|
+
`TanStackRouterBridge` is the concrete `RouterAdapter` implementation for TanStack Router. Exported from `packages/ui/src/router/providers/TanStackRouterBridge.tsx` and available via `@elevasis/ui/router`.
|
|
103
|
+
|
|
104
|
+
It wraps `RouterProvider` and supplies the adapter by reading `useLocation` and `useRouter` from `@tanstack/react-router`. The adapter value is stabilized with `useMemo` to prevent unnecessary re-renders in downstream consumers. Place it inside TanStack's `RouterProvider`:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<TanStackRouterBridge>
|
|
108
|
+
<ElevasisSystemsProvider ...>
|
|
109
|
+
<SystemShell>...</SystemShell>
|
|
110
|
+
</ElevasisSystemsProvider>
|
|
111
|
+
</TanStackRouterBridge>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Consumers using a different router can implement `RouterAdapter` directly and pass it to `RouterProvider` instead of using this bridge.
|
|
115
|
+
|
|
116
|
+
### System panels (CRM)
|
|
117
|
+
|
|
118
|
+
- `MyTasksPanel`, `QuickCreateActions` -- exported from `@elevasis/ui/features/crm`, included by default in `CrmSidebarMiddle`; consumers composing their own middle can re-include them explicitly.
|
|
119
|
+
|
|
120
|
+
### System pages
|
|
121
|
+
|
|
122
|
+
Every page each system renders is exported from its system barrel, so consumers can wrap with custom chrome without forking:
|
|
123
|
+
|
|
124
|
+
- CRM: `DealsListPage`, `DealDetailPage`
|
|
125
|
+
- Lead-gen: `LeadGenOverviewPage`, `LeadGenListsPage`, `LeadGenListDetailPage`, `LeadGenCompaniesPage`, `LeadGenContactsPage`
|
|
126
|
+
- Delivery: `AllTasksPage`, `UpcomingMilestonesPage`, `ProjectsListPage`, `ProjectDetailPage`
|
|
127
|
+
- Operations, monitoring, settings -- full page inventories exported from their system barrels
|
|
128
|
+
|
|
129
|
+
## Consumer Patterns
|
|
130
|
+
|
|
131
|
+
### 1. Extend nav items (shortest path)
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import { CrmSidebar, CrmSidebarMiddle, CRM_ITEMS } from '@elevasis/ui/features/crm'
|
|
135
|
+
import { IconFileText } from '@tabler/icons-react'
|
|
136
|
+
|
|
137
|
+
const customItems = [
|
|
138
|
+
...CRM_ITEMS,
|
|
139
|
+
{ label: 'Reports', to: '/crm/reports', icon: IconFileText, exact: false },
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
const MyCrmSidebar = () => (
|
|
143
|
+
<CrmSidebar>
|
|
144
|
+
<CrmSidebarMiddle items={customItems} />
|
|
145
|
+
</CrmSidebar>
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
const customCrmManifest = { ...crmManifest, sidebar: MyCrmSidebar }
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 2. Inject a new delivery section (compose from primitives)
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import {
|
|
155
|
+
ProjectsSidebar,
|
|
156
|
+
DELIVERY_PROJECT_ITEMS,
|
|
157
|
+
DELIVERY_WORK_ITEMS,
|
|
158
|
+
DELIVERY_COMMUNICATION_ITEMS,
|
|
159
|
+
} from '@elevasis/ui/features/delivery'
|
|
160
|
+
import { SubshellSidebarSection, SubshellNavList } from '@elevasis/ui/layout'
|
|
161
|
+
import { Stack } from '@mantine/core'
|
|
162
|
+
import { IconChartBar, IconListCheck, IconMessageCircle } from '@tabler/icons-react'
|
|
163
|
+
|
|
164
|
+
const ANALYTICS_ITEMS = [
|
|
165
|
+
{ label: 'Dashboard', to: '/projects/analytics', icon: IconChartBar, exact: true },
|
|
166
|
+
]
|
|
167
|
+
|
|
168
|
+
const MyDeliveryMiddle = () => (
|
|
169
|
+
<Stack gap={0} style={{ flex: 1, overflowY: 'auto' }}>
|
|
170
|
+
<Stack gap={0} p="sm"><SubshellNavList items={DELIVERY_PROJECT_ITEMS} /></Stack>
|
|
171
|
+
<SubshellSidebarSection icon={IconListCheck} label="Work" withTopBorder />
|
|
172
|
+
<Stack gap={0} p="sm"><SubshellNavList items={DELIVERY_WORK_ITEMS} /></Stack>
|
|
173
|
+
<SubshellSidebarSection icon={IconMessageCircle} label="Communication" withTopBorder />
|
|
174
|
+
<Stack gap={0} p="sm"><SubshellNavList items={DELIVERY_COMMUNICATION_ITEMS} /></Stack>
|
|
175
|
+
<SubshellSidebarSection icon={IconChartBar} label="Analytics" withTopBorder />
|
|
176
|
+
<Stack gap={0} p="sm"><SubshellNavList items={ANALYTICS_ITEMS} /></Stack>
|
|
177
|
+
</Stack>
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
const MyDeliverySidebar = () => (
|
|
181
|
+
<ProjectsSidebar>
|
|
182
|
+
<MyDeliveryMiddle />
|
|
183
|
+
</ProjectsSidebar>
|
|
184
|
+
)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 3. Wrap a page with custom chrome
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
// in a route file
|
|
191
|
+
import { DealsListPage } from '@elevasis/ui/features/crm'
|
|
192
|
+
|
|
193
|
+
export default function CustomDealsRoute() {
|
|
194
|
+
return (
|
|
195
|
+
<MyChromeWrapper>
|
|
196
|
+
<DealsListPage />
|
|
197
|
+
</MyChromeWrapper>
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Operations & Unmodified Systems
|
|
203
|
+
|
|
204
|
+
- **Operations** -- uses `sidebar?: ComponentType` with route-aware dispatch; the items-prop pattern does not apply.
|
|
205
|
+
- **Monitoring, Settings** -- no subshell sidebar. No customization surface needed.
|
|
206
|
+
- **SEO** -- has sidebar components (`SEOSidebar`, `SEOSidebarTop`, `SEOSidebarMiddle`) but no page inventory in `@elevasis/ui`.
|
|
207
|
+
|
|
208
|
+
## Publish-Surface Discipline
|
|
209
|
+
|
|
210
|
+
All primitives above flow through published subpaths (`@elevasis/ui/features/<system>`, `@elevasis/ui/layout`, `@elevasis/ui/router/context`). Any new primitive must sync four files per `.claude/rules/ui-package.md`: `package.json` `exports`, `publishConfig.exports`, `rollup.dts.config.mjs`, and `tsup.config.ts`.
|
|
211
|
+
|
|
212
|
+
The published barrel (`packages/ui/src/provider/published.ts`) remains headless -- no Mantine-dependent visual pieces leak into the external contract.
|
|
213
|
+
|
|
214
|
+
## Knowledge Browser Customization
|
|
215
|
+
|
|
216
|
+
The Knowledge Browser follows the same pattern described in this document. The three tiers map directly:
|
|
217
|
+
|
|
218
|
+
- **Tier 1** -- import `knowledgeManifest` from `@elevasis/ui/features/knowledge` and pass it to `ElevasisSystemsProvider`. No further code required.
|
|
219
|
+
- **Tier 2** -- spread the manifest, override `sidebar` to a component that composes `KnowledgeSidebar` + `KnowledgeSidebarMiddle items={customItems}`. Same shape as the CRM example above.
|
|
220
|
+
- **Tier 3** -- skip the manifest, own the route, call `bySystem` / `byKind` / `byOwner` from `@elevasis/core/knowledge` directly.
|
|
221
|
+
|
|
222
|
+
One additional wiring step is required for Knowledge Browser that does not apply to CRM or Lead Gen: add `knowledgePlugin()` from `@elevasis/ui/vite-plugin-knowledge` to `vite.config.ts`. The plugin runs build-time MDX codegen so rendered body components are available at runtime.
|
|
223
|
+
|
|
224
|
+
See [recipes/customize-knowledge-browser.md](../recipes/customize-knowledge-browser.md) for the full walkthrough including code examples, the CSS import requirement, and the full exports reference.
|
|
225
|
+
|
|
226
|
+
Phase 1.5 adds two further extension surfaces documented in the same recipe file under the "Phase 1.5" section:
|
|
227
|
+
|
|
228
|
+
- **Extending the SegmentedControl** -- supply a `segments` prop to `KnowledgeSidebarMiddle` to add custom mount-axis tabs beyond the default five (By Feature, By Kind, By Owner, Governs, Governed By).
|
|
229
|
+
- **Replacing `DescribeNodeView`** -- override the `/knowledge/:nodeId` route component to swap the entire main-pane dispatcher, or use `createDescribeNodeDispatcher` from `@elevasis/ui/knowledge` to override only specific node-kind views while keeping the platform defaults for the rest.
|
|
230
|
+
|
|
231
|
+
## What Not to Do
|
|
232
|
+
|
|
233
|
+
- **Don't fork sidebar files into your app tree.** You own upstream drift forever.
|
|
234
|
+
- **Don't redefine `NavItem` locally.** Import it from `@elevasis/ui/layout` so future shape changes stay coherent.
|
|
235
|
+
- **Don't monkey-patch `SYSTEM_MANIFESTS`.** It's a published convenience constant; consumers build their own manifest array and pass it to the provider.
|
|
236
|
+
- **Don't add discriminated-union sidebar configuration to manifests.** The single pattern (assign a component to `manifest.sidebar`) is intentional.
|