@schandlergarcia/sf-web-components 1.9.60 → 1.9.62
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.
|
@@ -17,14 +17,16 @@ These rules apply ONLY when building the Engine Travel Command Center dashboard
|
|
|
17
17
|
The Engine dashboard uses a **strict 4-phase build process.** You MUST complete each phase fully before starting the next:
|
|
18
18
|
|
|
19
19
|
1. **Phase 1: Layout** — Complete layout structure (header, map, glass KPI overlays, flight strip) + data panel placeholders ONLY
|
|
20
|
-
2. **Phase 2: Components + Sample Data** — Replace data panel placeholders with real library components + sample data
|
|
20
|
+
2. **Phase 2: Components + Sample Data** — Replace data panel placeholders with real library components + sample data AND add map data
|
|
21
21
|
- **CRITICAL:** Sample data file already exists at `src/data/engine-sample-data.js`
|
|
22
22
|
- **DO NOT create a new data file** — just import from the existing one
|
|
23
|
-
- Import dashboard-ready derivatives (MAP_MARKERS, TRAVELER_CARDS, ESCALATION_CARDS,
|
|
23
|
+
- Import dashboard-ready derivatives (MAP_MARKERS, MAP_ARCS, MAP_OVERLAYS, TRAVELER_CARDS, ESCALATION_CARDS, MONTHLY_SPEND)
|
|
24
24
|
- DO NOT define sample data inline in the dashboard — causes file truncation
|
|
25
|
-
- **FOLLOW THE EXACT CODE EXAMPLES in PRD Section
|
|
26
|
-
-
|
|
27
|
-
-
|
|
25
|
+
- **FOLLOW THE EXACT CODE EXAMPLES in PRD Section 7 (map) and Section 8c/8d (panels)** - copy the code blocks as shown
|
|
26
|
+
- **Map data:** Add markers, arcs, overlays to GeoMap to show where travelers are (see PRD Section 7)
|
|
27
|
+
- **Panel titles:** "Disruptions", "Active Travelers", "Escalations", "Travel Spend"
|
|
28
|
+
- **Escalations panel:** ActivityCard must be wrapped in BaseCard for visible card styling
|
|
29
|
+
- **Chart:** Line chart showing monthly spend trend (see PRD Section 8d code block for exact options)
|
|
28
30
|
- **DO NOT run validation or dev server** — phase is complete after wiring files
|
|
29
31
|
3. **Phase 3: Real Data** — Connect to Salesforce, keep UI identical to Phase 2
|
|
30
32
|
4. **Phase 4: Agent** — Add Eva ChatBar integration
|
|
@@ -85,7 +85,7 @@ export default function EngineDashboard() {
|
|
|
85
85
|
</div>
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
|
-
{/* Row 2: Escalations (1/2) +
|
|
88
|
+
{/* Row 2: Escalations (1/2) + Monthly Spend Chart (1/2) */}
|
|
89
89
|
<div className="grid grid-cols-1 items-start gap-4 lg:grid-cols-2">
|
|
90
90
|
<BaseCard>
|
|
91
91
|
<div className="flex h-48 items-center justify-center text-slate-400">
|
|
@@ -94,7 +94,7 @@ export default function EngineDashboard() {
|
|
|
94
94
|
</BaseCard>
|
|
95
95
|
<BaseCard>
|
|
96
96
|
<div className="flex h-48 items-center justify-center text-slate-400">
|
|
97
|
-
|
|
97
|
+
Travel Spend Panel
|
|
98
98
|
</div>
|
|
99
99
|
</BaseCard>
|
|
100
100
|
</div>
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.62] - 2026-04-01
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **CLAUDE.md** - Comprehensive guidance for working with the package in Claude Code
|
|
12
|
+
- Package overview and purpose
|
|
13
|
+
- Critical explanation of two UI contexts (outer app vs command center)
|
|
14
|
+
- Architecture and directory structure
|
|
15
|
+
- Key conventions (component naming, theme hook, data hook)
|
|
16
|
+
- Development workflow and pre-publish checks
|
|
17
|
+
- Postinstall and reset script behavior
|
|
18
|
+
- Important files guide
|
|
19
|
+
- Common issues and solutions
|
|
20
|
+
- Testing checklist
|
|
21
|
+
- Version history summary
|
|
22
|
+
- Now included in published package (added to files array)
|
|
23
|
+
|
|
24
|
+
This file provides essential context when opening sf-web-components as a standalone Claude Code project, explaining the architecture, conventions, and common pitfalls (like UIButton vs Button confusion).
|
|
25
|
+
|
|
26
|
+
## [1.9.61] - 2026-04-01
|
|
27
|
+
|
|
28
|
+
### Updated
|
|
29
|
+
- **Synced latest .a4drules and PRD from reactapp4** - Pulled latest documentation updates
|
|
30
|
+
- All `.a4drules/features/` files updated
|
|
31
|
+
- All `.a4drules/skills/` files updated
|
|
32
|
+
- All `.a4drules/troubleshooting/` files updated
|
|
33
|
+
- Root `.a4drules/*.md` files updated
|
|
34
|
+
- `data/engine-command-center-prd.md` updated to latest version
|
|
35
|
+
|
|
8
36
|
## [1.9.60] - 2026-04-01
|
|
9
37
|
|
|
10
38
|
### Updated
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code when working with the sf-web-components package.
|
|
4
|
+
|
|
5
|
+
## Package Overview
|
|
6
|
+
|
|
7
|
+
**@schandlergarcia/sf-web-components** is an npm package that provides:
|
|
8
|
+
|
|
9
|
+
1. **React component library** - Pre-built UI components for Salesforce Web Applications
|
|
10
|
+
2. **Templates** - Page templates (Home, Search, NotFound, BlankDashboard) and config templates (routes.tsx, vite.config.ts, dataStrategy.ts)
|
|
11
|
+
3. **Automation** - Postinstall script that sets up consuming projects automatically
|
|
12
|
+
4. **Documentation** - `.a4drules` skills and features for AI-assisted development
|
|
13
|
+
5. **Sample data** - Engine Travel sample data and pre-built GraphQL schema
|
|
14
|
+
6. **Scripts** - Reset scripts, validation scripts, schema generation
|
|
15
|
+
|
|
16
|
+
**Primary use case:** Building Salesforce Web Applications with React, specifically for:
|
|
17
|
+
- Outer app pages (search, navigation) using shadcn/ui + Tailwind
|
|
18
|
+
- Command Center dashboards using custom library components + HeroUI
|
|
19
|
+
|
|
20
|
+
## Architecture
|
|
21
|
+
|
|
22
|
+
### Two UI Contexts (CRITICAL)
|
|
23
|
+
|
|
24
|
+
The package supports **two distinct UI contexts** that must NOT be mixed:
|
|
25
|
+
|
|
26
|
+
#### 1. Outer App Context
|
|
27
|
+
- **Files:** `src/pages/Home.tsx`, `src/pages/Search.tsx`, `src/pages/NotFound.tsx` (installed from templates)
|
|
28
|
+
- **Rendered in:** AppLayout wrapper (standard React Router routes)
|
|
29
|
+
- **Components:** shadcn/ui from `@/components/ui/`
|
|
30
|
+
- `Button` from `@/components/ui/button`
|
|
31
|
+
- `Input` from `@/components/ui/input`
|
|
32
|
+
- etc.
|
|
33
|
+
- **Icons:** Lucide React (`lucide-react`)
|
|
34
|
+
- **Styling:** Neutral shadcn theme (slate colors, no Engine branding)
|
|
35
|
+
- **File type:** `.tsx`
|
|
36
|
+
|
|
37
|
+
#### 2. Command Center Context
|
|
38
|
+
- **Files:** Dashboard pages in `src/pages/` (e.g., BlankDashboard, EngineDashboard)
|
|
39
|
+
- **Rendered in:** CommandCenter wrapper with `.heroui-scope` class
|
|
40
|
+
- **Components:** Library components from `@/components/library`
|
|
41
|
+
- `UIButton` from `@/components/library/ui/UIButton`
|
|
42
|
+
- `UIInput` from `@/components/library/ui/UIInput`
|
|
43
|
+
- `MetricCard`, `ChartCard`, `ListCard`, `TableCard`, etc.
|
|
44
|
+
- **Icons:** Heroicons (`@heroicons/react`)
|
|
45
|
+
- **Styling:** Engine brand colors (teal #5BC8C8, coral, orange) inside `.heroui-scope`
|
|
46
|
+
- **File type:** `.jsx` or `.tsx`
|
|
47
|
+
|
|
48
|
+
**Common mistake:** Using UIButton/UIInput in outer app pages or shadcn Button/Input in command center dashboards. Check `.a4drules/features/pre-code-checklist.md` for validation rules.
|
|
49
|
+
|
|
50
|
+
### Package Structure
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
sf-web-components/
|
|
54
|
+
├── src/
|
|
55
|
+
│ ├── components/
|
|
56
|
+
│ │ ├── library/ # Command center components (MetricCard, ChartCard, etc.)
|
|
57
|
+
│ │ │ ├── cards/
|
|
58
|
+
│ │ │ ├── charts/
|
|
59
|
+
│ │ │ ├── ui/ # UIButton, UIInput, etc.
|
|
60
|
+
│ │ │ ├── theme/ # AppThemeProvider, useThemeMode
|
|
61
|
+
│ │ │ ├── data/ # useDataSource, DataModeProvider
|
|
62
|
+
│ │ │ └── index.jsx # Barrel export
|
|
63
|
+
│ │ └── workspace/ # CommandRegistry, ComponentRegistry
|
|
64
|
+
│ ├── templates/
|
|
65
|
+
│ │ ├── pages/ # Home.tsx.template, Search.tsx.template, etc.
|
|
66
|
+
│ │ ├── config/ # routes.tsx.template, vite.config.ts.template
|
|
67
|
+
│ │ ├── lib/ # dataStrategy.ts.template
|
|
68
|
+
│ │ └── workspace/ # CommandCenter.tsx.template
|
|
69
|
+
│ ├── lib/ # Utilities (utils.ts)
|
|
70
|
+
│ └── styles/ # global.css with Engine brand tokens
|
|
71
|
+
├── scripts/
|
|
72
|
+
│ ├── postinstall.mjs # Runs after npm install in consuming projects
|
|
73
|
+
│ ├── reset-command-center.sh
|
|
74
|
+
│ ├── validate-dashboard.sh
|
|
75
|
+
│ └── verify-consistency.sh
|
|
76
|
+
├── data/
|
|
77
|
+
│ ├── engine-sample-data.js
|
|
78
|
+
│ ├── schema.graphql
|
|
79
|
+
│ └── engine-command-center-prd.md
|
|
80
|
+
└── .a4drules/
|
|
81
|
+
├── features/ # Dashboard rules, engine-dashboard-rule, etc.
|
|
82
|
+
├── skills/ # component-library, command-center-builder, etc.
|
|
83
|
+
├── troubleshooting/ # Common issues and solutions
|
|
84
|
+
├── validation-requirements.md
|
|
85
|
+
├── webapp-data.md
|
|
86
|
+
└── webapp-ui.md
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Key Conventions
|
|
90
|
+
|
|
91
|
+
### Component Naming
|
|
92
|
+
- **Library components** (command center): `UIButton`, `UIInput`, `MetricCard`, `ChartCard`
|
|
93
|
+
- **shadcn components** (outer app): `Button`, `Input`, `Card` from `@/components/ui/`
|
|
94
|
+
|
|
95
|
+
### Theme Hook
|
|
96
|
+
- **Correct:** `import { useThemeMode } from "@/components/library/theme/AppThemeProvider"`
|
|
97
|
+
- **Wrong:** `import useAppTheme from ...` (does not exist)
|
|
98
|
+
- **Usage:** `const { mode, toggle } = useThemeMode();`
|
|
99
|
+
|
|
100
|
+
### Data Hook
|
|
101
|
+
- **Pattern:** Use `useDataSource` for instant loading with sample data cache
|
|
102
|
+
- **Example:**
|
|
103
|
+
```javascript
|
|
104
|
+
import useDataSource from "@/components/library/data/useDataSource";
|
|
105
|
+
|
|
106
|
+
const travelers = useDataSource({
|
|
107
|
+
sample: SAMPLE_TRAVELERS,
|
|
108
|
+
live: liveTravelers ?? []
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
- **Configuration:** `src/lib/dataStrategy.ts` controls `ENABLE_SAMPLE_DATA_CACHE`
|
|
112
|
+
|
|
113
|
+
### File Extensions
|
|
114
|
+
- **Outer app pages:** `.tsx`
|
|
115
|
+
- **Command center dashboards:** `.jsx` or `.tsx` (`.jsx` preferred per dashboard rules)
|
|
116
|
+
|
|
117
|
+
## Working with the Package
|
|
118
|
+
|
|
119
|
+
### Development Workflow
|
|
120
|
+
|
|
121
|
+
1. **Make changes** to components, templates, or documentation
|
|
122
|
+
2. **Update version:** `npm version patch` (or minor/major)
|
|
123
|
+
3. **Update CHANGELOG.md** with:
|
|
124
|
+
- Version number
|
|
125
|
+
- Date
|
|
126
|
+
- What changed and why
|
|
127
|
+
- Context for the change
|
|
128
|
+
4. **Build:** `npm run build`
|
|
129
|
+
5. **Verify:** `npm run verify` (checks consistency)
|
|
130
|
+
6. **Publish:** `npm publish` (runs pre-publish checks automatically)
|
|
131
|
+
|
|
132
|
+
### Pre-Publish Checks
|
|
133
|
+
|
|
134
|
+
The `scripts/pre-publish-check.sh` runs automatically before publishing and verifies:
|
|
135
|
+
1. Consistency between code, docs, and templates
|
|
136
|
+
2. CHANGELOG.md has entry for current version
|
|
137
|
+
3. Component naming conventions (UIButton.tsx exists, Button.tsx doesn't in library/ui/)
|
|
138
|
+
4. Build succeeds
|
|
139
|
+
5. Documentation files exist
|
|
140
|
+
6. package.json files array includes necessary directories
|
|
141
|
+
|
|
142
|
+
### Postinstall Behavior
|
|
143
|
+
|
|
144
|
+
When a project installs this package, `scripts/postinstall.mjs` automatically:
|
|
145
|
+
|
|
146
|
+
1. **Copies component library** to `src/components/library/`
|
|
147
|
+
2. **Copies lib utilities** to `src/lib/`
|
|
148
|
+
3. **Copies types** to `src/types/`
|
|
149
|
+
4. **Copies workspace files** to `src/components/workspace/`
|
|
150
|
+
5. **Installs page templates** to `src/pages/` (Home.tsx, Search.tsx, NotFound.tsx, BlankDashboard.tsx)
|
|
151
|
+
6. **Updates imports** in existing files (changes package imports to local `@/components/library` imports)
|
|
152
|
+
7. **Copies sample data** to `src/data/engine-sample-data.js`
|
|
153
|
+
8. **Copies schema** to root `schema.graphql`
|
|
154
|
+
9. **Copies PRD** to root `engine-command-center-prd.md`
|
|
155
|
+
10. **Installs config files** (routes.tsx, vite.config.ts, dataStrategy.ts) if they don't exist
|
|
156
|
+
11. **Adds npm scripts** to package.json (reset:command-center, validate:dashboard, graphql:schema:sample)
|
|
157
|
+
12. **Copies .a4drules** to project root for AI assistant discoverability
|
|
158
|
+
|
|
159
|
+
**Important:** Templates are **always overwritten** to ensure latest versions, except for config files (vite.config.ts, dataStrategy.ts) which only install if missing.
|
|
160
|
+
|
|
161
|
+
### Reset Script
|
|
162
|
+
|
|
163
|
+
The `scripts/reset-command-center.sh` provides a clean baseline for projects:
|
|
164
|
+
|
|
165
|
+
- Removes custom dashboard pages
|
|
166
|
+
- Restores BlankDashboard.tsx
|
|
167
|
+
- Updates CommandCenter.tsx to render BlankDashboard
|
|
168
|
+
- Restores Home.tsx with Account Search page
|
|
169
|
+
- Restores Search.tsx placeholder
|
|
170
|
+
- Updates routes.tsx to include Home, /accounts, and /accounts/:recordId
|
|
171
|
+
- Updates appLayout.tsx with nav bar
|
|
172
|
+
- Clears Vite cache
|
|
173
|
+
- Restores Engine-branded global.css
|
|
174
|
+
- Restores sample data and schema
|
|
175
|
+
|
|
176
|
+
## Important Files
|
|
177
|
+
|
|
178
|
+
### CHANGELOG.md
|
|
179
|
+
Complete history of all changes. ALWAYS update when making changes. Include:
|
|
180
|
+
- What changed
|
|
181
|
+
- Why it changed
|
|
182
|
+
- Context for the change
|
|
183
|
+
- Impact on consuming projects
|
|
184
|
+
|
|
185
|
+
### .a4drules/
|
|
186
|
+
AI assistant documentation. Key files:
|
|
187
|
+
- `features/engine-dashboard-rule.md` - How to build Engine Travel Command Center
|
|
188
|
+
- `features/command-center-dashboard-rule.md` - Dashboard development rules
|
|
189
|
+
- `features/pre-code-checklist.md` - Pre-implementation validation
|
|
190
|
+
- `skills/component-library/` - Component API reference
|
|
191
|
+
- `validation-requirements.md` - Validation rules
|
|
192
|
+
- `webapp-data.md` - Data access patterns (GraphQL, REST, SDK usage)
|
|
193
|
+
- `webapp-ui.md` - UI platform rules
|
|
194
|
+
|
|
195
|
+
### data/engine-command-center-prd.md
|
|
196
|
+
Product Requirements Document for Engine Travel Command Center. Defines:
|
|
197
|
+
- Product overview and users
|
|
198
|
+
- Brand tokens (Engine teal #5BC8C8, etc.)
|
|
199
|
+
- Layout structure (visualization-hero pattern)
|
|
200
|
+
- Component sections and data model
|
|
201
|
+
- Phase-by-phase build instructions
|
|
202
|
+
|
|
203
|
+
### src/components/library/theme/AppThemeProvider.jsx
|
|
204
|
+
Theme provider with dark mode toggle. Exports:
|
|
205
|
+
- **Default:** `AppThemeProvider` component
|
|
206
|
+
- **Named:** `useThemeMode` hook
|
|
207
|
+
|
|
208
|
+
### src/components/library/data/useDataSource.js
|
|
209
|
+
Hook for sample/live data switching via `ENABLE_SAMPLE_DATA_CACHE` flag.
|
|
210
|
+
|
|
211
|
+
## Common Issues
|
|
212
|
+
|
|
213
|
+
### TypeScript Errors
|
|
214
|
+
If you see TypeScript errors about missing exports:
|
|
215
|
+
1. Check the actual file to see what's exported
|
|
216
|
+
2. Don't trust TypeScript's suggestions blindly (it may suggest wrong import patterns)
|
|
217
|
+
3. Refer to `.a4drules/skills/component-library/SKILL.md` for correct import patterns
|
|
218
|
+
|
|
219
|
+
### Component Confusion
|
|
220
|
+
If agents mix up UIButton (library) vs Button (shadcn):
|
|
221
|
+
1. Check `.a4drules/features/pre-code-checklist.md` for validation rules
|
|
222
|
+
2. Outer app pages should NEVER import from `@/components/library`
|
|
223
|
+
3. Command center dashboards should NEVER import from `@/components/ui/`
|
|
224
|
+
|
|
225
|
+
### Routes Not Working
|
|
226
|
+
If routes show 404:
|
|
227
|
+
1. Check routes.tsx imports match installed file locations
|
|
228
|
+
2. Home should point to `./pages/Home` (not `__examples__`)
|
|
229
|
+
3. Accounts should point to `./features/object-search/__examples__/pages/AccountSearch`
|
|
230
|
+
4. Make sure `handle.showNavBar: true` is set for pages that need nav
|
|
231
|
+
|
|
232
|
+
### Missing Nav Bar
|
|
233
|
+
Routes need `handle: { showInNavigation: true, showNavBar: true }` for nav bar to appear.
|
|
234
|
+
|
|
235
|
+
## Testing
|
|
236
|
+
|
|
237
|
+
Before publishing:
|
|
238
|
+
1. Test in a real project (reactapp4, vibes3, etc.)
|
|
239
|
+
2. Run `npm install @schandlergarcia/sf-web-components@latest`
|
|
240
|
+
3. Verify postinstall behavior
|
|
241
|
+
4. Check templates are correct
|
|
242
|
+
5. Verify .a4drules are accessible
|
|
243
|
+
6. Test reset script: `npm run reset:command-center`
|
|
244
|
+
7. Test validation: `npm run validate:dashboard`
|
|
245
|
+
|
|
246
|
+
## Version History
|
|
247
|
+
|
|
248
|
+
See CHANGELOG.md for complete history. Recent major changes:
|
|
249
|
+
- v1.9.55 - Fixed UIButton/Button confusion in templates
|
|
250
|
+
- v1.9.56 - Fixed reset script 404 errors
|
|
251
|
+
- v1.9.57 - Restored "Browse All Accounts" button
|
|
252
|
+
- v1.9.58 - Fixed reset routes pointing to wrong Home file
|
|
253
|
+
- v1.9.59 - Restored navigation bar (showNavBar flag)
|
|
254
|
+
- v1.9.60-61 - Synced .a4drules and PRD from reactapp4
|
|
255
|
+
|
|
256
|
+
## Current Version
|
|
257
|
+
|
|
258
|
+
Run `node -p "require('./package.json').version"` to get current version.
|
|
@@ -99,8 +99,8 @@ This dashboard uses the **visualization-hero** layout. The live flight map is th
|
|
|
99
99
|
│ └────────────────┘ └────────────────────────────┘ │ ↕
|
|
100
100
|
│ │ ↕
|
|
101
101
|
│ ┌─── 1/2 ───────┐ ┌─── 1/2 ────────────────────┐ │ ↕
|
|
102
|
-
│ │ Escalations │ │
|
|
103
|
-
│ │ (ActivityCard) │ │ (ChartCard + D3Chart)
|
|
102
|
+
│ │ Escalations │ │ Travel Spend (Monthly) │ │ ↕
|
|
103
|
+
│ │ (ActivityCard) │ │ (ChartCard + D3Chart line) │ │ ↕
|
|
104
104
|
│ └────────────────┘ └────────────────────────────┘ │ ↕
|
|
105
105
|
└─────────────────────────────────────────────────────────────┘
|
|
106
106
|
```
|
|
@@ -215,20 +215,26 @@ The `ChatBar` replaces any FAB or sliding panel. It opens inline as a command pa
|
|
|
215
215
|
|
|
216
216
|
**Component:** `GeoMap` (from `@/components/library`)
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
**Phase 1:** Render GeoMap with NO data props (no markers/arcs/overlays)
|
|
219
|
+
**Phase 2:** Add markers, arcs, and overlays from sample data to show where travelers are
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { MAP_MARKERS, MAP_ARCS, MAP_OVERLAYS } from "@/data/engine-sample-data";
|
|
223
|
+
|
|
224
|
+
// Phase 2 - with map data
|
|
219
225
|
<GeoMap
|
|
220
226
|
width={960}
|
|
221
227
|
height={520}
|
|
222
228
|
theme={mode === "dark" ? "dark" : "light"}
|
|
223
|
-
markers={
|
|
224
|
-
arcs={
|
|
225
|
-
overlays={
|
|
229
|
+
markers={useDataSource({ sample: MAP_MARKERS, live: [] })}
|
|
230
|
+
arcs={useDataSource({ sample: MAP_ARCS, live: [] })}
|
|
231
|
+
overlays={useDataSource({ sample: MAP_OVERLAYS, live: [] })}
|
|
226
232
|
zoomable
|
|
227
233
|
className="h-full w-full"
|
|
228
234
|
/>
|
|
229
235
|
```
|
|
230
236
|
|
|
231
|
-
**Markers:** One per city (origin and destination). Each marker: `{ id, lon, lat, label, active: true }`.
|
|
237
|
+
**Markers:** One per city (origin and destination). Each marker: `{ id, lon, lat, label, active: true }`. Shows where travelers are located.
|
|
232
238
|
|
|
233
239
|
**Arcs:** One per active flight route. Each arc: `{ id, from: [lon, lat], to: [lon, lat], progress: 0–1 }`. Set `danger: true` on disrupted routes (delayed 60+ min or grounded). The `progress` value places an animated pulsing dot showing the flight's current position along the great circle arc.
|
|
234
240
|
|
|
@@ -273,17 +279,19 @@ Each traveler row:
|
|
|
273
279
|
|
|
274
280
|
### 8c. Escalations (1/2 width)
|
|
275
281
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
**Data source:** Import `ESCALATION_CARDS` from sample data (alias of `EVA_ACTIONS`)
|
|
282
|
+
**CRITICAL: ActivityCard has no card styling by default. Must wrap in BaseCard for visible card background.**
|
|
279
283
|
|
|
280
284
|
```tsx
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
<BaseCard>
|
|
286
|
+
<ActivityCard
|
|
287
|
+
title="Escalations"
|
|
288
|
+
actions={useDataSource({ sample: ESCALATION_CARDS, live: [] })}
|
|
289
|
+
/>
|
|
290
|
+
</BaseCard>
|
|
285
291
|
```
|
|
286
292
|
|
|
293
|
+
**Data source:** Import `ESCALATION_CARDS` from sample data (alias of `EVA_ACTIONS`)
|
|
294
|
+
|
|
287
295
|
Each escalation has:
|
|
288
296
|
- Title (issue description)
|
|
289
297
|
- Subtitle (details + context)
|
|
@@ -295,28 +303,32 @@ Examples from sample data:
|
|
|
295
303
|
- "Monitoring weather delay for Elena Rodriguez" - subtitle: "AF 99 · CDG arrival delayed 45 min · No action yet" (status: working)
|
|
296
304
|
- "Rebooked cancelled flight for Sarah Chen" - subtitle: "LH 431 → LH 433 · Same fare class" (status: complete)
|
|
297
305
|
|
|
298
|
-
### 8d.
|
|
306
|
+
### 8d. Monthly Spend Trend (1/2 width)
|
|
299
307
|
|
|
300
|
-
`ChartCard` wrapping a `D3Chart` with `D3ChartTemplates.
|
|
308
|
+
`ChartCard` wrapping a `D3Chart` with `D3ChartTemplates.lineChart`.
|
|
301
309
|
|
|
302
310
|
**CRITICAL: Use this exact code structure:**
|
|
303
311
|
|
|
304
312
|
```tsx
|
|
305
313
|
<ChartCard
|
|
306
|
-
title="
|
|
307
|
-
subtitle="
|
|
314
|
+
title="Travel Spend"
|
|
315
|
+
subtitle="Monthly trend (6 months)"
|
|
308
316
|
chart={
|
|
309
317
|
<D3Chart
|
|
310
|
-
data={
|
|
311
|
-
renderChart={D3ChartTemplates.
|
|
318
|
+
data={useDataSource({ sample: MONTHLY_SPEND, live: [] })}
|
|
319
|
+
renderChart={D3ChartTemplates.lineChart}
|
|
312
320
|
options={{
|
|
313
|
-
xKey: "
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
321
|
+
xKey: "month",
|
|
322
|
+
yKey: "amount",
|
|
323
|
+
color: "#5BC8C8",
|
|
324
|
+
lineWidth: 3,
|
|
325
|
+
showDots: true,
|
|
326
|
+
dotRadius: 4,
|
|
327
|
+
showArea: true,
|
|
328
|
+
areaOpacity: 0.1,
|
|
329
|
+
margin: { top: 20, right: 20, bottom: 40, left: 60 },
|
|
319
330
|
showGrid: true,
|
|
331
|
+
formatY: (d) => `$${(d / 1000).toFixed(0)}K`,
|
|
320
332
|
}}
|
|
321
333
|
responsive
|
|
322
334
|
height={320}
|
|
@@ -325,16 +337,21 @@ Examples from sample data:
|
|
|
325
337
|
/>
|
|
326
338
|
```
|
|
327
339
|
|
|
340
|
+
**Data source:** Import `MONTHLY_SPEND` from sample data
|
|
341
|
+
|
|
328
342
|
**Requirements:**
|
|
329
|
-
- X-axis:
|
|
330
|
-
- Y-axis:
|
|
331
|
-
- Height: 320px
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
343
|
+
- X-axis: month names (Oct through Mar)
|
|
344
|
+
- Y-axis: spend amount formatted as $XXK
|
|
345
|
+
- Height: 320px
|
|
346
|
+
- Line color: Engine teal (#5BC8C8)
|
|
347
|
+
- Line width: 3px
|
|
348
|
+
- Show dots at data points (radius: 4)
|
|
349
|
+
- Show filled area under line (opacity: 0.1)
|
|
335
350
|
- responsive={true}
|
|
336
351
|
|
|
337
|
-
**
|
|
352
|
+
**Why this chart:** Shows spend trends over time so travel managers can spot anomalies, budget overruns, or seasonal patterns. Actionable data for financial planning.
|
|
353
|
+
|
|
354
|
+
**That's it!** Only 4 panels total: Disruptions, Active Travelers, Escalations, and Monthly Spend Trend.
|
|
338
355
|
|
|
339
356
|
---
|
|
340
357
|
|
|
@@ -406,9 +423,7 @@ Mandatory on every element. The dashboard must work in both light and dark mode
|
|
|
406
423
|
|
|
407
424
|
**Escalation** — `id`, `title`, `subtitle`, `status` (complete | working | pending), `timestamp`
|
|
408
425
|
|
|
409
|
-
**Monthly Spend** — `{
|
|
410
|
-
|
|
411
|
-
**Destination Chart** — `{ x: city, travelers: count }` array
|
|
426
|
+
**Monthly Spend** — `{ month: string, amount: number }` array. Six months of travel spend data (Oct through Mar). Amounts in dollars, typically $98K-$156K range.
|
|
412
427
|
|
|
413
428
|
**Sample data:** 8–10 travelers, 8 flights, 4 disruptions, 8 bookings, 5 policy items, 8 escalations, 6 months of spend. All deterministic (no `Math.random()`). Include realistic names, routes, dollar amounts, and a mix of all status types.
|
|
414
429
|
|
|
@@ -432,7 +447,9 @@ Mandatory on every element. The dashboard must work in both light and dark mode
|
|
|
432
447
|
|
|
433
448
|
> **Skills:** command-center-builder, command-center-project, component-library
|
|
434
449
|
>
|
|
435
|
-
> Replace placeholders with library components. Import data from the pre-existing `src/data/engine-sample-data.js` file. Build the 4 data panels from section 8: Disruptions, Active Travelers, Escalations, and
|
|
450
|
+
> Replace placeholders with library components. Import data from the pre-existing `src/data/engine-sample-data.js` file. Build the 4 data panels from section 8: Disruptions, Active Travelers, Escalations, and Monthly Spend Trend chart. Follow the EXACT code examples in section 8 - copy the code blocks exactly as shown.
|
|
451
|
+
>
|
|
452
|
+
> **Add map data:** Import MAP_MARKERS, MAP_ARCS, MAP_OVERLAYS from sample data and pass to GeoMap component (see Section 7). The map should show where travelers are with markers for cities, arcs for flight routes, and overlays for disruptions.
|
|
436
453
|
|
|
437
454
|
---
|
|
438
455
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schandlergarcia/sf-web-components",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.62",
|
|
4
4
|
"description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"CONTRIBUTING.md",
|
|
39
39
|
"ARCHITECTURE.md",
|
|
40
40
|
"QUICK-REFERENCE.md",
|
|
41
|
+
"CLAUDE.md",
|
|
41
42
|
".a4drules"
|
|
42
43
|
],
|
|
43
44
|
"scripts": {
|