@domainkit/react 0.9.1 → 0.11.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 +52 -4
- package/dist/index.d.mts +333 -50
- package/dist/index.mjs +1121 -248
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +580 -50
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,6 +51,40 @@ the UI did not make.
|
|
|
51
51
|
An interactive provider returns the customer to the page they started from. Pass `returnTo` to name
|
|
52
52
|
a different destination, or `null` to leave the server's `defaultReturnTo` in charge.
|
|
53
53
|
|
|
54
|
+
## The disconnected offer
|
|
55
|
+
|
|
56
|
+
Discovery names the provider whose nameservers serve the domain. `Connect.Prompt` states it beside a
|
|
57
|
+
trigger, and the dialog behind that trigger is narrowed to that provider, with the rest behind a
|
|
58
|
+
disclosure.
|
|
59
|
+
|
|
60
|
+
When no registered provider serves the zone there is nothing DomainKit can connect, so the flow
|
|
61
|
+
offers nothing. Pass `connect="always"` to offer the all-providers dialog anyway, or `connect="never"`
|
|
62
|
+
for a domain your application has already settled another way. A domain DomainKit holds keeps its
|
|
63
|
+
status and its disconnect whatever the invitation says.
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
<Domain.Flow domain="app.example.com" requirements={requirements} connect="always" />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Connecting is the customer saying yes to the records, so the plan opens itself the moment a
|
|
70
|
+
connection lands — after a token connect, and after the customer returns from a provider — and one
|
|
71
|
+
action adds them. `review="manual"` waits for the trigger instead.
|
|
72
|
+
|
|
73
|
+
`onState` reports what DomainKit has to say about the domain, so your own offers can be ordered
|
|
74
|
+
beside it rather than competing with it:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
<Domain.Flow
|
|
78
|
+
domain="app.example.com"
|
|
79
|
+
requirements={requirements}
|
|
80
|
+
onState={({ connected, offering, provider }) => setDomainKitOffers(connected || offering)}
|
|
81
|
+
/>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Letting a provider go is one dialog: `Disconnect` asks whether to remove the records an apply
|
|
85
|
+
receipt proves DomainKit created, removes them when the option stays checked, then releases the
|
|
86
|
+
connection. `Cleanup.Flow` is still exported for a host that wants removal on its own.
|
|
87
|
+
|
|
54
88
|
## Own one piece, keep the rest
|
|
55
89
|
|
|
56
90
|
Every part of the flow is a slot with a default.
|
|
@@ -68,10 +102,10 @@ Every part of the flow is a slot with a default.
|
|
|
68
102
|
|
|
69
103
|
| Slot | Receives | Default |
|
|
70
104
|
| -------------- | ----------------------------------------------- | ---------------------------------------------------------- |
|
|
71
|
-
| `connection` | `{ controller, domain }`
|
|
105
|
+
| `connection` | `{ controller, domain, connect }` | `Connect.Card` once connected, `Connect.Prompt` until then |
|
|
72
106
|
| `records` | `{ records, readiness, controller, domain }` | `Records.Table` |
|
|
73
107
|
| `verification` | `{ controller, domain }` | `Verify.Status` with per-requirement evidence |
|
|
74
|
-
| `actions` | `{ connection, provisioning, cleanup, domain }` | Review changes, Approve, Decline
|
|
108
|
+
| `actions` | `{ connection, provisioning, cleanup, domain }` | Review changes, Approve, Decline |
|
|
75
109
|
|
|
76
110
|
`Domain.Flow` adds no layout container around a slot: its output is a direct child of the flow root,
|
|
77
111
|
so your own grid can place it without `display: contents`.
|
|
@@ -121,8 +155,8 @@ one is gone, and re-runs the failed step otherwise.
|
|
|
121
155
|
## Presentation
|
|
122
156
|
|
|
123
157
|
`DomainKit.Root` takes `messages`, `marks`, `icons`, `theme`, `colorScheme`, and `portalContainer`,
|
|
124
|
-
so branding stays in your app. `Messages.Catalog` holds every user-visible string, including
|
|
125
|
-
|
|
158
|
+
so branding stays in your app. `Messages.Catalog` holds every user-visible string, including a
|
|
159
|
+
title and a description per `DomainKit.Error` reason; nothing renders a tag. Provider artwork comes from `marks`,
|
|
126
160
|
with the provider's initial as the fallback and no request at render time. The stylesheet is
|
|
127
161
|
opt-in and every color is a `--domainkit-*` custom property.
|
|
128
162
|
|
|
@@ -148,6 +182,20 @@ still wins. Any layer you declare after it wins the same way:
|
|
|
148
182
|
}
|
|
149
183
|
```
|
|
150
184
|
|
|
185
|
+
A failed step renders as `Outcome`: media, the catalog's title and description, and the retry the
|
|
186
|
+
flow allows, as a card or on one line. Pass your own parts as children and the words still come from
|
|
187
|
+
the catalog.
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
<Connect.Outcome controller={connection} layout="inline">
|
|
191
|
+
<Outcome.Media variant="default">
|
|
192
|
+
<MyIcon />
|
|
193
|
+
</Outcome.Media>
|
|
194
|
+
<Outcome.Title />
|
|
195
|
+
<Outcome.Content />
|
|
196
|
+
</Connect.Outcome>
|
|
197
|
+
```
|
|
198
|
+
|
|
151
199
|
Every dialog and popover takes a `render` prop that replaces the surface with your own.
|
|
152
200
|
|
|
153
201
|
## Next.js
|