@stamprally/ui 0.11.0 → 0.12.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.
- package/README.md +36 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @stamprally/ui
|
|
2
|
+
|
|
3
|
+
Participant-facing React components for `@stamprally/core`.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { RallyViewer } from "@stamprally/ui";
|
|
9
|
+
import "@stamprally/ui/styles.css";
|
|
10
|
+
|
|
11
|
+
<RallyViewer config={publicConfig} locale="en" />;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
For a stateful client, pass `client={new StampRallyClient(publicConfig, options)}`.
|
|
15
|
+
The viewer subscribes to client state, renders all configured verification conditions,
|
|
16
|
+
and exposes check-in and reward actions through the same client.
|
|
17
|
+
|
|
18
|
+
## Render Props customization
|
|
19
|
+
|
|
20
|
+
`renderSpotCard`, `renderRewardCard`, `renderStatusBadge`, and the header/footer slots
|
|
21
|
+
allow a host application to replace presentation while retaining the domain engine.
|
|
22
|
+
`customConditionRenderers` can provide an application-specific QR, NFC, or custom
|
|
23
|
+
verification control. A custom renderer calls `onSubmit(proof)` when it has a proof.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
<RallyViewer
|
|
27
|
+
config={publicConfig}
|
|
28
|
+
locale="ja"
|
|
29
|
+
renderStatusBadge={({ status }) => <span data-status={status}>{status}</span>}
|
|
30
|
+
renderSpotCard={({ spot, children }) => <article><h2>{spot.name}</h2>{children}</article>}
|
|
31
|
+
/>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Keep private condition secrets, staff passcodes, digital content URLs, and
|
|
35
|
+
`serverMetadata` in the server-side `AdminRallyConfig`; publish only the result of
|
|
36
|
+
`toPublicConfig`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamprally/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Accessible participant UI components for stamp rallies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"./styles.css": "./dist/index.css"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@stamprally/
|
|
33
|
-
"@stamprally/
|
|
32
|
+
"@stamprally/core": "0.12.0",
|
|
33
|
+
"@stamprally/react": "0.12.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": "^18.0.0 || ^19.0.0",
|