@reqquest/ui 1.12.0 → 1.13.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 CHANGED
@@ -1,8 +1,33 @@
1
1
  # ReqQuest UI Library
2
2
 
3
- This library provides a set of Svelte components and utilities for building ReqQuest projects. You'll especially find the `api` useful for creating graphQL queries. In the future we will provide a small component library to help you build your prompts.
3
+ This library provides a set of Svelte components and utilities for building ReqQuest projects. You'll especially find the `api` useful for creating graphQL queries. Everything you need to build a prompt - the component the framework hands your props to, the
4
+ registration contract, the recipes, and the full catalog of `@reqquest/ui` and
5
+ `@txstate-mws/carbon-svelte` components with their props - is in **`dist/components.md`**
6
+ inside this package, i.e. `node_modules/@reqquest/ui/dist/components.md`. Start there.
4
7
 
5
- # Developing
8
+ ## Registering your prompts
9
+
10
+ Every prompt your API defines needs a Svelte component registered here, and nothing links the two
11
+ automatically. Use the keyed form of `UIConfig` so a prompt you forget to register is a build error
12
+ rather than a broken screen:
13
+
14
+ ```ts
15
+ const config = {
16
+ appName: 'My Program',
17
+ prompts: {
18
+ proof_of_residence_prompt: { formComponent: ResidencePrompt, displayComponent: ResidenceDisplay }
19
+ }
20
+ } satisfies UIConfig
21
+ export const uiRegistry = new UIRegistry(config)
22
+ ```
23
+
24
+ That check only has teeth once a key declaration augmenting `@reqquest/ui` is in your `src`. It is
25
+ generated on the **API** side, by the analyzer that ships with `@reqquest/api` — see
26
+ [docs/downstream-setup.md](../docs/downstream-setup.md). Without it, keys stay `string`, an
27
+ unregistered prompt renders an inline "unavailable" notice at runtime, and you find out when a user
28
+ reaches the screen.
29
+
30
+ # Developing this library
6
31
 
7
32
  To develop the UI library, you'll want to work with the full demo, so `docker compose up --build` in the root of the repo. Similarly the test suite is combined with API tests, so run `./test.sh` in the root of the repo.
8
33