You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ontario): add react-ontario package, showcase integration, and Experience Cloud site metadata
- Add Ontario Design System React package (@sfgps-ds/react-ontario) with 33 components,
OntarioProvider/OntarioContext, safeHtml/sanitizeHref utilities, and full test suite
- Add ontario-lab Vite dev app for component-level development
- Integrate Ontario routes into sfGpsDsUsGovShowcase UIBundle (vite.config woff2-only
font strategy, stripped CSS alias, copy-uswds-assets rewrite)
- Add 278+ Playwright E2E specs for Ontario components (local + live configurations)
- Set UIBundle target=Experience for Experience Cloud site linking
- Add Digital Experience site metadata for SfGpsDsUsGovShowcase and SfGpsDsUsGovReact
(Network, CustomSite, DigitalExperienceConfig, DigitalExperienceBundle) in showcase/
- Retrieve and store pronto_app and Government_of_the_Future reference site metadata
- Fix ComboBox and DatePicker bugs; expand Popover tests
- Update docs: ARCHITECTURE, QUICKSTART, ADDING_A_DESIGN_SYSTEM process guide
- Update Playwright configs with ontario-live-chromium project and live URL support
components/ 33 ODS wrappers (Stencil web components)
44
+
39
45
docs/ All documentation — platform guides and design-system guides
40
46
e2e/ Playwright tests against local Vite fixture (no org required)
41
47
showcase/ UIBundle showcase app for Salesforce React Experience Cloud
@@ -67,6 +73,7 @@ npm run test --workspaces --if-present # all packages
67
73
npm run test --workspace=packages/react-uswds # USWDS unit tests
68
74
npm run test --workspace=packages/react-bridge # bridge unit tests
69
75
npm run test --workspace=packages/gov-components # gov-components unit tests
76
+
npm run test --workspace=packages/react-ontario # Ontario unit tests
70
77
npm run test:coverage --workspace=packages/react-uswds # with coverage thresholds
71
78
```
72
79
@@ -108,7 +115,7 @@ sf org open --target-org BUILD
108
115
### Import rules
109
116
- Import `@salesforce/agentforce-conversation-client` only from `src/agentforce.ts`, never from `src/index.ts`
110
117
- Never import `@salesforce/apex/*`, `@salesforce/label/*`, `@salesforce/schema/*`, `@salesforce/user/*`, `@salesforce/client/*`, `@salesforce/featureFlag/*`, `@salesforce/customPermission/*`, `@salesforce/resourceUrl/*`, or `@salesforce/messageChannel/*` in any React source file — these are LWC compile-time virtual modules and cannot be resolved by npm or any bundler. ESLint rule SB-1 enforces this as a build error.
111
-
- Never import `@sfgps-ds/react-uswds` or `@gov-ido/gov-components` from any file in `packages/react-bridge/`. ESLint rule PB-1 enforces this.
118
+
- Never import `@sfgps-ds/react-uswds`, `@gov-ido/gov-components`, or `@sfgps-ds/react-ontario` from any file in `packages/react-bridge/`. ESLint rule PB-1 enforces this.
112
119
- Never use `JSON.parse(JSON.stringify(` in `packages/react-bridge/`. Use `stripProxy()` instead. ESLint rule SER-2 enforces this.
113
120
114
121
---
@@ -121,13 +128,14 @@ sf org open --target-org BUILD
121
128
- Export Agentforce-specific components from `packages/react-uswds/src/agentforce.ts` (not the main barrel)
122
129
- Add platform-agnostic infrastructure (gateways, stores, hooks) to `packages/react-bridge/src/`
123
130
- Add gov-specific components under `packages/gov-components/src/components/<ComponentName>/`
131
+
- Add Ontario Design System components under `packages/react-ontario/src/components/<ComponentName>/`
124
132
- Write Vitest tests alongside source in `src/**/__tests__/`
125
133
- Write E2E tests in `e2e/tests/`
126
134
127
135
### Do not
128
136
- Import `@salesforce/agentforce-conversation-client` from the main barrel (`index.ts`) — it belongs in `agentforce.ts` only
129
137
- Import `@salesforce/` LWC virtual modules (`@salesforce/apex/*`, `@salesforce/label/*`, etc.) in any React file — LWC compile-time modules; use the gateway abstraction instead (ESLint SB-1)
130
-
- Import `@sfgps-ds/react-uswds` or `@gov-ido/gov-components` from `packages/react-bridge/` — bridge is design-system-agnostic (ESLint PB-1)
138
+
- Import `@sfgps-ds/react-uswds`, `@gov-ido/gov-components`, or `@sfgps-ds/react-ontario` from `packages/react-bridge/` — bridge is design-system-agnostic (ESLint PB-1)
131
139
- Use `JSON.parse(JSON.stringify(` for LWC→React data crossing — use `stripProxy()` instead (ESLint SER-2)
132
140
- Call `DOMPurify(window)` at module evaluation time
133
141
- Use `document.activeElement` for focus management in React components
@@ -137,6 +145,19 @@ sf org open --target-org BUILD
137
145
138
146
## Known pre-existing issues
139
147
-`safeHtml.test.ts` — all tests pass. If test `[SEC-1D]` regresses, the fix is the `afterSanitizeAttributes` hook in `getPurifier()` inside `src/utils/safeHtml.ts`.
148
+
-`OntarioSummaryList` — upstream `@ongov/ontario-design-system-component-library-react` does not yet export `OntarioSummaryList`; 2 import tests in `packages/react-ontario` skip until the upstream ships the symbol.
149
+
150
+
---
151
+
152
+
## Ontario Design System (ODS) package architecture
153
+
154
+
The `packages/react-ontario/` package wraps Stencil web components from `@ongov/ontario-design-system-component-library-react`.
155
+
156
+
Key constraints:
157
+
-**Shadow DOM rendering** — ODS components render inside shadow DOM. Playwright axe tests must use `disableRules` for shadow DOM label/list issues (upstream ODS behavior, not a local bug).
158
+
-**OntarioProvider** — must wrap the component tree before any ODS component renders. It calls `setAssetPath` from `@stencil/core/loader` so Stencil can resolve icon and font assets at runtime. Never render ODS components outside an `OntarioProvider`.
159
+
-**JSON prop sanitization** — ODS components accept complex props as JSON strings (arrays, objects). Use `useMemo` keyed on individual primitive values, not on the full props object, to avoid unnecessary re-serializations and infinite render loops.
160
+
-**Package boundary** — `@sfgps-ds/react-ontario` is a design-system package; it must not be imported from `packages/react-bridge/` (ESLint PB-1).
Copy file name to clipboardExpand all lines: README.md
+35-9Lines changed: 35 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# @sfgps-ds/react-uswds
1
+
# Salesforce GPS Accelerators — React Design System Libraries
2
2
3
-
**USWDS 3.13 React component library for Salesforce Experience Cloud.**
3
+
**USWDS 3.13 and Ontario Government Design System React component libraries for Salesforce Experience Cloud.**
4
4
5
-
Built by Salesforce GPS Accelerators, this library brings the full U.S. Web Design System to Salesforce Experience Cloud's native React developer experience. Components deploy directly on Salesforce React Experience Cloud — no LWC bridge required.
5
+
Built by Salesforce GPS Accelerators, these libraries bring U.S. and Canadian government design systems to Salesforce Experience Cloud's native React developer experience. Components deploy directly on Salesforce React Experience Cloud — no LWC bridge required.
6
6
7
-
**1,100+ tests** — unit tests across 70+ files
7
+
**4,700+ tests** — unit tests and Playwright e2e tests across all packages
8
8
9
9
---
10
10
@@ -13,13 +13,14 @@ Built by Salesforce GPS Accelerators, this library brings the full U.S. Web Desi
13
13
| Layer | What it does |
14
14
|---|---|
15
15
|**React component library** (`packages/react-uswds/src/`) | 54 pure-React USWDS 3.13 components. No Salesforce dependencies. Publishable to npm as `@sfgps-ds/react-uswds`. |
16
+
|**Ontario React component library** (`packages/react-ontario/src/`) | 33 Ontario Government Design System components wrapping `@ongov/ontario-design-system-component-library-react` Stencil web components. No Salesforce dependencies. Publishable to npm as `@sfgps-ds/react-ontario`. |
16
17
|**Salesforce React Experience Cloud**| Components deploy directly using Salesforce's native React developer experience — no LWC bridge or IIFE bundle required. See [Salesforce Multi-Framework developer guide](https://developer.salesforce.com/docs/platform/agentforcevibes/guide/afv-reactdev-overview.html). |
`OntarioProvider` is required — it calls Stencil's `setAssetPath` to wire the web component asset path. Without it, icons and other static assets will not resolve.
68
+
44
69
### Salesforce React Experience Cloud
45
70
46
-
Import components directly — no bridge or bundle step required:
71
+
Import components directly from either library — no bridge or bundle step required:
@@ -222,7 +247,7 @@ Three lint rules enforce the React/Salesforce boundary at build time:
222
247
| Rule | Scope | What it blocks |
223
248
|---|---|---|
224
249
|**SB-1**| All React source |`@salesforce/apex/*`, `@salesforce/label/*`, `@salesforce/schema/*`, and 6 other LWC virtual modules — not resolvable outside the LWC compile context |
225
-
|**PB-1**|`packages/react-bridge/**`| Imports from `@sfgps-ds/react-uswds` or `@gov-ido/gov-components` — the platform adapter layer must stay design-system-agnostic |
250
+
|**PB-1**|`packages/react-bridge/**`| Imports from `@sfgps-ds/react-uswds`, `@sfgps-ds/react-ontario`, or `@gov-ido/gov-components` — the platform adapter layer must stay design-system-agnostic |
226
251
|**SER-2**|`packages/react-bridge/**`|`JSON.parse(JSON.stringify(` — use `stripProxy()` instead, which correctly handles `Date`, `Map`, `Set`, and `BigInt`|
227
252
228
253
All three are ESLint errors that fail the build. `@salesforce/agentforce-conversation-client` is a real npm package and is not restricted.
@@ -239,10 +264,11 @@ This section is intended for legal review. It lists every third-party package th
239
264
240
265
| Package | Version | License | Role | Ships how |
|`dompurify`| 3.2.6 |[MPL-2.0 OR Apache-2.0](https://github.com/cure53/DOMPurify/blob/main/LICENSE)| HTML sanitization for rich-text props (`Alert.body`, `Card.body`, etc.) | Peer dependency — caller provides; externalized from tsup bundle |
245
270
|`@uswds/uswds`| 3.13.0 |[CC0 / Apache-2.0 / SIL OFL 1.1 / MIT (see note)](https://github.com/uswds/uswds/blob/main/LICENSE.md)| USWDS CSS, fonts (Source Sans Pro, Merriweather, Public Sans), icons, and SVG sprite | Served as static assets; not bundled into JS |
271
+
|`@ongov/ontario-design-system-component-library-react`| ^8.1.0 |[MIT](https://github.com/ongov/ontario-design-system-component-library/blob/main/LICENSE)| Ontario Government Design System Stencil web components | Peer dependency for `@sfgps-ds/react-ontario` — caller provides |
246
272
|`@salesforce/agentforce-conversation-client`| 10.2.0 |[Salesforce Terms of Use](https://github.com/salesforce/agentforce-conversation-client)| Agentforce chat widget SDK (`AgentforceWidget` component) | Peer dependency for `@sfgps-ds/react-uswds/agentforce` sub-path only; excluded from the main bundle |
0 commit comments