Skip to content

Commit 5301b58

Browse files
GPS Design Systems React — USWDS 3.13 React component library for Salesforce Experience Cloud
Initial public release of @sfgps-ds/react-uswds: 54 USWDS 3.13 React components, 20 form components, Agentforce chat widget integration, Salesforce React Experience Cloud UIBundle showcase, E2E test suite, and documentation. Deploys natively to Salesforce React Experience Cloud without an LWC bridge. Part of the Salesforce GPS Accelerators program. https://gpsaccelerators.developer.salesforce.com/
0 parents  commit 5301b58

1,296 files changed

Lines changed: 109465 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.forceignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# node_modules should never be deployed to Salesforce
2+
**/node_modules/**
3+
**/node_modules
4+
5+
# Build artifacts in the UIBundle are deployed via ui-bundle.json outputDir
6+
# The dist/ directory is included because the UIBundle deploy needs it
7+
8+
# Exclude public/ directories — these are Vite dev-server directories only;
9+
# their contents (USWDS fonts/SVGs) are already in dist/uswds-assets/
10+
**/uiBundles/*/public/**
11+
12+
# Exclude source and config files from deployment — only dist/ is needed
13+
**/uiBundles/*/src/**
14+
**/uiBundles/*/scripts/**
15+
**/uiBundles/*/package.json
16+
**/uiBundles/*/tsconfig*.json
17+
**/uiBundles/*/vite.config.ts
18+
**/uiBundles/*/index.html

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#GUSINFO:GPS Accelerator Program,GPS Accelerator Program
2+
*
3+
# Comment line immediately above ownership line is reserved for related other information. Please be careful while editing.
4+
#ECCN:Open Source
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug Report
3+
about: Something is broken or behaving unexpectedly
4+
title: '[Bug] '
5+
labels: bug, needs-triage
6+
assignees: ''
7+
---
8+
9+
## Describe the bug
10+
11+
A clear description of what is broken and what you expected to happen.
12+
13+
## Reproduction steps
14+
15+
1. Go to...
16+
2. Click...
17+
3. See error...
18+
19+
## Environment
20+
21+
| Field | Value |
22+
|---|---|
23+
| `@sfgps-ds/react-uswds` version | |
24+
| Salesforce API version | |
25+
| Org type | (scratch org / sandbox / Developer Edition / production) |
26+
| LWS enabled | yes / no |
27+
| Browser | |
28+
29+
## Relevant code or error output
30+
31+
```
32+
Paste console errors, stack traces, or the LWC component code here.
33+
```
34+
35+
## Additional context
36+
37+
- Does this reproduce in the local Vite fixture (`npm run e2e:fixtures:preview`)? yes / no / not applicable
38+
- Does this reproduce with `MockGateway` (no org required)? yes / no / not applicable
39+
- Does this affect a specific USWDS component or the bridge infrastructure?

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/SFDC-Assets/gps-design-systems-react/discussions
5+
about: Use GitHub Discussions for questions, usage help, and architecture discussion.
6+
- name: Salesforce Known Issues
7+
url: https://help.salesforce.com/s/issue
8+
about: For platform bugs (LWS, LWR, Apex), check Salesforce Known Issues first.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new USWDS component, hook, or platform capability
4+
title: '[Feature] '
5+
labels: enhancement, needs-triage
6+
assignees: ''
7+
---
8+
9+
## Summary
10+
11+
One sentence describing the feature you want.
12+
13+
## Motivation
14+
15+
Why is this needed? What use case does it unlock? What is the workaround today?
16+
17+
## Proposed solution
18+
19+
Describe how you would expect the feature to work. Include component API sketches if relevant.
20+
21+
## Alternatives considered
22+
23+
Any other approaches you evaluated.
24+
25+
## References
26+
27+
- USWDS component spec (if applicable): https://designsystem.digital.gov/components/
28+
- Related Salesforce LWC docs (if applicable):

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Summary
2+
3+
<!-- What does this PR do? One or two sentences. -->
4+
5+
## Type of change
6+
7+
- [ ] Bug fix
8+
- [ ] New USWDS component
9+
- [ ] Platform / bridge change
10+
- [ ] Documentation
11+
- [ ] Dependency update
12+
13+
## Checklist
14+
15+
### For new USWDS components
16+
- [ ] Component renders correctly in the local Vite fixture (`npm run e2e:fixtures:preview`)
17+
- [ ] `SPEC.md` added describing the public API contract
18+
- [ ] Unit tests in `src/components/<Name>/__tests__/<Name>.test.tsx`
19+
- [ ] E2E test added in `e2e/tests/<name>.spec.ts`
20+
- [ ] Exported from `src/index.ts` (or `src/agentforce.ts` for Agentforce-specific components)
21+
- [ ] Accessibility: `vitest-axe` assertion in at least one test
22+
23+
### For bridge / platform changes
24+
- [ ] `packages/react-bridge` has zero imports from `@sfgps-ds/react-uswds` (run: `grep -r "@sfgps-ds/react-uswds" packages/react-bridge/`)
25+
- [ ] `lwcReactConfigLoader` subclasses still implement all four abstract getters
26+
- [ ] `stripProxy` used (not `JSON.parse/stringify`) for any new LWC→React data crossing
27+
28+
### For all PRs
29+
- [ ] `npm run test --workspaces --if-present` passes
30+
- [ ] `npm run lint` passes
31+
- [ ] `npm run build --workspace=packages/react-uswds` produces clean dist
32+
33+
## Testing notes
34+
35+
<!-- Describe how you tested this. Include org type, browser, and any edge cases verified. -->

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
commit-message:
9+
prefix: "chore(deps)"
10+
groups:
11+
github-actions:
12+
patterns:
13+
- "*"
14+
15+
- package-ecosystem: npm
16+
directory: /
17+
schedule:
18+
interval: weekly
19+
day: monday
20+
commit-message:
21+
prefix: "chore(deps)"
22+
ignore:
23+
# @uswds/uswds is intentionally pinned to exact 3.13.0 — upgrade via deliberate PR only
24+
- dependency-name: "@uswds/uswds"
25+
update-types: ["version-update:semver-patch", "version-update:semver-minor", "version-update:semver-major"]

.github/workflows/build.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build & Stage Artifacts
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Build React bundle and stage USWDS assets
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
18+
with:
19+
token: ${{ secrets.GH_PAT }}
20+
persist-credentials: false
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
24+
with:
25+
node-version: '24'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Assert USWDS CSS integrity
32+
run: |
33+
EXPECTED=$(awk '{print $1}' scripts/uswds-css-sha256.txt)
34+
CSS_PATH="node_modules/@uswds/uswds/dist/css/uswds.min.css"
35+
ACTUAL=$(sha256sum "$CSS_PATH" | awk '{print $1}')
36+
if [ "$ACTUAL" != "$EXPECTED" ]; then
37+
echo "SECURITY: uswds.min.css SHA-256 mismatch."
38+
echo " Expected: $EXPECTED"
39+
echo " Actual: $ACTUAL"
40+
echo "If this is an intentional USWDS upgrade, update scripts/uswds-css-sha256.txt."
41+
exit 1
42+
fi
43+
echo "CSS integrity verified: $ACTUAL"
44+
45+
- name: Export Salesforce Custom Labels
46+
if: env.SFDX_AUTH_URL != ''
47+
env:
48+
SFDX_AUTH_URL: ${{ secrets.SFDX_AUTH_URL }}
49+
run: node scripts/export-salesforce-labels.mjs
50+
51+
- name: Build all artifacts
52+
run: npm run build:all
53+
54+
# Each design system package is responsible for verifying its own artifacts.
55+
# Add a parallel verify block here when introducing a new design system package.
56+
- name: Verify USWDS artifacts
57+
run: |
58+
test -f packages/react-uswds/main/default/staticresources/sfGpsDsUsGovReactBundle.js || \
59+
(echo "ERROR: sfGpsDsUsGovReactBundle.js not found after build:all" && exit 1)
60+
test -f packages/react-uswds/main/default/staticresources/sfGpsDsUsGovAssets.zip || \
61+
(echo "ERROR: sfGpsDsUsGovAssets.zip not found after build:all" && exit 1)
62+
63+
- name: Generate artifact checksums
64+
run: |
65+
sha256sum \
66+
packages/react-uswds/main/default/staticresources/sfGpsDsUsGovReactBundle.js \
67+
packages/react-uswds/main/default/staticresources/sfGpsDsUsGovAssets.zip \
68+
> packages/react-uswds/main/default/staticresources/checksums.sha256
69+
echo "Generated checksums:"
70+
cat packages/react-uswds/main/default/staticresources/checksums.sha256
71+
72+
# USWDS-specific artifact upload. Add a parallel upload step for each additional
73+
# design system package, using a distinct artifact name (e.g. react-bundle-ukgds-${{ github.sha }}).
74+
- name: Upload React bundle artifact
75+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
76+
with:
77+
name: react-bundle-${{ github.sha }}
78+
path: |
79+
packages/react-uswds/main/default/staticresources/sfGpsDsUsGovReactBundle.js
80+
packages/react-uswds/main/default/staticresources/sfGpsDsUsGovReactBundle.resource-meta.xml
81+
packages/react-uswds/main/default/staticresources/sfGpsDsUsGovAssets.zip
82+
packages/react-uswds/main/default/staticresources/sfGpsDsUsGovAssets.resource-meta.xml
83+
packages/react-uswds/main/default/staticresources/checksums.sha256
84+
retention-days: 30

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
name: Lint, build, test
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
18+
with:
19+
token: ${{ secrets.GH_PAT }}
20+
persist-credentials: false
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
24+
with:
25+
node-version: '24'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Audit dependencies
32+
run: npm audit --audit-level=high
33+
34+
- name: Check formatting
35+
run: npm run format:check
36+
37+
- name: Lint
38+
run: npm run lint
39+
40+
- name: Build
41+
run: npm run build
42+
43+
- name: Verify dist
44+
run: npm run check-dist --workspace=packages/react-uswds
45+
46+
- name: Test (react-uswds)
47+
run: npm run test:coverage --workspace=packages/react-uswds
48+
49+
- name: Test (react-bridge)
50+
run: npm run test --workspace=packages/react-bridge
51+
52+
- name: Upload coverage
53+
if: always()
54+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
55+
with:
56+
files: packages/react-uswds/coverage/lcov.info
57+
fail_ci_if_error: false

.github/workflows/e2e.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: E2E
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
e2e:
11+
name: Playwright E2E
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@9f698171ed81b15d1823a05fc7211befd50c8ae0 # v6.0.3
18+
with:
19+
token: ${{ secrets.GH_PAT }}
20+
persist-credentials: false
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
24+
with:
25+
node-version: '24'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Install Playwright browsers
32+
run: npx playwright install --with-deps chromium firefox
33+
34+
- name: Build fixture app
35+
run: npm run e2e:fixtures:build
36+
37+
- name: Run E2E tests
38+
run: npm run e2e
39+
40+
- name: Upload test results
41+
if: failure()
42+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
43+
with:
44+
name: playwright-report
45+
path: test-results/
46+
retention-days: 7

0 commit comments

Comments
 (0)