@cloudparse/up-backoffice-sdk 0.0.0-stage → 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.
Files changed (38) hide show
  1. package/README.md +59 -2
  2. package/claude-plugin/.claude-plugin/marketplace.json +17 -0
  3. package/claude-plugin/.claude-plugin/plugin.json +21 -0
  4. package/claude-plugin/README.md +44 -0
  5. package/claude-plugin/commands/new-backoffice-plugin.md +18 -0
  6. package/claude-plugin/scripts/scaffold.mjs +186 -0
  7. package/claude-plugin/sdk-version.json +1 -0
  8. package/claude-plugin/skills/up-backoffice-plugin-builder/SKILL.md +40 -0
  9. package/claude-plugin/skills/up-backoffice-plugin-builder/references/plugin-checklist.md +14 -0
  10. package/claude-plugin/skills/up-backoffice-plugin-builder/references/recipes.md +147 -0
  11. package/claude-plugin/skills/up-backoffice-plugin-builder/references/rules-and-pitfalls.md +25 -0
  12. package/claude-plugin/skills/up-backoffice-plugin-builder/references/sdk-api.md +91 -0
  13. package/claude-plugin/templates/plugin/AGENTS.md +9 -0
  14. package/claude-plugin/templates/plugin/CLAUDE.md +1 -0
  15. package/claude-plugin/templates/plugin/biome.json +64 -0
  16. package/claude-plugin/templates/plugin/gitignore +2 -0
  17. package/claude-plugin/templates/plugin/package.json +31 -0
  18. package/claude-plugin/templates/plugin/src/features/__PLUGIN_ID__/components/AdminPage.tsx +143 -0
  19. package/claude-plugin/templates/plugin/src/features/__PLUGIN_ID__/types.ts +17 -0
  20. package/claude-plugin/templates/plugin/src/index.tsx +22 -0
  21. package/claude-plugin/templates/plugin/src/services/__PLUGIN_ID__.ts +26 -0
  22. package/claude-plugin/templates/plugin/src/styles.css +1 -0
  23. package/claude-plugin/templates/plugin/tsconfig.json +18 -0
  24. package/claude-plugin/templates/plugin/vite.config.ts +12 -0
  25. package/dist/chunk-PSBYWSHV.js +17 -0
  26. package/dist/chunk-PSBYWSHV.js.map +1 -0
  27. package/dist/contract-88aU9QZl.d.ts +122 -0
  28. package/dist/host.d.ts +33 -0
  29. package/dist/host.js +140 -0
  30. package/dist/host.js.map +1 -0
  31. package/dist/index.d.ts +564 -0
  32. package/dist/index.js +2549 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/plugin.css +9 -0
  35. package/dist/theme.css +41 -0
  36. package/dist/vite.d.ts +15 -0
  37. package/dist/vite.js +74 -0
  38. package/package.json +96 -4
@@ -0,0 +1,564 @@
1
+ /// <reference types="dayjs/plugin/localizedFormat" />
2
+ /// <reference types="dayjs/plugin/relativeTime" />
3
+ import { H as HttpClient, b as PluginHost, e as BackofficePluginDefinition, B as BackofficePluginModule, I as IconComponent } from './contract-88aU9QZl.js';
4
+ export { A as ApiService, F as FetchOptions, P as PLUGIN_CONTRACT_VERSION, a as PluginApplication, f as PluginPage, c as PluginUser } from './contract-88aU9QZl.js';
5
+ import * as react from 'react';
6
+ import { ReactNode, HTMLAttributes, ButtonHTMLAttributes, LabelHTMLAttributes, InputHTMLAttributes, ImgHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, TextareaHTMLAttributes } from 'react';
7
+ import { ClassValue } from 'clsx';
8
+ export { default as dayjs } from 'dayjs';
9
+
10
+ declare class ApiError extends Error {
11
+ status: number;
12
+ data?: unknown | undefined;
13
+ constructor(status: number, message: string, data?: unknown | undefined);
14
+ }
15
+ /**
16
+ * Duck-typed `ApiError` check. Use it instead of `instanceof ApiError` in plugins:
17
+ * errors thrown by the host's clients come from the host's copy of this class,
18
+ * so `instanceof` against the plugin's own copy is always false.
19
+ */
20
+ declare function isApiError(value: unknown): value is ApiError;
21
+
22
+ /** Copies text and exposes a `copied` flag that resets after `resetMs`. */
23
+ declare function useCopyToClipboard(resetMs?: number): {
24
+ copied: boolean;
25
+ copy: (text: string) => Promise<boolean>;
26
+ };
27
+
28
+ interface DangerZoneProps {
29
+ inputValue: string;
30
+ onInputChange: (value: string) => void;
31
+ onConfirmDelete: () => void;
32
+ isDeleting: boolean;
33
+ entityLabel?: string;
34
+ customDescription?: string;
35
+ id?: string;
36
+ inputLabel?: string;
37
+ inputPlaceholder?: string;
38
+ }
39
+ declare function DangerZone({ inputValue, onInputChange, onConfirmDelete, isDeleting, entityLabel, customDescription, id, inputLabel, inputPlaceholder, }: DangerZoneProps): react.JSX.Element;
40
+
41
+ interface UseDangerZoneDeleteOptions {
42
+ /** Deletes the item; throw to report a failure. */
43
+ onDelete: (uuid: string) => Promise<void>;
44
+ /**
45
+ * Returns a display name for a UUID typed in the danger zone, or null when no
46
+ * item matches (shown as an error, nothing is deleted).
47
+ */
48
+ resolveName: (uuid: string) => string | null;
49
+ /** E.g. "an entity", used in the danger zone description. */
50
+ entityLabel: string;
51
+ /** DOM id of the danger zone, the target of `request()`'s scroll. */
52
+ id?: string;
53
+ }
54
+ interface DangerZoneDelete {
55
+ /** Prefills the danger zone with this UUID and scrolls to it (row "delete" buttons). */
56
+ request: (uuid: string) => void;
57
+ /** Spread on `<DangerZone />`. */
58
+ dangerZoneProps: DangerZoneProps;
59
+ /** Confirmation modal to render somewhere in the page (null when closed). */
60
+ confirmModal: ReactNode;
61
+ /** Last error (unknown UUID or failed delete), to show in a `Banner`. */
62
+ error: string | null;
63
+ clearError: () => void;
64
+ }
65
+ /**
66
+ * The backoffice hard-delete flow: copy a UUID into the danger zone, confirm in
67
+ * a modal, delete. Replaces hand-written `confirm()` / `alert()` calls.
68
+ */
69
+ declare function useDangerZoneDelete({ onDelete, resolveName, entityLabel, id, }: UseDangerZoneDeleteOptions): DangerZoneDelete;
70
+
71
+ /**
72
+ * Client for the plugin's mini-app backend, usable from module-level services.
73
+ * Bound to the host's `miniappApi` once the host renders a page of the plugin.
74
+ */
75
+ declare const miniappApi: HttpClient;
76
+ /** Client for the Up hub backend (admin session), bound like `miniappApi`. */
77
+ declare const hubApi: HttpClient;
78
+ /** Returns a valid admin scoped token for the plugin's mini-app. */
79
+ declare function getScopeToken(): Promise<string | null>;
80
+
81
+ /** Returns the host of the current plugin page. Only valid inside a plugin page. */
82
+ declare function usePluginHost(): PluginHost;
83
+
84
+ /**
85
+ * Declares a backoffice plugin. The result is the default export of the plugin
86
+ * entry file; the host loads it at runtime and renders its pages.
87
+ */
88
+ declare function definePlugin(definition: BackofficePluginDefinition): BackofficePluginModule;
89
+
90
+ interface AuthStatusBadgeProps {
91
+ /** True when the last mini-app call was rejected (missing or expired admin scope). */
92
+ authError: boolean;
93
+ }
94
+ /** "Active token" / "Auth error" pill shown in plugin page headers. */
95
+ declare function AuthStatusBadge({ authError }: AuthStatusBadgeProps): react.JSX.Element;
96
+
97
+ type BadgeVariant = "primary" | "accent" | "success" | "warning" | "error" | "muted" | "outline";
98
+ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
99
+ variant?: BadgeVariant;
100
+ }
101
+ /**
102
+ * Every small uppercase status/category/scope pill in the app — "Active
103
+ * Token", "Backoffice CRUD", "Manager assigned", a role/scope tag, etc.
104
+ * One shared shape/typography, color varies by `variant`. Replaces every
105
+ * hand-rolled `<span className="text-xs font-bold uppercase ...">` pill.
106
+ */
107
+ declare function Badge({ variant, className, ...props }: BadgeProps): react.JSX.Element;
108
+
109
+ type BannerVariant = "success" | "warning" | "error";
110
+ interface BannerProps {
111
+ message: string;
112
+ variant: BannerVariant;
113
+ onClose?: () => void;
114
+ className?: string;
115
+ }
116
+ declare function Banner({ message, variant, onClose, className }: BannerProps): react.JSX.Element;
117
+
118
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
119
+ isLoading?: boolean;
120
+ variant?: "primary" | "secondary" | "danger" | "ghost";
121
+ size?: "sm" | "md" | "lg";
122
+ }
123
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
124
+
125
+ declare const PADDINGS$1: {
126
+ readonly lg: "p-8";
127
+ readonly md: "p-6";
128
+ readonly none: "";
129
+ };
130
+ interface CardProps extends HTMLAttributes<HTMLDivElement> {
131
+ padding?: keyof typeof PADDINGS$1;
132
+ /** Hover highlight, for clickable cards. */
133
+ interactive?: boolean;
134
+ /** `glass`: translucent with blur (default). `solid`: opaque card background. */
135
+ variant?: "glass" | "solid";
136
+ }
137
+ /** Surface container of the backoffice (cards, panels). */
138
+ declare function Card({ padding, interactive, variant, className, ...props }: CardProps): react.JSX.Element;
139
+
140
+ interface ConfirmModalProps {
141
+ title: string;
142
+ description: string;
143
+ confirmLabel?: string;
144
+ cancelLabel?: string;
145
+ isConfirming?: boolean;
146
+ variant?: "danger" | "primary";
147
+ onConfirm: () => void;
148
+ onCancel: () => void;
149
+ }
150
+ declare function ConfirmModal({ title, description, confirmLabel, cancelLabel, isConfirming, variant, onConfirm, onCancel, }: ConfirmModalProps): react.JSX.Element;
151
+
152
+ interface CopyableUuidProps {
153
+ uuid: string;
154
+ }
155
+ declare function CopyableUuid({ uuid }: CopyableUuidProps): react.JSX.Element;
156
+
157
+ interface EmptyStateProps {
158
+ icon: IconComponent;
159
+ title: string;
160
+ description?: string;
161
+ action?: ReactNode;
162
+ className?: string;
163
+ }
164
+ /**
165
+ * "Nothing here yet" state — icon + title + optional description/action.
166
+ * One shared shape for every list/table's empty state instead of each
167
+ * feature hand-rolling its own heading/description size combo.
168
+ */
169
+ declare function EmptyState({ icon: Icon, title, description, action, className, }: EmptyStateProps): react.JSX.Element;
170
+
171
+ interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
172
+ }
173
+ /**
174
+ * Standalone label for a field that isn't `Input` (a `<select>`, `<textarea>`,
175
+ * a custom picker) — same typography as `Input`'s own built-in `label` prop,
176
+ * so every field label in the app looks identical regardless of which
177
+ * control renders it.
178
+ */
179
+ declare function FieldLabel({ className, ...props }: FieldLabelProps): react.JSX.Element;
180
+
181
+ interface QueryPreset {
182
+ name: string;
183
+ description: string;
184
+ query: string;
185
+ variables?: string;
186
+ }
187
+ interface GraphQLPlaygroundProps {
188
+ title?: string;
189
+ description?: string;
190
+ presets: QueryPreset[];
191
+ onExecute: (query: string, variables?: Record<string, unknown>) => Promise<unknown>;
192
+ hasToken?: boolean;
193
+ authError?: boolean;
194
+ onConfigureToken?: () => void;
195
+ }
196
+ declare function GraphQLPlayground({ title, description, presets, onExecute, hasToken, authError, onConfigureToken, }: GraphQLPlaygroundProps): react.JSX.Element;
197
+
198
+ declare const VARIANTS: {
199
+ readonly danger: "hover:bg-error/10 hover:text-error";
200
+ readonly default: "hover:bg-primary/10 hover:text-primary";
201
+ readonly success: "hover:bg-success/10 hover:text-success";
202
+ };
203
+ interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
204
+ icon: IconComponent;
205
+ /** Accessible name and tooltip. */
206
+ label: string;
207
+ variant?: keyof typeof VARIANTS;
208
+ isLoading?: boolean;
209
+ /** Spins the icon (e.g. a refresh button while reloading) without disabling the button. */
210
+ spin?: boolean;
211
+ }
212
+ /** Square icon-only button (row actions, toolbars). */
213
+ declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
214
+ interface RowActionsProps {
215
+ children: ReactNode;
216
+ className?: string;
217
+ }
218
+ /** Right-aligned group of `IconButton`s at the end of a list or table row. */
219
+ declare function RowActions({ children, className }: RowActionsProps): react.JSX.Element;
220
+
221
+ declare const ASPECTS: {
222
+ readonly banner: "aspect-3/1";
223
+ readonly compact: "h-24 w-24";
224
+ readonly square: "aspect-square";
225
+ readonly wide: "h-40";
226
+ };
227
+ interface ImageUploadProps {
228
+ /** Current image (remote URL or local object URL). */
229
+ previewUrl?: string | null;
230
+ /** Called with a WebP file; non-WebP files are refused with `onError`. */
231
+ onFile: (file: File) => void;
232
+ onError?: (message: string) => void;
233
+ label?: string;
234
+ uploading?: boolean;
235
+ readOnly?: boolean;
236
+ aspect?: keyof typeof ASPECTS;
237
+ /** Shown over a read-only image, e.g. "Image cannot be changed". */
238
+ readOnlyHint?: string;
239
+ /** Also accept SVG (icons). WebP stays the rule for photos. */
240
+ allowSvg?: boolean;
241
+ /** Adds a "Remove image" button under the current image (also in read-only mode). */
242
+ onRemove?: () => void;
243
+ /** `contain` for icons and logos (whole image visible), `cover` for photos. */
244
+ fit?: "cover" | "contain";
245
+ className?: string;
246
+ }
247
+ /**
248
+ * WebP-only image picker with preview, change overlay and upload state.
249
+ * Keep the file in local state and upload it on save (no orphan uploads).
250
+ */
251
+ declare function ImageUpload({ previewUrl, onFile, onError, label, uploading, readOnly, aspect, readOnlyHint, allowSvg, onRemove, fit, className, }: ImageUploadProps): react.JSX.Element;
252
+
253
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
254
+ label?: string;
255
+ error?: string;
256
+ /** Leading icon inside the field. */
257
+ icon?: IconComponent;
258
+ }
259
+ declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
260
+
261
+ declare const SIZES$1: {
262
+ readonly lg: "w-10 h-10";
263
+ readonly md: "w-8 h-8";
264
+ readonly sm: "w-5 h-5";
265
+ };
266
+ declare const PADDINGS: {
267
+ readonly lg: "py-24";
268
+ readonly md: "py-16";
269
+ readonly none: "";
270
+ readonly sm: "py-6";
271
+ };
272
+ interface LoadingStateProps {
273
+ size?: keyof typeof SIZES$1;
274
+ padding?: keyof typeof PADDINGS;
275
+ /** Optional text under the spinner. */
276
+ label?: string;
277
+ className?: string;
278
+ }
279
+ /** Centered `Loader2` spinner: the only loading indicator of the backoffice. */
280
+ declare function LoadingState({ size, padding, label, className, }: LoadingStateProps): react.JSX.Element;
281
+
282
+ interface LoadMoreButtonProps {
283
+ onClick: () => void;
284
+ loading?: boolean;
285
+ label?: string;
286
+ }
287
+ /** "Load more" button under a cursor-paginated list. */
288
+ declare function LoadMoreButton({ onClick, loading, label, }: LoadMoreButtonProps): react.JSX.Element;
289
+
290
+ interface MarkdownEditorProps {
291
+ label: string;
292
+ value: string;
293
+ onChange: (value: string) => void;
294
+ placeholder?: string;
295
+ description?: string;
296
+ minHeight?: string;
297
+ maxHeight?: string;
298
+ required?: boolean;
299
+ }
300
+ declare function MarkdownEditor({ label, value, onChange, placeholder, description, minHeight, maxHeight, required, }: MarkdownEditorProps): react.JSX.Element;
301
+
302
+ declare const SIZES: {
303
+ readonly "2xl": "max-w-2xl";
304
+ readonly "4xl": "max-w-4xl";
305
+ readonly "5xl": "max-w-5xl";
306
+ readonly "6xl": "max-w-6xl";
307
+ readonly lg: "max-w-lg";
308
+ readonly md: "max-w-md";
309
+ readonly xl: "max-w-xl";
310
+ };
311
+ type ModalSize = keyof typeof SIZES;
312
+ interface ModalProps {
313
+ title: ReactNode;
314
+ description?: ReactNode;
315
+ icon?: IconComponent;
316
+ onClose: () => void;
317
+ size?: ModalSize;
318
+ /** `top` for long forms: the panel starts near the top and the overlay scrolls. */
319
+ align?: "center" | "top";
320
+ /** Rendered under the body, e.g. `<ModalActions />`. */
321
+ footer?: ReactNode;
322
+ children: ReactNode;
323
+ className?: string;
324
+ /** Close when the backdrop is clicked (default false: forms keep their data). */
325
+ closeOnBackdrop?: boolean;
326
+ /**
327
+ * False while a request runs: Escape, the backdrop and the close button do
328
+ * nothing, so the modal never unmounts mid-submit. Default true.
329
+ */
330
+ dismissible?: boolean;
331
+ }
332
+ /**
333
+ * Standard admin modal: overlay, panel, header with close button, body and
334
+ * optional footer. Mount it only while open. Rendered in place (no portal) so
335
+ * it keeps a plugin's scoped styles; scroll lock and focus trap come from
336
+ * `useModalLock`.
337
+ */
338
+ declare function Modal({ title, description, icon: Icon, onClose, size, align, footer, children, className, closeOnBackdrop, dismissible, }: ModalProps): react.JSX.Element;
339
+ interface ModalActionsProps {
340
+ onCancel: () => void;
341
+ submitLabel: ReactNode;
342
+ cancelLabel?: ReactNode;
343
+ isSubmitting?: boolean;
344
+ submitDisabled?: boolean;
345
+ /** `submit` (default) submits the enclosing form; `button` calls `onSubmit`. */
346
+ submitType?: "submit" | "button";
347
+ onSubmit?: () => void;
348
+ variant?: "primary" | "danger";
349
+ }
350
+ /** Cancel + submit row used at the bottom of every modal form. */
351
+ declare function ModalActions({ onCancel, submitLabel, cancelLabel, isSubmitting, submitDisabled, submitType, onSubmit, variant, }: ModalActionsProps): react.JSX.Element;
352
+
353
+ interface PageHeaderProps {
354
+ title: ReactNode;
355
+ icon?: IconComponent;
356
+ description?: ReactNode;
357
+ /** Small kicker above the title. */
358
+ eyebrow?: ReactNode;
359
+ /** Right side: buttons, status badge. */
360
+ actions?: ReactNode;
361
+ /** Bottom border separating the header from the page. */
362
+ bordered?: boolean;
363
+ className?: string;
364
+ }
365
+ /** Page title block (`h1`), from the backoffice typography scale. */
366
+ declare function PageHeader({ title, icon: Icon, description, eyebrow, actions, bordered, className, }: PageHeaderProps): react.JSX.Element;
367
+
368
+ interface PaginationProps {
369
+ page: number;
370
+ totalPages: number;
371
+ onPageChange: (page: number) => void;
372
+ className?: string;
373
+ }
374
+ /**
375
+ * Prev/Next pager with a "Page X of Y" label — for any list/table split
376
+ * across pages. Renders nothing when there's only one page.
377
+ */
378
+ declare function Pagination({ page, totalPages, onPageChange, className, }: PaginationProps): react.JSX.Element | null;
379
+
380
+ interface RemoteImageProps extends ImgHTMLAttributes<HTMLImageElement> {
381
+ src: string;
382
+ }
383
+ /** Image served by a mini-app backend or the bucket, with an error placeholder. */
384
+ declare function RemoteImage({ src, alt, className, ...props }: RemoteImageProps): react.JSX.Element;
385
+
386
+ interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value"> {
387
+ value: string;
388
+ onChange: (value: string) => void;
389
+ }
390
+ /** Text input with a search icon and a clear button. */
391
+ declare const SearchInput: react.ForwardRefExoticComponent<SearchInputProps & react.RefAttributes<HTMLInputElement>>;
392
+
393
+ interface SectionHeaderProps {
394
+ title: ReactNode;
395
+ icon?: IconComponent;
396
+ description?: ReactNode;
397
+ actions?: ReactNode;
398
+ /** `section`: `h2` heading. `label`: small uppercase group label above a list or table. */
399
+ variant?: "section" | "label";
400
+ className?: string;
401
+ }
402
+ /** Heading of a page section, with optional actions on the right. */
403
+ declare function SectionHeader({ title, icon: Icon, description, actions, variant, className, }: SectionHeaderProps): react.JSX.Element;
404
+
405
+ interface SelectOption {
406
+ value: string;
407
+ label: string;
408
+ disabled?: boolean;
409
+ }
410
+ interface SelectProps {
411
+ value: string;
412
+ onChange: (value: string) => void;
413
+ options: SelectOption[];
414
+ placeholder?: string;
415
+ disabled?: boolean;
416
+ className?: string;
417
+ id?: string;
418
+ }
419
+ /**
420
+ * Hand-rolled replacement for a native `<select>`. The menu is always
421
+ * anchored below the trigger (`top-full`) — a native select's open
422
+ * direction is decided by the browser based on viewport space and can
423
+ * flip upward with no way to override it from CSS/JS, which this avoids.
424
+ * The menu always includes a search field that filters `options` by
425
+ * label, focused automatically on open.
426
+ */
427
+ declare function Select({ value, onChange, options, placeholder, disabled, className, id, }: SelectProps): react.JSX.Element;
428
+
429
+ interface StatTileProps {
430
+ icon: IconComponent;
431
+ label: string;
432
+ value: ReactNode;
433
+ /** Optional line under the value (trend, unit...). */
434
+ hint?: ReactNode;
435
+ /** Makes the tile a button (e.g. a tab selector). */
436
+ onClick?: () => void;
437
+ active?: boolean;
438
+ className?: string;
439
+ }
440
+ /** KPI tile: icon, label and a big value. */
441
+ declare function StatTile({ icon: Icon, label, value, hint, onClick, active, className, }: StatTileProps): react.JSX.Element;
442
+
443
+ interface SwitchProps {
444
+ checked: boolean;
445
+ onChange: (checked: boolean) => void;
446
+ /** Accessible name. */
447
+ label: string;
448
+ disabled?: boolean;
449
+ tone?: "primary" | "success" | "error";
450
+ id?: string;
451
+ }
452
+ /** On/off toggle (`role="switch"`). */
453
+ declare function Switch({ checked, onChange, label, disabled, tone, id, }: SwitchProps): react.JSX.Element;
454
+ interface SettingRowProps {
455
+ label: string;
456
+ description?: string;
457
+ /** Control on the right, usually a `Switch`. */
458
+ control: ReactNode;
459
+ className?: string;
460
+ }
461
+ /** Bordered row: label + description on the left, a control on the right. */
462
+ declare function SettingRow({ label, description, control, className, }: SettingRowProps): react.JSX.Element;
463
+
464
+ type Align = "left" | "center" | "right";
465
+ /** Card around a table; scrolls horizontally on narrow screens instead of clipping columns. */
466
+ declare function TableContainer({ className, ...props }: HTMLAttributes<HTMLDivElement>): react.JSX.Element;
467
+ declare function Table({ className, ...props }: HTMLAttributes<HTMLTableElement>): react.JSX.Element;
468
+ declare function TableHead({ className, ...props }: HTMLAttributes<HTMLTableSectionElement>): react.JSX.Element;
469
+ declare function TableBody({ className, ...props }: HTMLAttributes<HTMLTableSectionElement>): react.JSX.Element;
470
+ interface TableHeaderCellProps extends ThHTMLAttributes<HTMLTableCellElement> {
471
+ align?: Align;
472
+ }
473
+ declare function TableHeaderCell({ align, className, ...props }: TableHeaderCellProps): react.JSX.Element;
474
+ declare function TableRow({ className, ...props }: HTMLAttributes<HTMLTableRowElement>): react.JSX.Element;
475
+ interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
476
+ align?: Align;
477
+ }
478
+ declare function TableCell({ align, className, ...props }: TableCellProps): react.JSX.Element;
479
+ interface TableEmptyProps {
480
+ colSpan: number;
481
+ icon: IconComponent;
482
+ title: string;
483
+ description?: string;
484
+ action?: ReactNode;
485
+ }
486
+ /** Full-width empty row rendering the shared `EmptyState`. */
487
+ declare function TableEmpty({ colSpan, icon, title, description, action, }: TableEmptyProps): react.JSX.Element;
488
+
489
+ interface TabItem<T extends string> {
490
+ value: T;
491
+ label: string;
492
+ icon?: IconComponent;
493
+ /** Optional count shown next to the label. */
494
+ count?: number;
495
+ }
496
+ interface TabsProps<T extends string> {
497
+ items: TabItem<T>[];
498
+ value: T;
499
+ onChange: (value: T) => void;
500
+ /** `underline`: page/section tabs. `pills`: compact segmented control. */
501
+ variant?: "underline" | "pills";
502
+ /**
503
+ * Id prefix of the panels: tab `x` has id `${panelIdPrefix}-tab-x` and controls the
504
+ * element with id `${panelIdPrefix}-x` (give the active panel `role="tabpanel"`,
505
+ * that id and `aria-labelledby="${panelIdPrefix}-tab-x"`).
506
+ */
507
+ panelIdPrefix?: string;
508
+ /** Accessible name of the tab list. */
509
+ label?: string;
510
+ className?: string;
511
+ }
512
+ /**
513
+ * Tab strip (`role="tablist"`, roving tabindex, Arrow/Home/End keys); the caller
514
+ * renders the active panel.
515
+ */
516
+ declare function Tabs<T extends string>({ items, value, onChange, variant, panelIdPrefix, label, className, }: TabsProps<T>): react.JSX.Element;
517
+
518
+ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
519
+ label?: string;
520
+ error?: string;
521
+ }
522
+ /** Multi-line text field matching `Input`. */
523
+ declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
524
+
525
+ interface ModalLockOptions {
526
+ /** Called on Escape when this is the topmost modal (not when a nested `Select` consumed it). */
527
+ onEscape?: () => void;
528
+ }
529
+ /**
530
+ * Locks background page scroll and traps Tab focus within the returned
531
+ * ref's element for as long as the calling component is mounted — every
532
+ * modal is only ever mounted while open (conditionally rendered by its
533
+ * parent), so lock/trap for the component's whole lifetime is equivalent
534
+ * to locking only "while open". Restores the previous body overflow and
535
+ * refocuses whatever had focus before the modal opened on unmount.
536
+ *
537
+ * Nested modals stack: only the topmost lock traps Tab and handles Escape.
538
+ * Initial focus goes to the first field of `[data-modal-body]` when there is
539
+ * one (not the header's close button), else to the first focusable element.
540
+ *
541
+ * Returns a callback ref (not a plain useRef) so initial focus fires
542
+ * exactly when the container DOM node attaches.
543
+ */
544
+ declare function useModalLock<T extends HTMLElement>(options?: ModalLockOptions): (node: T | null) => void;
545
+
546
+ /** Merges conditional class names and resolves conflicting Tailwind utilities. */
547
+ declare function cn(...inputs: ClassValue[]): string;
548
+
549
+ declare const WEBP_ERROR_MESSAGE = "Only .webp images are allowed. Please select a WebP image.";
550
+ /** True when the file is a WebP image (by MIME type or extension). */
551
+ declare function isWebp(file: File): boolean;
552
+ /** Backoffice image policy: every uploaded image is WebP. Throws otherwise. */
553
+ declare function assertWebp(file: File): void;
554
+ declare const WEBP_OR_SVG_ERROR_MESSAGE = "Only .webp or .svg images are allowed. Please select a WebP or SVG image.";
555
+ /** True when the file is an SVG image (by MIME type or extension). */
556
+ declare function isSvg(file: File): boolean;
557
+
558
+ declare const encodeBase64: (str: string) => string;
559
+ declare const decodeBase64: (str?: string) => string;
560
+ declare function parseMarkdown(md: string): string;
561
+ declare function stripMarkdown(md?: string): string;
562
+ declare function insertMarkdown(textarea: HTMLTextAreaElement | null, syntax: string, setValue: (value: string) => void, placeholder?: string): void;
563
+
564
+ export { ApiError, AuthStatusBadge, type AuthStatusBadgeProps, BackofficePluginDefinition, BackofficePluginModule, Badge, type BadgeProps, type BadgeVariant, Banner, type BannerProps, type BannerVariant, Button, type ButtonProps, Card, type CardProps, ConfirmModal, type ConfirmModalProps, CopyableUuid, type CopyableUuidProps, DangerZone, type DangerZoneDelete, type DangerZoneProps, EmptyState, type EmptyStateProps, FieldLabel, type FieldLabelProps, GraphQLPlayground, type GraphQLPlaygroundProps, HttpClient, IconButton, type IconButtonProps, IconComponent, ImageUpload, type ImageUploadProps, Input, type InputProps, LoadMoreButton, type LoadMoreButtonProps, LoadingState, type LoadingStateProps, MarkdownEditor, type MarkdownEditorProps, Modal, ModalActions, type ModalActionsProps, type ModalProps, type ModalSize, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, PluginHost, type QueryPreset, RemoteImage, type RemoteImageProps, RowActions, type RowActionsProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, Select, type SelectOption, type SelectProps, SettingRow, type SettingRowProps, StatTile, type StatTileProps, Switch, type SwitchProps, type TabItem, Table, TableBody, TableCell, type TableCellProps, TableContainer, TableEmpty, type TableEmptyProps, TableHead, TableHeaderCell, type TableHeaderCellProps, TableRow, Tabs, type TabsProps, Textarea, type TextareaProps, type UseDangerZoneDeleteOptions, WEBP_ERROR_MESSAGE, WEBP_OR_SVG_ERROR_MESSAGE, assertWebp, cn, decodeBase64, definePlugin, encodeBase64, getScopeToken, hubApi, insertMarkdown, isApiError, isSvg, isWebp, miniappApi, parseMarkdown, stripMarkdown, useCopyToClipboard, useDangerZoneDelete, useModalLock, usePluginHost };