@schandlergarcia/sf-web-components 1.9.17 → 1.9.19

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.
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  paths:
3
- - "**/components/pages/*.jsx"
4
- - "**/components/pages/*.tsx"
5
- - "**/components/pages/CommandCenter.tsx"
3
+ - "**/pages/*.jsx"
4
+ - "**/pages/*.tsx"
5
+ - "**/components/workspace/CommandCenter.tsx"
6
6
  ---
7
7
 
8
8
  # Command Center Dashboard Rules (MANDATORY)
9
9
 
10
- These rules are non-negotiable for all files in `src/components/pages/`.
10
+ These rules are non-negotiable for all dashboard files in `src/pages/` and workspace files in `src/components/workspace/`.
11
11
 
12
12
  ## Before writing ANY code, load these skills
13
13
 
@@ -15,7 +15,7 @@ You MUST load the **command-center-builder** and **component-library** skills be
15
15
 
16
16
  ## Critical constraints
17
17
 
18
- 1. **File extension should be `.tsx`** — TypeScript is preferred for type safety. Use `.jsx` only if types are not available.
18
+ 1. **File extension MUST be `.tsx`** — This is a TypeScript project. All React components MUST use `.tsx` extension, never `.jsx`. All type definitions are available from the component library.
19
19
 
20
20
  2. **Use ONLY library components** from `@/components/library` for cards, charts, tables, lists. Never hand-roll HTML cards (`<div className="bg-white border rounded...">`).
21
21
 
@@ -15,7 +15,7 @@ These rules apply when building dashboards rendered by `CommandCenter.tsx`. For
15
15
 
16
16
  **Every time you build a dashboard, you MUST follow these non-negotiable rules. Violations are the #1 cause of rejected dashboards.**
17
17
 
18
- 1. **Actually write files to disk.** Use the file-writing tools to create `.jsx` files in `src/components/pages/` and update `CommandCenter.tsx` to import your dashboard. If you only describe what you would build without creating the files, the dashboard will not render. Verify the files exist after writing them.
18
+ 1. **Actually write files to disk.** Use the file-writing tools to create `.tsx` files (NOT `.jsx`) in `src/pages/` and update `CommandCenter.tsx` to import your dashboard. This is a TypeScript project - all React components MUST use `.tsx` extension. If you only describe what you would build without creating the files, the dashboard will not render. Verify the files exist after writing them.
19
19
 
20
20
  2. **Use ONLY library components** from `@/components/library` for all cards, charts, tables, lists, and feeds. The library has 30+ components — there is no reason to hand-roll HTML. See the component table below.
21
21
 
package/README.md CHANGED
@@ -302,15 +302,15 @@ bash node_modules/@schandlergarcia/sf-web-components/scripts/reset-command-cente
302
302
  ```
303
303
 
304
304
  **What it does:**
305
- - Removes custom dashboard pages
305
+ - Removes custom dashboard pages (including those created at SFDX project root)
306
306
  - Reinstalls BlankDashboard.tsx with EmptyState
307
307
  - Resets CommandCenter.tsx (preserves theme mode)
308
- - Updates Home.tsx to render CommandCenter (blank dashboard)
308
+ - Updates Home.tsx to render search interface
309
309
  - Creates Search.tsx for search interface at `/search` route
310
310
  - Resets routes to baseline configuration
311
311
  - Preserves: component library, authentication, all dependencies
312
312
 
313
- **Result:** Home route (`/`) displays the CommandCenter with BlankDashboard, ready for customization
313
+ **Result:** Home route (`/`) displays the search interface (baseline state)
314
314
 
315
315
  ---
316
316
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.17",
3
+ "version": "1.9.19",
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",
@@ -164,20 +164,73 @@ WRAPPER_EOF
164
164
  echo " ✓ Wired up BlankDashboard"
165
165
  echo ""
166
166
 
167
- # ── 4. Reset Home.tsx to render CommandCenter ────────────────────────────────
167
+ # ── 4. Reset Home.tsx to render search interface ────────────────────────────
168
168
 
169
169
  HOME="src/pages/Home.tsx"
170
170
  echo "→ Updating ${HOME}..."
171
171
 
172
172
  cat > "$HOME" << 'HOME_EOF'
173
- import CommandCenter from "@/components/workspace/CommandCenter";
173
+ import { useState } from "react";
174
+ import { useNavigate } from "react-router";
175
+ import UIInput from '@/components/library/ui/UIInput';
176
+ import UIButton from '@/components/library/ui/UIButton';
177
+ import { Search } from "lucide-react";
174
178
 
175
179
  export default function HomePage() {
176
- return <CommandCenter />;
180
+ const [searchQuery, setSearchQuery] = useState("");
181
+ const navigate = useNavigate();
182
+
183
+ const handleSearch = () => {
184
+ const trimmed = searchQuery.trim();
185
+ if (trimmed) {
186
+ navigate(`/accounts?search=${encodeURIComponent(trimmed)}`);
187
+ } else {
188
+ navigate('/accounts');
189
+ }
190
+ };
191
+
192
+ const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
193
+ if (e.key === "Enter") {
194
+ e.preventDefault();
195
+ handleSearch();
196
+ }
197
+ };
198
+
199
+ return (
200
+ <div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8 bg-slate-50 dark:bg-slate-950 transition-colors">
201
+ <div className="w-full max-w-4xl">
202
+ <div className="text-center mb-8">
203
+ <h1 className="text-4xl font-bold text-slate-900 dark:text-slate-50 mb-4">Search</h1>
204
+ <p className="text-lg text-slate-600 dark:text-slate-300">Find records across your organization.</p>
205
+ </div>
206
+ <div className="flex flex-col gap-4">
207
+ <div className="relative">
208
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-slate-400" />
209
+ <UIInput
210
+ type="text"
211
+ value={searchQuery}
212
+ onChange={(e) => setSearchQuery(e.target.value)}
213
+ onKeyDown={handleKeyDown}
214
+ placeholder="Search..."
215
+ className="pl-10 w-full"
216
+ />
217
+ </div>
218
+ <div className="flex gap-3 justify-center">
219
+ <UIButton onClick={handleSearch} variant="primary">
220
+ Search
221
+ </UIButton>
222
+ <UIButton onClick={() => navigate('/accounts')} variant="secondary">
223
+ Browse All
224
+ </UIButton>
225
+ </div>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ );
177
230
  }
178
231
  HOME_EOF
179
232
 
180
- echo " ✓ Home renders CommandCenter (dashboard)"
233
+ echo " ✓ Home renders search interface"
181
234
  echo ""
182
235
 
183
236
  # ── 5. Ensure Search.tsx page exists ─────────────────────────────────────────
@@ -311,14 +364,14 @@ echo "║ • Authentication features ║"
311
364
  echo "║ • All styles & dependencies ║"
312
365
  echo "║ ║"
313
366
  echo "║ Layout: ║"
314
- echo "║ / → CommandCenter (blank dashboard)║"
315
- echo "║ /search → Search interface ║"
367
+ echo "║ / → Search interface ║"
368
+ echo "║ /search → Search interface (duplicate) ║"
316
369
  echo "║ /accounts → Account search and browse ║"
317
370
  echo "║ ║"
318
- echo "║ Command Center setup: ║"
319
- echo "║ • Home renders BlankDashboard ║"
320
- echo "║ • Theme and data providers configured ║"
321
- echo "║ • Ready to build custom dashboards ║"
371
+ echo "║ Search functionality: ║"
372
+ echo "║ • Search button navigates to /accounts ║"
373
+ echo "║ • Enter key triggers search ║"
374
+ echo "║ • Browse All shows all accounts ║"
322
375
  echo "║ ║"
323
376
  echo "║ Start building: ║"
324
377
  echo "║ npm run dev ║"