@agentconsent/react 0.1.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/dist/index.cjs +2292 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1047 -0
- package/dist/index.d.ts +1047 -0
- package/dist/index.js +2243 -0
- package/dist/index.js.map +1 -0
- package/package.json +74 -0
- package/src/theme.css +1711 -0
- package/src/tokens.css +145 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1047 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Action Preview — show exactly what an agent is about to do before it
|
|
5
|
+
* executes, and collect an explicit approve/reject decision.
|
|
6
|
+
*
|
|
7
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
8
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
9
|
+
* for the default theme.
|
|
10
|
+
*
|
|
11
|
+
* Two render modes:
|
|
12
|
+
* - inline (default): a card inside the conversation/task surface
|
|
13
|
+
* - modal (`asModal`): a Radix AlertDialog — focus is trapped, initial
|
|
14
|
+
* focus lands on the reject (least destructive) action, and Escape
|
|
15
|
+
* rejects. Modal mode is controlled via `open` / `onOpenChange`.
|
|
16
|
+
*/
|
|
17
|
+
type ActionPreviewConsequence = "reversible" | "irreversible";
|
|
18
|
+
interface ActionPreviewRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
19
|
+
/** Called when the user approves the action. */
|
|
20
|
+
onApprove: () => void;
|
|
21
|
+
/** Called when the user rejects the action (button, or Escape in modal mode). */
|
|
22
|
+
onReject: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* How hard the action is to undo. Irreversible consequence shifts the
|
|
25
|
+
* approve button to destructive styling and changes nothing else —
|
|
26
|
+
* friction weighting beyond that belongs to the Irreversibility Gate
|
|
27
|
+
* pattern.
|
|
28
|
+
*/
|
|
29
|
+
consequence?: ActionPreviewConsequence;
|
|
30
|
+
/** Render as a modal AlertDialog instead of an inline card. */
|
|
31
|
+
asModal?: boolean;
|
|
32
|
+
/** Modal mode only: whether the dialog is open (controlled). */
|
|
33
|
+
open?: boolean;
|
|
34
|
+
/** Modal mode only: called when the dialog requests an open-state change. */
|
|
35
|
+
onOpenChange?: (open: boolean) => void;
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
type ActionPreviewHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
39
|
+
declare function Header$b(props: ActionPreviewHeaderProps): React.JSX.Element;
|
|
40
|
+
type ActionPreviewIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
41
|
+
declare function Icon$b(props: ActionPreviewIconProps): React.JSX.Element;
|
|
42
|
+
type ActionPreviewTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
43
|
+
/** The action, stated as a verb phrase: "Send email to Dana Ito". */
|
|
44
|
+
declare function Title$b(props: ActionPreviewTitleProps): React.JSX.Element;
|
|
45
|
+
type ActionPreviewFieldsProps = React.HTMLAttributes<HTMLDListElement>;
|
|
46
|
+
declare function Fields(props: ActionPreviewFieldsProps): React.JSX.Element;
|
|
47
|
+
interface ActionPreviewFieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
48
|
+
/** The fact's name: "To", "Amount", "File". */
|
|
49
|
+
label: React.ReactNode;
|
|
50
|
+
/** The fact's exact value — never a summary. */
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
declare function Field({ label, children, ...rest }: ActionPreviewFieldProps): React.JSX.Element;
|
|
54
|
+
interface ActionPreviewContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
55
|
+
/** Toggle label: "Message body", "Full diff". */
|
|
56
|
+
label: React.ReactNode;
|
|
57
|
+
defaultExpanded?: boolean;
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
declare function Content({ label, defaultExpanded, children, ...rest }: ActionPreviewContentProps): React.JSX.Element;
|
|
61
|
+
interface ActionPreviewSourceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
62
|
+
/** The agent requesting approval: "Inbox Assistant". */
|
|
63
|
+
agent: React.ReactNode;
|
|
64
|
+
/** The authority it acts under: task name, grant, or trigger. */
|
|
65
|
+
authority?: React.ReactNode;
|
|
66
|
+
}
|
|
67
|
+
declare function Source$1({ agent, authority, children, ...rest }: ActionPreviewSourceProps): React.JSX.Element;
|
|
68
|
+
type ActionPreviewActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
69
|
+
declare function Actions$8(props: ActionPreviewActionsProps): React.JSX.Element;
|
|
70
|
+
type ActionPreviewButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
71
|
+
declare const ActionPreview: {
|
|
72
|
+
Root: React.ForwardRefExoticComponent<ActionPreviewRootProps & React.RefAttributes<HTMLElement>>;
|
|
73
|
+
Header: typeof Header$b;
|
|
74
|
+
Icon: typeof Icon$b;
|
|
75
|
+
Title: typeof Title$b;
|
|
76
|
+
Fields: typeof Fields;
|
|
77
|
+
Field: typeof Field;
|
|
78
|
+
Content: typeof Content;
|
|
79
|
+
Source: typeof Source$1;
|
|
80
|
+
Actions: typeof Actions$8;
|
|
81
|
+
Approve: React.ForwardRefExoticComponent<ActionPreviewButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
82
|
+
Reject: React.ForwardRefExoticComponent<ActionPreviewButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Irreversibility Gate — a confirmation whose friction scales with the
|
|
87
|
+
* consequence of the action. Reversible actions confirm in a click;
|
|
88
|
+
* irreversible ones require a deliberate, legible gesture.
|
|
89
|
+
*
|
|
90
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
91
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
92
|
+
* for the default theme.
|
|
93
|
+
*
|
|
94
|
+
* The friction ladder is driven by `severity`:
|
|
95
|
+
* - "reversible": confirm is enabled immediately, neutral styling.
|
|
96
|
+
* - "undoable": confirm is enabled, but the gate advertises the undo
|
|
97
|
+
* window so the user knows the action is recoverable.
|
|
98
|
+
* - "irreversible": confirm styling turns destructive, and — when a
|
|
99
|
+
* `confirmPhrase` is supplied — stays disabled until the user types
|
|
100
|
+
* that exact phrase. Type-to-confirm is the accessible, deliberate
|
|
101
|
+
* alternative to hold-to-confirm (which is invisible to screen readers
|
|
102
|
+
* and punishing for motor impairments).
|
|
103
|
+
*
|
|
104
|
+
* Two render modes mirror Action Preview:
|
|
105
|
+
* - inline (default): a `role="group"` card
|
|
106
|
+
* - modal (`asModal`): a Radix AlertDialog — focus is trapped, initial
|
|
107
|
+
* focus lands on cancel (the least destructive action), and Escape
|
|
108
|
+
* cancels. Controlled via `open` / `onOpenChange`.
|
|
109
|
+
*/
|
|
110
|
+
type IrreversibilitySeverity = "reversible" | "undoable" | "irreversible";
|
|
111
|
+
interface IrreversibilityGateRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
112
|
+
/** Called when the user confirms the action. */
|
|
113
|
+
onConfirm: () => void;
|
|
114
|
+
/** Called when the user backs out (button, or Escape in modal mode). */
|
|
115
|
+
onCancel: () => void;
|
|
116
|
+
/**
|
|
117
|
+
* How hard the action is to undo. Scales the gate's friction and the
|
|
118
|
+
* confirm button's styling. Defaults to "irreversible" — the case this
|
|
119
|
+
* pattern exists for.
|
|
120
|
+
*/
|
|
121
|
+
severity?: IrreversibilitySeverity;
|
|
122
|
+
/**
|
|
123
|
+
* When set and `severity` is "irreversible", the confirm action stays
|
|
124
|
+
* disabled until the user types this exact phrase. Ignored at lower
|
|
125
|
+
* severities, where type-to-confirm would be gratuitous friction.
|
|
126
|
+
*/
|
|
127
|
+
confirmPhrase?: string;
|
|
128
|
+
/** Render as a modal AlertDialog instead of an inline card. */
|
|
129
|
+
asModal?: boolean;
|
|
130
|
+
/** Modal mode only: whether the dialog is open (controlled). */
|
|
131
|
+
open?: boolean;
|
|
132
|
+
/** Modal mode only: called when the dialog requests an open-state change. */
|
|
133
|
+
onOpenChange?: (open: boolean) => void;
|
|
134
|
+
children: React.ReactNode;
|
|
135
|
+
}
|
|
136
|
+
type IrreversibilityGateHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
137
|
+
declare function Header$a(props: IrreversibilityGateHeaderProps): React.JSX.Element;
|
|
138
|
+
type IrreversibilityGateIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
139
|
+
declare function Icon$a(props: IrreversibilityGateIconProps): React.JSX.Element;
|
|
140
|
+
type IrreversibilityGateTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
141
|
+
/** The action, stated as a verb phrase: "Delete 1,240 files". */
|
|
142
|
+
declare function Title$a(props: IrreversibilityGateTitleProps): React.JSX.Element;
|
|
143
|
+
type IrreversibilityGateDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
144
|
+
/** One line of framing above the enumerated consequences. */
|
|
145
|
+
declare function Description$7(props: IrreversibilityGateDescriptionProps): React.JSX.Element;
|
|
146
|
+
type IrreversibilityGateConsequencesProps = React.HTMLAttributes<HTMLUListElement>;
|
|
147
|
+
declare function Consequences(props: IrreversibilityGateConsequencesProps): React.JSX.Element;
|
|
148
|
+
type IrreversibilityGateConsequenceProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
149
|
+
/** One concrete, specific effect: "Permanently deletes 1,240 files". */
|
|
150
|
+
declare function Consequence$1({ children, ...rest }: IrreversibilityGateConsequenceProps): React.JSX.Element;
|
|
151
|
+
type IrreversibilityGateConfirmFieldProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "id">;
|
|
152
|
+
/**
|
|
153
|
+
* The type-to-confirm input. Renders only when the gate actually requires
|
|
154
|
+
* a phrase (severity "irreversible" + a `confirmPhrase`); otherwise it
|
|
155
|
+
* renders nothing, so demos can leave it in the tree unconditionally.
|
|
156
|
+
*/
|
|
157
|
+
declare function ConfirmField({ children, ...rest }: IrreversibilityGateConfirmFieldProps & {
|
|
158
|
+
children?: React.ReactNode;
|
|
159
|
+
}): React.JSX.Element | null;
|
|
160
|
+
type IrreversibilityGateActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
161
|
+
declare function Actions$7(props: IrreversibilityGateActionsProps): React.JSX.Element;
|
|
162
|
+
type IrreversibilityGateButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
163
|
+
declare const IrreversibilityGate: {
|
|
164
|
+
Root: React.ForwardRefExoticComponent<IrreversibilityGateRootProps & React.RefAttributes<HTMLElement>>;
|
|
165
|
+
Header: typeof Header$a;
|
|
166
|
+
Icon: typeof Icon$a;
|
|
167
|
+
Title: typeof Title$a;
|
|
168
|
+
Description: typeof Description$7;
|
|
169
|
+
Consequences: typeof Consequences;
|
|
170
|
+
Consequence: typeof Consequence$1;
|
|
171
|
+
ConfirmField: typeof ConfirmField;
|
|
172
|
+
Actions: typeof Actions$7;
|
|
173
|
+
Confirm: React.ForwardRefExoticComponent<IrreversibilityGateButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
174
|
+
Cancel: React.ForwardRefExoticComponent<IrreversibilityGateButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Scoped Grant — the consent screen for connecting an agent to a service.
|
|
179
|
+
* Where an OAuth scope list says "access your email", this pattern makes the
|
|
180
|
+
* capability granularity legible: which resources, and read vs. write vs.
|
|
181
|
+
* delete, each as an individually reviewable, toggleable permission.
|
|
182
|
+
*
|
|
183
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
184
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
185
|
+
* for the default theme.
|
|
186
|
+
*
|
|
187
|
+
* Selection is a set of granted scope ids, controllable via `value` /
|
|
188
|
+
* `onValueChange` or uncontrolled via `defaultValue`. Mandatory scopes are
|
|
189
|
+
* declared once at the root (`requiredScopes`) so the grant payload has a
|
|
190
|
+
* single source of truth and children never need to self-register.
|
|
191
|
+
*/
|
|
192
|
+
type ScopeAccess = "read" | "write" | "delete";
|
|
193
|
+
interface ScopedGrantRootProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
194
|
+
/** Granted scope ids (controlled). */
|
|
195
|
+
value?: string[];
|
|
196
|
+
/** Initial granted scope ids (uncontrolled). */
|
|
197
|
+
defaultValue?: string[];
|
|
198
|
+
/** Called whenever the granted set changes. */
|
|
199
|
+
onValueChange?: (ids: string[]) => void;
|
|
200
|
+
/**
|
|
201
|
+
* Scope ids that are mandatory for the connection to function. They are
|
|
202
|
+
* always granted, render as locked, and are always present in the grant
|
|
203
|
+
* payload — declared here so payload/count have one source of truth.
|
|
204
|
+
*/
|
|
205
|
+
requiredScopes?: string[];
|
|
206
|
+
/** Called with the final granted ids when the user confirms the grant. */
|
|
207
|
+
onGrant: (ids: string[]) => void;
|
|
208
|
+
/** Called when the user declines to connect. */
|
|
209
|
+
onCancel?: () => void;
|
|
210
|
+
children: React.ReactNode;
|
|
211
|
+
}
|
|
212
|
+
type ScopedGrantHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
213
|
+
declare function Header$9(props: ScopedGrantHeaderProps): React.JSX.Element;
|
|
214
|
+
type ScopedGrantIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
215
|
+
declare function Icon$9(props: ScopedGrantIconProps): React.JSX.Element;
|
|
216
|
+
type ScopedGrantTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
217
|
+
/** What is being connected to what: "Connect Inbox Assistant to Gmail". */
|
|
218
|
+
declare function Title$9(props: ScopedGrantTitleProps): React.JSX.Element;
|
|
219
|
+
type ScopedGrantDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
220
|
+
declare function Description$6(props: ScopedGrantDescriptionProps): React.JSX.Element;
|
|
221
|
+
interface ScopedGrantGroupProps extends Omit<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, "resource"> {
|
|
222
|
+
/** The resource this cluster of scopes applies to: "Gmail". */
|
|
223
|
+
label: React.ReactNode;
|
|
224
|
+
/** How the resource is narrowed: "Board 2026 label only". */
|
|
225
|
+
resource?: React.ReactNode;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Clusters scopes by the resource they touch, so "read" against one folder
|
|
229
|
+
* and "delete" against the whole account are never conflated. Renders a
|
|
230
|
+
* fieldset/legend so assistive tech announces the grouping.
|
|
231
|
+
*/
|
|
232
|
+
declare function Group({ label, resource, children, ...rest }: ScopedGrantGroupProps): React.JSX.Element;
|
|
233
|
+
interface ScopedGrantScopeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "id"> {
|
|
234
|
+
/** Stable id used in the granted set and `requiredScopes`. */
|
|
235
|
+
id: string;
|
|
236
|
+
/** Power level of this capability — surfaced as a text badge, never color alone. */
|
|
237
|
+
access: ScopeAccess;
|
|
238
|
+
/** Plain-language capability name: "Send messages on your behalf". */
|
|
239
|
+
label: React.ReactNode;
|
|
240
|
+
/** What granting it actually lets the agent do. */
|
|
241
|
+
description?: React.ReactNode;
|
|
242
|
+
}
|
|
243
|
+
declare function Scope$1({ id, access, label, description, ...rest }: ScopedGrantScopeProps): React.JSX.Element;
|
|
244
|
+
type ScopedGrantActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
245
|
+
declare function Actions$6(props: ScopedGrantActionsProps): React.JSX.Element;
|
|
246
|
+
interface ScopedGrantGrantProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
247
|
+
/**
|
|
248
|
+
* Button content. As a render function it receives the live grant count,
|
|
249
|
+
* so the label can read "Grant 3 permissions" without lifting state.
|
|
250
|
+
*/
|
|
251
|
+
children: React.ReactNode | ((state: {
|
|
252
|
+
count: number;
|
|
253
|
+
}) => React.ReactNode);
|
|
254
|
+
}
|
|
255
|
+
type ScopedGrantCancelProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
256
|
+
declare const ScopedGrant: {
|
|
257
|
+
Root: React.ForwardRefExoticComponent<ScopedGrantRootProps & React.RefAttributes<HTMLFormElement>>;
|
|
258
|
+
Header: typeof Header$9;
|
|
259
|
+
Icon: typeof Icon$9;
|
|
260
|
+
Title: typeof Title$9;
|
|
261
|
+
Description: typeof Description$6;
|
|
262
|
+
Group: typeof Group;
|
|
263
|
+
Scope: typeof Scope$1;
|
|
264
|
+
Actions: typeof Actions$6;
|
|
265
|
+
Grant: React.ForwardRefExoticComponent<ScopedGrantGrantProps & React.RefAttributes<HTMLButtonElement>>;
|
|
266
|
+
Cancel: React.ForwardRefExoticComponent<ScopedGrantCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
interface ProgressiveScopeRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
270
|
+
/** Power level of the newly requested capability — surfaced as a text badge. */
|
|
271
|
+
access?: ScopeAccess;
|
|
272
|
+
/** Grant the capability for only the blocked action. */
|
|
273
|
+
onAllowOnce: () => void;
|
|
274
|
+
/** Escalate the capability into the standing grant. */
|
|
275
|
+
onAllowAlways: () => void;
|
|
276
|
+
/** Refuse the escalation (button, or Escape in modal mode). */
|
|
277
|
+
onDeny: () => void;
|
|
278
|
+
/** Render as a modal AlertDialog instead of an inline card. */
|
|
279
|
+
asModal?: boolean;
|
|
280
|
+
/** Modal mode only: whether the dialog is open (controlled). */
|
|
281
|
+
open?: boolean;
|
|
282
|
+
/** Modal mode only: called when the dialog requests an open-state change. */
|
|
283
|
+
onOpenChange?: (open: boolean) => void;
|
|
284
|
+
children: React.ReactNode;
|
|
285
|
+
}
|
|
286
|
+
type ProgressiveScopeHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
287
|
+
declare function Header$8(props: ProgressiveScopeHeaderProps): React.JSX.Element;
|
|
288
|
+
type ProgressiveScopeIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
289
|
+
declare function Icon$8(props: ProgressiveScopeIconProps): React.JSX.Element;
|
|
290
|
+
type ProgressiveScopeTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
291
|
+
/** The ask, stated plainly: "Inbox Assistant needs to send email". */
|
|
292
|
+
declare function Title$8(props: ProgressiveScopeTitleProps): React.JSX.Element;
|
|
293
|
+
type ProgressiveScopeReasonProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
294
|
+
/**
|
|
295
|
+
* Why the agent is asking now — tied to the concrete, blocked action.
|
|
296
|
+
* "To reply to the vendor, it needs to send email on your behalf."
|
|
297
|
+
*/
|
|
298
|
+
declare function Reason(props: ProgressiveScopeReasonProps): React.JSX.Element;
|
|
299
|
+
interface ProgressiveScopeRequestProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
300
|
+
/** Plain-language capability being requested: "Send email on your behalf". */
|
|
301
|
+
label: React.ReactNode;
|
|
302
|
+
/** What granting it lets the agent do. */
|
|
303
|
+
description?: React.ReactNode;
|
|
304
|
+
}
|
|
305
|
+
declare function Request({ label, description, ...rest }: ProgressiveScopeRequestProps): React.JSX.Element;
|
|
306
|
+
type ProgressiveScopeCurrentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
307
|
+
/**
|
|
308
|
+
* Frames the escalation as additive by naming the standing grant it builds
|
|
309
|
+
* on: "Inbox Assistant can already read this label."
|
|
310
|
+
*/
|
|
311
|
+
declare function Current({ children, ...rest }: ProgressiveScopeCurrentProps): React.JSX.Element;
|
|
312
|
+
type ProgressiveScopeActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
313
|
+
declare function Actions$5(props: ProgressiveScopeActionsProps): React.JSX.Element;
|
|
314
|
+
type ProgressiveScopeButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
315
|
+
declare const ProgressiveScope: {
|
|
316
|
+
Root: React.ForwardRefExoticComponent<ProgressiveScopeRootProps & React.RefAttributes<HTMLElement>>;
|
|
317
|
+
Header: typeof Header$8;
|
|
318
|
+
Icon: typeof Icon$8;
|
|
319
|
+
Title: typeof Title$8;
|
|
320
|
+
Reason: typeof Reason;
|
|
321
|
+
Request: typeof Request;
|
|
322
|
+
Current: typeof Current;
|
|
323
|
+
Actions: typeof Actions$5;
|
|
324
|
+
AllowOnce: React.ForwardRefExoticComponent<ProgressiveScopeButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
325
|
+
AllowAlways: React.ForwardRefExoticComponent<ProgressiveScopeButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
326
|
+
Deny: React.ForwardRefExoticComponent<ProgressiveScopeButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Batch Approval — a review queue for a run of agent-proposed actions.
|
|
331
|
+
* Reviewing agent work one modal at a time causes approval fatigue: the user
|
|
332
|
+
* falls into a rhythm and starts rubber-stamping. Batch Approval gives the
|
|
333
|
+
* queue triage affordances — select many, approve or reject as a group — while
|
|
334
|
+
* deliberately refusing to let the highest-stakes items be swept up in a bulk
|
|
335
|
+
* "approve all".
|
|
336
|
+
*
|
|
337
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
338
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
339
|
+
* for the default theme.
|
|
340
|
+
*
|
|
341
|
+
* The queue is declared once at the root (`items`) so selection eligibility
|
|
342
|
+
* and counts have a single source of truth — mirroring Scoped Grant's
|
|
343
|
+
* `requiredScopes`. An item flagged `requiresReview` is excluded from
|
|
344
|
+
* select-all and from batch actions: it can only be approved or rejected
|
|
345
|
+
* on its own row, so the item that most needs a human never gets a group pass.
|
|
346
|
+
*
|
|
347
|
+
* Selection is a set of item ids, controllable via `value` / `onValueChange`
|
|
348
|
+
* or uncontrolled via `defaultValue`.
|
|
349
|
+
*/
|
|
350
|
+
interface BatchApprovalItem {
|
|
351
|
+
/** Stable id used in the selection set and in approve/reject payloads. */
|
|
352
|
+
id: string;
|
|
353
|
+
/**
|
|
354
|
+
* When true the item is high-stakes: it is never selectable in bulk and is
|
|
355
|
+
* excluded from select-all and the batch actions. It must be decided on its
|
|
356
|
+
* own row. Irreversible or ambiguous actions belong here.
|
|
357
|
+
*/
|
|
358
|
+
requiresReview?: boolean;
|
|
359
|
+
}
|
|
360
|
+
interface BatchApprovalRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
361
|
+
/**
|
|
362
|
+
* The queue, declared once so selection eligibility and counts have one
|
|
363
|
+
* source of truth. Order is presentation-only; children still render each
|
|
364
|
+
* row. Items marked `requiresReview` are excluded from bulk selection.
|
|
365
|
+
*/
|
|
366
|
+
items: BatchApprovalItem[];
|
|
367
|
+
/** Selected item ids (controlled). */
|
|
368
|
+
value?: string[];
|
|
369
|
+
/** Initial selected item ids (uncontrolled). */
|
|
370
|
+
defaultValue?: string[];
|
|
371
|
+
/** Called whenever the selection changes. */
|
|
372
|
+
onValueChange?: (ids: string[]) => void;
|
|
373
|
+
/** Called with the ids the user approved (one id per row, many for batch). */
|
|
374
|
+
onApprove: (ids: string[]) => void;
|
|
375
|
+
/** Called with the ids the user rejected. */
|
|
376
|
+
onReject: (ids: string[]) => void;
|
|
377
|
+
children: React.ReactNode;
|
|
378
|
+
}
|
|
379
|
+
type BatchApprovalHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
380
|
+
declare function Header$7(props: BatchApprovalHeaderProps): React.JSX.Element;
|
|
381
|
+
type BatchApprovalIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
382
|
+
declare function Icon$7(props: BatchApprovalIconProps): React.JSX.Element;
|
|
383
|
+
type BatchApprovalTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
384
|
+
/** What the queue is: "Agent proposed 6 actions". */
|
|
385
|
+
declare function Title$7(props: BatchApprovalTitleProps): React.JSX.Element;
|
|
386
|
+
type BatchApprovalDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
387
|
+
declare function Description$5(props: BatchApprovalDescriptionProps): React.JSX.Element;
|
|
388
|
+
type BatchApprovalToolbarProps = React.HTMLAttributes<HTMLDivElement>;
|
|
389
|
+
/**
|
|
390
|
+
* The batch triage bar. Holds `SelectAll`, a live `SelectionCount`, and the
|
|
391
|
+
* batch `Approve` / `Reject` buttons — all scoped to the selectable items.
|
|
392
|
+
*/
|
|
393
|
+
declare function Toolbar(props: BatchApprovalToolbarProps): React.JSX.Element;
|
|
394
|
+
type BatchApprovalSelectAllProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
395
|
+
/** Label content; defaults to "Select all reviewable". */
|
|
396
|
+
children?: React.ReactNode;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Selects every *selectable* item at once — items marked `requiresReview` are
|
|
400
|
+
* never included, so "select all" can never sweep up the item that most needs
|
|
401
|
+
* a person. Reflects the mixed state as `indeterminate`.
|
|
402
|
+
*/
|
|
403
|
+
declare function SelectAll({ children, ...rest }: BatchApprovalSelectAllProps): React.JSX.Element;
|
|
404
|
+
interface BatchApprovalSelectionCountProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
405
|
+
/**
|
|
406
|
+
* Render function receiving the live counts, so a label can read
|
|
407
|
+
* "3 of 5 selected" without lifting state. Defaults to "{n} selected".
|
|
408
|
+
*/
|
|
409
|
+
children?: (state: {
|
|
410
|
+
selectedCount: number;
|
|
411
|
+
selectableCount: number;
|
|
412
|
+
}) => React.ReactNode;
|
|
413
|
+
}
|
|
414
|
+
/** Live, polite count of what a batch action would touch. */
|
|
415
|
+
declare function SelectionCount({ children, ...rest }: BatchApprovalSelectionCountProps): React.JSX.Element;
|
|
416
|
+
type BatchApprovalButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
417
|
+
type BatchApprovalListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
418
|
+
declare function List$2(props: BatchApprovalListProps): React.JSX.Element;
|
|
419
|
+
interface BatchApprovalItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "id" | "title"> {
|
|
420
|
+
/** Stable id; must appear in the root's `items`. */
|
|
421
|
+
id: string;
|
|
422
|
+
/** The proposed action, as a verb phrase: "Send reply to Dana Okafor". */
|
|
423
|
+
title: React.ReactNode;
|
|
424
|
+
/** One line of specifics under the title. */
|
|
425
|
+
detail?: React.ReactNode;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* One row of the queue. Renders its own selection checkbox — disabled and
|
|
429
|
+
* replaced with a "review individually" flag when the item `requiresReview`.
|
|
430
|
+
* Per-row action buttons (`Item.Approve` / `Item.Reject`) go in `children`.
|
|
431
|
+
*/
|
|
432
|
+
declare function Item({ id, title, detail, children, ...rest }: BatchApprovalItemProps): React.JSX.Element;
|
|
433
|
+
declare const BatchApproval: {
|
|
434
|
+
Root: React.ForwardRefExoticComponent<BatchApprovalRootProps & React.RefAttributes<HTMLElement>>;
|
|
435
|
+
Header: typeof Header$7;
|
|
436
|
+
Icon: typeof Icon$7;
|
|
437
|
+
Title: typeof Title$7;
|
|
438
|
+
Description: typeof Description$5;
|
|
439
|
+
Toolbar: typeof Toolbar;
|
|
440
|
+
SelectAll: typeof SelectAll;
|
|
441
|
+
SelectionCount: typeof SelectionCount;
|
|
442
|
+
BatchApprove: React.ForwardRefExoticComponent<BatchApprovalButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
443
|
+
BatchReject: React.ForwardRefExoticComponent<BatchApprovalButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
444
|
+
List: typeof List$2;
|
|
445
|
+
Item: typeof Item;
|
|
446
|
+
ItemApprove: React.ForwardRefExoticComponent<BatchApprovalButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
447
|
+
ItemReject: React.ForwardRefExoticComponent<BatchApprovalButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Consent Memory — the choice of *how long* a permission lasts, made legible.
|
|
452
|
+
* When an agent asks to do something, "Always allow" is the fastest way out of
|
|
453
|
+
* the prompt, so users pick it under task focus without registering that they
|
|
454
|
+
* just signed a standing grant. This pattern turns durability into a first-
|
|
455
|
+
* class, reviewable decision: every option spells out the future it commits
|
|
456
|
+
* you to, and the least-standing choice is the resting default.
|
|
457
|
+
*
|
|
458
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
459
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
460
|
+
* for the default theme.
|
|
461
|
+
*
|
|
462
|
+
* The selected option is controllable via `value` / `onValueChange` or
|
|
463
|
+
* uncontrolled via `defaultValue`. The confirm button reports the chosen
|
|
464
|
+
* durability so its label and the payload have a single source of truth.
|
|
465
|
+
*/
|
|
466
|
+
/**
|
|
467
|
+
* How long the grant persists. `once` is the safe default; the others are
|
|
468
|
+
* standing to increasing degrees — `scoped` binds to a narrow condition,
|
|
469
|
+
* `always` is an unconditional standing grant.
|
|
470
|
+
*/
|
|
471
|
+
type ConsentDurability = "once" | "session" | "scoped" | "always";
|
|
472
|
+
interface ConsentMemoryRootProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
473
|
+
/** Selected option value (controlled). */
|
|
474
|
+
value?: string;
|
|
475
|
+
/** Initial selected option value (uncontrolled). Point it at the `once` option. */
|
|
476
|
+
defaultValue?: string;
|
|
477
|
+
/** Called when the selected durability option changes. */
|
|
478
|
+
onValueChange?: (value: string) => void;
|
|
479
|
+
/** Called with the chosen option value when the user confirms. */
|
|
480
|
+
onAllow: (value: string) => void;
|
|
481
|
+
/** Called when the user declines entirely. */
|
|
482
|
+
onDeny: () => void;
|
|
483
|
+
children: React.ReactNode;
|
|
484
|
+
}
|
|
485
|
+
type ConsentMemoryHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
486
|
+
declare function Header$6(props: ConsentMemoryHeaderProps): React.JSX.Element;
|
|
487
|
+
type ConsentMemoryIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
488
|
+
declare function Icon$6(props: ConsentMemoryIconProps): React.JSX.Element;
|
|
489
|
+
type ConsentMemoryTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
490
|
+
/** The permission being asked about: "Allow Inbox Assistant to send email?". */
|
|
491
|
+
declare function Title$6(props: ConsentMemoryTitleProps): React.JSX.Element;
|
|
492
|
+
type ConsentMemoryDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
493
|
+
/** The concrete action prompting the request, above the durability choice. */
|
|
494
|
+
declare function Description$4(props: ConsentMemoryDescriptionProps): React.JSX.Element;
|
|
495
|
+
type ConsentMemoryOptionsProps = React.FieldsetHTMLAttributes<HTMLFieldSetElement> & {
|
|
496
|
+
/** Legend for the durability choice; defaults to "Apply this decision:". */
|
|
497
|
+
legend?: React.ReactNode;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* The set of durability choices, as a radio group. Renders a fieldset/legend
|
|
501
|
+
* so assistive tech announces "how long should this apply" as one grouping.
|
|
502
|
+
*/
|
|
503
|
+
declare function Options({ legend, children, ...rest }: ConsentMemoryOptionsProps): React.JSX.Element;
|
|
504
|
+
interface ConsentMemoryOptionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
505
|
+
/** Stable value passed to `onAllow` when this option is selected. */
|
|
506
|
+
value: string;
|
|
507
|
+
/** How standing this grant is — drives styling and the confirm label. */
|
|
508
|
+
durability: ConsentDurability;
|
|
509
|
+
/** The choice itself: "Always, for this recipient". */
|
|
510
|
+
label: React.ReactNode;
|
|
511
|
+
/**
|
|
512
|
+
* The future this choice commits to, in plain language: "The agent can email
|
|
513
|
+
* Dana any time without asking again." This is the point of the pattern.
|
|
514
|
+
*/
|
|
515
|
+
consequence: React.ReactNode;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* One durability choice. The radio and its consequence are bound together so
|
|
519
|
+
* the standing implication is never more than a line from the choice itself.
|
|
520
|
+
*/
|
|
521
|
+
declare function Option({ value, durability, label, consequence, ...rest }: ConsentMemoryOptionProps): React.JSX.Element;
|
|
522
|
+
type ConsentMemoryActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
523
|
+
declare function Actions$4(props: ConsentMemoryActionsProps): React.JSX.Element;
|
|
524
|
+
interface ConsentMemoryAllowProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
525
|
+
/**
|
|
526
|
+
* Button content. As a render function it receives the selected durability,
|
|
527
|
+
* so the label can read "Allow always" vs "Allow once" without lifting state.
|
|
528
|
+
*/
|
|
529
|
+
children: React.ReactNode | ((state: {
|
|
530
|
+
durability: ConsentDurability | null;
|
|
531
|
+
}) => React.ReactNode);
|
|
532
|
+
}
|
|
533
|
+
type ConsentMemoryDenyProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
534
|
+
declare const ConsentMemory: {
|
|
535
|
+
Root: React.ForwardRefExoticComponent<ConsentMemoryRootProps & React.RefAttributes<HTMLFormElement>>;
|
|
536
|
+
Header: typeof Header$6;
|
|
537
|
+
Icon: typeof Icon$6;
|
|
538
|
+
Title: typeof Title$6;
|
|
539
|
+
Description: typeof Description$4;
|
|
540
|
+
Options: typeof Options;
|
|
541
|
+
Option: typeof Option;
|
|
542
|
+
Actions: typeof Actions$4;
|
|
543
|
+
Allow: React.ForwardRefExoticComponent<ConsentMemoryAllowProps & React.RefAttributes<HTMLButtonElement>>;
|
|
544
|
+
Deny: React.ForwardRefExoticComponent<ConsentMemoryDenyProps & React.RefAttributes<HTMLButtonElement>>;
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* How much standing authority a capability carries.
|
|
549
|
+
* - `auto`: the agent may do it unattended.
|
|
550
|
+
* - `ask`: the agent must ask for confirmation each time (the safe default).
|
|
551
|
+
* - `never`: the agent may not do it at all.
|
|
552
|
+
*/
|
|
553
|
+
type AuthorityLevel = "auto" | "ask" | "never";
|
|
554
|
+
declare const AUTHORITY_LEVELS: AuthorityLevel[];
|
|
555
|
+
interface AuthorityBoundaryRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "defaultValue"> {
|
|
556
|
+
/** Capability id → authority level (controlled). */
|
|
557
|
+
value?: Record<string, AuthorityLevel>;
|
|
558
|
+
/** Initial capability id → authority level (uncontrolled). */
|
|
559
|
+
defaultValue?: Record<string, AuthorityLevel>;
|
|
560
|
+
/** Called with the full level map whenever any capability changes. */
|
|
561
|
+
onValueChange?: (value: Record<string, AuthorityLevel>) => void;
|
|
562
|
+
children: React.ReactNode;
|
|
563
|
+
}
|
|
564
|
+
type AuthorityBoundaryHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
565
|
+
declare function Header$5(props: AuthorityBoundaryHeaderProps): React.JSX.Element;
|
|
566
|
+
type AuthorityBoundaryIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
567
|
+
declare function Icon$5(props: AuthorityBoundaryIconProps): React.JSX.Element;
|
|
568
|
+
type AuthorityBoundaryTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
569
|
+
/** The question the surface answers: "What can Inbox Assistant do on its own?". */
|
|
570
|
+
declare function Title$5(props: AuthorityBoundaryTitleProps): React.JSX.Element;
|
|
571
|
+
type AuthorityBoundaryDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
572
|
+
declare function Description$3(props: AuthorityBoundaryDescriptionProps): React.JSX.Element;
|
|
573
|
+
interface AuthorityBoundarySummaryProps extends Omit<React.HTMLAttributes<HTMLParagraphElement>, "children"> {
|
|
574
|
+
/**
|
|
575
|
+
* Render function receiving the live per-level counts, so the surface can
|
|
576
|
+
* state "3 automatic · 2 ask first · 1 never" at a glance.
|
|
577
|
+
*/
|
|
578
|
+
children: (counts: Record<AuthorityLevel, number>) => React.ReactNode;
|
|
579
|
+
}
|
|
580
|
+
/** A live, at-a-glance tally of how much standing authority is granted. */
|
|
581
|
+
declare function Summary$1({ children, ...rest }: AuthorityBoundarySummaryProps): React.JSX.Element;
|
|
582
|
+
type AuthorityBoundaryListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
583
|
+
declare function List$1(props: AuthorityBoundaryListProps): React.JSX.Element;
|
|
584
|
+
interface AuthorityBoundaryCapabilityProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "id"> {
|
|
585
|
+
/** Stable id used as the key in the level map. */
|
|
586
|
+
id: string;
|
|
587
|
+
/** Power level of this capability — a text badge, never color alone. */
|
|
588
|
+
access: ScopeAccess;
|
|
589
|
+
/** Plain-language capability name: "Send email on your behalf". */
|
|
590
|
+
label: React.ReactNode;
|
|
591
|
+
/** What the agent does with this capability. */
|
|
592
|
+
description?: React.ReactNode;
|
|
593
|
+
/**
|
|
594
|
+
* Levels this capability may not be set to. Use it to forbid `auto` on an
|
|
595
|
+
* irreversible capability, so the UI can't grant standing authority to
|
|
596
|
+
* something that should always be confirmed.
|
|
597
|
+
*/
|
|
598
|
+
disallow?: AuthorityLevel[];
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* One capability row with its segmented authority control. The control is a
|
|
602
|
+
* real radio group (a fieldset with a screen-reader legend naming the
|
|
603
|
+
* capability), so each capability's authority is an independent, labelled
|
|
604
|
+
* choice.
|
|
605
|
+
*/
|
|
606
|
+
declare function Capability({ id, access, label, description, disallow, ...rest }: AuthorityBoundaryCapabilityProps): React.JSX.Element;
|
|
607
|
+
declare const AuthorityBoundary: {
|
|
608
|
+
Root: React.ForwardRefExoticComponent<AuthorityBoundaryRootProps & React.RefAttributes<HTMLElement>>;
|
|
609
|
+
Header: typeof Header$5;
|
|
610
|
+
Icon: typeof Icon$5;
|
|
611
|
+
Title: typeof Title$5;
|
|
612
|
+
Description: typeof Description$3;
|
|
613
|
+
Summary: typeof Summary$1;
|
|
614
|
+
List: typeof List$1;
|
|
615
|
+
Capability: typeof Capability;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Spend & Rate Limits — numeric guardrails treated as consent primitives, not
|
|
620
|
+
* billing settings. A budget cap, an action count, a time window: each is a
|
|
621
|
+
* standing decision about how far an agent may go before it has to come back
|
|
622
|
+
* and ask. This pattern gives those numbers one surface, shows each cap against
|
|
623
|
+
* live usage so the boundary is legible, and makes clear that reaching a cap is
|
|
624
|
+
* a *consent* event — the agent pauses and asks rather than silently stopping.
|
|
625
|
+
*
|
|
626
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
627
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
628
|
+
* for the default theme.
|
|
629
|
+
*
|
|
630
|
+
* Usage facts (`limits`) are declared once at the Root — the single source of
|
|
631
|
+
* truth for consumption and the summary tally. The caps are controllable via
|
|
632
|
+
* `value` / `onValueChange` or uncontrolled via `defaultValue` (a record of
|
|
633
|
+
* limit id → cap). A limit with no cap entry is treated as having no limit set.
|
|
634
|
+
*/
|
|
635
|
+
/** Whether a limit meters money (`spend`) or a count of actions (`rate`). */
|
|
636
|
+
type SpendLimitKind = "spend" | "rate";
|
|
637
|
+
/** The window a cap resets over. */
|
|
638
|
+
type SpendLimitPeriod = "day" | "week" | "month";
|
|
639
|
+
/**
|
|
640
|
+
* How a limit stands against its cap.
|
|
641
|
+
* - `none`: no cap set — the agent is unbounded on this axis.
|
|
642
|
+
* - `ok`: comfortably under the cap.
|
|
643
|
+
* - `warning`: at or past 80% of the cap.
|
|
644
|
+
* - `reached`: at or over the cap; the agent must ask before doing more.
|
|
645
|
+
*/
|
|
646
|
+
type SpendLimitState = "none" | "ok" | "warning" | "reached";
|
|
647
|
+
/** A consumption fact: how much of a limit has been used so far this window. */
|
|
648
|
+
interface SpendLimitUsage {
|
|
649
|
+
/** Stable id, keyed to a `Limit` child and to the cap map. */
|
|
650
|
+
id: string;
|
|
651
|
+
/** Amount consumed this window — dollars for `spend`, a count for `rate`. */
|
|
652
|
+
used: number;
|
|
653
|
+
}
|
|
654
|
+
interface SpendLimitsSummary {
|
|
655
|
+
total: number;
|
|
656
|
+
ok: number;
|
|
657
|
+
warning: number;
|
|
658
|
+
reached: number;
|
|
659
|
+
}
|
|
660
|
+
interface SpendLimitsRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "defaultValue"> {
|
|
661
|
+
/**
|
|
662
|
+
* Consumption facts, one per limit — the single source of truth for usage and
|
|
663
|
+
* the summary tally. Declare every limit you render a `Limit` for.
|
|
664
|
+
*/
|
|
665
|
+
limits: SpendLimitUsage[];
|
|
666
|
+
/** Limit id → cap (controlled). */
|
|
667
|
+
value?: Record<string, number>;
|
|
668
|
+
/** Initial limit id → cap (uncontrolled). */
|
|
669
|
+
defaultValue?: Record<string, number>;
|
|
670
|
+
/** Called with the full cap map whenever any cap changes. */
|
|
671
|
+
onValueChange?: (value: Record<string, number>) => void;
|
|
672
|
+
children: React.ReactNode;
|
|
673
|
+
}
|
|
674
|
+
type SpendLimitsHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
675
|
+
declare function Header$4(props: SpendLimitsHeaderProps): React.JSX.Element;
|
|
676
|
+
type SpendLimitsIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
677
|
+
declare function Icon$4(props: SpendLimitsIconProps): React.JSX.Element;
|
|
678
|
+
type SpendLimitsTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
679
|
+
/** The question the surface answers: "How far can Shopping Agent go alone?". */
|
|
680
|
+
declare function Title$4(props: SpendLimitsTitleProps): React.JSX.Element;
|
|
681
|
+
type SpendLimitsDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
682
|
+
declare function Description$2(props: SpendLimitsDescriptionProps): React.JSX.Element;
|
|
683
|
+
interface SpendLimitsSummaryProps extends Omit<React.HTMLAttributes<HTMLParagraphElement>, "children"> {
|
|
684
|
+
/**
|
|
685
|
+
* Render function receiving the live per-state counts, so the surface can
|
|
686
|
+
* state "1 cap reached · 1 near cap" at a glance.
|
|
687
|
+
*/
|
|
688
|
+
children: (summary: SpendLimitsSummary) => React.ReactNode;
|
|
689
|
+
}
|
|
690
|
+
/** A live, at-a-glance read of how close the agent is to its guardrails. */
|
|
691
|
+
declare function Summary({ children, ...rest }: SpendLimitsSummaryProps): React.JSX.Element;
|
|
692
|
+
type SpendLimitsListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
693
|
+
declare function List(props: SpendLimitsListProps): React.JSX.Element;
|
|
694
|
+
interface SpendLimitsLimitProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "id"> {
|
|
695
|
+
/** Stable id used to look up usage and the cap. */
|
|
696
|
+
id: string;
|
|
697
|
+
/** Whether this limit meters money or a count of actions. */
|
|
698
|
+
kind: SpendLimitKind;
|
|
699
|
+
/**
|
|
700
|
+
* The unit. For `spend`, a currency symbol shown before the amount ("$").
|
|
701
|
+
* For `rate`, the noun shown after it ("emails", "API calls").
|
|
702
|
+
*/
|
|
703
|
+
unit: string;
|
|
704
|
+
/** The window this cap resets over. */
|
|
705
|
+
period: SpendLimitPeriod;
|
|
706
|
+
/** Plain-language name for the guardrail: "Purchases". */
|
|
707
|
+
label: React.ReactNode;
|
|
708
|
+
/** What the agent spends this budget on. */
|
|
709
|
+
description?: React.ReactNode;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* One guardrail row: a labelled cap, a meter of usage against it, and an
|
|
713
|
+
* editable number so the user can tighten or loosen the boundary in place. The
|
|
714
|
+
* cap is a real number input, labelled per limit, so the guardrail is a single,
|
|
715
|
+
* legible, keyboard-accessible control.
|
|
716
|
+
*/
|
|
717
|
+
declare function Limit({ id, kind, unit, period, label, description, ...rest }: SpendLimitsLimitProps): React.JSX.Element;
|
|
718
|
+
declare const SpendLimits: {
|
|
719
|
+
Root: React.ForwardRefExoticComponent<SpendLimitsRootProps & React.RefAttributes<HTMLElement>>;
|
|
720
|
+
Header: typeof Header$4;
|
|
721
|
+
Icon: typeof Icon$4;
|
|
722
|
+
Title: typeof Title$4;
|
|
723
|
+
Description: typeof Description$2;
|
|
724
|
+
Summary: typeof Summary;
|
|
725
|
+
List: typeof List;
|
|
726
|
+
Limit: typeof Limit;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Credential Handoff — an agent should never see a password or a card number.
|
|
731
|
+
* When a task needs a secret, the agent steps aside and hands the exchange to a
|
|
732
|
+
* trusted holder — a password manager, a passkey, the provider's own payment
|
|
733
|
+
* page — which returns a scoped credential (a signed-in session, a one-time
|
|
734
|
+
* token) rather than the secret itself. This surface makes that boundary
|
|
735
|
+
* legible: it names who will hold the secret, states plainly that the agent is
|
|
736
|
+
* excluded, and shows what comes back instead.
|
|
737
|
+
*
|
|
738
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
739
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
740
|
+
* for the default theme.
|
|
741
|
+
*
|
|
742
|
+
* A decision surface: `onHandoff` continues into the trusted holder,
|
|
743
|
+
* `onCancel` backs out. It is deliberately not a form — it never collects the
|
|
744
|
+
* secret itself.
|
|
745
|
+
*/
|
|
746
|
+
/** What kind of trusted holder the secret is handed to. */
|
|
747
|
+
type HandoffHandlerKind = "password-manager" | "passkey" | "payment" | "provider";
|
|
748
|
+
interface CredentialHandoffRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
749
|
+
/** Called when the user continues into the trusted holder. */
|
|
750
|
+
onHandoff: () => void;
|
|
751
|
+
/** Called when the user backs out without handing off. */
|
|
752
|
+
onCancel: () => void;
|
|
753
|
+
children: React.ReactNode;
|
|
754
|
+
}
|
|
755
|
+
type CredentialHandoffHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
756
|
+
declare function Header$3(props: CredentialHandoffHeaderProps): React.JSX.Element;
|
|
757
|
+
type CredentialHandoffIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
758
|
+
declare function Icon$3(props: CredentialHandoffIconProps): React.JSX.Element;
|
|
759
|
+
type CredentialHandoffTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
760
|
+
/** The task needing a secret: "Sign in to Delta" or "Pay Delta $340.00". */
|
|
761
|
+
declare function Title$3(props: CredentialHandoffTitleProps): React.JSX.Element;
|
|
762
|
+
type CredentialHandoffDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
763
|
+
declare function Description$1(props: CredentialHandoffDescriptionProps): React.JSX.Element;
|
|
764
|
+
interface CredentialHandoffHandlerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
765
|
+
/** What kind of holder this is — surfaced as a text badge. */
|
|
766
|
+
kind: HandoffHandlerKind;
|
|
767
|
+
/** The holder's name: "1Password", "Apple Pay", "Delta's payment page". */
|
|
768
|
+
name: React.ReactNode;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* The trusted holder the secret goes to. Naming it — and its kind — is how the
|
|
772
|
+
* user knows the exchange leaves the agent for something they already trust.
|
|
773
|
+
*/
|
|
774
|
+
declare function Handler({ kind, name, children, ...rest }: CredentialHandoffHandlerProps): React.JSX.Element;
|
|
775
|
+
type CredentialHandoffBoundaryProps = React.HTMLAttributes<HTMLDivElement>;
|
|
776
|
+
/**
|
|
777
|
+
* The pattern's distinct element: an explicit statement that the agent is
|
|
778
|
+
* outside this exchange. Rendered as a `note` so assistive tech announces the
|
|
779
|
+
* exclusion, not just the visual fence.
|
|
780
|
+
*/
|
|
781
|
+
declare function Boundary(props: CredentialHandoffBoundaryProps): React.JSX.Element;
|
|
782
|
+
type CredentialHandoffReturnsProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
783
|
+
/** Heading for the list; defaults to "The agent receives:". */
|
|
784
|
+
legend?: React.ReactNode;
|
|
785
|
+
};
|
|
786
|
+
/**
|
|
787
|
+
* What the agent gets back in place of the secret — a scoped session, a
|
|
788
|
+
* one-time token, a confirmation. Never the secret itself.
|
|
789
|
+
*/
|
|
790
|
+
declare function Returns({ legend, children, ...rest }: CredentialHandoffReturnsProps): React.JSX.Element;
|
|
791
|
+
type CredentialHandoffReturnProps = React.LiHTMLAttributes<HTMLLIElement>;
|
|
792
|
+
declare function Return(props: CredentialHandoffReturnProps): React.JSX.Element;
|
|
793
|
+
type CredentialHandoffActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
794
|
+
declare function Actions$3(props: CredentialHandoffActionsProps): React.JSX.Element;
|
|
795
|
+
type CredentialHandoffButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
796
|
+
declare const CredentialHandoff: {
|
|
797
|
+
Root: React.ForwardRefExoticComponent<CredentialHandoffRootProps & React.RefAttributes<HTMLElement>>;
|
|
798
|
+
Header: typeof Header$3;
|
|
799
|
+
Icon: typeof Icon$3;
|
|
800
|
+
Title: typeof Title$3;
|
|
801
|
+
Description: typeof Description$1;
|
|
802
|
+
Handler: typeof Handler;
|
|
803
|
+
Boundary: typeof Boundary;
|
|
804
|
+
Returns: typeof Returns;
|
|
805
|
+
Return: typeof Return;
|
|
806
|
+
Actions: typeof Actions$3;
|
|
807
|
+
Handoff: React.ForwardRefExoticComponent<CredentialHandoffButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
808
|
+
Cancel: React.ForwardRefExoticComponent<CredentialHandoffButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Action Receipt — consent doesn't end at approval. After an agent acts, the
|
|
813
|
+
* user needs a durable record of what it did, under what authority, and when —
|
|
814
|
+
* with a way to undo it where the action allows. Without a receipt, an approval
|
|
815
|
+
* (or a standing grant firing on its own) vanishes the moment it executes, and
|
|
816
|
+
* the user has no surface to notice, question, or reverse it.
|
|
817
|
+
*
|
|
818
|
+
* Headless compound component. All parts render unstyled with `data-acp`
|
|
819
|
+
* attributes as styling hooks; import `@agentconsent/react/theme.css`
|
|
820
|
+
* for the default theme.
|
|
821
|
+
*
|
|
822
|
+
* Like Connection Card, this is a display surface: it takes no decision
|
|
823
|
+
* callbacks of its own. The one interactive part, `Undo`, is wired to your
|
|
824
|
+
* handler — and it renders as an inert note (not a button) when the action was
|
|
825
|
+
* irreversible or has already been undone, so the receipt can never offer an
|
|
826
|
+
* undo it can't honour.
|
|
827
|
+
*/
|
|
828
|
+
/** How the action turned out. Drives the outcome badge and styling. */
|
|
829
|
+
type ReceiptOutcome = "completed" | "undone" | "failed";
|
|
830
|
+
/** Whether the action can be reversed — governs whether Undo is offered. */
|
|
831
|
+
type ReceiptReversibility = "reversible" | "irreversible";
|
|
832
|
+
interface ActionReceiptRootProps extends React.HTMLAttributes<HTMLElement> {
|
|
833
|
+
/** How the action turned out. Defaults to `completed`. */
|
|
834
|
+
outcome?: ReceiptOutcome;
|
|
835
|
+
/**
|
|
836
|
+
* Whether the action can be reversed. Defaults to `reversible`. An
|
|
837
|
+
* `irreversible` receipt renders no undo button — only an honest note.
|
|
838
|
+
*/
|
|
839
|
+
reversibility?: ReceiptReversibility;
|
|
840
|
+
children: React.ReactNode;
|
|
841
|
+
}
|
|
842
|
+
type ActionReceiptHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
843
|
+
declare function Header$2(props: ActionReceiptHeaderProps): React.JSX.Element;
|
|
844
|
+
type ActionReceiptIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
845
|
+
declare function Icon$2(props: ActionReceiptIconProps): React.JSX.Element;
|
|
846
|
+
type ActionReceiptTitleProps = React.HTMLAttributes<HTMLDivElement>;
|
|
847
|
+
/**
|
|
848
|
+
* What the agent did, in the past tense: "Sent email to Dana Ito". A non-heading
|
|
849
|
+
* element with an id, so a receipt slots into an activity log at any depth
|
|
850
|
+
* without imposing a heading level.
|
|
851
|
+
*/
|
|
852
|
+
declare function Title$2(props: ActionReceiptTitleProps): React.JSX.Element;
|
|
853
|
+
type ActionReceiptOutcomeProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
854
|
+
/**
|
|
855
|
+
* The outcome badge, as text (never color alone). Pass children to override the
|
|
856
|
+
* wording.
|
|
857
|
+
*/
|
|
858
|
+
declare function Outcome({ children, ...rest }: ActionReceiptOutcomeProps): React.JSX.Element;
|
|
859
|
+
type ActionReceiptDetailsProps = React.HTMLAttributes<HTMLDListElement>;
|
|
860
|
+
declare function Details(props: ActionReceiptDetailsProps): React.JSX.Element;
|
|
861
|
+
interface ActionReceiptDetailProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
862
|
+
/** The fact's name: "To", "Amount", "File". */
|
|
863
|
+
label: React.ReactNode;
|
|
864
|
+
/** The exact value acted on — never a summary. */
|
|
865
|
+
children: React.ReactNode;
|
|
866
|
+
}
|
|
867
|
+
declare function Detail({ label, children, ...rest }: ActionReceiptDetailProps): React.JSX.Element;
|
|
868
|
+
interface ActionReceiptAuthorityProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
869
|
+
/** The grant, approval, or standing rule the action ran under. */
|
|
870
|
+
grant: React.ReactNode;
|
|
871
|
+
/** How that authority was established: "you approved · Jul 8", "always-allow". */
|
|
872
|
+
via?: React.ReactNode;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Under what authority the action was taken — the receipt's distinct job. It
|
|
876
|
+
* ties the act back to the consent that permitted it, so a user reviewing the
|
|
877
|
+
* log can see *why* the agent was allowed to do this, not just that it did.
|
|
878
|
+
*/
|
|
879
|
+
declare function Authority({ grant, via, children, ...rest }: ActionReceiptAuthorityProps): React.JSX.Element;
|
|
880
|
+
type ActionReceiptMetaProps = React.HTMLAttributes<HTMLDListElement>;
|
|
881
|
+
declare function Meta$1(props: ActionReceiptMetaProps): React.JSX.Element;
|
|
882
|
+
interface ActionReceiptMetaItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
883
|
+
/** The fact's name: "When", "Reference". */
|
|
884
|
+
label: React.ReactNode;
|
|
885
|
+
children: React.ReactNode;
|
|
886
|
+
}
|
|
887
|
+
declare function MetaItem$1({ label, children, ...rest }: ActionReceiptMetaItemProps): React.JSX.Element;
|
|
888
|
+
type ActionReceiptActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
889
|
+
declare function Actions$2(props: ActionReceiptActionsProps): React.JSX.Element;
|
|
890
|
+
interface ActionReceiptUndoProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
891
|
+
/**
|
|
892
|
+
* Note shown in place of the button when the action can't be undone.
|
|
893
|
+
* Defaults to "Can't be undone".
|
|
894
|
+
*/
|
|
895
|
+
irreversibleNote?: React.ReactNode;
|
|
896
|
+
/** Note shown once the action has already been undone. Defaults to "Undone". */
|
|
897
|
+
undoneNote?: React.ReactNode;
|
|
898
|
+
}
|
|
899
|
+
declare const ActionReceipt: {
|
|
900
|
+
Root: React.ForwardRefExoticComponent<ActionReceiptRootProps & React.RefAttributes<HTMLElement>>;
|
|
901
|
+
Header: typeof Header$2;
|
|
902
|
+
Icon: typeof Icon$2;
|
|
903
|
+
Title: typeof Title$2;
|
|
904
|
+
Outcome: typeof Outcome;
|
|
905
|
+
Details: typeof Details;
|
|
906
|
+
Detail: typeof Detail;
|
|
907
|
+
Authority: typeof Authority;
|
|
908
|
+
Meta: typeof Meta$1;
|
|
909
|
+
MetaItem: typeof MetaItem$1;
|
|
910
|
+
Actions: typeof Actions$2;
|
|
911
|
+
Undo: React.ForwardRefExoticComponent<ActionReceiptUndoProps & React.RefAttributes<HTMLButtonElement>>;
|
|
912
|
+
};
|
|
913
|
+
|
|
914
|
+
interface InjectionFlagRootProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
915
|
+
/** Called when the user chooses to follow the flagged instruction. */
|
|
916
|
+
onProceed: () => void;
|
|
917
|
+
/**
|
|
918
|
+
* Called when the user declines to follow it (button, or Escape in modal
|
|
919
|
+
* mode). This is the safe path — the agent keeps doing what the *user* asked.
|
|
920
|
+
*/
|
|
921
|
+
onDismiss: () => void;
|
|
922
|
+
/** Render as a modal AlertDialog instead of an inline card. */
|
|
923
|
+
asModal?: boolean;
|
|
924
|
+
/** Modal mode only: whether the dialog is open (controlled). */
|
|
925
|
+
open?: boolean;
|
|
926
|
+
/** Modal mode only: called when the dialog requests an open-state change. */
|
|
927
|
+
onOpenChange?: (open: boolean) => void;
|
|
928
|
+
children: React.ReactNode;
|
|
929
|
+
}
|
|
930
|
+
type InjectionFlagHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
931
|
+
declare function Header$1(props: InjectionFlagHeaderProps): React.JSX.Element;
|
|
932
|
+
type InjectionFlagIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
933
|
+
declare function Icon$1(props: InjectionFlagIconProps): React.JSX.Element;
|
|
934
|
+
type InjectionFlagTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
935
|
+
/** The situation, stated plainly: "An instruction came from untrusted content". */
|
|
936
|
+
declare function Title$1(props: InjectionFlagTitleProps): React.JSX.Element;
|
|
937
|
+
type InjectionFlagDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
938
|
+
/** Plain-language framing of why this is being surfaced. */
|
|
939
|
+
declare function Description(props: InjectionFlagDescriptionProps): React.JSX.Element;
|
|
940
|
+
interface InjectionFlagSourceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
941
|
+
/** The untrusted origin type: "a web page", "an email", "an uploaded file". */
|
|
942
|
+
origin: React.ReactNode;
|
|
943
|
+
/** A specific pointer to it: a URL, a sender, a filename. */
|
|
944
|
+
location?: React.ReactNode;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Where the instruction came from — the provenance that makes it untrusted.
|
|
948
|
+
* Carried in text (and an untrusted accent), never implied by styling alone.
|
|
949
|
+
*/
|
|
950
|
+
declare function Source({ origin, location, children, ...rest }: InjectionFlagSourceProps): React.JSX.Element;
|
|
951
|
+
interface InjectionFlagQuoteProps extends React.HTMLAttributes<HTMLQuoteElement> {
|
|
952
|
+
/** Label above the quote; defaults to "The instruction reads:". */
|
|
953
|
+
label?: React.ReactNode;
|
|
954
|
+
/** The flagged instruction, quoted exactly as it appeared. */
|
|
955
|
+
children: React.ReactNode;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* The injected instruction, quoted verbatim and visually fenced. Showing the
|
|
959
|
+
* literal text — not a paraphrase — is the heart of the pattern: the user sees
|
|
960
|
+
* exactly what is trying to steer the agent.
|
|
961
|
+
*/
|
|
962
|
+
declare function Quote({ label, children, ...rest }: InjectionFlagQuoteProps): React.JSX.Element;
|
|
963
|
+
type InjectionFlagConsequenceProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
964
|
+
/**
|
|
965
|
+
* What the agent would do if it followed the instruction, stated concretely so
|
|
966
|
+
* the stakes of "Proceed" are legible: "I would forward your inbox to an
|
|
967
|
+
* outside address."
|
|
968
|
+
*/
|
|
969
|
+
declare function Consequence(props: InjectionFlagConsequenceProps): React.JSX.Element;
|
|
970
|
+
type InjectionFlagActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
971
|
+
declare function Actions$1(props: InjectionFlagActionsProps): React.JSX.Element;
|
|
972
|
+
type InjectionFlagButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
973
|
+
declare const InjectionFlag: {
|
|
974
|
+
Root: React.ForwardRefExoticComponent<InjectionFlagRootProps & React.RefAttributes<HTMLElement>>;
|
|
975
|
+
Header: typeof Header$1;
|
|
976
|
+
Icon: typeof Icon$1;
|
|
977
|
+
Title: typeof Title$1;
|
|
978
|
+
Description: typeof Description;
|
|
979
|
+
Source: typeof Source;
|
|
980
|
+
Quote: typeof Quote;
|
|
981
|
+
Consequence: typeof Consequence;
|
|
982
|
+
Actions: typeof Actions$1;
|
|
983
|
+
Proceed: React.ForwardRefExoticComponent<InjectionFlagButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
984
|
+
Dismiss: React.ForwardRefExoticComponent<InjectionFlagButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
type ConnectionStatus = "active" | "paused" | "needs-reauth" | "expired";
|
|
988
|
+
interface ConnectionCardRootProps extends React.HTMLAttributes<HTMLElement> {
|
|
989
|
+
/** Lifecycle state of the connection — drives the status badge + styling. */
|
|
990
|
+
status?: ConnectionStatus;
|
|
991
|
+
children: React.ReactNode;
|
|
992
|
+
}
|
|
993
|
+
type ConnectionCardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
994
|
+
declare function Header(props: ConnectionCardHeaderProps): React.JSX.Element;
|
|
995
|
+
type ConnectionCardIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
996
|
+
declare function Icon(props: ConnectionCardIconProps): React.JSX.Element;
|
|
997
|
+
type ConnectionCardTitleProps = React.HTMLAttributes<HTMLDivElement>;
|
|
998
|
+
/**
|
|
999
|
+
* Who is connected to what: "Inbox Assistant → Gmail". Rendered as a
|
|
1000
|
+
* non-heading element with an id so the card's accessible name works at any
|
|
1001
|
+
* position in a settings list without imposing a heading level.
|
|
1002
|
+
*/
|
|
1003
|
+
declare function Title(props: ConnectionCardTitleProps): React.JSX.Element;
|
|
1004
|
+
type ConnectionCardStatusProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
1005
|
+
/**
|
|
1006
|
+
* The lifecycle badge. Defaults to the status label as text (never color
|
|
1007
|
+
* alone); pass children to override the wording.
|
|
1008
|
+
*/
|
|
1009
|
+
declare function Status({ children, ...rest }: ConnectionCardStatusProps): React.JSX.Element;
|
|
1010
|
+
type ConnectionCardScopesProps = React.HTMLAttributes<HTMLUListElement>;
|
|
1011
|
+
declare function Scopes(props: ConnectionCardScopesProps): React.JSX.Element;
|
|
1012
|
+
interface ConnectionCardScopeProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
1013
|
+
/** Access level of this active capability — surfaced as a text badge. */
|
|
1014
|
+
access: ScopeAccess;
|
|
1015
|
+
/** Plain-language capability name: "Send messages". */
|
|
1016
|
+
children: React.ReactNode;
|
|
1017
|
+
}
|
|
1018
|
+
declare function Scope({ access, children, ...rest }: ConnectionCardScopeProps): React.JSX.Element;
|
|
1019
|
+
type ConnectionCardMetaProps = React.HTMLAttributes<HTMLDListElement>;
|
|
1020
|
+
declare function Meta(props: ConnectionCardMetaProps): React.JSX.Element;
|
|
1021
|
+
interface ConnectionCardMetaItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1022
|
+
/** The fact's name: "Last used", "Connected". */
|
|
1023
|
+
label: React.ReactNode;
|
|
1024
|
+
children: React.ReactNode;
|
|
1025
|
+
}
|
|
1026
|
+
declare function MetaItem({ label, children, ...rest }: ConnectionCardMetaItemProps): React.JSX.Element;
|
|
1027
|
+
type ConnectionCardActionsProps = React.HTMLAttributes<HTMLDivElement>;
|
|
1028
|
+
declare function Actions(props: ConnectionCardActionsProps): React.JSX.Element;
|
|
1029
|
+
interface ConnectionCardActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1030
|
+
/** "danger" styles a destructive management action such as revoke. */
|
|
1031
|
+
tone?: "default" | "danger";
|
|
1032
|
+
}
|
|
1033
|
+
declare const ConnectionCard: {
|
|
1034
|
+
Root: React.ForwardRefExoticComponent<ConnectionCardRootProps & React.RefAttributes<HTMLElement>>;
|
|
1035
|
+
Header: typeof Header;
|
|
1036
|
+
Icon: typeof Icon;
|
|
1037
|
+
Title: typeof Title;
|
|
1038
|
+
Status: typeof Status;
|
|
1039
|
+
Scopes: typeof Scopes;
|
|
1040
|
+
Scope: typeof Scope;
|
|
1041
|
+
Meta: typeof Meta;
|
|
1042
|
+
MetaItem: typeof MetaItem;
|
|
1043
|
+
Actions: typeof Actions;
|
|
1044
|
+
Action: React.ForwardRefExoticComponent<ConnectionCardActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
export { AUTHORITY_LEVELS, ActionPreview, type ActionPreviewActionsProps, type ActionPreviewButtonProps, type ActionPreviewConsequence, type ActionPreviewContentProps, type ActionPreviewFieldProps, type ActionPreviewFieldsProps, type ActionPreviewHeaderProps, type ActionPreviewIconProps, type ActionPreviewRootProps, type ActionPreviewSourceProps, type ActionPreviewTitleProps, ActionReceipt, type ActionReceiptActionsProps, type ActionReceiptAuthorityProps, type ActionReceiptDetailProps, type ActionReceiptDetailsProps, type ActionReceiptHeaderProps, type ActionReceiptIconProps, type ActionReceiptMetaItemProps, type ActionReceiptMetaProps, type ActionReceiptOutcomeProps, type ActionReceiptRootProps, type ActionReceiptTitleProps, type ActionReceiptUndoProps, AuthorityBoundary, type AuthorityBoundaryCapabilityProps, type AuthorityBoundaryDescriptionProps, type AuthorityBoundaryHeaderProps, type AuthorityBoundaryIconProps, type AuthorityBoundaryListProps, type AuthorityBoundaryRootProps, type AuthorityBoundarySummaryProps, type AuthorityBoundaryTitleProps, type AuthorityLevel, BatchApproval, type BatchApprovalButtonProps, type BatchApprovalDescriptionProps, type BatchApprovalHeaderProps, type BatchApprovalIconProps, type BatchApprovalItem, type BatchApprovalItemProps, type BatchApprovalListProps, type BatchApprovalRootProps, type BatchApprovalSelectAllProps, type BatchApprovalSelectionCountProps, type BatchApprovalTitleProps, type BatchApprovalToolbarProps, ConnectionCard, type ConnectionCardActionProps, type ConnectionCardActionsProps, type ConnectionCardHeaderProps, type ConnectionCardIconProps, type ConnectionCardMetaItemProps, type ConnectionCardMetaProps, type ConnectionCardRootProps, type ConnectionCardScopeProps, type ConnectionCardScopesProps, type ConnectionCardStatusProps, type ConnectionCardTitleProps, type ConnectionStatus, type ConsentDurability, ConsentMemory, type ConsentMemoryActionsProps, type ConsentMemoryAllowProps, type ConsentMemoryDenyProps, type ConsentMemoryDescriptionProps, type ConsentMemoryHeaderProps, type ConsentMemoryIconProps, type ConsentMemoryOptionProps, type ConsentMemoryOptionsProps, type ConsentMemoryRootProps, type ConsentMemoryTitleProps, CredentialHandoff, type CredentialHandoffActionsProps, type CredentialHandoffBoundaryProps, type CredentialHandoffButtonProps, type CredentialHandoffDescriptionProps, type CredentialHandoffHandlerProps, type CredentialHandoffHeaderProps, type CredentialHandoffIconProps, type CredentialHandoffReturnProps, type CredentialHandoffReturnsProps, type CredentialHandoffRootProps, type CredentialHandoffTitleProps, type HandoffHandlerKind, InjectionFlag, type InjectionFlagActionsProps, type InjectionFlagButtonProps, type InjectionFlagConsequenceProps, type InjectionFlagDescriptionProps, type InjectionFlagHeaderProps, type InjectionFlagIconProps, type InjectionFlagQuoteProps, type InjectionFlagRootProps, type InjectionFlagSourceProps, type InjectionFlagTitleProps, IrreversibilityGate, type IrreversibilityGateActionsProps, type IrreversibilityGateButtonProps, type IrreversibilityGateConfirmFieldProps, type IrreversibilityGateConsequenceProps, type IrreversibilityGateConsequencesProps, type IrreversibilityGateDescriptionProps, type IrreversibilityGateHeaderProps, type IrreversibilityGateIconProps, type IrreversibilityGateRootProps, type IrreversibilityGateTitleProps, type IrreversibilitySeverity, ProgressiveScope, type ProgressiveScopeActionsProps, type ProgressiveScopeButtonProps, type ProgressiveScopeCurrentProps, type ProgressiveScopeHeaderProps, type ProgressiveScopeIconProps, type ProgressiveScopeReasonProps, type ProgressiveScopeRequestProps, type ProgressiveScopeRootProps, type ProgressiveScopeTitleProps, type ReceiptOutcome, type ReceiptReversibility, type ScopeAccess, ScopedGrant, type ScopedGrantActionsProps, type ScopedGrantCancelProps, type ScopedGrantDescriptionProps, type ScopedGrantGrantProps, type ScopedGrantGroupProps, type ScopedGrantHeaderProps, type ScopedGrantIconProps, type ScopedGrantRootProps, type ScopedGrantScopeProps, type ScopedGrantTitleProps, type SpendLimitKind, type SpendLimitPeriod, type SpendLimitState, type SpendLimitUsage, SpendLimits, type SpendLimitsDescriptionProps, type SpendLimitsHeaderProps, type SpendLimitsIconProps, type SpendLimitsLimitProps, type SpendLimitsListProps, type SpendLimitsRootProps, type SpendLimitsSummaryProps, type SpendLimitsTitleProps };
|