@schandlergarcia/sf-web-components 1.9.27 → 1.9.28

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.
Files changed (2) hide show
  1. package/INSTALL.md +200 -0
  2. package/package.json +2 -1
package/INSTALL.md ADDED
@@ -0,0 +1,200 @@
1
+ # Installation Guide
2
+
3
+ Quick start guide for installing `@schandlergarcia/sf-web-components` in your Salesforce web application.
4
+
5
+ ## Prerequisites
6
+
7
+ - Salesforce web application created with `sf webapp generate --template react-ts`
8
+ - Node.js 18+ and npm installed
9
+ - Tailwind CSS v4 configured in your project
10
+
11
+ ## Installation Steps
12
+
13
+ ### 1. Navigate to Your Web App
14
+
15
+ ```bash
16
+ cd force-app/main/default/webapplications/YOUR_APP_NAME
17
+ ```
18
+
19
+ ### 2. Install the Package
20
+
21
+ ```bash
22
+ npm install @schandlergarcia/sf-web-components@latest
23
+ ```
24
+
25
+ The postinstall script runs automatically and:
26
+ - ✅ Copies 102+ component files to `src/components/library/`
27
+ - ✅ Installs page templates to `src/pages/`
28
+ - ✅ Installs workspace files to `src/components/workspace/`
29
+ - ✅ Copies AI assistant rules to project root `.a4drules/`
30
+ - ✅ Adds `reset:command-center` and `validate:dashboard` scripts
31
+ - ✅ Updates imports in existing files
32
+
33
+ ### 3. Install Type Definitions
34
+
35
+ ```bash
36
+ npm install --save-dev @types/d3 @types/topojson-client
37
+ ```
38
+
39
+ ### 4. Verify Installation
40
+
41
+ ```bash
42
+ npm run build
43
+ npm run dev
44
+ ```
45
+
46
+ Visit `http://localhost:5173` - you should see the CommandCenter with BlankDashboard.
47
+
48
+ ## What You Get
49
+
50
+ After installation:
51
+
52
+ ```
53
+ src/
54
+ ├── components/
55
+ │ ├── library/ # 102+ UI components
56
+ │ │ ├── ui/ # Buttons, inputs, cards, alerts
57
+ │ │ ├── cards/ # MetricCard, ChartCard, TableCard, etc.
58
+ │ │ ├── charts/ # D3Chart, GeoMap
59
+ │ │ ├── forms/ # FormRenderer, FormField
60
+ │ │ ├── filters/ # SearchFilter, SelectFilter
61
+ │ │ └── ...
62
+ │ └── workspace/
63
+ │ └── CommandCenter.tsx # Dashboard wrapper
64
+ ├── pages/
65
+ │ ├── Home.tsx # Renders CommandCenter
66
+ │ ├── BlankDashboard.tsx # Empty template
67
+ │ ├── Search.tsx # Search interface
68
+ │ └── NotFound.tsx # 404 page
69
+ ├── lib/
70
+ │ └── utils.ts # Utility functions
71
+ └── types/
72
+ └── conversation.ts # AgentforceConversationClient types
73
+
74
+ package.json # Added scripts:
75
+ # - reset:command-center
76
+ # - validate:dashboard
77
+
78
+ .a4drules/ # AI assistant rules (at project root)
79
+ ├── skills/
80
+ │ └── command-center-builder/
81
+ │ └── SKILL.md
82
+ └── features/
83
+ └── command-center-dashboard-rule.md
84
+ ```
85
+
86
+ ## Next Steps
87
+
88
+ ### Option 1: Build a Dashboard with AI
89
+
90
+ Have an AI assistant (Agentforce, Claude, etc.) build your dashboard:
91
+
92
+ ```
93
+ Build me a Sales Dashboard with KPI metrics, revenue chart, and top accounts table
94
+ ```
95
+
96
+ The AI will:
97
+ 1. Load the command-center-builder skill
98
+ 2. Create your dashboard file in `src/pages/`
99
+ 3. Wire it to CommandCenter
100
+ 4. Update Home.tsx
101
+ 5. Validate with `npm run validate:dashboard`
102
+
103
+ ### Option 2: Build Manually
104
+
105
+ ```bash
106
+ # 1. Create dashboard file
107
+ cat > src/pages/MyDashboard.tsx << 'EOF'
108
+ import { MetricCard, ChartCard } from '@/components/library';
109
+
110
+ export default function MyDashboard() {
111
+ return (
112
+ <div className="space-y-6 p-6">
113
+ <div className="grid grid-cols-3 gap-6">
114
+ <MetricCard title="Revenue" value="$1.2M" change="+12%" changeType="positive" />
115
+ <MetricCard title="Users" value={1284} change="+8%" changeType="positive" />
116
+ <MetricCard title="Conversion" value="3.2%" change="-0.5%" changeType="negative" />
117
+ </div>
118
+ </div>
119
+ );
120
+ }
121
+ EOF
122
+
123
+ # 2. Wire to CommandCenter
124
+ # Edit src/components/workspace/CommandCenter.tsx
125
+ # Change: import BlankDashboard from "../../pages/BlankDashboard";
126
+ # To: import MyDashboard from "../../pages/MyDashboard";
127
+ # Change: <BlankDashboard />
128
+ # To: <MyDashboard />
129
+
130
+ # 3. Update Home
131
+ # Home.tsx should already render CommandCenter
132
+
133
+ # 4. Validate
134
+ npm run validate:dashboard
135
+ ```
136
+
137
+ ## Useful Commands
138
+
139
+ ```bash
140
+ # Development
141
+ npm run dev # Start dev server
142
+ npm run build # Build for production
143
+
144
+ # Dashboard Management
145
+ npm run reset:command-center # Reset to blank state
146
+ npm run validate:dashboard # Check dashboard rules
147
+
148
+ # GraphQL (if using Salesforce data)
149
+ npm run graphql:schema # Fetch schema
150
+ npm run graphql:codegen # Generate types
151
+ ```
152
+
153
+ ## Troubleshooting
154
+
155
+ ### Postinstall didn't run
156
+
157
+ ```bash
158
+ node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs
159
+ ```
160
+
161
+ ### Build errors about missing D3 types
162
+
163
+ ```bash
164
+ npm install --save-dev @types/d3 @types/topojson-client
165
+ ```
166
+
167
+ ### Home page shows blank/wrong content
168
+
169
+ ```bash
170
+ # Re-run postinstall to restore templates
171
+ node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs
172
+ ```
173
+
174
+ ### AI assistant not following rules
175
+
176
+ Check that `.a4drules/` exists at your **project root** (not in the webapp directory):
177
+
178
+ ```bash
179
+ # From webapp directory
180
+ ls ../../../../../.a4drules/skills/command-center-builder/SKILL.md
181
+ ```
182
+
183
+ If missing, re-run postinstall:
184
+
185
+ ```bash
186
+ node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs
187
+ ```
188
+
189
+ ## Support
190
+
191
+ - **Documentation:** [README.md](./README.md)
192
+ - **Issues:** [GitHub Issues](https://github.com/schandlergarcia/sf-web-components/issues)
193
+ - **Package:** [npm](https://www.npmjs.com/package/@schandlergarcia/sf-web-components)
194
+
195
+ ## Next Steps
196
+
197
+ - Read the [Component Documentation](./README.md#using-the-dashboard-framework)
198
+ - Check [AI Assistant Rules](./.a4drules/skills/command-center-builder/SKILL.md) (after install)
199
+ - Browse example pages in `src/pages/`
200
+ - Explore component library in `src/components/library/`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.27",
3
+ "version": "1.9.28",
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",
@@ -32,6 +32,7 @@
32
32
  "src/lib",
33
33
  "src/types",
34
34
  "README.md",
35
+ "INSTALL.md",
35
36
  ".a4drules"
36
37
  ],
37
38
  "scripts": {