@salesforce/webapp-template-app-react-template-b2e-experimental 1.84.0 → 1.85.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.
@@ -1,9 +1,11 @@
1
1
  ---
2
- name: webapp-react-add-component
3
- description: Creates React components, pages, headers, and footers using shadcn UI and Tailwind CSS. Use when the user asks to create a component, add a widget, build a UI element, add a page, create a new page, add a section (e.g. "add a contacts page"), add a header, add a footer, add a navigation bar, or add anything to the web application.
2
+ name: webapp-react
3
+ description: Use when editing any React code in the web application creating or modifying components, pages, layout, headers, footers, or any TSX/JSX files. Follow this skill for add component, add page, header/footer, and general React UI implementation patterns (shadcn UI and Tailwind CSS).
4
4
  ---
5
5
 
6
- # Add React Component
6
+ # React Web App (Components, Pages, Layout)
7
+
8
+ Use this skill whenever you are editing React/TSX code in the web app (creating or modifying components, pages, header/footer, or layout).
7
9
 
8
10
  ## Step 1 — Identify the type of component
9
11
 
@@ -116,6 +116,14 @@ AppLayout (appLayout.tsx)
116
116
  - **Icons:** `lucide-react`; add `aria-hidden="true"` on decorative icons
117
117
  - **Design tokens:** `bg-background`, `text-foreground`, `text-muted-foreground`, `border`, `bg-primary`
118
118
 
119
+ ### Mobile hamburger / Menu icon — Must be functional
120
+
121
+ If the header includes a hamburger or `Menu` icon for mobile:
122
+
123
+ - **Do not** add a Menu/hamburger icon that does nothing. It must toggle a visible mobile menu.
124
+ - **Required:** (1) State: `const [isOpen, setIsOpen] = useState(false)`. (2) Button: `onClick={() => setIsOpen(!isOpen)}`, `aria-label="Toggle menu"`. (3) Conditional panel: `{isOpen && ( <div>...nav links...</div> )}` with responsive visibility (e.g. `md:hidden`). (4) Close on navigate: each link in the panel should `onClick={() => setIsOpen(false)}`.
125
+ - Implement in `appLayout.tsx` (or the component that owns the header). Use the `Menu` icon from `lucide-react`.
126
+
119
127
  ### Confirm — Header / Footer
120
128
 
121
129
  - Header and footer appear on every page (navigate to at least two routes)
@@ -2,13 +2,14 @@
2
2
 
3
3
  ### Rules
4
4
 
5
- 1. **`routes.tsx` is the only route registry** — never add routes in `app.tsx` or inside page files.
6
- 2. **All pages are children of the AppLayout route** — do not create top-level routes that bypass the layout shell.
7
- 3. **Default export per page** — each page file has exactly one default-export component.
8
- 4. **Path aliases in all imports** — use `@/pages/...`, `@/components/...`; no deep relative paths.
9
- 5. **No inline styles** — Tailwind utility classes and design tokens only.
10
- 6. **Catch-all last** — `path: '*'` (NotFound) must always remain the last child in the layout route.
11
- 7. **Never modify `appLayout.tsx`** when adding a page layout changes are a separate concern.
5
+ 1. **Edit the component that owns the UI, never output raw HTML** — When editing the home page or any page content, modify the actual `.tsx` file that renders the target. If the target is inside a child component (e.g. `<GlobalSearchInput />` in `Home.tsx`), edit the child's file (e.g. `GlobalSearchInput.tsx`), not the parent. Do not wrap the component with extra elements in the parent; go into the component and change its JSX. Do not paste or generate raw HTML.
6
+ 2. **`routes.tsx` is the only route registry** — never add routes in `app.tsx` or inside page files.
7
+ 3. **All pages are children of the AppLayout route** — do not create top-level routes that bypass the layout shell.
8
+ 4. **Default export per page** — each page file has exactly one default-export component.
9
+ 5. **Path aliases in all imports** — use `@/pages/...`, `@/components/...`; no deep relative paths.
10
+ 6. **No inline styles** — Tailwind utility classes and design tokens only.
11
+ 7. **Catch-all last** `path: '*'` (NotFound) must always remain the last child in the layout route.
12
+ 8. **Never modify `appLayout.tsx`** when adding a page — layout changes are a separate concern.
12
13
 
13
14
  ### Step 1 — Create the page file
14
15
 
@@ -1,11 +1,13 @@
1
1
  ---
2
- name: ui-ux
3
- description: Comprehensive design guide for React + Tailwind + shadcn/ui applications. Searchable database with priority-based recommendations for styles, color palettes, font pairings, UX guidelines, and chart types.
2
+ name: webapp-ui-ux
3
+ description: Use when editing any UI code in the web application — styling, layout, design, appearance, Tailwind, shadcn, colors, typography, icons, or visual/UX changes. Comprehensive design guide and searchable database for React + Tailwind + shadcn/ui (styles, color palettes, font pairings, UX guidelines, chart types).
4
4
  ---
5
5
 
6
- # ui-ux
6
+ # Web App UI/UX
7
7
 
8
- Comprehensive design guide for React + Tailwind + shadcn/ui applications. Contains 67 styles, 96 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types. Searchable database with priority-based recommendations.
8
+ Use this skill whenever you are editing UI code in the web application styling, layout, design, appearance, Tailwind, shadcn, colors, typography, icons, or any visual/UX change.
9
+
10
+ Comprehensive design guide for React + Tailwind + shadcn/ui. Contains 67 styles, 96 color palettes, 57 font pairings, 99 UX guidelines, and 25 chart types. Searchable database with priority-based recommendations.
9
11
 
10
12
  ## Prerequisites
11
13
 
@@ -200,9 +202,10 @@ These are frequently overlooked issues that make UI look unprofessional:
200
202
 
201
203
  | Rule | Do | Don't |
202
204
  |------|----|----- |
203
- | **No emoji icons** | Use SVG icons (Heroicons, Lucide, Simple Icons) | Use emojis like 🎨 🚀 ⚙️ as UI icons |
205
+ | **Icons: Lucide only** | Use **lucide-react** for all UI icons: `import { IconName } from 'lucide-react'` | Use Heroicons, react-icons, or other icon libraries; use emojis as icons |
206
+ | **No emojis ever** | Use words + Lucide icons for labels, empty states, tooltips, headings | Use emojis anywhere in UI or user-facing text (e.g. 🎨 🚀 ⚙️) |
204
207
  | **Stable hover states** | Use color/opacity transitions on hover | Use scale transforms that shift layout |
205
- | **Correct brand logos** | Research official SVG from Simple Icons | Guess or use incorrect logo paths |
208
+ | **Correct brand logos** | Research official SVG from Simple Icons (when needed outside Lucide) | Guess or use incorrect logo paths |
206
209
  | **Consistent icon sizing** | Use fixed viewBox (24x24) with w-6 h-6 | Mix different icon sizes randomly |
207
210
 
208
211
  ### Interaction & Cursor
@@ -237,8 +240,8 @@ These are frequently overlooked issues that make UI look unprofessional:
237
240
  Before delivering UI code, verify these items:
238
241
 
239
242
  ### Visual Quality
240
- - [ ] No emojis used as icons (use SVG instead)
241
- - [ ] All icons from consistent icon set (Heroicons/Lucide)
243
+ - [ ] No emojis anywhere (UI, labels, empty states, tooltips—use words + Lucide icons only)
244
+ - [ ] All icons from **lucide-react** only (no Heroicons, react-icons, or emojis)
242
245
  - [ ] Brand logos are correct (verified from Simple Icons)
243
246
  - [ ] Hover states don't cause layout shift
244
247
  - [ ] Use theme colors directly (bg-primary) not var() wrapper
@@ -18,6 +18,15 @@ For layout, navigation, and generation rules, see **webapp.md**.
18
18
  - Dev server: `npm run dev`
19
19
  - Build: `npm run build`
20
20
 
21
+ ## Routing (React Router)
22
+
23
+ Use a **single** router package for the app. When using `createBrowserRouter` and `RouterProvider` from `react-router`, all routing imports must come from **`react-router`** — not from `react-router-dom`.
24
+
25
+ - ✅ `import { createBrowserRouter, RouterProvider, Link, useNavigate, useLocation, Outlet } from 'react-router';`
26
+ - ❌ `import { Link } from 'react-router-dom';` when the app uses `RouterProvider` from `react-router`
27
+
28
+ Mixing packages causes "Cannot destructure property 'basename' of ... as it is null" because `Link`/hooks from `react-router-dom` read a different context than the one provided by `RouterProvider` from `react-router`.
29
+
21
30
  ## Component Library (MANDATORY)
22
31
 
23
32
  Use **shadcn/ui** for UI components:
@@ -28,6 +37,42 @@ import { Card, CardHeader, CardContent } from '@/components/ui/card';
28
37
  import { Input } from '@/components/ui/input';
29
38
  ```
30
39
 
40
+ ## Icons & No Emojis (MANDATORY)
41
+
42
+ - **Icons:** Use **lucide-react** only. Do not use Heroicons, Simple Icons, or other icon libraries in the web app.
43
+ - ✅ `import { Menu, Settings, Bell } from 'lucide-react';` then `<Menu className="w-5 h-5" />`
44
+ - ❌ Any emoji character as an icon or visual element (e.g. 🎨 🚀 ⚙️ 🔔)
45
+ - ❌ Other icon libraries (e.g. `@heroicons/react`, `react-icons`, custom SVG icon sets)
46
+ - **No emojis ever:** Do not use emojis anywhere in the app: no emojis in UI labels, buttons, headings, empty states, tooltips, or any user-facing text. Use words and lucide-react icons instead.
47
+ - ✅ "Settings" with `<Settings />` icon
48
+ - ❌ "⚙️ Settings" or "Settings 🔧"
49
+ - For icon usage patterns and naming, see the **webapp-ui-ux** skill (`.a4drules/skills/webapp-ui-ux/`, especially `data/icons.csv`).
50
+
51
+ ## Editing UI — Source Files Only (CRITICAL)
52
+
53
+ When asked to edit the home page, a section, or any on-screen UI:
54
+
55
+ - **Always edit the actual React/TSX source files.** Never output, paste, or generate raw HTML. The UI is built from components; the agent must locate the component file(s) that render the target area and change **JSX in those files**.
56
+ - **Do not** replace JSX with HTML strings, and do not copy browser-rendered DOM (e.g. expanded `<div>`, `data-slot`, long class strings) into the codebase. That is the output of React + shadcn; the source is `.tsx` with `<Card>`, `<Input>`, etc.
57
+ - **Edit inside the component that owns the UI.** If the element to change is rendered by a **child component** (e.g. `<GlobalSearchInput />` in `Home.tsx`), make the edit **inside that component's file** (e.g. `GlobalSearchInput.tsx`). Do **not** only wrap the component with extra elements in the parent (e.g. adding a `<section>` or `<div>` around `<GlobalSearchInput />`). The parent composes components; the visual/content change belongs in the component that actually renders that part of the UI.
58
+ - **Where to edit:**
59
+ - **Home page content:** `src/pages/Home.tsx` — but if the target is inside a child (e.g. `<GlobalSearchInput />`), edit the child's file, not the parent.
60
+ - **Layout, header, nav:** `src/appLayout.tsx`.
61
+ - **Feature-specific UI (e.g. search, list):** open the **specific component file** that renders the target (e.g. `GlobalSearchInput.tsx` for the search input UI).
62
+ - **Steps:** (1) Identify which **component** owns the section (follow the import: e.g. `GlobalSearchInput` → its file). (2) Open that component's file and modify the JSX there. (3) Only change the parent (e.g. `Home.tsx`) if the change is layout/ordering of components, not the internals of a child. Do not emit a standalone HTML snippet as the “edit.”
63
+
64
+ ## Mobile Nav / Hamburger — Must Be Functional
65
+
66
+ When adding a navigation menu that includes a hamburger (or Menu icon) for mobile:
67
+
68
+ - **Do not** add a hamburger/Menu icon that does nothing. The icon must **toggle a visible mobile menu**.
69
+ - **Required implementation:**
70
+ 1. **State:** e.g. `const [isOpen, setIsOpen] = useState(false);`
71
+ 2. **Toggle button:** The hamburger/Menu button must have `onClick={() => setIsOpen(!isOpen)}` and `aria-label="Toggle menu"` (or equivalent).
72
+ 3. **Conditional panel:** A mobile-only menu panel that renders when `isOpen` is true, e.g. `{isOpen && ( <div className="..."> ... nav links ... </div> )}`. Use responsive classes (e.g. `md:hidden`) so the panel is shown only on small screens if the desktop nav is separate.
73
+ 4. **Close on navigation:** Each nav link in the mobile panel should call `onClick={() => setIsOpen(false)}` (or similar) so the menu closes when the user navigates.
74
+ - Implement this in `appLayout.tsx` (or the component that owns the header/nav). See existing apps for the full pattern (state + button + conditional panel + link onClick).
75
+
31
76
  ## Styling
32
77
 
33
78
  - Use **Tailwind CSS** utility classes
@@ -137,11 +182,20 @@ window.location.reload();
137
182
  - ❌ Using LWC patterns (`@wire`, LDS) in React
138
183
  - ❌ Hardcoded Salesforce IDs or URLs
139
184
  - ❌ Missing error handling for async operations
185
+ - ❌ Mixing `react-router` and `react-router-dom` (e.g. `RouterProvider` from `react-router` but `Link` from `react-router-dom`) — use one package for all routing imports
186
+ - ❌ Using emojis anywhere in the app (labels, icons, empty states, headings, tooltips)
187
+ - ❌ Using any icon library other than **lucide-react** (no Heroicons, react-icons, or emoji-as-icon)
188
+ - ❌ Outputting or pasting raw HTML when editing UI — always edit the React/TSX source files (e.g. `Home.tsx`, `appLayout.tsx`, feature components)
189
+ - ❌ Adding a hamburger or Menu icon for mobile nav without implementing toggle state, conditional menu panel, and close-on-navigate
140
190
 
141
191
  ## Quality Checklist
142
192
 
143
193
  - [ ] Entry point maintained (`app.tsx`)
144
194
  - [ ] Uses shadcn/ui and Tailwind
195
+ - [ ] Icons from **lucide-react** only; no emojis anywhere in UI or user-facing text
196
+ - [ ] UI changes made by editing .tsx source files (never by pasting raw HTML)
197
+ - [ ] If mobile hamburger exists: it has toggle state, conditional menu panel, and close on link click
198
+ - [ ] All routing imports from same package as router (e.g. `react-router` only)
145
199
  - [ ] DataSDK used for all Salesforce API calls
146
200
  - [ ] Proper error handling with try/catch
147
201
  - [ ] Loading and error states implemented
package/dist/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.85.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.84.1...v1.85.0) (2026-03-10)
7
+
8
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.84.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.84.0...v1.84.1) (2026-03-10)
15
+
16
+ **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
17
+
18
+
19
+
20
+
21
+
6
22
  # [1.84.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.83.0...v1.84.0) (2026-03-09)
7
23
 
8
24
 
@@ -15,9 +15,9 @@
15
15
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "@salesforce/agentforce-conversation-client": "^1.84.0",
19
- "@salesforce/sdk-data": "^1.84.0",
20
- "@salesforce/webapp-experimental": "^1.84.0",
18
+ "@salesforce/agentforce-conversation-client": "^1.85.0",
19
+ "@salesforce/sdk-data": "^1.85.0",
20
+ "@salesforce/webapp-experimental": "^1.85.0",
21
21
  "@tailwindcss/vite": "^4.1.17",
22
22
  "@tanstack/react-form": "^1.28.4",
23
23
  "class-variance-authority": "^0.7.1",
@@ -41,7 +41,7 @@
41
41
  "@graphql-eslint/eslint-plugin": "^4.1.0",
42
42
  "@graphql-tools/utils": "^11.0.0",
43
43
  "@playwright/test": "^1.49.0",
44
- "@salesforce/vite-plugin-webapp-experimental": "^1.84.0",
44
+ "@salesforce/vite-plugin-webapp-experimental": "^1.85.0",
45
45
  "@testing-library/jest-dom": "^6.6.3",
46
46
  "@testing-library/react": "^16.1.0",
47
47
  "@testing-library/user-event": "^14.5.2",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.84.0",
3
+ "version": "1.85.0",
4
4
  "description": "Base SFDX project template",
5
5
  "private": true,
6
6
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-app-react-template-b2e-experimental",
3
- "version": "1.84.0",
3
+ "version": "1.85.0",
4
4
  "description": "B2E template app (from BYO)",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",